dev-process-kit 0.0.8 → 0.0.9

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 (34) hide show
  1. package/README.md +1 -0
  2. package/dist/chunks/shared-7qenhU4J.js +2173 -0
  3. package/dist/chunks/{shared-Dn4XK7mS.js → shared-8lYUcRvS.js} +25 -15
  4. package/dist/chunks/shared-BHGClRU3.js +29 -0
  5. package/dist/chunks/{shared-DNk3phV5.js → shared-BIdQ89rB.js} +1 -1
  6. package/dist/chunks/{shared-BTlCV660.js → shared-BOFIcKZe.js} +8 -8
  7. package/dist/chunks/shared-Cia5FdOF.js +1112 -0
  8. package/dist/chunks/shared-D4czF1TI.js +1252 -0
  9. package/dist/chunks/{shared-DEdm-PCj.js → shared-D6Yx-euS.js} +2 -2
  10. package/dist/chunks/{shared-CwwZhA40.js → shared-Dkx_2Lbf.js} +336 -268
  11. package/dist/chunks/shared-Dn5j0MCU.js +1 -0
  12. package/dist/chunks/{shared-CupreHTH.js → shared-SGSKyTNs.js} +7 -7
  13. package/dist/chunks/shared-U2T3astJ.js +1094 -0
  14. package/dist/chunks/shared-nW8tfMgg.js +556 -0
  15. package/dist/chunks/{shared-CaLe76va.js → shared-p8037r6P.js} +2 -2
  16. package/dist/components.js +1 -1
  17. package/dist/index.js +1 -1
  18. package/dist/templates/delegation-poker.js +1 -1
  19. package/dist/templates/event-storming.js +1 -1
  20. package/dist/templates/example-mapping.js +1 -1
  21. package/dist/templates/grill.js +1 -1
  22. package/dist/templates/plain.js +1 -1
  23. package/dist/templates/prototype.js +1 -1
  24. package/dist/templates/slides.js +1 -1
  25. package/dist/templates/task-board.js +1 -1
  26. package/dist/templates/usm.js +1 -1
  27. package/dist/templates/whiteboard.js +1 -0
  28. package/package.json +3 -2
  29. package/dist/chunks/shared-1AA-0t4O.js +0 -29
  30. package/dist/chunks/shared-BAePwoKi.js +0 -679
  31. package/dist/chunks/shared-BYZoeQ97.js +0 -1963
  32. package/dist/chunks/shared-CSV1HkB2.js +0 -1
  33. package/dist/chunks/shared-Csmm_KdH.js +0 -761
  34. package/dist/chunks/shared-VNSWugEg.js +0 -556
