dev-process-kit 0.0.2-beta.1 → 0.0.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 (36) hide show
  1. package/README.md +22 -9
  2. package/dist/chunks/shared-B2K3LoOU.js +1016 -0
  3. package/dist/chunks/shared-BqW3KAJ4.js +613 -0
  4. package/dist/chunks/shared-Byv6cc0r.js +2779 -0
  5. package/dist/chunks/{shared-CmM4cgd6.js → shared-CKG_SQh5.js} +1 -1
  6. package/dist/chunks/shared-CPAT0Cgk.js +29 -0
  7. package/dist/chunks/shared-CwbzACTe.js +1874 -0
  8. package/dist/chunks/shared-DBDgdVsd.js +1 -0
  9. package/dist/chunks/shared-DMlMTd3c.js +1018 -0
  10. package/dist/chunks/shared-DaoPCw6-.js +556 -0
  11. package/dist/chunks/shared-DqB_TR20.js +1599 -0
  12. package/dist/chunks/shared-DsVxrO_3.js +609 -0
  13. package/dist/chunks/shared-iQIywbRc.js +676 -0
  14. package/dist/chunks/shared-xrCdgpNS.js +1 -0
  15. package/dist/components.js +1 -1
  16. package/dist/index.js +1 -1
  17. package/dist/templates/event-storming.js +1 -1
  18. package/dist/templates/example-mapping.js +1 -1
  19. package/dist/templates/grill.js +1 -1
  20. package/dist/templates/plain.js +1 -1
  21. package/dist/templates/prototype.js +1 -1
  22. package/dist/templates/slides.js +1 -0
  23. package/dist/templates/task-board.js +1 -0
  24. package/dist/templates/usm.js +1 -1
  25. package/package.json +4 -2
  26. package/dist/chunks/shared-5C6fORCL.js +0 -1404
  27. package/dist/chunks/shared-B1lFGiYZ.js +0 -1
  28. package/dist/chunks/shared-BEjjbZ0X.js +0 -2543
  29. package/dist/chunks/shared-BFAVBf4I.js +0 -1
  30. package/dist/chunks/shared-BybvAQye.js +0 -579
  31. package/dist/chunks/shared-DKxAm7wL.js +0 -27
  32. package/dist/chunks/shared-DgusMFKr.js +0 -1
  33. package/dist/chunks/shared-Dx0MEuAf.js +0 -921
  34. package/dist/chunks/shared-RclF4vSf.js +0 -692
  35. package/dist/chunks/shared-ao1beBgL.js +0 -544
  36. package/dist/chunks/shared-eiZoh1aF.js +0 -521
