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.
- package/README.md +1 -0
- package/dist/chunks/shared-7qenhU4J.js +2173 -0
- package/dist/chunks/{shared-Dn4XK7mS.js → shared-8lYUcRvS.js} +25 -15
- package/dist/chunks/shared-BHGClRU3.js +29 -0
- package/dist/chunks/{shared-DNk3phV5.js → shared-BIdQ89rB.js} +1 -1
- package/dist/chunks/{shared-BTlCV660.js → shared-BOFIcKZe.js} +8 -8
- package/dist/chunks/shared-Cia5FdOF.js +1112 -0
- package/dist/chunks/shared-D4czF1TI.js +1252 -0
- package/dist/chunks/{shared-DEdm-PCj.js → shared-D6Yx-euS.js} +2 -2
- package/dist/chunks/{shared-CwwZhA40.js → shared-Dkx_2Lbf.js} +336 -268
- package/dist/chunks/shared-Dn5j0MCU.js +1 -0
- package/dist/chunks/{shared-CupreHTH.js → shared-SGSKyTNs.js} +7 -7
- package/dist/chunks/shared-U2T3astJ.js +1094 -0
- package/dist/chunks/shared-nW8tfMgg.js +556 -0
- package/dist/chunks/{shared-CaLe76va.js → shared-p8037r6P.js} +2 -2
- package/dist/components.js +1 -1
- package/dist/index.js +1 -1
- package/dist/templates/delegation-poker.js +1 -1
- package/dist/templates/event-storming.js +1 -1
- package/dist/templates/example-mapping.js +1 -1
- package/dist/templates/grill.js +1 -1
- package/dist/templates/plain.js +1 -1
- package/dist/templates/prototype.js +1 -1
- package/dist/templates/slides.js +1 -1
- package/dist/templates/task-board.js +1 -1
- package/dist/templates/usm.js +1 -1
- package/dist/templates/whiteboard.js +1 -0
- package/package.json +3 -2
- package/dist/chunks/shared-1AA-0t4O.js +0 -29
- package/dist/chunks/shared-BAePwoKi.js +0 -679
- package/dist/chunks/shared-BYZoeQ97.js +0 -1963
- package/dist/chunks/shared-CSV1HkB2.js +0 -1
- package/dist/chunks/shared-Csmm_KdH.js +0 -761
- package/dist/chunks/shared-VNSWugEg.js +0 -556
|
@@ -0,0 +1,2173 @@
|
|
|
1
|
+
const me=globalThis,je=me.ShadowRoot&&(me.ShadyCSS===void 0||me.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Le=Symbol(),_t=new WeakMap;let Tt=class{constructor(e,s,n){if(this._$cssResult$=!0,n!==Le)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(je&&e===void 0){const n=s!==void 0&&s.length===1;n&&(e=_t.get(s)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&_t.set(s,e))}return e}toString(){return this.cssText}};const Ot=t=>new Tt(typeof t=="string"?t:t+"",void 0,Le),q=(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 Tt(s,t,Le)},$n=(t,e)=>{if(je)t.adoptedStyleSheets=e.map(s=>s instanceof CSSStyleSheet?s:s.styleSheet);else for(const s of e){const n=document.createElement("style"),r=me.litNonce;r!==void 0&&n.setAttribute("nonce",r),n.textContent=s.cssText,t.appendChild(n)}},Mt=je?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let s="";for(const n of e.cssRules)s+=n.cssText;return Ot(s)})(t):t,{is:An,defineProperty:Cn,getOwnPropertyDescriptor:Sn,getOwnPropertyNames:En,getOwnPropertySymbols:_n,getPrototypeOf:Tn}=Object,be=globalThis,jt=be.trustedTypes,On=jt?jt.emptyScript:"",Mn=be.reactiveElementPolyfillSupport,se=(t,e)=>t,Re={toAttribute(t,e){switch(e){case Boolean:t=t?On: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}},Lt=(t,e)=>!An(t,e),Rt={attribute:!0,type:String,converter:Re,reflect:!1,useDefault:!1,hasChanged:Lt};Symbol.metadata??=Symbol("metadata"),be.litPropertyMetadata??=new WeakMap;let J=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=Rt){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&&Cn(this.prototype,e,r)}}static getPropertyDescriptor(e,s,n){const{get:r,set:i}=Sn(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)??Rt}static _$Ei(){if(this.hasOwnProperty(se("elementProperties")))return;const e=Tn(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(se("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(se("properties"))){const s=this.properties,n=[...En(s),..._n(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 $n(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:Re).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:Re;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??Lt)(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){}};J.elementStyles=[],J.shadowRootOptions={mode:"open"},J[se("elementProperties")]=new Map,J[se("finalized")]=new Map,Mn?.({ReactiveElement:J}),(be.reactiveElementVersions??=[]).push("2.1.2");const Pe=globalThis,Pt=t=>t,ke=Pe.trustedTypes,zt=ke?ke.createPolicy("lit-html",{createHTML:t=>t}):void 0,Nt="$lit$",L=`lit$${Math.random().toFixed(9).slice(2)}$`,It="?"+L,jn=`<${It}>`,U=document,ne=()=>U.createComment(""),re=t=>t===null||typeof t!="object"&&typeof t!="function",ze=Array.isArray,Ln=t=>ze(t)||typeof t?.[Symbol.iterator]=="function",Ne=`[
|
|
2
|
+
\f\r]`,ie=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,qt=/-->/g,Ut=/>/g,D=RegExp(`>|${Ne}(?:([^\\s"'>=/]+)(${Ne}*=${Ne}*(?:[^
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Dt=/'/g,Bt=/"/g,Ht=/^(?:script|style|textarea|title)$/i,Ft=t=>(e,...s)=>({_$litType$:t,strings:e,values:s}),f=Ft(1),Rn=Ft(2),T=Symbol.for("lit-noChange"),g=Symbol.for("lit-nothing"),Kt=new WeakMap,B=U.createTreeWalker(U,129);function Vt(t,e){if(!ze(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return zt!==void 0?zt.createHTML(e):e}const Pn=(t,e)=>{const s=t.length-1,n=[];let r,i=e===2?"<svg>":e===3?"<math>":"",o=ie;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===ie?p[1]==="!--"?o=qt:p[1]!==void 0?o=Ut:p[2]!==void 0?(Ht.test(p[2])&&(r=RegExp("</"+p[2],"g")),o=D):p[3]!==void 0&&(o=D):o===D?p[0]===">"?(o=r??ie,c=-1):p[1]===void 0?c=-2:(c=o.lastIndex-p[2].length,l=p[1],o=p[3]===void 0?D:p[3]==='"'?Bt:Dt):o===Bt||o===Dt?o=D:o===qt||o===Ut?o=ie:(o=D,r=void 0);const u=o===D&&t[d+1].startsWith("/>")?" ":"";i+=o===ie?a+jn:c>=0?(n.push(l),a.slice(0,c)+Nt+a.slice(c)+L+u):a+L+(c===-2?d:u)}return[Vt(t,i+(t[s]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]};class ge{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]=Pn(e,s);if(this.el=ge.createElement(l,n),B.currentNode=this.el.content,s===2||s===3){const c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(r=B.nextNode())!==null&&a.length<d;){if(r.nodeType===1){if(r.hasAttributes())for(const c of r.getAttributeNames())if(c.endsWith(Nt)){const h=p[o++],u=r.getAttribute(c).split(L),b=/([.?@])?(.*)/.exec(h);a.push({type:1,index:i,name:b[2],strings:u,ctor:b[1]==="."?Nn:b[1]==="?"?In:b[1]==="@"?qn:ve}),r.removeAttribute(c)}else c.startsWith(L)&&(a.push({type:6,index:i}),r.removeAttribute(c));if(Ht.test(r.tagName)){const c=r.textContent.split(L),h=c.length-1;if(h>0){r.textContent=ke?ke.emptyScript:"";for(let u=0;u<h;u++)r.append(c[u],ne()),B.nextNode(),a.push({type:2,index:++i});r.append(c[h],ne())}}}else if(r.nodeType===8)if(r.data===It)a.push({type:2,index:i});else{let c=-1;for(;(c=r.data.indexOf(L,c+1))!==-1;)a.push({type:7,index:i}),c+=L.length-1}i++}}static createElement(e,s){const n=U.createElement("template");return n.innerHTML=e,n}}function Y(t,e,s=t,n){if(e===T)return e;let r=n!==void 0?s._$Co?.[n]:s._$Cl;const i=re(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=Y(t,r._$AS(t,e.values),r,n)),e}class zn{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??U).importNode(s,!0);B.currentNode=r;let i=B.nextNode(),o=0,d=0,a=n[0];for(;a!==void 0;){if(o===a.index){let l;a.type===2?l=new te(i,i.nextSibling,this,e):a.type===1?l=new a.ctor(i,a.name,a.strings,this,e):a.type===6&&(l=new Un(i,this,e)),this._$AV.push(l),a=n[++d]}o!==a?.index&&(i=B.nextNode(),o++)}return B.currentNode=U,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 te{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=Y(this,e,s),re(e)?e===g||e==null||e===""?(this._$AH!==g&&this._$AR(),this._$AH=g):e!==this._$AH&&e!==T&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Ln(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&&re(this._$AH)?this._$AA.nextSibling.data=e:this.T(U.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=ge.createElement(Vt(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(s);else{const i=new zn(r,this),o=i.u(this.options);i.p(s),this.T(o),this._$AH=i}}_$AC(e){let s=Kt.get(e.strings);return s===void 0&&Kt.set(e.strings,s=new ge(e)),s}k(e){ze(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 te(this.O(ne()),this.O(ne()),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=Pt(e).nextSibling;Pt(e).remove(),e=n}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}}class ve{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=Y(this,e,s,0),o=!re(e)||e!==this._$AH&&e!==T,o&&(this._$AH=e);else{const d=e;let a,l;for(e=i[0],a=0;a<i.length-1;a++)l=Y(this,d[n+a],s,a),l===T&&(l=this._$AH[a]),o||=!re(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 Nn extends ve{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===g?void 0:e}}class In extends ve{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==g)}}class qn extends ve{constructor(e,s,n,r,i){super(e,s,n,r,i),this.type=5}_$AI(e,s=this){if((e=Y(this,e,s,0)??g)===T)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 Un{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){Y(this,e)}}const Dn={I:te},Bn=Pe.litHtmlPolyfillSupport;Bn?.(ge,te),(Pe.litHtmlVersions??=[]).push("3.3.3");const Hn=(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 te(e.insertBefore(ne(),i),i,void 0,s??{})}return r._$AI(t),r},Ie=globalThis;let R=class extends J{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=Hn(s,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return T}};R._$litElement$=!0,R.finalized=!0,Ie.litElementHydrateSupport?.({LitElement:R});const Fn=Ie.litElementPolyfillSupport;Fn?.({LitElement:R}),(Ie.litElementVersions??=[]).push("4.2.2");const H={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4},qe=t=>(...e)=>({_$litDirective$:t,values:e});let Ue=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:Kn}=Dn,Wt=t=>t,Vn=t=>t.strings===void 0,Jt=()=>document.createComment(""),oe=(t,e,s)=>{const n=t._$AA.parentNode,r=e===void 0?t._$AB:e._$AA;if(s===void 0){const i=n.insertBefore(Jt(),r),o=n.insertBefore(Jt(),r);s=new Kn(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=Wt(a).nextSibling;Wt(n).insertBefore(a,r),a=l}}}return s},F=(t,e,s=t)=>(t._$AI(e,s),t),Wn={},De=(t,e=Wn)=>t._$AH=e,Jn=t=>t._$AH,Be=t=>{t._$AR(),t._$AA.remove()},Yt=qe(class extends Ue{constructor(t){if(super(t),t.type!==H.PROPERTY&&t.type!==H.ATTRIBUTE&&t.type!==H.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!Vn(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,[e]){if(e===T||e===g)return e;const s=t.element,n=t.name;if(t.type===H.PROPERTY){if(e===s[n])return T}else if(t.type===H.BOOLEAN_ATTRIBUTE){if(!!e===s.hasAttribute(n))return T}else if(t.type===H.ATTRIBUTE&&s.getAttribute(n)===e+"")return T;return De(t),e}}),ye=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},He=["en","ja"],Gt="en",Zt=t=>He.some(e=>e===t),xe=t=>{const e=(t??"").split("-")[0]?.toLowerCase()??"";return Zt(e)?e:Gt},Xt=t=>xe(ye(t)),Fe="dpk-locale-change",Qt=t=>typeof t=="string"&&Zt(t)?t:null,Yn=t=>t.preference??t.authored,Gn=(t,e)=>t===e?null:t,we=t=>e=>e==="ja"?t.ja:t.en;class Ke{#e;#i;#s=Gt;constructor(e,s=()=>{}){this.#e=e,this.#i=s,e.addController(this)}get locale(){return this.#s}hostConnected(){this.#s=Xt(this.#e),document.addEventListener(Fe,this.#n)}hostDisconnected(){document.removeEventListener(Fe,this.#n)}#n=()=>{const e=Xt(this.#e);e!==this.#s&&(this.#s=e,this.#i(),this.#e.requestUpdate())}}const Zn={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)"]},es=t=>Ot(Object.entries(Zn).map(([e,[s,n]])=>`--dpk-${e}: ${t(s,n)};`).join(`
|
|
4
|
+
`)),$e=q`
|
|
5
|
+
:host {
|
|
6
|
+
/* Browsers without light-dark() stay light. */
|
|
7
|
+
${es(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
|
+
${es((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
|
+
`,Ve=q`
|
|
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
|
+
`,Xn=q`
|
|
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
|
+
`,G=(t,e)=>t instanceof e?t:null,Qn=we({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 ts extends R{static{this.styles=[$e,q`
|
|
387
|
+
/* One atomic box in both states, so the text can be edited where it sits:
|
|
388
|
+
while editing, the text stays (hidden) underneath and keeps sizing the
|
|
389
|
+
box, and the field lies over it. Starting an edit moves nothing; the
|
|
390
|
+
box grows only as the draft does. */
|
|
391
|
+
:host {
|
|
392
|
+
display: inline-block;
|
|
393
|
+
max-width: 100%;
|
|
394
|
+
vertical-align: baseline;
|
|
395
|
+
/* Inherit the surrounding type scale instead of forcing the chrome size:
|
|
396
|
+
an inline edit inside a 17px heading must look like a 17px heading.
|
|
397
|
+
Color comes along too, so an edit on a colored card stays legible. */
|
|
398
|
+
font-family: inherit;
|
|
399
|
+
font-size: inherit;
|
|
400
|
+
font-weight: inherit;
|
|
401
|
+
line-height: inherit;
|
|
402
|
+
color: inherit;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
.box {
|
|
406
|
+
position: relative;
|
|
407
|
+
display: block;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
/* No vertical padding or border: the box is exactly the lines of text.
|
|
411
|
+
The underline and ring are shadows, which never move the layout. */
|
|
412
|
+
.view {
|
|
413
|
+
display: block;
|
|
414
|
+
padding: 0 4px;
|
|
415
|
+
border-radius: var(--dpk-radius-xs);
|
|
416
|
+
white-space: pre-wrap;
|
|
417
|
+
overflow-wrap: anywhere;
|
|
418
|
+
cursor: text;
|
|
419
|
+
transition:
|
|
420
|
+
background 140ms var(--dpk-ease),
|
|
421
|
+
box-shadow 140ms var(--dpk-ease);
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
.view:hover {
|
|
425
|
+
background: var(--dpk-blue-soft);
|
|
426
|
+
box-shadow:
|
|
427
|
+
inset 0 -1px 0 var(--dpk-blue),
|
|
428
|
+
inset 0 0 0 1px color-mix(in srgb, var(--dpk-blue) 22%, transparent);
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
.view[data-empty='true'] {
|
|
432
|
+
box-shadow: inset 0 -1px 0 var(--dpk-rule-strong);
|
|
433
|
+
color: var(--dpk-ink-faint);
|
|
434
|
+
font-style: italic;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
.view[data-empty='true']:hover {
|
|
438
|
+
box-shadow: inset 0 -1px 0 var(--dpk-blue);
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
.view[aria-hidden='true'] {
|
|
442
|
+
visibility: hidden;
|
|
443
|
+
transition: none;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
.field {
|
|
447
|
+
position: absolute;
|
|
448
|
+
inset: 0;
|
|
449
|
+
box-sizing: border-box;
|
|
450
|
+
width: 100%;
|
|
451
|
+
height: 100%;
|
|
452
|
+
min-width: 0;
|
|
453
|
+
margin: 0;
|
|
454
|
+
padding: 0 4px;
|
|
455
|
+
border: none;
|
|
456
|
+
border-radius: var(--dpk-radius-xs);
|
|
457
|
+
outline: none;
|
|
458
|
+
background: var(--dpk-paper-raised);
|
|
459
|
+
box-shadow:
|
|
460
|
+
inset 0 0 0 1px var(--dpk-blue),
|
|
461
|
+
var(--dpk-focus);
|
|
462
|
+
font: inherit;
|
|
463
|
+
line-height: inherit;
|
|
464
|
+
letter-spacing: inherit;
|
|
465
|
+
color: inherit;
|
|
466
|
+
white-space: pre-wrap;
|
|
467
|
+
overflow-wrap: anywhere;
|
|
468
|
+
overflow: hidden;
|
|
469
|
+
resize: none;
|
|
470
|
+
animation: dpk-inline-edit-in 140ms var(--dpk-ease) backwards;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
.field::placeholder {
|
|
474
|
+
color: var(--dpk-ink-faint);
|
|
475
|
+
font-style: italic;
|
|
476
|
+
opacity: 1;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
@keyframes dpk-inline-edit-in {
|
|
480
|
+
from {
|
|
481
|
+
opacity: 0;
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
/* seamless: no field chrome at all — the text is edited where it sits. */
|
|
486
|
+
:host([seamless]) .view,
|
|
487
|
+
:host([seamless]) .field {
|
|
488
|
+
padding: 0;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
:host([seamless]) .field {
|
|
492
|
+
border-radius: 0;
|
|
493
|
+
background: transparent;
|
|
494
|
+
box-shadow: none;
|
|
495
|
+
}
|
|
496
|
+
`]}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="";#i=0;#s=new Ke(this);connectedCallback(){super.connectedCallback(),this.#i+=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(".field"),s=this.renderRoot,n=s instanceof ShadowRoot?s.activeElement:document.activeElement;e&&n!==e&&(e.focus(),e.select())}render(){const e=Qn(this.#s.locale),s=this.placeholder||e.unset,{editing:n}=this,r=n?this.#e:this.value,i=r===""?s:n&&r.endsWith(`
|
|
497
|
+
`)?`${r}\u200B`:r;return f`<span class="box"
|
|
498
|
+
><span
|
|
499
|
+
class="view"
|
|
500
|
+
data-empty=${String(r==="")}
|
|
501
|
+
aria-hidden=${n?"true":g}
|
|
502
|
+
role=${n?g:"button"}
|
|
503
|
+
tabindex=${n?g:"0"}
|
|
504
|
+
title=${n?g:e.clickToEdit}
|
|
505
|
+
@click=${this.#t}
|
|
506
|
+
@keydown=${this.#r}
|
|
507
|
+
>${i}</span
|
|
508
|
+
>${n?this.#n(this.label||this.placeholder||e.edit,s):g}</span
|
|
509
|
+
>`}#n(e,s){return this.multiline||this.wrap?f`<textarea
|
|
510
|
+
class="field"
|
|
511
|
+
rows="1"
|
|
512
|
+
.value=${Yt(this.#e)}
|
|
513
|
+
placeholder=${s}
|
|
514
|
+
aria-label=${e}
|
|
515
|
+
@input=${this.#o}
|
|
516
|
+
@keydown=${this.#a}
|
|
517
|
+
@blur=${this.#d}
|
|
518
|
+
></textarea>`:f`<input
|
|
519
|
+
class="field"
|
|
520
|
+
.value=${Yt(this.#e)}
|
|
521
|
+
placeholder=${s}
|
|
522
|
+
aria-label=${e}
|
|
523
|
+
@input=${this.#o}
|
|
524
|
+
@keydown=${this.#a}
|
|
525
|
+
@blur=${this.#d}
|
|
526
|
+
/>`}#t=e=>{e.stopPropagation(),!this.editing&&(this.#e=this.value,this.editing=!0)};#r=e=>{e.isComposing||this.editing||(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.editing=!0)};#o=e=>{const s=G(e.target,HTMLInputElement)??G(e.target,HTMLTextAreaElement);s!==null&&(this.#e=s.value,this.requestUpdate())};#a=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.#u())}};#d=e=>{const s=e.currentTarget;if(!(s instanceof HTMLInputElement||s instanceof HTMLTextAreaElement))return;const n=this.#i,{selectionStart:r,selectionEnd:i}=s;queueMicrotask(()=>{!this.isConnected||!this.editing||(n!==this.#i?(s.focus(),s.setSelectionRange(r,i)):this.#u())})};#u=()=>{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 er=()=>{customElements.get("dpk-component-inline-edit")||customElements.define("dpk-component-inline-edit",ts)},tr={lang:void 0,message:void 0,abortEarly:void 0,abortPipeEarly:void 0};function We(t){return tr}let sr;function nr(t){return sr?.get(t)}let rr;function ir(t){return rr?.get(t)}let or;function ar(t,e){return or?.get(t)?.get(e)}function ae(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??ae(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??ar(t.reference,a.lang)??(l?ir(a.lang):null)??n.message??nr(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 dr(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function lr(t,e){return Object.prototype.hasOwnProperty.call(t,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function Je(t,e){const s=[...new Set(t)];return s.length>1?`(${s.join(` ${e} `)})`:s[0]??"never"}function $(t){return t["~standard"]={version:1,vendor:"valibot",validate:e=>t["~run"]({value:e},We())},t}var cr=class extends Error{constructor(t){super(t[0].message),this.name="ValiError",this.issues=t}};function ss(t,e){return{kind:"validation",type:"check",reference:ss,async:!1,expects:null,requirement:t,message:e,"~run"(s,n){return s.typed&&!this.requirement(s.value)&&x(this,"input",s,n),s}}}function ns(t){return{kind:"validation",type:"finite",reference:ns,async:!1,expects:null,requirement:Number.isFinite,message:t,"~run"(e,s){return e.typed&&!this.requirement(e.value)&&x(this,"finite",e,s),e}}}function rs(t){return{kind:"validation",type:"integer",reference:rs,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 is(t,e){return{kind:"validation",type:"min_value",reference:is,async:!1,expects:`>=${t instanceof Date?t.toJSON():ae(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():ae(s.value)}),s}}}function K(t,e){return{kind:"validation",type:"regex",reference:K,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 Ye(){return{kind:"transformation",type:"trim",reference:Ye,async:!1,"~run"(t){return t.value=t.value.trim(),t}}}const os={abortEarly:!0};function as(t,e,s){return typeof t.fallback=="function"?t.fallback(e,s):t.fallback}function Ae(t,e,s){return typeof t.default=="function"?t.default(e,s):t.default}function pr(t,e){return!t["~run"]({value:e},os).issues}function P(t,e){return $({kind:"schema",type:"array",reference:P,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 ds(t){return $({kind:"schema",type:"boolean",reference:ds,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 $({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 ls(t){return $({kind:"schema",type:"lazy",reference:ls,expects:"unknown",async:!1,getter:t,"~run"(e,s){return this.getter(e.value)["~run"](e,s)}})}function Z(t,e){return $({kind:"schema",type:"literal",reference:Z,expects:ae(t),async:!1,literal:t,message:e,"~run"(s,n){return dr(s.value,this.literal)?s.typed=!0:x(this,"type",s,n),s}})}function cs(t,e){return $({kind:"schema",type:"nullable",reference:cs,expects:`(${t.expects} | null)`,async:!1,wrapped:t,default:e,"~run"(s,n){return s.value===null&&(this.default!==void 0&&(s.value=Ae(this,s,n)),s.value===null)?(s.typed=!0,s):this.wrapped["~run"](s,n)}})}function ps(t){return $({kind:"schema",type:"number",reference:ps,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 w(t,e){return $({kind:"schema",type:"object",reference:w,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]:Ae(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]=as(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 de(t,e){return $({kind:"schema",type:"optional",reference:de,expects:`(${t.expects} | undefined)`,async:!1,wrapped:t,default:e,"~run"(s,n){return s.value===void 0&&(this.default!==void 0&&(s.value=Ae(this,s,n)),s.value===void 0)?(s.typed=!0,s):this.wrapped["~run"](s,n)}})}function Ce(t,e){return $({kind:"schema",type:"picklist",reference:Ce,expects:Je(t.map(ae),"|"),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 Ge(t,e,s){return $({kind:"schema",type:"record",reference:Ge,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(lr(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 X(t,e){return $({kind:"schema",type:"strict_object",reference:X,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]:Ae(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]=as(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 $({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 hs(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 Ze(t,e){return $({kind:"schema",type:"union",reference:Ze,expects:Je(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:hs(i)}),s.typed=!0}else{if(o?.length===1)return o[0];x(this,"type",s,n,{issues:hs(o)})}return s}})}function z(){return $({kind:"schema",type:"unknown",reference:z,expects:"unknown",async:!1,"~run"(t){return t.typed=!0,t}})}function us(t,e,s){return $({kind:"schema",type:"variant",reference:us,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 I=u.entries[A];if(A in i?I["~run"]({typed:!1,value:i[A]},os).issues:I.type!=="exact_optional"&&I.type!=="optional"&&I.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:Je(l,"|"),path:[{type:"object",origin:"value",input:i,key:a,value:i[a]}]})}else x(this,"type",n,r);return n}})}function Xe(t,e,s){const n=t["~run"]({value:e},We());if(n.issues)throw new cr(n.issues);return n.value}function k(...t){return $({...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},We());return{typed:n.typed,success:!n.issues,output:n.value,issues:n.issues}}const Se=w({type:k(m(),v(1)),id:k(m(),v(1))}),hr=k(m(),v(1),K(/^[A-Za-z0-9_-]+$/,'ids may only contain letters, digits, "_" and "-" (a "." builds a path)')),ur=(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},V=w({id:k(m(),v(1)),type:k(m(),v(1)),target:Se,payload:z(),note:S(m()),createdAt:k(m(),v(1))}),fr=(t,e,s,n={})=>{const r=w({id:k(m(),v(1)),type:Z(t),target:Se,payload:s,note:S(m()),createdAt:k(m(),v(1))}),i=o=>{const d=y(V,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}:{}}},gr=(t,e)=>{const s=Ee(t,e.type);if(s===void 0)return null;const n=s.parse(e);return n===null?null:n},mr=(t,e)=>{const s=y(t.payloadSchema,e.payload);if(!s.success)throw new Error(`invalid payload for action "${e.type}"`);return s.output},Ee=(t,e)=>Object.hasOwn(t,e)?t[e]:void 0,br=t=>{throw new Error(`unhandled action: ${JSON.stringify(t)}`)},kr=w({id:k(m(),v(1))}),vr=t=>{const e=y(kr,t.payload);return`${t.type}|${e.success?e.output.id:JSON.stringify(t.payload)}`},_=t=>`${t.type}:${t.id}`,fs=t=>{const e=t.indexOf(":");return e<=0?{type:"unknown",id:t}:{type:t.slice(0,e),id:t.slice(e+1)}},Qe=(t,e)=>typeof t=="string"?fs(t.includes(":")?t:`${e}:${t}`):{type:t.type,id:t.id},yr=(t,e)=>t.type===e.type&&t.id===e.id,gs=t=>{const e=t.normalize("NFKD").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40);return e.length>0?e:"item"},xr=(t,e)=>{const s=gs(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)}`},ms=()=>{const t=globalThis.crypto;return t?.randomUUID?t.randomUUID():`a-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`},E="comment",W=t=>{const[e]=t;return{path:e?.path?.map(s=>String(s.key)).join(".")??"",message:e?.message??"invalid action"}},bs=w({type:k(m(),v(1)),target:Ze([k(m(),v(1)),Se]),payload:de(z()),note:S(m()),id:S(k(m(),v(1))),createdAt:S(k(m(),v(1)))}),wr=(t,e)=>{const s=y(bs,t);if(!s.success)return{ok:!1,issue:W(s.issues)};const n=s.output,r=Qe(n.target,e.targetType),i={id:n.id??ms(),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:W(o.issues)};const d=y(V,o.output);return d.success?{ok:!0,action:d.output}:{ok:!1,issue:W(d.issues)}},et=(t,e)=>e.dedupeKey?e.dedupeKey(t):e.mode!=="patch"?null:`${t.type}|${_(t.target)}`,tt=(t,e,s)=>{const n=et(e,s);if(n===null)return[...t,e];const r=t.at(-1);return!r||et(r,s)!==n||!$r(r,e)?[...t,e]:[...t.slice(0,-1),e]},$r=(t,e)=>yr(t.target,e.target),st=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),ks=w({id:k(m(),v(1)),type:Z(E),target:w({type:k(m(),v(1)),id:k(m(),v(1))}),payload:w({body:k(m(),v(1))}),note:S(m()),createdAt:k(m(),v(1))}),nt={schema:ks,mode:"append",targetType:"page"},Ar=w({body:m()}),le=t=>{const e=y(Ar,t.payload);return e.success?e.output.body:""},rt="element",vs=k(m(),K(/^[A-Z][A-Z0-9_]*$/,"component action types are CONSTANT_CASE")),ys=Ge(m(),z()),Cr=w({type:Z(rt),id:k(m(),K(/^[^/]+\/.+/,"component references start with a provider id"))}),Sr=w({id:k(m(),v(1)),type:vs,target:Cr,payload:ys,note:S(m()),createdAt:k(m(),v(1))}),Er={schema:Sr,mode:"sequence",targetType:rt},_r=X({type:vs,target:k(m(),K(/^element:[^/]+\/.+/)),payload:de(ys,{})}),xs=X({id:k(m(),v(1)),title:k(m(),v(1)),summary:S(m()),tone:S(Ce(["create","update","delete","move","meta"])),stale:S(Ce(["unsupported-action-type","target-missing","constraint-violated"]))}),it=t=>{if(t.type!==rt)return null;const e=t.id.indexOf("/");if(e<=0)return null;try{return decodeURIComponent(t.id.slice(0,e))}catch{return null}},O=t=>t.type!==E&&it(t.target)!==null,Tr=(t,e)=>t.filter(s=>O(s)&&it(s.target)===e),ws=(t,e)=>{const s=new Map(t.flatMap(n=>O(n)?[[n.id,it(n.target)]]:[]));return new Map(e.flatMap(n=>n.results.flatMap(r=>s.get(r.id)===n.id?[[r.id,r]]:[])))},ot=Object.freeze({}),at=t=>{const e=t.startsWith("#")?t.slice(1):t;if(e.length===0)return ot;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},Q=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}`},dt=(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},Or=(t,e="json")=>`\`\`\`${e}
|
|
527
|
+
${t}
|
|
528
|
+
\`\`\``,Mr=t=>JSON.stringify({type:t.type,target:t.target,payload:t.payload,...t.note===void 0?{}:{note:t.note}},null,2),lt=(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: \`${Q(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(O)&&(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(` > ${le(c).replace(/\n/g,`
|
|
529
|
+
> `)}`)}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
|
|
530
|
+
${Mr(c).replace(/\n/g,`
|
|
531
|
+
`)}
|
|
532
|
+
\`\`\``)}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?le(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(Or(st(n))),l.push(""),l.join(`
|
|
533
|
+
`)},M="0.0.9",ct=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()}},$s=we({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",editComment:"Edit this comment",editLabel:"Edit the comment",saveEdit:"Save",cancelEdit:"Cancel",editHint:"Ctrl/Cmd + Enter to save, Esc to cancel",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",editComment:"\u3053\u306E\u30B3\u30E1\u30F3\u30C8\u3092\u7DE8\u96C6",editLabel:"\u30B3\u30E1\u30F3\u30C8\u3092\u7DE8\u96C6",saveEdit:"\u4FDD\u5B58",cancelEdit:"\u30AD\u30E3\u30F3\u30BB\u30EB",editHint:"Ctrl/Cmd + Enter \u3067\u4FDD\u5B58\u3001Esc \u3067\u30AD\u30E3\u30F3\u30BB\u30EB",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"}}),jr=()=>({body:"",editing:null,attachment:{kind:"page"},copy:{kind:"idle"},copyRequest:0,send:{kind:"idle"},sendRequest:0}),As=t=>t.kind==="explicit"?{kind:t.resume}:t,Cs=(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"edit-start":return{...t,editing:{id:e.id,body:e.body}};case"edit-input":return t.editing?{...t,editing:{...t.editing,body:e.body}}:t;case"edit-cancel":case"edited":return{...t,editing:null};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}}}},Lr=(t,e)=>{const s=t.body.trim();return s===""?null:{target:e,body:s}},Rr=t=>{if(!t.editing)return null;const e=t.editing.body.trim();return e===""?null:{id:t.editing.id,body:e}},Pr={en:"English",ja:"\u65E5\u672C\u8A9E"},j=we({en:{review:"Review",reviewToggle:"Review / comments",useLightTheme:"Switch to light theme",useDarkTheme:"Switch to dark theme",language:"Language",versionLabel:"dev-process-kit version (reloads the page)",versionPinned:"Pinned by the page",versionLatest:t=>`${t} (latest)`,resizeSidebar:"Resize sidebar",resizeSidebarHint:"Drag to resize. Double-click to reset",collapseSidebar:"Collapse sidebar",expandSidebar:"Expand sidebar",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",versionLabel:"dev-process-kit \u306E\u30D0\u30FC\u30B8\u30E7\u30F3\uFF08\u30DA\u30FC\u30B8\u3092\u518D\u8AAD\u307F\u8FBC\u307F\u3057\u307E\u3059\uFF09",versionPinned:"\u30DA\u30FC\u30B8\u6307\u5B9A\u306E\u30D0\u30FC\u30B8\u30E7\u30F3",versionLatest:t=>`${t}\uFF08\u6700\u65B0\uFF09`,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",collapseSidebar:"\u30B5\u30A4\u30C9\u30D0\u30FC\u3092\u6298\u308A\u305F\u305F\u3080",expandSidebar:"\u30B5\u30A4\u30C9\u30D0\u30FC\u3092\u958B\u304F",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"}}),zr=4096,Nr="reviews",Ss="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.",Ir=t=>new TextEncoder().encode(t).length,qr=t=>t.replace(/[\u0000-\u0008\u000B-\u001F\u007F]/g,""),Ur=t=>{const e=`${Ss}
|
|
534
|
+
|
|
535
|
+
${qr(t)}`;return Ir(e)<=zr?e:null},Dr=t=>`${Ss}
|
|
536
|
+
|
|
537
|
+
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).`,Br={consent_required:"consent",forbidden:"forbidden",not_granted:"forbidden",capability_disabled:"forbidden",capability_removed:"forbidden",claude_unavailable:"claude_unavailable",rate_limited:"rate_limited"},Hr=t=>{const e=typeof t=="object"&&t!==null&&"code"in t?t.code:void 0;return(typeof e=="string"?Br[e]:void 0)??"error"},Fr={too_large:"handoffTooLarge",consent:"handoffConsent",forbidden:"handoffForbidden",claude_unavailable:"handoffClaudeUnavailable",rate_limited:"handoffRateLimited",storage:"handoffStorage",error:"handoffError"},pt=(t,e)=>j(e)[Fr[t]],Es=t=>t.group?`${t.group} \xB7 ${t.label}`:t.label,_s=(t,e)=>{const{definition:s,state:n,navigation:r,derivation:i}=t,o=$s(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?Es(l):a.ref}:a.kind==="current"&&d?{ref:d.value,label:Es(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?le(h):u.summary??""},code:s.serialize(h),stale:c.get(h.id)??null,edit:!b||t.editable!==!0?{kind:"none"}:e.editing?.id===h.id?{kind:"editing",body:e.editing.body,canSave:e.editing.body.trim().length>0}:{kind:"available"}}}),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"?pt(e.send.reason,t.locale):e.copy.kind==="copied"?o.copied:e.copy.kind==="failed"?o.copyFailed:""}},Kr=[$e,Ve,q`
|
|
538
|
+
:host {
|
|
539
|
+
display: flex;
|
|
540
|
+
flex-direction: column;
|
|
541
|
+
min-height: 0;
|
|
542
|
+
width: 100%;
|
|
543
|
+
background: var(--dpk-paper-raised);
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
header {
|
|
547
|
+
position: relative;
|
|
548
|
+
z-index: 1;
|
|
549
|
+
display: flex;
|
|
550
|
+
align-items: center;
|
|
551
|
+
justify-content: space-between;
|
|
552
|
+
gap: 8px;
|
|
553
|
+
padding: 14px 16px 12px;
|
|
554
|
+
border-bottom: 1px solid var(--dpk-rule);
|
|
555
|
+
background: var(--dpk-glass);
|
|
556
|
+
backdrop-filter: blur(12px);
|
|
557
|
+
box-shadow: 0 1px 0 var(--dpk-highlight) inset;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
header h2 {
|
|
561
|
+
font-size: 13.5px;
|
|
562
|
+
font-weight: 660;
|
|
563
|
+
letter-spacing: -0.015em;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
.composer {
|
|
567
|
+
display: grid;
|
|
568
|
+
gap: 10px;
|
|
569
|
+
padding: 14px 16px 14px;
|
|
570
|
+
border-bottom: 1px solid var(--dpk-rule);
|
|
571
|
+
background: var(--dpk-paper-sunken);
|
|
572
|
+
box-shadow: inset 0 1px 3px var(--dpk-shade-1);
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
.composer textarea {
|
|
576
|
+
min-height: 62px;
|
|
577
|
+
background: var(--dpk-paper-raised);
|
|
578
|
+
border-radius: var(--dpk-radius);
|
|
579
|
+
box-shadow:
|
|
580
|
+
var(--dpk-bevel),
|
|
581
|
+
inset 0 1px 2px var(--dpk-shade-1);
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
.composer .row {
|
|
585
|
+
display: flex;
|
|
586
|
+
align-items: center;
|
|
587
|
+
gap: 8px;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
.composer .attach {
|
|
591
|
+
display: inline-flex;
|
|
592
|
+
align-items: center;
|
|
593
|
+
gap: 7px;
|
|
594
|
+
font-size: 12px;
|
|
595
|
+
color: var(--dpk-ink-soft);
|
|
596
|
+
cursor: pointer;
|
|
597
|
+
transition: color 140ms var(--dpk-ease);
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
.composer .attach:hover {
|
|
601
|
+
color: var(--dpk-ink);
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
.composer .attach input {
|
|
605
|
+
width: 14px;
|
|
606
|
+
height: 14px;
|
|
607
|
+
margin: 0;
|
|
608
|
+
accent-color: var(--dpk-accent);
|
|
609
|
+
cursor: pointer;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
.composer .chip {
|
|
613
|
+
display: inline-flex;
|
|
614
|
+
align-items: center;
|
|
615
|
+
gap: 6px;
|
|
616
|
+
padding: 3px 10px;
|
|
617
|
+
border: 1px solid var(--dpk-rule-strong);
|
|
618
|
+
border-radius: 999px;
|
|
619
|
+
background: var(--dpk-paper-raised);
|
|
620
|
+
box-shadow: var(--dpk-shadow-xs);
|
|
621
|
+
font-size: 11.5px;
|
|
622
|
+
cursor: pointer;
|
|
623
|
+
transition:
|
|
624
|
+
border-color 140ms var(--dpk-ease),
|
|
625
|
+
box-shadow 140ms var(--dpk-ease),
|
|
626
|
+
transform 140ms var(--dpk-ease);
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
.composer .chip svg {
|
|
630
|
+
flex: none;
|
|
631
|
+
width: 12px;
|
|
632
|
+
height: 12px;
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
.composer .chip:hover {
|
|
636
|
+
border-color: color-mix(in srgb, var(--dpk-accent) 45%, var(--dpk-rule-strong));
|
|
637
|
+
box-shadow: var(--dpk-shadow-sm);
|
|
638
|
+
transform: translateY(-1px);
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
.target-line {
|
|
642
|
+
margin-right: auto;
|
|
643
|
+
padding: 3px 9px;
|
|
644
|
+
border-radius: 999px;
|
|
645
|
+
background: var(--dpk-paper-inset);
|
|
646
|
+
font-family: var(--dpk-mono);
|
|
647
|
+
font-size: 10px;
|
|
648
|
+
letter-spacing: 0.03em;
|
|
649
|
+
color: var(--dpk-ink-faint);
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
.list {
|
|
653
|
+
list-style: none;
|
|
654
|
+
margin: 0;
|
|
655
|
+
padding: 10px 12px;
|
|
656
|
+
overflow: auto;
|
|
657
|
+
flex: 1;
|
|
658
|
+
min-height: 0;
|
|
659
|
+
display: grid;
|
|
660
|
+
gap: 8px;
|
|
661
|
+
align-content: start;
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
.item {
|
|
665
|
+
position: relative;
|
|
666
|
+
display: grid;
|
|
667
|
+
gap: 5px;
|
|
668
|
+
padding: 10px 12px 11px 16px;
|
|
669
|
+
border: 1px solid var(--dpk-rule);
|
|
670
|
+
border-radius: var(--dpk-radius);
|
|
671
|
+
background: var(--dpk-paper-raised);
|
|
672
|
+
box-shadow: var(--dpk-bevel), var(--dpk-shadow-xs);
|
|
673
|
+
transition:
|
|
674
|
+
box-shadow 160ms var(--dpk-ease),
|
|
675
|
+
border-color 160ms var(--dpk-ease),
|
|
676
|
+
transform 160ms var(--dpk-ease);
|
|
677
|
+
animation: dpk-item-in 200ms var(--dpk-ease) backwards;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
@keyframes dpk-item-in {
|
|
681
|
+
from {
|
|
682
|
+
opacity: 0;
|
|
683
|
+
transform: translateY(3px);
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
.item:hover {
|
|
688
|
+
border-color: var(--dpk-rule-hover);
|
|
689
|
+
box-shadow: var(--dpk-bevel), var(--dpk-shadow-sm);
|
|
690
|
+
transform: translateY(-1px);
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
.item::before {
|
|
694
|
+
content: '';
|
|
695
|
+
position: absolute;
|
|
696
|
+
left: 0;
|
|
697
|
+
top: 10px;
|
|
698
|
+
bottom: 10px;
|
|
699
|
+
width: 3px;
|
|
700
|
+
border-radius: 0 2px 2px 0;
|
|
701
|
+
background: var(--tone, var(--dpk-ink-faint));
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
.item[data-tone='comment'] {
|
|
705
|
+
--tone: var(--dpk-accent);
|
|
706
|
+
background: linear-gradient(90deg, var(--dpk-accent-soft), transparent 55%), var(--dpk-paper-raised);
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
.item[data-tone='create'] {
|
|
710
|
+
--tone: var(--dpk-green);
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
.item[data-tone='update'] {
|
|
714
|
+
--tone: var(--dpk-blue);
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
.item[data-tone='delete'] {
|
|
718
|
+
--tone: var(--dpk-accent);
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
.item[data-tone='move'] {
|
|
722
|
+
--tone: var(--dpk-violet);
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
.item[data-stale='true'] {
|
|
726
|
+
opacity: 0.62;
|
|
727
|
+
border-style: dashed;
|
|
728
|
+
box-shadow: none;
|
|
729
|
+
transform: none;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
.item-head {
|
|
733
|
+
display: flex;
|
|
734
|
+
align-items: center;
|
|
735
|
+
gap: 7px;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
.item-icon {
|
|
739
|
+
display: inline-flex;
|
|
740
|
+
flex: none;
|
|
741
|
+
align-items: center;
|
|
742
|
+
justify-content: center;
|
|
743
|
+
width: 18px;
|
|
744
|
+
height: 18px;
|
|
745
|
+
border-radius: var(--dpk-radius-xs);
|
|
746
|
+
background: color-mix(in srgb, var(--tone, var(--dpk-ink-faint)) 16%, transparent);
|
|
747
|
+
color: var(--tone, var(--dpk-ink-faint));
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
.item-icon svg {
|
|
751
|
+
display: block;
|
|
752
|
+
width: 11px;
|
|
753
|
+
height: 11px;
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
.item-title {
|
|
757
|
+
font-size: 12.5px;
|
|
758
|
+
font-weight: 600;
|
|
759
|
+
letter-spacing: -0.005em;
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
.stale-badge {
|
|
763
|
+
padding: 1px 7px;
|
|
764
|
+
border: 1px solid color-mix(in srgb, var(--dpk-amber) 40%, transparent);
|
|
765
|
+
border-radius: 999px;
|
|
766
|
+
background: var(--dpk-amber-soft);
|
|
767
|
+
font-family: var(--dpk-mono);
|
|
768
|
+
font-size: 9px;
|
|
769
|
+
letter-spacing: 0.06em;
|
|
770
|
+
text-transform: uppercase;
|
|
771
|
+
color: var(--dpk-amber);
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
.item-head .dpk-icon-btn {
|
|
775
|
+
margin-left: auto;
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
/* Edit and delete sit together at the end of the row. */
|
|
779
|
+
.item-head .item-edit + .dpk-icon-btn {
|
|
780
|
+
margin-left: -4px;
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
.item-target {
|
|
784
|
+
display: inline-flex;
|
|
785
|
+
align-items: center;
|
|
786
|
+
width: fit-content;
|
|
787
|
+
padding: 1px 7px;
|
|
788
|
+
border-radius: var(--dpk-radius-xs);
|
|
789
|
+
background: var(--dpk-paper-sunken);
|
|
790
|
+
font-family: var(--dpk-mono);
|
|
791
|
+
font-size: 10px;
|
|
792
|
+
color: var(--dpk-ink-faint);
|
|
793
|
+
overflow-wrap: anywhere;
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
.item-summary {
|
|
797
|
+
font-size: 12px;
|
|
798
|
+
color: var(--dpk-ink-soft);
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
.item-body {
|
|
802
|
+
margin: 2px 0 0;
|
|
803
|
+
padding-left: 9px;
|
|
804
|
+
border-left: 2px solid var(--dpk-accent);
|
|
805
|
+
font-size: 12.5px;
|
|
806
|
+
white-space: pre-wrap;
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
.item-editor {
|
|
810
|
+
display: grid;
|
|
811
|
+
gap: 8px;
|
|
812
|
+
margin-top: 2px;
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
.item-editor textarea {
|
|
816
|
+
min-height: 62px;
|
|
817
|
+
background: var(--dpk-paper-raised);
|
|
818
|
+
border-radius: var(--dpk-radius);
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
.item-editor-actions {
|
|
822
|
+
display: flex;
|
|
823
|
+
justify-content: flex-end;
|
|
824
|
+
gap: 6px;
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
.item-code {
|
|
828
|
+
margin-top: 2px;
|
|
829
|
+
padding: 5px 7px;
|
|
830
|
+
border-radius: var(--dpk-radius-xs);
|
|
831
|
+
background: var(--dpk-paper-sunken);
|
|
832
|
+
font-family: var(--dpk-mono);
|
|
833
|
+
font-size: 10px;
|
|
834
|
+
color: var(--dpk-ink-faint);
|
|
835
|
+
overflow-wrap: anywhere;
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
.empty {
|
|
839
|
+
padding: 4px;
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
.empty-box {
|
|
843
|
+
display: grid;
|
|
844
|
+
justify-items: center;
|
|
845
|
+
gap: 6px;
|
|
846
|
+
padding: 26px 16px;
|
|
847
|
+
border: 1px dashed var(--dpk-rule-strong);
|
|
848
|
+
border-radius: var(--dpk-radius-lg);
|
|
849
|
+
background: var(--dpk-paper-sunken);
|
|
850
|
+
text-align: center;
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
.empty-box svg {
|
|
854
|
+
width: 20px;
|
|
855
|
+
height: 20px;
|
|
856
|
+
color: var(--dpk-ink-faint);
|
|
857
|
+
opacity: 0.7;
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
.empty-box p {
|
|
861
|
+
margin: 0;
|
|
862
|
+
font-size: 12px;
|
|
863
|
+
line-height: 1.6;
|
|
864
|
+
color: var(--dpk-ink-soft);
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
.empty-box .empty-hint {
|
|
868
|
+
max-width: 30ch;
|
|
869
|
+
color: var(--dpk-ink-faint);
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
.issues {
|
|
873
|
+
margin: 10px 12px 0;
|
|
874
|
+
padding: 9px 11px 9px 13px;
|
|
875
|
+
border: 1px solid color-mix(in srgb, var(--dpk-danger) 35%, transparent);
|
|
876
|
+
border-radius: var(--dpk-radius-sm);
|
|
877
|
+
background: linear-gradient(90deg, var(--dpk-danger) 0 3px, transparent 3px), var(--dpk-danger-soft);
|
|
878
|
+
font-size: 11.5px;
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
.issues strong {
|
|
882
|
+
color: var(--dpk-danger);
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
.issues ul {
|
|
886
|
+
margin: 4px 0 0;
|
|
887
|
+
padding-left: 16px;
|
|
888
|
+
color: var(--dpk-ink-soft);
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
footer {
|
|
892
|
+
display: flex;
|
|
893
|
+
flex-wrap: wrap;
|
|
894
|
+
align-items: center;
|
|
895
|
+
gap: 8px;
|
|
896
|
+
padding: 12px 16px;
|
|
897
|
+
border-top: 1px solid var(--dpk-rule);
|
|
898
|
+
background: var(--dpk-glass);
|
|
899
|
+
backdrop-filter: blur(12px);
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
.footer-actions {
|
|
903
|
+
display: flex;
|
|
904
|
+
align-items: center;
|
|
905
|
+
gap: 6px;
|
|
906
|
+
flex-wrap: wrap;
|
|
907
|
+
margin-left: auto;
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
.flash {
|
|
911
|
+
font-family: var(--dpk-mono);
|
|
912
|
+
font-size: 10px;
|
|
913
|
+
letter-spacing: 0.04em;
|
|
914
|
+
color: var(--dpk-green);
|
|
915
|
+
}
|
|
916
|
+
`],Ts=(t,e,s)=>{const n=new Map;for(let r=e;r<=s;r++)n.set(t[r],r);return n},Os=qe(class extends Ue{constructor(t){if(super(t),t.type!==H.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=Jn(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]=F(r[c],i[u]),c++,u++;else if(d[h]===o[b])a[b]=F(r[h],i[b]),h--,b--;else if(d[c]===o[b])a[b]=F(r[c],i[b]),oe(t,a[b+1],r[c]),c++,b--;else if(d[h]===o[u])a[u]=F(r[h],i[u]),oe(t,r[c],r[h]),h--,u++;else if(l===void 0&&(l=Ts(o,u,b),p=Ts(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 I=oe(t,r[c]);F(I,i[u]),a[u]=I}else a[u]=F(A,i[u]),oe(t,r[c],A),r[C]=null;u++}else Be(r[h]),h--;else Be(r[c]),c++;for(;u<=b;){const C=oe(t,a[b+1]);F(C,i[u]),a[u++]=C}for(;c<=h;){const C=r[c++];C!==null&&Be(C)}return this.ut=o,De(t,a),T}}),ht=()=>f`<svg
|
|
917
|
+
viewBox="0 0 16 16"
|
|
918
|
+
fill="none"
|
|
919
|
+
stroke="currentColor"
|
|
920
|
+
stroke-width="1.5"
|
|
921
|
+
stroke-linecap="round"
|
|
922
|
+
stroke-linejoin="round"
|
|
923
|
+
aria-hidden="true"
|
|
924
|
+
focusable="false"
|
|
925
|
+
>
|
|
926
|
+
<path d="M4 4l8 8M12 4l-8 8" />
|
|
927
|
+
</svg>`,Ms=()=>f`<svg
|
|
928
|
+
viewBox="0 0 16 16"
|
|
929
|
+
fill="none"
|
|
930
|
+
stroke="currentColor"
|
|
931
|
+
stroke-width="1.5"
|
|
932
|
+
stroke-linecap="round"
|
|
933
|
+
stroke-linejoin="round"
|
|
934
|
+
aria-hidden="true"
|
|
935
|
+
focusable="false"
|
|
936
|
+
>
|
|
937
|
+
<path d="M3.5 5h9M5.5 5V3.5a1 1 0 011-1h3a1 1 0 011 1V5" />
|
|
938
|
+
<path d="M5 5l.5 7.5h5L11 5" />
|
|
939
|
+
<path d="M6.8 7.5v3.5M9.2 7.5v3.5" />
|
|
940
|
+
</svg>`,ut=()=>f`<svg
|
|
941
|
+
viewBox="0 0 16 16"
|
|
942
|
+
fill="none"
|
|
943
|
+
stroke="currentColor"
|
|
944
|
+
stroke-width="1.5"
|
|
945
|
+
stroke-linecap="round"
|
|
946
|
+
stroke-linejoin="round"
|
|
947
|
+
aria-hidden="true"
|
|
948
|
+
focusable="false"
|
|
949
|
+
>
|
|
950
|
+
<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" />
|
|
951
|
+
</svg>`,ft=()=>f`<svg
|
|
952
|
+
viewBox="0 0 16 16"
|
|
953
|
+
fill="none"
|
|
954
|
+
stroke="currentColor"
|
|
955
|
+
stroke-width="1.5"
|
|
956
|
+
stroke-linecap="round"
|
|
957
|
+
stroke-linejoin="round"
|
|
958
|
+
aria-hidden="true"
|
|
959
|
+
focusable="false"
|
|
960
|
+
>
|
|
961
|
+
<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" />
|
|
962
|
+
</svg>`,js=()=>f`<svg
|
|
963
|
+
viewBox="0 0 16 16"
|
|
964
|
+
fill="none"
|
|
965
|
+
stroke="currentColor"
|
|
966
|
+
stroke-width="1.5"
|
|
967
|
+
stroke-linecap="round"
|
|
968
|
+
stroke-linejoin="round"
|
|
969
|
+
aria-hidden="true"
|
|
970
|
+
focusable="false"
|
|
971
|
+
>
|
|
972
|
+
<path d="M6.5 9.5l3-3" />
|
|
973
|
+
<path d="M7 5.5l1-1a2.1 2.1 0 013 3l-1 1" />
|
|
974
|
+
<path d="M9 10.5l-1 1a2.1 2.1 0 01-3-3l1-1" />
|
|
975
|
+
</svg>`,Vr=()=>f`<svg
|
|
976
|
+
viewBox="0 0 16 16"
|
|
977
|
+
fill="none"
|
|
978
|
+
stroke="currentColor"
|
|
979
|
+
stroke-width="1.5"
|
|
980
|
+
stroke-linecap="round"
|
|
981
|
+
stroke-linejoin="round"
|
|
982
|
+
aria-hidden="true"
|
|
983
|
+
focusable="false"
|
|
984
|
+
>
|
|
985
|
+
<rect x="5.5" y="5.5" width="7" height="7" rx="1.5" />
|
|
986
|
+
<path d="M10.5 5.5V4.5a1 1 0 00-1-1h-5a1 1 0 00-1 1v5a1 1 0 001 1h1" />
|
|
987
|
+
</svg>`,Wr=()=>f`<svg
|
|
988
|
+
viewBox="0 0 16 16"
|
|
989
|
+
fill="none"
|
|
990
|
+
stroke="currentColor"
|
|
991
|
+
stroke-width="1.5"
|
|
992
|
+
stroke-linecap="round"
|
|
993
|
+
stroke-linejoin="round"
|
|
994
|
+
aria-hidden="true"
|
|
995
|
+
focusable="false"
|
|
996
|
+
>
|
|
997
|
+
<path d="M3.5 8.5l3 3 6-7" />
|
|
998
|
+
</svg>`,Ls=()=>f`<svg
|
|
999
|
+
viewBox="0 0 16 16"
|
|
1000
|
+
fill="none"
|
|
1001
|
+
stroke="currentColor"
|
|
1002
|
+
stroke-width="1.5"
|
|
1003
|
+
stroke-linecap="round"
|
|
1004
|
+
stroke-linejoin="round"
|
|
1005
|
+
aria-hidden="true"
|
|
1006
|
+
focusable="false"
|
|
1007
|
+
>
|
|
1008
|
+
<path d="M8 3.5v9M3.5 8h9" />
|
|
1009
|
+
</svg>`,Jr=()=>f`<svg viewBox="0 0 16 16" fill="currentColor" aria-hidden="true" focusable="false">
|
|
1010
|
+
<circle cx="6.5" cy="4.5" r="1" />
|
|
1011
|
+
<circle cx="9.5" cy="4.5" r="1" />
|
|
1012
|
+
<circle cx="6.5" cy="8" r="1" />
|
|
1013
|
+
<circle cx="9.5" cy="8" r="1" />
|
|
1014
|
+
<circle cx="6.5" cy="11.5" r="1" />
|
|
1015
|
+
<circle cx="9.5" cy="11.5" r="1" />
|
|
1016
|
+
</svg>`,Rs=()=>f`<svg
|
|
1017
|
+
viewBox="0 0 16 16"
|
|
1018
|
+
fill="none"
|
|
1019
|
+
stroke="currentColor"
|
|
1020
|
+
stroke-width="1.5"
|
|
1021
|
+
stroke-linecap="round"
|
|
1022
|
+
stroke-linejoin="round"
|
|
1023
|
+
aria-hidden="true"
|
|
1024
|
+
focusable="false"
|
|
1025
|
+
>
|
|
1026
|
+
<path
|
|
1027
|
+
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"
|
|
1028
|
+
/>
|
|
1029
|
+
</svg>`,Yr=()=>f`<svg
|
|
1030
|
+
viewBox="0 0 16 16"
|
|
1031
|
+
fill="none"
|
|
1032
|
+
stroke="currentColor"
|
|
1033
|
+
stroke-width="1.5"
|
|
1034
|
+
stroke-linecap="round"
|
|
1035
|
+
stroke-linejoin="round"
|
|
1036
|
+
aria-hidden="true"
|
|
1037
|
+
focusable="false"
|
|
1038
|
+
>
|
|
1039
|
+
<path d="M8 12.5V3.5M4.5 7L8 3.5 11.5 7" />
|
|
1040
|
+
</svg>`,Gr=()=>f`<svg
|
|
1041
|
+
viewBox="0 0 16 16"
|
|
1042
|
+
fill="none"
|
|
1043
|
+
stroke="currentColor"
|
|
1044
|
+
stroke-width="1.5"
|
|
1045
|
+
stroke-linecap="round"
|
|
1046
|
+
stroke-linejoin="round"
|
|
1047
|
+
aria-hidden="true"
|
|
1048
|
+
focusable="false"
|
|
1049
|
+
>
|
|
1050
|
+
<path d="M8 3.5v9M4.5 9L8 12.5 11.5 9" />
|
|
1051
|
+
</svg>`,Ps=()=>f`<svg
|
|
1052
|
+
viewBox="0 0 16 16"
|
|
1053
|
+
fill="none"
|
|
1054
|
+
stroke="currentColor"
|
|
1055
|
+
stroke-width="1.5"
|
|
1056
|
+
stroke-linecap="round"
|
|
1057
|
+
stroke-linejoin="round"
|
|
1058
|
+
aria-hidden="true"
|
|
1059
|
+
focusable="false"
|
|
1060
|
+
>
|
|
1061
|
+
<path d="M10 3.5L5.5 8 10 12.5" />
|
|
1062
|
+
</svg>`,zs=()=>f`<svg
|
|
1063
|
+
viewBox="0 0 16 16"
|
|
1064
|
+
fill="none"
|
|
1065
|
+
stroke="currentColor"
|
|
1066
|
+
stroke-width="1.5"
|
|
1067
|
+
stroke-linecap="round"
|
|
1068
|
+
stroke-linejoin="round"
|
|
1069
|
+
aria-hidden="true"
|
|
1070
|
+
focusable="false"
|
|
1071
|
+
>
|
|
1072
|
+
<path d="M6 3.5L10.5 8 6 12.5" />
|
|
1073
|
+
</svg>`,Zr=()=>f`<svg
|
|
1074
|
+
viewBox="0 0 16 16"
|
|
1075
|
+
fill="none"
|
|
1076
|
+
stroke="currentColor"
|
|
1077
|
+
stroke-width="1.5"
|
|
1078
|
+
stroke-linecap="round"
|
|
1079
|
+
stroke-linejoin="round"
|
|
1080
|
+
aria-hidden="true"
|
|
1081
|
+
focusable="false"
|
|
1082
|
+
>
|
|
1083
|
+
<path d="M9.5 2.5h4v4M6.5 13.5h-4v-4M13.5 2.5L9 7M2.5 13.5L7 9" />
|
|
1084
|
+
</svg>`,Xr=()=>f`<svg
|
|
1085
|
+
viewBox="0 0 16 16"
|
|
1086
|
+
fill="none"
|
|
1087
|
+
stroke="currentColor"
|
|
1088
|
+
stroke-width="1.5"
|
|
1089
|
+
stroke-linecap="round"
|
|
1090
|
+
stroke-linejoin="round"
|
|
1091
|
+
aria-hidden="true"
|
|
1092
|
+
focusable="false"
|
|
1093
|
+
>
|
|
1094
|
+
<path d="M13.5 7h-4.5v-4.5M2.5 9h4.5v4.5M9 7l4.5-4.5M7 9l-4.5 4.5" />
|
|
1095
|
+
</svg>`,Qr=()=>f`<svg
|
|
1096
|
+
viewBox="0 0 16 16"
|
|
1097
|
+
fill="none"
|
|
1098
|
+
stroke="currentColor"
|
|
1099
|
+
stroke-width="1.5"
|
|
1100
|
+
stroke-linecap="round"
|
|
1101
|
+
stroke-linejoin="round"
|
|
1102
|
+
aria-hidden="true"
|
|
1103
|
+
focusable="false"
|
|
1104
|
+
>
|
|
1105
|
+
<circle cx="8" cy="8" r="2.75" />
|
|
1106
|
+
<path
|
|
1107
|
+
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"
|
|
1108
|
+
/>
|
|
1109
|
+
</svg>`,ei=()=>f`<svg
|
|
1110
|
+
viewBox="0 0 16 16"
|
|
1111
|
+
fill="none"
|
|
1112
|
+
stroke="currentColor"
|
|
1113
|
+
stroke-width="1.5"
|
|
1114
|
+
stroke-linecap="round"
|
|
1115
|
+
stroke-linejoin="round"
|
|
1116
|
+
aria-hidden="true"
|
|
1117
|
+
focusable="false"
|
|
1118
|
+
>
|
|
1119
|
+
<path d="M13.5 9.6A5.75 5.75 0 016.4 2.5a5.75 5.75 0 107.1 7.1z" />
|
|
1120
|
+
</svg>`,ti=t=>{switch(t){case"comment":return ft();case"create":return Ls();case"update":return ut();case"delete":return Ms();case"move":return Rs();default:return js()}},si=(t,e,s,n=!1)=>f`
|
|
1121
|
+
${n?g:f`<header><h2>${t.heading}</h2></header>`}
|
|
1122
|
+
${e.issues.length>0?f`<div class="issues" role="alert">
|
|
1123
|
+
<strong>${t.rejected}</strong>
|
|
1124
|
+
<ul>
|
|
1125
|
+
${e.issues.map(r=>f`<li>${r}</li>`)}
|
|
1126
|
+
</ul>
|
|
1127
|
+
</div>`:g}
|
|
1128
|
+
<div class="composer">
|
|
1129
|
+
<textarea
|
|
1130
|
+
class="dpk-textarea"
|
|
1131
|
+
aria-label=${t.commentLabel}
|
|
1132
|
+
placeholder=${t.commentPlaceholder}
|
|
1133
|
+
.value=${e.body}
|
|
1134
|
+
@input=${r=>{r.currentTarget instanceof HTMLTextAreaElement&&s({kind:"input",body:r.currentTarget.value})}}
|
|
1135
|
+
@keydown=${r=>{!r.isComposing&&r.key==="Enter"&&(r.metaKey||r.ctrlKey)&&(r.preventDefault(),s({kind:"submit"}))}}
|
|
1136
|
+
></textarea>
|
|
1137
|
+
${e.attachment.kind==="explicit"?f`<div class="row">
|
|
1138
|
+
<button class="chip" type="button" aria-label=${t.detach} @click=${()=>s({kind:"clear-target"})}>
|
|
1139
|
+
${e.target.label} ${ht()}
|
|
1140
|
+
</button>
|
|
1141
|
+
</div>`:e.attachment.kind==="checkbox"?f`<div class="row">
|
|
1142
|
+
<label class="attach">
|
|
1143
|
+
<input
|
|
1144
|
+
type="checkbox"
|
|
1145
|
+
.checked=${e.attachment.checked}
|
|
1146
|
+
@change=${r=>{r.currentTarget instanceof HTMLInputElement&&s({kind:"attach",current:r.currentTarget.checked})}}
|
|
1147
|
+
/>
|
|
1148
|
+
<span>${t.attachTo(e.attachment.group)}</span>
|
|
1149
|
+
</label>
|
|
1150
|
+
</div>`:g}
|
|
1151
|
+
<div class="row">
|
|
1152
|
+
<span class="target-line">→ ${e.target.label}</span>
|
|
1153
|
+
<button
|
|
1154
|
+
class="dpk-btn dpk-btn--accent"
|
|
1155
|
+
type="button"
|
|
1156
|
+
?disabled=${!e.canSubmit}
|
|
1157
|
+
@click=${()=>s({kind:"submit"})}
|
|
1158
|
+
>
|
|
1159
|
+
${t.addNote}
|
|
1160
|
+
</button>
|
|
1161
|
+
</div>
|
|
1162
|
+
</div>
|
|
1163
|
+
<ul class="list">
|
|
1164
|
+
${e.items.length===0?f`<li class="empty">
|
|
1165
|
+
<div class="empty-box">
|
|
1166
|
+
${ft()}
|
|
1167
|
+
<p>${t.empty}</p>
|
|
1168
|
+
<p class="empty-hint">${t.emptyHint}</p>
|
|
1169
|
+
</div>
|
|
1170
|
+
</li>`:Os(e.items,r=>r.id,r=>ni(t,r,s))}
|
|
1171
|
+
</ul>
|
|
1172
|
+
<footer>
|
|
1173
|
+
${n||e.send==="hidden"?g:f`<button
|
|
1174
|
+
class="dpk-btn dpk-btn--accent"
|
|
1175
|
+
type="button"
|
|
1176
|
+
?disabled=${e.send==="disabled"}
|
|
1177
|
+
@click=${()=>s({kind:"send"})}
|
|
1178
|
+
>
|
|
1179
|
+
${t.sendToClaude}
|
|
1180
|
+
</button>`}
|
|
1181
|
+
<div class="footer-actions">
|
|
1182
|
+
${n?g:f`<button
|
|
1183
|
+
class=${e.send==="hidden"?"dpk-btn dpk-btn--accent":"dpk-btn"}
|
|
1184
|
+
type="button"
|
|
1185
|
+
title=${t.copyTitle}
|
|
1186
|
+
?disabled=${e.items.length===0}
|
|
1187
|
+
@click=${()=>s({kind:"copy"})}
|
|
1188
|
+
>
|
|
1189
|
+
${t.copy}
|
|
1190
|
+
</button>`}
|
|
1191
|
+
<button
|
|
1192
|
+
class="dpk-btn dpk-btn--ghost"
|
|
1193
|
+
type="button"
|
|
1194
|
+
?disabled=${e.items.length===0}
|
|
1195
|
+
@click=${()=>s({kind:"clear"})}
|
|
1196
|
+
>
|
|
1197
|
+
${t.clear}
|
|
1198
|
+
</button>
|
|
1199
|
+
</div>
|
|
1200
|
+
${e.flash?f`<span class="flash" role="status">${e.flash}</span>`:g}
|
|
1201
|
+
</footer>
|
|
1202
|
+
`,ni=(t,e,s)=>f`
|
|
1203
|
+
<li class="item" data-tone=${e.tone} data-stale=${String(e.stale!==null)} data-id=${e.id}>
|
|
1204
|
+
<div class="item-head">
|
|
1205
|
+
<span class="item-icon">${ti(e.tone)}</span>
|
|
1206
|
+
<span class="item-title">${e.title}</span>
|
|
1207
|
+
${e.stale?f`<span class="stale-badge">${e.stale}</span>`:g}
|
|
1208
|
+
${e.edit.kind==="available"?f`<button
|
|
1209
|
+
class="dpk-icon-btn item-edit"
|
|
1210
|
+
type="button"
|
|
1211
|
+
aria-label=${t.editComment}
|
|
1212
|
+
title=${t.editComment}
|
|
1213
|
+
@click=${()=>s({kind:"edit-start",id:e.id,body:e.text.body})}
|
|
1214
|
+
>
|
|
1215
|
+
${ut()}
|
|
1216
|
+
</button>`:g}
|
|
1217
|
+
<button
|
|
1218
|
+
class="dpk-icon-btn"
|
|
1219
|
+
type="button"
|
|
1220
|
+
aria-label=${t.deleteAction}
|
|
1221
|
+
@click=${()=>s({kind:"delete",id:e.id})}
|
|
1222
|
+
>
|
|
1223
|
+
${ht()}
|
|
1224
|
+
</button>
|
|
1225
|
+
</div>
|
|
1226
|
+
<div class="item-target">${e.targetLabel}</div>
|
|
1227
|
+
${e.edit.kind==="editing"?ri(t,e.edit,s):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}
|
|
1228
|
+
<code class="item-code">${e.code}</code>
|
|
1229
|
+
</li>
|
|
1230
|
+
`,ri=(t,e,s)=>f`
|
|
1231
|
+
<div class="item-editor">
|
|
1232
|
+
<textarea
|
|
1233
|
+
class="dpk-textarea"
|
|
1234
|
+
aria-label=${t.editLabel}
|
|
1235
|
+
title=${t.editHint}
|
|
1236
|
+
.value=${e.body}
|
|
1237
|
+
@input=${n=>{n.currentTarget instanceof HTMLTextAreaElement&&s({kind:"edit-input",body:n.currentTarget.value})}}
|
|
1238
|
+
@keydown=${n=>{n.isComposing||(n.key==="Enter"&&(n.metaKey||n.ctrlKey)?(n.preventDefault(),s({kind:"edit-save"})):n.key==="Escape"&&(n.preventDefault(),n.stopPropagation(),s({kind:"edit-cancel"})))}}
|
|
1239
|
+
></textarea>
|
|
1240
|
+
<div class="row item-editor-actions">
|
|
1241
|
+
<button class="dpk-btn dpk-btn--ghost" type="button" @click=${()=>s({kind:"edit-cancel"})}>
|
|
1242
|
+
${t.cancelEdit}
|
|
1243
|
+
</button>
|
|
1244
|
+
<button
|
|
1245
|
+
class="dpk-btn dpk-btn--accent"
|
|
1246
|
+
type="button"
|
|
1247
|
+
?disabled=${!e.canSave}
|
|
1248
|
+
@click=${()=>s({kind:"edit-save"})}
|
|
1249
|
+
>
|
|
1250
|
+
${t.saveEdit}
|
|
1251
|
+
</button>
|
|
1252
|
+
</div>
|
|
1253
|
+
</div>
|
|
1254
|
+
`;class Ns extends R{static{this.styles=Kr}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},onEditComment:{attribute:!1},exportBrief:{attribute:!1},sendToClaude:{attribute:!1},embedded:{type:Boolean}}}#e=jr();#i=null;#s=new Ke(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=Cs(this.#e,{kind:"target-requested",ref:this.pendingTarget}))}updated(e){e.has("pendingTarget")&&this.pendingTarget&&this.isConnected&&this.renderRoot.querySelector("textarea")?.focus();const s=this.#i;s&&(this.#i=null,[...this.renderRoot.querySelectorAll(".item")].find(r=>r.dataset.id===s.id)?.querySelector(s.kind==="editor"?".item-editor textarea":".item-edit")?.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,editable:this.onEditComment!==void 0,locale:this.#s.locale}}render(){const e=this.#n();return e?si($s(this.#s.locale),_s(e,this.#e),this.#r,this.embedded):g}#t(e){this.#e=Cs(this.#e,e),this.requestUpdate()}#r=e=>{switch(e.kind){case"delete":this.onDelete?.(e.id);return;case"clear":this.onClear?.();return;case"copy":this.#a();return;case"send":this.#o();return;case"edit-start":this.#i={kind:"editor",id:e.id},this.#t(e);return;case"edit-cancel":{const s=this.#e.editing;s&&(this.#i={kind:"edit-button",id:s.id}),this.#t(e);return}case"edit-save":{const s=Rr(this.#e);if(!s||!this.onEditComment||!this.onEditComment(s.id,s.body).ok)return;this.#i={kind:"edit-button",id:s.id},this.#t({kind:"edited"});return}case"submit":{const s=this.#n();if(!s||!this.onComment)return;const n=Lr(this.#e,_s(s,this.#e).target.ref);if(!n||!this.onComment(n.target,n.body).ok)return;this.#t({kind:"submitted"});return}default:this.#t(e)}};async#o(){const e=this.sendToClaude;if(!e||this.#e.send.kind==="pending")return;this.#t({kind:"send-started"});const s=this.#e.sendRequest,n=await e().catch(()=>({ok:!1,reason:"error"}));this.isConnected&&this.#t({kind:"send-finished",request:s,outcome:n})}async#a(){const e=this.#n();if(!e)return;this.#t({kind:"copy-started"});const s=this.#e.copyRequest;try{const n=this.exportBrief?.()??lt({...e.derivation,navigation:e.navigation,issues:e.issues},e.definition,M),r=await ct(n);this.isConnected&&this.#t({kind:"copy-finished",request:s,ok:r})}catch{this.isConnected&&this.#t({kind:"copy-finished",request:s,ok:!1})}}}const ii=()=>{customElements.get("dpk-component-comment-panel")||customElements.define("dpk-component-comment-panel",Ns)},Is=(t,e,s)=>{typeof window>"u"||Object.assign(window,{devProcessKit:{version:t,templates:e,versionParam:s}})},ce="dpk-version",qs="version",oi=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/,_e=t=>oi.test(t),ai="https://cdn.jsdelivr.net/npm/dev-process-kit@",Us="https://data.jsdelivr.com/v1/packages/npm/dev-process-kit",gt=t=>{const e=new URLSearchParams(t),s=e.get(ce)??e.get(qs);return s!==null&&_e(s)?s:null},di=(t,e)=>{const s=gt(t);return s===null||s===e?null:s},li=(t,e)=>{if(!_e(t))throw new Error(`not an exact version: ${t}`);if(!/^[a-z0-9-]+(?:\/[a-z0-9-]+)*\.js$/.test(e))throw new Error(`not an entry path: ${e}`);return`${ai}${t}/dist/${e}`},ci=(t,e)=>{const s=new URL(t);return s.searchParams.delete(qs),e===null?s.searchParams.delete(ce):s.searchParams.set(ce,e),s.href},pi=w({tags:de(Ge(m(),z()),{}),versions:P(w({version:m()}))}),hi=t=>{const e=Xe(pi,t),s=e.tags.latest;return{latest:typeof s=="string"&&_e(s)?s:null,versions:e.versions.map(n=>n.version).filter(_e)}},Ds=t=>{const e=t.published?.versions??[],s=e.includes(t.current)?e:[t.current,...e],n=t.published?.latest??null;return{value:t.current,options:[...t.requested?[{value:"",label:t.text.pinned}]:[],...s.map(r=>({value:r,label:r===n&&r!==t.current?t.text.latest(r):r}))]}};let Te;const Bs=()=>(Te??=fetch(Us).then(async t=>{if(!t.ok)throw new Error(`${Us} answered ${t.status}`);return hi(await t.json())}),Te.catch(()=>{Te=void 0}),Te),Hs=t=>{location.assign(ci(location.href,t))},ui=t=>import(t),fi=({entry:t,templates:e,register:s,importModule:n=ui})=>{const r=()=>{s(),Is(M,e,ce)},i=typeof location>"u"?null:di(location.search,M);if(i===null){r();return}n(li(i,t)).then(()=>{gi()||bi(i)},o=>{console.error(`dev-process-kit@${i} could not be loaded; running ${M}`,o),r()})},gi=()=>{const t=Reflect.get(window,"devProcessKit");return typeof t=="object"&&t!==null&&"versionParam"in t},mt="dpk-version-fallback",mi=`
|
|
1255
|
+
.${mt} {
|
|
1256
|
+
flex: none;
|
|
1257
|
+
height: 24px;
|
|
1258
|
+
margin-left: auto;
|
|
1259
|
+
padding: 0 22px 0 10px;
|
|
1260
|
+
border: 1px solid var(--dpk-rule, #8884);
|
|
1261
|
+
border-radius: 999px;
|
|
1262
|
+
background: var(--dpk-paper-sunken, transparent)
|
|
1263
|
+
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>")
|
|
1264
|
+
no-repeat right 8px center;
|
|
1265
|
+
appearance: none;
|
|
1266
|
+
field-sizing: content;
|
|
1267
|
+
color: var(--dpk-ink-soft, inherit);
|
|
1268
|
+
font-family: var(--dpk-mono, ui-monospace, monospace);
|
|
1269
|
+
font-size: 10px;
|
|
1270
|
+
letter-spacing: 0.02em;
|
|
1271
|
+
cursor: pointer;
|
|
1272
|
+
}
|
|
1273
|
+
`,bi=t=>{const e=[...document.body.querySelectorAll("*")].filter(s=>s.localName.startsWith("dpk-template-")&&!s.querySelector(`:scope > .${mt}`));if(e.length!==0){document.head.append(Object.assign(document.createElement("style"),{textContent:mi}));for(const s of e)s.append(ki(s,t))}},ki=(t,e)=>{const s=j(xe(ye(t))),n=document.createElement("select");n.className=mt,n.slot="header",n.setAttribute("aria-label",s.versionLabel),n.title=s.versionLabel;const r=o=>{const d=Ds({current:e,requested:gt(location.search)!==null,published:o,text:{pinned:s.versionPinned,latest:s.versionLatest}});n.replaceChildren(...d.options.map(a=>Object.assign(document.createElement("option"),{value:a.value,textContent:a.label}))),n.value=d.value},i=()=>{Bs().then(r,o=>console.warn(o))};return n.addEventListener("pointerenter",i,{once:!0}),n.addEventListener("focus",i,{once:!0}),n.addEventListener("change",()=>Hs(n.value===""?null:n.value)),r(null),n},vi=w({value:m()}),yi=t=>e=>{if(!(e instanceof CustomEvent))return;const s=y(vi,e.detail);s.success&&t(s.output.value)},bt=t=>e=>{const s=G(e.target,HTMLSelectElement);s!==null&&t(s.value)},xi=t=>e=>{const s=G(e.target,HTMLInputElement);s!==null&&t(s.checked)},pe=t=>t==="light"||t==="dark"?t:null,Fs=t=>t.authored??t.environment,Ks=t=>t.preference??Fs(t),wi=t=>{const e=Ks(t)==="dark"?"light":"dark";return e===Fs(t)?null:e},Vs=P(X({value:k(m(),K(/^element:.+/)),label:k(m(),v(1)),group:S(m())})),$i=w({targets:Vs,providers:P(w({id:k(m(),v(1)),results:P(xs)}))}),Ai=X({target:k(m(),K(/^element:.+/)),body:k(m(),Ye(),v(1))}),Ws=t=>t.group?`${t.group} \xB7 ${t.label}`:t.label,Js=(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(O(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?Ws(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:Ws(a)}},serialize:r=>O(r)?`${r.type} ${_(r.target)} ${JSON.stringify(r.payload)}`:t.serialize(r)}},Ys=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function Gs(t){return typeof Ys.Buffer<"u"&&Ys.Buffer.isBuffer(t)}function Zs(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 Xs(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function Qs(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const Ci="[object RegExp]",Si="[object String]",Ei="[object Number]",_i="[object Boolean]",Ti="[object Symbol]",Oi="[object Date]",Mi="[object Map]",ji="[object Set]",Li="[object Array]",Ri="[object Function]",Pi="[object ArrayBuffer]",kt="[object Object]",zi="[object Error]",Ni="[object DataView]",Ii="[object Uint8Array]",qi="[object Uint8ClampedArray]",Ui="[object Uint16Array]",Di="[object Uint32Array]",Bi="[object BigUint64Array]",Hi="[object Int8Array]",Fi="[object Int16Array]",Ki="[object Int32Array]",Vi="[object BigInt64Array]",Wi="[object Float32Array]",Ji="[object Float64Array]";function Yi(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function Gi(t,e,s){return he(t,e,void 0,void 0,void 0,void 0,s)}function he(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 ue(t,e,i,o)}return ue(t,e,i,o)}function ue(t,e,s,n){if(Object.is(t,e))return!0;let r=Qs(t),i=Qs(e);if(r==="[object Arguments]"&&(r=kt),i==="[object Arguments]"&&(i=kt),r!==i)return!1;switch(r){case Si:return t.toString()===e.toString();case Ei:return Yi(t.valueOf(),e.valueOf());case _i:case Oi:case Ti:return Object.is(t.valueOf(),e.valueOf());case Ci:return t.source===e.source&&t.flags===e.flags;case Ri: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 Mi:if(t.size!==e.size)return!1;for(const[a,l]of t.entries())if(!e.has(a)||!he(l,e.get(a),a,t,e,s,n))return!1;return!0;case ji:{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=>he(c,u,void 0,t,e,s,n));if(h===-1)return!1;l.splice(h,1)}return!0}case Li:case Ii:case qi:case Ui:case Di:case Bi:case Hi:case Fi:case Ki:case Vi:case Wi:case Ji:if(Gs(t)!==Gs(e)||t.length!==e.length)return!1;for(let a=0;a<t.length;a++)if(!he(t[a],e[a],a,t,e,s,n))return!1;return!0;case Pi:return t.byteLength!==e.byteLength?!1:ue(new Uint8Array(t),new Uint8Array(e),s,n);case Ni:return t.byteLength!==e.byteLength||t.byteOffset!==e.byteOffset?!1:ue(new Uint8Array(t),new Uint8Array(e),s,n);case zi:return t.name===e.name&&t.message===e.message;case kt:{if(!(ue(t.constructor,e.constructor,s,n)||Zs(t)&&Zs(e)))return!1;const a=[...Object.keys(t),...Xs(t)],l=[...Object.keys(e),...Xs(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(!he(h,u,c,t,e,s,n))return!1}return!0}default:return!1}}finally{s.delete(t),s.delete(e)}}function Zi(){}function Oe(t,e){return Gi(t,e,Zi)}const en="page",tn=t=>_(t),sn=(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(O(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=Ee(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"&&vt(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!==en&&!t.hasTarget(r,c.target)){o.push({action:c,reason:"target-missing"});continue}a.push(c);const h=tn(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}},vt=(t,e,s)=>e===s?!0:t.canonicalState===void 0?Oe(e,s):Oe(t.canonicalState(e),t.canonicalState(s)),nn=t=>{const e=new Set(t.obsolete.map(s=>s.id));return t.actions.filter(s=>!e.has(s.id))},Xi=(t,e,s,n)=>{let r=e;const i=n??rn(r).map(o=>o.id);for(const o of[...i].reverse())r=Qi(t,r,s,o,n!==void 0)??r;return r},rn=t=>t.applied.filter(e=>!O(e)),Qi=(t,e,s,n,r)=>{const i=rn(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?eo(t,e.base,i,o):[],...to(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=so(t,e,s,h);if(u!==null)return u}return null},eo=(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)=>vt(t,o,i)?[s.slice(d,n+1).map(a=>a.id)]:[])},to=(t,e,s)=>{const n=on(s),r=e.filter(a=>on(a).some(l=>n.includes(l))),i=an(t,s),o=r.filter(a=>an(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])]},on=t=>{const e=t.target.type===en?[]: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]},an=(t,e)=>Ee(t.actions,e.type)?.mode,so=(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 vt(t,o.state,e.state)?o:null;if(d.some(a=>a.type===E||O(a)))return null;for(const a of d)i.add(a.id)}},no=w({v:Z(1),template:k(m(),v(1)),actions:P(z())});class yt{constructor(e){this.storage=e}load(e,s){try{const n=this.storage.getItem(e);if(n===null)return[];const r=y(no,JSON.parse(n));return!r.success||r.output.template!==s?[]:r.output.actions.flatMap(i=>{const o=y(V,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 xt{constructor(){this.store=new Map}load(e,s){return new yt({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 wt=()=>{try{if(typeof localStorage<"u")return new yt(localStorage)}catch{}return new xt},dn=t=>`dev-process-kit:draft:${typeof location>"u"?"local":`${location.pathname}${location.search}`}:${t}`,ro=P(z());class ln{#e;#i;#s={targets:[],providers:[]};#n=new Map;#t;#r;#o;#a;#d;#u=new Set;#b=[];#l=0;constructor(e){this.#e=e.definition,this.#i=Js(e.definition,[],this.#n),this.#t=e.base,this.#d=e.storageKey??dn(e.definition.name),this.#a=e.storage===void 0?wt():e.storage;const s=e.initialActions??this.#a?.load(this.#d,this.definition.name)??[];this.#r=pn(this.definition,s),this.#o=this.#h(this.#r),this.#m()&&this.#v()}get definition(){return this.#i}setComponentSnapshot(e){const s=Xe($i,e);if(!Oe(s,this.#s)){this.#s=s,this.#c(),this.#o=this.#h(this.#r);for(const n of this.#u)n()}}setTemplate(e){this.#e=e,this.#c(),this.#o=this.#h(this.#r);for(const s of this.#u)s()}#c(){this.#n=ws(this.#r,this.#s.providers),this.#i=Js(this.#e,this.#s.targets,this.#n)}#h(e){return sn(this.definition,this.#t,e,ws(e,this.#s.providers))}get base(){return this.#t}get actions(){return this.#r}get derivation(){return this.#o}get lastIssues(){return this.#b}get prunedCount(){return this.#l}descriptorFor(e,s){return cn(this.definition,e,s)}dispatch(e){const s=this.#x(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.#f(tt(this.#r,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(ro,e);if(!s.success)return this.#p([W(s.issues)]);const n=s.output;if(n.length===0)return{ok:!0,ids:[]};let r=this.#r,i=this.#o.state;const o=[];for(const d of n){const a=this.#x(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"||O(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=tt(r,l,p),i=this.#h(r).state,o.push(l.id)}return this.#f(r,o),{ok:!0,ids:o}}#x(e,s){const n=y(bs,e);if(!n.success)return{ok:!1,issue:W(n.issues)};const r=this.descriptorFor(n.output.type,typeof n.output.target=="string"?Qe(n.output.target,"page"):n.output.target);if(!r)return{ok:!1,issue:{path:"type",message:`unknown action type "${n.output.type}"`}};const i=wr(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.#b=e,{ok:!1,issues:e}}editComment(e,s){const n=this.#r.find(d=>d.id===e);if(n?.type!==E)return this.#p([{path:"id",message:`no comment "${e}" in the draft`}]);if(le(n)===s)return{ok:!0,id:e};const r=y(nt.schema,{...n,payload:{body:s}});if(!r.success)return this.#p([W(r.issues)]);const i=y(V,r.output);if(!i.success)return this.#p([W(i.issues)]);const o=i.output;return this.#f(this.#r.map(d=>d===n?o:d),[]),{ok:!0,id:e}}removeAction(e){const s=this.#r.filter(n=>n.id!==e);s.length!==this.#r.length&&this.#f(s)}clearActions(){this.#r.length>0&&this.#f([])}replaceActions(e){this.#f(pn(this.definition,e))}setBase(e){this.#t=e,this.#f(this.#r)}subscribe(e){return this.#u.add(e),()=>{this.#u.delete(e)}}exportDraft(e){return{template:this.definition.name,frameworkVersion:e,exportedAt:new Date().toISOString(),actions:this.#r}}#f(e,s){this.#b=[],this.#r=e,this.#c(),this.#o=this.#h(this.#r),this.#m(s),this.#v();for(const n of this.#u)n()}#m(e){const s=this.#k(),n=Xi(this.definition,this.#o,r=>this.#h(r),e);return n===this.#o?s:(this.#l+=this.#r.length-n.actions.length,this.#r=[...n.actions],this.#c(),this.#o=this.#h(this.#r),this.#k(),!0)}#k(){return this.#o.obsolete.length===0?!1:(this.#l+=this.#o.obsolete.length,this.#r=nn(this.#o),this.#c(),this.#o=this.#h(this.#r),!0)}#v(){this.#a?.save(this.#d,this.definition.name,this.#r)}}const cn=(t,e,s)=>e==="comment"?nt:s!==void 0&&O({type:e,target:s})?Er:Ee(t.actions,e),pn=(t,e)=>e.flatMap(s=>{const n=y(V,s);if(!n.success)return[];const r=n.output,i=cn(t,r.type,r.target);if(!i)return[];const o=y(i.schema,r);if(!o.success)return[];const d=y(V,o.output);return d.success?[d.output]:[]}),io=()=>({status:{kind:"idle"},request:0}),oo=(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}},ao=(t,e)=>{if(t.actions===0||t.railOpen)return null;const s=j(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"?pt(n.reason,t.locale):null}},hn=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()}},lo=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)}},co=(t,e)=>{const s=()=>hn(t);return{version:M,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}}),editComment:(n,r)=>t.editComment(n,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(M),exportBrief:()=>lt(s(),t.controller().definition,M),subscribe:n=>t.subscribe(n)}},$t=(t,e)=>typeof t=="object"&&t!==null&&e.every(s=>typeof Reflect.get(t,s)=="function"),po=t=>$t(t,["use"]),ho=t=>$t(t,["anchorFor","canSendToClaude","sendToClaude"]),uo=t=>$t(t,["collection"]),un=async(t,e)=>{try{return await t.use(e)}catch{return null}},fo=(t,e)=>({async canSend(){try{return await t.canSendToClaude()==="available"}catch{return!1}},async send({brief:s,draft:n,anchor:r}){let i=Ur(s);if(i===null){if(e===null)return{ok:!1,reason:"too_large"};try{const o=e.collection(Nr).doc();await o.set({brief:s,draft:n,createdAt:new Date().toISOString()}),i=Dr(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:Hr(o)}}}}),go=async t=>{if(!po(t))return null;const[e,s]=await Promise.all([un(t,"comments"),un(t,"db")]);return ho(e)?fo(e,uo(s)?s:null):null},mo=()=>Reflect.get(globalThis,"claude");class bo{#e;#i;#s=null;#n=!1;constructor(e,s=mo){this.#e=e,this.#i=s,e.addController(this)}get available(){return this.#n}hostConnected(){this.#s??=go(this.#i()),this.#t(),window.addEventListener("focus",this.#t)}hostDisconnected(){window.removeEventListener("focus",this.#t)}async send(e){const s=await this.#s;if(!s)return{ok:!1,reason:"forbidden"};const n=await s.send(e);return this.#t(),n}#t=async()=>{const e=await this.#s,s=e?await e.canSend():!1;s!==this.#n&&(this.#n=s,this.#e.requestUpdate())}}const fn=(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{}}}),ee=t=>{const e=new Map;return fn({getItem:s=>e.get(s)??null,setItem:(s,n)=>{e.set(s,n)},removeItem:s=>{e.delete(s)}},t)},fe=t=>{try{if(typeof localStorage<"u")return fn(localStorage,t)}catch{}return ee(t)},At="dev-process-kit:color-scheme",ko="(prefers-color-scheme: dark)",gn=()=>typeof matchMedia=="function"?matchMedia(ko):null,mn=()=>pe(document.documentElement.dataset.theme)??(gn()?.matches===!0?"dark":"light");class vo{#e;#i;#s=null;#n=null;#t="light";#r=null;#o=null;constructor(e,s){this.#e=e,this.#i=s,e.addController(this)}hostConnected(){this.#s===null&&(this.#s=this.#i()?fe(pe):ee(pe),this.#n=this.#s.read(At)),this.#t=mn(),this.#r=gn(),this.#r?.addEventListener("change",this.#d),this.#o=new MutationObserver(this.#d),this.#o.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})}hostDisconnected(){this.#r?.removeEventListener("change",this.#d),this.#r=null,this.#o?.disconnect(),this.#o=null}resolve(e){return Ks(this.#a(e))}toggle(e){this.#n=wi(this.#a(e)),this.#n===null?this.#s?.remove(At):this.#s?.write(At,this.#n),this.#e.requestUpdate()}#a(e){return{preference:this.#n,authored:e,environment:this.#t}}#d=()=>{const e=mn();e!==this.#t&&(this.#t=e,this.#e.requestUpdate())}}const yo=(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},bn=(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)},kn=t=>bn(t.filter(e=>"elementActions"in e&&e.id.length>0),e=>e.id),vn=(t,e)=>{for(const s of kn(t)){const n=Tr(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)}},xo=t=>{const e=Reflect.get(t,"elementActionResults");return Array.isArray(e)?e.flatMap(s=>{const n=y(xs,s);return n.success?[n.output]:[]}):[]},wo=t=>{const e=[];for(const s of t){if(!("commentTargets"in s))continue;const n=y(Vs,s.commentTargets);n.success&&e.push(...n.output)}return{targets:bn(e,s=>s.value),providers:kn(t).map(s=>({id:s.id,results:xo(s)}))}},$o=2400;class Ao{#e=io();#i=null;#s;constructor(e){this.#s=e,e.addController(this)}get state(){return this.#e}hostDisconnected(){this.#r()}async copy(e){this.#n({kind:"copy-started"});const s=this.#e.request,n=await ct(e()).catch(()=>!1);this.#n({kind:"copy-finished",request:s,ok:n}),this.#t(s)}async send(e){if(this.#e.status.kind==="sending")return;this.#n({kind:"send-started"});const s=this.#e.request,n=await e().catch(()=>({ok:!1,reason:"error"}));this.#n({kind:"send-finished",request:s,outcome:n}),n.ok&&this.#t(s)}#n(e){(e.kind==="copy-started"||e.kind==="send-started")&&this.#r(),this.#e=oo(this.#e,e),this.#s.requestUpdate()}#t(e){e===this.#e.request&&(this.#r(),this.#i=setTimeout(()=>{this.#i=null,this.#n({kind:"settled",request:e})},$o))}#r(){this.#i!==null&&clearTimeout(this.#i),this.#i=null}}const Ct="dev-process-kit:locale";class Co{#e;#i;#s;#n=null;#t=null;#r;#o;constructor(e,s,n){this.#e=e,this.#i=s,this.#s=n,e.addController(this)}get authored(){if(this.#r===void 0)return xe(ye(this.#e));const e=this.#e.parentNode;return xe(this.#r??(e===null?null:ye(e)))}get locale(){return this.#o??this.#a()}#a(){return Yn({preference:this.#t,authored:this.authored})}hostConnected(){this.#n===null&&(this.#n=this.#i()?fe(Qt):ee(Qt),this.#t=this.#n.read(Ct)),this.#r??=this.#e.getAttribute("lang"),this.#d()}pick(e){this.#t=Gn(e,this.authored),this.#t===null?this.#n?.remove(Ct):this.#n?.write(Ct,this.#t),this.#d(),this.#e.requestUpdate()}#d(){const e=this.#t??this.#r??null;e===null?this.#e.removeAttribute("lang"):this.#e.getAttribute("lang")!==e&&this.#e.setAttribute("lang",e);const s=this.#a();if(s===this.#o)return;const n=this.#o===void 0;this.#o=s,this.#s(),(!n||this.#t!==null)&&document.dispatchEvent(new Event(Fe))}}const yn=()=>at(typeof location>"u"?"":location.hash),So=(t,e)=>{if(typeof history>"u")return;const s=`${location.pathname}${location.search}${Q(t)}`;`${location.pathname}${location.search}${location.hash}`!==s&&(e?history.replaceState(null,"",s):history.pushState(null,"",s))};class Eo{#e;#i=null;#s=0;constructor(e){this.#e=e}get orphans(){return this.#s}route(){const e=this.#e.renderRoot,s=G(e.querySelector('slot[name="preview"]'),HTMLSlotElement);if(s===null)return;this.#i!==s&&(this.#i=s,s.addEventListener("slotchange",this.#n));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.#s&&(this.#s=r.length,queueMicrotask(()=>this.#e.requestUpdate()))}#n=()=>{queueMicrotask(()=>this.route())}}const N={min:180,max:560,step:16,largeStep:64},_o={side:"left",defaultWidth:260},Me=t=>Math.round(Math.min(N.max,Math.max(N.min,t))),xn=t=>typeof t=="number"&&Number.isFinite(t)?Me(t):null,St=(t,e)=>t==="left"?e:-e,To=(t,e)=>Me(t.startWidth+St(t.side,e-t.startX)),Oo=(t,e,{key:s,shiftKey:n})=>{const r=n?N.largeStep:N.step;switch(s){case"ArrowLeft":return Me(t+St(e,-r));case"ArrowRight":return Me(t+St(e,r));case"Home":return N.min;case"End":return N.max;default:return null}},wn=t=>typeof t=="boolean"?t:null,Mo=t=>t==="left"?"right":"left",jo=(t,e)=>e?{action:"expand",points:Mo(t)}:{action:"collapse",points:t},Lo=t=>`dev-process-kit:sidebar-collapsed:${t}`;class Ro{#e;#i;#s=null;#n="";#t=!1;constructor(e,s){this.#e=e,this.#i=s,e.addController(this)}hostConnected(){this.#s===null&&(this.#s=this.#i.persist()?fe(wn):ee(wn),this.#n=Lo(this.#i.template()),this.#t=this.#s.read(this.#n)??!1)}get collapsed(){return this.#t}toggle(){this.#t=!this.#t,this.#t?this.#s?.write(this.#n,!0):this.#s?.remove(this.#n),this.#e.requestUpdate()}}const Po=t=>`dev-process-kit:sidebar-width:${t}`,Et={kind:"idle"};class zo{constructor(e,s){this.#s=null,this.#n="",this.#t=null,this.#r=Et,this.handlers={pointerdown:n=>{n.button===0&&(n.preventDefault(),n.currentTarget instanceof Element&&n.currentTarget.setPointerCapture(n.pointerId),this.#r={kind:"dragging",pointerId:n.pointerId,side:this.#i.layout().side,startX:n.clientX,startWidth:this.width},this.#e.requestUpdate())},pointermove:n=>{const r=this.#r;r.kind!=="dragging"||r.pointerId!==n.pointerId||this.#a(To(r,n.clientX))},pointerup:n=>this.#o(n),pointercancel:n=>this.#o(n),keydown:n=>{const r=Oo(this.width,this.#i.layout().side,n);r!==null&&(n.preventDefault(),this.#a(r),this.#d())},dblclick:()=>{this.#a(this.#i.layout().defaultWidth),this.#d()}},this.#e=e,this.#i=s,e.addController(this)}#e;#i;#s;#n;#t;#r;hostConnected(){this.#s===null&&(this.#s=this.#i.persist()?fe(xn):ee(xn),this.#n=Po(this.#i.template()),this.#t=this.#s.read(this.#n))}hostDisconnected(){this.#r=Et}get width(){return this.#t??this.#i.layout().defaultWidth}get dragging(){return this.#r.kind==="dragging"}#o(e){const s=this.#r;s.kind!=="dragging"||s.pointerId!==e.pointerId||(this.#r=Et,this.#d(),this.#e.requestUpdate())}#a(e){const s=e===this.#i.layout().defaultWidth?null:e;s!==this.#t&&(this.#t=s,this.#e.requestUpdate())}#d(){this.#t===null?this.#s?.remove(this.#n):this.#s?.write(this.#n,this.#t)}}const No=[$e,Ve,q`
|
|
1274
|
+
:host {
|
|
1275
|
+
display: block;
|
|
1276
|
+
min-height: 100%;
|
|
1277
|
+
background: var(--dpk-paper);
|
|
1278
|
+
color-scheme: light;
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1281
|
+
/* The element stamps its resolved scheme; nested components inherit it. */
|
|
1282
|
+
:host([data-theme='dark']) {
|
|
1283
|
+
color-scheme: dark;
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
.dpk-shell {
|
|
1287
|
+
display: grid;
|
|
1288
|
+
/* One column no wider than the host: a truncated title must not widen
|
|
1289
|
+
the page past a phone screen. */
|
|
1290
|
+
grid-template-columns: minmax(0, 1fr);
|
|
1291
|
+
grid-template-rows: auto minmax(0, 1fr) auto;
|
|
1292
|
+
min-height: 100%;
|
|
1293
|
+
max-height: 100%;
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
/* ------------------------------------------------------------- header */
|
|
1297
|
+
|
|
1298
|
+
.dpk-header {
|
|
1299
|
+
position: relative;
|
|
1300
|
+
z-index: 20;
|
|
1301
|
+
display: flex;
|
|
1302
|
+
align-items: center;
|
|
1303
|
+
gap: 14px;
|
|
1304
|
+
min-height: 60px;
|
|
1305
|
+
/* Right padding keeps the header content clear of the fixed review button. */
|
|
1306
|
+
padding: 10px 72px 10px 16px;
|
|
1307
|
+
border-bottom: 1px solid var(--dpk-rule);
|
|
1308
|
+
background: var(--dpk-glass);
|
|
1309
|
+
backdrop-filter: saturate(1.6) blur(14px);
|
|
1310
|
+
box-shadow: 0 1px 0 var(--dpk-highlight) inset;
|
|
1311
|
+
}
|
|
1312
|
+
|
|
1313
|
+
/* A hairline of the accent along the bottom edge, fading out to the right. */
|
|
1314
|
+
.dpk-header::after {
|
|
1315
|
+
content: '';
|
|
1316
|
+
position: absolute;
|
|
1317
|
+
left: 0;
|
|
1318
|
+
right: 0;
|
|
1319
|
+
bottom: -1px;
|
|
1320
|
+
height: 1px;
|
|
1321
|
+
background: linear-gradient(
|
|
1322
|
+
90deg,
|
|
1323
|
+
color-mix(in srgb, var(--dpk-accent) 70%, transparent),
|
|
1324
|
+
color-mix(in srgb, var(--dpk-accent) 0%, transparent) 38%
|
|
1325
|
+
);
|
|
1326
|
+
pointer-events: none;
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
/* Kit mark: a stack of pages, the single HTML page the agent wrote. */
|
|
1330
|
+
.dpk-brand {
|
|
1331
|
+
position: relative;
|
|
1332
|
+
flex: none;
|
|
1333
|
+
width: 32px;
|
|
1334
|
+
height: 32px;
|
|
1335
|
+
border-radius: 9px;
|
|
1336
|
+
background:
|
|
1337
|
+
radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.35), transparent 60%),
|
|
1338
|
+
linear-gradient(145deg, var(--dpk-accent-bright), var(--dpk-accent-strong));
|
|
1339
|
+
box-shadow:
|
|
1340
|
+
inset 0 1px 0 rgba(255, 255, 255, 0.3),
|
|
1341
|
+
inset 0 -1px 0 rgba(0, 0, 0, 0.12),
|
|
1342
|
+
0 4px 12px -4px color-mix(in srgb, var(--dpk-accent) 70%, transparent);
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
.dpk-brand::before,
|
|
1346
|
+
.dpk-brand::after {
|
|
1347
|
+
content: '';
|
|
1348
|
+
position: absolute;
|
|
1349
|
+
width: 12px;
|
|
1350
|
+
height: 15px;
|
|
1351
|
+
border-radius: 3px;
|
|
1352
|
+
}
|
|
1353
|
+
|
|
1354
|
+
.dpk-brand::before {
|
|
1355
|
+
left: 12px;
|
|
1356
|
+
top: 7px;
|
|
1357
|
+
background: rgba(255, 255, 255, 0.4);
|
|
1358
|
+
}
|
|
1359
|
+
|
|
1360
|
+
.dpk-brand::after {
|
|
1361
|
+
left: 8px;
|
|
1362
|
+
top: 10px;
|
|
1363
|
+
background:
|
|
1364
|
+
linear-gradient(var(--dpk-accent), var(--dpk-accent)) 3px 4px / 6px 1.5px no-repeat,
|
|
1365
|
+
linear-gradient(var(--dpk-accent), var(--dpk-accent)) 3px 7.5px / 4px 1.5px no-repeat,
|
|
1366
|
+
#fff;
|
|
1367
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1370
|
+
.dpk-title {
|
|
1371
|
+
display: flex;
|
|
1372
|
+
flex-direction: column;
|
|
1373
|
+
gap: 3px;
|
|
1374
|
+
min-width: 0;
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1377
|
+
.dpk-title h1 {
|
|
1378
|
+
font-size: 16px;
|
|
1379
|
+
font-weight: 680;
|
|
1380
|
+
letter-spacing: -0.02em;
|
|
1381
|
+
white-space: nowrap;
|
|
1382
|
+
overflow: hidden;
|
|
1383
|
+
text-overflow: ellipsis;
|
|
1384
|
+
}
|
|
1385
|
+
|
|
1386
|
+
.dpk-template-mark {
|
|
1387
|
+
align-self: flex-start;
|
|
1388
|
+
font-family: var(--dpk-mono);
|
|
1389
|
+
font-size: 9.5px;
|
|
1390
|
+
font-weight: 600;
|
|
1391
|
+
letter-spacing: 0.14em;
|
|
1392
|
+
line-height: 1;
|
|
1393
|
+
text-transform: uppercase;
|
|
1394
|
+
color: var(--dpk-accent);
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1397
|
+
.dpk-header-slot {
|
|
1398
|
+
flex: 1;
|
|
1399
|
+
min-width: 0;
|
|
1400
|
+
display: flex;
|
|
1401
|
+
align-items: center;
|
|
1402
|
+
gap: 10px;
|
|
1403
|
+
}
|
|
1404
|
+
|
|
1405
|
+
.dpk-header-meta {
|
|
1406
|
+
display: flex;
|
|
1407
|
+
align-items: center;
|
|
1408
|
+
gap: 0;
|
|
1409
|
+
margin-left: auto;
|
|
1410
|
+
padding: 3px;
|
|
1411
|
+
border-radius: 999px;
|
|
1412
|
+
border: 1px solid var(--dpk-rule);
|
|
1413
|
+
background: var(--dpk-paper-sunken);
|
|
1414
|
+
font-family: var(--dpk-mono);
|
|
1415
|
+
font-size: 10px;
|
|
1416
|
+
letter-spacing: 0.02em;
|
|
1417
|
+
color: var(--dpk-ink-faint);
|
|
1418
|
+
white-space: nowrap;
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1421
|
+
.dpk-header-meta span {
|
|
1422
|
+
padding: 3px 9px;
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1425
|
+
.dpk-header-meta span + span {
|
|
1426
|
+
border-left: 1px solid var(--dpk-rule);
|
|
1427
|
+
}
|
|
1428
|
+
|
|
1429
|
+
.dpk-version-select {
|
|
1430
|
+
margin: -3px 0;
|
|
1431
|
+
padding: 3px 14px 3px 0;
|
|
1432
|
+
border: 0;
|
|
1433
|
+
border-radius: 4px;
|
|
1434
|
+
background: transparent
|
|
1435
|
+
url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='8' height='8' 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>")
|
|
1436
|
+
no-repeat right 2px center;
|
|
1437
|
+
appearance: none;
|
|
1438
|
+
/* As wide as the version shown, not the longest prerelease in the list. */
|
|
1439
|
+
field-sizing: content;
|
|
1440
|
+
color: inherit;
|
|
1441
|
+
font: inherit;
|
|
1442
|
+
letter-spacing: inherit;
|
|
1443
|
+
cursor: pointer;
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
.dpk-version-select:hover {
|
|
1447
|
+
color: var(--dpk-ink-soft);
|
|
1448
|
+
}
|
|
1449
|
+
|
|
1450
|
+
.dpk-version-select:focus-visible {
|
|
1451
|
+
outline: none;
|
|
1452
|
+
box-shadow: var(--dpk-focus);
|
|
1453
|
+
}
|
|
1454
|
+
|
|
1455
|
+
.dpk-header-meta .dpk-meta-count {
|
|
1456
|
+
margin-left: 2px;
|
|
1457
|
+
border-left: 0;
|
|
1458
|
+
border-radius: 999px;
|
|
1459
|
+
background: var(--dpk-paper-raised);
|
|
1460
|
+
color: var(--dpk-ink-soft);
|
|
1461
|
+
box-shadow: var(--dpk-bevel), var(--dpk-shadow-xs);
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1464
|
+
.dpk-header-meta .dpk-meta-count[data-active='true'] {
|
|
1465
|
+
background: var(--dpk-accent-soft);
|
|
1466
|
+
color: var(--dpk-accent);
|
|
1467
|
+
box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--dpk-accent) 25%, transparent);
|
|
1468
|
+
}
|
|
1469
|
+
|
|
1470
|
+
.dpk-header-tools {
|
|
1471
|
+
display: flex;
|
|
1472
|
+
flex: none;
|
|
1473
|
+
align-items: center;
|
|
1474
|
+
gap: 2px;
|
|
1475
|
+
padding: 3px;
|
|
1476
|
+
border: 1px solid var(--dpk-rule);
|
|
1477
|
+
border-radius: 999px;
|
|
1478
|
+
background: var(--dpk-paper-sunken);
|
|
1479
|
+
}
|
|
1480
|
+
|
|
1481
|
+
.dpk-lang-select {
|
|
1482
|
+
flex: none;
|
|
1483
|
+
height: 26px;
|
|
1484
|
+
padding: 0 24px 0 10px;
|
|
1485
|
+
border: 0;
|
|
1486
|
+
border-radius: 999px;
|
|
1487
|
+
background: transparent
|
|
1488
|
+
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>")
|
|
1489
|
+
no-repeat right 8px center;
|
|
1490
|
+
appearance: none;
|
|
1491
|
+
color: var(--dpk-ink-soft);
|
|
1492
|
+
font: inherit;
|
|
1493
|
+
font-size: 12px;
|
|
1494
|
+
font-weight: 520;
|
|
1495
|
+
cursor: pointer;
|
|
1496
|
+
transition:
|
|
1497
|
+
color 160ms var(--dpk-ease),
|
|
1498
|
+
background-color 160ms var(--dpk-ease);
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1501
|
+
.dpk-lang-select:hover {
|
|
1502
|
+
color: var(--dpk-ink);
|
|
1503
|
+
background-color: var(--dpk-paper-raised);
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1506
|
+
.dpk-lang-select:focus-visible {
|
|
1507
|
+
outline: none;
|
|
1508
|
+
box-shadow: var(--dpk-focus);
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1511
|
+
.dpk-theme-toggle {
|
|
1512
|
+
display: inline-flex;
|
|
1513
|
+
flex: none;
|
|
1514
|
+
align-items: center;
|
|
1515
|
+
justify-content: center;
|
|
1516
|
+
width: 26px;
|
|
1517
|
+
height: 26px;
|
|
1518
|
+
padding: 0;
|
|
1519
|
+
border: 0;
|
|
1520
|
+
border-radius: 999px;
|
|
1521
|
+
background: transparent;
|
|
1522
|
+
color: var(--dpk-ink-soft);
|
|
1523
|
+
cursor: pointer;
|
|
1524
|
+
transition:
|
|
1525
|
+
color 160ms var(--dpk-ease),
|
|
1526
|
+
background 160ms var(--dpk-ease),
|
|
1527
|
+
transform 300ms var(--dpk-ease-spring);
|
|
1528
|
+
}
|
|
1529
|
+
|
|
1530
|
+
.dpk-theme-toggle svg {
|
|
1531
|
+
width: 14px;
|
|
1532
|
+
height: 14px;
|
|
1533
|
+
}
|
|
1534
|
+
|
|
1535
|
+
.dpk-theme-toggle:hover {
|
|
1536
|
+
color: var(--dpk-ink);
|
|
1537
|
+
background: var(--dpk-paper-raised);
|
|
1538
|
+
transform: rotate(-18deg);
|
|
1539
|
+
}
|
|
1540
|
+
|
|
1541
|
+
.dpk-theme-toggle:focus-visible {
|
|
1542
|
+
outline: none;
|
|
1543
|
+
box-shadow: var(--dpk-focus);
|
|
1544
|
+
}
|
|
1545
|
+
|
|
1546
|
+
/* --------------------------------------------------------------- body */
|
|
1547
|
+
|
|
1548
|
+
.dpk-body {
|
|
1549
|
+
display: flex;
|
|
1550
|
+
min-height: 0;
|
|
1551
|
+
}
|
|
1552
|
+
|
|
1553
|
+
.dpk-sidebar {
|
|
1554
|
+
/* The element sets the template's or the reader's width; on a narrow
|
|
1555
|
+
screen a wide one still leaves the main column some room. */
|
|
1556
|
+
width: var(--dpk-sidebar-width);
|
|
1557
|
+
max-width: calc(100% - 120px);
|
|
1558
|
+
flex: 0 0 auto;
|
|
1559
|
+
border-right: 1px solid var(--dpk-rule);
|
|
1560
|
+
background: var(--dpk-paper-sunken);
|
|
1561
|
+
overflow: auto;
|
|
1562
|
+
padding: 18px 14px;
|
|
1563
|
+
scrollbar-width: thin;
|
|
1564
|
+
}
|
|
1565
|
+
|
|
1566
|
+
.dpk-sidebar[hidden] {
|
|
1567
|
+
display: none;
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1570
|
+
/*
|
|
1571
|
+
* A right-hand sidebar: a rail beside the main column rather than a list
|
|
1572
|
+
* before it. \`:where\` keeps these as weak as the rules above, so a
|
|
1573
|
+
* template can still restyle the rail (stacking it on a phone, say).
|
|
1574
|
+
*/
|
|
1575
|
+
:where(.dpk-body[data-sidebar-side='right']) .dpk-main {
|
|
1576
|
+
order: 1;
|
|
1577
|
+
}
|
|
1578
|
+
|
|
1579
|
+
:where(.dpk-body[data-sidebar-side='right']) .dpk-sidebar,
|
|
1580
|
+
:where(.dpk-body[data-sidebar-side='right']) .dpk-sidebar-resizer,
|
|
1581
|
+
:where(.dpk-body[data-sidebar-side='right']) .dpk-sidebar-toggle,
|
|
1582
|
+
:where(.dpk-body[data-sidebar-side='right']) .dpk-sidebar-strip {
|
|
1583
|
+
order: 2;
|
|
1584
|
+
}
|
|
1585
|
+
|
|
1586
|
+
:where(.dpk-body[data-sidebar-side='right']) .dpk-sidebar,
|
|
1587
|
+
:where(.dpk-body[data-sidebar-side='right']) .dpk-sidebar-strip {
|
|
1588
|
+
border-right: 0;
|
|
1589
|
+
border-left: 1px solid var(--dpk-rule);
|
|
1590
|
+
}
|
|
1591
|
+
|
|
1592
|
+
/*
|
|
1593
|
+
* The fold button. Expanded, it sits on the sidebar's border near the top
|
|
1594
|
+
* and, like the resizer, takes no room of its own; folded, it is the only
|
|
1595
|
+
* thing left in a narrow strip where the sidebar was.
|
|
1596
|
+
*/
|
|
1597
|
+
.dpk-sidebar-toggle {
|
|
1598
|
+
position: relative;
|
|
1599
|
+
z-index: 7;
|
|
1600
|
+
display: inline-flex;
|
|
1601
|
+
flex: none;
|
|
1602
|
+
align-self: flex-start;
|
|
1603
|
+
align-items: center;
|
|
1604
|
+
justify-content: center;
|
|
1605
|
+
width: 22px;
|
|
1606
|
+
height: 22px;
|
|
1607
|
+
margin: 14px -11px 0;
|
|
1608
|
+
padding: 0;
|
|
1609
|
+
border: 1px solid var(--dpk-rule-strong);
|
|
1610
|
+
border-radius: 999px;
|
|
1611
|
+
background: var(--dpk-paper-raised);
|
|
1612
|
+
color: var(--dpk-ink-soft);
|
|
1613
|
+
box-shadow: var(--dpk-bevel), var(--dpk-shadow-xs);
|
|
1614
|
+
cursor: pointer;
|
|
1615
|
+
transition:
|
|
1616
|
+
color 160ms var(--dpk-ease),
|
|
1617
|
+
border-color 160ms var(--dpk-ease),
|
|
1618
|
+
background 160ms var(--dpk-ease);
|
|
1619
|
+
}
|
|
1620
|
+
|
|
1621
|
+
.dpk-sidebar-toggle svg {
|
|
1622
|
+
width: 13px;
|
|
1623
|
+
height: 13px;
|
|
1624
|
+
}
|
|
1625
|
+
|
|
1626
|
+
.dpk-sidebar-toggle:hover {
|
|
1627
|
+
color: var(--dpk-accent);
|
|
1628
|
+
border-color: color-mix(in srgb, var(--dpk-accent) 45%, transparent);
|
|
1629
|
+
}
|
|
1630
|
+
|
|
1631
|
+
.dpk-sidebar-toggle:focus-visible {
|
|
1632
|
+
outline: none;
|
|
1633
|
+
box-shadow: var(--dpk-focus);
|
|
1634
|
+
}
|
|
1635
|
+
|
|
1636
|
+
.dpk-sidebar-strip {
|
|
1637
|
+
display: flex;
|
|
1638
|
+
flex: none;
|
|
1639
|
+
justify-content: center;
|
|
1640
|
+
width: 36px;
|
|
1641
|
+
padding-top: 14px;
|
|
1642
|
+
border-right: 1px solid var(--dpk-rule);
|
|
1643
|
+
background: var(--dpk-paper-sunken);
|
|
1644
|
+
}
|
|
1645
|
+
|
|
1646
|
+
.dpk-sidebar-strip .dpk-sidebar-toggle {
|
|
1647
|
+
margin: 0;
|
|
1648
|
+
}
|
|
1649
|
+
|
|
1650
|
+
/*
|
|
1651
|
+
* The sidebar's resizable edge: a hit area straddling its border that takes
|
|
1652
|
+
* no room of its own, with an accent line while hovered, focused or dragged.
|
|
1653
|
+
*/
|
|
1654
|
+
.dpk-sidebar-resizer {
|
|
1655
|
+
position: relative;
|
|
1656
|
+
z-index: 6;
|
|
1657
|
+
flex: none;
|
|
1658
|
+
width: 9px;
|
|
1659
|
+
/* Centred on the sidebar's border, whichever side that is. */
|
|
1660
|
+
margin: 0 -5px 0 -4px;
|
|
1661
|
+
cursor: col-resize;
|
|
1662
|
+
touch-action: none;
|
|
1663
|
+
}
|
|
1664
|
+
|
|
1665
|
+
.dpk-sidebar-resizer::after {
|
|
1666
|
+
content: '';
|
|
1667
|
+
position: absolute;
|
|
1668
|
+
top: 0;
|
|
1669
|
+
bottom: 0;
|
|
1670
|
+
left: 3px;
|
|
1671
|
+
width: 2px;
|
|
1672
|
+
border-radius: 1px;
|
|
1673
|
+
background: var(--dpk-accent);
|
|
1674
|
+
opacity: 0;
|
|
1675
|
+
transition: opacity 160ms var(--dpk-ease);
|
|
1676
|
+
}
|
|
1677
|
+
|
|
1678
|
+
.dpk-sidebar-resizer:hover::after,
|
|
1679
|
+
.dpk-sidebar-resizer:focus-visible::after,
|
|
1680
|
+
.dpk-shell[data-resizing] .dpk-sidebar-resizer::after {
|
|
1681
|
+
opacity: 1;
|
|
1682
|
+
}
|
|
1683
|
+
|
|
1684
|
+
.dpk-sidebar-resizer:focus-visible {
|
|
1685
|
+
outline: none;
|
|
1686
|
+
}
|
|
1687
|
+
|
|
1688
|
+
/* While dragging, the cursor stays put and nothing underneath (text, preview frames) reacts. */
|
|
1689
|
+
.dpk-shell[data-resizing] {
|
|
1690
|
+
cursor: col-resize;
|
|
1691
|
+
user-select: none;
|
|
1692
|
+
}
|
|
1693
|
+
|
|
1694
|
+
.dpk-shell[data-resizing] .dpk-main {
|
|
1695
|
+
pointer-events: none;
|
|
1696
|
+
}
|
|
1697
|
+
|
|
1698
|
+
.dpk-main {
|
|
1699
|
+
flex: 1 1 0%;
|
|
1700
|
+
display: flex;
|
|
1701
|
+
flex-direction: column;
|
|
1702
|
+
min-width: 0;
|
|
1703
|
+
overflow: auto;
|
|
1704
|
+
/* A faint wash of the accent from the top left corner gives the ground some depth. */
|
|
1705
|
+
background:
|
|
1706
|
+
radial-gradient(
|
|
1707
|
+
ellipse 900px 360px at 0% 0%,
|
|
1708
|
+
color-mix(in srgb, var(--dpk-accent) 5%, transparent),
|
|
1709
|
+
transparent 70%
|
|
1710
|
+
),
|
|
1711
|
+
radial-gradient(
|
|
1712
|
+
ellipse 700px 320px at 100% 0%,
|
|
1713
|
+
color-mix(in srgb, var(--dpk-blue) 4%, transparent),
|
|
1714
|
+
transparent 70%
|
|
1715
|
+
),
|
|
1716
|
+
var(--dpk-paper);
|
|
1717
|
+
background-attachment: local;
|
|
1718
|
+
}
|
|
1719
|
+
|
|
1720
|
+
.dpk-main-body {
|
|
1721
|
+
flex: 1 0 auto;
|
|
1722
|
+
display: grid;
|
|
1723
|
+
align-content: start;
|
|
1724
|
+
gap: 16px;
|
|
1725
|
+
min-width: 0;
|
|
1726
|
+
padding: 24px;
|
|
1727
|
+
animation: dpk-rise 420ms var(--dpk-ease) backwards;
|
|
1728
|
+
}
|
|
1729
|
+
|
|
1730
|
+
@keyframes dpk-rise {
|
|
1731
|
+
from {
|
|
1732
|
+
opacity: 0;
|
|
1733
|
+
transform: translateY(6px);
|
|
1734
|
+
}
|
|
1735
|
+
}
|
|
1736
|
+
|
|
1737
|
+
/*
|
|
1738
|
+
* Author memo. It sits at the end of the main column and sticks to the
|
|
1739
|
+
* bottom of the scrollport: always visible, floating over whatever scrolls
|
|
1740
|
+
* behind it, and never stealing height from the preview.
|
|
1741
|
+
*/
|
|
1742
|
+
.dpk-memo {
|
|
1743
|
+
position: sticky;
|
|
1744
|
+
bottom: 0;
|
|
1745
|
+
z-index: 5;
|
|
1746
|
+
/* Clear of the hand-off dock at the bottom right while it is shown. */
|
|
1747
|
+
padding: 0 calc(20px + var(--dpk-dock-space, 0px)) 20px 20px;
|
|
1748
|
+
pointer-events: none;
|
|
1749
|
+
}
|
|
1750
|
+
|
|
1751
|
+
.dpk-memo[hidden] {
|
|
1752
|
+
display: none;
|
|
1753
|
+
}
|
|
1754
|
+
|
|
1755
|
+
.dpk-memo ::slotted(*) {
|
|
1756
|
+
display: block;
|
|
1757
|
+
max-width: 100%;
|
|
1758
|
+
padding: 12px 16px;
|
|
1759
|
+
/* A faint amber wash over the whole note marks it as the author's aside. */
|
|
1760
|
+
border: 1px solid color-mix(in srgb, var(--dpk-amber) 28%, var(--dpk-rule-strong));
|
|
1761
|
+
border-radius: var(--dpk-radius-lg);
|
|
1762
|
+
background: color-mix(in srgb, color-mix(in srgb, var(--dpk-amber) 7%, var(--dpk-paper-raised)) 90%, transparent);
|
|
1763
|
+
backdrop-filter: blur(12px);
|
|
1764
|
+
box-shadow: var(--dpk-bevel), var(--dpk-shadow-lg);
|
|
1765
|
+
font-size: 12.5px;
|
|
1766
|
+
line-height: 1.7;
|
|
1767
|
+
color: var(--dpk-ink-soft);
|
|
1768
|
+
pointer-events: auto;
|
|
1769
|
+
}
|
|
1770
|
+
|
|
1771
|
+
.dpk-orphans {
|
|
1772
|
+
margin-top: 16px;
|
|
1773
|
+
border: 1px dashed var(--dpk-rule-strong);
|
|
1774
|
+
border-radius: var(--dpk-radius);
|
|
1775
|
+
padding: 12px;
|
|
1776
|
+
}
|
|
1777
|
+
|
|
1778
|
+
.dpk-banner {
|
|
1779
|
+
display: grid;
|
|
1780
|
+
gap: 4px;
|
|
1781
|
+
margin-bottom: 14px;
|
|
1782
|
+
border: 1px solid color-mix(in srgb, var(--dpk-danger) 35%, transparent);
|
|
1783
|
+
border-radius: var(--dpk-radius);
|
|
1784
|
+
background: linear-gradient(90deg, var(--dpk-danger) 0 3px, transparent 3px), var(--dpk-danger-soft);
|
|
1785
|
+
padding: 12px 14px 12px 17px;
|
|
1786
|
+
max-width: 900px;
|
|
1787
|
+
}
|
|
1788
|
+
|
|
1789
|
+
.dpk-banner strong {
|
|
1790
|
+
font-size: 13px;
|
|
1791
|
+
color: var(--dpk-danger);
|
|
1792
|
+
}
|
|
1793
|
+
|
|
1794
|
+
.dpk-banner code {
|
|
1795
|
+
font-family: var(--dpk-mono);
|
|
1796
|
+
font-size: 11px;
|
|
1797
|
+
color: var(--dpk-ink-soft);
|
|
1798
|
+
overflow-wrap: anywhere;
|
|
1799
|
+
}
|
|
1800
|
+
|
|
1801
|
+
.dpk-notes {
|
|
1802
|
+
flex: 0 0 auto;
|
|
1803
|
+
width: 360px;
|
|
1804
|
+
border-left: 1px solid var(--dpk-rule);
|
|
1805
|
+
background: var(--dpk-paper-raised);
|
|
1806
|
+
box-shadow: -12px 0 32px -24px var(--dpk-shade-3);
|
|
1807
|
+
overflow: hidden;
|
|
1808
|
+
display: flex;
|
|
1809
|
+
animation: dpk-slide-in 260ms var(--dpk-ease) backwards;
|
|
1810
|
+
}
|
|
1811
|
+
|
|
1812
|
+
@keyframes dpk-slide-in {
|
|
1813
|
+
from {
|
|
1814
|
+
opacity: 0;
|
|
1815
|
+
transform: translateX(16px);
|
|
1816
|
+
}
|
|
1817
|
+
}
|
|
1818
|
+
|
|
1819
|
+
.dpk-notes[hidden] {
|
|
1820
|
+
display: none;
|
|
1821
|
+
}
|
|
1822
|
+
|
|
1823
|
+
/* ------------------------------------------------------------- footer */
|
|
1824
|
+
|
|
1825
|
+
.dpk-footer {
|
|
1826
|
+
border-top: 1px solid var(--dpk-rule);
|
|
1827
|
+
padding: 10px 20px;
|
|
1828
|
+
display: flex;
|
|
1829
|
+
gap: 12px;
|
|
1830
|
+
align-items: center;
|
|
1831
|
+
background: var(--dpk-glass);
|
|
1832
|
+
backdrop-filter: blur(12px);
|
|
1833
|
+
font-size: 12px;
|
|
1834
|
+
color: var(--dpk-ink-faint);
|
|
1835
|
+
}
|
|
1836
|
+
|
|
1837
|
+
/* --------------------------------------------------- floating review */
|
|
1838
|
+
|
|
1839
|
+
/* Review toggle: pinned to the top right corner, always in the same place. */
|
|
1840
|
+
.dpk-fab {
|
|
1841
|
+
position: fixed;
|
|
1842
|
+
top: 12px;
|
|
1843
|
+
right: 16px;
|
|
1844
|
+
z-index: 60;
|
|
1845
|
+
display: inline-flex;
|
|
1846
|
+
align-items: center;
|
|
1847
|
+
justify-content: center;
|
|
1848
|
+
width: 36px;
|
|
1849
|
+
height: 36px;
|
|
1850
|
+
padding: 0;
|
|
1851
|
+
border: 1px solid var(--dpk-rule-strong);
|
|
1852
|
+
border-radius: 11px;
|
|
1853
|
+
background: var(--dpk-paper-raised);
|
|
1854
|
+
color: var(--dpk-ink-soft);
|
|
1855
|
+
box-shadow: var(--dpk-bevel), var(--dpk-shadow-sm);
|
|
1856
|
+
cursor: pointer;
|
|
1857
|
+
transition:
|
|
1858
|
+
color 180ms var(--dpk-ease),
|
|
1859
|
+
background 180ms var(--dpk-ease),
|
|
1860
|
+
border-color 180ms var(--dpk-ease),
|
|
1861
|
+
box-shadow 180ms var(--dpk-ease),
|
|
1862
|
+
transform 220ms var(--dpk-ease-spring);
|
|
1863
|
+
}
|
|
1864
|
+
|
|
1865
|
+
.dpk-fab:hover {
|
|
1866
|
+
color: var(--dpk-ink);
|
|
1867
|
+
border-color: var(--dpk-rule-hover);
|
|
1868
|
+
transform: translateY(-1px);
|
|
1869
|
+
box-shadow: var(--dpk-bevel), var(--dpk-shadow);
|
|
1870
|
+
}
|
|
1871
|
+
|
|
1872
|
+
.dpk-fab:active {
|
|
1873
|
+
transform: translateY(0) scale(0.95);
|
|
1874
|
+
box-shadow: var(--dpk-shadow-xs);
|
|
1875
|
+
}
|
|
1876
|
+
|
|
1877
|
+
.dpk-fab:focus-visible {
|
|
1878
|
+
outline: none;
|
|
1879
|
+
box-shadow: var(--dpk-focus);
|
|
1880
|
+
}
|
|
1881
|
+
|
|
1882
|
+
.dpk-fab[aria-expanded='true'] {
|
|
1883
|
+
color: var(--dpk-accent-ink);
|
|
1884
|
+
border-color: color-mix(in srgb, var(--dpk-accent-strong) 70%, transparent);
|
|
1885
|
+
background: linear-gradient(145deg, var(--dpk-accent-bright), var(--dpk-accent-strong));
|
|
1886
|
+
box-shadow:
|
|
1887
|
+
inset 0 1px 0 rgba(255, 255, 255, 0.25),
|
|
1888
|
+
0 6px 16px -6px color-mix(in srgb, var(--dpk-accent) 70%, transparent);
|
|
1889
|
+
}
|
|
1890
|
+
|
|
1891
|
+
.dpk-fab[aria-expanded='true']:hover {
|
|
1892
|
+
box-shadow:
|
|
1893
|
+
inset 0 1px 0 rgba(255, 255, 255, 0.25),
|
|
1894
|
+
0 10px 22px -8px color-mix(in srgb, var(--dpk-accent) 80%, transparent);
|
|
1895
|
+
}
|
|
1896
|
+
|
|
1897
|
+
.dpk-fab-icon {
|
|
1898
|
+
position: relative;
|
|
1899
|
+
display: block;
|
|
1900
|
+
width: 16px;
|
|
1901
|
+
height: 12px;
|
|
1902
|
+
border: 1.6px solid currentColor;
|
|
1903
|
+
border-radius: 4px;
|
|
1904
|
+
}
|
|
1905
|
+
|
|
1906
|
+
.dpk-fab-icon::after {
|
|
1907
|
+
content: '';
|
|
1908
|
+
position: absolute;
|
|
1909
|
+
left: 2px;
|
|
1910
|
+
bottom: -4px;
|
|
1911
|
+
border-left: 3.5px solid transparent;
|
|
1912
|
+
border-right: 3.5px solid transparent;
|
|
1913
|
+
border-top: 4px solid currentColor;
|
|
1914
|
+
}
|
|
1915
|
+
|
|
1916
|
+
.dpk-fab-badge {
|
|
1917
|
+
position: absolute;
|
|
1918
|
+
top: -6px;
|
|
1919
|
+
right: -6px;
|
|
1920
|
+
min-width: 18px;
|
|
1921
|
+
height: 18px;
|
|
1922
|
+
padding: 0 4px;
|
|
1923
|
+
border: 2px solid var(--dpk-paper);
|
|
1924
|
+
border-radius: 999px;
|
|
1925
|
+
background: linear-gradient(145deg, var(--dpk-accent-bright), var(--dpk-accent));
|
|
1926
|
+
color: var(--dpk-accent-ink);
|
|
1927
|
+
font-family: var(--dpk-mono);
|
|
1928
|
+
font-size: 9.5px;
|
|
1929
|
+
font-weight: 650;
|
|
1930
|
+
font-variant-numeric: tabular-nums;
|
|
1931
|
+
line-height: 14px;
|
|
1932
|
+
text-align: center;
|
|
1933
|
+
box-shadow: 0 3px 8px -2px color-mix(in srgb, var(--dpk-accent) 60%, transparent);
|
|
1934
|
+
animation: dpk-pop 260ms var(--dpk-ease-spring);
|
|
1935
|
+
}
|
|
1936
|
+
|
|
1937
|
+
@keyframes dpk-pop {
|
|
1938
|
+
from {
|
|
1939
|
+
transform: scale(0.4);
|
|
1940
|
+
opacity: 0;
|
|
1941
|
+
}
|
|
1942
|
+
}
|
|
1943
|
+
|
|
1944
|
+
/* ------------------------------------------------------ hand-off dock */
|
|
1945
|
+
|
|
1946
|
+
.dpk-dock {
|
|
1947
|
+
position: fixed;
|
|
1948
|
+
right: 16px;
|
|
1949
|
+
bottom: 16px;
|
|
1950
|
+
z-index: 60;
|
|
1951
|
+
display: flex;
|
|
1952
|
+
flex-direction: column;
|
|
1953
|
+
align-items: flex-end;
|
|
1954
|
+
gap: 8px;
|
|
1955
|
+
max-width: calc(100vw - 32px);
|
|
1956
|
+
animation: dpk-dock-in 260ms var(--dpk-ease) backwards;
|
|
1957
|
+
}
|
|
1958
|
+
|
|
1959
|
+
@keyframes dpk-dock-in {
|
|
1960
|
+
from {
|
|
1961
|
+
transform: translateY(8px);
|
|
1962
|
+
opacity: 0;
|
|
1963
|
+
}
|
|
1964
|
+
}
|
|
1965
|
+
|
|
1966
|
+
.dpk-dock-actions {
|
|
1967
|
+
display: flex;
|
|
1968
|
+
gap: 6px;
|
|
1969
|
+
padding: 6px;
|
|
1970
|
+
border: 1px solid var(--dpk-rule-strong);
|
|
1971
|
+
border-radius: var(--dpk-radius-lg);
|
|
1972
|
+
background: var(--dpk-glass);
|
|
1973
|
+
backdrop-filter: blur(12px);
|
|
1974
|
+
box-shadow: var(--dpk-bevel), var(--dpk-shadow-lg);
|
|
1975
|
+
}
|
|
1976
|
+
|
|
1977
|
+
.dpk-dock-note {
|
|
1978
|
+
max-width: 320px;
|
|
1979
|
+
margin: 0;
|
|
1980
|
+
padding: 8px 12px;
|
|
1981
|
+
border: 1px solid var(--dpk-rule-strong);
|
|
1982
|
+
border-radius: var(--dpk-radius);
|
|
1983
|
+
background: var(--dpk-paper-raised);
|
|
1984
|
+
box-shadow: var(--dpk-shadow);
|
|
1985
|
+
color: var(--dpk-ink-soft);
|
|
1986
|
+
font-size: 12px;
|
|
1987
|
+
line-height: 1.6;
|
|
1988
|
+
}
|
|
1989
|
+
|
|
1990
|
+
@media (max-width: 720px) {
|
|
1991
|
+
/* The version select stays: it is the reader's only way to switch versions. */
|
|
1992
|
+
.dpk-header-meta > :not(.dpk-version) {
|
|
1993
|
+
display: none;
|
|
1994
|
+
}
|
|
1995
|
+
|
|
1996
|
+
/* The title takes the first row whole; the version select and tools wrap below it. */
|
|
1997
|
+
.dpk-header {
|
|
1998
|
+
flex-wrap: wrap;
|
|
1999
|
+
row-gap: 8px;
|
|
2000
|
+
}
|
|
2001
|
+
|
|
2002
|
+
.dpk-title {
|
|
2003
|
+
flex: 1 0 100%;
|
|
2004
|
+
}
|
|
2005
|
+
|
|
2006
|
+
.dpk-brand {
|
|
2007
|
+
display: none;
|
|
2008
|
+
}
|
|
2009
|
+
}
|
|
2010
|
+
`];class Io{#e;#i;#s;#n=null;#t=!1;constructor(e,s={}){this.#e=e,this.#i=s.fetchVersions??Bs,this.#s=s.switchTo??Hs,e.addController(this)}hostConnected(){}load(){this.#t||this.#n!==null||(this.#t=!0,this.#i().then(e=>{this.#n=e,this.#t=!1,this.#e.requestUpdate()},e=>{this.#t=!1,console.warn("dev-process-kit: could not list the published versions",e)}))}pick(e){e!==M&&this.#s(e===""?null:e)}render(e){const s=j(e),n=Ds({current:M,requested:gt(location.search)!==null,published:this.#n,text:{pinned:s.versionPinned,latest:s.versionLatest}}),r=()=>this.load();return f`<span class="dpk-version"
|
|
2011
|
+
>dev-process-kit@<select
|
|
2012
|
+
class="dpk-version-select"
|
|
2013
|
+
aria-label=${s.versionLabel}
|
|
2014
|
+
title=${s.versionLabel}
|
|
2015
|
+
@pointerenter=${r}
|
|
2016
|
+
@focus=${r}
|
|
2017
|
+
@change=${bt(i=>this.pick(i))}
|
|
2018
|
+
>
|
|
2019
|
+
${n.options.map(i=>f`<option value=${i.value} ?selected=${i.value===n.value}>${i.label}</option>`)}
|
|
2020
|
+
</select></span
|
|
2021
|
+
>`}}class qo extends R{static{this.styles=No}static{this.properties={storageKey:{type:String,attribute:"storage-key"},storage:{type:String},notes:{type:String},theme:{type:String},notesOpen:{state:!0}}}#e=!1;#i=new Eo(this);#s=new vo(this,()=>this.storage!=="off"&&this.storage!=="memory");#n=new bo(this);#t=new Ao(this);#r=new zo(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",template:()=>this.definition.name,layout:()=>this.sidebarLayout});#o=new Ro(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",template:()=>this.definition.name});#a=!1;#d=new Io(this);#u=new Co(this,()=>this.storage!=="off"&&this.storage!=="memory",()=>this.#l?.setTemplate(this.definition));#b;#l;#c=ot;#h=null;#x=new Set;#p=null;#f;#m;#k;#v=[];#C;#I=new Promise(e=>{this.#C=e});#S;get locale(){return this.#u.locale}get definition(){const e=this.locale;return this.#b?.locale!==e&&(this.#b={locale:e,value:this.definitionFor(e)}),this.#b.value}connectedCallback(){super.connectedCallback(),this.dataset.template=this.definition.name,this.#e||(this.#e=!0,this.notesOpen=this.notes==="on"||this.notes==="open"),this.#E(),window.addEventListener("hashchange",this.#L),this.addEventListener("click",this.#N),this.addEventListener("dpk-comment-targets-change",this.#g),this.addEventListener("dpk-comment-request",this.#R),this.addEventListener("dpk-comment-submit",this.#P),this.addEventListener("dpk-element-action",this.#z),this.#k??=new MutationObserver(this.#g),this.#g()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("hashchange",this.#L),this.removeEventListener("click",this.#N),this.#m?.disconnect(),this.#k?.disconnect(),this.removeEventListener("dpk-comment-targets-change",this.#g),this.removeEventListener("dpk-comment-request",this.#R),this.removeEventListener("dpk-comment-submit",this.#P),this.removeEventListener("dpk-element-action",this.#z)}#E(e=0){if(this.#l){this.#_();return}if(this.childNodes.length===0&&e<2){queueMicrotask(()=>this.#E(e+1));return}this.#K()}#_(){this.#f||(this.#f=this.#l?.subscribe(()=>this.#Y()))}willUpdate(){this.dataset.theme=this.#s.resolve(pe(this.theme))}updated(){this.#Z(),this.#G(),this.#a&&(this.#a=!1,this.renderRoot.querySelector(".dpk-sidebar-toggle")?.focus())}get api(){return this.#S??=this.#F(),this.#S}get controller(){if(!this.#l)throw new Error(`<${this.tagName.toLowerCase()}> is not initialized yet`);return this.#l}get derivation(){return this.controller.derivation}get navigation(){return this.#c}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.#y()),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.#y()),s}editComment(e,s){const n=this.controller.editComment(e,s);return n.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:n.issues},bubbles:!0,composed:!0})),this.#y()),n}removeAction(e){this.controller.removeAction(e)}clearActions(){this.controller.clearActions()}navigate(e,s={}){const n=Q(this.#w());this.#c=dt(this.#c,e,this.definition.navigationHierarchy),this.#$(s.replace??!1);const r=Q(this.#w());this.requestUpdate(),n!==r&&(this.#y(),this.dispatchEvent(new CustomEvent("dpk-navigate",{detail:{navigation:this.#c},bubbles:!0,composed:!0})))}hashFor(e){const s=this.#w();return Q(this.definition.resolveNavigation(this.derivation.state,dt(s,e,this.definition.navigationHierarchy)))}requestComment(e){this.#h=typeof e=="string"?e:_(e),this.notesOpen=!0,this.requestUpdate()}get integratedReview(){return!1}get canSendToClaude(){return this.#n.available}sendToClaude(){return this.#n.send({brief:this.api.exportBrief(),draft:st(this.derivation.actions),anchor:this})}renderReviewPanel(e){return f`<dpk-component-comment-panel
|
|
2022
|
+
.definition=${this.controller.definition}
|
|
2023
|
+
.state=${e.state}
|
|
2024
|
+
.navigation=${e.navigation}
|
|
2025
|
+
.derivation=${this.derivation}
|
|
2026
|
+
.issues=${this.controller.lastIssues}
|
|
2027
|
+
.exportBrief=${()=>this.api.exportBrief()}
|
|
2028
|
+
.sendToClaude=${this.canSendToClaude?()=>this.sendToClaude():void 0}
|
|
2029
|
+
.pendingTarget=${this.#h}
|
|
2030
|
+
.embedded=${this.integratedReview}
|
|
2031
|
+
.onDelete=${s=>this.removeAction(s)}
|
|
2032
|
+
.onEditComment=${(s,n)=>this.editComment(s,n)}
|
|
2033
|
+
.onClear=${()=>this.clearActions()}
|
|
2034
|
+
.onComment=${(s,n)=>{const r=this.dispatch({type:E,target:s,payload:{body:n}});return r.ok&&(this.#h=null),r}}
|
|
2035
|
+
></dpk-component-comment-panel>`}renderChrome(e,s){const n=e.actions.length,r=e.comments.length,i=j(this.locale),o=s.sidebarHidden===!0||!s.sidebar&&!this.hasSidebarContent(),d=this.sidebarLayout.side,a=!o&&this.#T&&this.#o.collapsed,l=o?g:this.#B(a);return f`
|
|
2036
|
+
<div class="dpk-shell" ?data-resizing=${this.#r.dragging}>
|
|
2037
|
+
<header class="dpk-header">
|
|
2038
|
+
<span class="dpk-brand" aria-hidden="true"></span>
|
|
2039
|
+
<div class="dpk-title">
|
|
2040
|
+
<span class="dpk-template-mark">${this.definition.label}</span>
|
|
2041
|
+
<h1>${this.definition.title(e.state)}</h1>
|
|
2042
|
+
</div>
|
|
2043
|
+
<div class="dpk-header-slot">
|
|
2044
|
+
${s.header??g}
|
|
2045
|
+
<slot name="header"></slot>
|
|
2046
|
+
</div>
|
|
2047
|
+
<div class="dpk-header-meta">
|
|
2048
|
+
${this.#d.render(this.locale)}
|
|
2049
|
+
<span>${this.definition.name}</span>
|
|
2050
|
+
<span class="dpk-meta-count" data-active=${n>0?"true":"false"}>
|
|
2051
|
+
${n} draft · ${r} note
|
|
2052
|
+
</span>
|
|
2053
|
+
</div>
|
|
2054
|
+
<div class="dpk-header-tools">${this.#U()} ${this.#D()}</div>
|
|
2055
|
+
</header>
|
|
2056
|
+
<div class="dpk-body" data-sidebar-side=${d}>
|
|
2057
|
+
${d==="right"?l:g}
|
|
2058
|
+
<aside
|
|
2059
|
+
id="dpk-sidebar"
|
|
2060
|
+
class="dpk-sidebar"
|
|
2061
|
+
?hidden=${o||a}
|
|
2062
|
+
style=${`--dpk-sidebar-width: ${this.#r.width}px`}
|
|
2063
|
+
>
|
|
2064
|
+
${s.sidebar??g}
|
|
2065
|
+
<slot name="sidebar"></slot>
|
|
2066
|
+
</aside>
|
|
2067
|
+
${d==="left"?l:g}
|
|
2068
|
+
<main class="dpk-main">
|
|
2069
|
+
<div class="dpk-main-body">
|
|
2070
|
+
${this.#p?f`<div class="dpk-banner" role="alert">
|
|
2071
|
+
<strong>${i.baseDataError}</strong>
|
|
2072
|
+
<code>${this.#p}</code>
|
|
2073
|
+
</div>`:g}
|
|
2074
|
+
${s.main??g}
|
|
2075
|
+
<slot name="main"></slot>
|
|
2076
|
+
<section class="dpk-orphans" ?hidden=${this.#i.orphans===0}>
|
|
2077
|
+
<p class="dpk-label">previews without metadata</p>
|
|
2078
|
+
<slot name="preview"></slot>
|
|
2079
|
+
</section>
|
|
2080
|
+
</div>
|
|
2081
|
+
<div class="dpk-memo" ?hidden=${!this.hasMemoContent()}>
|
|
2082
|
+
<slot name="memo"></slot>
|
|
2083
|
+
</div>
|
|
2084
|
+
</main>
|
|
2085
|
+
${this.integratedReview?g:f`<aside class="dpk-notes" ?hidden=${!this.notesOpen}>${this.renderReviewPanel(e)}</aside>`}
|
|
2086
|
+
</div>
|
|
2087
|
+
${s.footer||this.hasFooterContent()?f`<footer class="dpk-footer">
|
|
2088
|
+
${s.footer??g}
|
|
2089
|
+
<slot name="footer"></slot>
|
|
2090
|
+
</footer>`:g}
|
|
2091
|
+
${this.integratedReview?g:f`<button
|
|
2092
|
+
class="dpk-fab"
|
|
2093
|
+
type="button"
|
|
2094
|
+
aria-expanded=${this.notesOpen?"true":"false"}
|
|
2095
|
+
title=${i.reviewToggle}
|
|
2096
|
+
@click=${()=>{this.notesOpen=!this.notesOpen}}
|
|
2097
|
+
>
|
|
2098
|
+
<span class="dpk-fab-icon" aria-hidden="true"></span>
|
|
2099
|
+
<span
|
|
2100
|
+
class="dpk-label"
|
|
2101
|
+
style="position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)"
|
|
2102
|
+
>
|
|
2103
|
+
${i.review}
|
|
2104
|
+
</span>
|
|
2105
|
+
${n>0?f`<span class="dpk-fab-badge">${n}</span>`:g}
|
|
2106
|
+
</button>`}
|
|
2107
|
+
${this.integratedReview?g:this.#q(n)}
|
|
2108
|
+
</div>
|
|
2109
|
+
`}#q(e){const s=ao({actions:e,railOpen:this.notesOpen,sendable:this.canSendToClaude,locale:this.locale},this.#t.state);if(!s)return g;const n=j(this.locale);return f`<div class="dpk-dock" role="group" aria-label=${n.handoffLabel}>
|
|
2110
|
+
${s.note?f`<p class="dpk-dock-note" role="alert">${s.note}</p>`:g}
|
|
2111
|
+
<div class="dpk-dock-actions">
|
|
2112
|
+
${s.send?f`<button
|
|
2113
|
+
class="dpk-btn dpk-btn--accent"
|
|
2114
|
+
type="button"
|
|
2115
|
+
?disabled=${s.send.disabled}
|
|
2116
|
+
@click=${()=>{this.#t.send(()=>this.sendToClaude())}}
|
|
2117
|
+
>
|
|
2118
|
+
${s.send.label}
|
|
2119
|
+
</button>`:g}
|
|
2120
|
+
<button
|
|
2121
|
+
class=${s.send?"dpk-btn":"dpk-btn dpk-btn--accent"}
|
|
2122
|
+
type="button"
|
|
2123
|
+
data-status=${s.copy.status}
|
|
2124
|
+
title=${n.handoffCopyTitle}
|
|
2125
|
+
@click=${()=>{this.#t.copy(()=>this.api.exportBrief())}}
|
|
2126
|
+
>
|
|
2127
|
+
${s.copy.label}
|
|
2128
|
+
</button>
|
|
2129
|
+
</div>
|
|
2130
|
+
</div>`}#U(){const e=this.locale,s=j(e).language;return f`<select
|
|
2131
|
+
class="dpk-lang-select"
|
|
2132
|
+
aria-label=${s}
|
|
2133
|
+
title=${s}
|
|
2134
|
+
@change=${bt(n=>{const r=He.find(i=>i===n);r!==void 0&&this.#u.pick(r)})}
|
|
2135
|
+
>
|
|
2136
|
+
${He.map(n=>f`<option value=${n} lang=${n} ?selected=${n===e}>
|
|
2137
|
+
${Pr[n]}
|
|
2138
|
+
</option>`)}
|
|
2139
|
+
</select>`}#D(){const e=this.dataset.theme==="dark",s=j(this.locale),n=e?s.useLightTheme:s.useDarkTheme;return f`<button
|
|
2140
|
+
class="dpk-theme-toggle"
|
|
2141
|
+
type="button"
|
|
2142
|
+
aria-label=${n}
|
|
2143
|
+
title=${n}
|
|
2144
|
+
@click=${()=>this.#s.toggle(pe(this.theme))}
|
|
2145
|
+
>
|
|
2146
|
+
${e?Qr():ei()}
|
|
2147
|
+
</button>`}get#T(){return this.sidebarLayout.collapsible!==!1}#B(e){const s=this.#T?this.#H(e):g;return e?f`<div class="dpk-sidebar-strip">${s}</div>`:this.sidebarLayout.side==="left"?f`${this.#O()}${s}`:f`${s}${this.#O()}`}#H(e){const s=j(this.locale),n=jo(this.sidebarLayout.side,e),r=n.action==="collapse"?s.collapseSidebar:s.expandSidebar;return f`<button
|
|
2148
|
+
class="dpk-sidebar-toggle"
|
|
2149
|
+
type="button"
|
|
2150
|
+
aria-controls="dpk-sidebar"
|
|
2151
|
+
aria-expanded=${e?"false":"true"}
|
|
2152
|
+
aria-label=${r}
|
|
2153
|
+
title=${r}
|
|
2154
|
+
@click=${()=>{this.#a=!0,this.#o.toggle()}}
|
|
2155
|
+
>
|
|
2156
|
+
${n.points==="left"?Ps():zs()}
|
|
2157
|
+
</button>`}#O(){const e=j(this.locale),s=this.#r.handlers;return f`<div
|
|
2158
|
+
class="dpk-sidebar-resizer"
|
|
2159
|
+
role="separator"
|
|
2160
|
+
tabindex="0"
|
|
2161
|
+
aria-orientation="vertical"
|
|
2162
|
+
aria-label=${e.resizeSidebar}
|
|
2163
|
+
aria-valuemin=${N.min}
|
|
2164
|
+
aria-valuemax=${N.max}
|
|
2165
|
+
aria-valuenow=${this.#r.width}
|
|
2166
|
+
title=${e.resizeSidebarHint}
|
|
2167
|
+
@pointerdown=${s.pointerdown}
|
|
2168
|
+
@pointermove=${s.pointermove}
|
|
2169
|
+
@pointerup=${s.pointerup}
|
|
2170
|
+
@pointercancel=${s.pointercancel}
|
|
2171
|
+
@keydown=${s.keydown}
|
|
2172
|
+
@dblclick=${s.dblclick}
|
|
2173
|
+
></div>`}render(){if(!this.#l)return g;const e=this.#j();return this.renderChrome(e,this.renderRegions(e))}get sidebarLayout(){return _o}hasSidebarContent(){return this.querySelector('[slot="sidebar"]')!==null}hasMemoContent(){return this.querySelector('[slot="memo"]')!==null}hasFooterContent(){return this.querySelector('[slot="footer"]')!==null}context(){return this.#j()}#A(){return{definition:this.definition,controller:()=>this.controller,derivation:()=>this.derivation,ready:this.#I,navigation:()=>this.#w(),issues:()=>this.controller.lastIssues,dispatch:e=>this.dispatch(e),dispatchBatch:e=>this.dispatchBatch(e),subscribe:e=>(this.#x.add(e),()=>{this.#x.delete(e)}),editComment:(e,s)=>this.editComment(e,s),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)}}#F(){return co(this.#A(),this)}#M(){return hn(this.#A())}#j(){return lo(this.#A())}#w(){return this.definition.resolveNavigation(this.derivation.state,this.#c)}#K(){const e=this.#W();this.#c=yn();const s=this.storageKey;this.#l=new ln({definition:this.definition,base:e,storage:this.#V(),...typeof s=="string"?{storageKey:s}:{}}),this.#_(),this.#g(),this.#$(!0),this.#C?.(),this.#J(),this.requestUpdate()}#V(){return this.storage==="off"?null:this.storage==="memory"?new xt:wt()}#W(){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.#p='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.#p=s instanceof Error?s.message:String(s),this.definition.emptyBase()}}#J(){this.querySelector('script[type="application/json"]')||(this.#m=new MutationObserver(()=>{const e=this.querySelector('script[type="application/json"]');if(e){this.#m?.disconnect(),this.#m=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.#m.observe(this,{childList:!0,subtree:!0}))}#y(){const e=this.#M();for(const s of this.#x)s(e)}#Y(){if(!this.isConnected){this.requestUpdate(),this.#y();return}this.#$(!0),vn(this.#v,this.controller.actions),queueMicrotask(this.#g),this.requestUpdate(),this.#y(),this.dispatchEvent(new CustomEvent("dpk-change",{detail:this.#M(),bubbles:!0,composed:!0}))}#$(e){const s=this.#w();this.#c=s,So(s,e)}#L=()=>{this.#c=yn(),this.#$(!0),this.requestUpdate(),this.#y(),this.dispatchEvent(new CustomEvent("dpk-navigate",{detail:{navigation:this.#c},bubbles:!0,composed:!0}))};#g=()=>{this.#k?.disconnect(),this.#v=yo(this,e=>{this.isConnected&&this.#k?.observe(e,{childList:!0,subtree:!0})}),this.#l&&(vn(this.#v,this.#l.actions),this.#l.setComponentSnapshot(wo(this.#v)))};#R=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!this.#l)return;const s=e.detail;typeof s!="object"||s===null||!("target"in s)||typeof s.target!="string"||(this.#g(),!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(r=>r.value===s.target))||this.requestComment(s.target)};#P=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!e.cancelable||!this.#l)return;const s=y(Ai,e.detail);if(!s.success)return;this.#g();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()};#z=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!e.cancelable||!this.#l)return;const s=y(_r,e.detail);if(!s.success)return;this.#g();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()};#N=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(at(n.includes("=")?n:`step=${n}`));return}const r=s.getAttribute("data-dpk-comment");if(r!==null){e.preventDefault(),this.requestComment(r);return}}};#G(){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"))}#Z(){this.#i.route()}}export{ce as $,ft as A,Jr as B,E as C,Ns as D,ot as E,M as F,js as G,Rs as H,ut as I,Ls as J,Ms as K,nn as L,xt as M,at as N,fs as O,gr as P,dt as Q,mr as R,st as S,qo as T,gs as U,_ as V,yt as W,Se as X,Qe as Y,$e as Z,Is as _,nt as a,we as a0,Xn as a1,q as a2,g as a3,f as a4,Os as a5,Rn as a6,R as a7,Ke as a8,Zr as a9,ee as aA,yi as aB,bt as aC,xi as aD,Oe as aE,G as aF,pt as aG,ct as aH,ur as aI,pr as aJ,ss as aK,qe as aL,Ue as aM,De as aN,Ps as aO,Wr as aP,Vr as aQ,ns as aR,Xr as aa,Xe as ab,X as ac,de as ad,P as ae,m as af,Ce as ag,k as ah,v as ai,ps as aj,us as ak,z as al,Z as am,ds as an,Ze as ao,y as ap,w as aq,ls as ar,Ye as as,is as at,rs as au,cs as av,hr as aw,zs as ax,S as ay,fe as az,ts as b,ln as c,tt as d,br as e,lt as f,ks as g,le as h,tn as i,Ve as j,ms as k,xr as l,et as m,wt as n,dn as o,fr as p,ii as q,er as r,fi as s,sn as t,V as u,vr as v,Q as w,Gr as x,Yr as y,ht as z};
|