@@ -1,1963 +0,0 @@
1
- const pe=globalThis,_e=pe.ShadowRoot&&(pe.ShadyCSS===void 0||pe.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ee=Symbol(),ut=new WeakMap;let ft=class{constructor(e,s,n){if(this._$cssResult$=!0,n!==Ee)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=s}get styleSheet(){let e=this.o;const s=this.t;if(_e&&e===void 0){const n=s!==void 0&&s.length===1;n&&(e=ut.get(s)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&ut.set(s,e))}return e}toString(){return this.cssText}};const gt=t=>new ft(typeof t=="string"?t:t+"",void 0,Ee),R=(t,...e)=>{const s=t.length===1?t[0]:e.reduce((n,r,i)=>n+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+t[i+1],t[0]);return new ft(s,t,Ee)},nn=(t,e)=>{if(_e)t.adoptedStyleSheets=e.map(s=>s instanceof CSSStyleSheet?s:s.styleSheet);else for(const s of e){const n=document.createElement("style"),r=pe.litNonce;r!==void 0&&n.setAttribute("nonce",r),n.textContent=s.cssText,t.appendChild(n)}},mt=_e?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let s="";for(const n of e.cssRules)s+=n.cssText;return gt(s)})(t):t,{is:rn,defineProperty:on,getOwnPropertyDescriptor:an,getOwnPropertyNames:dn,getOwnPropertySymbols:ln,getPrototypeOf:cn}=Object,he=globalThis,bt=he.trustedTypes,pn=bt?bt.emptyScript:"",hn=he.reactiveElementPolyfillSupport,Q=(t,e)=>t,Te={toAttribute(t,e){switch(e){case Boolean:t=t?pn:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=t!==null;break;case Number:s=t===null?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch{s=null}}return s}},kt=(t,e)=>!rn(t,e),vt={attribute:!0,type:String,converter:Te,reflect:!1,useDefault:!1,hasChanged:kt};Symbol.metadata??=Symbol("metadata"),he.litPropertyMetadata??=new WeakMap;let F=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,s=vt){if(s.state&&(s.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((s=Object.create(s)).wrapped=!0),this.elementProperties.set(e,s),!s.noAccessor){const n=Symbol(),r=this.getPropertyDescriptor(e,n,s);r!==void 0&&on(this.prototype,e,r)}}static getPropertyDescriptor(e,s,n){const{get:r,set:i}=an(this.prototype,e)??{get(){return this[s]},set(o){this[s]=o}};return{get:r,set(o){const d=r?.call(this);i?.call(this,o),this.requestUpdate(e,d,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??vt}static _$Ei(){if(this.hasOwnProperty(Q("elementProperties")))return;const e=cn(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Q("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Q("properties"))){const s=this.properties,n=[...dn(s),...ln(s)];for(const r of n)this.createProperty(r,s[r])}const e=this[Symbol.metadata];if(e!==null){const s=litPropertyMetadata.get(e);if(s!==void 0)for(const[n,r]of s)this.elementProperties.set(n,r)}this._$Eh=new Map;for(const[s,n]of this.elementProperties){const r=this._$Eu(s,n);r!==void 0&&this._$Eh.set(r,s)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const s=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const r of n)s.unshift(mt(r))}else e!==void 0&&s.push(mt(e));return s}static _$Eu(e,s){const n=s.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,s=this.constructor.elementProperties;for(const n of s.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return nn(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,s,n){this._$AK(e,n)}_$ET(e,s){const n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(r!==void 0&&n.reflect===!0){const i=(n.converter?.toAttribute!==void 0?n.converter:Te).toAttribute(s,n.type);this._$Em=e,i==null?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,s){const n=this.constructor,r=n._$Eh.get(e);if(r!==void 0&&this._$Em!==r){const i=n.getPropertyOptions(r),o=typeof i.converter=="function"?{fromAttribute:i.converter}:i.converter?.fromAttribute!==void 0?i.converter:Te;this._$Em=r;const d=o.fromAttribute(s,i.type);this[r]=d??this._$Ej?.get(r)??d,this._$Em=null}}requestUpdate(e,s,n,r=!1,i){if(e!==void 0){const o=this.constructor;if(r===!1&&(i=this[e]),n??=o.getPropertyOptions(e),!((n.hasChanged??kt)(i,s)||n.useDefault&&n.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(o._$Eu(e,n))))return;this.C(e,s,n)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,s,{useDefault:n,reflect:r,wrapped:i},o){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??s??this[e]),i!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(s=void 0),this._$AL.set(e,s)),r===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(s){Promise.reject(s)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[r,i]of this._$Ep)this[r]=i;this._$Ep=void 0}const n=this.constructor.elementProperties;if(n.size>0)for(const[r,i]of n){const{wrapped:o}=i,d=this[r];o!==!0||this._$AL.has(r)||d===void 0||this.C(r,void 0,i,d)}}let e=!1;const s=this._$AL;try{e=this.shouldUpdate(s),e?(this.willUpdate(s),this._$EO?.forEach(n=>n.hostUpdate?.()),this.update(s)):this._$EM()}catch(n){throw e=!1,this._$EM(),n}e&&this._$AE(s)}willUpdate(e){}_$AE(e){this._$EO?.forEach(s=>s.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(s=>this._$ET(s,this[s])),this._$EM()}updated(e){}firstUpdated(e){}};F.elementStyles=[],F.shadowRootOptions={mode:"open"},F[Q("elementProperties")]=new Map,F[Q("finalized")]=new Map,hn?.({ReactiveElement:F}),(he.reactiveElementVersions??=[]).push("2.1.2");const Me=globalThis,yt=t=>t,ue=Me.trustedTypes,xt=ue?ue.createPolicy("lit-html",{createHTML:t=>t}):void 0,wt="$lit$",M=`lit$${Math.random().toFixed(9).slice(2)}$`,$t="?"+M,un=`<${$t}>`,z=document,ee=()=>z.createComment(""),te=t=>t===null||typeof t!="object"&&typeof t!="function",Oe=Array.isArray,fn=t=>Oe(t)||typeof t?.[Symbol.iterator]=="function",je=`[
2
- \f\r]`,se=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,At=/-->/g,Ct=/>/g,N=RegExp(`>|${je}(?:([^\\s"'>=/]+)(${je}*=${je}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),St=/'/g,_t=/"/g,Et=/^(?:script|style|textarea|title)$/i,Tt=t=>(e,...s)=>({_$litType$:t,strings:e,values:s}),f=Tt(1),gn=Tt(2),P=Symbol.for("lit-noChange"),g=Symbol.for("lit-nothing"),Mt=new WeakMap,D=z.createTreeWalker(z,129);function Ot(t,e){if(!Oe(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return xt!==void 0?xt.createHTML(e):e}const mn=(t,e)=>{const s=t.length-1,n=[];let r,i=e===2?"<svg>":e===3?"<math>":"",o=se;for(let d=0;d<s;d++){const a=t[d];let l,p,c=-1,h=0;for(;h<a.length&&(o.lastIndex=h,p=o.exec(a),p!==null);)h=o.lastIndex,o===se?p[1]==="!--"?o=At:p[1]!==void 0?o=Ct:p[2]!==void 0?(Et.test(p[2])&&(r=RegExp("</"+p[2],"g")),o=N):p[3]!==void 0&&(o=N):o===N?p[0]===">"?(o=r??se,c=-1):p[1]===void 0?c=-2:(c=o.lastIndex-p[2].length,l=p[1],o=p[3]===void 0?N:p[3]==='"'?_t:St):o===_t||o===St?o=N:o===At||o===Ct?o=se:(o=N,r=void 0);const u=o===N&&t[d+1].startsWith("/>")?" ":"";i+=o===se?a+un:c>=0?(n.push(l),a.slice(0,c)+wt+a.slice(c)+M+u):a+M+(c===-2?d:u)}return[Ot(t,i+(t[s]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]};class ce{constructor({strings:e,_$litType$:s},n){let r;this.parts=[];let i=0,o=0;const d=e.length-1,a=this.parts,[l,p]=mn(e,s);if(this.el=ce.createElement(l,n),D.currentNode=this.el.content,s===2||s===3){const c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(r=D.nextNode())!==null&&a.length<d;){if(r.nodeType===1){if(r.hasAttributes())for(const c of r.getAttributeNames())if(c.endsWith(wt)){const h=p[o++],u=r.getAttribute(c).split(M),b=/([.?@])?(.*)/.exec(h);a.push({type:1,index:i,name:b[2],strings:u,ctor:b[1]==="."?kn:b[1]==="?"?vn:b[1]==="@"?yn:fe}),r.removeAttribute(c)}else c.startsWith(M)&&(a.push({type:6,index:i}),r.removeAttribute(c));if(Et.test(r.tagName)){const c=r.textContent.split(M),h=c.length-1;if(h>0){r.textContent=ue?ue.emptyScript:"";for(let u=0;u<h;u++)r.append(c[u],ee()),D.nextNode(),a.push({type:2,index:++i});r.append(c[h],ee())}}}else if(r.nodeType===8)if(r.data===$t)a.push({type:2,index:i});else{let c=-1;for(;(c=r.data.indexOf(M,c+1))!==-1;)a.push({type:7,index:i}),c+=M.length-1}i++}}static createElement(e,s){const n=z.createElement("template");return n.innerHTML=e,n}}function K(t,e,s=t,n){if(e===P)return e;let r=n!==void 0?s._$Co?.[n]:s._$Cl;const i=te(e)?void 0:e._$litDirective$;return r?.constructor!==i&&(r?._$AO?.(!1),i===void 0?r=void 0:(r=new i(t),r._$AT(t,s,n)),n!==void 0?(s._$Co??=[])[n]=r:s._$Cl=r),r!==void 0&&(e=K(t,r._$AS(t,e.values),r,n)),e}class bn{constructor(e,s){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=s}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:s},parts:n}=this._$AD,r=(e?.creationScope??z).importNode(s,!0);D.currentNode=r;let i=D.nextNode(),o=0,d=0,a=n[0];for(;a!==void 0;){if(o===a.index){let l;a.type===2?l=new X(i,i.nextSibling,this,e):a.type===1?l=new a.ctor(i,a.name,a.strings,this,e):a.type===6&&(l=new xn(i,this,e)),this._$AV.push(l),a=n[++d]}o!==a?.index&&(i=D.nextNode(),o++)}return D.currentNode=z,r}p(e){let s=0;for(const n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,s),s+=n.strings.length-2):n._$AI(e[s])),s++}}class X{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,s,n,r){this.type=2,this._$AH=g,this._$AN=void 0,this._$AA=e,this._$AB=s,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const s=this._$AM;return s!==void 0&&e?.nodeType===11&&(e=s.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,s=this){e=K(this,e,s),te(e)?e===g||e==null||e===""?(this._$AH!==g&&this._$AR(),this._$AH=g):e!==this._$AH&&e!==P&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):fn(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==g&&te(this._$AH)?this._$AA.nextSibling.data=e:this.T(z.createTextNode(e)),this._$AH=e}$(e){const{values:s,_$litType$:n}=e,r=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=ce.createElement(Ot(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(s);else{const i=new bn(r,this),o=i.u(this.options);i.p(s),this.T(o),this._$AH=i}}_$AC(e){let s=Mt.get(e.strings);return s===void 0&&Mt.set(e.strings,s=new ce(e)),s}k(e){Oe(this._$AH)||(this._$AH=[],this._$AR());const s=this._$AH;let n,r=0;for(const i of e)r===s.length?s.push(n=new X(this.O(ee()),this.O(ee()),this,this.options)):n=s[r],n._$AI(i),r++;r<s.length&&(this._$AR(n&&n._$AB.nextSibling,r),s.length=r)}_$AR(e=this._$AA.nextSibling,s){for(this._$AP?.(!1,!0,s);e!==this._$AB;){const n=yt(e).nextSibling;yt(e).remove(),e=n}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}}class fe{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,s,n,r,i){this.type=1,this._$AH=g,this._$AN=void 0,this.element=e,this.name=s,this._$AM=r,this.options=i,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=g}_$AI(e,s=this,n,r){const i=this.strings;let o=!1;if(i===void 0)e=K(this,e,s,0),o=!te(e)||e!==this._$AH&&e!==P,o&&(this._$AH=e);else{const d=e;let a,l;for(e=i[0],a=0;a<i.length-1;a++)l=K(this,d[n+a],s,a),l===P&&(l=this._$AH[a]),o||=!te(l)||l!==this._$AH[a],l===g?e=g:e!==g&&(e+=(l??"")+i[a+1]),this._$AH[a]=l}o&&!r&&this.j(e)}j(e){e===g?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class kn extends fe{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===g?void 0:e}}class vn extends fe{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==g)}}class yn extends fe{constructor(e,s,n,r,i){super(e,s,n,r,i),this.type=5}_$AI(e,s=this){if((e=K(this,e,s,0)??g)===P)return;const n=this._$AH,r=e===g&&n!==g||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,i=e!==g&&(n===g||r);r&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class xn{constructor(e,s,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=s,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){K(this,e)}}const wn={I:X},$n=Me.litHtmlPolyfillSupport;$n?.(ce,X),(Me.litHtmlVersions??=[]).push("3.3.3");const An=(t,e,s)=>{const n=s?.renderBefore??e;let r=n._$litPart$;if(r===void 0){const i=s?.renderBefore??null;n._$litPart$=r=new X(e.insertBefore(ee(),i),i,void 0,s??{})}return r._$AI(t),r},Le=globalThis;let O=class extends F{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const s=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=An(s,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return P}};O._$litElement$=!0,O.finalized=!0,Le.litElementHydrateSupport?.({LitElement:O});const Cn=Le.litElementPolyfillSupport;Cn?.({LitElement:O}),(Le.litElementVersions??=[]).push("4.2.2");const Re=t=>{let e=t;for(;e!==null;){if(e instanceof Element){const s=e.getAttribute("lang");if(s!==null)return s}e=e instanceof ShadowRoot?e.host:e.parentNode}return null},ze=["en","ja"],jt="en",Lt=t=>ze.some(e=>e===t),Ne=t=>{const e=(t??"").split("-")[0]?.toLowerCase()??"";return Lt(e)?e:jt},Rt=t=>Ne(Re(t)),Pe="dpk-locale-change",zt=t=>typeof t=="string"&&Lt(t)?t:null,Sn=t=>t.preference??t.authored,_n=(t,e)=>t===e?null:t,ge=t=>e=>e==="ja"?t.ja:t.en;class De{#e;#r;#n=jt;constructor(e,s=()=>{}){this.#e=e,this.#r=s,e.addController(this)}get locale(){return this.#n}hostConnected(){this.#n=Rt(this.#e),document.addEventListener(Pe,this.#s)}hostDisconnected(){document.removeEventListener(Pe,this.#s)}#s=()=>{const e=Rt(this.#e);e!==this.#n&&(this.#n=e,this.#r(),this.#e.requestUpdate())}}const En={paper:["#f6f7f9","#0e1014"],"paper-raised":["#ffffff","#171a20"],"paper-sunken":["#eff1f4","#0a0b0e"],"paper-inset":["#e7eaef","#22262e"],ink:["#11141b","#eceef3"],"ink-soft":["#464e5f","#a9b0bd"],"ink-faint":["#788195","#737b8b"],rule:["rgba(17, 24, 39, 0.08)","rgba(226, 232, 244, 0.08)"],"rule-strong":["rgba(17, 24, 39, 0.13)","rgba(226, 232, 244, 0.14)"],"rule-hover":["rgba(17, 24, 39, 0.24)","rgba(226, 232, 244, 0.26)"],accent:["#e04e1f","#f26a3d"],"accent-strong":["#c63f12","#dc5226"],"accent-bright":["#f0652f","#ff8a5e"],"accent-soft":["rgba(224, 78, 31, 0.08)","rgba(242, 106, 61, 0.14)"],"accent-ink":["#ffffff","#ffffff"],blue:["#3563d9","#7aa2f7"],"blue-strong":["#2a4fb3","#5b86e8"],"blue-soft":["rgba(53, 99, 217, 0.09)","rgba(122, 162, 247, 0.15)"],green:["#15894a","#4cc787"],"green-soft":["rgba(21, 137, 74, 0.09)","rgba(76, 199, 135, 0.14)"],amber:["#b27406","#e9ae45"],"amber-soft":["rgba(178, 116, 6, 0.1)","rgba(233, 174, 69, 0.15)"],violet:["#7549d6","#ab90f5"],"violet-soft":["rgba(117, 73, 214, 0.09)","rgba(171, 144, 245, 0.15)"],danger:["#c11d38","#f5707f"],"danger-soft":["rgba(214, 53, 80, 0.09)","rgba(245, 112, 127, 0.14)"],shade:["rgb(17, 24, 39)","rgb(0, 0, 0)"],"shade-1":["rgba(17, 24, 39, 0.06)","rgba(0, 0, 0, 0.32)"],"shade-2":["rgba(17, 24, 39, 0.08)","rgba(0, 0, 0, 0.38)"],"shade-3":["rgba(17, 24, 39, 0.13)","rgba(0, 0, 0, 0.5)"],highlight:["rgba(255, 255, 255, 0.9)","rgba(255, 255, 255, 0.05)"]},Nt=t=>gt(Object.entries(En).map(([e,[s,n]])=>`--dpk-${e}: ${t(s,n)};`).join(`
4
- `)),me=R`
5
- :host {
6
- /* Browsers without light-dark() stay light. */
7
- ${Nt(t=>t)}
8
- --dpk-display: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
9
- --dpk-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
10
- --dpk-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
11
-
12
- /* Shape + elevation scale, so every surface reads as one system. */
13
- --dpk-radius-xs: 6px;
14
- --dpk-radius-sm: 8px;
15
- --dpk-radius: 10px;
16
- --dpk-radius-lg: 14px;
17
- --dpk-radius-xl: 20px;
18
- --dpk-bevel: inset 0 1px 0 var(--dpk-highlight);
19
- --dpk-shadow-xs: 0 1px 2px var(--dpk-shade-1);
20
- --dpk-shadow-sm: 0 1px 2px var(--dpk-shade-1), 0 3px 8px -2px var(--dpk-shade-2);
21
- --dpk-shadow:
22
- 0 1px 2px var(--dpk-shade-1), 0 6px 16px -4px var(--dpk-shade-2), 0 14px 32px -12px var(--dpk-shade-3);
23
- --dpk-shadow-lg:
24
- 0 2px 4px var(--dpk-shade-1), 0 12px 28px -6px var(--dpk-shade-2), 0 32px 64px -20px var(--dpk-shade-3);
25
- --dpk-focus: 0 0 0 1px var(--dpk-paper-raised), 0 0 0 3.5px color-mix(in srgb, var(--dpk-blue) 45%, transparent);
26
- --dpk-control-h: 32px;
27
- --dpk-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
28
- --dpk-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
29
- /* Frosted chrome: headers and toolbars that float over scrolling content. */
30
- --dpk-glass: color-mix(in srgb, var(--dpk-paper-raised) 78%, transparent);
31
- /* Working surface behind boards and canvases: a quiet dot lattice. */
32
- --dpk-dots: radial-gradient(circle at 1px 1px, var(--dpk-rule-strong) 1px, transparent 0) 0 0 / 20px 20px;
33
-
34
- color: var(--dpk-ink);
35
- font-family: var(--dpk-body);
36
- font-size: 14px;
37
- line-height: 1.5;
38
- -webkit-font-smoothing: antialiased;
39
- text-rendering: optimizeLegibility;
40
- display: block;
41
- }
42
-
43
- @supports (color: light-dark(#000, #fff)) {
44
- :host {
45
- ${Nt((t,e)=>`light-dark(${t}, ${e})`)}
46
- }
47
- }
48
-
49
- *,
50
- *::before,
51
- *::after {
52
- box-sizing: border-box;
53
- }
54
-
55
- h1,
56
- h2,
57
- h3,
58
- h4 {
59
- font-family: var(--dpk-display);
60
- font-weight: 660;
61
- margin: 0;
62
- line-height: 1.2;
63
- letter-spacing: -0.015em;
64
- }
65
-
66
- button {
67
- font: inherit;
68
- color: inherit;
69
- }
70
-
71
- ::selection {
72
- background: color-mix(in srgb, var(--dpk-blue) 22%, transparent);
73
- }
74
-
75
- .dpk-mono,
76
- .dpk-num {
77
- font-variant-numeric: tabular-nums;
78
- }
79
-
80
- .dpk-label {
81
- font-family: var(--dpk-mono);
82
- font-size: 10px;
83
- font-weight: 550;
84
- letter-spacing: 0.1em;
85
- text-transform: uppercase;
86
- color: var(--dpk-ink-faint);
87
- }
88
-
89
- @media (prefers-reduced-motion: reduce) {
90
- *,
91
- *::before,
92
- *::after {
93
- animation-duration: 1ms !important;
94
- animation-iteration-count: 1 !important;
95
- transition-duration: 1ms !important;
96
- }
97
- }
98
- `,be=R`
99
- .dpk-btn {
100
- display: inline-flex;
101
- align-items: center;
102
- justify-content: center;
103
- gap: 6px;
104
- min-height: 30px;
105
- padding: 0 12px;
106
- border: 1px solid var(--dpk-rule-strong);
107
- border-radius: var(--dpk-radius-sm);
108
- background: var(--dpk-paper-raised);
109
- color: var(--dpk-ink);
110
- font-size: 12.5px;
111
- font-weight: 550;
112
- line-height: 1;
113
- white-space: nowrap;
114
- box-shadow: var(--dpk-bevel), var(--dpk-shadow-xs);
115
- cursor: pointer;
116
- transition:
117
- background 160ms var(--dpk-ease),
118
- border-color 160ms var(--dpk-ease),
119
- box-shadow 160ms var(--dpk-ease),
120
- color 160ms var(--dpk-ease),
121
- transform 120ms var(--dpk-ease);
122
- }
123
-
124
- .dpk-btn:hover:not([disabled]) {
125
- border-color: var(--dpk-rule-hover);
126
- box-shadow: var(--dpk-bevel), var(--dpk-shadow-sm);
127
- }
128
-
129
- .dpk-btn:active:not([disabled]) {
130
- transform: translateY(1px) scale(0.985);
131
- box-shadow: none;
132
- }
133
-
134
- .dpk-btn:focus-visible {
135
- outline: none;
136
- box-shadow: var(--dpk-focus);
137
- }
138
-
139
- .dpk-btn[disabled] {
140
- opacity: 0.45;
141
- box-shadow: none;
142
- cursor: not-allowed;
143
- }
144
-
145
- .dpk-btn--accent {
146
- border-color: color-mix(in srgb, var(--dpk-accent-strong) 70%, transparent);
147
- background: linear-gradient(180deg, var(--dpk-accent-bright), var(--dpk-accent) 55%, var(--dpk-accent-strong));
148
- color: var(--dpk-accent-ink);
149
- text-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
150
- box-shadow:
151
- inset 0 1px 0 rgba(255, 255, 255, 0.22),
152
- 0 1px 2px color-mix(in srgb, var(--dpk-accent) 30%, transparent),
153
- 0 4px 12px -4px color-mix(in srgb, var(--dpk-accent) 55%, transparent);
154
- }
155
-
156
- .dpk-btn--accent:hover:not([disabled]) {
157
- border-color: color-mix(in srgb, var(--dpk-accent-strong) 70%, transparent);
158
- background: linear-gradient(180deg, var(--dpk-accent-bright), var(--dpk-accent-bright) 40%, var(--dpk-accent));
159
- box-shadow:
160
- inset 0 1px 0 rgba(255, 255, 255, 0.25),
161
- 0 2px 4px color-mix(in srgb, var(--dpk-accent) 30%, transparent),
162
- 0 8px 20px -6px color-mix(in srgb, var(--dpk-accent) 65%, transparent);
163
- }
164
-
165
- /* Selection state, shared by every template's filter/nav controls. */
166
- .dpk-btn--selected {
167
- border-color: color-mix(in srgb, var(--dpk-blue-strong) 70%, transparent);
168
- background: linear-gradient(180deg, var(--dpk-blue), var(--dpk-blue-strong));
169
- color: #fff;
170
- box-shadow:
171
- inset 0 1px 0 rgba(255, 255, 255, 0.2),
172
- 0 2px 8px -2px color-mix(in srgb, var(--dpk-blue) 60%, transparent);
173
- }
174
-
175
- .dpk-btn--selected:hover:not([disabled]) {
176
- border-color: color-mix(in srgb, var(--dpk-blue-strong) 70%, transparent);
177
- background: linear-gradient(180deg, var(--dpk-blue), var(--dpk-blue));
178
- box-shadow:
179
- inset 0 1px 0 rgba(255, 255, 255, 0.22),
180
- 0 4px 12px -3px color-mix(in srgb, var(--dpk-blue) 65%, transparent);
181
- }
182
-
183
- .dpk-btn--ghost {
184
- border-color: transparent;
185
- background: transparent;
186
- box-shadow: none;
187
- color: var(--dpk-ink-soft);
188
- }
189
-
190
- .dpk-btn--ghost:hover:not([disabled]) {
191
- background: var(--dpk-paper-inset);
192
- border-color: transparent;
193
- box-shadow: none;
194
- color: var(--dpk-ink);
195
- }
196
-
197
- .dpk-icon-btn {
198
- position: relative;
199
- display: inline-flex;
200
- align-items: center;
201
- justify-content: center;
202
- width: 26px;
203
- height: 26px;
204
- padding: 0;
205
- border: 1px solid transparent;
206
- border-radius: var(--dpk-radius-xs);
207
- background: transparent;
208
- color: var(--dpk-ink-faint);
209
- font-size: 11px;
210
- line-height: 1;
211
- cursor: pointer;
212
- transition:
213
- background 160ms var(--dpk-ease),
214
- color 160ms var(--dpk-ease),
215
- transform 160ms var(--dpk-ease-spring);
216
- }
217
-
218
- .dpk-icon-btn:hover:not([disabled]) {
219
- background: var(--dpk-paper-inset);
220
- color: var(--dpk-ink);
221
- }
222
-
223
- .dpk-icon-btn:active:not([disabled]) {
224
- transform: scale(0.92);
225
- }
226
-
227
- .dpk-icon-btn:focus-visible {
228
- outline: none;
229
- box-shadow: var(--dpk-focus);
230
- }
231
-
232
- .dpk-icon-btn[disabled] {
233
- opacity: 0.35;
234
- cursor: default;
235
- }
236
-
237
- .dpk-icon-btn[data-active='true'] {
238
- background: var(--dpk-blue-soft);
239
- color: var(--dpk-blue);
240
- }
241
-
242
- .dpk-icon-btn svg {
243
- display: block;
244
- width: 15px;
245
- height: 15px;
246
- }
247
-
248
- /* Count badge for an icon-only control (comments on a card, drafts on the rail). */
249
- .dpk-icon-badge {
250
- position: absolute;
251
- top: -5px;
252
- right: -5px;
253
- min-width: 16px;
254
- height: 16px;
255
- padding: 0 4px;
256
- border: 1.5px solid var(--dpk-paper-raised);
257
- border-radius: 999px;
258
- background: linear-gradient(180deg, var(--dpk-accent-bright), var(--dpk-accent));
259
- color: var(--dpk-accent-ink);
260
- font-family: var(--dpk-mono);
261
- font-size: 9px;
262
- font-weight: 650;
263
- font-variant-numeric: tabular-nums;
264
- line-height: 13px;
265
- text-align: center;
266
- box-shadow: 0 2px 6px -1px color-mix(in srgb, var(--dpk-accent) 55%, transparent);
267
- animation: dpk-pop 260ms var(--dpk-ease-spring);
268
- }
269
-
270
- @keyframes dpk-pop {
271
- from {
272
- transform: scale(0.4);
273
- opacity: 0;
274
- }
275
- }
276
-
277
- .dpk-input,
278
- .dpk-textarea,
279
- .dpk-select {
280
- box-sizing: border-box;
281
- width: 100%;
282
- min-height: var(--dpk-control-h);
283
- padding: 6px 10px;
284
- border: 1px solid var(--dpk-rule-strong);
285
- border-radius: var(--dpk-radius-sm);
286
- background: var(--dpk-paper-raised);
287
- color: var(--dpk-ink);
288
- font: inherit;
289
- font-size: 12.5px;
290
- box-shadow: inset 0 1px 2px var(--dpk-shade-1);
291
- transition:
292
- border-color 160ms var(--dpk-ease),
293
- box-shadow 160ms var(--dpk-ease),
294
- background 160ms var(--dpk-ease);
295
- }
296
-
297
- .dpk-input::placeholder,
298
- .dpk-textarea::placeholder {
299
- color: var(--dpk-ink-faint);
300
- }
301
-
302
- .dpk-input:hover,
303
- .dpk-textarea:hover,
304
- .dpk-select:hover {
305
- border-color: var(--dpk-rule-hover);
306
- }
307
-
308
- .dpk-input:focus,
309
- .dpk-textarea:focus,
310
- .dpk-select:focus {
311
- outline: none;
312
- border-color: var(--dpk-blue);
313
- box-shadow: var(--dpk-focus);
314
- }
315
-
316
- .dpk-select {
317
- appearance: none;
318
- background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%23878e9e' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/></svg>");
319
- background-repeat: no-repeat;
320
- background-position: right 8px center;
321
- padding-right: 28px;
322
- box-shadow: var(--dpk-bevel), var(--dpk-shadow-xs);
323
- cursor: pointer;
324
- }
325
-
326
- .dpk-textarea {
327
- resize: vertical;
328
- min-height: 64px;
329
- line-height: 1.55;
330
- }
331
- `,Tn=R`
332
- .comment-pop {
333
- box-sizing: border-box;
334
- overflow: auto;
335
- position: fixed;
336
- inset: auto;
337
- margin: 0;
338
- display: grid;
339
- gap: 10px;
340
- padding: 14px;
341
- border: 1px solid var(--dpk-rule-strong);
342
- border-radius: var(--dpk-radius-lg);
343
- background: var(--dpk-paper-raised);
344
- box-shadow: var(--dpk-bevel), var(--dpk-shadow-lg);
345
- color: var(--dpk-ink);
346
- font-size: 12.5px;
347
- animation: dpk-pop-in 180ms var(--dpk-ease);
348
- }
349
-
350
- @keyframes dpk-pop-in {
351
- from {
352
- opacity: 0;
353
- transform: translateY(4px) scale(0.98);
354
- }
355
- }
356
-
357
- .comment-pop .comment-list {
358
- list-style: none;
359
- margin: 0;
360
- padding: 0;
361
- display: grid;
362
- gap: 6px;
363
- max-height: 140px;
364
- overflow: auto;
365
- font-size: 12px;
366
- color: var(--dpk-ink-soft);
367
- }
368
-
369
- .comment-pop .comment-list li {
370
- padding: 6px 10px;
371
- border-radius: var(--dpk-radius-xs);
372
- background: var(--dpk-accent-soft);
373
- border-left: 2px solid var(--dpk-accent);
374
- }
375
-
376
- .comment-pop .dpk-textarea {
377
- min-height: 54px;
378
- }
379
-
380
- .pop-actions {
381
- display: flex;
382
- gap: 4px;
383
- align-items: center;
384
- justify-content: flex-end;
385
- }
386
- `,W=(t,e)=>t instanceof e?t:null,Mn=ge({en:{clickToEdit:"Click to edit",unset:"Not set",edit:"Edit"},ja:{clickToEdit:"\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u7DE8\u96C6",unset:"\u672A\u8A2D\u5B9A",edit:"\u7DE8\u96C6"}});class Pt extends O{static{this.styles=[me,be,R`
387
- :host {
388
- display: inline;
389
- /* Inherit the surrounding type scale instead of forcing the chrome size:
390
- an inline edit inside a 17px heading must look like a 17px heading.
391
- Color comes along too, so an edit on a colored card stays legible. */
392
- font-family: inherit;
393
- font-size: inherit;
394
- font-weight: inherit;
395
- line-height: inherit;
396
- color: inherit;
397
- }
398
-
399
- .view {
400
- cursor: text;
401
- border-bottom: 1px dashed transparent;
402
- border-radius: var(--dpk-radius-xs);
403
- padding: 1px 4px;
404
- transition:
405
- background 140ms var(--dpk-ease),
406
- border-color 140ms var(--dpk-ease),
407
- box-shadow 140ms var(--dpk-ease);
408
- }
409
-
410
- .view:hover {
411
- border-bottom-color: var(--dpk-blue);
412
- background: var(--dpk-blue-soft);
413
- box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--dpk-blue) 22%, transparent);
414
- }
415
-
416
- .view[data-empty='true'] {
417
- border-bottom-color: var(--dpk-rule-strong);
418
- color: var(--dpk-ink-faint);
419
- font-style: italic;
420
- }
421
-
422
- .view[data-empty='true']:hover {
423
- border-bottom-color: var(--dpk-blue);
424
- }
425
-
426
- input,
427
- textarea {
428
- font: inherit;
429
- color: inherit;
430
- background: var(--dpk-paper-raised);
431
- border: 1px solid var(--dpk-blue);
432
- border-radius: var(--dpk-radius-sm);
433
- box-shadow: var(--dpk-focus);
434
- padding: 3px 7px;
435
- min-width: 0;
436
- width: 100%;
437
- transition: box-shadow 140ms var(--dpk-ease);
438
- animation: dpk-inline-edit-in 140ms var(--dpk-ease) backwards;
439
- }
440
-
441
- @keyframes dpk-inline-edit-in {
442
- from {
443
- opacity: 0;
444
- transform: translateY(1px) scale(0.99);
445
- }
446
- }
447
-
448
- textarea {
449
- min-height: var(--dpk-inline-textarea-min-height, 90px);
450
- resize: vertical;
451
- font-family: var(--dpk-body);
452
- line-height: 1.5;
453
- }
454
-
455
- /* wrap: the field wraps like the text it replaces, and Enter still
456
- commits, so a one-line value is edited without losing sight of it. */
457
- :host([wrap]) textarea {
458
- min-height: 0;
459
- resize: none;
460
- line-height: inherit;
461
- }
462
-
463
- /* seamless: no field chrome at all — the text is edited where it sits.
464
- The chrome theme paints fields with its own ink and size, so the
465
- seamless field re-states the inherited type and color. */
466
- :host([seamless]) input,
467
- :host([seamless]) textarea {
468
- padding: 0;
469
- border: none;
470
- border-radius: 0;
471
- background: transparent;
472
- box-shadow: none;
473
- height: 100%;
474
- min-height: 0;
475
- overflow: auto;
476
- resize: none;
477
- font: inherit;
478
- font-size: inherit;
479
- line-height: inherit;
480
- color: inherit;
481
- }
482
-
483
- :host([seamless]) .view {
484
- padding: 0;
485
- }
486
- `]}static{this.properties={value:{type:String},placeholder:{type:String},multiline:{type:Boolean},wrap:{type:Boolean,reflect:!0},seamless:{type:Boolean,reflect:!0},label:{type:String},editing:{state:!0}}}#e="";#r=0;#n=new De(this);connectedCallback(){super.connectedCallback(),this.#r+=1}constructor(){super(),this.value="",this.placeholder="",this.multiline=!1,this.wrap=!1,this.seamless=!1,this.label="",this.editing=!1,this.#e=""}startEditing(){this.#e=this.value,this.editing=!0}willUpdate(e){e.has("value")&&!this.editing&&(this.#e=this.value)}updated(){if(!this.editing)return;const e=this.renderRoot.querySelector("input, textarea"),s=this.renderRoot,n=s instanceof ShadowRoot?s.activeElement:document.activeElement;e&&n!==e&&(e.focus(),e.select())}render(){const e=Mn(this.#n.locale);if(!this.editing){const n=this.value.length===0;return f`<span
487
- class="view"
488
- data-empty=${String(n)}
489
- role="button"
490
- tabindex="0"
491
- title=${e.clickToEdit}
492
- @click=${this.#s}
493
- @keydown=${this.#i}
494
- >${n?this.placeholder||e.unset:this.value}</span
495
- >`}const s=this.label||this.placeholder||e.edit;return f`
496
- ${this.multiline||this.wrap?f`<textarea
497
- class="dpk-textarea"
498
- .value=${this.#e}
499
- aria-label=${s}
500
- @input=${this.#t}
501
- @keydown=${this.#o}
502
- @blur=${this.#d}
503
- ></textarea>`:f`<input
504
- class="dpk-input"
505
- .value=${this.#e}
506
- aria-label=${s}
507
- @input=${this.#t}
508
- @keydown=${this.#o}
509
- @blur=${this.#d}
510
- />`}
511
- `}#s=e=>{e.stopPropagation(),this.editing=!0};#i=e=>{e.isComposing||(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.editing=!0)};#t=e=>{const s=W(e.target,HTMLInputElement)??W(e.target,HTMLTextAreaElement);s!==null&&(this.#e=s.value)};#o=e=>{if(!e.isComposing){if(e.key==="Escape"){e.preventDefault(),this.#e=this.value,this.editing=!1;return}e.key==="Enter"&&(!this.multiline||this.wrap||e.metaKey||e.ctrlKey)&&(e.preventDefault(),this.#a())}};#d=e=>{const s=e.currentTarget;if(!(s instanceof HTMLInputElement||s instanceof HTMLTextAreaElement))return;const n=this.#r,{selectionStart:r,selectionEnd:i}=s;queueMicrotask(()=>{!this.isConnected||!this.editing||(n!==this.#r?(s.focus(),s.setSelectionRange(r,i)):this.#a())})};#a=()=>{if(!this.editing)return;this.editing=!1;const s=(this.wrap?this.#e.replace(/\r?\n/g," "):this.#e).trim();s!==this.value&&this.dispatchEvent(new CustomEvent("dpk-commit",{detail:{value:s},bubbles:!0,composed:!0}))}}const On=()=>{customElements.get("dpk-component-inline-edit")||customElements.define("dpk-component-inline-edit",Pt)},jn={lang:void 0,message:void 0,abortEarly:void 0,abortPipeEarly:void 0};function Ie(t){return jn}let Ln;function Rn(t){return Ln?.get(t)}let zn;function Nn(t){return zn?.get(t)}let Pn;function Dn(t,e){return Pn?.get(t)?.get(e)}function ne(t){const e=typeof t;return e==="string"?`"${t}"`:e==="number"||e==="bigint"||e==="boolean"?`${t}`:e==="object"||e==="function"?(t&&Object.getPrototypeOf(t)?.constructor?.name)??"null":e}function x(t,e,s,n,r){const i=r&&"input"in r?r.input:s.value,o=r?.expected??t.expects??null,d=r?.received??ne(i),a={kind:t.kind,type:t.type,input:i,expected:o,received:d,message:`Invalid ${e}: ${o?`Expected ${o} but r`:"R"}eceived ${d}`,requirement:t.requirement,path:r?.path,issues:r?.issues,lang:n.lang,abortEarly:n.abortEarly,abortPipeEarly:n.abortPipeEarly},l=t.kind==="schema",p=r?.message??t.message??Dn(t.reference,a.lang)??(l?Nn(a.lang):null)??n.message??Rn(a.lang);p!==void 0&&(a.message=typeof p=="function"?p(a):p),l&&(s.typed=!1),s.issues?s.issues.push(a):s.issues=[a]}function In(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function Un(t,e){return Object.prototype.hasOwnProperty.call(t,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function Ue(t,e){const s=[...new Set(t)];return s.length>1?`(${s.join(` ${e} `)})`:s[0]??"never"}function w(t){return t["~standard"]={version:1,vendor:"valibot",validate:e=>t["~run"]({value:e},Ie())},t}var qn=class extends Error{constructor(t){super(t[0].message),this.name="ValiError",this.issues=t}};function Dt(t){return{kind:"validation",type:"integer",reference:Dt,async:!1,expects:null,requirement:Number.isInteger,message:t,"~run"(e,s){return e.typed&&!this.requirement(e.value)&&x(this,"integer",e,s),e}}}function v(t,e){return{kind:"validation",type:"min_length",reference:v,async:!1,expects:`>=${t}`,requirement:t,message:e,"~run"(s,n){return s.typed&&s.value.length<this.requirement&&x(this,"length",s,n,{received:`${s.value.length}`}),s}}}function It(t,e){return{kind:"validation",type:"min_value",reference:It,async:!1,expects:`>=${t instanceof Date?t.toJSON():ne(t)}`,requirement:t,message:e,"~run"(s,n){return s.typed&&!(s.value>=this.requirement)&&x(this,"value",s,n,{received:s.value instanceof Date?s.value.toJSON():ne(s.value)}),s}}}function I(t,e){return{kind:"validation",type:"regex",reference:I,async:!1,expects:`${t}`,requirement:t,message:e,"~run"(s,n){return s.typed&&!this.requirement.test(s.value)&&x(this,"format",s,n),s}}}function qe(){return{kind:"transformation",type:"trim",reference:qe,async:!1,"~run"(t){return t.value=t.value.trim(),t}}}const Bn={abortEarly:!0};function Ut(t,e,s){return typeof t.fallback=="function"?t.fallback(e,s):t.fallback}function ke(t,e,s){return typeof t.default=="function"?t.default(e,s):t.default}function U(t,e){return w({kind:"schema",type:"array",reference:U,expects:"Array",async:!1,item:t,message:e,"~run"(s,n){const r=s.value;if(Array.isArray(r)){s.typed=!0,s.value=[];for(let i=0;i<r.length;i++){const o=r[i],d=this.item["~run"]({value:o},n);if(d.issues){const a={type:"array",origin:"value",input:r,key:i,value:o};for(const l of d.issues)l.path?l.path.unshift(a):l.path=[a],s.issues?.push(l);if(s.issues||(s.issues=d.issues),n.abortEarly){s.typed=!1;break}}d.typed||(s.typed=!1),s.value.push(d.value)}}else x(this,"type",s,n);return s}})}function qt(t){return w({kind:"schema",type:"boolean",reference:qt,expects:"boolean",async:!1,message:t,"~run"(e,s){return typeof e.value=="boolean"?e.typed=!0:x(this,"type",e,s),e}})}function S(t,e){return w({kind:"schema",type:"exact_optional",reference:S,expects:t.expects,async:!1,wrapped:t,default:e,"~run"(s,n){return this.wrapped["~run"](s,n)}})}function Bt(t){return w({kind:"schema",type:"lazy",reference:Bt,expects:"unknown",async:!1,getter:t,"~run"(e,s){return this.getter(e.value)["~run"](e,s)}})}function J(t,e){return w({kind:"schema",type:"literal",reference:J,expects:ne(t),async:!1,literal:t,message:e,"~run"(s,n){return In(s.value,this.literal)?s.typed=!0:x(this,"type",s,n),s}})}function Ht(t,e){return w({kind:"schema",type:"nullable",reference:Ht,expects:`(${t.expects} | null)`,async:!1,wrapped:t,default:e,"~run"(s,n){return s.value===null&&(this.default!==void 0&&(s.value=ke(this,s,n)),s.value===null)?(s.typed=!0,s):this.wrapped["~run"](s,n)}})}function Ft(t){return w({kind:"schema",type:"number",reference:Ft,expects:"number",async:!1,message:t,"~run"(e,s){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:x(this,"type",e,s),e}})}function $(t,e){return w({kind:"schema",type:"object",reference:$,expects:"Object",async:!1,entries:t,message:e,"~run"(s,n){const r=s.value;if(r&&typeof r=="object"){s.typed=!0,s.value={};for(const i in this.entries){const o=this.entries[i];if(i in r||(o.type==="exact_optional"||o.type==="optional"||o.type==="nullish")&&o.default!==void 0){const d=i in r?r[i]:ke(o),a=o["~run"]({value:d},n);if(a.issues){const l={type:"object",origin:"value",input:r,key:i,value:d};for(const p of a.issues)p.path?p.path.unshift(l):p.path=[l],s.issues?.push(p);if(s.issues||(s.issues=a.issues),n.abortEarly){s.typed=!1;break}}a.typed||(s.typed=!1),s.value[i]=a.value}else if(o.fallback!==void 0)s.value[i]=Ut(o);else if(o.type!=="exact_optional"&&o.type!=="optional"&&o.type!=="nullish"&&(x(this,"key",s,n,{input:void 0,expected:`"${i}"`,path:[{type:"object",origin:"key",input:r,key:i,value:r[i]}]}),n.abortEarly))break}}else x(this,"type",s,n);return s}})}function ve(t,e){return w({kind:"schema",type:"optional",reference:ve,expects:`(${t.expects} | undefined)`,async:!1,wrapped:t,default:e,"~run"(s,n){return s.value===void 0&&(this.default!==void 0&&(s.value=ke(this,s,n)),s.value===void 0)?(s.typed=!0,s):this.wrapped["~run"](s,n)}})}function ye(t,e){return w({kind:"schema",type:"picklist",reference:ye,expects:Ue(t.map(ne),"|"),async:!1,options:t,message:e,"~run"(s,n){return this.options.includes(s.value)?s.typed=!0:x(this,"type",s,n),s}})}function Kt(t,e,s){return w({kind:"schema",type:"record",reference:Kt,expects:"Object",async:!1,key:t,value:e,message:s,"~run"(n,r){const i=n.value;if(i&&typeof i=="object"){n.typed=!0,n.value={};for(const o in i)if(Un(i,o)){const d=i[o],a=this.key["~run"]({value:o},r);if(a.issues){const p={type:"object",origin:"key",input:i,key:o,value:d};for(const c of a.issues)c.path=[p],n.issues?.push(c);if(n.issues||(n.issues=a.issues),r.abortEarly){n.typed=!1;break}}const l=this.value["~run"]({value:d},r);if(l.issues){const p={type:"object",origin:"value",input:i,key:o,value:d};for(const c of l.issues)c.path?c.path.unshift(p):c.path=[p],n.issues?.push(c);if(n.issues||(n.issues=l.issues),r.abortEarly){n.typed=!1;break}}(!a.typed||!l.typed)&&(n.typed=!1),a.typed&&(n.value[a.value]=l.value)}}else x(this,"type",n,r);return n}})}function V(t,e){return w({kind:"schema",type:"strict_object",reference:V,expects:"Object",async:!1,entries:t,message:e,"~run"(s,n){const r=s.value;if(r&&typeof r=="object"){s.typed=!0,s.value={};for(const i in this.entries){const o=this.entries[i];if(i in r||(o.type==="exact_optional"||o.type==="optional"||o.type==="nullish")&&o.default!==void 0){const d=i in r?r[i]:ke(o),a=o["~run"]({value:d},n);if(a.issues){const l={type:"object",origin:"value",input:r,key:i,value:d};for(const p of a.issues)p.path?p.path.unshift(l):p.path=[l],s.issues?.push(p);if(s.issues||(s.issues=a.issues),n.abortEarly){s.typed=!1;break}}a.typed||(s.typed=!1),s.value[i]=a.value}else if(o.fallback!==void 0)s.value[i]=Ut(o);else if(o.type!=="exact_optional"&&o.type!=="optional"&&o.type!=="nullish"&&(x(this,"key",s,n,{input:void 0,expected:`"${i}"`,path:[{type:"object",origin:"key",input:r,key:i,value:r[i]}]}),n.abortEarly))break}if(!s.issues||!n.abortEarly){for(const i in r)if(!Object.prototype.hasOwnProperty.call(this.entries,i)){x(this,"key",s,n,{input:i,expected:"never",path:[{type:"object",origin:"key",input:r,key:i,value:r[i]}]});break}}}else x(this,"type",s,n);return s}})}function m(t){return w({kind:"schema",type:"string",reference:m,expects:"string",async:!1,message:t,"~run"(e,s){return typeof e.value=="string"?e.typed=!0:x(this,"type",e,s),e}})}function Wt(t){let e;if(t)for(const s of t)if(e)for(const n of s.issues)e.push(n);else e=s.issues;return e}function Jt(t,e){return w({kind:"schema",type:"union",reference:Jt,expects:Ue(t.map(s=>s.expects),"|"),async:!1,options:t,message:e,"~run"(s,n){let r,i,o;for(const d of this.options){const a=d["~run"]({value:s.value},n);if(a.typed)if(a.issues)i?i.push(a):i=[a];else{r=a;break}else o?o.push(a):o=[a]}if(r)return r;if(i){if(i.length===1)return i[0];x(this,"type",s,n,{issues:Wt(i)}),s.typed=!0}else{if(o?.length===1)return o[0];x(this,"type",s,n,{issues:Wt(o)})}return s}})}function q(){return w({kind:"schema",type:"unknown",reference:q,expects:"unknown",async:!1,"~run"(t){return t.typed=!0,t}})}function Vt(t,e,s){return w({kind:"schema",type:"variant",reference:Vt,expects:"Object",async:!1,key:t,options:e,message:s,"~run"(n,r){const i=n.value;if(i&&typeof i=="object"){let o,d=0,a=this.key,l=[];const p=(c,h)=>{for(const u of c.options){if(u.type==="variant")p(u,new Set(h).add(u.key));else{let b=!0,C=0;for(const A of h){const L=u.entries[A];if(A in i?L["~run"]({typed:!1,value:i[A]},Bn).issues:L.type!=="exact_optional"&&L.type!=="optional"&&L.type!=="nullish"){b=!1,a!==A&&(d<C||d===C&&A in i&&!(a in i))&&(d=C,a=A,l=[]),a===A&&l.push(u.entries[A].expects);break}C++}if(b){const A=u["~run"]({value:i},r);(!o||!o.typed&&A.typed)&&(o=A)}}if(o&&!o.issues)break}};if(p(this,new Set([this.key])),o)return o;x(this,"type",n,r,{input:i[a],expected:Ue(l,"|"),path:[{type:"object",origin:"value",input:i,key:a,value:i[a]}]})}else x(this,"type",n,r);return n}})}function Yt(t,e,s){const n=t["~run"]({value:e},Ie());if(n.issues)throw new qn(n.issues);return n.value}function k(...t){return w({...t[0],pipe:t,"~run"(e,s){for(const n of t)if(n.kind!=="metadata"){if(e.issues&&(n.kind==="schema"||n.kind==="transformation")){e.typed=!1;break}(!e.issues||!s.abortEarly&&!s.abortPipeEarly)&&(e=n["~run"](e,s))}return e}})}function y(t,e,s){const n=t["~run"]({value:e},Ie());return{typed:n.typed,success:!n.issues,output:n.value,issues:n.issues}}const xe=$({type:k(m(),v(1)),id:k(m(),v(1))}),Hn=k(m(),v(1),I(/^[A-Za-z0-9_-]+$/,'ids may only contain letters, digits, "_" and "-" (a "." builds a path)')),Fn=(t,e)=>{if(e===1)return t.includes(".")?null:[t];const s=t.split(".");return s.length===e&&s.every(n=>n.length>0)?s:null},Y=$({id:k(m(),v(1)),type:k(m(),v(1)),target:xe,payload:q(),note:S(m()),createdAt:k(m(),v(1))}),Kn=(t,e,s,n={})=>{const r=$({id:k(m(),v(1)),type:J(t),target:xe,payload:s,note:S(m()),createdAt:k(m(),v(1))}),i=o=>{const d=y(Y,o);if(!d.success||d.output.type!==t)return null;const a=y(s,o.payload);return a.success?{id:d.output.id,type:t,target:d.output.target,payload:a.output,...d.output.note===void 0?{}:{note:d.output.note},createdAt:d.output.createdAt}:null};return{schema:r,mode:n.mode??"patch",targetType:e,actionType:t,payloadSchema:s,parse:i,...n.dedupeKey?{dedupeKey:n.dedupeKey}:{}}},Wn=(t,e)=>{const s=we(t,e.type);if(s===void 0)return null;const n=s.parse(e);return n===null?null:n},Jn=(t,e)=>{const s=y(t.payloadSchema,e.payload);if(!s.success)throw new Error(`invalid payload for action "${e.type}"`);return s.output},we=(t,e)=>Object.hasOwn(t,e)?t[e]:void 0,Vn=t=>{throw new Error(`unhandled action: ${JSON.stringify(t)}`)},Yn=$({id:k(m(),v(1))}),Gn=t=>{const e=y(Yn,t.payload);return`${t.type}|${e.success?e.output.id:JSON.stringify(t.payload)}`},_=t=>`${t.type}:${t.id}`,Gt=t=>{const e=t.indexOf(":");return e<=0?{type:"unknown",id:t}:{type:t.slice(0,e),id:t.slice(e+1)}},Be=(t,e)=>typeof t=="string"?Gt(t.includes(":")?t:`${e}:${t}`):{type:t.type,id:t.id},Zn=(t,e)=>t.type===e.type&&t.id===e.id,Zt=t=>{const e=t.normalize("NFKD").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40);return e.length>0?e:"item"},Xn=(t,e)=>{const s=Zt(t),n=new Set(e);if(!n.has(s))return s;for(let r=2;r<1e3;r+=1){const i=`${s}-${r}`;if(!n.has(i))return i}return`${s}-${Math.random().toString(36).slice(2,8)}`},Xt=()=>{const t=globalThis.crypto;return t?.randomUUID?t.randomUUID():`a-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`},E="comment",re=t=>{const[e]=t;return{path:e?.path?.map(s=>String(s.key)).join(".")??"",message:e?.message??"invalid action"}},Qt=$({type:k(m(),v(1)),target:Jt([k(m(),v(1)),xe]),payload:ve(q()),note:S(m()),id:S(k(m(),v(1))),createdAt:S(k(m(),v(1)))}),Qn=(t,e)=>{const s=y(Qt,t);if(!s.success)return{ok:!1,issue:re(s.issues)};const n=s.output,r=Be(n.target,e.targetType),i={id:n.id??Xt(),type:n.type,target:r,payload:n.payload??{},...n.note===void 0?{}:{note:n.note},createdAt:n.createdAt??new Date().toISOString()},o=y(e.schema,i);if(!o.success)return{ok:!1,issue:re(o.issues)};const d=y(Y,o.output);return d.success?{ok:!0,action:d.output}:{ok:!1,issue:re(d.issues)}},He=(t,e)=>e.dedupeKey?e.dedupeKey(t):e.mode!=="patch"?null:`${t.type}|${_(t.target)}`,Fe=(t,e,s)=>{const n=He(e,s);if(n===null)return[...t,e];const r=t.at(-1);return!r||He(r,s)!==n||!er(r,e)?[...t,e]:[...t.slice(0,-1),e]},er=(t,e)=>Zn(t.target,e.target),Ke=t=>JSON.stringify(t.map(e=>({id:e.id,type:e.type,target:e.target,payload:e.payload,...e.note===void 0?{}:{note:e.note},createdAt:e.createdAt})),null,2),es=$({id:k(m(),v(1)),type:J(E),target:$({type:k(m(),v(1)),id:k(m(),v(1))}),payload:$({body:k(m(),v(1))}),note:S(m()),createdAt:k(m(),v(1))}),ts={schema:es,mode:"append",targetType:"page"},tr=$({body:m()}),$e=t=>{const e=y(tr,t.payload);return e.success?e.output.body:""},We="element",ss=k(m(),I(/^[A-Z][A-Z0-9_]*$/,"component action types are CONSTANT_CASE")),ns=Kt(m(),q()),sr=$({type:J(We),id:k(m(),I(/^[^/]+\/.+/,"component references start with a provider id"))}),nr=$({id:k(m(),v(1)),type:ss,target:sr,payload:ns,note:S(m()),createdAt:k(m(),v(1))}),rr={schema:nr,mode:"sequence",targetType:We},ir=V({type:ss,target:k(m(),I(/^element:[^/]+\/.+/)),payload:ve(ns,{})}),rs=V({id:k(m(),v(1)),title:k(m(),v(1)),summary:S(m()),tone:S(ye(["create","update","delete","move","meta"])),stale:S(ye(["unsupported-action-type","target-missing","constraint-violated"]))}),Je=t=>{if(t.type!==We)return null;const e=t.id.indexOf("/");if(e<=0)return null;try{return decodeURIComponent(t.id.slice(0,e))}catch{return null}},T=t=>t.type!==E&&Je(t.target)!==null,or=(t,e)=>t.filter(s=>T(s)&&Je(s.target)===e),is=(t,e)=>{const s=new Map(t.flatMap(n=>T(n)?[[n.id,Je(n.target)]]:[]));return new Map(e.flatMap(n=>n.results.flatMap(r=>s.get(r.id)===n.id?[[r.id,r]]:[])))},Ve=Object.freeze({}),Ye=t=>{const e=t.startsWith("#")?t.slice(1):t;if(e.length===0)return Ve;const s=new URLSearchParams(e.startsWith("?")?e.slice(1):e),n={};for(const[r,i]of s)r.length>0&&i.length>0&&(n[r]=i);return n},G=t=>{const e=new URLSearchParams;for(const n of Object.keys(t).sort((r,i)=>r<i?-1:r>i?1:0)){const r=t[n];r!=null&&r!==""&&e.set(n,r)}const s=e.toString();return s.length===0?"":`#${s}`},Ge=(t,e,s=[])=>{const n={...t},r=Object.keys(e).map(i=>s.indexOf(i)).filter(i=>i>=0);if(r.length>0)for(const i of s.slice(Math.min(...r)+1))Object.hasOwn(e,i)||delete n[i];for(const[i,o]of Object.entries(e))o==null||o===""?delete n[i]:n[i]=o;return n},ar=(t,e="json")=>`\`\`\`${e}
512
- ${t}
513
- \`\`\``,dr=t=>JSON.stringify({type:t.type,target:t.target,payload:t.payload,...t.note===void 0?{}:{note:t.note}},null,2),Ze=(t,e,s)=>{const{actions:n,state:r}=t,i=new Set(t.stale.map(p=>p.action.id)),o=n.filter(p=>!i.has(p.id)),d=o.filter(p=>p.type===E),a=o.filter(p=>p.type!==E),l=[];if(l.push(`# Review draft \u2014 ${e.label}`),l.push(""),l.push(`- template: \`${e.name}\``),l.push(`- framework: \`dev-process-kit@${s}\``),l.push(`- navigation: \`${G(t.navigation)||"(none)"}\``),l.push(`- pending: ${a.length} change(s), ${d.length} comment(s)`),t.stale.length>0&&l.push(`- stale (not applicable to the current base): ${t.stale.length}`),l.push(""),l.push("## How to apply"),l.push(""),l.push("These are patches against the base HTML, not a command log. Apply the requested end state to the meaning model, keep the stable ids of surviving concepts, and keep the base JSON free of any draft envelope."),a.some(T)&&(l.push(""),l.push("Changes targeting `element:<id>/\u2026` belong to the component with that `id` (for example a diagram): apply them to that component's own JSON, following its documented action vocabulary.")),l.push(""),d.length>0){l.push(`## Comments (${d.length})`),l.push("");for(const[p,c]of d.entries()){const h=e.describe(c,r,t.base);l.push(`${p+1}. **${h.targetLabel}** \u2014 \`${_(c.target)}\``),l.push(` > ${$e(c).replace(/\n/g,`
514
- > `)}`)}l.push("")}if(a.length>0){l.push(`## Requested changes (${a.length})`),l.push("");for(const[p,c]of a.entries()){const h=e.describe(c,r,t.base),u=h.summary?` \u2014 ${h.summary}`:"";l.push(`${p+1}. **${h.title}**${u}`),l.push(` target: \`${_(c.target)}\` (${c.target.type})`),l.push(` \`\`\`json
515
- ${dr(c).replace(/\n/g,`
516
- `)}
517
- \`\`\``)}l.push("")}if(a.length===0&&d.length===0&&(l.push("_No pending draft actions._"),l.push("")),t.stale.length>0){l.push(`## Not applicable to the current base (${t.stale.length})`),l.push(""),l.push("These actions were made against an earlier base and no longer fit it. Do not apply them; mention them if they still matter. The reader can remove them from the review rail."),l.push("");for(const[p,{action:c,reason:h}]of t.stale.entries()){const u=e.describe(c,r,t.base),b=c.type===E?$e(c):u.title;l.push(`${p+1}. \`${c.type}\` on \`${_(c.target)}\` (${h}) \u2014 ${b}`)}l.push("")}return l.push("## Canonical draft (JSON)"),l.push(""),l.push(ar(Ke(n))),l.push(""),l.join(`
518
- `)},Z="0.0.8",Xe=async t=>{try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(t),!0}catch{}const e=document.activeElement,s=document.createElement("textarea");try{return s.value=t,s.setAttribute("readonly",""),s.style.position="fixed",s.style.opacity="0",document.body.append(s),s.select(),document.execCommand("copy")}catch{return!1}finally{s.remove(),e instanceof HTMLElement&&e.focus()}},os=ge({en:{heading:"Review notes",rejected:"Action rejected.",commentLabel:"Review comment",commentPlaceholder:"What should change, or what you noticed (passed to the agent as an instruction)",detach:"Detach",attachTo:t=>`Attach to this ${t}`,addNote:"Add note",empty:"No draft actions yet.",emptyHint:"Comments and structural patches both land here, and survive reload via LocalStorage.",sendToClaude:"Send to Claude",copy:"Copy changes & comments",copyTitle:"Copy the review to paste it to the agent",clear:"Clear",deleteAction:"Delete this draft action",wholePage:"Whole page",comment:"Comment",sent:"Sent to Claude \u2713",copied:"Copied \u2713",copyFailed:"Could not copy"},ja:{heading:"\u30EC\u30D3\u30E5\u30FC\u30CE\u30FC\u30C8",rejected:"action \u3092\u53D7\u3051\u4ED8\u3051\u3089\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002",commentLabel:"\u30EC\u30D3\u30E5\u30FC\u30B3\u30E1\u30F3\u30C8",commentPlaceholder:"\u5909\u66F4\u3057\u305F\u3044\u3053\u3068 / \u6C17\u3065\u304D\u3092\u66F8\u304F\uFF08Agent \u3078\u306E\u6307\u793A\u3068\u3057\u3066\u6E21\u308B\uFF09",detach:"\u7D10\u3065\u3051\u3092\u89E3\u9664",attachTo:t=>`\u3053\u306E ${t} \u306B\u7D10\u3065\u3051\u308B`,addNote:"\u30CE\u30FC\u30C8\u3092\u8FFD\u52A0",empty:"draft action \u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002",emptyHint:"\u30B3\u30E1\u30F3\u30C8\u3082\u69CB\u9020\u306E\u5909\u66F4\u3082\u3053\u3053\u306B\u96C6\u307E\u308A\u3001LocalStorage \u306B\u6B8B\u308B\u306E\u3067\u30EA\u30ED\u30FC\u30C9\u3057\u3066\u3082\u6D88\u3048\u307E\u305B\u3093\u3002",sendToClaude:"Claude \u306B\u9001\u308B",copy:"\u5909\u66F4\u30FB\u30B3\u30E1\u30F3\u30C8\u3092\u30B3\u30D4\u30FC",copyTitle:"Review \u3092\u30B3\u30D4\u30FC\u3057\u3066 Agent \u306B\u8CBC\u308A\u4ED8\u3051\u308B",clear:"\u30AF\u30EA\u30A2",deleteAction:"\u3053\u306E draft action \u3092\u524A\u9664",wholePage:"\u30DA\u30FC\u30B8\u5168\u4F53",comment:"\u30B3\u30E1\u30F3\u30C8",sent:"Claude \u306B\u9001\u308A\u307E\u3057\u305F \u2713",copied:"\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F \u2713",copyFailed:"\u30B3\u30D4\u30FC\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F"}}),lr=()=>({body:"",attachment:{kind:"page"},copy:{kind:"idle"},copyRequest:0,send:{kind:"idle"},sendRequest:0}),as=t=>t.kind==="explicit"?{kind:t.resume}:t,ds=(t,e)=>{switch(e.kind){case"input":return{...t,body:e.body};case"attach":return{...t,attachment:{kind:e.current?"current":"page"}};case"clear-target":return{...t,attachment:as(t.attachment)};case"target-requested":return{...t,attachment:{kind:"explicit",ref:e.ref,resume:t.attachment.kind==="explicit"?t.attachment.resume:t.attachment.kind}};case"submitted":return{...t,body:"",attachment:as(t.attachment),copy:{kind:"idle"},copyRequest:t.copyRequest+1,send:{kind:"idle"},sendRequest:t.sendRequest+1};case"copy-started":return{...t,copy:{kind:"pending"},copyRequest:t.copyRequest+1,send:{kind:"idle"},sendRequest:t.sendRequest+1};case"copy-finished":return e.request!==t.copyRequest||t.copy.kind!=="pending"?t:{...t,copy:{kind:e.ok?"copied":"failed"}};case"send-started":return{...t,send:{kind:"pending"},sendRequest:t.sendRequest+1,copy:{kind:"idle"},copyRequest:t.copyRequest+1};case"send-finished":return e.request!==t.sendRequest||t.send.kind!=="pending"?t:{...t,send:e.outcome.ok?{kind:"sent"}:{kind:"failed",reason:e.outcome.reason}}}},cr=(t,e)=>{const s=t.body.trim();return s===""?null:{target:e,body:s}},pr={en:"English",ja:"\u65E5\u672C\u8A9E"},B=ge({en:{review:"Review",reviewToggle:"Review / comments",useLightTheme:"Switch to light theme",useDarkTheme:"Switch to dark theme",language:"Language",resizeSidebar:"Resize sidebar",resizeSidebarHint:"Drag to resize. Double-click to reset",baseDataError:"Could not read the base data (showing an empty page)",handoffTooLarge:"The review is too long to send. Copy it and paste it instead",handoffConsent:"Commenting needs your permission. Allow it, then send again",handoffForbidden:"This page cannot send to Claude. Copy the review and paste it instead",handoffClaudeUnavailable:"Could not reach the Claude session. Copy the review and paste it instead",handoffRateLimited:"Too many sends in a row. Wait a moment, then send again",handoffStorage:"Could not save the review. Copy it and paste it instead",handoffError:"Could not send. Copy the review and paste it instead",handoffLabel:"Hand the review to the agent",handoffSend:"Send to Claude",handoffSending:"Sending\u2026",handoffSent:"Sent to Claude \u2713",handoffCopy:"Copy changes & comments",handoffCopyTitle:"Copy the review to paste it to the agent",handoffCopied:"Copied \u2713",handoffCopyFailed:"Could not copy"},ja:{review:"\u30EC\u30D3\u30E5\u30FC",reviewToggle:"\u30EC\u30D3\u30E5\u30FC / \u30B3\u30E1\u30F3\u30C8",useLightTheme:"\u30E9\u30A4\u30C8\u30C6\u30FC\u30DE\u306B\u3059\u308B",useDarkTheme:"\u30C0\u30FC\u30AF\u30C6\u30FC\u30DE\u306B\u3059\u308B",language:"\u8A00\u8A9E",resizeSidebar:"\u30B5\u30A4\u30C9\u30D0\u30FC\u306E\u5E45\u3092\u5909\u66F4",resizeSidebarHint:"\u30C9\u30E9\u30C3\u30B0\u3067\u5E45\u3092\u5909\u66F4\u3002\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u3067\u5143\u306B\u623B\u3059",baseDataError:"base data \u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F\uFF08\u7A7A\u306E\u30DA\u30FC\u30B8\u3068\u3057\u3066\u8868\u793A\u4E2D\uFF09",handoffTooLarge:"Review \u304C\u9577\u3059\u304E\u3066\u9001\u308C\u307E\u305B\u3093\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffConsent:"\u30B3\u30E1\u30F3\u30C8\u306E\u8A31\u53EF\u304C\u5FC5\u8981\u3067\u3059\u3002\u8A31\u53EF\u3057\u3066\u304B\u3089\u3082\u3046\u4E00\u5EA6\u9001\u3063\u3066\u304F\u3060\u3055\u3044",handoffForbidden:"\u3053\u306E\u30DA\u30FC\u30B8\u304B\u3089\u306F\u9001\u308C\u307E\u305B\u3093\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffClaudeUnavailable:"Claude \u306E\u30BB\u30C3\u30B7\u30E7\u30F3\u306B\u5C4A\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffRateLimited:"\u9001\u4FE1\u304C\u7D9A\u3044\u3066\u3044\u307E\u3059\u3002\u5C11\u3057\u5F85\u3063\u3066\u304B\u3089\u9001\u3063\u3066\u304F\u3060\u3055\u3044",handoffStorage:"Review \u3092\u4FDD\u5B58\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffError:"\u9001\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffLabel:"Review \u3092 Agent \u306B\u6E21\u3059",handoffSend:"Claude \u306B\u9001\u308B",handoffSending:"\u9001\u4FE1\u4E2D\u2026",handoffSent:"Claude \u306B\u9001\u308A\u307E\u3057\u305F \u2713",handoffCopy:"\u5909\u66F4\u30FB\u30B3\u30E1\u30F3\u30C8\u3092\u30B3\u30D4\u30FC",handoffCopyTitle:"Review \u3092\u30B3\u30D4\u30FC\u3057\u3066 Agent \u306B\u8CBC\u308A\u4ED8\u3051\u308B",handoffCopied:"\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F \u2713",handoffCopyFailed:"\u30B3\u30D4\u30FC\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F"}}),hr=4096,ur="reviews",ls="Review from the page (dev-process-kit). Apply it to the base data and republish this artifact. Then answer with ArtifactComments `reply` in this thread: the reader sees only this thread, and the page never shows anything written to the database.",fr=t=>new TextEncoder().encode(t).length,gr=t=>t.replace(/[\u0000-\u0008\u000B-\u001F\u007F]/g,""),mr=t=>{const e=`${ls}
519
-
520
- ${gr(t)}`;return fr(e)<=hr?e:null},br=t=>`${ls}
521
-
522
- The brief is too long for a comment, so it is stored in this artifact's database: read the document \`${t}\` (\`brief\` is the review, \`draft\` the raw draft JSON).`,kr={consent_required:"consent",forbidden:"forbidden",not_granted:"forbidden",capability_disabled:"forbidden",capability_removed:"forbidden",claude_unavailable:"claude_unavailable",rate_limited:"rate_limited"},vr=t=>{const e=typeof t=="object"&&t!==null&&"code"in t?t.code:void 0;return(typeof e=="string"?kr[e]:void 0)??"error"},yr={too_large:"handoffTooLarge",consent:"handoffConsent",forbidden:"handoffForbidden",claude_unavailable:"handoffClaudeUnavailable",rate_limited:"handoffRateLimited",storage:"handoffStorage",error:"handoffError"},Qe=(t,e)=>B(e)[yr[t]],cs=t=>t.group?`${t.group} \xB7 ${t.label}`:t.label,ps=(t,e)=>{const{definition:s,state:n,navigation:r,derivation:i}=t,o=os(t.locale),d=s.currentTarget?.(n,r)??null,a=e.attachment,l=a.kind==="explicit"?s.commentTargets(n,r).find(h=>h.value===a.ref):null,p=a.kind==="explicit"?{ref:a.ref,label:l?cs(l):a.ref}:a.kind==="current"&&d?{ref:d.value,label:cs(d)}:{ref:`page:${s.name}`,label:o.wholePage},c=new Map(i.stale.map(h=>[h.action.id,h.reason]));return{body:e.body,target:p,attachment:a.kind==="explicit"?{kind:"explicit"}:d?{kind:"checkbox",checked:a.kind==="current",group:d.group??""}:{kind:"none"},canSubmit:e.body.trim().length>0,items:i.actions.map(h=>{const u=s.describe(h,n,i.base),b=h.type==="comment";return{id:h.id,title:b?o.comment:u.title,targetLabel:u.targetLabel,tone:b?"comment":u.tone,text:{kind:b?"comment":"summary",body:b?$e(h):u.summary??""},code:s.serialize(h),stale:c.get(h.id)??null}}),issues:t.issues.map(h=>`${h.path?`${h.path}: `:""}${h.message}`),send:t.sendable!==!0?"hidden":i.actions.length===0||e.send.kind==="pending"?"disabled":"ready",flash:e.send.kind==="sent"?o.sent:e.send.kind==="failed"?Qe(e.send.reason,t.locale):e.copy.kind==="copied"?o.copied:e.copy.kind==="failed"?o.copyFailed:""}},xr=[me,be,R`
523
- :host {
524
- display: flex;
525
- flex-direction: column;
526
- min-height: 0;
527
- width: 100%;
528
- background: var(--dpk-paper-raised);
529
- }
530
-
531
- header {
532
- position: relative;
533
- z-index: 1;
534
- display: flex;
535
- align-items: center;
536
- justify-content: space-between;
537
- gap: 8px;
538
- padding: 14px 16px 12px;
539
- border-bottom: 1px solid var(--dpk-rule);
540
- background: var(--dpk-glass);
541
- backdrop-filter: blur(12px);
542
- box-shadow: 0 1px 0 var(--dpk-highlight) inset;
543
- }
544
-
545
- header h2 {
546
- font-size: 13.5px;
547
- font-weight: 660;
548
- letter-spacing: -0.015em;
549
- }
550
-
551
- .composer {
552
- display: grid;
553
- gap: 10px;
554
- padding: 14px 16px 14px;
555
- border-bottom: 1px solid var(--dpk-rule);
556
- background: var(--dpk-paper-sunken);
557
- box-shadow: inset 0 1px 3px var(--dpk-shade-1);
558
- }
559
-
560
- .composer textarea {
561
- min-height: 62px;
562
- background: var(--dpk-paper-raised);
563
- border-radius: var(--dpk-radius);
564
- box-shadow:
565
- var(--dpk-bevel),
566
- inset 0 1px 2px var(--dpk-shade-1);
567
- }
568
-
569
- .composer .row {
570
- display: flex;
571
- align-items: center;
572
- gap: 8px;
573
- }
574
-
575
- .composer .attach {
576
- display: inline-flex;
577
- align-items: center;
578
- gap: 7px;
579
- font-size: 12px;
580
- color: var(--dpk-ink-soft);
581
- cursor: pointer;
582
- transition: color 140ms var(--dpk-ease);
583
- }
584
-
585
- .composer .attach:hover {
586
- color: var(--dpk-ink);
587
- }
588
-
589
- .composer .attach input {
590
- width: 14px;
591
- height: 14px;
592
- margin: 0;
593
- accent-color: var(--dpk-accent);
594
- cursor: pointer;
595
- }
596
-
597
- .composer .chip {
598
- display: inline-flex;
599
- align-items: center;
600
- gap: 6px;
601
- padding: 3px 10px;
602
- border: 1px solid var(--dpk-rule-strong);
603
- border-radius: 999px;
604
- background: var(--dpk-paper-raised);
605
- box-shadow: var(--dpk-shadow-xs);
606
- font-size: 11.5px;
607
- cursor: pointer;
608
- transition:
609
- border-color 140ms var(--dpk-ease),
610
- box-shadow 140ms var(--dpk-ease),
611
- transform 140ms var(--dpk-ease);
612
- }
613
-
614
- .composer .chip svg {
615
- flex: none;
616
- width: 12px;
617
- height: 12px;
618
- }
619
-
620
- .composer .chip:hover {
621
- border-color: color-mix(in srgb, var(--dpk-accent) 45%, var(--dpk-rule-strong));
622
- box-shadow: var(--dpk-shadow-sm);
623
- transform: translateY(-1px);
624
- }
625
-
626
- .target-line {
627
- margin-right: auto;
628
- padding: 3px 9px;
629
- border-radius: 999px;
630
- background: var(--dpk-paper-inset);
631
- font-family: var(--dpk-mono);
632
- font-size: 10px;
633
- letter-spacing: 0.03em;
634
- color: var(--dpk-ink-faint);
635
- }
636
-
637
- .list {
638
- list-style: none;
639
- margin: 0;
640
- padding: 10px 12px;
641
- overflow: auto;
642
- flex: 1;
643
- min-height: 0;
644
- display: grid;
645
- gap: 8px;
646
- align-content: start;
647
- }
648
-
649
- .item {
650
- position: relative;
651
- display: grid;
652
- gap: 5px;
653
- padding: 10px 12px 11px 16px;
654
- border: 1px solid var(--dpk-rule);
655
- border-radius: var(--dpk-radius);
656
- background: var(--dpk-paper-raised);
657
- box-shadow: var(--dpk-bevel), var(--dpk-shadow-xs);
658
- transition:
659
- box-shadow 160ms var(--dpk-ease),
660
- border-color 160ms var(--dpk-ease),
661
- transform 160ms var(--dpk-ease);
662
- animation: dpk-item-in 200ms var(--dpk-ease) backwards;
663
- }
664
-
665
- @keyframes dpk-item-in {
666
- from {
667
- opacity: 0;
668
- transform: translateY(3px);
669
- }
670
- }
671
-
672
- .item:hover {
673
- border-color: var(--dpk-rule-hover);
674
- box-shadow: var(--dpk-bevel), var(--dpk-shadow-sm);
675
- transform: translateY(-1px);
676
- }
677
-
678
- .item::before {
679
- content: '';
680
- position: absolute;
681
- left: 0;
682
- top: 10px;
683
- bottom: 10px;
684
- width: 3px;
685
- border-radius: 0 2px 2px 0;
686
- background: var(--tone, var(--dpk-ink-faint));
687
- }
688
-
689
- .item[data-tone='comment'] {
690
- --tone: var(--dpk-accent);
691
- background: linear-gradient(90deg, var(--dpk-accent-soft), transparent 55%), var(--dpk-paper-raised);
692
- }
693
-
694
- .item[data-tone='create'] {
695
- --tone: var(--dpk-green);
696
- }
697
-
698
- .item[data-tone='update'] {
699
- --tone: var(--dpk-blue);
700
- }
701
-
702
- .item[data-tone='delete'] {
703
- --tone: var(--dpk-accent);
704
- }
705
-
706
- .item[data-tone='move'] {
707
- --tone: var(--dpk-violet);
708
- }
709
-
710
- .item[data-stale='true'] {
711
- opacity: 0.62;
712
- border-style: dashed;
713
- box-shadow: none;
714
- transform: none;
715
- }
716
-
717
- .item-head {
718
- display: flex;
719
- align-items: center;
720
- gap: 7px;
721
- }
722
-
723
- .item-icon {
724
- display: inline-flex;
725
- flex: none;
726
- align-items: center;
727
- justify-content: center;
728
- width: 18px;
729
- height: 18px;
730
- border-radius: var(--dpk-radius-xs);
731
- background: color-mix(in srgb, var(--tone, var(--dpk-ink-faint)) 16%, transparent);
732
- color: var(--tone, var(--dpk-ink-faint));
733
- }
734
-
735
- .item-icon svg {
736
- display: block;
737
- width: 11px;
738
- height: 11px;
739
- }
740
-
741
- .item-title {
742
- font-size: 12.5px;
743
- font-weight: 600;
744
- letter-spacing: -0.005em;
745
- }
746
-
747
- .stale-badge {
748
- padding: 1px 7px;
749
- border: 1px solid color-mix(in srgb, var(--dpk-amber) 40%, transparent);
750
- border-radius: 999px;
751
- background: var(--dpk-amber-soft);
752
- font-family: var(--dpk-mono);
753
- font-size: 9px;
754
- letter-spacing: 0.06em;
755
- text-transform: uppercase;
756
- color: var(--dpk-amber);
757
- }
758
-
759
- .item-head .dpk-icon-btn {
760
- margin-left: auto;
761
- }
762
-
763
- .item-target {
764
- display: inline-flex;
765
- align-items: center;
766
- width: fit-content;
767
- padding: 1px 7px;
768
- border-radius: var(--dpk-radius-xs);
769
- background: var(--dpk-paper-sunken);
770
- font-family: var(--dpk-mono);
771
- font-size: 10px;
772
- color: var(--dpk-ink-faint);
773
- overflow-wrap: anywhere;
774
- }
775
-
776
- .item-summary {
777
- font-size: 12px;
778
- color: var(--dpk-ink-soft);
779
- }
780
-
781
- .item-body {
782
- margin: 2px 0 0;
783
- padding-left: 9px;
784
- border-left: 2px solid var(--dpk-accent);
785
- font-size: 12.5px;
786
- white-space: pre-wrap;
787
- }
788
-
789
- .item-code {
790
- margin-top: 2px;
791
- padding: 5px 7px;
792
- border-radius: var(--dpk-radius-xs);
793
- background: var(--dpk-paper-sunken);
794
- font-family: var(--dpk-mono);
795
- font-size: 10px;
796
- color: var(--dpk-ink-faint);
797
- overflow-wrap: anywhere;
798
- }
799
-
800
- .empty {
801
- padding: 4px;
802
- }
803
-
804
- .empty-box {
805
- display: grid;
806
- justify-items: center;
807
- gap: 6px;
808
- padding: 26px 16px;
809
- border: 1px dashed var(--dpk-rule-strong);
810
- border-radius: var(--dpk-radius-lg);
811
- background: var(--dpk-paper-sunken);
812
- text-align: center;
813
- }
814
-
815
- .empty-box svg {
816
- width: 20px;
817
- height: 20px;
818
- color: var(--dpk-ink-faint);
819
- opacity: 0.7;
820
- }
821
-
822
- .empty-box p {
823
- margin: 0;
824
- font-size: 12px;
825
- line-height: 1.6;
826
- color: var(--dpk-ink-soft);
827
- }
828
-
829
- .empty-box .empty-hint {
830
- max-width: 30ch;
831
- color: var(--dpk-ink-faint);
832
- }
833
-
834
- .issues {
835
- margin: 10px 12px 0;
836
- padding: 9px 11px 9px 13px;
837
- border: 1px solid color-mix(in srgb, var(--dpk-danger) 35%, transparent);
838
- border-radius: var(--dpk-radius-sm);
839
- background: linear-gradient(90deg, var(--dpk-danger) 0 3px, transparent 3px), var(--dpk-danger-soft);
840
- font-size: 11.5px;
841
- }
842
-
843
- .issues strong {
844
- color: var(--dpk-danger);
845
- }
846
-
847
- .issues ul {
848
- margin: 4px 0 0;
849
- padding-left: 16px;
850
- color: var(--dpk-ink-soft);
851
- }
852
-
853
- footer {
854
- display: flex;
855
- flex-wrap: wrap;
856
- align-items: center;
857
- gap: 8px;
858
- padding: 12px 16px;
859
- border-top: 1px solid var(--dpk-rule);
860
- background: var(--dpk-glass);
861
- backdrop-filter: blur(12px);
862
- }
863
-
864
- .footer-actions {
865
- display: flex;
866
- align-items: center;
867
- gap: 6px;
868
- flex-wrap: wrap;
869
- margin-left: auto;
870
- }
871
-
872
- .flash {
873
- font-family: var(--dpk-mono);
874
- font-size: 10px;
875
- letter-spacing: 0.04em;
876
- color: var(--dpk-green);
877
- }
878
- `],wr={CHILD:2},hs=t=>(...e)=>({_$litDirective$:t,values:e});let us=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,s,n){this._$Ct=e,this._$AM=s,this._$Ci=n}_$AS(e,s){return this.update(e,s)}update(e,s){return this.render(...s)}};const{I:$r}=wn,fs=t=>t,gs=()=>document.createComment(""),ie=(t,e,s)=>{const n=t._$AA.parentNode,r=e===void 0?t._$AB:e._$AA;if(s===void 0){const i=n.insertBefore(gs(),r),o=n.insertBefore(gs(),r);s=new $r(i,o,t,t.options)}else{const i=s._$AB.nextSibling,o=s._$AM,d=o!==t;if(d){let a;s._$AQ?.(t),s._$AM=t,s._$AP!==void 0&&(a=t._$AU)!==o._$AU&&s._$AP(a)}if(i!==r||d){let a=s._$AA;for(;a!==i;){const l=fs(a).nextSibling;fs(n).insertBefore(a,r),a=l}}}return s},H=(t,e,s=t)=>(t._$AI(e,s),t),Ar={},ms=(t,e=Ar)=>t._$AH=e,Cr=t=>t._$AH,et=t=>{t._$AR(),t._$AA.remove()},bs=(t,e,s)=>{const n=new Map;for(let r=e;r<=s;r++)n.set(t[r],r);return n},ks=hs(class extends us{constructor(t){if(super(t),t.type!==wr.CHILD)throw Error("repeat() can only be used in text expressions")}dt(t,e,s){let n;s===void 0?s=e:e!==void 0&&(n=e);const r=[],i=[];let o=0;for(const d of t)r[o]=n?n(d,o):o,i[o]=s(d,o),o++;return{values:i,keys:r}}render(t,e,s){return this.dt(t,e,s).values}update(t,[e,s,n]){const r=Cr(t),{values:i,keys:o}=this.dt(e,s,n);if(!Array.isArray(r))return this.ut=o,i;const d=this.ut??=[],a=[];let l,p,c=0,h=r.length-1,u=0,b=i.length-1;for(;c<=h&&u<=b;)if(r[c]===null)c++;else if(r[h]===null)h--;else if(d[c]===o[u])a[u]=H(r[c],i[u]),c++,u++;else if(d[h]===o[b])a[b]=H(r[h],i[b]),h--,b--;else if(d[c]===o[b])a[b]=H(r[c],i[b]),ie(t,a[b+1],r[c]),c++,b--;else if(d[h]===o[u])a[u]=H(r[h],i[u]),ie(t,r[c],r[h]),h--,u++;else if(l===void 0&&(l=bs(o,u,b),p=bs(d,c,h)),l.has(d[c]))if(l.has(d[h])){const C=p.get(o[u]),A=C!==void 0?r[C]:null;if(A===null){const L=ie(t,r[c]);H(L,i[u]),a[u]=L}else a[u]=H(A,i[u]),ie(t,r[c],A),r[C]=null;u++}else et(r[h]),h--;else et(r[c]),c++;for(;u<=b;){const C=ie(t,a[b+1]);H(C,i[u]),a[u++]=C}for(;c<=h;){const C=r[c++];C!==null&&et(C)}return this.ut=o,ms(t,a),P}}),tt=()=>f`<svg
879
- viewBox="0 0 16 16"
880
- fill="none"
881
- stroke="currentColor"
882
- stroke-width="1.5"
883
- stroke-linecap="round"
884
- stroke-linejoin="round"
885
- aria-hidden="true"
886
- focusable="false"
887
- >
888
- <path d="M4 4l8 8M12 4l-8 8" />
889
- </svg>`,vs=()=>f`<svg
890
- viewBox="0 0 16 16"
891
- fill="none"
892
- stroke="currentColor"
893
- stroke-width="1.5"
894
- stroke-linecap="round"
895
- stroke-linejoin="round"
896
- aria-hidden="true"
897
- focusable="false"
898
- >
899
- <path d="M3.5 5h9M5.5 5V3.5a1 1 0 011-1h3a1 1 0 011 1V5" />
900
- <path d="M5 5l.5 7.5h5L11 5" />
901
- <path d="M6.8 7.5v3.5M9.2 7.5v3.5" />
902
- </svg>`,ys=()=>f`<svg
903
- viewBox="0 0 16 16"
904
- fill="none"
905
- stroke="currentColor"
906
- stroke-width="1.5"
907
- stroke-linecap="round"
908
- stroke-linejoin="round"
909
- aria-hidden="true"
910
- focusable="false"
911
- >
912
- <path d="M3 13l1.5-1.5M11.3 2.7a1.5 1.5 0 012.1 2.1L5.5 12.7l-3 .8.8-3z" />
913
- </svg>`,st=()=>f`<svg
914
- viewBox="0 0 16 16"
915
- fill="none"
916
- stroke="currentColor"
917
- stroke-width="1.5"
918
- stroke-linecap="round"
919
- stroke-linejoin="round"
920
- aria-hidden="true"
921
- focusable="false"
922
- >
923
- <path d="M3.5 3.5h9a1 1 0 011 1v5a1 1 0 01-1 1H8.2l-2.7 2.2v-2.2H3.5a1 1 0 01-1-1v-5a1 1 0 011-1z" />
924
- </svg>`,xs=()=>f`<svg
925
- viewBox="0 0 16 16"
926
- fill="none"
927
- stroke="currentColor"
928
- stroke-width="1.5"
929
- stroke-linecap="round"
930
- stroke-linejoin="round"
931
- aria-hidden="true"
932
- focusable="false"
933
- >
934
- <path d="M6.5 9.5l3-3" />
935
- <path d="M7 5.5l1-1a2.1 2.1 0 013 3l-1 1" />
936
- <path d="M9 10.5l-1 1a2.1 2.1 0 01-3-3l1-1" />
937
- </svg>`,Sr=()=>f`<svg
938
- viewBox="0 0 16 16"
939
- fill="none"
940
- stroke="currentColor"
941
- stroke-width="1.5"
942
- stroke-linecap="round"
943
- stroke-linejoin="round"
944
- aria-hidden="true"
945
- focusable="false"
946
- >
947
- <rect x="5.5" y="5.5" width="7" height="7" rx="1.5" />
948
- <path d="M10.5 5.5V4.5a1 1 0 00-1-1h-5a1 1 0 00-1 1v5a1 1 0 001 1h1" />
949
- </svg>`,_r=()=>f`<svg
950
- viewBox="0 0 16 16"
951
- fill="none"
952
- stroke="currentColor"
953
- stroke-width="1.5"
954
- stroke-linecap="round"
955
- stroke-linejoin="round"
956
- aria-hidden="true"
957
- focusable="false"
958
- >
959
- <path d="M3.5 8.5l3 3 6-7" />
960
- </svg>`,ws=()=>f`<svg
961
- viewBox="0 0 16 16"
962
- fill="none"
963
- stroke="currentColor"
964
- stroke-width="1.5"
965
- stroke-linecap="round"
966
- stroke-linejoin="round"
967
- aria-hidden="true"
968
- focusable="false"
969
- >
970
- <path d="M8 3.5v9M3.5 8h9" />
971
- </svg>`,Er=()=>f`<svg viewBox="0 0 16 16" fill="currentColor" aria-hidden="true" focusable="false">
972
- <circle cx="6.5" cy="4.5" r="1" />
973
- <circle cx="9.5" cy="4.5" r="1" />
974
- <circle cx="6.5" cy="8" r="1" />
975
- <circle cx="9.5" cy="8" r="1" />
976
- <circle cx="6.5" cy="11.5" r="1" />
977
- <circle cx="9.5" cy="11.5" r="1" />
978
- </svg>`,$s=()=>f`<svg
979
- viewBox="0 0 16 16"
980
- fill="none"
981
- stroke="currentColor"
982
- stroke-width="1.5"
983
- stroke-linecap="round"
984
- stroke-linejoin="round"
985
- aria-hidden="true"
986
- focusable="false"
987
- >
988
- <path
989
- d="M8 2.5v11M8 2.5L5.5 5M8 2.5l2.5 2.5M8 13.5l-2.5-2.5M8 13.5l2.5-2.5M2.5 8h11M2.5 8L5 5.5M2.5 8l2.5 2.5M13.5 8L11 5.5M13.5 8L11 10.5"
990
- />
991
- </svg>`,Tr=()=>f`<svg
992
- viewBox="0 0 16 16"
993
- fill="none"
994
- stroke="currentColor"
995
- stroke-width="1.5"
996
- stroke-linecap="round"
997
- stroke-linejoin="round"
998
- aria-hidden="true"
999
- focusable="false"
1000
- >
1001
- <path d="M8 12.5V3.5M4.5 7L8 3.5 11.5 7" />
1002
- </svg>`,Mr=()=>f`<svg
1003
- viewBox="0 0 16 16"
1004
- fill="none"
1005
- stroke="currentColor"
1006
- stroke-width="1.5"
1007
- stroke-linecap="round"
1008
- stroke-linejoin="round"
1009
- aria-hidden="true"
1010
- focusable="false"
1011
- >
1012
- <path d="M8 3.5v9M4.5 9L8 12.5 11.5 9" />
1013
- </svg>`,Or=()=>f`<svg
1014
- viewBox="0 0 16 16"
1015
- fill="none"
1016
- stroke="currentColor"
1017
- stroke-width="1.5"
1018
- stroke-linecap="round"
1019
- stroke-linejoin="round"
1020
- aria-hidden="true"
1021
- focusable="false"
1022
- >
1023
- <path d="M10 3.5L5.5 8 10 12.5" />
1024
- </svg>`,jr=()=>f`<svg
1025
- viewBox="0 0 16 16"
1026
- fill="none"
1027
- stroke="currentColor"
1028
- stroke-width="1.5"
1029
- stroke-linecap="round"
1030
- stroke-linejoin="round"
1031
- aria-hidden="true"
1032
- focusable="false"
1033
- >
1034
- <path d="M6 3.5L10.5 8 6 12.5" />
1035
- </svg>`,Lr=()=>f`<svg
1036
- viewBox="0 0 16 16"
1037
- fill="none"
1038
- stroke="currentColor"
1039
- stroke-width="1.5"
1040
- stroke-linecap="round"
1041
- stroke-linejoin="round"
1042
- aria-hidden="true"
1043
- focusable="false"
1044
- >
1045
- <path d="M9.5 2.5h4v4M6.5 13.5h-4v-4M13.5 2.5L9 7M2.5 13.5L7 9" />
1046
- </svg>`,Rr=()=>f`<svg
1047
- viewBox="0 0 16 16"
1048
- fill="none"
1049
- stroke="currentColor"
1050
- stroke-width="1.5"
1051
- stroke-linecap="round"
1052
- stroke-linejoin="round"
1053
- aria-hidden="true"
1054
- focusable="false"
1055
- >
1056
- <path d="M13.5 7h-4.5v-4.5M2.5 9h4.5v4.5M9 7l4.5-4.5M7 9l-4.5 4.5" />
1057
- </svg>`,zr=()=>f`<svg
1058
- viewBox="0 0 16 16"
1059
- fill="none"
1060
- stroke="currentColor"
1061
- stroke-width="1.5"
1062
- stroke-linecap="round"
1063
- stroke-linejoin="round"
1064
- aria-hidden="true"
1065
- focusable="false"
1066
- >
1067
- <circle cx="8" cy="8" r="2.75" />
1068
- <path
1069
- d="M8 1.5v1.5M8 13v1.5M1.5 8H3M13 8h1.5M3.4 3.4l1.06 1.06M11.54 11.54l1.06 1.06M3.4 12.6l1.06-1.06M11.54 4.46l1.06-1.06"
1070
- />
1071
- </svg>`,Nr=()=>f`<svg
1072
- viewBox="0 0 16 16"
1073
- fill="none"
1074
- stroke="currentColor"
1075
- stroke-width="1.5"
1076
- stroke-linecap="round"
1077
- stroke-linejoin="round"
1078
- aria-hidden="true"
1079
- focusable="false"
1080
- >
1081
- <path d="M13.5 9.6A5.75 5.75 0 016.4 2.5a5.75 5.75 0 107.1 7.1z" />
1082
- </svg>`,Pr=t=>{switch(t){case"comment":return st();case"create":return ws();case"update":return ys();case"delete":return vs();case"move":return $s();default:return xs()}},Dr=(t,e,s,n=!1)=>f`
1083
- ${n?g:f`<header><h2>${t.heading}</h2></header>`}
1084
- ${e.issues.length>0?f`<div class="issues" role="alert">
1085
- <strong>${t.rejected}</strong>
1086
- <ul>
1087
- ${e.issues.map(r=>f`<li>${r}</li>`)}
1088
- </ul>
1089
- </div>`:g}
1090
- <div class="composer">
1091
- <textarea
1092
- class="dpk-textarea"
1093
- aria-label=${t.commentLabel}
1094
- placeholder=${t.commentPlaceholder}
1095
- .value=${e.body}
1096
- @input=${r=>{r.currentTarget instanceof HTMLTextAreaElement&&s({kind:"input",body:r.currentTarget.value})}}
1097
- @keydown=${r=>{!r.isComposing&&r.key==="Enter"&&(r.metaKey||r.ctrlKey)&&(r.preventDefault(),s({kind:"submit"}))}}
1098
- ></textarea>
1099
- ${e.attachment.kind==="explicit"?f`<div class="row">
1100
- <button class="chip" type="button" aria-label=${t.detach} @click=${()=>s({kind:"clear-target"})}>
1101
- ${e.target.label} ${tt()}
1102
- </button>
1103
- </div>`:e.attachment.kind==="checkbox"?f`<div class="row">
1104
- <label class="attach">
1105
- <input
1106
- type="checkbox"
1107
- .checked=${e.attachment.checked}
1108
- @change=${r=>{r.currentTarget instanceof HTMLInputElement&&s({kind:"attach",current:r.currentTarget.checked})}}
1109
- />
1110
- <span>${t.attachTo(e.attachment.group)}</span>
1111
- </label>
1112
- </div>`:g}
1113
- <div class="row">
1114
- <span class="target-line">→ ${e.target.label}</span>
1115
- <button
1116
- class="dpk-btn dpk-btn--accent"
1117
- type="button"
1118
- ?disabled=${!e.canSubmit}
1119
- @click=${()=>s({kind:"submit"})}
1120
- >
1121
- ${t.addNote}
1122
- </button>
1123
- </div>
1124
- </div>
1125
- <ul class="list">
1126
- ${e.items.length===0?f`<li class="empty">
1127
- <div class="empty-box">
1128
- ${st()}
1129
- <p>${t.empty}</p>
1130
- <p class="empty-hint">${t.emptyHint}</p>
1131
- </div>
1132
- </li>`:ks(e.items,r=>r.id,r=>Ir(t,r,s))}
1133
- </ul>
1134
- <footer>
1135
- ${n||e.send==="hidden"?g:f`<button
1136
- class="dpk-btn dpk-btn--accent"
1137
- type="button"
1138
- ?disabled=${e.send==="disabled"}
1139
- @click=${()=>s({kind:"send"})}
1140
- >
1141
- ${t.sendToClaude}
1142
- </button>`}
1143
- <div class="footer-actions">
1144
- ${n?g:f`<button
1145
- class=${e.send==="hidden"?"dpk-btn dpk-btn--accent":"dpk-btn"}
1146
- type="button"
1147
- title=${t.copyTitle}
1148
- ?disabled=${e.items.length===0}
1149
- @click=${()=>s({kind:"copy"})}
1150
- >
1151
- ${t.copy}
1152
- </button>`}
1153
- <button
1154
- class="dpk-btn dpk-btn--ghost"
1155
- type="button"
1156
- ?disabled=${e.items.length===0}
1157
- @click=${()=>s({kind:"clear"})}
1158
- >
1159
- ${t.clear}
1160
- </button>
1161
- </div>
1162
- ${e.flash?f`<span class="flash" role="status">${e.flash}</span>`:g}
1163
- </footer>
1164
- `,Ir=(t,e,s)=>f`
1165
- <li class="item" data-tone=${e.tone} data-stale=${String(e.stale!==null)}>
1166
- <div class="item-head">
1167
- <span class="item-icon">${Pr(e.tone)}</span>
1168
- <span class="item-title">${e.title}</span>
1169
- ${e.stale?f`<span class="stale-badge">${e.stale}</span>`:g}
1170
- <button
1171
- class="dpk-icon-btn"
1172
- type="button"
1173
- aria-label=${t.deleteAction}
1174
- @click=${()=>s({kind:"delete",id:e.id})}
1175
- >
1176
- ${tt()}
1177
- </button>
1178
- </div>
1179
- <div class="item-target">${e.targetLabel}</div>
1180
- ${e.text.kind==="comment"?f`<p class="item-body">${e.text.body}</p>`:e.text.body?f`<div class="item-summary">${e.text.body}</div>`:g}
1181
- <code class="item-code">${e.code}</code>
1182
- </li>
1183
- `;class As extends O{static{this.styles=xr}static{this.properties={definition:{attribute:!1},state:{attribute:!1},navigation:{attribute:!1},derivation:{attribute:!1},issues:{attribute:!1},pendingTarget:{attribute:!1},onDelete:{attribute:!1},onClear:{attribute:!1},onComment:{attribute:!1},exportBrief:{attribute:!1},sendToClaude:{attribute:!1},embedded:{type:Boolean}}}#e=lr();#r=new De(this);constructor(){super(),this.embedded=!1,this.definition=null,this.state=void 0,this.navigation={},this.derivation=null,this.issues=[],this.pendingTarget=null}willUpdate(e){e.has("pendingTarget")&&this.pendingTarget&&(this.#e=ds(this.#e,{kind:"target-requested",ref:this.pendingTarget}))}updated(e){e.has("pendingTarget")&&this.pendingTarget&&this.isConnected&&this.renderRoot.querySelector("textarea")?.focus()}#n(){return!this.definition||!this.derivation?null:{definition:this.definition,state:this.state,navigation:this.navigation,derivation:this.derivation,issues:this.issues,sendable:this.sendToClaude!==void 0,locale:this.#r.locale}}render(){const e=this.#n();return e?Dr(os(this.#r.locale),ps(e,this.#e),this.#i,this.embedded):g}#s(e){this.#e=ds(this.#e,e),this.requestUpdate()}#i=e=>{switch(e.kind){case"delete":this.onDelete?.(e.id);return;case"clear":this.onClear?.();return;case"copy":this.#o();return;case"send":this.#t();return;case"submit":{const s=this.#n();if(!s||!this.onComment)return;const n=cr(this.#e,ps(s,this.#e).target.ref);if(!n||!this.onComment(n.target,n.body).ok)return;this.#s({kind:"submitted"});return}default:this.#s(e)}};async#t(){const e=this.sendToClaude;if(!e||this.#e.send.kind==="pending")return;this.#s({kind:"send-started"});const s=this.#e.sendRequest,n=await e().catch(()=>({ok:!1,reason:"error"}));this.isConnected&&this.#s({kind:"send-finished",request:s,outcome:n})}async#o(){const e=this.#n();if(!e)return;this.#s({kind:"copy-started"});const s=this.#e.copyRequest;try{const n=this.exportBrief?.()??Ze({...e.derivation,navigation:e.navigation,issues:e.issues},e.definition,Z),r=await Xe(n);this.isConnected&&this.#s({kind:"copy-finished",request:s,ok:r})}catch{this.isConnected&&this.#s({kind:"copy-finished",request:s,ok:!1})}}}const Ur=()=>{customElements.get("dpk-component-comment-panel")||customElements.define("dpk-component-comment-panel",As)},qr=$({value:m()}),Br=t=>e=>{if(!(e instanceof CustomEvent))return;const s=y(qr,e.detail);s.success&&t(s.output.value)},Cs=t=>e=>{const s=W(e.target,HTMLSelectElement);s!==null&&t(s.value)},Hr=t=>e=>{const s=W(e.target,HTMLInputElement);s!==null&&t(s.checked)},oe=t=>t==="light"||t==="dark"?t:null,Ss=t=>t.authored??t.environment,_s=t=>t.preference??Ss(t),Fr=t=>{const e=_s(t)==="dark"?"light":"dark";return e===Ss(t)?null:e},Es=U(V({value:k(m(),I(/^element:.+/)),label:k(m(),v(1)),group:S(m())})),Kr=$({targets:Es,providers:U($({id:k(m(),v(1)),results:U(rs)}))}),Wr=V({target:k(m(),I(/^element:.+/)),body:k(m(),qe(),v(1))}),Ts=t=>t.group?`${t.group} \xB7 ${t.label}`:t.label,Ms=(t,e,s)=>{const n=new Map(e.map(r=>[r.value,r]));return{...t,hasTarget:(r,i)=>t.hasTarget(r,i)||n.has(_(i)),commentTargets:(r,i)=>{const o=t.commentTargets(r,i),d=new Set(o.map(a=>a.value));return[...o,...e.filter(a=>!d.has(a.value))]},describe:(r,i,o)=>{if(T(r)){const l=s.get(r.id),p=n.get(_(r.target));return{title:l?.title??r.type,...l?.summary===void 0?{}:{summary:l.summary},tone:l?.tone??"update",targetLabel:p?Ts(p):r.target.id}}const d=t.describe(r,i,o),a=r.type==="comment"&&!t.hasTarget(i,r.target)?n.get(_(r.target)):void 0;return a===void 0?d:{...d,targetLabel:Ts(a)}},serialize:r=>T(r)?`${r.type} ${_(r.target)} ${JSON.stringify(r.payload)}`:t.serialize(r)}},Os=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function js(t){return typeof Os.Buffer<"u"&&Os.Buffer.isBuffer(t)}function Ls(t){if(!t||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype||Object.getPrototypeOf(e)===null?Object.prototype.toString.call(t)==="[object Object]":!1}function Rs(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function zs(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const Jr="[object RegExp]",Vr="[object String]",Yr="[object Number]",Gr="[object Boolean]",Zr="[object Symbol]",Xr="[object Date]",Qr="[object Map]",ei="[object Set]",ti="[object Array]",si="[object Function]",ni="[object ArrayBuffer]",nt="[object Object]",ri="[object Error]",ii="[object DataView]",oi="[object Uint8Array]",ai="[object Uint8ClampedArray]",di="[object Uint16Array]",li="[object Uint32Array]",ci="[object BigUint64Array]",pi="[object Int8Array]",hi="[object Int16Array]",ui="[object Int32Array]",fi="[object BigInt64Array]",gi="[object Float32Array]",mi="[object Float64Array]";function bi(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function ki(t,e,s){return ae(t,e,void 0,void 0,void 0,void 0,s)}function ae(t,e,s,n,r,i,o){const d=o(t,e,s,n,r,i);if(d!==void 0)return d;if(typeof t==typeof e)switch(typeof t){case"bigint":case"string":case"boolean":case"symbol":case"undefined":return t===e;case"number":return t===e||Object.is(t,e);case"function":return t===e;case"object":return de(t,e,i,o)}return de(t,e,i,o)}function de(t,e,s,n){if(Object.is(t,e))return!0;let r=zs(t),i=zs(e);if(r==="[object Arguments]"&&(r=nt),i==="[object Arguments]"&&(i=nt),r!==i)return!1;switch(r){case Vr:return t.toString()===e.toString();case Yr:return bi(t.valueOf(),e.valueOf());case Gr:case Xr:case Zr:return Object.is(t.valueOf(),e.valueOf());case Jr:return t.source===e.source&&t.flags===e.flags;case si:return t===e}s=s??new Map;const o=s.get(t),d=s.get(e);if(o!=null&&d!=null)return o===e;s.set(t,e),s.set(e,t);try{switch(r){case Qr:if(t.size!==e.size)return!1;for(const[a,l]of t.entries())if(!e.has(a)||!ae(l,e.get(a),a,t,e,s,n))return!1;return!0;case ei:{if(t.size!==e.size)return!1;const a=Array.from(t.values()),l=Array.from(e.values());for(let p=0;p<a.length;p++){const c=a[p],h=l.findIndex(u=>ae(c,u,void 0,t,e,s,n));if(h===-1)return!1;l.splice(h,1)}return!0}case ti:case oi:case ai:case di:case li:case ci:case pi:case hi:case ui:case fi:case gi:case mi:if(js(t)!==js(e)||t.length!==e.length)return!1;for(let a=0;a<t.length;a++)if(!ae(t[a],e[a],a,t,e,s,n))return!1;return!0;case ni:return t.byteLength!==e.byteLength?!1:de(new Uint8Array(t),new Uint8Array(e),s,n);case ii:return t.byteLength!==e.byteLength||t.byteOffset!==e.byteOffset?!1:de(new Uint8Array(t),new Uint8Array(e),s,n);case ri:return t.name===e.name&&t.message===e.message;case nt:{if(!(de(t.constructor,e.constructor,s,n)||Ls(t)&&Ls(e)))return!1;const a=[...Object.keys(t),...Rs(t)],l=[...Object.keys(e),...Rs(e)];if(a.length!==l.length)return!1;for(let p=0;p<a.length;p++){const c=a[p],h=t[c];if(!Object.hasOwn(e,c))return!1;const u=e[c];if(!ae(h,u,c,t,e,s,n))return!1}return!0}default:return!1}}finally{s.delete(t),s.delete(e)}}function vi(){}function Ae(t,e){return ki(t,e,vi)}const Ns="page",Ps=t=>_(t),Ds=(t,e,s,n=new Map)=>{let r=e;const i=[],o=[],d=[],a=[],l=new Map;for(const c of s){if(c.type===E)continue;if(T(c)){const b=n.get(c.id);b===void 0||b.stale!==void 0?o.push({action:c,reason:b?.stale??"target-missing"}):i.push(c);continue}const h=we(t.actions,c.type);if(!h){o.push({action:c,reason:"unsupported-action-type"});continue}const u=t.apply(r,c);if(u===null){o.push({action:c,reason:t.hasTarget(r,c.target)?"constraint-violated":"target-missing"});continue}if(h.mode!=="append"&&rt(t,r,u)){d.push(c);continue}r=u,i.push(c)}for(const c of s){if(c.type!==E)continue;if(c.target.type!==Ns&&!t.hasTarget(r,c.target)){o.push({action:c,reason:"target-missing"});continue}a.push(c);const h=Ps(c.target);l.set(h,[...l.get(h)??[],c])}const p=new Map(s.map((c,h)=>[c.id,h]));return o.sort((c,h)=>(p.get(c.action.id)??0)-(p.get(h.action.id)??0)),{base:e,state:r,actions:s,applied:i,stale:o,obsolete:d,comments:a,commentsByTarget:l}},rt=(t,e,s)=>e===s?!0:t.canonicalState===void 0?Ae(e,s):Ae(t.canonicalState(e),t.canonicalState(s)),Is=t=>{const e=new Set(t.obsolete.map(s=>s.id));return t.actions.filter(s=>!e.has(s.id))},yi=(t,e,s,n)=>{let r=e;const i=n??Us(r).map(o=>o.id);for(const o of[...i].reverse())r=xi(t,r,s,o,n!==void 0)??r;return r},Us=t=>t.applied.filter(e=>!T(e)),xi=(t,e,s,n,r)=>{const i=Us(e),o=i.findIndex(h=>h.id===n),d=i[o];if(d===void 0)return null;const a=i.slice(0,o),l=[...r?wi(t,e.base,i,o):[],...$i(t,a,d)],p=new Set,c=l.filter(h=>{const u=h.join(" ");return p.has(u)?!1:(p.add(u),!0)}).sort((h,u)=>u.length-h.length);for(const h of c){const u=Ai(t,e,s,h);if(u!==null)return u}return null},wi=(t,e,s,n)=>{const r=[];let i=e;for(const o of s.slice(0,n+1))r.push(i),i=t.apply(i,o)??i;return r.flatMap((o,d)=>rt(t,o,i)?[s.slice(d,n+1).map(a=>a.id)]:[])},$i=(t,e,s)=>{const n=qs(s),r=e.filter(a=>qs(a).some(l=>n.includes(l))),i=Bs(t,s),o=r.filter(a=>Bs(t,a)===i),d=a=>a.map((l,p)=>[...a.slice(p).map(c=>c.id),s.id]);return[...d(r),...d(o),...r.map(a=>[a.id,s.id]),...r.map(a=>[a.id])]},qs=t=>{const e=t.target.type===Ns?[]:t.target.id.split("."),s=typeof t.payload=="object"&&t.payload!==null?Object.values(t.payload).filter(n=>typeof n=="string"&&n!==""):[];return[...e,...s]},Bs=(t,e)=>we(t.actions,e.type)?.mode,Ai=(t,e,s,n)=>{const r=new Set(e.stale.map(o=>o.action.id)),i=new Set(n);for(;;){const o=s(e.actions.filter(a=>!i.has(a.id))),d=o.stale.filter(a=>!r.has(a.action.id)).map(a=>a.action);if(d.length===0)return rt(t,o.state,e.state)?o:null;if(d.some(a=>a.type===E||T(a)))return null;for(const a of d)i.add(a.id)}},Ci=$({v:J(1),template:k(m(),v(1)),actions:U(q())});class it{constructor(e){this.storage=e}load(e,s){try{const n=this.storage.getItem(e);if(n===null)return[];const r=y(Ci,JSON.parse(n));return!r.success||r.output.template!==s?[]:r.output.actions.flatMap(i=>{const o=y(Y,i);return o.success?[o.output]:[]})}catch{return[]}}save(e,s,n){const r={v:1,template:s,actions:n};try{this.storage.setItem(e,JSON.stringify(r))}catch{}}clear(e){try{this.storage.removeItem(e)}catch{}}}class ot{constructor(){this.store=new Map}load(e,s){return new it({getItem:n=>this.store.get(n)??null,setItem:(n,r)=>{this.store.set(n,r)},removeItem:n=>{this.store.delete(n)}}).load(e,s)}save(e,s,n){this.store.set(e,JSON.stringify({v:1,template:s,actions:n}))}clear(e){this.store.delete(e)}}const at=()=>{try{if(typeof localStorage<"u")return new it(localStorage)}catch{}return new ot},Hs=t=>`dev-process-kit:draft:${typeof location>"u"?"local":`${location.pathname}${location.search}`}:${t}`,Si=U(q());class Fs{#e;#r;#n={targets:[],providers:[]};#s=new Map;#i;#t;#o;#d;#a;#l=new Set;#m=[];#b=0;constructor(e){this.#e=e.definition,this.#r=Ms(e.definition,[],this.#s),this.#i=e.base,this.#a=e.storageKey??Hs(e.definition.name),this.#d=e.storage===void 0?at():e.storage;const s=e.initialActions??this.#d?.load(this.#a,this.definition.name)??[];this.#t=Ws(this.definition,s),this.#o=this.#c(this.#t),this.#v()&&this.#y()}get definition(){return this.#r}setComponentSnapshot(e){const s=Yt(Kr,e);if(!Ae(s,this.#n)){this.#n=s,this.#u(),this.#o=this.#c(this.#t);for(const n of this.#l)n()}}setTemplate(e){this.#e=e,this.#u(),this.#o=this.#c(this.#t);for(const s of this.#l)s()}#u(){this.#s=is(this.#t,this.#n.providers),this.#r=Ms(this.#e,this.#n.targets,this.#s)}#c(e){return Ds(this.definition,this.#i,e,is(e,this.#n.providers))}get base(){return this.#i}get actions(){return this.#t}get derivation(){return this.#o}get lastIssues(){return this.#m}get prunedCount(){return this.#b}descriptorFor(e,s){return Ks(this.definition,e,s)}dispatch(e){const s=this.#g(e,this.#o.state);if(!s.ok)return this.#p([s.issue]);const n=this.descriptorFor(s.action.type,s.action.target);return n?(this.#h(Fe(this.#t,s.action,n),[s.action.id]),{ok:!0,id:s.action.id}):this.#p([{path:"type",message:"unknown action type"}])}dispatchBatch(e){const s=y(Si,e);if(!s.success)return this.#p([re(s.issues)]);const n=s.output;if(n.length===0)return{ok:!0,ids:[]};let r=this.#t,i=this.#o.state;const o=[];for(const d of n){const a=this.#g(d,i);if(!a.ok)return this.#p([a.issue]);const l=a.action,p=this.descriptorFor(l.type,l.target);if(!p)return this.#p([{path:"type",message:"unknown action type"}]);if((l.type==="comment"||T(l)?l.target.type==="page"||this.definition.hasTarget(i,l.target)?i:null:this.definition.apply(i,l))===null)return this.#p([{path:"target",message:"batch action is not applicable"}]);r=Fe(r,l,p),i=this.#c(r).state,o.push(l.id)}return this.#h(r,o),{ok:!0,ids:o}}#g(e,s){const n=y(Qt,e);if(!n.success)return{ok:!1,issue:re(n.issues)};const r=this.descriptorFor(n.output.type,typeof n.output.target=="string"?Be(n.output.target,"page"):n.output.target);if(!r)return{ok:!1,issue:{path:"type",message:`unknown action type "${n.output.type}"`}};const i=Qn(n.output,r);if(!i.ok)return i;const o=this.definition.canonicalTarget?.(s,i.action.target)??i.action.target;return{ok:!0,action:{...i.action,target:o}}}#p(e){return this.#m=e,{ok:!1,issues:e}}removeAction(e){const s=this.#t.filter(n=>n.id!==e);s.length!==this.#t.length&&this.#h(s)}clearActions(){this.#t.length>0&&this.#h([])}replaceActions(e){this.#h(Ws(this.definition,e))}setBase(e){this.#i=e,this.#h(this.#t)}subscribe(e){return this.#l.add(e),()=>{this.#l.delete(e)}}exportDraft(e){return{template:this.definition.name,frameworkVersion:e,exportedAt:new Date().toISOString(),actions:this.#t}}#h(e,s){this.#m=[],this.#t=e,this.#u(),this.#o=this.#c(this.#t),this.#v(s),this.#y();for(const n of this.#l)n()}#v(e){const s=this.#w(),n=yi(this.definition,this.#o,r=>this.#c(r),e);return n===this.#o?s:(this.#b+=this.#t.length-n.actions.length,this.#t=[...n.actions],this.#u(),this.#o=this.#c(this.#t),this.#w(),!0)}#w(){return this.#o.obsolete.length===0?!1:(this.#b+=this.#o.obsolete.length,this.#t=Is(this.#o),this.#u(),this.#o=this.#c(this.#t),!0)}#y(){this.#d?.save(this.#a,this.definition.name,this.#t)}}const Ks=(t,e,s)=>e==="comment"?ts:s!==void 0&&T({type:e,target:s})?rr:we(t.actions,e),Ws=(t,e)=>e.flatMap(s=>{const n=y(Y,s);if(!n.success)return[];const r=n.output,i=Ks(t,r.type,r.target);if(!i)return[];const o=y(i.schema,r);if(!o.success)return[];const d=y(Y,o.output);return d.success?[d.output]:[]}),_i=()=>({status:{kind:"idle"},request:0}),Ei=(t,e)=>{switch(e.kind){case"copy-started":return{status:{kind:"copying"},request:t.request+1};case"send-started":return{status:{kind:"sending"},request:t.request+1};case"copy-finished":return e.request!==t.request||t.status.kind!=="copying"?t:{...t,status:{kind:e.ok?"copied":"copy-failed"}};case"send-finished":return e.request!==t.request||t.status.kind!=="sending"?t:{...t,status:e.outcome.ok?{kind:"sent"}:{kind:"send-failed",reason:e.outcome.reason}};case"settled":return e.request===t.request?{...t,status:{kind:"idle"}}:t}},Ti=(t,e)=>{if(t.actions===0||t.railOpen)return null;const s=B(t.locale),n=e.status;return{send:t.sendable?{label:n.kind==="sending"?s.handoffSending:n.kind==="sent"?s.handoffSent:s.handoffSend,disabled:n.kind==="sending"}:null,copy:n.kind==="copied"?{label:s.handoffCopied,status:"copied"}:n.kind==="copy-failed"?{label:s.handoffCopyFailed,status:"failed"}:{label:s.handoffCopy,status:"idle"},note:n.kind==="send-failed"?Qe(n.reason,t.locale):null}},Js=t=>{const e=t.derivation();return{base:e.base,state:e.state,navigation:t.navigation(),actions:t.controller().actions,comments:e.comments,stale:e.stale,issues:t.issues()}},Mi=t=>{const e=t.derivation();return{state:e.state,base:e.base,navigation:t.navigation(),actions:t.controller().actions,comments:e.comments,stale:e.stale,commentCount:s=>{const n=typeof s=="string"?s:_(s);return e.commentsByTarget.get(n)?.length??0},dispatch:s=>t.dispatch(s),dispatchBatch:s=>t.dispatchBatch(s),navigate:(s,n)=>t.navigate(s,n),hashFor:s=>t.hashFor(s),requestComment:s=>t.requestComment(s)}},Oi=(t,e)=>{const s=()=>Js(t);return{version:Z,template:t.definition.name,host:e,ready:t.ready,get base(){return t.controller().base},get state(){return t.derivation().state},get navigation(){return t.navigation()},get actions(){return t.controller().actions},get comments(){return t.derivation().comments},get stale(){return t.derivation().stale},get issues(){return t.issues()},dispatch:n=>t.dispatch(n),dispatchBatch:n=>t.dispatchBatch(n),comment:(n,r)=>t.dispatch({type:E,target:n,payload:{body:r}}),removeAction:n=>t.removeAction(n),clearActions:()=>t.clearActions(),importDraft:n=>t.controller().replaceActions(n),navigate:(n,r)=>t.navigate(n,r),hashFor:n=>t.hashFor(n),snapshot:s,exportDraft:()=>t.controller().exportDraft(Z),exportBrief:()=>Ze(s(),t.controller().definition,Z),subscribe:n=>t.subscribe(n)}},dt=(t,e)=>typeof t=="object"&&t!==null&&e.every(s=>typeof Reflect.get(t,s)=="function"),ji=t=>dt(t,["use"]),Li=t=>dt(t,["anchorFor","canSendToClaude","sendToClaude"]),Ri=t=>dt(t,["collection"]),Vs=async(t,e)=>{try{return await t.use(e)}catch{return null}},zi=(t,e)=>({async canSend(){try{return await t.canSendToClaude()==="available"}catch{return!1}},async send({brief:s,draft:n,anchor:r}){let i=mr(s);if(i===null){if(e===null)return{ok:!1,reason:"too_large"};try{const o=e.collection(ur).doc();await o.set({brief:s,draft:n,createdAt:new Date().toISOString()}),i=br(o.path)}catch{return{ok:!1,reason:"storage"}}}try{return await t.sendToClaude({anchor:await t.anchorFor(r),text:i}),{ok:!0}}catch(o){return{ok:!1,reason:vr(o)}}}}),Ni=async t=>{if(!ji(t))return null;const[e,s]=await Promise.all([Vs(t,"comments"),Vs(t,"db")]);return Li(e)?zi(e,Ri(s)?s:null):null},Pi=()=>Reflect.get(globalThis,"claude");class Di{#e;#r;#n=null;#s=!1;constructor(e,s=Pi){this.#e=e,this.#r=s,e.addController(this)}get available(){return this.#s}hostConnected(){this.#n??=Ni(this.#r()),this.#i(),window.addEventListener("focus",this.#i)}hostDisconnected(){window.removeEventListener("focus",this.#i)}async send(e){const s=await this.#n;if(!s)return{ok:!1,reason:"forbidden"};const n=await s.send(e);return this.#i(),n}#i=async()=>{const e=await this.#n,s=e?await e.canSend():!1;s!==this.#s&&(this.#s=s,this.#e.requestUpdate())}}const Ys=(t,e)=>({read(s){try{const n=t.getItem(s);return n===null?null:e(JSON.parse(n))}catch{return null}},write(s,n){try{return t.setItem(s,JSON.stringify(n)),!0}catch{return!1}},remove(s){try{t.removeItem(s)}catch{}}}),le=t=>{const e=new Map;return Ys({getItem:s=>e.get(s)??null,setItem:(s,n)=>{e.set(s,n)},removeItem:s=>{e.delete(s)}},t)},Ce=t=>{try{if(typeof localStorage<"u")return Ys(localStorage,t)}catch{}return le(t)},lt="dev-process-kit:color-scheme",Ii="(prefers-color-scheme: dark)",Gs=()=>typeof matchMedia=="function"?matchMedia(Ii):null,Zs=()=>oe(document.documentElement.dataset.theme)??(Gs()?.matches===!0?"dark":"light");class Ui{#e;#r;#n=null;#s=null;#i="light";#t=null;#o=null;constructor(e,s){this.#e=e,this.#r=s,e.addController(this)}hostConnected(){this.#n===null&&(this.#n=this.#r()?Ce(oe):le(oe),this.#s=this.#n.read(lt)),this.#i=Zs(),this.#t=Gs(),this.#t?.addEventListener("change",this.#a),this.#o=new MutationObserver(this.#a),this.#o.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})}hostDisconnected(){this.#t?.removeEventListener("change",this.#a),this.#t=null,this.#o?.disconnect(),this.#o=null}resolve(e){return _s(this.#d(e))}toggle(e){this.#s=Fr(this.#d(e)),this.#s===null?this.#n?.remove(lt):this.#n?.write(lt,this.#s),this.#e.requestUpdate()}#d(e){return{preference:this.#s,authored:e,environment:this.#i}}#a=()=>{const e=Zs();e!==this.#i&&(this.#i=e,this.#e.requestUpdate())}}const qi=(t,e)=>{const s=[],n=r=>{(r===t||r instanceof ShadowRoot)&&e?.(r);for(const i of r.children)i.hasAttribute("data-template")||(("commentTargets"in i||"elementActions"in i)&&s.push(i),n(i),i.shadowRoot&&n(i.shadowRoot))};return n(t),s},Xs=(t,e)=>{const s=new Map;for(const n of t)s.set(e(n),(s.get(e(n))??0)+1);return t.filter(n=>s.get(e(n))===1)},Qs=t=>Xs(t.filter(e=>"elementActions"in e&&e.id.length>0),e=>e.id),en=(t,e)=>{for(const s of Qs(t)){const n=or(e,s.id),r=Reflect.get(s,"elementActions");Array.isArray(r)&&r.length===n.length&&n.every((o,d)=>{const a=r[d];return typeof a=="object"&&a!==null&&"id"in a&&a.id===o.id})||Reflect.set(s,"elementActions",n)}},Bi=t=>{const e=Reflect.get(t,"elementActionResults");return Array.isArray(e)?e.flatMap(s=>{const n=y(rs,s);return n.success?[n.output]:[]}):[]},Hi=t=>{const e=[];for(const s of t){if(!("commentTargets"in s))continue;const n=y(Es,s.commentTargets);n.success&&e.push(...n.output)}return{targets:Xs(e,s=>s.value),providers:Qs(t).map(s=>({id:s.id,results:Bi(s)}))}},Fi=2400;class Ki{#e=_i();#r=null;#n;constructor(e){this.#n=e,e.addController(this)}get state(){return this.#e}hostDisconnected(){this.#t()}async copy(e){this.#s({kind:"copy-started"});const s=this.#e.request,n=await Xe(e()).catch(()=>!1);this.#s({kind:"copy-finished",request:s,ok:n}),this.#i(s)}async send(e){if(this.#e.status.kind==="sending")return;this.#s({kind:"send-started"});const s=this.#e.request,n=await e().catch(()=>({ok:!1,reason:"error"}));this.#s({kind:"send-finished",request:s,outcome:n}),n.ok&&this.#i(s)}#s(e){(e.kind==="copy-started"||e.kind==="send-started")&&this.#t(),this.#e=Ei(this.#e,e),this.#n.requestUpdate()}#i(e){e===this.#e.request&&(this.#t(),this.#r=setTimeout(()=>{this.#r=null,this.#s({kind:"settled",request:e})},Fi))}#t(){this.#r!==null&&clearTimeout(this.#r),this.#r=null}}const ct="dev-process-kit:locale";class Wi{#e;#r;#n;#s=null;#i=null;#t;#o;constructor(e,s,n){this.#e=e,this.#r=s,this.#n=n,e.addController(this)}get authored(){if(this.#t===void 0)return Ne(Re(this.#e));const e=this.#e.parentNode;return Ne(this.#t??(e===null?null:Re(e)))}get locale(){return this.#o??this.#d()}#d(){return Sn({preference:this.#i,authored:this.authored})}hostConnected(){this.#s===null&&(this.#s=this.#r()?Ce(zt):le(zt),this.#i=this.#s.read(ct)),this.#t??=this.#e.getAttribute("lang"),this.#a()}pick(e){this.#i=_n(e,this.authored),this.#i===null?this.#s?.remove(ct):this.#s?.write(ct,this.#i),this.#a(),this.#e.requestUpdate()}#a(){const e=this.#i??this.#t??null;e===null?this.#e.removeAttribute("lang"):this.#e.getAttribute("lang")!==e&&this.#e.setAttribute("lang",e);const s=this.#d();if(s===this.#o)return;const n=this.#o===void 0;this.#o=s,this.#n(),(!n||this.#i!==null)&&document.dispatchEvent(new Event(Pe))}}const tn=()=>Ye(typeof location>"u"?"":location.hash),Ji=(t,e)=>{if(typeof history>"u")return;const s=`${location.pathname}${location.search}${G(t)}`;`${location.pathname}${location.search}${location.hash}`!==s&&(e?history.replaceState(null,"",s):history.pushState(null,"",s))};class Vi{#e;#r=null;#n=0;constructor(e){this.#e=e}get orphans(){return this.#n}route(){const e=this.#e.renderRoot,s=W(e.querySelector('slot[name="preview"]'),HTMLSlotElement);if(s===null)return;this.#r!==s&&(this.#r=s,s.addEventListener("slotchange",this.#s));const n=new Set(Array.from(e.querySelectorAll("slot")).map(i=>i.getAttribute("name")??"")),r=s.assignedElements();for(const i of r){const o=i.getAttribute("data-preview-id");if(!o)continue;const d=`preview:${o}`;i.getAttribute("slot")!==d&&n.has(d)&&i.setAttribute("slot",d)}r.length!==this.#n&&(this.#n=r.length,queueMicrotask(()=>this.#e.requestUpdate()))}#s=()=>{queueMicrotask(()=>this.route())}}const j={min:180,max:560,step:16,largeStep:64},Yi={side:"left",defaultWidth:260},Se=t=>Math.round(Math.min(j.max,Math.max(j.min,t))),sn=t=>typeof t=="number"&&Number.isFinite(t)?Se(t):null,pt=(t,e)=>t==="left"?e:-e,Gi=(t,e)=>Se(t.startWidth+pt(t.side,e-t.startX)),Zi=(t,e,{key:s,shiftKey:n})=>{const r=n?j.largeStep:j.step;switch(s){case"ArrowLeft":return Se(t+pt(e,-r));case"ArrowRight":return Se(t+pt(e,r));case"Home":return j.min;case"End":return j.max;default:return null}},Xi=t=>`dev-process-kit:sidebar-width:${t}`,ht={kind:"idle"};class Qi{constructor(e,s){this.#n=null,this.#s="",this.#i=null,this.#t=ht,this.handlers={pointerdown:n=>{n.button===0&&(n.preventDefault(),n.currentTarget instanceof Element&&n.currentTarget.setPointerCapture(n.pointerId),this.#t={kind:"dragging",pointerId:n.pointerId,side:this.#r.layout().side,startX:n.clientX,startWidth:this.width},this.#e.requestUpdate())},pointermove:n=>{const r=this.#t;r.kind!=="dragging"||r.pointerId!==n.pointerId||this.#d(Gi(r,n.clientX))},pointerup:n=>this.#o(n),pointercancel:n=>this.#o(n),keydown:n=>{const r=Zi(this.width,this.#r.layout().side,n);r!==null&&(n.preventDefault(),this.#d(r),this.#a())},dblclick:()=>{this.#d(this.#r.layout().defaultWidth),this.#a()}},this.#e=e,this.#r=s,e.addController(this)}#e;#r;#n;#s;#i;#t;hostConnected(){this.#n===null&&(this.#n=this.#r.persist()?Ce(sn):le(sn),this.#s=Xi(this.#r.template()),this.#i=this.#n.read(this.#s))}hostDisconnected(){this.#t=ht}get width(){return this.#i??this.#r.layout().defaultWidth}get dragging(){return this.#t.kind==="dragging"}#o(e){const s=this.#t;s.kind!=="dragging"||s.pointerId!==e.pointerId||(this.#t=ht,this.#a(),this.#e.requestUpdate())}#d(e){const s=e===this.#r.layout().defaultWidth?null:e;s!==this.#i&&(this.#i=s,this.#e.requestUpdate())}#a(){this.#i===null?this.#n?.remove(this.#s):this.#n?.write(this.#s,this.#i)}}const eo=[me,be,R`
1184
- :host {
1185
- display: block;
1186
- min-height: 100%;
1187
- background: var(--dpk-paper);
1188
- color-scheme: light;
1189
- }
1190
-
1191
- /* The element stamps its resolved scheme; nested components inherit it. */
1192
- :host([data-theme='dark']) {
1193
- color-scheme: dark;
1194
- }
1195
-
1196
- .dpk-shell {
1197
- display: grid;
1198
- /* One column no wider than the host: a truncated title must not widen
1199
- the page past a phone screen. */
1200
- grid-template-columns: minmax(0, 1fr);
1201
- grid-template-rows: auto minmax(0, 1fr) auto;
1202
- min-height: 100%;
1203
- max-height: 100%;
1204
- }
1205
-
1206
- /* ------------------------------------------------------------- header */
1207
-
1208
- .dpk-header {
1209
- position: relative;
1210
- z-index: 20;
1211
- display: flex;
1212
- align-items: center;
1213
- gap: 14px;
1214
- min-height: 60px;
1215
- /* Right padding keeps the header content clear of the fixed review button. */
1216
- padding: 10px 72px 10px 16px;
1217
- border-bottom: 1px solid var(--dpk-rule);
1218
- background: var(--dpk-glass);
1219
- backdrop-filter: saturate(1.6) blur(14px);
1220
- box-shadow: 0 1px 0 var(--dpk-highlight) inset;
1221
- }
1222
-
1223
- /* A hairline of the accent along the bottom edge, fading out to the right. */
1224
- .dpk-header::after {
1225
- content: '';
1226
- position: absolute;
1227
- left: 0;
1228
- right: 0;
1229
- bottom: -1px;
1230
- height: 1px;
1231
- background: linear-gradient(
1232
- 90deg,
1233
- color-mix(in srgb, var(--dpk-accent) 70%, transparent),
1234
- color-mix(in srgb, var(--dpk-accent) 0%, transparent) 38%
1235
- );
1236
- pointer-events: none;
1237
- }
1238
-
1239
- /* Kit mark: a stack of pages, the single HTML page the agent wrote. */
1240
- .dpk-brand {
1241
- position: relative;
1242
- flex: none;
1243
- width: 32px;
1244
- height: 32px;
1245
- border-radius: 9px;
1246
- background:
1247
- radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.35), transparent 60%),
1248
- linear-gradient(145deg, var(--dpk-accent-bright), var(--dpk-accent-strong));
1249
- box-shadow:
1250
- inset 0 1px 0 rgba(255, 255, 255, 0.3),
1251
- inset 0 -1px 0 rgba(0, 0, 0, 0.12),
1252
- 0 4px 12px -4px color-mix(in srgb, var(--dpk-accent) 70%, transparent);
1253
- }
1254
-
1255
- .dpk-brand::before,
1256
- .dpk-brand::after {
1257
- content: '';
1258
- position: absolute;
1259
- width: 12px;
1260
- height: 15px;
1261
- border-radius: 3px;
1262
- }
1263
-
1264
- .dpk-brand::before {
1265
- left: 12px;
1266
- top: 7px;
1267
- background: rgba(255, 255, 255, 0.4);
1268
- }
1269
-
1270
- .dpk-brand::after {
1271
- left: 8px;
1272
- top: 10px;
1273
- background:
1274
- linear-gradient(var(--dpk-accent), var(--dpk-accent)) 3px 4px / 6px 1.5px no-repeat,
1275
- linear-gradient(var(--dpk-accent), var(--dpk-accent)) 3px 7.5px / 4px 1.5px no-repeat,
1276
- #fff;
1277
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
1278
- }
1279
-
1280
- .dpk-title {
1281
- display: flex;
1282
- flex-direction: column;
1283
- gap: 3px;
1284
- min-width: 0;
1285
- }
1286
-
1287
- .dpk-title h1 {
1288
- font-size: 16px;
1289
- font-weight: 680;
1290
- letter-spacing: -0.02em;
1291
- white-space: nowrap;
1292
- overflow: hidden;
1293
- text-overflow: ellipsis;
1294
- }
1295
-
1296
- .dpk-template-mark {
1297
- align-self: flex-start;
1298
- font-family: var(--dpk-mono);
1299
- font-size: 9.5px;
1300
- font-weight: 600;
1301
- letter-spacing: 0.14em;
1302
- line-height: 1;
1303
- text-transform: uppercase;
1304
- color: var(--dpk-accent);
1305
- }
1306
-
1307
- .dpk-header-slot {
1308
- flex: 1;
1309
- min-width: 0;
1310
- display: flex;
1311
- align-items: center;
1312
- gap: 10px;
1313
- }
1314
-
1315
- .dpk-header-meta {
1316
- display: flex;
1317
- align-items: center;
1318
- gap: 0;
1319
- margin-left: auto;
1320
- padding: 3px;
1321
- border-radius: 999px;
1322
- border: 1px solid var(--dpk-rule);
1323
- background: var(--dpk-paper-sunken);
1324
- font-family: var(--dpk-mono);
1325
- font-size: 10px;
1326
- letter-spacing: 0.02em;
1327
- color: var(--dpk-ink-faint);
1328
- white-space: nowrap;
1329
- }
1330
-
1331
- .dpk-header-meta span {
1332
- padding: 3px 9px;
1333
- }
1334
-
1335
- .dpk-header-meta span + span {
1336
- border-left: 1px solid var(--dpk-rule);
1337
- }
1338
-
1339
- .dpk-header-meta .dpk-meta-count {
1340
- margin-left: 2px;
1341
- border-left: 0;
1342
- border-radius: 999px;
1343
- background: var(--dpk-paper-raised);
1344
- color: var(--dpk-ink-soft);
1345
- box-shadow: var(--dpk-bevel), var(--dpk-shadow-xs);
1346
- }
1347
-
1348
- .dpk-header-meta .dpk-meta-count[data-active='true'] {
1349
- background: var(--dpk-accent-soft);
1350
- color: var(--dpk-accent);
1351
- box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--dpk-accent) 25%, transparent);
1352
- }
1353
-
1354
- .dpk-header-tools {
1355
- display: flex;
1356
- flex: none;
1357
- align-items: center;
1358
- gap: 2px;
1359
- padding: 3px;
1360
- border: 1px solid var(--dpk-rule);
1361
- border-radius: 999px;
1362
- background: var(--dpk-paper-sunken);
1363
- }
1364
-
1365
- .dpk-lang-select {
1366
- flex: none;
1367
- height: 26px;
1368
- padding: 0 24px 0 10px;
1369
- border: 0;
1370
- border-radius: 999px;
1371
- background: transparent
1372
- url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'><path d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%23878e9e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>")
1373
- no-repeat right 8px center;
1374
- appearance: none;
1375
- color: var(--dpk-ink-soft);
1376
- font: inherit;
1377
- font-size: 12px;
1378
- font-weight: 520;
1379
- cursor: pointer;
1380
- transition:
1381
- color 160ms var(--dpk-ease),
1382
- background-color 160ms var(--dpk-ease);
1383
- }
1384
-
1385
- .dpk-lang-select:hover {
1386
- color: var(--dpk-ink);
1387
- background-color: var(--dpk-paper-raised);
1388
- }
1389
-
1390
- .dpk-lang-select:focus-visible {
1391
- outline: none;
1392
- box-shadow: var(--dpk-focus);
1393
- }
1394
-
1395
- .dpk-theme-toggle {
1396
- display: inline-flex;
1397
- flex: none;
1398
- align-items: center;
1399
- justify-content: center;
1400
- width: 26px;
1401
- height: 26px;
1402
- padding: 0;
1403
- border: 0;
1404
- border-radius: 999px;
1405
- background: transparent;
1406
- color: var(--dpk-ink-soft);
1407
- cursor: pointer;
1408
- transition:
1409
- color 160ms var(--dpk-ease),
1410
- background 160ms var(--dpk-ease),
1411
- transform 300ms var(--dpk-ease-spring);
1412
- }
1413
-
1414
- .dpk-theme-toggle svg {
1415
- width: 14px;
1416
- height: 14px;
1417
- }
1418
-
1419
- .dpk-theme-toggle:hover {
1420
- color: var(--dpk-ink);
1421
- background: var(--dpk-paper-raised);
1422
- transform: rotate(-18deg);
1423
- }
1424
-
1425
- .dpk-theme-toggle:focus-visible {
1426
- outline: none;
1427
- box-shadow: var(--dpk-focus);
1428
- }
1429
-
1430
- /* --------------------------------------------------------------- body */
1431
-
1432
- .dpk-body {
1433
- display: flex;
1434
- min-height: 0;
1435
- }
1436
-
1437
- .dpk-sidebar {
1438
- /* The element sets the template's or the reader's width; on a narrow
1439
- screen a wide one still leaves the main column some room. */
1440
- width: var(--dpk-sidebar-width);
1441
- max-width: calc(100% - 120px);
1442
- flex: 0 0 auto;
1443
- border-right: 1px solid var(--dpk-rule);
1444
- background: var(--dpk-paper-sunken);
1445
- overflow: auto;
1446
- padding: 18px 14px;
1447
- scrollbar-width: thin;
1448
- }
1449
-
1450
- .dpk-sidebar[hidden] {
1451
- display: none;
1452
- }
1453
-
1454
- /*
1455
- * A right-hand sidebar: a rail beside the main column rather than a list
1456
- * before it. \`:where\` keeps these as weak as the rules above, so a
1457
- * template can still restyle the rail (stacking it on a phone, say).
1458
- */
1459
- :where(.dpk-body[data-sidebar-side='right']) .dpk-main {
1460
- order: 1;
1461
- }
1462
-
1463
- :where(.dpk-body[data-sidebar-side='right']) .dpk-sidebar,
1464
- :where(.dpk-body[data-sidebar-side='right']) .dpk-sidebar-resizer {
1465
- order: 2;
1466
- }
1467
-
1468
- :where(.dpk-body[data-sidebar-side='right']) .dpk-sidebar {
1469
- border-right: 0;
1470
- border-left: 1px solid var(--dpk-rule);
1471
- }
1472
-
1473
- /*
1474
- * The sidebar's resizable edge: a hit area straddling its border that takes
1475
- * no room of its own, with an accent line while hovered, focused or dragged.
1476
- */
1477
- .dpk-sidebar-resizer {
1478
- position: relative;
1479
- z-index: 6;
1480
- flex: none;
1481
- width: 9px;
1482
- /* Centred on the sidebar's border, whichever side that is. */
1483
- margin: 0 -5px 0 -4px;
1484
- cursor: col-resize;
1485
- touch-action: none;
1486
- }
1487
-
1488
- .dpk-sidebar-resizer::after {
1489
- content: '';
1490
- position: absolute;
1491
- top: 0;
1492
- bottom: 0;
1493
- left: 3px;
1494
- width: 2px;
1495
- border-radius: 1px;
1496
- background: var(--dpk-accent);
1497
- opacity: 0;
1498
- transition: opacity 160ms var(--dpk-ease);
1499
- }
1500
-
1501
- .dpk-sidebar-resizer:hover::after,
1502
- .dpk-sidebar-resizer:focus-visible::after,
1503
- .dpk-shell[data-resizing] .dpk-sidebar-resizer::after {
1504
- opacity: 1;
1505
- }
1506
-
1507
- .dpk-sidebar-resizer:focus-visible {
1508
- outline: none;
1509
- }
1510
-
1511
- /* While dragging, the cursor stays put and nothing underneath (text, preview frames) reacts. */
1512
- .dpk-shell[data-resizing] {
1513
- cursor: col-resize;
1514
- user-select: none;
1515
- }
1516
-
1517
- .dpk-shell[data-resizing] .dpk-main {
1518
- pointer-events: none;
1519
- }
1520
-
1521
- .dpk-main {
1522
- flex: 1 1 0%;
1523
- display: flex;
1524
- flex-direction: column;
1525
- min-width: 0;
1526
- overflow: auto;
1527
- /* A faint wash of the accent from the top left corner gives the ground some depth. */
1528
- background:
1529
- radial-gradient(
1530
- ellipse 900px 360px at 0% 0%,
1531
- color-mix(in srgb, var(--dpk-accent) 5%, transparent),
1532
- transparent 70%
1533
- ),
1534
- radial-gradient(
1535
- ellipse 700px 320px at 100% 0%,
1536
- color-mix(in srgb, var(--dpk-blue) 4%, transparent),
1537
- transparent 70%
1538
- ),
1539
- var(--dpk-paper);
1540
- background-attachment: local;
1541
- }
1542
-
1543
- .dpk-main-body {
1544
- flex: 1 0 auto;
1545
- display: grid;
1546
- align-content: start;
1547
- gap: 16px;
1548
- min-width: 0;
1549
- padding: 24px;
1550
- animation: dpk-rise 420ms var(--dpk-ease) backwards;
1551
- }
1552
-
1553
- @keyframes dpk-rise {
1554
- from {
1555
- opacity: 0;
1556
- transform: translateY(6px);
1557
- }
1558
- }
1559
-
1560
- /*
1561
- * Author memo. It sits at the end of the main column and sticks to the
1562
- * bottom of the scrollport: always visible, floating over whatever scrolls
1563
- * behind it, and never stealing height from the preview.
1564
- */
1565
- .dpk-memo {
1566
- position: sticky;
1567
- bottom: 0;
1568
- z-index: 5;
1569
- /* Clear of the hand-off dock at the bottom right while it is shown. */
1570
- padding: 0 calc(20px + var(--dpk-dock-space, 0px)) 20px 20px;
1571
- pointer-events: none;
1572
- }
1573
-
1574
- .dpk-memo[hidden] {
1575
- display: none;
1576
- }
1577
-
1578
- .dpk-memo ::slotted(*) {
1579
- display: block;
1580
- max-width: 100%;
1581
- padding: 12px 16px 12px 18px;
1582
- border: 1px solid var(--dpk-rule-strong);
1583
- border-radius: var(--dpk-radius-lg);
1584
- background:
1585
- linear-gradient(90deg, var(--dpk-amber) 0 3px, transparent 3px),
1586
- color-mix(in srgb, var(--dpk-paper-raised) 88%, transparent);
1587
- backdrop-filter: blur(12px);
1588
- box-shadow: var(--dpk-bevel), var(--dpk-shadow-lg);
1589
- font-size: 12.5px;
1590
- line-height: 1.7;
1591
- color: var(--dpk-ink-soft);
1592
- pointer-events: auto;
1593
- }
1594
-
1595
- .dpk-orphans {
1596
- margin-top: 16px;
1597
- border: 1px dashed var(--dpk-rule-strong);
1598
- border-radius: var(--dpk-radius);
1599
- padding: 12px;
1600
- }
1601
-
1602
- .dpk-banner {
1603
- display: grid;
1604
- gap: 4px;
1605
- margin-bottom: 14px;
1606
- border: 1px solid color-mix(in srgb, var(--dpk-danger) 35%, transparent);
1607
- border-radius: var(--dpk-radius);
1608
- background: linear-gradient(90deg, var(--dpk-danger) 0 3px, transparent 3px), var(--dpk-danger-soft);
1609
- padding: 12px 14px 12px 17px;
1610
- max-width: 900px;
1611
- }
1612
-
1613
- .dpk-banner strong {
1614
- font-size: 13px;
1615
- color: var(--dpk-danger);
1616
- }
1617
-
1618
- .dpk-banner code {
1619
- font-family: var(--dpk-mono);
1620
- font-size: 11px;
1621
- color: var(--dpk-ink-soft);
1622
- overflow-wrap: anywhere;
1623
- }
1624
-
1625
- .dpk-notes {
1626
- flex: 0 0 auto;
1627
- width: 360px;
1628
- border-left: 1px solid var(--dpk-rule);
1629
- background: var(--dpk-paper-raised);
1630
- box-shadow: -12px 0 32px -24px var(--dpk-shade-3);
1631
- overflow: hidden;
1632
- display: flex;
1633
- animation: dpk-slide-in 260ms var(--dpk-ease) backwards;
1634
- }
1635
-
1636
- @keyframes dpk-slide-in {
1637
- from {
1638
- opacity: 0;
1639
- transform: translateX(16px);
1640
- }
1641
- }
1642
-
1643
- .dpk-notes[hidden] {
1644
- display: none;
1645
- }
1646
-
1647
- /* ------------------------------------------------------------- footer */
1648
-
1649
- .dpk-footer {
1650
- border-top: 1px solid var(--dpk-rule);
1651
- padding: 10px 20px;
1652
- display: flex;
1653
- gap: 12px;
1654
- align-items: center;
1655
- background: var(--dpk-glass);
1656
- backdrop-filter: blur(12px);
1657
- font-size: 12px;
1658
- color: var(--dpk-ink-faint);
1659
- }
1660
-
1661
- /* --------------------------------------------------- floating review */
1662
-
1663
- /* Review toggle: pinned to the top right corner, always in the same place. */
1664
- .dpk-fab {
1665
- position: fixed;
1666
- top: 12px;
1667
- right: 16px;
1668
- z-index: 60;
1669
- display: inline-flex;
1670
- align-items: center;
1671
- justify-content: center;
1672
- width: 36px;
1673
- height: 36px;
1674
- padding: 0;
1675
- border: 1px solid var(--dpk-rule-strong);
1676
- border-radius: 11px;
1677
- background: var(--dpk-paper-raised);
1678
- color: var(--dpk-ink-soft);
1679
- box-shadow: var(--dpk-bevel), var(--dpk-shadow-sm);
1680
- cursor: pointer;
1681
- transition:
1682
- color 180ms var(--dpk-ease),
1683
- background 180ms var(--dpk-ease),
1684
- border-color 180ms var(--dpk-ease),
1685
- box-shadow 180ms var(--dpk-ease),
1686
- transform 220ms var(--dpk-ease-spring);
1687
- }
1688
-
1689
- .dpk-fab:hover {
1690
- color: var(--dpk-ink);
1691
- border-color: var(--dpk-rule-hover);
1692
- transform: translateY(-1px);
1693
- box-shadow: var(--dpk-bevel), var(--dpk-shadow);
1694
- }
1695
-
1696
- .dpk-fab:active {
1697
- transform: translateY(0) scale(0.95);
1698
- box-shadow: var(--dpk-shadow-xs);
1699
- }
1700
-
1701
- .dpk-fab:focus-visible {
1702
- outline: none;
1703
- box-shadow: var(--dpk-focus);
1704
- }
1705
-
1706
- .dpk-fab[aria-expanded='true'] {
1707
- color: var(--dpk-accent-ink);
1708
- border-color: color-mix(in srgb, var(--dpk-accent-strong) 70%, transparent);
1709
- background: linear-gradient(145deg, var(--dpk-accent-bright), var(--dpk-accent-strong));
1710
- box-shadow:
1711
- inset 0 1px 0 rgba(255, 255, 255, 0.25),
1712
- 0 6px 16px -6px color-mix(in srgb, var(--dpk-accent) 70%, transparent);
1713
- }
1714
-
1715
- .dpk-fab[aria-expanded='true']:hover {
1716
- box-shadow:
1717
- inset 0 1px 0 rgba(255, 255, 255, 0.25),
1718
- 0 10px 22px -8px color-mix(in srgb, var(--dpk-accent) 80%, transparent);
1719
- }
1720
-
1721
- .dpk-fab-icon {
1722
- position: relative;
1723
- display: block;
1724
- width: 16px;
1725
- height: 12px;
1726
- border: 1.6px solid currentColor;
1727
- border-radius: 4px;
1728
- }
1729
-
1730
- .dpk-fab-icon::after {
1731
- content: '';
1732
- position: absolute;
1733
- left: 2px;
1734
- bottom: -4px;
1735
- border-left: 3.5px solid transparent;
1736
- border-right: 3.5px solid transparent;
1737
- border-top: 4px solid currentColor;
1738
- }
1739
-
1740
- .dpk-fab-badge {
1741
- position: absolute;
1742
- top: -6px;
1743
- right: -6px;
1744
- min-width: 18px;
1745
- height: 18px;
1746
- padding: 0 4px;
1747
- border: 2px solid var(--dpk-paper);
1748
- border-radius: 999px;
1749
- background: linear-gradient(145deg, var(--dpk-accent-bright), var(--dpk-accent));
1750
- color: var(--dpk-accent-ink);
1751
- font-family: var(--dpk-mono);
1752
- font-size: 9.5px;
1753
- font-weight: 650;
1754
- font-variant-numeric: tabular-nums;
1755
- line-height: 14px;
1756
- text-align: center;
1757
- box-shadow: 0 3px 8px -2px color-mix(in srgb, var(--dpk-accent) 60%, transparent);
1758
- animation: dpk-pop 260ms var(--dpk-ease-spring);
1759
- }
1760
-
1761
- @keyframes dpk-pop {
1762
- from {
1763
- transform: scale(0.4);
1764
- opacity: 0;
1765
- }
1766
- }
1767
-
1768
- /* ------------------------------------------------------ hand-off dock */
1769
-
1770
- .dpk-dock {
1771
- position: fixed;
1772
- right: 16px;
1773
- bottom: 16px;
1774
- z-index: 60;
1775
- display: flex;
1776
- flex-direction: column;
1777
- align-items: flex-end;
1778
- gap: 8px;
1779
- max-width: calc(100vw - 32px);
1780
- animation: dpk-dock-in 260ms var(--dpk-ease) backwards;
1781
- }
1782
-
1783
- @keyframes dpk-dock-in {
1784
- from {
1785
- transform: translateY(8px);
1786
- opacity: 0;
1787
- }
1788
- }
1789
-
1790
- .dpk-dock-actions {
1791
- display: flex;
1792
- gap: 6px;
1793
- padding: 6px;
1794
- border: 1px solid var(--dpk-rule-strong);
1795
- border-radius: var(--dpk-radius-lg);
1796
- background: var(--dpk-glass);
1797
- backdrop-filter: blur(12px);
1798
- box-shadow: var(--dpk-bevel), var(--dpk-shadow-lg);
1799
- }
1800
-
1801
- .dpk-dock-note {
1802
- max-width: 320px;
1803
- margin: 0;
1804
- padding: 8px 12px;
1805
- border: 1px solid var(--dpk-rule-strong);
1806
- border-radius: var(--dpk-radius);
1807
- background: var(--dpk-paper-raised);
1808
- box-shadow: var(--dpk-shadow);
1809
- color: var(--dpk-ink-soft);
1810
- font-size: 12px;
1811
- line-height: 1.6;
1812
- }
1813
-
1814
- @media (max-width: 720px) {
1815
- .dpk-header-meta {
1816
- display: none;
1817
- }
1818
-
1819
- .dpk-brand {
1820
- display: none;
1821
- }
1822
- }
1823
- `];class to extends O{static{this.styles=eo}static{this.properties={storageKey:{type:String,attribute:"storage-key"},storage:{type:String},notes:{type:String},theme:{type:String},notesOpen:{state:!0}}}#e=!1;#r=new Vi(this);#n=new Ui(this,()=>this.storage!=="off"&&this.storage!=="memory");#s=new Di(this);#i=new Ki(this);#t=new Qi(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",template:()=>this.definition.name,layout:()=>this.sidebarLayout});#o=new Wi(this,()=>this.storage!=="off"&&this.storage!=="memory",()=>this.#a?.setTemplate(this.definition));#d;#a;#l=Ve;#m=null;#b=new Set;#u=null;#c;#g;#p;#h=[];#v;#w=new Promise(e=>{this.#v=e});#y;get locale(){return this.#o.locale}get definition(){const e=this.locale;return this.#d?.locale!==e&&(this.#d={locale:e,value:this.definitionFor(e)}),this.#d.value}connectedCallback(){super.connectedCallback(),this.dataset.template=this.definition.name,this.#e||(this.#e=!0,this.notesOpen=this.notes==="on"||this.notes==="open"),this.#C(),window.addEventListener("hashchange",this.#M),this.addEventListener("click",this.#R),this.addEventListener("dpk-comment-targets-change",this.#f),this.addEventListener("dpk-comment-request",this.#O),this.addEventListener("dpk-comment-submit",this.#j),this.addEventListener("dpk-element-action",this.#L),this.#p??=new MutationObserver(this.#f),this.#f()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("hashchange",this.#M),this.removeEventListener("click",this.#R),this.#g?.disconnect(),this.#p?.disconnect(),this.removeEventListener("dpk-comment-targets-change",this.#f),this.removeEventListener("dpk-comment-request",this.#O),this.removeEventListener("dpk-comment-submit",this.#j),this.removeEventListener("dpk-element-action",this.#L)}#C(e=0){if(this.#a){this.#S();return}if(this.childNodes.length===0&&e<2){queueMicrotask(()=>this.#C(e+1));return}this.#I()}#S(){this.#c||(this.#c=this.#a?.subscribe(()=>this.#H()))}willUpdate(){this.dataset.theme=this.#n.resolve(oe(this.theme))}updated(){this.#K(),this.#F()}get api(){return this.#y??=this.#D(),this.#y}get controller(){if(!this.#a)throw new Error(`<${this.tagName.toLowerCase()}> is not initialized yet`);return this.#a}get derivation(){return this.controller.derivation}get navigation(){return this.#l}dispatch(e){const s=this.controller.dispatch(e);return s.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:s.issues},bubbles:!0,composed:!0})),this.#k()),s}dispatchBatch(e){const s=this.controller.dispatchBatch(e);return s.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:s.issues},bubbles:!0,composed:!0})),this.#k()),s}removeAction(e){this.controller.removeAction(e)}clearActions(){this.controller.clearActions()}navigate(e,s={}){const n=G(this.#x());this.#l=Ge(this.#l,e,this.definition.navigationHierarchy),this.#$(s.replace??!1);const r=G(this.#x());this.requestUpdate(),n!==r&&(this.#k(),this.dispatchEvent(new CustomEvent("dpk-navigate",{detail:{navigation:this.#l},bubbles:!0,composed:!0})))}hashFor(e){const s=this.#x();return G(this.definition.resolveNavigation(this.derivation.state,Ge(s,e,this.definition.navigationHierarchy)))}requestComment(e){this.#m=typeof e=="string"?e:_(e),this.notesOpen=!0,this.requestUpdate()}get integratedReview(){return!1}get canSendToClaude(){return this.#s.available}sendToClaude(){return this.#s.send({brief:this.api.exportBrief(),draft:Ke(this.derivation.actions),anchor:this})}renderReviewPanel(e){return f`<dpk-component-comment-panel
1824
- .definition=${this.controller.definition}
1825
- .state=${e.state}
1826
- .navigation=${e.navigation}
1827
- .derivation=${this.derivation}
1828
- .issues=${this.controller.lastIssues}
1829
- .exportBrief=${()=>this.api.exportBrief()}
1830
- .sendToClaude=${this.canSendToClaude?()=>this.sendToClaude():void 0}
1831
- .pendingTarget=${this.#m}
1832
- .embedded=${this.integratedReview}
1833
- .onDelete=${s=>this.removeAction(s)}
1834
- .onClear=${()=>this.clearActions()}
1835
- .onComment=${(s,n)=>{const r=this.dispatch({type:E,target:s,payload:{body:n}});return r.ok&&(this.#m=null),r}}
1836
- ></dpk-component-comment-panel>`}renderChrome(e,s){const n=e.actions.length,r=e.comments.length,i=B(this.locale),o=s.sidebarHidden===!0||!s.sidebar&&!this.hasSidebarContent(),d=this.sidebarLayout.side;return f`
1837
- <div class="dpk-shell" ?data-resizing=${this.#t.dragging}>
1838
- <header class="dpk-header">
1839
- <span class="dpk-brand" aria-hidden="true"></span>
1840
- <div class="dpk-title">
1841
- <span class="dpk-template-mark">${this.definition.label}</span>
1842
- <h1>${this.definition.title(e.state)}</h1>
1843
- </div>
1844
- <div class="dpk-header-slot">
1845
- ${s.header??g}
1846
- <slot name="header"></slot>
1847
- </div>
1848
- <div class="dpk-header-meta">
1849
- <span>dev-process-kit@${Z}</span>
1850
- <span>${this.definition.name}</span>
1851
- <span class="dpk-meta-count" data-active=${n>0?"true":"false"}>
1852
- ${n} draft · ${r} note
1853
- </span>
1854
- </div>
1855
- <div class="dpk-header-tools">${this.#N()} ${this.#P()}</div>
1856
- </header>
1857
- <div class="dpk-body" data-sidebar-side=${d}>
1858
- ${o||d!=="right"?g:this.#_()}
1859
- <aside
1860
- class="dpk-sidebar"
1861
- ?hidden=${o}
1862
- style=${`--dpk-sidebar-width: ${this.#t.width}px`}
1863
- >
1864
- ${s.sidebar??g}
1865
- <slot name="sidebar"></slot>
1866
- </aside>
1867
- ${o||d!=="left"?g:this.#_()}
1868
- <main class="dpk-main">
1869
- <div class="dpk-main-body">
1870
- ${this.#u?f`<div class="dpk-banner" role="alert">
1871
- <strong>${i.baseDataError}</strong>
1872
- <code>${this.#u}</code>
1873
- </div>`:g}
1874
- ${s.main??g}
1875
- <slot name="main"></slot>
1876
- <section class="dpk-orphans" ?hidden=${this.#r.orphans===0}>
1877
- <p class="dpk-label">previews without metadata</p>
1878
- <slot name="preview"></slot>
1879
- </section>
1880
- </div>
1881
- <div class="dpk-memo" ?hidden=${!this.hasMemoContent()}>
1882
- <slot name="memo"></slot>
1883
- </div>
1884
- </main>
1885
- ${this.integratedReview?g:f`<aside class="dpk-notes" ?hidden=${!this.notesOpen}>${this.renderReviewPanel(e)}</aside>`}
1886
- </div>
1887
- ${s.footer||this.hasFooterContent()?f`<footer class="dpk-footer">
1888
- ${s.footer??g}
1889
- <slot name="footer"></slot>
1890
- </footer>`:g}
1891
- ${this.integratedReview?g:f`<button
1892
- class="dpk-fab"
1893
- type="button"
1894
- aria-expanded=${this.notesOpen?"true":"false"}
1895
- title=${i.reviewToggle}
1896
- @click=${()=>{this.notesOpen=!this.notesOpen}}
1897
- >
1898
- <span class="dpk-fab-icon" aria-hidden="true"></span>
1899
- <span
1900
- class="dpk-label"
1901
- style="position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)"
1902
- >
1903
- ${i.review}
1904
- </span>
1905
- ${n>0?f`<span class="dpk-fab-badge">${n}</span>`:g}
1906
- </button>`}
1907
- ${this.integratedReview?g:this.#z(n)}
1908
- </div>
1909
- `}#z(e){const s=Ti({actions:e,railOpen:this.notesOpen,sendable:this.canSendToClaude,locale:this.locale},this.#i.state);if(!s)return g;const n=B(this.locale);return f`<div class="dpk-dock" role="group" aria-label=${n.handoffLabel}>
1910
- ${s.note?f`<p class="dpk-dock-note" role="alert">${s.note}</p>`:g}
1911
- <div class="dpk-dock-actions">
1912
- ${s.send?f`<button
1913
- class="dpk-btn dpk-btn--accent"
1914
- type="button"
1915
- ?disabled=${s.send.disabled}
1916
- @click=${()=>{this.#i.send(()=>this.sendToClaude())}}
1917
- >
1918
- ${s.send.label}
1919
- </button>`:g}
1920
- <button
1921
- class=${s.send?"dpk-btn":"dpk-btn dpk-btn--accent"}
1922
- type="button"
1923
- data-status=${s.copy.status}
1924
- title=${n.handoffCopyTitle}
1925
- @click=${()=>{this.#i.copy(()=>this.api.exportBrief())}}
1926
- >
1927
- ${s.copy.label}
1928
- </button>
1929
- </div>
1930
- </div>`}#N(){const e=this.locale,s=B(e).language;return f`<select
1931
- class="dpk-lang-select"
1932
- aria-label=${s}
1933
- title=${s}
1934
- @change=${Cs(n=>{const r=ze.find(i=>i===n);r!==void 0&&this.#o.pick(r)})}
1935
- >
1936
- ${ze.map(n=>f`<option value=${n} lang=${n} ?selected=${n===e}>
1937
- ${pr[n]}
1938
- </option>`)}
1939
- </select>`}#P(){const e=this.dataset.theme==="dark",s=B(this.locale),n=e?s.useLightTheme:s.useDarkTheme;return f`<button
1940
- class="dpk-theme-toggle"
1941
- type="button"
1942
- aria-label=${n}
1943
- title=${n}
1944
- @click=${()=>this.#n.toggle(oe(this.theme))}
1945
- >
1946
- ${e?zr():Nr()}
1947
- </button>`}#_(){const e=B(this.locale),s=this.#t.handlers;return f`<div
1948
- class="dpk-sidebar-resizer"
1949
- role="separator"
1950
- tabindex="0"
1951
- aria-orientation="vertical"
1952
- aria-label=${e.resizeSidebar}
1953
- aria-valuemin=${j.min}
1954
- aria-valuemax=${j.max}
1955
- aria-valuenow=${this.#t.width}
1956
- title=${e.resizeSidebarHint}
1957
- @pointerdown=${s.pointerdown}
1958
- @pointermove=${s.pointermove}
1959
- @pointerup=${s.pointerup}
1960
- @pointercancel=${s.pointercancel}
1961
- @keydown=${s.keydown}
1962
- @dblclick=${s.dblclick}
1963
- ></div>`}render(){if(!this.#a)return g;const e=this.#T();return this.renderChrome(e,this.renderRegions(e))}get sidebarLayout(){return Yi}hasSidebarContent(){return this.querySelector('[slot="sidebar"]')!==null}hasMemoContent(){return this.querySelector('[slot="memo"]')!==null}hasFooterContent(){return this.querySelector('[slot="footer"]')!==null}context(){return this.#T()}#A(){return{definition:this.definition,controller:()=>this.controller,derivation:()=>this.derivation,ready:this.#w,navigation:()=>this.#x(),issues:()=>this.controller.lastIssues,dispatch:e=>this.dispatch(e),dispatchBatch:e=>this.dispatchBatch(e),subscribe:e=>(this.#b.add(e),()=>{this.#b.delete(e)}),removeAction:e=>this.removeAction(e),clearActions:()=>this.clearActions(),navigate:(e,s)=>this.navigate(e,s),hashFor:e=>this.hashFor(e),requestComment:e=>this.requestComment(e)}}#D(){return Oi(this.#A(),this)}#E(){return Js(this.#A())}#T(){return Mi(this.#A())}#x(){return this.definition.resolveNavigation(this.derivation.state,this.#l)}#I(){const e=this.#q();this.#l=tn();const s=this.storageKey;this.#a=new Fs({definition:this.definition,base:e,storage:this.#U(),...typeof s=="string"?{storageKey:s}:{}}),this.#S(),this.#f(),this.#$(!0),this.#v?.(),this.#B(),this.requestUpdate()}#U(){return this.storage==="off"?null:this.storage==="memory"?new ot:at()}#q(){const e=this.querySelector('script[type="application/json"]');if(!e?.textContent||e.textContent.trim().length===0)return console.warn(`[dev-process-kit] <${this.tagName.toLowerCase()}> has no base JSON; starting from an empty state.`),this.#u='no <script type="application/json"> child found',this.definition.emptyBase();try{return this.definition.parseBase(JSON.parse(e.textContent))}catch(s){return console.error("[dev-process-kit] invalid base data:",s),this.#u=s instanceof Error?s.message:String(s),this.definition.emptyBase()}}#B(){this.querySelector('script[type="application/json"]')||(this.#g=new MutationObserver(()=>{const e=this.querySelector('script[type="application/json"]');if(e){this.#g?.disconnect(),this.#g=void 0;try{this.controller.setBase(this.definition.parseBase(JSON.parse(e.textContent??"null")))}catch(s){console.error("[dev-process-kit] invalid base data:",s)}}}),this.#g.observe(this,{childList:!0,subtree:!0}))}#k(){const e=this.#E();for(const s of this.#b)s(e)}#H(){if(!this.isConnected){this.requestUpdate(),this.#k();return}this.#$(!0),en(this.#h,this.controller.actions),queueMicrotask(this.#f),this.requestUpdate(),this.#k(),this.dispatchEvent(new CustomEvent("dpk-change",{detail:this.#E(),bubbles:!0,composed:!0}))}#$(e){const s=this.#x();this.#l=s,Ji(s,e)}#M=()=>{this.#l=tn(),this.#$(!0),this.requestUpdate(),this.#k(),this.dispatchEvent(new CustomEvent("dpk-navigate",{detail:{navigation:this.#l},bubbles:!0,composed:!0}))};#f=()=>{this.#p?.disconnect(),this.#h=qi(this,e=>{this.isConnected&&this.#p?.observe(e,{childList:!0,subtree:!0})}),this.#a&&(en(this.#h,this.#a.actions),this.#a.setComponentSnapshot(Hi(this.#h)))};#O=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!this.#a)return;const s=e.detail;typeof s!="object"||s===null||!("target"in s)||typeof s.target!="string"||(this.#f(),!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(r=>r.value===s.target))||this.requestComment(s.target)};#j=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!e.cancelable||!this.#a)return;const s=y(Wr,e.detail);if(!s.success)return;this.#f();const{target:n,body:r}=s.output;if(!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(d=>d.value===n))return;this.dispatch({type:E,target:n,payload:{body:r}}).ok&&e.preventDefault()};#L=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!e.cancelable||!this.#a)return;const s=y(ir,e.detail);if(!s.success)return;this.#f();const{type:n,target:r,payload:i}=s.output;if(!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(a=>a.value===r))return;this.dispatch({type:n,target:r,payload:i}).ok&&e.preventDefault()};#R=e=>{for(const s of e.composedPath()){if(!(s instanceof Element))continue;if(s===this||s.hasAttribute("data-template"))break;const n=s.getAttribute("data-dpk-navigate");if(n!==null){e.preventDefault(),this.navigate(Ye(n.includes("=")?n:`step=${n}`));return}const r=s.getAttribute("data-dpk-comment");if(r!==null){e.preventDefault(),this.requestComment(r);return}}};#F(){const e=this.renderRoot.querySelector(".dpk-shell"),s=this.renderRoot.querySelector(".dpk-dock-actions");e&&(s?e.style.setProperty("--dpk-dock-space",`${s.offsetWidth+8}px`):e.style.removeProperty("--dpk-dock-space"))}#K(){this.#r.route()}}const so=(t,e)=>{typeof window>"u"||Object.assign(window,{devProcessKit:{version:t,templates:e}})};export{Tn as $,st as A,Er as B,E as C,As as D,Ve as E,Z as F,xs as G,$s as H,ys as I,ws as J,vs as K,Is as L,ot as M,Ye as N,Gt as O,Wn as P,Ge as Q,Jn as R,Ke as S,to as T,Zt as U,_ as V,it as W,xe as X,Be as Y,me as Z,ge as _,so as a,R as a0,g as a1,f as a2,ks as a3,gn as a4,O as a5,De as a6,Lr as a7,Rr as a8,Yt as a9,Hr as aA,Ae as aB,W as aC,Qe as aD,Xe as aE,Fn as aF,hs as aG,us as aH,ms as aI,Or as aJ,_r as aK,Sr as aL,V as aa,ve as ab,U as ac,m as ad,ye as ae,k as af,v as ag,Ft as ah,Vt as ai,q as aj,J as ak,qt as al,y as am,$ as an,Bt as ao,qe as ap,It as aq,Dt as ar,Ht as as,Hn as at,jr as au,S as av,Ce as aw,le as ax,Br as ay,Cs as az,ts as b,Pt as c,Fs as d,Fe as e,Vn as f,Ze as g,es as h,$e as i,Ps as j,be as k,Xt as l,Xn as m,He as n,at as o,Hs as p,Kn as q,Ur as r,On as s,Ds as t,Y as u,Gn as v,G as w,Mr as x,Tr as y,tt as z};