@@ -0,0 +1,1018 @@
1
+ import{q as be,ai as I,aa as g,af as h,ag as b,ad as p,ak as v,ab as u,al as fe,ac as $,a9 as ke,R as L,_ as ve,V as xe,a2 as s,a3 as F,a1 as d,ay as O,a0 as me,T as P,az as we,aA as ye}from"./shared-CwbzACTe.js";import{c as N}from"./shared-ml5h7U5L.js";const $e=(t,e,r)=>r.top<e.top?t+r.top-e.top:r.bottom<=e.bottom?t:t+Math.min(r.bottom-e.bottom,r.top-e.top),Te=(t,e)=>{const i=t.getBoundingClientRect().top+t.clientTop;t.scrollTop=$e(t.scrollTop,{top:i,bottom:i+t.clientHeight},e.getBoundingClientRect())},Se=I("kind",[g({kind:v("option"),optionId:h(p(),b(1))}),g({kind:v("free"),text:p()}),g({kind:v("clear")})]),T={ANSWER_QUESTION:be("ANSWER_QUESTION","question",Se)},G=(t,e)=>({type:"ANSWER_QUESTION",target:{type:"question",id:t},payload:e}),Re=g({id:h(p(),b(1)),label:h(p(),b(1))}),B=g({id:h(p(),b(1)),ref:u(h(p(),b(1))),title:h(p(),b(1)),description:u(p()),note:u(p()),options:u($(Re),[]),freeText:u(fe(),!0)}),Ce=I("kind",[g({kind:v("option"),optionId:h(p(),b(1))}),g({kind:v("free"),text:p()})]),Ae=g({...B.entries,answer:u(Ce)}),qe=g({label:u(h(p(),b(1))),questions:$(Ae)}),_=g({title:u(p(),""),questions:$(B),history:u($(qe),[])}),M=t=>{const e=new Set;return t.map((r,i)=>{if(e.has(r.id))throw new Error(`duplicate question id: ${r.id}`);e.add(r.id);const n=new Set;for(const a of r.options){if(n.has(a.id))throw new Error(`duplicate option id: ${a.id} in question ${r.id}`);n.add(a.id)}return{...r,ref:r.ref??`Q${i+1}`,description:r.description??null,note:r.note??null}})},U=t=>({id:t.id,ref:t.ref,title:t.title,description:t.description,note:t.note,options:t.options,freeText:t.freeText}),Ee=t=>{const e=t.answer??null;if(e?.kind==="option"&&!t.options.some(r=>r.id===e.optionId))throw new Error(`unknown option id: ${e.optionId} in question ${t.id}`);return{...U(t),answer:e}},H=t=>{const e=ke(_,t);return{title:e.title,questions:M(e.questions).map(U),answers:{},pastRounds:e.history.map((r,i)=>({label:r.label??`v${i+1}`,questions:M(r.questions).map(Ee)}))}},W=()=>({title:"",questions:[],answers:{},pastRounds:[]}),f=(t,e)=>t.questions.find(r=>r.id===e),Qe=(t,e)=>f(t,e)?.ref??e,q=(t,e)=>{const r=f(t,e);return r?`${r.ref} \xB7 ${r.title}`:e},x=(t,e)=>e?e.kind==="option"?t.options.find(r=>r.id===e.optionId)?.label??"":e.text.trim():"",S=(t,e)=>x(t,e)!=="",j=t=>{let e="";for(let r=t+1;r>0;r=Math.floor((r-1)/26))e=String.fromCharCode(97+(r-1)%26)+e;return e},D=t=>({total:t.questions.length,answered:t.questions.filter(e=>S(e,t.answers[e.id])).length}),R=(t,e,r)=>{const i=t.answers[e];if(r===null){if(i===void 0)return t;const n={...t.answers};return delete n[e],{...t,answers:n}}return i?.kind===r.kind&&(i.kind==="option"&&r.kind==="option"&&i.optionId===r.optionId||i.kind==="free"&&r.kind==="free"&&i.text===r.text)?t:{...t,answers:{...t.answers,[e]:r}}},Y=(t,e)=>{if(e.type!=="ANSWER_QUESTION")return null;const r=f(t,e.target.id);if(!r)return null;const i=L(T.ANSWER_QUESTION,e);return i.kind==="clear"?R(t,r.id,null):i.kind==="option"?r.options.some(n=>n.id===i.optionId)?R(t,r.id,{kind:"option",optionId:i.optionId}):null:R(t,r.id,{kind:"free",text:i.text})},m=ve({en:{wholePage:"Whole page",questionGroup:"Question",answerCleared:"Clear answer",answered:"Answer",answeredFreely:"Answer in your own words",quoted:t=>`\u2192 \u201C${t}\u201D`,progress:(t,e)=>`${t} of ${e} answered`,openPanel:"Show questions / review",closePanel:"Hide questions / review",toggleLabel:(t,e)=>`${t} (${e})`,tabs:"Questions / review",questionsTab:"Questions",reviewTab:"Review",copied:"Copied",copyFailed:"Could not copy",copyAll:"Copy answers and review",sending:"Sending\u2026",sent:"Sent to Claude",sendFailed:"Could not send",sendAll:"Send answers and review to Claude",copyDone:"Copied",copy:"Copy",noQuestions:"No matching questions.",freeText:"Your own answer",freeTextOf:t=>`Your own answer to ${t}`,freeTextPlaceholder:"Type an answer\u2026 (\u2318/Ctrl+Enter for next)",clearAnswer:"Clear answer",roundSelect:"Question round",currentRound:"Current questions",roundOption:(t,e)=>`${t} (${e})`,pastRound:t=>`${t}: earlier questions, read-only`,unanswered:"Not answered"},ja:{wholePage:"\u30DA\u30FC\u30B8\u5168\u4F53",questionGroup:"\u8CEA\u554F",answerCleared:"\u56DE\u7B54\u3092\u30AF\u30EA\u30A2",answered:"\u56DE\u7B54",answeredFreely:"\u81EA\u7531\u8A18\u8FF0\u3067\u56DE\u7B54",quoted:t=>`\u2192 \u300C${t}\u300D`,progress:(t,e)=>`\u56DE\u7B54\u6E08\u307F ${t} / ${e}`,openPanel:"\u8CEA\u554F / Review \u3092\u3072\u3089\u304F",closePanel:"\u8CEA\u554F / Review \u3092\u305F\u305F\u3080",toggleLabel:(t,e)=>`${t}\uFF08${e}\uFF09`,tabs:"\u8CEA\u554F / Review",questionsTab:"\u8CEA\u554F",reviewTab:"Review",copied:"\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F",copyFailed:"\u30B3\u30D4\u30FC\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F",copyAll:"\u56DE\u7B54\u30FBReview \u3092\u307E\u3068\u3081\u3066\u30B3\u30D4\u30FC",sending:"\u9001\u4FE1\u4E2D\u2026",sent:"Claude \u306B\u9001\u308A\u307E\u3057\u305F",sendFailed:"\u9001\u308C\u307E\u305B\u3093\u3067\u3057\u305F",sendAll:"\u56DE\u7B54\u30FBReview \u3092 Claude \u306B\u9001\u308B",copyDone:"\u30B3\u30D4\u30FC\u6E08\u307F",copy:"\u30B3\u30D4\u30FC",noQuestions:"\u8A72\u5F53\u3059\u308B\u8CEA\u554F\u306F\u3042\u308A\u307E\u305B\u3093\u3002",freeText:"\u81EA\u7531\u8A18\u8FF0",freeTextOf:t=>`${t} \u306E\u81EA\u7531\u8A18\u8FF0`,freeTextPlaceholder:"\u56DE\u7B54\u3092\u5165\u529B\u2026\uFF08\u2318/Ctrl+Enter \u3067\u6B21\u3078\uFF09",clearAnswer:"\u56DE\u7B54\u3092\u30AF\u30EA\u30A2",roundSelect:"\u8CEA\u554F\u306E\u30E9\u30A6\u30F3\u30C9",currentRound:"\u73FE\u5728\u306E\u8CEA\u554F",roundOption:(t,e)=>`${t}\uFF08${e} \u554F\uFF09`,pastRound:t=>`${t}: \u904E\u53BB\u306E\u8CEA\u554F\uFF08\u95B2\u89A7\u306E\u307F\uFF09`,unanswered:"\u672A\u56DE\u7B54"}}),V=t=>t.title===""?"Visually Grill":t.title,K=(t,e,r)=>{switch(r.type){case"question":return q(e,r.id);case"page":return t.wholePage;default:return r.id}},ze=(t,e,r)=>{const i=L(T.ANSWER_QUESTION,r);if(i.kind==="clear")return{title:t.answerCleared,tone:"delete"};if(i.kind==="option"){const n=f(e,r.target.id)?.options.find(a=>a.id===i.optionId);return{title:t.answered,tone:"update",body:t.quoted(n?.label??i.optionId)}}return{title:t.answeredFreely,tone:"update",body:t.quoted(i.text.slice(0,120))}},J=(t,e,r,i)=>{let n;try{n=ze(t,i??r,e)}catch{n={title:e.type,tone:"meta"}}return{title:n.title,targetLabel:K(t,r,e.target),tone:n.tone,...n.body===void 0?{}:{summary:n.body}}},X=t=>`${t.type} ${xe(t.target)} ${JSON.stringify(t.payload)}`,Z=(t,e)=>e.questions.map(r=>({value:`question:${r.id}`,label:q(e,r.id),group:t.questionGroup})),ee=(t,e)=>{const r=e.question;if(r!==void 0&&f(t,r))return e;const i=t.questions[0];return i===void 0?e:{...e,question:i.id}},te=(t,e)=>{const r=e.question;return r!==void 0&&f(t,r)?r:t.questions[0]?.id??null},Ie=(t,e)=>{const r=t.questions,i=r.findIndex(a=>a.id===e);return(i===-1?r:[...r.slice(i+1),...r.slice(0,i)]).find(a=>!S(a,t.answers[a.id]))?.id??null},re=(t,e)=>t.options.map((r,i)=>({id:r.id,letter:j(i),label:r.label,checked:e?.kind==="option"&&e.optionId===r.id})),Le=(t,e,r)=>{const i=e.answers[t.id];return{id:t.id,ref:t.ref,title:t.title,description:t.description,note:t.note,open:t.id===r,answered:x(t,i)!=="",summary:x(t,i),choices:re(t,i),draft:i?.kind==="free"?i.text:"",freeSelected:i?.kind==="free",allowFreeText:t.freeText}},ie=(t,e)=>{const r=te(t,e);return{questions:t.questions.map(i=>Le(i,t,r))}},ne=(t,e)=>{const r=D(e);return{progress:t.progress(r.answered,r.total),answered:r.answered,total:r.total}},ae=(t,e)=>e!=="current"&&t.pastRounds[e]!==void 0?e:"current",Fe=(t,e,r)=>{if(e.pastRounds.length===0)return[];const i=ae(e,r),n=e.pastRounds.map((a,o)=>({value:String(o),label:t.roundOption(a.label,a.questions.length),selected:i===o}));return[{value:"current",label:t.roundOption(t.currentRound,e.questions.length),selected:i==="current"},...[...n].reverse()]},Oe=(t,e,r)=>{const i=e.pastRounds[r];return i===void 0?null:{label:i.label,questions:i.questions.map(n=>{const a=n.answer??void 0,o=x(n,a);return{id:n.id,ref:n.ref,title:n.title,description:n.description,note:n.note,answered:o!=="",summary:o===""?t.unanswered:o,choices:re(n,a),freeText:a?.kind==="free"?a.text:null}})}},oe=(t,e)=>{switch(e.type){case"question":return f(t,e.id)!==void 0;case"page":return!0;default:return!1}},se=t=>{const e=m(t);return{name:"grill",label:"Visually Grill",parseBase:H,emptyBase:W,actions:T,apply:Y,hasTarget:oe,describe:(r,i,n)=>J(e,r,i,n),serialize:X,resolveNavigation:ee,commentTargets:r=>Z(e,r),title:V}},w="data-grill-questions",Pe=t=>{const e=[t];for(const r of t.querySelectorAll("*"))r.shadowRoot&&e.push(r.shadowRoot);return e},le=(t,e,r)=>{const i=r.question??e.questions[0]?.id??null,n=new Map(e.questions.map(o=>[o.ref,o])),a=[];for(const o of Pe(t))for(const l of o.querySelectorAll(`[${w}]`)){const k=l.getAttribute(w)??"";for(const C of k.split(/\s+/)){if(C==="")continue;const c=n.get(C);c&&a.push({index:a.length,target:l,questionId:c.id,ref:c.ref,title:c.title,answered:S(c,e.answers[c.id]),open:c.id===i})}}return a},de=(t,e)=>{const r=t.getBoundingClientRect(),i=new Map;e.forEach((a,o)=>{const l=t.querySelector(`[data-label="${o}"]`);if(!l)return;const k=i.get(a.target)??[];k.push(l),i.set(a.target,k)});const n=new Map;for(const[a,o]of i){const l=a.getBoundingClientRect(),k=l.width>0||l.height>0,c=n.get(a)??Ne(a,t);n.set(a,c);const E=l.bottom>r.top&&l.top<r.bottom&&l.right>r.left&&l.left<r.right,Q=l.bottom>c.top&&l.top<c.bottom;o.forEach((y,ge)=>{if(y.dataset.visible=String(k&&E&&Q),!k||!E||!Q)return;const A=y.offsetWidth,z=y.offsetHeight,ue=l.right-r.left-A+8-(o.length-1-ge)*(A+5),he=l.top-r.top-z/2;y.style.transform=`translate(${N(ue,0,Math.max(0,t.clientWidth-A))}px, ${N(he,0,Math.max(0,t.clientHeight-z))}px)`})}},Ne=(t,e)=>{const r=t.getRootNode(),i=r instanceof ShadowRoot?r.host:null,n=i?.shadowRoot?.querySelector(".diagram-canvas")??null;return n instanceof Element?n.getBoundingClientRect():i instanceof Element?i.getBoundingClientRect():e.getBoundingClientRect()},Ge=(t,e,r)=>s`
2
+ <div class="grill-list">
3
+ ${e.questions.length===0?s`<p class="grill-empty">${t.noQuestions}</p>`:F(e.questions,i=>i.id,i=>Be(t,i,r))}
4
+ </div>
5
+ `,Be=(t,e,r)=>s`
6
+ <section class="grill-question" data-question=${e.id} data-answered=${String(e.answered)}>
7
+ <button
8
+ class="grill-heading"
9
+ type="button"
10
+ aria-expanded=${e.open?"true":"false"}
11
+ aria-controls=${`grill-body-${e.id}`}
12
+ @click=${()=>r.open(e.id)}
13
+ >
14
+ <span class="grill-ref">${e.ref}</span>
15
+ <span class="grill-heading-text">
16
+ <strong>${e.title}</strong>
17
+ ${!e.open&&e.answered?s`<span class="grill-summary">${e.summary}</span>`:d}
18
+ </span>
19
+ <span class="grill-chevron" aria-hidden="true">${O()}</span>
20
+ </button>
21
+ ${e.open?s`<div class="grill-body" id=${`grill-body-${e.id}`}>
22
+ ${e.description?s`<p class="grill-description">${e.description}</p>`:d}
23
+ ${e.note?s`<p class="grill-note">${e.note}</p>`:d}
24
+ <div class="grill-choices" role="radiogroup" aria-label=${e.title}>
25
+ ${e.choices.map(i=>_e(e.id,i,r))}
26
+ ${e.allowFreeText?s`<label class="grill-choice grill-choice--free" data-free=${String(e.freeSelected)}>
27
+ <input
28
+ type="radio"
29
+ name=${`grill-${e.id}`}
30
+ value="__free"
31
+ .checked=${e.freeSelected}
32
+ @change=${()=>r.answer(e.id,{kind:"free",text:""})}
33
+ />
34
+ <span class="grill-choice-text">${t.freeText}</span>
35
+ </label>`:d}
36
+ </div>
37
+ ${e.allowFreeText?s`<textarea
38
+ class="dpk-textarea grill-free"
39
+ data-free-text=${e.id}
40
+ aria-label=${t.freeTextOf(e.ref)}
41
+ placeholder=${t.freeTextPlaceholder}
42
+ .value=${e.draft}
43
+ ?hidden=${!e.freeSelected}
44
+ @input=${i=>{const n=i.currentTarget;n instanceof HTMLTextAreaElement&&r.answer(e.id,{kind:"free",text:n.value})}}
45
+ @keydown=${i=>{i.isComposing||!(i.metaKey||i.ctrlKey)||i.key!=="Enter"||(i.preventDefault(),r.next(e.id))}}
46
+ ></textarea>`:d}
47
+ ${e.answered?s`<button
48
+ type="button"
49
+ class="grill-clear"
50
+ @click=${()=>r.answer(e.id,{kind:"clear"})}
51
+ >
52
+ ${t.clearAnswer}
53
+ </button>`:d}
54
+ </div>`:d}
55
+ </section>
56
+ `,_e=(t,e,r)=>s`
57
+ <label class="grill-choice" data-choice=${e.id}>
58
+ <input
59
+ type="radio"
60
+ name=${`grill-${t}`}
61
+ value=${e.id}
62
+ .checked=${e.checked}
63
+ @change=${()=>r.answer(t,{kind:"option",optionId:e.id})}
64
+ />
65
+ <span class="grill-choice-text">
66
+ <span class="grill-letter">(${e.letter})</span>
67
+ <span>${e.label}</span>
68
+ </span>
69
+ </label>
70
+ `,Me=(t,e)=>s`
71
+ <div class="grill-list">
72
+ <p class="grill-round-note">${t.pastRound(e.label)}</p>
73
+ ${e.questions.length===0?s`<p class="grill-empty">${t.noQuestions}</p>`:F(e.questions,r=>r.id,r=>Ue(r))}
74
+ </div>
75
+ `,Ue=t=>s`
76
+ <details
77
+ class="grill-question grill-question--past"
78
+ data-question=${t.id}
79
+ data-answered=${String(t.answered)}
80
+ >
81
+ <summary class="grill-heading">
82
+ <span class="grill-ref">${t.ref}</span>
83
+ <span class="grill-heading-text">
84
+ <strong>${t.title}</strong>
85
+ <span class="grill-summary">${t.summary}</span>
86
+ </span>
87
+ <span class="grill-chevron" aria-hidden="true">${O()}</span>
88
+ </summary>
89
+ <div class="grill-body">
90
+ ${t.description?s`<p class="grill-description">${t.description}</p>`:d}
91
+ ${t.note?s`<p class="grill-note">${t.note}</p>`:d}
92
+ ${t.choices.length===0?d:s`<ul class="grill-past-choices">
93
+ ${t.choices.map(e=>s`<li class="grill-past-choice" data-checked=${String(e.checked)}>
94
+ <span class="grill-letter">(${e.letter})</span>
95
+ <span>${e.label}</span>
96
+ </li>`)}
97
+ </ul>`}
98
+ ${t.freeText===null?d:s`<p class="grill-past-choice grill-past-free" data-checked="true">${t.freeText}</p>`}
99
+ </div>
100
+ </details>
101
+ `,He=me`
102
+ /*
103
+ * The rail and its hand-off only work inside a bounded shell. A page that gives
104
+ * the host no height (no \`height: 100%\` up the chain) would grow the shell to
105
+ * its content and scroll the whole document, carrying the rail and the copy
106
+ * button off screen; the viewport height is the fallback. A host with a height
107
+ * still wins: the shell's own min/max-height pin it to that.
108
+ */
109
+ .dpk-shell {
110
+ height: 100dvh;
111
+ }
112
+
113
+ .dpk-main {
114
+ order: 1;
115
+ }
116
+
117
+ /* The shell's sidebar becomes a right-hand rail, keeping its width and scroll. */
118
+ .dpk-sidebar {
119
+ order: 2;
120
+ width: 336px;
121
+ display: flex;
122
+ flex-direction: column;
123
+ gap: 0;
124
+ padding: 0;
125
+ border-right: 0;
126
+ border-left: 1px solid var(--dpk-rule);
127
+ }
128
+
129
+ /* The header reserves room for the corner button, exactly like the review
130
+ button in the other templates. */
131
+ .grill-panel {
132
+ display: flex;
133
+ flex-direction: column;
134
+ flex: 1;
135
+ min-height: 0;
136
+ }
137
+
138
+ .grill-tab-panel {
139
+ display: flex;
140
+ flex-direction: column;
141
+ flex: 1;
142
+ min-height: 0;
143
+ overflow: auto;
144
+ }
145
+
146
+ .grill-tab-panel[hidden],
147
+ .dpk-sidebar[hidden] {
148
+ display: none;
149
+ }
150
+
151
+ .grill-tab-panel dpk-component-comment-panel {
152
+ flex: 1;
153
+ }
154
+
155
+ /* ------------------------------------------------------- header control */
156
+
157
+ /*
158
+ * The one control the reader always needs: the questions. It sits where the
159
+ * other templates put their review button, and folds the question column away
160
+ * so the diagrams get the width back.
161
+ */
162
+ .grill-toggle {
163
+ position: fixed;
164
+ top: 10px;
165
+ right: 16px;
166
+ z-index: 60;
167
+ display: inline-flex;
168
+ align-items: center;
169
+ justify-content: center;
170
+ width: 38px;
171
+ height: 38px;
172
+ padding: 0;
173
+ border: 1px solid var(--dpk-rule-strong);
174
+ border-radius: 999px;
175
+ background: var(--dpk-glass);
176
+ backdrop-filter: blur(12px);
177
+ color: var(--dpk-ink-soft);
178
+ font-size: 16.5px;
179
+ font-weight: 650;
180
+ line-height: 1;
181
+ box-shadow: var(--dpk-bevel), var(--dpk-shadow);
182
+ cursor: pointer;
183
+ transition:
184
+ color 160ms var(--dpk-ease),
185
+ background 160ms var(--dpk-ease),
186
+ border-color 160ms var(--dpk-ease),
187
+ box-shadow 160ms var(--dpk-ease),
188
+ transform 160ms var(--dpk-ease-spring);
189
+ }
190
+
191
+ .grill-toggle:hover {
192
+ color: var(--dpk-ink);
193
+ transform: translateY(-2px) scale(1.05);
194
+ box-shadow: var(--dpk-bevel), var(--dpk-shadow-lg);
195
+ }
196
+
197
+ .grill-toggle:active {
198
+ transform: translateY(0) scale(0.97);
199
+ box-shadow: var(--dpk-shadow-xs);
200
+ }
201
+
202
+ .grill-toggle:focus-visible {
203
+ outline: none;
204
+ box-shadow: var(--dpk-focus);
205
+ }
206
+
207
+ .grill-toggle[aria-expanded='true'] {
208
+ color: var(--dpk-accent-ink);
209
+ border-color: transparent;
210
+ background: linear-gradient(135deg, var(--dpk-accent-bright), var(--dpk-accent-strong));
211
+ box-shadow:
212
+ inset 0 1px 0 rgba(255, 255, 255, 0.24),
213
+ 0 2px 8px color-mix(in srgb, var(--dpk-accent) 40%, transparent);
214
+ }
215
+
216
+ .grill-toggle-glyph {
217
+ display: block;
218
+ }
219
+
220
+ .grill-toggle-badge {
221
+ position: absolute;
222
+ top: -5px;
223
+ right: -5px;
224
+ min-width: 22px;
225
+ height: 18px;
226
+ padding: 0 5px;
227
+ border: 2px solid var(--dpk-paper-raised);
228
+ border-radius: 999px;
229
+ background: linear-gradient(180deg, var(--dpk-paper-raised), var(--dpk-paper-inset));
230
+ color: var(--dpk-ink-soft);
231
+ font-family: var(--dpk-mono);
232
+ font-size: 9px;
233
+ font-weight: 650;
234
+ font-variant-numeric: tabular-nums;
235
+ line-height: 14px;
236
+ /* The widest value is wider than the button it sits on: keep it on one line. */
237
+ white-space: nowrap;
238
+ text-align: center;
239
+ box-shadow: var(--dpk-bevel), var(--dpk-shadow-xs);
240
+ }
241
+
242
+ .grill-toggle[aria-expanded='true'] .grill-toggle-badge {
243
+ background: var(--dpk-paper-raised);
244
+ color: var(--dpk-accent);
245
+ }
246
+
247
+ /* ------------------------------------------------------------- the list */
248
+
249
+ /* A segmented control: a sunken track with the active tab raised out of it. */
250
+ .grill-tabs {
251
+ display: flex;
252
+ align-items: center;
253
+ gap: 3px;
254
+ flex-shrink: 0;
255
+ margin: 10px;
256
+ padding: 3px;
257
+ border: 1px solid var(--dpk-rule);
258
+ border-radius: var(--dpk-radius);
259
+ background: var(--dpk-paper-sunken);
260
+ box-shadow: inset 0 1px 2px var(--dpk-shade-1);
261
+ }
262
+
263
+ .grill-tabs button {
264
+ flex: 1 1 0;
265
+ display: inline-flex;
266
+ align-items: center;
267
+ justify-content: center;
268
+ gap: 5px;
269
+ padding: 6px 9px;
270
+ border: 1px solid transparent;
271
+ border-radius: var(--dpk-radius-sm);
272
+ background: transparent;
273
+ color: var(--dpk-ink-faint);
274
+ font-size: 11.5px;
275
+ cursor: pointer;
276
+ transition:
277
+ background 140ms var(--dpk-ease),
278
+ color 140ms var(--dpk-ease),
279
+ box-shadow 140ms var(--dpk-ease);
280
+ }
281
+
282
+ .grill-tabs button:hover {
283
+ color: var(--dpk-ink);
284
+ }
285
+
286
+ .grill-tabs button[aria-selected='true'] {
287
+ background: var(--dpk-paper-raised);
288
+ color: var(--dpk-ink);
289
+ font-weight: 600;
290
+ box-shadow: var(--dpk-bevel), var(--dpk-shadow-xs);
291
+ }
292
+
293
+ .grill-count {
294
+ font-family: var(--dpk-mono);
295
+ font-size: 10px;
296
+ font-variant-numeric: tabular-nums;
297
+ color: var(--dpk-ink-faint);
298
+ }
299
+
300
+ .grill-tabs button[aria-selected='true'] .grill-count {
301
+ color: var(--dpk-accent);
302
+ }
303
+
304
+ /* With earlier rounds, the questions tab is a select of rounds: the same
305
+ segment, with a chevron drawn from the text color. */
306
+ .grill-round-tab {
307
+ position: relative;
308
+ flex: 1 1 0;
309
+ display: flex;
310
+ min-width: 0;
311
+ }
312
+
313
+ .grill-round {
314
+ flex: 1;
315
+ min-width: 0;
316
+ padding: 6px 22px 6px 9px;
317
+ border: 1px solid transparent;
318
+ border-radius: var(--dpk-radius-sm);
319
+ appearance: none;
320
+ background-color: transparent;
321
+ background-image:
322
+ linear-gradient(45deg, transparent 50%, currentColor 50%),
323
+ linear-gradient(135deg, currentColor 50%, transparent 50%);
324
+ background-position:
325
+ calc(100% - 12px) 52%,
326
+ calc(100% - 8px) 52%;
327
+ background-size: 4px 4px;
328
+ background-repeat: no-repeat;
329
+ color: var(--dpk-ink-faint);
330
+ font: inherit;
331
+ font-size: 11.5px;
332
+ text-align: center;
333
+ text-align-last: center;
334
+ text-overflow: ellipsis;
335
+ cursor: pointer;
336
+ transition:
337
+ background-color 140ms var(--dpk-ease),
338
+ color 140ms var(--dpk-ease),
339
+ box-shadow 140ms var(--dpk-ease);
340
+ }
341
+
342
+ .grill-round-tab:hover .grill-round {
343
+ color: var(--dpk-ink);
344
+ }
345
+
346
+ /* From Review the select is disabled and only looks like the other tab. */
347
+ .grill-round:disabled {
348
+ opacity: 1;
349
+ }
350
+
351
+ .grill-tabs .grill-round-switch {
352
+ position: absolute;
353
+ inset: 0;
354
+ padding: 0;
355
+ }
356
+
357
+ .grill-round-tab[data-selected='true'] .grill-round {
358
+ background-color: var(--dpk-paper-raised);
359
+ color: var(--dpk-ink);
360
+ font-weight: 600;
361
+ box-shadow: var(--dpk-bevel), var(--dpk-shadow-xs);
362
+ }
363
+
364
+ .grill-round option {
365
+ color: var(--dpk-ink);
366
+ background: var(--dpk-paper-raised);
367
+ font-weight: 400;
368
+ }
369
+
370
+ .grill-round-note {
371
+ margin: 4px 0 2px;
372
+ padding: 0 8px;
373
+ font-size: 10.5px;
374
+ line-height: 1.6;
375
+ color: var(--dpk-ink-faint);
376
+ }
377
+
378
+ .grill-list {
379
+ flex: 1;
380
+ min-height: 0;
381
+ overflow: auto;
382
+ overscroll-behavior: contain;
383
+ padding: 2px 10px 12px;
384
+ }
385
+
386
+ .grill-empty {
387
+ margin: 0;
388
+ padding: 22px 8px;
389
+ text-align: center;
390
+ font-size: 12px;
391
+ color: var(--dpk-ink-faint);
392
+ }
393
+
394
+ .grill-question {
395
+ margin: 6px 0;
396
+ border: 1px solid transparent;
397
+ border-radius: var(--dpk-radius);
398
+ transition:
399
+ background 140ms var(--dpk-ease),
400
+ border-color 140ms var(--dpk-ease);
401
+ }
402
+
403
+ .grill-question:has(.grill-heading[aria-expanded='true']) {
404
+ border-color: var(--dpk-rule);
405
+ background: var(--dpk-paper-raised);
406
+ box-shadow: var(--dpk-bevel), var(--dpk-shadow-xs);
407
+ }
408
+
409
+ .grill-heading {
410
+ display: flex;
411
+ align-items: flex-start;
412
+ gap: 9px;
413
+ width: 100%;
414
+ padding: 10px 8px;
415
+ border: 0;
416
+ border-radius: var(--dpk-radius-sm);
417
+ background: none;
418
+ text-align: left;
419
+ cursor: pointer;
420
+ }
421
+
422
+ .grill-heading:hover {
423
+ background: var(--dpk-paper-sunken);
424
+ }
425
+
426
+ .grill-question:has(.grill-heading[aria-expanded='true']) .grill-heading:hover {
427
+ background: none;
428
+ }
429
+
430
+ .grill-ref {
431
+ flex: 0 0 auto;
432
+ display: grid;
433
+ place-items: center;
434
+ min-width: 30px;
435
+ height: 22px;
436
+ padding: 0 6px;
437
+ border: 1px solid var(--dpk-rule-strong);
438
+ border-radius: 999px;
439
+ background: var(--dpk-paper-sunken);
440
+ font-family: var(--dpk-mono);
441
+ font-size: 10px;
442
+ font-weight: 600;
443
+ font-variant-numeric: tabular-nums;
444
+ color: var(--dpk-ink-faint);
445
+ box-shadow: inset 0 1px 2px var(--dpk-shade-1);
446
+ transition:
447
+ background 140ms var(--dpk-ease),
448
+ color 140ms var(--dpk-ease),
449
+ border-color 140ms var(--dpk-ease),
450
+ box-shadow 140ms var(--dpk-ease);
451
+ }
452
+
453
+ .grill-question[data-answered='true'] .grill-ref {
454
+ border-color: transparent;
455
+ background: linear-gradient(180deg, var(--dpk-green-soft), color-mix(in srgb, var(--dpk-green) 16%, transparent));
456
+ color: var(--dpk-green);
457
+ box-shadow: var(--dpk-bevel);
458
+ }
459
+
460
+ .grill-question:has(.grill-heading[aria-expanded='true']) .grill-ref {
461
+ border-color: transparent;
462
+ background: linear-gradient(180deg, var(--dpk-accent-bright), var(--dpk-accent));
463
+ color: var(--dpk-accent-ink);
464
+ box-shadow:
465
+ inset 0 1px 0 rgba(255, 255, 255, 0.24),
466
+ 0 2px 6px -2px color-mix(in srgb, var(--dpk-accent) 55%, transparent);
467
+ }
468
+
469
+ .grill-heading-text {
470
+ flex: 1;
471
+ min-width: 0;
472
+ }
473
+
474
+ .grill-heading-text strong {
475
+ display: block;
476
+ font-size: 12.5px;
477
+ font-weight: 620;
478
+ line-height: 1.6;
479
+ letter-spacing: -0.005em;
480
+ }
481
+
482
+ .grill-summary {
483
+ display: block;
484
+ margin-top: 4px;
485
+ font-size: 10.5px;
486
+ line-height: 1.6;
487
+ color: var(--dpk-green);
488
+ white-space: nowrap;
489
+ overflow: hidden;
490
+ text-overflow: ellipsis;
491
+ }
492
+
493
+ .grill-chevron {
494
+ flex: 0 0 auto;
495
+ width: 16px;
496
+ color: var(--dpk-ink-faint);
497
+ line-height: 22px;
498
+ text-align: center;
499
+ }
500
+
501
+ .grill-chevron svg {
502
+ display: block;
503
+ width: 13px;
504
+ height: 13px;
505
+ margin: 4.5px auto 0;
506
+ transition: transform 180ms var(--dpk-ease);
507
+ }
508
+
509
+ .grill-heading[aria-expanded='true'] .grill-chevron svg {
510
+ transform: rotate(90deg);
511
+ color: var(--dpk-accent);
512
+ }
513
+
514
+ .grill-body {
515
+ padding: 2px 8px 14px 47px;
516
+ animation: dpk-grill-open 180ms var(--dpk-ease) backwards;
517
+ }
518
+
519
+ @keyframes dpk-grill-open {
520
+ from {
521
+ opacity: 0;
522
+ transform: translateY(-4px);
523
+ }
524
+ }
525
+
526
+ .grill-description {
527
+ margin: 0 0 8px;
528
+ font-size: 11.5px;
529
+ line-height: 1.85;
530
+ color: var(--dpk-ink-soft);
531
+ }
532
+
533
+ .grill-note {
534
+ margin: 0 0 10px;
535
+ padding: 7px 10px;
536
+ border-left: 2px solid var(--dpk-amber);
537
+ border-radius: 0 var(--dpk-radius-xs) var(--dpk-radius-xs) 0;
538
+ background: linear-gradient(90deg, var(--dpk-amber-soft), transparent);
539
+ font-size: 11px;
540
+ line-height: 1.7;
541
+ color: var(--dpk-ink-soft);
542
+ }
543
+
544
+ .grill-choices {
545
+ display: grid;
546
+ gap: 6px;
547
+ }
548
+
549
+ .grill-choice {
550
+ position: relative;
551
+ display: flex;
552
+ align-items: flex-start;
553
+ gap: 8px;
554
+ padding: 8px 9px 8px 12px;
555
+ border: 1px solid var(--dpk-rule);
556
+ border-radius: var(--dpk-radius-sm);
557
+ background: var(--dpk-paper);
558
+ font-size: 11.5px;
559
+ line-height: 1.7;
560
+ cursor: pointer;
561
+ overflow: hidden;
562
+ transition:
563
+ border-color 140ms var(--dpk-ease),
564
+ background 140ms var(--dpk-ease),
565
+ box-shadow 140ms var(--dpk-ease),
566
+ transform 140ms var(--dpk-ease);
567
+ }
568
+
569
+ /* Selection indicator: a colored bar on the leading edge, like the rail's
570
+ comment cards — quiet until a choice is actually picked. */
571
+ .grill-choice::before {
572
+ content: '';
573
+ position: absolute;
574
+ left: 0;
575
+ top: 0;
576
+ bottom: 0;
577
+ width: 3px;
578
+ background: transparent;
579
+ transition: background 140ms var(--dpk-ease);
580
+ }
581
+
582
+ .grill-choice:hover {
583
+ border-color: var(--dpk-rule-hover);
584
+ background: var(--dpk-paper-inset);
585
+ }
586
+
587
+ .grill-choice:has(input:checked) {
588
+ border-color: color-mix(in srgb, var(--dpk-green) 45%, transparent);
589
+ background: var(--dpk-green-soft);
590
+ box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--dpk-green) 30%, transparent);
591
+ }
592
+
593
+ .grill-choice:has(input:checked)::before {
594
+ background: var(--dpk-green);
595
+ }
596
+
597
+ .grill-choice--free {
598
+ border-style: dashed;
599
+ }
600
+
601
+ .grill-choice--free[data-free='true'] {
602
+ border-style: solid;
603
+ }
604
+
605
+ .grill-choice input {
606
+ flex: 0 0 auto;
607
+ margin: 3px 0 0;
608
+ accent-color: var(--dpk-green);
609
+ }
610
+
611
+ .grill-choice-text {
612
+ display: flex;
613
+ gap: 7px;
614
+ min-width: 0;
615
+ }
616
+
617
+ .grill-letter {
618
+ flex: 0 0 auto;
619
+ font-family: var(--dpk-mono);
620
+ font-size: 10px;
621
+ font-weight: 600;
622
+ line-height: 1.9;
623
+ color: var(--dpk-green);
624
+ }
625
+
626
+ /* An earlier round: a disclosure per question, nothing to answer with. */
627
+ .grill-question--past > summary {
628
+ list-style: none;
629
+ }
630
+
631
+ .grill-question--past > summary::-webkit-details-marker {
632
+ display: none;
633
+ }
634
+
635
+ .grill-question--past[open] {
636
+ border-color: var(--dpk-rule);
637
+ background: var(--dpk-paper-raised);
638
+ box-shadow: var(--dpk-bevel), var(--dpk-shadow-xs);
639
+ }
640
+
641
+ .grill-question--past[open] .grill-heading:hover {
642
+ background: none;
643
+ }
644
+
645
+ .grill-question--past[open] .grill-chevron svg {
646
+ transform: rotate(90deg);
647
+ }
648
+
649
+ .grill-question--past[open] .grill-summary {
650
+ display: none;
651
+ }
652
+
653
+ .grill-question--past[data-answered='false'] .grill-summary {
654
+ color: var(--dpk-ink-faint);
655
+ }
656
+
657
+ .grill-past-choices {
658
+ display: grid;
659
+ gap: 6px;
660
+ margin: 0;
661
+ padding: 0;
662
+ list-style: none;
663
+ }
664
+
665
+ .grill-past-choice {
666
+ display: flex;
667
+ gap: 7px;
668
+ margin: 0;
669
+ padding: 7px 9px;
670
+ border: 1px solid var(--dpk-rule);
671
+ border-radius: var(--dpk-radius-sm);
672
+ font-size: 11.5px;
673
+ line-height: 1.7;
674
+ color: var(--dpk-ink-faint);
675
+ }
676
+
677
+ .grill-past-choice[data-checked='true'] {
678
+ border-color: color-mix(in srgb, var(--dpk-green) 45%, transparent);
679
+ background: var(--dpk-green-soft);
680
+ color: var(--dpk-ink);
681
+ }
682
+
683
+ .grill-past-free {
684
+ margin-top: 6px;
685
+ white-space: pre-wrap;
686
+ }
687
+
688
+ .grill-free {
689
+ margin-top: 7px;
690
+ min-height: 76px;
691
+ max-height: 240px;
692
+ }
693
+
694
+ .grill-clear {
695
+ margin-top: 10px;
696
+ padding: 0;
697
+ border: 0;
698
+ background: none;
699
+ color: var(--dpk-ink-faint);
700
+ font-size: 10.5px;
701
+ text-decoration: underline;
702
+ text-underline-offset: 3px;
703
+ cursor: pointer;
704
+ }
705
+
706
+ .grill-clear:hover {
707
+ color: var(--dpk-ink);
708
+ }
709
+
710
+ .grill-footer {
711
+ flex-shrink: 0;
712
+ padding: 10px 12px;
713
+ border-top: 1px solid var(--dpk-rule);
714
+ background: var(--dpk-paper-raised);
715
+ box-shadow: 0 -6px 12px -10px var(--dpk-shade-2);
716
+ }
717
+
718
+ .grill-copy {
719
+ width: 100%;
720
+ }
721
+
722
+ /* Inside a Claude Artifact: send is the way, copy the fallback beside it. */
723
+ .grill-footer-actions {
724
+ display: flex;
725
+ gap: 6px;
726
+ }
727
+
728
+ .grill-send {
729
+ flex: 1;
730
+ min-width: 0;
731
+ }
732
+
733
+ .grill-footer-actions .grill-copy {
734
+ width: auto;
735
+ flex-shrink: 0;
736
+ }
737
+
738
+ .grill-send[data-status='sent'] {
739
+ border-color: transparent;
740
+ background: var(--dpk-green);
741
+ color: var(--dpk-accent-ink);
742
+ }
743
+
744
+ .grill-send[data-status='failed'] {
745
+ border-color: transparent;
746
+ background: var(--dpk-amber);
747
+ color: var(--dpk-accent-ink);
748
+ }
749
+
750
+ .grill-footer-note {
751
+ margin: 8px 0 0;
752
+ color: var(--dpk-ink-soft);
753
+ font-size: 11.5px;
754
+ line-height: 1.5;
755
+ }
756
+
757
+ /* The copy button reports the outcome, so a click is never silent. */
758
+ .grill-copy[data-status='copied'] {
759
+ border-color: transparent;
760
+ background: var(--dpk-green);
761
+ color: var(--dpk-accent-ink);
762
+ }
763
+
764
+ .grill-copy[data-status='copied']:hover:not([disabled]) {
765
+ border-color: transparent;
766
+ background: color-mix(in srgb, var(--dpk-green) 85%, #000);
767
+ }
768
+
769
+ .grill-copy[data-status='failed'] {
770
+ border-color: transparent;
771
+ background: var(--dpk-amber);
772
+ color: var(--dpk-accent-ink);
773
+ }
774
+
775
+ .grill-copy[data-status='failed']:hover:not([disabled]) {
776
+ border-color: transparent;
777
+ background: color-mix(in srgb, var(--dpk-amber) 85%, #000);
778
+ }
779
+
780
+ /* Announced to assistive tech; the button label change alone is easy to miss. */
781
+ .grill-sr {
782
+ position: absolute;
783
+ width: 1px;
784
+ height: 1px;
785
+ margin: -1px;
786
+ padding: 0;
787
+ overflow: hidden;
788
+ clip-path: inset(50%);
789
+ white-space: nowrap;
790
+ border: 0;
791
+ }
792
+
793
+ /* -------------------------------------------------- main area and badges */
794
+
795
+ .grill-stage {
796
+ position: relative;
797
+ min-width: 0;
798
+ }
799
+
800
+ /* The author's own markup lands in slot="main": nudge its prose toward the
801
+ kit's own type scale, so the diagrams it wraps don't feel bolted on. */
802
+ .grill-stage ::slotted(h1),
803
+ .grill-stage ::slotted(h2),
804
+ .grill-stage ::slotted(h3) {
805
+ font-family: var(--dpk-display);
806
+ font-weight: 660;
807
+ letter-spacing: -0.015em;
808
+ color: var(--dpk-ink);
809
+ }
810
+
811
+ .grill-stage ::slotted(p) {
812
+ line-height: 1.75;
813
+ color: var(--dpk-ink-soft);
814
+ }
815
+
816
+ .grill-labels {
817
+ position: absolute;
818
+ inset: 0;
819
+ z-index: 3;
820
+ overflow: hidden;
821
+ pointer-events: none;
822
+ }
823
+
824
+ .grill-label {
825
+ position: absolute;
826
+ display: inline-flex;
827
+ align-items: center;
828
+ justify-content: center;
829
+ min-width: 30px;
830
+ height: 22px;
831
+ padding: 0 7px;
832
+ border: 2px solid var(--dpk-paper-raised);
833
+ border-radius: 999px;
834
+ background: linear-gradient(180deg, var(--dpk-accent-bright), var(--dpk-accent));
835
+ color: var(--dpk-accent-ink);
836
+ font-family: var(--dpk-mono);
837
+ font-size: 10px;
838
+ font-weight: 650;
839
+ font-variant-numeric: tabular-nums;
840
+ box-shadow:
841
+ inset 0 1px 0 rgba(255, 255, 255, 0.28),
842
+ 0 2px 6px -2px color-mix(in srgb, var(--dpk-accent) 55%, transparent);
843
+ cursor: pointer;
844
+ pointer-events: auto;
845
+ transition:
846
+ transform 160ms var(--dpk-ease-spring),
847
+ box-shadow 160ms var(--dpk-ease),
848
+ background 160ms var(--dpk-ease);
849
+ }
850
+
851
+ .grill-label[data-visible='false'] {
852
+ visibility: hidden;
853
+ }
854
+
855
+ .grill-label:hover {
856
+ transform: translateY(-1px) scale(1.06);
857
+ box-shadow:
858
+ inset 0 1px 0 rgba(255, 255, 255, 0.3),
859
+ 0 4px 10px -2px color-mix(in srgb, var(--dpk-accent) 60%, transparent);
860
+ }
861
+
862
+ .grill-label[data-answered='true'] {
863
+ background: linear-gradient(180deg, color-mix(in srgb, var(--dpk-green) 85%, white), var(--dpk-green));
864
+ }
865
+
866
+ .grill-label[aria-pressed='true'] {
867
+ box-shadow:
868
+ 0 0 0 2px color-mix(in srgb, var(--dpk-accent) 45%, transparent),
869
+ var(--dpk-shadow-sm);
870
+ }
871
+
872
+ .grill-label:focus-visible {
873
+ outline: none;
874
+ box-shadow: var(--dpk-focus);
875
+ }
876
+ `;class pe extends P{static{this.styles=[P.styles,He]}definitionFor(e){return se(e)}static{this.properties={tab:{state:!0},folded:{state:!0},round:{state:!0}}}#o=[];#s=!1;#a=null;#l=null;#r=null;#e="idle";#i=null;#n={kind:"idle"};constructor(){super(),this.tab="questions",this.folded=!1,this.round="current"}connectedCallback(){super.connectedCallback(),document.addEventListener("scroll",this.#t,!0),window.addEventListener("resize",this.#t),this.addEventListener("dpk-diagram-view",this.#t)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("scroll",this.#t,!0),window.removeEventListener("resize",this.#t),this.removeEventListener("dpk-diagram-view",this.#t),this.#r?.disconnect(),this.#r=null,this.#d()}renderRegions(e){return this.#o=le(this,e.state,e.navigation),{header:this.#b(e),main:this.#m(e,this.#o),sidebar:this.#f(e),sidebarHidden:this.folded}}updated(){super.updated(),this.#T(),this.#t(),this.#S();const e=this.#l;e!==null&&(this.#l=null,this.renderRoot.querySelector(`[data-free-text="${e}"]`)?.focus())}get integratedReview(){return!0}requestComment(e){this.tab="review",this.folded=!1,super.requestComment(e)}#p(e,r){this.tab="questions",this.folded=!1,this.round="current",this.#a=null,e.navigate({question:r})}#b(e){const r=m(this.locale),i=ne(r,e.state),n=r.toggleLabel(this.folded?r.openPanel:r.closePanel,i.progress);return s`
877
+ <button
878
+ type="button"
879
+ class="grill-toggle"
880
+ aria-expanded=${this.folded?"false":"true"}
881
+ aria-label=${n}
882
+ title=${n}
883
+ @click=${()=>this.folded=!this.folded}
884
+ >
885
+ <span class="grill-toggle-glyph" aria-hidden="true">?</span>
886
+ <span class="grill-toggle-badge" aria-hidden="true">${i.answered} / ${i.total}</span>
887
+ </button>
888
+ `}#f(e){const r=m(this.locale),i=ae(e.state,this.round),n=Fe(r,e.state,i),a=i==="current"?null:Oe(r,e.state,i);return s`
889
+ <div class="grill-panel">
890
+ <div class="grill-tabs" role="tablist" aria-label=${r.tabs}>
891
+ ${["questions","review"].map(o=>o==="questions"&&n.length>0?this.#v(r,n):s`
892
+ <button
893
+ type="button"
894
+ role="tab"
895
+ id=${`grill-tab-${o}`}
896
+ data-tab=${o}
897
+ aria-controls=${`grill-panel-${o}`}
898
+ aria-selected=${String(this.tab===o)}
899
+ tabindex=${this.tab===o?0:-1}
900
+ @click=${()=>this.tab=o}
901
+ @keydown=${l=>this.#c(l)}
902
+ >
903
+ ${o==="questions"?r.questionsTab:r.reviewTab}<span class="grill-count"
904
+ >${o==="questions"?e.state.questions.length:e.actions.length}</span
905
+ >
906
+ </button>
907
+ `)}
908
+ </div>
909
+ <div
910
+ class="grill-tab-panel"
911
+ id="grill-panel-questions"
912
+ role="tabpanel"
913
+ aria-labelledby="grill-tab-questions"
914
+ ?hidden=${this.tab!=="questions"}
915
+ >
916
+ ${a===null?Ge(r,ie(e.state,e.navigation),{open:o=>this.#p(e,o),answer:(o,l)=>this.#w(o,l),next:o=>this.#g(o)}):Me(r,a)}
917
+ </div>
918
+ <div
919
+ class="grill-tab-panel"
920
+ id="grill-panel-review"
921
+ role="tabpanel"
922
+ aria-labelledby="grill-tab-review"
923
+ ?hidden=${this.tab!=="review"}
924
+ >
925
+ ${this.renderReviewPanel(e)}
926
+ </div>
927
+ ${this.#k(e.actions.length===0)}
928
+ </div>
929
+ `}#k(e){const r=m(this.locale),i=this.#e==="copied"?r.copied:this.#e==="failed"?r.copyFailed:r.copyAll;if(!this.canSendToClaude)return s`
930
+ <div class="grill-footer">
931
+ <button
932
+ class="dpk-btn dpk-btn--accent grill-copy"
933
+ type="button"
934
+ data-status=${this.#e}
935
+ ?disabled=${e}
936
+ @click=${()=>{this.#u()}}
937
+ >
938
+ ${i}
939
+ </button>
940
+ <span class="grill-sr" role="status">${this.#e==="idle"?"":i}</span>
941
+ </div>
942
+ `;const n=this.#n,a=n.kind==="pending"?r.sending:n.kind==="sent"?r.sent:n.kind==="failed"?r.sendFailed:r.sendAll,o=n.kind==="failed"?we(n.reason,this.locale):null,l=o??(n.kind==="sent"?a:this.#e==="idle"?"":i);return s`
943
+ <div class="grill-footer">
944
+ <div class="grill-footer-actions">
945
+ <button
946
+ class="dpk-btn dpk-btn--accent grill-send"
947
+ type="button"
948
+ data-status=${n.kind}
949
+ ?disabled=${e||n.kind==="pending"}
950
+ @click=${()=>{this.#y()}}
951
+ >
952
+ ${a}
953
+ </button>
954
+ <button
955
+ class="dpk-btn dpk-btn--ghost grill-copy"
956
+ type="button"
957
+ data-status=${this.#e}
958
+ title=${r.copyAll}
959
+ ?disabled=${e}
960
+ @click=${()=>{this.#u()}}
961
+ >
962
+ ${this.#e==="copied"?r.copyDone:r.copy}
963
+ </button>
964
+ </div>
965
+ ${o===null?null:s`<p class="grill-footer-note">${o}</p>`}
966
+ <span class="grill-sr" role="status">${l}</span>
967
+ </div>
968
+ `}#v(e,r){const i=this.tab==="questions",n=s`
969
+ <select
970
+ class="grill-round"
971
+ id=${i?"grill-tab-questions":d}
972
+ data-tab=${i?"questions":d}
973
+ aria-label=${e.roundSelect}
974
+ aria-controls="grill-panel-questions"
975
+ ?disabled=${!i}
976
+ @change=${a=>this.#x(a)}
977
+ >
978
+ ${r.map(a=>s`<option value=${a.value} ?selected=${a.selected}>${a.label}</option>`)}
979
+ </select>
980
+ `;return s`
981
+ <div class="grill-round-tab" data-selected=${String(i)}>
982
+ ${n}
983
+ ${i?d:s`<button
984
+ type="button"
985
+ role="tab"
986
+ class="grill-round-switch"
987
+ id="grill-tab-questions"
988
+ data-tab="questions"
989
+ aria-controls="grill-panel-questions"
990
+ aria-selected="false"
991
+ aria-label=${r.find(a=>a.selected)?.label??e.questionsTab}
992
+ tabindex="-1"
993
+ @click=${()=>this.tab="questions"}
994
+ @keydown=${a=>this.#c(a)}
995
+ ></button>`}
996
+ </div>
997
+ `}#x(e){const r=e.currentTarget;r instanceof HTMLSelectElement&&(this.tab="questions",this.round=r.value==="current"?"current":Number(r.value),this.#a=null)}#c(e){if(!["ArrowLeft","ArrowRight","Home","End"].includes(e.key))return;e.preventDefault(),this.tab=e.key==="Home"?"questions":e.key==="End"||this.tab==="questions"?"review":"questions";const r=this.tab;this.updateComplete.then(()=>this.renderRoot.querySelector(`[data-tab="${r}"]`)?.focus())}#m(e,r){return s`
998
+ <div class="grill-stage">
999
+ <slot name="main"></slot>
1000
+ <div class="grill-labels">
1001
+ ${r.map(i=>s`
1002
+ <button
1003
+ type="button"
1004
+ class="grill-label"
1005
+ data-label=${i.index}
1006
+ data-answered=${String(i.answered)}
1007
+ data-visible="false"
1008
+ aria-pressed=${i.open?"true":"false"}
1009
+ aria-label=${`${i.ref} \xB7 ${i.title}`}
1010
+ title=${`${i.ref} \xB7 ${i.title}`}
1011
+ @click=${()=>this.#p(e,i.questionId)}
1012
+ >
1013
+ ${i.ref}
1014
+ </button>
1015
+ `)}
1016
+ </div>
1017
+ </div>
1018
+ `}#w(e,r){if(this.dispatch(G(e,r)).ok){if(r.kind==="option"){this.#g(e);return}r.kind==="free"&&r.text===""&&(this.#l=e)}}#g(e){const r=Ie(this.derivation.state,e);r!==null&&this.navigate({question:r})}async#u(){const e=this.api.exportBrief(),r=await ye(e);this.#d(),this.#e=r?"copied":"failed",this.#h()}async#y(){this.#d(),this.#n={kind:"pending"},this.requestUpdate();const e=await this.sendToClaude();this.#n=e.ok?{kind:"sent"}:{kind:"failed",reason:e.reason},e.ok?this.#h():this.requestUpdate()}#h(){this.requestUpdate(),this.#i=setTimeout(()=>{this.#i=null,this.#e="idle",this.#n={kind:"idle"},this.requestUpdate()},2400)}#d(){this.#i!==null&&clearTimeout(this.#i),this.#i=null,this.#e="idle",this.#n={kind:"idle"}}#$(){this.requestUpdate()}#T(){this.#r?.disconnect(),this.#r??=new MutationObserver(()=>{this.#$(),this.#t()}),this.#r.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[w]});for(const e of this.querySelectorAll("*"))e===this||!e.shadowRoot||this.#r.observe(e.shadowRoot,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[w]})}#t=()=>{this.#s||(this.#s=!0,requestAnimationFrame(()=>{this.#s=!1;const e=this.renderRoot.querySelector(".grill-labels");e&&de(e,this.#o)}))};#S(){const e=this.navigation.question??null;if(this.tab!=="questions"||this.round!=="current"||this.folded||e===null||e===this.#a)return;this.#a=e;const r=this.renderRoot.querySelector(`[data-question="${e}"]`),i=r?.closest(".grill-list");r&&i&&Te(i,r)}}const ce=()=>{customElements.get("dpk-template-grill")||customElements.define("dpk-template-grill",pe)},We=Object.freeze(Object.defineProperty({__proto__:null,DpkTemplateGrill:pe,GRILL_QUESTIONS_ATTRIBUTE:w,answerCounts:D,answerQuestion:G,answerText:x,applyGrillAction:Y,collectLabelBindings:le,defineGrillElement:ce,describeGrillAction:J,emptyGrillBase:W,findQuestion:f,grillActions:T,grillBaseSchema:_,grillCommentTargets:Z,grillDefinitionFor:se,grillHasTarget:oe,grillMessages:m,grillTargetLabel:K,grillTitle:V,isAnswered:S,openQuestionId:te,optionLetter:j,parseGrillBase:H,positionLabels:de,presentGrillHeader:ne,presentGrillPanel:ie,questionLabel:q,questionRef:Qe,resolveGrillNavigation:ee,serializeGrillAction:X,withAnswer:R},Symbol.toStringTag,{value:"Module"}));export{ce as d,We as i};