dev-process-kit 0.3.2 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/boards.js +1 -1
  2. package/dist/chunks/{shared-BPVvO01I.js → shared-B2S6Vsb5.js} +20 -20
  3. package/dist/chunks/{shared-DPD_tBh8.js → shared-BBKduY__.js} +1 -1
  4. package/dist/chunks/{shared-BblP0eEY.js → shared-BDAaq_FM.js} +1 -1
  5. package/dist/chunks/{shared-DlZJHHpN.js → shared-BWIla41c.js} +367 -317
  6. package/dist/chunks/{shared-Cbm3cQ8l.js → shared-Bj6Oqtla.js} +62 -62
  7. package/dist/chunks/shared-CBzul9Ae.js +1 -0
  8. package/dist/chunks/shared-CJZKj_HI.js +3 -0
  9. package/dist/chunks/{shared-bP-1q7ZQ.js → shared-CKIn5p8J.js} +11 -11
  10. package/dist/chunks/shared-CTxoriaS.js +1 -0
  11. package/dist/chunks/shared-Cd0_rxlc.js +1883 -0
  12. package/dist/chunks/{shared-BBTySCXK.js → shared-CkOyWfwZ.js} +13 -13
  13. package/dist/chunks/{shared-nrgnwzCU.js → shared-DF9b2Hdv.js} +2 -2
  14. package/dist/chunks/{shared-C5wXNKl3.js → shared-DRCtnrZO.js} +1 -1
  15. package/dist/chunks/{shared-Bu1HuBxn.js → shared-DZNeJT2R.js} +22 -22
  16. package/dist/chunks/{shared-7Yki1uKI.js → shared-DnSwEx91.js} +37 -37
  17. package/dist/chunks/{shared-C4EqS9Lp.js → shared-O0o2ls6e.js} +16 -16
  18. package/dist/chunks/{shared-bQPXht-t.js → shared-lPeFJij5.js} +2 -2
  19. package/dist/chunks/{shared-UH4xqvj9.js → shared-zNs0yAfd.js} +139 -135
  20. package/dist/components.js +1 -1
  21. package/dist/index.js +1 -1
  22. package/dist/sync.js +1 -0
  23. package/dist/views/delegation-poker.js +1 -1
  24. package/dist/views/plain.js +1 -1
  25. package/dist/views/prototype.js +1 -1
  26. package/dist/views/slides.js +1 -1
  27. package/dist/views/task-board.js +1 -1
  28. package/dist/views/usm.js +1 -1
  29. package/package.json +2 -1
  30. package/dist/chunks/shared-C44CU0VV.js +0 -1868
  31. package/dist/chunks/shared-hhwSHdS3.js +0 -1
  32. package/dist/chunks/shared-pYjptMZ1.js +0 -1
@@ -1,6 +1,6 @@
1
- const tr=[["path",{d:"M12 5v14"}],["path",{d:"m19 12-7 7-7-7"}]],Zd=[["path",{d:"M8 3 4 7l4 4"}],["path",{d:"M4 7h16"}],["path",{d:"m16 21 4-4-4-4"}],["path",{d:"M20 17H4"}]],nr=[["path",{d:"m12 19-7-7 7-7"}],["path",{d:"M19 12H5"}]],Qd=[["path",{d:"m16 3 4 4-4 4"}],["path",{d:"M20 7H4"}],["path",{d:"m8 21-4-4 4-4"}],["path",{d:"M4 17h16"}]],sr=[["path",{d:"M5 12h14"}],["path",{d:"m12 5 7 7-7 7"}]],Xd=[["path",{d:"M5 3h14"}],["path",{d:"m18 13-6-6-6 6"}],["path",{d:"M12 7v14"}]],ir=[["path",{d:"m5 12 7-7 7 7"}],["path",{d:"M12 19V5"}]],Jd=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326"}]],ec=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z"}],["path",{d:"m7 16.5-4.74-2.85"}],["path",{d:"m7 16.5 5-3"}],["path",{d:"M7 16.5v5.17"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z"}],["path",{d:"m17 16.5-5-3"}],["path",{d:"m17 16.5 4.74-2.85"}],["path",{d:"M17 16.5v5.17"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z"}],["path",{d:"M12 8 7.26 5.15"}],["path",{d:"m12 8 4.74-2.85"}],["path",{d:"M12 13.5V8"}]],tc=[["path",{d:"M20 6 9 17l-5-5"}]],rr=[["path",{d:"m6 9 6 6 6-6"}]],nc=[["path",{d:"m15 18-6-6 6-6"}]],sc=[["path",{d:"m9 18 6-6-6-6"}]],ic=[["circle",{cx:"12",cy:"12",r:"1"}],["circle",{cx:"12",cy:"12",r:"10"}]],or=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}],["path",{d:"M12 17h.01"}]],rc=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}]],oc=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5"}],["path",{d:"M3 12A9 3 0 0 0 21 12"}]],ac=[["path",{d:"M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z"}]],ar=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5"}],["path",{d:"M10 9H8"}],["path",{d:"M16 13H8"}],["path",{d:"M16 17H8"}]],lc=[["path",{d:"M15 6a9 9 0 0 0-9 9V3"}],["circle",{cx:"18",cy:"6",r:"3"}],["circle",{cx:"6",cy:"18",r:"3"}]],dc=[["circle",{cx:"12",cy:"18",r:"3"}],["circle",{cx:"6",cy:"6",r:"3"}],["circle",{cx:"18",cy:"6",r:"3"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9"}],["path",{d:"M12 12v3"}]],cc=[["circle",{cx:"12",cy:"9",r:"1"}],["circle",{cx:"19",cy:"9",r:"1"}],["circle",{cx:"5",cy:"9",r:"1"}],["circle",{cx:"12",cy:"15",r:"1"}],["circle",{cx:"19",cy:"15",r:"1"}],["circle",{cx:"5",cy:"15",r:"1"}]],pc=[["circle",{cx:"9",cy:"12",r:"1"}],["circle",{cx:"9",cy:"5",r:"1"}],["circle",{cx:"9",cy:"19",r:"1"}],["circle",{cx:"15",cy:"12",r:"1"}],["circle",{cx:"15",cy:"5",r:"1"}],["circle",{cx:"15",cy:"19",r:"1"}]],hc=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor"}]],lr=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1"}]],uc=[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1"}]],gc=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"}]],dr=[["path",{d:"M13 5h8"}],["path",{d:"M13 12h8"}],["path",{d:"M13 19h8"}],["path",{d:"m3 17 2 2 4-4"}],["path",{d:"m3 7 2 2 4-4"}]],fc=[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z"}],["path",{d:"M15 5.764v15"}],["path",{d:"M9 3.236v15"}]],mc=[["path",{d:"M15 3h6v6"}],["path",{d:"m21 3-7 7"}],["path",{d:"m3 21 7-7"}],["path",{d:"M9 21H3v-6"}]],kc=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z"}],["path",{d:"M7 11h10"}],["path",{d:"M7 15h6"}],["path",{d:"M7 7h8"}]],bc=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z"}]],vc=[["path",{d:"m14 10 7-7"}],["path",{d:"M20 10h-6V4"}],["path",{d:"m3 21 7-7"}],["path",{d:"M4 14h6v6"}]],xc=[["path",{d:"M5 12h14"}]],yc=[["path",{d:"M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8"}],["path",{d:"M10 19v-3.96 3.15"}],["path",{d:"M7 19h5"}],["rect",{width:"6",height:"10",x:"16",y:"12",rx:"2"}]],wc=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401"}]],$c=[["path",{d:"M12 2v20"}],["path",{d:"m15 19-3 3-3-3"}],["path",{d:"m19 9 3 3-3 3"}],["path",{d:"M2 12h20"}],["path",{d:"m5 9-3 3 3 3"}],["path",{d:"m9 5 3-3 3 3"}]],Sc=[["path",{d:"m18 13-.654-4.736a4 4 0 00-2.756-3.266l-9.163-2.9a2 2 0 00-2.017.493l-.82.819a2 2 0 00-.492 2.017l2.9 9.163a4 4 0 003.266 2.756L13 18"}],["path",{d:"M18.648 12.352a1.205 1.205 0 011.704 0l1.296 1.296a1.205 1.205 0 010 1.704l-6.296 6.296a1.205 1.205 0 01-1.704 0l-1.296-1.296a1.205 1.205 0 010-1.704z"}],["path",{d:"m3 3 6.586 6.586"}],["circle",{cx:"11",cy:"11",r:"2"}]],Ac=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"}],["path",{d:"m15 5 4 4"}]],Ec=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]],Cc=[["path",{d:"M2 3h20"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3"}],["path",{d:"m7 21 5-5 5 5"}]],Tc=[["path",{d:"m15 14 5-5-5-5"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13"}]],Rc=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}],["path",{d:"M3 3v5h5"}],["path",{d:"M12 7v5l4 2"}]],_c=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915"}],["circle",{cx:"12",cy:"12",r:"3"}]],Mc=[["path",{d:"M12 18v4"}],["path",{d:"M2 14.499a5.5 5.5 0 0 0 9.591 3.675.6.6 0 0 1 .818.001A5.5 5.5 0 0 0 22 14.5c0-2.29-1.5-4-3-5.5l-5.492-5.312a2 2 0 0 0-3-.02L5 8.999c-1.5 1.5-3 3.2-3 5.5"}]],Oc=[["circle",{cx:"12",cy:"12",r:"4"}],["path",{d:"M12 2v2"}],["path",{d:"M12 20v2"}],["path",{d:"m4.93 4.93 1.41 1.41"}],["path",{d:"m17.66 17.66 1.41 1.41"}],["path",{d:"M2 12h2"}],["path",{d:"M20 12h2"}],["path",{d:"m6.34 17.66-1.41 1.41"}],["path",{d:"m19.07 4.93-1.41 1.41"}]],Pc=[["path",{d:"M3 9h18"}],["path",{d:"M9 3v18"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}]],Lc=[["path",{d:"M10 11v6"}],["path",{d:"M14 11v6"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}],["path",{d:"M3 6h18"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}]],zc=[["path",{d:"M9 14 4 9l5-5"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11"}]],Dc=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]],Ic=[["path",{d:"M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z"}]],rn=globalThis,fs=rn.ShadowRoot&&(rn.ShadyCSS===void 0||rn.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ms=Symbol(),cr=new WeakMap;let pr=class{constructor(e,n,s){if(this._$cssResult$=!0,s!==ms)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=n}get styleSheet(){let e=this.o;const n=this.t;if(fs&&e===void 0){const s=n!==void 0&&n.length===1;s&&(e=cr.get(n)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),s&&cr.set(n,e))}return e}toString(){return this.cssText}};const on=t=>new pr(typeof t=="string"?t:t+"",void 0,ms),z=(t,...e)=>{const n=t.length===1?t[0]:e.reduce((s,i,r)=>s+(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.")})(i)+t[r+1],t[0]);return new pr(n,t,ms)},Nc=(t,e)=>{if(fs)t.adoptedStyleSheets=e.map(n=>n instanceof CSSStyleSheet?n:n.styleSheet);else for(const n of e){const s=document.createElement("style"),i=rn.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=n.cssText,t.appendChild(s)}},hr=fs?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let n="";for(const s of e.cssRules)n+=s.cssText;return on(n)})(t):t,{is:qc,defineProperty:Uc,getOwnPropertyDescriptor:Hc,getOwnPropertyNames:jc,getOwnPropertySymbols:Bc,getPrototypeOf:Fc}=Object,an=globalThis,ur=an.trustedTypes,Gc=ur?ur.emptyScript:"",Wc=an.reactiveElementPolyfillSupport,Et=(t,e)=>t,ks={toAttribute(t,e){switch(e){case Boolean:t=t?Gc:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let n=t;switch(e){case Boolean:n=t!==null;break;case Number:n=t===null?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch{n=null}}return n}},gr=(t,e)=>!qc(t,e),fr={attribute:!0,type:String,converter:ks,reflect:!1,useDefault:!1,hasChanged:gr};Symbol.metadata??=Symbol("metadata"),an.litPropertyMetadata??=new WeakMap;let Xe=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,n=fr){if(n.state&&(n.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((n=Object.create(n)).wrapped=!0),this.elementProperties.set(e,n),!n.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(e,s,n);i!==void 0&&Uc(this.prototype,e,i)}}static getPropertyDescriptor(e,n,s){const{get:i,set:r}=Hc(this.prototype,e)??{get(){return this[n]},set(o){this[n]=o}};return{get:i,set(o){const a=i?.call(this);r?.call(this,o),this.requestUpdate(e,a,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??fr}static _$Ei(){if(this.hasOwnProperty(Et("elementProperties")))return;const e=Fc(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Et("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Et("properties"))){const n=this.properties,s=[...jc(n),...Bc(n)];for(const i of s)this.createProperty(i,n[i])}const e=this[Symbol.metadata];if(e!==null){const n=litPropertyMetadata.get(e);if(n!==void 0)for(const[s,i]of n)this.elementProperties.set(s,i)}this._$Eh=new Map;for(const[n,s]of this.elementProperties){const i=this._$Eu(n,s);i!==void 0&&this._$Eh.set(i,n)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const n=[];if(Array.isArray(e)){const s=new Set(e.flat(1/0).reverse());for(const i of s)n.unshift(hr(i))}else e!==void 0&&n.push(hr(e));return n}static _$Eu(e,n){const s=n.attribute;return s===!1?void 0:typeof s=="string"?s: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,n=this.constructor.elementProperties;for(const s of n.keys())this.hasOwnProperty(s)&&(e.set(s,this[s]),delete this[s]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Nc(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,n,s){this._$AK(e,s)}_$ET(e,n){const s=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,s);if(i!==void 0&&s.reflect===!0){const r=(s.converter?.toAttribute!==void 0?s.converter:ks).toAttribute(n,s.type);this._$Em=e,r==null?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(e,n){const s=this.constructor,i=s._$Eh.get(e);if(i!==void 0&&this._$Em!==i){const r=s.getPropertyOptions(i),o=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:ks;this._$Em=i;const a=o.fromAttribute(n,r.type);this[i]=a??this._$Ej?.get(i)??a,this._$Em=null}}requestUpdate(e,n,s,i=!1,r){if(e!==void 0){const o=this.constructor;if(i===!1&&(r=this[e]),s??=o.getPropertyOptions(e),!((s.hasChanged??gr)(r,n)||s.useDefault&&s.reflect&&r===this._$Ej?.get(e)&&!this.hasAttribute(o._$Eu(e,s))))return;this.C(e,n,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,n,{useDefault:s,reflect:i,wrapped:r},o){s&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??n??this[e]),r!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||s||(n=void 0),this._$AL.set(e,n)),i===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(n){Promise.reject(n)}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[i,r]of this._$Ep)this[i]=r;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[i,r]of s){const{wrapped:o}=r,a=this[i];o!==!0||this._$AL.has(i)||a===void 0||this.C(i,void 0,r,a)}}let e=!1;const n=this._$AL;try{e=this.shouldUpdate(n),e?(this.willUpdate(n),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(n)):this._$EM()}catch(s){throw e=!1,this._$EM(),s}e&&this._$AE(n)}willUpdate(e){}_$AE(e){this._$EO?.forEach(n=>n.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(n=>this._$ET(n,this[n])),this._$EM()}updated(e){}firstUpdated(e){}};Xe.elementStyles=[],Xe.shadowRootOptions={mode:"open"},Xe[Et("elementProperties")]=new Map,Xe[Et("finalized")]=new Map,Wc?.({ReactiveElement:Xe}),(an.reactiveElementVersions??=[]).push("2.1.2");const bs=globalThis,mr=t=>t,ln=bs.trustedTypes,kr=ln?ln.createPolicy("lit-html",{createHTML:t=>t}):void 0,br="$lit$",ve=`lit$${Math.random().toFixed(9).slice(2)}$`,vr="?"+ve,Kc=`<${vr}>`,Re=document,Ct=()=>Re.createComment(""),Tt=t=>t===null||typeof t!="object"&&typeof t!="function",vs=Array.isArray,Vc=t=>vs(t)||typeof t?.[Symbol.iterator]=="function",xs=`[
2
- \f\r]`,Rt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,xr=/-->/g,yr=/>/g,_e=RegExp(`>|${xs}(?:([^\\s"'>=/]+)(${xs}*=${xs}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),wr=/'/g,$r=/"/g,Sr=/^(?:script|style|textarea|title)$/i,Ar=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),k=Ar(1),Yc=Ar(2),Z=Symbol.for("lit-noChange"),b=Symbol.for("lit-nothing"),Er=new WeakMap,Me=Re.createTreeWalker(Re,129);function Cr(t,e){if(!vs(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return kr!==void 0?kr.createHTML(e):e}const Zc=(t,e)=>{const n=t.length-1,s=[];let i,r=e===2?"<svg>":e===3?"<math>":"",o=Rt;for(let a=0;a<n;a++){const l=t[a];let c,d,h=-1,f=0;for(;f<l.length&&(o.lastIndex=f,d=o.exec(l),d!==null);)f=o.lastIndex,o===Rt?d[1]==="!--"?o=xr:d[1]!==void 0?o=yr:d[2]!==void 0?(Sr.test(d[2])&&(i=RegExp("</"+d[2],"g")),o=_e):d[3]!==void 0&&(o=_e):o===_e?d[0]===">"?(o=i??Rt,h=-1):d[1]===void 0?h=-2:(h=o.lastIndex-d[2].length,c=d[1],o=d[3]===void 0?_e:d[3]==='"'?$r:wr):o===$r||o===wr?o=_e:o===xr||o===yr?o=Rt:(o=_e,i=void 0);const p=o===_e&&t[a+1].startsWith("/>")?" ":"";r+=o===Rt?l+Kc:h>=0?(s.push(c),l.slice(0,h)+br+l.slice(h)+ve+p):l+ve+(h===-2?a:p)}return[Cr(t,r+(t[n]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),s]};let ys=class Kd{constructor({strings:e,_$litType$:n},s){let i;this.parts=[];let r=0,o=0;const a=e.length-1,l=this.parts,[c,d]=Zc(e,n);if(this.el=Kd.createElement(c,s),Me.currentNode=this.el.content,n===2||n===3){const h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(i=Me.nextNode())!==null&&l.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(const h of i.getAttributeNames())if(h.endsWith(br)){const f=d[o++],p=i.getAttribute(h).split(ve),g=/([.?@])?(.*)/.exec(f);l.push({type:1,index:r,name:g[2],strings:p,ctor:g[1]==="."?Xc:g[1]==="?"?Jc:g[1]==="@"?ep:cn}),i.removeAttribute(h)}else h.startsWith(ve)&&(l.push({type:6,index:r}),i.removeAttribute(h));if(Sr.test(i.tagName)){const h=i.textContent.split(ve),f=h.length-1;if(f>0){i.textContent=ln?ln.emptyScript:"";for(let p=0;p<f;p++)i.append(h[p],Ct()),Me.nextNode(),l.push({type:2,index:++r});i.append(h[f],Ct())}}}else if(i.nodeType===8)if(i.data===vr)l.push({type:2,index:r});else{let h=-1;for(;(h=i.data.indexOf(ve,h+1))!==-1;)l.push({type:7,index:r}),h+=ve.length-1}r++}}static createElement(e,n){const s=Re.createElement("template");return s.innerHTML=e,s}};function Je(t,e,n=t,s){if(e===Z)return e;let i=s!==void 0?n._$Co?.[s]:n._$Cl;const r=Tt(e)?void 0:e._$litDirective$;return i?.constructor!==r&&(i?._$AO?.(!1),r===void 0?i=void 0:(i=new r(t),i._$AT(t,n,s)),s!==void 0?(n._$Co??=[])[s]=i:n._$Cl=i),i!==void 0&&(e=Je(t,i._$AS(t,e.values),i,s)),e}let Qc=class{constructor(e,n){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=n}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:n},parts:s}=this._$AD,i=(e?.creationScope??Re).importNode(n,!0);Me.currentNode=i;let r=Me.nextNode(),o=0,a=0,l=s[0];for(;l!==void 0;){if(o===l.index){let c;l.type===2?c=new dn(r,r.nextSibling,this,e):l.type===1?c=new l.ctor(r,l.name,l.strings,this,e):l.type===6&&(c=new tp(r,this,e)),this._$AV.push(c),l=s[++a]}o!==l?.index&&(r=Me.nextNode(),o++)}return Me.currentNode=Re,i}p(e){let n=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(e,s,n),n+=s.strings.length-2):s._$AI(e[n])),n++}},dn=class Vd{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,n,s,i){this.type=2,this._$AH=b,this._$AN=void 0,this._$AA=e,this._$AB=n,this._$AM=s,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const n=this._$AM;return n!==void 0&&e?.nodeType===11&&(e=n.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,n=this){e=Je(this,e,n),Tt(e)?e===b||e==null||e===""?(this._$AH!==b&&this._$AR(),this._$AH=b):e!==this._$AH&&e!==Z&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Vc(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!==b&&Tt(this._$AH)?this._$AA.nextSibling.data=e:this.T(Re.createTextNode(e)),this._$AH=e}$(e){const{values:n,_$litType$:s}=e,i=typeof s=="number"?this._$AC(e):(s.el===void 0&&(s.el=ys.createElement(Cr(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(n);else{const r=new Qc(i,this),o=r.u(this.options);r.p(n),this.T(o),this._$AH=r}}_$AC(e){let n=Er.get(e.strings);return n===void 0&&Er.set(e.strings,n=new ys(e)),n}k(e){vs(this._$AH)||(this._$AH=[],this._$AR());const n=this._$AH;let s,i=0;for(const r of e)i===n.length?n.push(s=new Vd(this.O(Ct()),this.O(Ct()),this,this.options)):s=n[i],s._$AI(r),i++;i<n.length&&(this._$AR(s&&s._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,n){for(this._$AP?.(!1,!0,n);e!==this._$AB;){const s=mr(e).nextSibling;mr(e).remove(),e=s}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}};class cn{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,n,s,i,r){this.type=1,this._$AH=b,this._$AN=void 0,this.element=e,this.name=n,this._$AM=i,this.options=r,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=b}_$AI(e,n=this,s,i){const r=this.strings;let o=!1;if(r===void 0)e=Je(this,e,n,0),o=!Tt(e)||e!==this._$AH&&e!==Z,o&&(this._$AH=e);else{const a=e;let l,c;for(e=r[0],l=0;l<r.length-1;l++)c=Je(this,a[s+l],n,l),c===Z&&(c=this._$AH[l]),o||=!Tt(c)||c!==this._$AH[l],c===b?e=b:e!==b&&(e+=(c??"")+r[l+1]),this._$AH[l]=c}o&&!i&&this.j(e)}j(e){e===b?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}let Xc=class extends cn{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===b?void 0:e}},Jc=class extends cn{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==b)}},ep=class extends cn{constructor(e,n,s,i,r){super(e,n,s,i,r),this.type=5}_$AI(e,n=this){if((e=Je(this,e,n,0)??b)===Z)return;const s=this._$AH,i=e===b&&s!==b||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,r=e!==b&&(s===b||i);i&&this.element.removeEventListener(this.name,this,s),r&&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 tp{constructor(e,n,s){this.element=e,this.type=6,this._$AN=void 0,this._$AM=n,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(e){Je(this,e)}}const np={I:dn},sp=bs.litHtmlPolyfillSupport;sp?.(ys,dn),(bs.litHtmlVersions??=[]).push("3.3.3");const Tr=(t,e,n)=>{const s=n?.renderBefore??e;let i=s._$litPart$;if(i===void 0){const r=n?.renderBefore??null;s._$litPart$=i=new dn(e.insertBefore(Ct(),r),r,void 0,n??{})}return i._$AI(t),i},ws=globalThis;let ee=class extends Xe{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 n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Tr(n,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Z}};ee._$litElement$=!0,ee.finalized=!0,ws.litElementHydrateSupport?.({LitElement:ee});const ip=ws.litElementPolyfillSupport;ip?.({LitElement:ee}),(ws.litElementVersions??=[]).push("4.2.2");const Rr=(t,e,n,s)=>{if(typeof window>"u")return;const i=Reflect.get(window,"devProcessKit"),r=$s(i)&&i.views.length>0&&e.length===0?{version:t,views:i.views,versionParam:n,entryUrl:i.entryUrl}:{version:t,views:$s(i)?[...new Set([...i.views,...e])]:e,versionParam:n,entryUrl:s};Object.assign(window,{devProcessKit:r})},$s=t=>typeof t=="object"&&t!==null&&typeof Reflect.get(t,"entryUrl")=="string"&&Array.isArray(Reflect.get(t,"views")),_r=()=>{if(typeof window>"u")return null;const t=Reflect.get(window,"devProcessKit");return $s(t)?t.entryUrl:null};class pn{#e;constructor(e,n){this.#e=n,e.addController(this)}hostConnected(){document.addEventListener("pointerdown",this.#s,!0),document.addEventListener("keydown",this.#t)}hostDisconnected(){document.removeEventListener("pointerdown",this.#s,!0),document.removeEventListener("keydown",this.#t)}#s=e=>{e.button!==0||!this.#e.open()||this.#e.closesOn(e.composedPath())&&this.#e.dismiss()};#t=e=>{e.key!=="Escape"||e.isComposing||e.defaultPrevented||!this.#e.open()||this.#e.ownsEscape(e.composedPath())&&(e.preventDefault(),this.#e.dismiss())}}const Mr=z`
1
+ import{s as C,o as O,v as $,E as Wd,T as Kd,n as Vd,K as le,j as x,c as wt,B as W,w as E,k as I,u as yt,A as Qi,t as Yd,U as Zd,q as z,h as H,l as K,J as $t,V as Qd,g as Xi,R as Xd,x as ds,y as Ji,z as er,m as tn,C as tr,W as St,X as nr,Y as Jd,a as ec,S as cs,i as tc,d as ps,p as nn,Z as nc}from"./shared-CJZKj_HI.js";const sr=[["path",{d:"M12 5v14"}],["path",{d:"m19 12-7 7-7-7"}]],sc=[["path",{d:"M8 3 4 7l4 4"}],["path",{d:"M4 7h16"}],["path",{d:"m16 21 4-4-4-4"}],["path",{d:"M20 17H4"}]],ir=[["path",{d:"m12 19-7-7 7-7"}],["path",{d:"M19 12H5"}]],ic=[["path",{d:"m16 3 4 4-4 4"}],["path",{d:"M20 7H4"}],["path",{d:"m8 21-4-4 4-4"}],["path",{d:"M4 17h16"}]],rr=[["path",{d:"M5 12h14"}],["path",{d:"m12 5 7 7-7 7"}]],rc=[["path",{d:"M5 3h14"}],["path",{d:"m18 13-6-6-6 6"}],["path",{d:"M12 7v14"}]],or=[["path",{d:"m5 12 7-7 7 7"}],["path",{d:"M12 19V5"}]],oc=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326"}]],ac=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z"}],["path",{d:"m7 16.5-4.74-2.85"}],["path",{d:"m7 16.5 5-3"}],["path",{d:"M7 16.5v5.17"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z"}],["path",{d:"m17 16.5-5-3"}],["path",{d:"m17 16.5 4.74-2.85"}],["path",{d:"M17 16.5v5.17"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z"}],["path",{d:"M12 8 7.26 5.15"}],["path",{d:"m12 8 4.74-2.85"}],["path",{d:"M12 13.5V8"}]],lc=[["path",{d:"M20 6 9 17l-5-5"}]],ar=[["path",{d:"m6 9 6 6 6-6"}]],dc=[["path",{d:"m15 18-6-6 6-6"}]],cc=[["path",{d:"m9 18 6-6-6-6"}]],pc=[["circle",{cx:"12",cy:"12",r:"1"}],["circle",{cx:"12",cy:"12",r:"10"}]],lr=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}],["path",{d:"M12 17h.01"}]],hc=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}]],uc=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5"}],["path",{d:"M3 12A9 3 0 0 0 21 12"}]],gc=[["path",{d:"M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z"}]],dr=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5"}],["path",{d:"M10 9H8"}],["path",{d:"M16 13H8"}],["path",{d:"M16 17H8"}]],fc=[["path",{d:"M15 6a9 9 0 0 0-9 9V3"}],["circle",{cx:"18",cy:"6",r:"3"}],["circle",{cx:"6",cy:"18",r:"3"}]],mc=[["circle",{cx:"12",cy:"18",r:"3"}],["circle",{cx:"6",cy:"6",r:"3"}],["circle",{cx:"18",cy:"6",r:"3"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9"}],["path",{d:"M12 12v3"}]],kc=[["circle",{cx:"12",cy:"9",r:"1"}],["circle",{cx:"19",cy:"9",r:"1"}],["circle",{cx:"5",cy:"9",r:"1"}],["circle",{cx:"12",cy:"15",r:"1"}],["circle",{cx:"19",cy:"15",r:"1"}],["circle",{cx:"5",cy:"15",r:"1"}]],bc=[["circle",{cx:"9",cy:"12",r:"1"}],["circle",{cx:"9",cy:"5",r:"1"}],["circle",{cx:"9",cy:"19",r:"1"}],["circle",{cx:"15",cy:"12",r:"1"}],["circle",{cx:"15",cy:"5",r:"1"}],["circle",{cx:"15",cy:"19",r:"1"}]],vc=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor"}]],cr=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1"}]],xc=[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1"}]],wc=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"}]],pr=[["path",{d:"M13 5h8"}],["path",{d:"M13 12h8"}],["path",{d:"M13 19h8"}],["path",{d:"m3 17 2 2 4-4"}],["path",{d:"m3 7 2 2 4-4"}]],yc=[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z"}],["path",{d:"M15 5.764v15"}],["path",{d:"M9 3.236v15"}]],$c=[["path",{d:"M15 3h6v6"}],["path",{d:"m21 3-7 7"}],["path",{d:"m3 21 7-7"}],["path",{d:"M9 21H3v-6"}]],Sc=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z"}],["path",{d:"M7 11h10"}],["path",{d:"M7 15h6"}],["path",{d:"M7 7h8"}]],Ac=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z"}]],Ec=[["path",{d:"m14 10 7-7"}],["path",{d:"M20 10h-6V4"}],["path",{d:"m3 21 7-7"}],["path",{d:"M4 14h6v6"}]],Cc=[["path",{d:"M5 12h14"}]],Tc=[["path",{d:"M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8"}],["path",{d:"M10 19v-3.96 3.15"}],["path",{d:"M7 19h5"}],["rect",{width:"6",height:"10",x:"16",y:"12",rx:"2"}]],Rc=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401"}]],Mc=[["path",{d:"M12 2v20"}],["path",{d:"m15 19-3 3-3-3"}],["path",{d:"m19 9 3 3-3 3"}],["path",{d:"M2 12h20"}],["path",{d:"m5 9-3 3 3 3"}],["path",{d:"m9 5 3-3 3 3"}]],Oc=[["path",{d:"m18 13-.654-4.736a4 4 0 00-2.756-3.266l-9.163-2.9a2 2 0 00-2.017.493l-.82.819a2 2 0 00-.492 2.017l2.9 9.163a4 4 0 003.266 2.756L13 18"}],["path",{d:"M18.648 12.352a1.205 1.205 0 011.704 0l1.296 1.296a1.205 1.205 0 010 1.704l-6.296 6.296a1.205 1.205 0 01-1.704 0l-1.296-1.296a1.205 1.205 0 010-1.704z"}],["path",{d:"m3 3 6.586 6.586"}],["circle",{cx:"11",cy:"11",r:"2"}]],_c=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"}],["path",{d:"m15 5 4 4"}]],Pc=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]],Lc=[["path",{d:"M2 3h20"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3"}],["path",{d:"m7 21 5-5 5 5"}]],zc=[["path",{d:"m15 14 5-5-5-5"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13"}]],Ic=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}],["path",{d:"M3 3v5h5"}],["path",{d:"M12 7v5l4 2"}]],Dc=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915"}],["circle",{cx:"12",cy:"12",r:"3"}]],Nc=[["path",{d:"M12 18v4"}],["path",{d:"M2 14.499a5.5 5.5 0 0 0 9.591 3.675.6.6 0 0 1 .818.001A5.5 5.5 0 0 0 22 14.5c0-2.29-1.5-4-3-5.5l-5.492-5.312a2 2 0 0 0-3-.02L5 8.999c-1.5 1.5-3 3.2-3 5.5"}]],qc=[["circle",{cx:"12",cy:"12",r:"4"}],["path",{d:"M12 2v2"}],["path",{d:"M12 20v2"}],["path",{d:"m4.93 4.93 1.41 1.41"}],["path",{d:"m17.66 17.66 1.41 1.41"}],["path",{d:"M2 12h2"}],["path",{d:"M20 12h2"}],["path",{d:"m6.34 17.66-1.41 1.41"}],["path",{d:"m19.07 4.93-1.41 1.41"}]],Uc=[["path",{d:"M3 9h18"}],["path",{d:"M9 3v18"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}]],Hc=[["path",{d:"M10 11v6"}],["path",{d:"M14 11v6"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}],["path",{d:"M3 6h18"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}]],Bc=[["path",{d:"M9 14 4 9l5-5"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11"}]],jc=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]],Fc=[["path",{d:"M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z"}]],sn=globalThis,hs=sn.ShadowRoot&&(sn.ShadyCSS===void 0||sn.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,us=Symbol(),hr=new WeakMap;let ur=class{constructor(e,n,s){if(this._$cssResult$=!0,s!==us)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=n}get styleSheet(){let e=this.o;const n=this.t;if(hs&&e===void 0){const s=n!==void 0&&n.length===1;s&&(e=hr.get(n)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),s&&hr.set(n,e))}return e}toString(){return this.cssText}};const rn=t=>new ur(typeof t=="string"?t:t+"",void 0,us),P=(t,...e)=>{const n=t.length===1?t[0]:e.reduce((s,i,r)=>s+(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.")})(i)+t[r+1],t[0]);return new ur(n,t,us)},Gc=(t,e)=>{if(hs)t.adoptedStyleSheets=e.map(n=>n instanceof CSSStyleSheet?n:n.styleSheet);else for(const n of e){const s=document.createElement("style"),i=sn.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=n.cssText,t.appendChild(s)}},gr=hs?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let n="";for(const s of e.cssRules)n+=s.cssText;return rn(n)})(t):t,{is:Wc,defineProperty:Kc,getOwnPropertyDescriptor:Vc,getOwnPropertyNames:Yc,getOwnPropertySymbols:Zc,getPrototypeOf:Qc}=Object,on=globalThis,fr=on.trustedTypes,Xc=fr?fr.emptyScript:"",Jc=on.reactiveElementPolyfillSupport,At=(t,e)=>t,gs={toAttribute(t,e){switch(e){case Boolean:t=t?Xc:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let n=t;switch(e){case Boolean:n=t!==null;break;case Number:n=t===null?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch{n=null}}return n}},mr=(t,e)=>!Wc(t,e),kr={attribute:!0,type:String,converter:gs,reflect:!1,useDefault:!1,hasChanged:mr};Symbol.metadata??=Symbol("metadata"),on.litPropertyMetadata??=new WeakMap;let Ye=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,n=kr){if(n.state&&(n.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((n=Object.create(n)).wrapped=!0),this.elementProperties.set(e,n),!n.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(e,s,n);i!==void 0&&Kc(this.prototype,e,i)}}static getPropertyDescriptor(e,n,s){const{get:i,set:r}=Vc(this.prototype,e)??{get(){return this[n]},set(o){this[n]=o}};return{get:i,set(o){const a=i?.call(this);r?.call(this,o),this.requestUpdate(e,a,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??kr}static _$Ei(){if(this.hasOwnProperty(At("elementProperties")))return;const e=Qc(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(At("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(At("properties"))){const n=this.properties,s=[...Yc(n),...Zc(n)];for(const i of s)this.createProperty(i,n[i])}const e=this[Symbol.metadata];if(e!==null){const n=litPropertyMetadata.get(e);if(n!==void 0)for(const[s,i]of n)this.elementProperties.set(s,i)}this._$Eh=new Map;for(const[n,s]of this.elementProperties){const i=this._$Eu(n,s);i!==void 0&&this._$Eh.set(i,n)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const n=[];if(Array.isArray(e)){const s=new Set(e.flat(1/0).reverse());for(const i of s)n.unshift(gr(i))}else e!==void 0&&n.push(gr(e));return n}static _$Eu(e,n){const s=n.attribute;return s===!1?void 0:typeof s=="string"?s: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,n=this.constructor.elementProperties;for(const s of n.keys())this.hasOwnProperty(s)&&(e.set(s,this[s]),delete this[s]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Gc(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,n,s){this._$AK(e,s)}_$ET(e,n){const s=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,s);if(i!==void 0&&s.reflect===!0){const r=(s.converter?.toAttribute!==void 0?s.converter:gs).toAttribute(n,s.type);this._$Em=e,r==null?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(e,n){const s=this.constructor,i=s._$Eh.get(e);if(i!==void 0&&this._$Em!==i){const r=s.getPropertyOptions(i),o=typeof r.converter=="function"?{fromAttribute:r.converter}:r.converter?.fromAttribute!==void 0?r.converter:gs;this._$Em=i;const a=o.fromAttribute(n,r.type);this[i]=a??this._$Ej?.get(i)??a,this._$Em=null}}requestUpdate(e,n,s,i=!1,r){if(e!==void 0){const o=this.constructor;if(i===!1&&(r=this[e]),s??=o.getPropertyOptions(e),!((s.hasChanged??mr)(r,n)||s.useDefault&&s.reflect&&r===this._$Ej?.get(e)&&!this.hasAttribute(o._$Eu(e,s))))return;this.C(e,n,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,n,{useDefault:s,reflect:i,wrapped:r},o){s&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??n??this[e]),r!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||s||(n=void 0),this._$AL.set(e,n)),i===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(n){Promise.reject(n)}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[i,r]of this._$Ep)this[i]=r;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[i,r]of s){const{wrapped:o}=r,a=this[i];o!==!0||this._$AL.has(i)||a===void 0||this.C(i,void 0,r,a)}}let e=!1;const n=this._$AL;try{e=this.shouldUpdate(n),e?(this.willUpdate(n),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(n)):this._$EM()}catch(s){throw e=!1,this._$EM(),s}e&&this._$AE(n)}willUpdate(e){}_$AE(e){this._$EO?.forEach(n=>n.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(n=>this._$ET(n,this[n])),this._$EM()}updated(e){}firstUpdated(e){}};Ye.elementStyles=[],Ye.shadowRootOptions={mode:"open"},Ye[At("elementProperties")]=new Map,Ye[At("finalized")]=new Map,Jc?.({ReactiveElement:Ye}),(on.reactiveElementVersions??=[]).push("2.1.2");const fs=globalThis,br=t=>t,an=fs.trustedTypes,vr=an?an.createPolicy("lit-html",{createHTML:t=>t}):void 0,xr="$lit$",ke=`lit$${Math.random().toFixed(9).slice(2)}$`,wr="?"+ke,ep=`<${wr}>`,Ee=document,Et=()=>Ee.createComment(""),Ct=t=>t===null||typeof t!="object"&&typeof t!="function",ms=Array.isArray,tp=t=>ms(t)||typeof t?.[Symbol.iterator]=="function",ks=`[
2
+ \f\r]`,Tt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,yr=/-->/g,$r=/>/g,Ce=RegExp(`>|${ks}(?:([^\\s"'>=/]+)(${ks}*=${ks}*(?:[^
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Sr=/'/g,Ar=/"/g,Er=/^(?:script|style|textarea|title)$/i,Cr=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),m=Cr(1),np=Cr(2),V=Symbol.for("lit-noChange"),b=Symbol.for("lit-nothing"),Tr=new WeakMap,Te=Ee.createTreeWalker(Ee,129);function Rr(t,e){if(!ms(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return vr!==void 0?vr.createHTML(e):e}const sp=(t,e)=>{const n=t.length-1,s=[];let i,r=e===2?"<svg>":e===3?"<math>":"",o=Tt;for(let a=0;a<n;a++){const l=t[a];let p,h,d=-1,f=0;for(;f<l.length&&(o.lastIndex=f,h=o.exec(l),h!==null);)f=o.lastIndex,o===Tt?h[1]==="!--"?o=yr:h[1]!==void 0?o=$r:h[2]!==void 0?(Er.test(h[2])&&(i=RegExp("</"+h[2],"g")),o=Ce):h[3]!==void 0&&(o=Ce):o===Ce?h[0]===">"?(o=i??Tt,d=-1):h[1]===void 0?d=-2:(d=o.lastIndex-h[2].length,p=h[1],o=h[3]===void 0?Ce:h[3]==='"'?Ar:Sr):o===Ar||o===Sr?o=Ce:o===yr||o===$r?o=Tt:(o=Ce,i=void 0);const c=o===Ce&&t[a+1].startsWith("/>")?" ":"";r+=o===Tt?l+ep:d>=0?(s.push(p),l.slice(0,d)+xr+l.slice(d)+ke+c):l+ke+(d===-2?a:c)}return[Rr(t,r+(t[n]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),s]};let bs=class jd{constructor({strings:e,_$litType$:n},s){let i;this.parts=[];let r=0,o=0;const a=e.length-1,l=this.parts,[p,h]=sp(e,n);if(this.el=jd.createElement(p,s),Te.currentNode=this.el.content,n===2||n===3){const d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(i=Te.nextNode())!==null&&l.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(const d of i.getAttributeNames())if(d.endsWith(xr)){const f=h[o++],c=i.getAttribute(d).split(ke),g=/([.?@])?(.*)/.exec(f);l.push({type:1,index:r,name:g[2],strings:c,ctor:g[1]==="."?rp:g[1]==="?"?op:g[1]==="@"?ap:dn}),i.removeAttribute(d)}else d.startsWith(ke)&&(l.push({type:6,index:r}),i.removeAttribute(d));if(Er.test(i.tagName)){const d=i.textContent.split(ke),f=d.length-1;if(f>0){i.textContent=an?an.emptyScript:"";for(let c=0;c<f;c++)i.append(d[c],Et()),Te.nextNode(),l.push({type:2,index:++r});i.append(d[f],Et())}}}else if(i.nodeType===8)if(i.data===wr)l.push({type:2,index:r});else{let d=-1;for(;(d=i.data.indexOf(ke,d+1))!==-1;)l.push({type:7,index:r}),d+=ke.length-1}r++}}static createElement(e,n){const s=Ee.createElement("template");return s.innerHTML=e,s}};function Ze(t,e,n=t,s){if(e===V)return e;let i=s!==void 0?n._$Co?.[s]:n._$Cl;const r=Ct(e)?void 0:e._$litDirective$;return i?.constructor!==r&&(i?._$AO?.(!1),r===void 0?i=void 0:(i=new r(t),i._$AT(t,n,s)),s!==void 0?(n._$Co??=[])[s]=i:n._$Cl=i),i!==void 0&&(e=Ze(t,i._$AS(t,e.values),i,s)),e}let ip=class{constructor(e,n){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=n}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:n},parts:s}=this._$AD,i=(e?.creationScope??Ee).importNode(n,!0);Te.currentNode=i;let r=Te.nextNode(),o=0,a=0,l=s[0];for(;l!==void 0;){if(o===l.index){let p;l.type===2?p=new ln(r,r.nextSibling,this,e):l.type===1?p=new l.ctor(r,l.name,l.strings,this,e):l.type===6&&(p=new lp(r,this,e)),this._$AV.push(p),l=s[++a]}o!==l?.index&&(r=Te.nextNode(),o++)}return Te.currentNode=Ee,i}p(e){let n=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(e,s,n),n+=s.strings.length-2):s._$AI(e[n])),n++}},ln=class Fd{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,n,s,i){this.type=2,this._$AH=b,this._$AN=void 0,this._$AA=e,this._$AB=n,this._$AM=s,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const n=this._$AM;return n!==void 0&&e?.nodeType===11&&(e=n.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,n=this){e=Ze(this,e,n),Ct(e)?e===b||e==null||e===""?(this._$AH!==b&&this._$AR(),this._$AH=b):e!==this._$AH&&e!==V&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):tp(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!==b&&Ct(this._$AH)?this._$AA.nextSibling.data=e:this.T(Ee.createTextNode(e)),this._$AH=e}$(e){const{values:n,_$litType$:s}=e,i=typeof s=="number"?this._$AC(e):(s.el===void 0&&(s.el=bs.createElement(Rr(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(n);else{const r=new ip(i,this),o=r.u(this.options);r.p(n),this.T(o),this._$AH=r}}_$AC(e){let n=Tr.get(e.strings);return n===void 0&&Tr.set(e.strings,n=new bs(e)),n}k(e){ms(this._$AH)||(this._$AH=[],this._$AR());const n=this._$AH;let s,i=0;for(const r of e)i===n.length?n.push(s=new Fd(this.O(Et()),this.O(Et()),this,this.options)):s=n[i],s._$AI(r),i++;i<n.length&&(this._$AR(s&&s._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,n){for(this._$AP?.(!1,!0,n);e!==this._$AB;){const s=br(e).nextSibling;br(e).remove(),e=s}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}};class dn{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,n,s,i,r){this.type=1,this._$AH=b,this._$AN=void 0,this.element=e,this.name=n,this._$AM=i,this.options=r,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=b}_$AI(e,n=this,s,i){const r=this.strings;let o=!1;if(r===void 0)e=Ze(this,e,n,0),o=!Ct(e)||e!==this._$AH&&e!==V,o&&(this._$AH=e);else{const a=e;let l,p;for(e=r[0],l=0;l<r.length-1;l++)p=Ze(this,a[s+l],n,l),p===V&&(p=this._$AH[l]),o||=!Ct(p)||p!==this._$AH[l],p===b?e=b:e!==b&&(e+=(p??"")+r[l+1]),this._$AH[l]=p}o&&!i&&this.j(e)}j(e){e===b?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}let rp=class extends dn{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===b?void 0:e}},op=class extends dn{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==b)}},ap=class extends dn{constructor(e,n,s,i,r){super(e,n,s,i,r),this.type=5}_$AI(e,n=this){if((e=Ze(this,e,n,0)??b)===V)return;const s=this._$AH,i=e===b&&s!==b||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,r=e!==b&&(s===b||i);i&&this.element.removeEventListener(this.name,this,s),r&&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 lp{constructor(e,n,s){this.element=e,this.type=6,this._$AN=void 0,this._$AM=n,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(e){Ze(this,e)}}const dp={I:ln},cp=fs.litHtmlPolyfillSupport;cp?.(bs,ln),(fs.litHtmlVersions??=[]).push("3.3.3");const Mr=(t,e,n)=>{const s=n?.renderBefore??e;let i=s._$litPart$;if(i===void 0){const r=n?.renderBefore??null;s._$litPart$=i=new ln(e.insertBefore(Et(),r),r,void 0,n??{})}return i._$AI(t),i},vs=globalThis;let X=class extends Ye{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 n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Mr(n,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return V}};X._$litElement$=!0,X.finalized=!0,vs.litElementHydrateSupport?.({LitElement:X});const pp=vs.litElementPolyfillSupport;pp?.({LitElement:X}),(vs.litElementVersions??=[]).push("4.2.2");const Or=(t,e,n,s)=>{if(typeof window>"u")return;const i=Reflect.get(window,"devProcessKit"),r=xs(i)&&i.views.length>0&&e.length===0?{version:t,views:i.views,versionParam:n,entryUrl:i.entryUrl}:{version:t,views:xs(i)?[...new Set([...i.views,...e])]:e,versionParam:n,entryUrl:s};Object.assign(window,{devProcessKit:r})},xs=t=>typeof t=="object"&&t!==null&&typeof Reflect.get(t,"entryUrl")=="string"&&Array.isArray(Reflect.get(t,"views")),_r=()=>{if(typeof window>"u")return null;const t=Reflect.get(window,"devProcessKit");return xs(t)?t.entryUrl:null};class cn{#e;constructor(e,n){this.#e=n,e.addController(this)}hostConnected(){document.addEventListener("pointerdown",this.#n,!0),document.addEventListener("keydown",this.#s)}hostDisconnected(){document.removeEventListener("pointerdown",this.#n,!0),document.removeEventListener("keydown",this.#s)}#n=e=>{e.button!==0||!this.#e.open()||this.#e.closesOn(e.composedPath())&&this.#e.dismiss()};#s=e=>{e.key!=="Escape"||e.isComposing||e.defaultPrevented||!this.#e.open()||this.#e.ownsEscape(e.composedPath())&&(e.preventDefault(),this.#e.dismiss())}}const Pr=P`
4
4
  .dpk-context-menu {
5
5
  min-width: 180px;
6
6
  }
@@ -39,7 +39,7 @@ const tr=[["path",{d:"M12 5v14"}],["path",{d:"m19 12-7 7-7-7"}]],Zd=[["path",{d:
39
39
  left: 100%;
40
40
  z-index: 1;
41
41
  }
42
- `,Or=z`
42
+ `,Lr=P`
43
43
  .dpk-dialog {
44
44
  box-sizing: border-box;
45
45
  /* One column as wide as the panel: a long label wraps instead of widening it. */
@@ -218,13 +218,11 @@ const tr=[["path",{d:"M12 5v14"}],["path",{d:"m19 12-7 7-7-7"}]],Zd=[["path",{d:
218
218
  .dpk-dialog-footer[hidden] {
219
219
  display: none;
220
220
  }
221
- `,rp={lang:void 0,message:void 0,abortEarly:void 0,abortPipeEarly:void 0};function Ss(t){return rp}let op;function ap(t){return op?.get(t)}let lp;function dp(t){return lp?.get(t)}let cp;function pp(t,e){return cp?.get(t)?.get(e)}function et(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 T(t,e,n,s,i){const r=i&&"input"in i?i.input:n.value,o=i?.expected??t.expects??null,a=i?.received??et(r),l={kind:t.kind,type:t.type,input:r,expected:o,received:a,message:`Invalid ${e}: ${o?`Expected ${o} but r`:"R"}eceived ${a}`,requirement:t.requirement,path:i?.path,issues:i?.issues,lang:s.lang,abortEarly:s.abortEarly,abortPipeEarly:s.abortPipeEarly},c=t.kind==="schema",d=i?.message??t.message??pp(t.reference,l.lang)??(c?dp(l.lang):null)??s.message??ap(l.lang);d!==void 0&&(l.message=typeof d=="function"?d(l):d),c&&(n.typed=!1),n.issues?n.issues.push(l):n.issues=[l]}function hp(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function up(t,e){return Object.prototype.hasOwnProperty.call(t,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function As(t,e){const n=[...new Set(t)];return n.length>1?`(${n.join(` ${e} `)})`:n[0]??"never"}function D(t){return t["~standard"]={version:1,vendor:"valibot",validate:e=>t["~run"]({value:e},Ss())},t}function gp(t){if(t.path){let e="";for(const n of t.path)if(typeof n.key=="string"||typeof n.key=="number")e?e+=`.${n.key}`:e+=n.key;else return null;return e}return null}var fp=class extends Error{constructor(t){super(t[0].message),this.name="ValiError",this.issues=t}};const mp=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])$/u,kp=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])[T ](?:0\d|1\d|2[0-3])(?::[0-5]\d){2}(?:\.\d{1,9})?(?:Z| ?[+-](?:0\d|1\d|2[0-3])(?::?[0-5]\d)?)$/u;function Pr(t,e){return{kind:"validation",type:"check",reference:Pr,async:!1,expects:null,requirement:t,message:e,"~run"(n,s){return n.typed&&!this.requirement(n.value)&&T(this,"input",n,s),n}}}function Lr(t){return{kind:"validation",type:"finite",reference:Lr,async:!1,expects:null,requirement:Number.isFinite,message:t,"~run"(e,n){return e.typed&&!this.requirement(e.value)&&T(this,"finite",e,n),e}}}function zr(t,e){const n=et(t);return{kind:"validation",type:"includes",reference:zr,async:!1,expects:n,requirement:t,message:e,"~run"(s,i){return s.typed&&!s.value.includes(this.requirement)&&T(this,"content",s,i,{received:`!${n}`}),s}}}function Dr(t){return{kind:"validation",type:"integer",reference:Dr,async:!1,expects:null,requirement:Number.isInteger,message:t,"~run"(e,n){return e.typed&&!this.requirement(e.value)&&T(this,"integer",e,n),e}}}function Ir(t){return{kind:"validation",type:"iso_date",reference:Ir,async:!1,expects:null,requirement:mp,message:t,"~run"(e,n){return e.typed&&!this.requirement.test(e.value)&&T(this,"date",e,n),e}}}function Nr(t){return{kind:"validation",type:"iso_timestamp",reference:Nr,async:!1,expects:null,requirement:kp,message:t,"~run"(e,n){return e.typed&&!this.requirement.test(e.value)&&T(this,"timestamp",e,n),e}}}function S(t,e){return{kind:"validation",type:"min_length",reference:S,async:!1,expects:`>=${t}`,requirement:t,message:e,"~run"(n,s){return n.typed&&n.value.length<this.requirement&&T(this,"length",n,s,{received:`${n.value.length}`}),n}}}function qr(t,e){return{kind:"validation",type:"min_value",reference:qr,async:!1,expects:`>=${t instanceof Date?t.toJSON():et(t)}`,requirement:t,message:e,"~run"(n,s){return n.typed&&!(n.value>=this.requirement)&&T(this,"value",n,s,{received:n.value instanceof Date?n.value.toJSON():et(n.value)}),n}}}function te(t,e){return{kind:"validation",type:"regex",reference:te,async:!1,expects:`${t}`,requirement:t,message:e,"~run"(n,s){return n.typed&&!this.requirement.test(n.value)&&T(this,"format",n,s),n}}}function hn(){return{kind:"transformation",type:"trim",reference:hn,async:!1,"~run"(t){return t.value=t.value.trim(),t}}}function Ur(t){return{kind:"validation",type:"url",reference:Ur,async:!1,expects:null,requirement(e){try{return URL.canParse?URL.canParse(e):(new URL(e),!0)}catch{return!1}},message:t,"~run"(e,n){return e.typed&&!this.requirement(e.value)&&T(this,"URL",e,n),e}}}const Hr={abortEarly:!0};function Es(t,e,n){return typeof t.fallback=="function"?t.fallback(e,n):t.fallback}function bp(t,e){return D({...t,fallback:e,"~run"(n,s){const i=t["~run"](n,s);return i.issues?{typed:!0,value:Es(this,i,s)}:i}})}function un(t,e,n){return typeof t.default=="function"?t.default(e,n):t.default}function vp(t,e){return!t["~run"]({value:e},Hr).issues}function jr(){return D({kind:"schema",type:"any",reference:jr,expects:"any",async:!1,"~run"(t){return t.typed=!0,t}})}function U(t,e){return D({kind:"schema",type:"array",reference:U,expects:"Array",async:!1,item:t,message:e,"~run"(n,s){const i=n.value;if(Array.isArray(i)){n.typed=!0,n.value=[];for(let r=0;r<i.length;r++){const o=i[r],a=this.item["~run"]({value:o},s);if(a.issues){const l={type:"array",origin:"value",input:i,key:r,value:o};for(const c of a.issues)c.path?c.path.unshift(l):c.path=[l],n.issues?.push(c);if(n.issues||(n.issues=a.issues),s.abortEarly){n.typed=!1;break}}a.typed||(n.typed=!1),n.value.push(a.value)}}else T(this,"type",n,s);return n}})}function gn(t){return D({kind:"schema",type:"boolean",reference:gn,expects:"boolean",async:!1,message:t,"~run"(e,n){return typeof e.value=="boolean"?e.typed=!0:T(this,"type",e,n),e}})}function B(t,e){return D({kind:"schema",type:"exact_optional",reference:B,expects:t.expects,async:!1,wrapped:t,default:e,"~run"(n,s){return this.wrapped["~run"](n,s)}})}function Br(t){return D({kind:"schema",type:"lazy",reference:Br,expects:"unknown",async:!1,getter:t,"~run"(e,n){return this.getter(e.value)["~run"](e,n)}})}function G(t,e){return D({kind:"schema",type:"literal",reference:G,expects:et(t),async:!1,literal:t,message:e,"~run"(n,s){return hp(n.value,this.literal)?n.typed=!0:T(this,"type",n,s),n}})}function Cs(t){return D({kind:"schema",type:"null",reference:Cs,expects:"null",async:!1,message:t,"~run"(e,n){return e.value===null?e.typed=!0:T(this,"type",e,n),e}})}function Fr(t,e){return D({kind:"schema",type:"nullable",reference:Fr,expects:`(${t.expects} | null)`,async:!1,wrapped:t,default:e,"~run"(n,s){return n.value===null&&(this.default!==void 0&&(n.value=un(this,n,s)),n.value===null)?(n.typed=!0,n):this.wrapped["~run"](n,s)}})}function Gr(t){return D({kind:"schema",type:"number",reference:Gr,expects:"number",async:!1,message:t,"~run"(e,n){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:T(this,"type",e,n),e}})}function R(t,e){return D({kind:"schema",type:"object",reference:R,expects:"Object",async:!1,entries:t,message:e,"~run"(n,s){const i=n.value;if(i&&typeof i=="object"){n.typed=!0,n.value={};for(const r in this.entries){const o=this.entries[r];if(r in i||(o.type==="exact_optional"||o.type==="optional"||o.type==="nullish")&&o.default!==void 0){const a=r in i?i[r]:un(o),l=o["~run"]({value:a},s);if(l.issues){const c={type:"object",origin:"value",input:i,key:r,value:a};for(const d of l.issues)d.path?d.path.unshift(c):d.path=[c],n.issues?.push(d);if(n.issues||(n.issues=l.issues),s.abortEarly){n.typed=!1;break}}l.typed||(n.typed=!1),n.value[r]=l.value}else if(o.fallback!==void 0)n.value[r]=Es(o);else if(o.type!=="exact_optional"&&o.type!=="optional"&&o.type!=="nullish"&&(T(this,"key",n,s,{input:void 0,expected:`"${r}"`,path:[{type:"object",origin:"key",input:i,key:r,value:i[r]}]}),s.abortEarly))break}}else T(this,"type",n,s);return n}})}function N(t,e){return D({kind:"schema",type:"optional",reference:N,expects:`(${t.expects} | undefined)`,async:!1,wrapped:t,default:e,"~run"(n,s){return n.value===void 0&&(this.default!==void 0&&(n.value=un(this,n,s)),n.value===void 0)?(n.typed=!0,n):this.wrapped["~run"](n,s)}})}function _t(t,e){return D({kind:"schema",type:"picklist",reference:_t,expects:As(t.map(et),"|"),async:!1,options:t,message:e,"~run"(n,s){return this.options.includes(n.value)?n.typed=!0:T(this,"type",n,s),n}})}function Oe(t,e,n){return D({kind:"schema",type:"record",reference:Oe,expects:"Object",async:!1,key:t,value:e,message:n,"~run"(s,i){const r=s.value;if(r&&typeof r=="object"){s.typed=!0,s.value={};for(const o in r)if(up(r,o)){const a=r[o],l=this.key["~run"]({value:o},i);if(l.issues){const d={type:"object",origin:"key",input:r,key:o,value:a};for(const h of l.issues)h.path=[d],s.issues?.push(h);if(s.issues||(s.issues=l.issues),i.abortEarly){s.typed=!1;break}}const c=this.value["~run"]({value:a},i);if(c.issues){const d={type:"object",origin:"value",input:r,key:o,value:a};for(const h of c.issues)h.path?h.path.unshift(d):h.path=[d],s.issues?.push(h);if(s.issues||(s.issues=c.issues),i.abortEarly){s.typed=!1;break}}(!l.typed||!c.typed)&&(s.typed=!1),l.typed&&(s.value[l.value]=c.value)}}else T(this,"type",s,i);return s}})}function L(t,e){return D({kind:"schema",type:"strict_object",reference:L,expects:"Object",async:!1,entries:t,message:e,"~run"(n,s){const i=n.value;if(i&&typeof i=="object"){n.typed=!0,n.value={};for(const r in this.entries){const o=this.entries[r];if(r in i||(o.type==="exact_optional"||o.type==="optional"||o.type==="nullish")&&o.default!==void 0){const a=r in i?i[r]:un(o),l=o["~run"]({value:a},s);if(l.issues){const c={type:"object",origin:"value",input:i,key:r,value:a};for(const d of l.issues)d.path?d.path.unshift(c):d.path=[c],n.issues?.push(d);if(n.issues||(n.issues=l.issues),s.abortEarly){n.typed=!1;break}}l.typed||(n.typed=!1),n.value[r]=l.value}else if(o.fallback!==void 0)n.value[r]=Es(o);else if(o.type!=="exact_optional"&&o.type!=="optional"&&o.type!=="nullish"&&(T(this,"key",n,s,{input:void 0,expected:`"${r}"`,path:[{type:"object",origin:"key",input:i,key:r,value:i[r]}]}),s.abortEarly))break}if(!n.issues||!s.abortEarly){for(const r in i)if(!Object.prototype.hasOwnProperty.call(this.entries,r)){T(this,"key",n,s,{input:r,expected:"never",path:[{type:"object",origin:"key",input:i,key:r,value:i[r]}]});break}}}else T(this,"type",n,s);return n}})}function v(t){return D({kind:"schema",type:"string",reference:v,expects:"string",async:!1,message:t,"~run"(e,n){return typeof e.value=="string"?e.typed=!0:T(this,"type",e,n),e}})}function Wr(t){let e;if(t)for(const n of t)if(e)for(const s of n.issues)e.push(s);else e=n.issues;return e}function fn(t,e){return D({kind:"schema",type:"union",reference:fn,expects:As(t.map(n=>n.expects),"|"),async:!1,options:t,message:e,"~run"(n,s){let i,r,o;for(const a of this.options){const l=a["~run"]({value:n.value},s);if(l.typed)if(l.issues)r?r.push(l):r=[l];else{i=l;break}else o?o.push(l):o=[l]}if(i)return i;if(r){if(r.length===1)return r[0];T(this,"type",n,s,{issues:Wr(r)}),n.typed=!0}else{if(o?.length===1)return o[0];T(this,"type",n,s,{issues:Wr(o)})}return n}})}function xe(){return D({kind:"schema",type:"unknown",reference:xe,expects:"unknown",async:!1,"~run"(t){return t.typed=!0,t}})}function mn(t,e,n){return D({kind:"schema",type:"variant",reference:mn,expects:"Object",async:!1,key:t,options:e,message:n,"~run"(s,i){const r=s.value;if(r&&typeof r=="object"){let o,a=0,l=this.key,c=[];const d=(h,f)=>{for(const p of h.options){if(p.type==="variant")d(p,new Set(f).add(p.key));else{let g=!0,u=0;for(const m of f){const x=p.entries[m];if(m in r?x["~run"]({typed:!1,value:r[m]},Hr).issues:x.type!=="exact_optional"&&x.type!=="optional"&&x.type!=="nullish"){g=!1,l!==m&&(a<u||a===u&&m in r&&!(l in r))&&(a=u,l=m,c=[]),l===m&&c.push(p.entries[m].expects);break}u++}if(g){const m=p["~run"]({value:r},i);(!o||!o.typed&&m.typed)&&(o=m)}}if(o&&!o.issues)break}};if(d(this,new Set([this.key])),o)return o;T(this,"type",s,i,{input:r[l],expected:As(c,"|"),path:[{type:"object",origin:"value",input:r,key:l,value:r[l]}]})}else T(this,"type",s,i);return s}})}function Mt(t,e,n){const s=t["~run"]({value:e},Ss());if(s.issues)throw new fp(s.issues);return s.value}function w(...t){return D({...t[0],pipe:t,"~run"(e,n){for(const s of t)if(s.kind!=="metadata"){if(e.issues&&(s.kind==="schema"||s.kind==="transformation")){e.typed=!1;break}(!e.issues||!n.abortEarly&&!n.abortPipeEarly)&&(e=s["~run"](e,n))}return e}})}function C(t,e,n){const s=t["~run"]({value:e},Ss());return{typed:s.typed,success:!s.issues,output:s.value,issues:s.issues}}function xp(t){let e="";for(const n of t){e&&(e+=`
222
- `),e+=`\xD7 ${n.message}`;const s=gp(n);s&&(e+=`
223
- \u2192 at ${s}`)}return e}const Kr=(t,e,n)=>n.top<e.top?t+n.top-e.top:n.bottom<=e.bottom?t:t+Math.min(n.bottom-e.bottom,n.top-e.top),Vr=(t,e,n)=>{const s=Math.min(n,e/4);return{top:t+s,bottom:t+e-s}},Ts=(t,e,n=0)=>{const s=t.getBoundingClientRect();t.scrollTop=Kr(t.scrollTop,Vr(s.top+t.clientTop,t.clientHeight,n),e.getBoundingClientRect())},Yr=(t,e,n=0)=>{const s=t.getBoundingClientRect(),i=e.getBoundingClientRect();t.scrollLeft=Kr(t.scrollLeft,Vr(s.left+t.clientLeft,t.clientWidth,n),{top:i.left,bottom:i.right})},yp=16,wp=(t,e)=>{const n=t.deltaMode===1?yp:t.deltaMode===2?e:1;return{dx:t.deltaX*n,dy:t.deltaY*n}},$p=(t,e)=>{if(e.ctrlKey)return!1;const n=t.scrollHeight>t.clientHeight,s=t.scrollWidth>t.clientWidth;if(!n&&!s)return!1;const{dx:i,dy:r}=wp(e,t.clientHeight),o=Math.min(Math.max(t.scrollTop+r,0),t.scrollHeight-t.clientHeight),a=Math.min(Math.max(t.scrollLeft+i,0),t.scrollWidth-t.clientWidth);return o===t.scrollTop&&a===t.scrollLeft?!1:(t.scrollTop=o,t.scrollLeft=a,!0)},kn=R({type:w(v(),S(1)),id:w(v(),S(1))}),Rs=w(v(),S(1),te(/^[A-Za-z0-9_-]+$/,'ids may only contain letters, digits, "_" and "-" (a "." builds a path)')),Sp=(t,e)=>{if(e===1)return t.includes(".")?null:[t];const n=t.split(".");return n.length===e&&n.every(s=>s.length>0)?n:null},Pe=R({id:w(v(),S(1)),type:w(v(),S(1)),target:kn,payload:xe(),note:B(v()),createdAt:w(v(),S(1))}),bn=(t,e,n,s={})=>{const i=R({id:w(v(),S(1)),type:G(t),target:kn,payload:n,note:B(v()),createdAt:w(v(),S(1))}),r=o=>{const a=C(Pe,o);if(!a.success||a.output.type!==t)return null;const l=C(n,o.payload);return l.success?{id:a.output.id,type:t,target:a.output.target,payload:l.output,...a.output.note===void 0?{}:{note:a.output.note},createdAt:a.output.createdAt}:null};return{schema:i,mode:s.mode??"patch",targetType:e,actionType:t,payloadSchema:n,parse:r,...s.dedupeKey?{dedupeKey:s.dedupeKey}:{}}},Ot=(t,e)=>{const n=tt(t,e.type);if(n===void 0)return null;const s=n.parse(e);return s===null?null:s},Ap=(t,e)=>{const n=C(t.payloadSchema,e.payload);if(!n.success)throw new Error(`invalid payload for action "${e.type}"`);return n.output},tt=(t,e)=>Object.hasOwn(t,e)?t[e]:void 0,Ep=t=>{throw new Error(`unhandled action: ${JSON.stringify(t)}`)},Cp=R({id:w(v(),S(1))}),Tp=t=>{const e=C(Cp,t.payload);return`${t.type}|${e.success?e.output.id:JSON.stringify(t.payload)}`},P=t=>`${t.type}:${t.id}`,Le=t=>{const e=t.indexOf(":");return e<=0?{type:"unknown",id:t}:{type:t.slice(0,e),id:t.slice(e+1)}},vn=(t,e)=>typeof t=="string"?Le(t.includes(":")?t:`${e}:${t}`):{type:t.type,id:t.id},Rp=(t,e)=>t.type===e.type&&t.id===e.id,Zr=t=>{const e=t.normalize("NFKD").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40);return e.length>0?e:"item"},_p=(t,e)=>{const n=Zr(t),s=new Set(e);if(!s.has(n))return n;for(let i=2;i<1e3;i+=1){const r=`${n}-${i}`;if(!s.has(r))return r}return`${n}-${Math.random().toString(36).slice(2,8)}`},Qr=()=>{const t=globalThis.crypto;return t?.randomUUID?t.randomUUID():`a-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`},H="comment",ze=t=>{const[e]=t;return{path:e?.path?.map(n=>String(n.key)).join(".")??"",message:e?.message??"invalid action"}},Xr=R({type:w(v(),S(1)),target:fn([w(v(),S(1)),kn]),payload:N(xe()),note:B(v()),id:B(w(v(),S(1))),createdAt:B(w(v(),S(1)))}),Mp=(t,e)=>{const n=C(Xr,t);if(!n.success)return{ok:!1,issue:ze(n.issues)};const s=n.output,i=vn(s.target,e.targetType),r={id:s.id??Qr(),type:s.type,target:i,payload:s.payload??{},...s.note===void 0?{}:{note:s.note},createdAt:s.createdAt??new Date().toISOString()},o=C(e.schema,r);if(!o.success)return{ok:!1,issue:ze(o.issues)};const a=C(Pe,o.output);return a.success?{ok:!0,action:a.output}:{ok:!1,issue:ze(a.issues)}},_s=(t,e)=>e.dedupeKey?e.dedupeKey(t):e.mode!=="patch"?null:`${t.type}|${P(t.target)}`,Jr=(t,e,n)=>{const s=_s(e,n);if(s===null)return[...t,e];const i=t.at(-1);return!i||i.type!==e.type||_s(i,n)!==s||!Op(i,e)?[...t,e]:[...t.slice(0,-1),e]},Op=(t,e)=>Rp(t.target,e.target),Ms=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),Pt=Object.freeze({}),xn=t=>{const e=t.startsWith("#")?t.slice(1):t;if(e.length===0)return Pt;const n=new URLSearchParams(e.startsWith("?")?e.slice(1):e),s={};for(const[i,r]of n)i.length>0&&r.length>0&&(s[i]=r);return s},nt=t=>{const e=new URLSearchParams;for(const s of Object.keys(t).sort((i,r)=>i<r?-1:i>r?1:0)){const i=t[s];i!=null&&i!==""&&e.set(s,i)}const n=e.toString();return n.length===0?"":`#${n}`},yn=(t,e,n=[])=>{const s={...t},i=Object.keys(e).map(r=>n.indexOf(r)).filter(r=>r>=0);if(i.length>0)for(const r of n.slice(Math.min(...i)+1))Object.hasOwn(e,r)||delete s[r];for(const[r,o]of Object.entries(e))o==null||o===""?delete s[r]:s[r]=o;return s},eo="data-dpk-changes",Pp=/^[^:\s]+:\S+$/,Lp=L({id:N(w(v(),S(1))),title:w(v(),S(1)),body:N(v()),target:N(w(v(),te(Pp,'target must be written "type:id"'))),navigate:N(w(v(),zr("=",'navigate must be written "key=value"')))}),zp=U(Lp),Dp=w(v(),S(1)),to=L({revision:Dp,changes:zp}),Ip=L({revisions:w(U(to),S(1,"list at least one version"))}),Np=(t,e)=>JSON.stringify([t,e]),st=t=>[...t.earlier,t.latest],qp=t=>{const e=t.changes.map((s,i)=>{const r=s.id??String(i);return{key:Np(t.revision,r),id:r,revision:t.revision,title:s.title,body:s.body??null,target:s.target??null,navigate:s.navigate??null}});return new Set(e.map(s=>s.id)).size!==e.length?`change ids must be unique within version "${t.revision}"`:{revision:t.revision,entries:e}},Up=t=>{const e=typeof t=="object"&&t!==null&&"revisions"in t,n=C(e?Ip:to,t);if(!n.success)return{ok:!1,error:xp(n.issues)};const s=n.output,i="revisions"in s?s.revisions:[s],r=[];for(const a of i){if(r.some(c=>c.revision===a.revision))return{ok:!1,error:`version "${a.revision}" is listed twice`};const l=qp(a);if(typeof l=="string")return{ok:!1,error:l};r.push(l)}const o=r.pop();return o?{ok:!0,log:{earlier:r,latest:o}}:{ok:!1,error:"list at least one version"}},Hp=L({v:G(1),revision:v(),seen:U(v())}),jp=L({v:G(2),since:v(),seen:Oe(v(),U(v()))}),no=t=>{const e=C(jp,t);if(e.success)return e.output;const n=C(Hp,t);return n.success?{v:2,since:n.output.revision,seen:{[n.output.revision]:n.output.seen}}:null},Os={open:!1,fresh:new Set},so=t=>e=>t.told.has(e.revision)&&!t.seen.has(e.key),Ps=(t,e)=>st(t).flatMap(n=>n.entries.filter(so(e))),io=t=>t.target!==null||t.navigate!==null,Bp=(t,e)=>{const n=st(t),s=e===null?-1:n.findIndex(o=>o.revision===e.since),i=e===null?[t.latest]:n.slice(Math.max(0,s)),r=new Set(i.flatMap(o=>{const a=new Set(e?.seen[o.revision]??[]);return o.entries.filter(l=>a.has(l.id)).map(l=>l.key)}));return{told:new Set(i.map(o=>o.revision)),seen:r,toasts:t.latest.entries.filter(o=>!r.has(o.key)).map(o=>o.key),list:Os}},Ls=(t,e)=>new Set([...t.seen,...e]),Fp=(t,e,n)=>{switch(n.kind){case"open-list":{const s=Ps(t,e),i=new Set(s.map(o=>o.key)),r=s.filter(o=>!io(o)).map(o=>o.key);return{...e,seen:Ls(e,r),toasts:[],list:{open:!0,fresh:i}}}case"close-list":return{...e,list:Os};case"close-toast":return{...e,toasts:e.toasts.filter(s=>s!==n.key)};case"jump":return{...e,seen:Ls(e,[n.key]),toasts:e.toasts.filter(s=>s!==n.key),list:Os};case"read-all":return{...e,seen:Ls(e,Ps(t,e).map(s=>s.key)),toasts:[],list:{open:e.list.open,fresh:new Set}}}},Gp=(t,e)=>Ps(t,e).length,Wp=(t,e)=>{const n=st(t),s=n.findIndex(o=>e.told.has(o.revision)&&o.entries.some(so(e))),i=s===-1?n.length-1:s,r=n.slice(i).flatMap(o=>{const a=o.entries.filter(l=>e.seen.has(l.key)).map(l=>l.id);return a.length>0?[[o.revision,a]]:[]});return{v:2,since:n[i]?.revision??t.latest.revision,seen:Object.fromEntries(r)}},Kp=(t,e)=>t.target===null&&t.navigate===null?null:{navigate:t.navigate!==null?xn(t.navigate):t.target!==null?e(Le(t.target)):null,target:t.target},ro=3,Vp=t=>e=>({key:e.key,id:e.id,revision:e.revision,title:e.title,body:e.body,jumpable:io(e),fresh:t.list.fresh.has(e.key)}),Yp=(t,e)=>{const n=st(t).map(r=>({revision:r.revision,latest:r===t.latest,cards:r.entries.map(Vp(e))})).reverse(),s=new Map(n.flatMap(r=>r.cards.map(o=>[o.key,o]))),i=e.toasts.flatMap(r=>{const o=s.get(r);return o?[o]:[]});return{unread:Gp(t,e),open:e.list.open,groups:n,toasts:i.slice(0,ro),waiting:Math.max(0,i.length-ro)}},Zp=L({revision:fn([v(),Cs()])}),Qp=L({v:G(1),enabled:gn(),checked:Oe(v(),Zp)}),zs={v:1,enabled:!1,checked:{}},oo=t=>{const e=C(Qp,t);return e.success?e.output:null},Xp=(t,e)=>e?{...t,enabled:!0}:{...zs,enabled:!1},Jp=t=>t===null?null:t.latest.revision,ao=(t,e,n)=>{const s=t.checked[e];if(!s)return"unchecked";if(n===null||s.revision===null)return"checked";const i=st(n),r=i.findIndex(l=>l.revision===s.revision);return(r===-1?i:i.slice(r+1)).some(l=>l.entries.some(c=>c.target===e))?"stale":"checked"},eh=t=>Object.keys(t.checked).length>0,th=(t,e,n,s)=>{if(n==="checked"){const{[e]:i,...r}=t.checked;return{...t,checked:r}}return{...t,checked:{...t.checked,[e]:{revision:s}}}},De=t=>t==="light"||t==="dark"?t:null,lo=t=>t.authored??t.environment,co=t=>t.preference??lo(t),nh=t=>{const e=co(t)==="dark"?"light":"dark";return po(t,e)},po=(t,e)=>e===lo(t)?null:e,Ds="element",ho=w(v(),te(/^[A-Z][A-Z0-9_]*$/,"component action types are CONSTANT_CASE")),uo=Oe(v(),xe()),sh=R({type:G(Ds),id:w(v(),te(/^[^/]+\/.+/,"component references start with a provider id"))}),ih=R({id:w(v(),S(1)),type:ho,target:sh,payload:uo,note:B(v()),createdAt:w(v(),S(1))}),rh={schema:ih,mode:"sequence",targetType:Ds},oh=L({type:ho,target:w(v(),te(/^element:[^/]+\/.+/)),payload:N(uo,{})}),go=L({id:w(v(),S(1)),title:w(v(),S(1)),summary:B(v()),tone:B(_t(["create","update","delete","move","meta"])),stale:B(_t(["unsupported-action-type","target-missing","constraint-violated"]))}),Is=t=>{if(t.type!==Ds)return null;const e=t.id.indexOf("/");if(e<=0)return null;try{return decodeURIComponent(t.id.slice(0,e))}catch{return null}},re=t=>t.type!==H&&Is(t.target)!==null,fo=(t,e)=>t.filter(n=>re(n)&&Is(n.target)===e),mo=(t,e)=>{const n=new Map(t.flatMap(s=>re(s)?[[s.id,Is(s.target)]]:[]));return new Map(e.flatMap(s=>s.results.flatMap(i=>n.get(i.id)===s.id?[[i.id,i]]:[])))},ko=U(L({value:w(v(),te(/^element:.+/)),label:w(v(),S(1)),group:B(v())})),ah=R({targets:ko,providers:U(R({id:w(v(),S(1)),results:U(go)}))}),lh=L({target:w(v(),te(/^element:.+/)),body:w(v(),hn(),S(1))}),bo=t=>t.group?`${t.group} \xB7 ${t.label}`:t.label,vo=(t,e,n)=>{const s=new Map(e.map(i=>[i.value,i]));return{...t,hasTarget:(i,r)=>t.hasTarget(i,r)||s.has(P(r)),commentTargets:(i,r)=>{const o=t.commentTargets(i,r),a=new Set(o.map(l=>l.value));return[...o,...e.filter(l=>!a.has(l.value))]},describe:(i,r,o)=>{if(re(i)){const c=n.get(i.id),d=s.get(P(i.target));return{title:c?.title??i.type,...c?.summary===void 0?{}:{summary:c.summary},tone:c?.tone??"update",targetLabel:d?bo(d):i.target.id}}const a=t.describe(i,r,o),l=i.type==="comment"&&!t.hasTarget(r,i.target)?s.get(P(i.target)):void 0;return l===void 0?a:{...a,targetLabel:bo(l)}},serialize:i=>re(i)?`${i.type} ${P(i.target)} ${JSON.stringify(i.payload)}`:t.serialize(i)}};let dh=0;class xo{#e;#s=`dpk-confirm-dialog-${++dh}`;#t=null;#n=null;#i=!1;constructor(e){this.#e=e,e.addController(this)}hostConnected(){}hostUpdated(){if(!this.#i)return;const e=this.#r();e&&!e.open&&(e.showModal(),this.#i=!1)}hostDisconnected(){this.#a(!1)}ask(e){return this.#a(!1),this.#t=e,this.#i=!0,this.#e.requestUpdate(),new Promise(n=>{this.#n=n})}render(){if(this.#t===null)return b;const{title:e,body:n,confirmLabel:s,cancelLabel:i,tone:r}=this.#t;return k`
224
- <dialog class="dpk-confirm-dialog" data-dpk-confirm-dialog=${this.#s} @close=${this.#o}>
221
+ `,zr=(t,e,n)=>n.top<e.top?t+n.top-e.top:n.bottom<=e.bottom?t:t+Math.min(n.bottom-e.bottom,n.top-e.top),Ir=(t,e,n)=>{const s=Math.min(n,e/4);return{top:t+s,bottom:t+e-s}},ws=(t,e,n=0)=>{const s=t.getBoundingClientRect();t.scrollTop=zr(t.scrollTop,Ir(s.top+t.clientTop,t.clientHeight,n),e.getBoundingClientRect())},Dr=(t,e,n=0)=>{const s=t.getBoundingClientRect(),i=e.getBoundingClientRect();t.scrollLeft=zr(t.scrollLeft,Ir(s.left+t.clientLeft,t.clientWidth,n),{top:i.left,bottom:i.right})},hp=16,up=(t,e)=>{const n=t.deltaMode===1?hp:t.deltaMode===2?e:1;return{dx:t.deltaX*n,dy:t.deltaY*n}},gp=(t,e)=>{if(e.ctrlKey)return!1;const n=t.scrollHeight>t.clientHeight,s=t.scrollWidth>t.clientWidth;if(!n&&!s)return!1;const{dx:i,dy:r}=up(e,t.clientHeight),o=Math.min(Math.max(t.scrollTop+r,0),t.scrollHeight-t.clientHeight),a=Math.min(Math.max(t.scrollLeft+i,0),t.scrollWidth-t.clientWidth);return o===t.scrollTop&&a===t.scrollLeft?!1:(t.scrollTop=o,t.scrollLeft=a,!0)},Nr="dev-process-kit:action-writer",fp=O({writer:$(x(),le(/^[A-Za-z0-9_-]+$/)),seq:$(Vd(),Kd(),Wd(0))}),mp=()=>{const t=globalThis.crypto,e=new Uint8Array(8);if(t?.getRandomValues)t.getRandomValues(e);else for(let n=0;n<e.length;n+=1)e[n]=Math.floor(Math.random()*256);return[...e].map(n=>(n%36).toString(36)).join("")},kp=t=>{if(t===null)return null;try{const e=C(fp,JSON.parse(t));return e.success?e.output:null}catch{return null}},bp=t=>{let e=null;return()=>{let n=null;try{n=t===null?null:kp(t.getItem(Nr))}catch{}const s=n!==null&&e!==null&&n.writer===e.writer&&e.seq>n.seq?e:n??e??{writer:mp(),seq:0},i={writer:s.writer,seq:s.seq+1};e=i;try{t?.setItem(Nr,JSON.stringify(i))}catch{}return`${i.writer}:${i.seq}`}},vp=()=>{try{return typeof localStorage>"u"?null:localStorage}catch{return null}};let qr=null;const pn=()=>(qr??=bp(vp()),qr()),_=t=>`${t.type}:${t.id}`,Re=t=>{const e=t.indexOf(":");return e<=0?{type:"unknown",id:t}:{type:t.slice(0,e),id:t.slice(e+1)}},hn=(t,e)=>typeof t=="string"?Re(t.includes(":")?t:`${e}:${t}`):{type:t.type,id:t.id},xp=(t,e)=>t.type===e.type&&t.id===e.id,Ur=t=>{const e=t.normalize("NFKD").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40);return e.length>0?e:"item"},wp=(t,e)=>{const n=Ur(t),s=new Set(e);if(!s.has(n))return n;for(let i=2;i<1e3;i+=1){const r=`${n}-${i}`;if(!s.has(r))return r}return`${n}-${Math.random().toString(36).slice(2,8)}`},D="comment",Me=t=>{const[e]=t;return{path:e?.path?.map(n=>String(n.key)).join(".")??"",message:e?.message??"invalid action"}},Hr=O({type:$(x(),E(1)),target:Qi([$(x(),E(1)),Yd]),payload:I(yt()),note:W(x()),id:W($(x(),E(1))),createdAt:W($(x(),E(1)))}),yp=(t,e)=>{const n=C(Hr,t);if(!n.success)return{ok:!1,issue:Me(n.issues)};const s=n.output,i=hn(s.target,e.targetType),r={id:s.id??pn(),type:s.type,target:i,payload:s.payload??{},...s.note===void 0?{}:{note:s.note},createdAt:s.createdAt??new Date().toISOString()},o=C(e.schema,r);if(!o.success)return{ok:!1,issue:Me(o.issues)};const a=C(wt,o.output);return a.success?{ok:!0,action:a.output}:{ok:!1,issue:Me(a.issues)}},ys=(t,e)=>e.dedupeKey?e.dedupeKey(t):e.mode!=="patch"?null:`${t.type}|${_(t.target)}`,Br=(t,e,n)=>{const s=ys(e,n);if(s===null)return[...t,e];const i=t.at(-1);return!i||i.type!==e.type||ys(i,n)!==s||!$p(i,e)?[...t,e]:[...t.slice(0,-1),e]},$p=(t,e)=>xp(t.target,e.target),$s=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),Oe=new Map,Sp=/^([A-Za-z0-9_-]+):([1-9][0-9]*)$/,Ap=/^([A-Za-z0-9_-]+):([1-9][0-9]*)(?:-([1-9][0-9]*))?$/,Ss=t=>{const e=Sp.exec(t);if(e===null)return null;const n=Number(e[2]);return Number.isSafeInteger(n)?{writer:e[1]??"",seq:n}:null},Ep=t=>{const e=[...t].sort((s,i)=>s[0]-i[0]),n=[];for(const[s,i]of e){const r=n.at(-1);r!==void 0&&s<=r[1]+1?r[1]=Math.max(r[1],i):n.push([s,i])}return n},jr=(t,e,n)=>{const s=new Map(t);return s.set(e,Ep([...t.get(e)??[],...n])),s},Cp=t=>{let e=Oe;for(const n of t.split(",")){const s=n.trim();if(s.length===0)continue;const i=Ap.exec(s);if(i===null)return`"${s}" is not written "writer:from-to"`;const r=Number(i[2]),o=i[3]===void 0?r:Number(i[3]);if(!Number.isSafeInteger(r)||!Number.isSafeInteger(o))return`"${s}" is out of range`;if(o<r)return`"${s}" ends before it starts`;e=jr(e,i[1]??"",[[r,o]])}return e},Tp=t=>[...t.keys()].sort().flatMap(e=>(t.get(e)??[]).map(([n,s])=>n===s?`${e}:${n}`:`${e}:${n}-${s}`)).join(","),As=(t,e)=>{const n=Ss(e);return n===null?!1:(t.get(n.writer)??[]).some(([s,i])=>n.seq>=s&&n.seq<=i)},Rp=(t,e)=>{const n=new Map;for(const i of e){const r=Ss(i);r!==null&&n.set(r.writer,Math.max(n.get(r.writer)??0,r.seq))}let s=t;for(const[i,r]of n)s=jr(s,i,[[1,r]]);return s},Rt=Object.freeze({}),un=t=>{const e=t.startsWith("#")?t.slice(1):t;if(e.length===0)return Rt;const n=new URLSearchParams(e.startsWith("?")?e.slice(1):e),s={};for(const[i,r]of n)i.length>0&&r.length>0&&(s[i]=r);return s},Qe=t=>{const e=new URLSearchParams;for(const s of Object.keys(t).sort((i,r)=>i<r?-1:i>r?1:0)){const i=t[s];i!=null&&i!==""&&e.set(s,i)}const n=e.toString();return n.length===0?"":`#${n}`},gn=(t,e,n=[])=>{const s={...t},i=Object.keys(e).map(r=>n.indexOf(r)).filter(r=>r>=0);if(i.length>0)for(const r of n.slice(Math.min(...i)+1))Object.hasOwn(e,r)||delete s[r];for(const[r,o]of Object.entries(e))o==null||o===""?delete s[r]:s[r]=o;return s},Fr="data-dpk-changes",Mp=/^[^:\s]+:\S+$/,Op=z({id:I($(x(),E(1))),title:$(x(),E(1)),body:I(x()),target:I($(x(),le(Mp,'target must be written "type:id"'))),navigate:I($(x(),Qd("=",'navigate must be written "key=value"')))}),_p=H(Op),Pp=$(x(),E(1)),Gr=I(x()),Wr=z({revision:Pp,changes:_p,addressed:Gr}),Lp=z({addressed:Gr,revisions:$(H(Wr),E(1,"list at least one version"))}),zp=(t,e)=>JSON.stringify([t,e]),Xe=t=>[...t.earlier,t.latest],Ip=t=>{const e=t.changes.map((s,i)=>{const r=s.id??String(i);return{key:zp(t.revision,r),id:r,revision:t.revision,title:s.title,body:s.body??null,target:s.target??null,navigate:s.navigate??null}});return new Set(e.map(s=>s.id)).size!==e.length?`change ids must be unique within version "${t.revision}"`:{revision:t.revision,entries:e}},Dp=t=>{const n=typeof t=="object"&&t!==null&&"revisions"in t?C(Lp,t):C(Wr,t);if(!n.success)return{ok:!1,error:Zd(n.issues)};const s=n.output,i=s.addressed===void 0?Oe:Cp(s.addressed);if(typeof i=="string")return{ok:!1,error:`addressed: ${i}`};const r="revisions"in s?s.revisions:[s],o=[];for(const l of r){if(o.some(h=>h.revision===l.revision))return{ok:!1,error:`version "${l.revision}" is listed twice`};const p=Ip(l);if(typeof p=="string")return{ok:!1,error:p};o.push(p)}const a=o.pop();return a?{ok:!0,log:{earlier:o,latest:a,addressed:i}}:{ok:!1,error:"list at least one version"}},Np=z({v:K(1),revision:x(),seen:H(x())}),qp=z({v:K(2),since:x(),seen:$t(x(),H(x()))}),Kr=t=>{const e=C(qp,t);if(e.success)return e.output;const n=C(Np,t);return n.success?{v:2,since:n.output.revision,seen:{[n.output.revision]:n.output.seen}}:null},Es={open:!1,fresh:new Set},Vr=t=>e=>t.told.has(e.revision)&&!t.seen.has(e.key),Cs=(t,e)=>Xe(t).flatMap(n=>n.entries.filter(Vr(e))),Yr=t=>t.target!==null||t.navigate!==null,Up=(t,e)=>{const n=Xe(t),s=e===null?-1:n.findIndex(o=>o.revision===e.since),i=e===null?[t.latest]:n.slice(Math.max(0,s)),r=new Set(i.flatMap(o=>{const a=new Set(e?.seen[o.revision]??[]);return o.entries.filter(l=>a.has(l.id)).map(l=>l.key)}));return{told:new Set(i.map(o=>o.revision)),seen:r,toasts:t.latest.entries.filter(o=>!r.has(o.key)).map(o=>o.key),list:Es}},Ts=(t,e)=>new Set([...t.seen,...e]),Hp=(t,e,n)=>{switch(n.kind){case"open-list":{const s=Cs(t,e),i=new Set(s.map(o=>o.key)),r=s.filter(o=>!Yr(o)).map(o=>o.key);return{...e,seen:Ts(e,r),toasts:[],list:{open:!0,fresh:i}}}case"close-list":return{...e,list:Es};case"close-toast":return{...e,toasts:e.toasts.filter(s=>s!==n.key)};case"jump":return{...e,seen:Ts(e,[n.key]),toasts:e.toasts.filter(s=>s!==n.key),list:Es};case"read-all":return{...e,seen:Ts(e,Cs(t,e).map(s=>s.key)),toasts:[],list:{open:e.list.open,fresh:new Set}}}},Bp=(t,e)=>Cs(t,e).length,jp=(t,e)=>{const n=Xe(t),s=n.findIndex(o=>e.told.has(o.revision)&&o.entries.some(Vr(e))),i=s===-1?n.length-1:s,r=n.slice(i).flatMap(o=>{const a=o.entries.filter(l=>e.seen.has(l.key)).map(l=>l.id);return a.length>0?[[o.revision,a]]:[]});return{v:2,since:n[i]?.revision??t.latest.revision,seen:Object.fromEntries(r)}},Fp=(t,e)=>t.target===null&&t.navigate===null?null:{navigate:t.navigate!==null?un(t.navigate):t.target!==null?e(Re(t.target)):null,target:t.target},Zr=3,Gp=t=>e=>({key:e.key,id:e.id,revision:e.revision,title:e.title,body:e.body,jumpable:Yr(e),fresh:t.list.fresh.has(e.key)}),Wp=(t,e)=>{const n=Xe(t).map(r=>({revision:r.revision,latest:r===t.latest,cards:r.entries.map(Gp(e))})).reverse(),s=new Map(n.flatMap(r=>r.cards.map(o=>[o.key,o]))),i=e.toasts.flatMap(r=>{const o=s.get(r);return o?[o]:[]});return{unread:Bp(t,e),open:e.list.open,groups:n,toasts:i.slice(0,Zr),waiting:Math.max(0,i.length-Zr)}},Kp=z({revision:Qi([x(),Xd()])}),Vp=z({v:K(1),enabled:Xi(),checked:$t(x(),Kp)}),Rs={v:1,enabled:!1,checked:{}},Qr=t=>{const e=C(Vp,t);return e.success?e.output:null},Yp=(t,e)=>e?{...t,enabled:!0}:{...Rs,enabled:!1},Zp=t=>t===null?null:t.latest.revision,Xr=(t,e,n)=>{const s=t.checked[e];if(!s)return"unchecked";if(n===null||s.revision===null)return"checked";const i=Xe(n),r=i.findIndex(l=>l.revision===s.revision);return(r===-1?i:i.slice(r+1)).some(l=>l.entries.some(p=>p.target===e))?"stale":"checked"},Qp=t=>Object.keys(t.checked).length>0,Xp=(t,e,n,s)=>{if(n==="checked"){const{[e]:i,...r}=t.checked;return{...t,checked:r}}return{...t,checked:{...t.checked,[e]:{revision:s}}}},_e=t=>t==="light"||t==="dark"?t:null,Jr=t=>t.authored??t.environment,eo=t=>t.preference??Jr(t),Jp=t=>{const e=eo(t)==="dark"?"light":"dark";return to(t,e)},to=(t,e)=>e===Jr(t)?null:e,Ms="element",no=$(x(),le(/^[A-Z][A-Z0-9_]*$/,"component action types are CONSTANT_CASE")),so=$t(x(),yt()),eh=O({type:K(Ms),id:$(x(),le(/^[^/]+\/.+/,"component references start with a provider id"))}),th=O({id:$(x(),E(1)),type:no,target:eh,payload:so,note:W(x()),createdAt:$(x(),E(1))}),nh={schema:th,mode:"sequence",targetType:Ms},sh=z({type:no,target:$(x(),le(/^element:[^/]+\/.+/)),payload:I(so,{})}),io=z({id:$(x(),E(1)),title:$(x(),E(1)),summary:W(x()),tone:W(ds(["create","update","delete","move","meta"])),stale:W(ds(["unsupported-action-type","target-missing","constraint-violated"]))}),fn=t=>{if(t.type!==Ms)return null;const e=t.id.indexOf("/");if(e<=0)return null;try{return decodeURIComponent(t.id.slice(0,e))}catch{return null}},ne=t=>t.type!==D&&fn(t.target)!==null,ro=(t,e)=>t.filter(n=>ne(n)&&fn(n.target)===e),oo=(t,e)=>{const n=new Map(t.flatMap(s=>ne(s)?[[s.id,fn(s.target)]]:[]));return new Map(e.flatMap(s=>s.results.flatMap(i=>n.get(i.id)===s.id?[[i.id,i]]:[])))},ao=H(z({value:$(x(),le(/^element:.+/)),label:$(x(),E(1)),group:W(x())})),ih=O({targets:ao,providers:H(O({id:$(x(),E(1)),results:H(io)}))}),rh=z({target:$(x(),le(/^element:.+/)),body:$(x(),Ji(),E(1))}),lo=t=>t.group?`${t.group} \xB7 ${t.label}`:t.label,co=(t,e,n)=>{const s=new Map(e.map(i=>[i.value,i]));return{...t,hasTarget:(i,r)=>t.hasTarget(i,r)||s.has(_(r)),commentTargets:(i,r)=>{const o=t.commentTargets(i,r),a=new Set(o.map(l=>l.value));return[...o,...e.filter(l=>!a.has(l.value))]},describe:(i,r,o)=>{if(ne(i)){const p=n.get(i.id),h=s.get(_(i.target));return{title:p?.title??i.type,...p?.summary===void 0?{}:{summary:p.summary},tone:p?.tone??"update",targetLabel:h?lo(h):i.target.id}}const a=t.describe(i,r,o),l=i.type==="comment"&&!t.hasTarget(r,i.target)?s.get(_(i.target)):void 0;return l===void 0?a:{...a,targetLabel:lo(l)}},serialize:i=>ne(i)?`${i.type} ${_(i.target)} ${JSON.stringify(i.payload)}`:t.serialize(i)}};let oh=0;class po{#e;#n=`dpk-confirm-dialog-${++oh}`;#s=null;#t=null;#i=!1;constructor(e){this.#e=e,e.addController(this)}hostConnected(){}hostUpdated(){if(!this.#i)return;const e=this.#r();e&&!e.open&&(e.showModal(),this.#i=!1)}hostDisconnected(){this.#a(!1)}ask(e){return this.#a(!1),this.#s=e,this.#i=!0,this.#e.requestUpdate(),new Promise(n=>{this.#t=n})}render(){if(this.#s===null)return b;const{title:e,body:n,confirmLabel:s,cancelLabel:i,tone:r}=this.#s;return m`
222
+ <dialog class="dpk-confirm-dialog" data-dpk-confirm-dialog=${this.#n} @close=${this.#o}>
225
223
  <form method="dialog" class="dpk-confirm-dialog-body">
226
224
  <h2 class="dpk-confirm-dialog-title">${e}</h2>
227
- ${n?k`<p class="dpk-confirm-dialog-text">${n}</p>`:b}
225
+ ${n?m`<p class="dpk-confirm-dialog-text">${n}</p>`:b}
228
226
  <div class="dpk-confirm-dialog-actions">
229
227
  <button type="submit" class="dpk-btn dpk-btn--ghost" value="cancel">${i}</button>
230
228
  <button
@@ -237,9 +235,9 @@ const tr=[["path",{d:"M12 5v14"}],["path",{d:"m19 12-7 7-7-7"}]],Zd=[["path",{d:
237
235
  </div>
238
236
  </form>
239
237
  </dialog>
240
- `}#r(){return this.#e.renderRoot.querySelector(`dialog[data-dpk-confirm-dialog="${this.#s}"]`)??null}#o=()=>{const e=this.#r();this.#a(e?.returnValue==="confirm")};#a(e){const n=this.#n;this.#n=null,this.#t=null,this.#i=!1,this.#e.requestUpdate(),n?.(e)}}const it=Math.min,pe=Math.max,wn=Math.round,$n=Math.floor,he=t=>({x:t,y:t}),ch={left:"right",right:"left",bottom:"top",top:"bottom"};function ph(t,e,n){return pe(t,it(e,n))}function Lt(t,e){return typeof t=="function"?t(e):t}function Ie(t){return t.split("-")[0]}function zt(t){return t.split("-")[1]}function yo(t){return t==="x"?"y":"x"}function wo(t){return t==="y"?"height":"width"}function ue(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function $o(t){return yo(ue(t))}function hh(t,e,n){n===void 0&&(n=!1);const s=zt(t),i=$o(t),r=wo(i);let o=i==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(o=Sn(o)),[o,Sn(o)]}function uh(t){const e=Sn(t);return[Ns(t),e,Ns(e)]}function Ns(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const So=["left","right"],Ao=["right","left"],gh=["top","bottom"],fh=["bottom","top"];function mh(t,e,n){switch(t){case"top":case"bottom":return n?e?Ao:So:e?So:Ao;case"left":case"right":return e?gh:fh;default:return[]}}function kh(t,e,n,s){const i=zt(t);let r=mh(Ie(t),n==="start",s);return i&&(r=r.map(o=>o+"-"+i),e&&(r=r.concat(r.map(Ns)))),r}function Sn(t){const e=Ie(t);return ch[e]+t.slice(e.length)}function bh(t){var e,n,s,i;return{top:(e=t.top)!=null?e:0,right:(n=t.right)!=null?n:0,bottom:(s=t.bottom)!=null?s:0,left:(i=t.left)!=null?i:0}}function vh(t){return typeof t!="number"?bh(t):{top:t,right:t,bottom:t,left:t}}function An(t){const{x:e,y:n,width:s,height:i}=t;return{width:s,height:i,top:n,left:e,right:e+s,bottom:n+i,x:e,y:n}}function Eo(t,e,n){let{reference:s,floating:i}=t;const r=ue(e),o=$o(e),a=wo(o),l=Ie(e),c=r==="y",d=s.x+s.width/2-i.width/2,h=s.y+s.height/2-i.height/2,f=s[a]/2-i[a]/2;let p;switch(l){case"top":p={x:d,y:s.y-i.height};break;case"bottom":p={x:d,y:s.y+s.height};break;case"right":p={x:s.x+s.width,y:h};break;case"left":p={x:s.x-i.width,y:h};break;default:p={x:s.x,y:s.y}}const g=zt(e);return g&&(p[o]+=f*(g==="end"?1:-1)*(n&&c?-1:1)),p}async function xh(t,e){var n;e===void 0&&(e={});const{x:s,y:i,platform:r,rects:o,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:f=!1,padding:p=0}=Lt(e,t),g=vh(p),m=a[f?h==="floating"?"reference":"floating":h],x=An(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(m)))==null||n?m:m.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),$=h==="floating"?{x:s,y:i,width:o.floating.width,height:o.floating.height}:o.reference,E=await(r.getOffsetParent==null?void 0:r.getOffsetParent(a.floating)),M=await(r.isElement==null?void 0:r.isElement(E))&&await(r.getScale==null?void 0:r.getScale(E))||{x:1,y:1},F=An(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:$,offsetParent:E,strategy:l}):$);return{top:(x.top-F.top+g.top)/M.y,bottom:(F.bottom-x.bottom+g.bottom)/M.y,left:(x.left-F.left+g.left)/M.x,right:(F.right-x.right+g.right)/M.x}}const yh=50,wh=async(t,e,n)=>{const{placement:s="bottom",strategy:i="absolute",middleware:r=[],platform:o}=n,a=o.detectOverflow?o:{...o,detectOverflow:xh},l=await(o.isRTL==null?void 0:o.isRTL(e));let c=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:d,y:h}=Eo(c,s,l),f=s,p=0;const g={};for(let u=0;u<r.length;u++){const m=r[u];if(!m)continue;const{name:x,fn:$}=m,{x:E,y:M,data:F,reset:I}=await $({x:d,y:h,initialPlacement:s,placement:f,strategy:i,middlewareData:g,rects:c,platform:a,elements:{reference:t,floating:e}});d=E??d,h=M??h,g[x]={...g[x],...F},I&&p<yh&&(p++,typeof I=="object"&&(I.placement&&(f=I.placement),I.rects&&(c=I.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:i}):I.rects),{x:d,y:h}=Eo(c,f,l)),u=-1)}return{x:d,y:h,placement:f,strategy:i,middlewareData:g}},$h=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,s;const{placement:i,middlewareData:r,rects:o,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:u=!0,...m}=Lt(t,e);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const x=Ie(i),$=ue(a),E=Ie(a)===a,M=await(l.isRTL==null?void 0:l.isRTL(c.floating)),F=f||(E||!u?[Sn(a)]:uh(a)),I=g!=="none";!f&&I&&F.push(...kh(a,u,g,M));const Y=[a,...F],j=await l.detectOverflow(e,m),ce=[];let ie=((s=r.flip)==null?void 0:s.overflows)||[];if(d&&ce.push(j[x]),h){const Ce=hh(i,o,M);ce.push(j[Ce[0]],j[Ce[1]])}if(ie=[...ie,{placement:i,overflows:ce}],!ce.every(Ce=>Ce<=0)){var Xi,Ji;const Ce=(((Xi=r.flip)==null?void 0:Xi.index)||0)+1,gs=Y[Ce];if(gs&&(!(h==="alignment"?$!==ue(gs):!1)||ie.every(J=>ue(J.placement)===$?J.overflows[0]>0:!0)))return{data:{index:Ce,overflows:ie},reset:{placement:gs}};let At=(Ji=ie.filter(Te=>Te.overflows[0]<=0).sort((Te,J)=>Te.overflows[1]-J.overflows[1])[0])==null?void 0:Ji.placement;if(!At)switch(p){case"bestFit":{var er;const Te=(er=ie.filter(J=>{if(I){const be=ue(J.placement);return be===$||be==="y"}return!0}).map(J=>[J.placement,J.overflows.filter(be=>be>0).reduce((be,Yd)=>be+Yd,0)]).sort((J,be)=>J[1]-be[1])[0])==null?void 0:er[0];Te&&(At=Te);break}case"initialPlacement":At=a;break}if(i!==At)return{reset:{placement:At}}}return{}}}},Sh=new Set(["left","top"]);async function Ah(t,e){const{placement:n,platform:s,elements:i}=t,r=await(s.isRTL==null?void 0:s.isRTL(i.floating)),o=Ie(n),a=zt(n),l=ue(n)==="y",c=Sh.has(o)?-1:1,d=r&&l?-1:1,h=Lt(e,t);let{mainAxis:f,crossAxis:p,alignmentAxis:g}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof g=="number"&&(p=a==="end"?g*-1:g),l?{x:p*d,y:f*c}:{x:f*c,y:p*d}}const Eh=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,s;const{x:i,y:r,placement:o,middlewareData:a}=e,l=await Ah(e,t);return o===((n=a.offset)==null?void 0:n.placement)&&(s=a.arrow)!=null&&s.alignmentOffset?{}:{x:i+l.x,y:r+l.y,data:{...l,placement:o}}}}},Ch=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:s,placement:i,platform:r}=e,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:$=>{let{x:E,y:M}=$;return{x:E,y:M}}},...c}=Lt(t,e),d={x:n,y:s},h=await r.detectOverflow(e,c),f=ue(i),p=yo(f);let g=d[p],u=d[f];const m=($,E)=>ph(E+h[$==="y"?"top":"left"],E,E-h[$==="y"?"bottom":"right"]);o&&(g=m(p,g)),a&&(u=m(f,u));const x=l.fn({...e,[p]:g,[f]:u});return{...x,data:{x:x.x-n,y:x.y-s,enabled:{[p]:o,[f]:a}}}}}},Th=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:s,platform:i,elements:r}=e,{apply:o=()=>{},...a}=Lt(t,e),l=await i.detectOverflow(e,a),c=Ie(n),d=zt(n),h=ue(n)==="y",{width:f,height:p}=s.floating;let g,u;c==="top"||c==="bottom"?(g=c,u=d===(await(i.isRTL==null?void 0:i.isRTL(r.floating))?"start":"end")?"left":"right"):(u=c,g=d==="end"?"top":"bottom");const m=p-l.top-l.bottom,x=f-l.left-l.right,$=it(p-l[g],m),E=it(f-l[u],x),M=e.middlewareData.shift,F=!M;let I=$,Y=E;M!=null&&M.enabled.x&&(Y=x),M!=null&&M.enabled.y&&(I=m),F&&!d&&(h?Y=f-2*pe(l.left,l.right):I=p-2*pe(l.top,l.bottom)),await o({...e,availableWidth:Y,availableHeight:I});const j=await i.getDimensions(r.floating);return f!==j.width||p!==j.height?{reset:{rects:!0}}:{}}}};function En(){return typeof window<"u"}function rt(t){return Co(t)?(t.nodeName||"").toLowerCase():"#document"}function W(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function ge(t){var e;return(e=(Co(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Co(t){return En()?t instanceof Node||t instanceof W(t).Node:!1}function oe(t){return En()?t instanceof Element||t instanceof W(t).Element:!1}function ye(t){return En()?t instanceof HTMLElement||t instanceof W(t).HTMLElement:!1}function To(t){return!En()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof W(t).ShadowRoot}function Cn(t){const{overflow:e,overflowX:n,overflowY:s,display:i}=ae(t);return/auto|scroll|overlay|hidden|clip/.test(e+s+n)&&i!=="inline"&&i!=="contents"}function Rh(t){return/^(table|td|th)$/.test(rt(t))}function Tn(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const _h=/transform|translate|scale|rotate|perspective|filter/,Mh=/paint|layout|strict|content/,Ne=t=>!!t&&t!=="none";let qs;function Us(t){const e=oe(t)?ae(t):t;return Ne(e.transform)||Ne(e.translate)||Ne(e.scale)||Ne(e.rotate)||Ne(e.perspective)||!Hs()&&(Ne(e.backdropFilter)||Ne(e.filter))||_h.test(e.willChange||"")||Mh.test(e.contain||"")}function Oh(t){let e=qe(t);for(;ye(e)&&!Dt(e);){if(Us(e))return e;if(Tn(e))return null;e=qe(e)}return null}function Hs(){return qs==null&&(qs=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),qs}function Dt(t){return/^(html|body|#document)$/.test(rt(t))}function ae(t){return W(t).getComputedStyle(t)}function Rn(t){return oe(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function qe(t){if(rt(t)==="html")return t;const e=t.assignedSlot||t.parentNode||To(t)&&t.host||ge(t);return To(e)?e.host:e}function Ro(t){const e=qe(t);return Dt(e)?(t.ownerDocument||t).body:ye(e)&&Cn(e)?e:Ro(e)}function It(t,e,n){var s;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Ro(t),r=i===((s=t.ownerDocument)==null?void 0:s.body),o=W(i);if(r){const a=js(o);return e.concat(o,o.visualViewport||[],Cn(i)?i:[],a&&n?It(a):[])}else return e.concat(i,It(i,[],n))}function js(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function _o(t){const e=ae(t);let n=parseFloat(e.width)||0,s=parseFloat(e.height)||0;const i=ye(t),r=i?t.offsetWidth:n,o=i?t.offsetHeight:s,a=wn(n)!==r||wn(s)!==o;return a&&(n=r,s=o),{width:n,height:s,$:a}}function Bs(t){return oe(t)?t:t.contextElement}function ot(t){const e=Bs(t);if(!ye(e))return he(1);const n=e.getBoundingClientRect(),{width:s,height:i,$:r}=_o(e);let o=(r?wn(n.width):n.width)/s,a=(r?wn(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const Ph=he(0);function Mo(t){const e=W(t);return!Hs()||!e.visualViewport?Ph:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Lh(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===W(t)}function Ue(t,e,n,s){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),r=Bs(t);let o=he(1);e&&(s?oe(s)&&(o=ot(s)):o=ot(t));const a=Lh(r,n,s)?Mo(r):he(0);let l=(i.left+a.x)/o.x,c=(i.top+a.y)/o.y,d=i.width/o.x,h=i.height/o.y;if(r&&s){const f=W(r),p=oe(s)?W(s):s;let g=f,u=js(g);for(;u&&p!==g;){const m=ot(u),x=u.getBoundingClientRect(),$=ae(u),E=x.left+(u.clientLeft+parseFloat($.paddingLeft))*m.x,M=x.top+(u.clientTop+parseFloat($.paddingTop))*m.y;l*=m.x,c*=m.y,d*=m.x,h*=m.y,l+=E,c+=M,g=W(u),u=js(g)}}return An({width:d,height:h,x:l,y:c})}function _n(t,e){const n=Rn(t).scrollLeft;return e?e.left+n:Ue(ge(t)).left+n}function Oo(t,e){const n=t.getBoundingClientRect(),s=n.left+e.scrollLeft-_n(t,n),i=n.top+e.scrollTop;return{x:s,y:i}}function zh(t){let{elements:e,rect:n,offsetParent:s,strategy:i}=t;const r=i==="fixed",o=ge(s),a=e?Tn(e.floating):!1;if(s===o||a&&r)return n;let l={scrollLeft:0,scrollTop:0},c=he(1);const d=he(0),h=ye(s);if((h||!r)&&((rt(s)!=="body"||Cn(o))&&(l=Rn(s)),h)){const p=Ue(s);c=ot(s),d.x=p.x+s.clientLeft,d.y=p.y+s.clientTop}const f=o&&!h&&!r?Oo(o,l):he(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+f.x,y:n.y*c.y-l.scrollTop*c.y+d.y+f.y}}function Dh(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function Ih(t){const e=Rn(t),n=t.ownerDocument.body,s=pe(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=pe(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let r=-e.scrollLeft+_n(t);const o=-e.scrollTop;return ae(n).direction==="rtl"&&(r+=pe(t.clientWidth,n.clientWidth)-s),{width:s,height:i,x:r,y:o}}const Nh=25;function qh(t,e,n){n===void 0&&(n="viewport");const s=n==="layoutViewport",i=W(t),r=ge(t),o=i.visualViewport;let a=r.clientWidth,l=r.clientHeight,c=0,d=0;if(o){const f=!Hs()||e==="fixed";s?f||(c=-o.offsetLeft,d=-o.offsetTop):(a=o.width,l=o.height,f&&(c=o.offsetLeft,d=o.offsetTop))}if(_n(r)<=0){const f=r.ownerDocument,p=f.body,g=getComputedStyle(p),u=f.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,m=Math.abs(r.clientWidth-p.clientWidth-u),x=getComputedStyle(r).scrollbarGutter==="stable both-edges"?m/2:m;x<=Nh&&(a-=x)}return{width:a,height:l,x:c,y:d}}function Uh(t,e){const n=Ue(t,!0,e==="fixed"),s=n.top+t.clientTop,i=n.left+t.clientLeft,r=ot(t),o=t.clientWidth*r.x,a=t.clientHeight*r.y,l=i*r.x,c=s*r.y;return{width:o,height:a,x:l,y:c}}function Po(t,e,n){let s;if(e==="viewport"||e==="layoutViewport")s=qh(t,n,e);else if(e==="document")s=Ih(ge(t));else if(oe(e))s=Uh(e,n);else{const i=Mo(t);s={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return An(s)}function Hh(t,e){const n=e.get(t);if(n)return n;let s=It(t,[],!1).filter(a=>oe(a)&&rt(a)!=="body"),i=null;const r=ae(t).position==="fixed";let o=r?qe(t):t;for(;oe(o)&&!Dt(o);){const a=ae(o),l=Us(o),c=i?i.position:r?"fixed":"";!l&&(c==="fixed"||c==="absolute"&&a.position==="static")?s=s.filter(h=>h!==o):i=a,o=qe(o)}return e.set(t,s),s}function jh(t){let{element:e,boundary:n,rootBoundary:s,strategy:i}=t;const o=[...n==="clippingAncestors"?Tn(e)?[]:Hh(e,this._c):[].concat(n),s],a=Po(e,o[0],i);let l=a.top,c=a.right,d=a.bottom,h=a.left;for(let f=1;f<o.length;f++){const p=Po(e,o[f],i);l=pe(p.top,l),c=it(p.right,c),d=it(p.bottom,d),h=pe(p.left,h)}return{width:c-h,height:d-l,x:h,y:l}}function Bh(t){const{width:e,height:n}=_o(t);return{width:e,height:n}}function Fh(t,e,n){const s=ye(e),i=ge(e),r=n==="fixed",o=Ue(t,!0,r,e);let a={scrollLeft:0,scrollTop:0};const l=he(0);if((s||!r)&&((rt(e)!=="body"||Cn(i))&&(a=Rn(e)),s)){const f=Ue(e,!0,r,e);l.x=f.x+e.clientLeft,l.y=f.y+e.clientTop}!s&&i&&(l.x=_n(i));const c=i&&!s&&!r?Oo(i,a):he(0),d=o.left+a.scrollLeft-l.x-c.x,h=o.top+a.scrollTop-l.y-c.y;return{x:d,y:h,width:o.width,height:o.height}}function Fs(t){return ae(t).position==="static"}function Lo(t,e){if(!ye(t)||ae(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return ge(t)===n&&(n=n.ownerDocument.body),n}function zo(t,e){const n=W(t);if(Tn(t))return n;if(!ye(t)){let i=qe(t);for(;i&&!Dt(i);){if(oe(i)&&!Fs(i))return i;i=qe(i)}return n}let s=Lo(t,e);for(;s&&Rh(s)&&Fs(s);)s=Lo(s,e);return s&&Dt(s)&&Fs(s)&&!Us(s)?n:s||Oh(t)||n}const Gh=async function(t){const e=this.getOffsetParent||zo,n=this.getDimensions,s=await n(t.floating);return{reference:Fh(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function Wh(t){return ae(t).direction==="rtl"}const Kh={convertOffsetParentRelativeRectToViewportRelativeRect:zh,getDocumentElement:ge,getClippingRect:jh,getOffsetParent:zo,getElementRects:Gh,getClientRects:Dh,getDimensions:Bh,getScale:ot,isElement:oe,isRTL:Wh};function Do(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Vh(t,e,n){let s=null,i;const r=ge(t);function o(){var d;clearTimeout(i),(d=s)==null||d.disconnect(),s=null}function a(d,h){d===void 0&&(d=!1),h===void 0&&(h=1),o();const f=t.getBoundingClientRect(),{left:p,top:g,width:u,height:m}=f;if(d||e(),!u||!m)return;const x=$n(g),$=$n(r.clientWidth-(p+u)),E=$n(r.clientHeight-(g+m)),M=$n(p),I={rootMargin:-x+"px "+-$+"px "+-E+"px "+-M+"px",threshold:pe(0,it(1,h))||1};let Y=!0;function j(ce){const ie=ce[0].intersectionRatio;if(!Do(f,t.getBoundingClientRect()))return a();if(ie!==h){if(!Y)return a();ie?a(!1,ie):i=setTimeout(()=>{a(!1,1e-7)},1e3)}Y=!1}try{s=new IntersectionObserver(j,{...I,root:r.ownerDocument})}catch{s=new IntersectionObserver(j,I)}s.observe(t)}const l=W(t),c=()=>a(n);return l.addEventListener("resize",c),a(!0),()=>{l.removeEventListener("resize",c),o()}}function Yh(t,e,n,s){s===void 0&&(s={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=s,c=Bs(t),d=i||r?[...c?It(c):[],...e?It(e):[]]:[];d.forEach(x=>{i&&x.addEventListener("scroll",n),r&&x.addEventListener("resize",n)});const h=c&&a?Vh(c,n,r):null;let f=-1,p=null;o&&(p=new ResizeObserver(x=>{let[$]=x;$&&$.target===c&&p&&e&&(p.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var E;(E=p)==null||E.observe(e)})),n()}),c&&!l&&p.observe(c),e&&p.observe(e));let g,u=l?Ue(t):null;l&&m();function m(){const x=Ue(t);u&&!Do(u,x)&&n(),u=x,g=requestAnimationFrame(m)}return n(),()=>{var x;d.forEach($=>{i&&$.removeEventListener("scroll",n),r&&$.removeEventListener("resize",n)}),h?.(),(x=p)==null||x.disconnect(),p=null,l&&cancelAnimationFrame(g)}}const Zh=Eh,Qh=Ch,Xh=$h,Jh=Th,eu=(t,e,n)=>{const s=new Map,i=n??{},r={...Kh,...i.platform,_c:s};return wh(t,e,{...i,platform:r})},Io=(t,e)=>({top:e,bottom:e,right:t}),Gs=(t,e,n,s={})=>{if(typeof t.showPopover!="function")return()=>{};try{t.showPopover()}catch{return()=>{}}let i=!0,r=0;const o=e instanceof Element?e:{getBoundingClientRect:()=>({x:e.right,y:e.top,left:e.right,right:e.right,top:e.top,bottom:e.bottom,width:0,height:e.bottom-e.top})};t.style.width=`${n.width}px`,t.style.maxHeight=`${n.height}px`,t.style.inset="auto";const l=Yh(o,t,()=>{const c=++r;eu(o,t,{strategy:"fixed",placement:s.placement??"bottom-end",middleware:[Zh(8),Xh({padding:8,fallbackAxisSideDirection:"end",...s.boundary===void 0?{}:{boundary:s.boundary}}),Qh({padding:8,...s.boundary===void 0?{}:{boundary:s.boundary}}),Jh({padding:8,...s.boundary===void 0?{}:{boundary:s.boundary},apply:({availableWidth:d,availableHeight:h})=>{!i||c!==r||(t.style.width=`${Math.max(0,Math.min(n.width,d))}px`,t.style.maxHeight=`${Math.max(0,Math.min(n.height,h))}px`)}})]}).then(({x:d,y:h})=>{!i||c!==r||!t.isConnected||(t.style.left=`${d}px`,t.style.top=`${h}px`)}).catch(()=>{})},{animationFrame:s.trackTransform??!1,elementResize:typeof ResizeObserver<"u",layoutShift:typeof IntersectionObserver<"u"});return()=>{i=!1,l()}},Mn=t=>{if(!(!t||typeof t.hidePopover!="function"))try{t.hidePopover()}catch{}},On=async t=>{try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(t),!0}catch{}const e=document.activeElement,n=document.createElement("textarea");try{return n.value=t,n.setAttribute("readonly",""),n.style.position="fixed",n.style.opacity="0",document.body.append(n),n.select(),document.execCommand("copy")}catch{return!1}finally{n.remove(),e instanceof HTMLElement&&e.focus()}},tu=t=>{const{host:e,state:n,target:s,targetElement:i,resetViewElement:r,messages:o}=t,a=[],l=i?.textContent?.trim()??"";return s!==null&&l!==""&&a.push({kind:"item",id:"copy-text",label:o.copyText,run:()=>{On(l)}}),s!==null&&e.definition.hasTarget(n,s)&&a.push({kind:"item",id:"feedback",label:o.feedback,run:()=>e.requestComment(P(s))}),r!==null&&a.push({kind:"item",id:"reset-view",label:o.resetView,run:()=>r.resetView()}),a.length===0?null:{id:"common",entries:a}},Ws={open:!1,x:0,y:0,groups:[],openPath:[],activeId:null},nu=(t,e,n)=>({open:n.some(s=>s.entries.length>0),x:t,y:e,groups:n,openPath:[],activeId:null}),su=t=>t.flatMap(e=>e.entries),Ks=(t,e)=>t.find(n=>n.id===e),Vs=(t,e)=>{let n=su(t);for(const s of e){const i=Ks(n,s);if(i===void 0||i.kind!=="submenu")return n;n=i.items}return n},No=t=>t.filter(e=>!(e.kind==="item"&&e.disabled===!0)).map(e=>e.id),qo=(t,e)=>{const n=No(Vs(t.groups,t.openPath));if(n.length===0)return t;const s=t.activeId===null?e===1?-1:n.length:n.indexOf(t.activeId),i=n[(s+e+n.length)%n.length];return i===void 0?t:{...t,activeId:i}},Uo=(t,e)=>{const n=Ks(Vs(t.groups,t.openPath),e);if(n===void 0||n.kind!=="submenu")return t;const s=No(n.items)[0]??null;return{...t,openPath:[...t.openPath,e],activeId:s}},Ho=t=>t.activeId===null?t:Uo(t,t.activeId),iu=t=>{if(t.openPath.length===0)return t;const e=t.openPath[t.openPath.length-1]??null;return{...t,openPath:t.openPath.slice(0,-1),activeId:e}},ru=t=>{const e=Ks(Vs(t.groups,t.openPath),t.activeId??"");return e===void 0?{state:t,run:null}:e.kind==="submenu"?{state:Ho(t),run:null}:e.disabled===!0?{state:t,run:null}:{state:Ws,run:e.run}},Ys=(t,e)=>{const n=[],s=i=>{for(const r of i.querySelectorAll("*"))r.matches(e)&&n.push(r),r.shadowRoot&&s(r.shadowRoot)};return s(t),t instanceof Element&&t.shadowRoot&&s(t.shadowRoot),n},jo=(t,e)=>{const n=[];let s=t;for(;s;){const i=s instanceof Element&&s.assignedSlot?s.assignedSlot:s.parentNode;if(s=i instanceof ShadowRoot?i.host:i,!(s instanceof Element)||s===e)break;n.push(s)}return n},at="data-dpk-target",ou=2800,Bo=48,au=t=>t.getClientRects().length>0,lu=(t,e)=>{const n=Ys(t,`[${at}]`).filter(r=>(r.getAttribute(at)??"").split(/\s+/).includes(e)),s=Ys(t,"[data-dpk-comment]").filter(r=>r.getAttribute("data-dpk-comment")===e),i=[...n,...s];return i.find(au)??i[0]??null},Fo=(t,e)=>{const n=getComputedStyle(t),s=e==="y"?n.overflowY:n.overflowX;return s!=="auto"&&s!=="scroll"?!1:e==="y"?t.scrollHeight>t.clientHeight:t.scrollWidth>t.clientWidth},du=(t,e)=>{for(const n of jo(e,t))Fo(n,"y")&&Ts(n,e,Bo),Fo(n,"x")&&Yr(n,e,Bo)},Go="color-mix(in srgb, var(--dpk-accent) 45%, transparent)",He={outline:"2px solid var(--dpk-accent)",outlineOffset:"3px"},Wo={outline:"2px solid transparent",outlineOffset:"3px"},cu=t=>t?[{...He},{...He,offset:.85},{...Wo}]:[{...He,boxShadow:`0 0 0 0 ${Go}`},{...He,boxShadow:"0 0 0 14px transparent",offset:.3},{...He,boxShadow:`0 0 0 0 ${Go}`,offset:.31},{...He,boxShadow:"0 0 0 14px transparent",offset:.6},{...He,offset:.85},{...Wo}],Nt={filter:"drop-shadow(0 0 3px var(--dpk-accent)) drop-shadow(0 0 3px var(--dpk-accent))"},Pn={filter:"drop-shadow(0 0 3px transparent) drop-shadow(0 0 3px transparent)"},pu=t=>t?[{...Nt},{...Nt,offset:.85},{...Pn}]:[{...Nt},{...Pn,offset:.3},{...Nt,offset:.31},{...Pn,offset:.6},{...Nt,offset:.61},{...Pn}],hu=t=>{if(typeof t.animate!="function")return;const e=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches,n=t instanceof SVGElement&&!(t instanceof SVGSVGElement);t.animate(n?pu(e):cu(e),{duration:ou,easing:"ease-out"})},uu=t=>typeof t=="object"&&t!==null&&"getContextMenuItems"in t&&typeof t.getContextMenuItems=="function",gu=(t,e)=>{const n=[];for(const s of t){if(!uu(s))continue;const i=s.getContextMenuItems(e);i!==null&&n.push(...i)}return n},fu=t=>{for(const e of t)if(e instanceof Element)return e;return null},mu=t=>{for(const e of t){if(!(e instanceof Element))continue;const n=e.getAttribute(at);if(n!==null&&n.trim()!=="")try{return Le(n)}catch{continue}const s=e.getAttribute("data-dpk-comment");if(s!==null&&s.trim()!=="")try{return Le(s)}catch{continue}}return null},ku=(t,e)=>{for(const n of t)if(n instanceof Element&&typeof Reflect.get(n,e)=="function")return n;return null},bu=t=>{for(const e of t)if(e instanceof Element&&(e.hasAttribute(at)||e.hasAttribute("data-dpk-comment")))return e;return null},Ko="dpk-context-menu",Vo=(t,e)=>`dpk-settings-option dpk-context-menu-option${e?" is-active":""}${t.kind==="item"&&t.danger===!0?" is-danger":""}`,Yo=(t,e,n,s)=>{const i=n.openPath.length===e&&n.activeId===t.id;if(t.kind==="submenu"){const r=n.openPath[e]===t.id;return k`<div class="dpk-context-menu-submenu-wrap">
238
+ `}#r(){return this.#e.renderRoot.querySelector(`dialog[data-dpk-confirm-dialog="${this.#n}"]`)??null}#o=()=>{const e=this.#r();this.#a(e?.returnValue==="confirm")};#a(e){const n=this.#t;this.#t=null,this.#s=null,this.#i=!1,this.#e.requestUpdate(),n?.(e)}}const Je=Math.min,de=Math.max,mn=Math.round,kn=Math.floor,ce=t=>({x:t,y:t}),ah={left:"right",right:"left",bottom:"top",top:"bottom"};function lh(t,e,n){return de(t,Je(e,n))}function Mt(t,e){return typeof t=="function"?t(e):t}function Pe(t){return t.split("-")[0]}function Ot(t){return t.split("-")[1]}function ho(t){return t==="x"?"y":"x"}function uo(t){return t==="y"?"height":"width"}function pe(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function go(t){return ho(pe(t))}function dh(t,e,n){n===void 0&&(n=!1);const s=Ot(t),i=go(t),r=uo(i);let o=i==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(o=bn(o)),[o,bn(o)]}function ch(t){const e=bn(t);return[Os(t),e,Os(e)]}function Os(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const fo=["left","right"],mo=["right","left"],ph=["top","bottom"],hh=["bottom","top"];function uh(t,e,n){switch(t){case"top":case"bottom":return n?e?mo:fo:e?fo:mo;case"left":case"right":return e?ph:hh;default:return[]}}function gh(t,e,n,s){const i=Ot(t);let r=uh(Pe(t),n==="start",s);return i&&(r=r.map(o=>o+"-"+i),e&&(r=r.concat(r.map(Os)))),r}function bn(t){const e=Pe(t);return ah[e]+t.slice(e.length)}function fh(t){var e,n,s,i;return{top:(e=t.top)!=null?e:0,right:(n=t.right)!=null?n:0,bottom:(s=t.bottom)!=null?s:0,left:(i=t.left)!=null?i:0}}function mh(t){return typeof t!="number"?fh(t):{top:t,right:t,bottom:t,left:t}}function vn(t){const{x:e,y:n,width:s,height:i}=t;return{width:s,height:i,top:n,left:e,right:e+s,bottom:n+i,x:e,y:n}}function ko(t,e,n){let{reference:s,floating:i}=t;const r=pe(e),o=go(e),a=uo(o),l=Pe(e),p=r==="y",h=s.x+s.width/2-i.width/2,d=s.y+s.height/2-i.height/2,f=s[a]/2-i[a]/2;let c;switch(l){case"top":c={x:h,y:s.y-i.height};break;case"bottom":c={x:h,y:s.y+s.height};break;case"right":c={x:s.x+s.width,y:d};break;case"left":c={x:s.x-i.width,y:d};break;default:c={x:s.x,y:s.y}}const g=Ot(e);return g&&(c[o]+=f*(g==="end"?1:-1)*(n&&p?-1:1)),c}async function kh(t,e){var n;e===void 0&&(e={});const{x:s,y:i,platform:r,rects:o,elements:a,strategy:l}=t,{boundary:p="clippingAncestors",rootBoundary:h="viewport",elementContext:d="floating",altBoundary:f=!1,padding:c=0}=Mt(e,t),g=mh(c),k=a[f?d==="floating"?"reference":"floating":d],v=vn(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(k)))==null||n?k:k.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(a.floating)),boundary:p,rootBoundary:h,strategy:l})),y=d==="floating"?{x:s,y:i,width:o.floating.width,height:o.floating.height}:o.reference,A=await(r.getOffsetParent==null?void 0:r.getOffsetParent(a.floating)),M=await(r.isElement==null?void 0:r.isElement(A))&&await(r.getScale==null?void 0:r.getScale(A))||{x:1,y:1},U=vn(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:A,strategy:l}):y);return{top:(v.top-U.top+g.top)/M.y,bottom:(U.bottom-v.bottom+g.bottom)/M.y,left:(v.left-U.left+g.left)/M.x,right:(U.right-v.right+g.right)/M.x}}const bh=50,vh=async(t,e,n)=>{const{placement:s="bottom",strategy:i="absolute",middleware:r=[],platform:o}=n,a=o.detectOverflow?o:{...o,detectOverflow:kh},l=await(o.isRTL==null?void 0:o.isRTL(e));let p=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:h,y:d}=ko(p,s,l),f=s,c=0;const g={};for(let u=0;u<r.length;u++){const k=r[u];if(!k)continue;const{name:v,fn:y}=k,{x:A,y:M,data:U,reset:L}=await y({x:h,y:d,initialPlacement:s,placement:f,strategy:i,middlewareData:g,rects:p,platform:a,elements:{reference:t,floating:e}});h=A??h,d=M??d,g[v]={...g[v],...U},L&&c<bh&&(c++,typeof L=="object"&&(L.placement&&(f=L.placement),L.rects&&(p=L.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:i}):L.rects),{x:h,y:d}=ko(p,f,l)),u=-1)}return{x:h,y:d,placement:f,strategy:i,middlewareData:g}},xh=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,s;const{placement:i,middlewareData:r,rects:o,initialPlacement:a,platform:l,elements:p}=e,{mainAxis:h=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:c="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:u=!0,...k}=Mt(t,e);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const v=Pe(i),y=pe(a),A=Pe(a)===a,M=await(l.isRTL==null?void 0:l.isRTL(p.floating)),U=f||(A||!u?[bn(a)]:ch(a)),L=g!=="none";!f&&L&&U.push(...gh(a,u,g,M));const G=[a,...U],q=await l.detectOverflow(e,k),ae=[];let te=((s=r.flip)==null?void 0:s.overflows)||[];if(h&&ae.push(q[v]),d){const Se=dh(i,o,M);ae.push(q[Se[0]],q[Se[1]])}if(te=[...te,{placement:i,overflows:ae}],!ae.every(Se=>Se<=0)){var Vi,Yi;const Se=(((Vi=r.flip)==null?void 0:Vi.index)||0)+1,ls=G[Se];if(ls&&(!(d==="alignment"?y!==pe(ls):!1)||te.every(Q=>pe(Q.placement)===y?Q.overflows[0]>0:!0)))return{data:{index:Se,overflows:te},reset:{placement:ls}};let xt=(Yi=te.filter(Ae=>Ae.overflows[0]<=0).sort((Ae,Q)=>Ae.overflows[1]-Q.overflows[1])[0])==null?void 0:Yi.placement;if(!xt)switch(c){case"bestFit":{var Zi;const Ae=(Zi=te.filter(Q=>{if(L){const me=pe(Q.placement);return me===y||me==="y"}return!0}).map(Q=>[Q.placement,Q.overflows.filter(me=>me>0).reduce((me,Gd)=>me+Gd,0)]).sort((Q,me)=>Q[1]-me[1])[0])==null?void 0:Zi[0];Ae&&(xt=Ae);break}case"initialPlacement":xt=a;break}if(i!==xt)return{reset:{placement:xt}}}return{}}}},wh=new Set(["left","top"]);async function yh(t,e){const{placement:n,platform:s,elements:i}=t,r=await(s.isRTL==null?void 0:s.isRTL(i.floating)),o=Pe(n),a=Ot(n),l=pe(n)==="y",p=wh.has(o)?-1:1,h=r&&l?-1:1,d=Mt(e,t);let{mainAxis:f,crossAxis:c,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof g=="number"&&(c=a==="end"?g*-1:g),l?{x:c*h,y:f*p}:{x:f*p,y:c*h}}const $h=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,s;const{x:i,y:r,placement:o,middlewareData:a}=e,l=await yh(e,t);return o===((n=a.offset)==null?void 0:n.placement)&&(s=a.arrow)!=null&&s.alignmentOffset?{}:{x:i+l.x,y:r+l.y,data:{...l,placement:o}}}}},Sh=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:s,placement:i,platform:r}=e,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:y=>{let{x:A,y:M}=y;return{x:A,y:M}}},...p}=Mt(t,e),h={x:n,y:s},d=await r.detectOverflow(e,p),f=pe(i),c=ho(f);let g=h[c],u=h[f];const k=(y,A)=>lh(A+d[y==="y"?"top":"left"],A,A-d[y==="y"?"bottom":"right"]);o&&(g=k(c,g)),a&&(u=k(f,u));const v=l.fn({...e,[c]:g,[f]:u});return{...v,data:{x:v.x-n,y:v.y-s,enabled:{[c]:o,[f]:a}}}}}},Ah=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:s,platform:i,elements:r}=e,{apply:o=()=>{},...a}=Mt(t,e),l=await i.detectOverflow(e,a),p=Pe(n),h=Ot(n),d=pe(n)==="y",{width:f,height:c}=s.floating;let g,u;p==="top"||p==="bottom"?(g=p,u=h===(await(i.isRTL==null?void 0:i.isRTL(r.floating))?"start":"end")?"left":"right"):(u=p,g=h==="end"?"top":"bottom");const k=c-l.top-l.bottom,v=f-l.left-l.right,y=Je(c-l[g],k),A=Je(f-l[u],v),M=e.middlewareData.shift,U=!M;let L=y,G=A;M!=null&&M.enabled.x&&(G=v),M!=null&&M.enabled.y&&(L=k),U&&!h&&(d?G=f-2*de(l.left,l.right):L=c-2*de(l.top,l.bottom)),await o({...e,availableWidth:G,availableHeight:L});const q=await i.getDimensions(r.floating);return f!==q.width||c!==q.height?{reset:{rects:!0}}:{}}}};function xn(){return typeof window<"u"}function et(t){return bo(t)?(t.nodeName||"").toLowerCase():"#document"}function B(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function he(t){var e;return(e=(bo(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function bo(t){return xn()?t instanceof Node||t instanceof B(t).Node:!1}function se(t){return xn()?t instanceof Element||t instanceof B(t).Element:!1}function be(t){return xn()?t instanceof HTMLElement||t instanceof B(t).HTMLElement:!1}function vo(t){return!xn()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof B(t).ShadowRoot}function wn(t){const{overflow:e,overflowX:n,overflowY:s,display:i}=ie(t);return/auto|scroll|overlay|hidden|clip/.test(e+s+n)&&i!=="inline"&&i!=="contents"}function Eh(t){return/^(table|td|th)$/.test(et(t))}function yn(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const Ch=/transform|translate|scale|rotate|perspective|filter/,Th=/paint|layout|strict|content/,Le=t=>!!t&&t!=="none";let _s;function Ps(t){const e=se(t)?ie(t):t;return Le(e.transform)||Le(e.translate)||Le(e.scale)||Le(e.rotate)||Le(e.perspective)||!Ls()&&(Le(e.backdropFilter)||Le(e.filter))||Ch.test(e.willChange||"")||Th.test(e.contain||"")}function Rh(t){let e=ze(t);for(;be(e)&&!_t(e);){if(Ps(e))return e;if(yn(e))return null;e=ze(e)}return null}function Ls(){return _s==null&&(_s=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),_s}function _t(t){return/^(html|body|#document)$/.test(et(t))}function ie(t){return B(t).getComputedStyle(t)}function $n(t){return se(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function ze(t){if(et(t)==="html")return t;const e=t.assignedSlot||t.parentNode||vo(t)&&t.host||he(t);return vo(e)?e.host:e}function xo(t){const e=ze(t);return _t(e)?(t.ownerDocument||t).body:be(e)&&wn(e)?e:xo(e)}function Pt(t,e,n){var s;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=xo(t),r=i===((s=t.ownerDocument)==null?void 0:s.body),o=B(i);if(r){const a=zs(o);return e.concat(o,o.visualViewport||[],wn(i)?i:[],a&&n?Pt(a):[])}else return e.concat(i,Pt(i,[],n))}function zs(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function wo(t){const e=ie(t);let n=parseFloat(e.width)||0,s=parseFloat(e.height)||0;const i=be(t),r=i?t.offsetWidth:n,o=i?t.offsetHeight:s,a=mn(n)!==r||mn(s)!==o;return a&&(n=r,s=o),{width:n,height:s,$:a}}function Is(t){return se(t)?t:t.contextElement}function tt(t){const e=Is(t);if(!be(e))return ce(1);const n=e.getBoundingClientRect(),{width:s,height:i,$:r}=wo(e);let o=(r?mn(n.width):n.width)/s,a=(r?mn(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const Mh=ce(0);function yo(t){const e=B(t);return!Ls()||!e.visualViewport?Mh:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Oh(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===B(t)}function Ie(t,e,n,s){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),r=Is(t);let o=ce(1);e&&(s?se(s)&&(o=tt(s)):o=tt(t));const a=Oh(r,n,s)?yo(r):ce(0);let l=(i.left+a.x)/o.x,p=(i.top+a.y)/o.y,h=i.width/o.x,d=i.height/o.y;if(r&&s){const f=B(r),c=se(s)?B(s):s;let g=f,u=zs(g);for(;u&&c!==g;){const k=tt(u),v=u.getBoundingClientRect(),y=ie(u),A=v.left+(u.clientLeft+parseFloat(y.paddingLeft))*k.x,M=v.top+(u.clientTop+parseFloat(y.paddingTop))*k.y;l*=k.x,p*=k.y,h*=k.x,d*=k.y,l+=A,p+=M,g=B(u),u=zs(g)}}return vn({width:h,height:d,x:l,y:p})}function Sn(t,e){const n=$n(t).scrollLeft;return e?e.left+n:Ie(he(t)).left+n}function $o(t,e){const n=t.getBoundingClientRect(),s=n.left+e.scrollLeft-Sn(t,n),i=n.top+e.scrollTop;return{x:s,y:i}}function _h(t){let{elements:e,rect:n,offsetParent:s,strategy:i}=t;const r=i==="fixed",o=he(s),a=e?yn(e.floating):!1;if(s===o||a&&r)return n;let l={scrollLeft:0,scrollTop:0},p=ce(1);const h=ce(0),d=be(s);if((d||!r)&&((et(s)!=="body"||wn(o))&&(l=$n(s)),d)){const c=Ie(s);p=tt(s),h.x=c.x+s.clientLeft,h.y=c.y+s.clientTop}const f=o&&!d&&!r?$o(o,l):ce(0);return{width:n.width*p.x,height:n.height*p.y,x:n.x*p.x-l.scrollLeft*p.x+h.x+f.x,y:n.y*p.y-l.scrollTop*p.y+h.y+f.y}}function Ph(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function Lh(t){const e=$n(t),n=t.ownerDocument.body,s=de(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=de(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let r=-e.scrollLeft+Sn(t);const o=-e.scrollTop;return ie(n).direction==="rtl"&&(r+=de(t.clientWidth,n.clientWidth)-s),{width:s,height:i,x:r,y:o}}const zh=25;function Ih(t,e,n){n===void 0&&(n="viewport");const s=n==="layoutViewport",i=B(t),r=he(t),o=i.visualViewport;let a=r.clientWidth,l=r.clientHeight,p=0,h=0;if(o){const f=!Ls()||e==="fixed";s?f||(p=-o.offsetLeft,h=-o.offsetTop):(a=o.width,l=o.height,f&&(p=o.offsetLeft,h=o.offsetTop))}if(Sn(r)<=0){const f=r.ownerDocument,c=f.body,g=getComputedStyle(c),u=f.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,k=Math.abs(r.clientWidth-c.clientWidth-u),v=getComputedStyle(r).scrollbarGutter==="stable both-edges"?k/2:k;v<=zh&&(a-=v)}return{width:a,height:l,x:p,y:h}}function Dh(t,e){const n=Ie(t,!0,e==="fixed"),s=n.top+t.clientTop,i=n.left+t.clientLeft,r=tt(t),o=t.clientWidth*r.x,a=t.clientHeight*r.y,l=i*r.x,p=s*r.y;return{width:o,height:a,x:l,y:p}}function So(t,e,n){let s;if(e==="viewport"||e==="layoutViewport")s=Ih(t,n,e);else if(e==="document")s=Lh(he(t));else if(se(e))s=Dh(e,n);else{const i=yo(t);s={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return vn(s)}function Nh(t,e){const n=e.get(t);if(n)return n;let s=Pt(t,[],!1).filter(a=>se(a)&&et(a)!=="body"),i=null;const r=ie(t).position==="fixed";let o=r?ze(t):t;for(;se(o)&&!_t(o);){const a=ie(o),l=Ps(o),p=i?i.position:r?"fixed":"";!l&&(p==="fixed"||p==="absolute"&&a.position==="static")?s=s.filter(d=>d!==o):i=a,o=ze(o)}return e.set(t,s),s}function qh(t){let{element:e,boundary:n,rootBoundary:s,strategy:i}=t;const o=[...n==="clippingAncestors"?yn(e)?[]:Nh(e,this._c):[].concat(n),s],a=So(e,o[0],i);let l=a.top,p=a.right,h=a.bottom,d=a.left;for(let f=1;f<o.length;f++){const c=So(e,o[f],i);l=de(c.top,l),p=Je(c.right,p),h=Je(c.bottom,h),d=de(c.left,d)}return{width:p-d,height:h-l,x:d,y:l}}function Uh(t){const{width:e,height:n}=wo(t);return{width:e,height:n}}function Hh(t,e,n){const s=be(e),i=he(e),r=n==="fixed",o=Ie(t,!0,r,e);let a={scrollLeft:0,scrollTop:0};const l=ce(0);if((s||!r)&&((et(e)!=="body"||wn(i))&&(a=$n(e)),s)){const f=Ie(e,!0,r,e);l.x=f.x+e.clientLeft,l.y=f.y+e.clientTop}!s&&i&&(l.x=Sn(i));const p=i&&!s&&!r?$o(i,a):ce(0),h=o.left+a.scrollLeft-l.x-p.x,d=o.top+a.scrollTop-l.y-p.y;return{x:h,y:d,width:o.width,height:o.height}}function Ds(t){return ie(t).position==="static"}function Ao(t,e){if(!be(t)||ie(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return he(t)===n&&(n=n.ownerDocument.body),n}function Eo(t,e){const n=B(t);if(yn(t))return n;if(!be(t)){let i=ze(t);for(;i&&!_t(i);){if(se(i)&&!Ds(i))return i;i=ze(i)}return n}let s=Ao(t,e);for(;s&&Eh(s)&&Ds(s);)s=Ao(s,e);return s&&_t(s)&&Ds(s)&&!Ps(s)?n:s||Rh(t)||n}const Bh=async function(t){const e=this.getOffsetParent||Eo,n=this.getDimensions,s=await n(t.floating);return{reference:Hh(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function jh(t){return ie(t).direction==="rtl"}const Fh={convertOffsetParentRelativeRectToViewportRelativeRect:_h,getDocumentElement:he,getClippingRect:qh,getOffsetParent:Eo,getElementRects:Bh,getClientRects:Ph,getDimensions:Uh,getScale:tt,isElement:se,isRTL:jh};function Co(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Gh(t,e,n){let s=null,i;const r=he(t);function o(){var h;clearTimeout(i),(h=s)==null||h.disconnect(),s=null}function a(h,d){h===void 0&&(h=!1),d===void 0&&(d=1),o();const f=t.getBoundingClientRect(),{left:c,top:g,width:u,height:k}=f;if(h||e(),!u||!k)return;const v=kn(g),y=kn(r.clientWidth-(c+u)),A=kn(r.clientHeight-(g+k)),M=kn(c),L={rootMargin:-v+"px "+-y+"px "+-A+"px "+-M+"px",threshold:de(0,Je(1,d))||1};let G=!0;function q(ae){const te=ae[0].intersectionRatio;if(!Co(f,t.getBoundingClientRect()))return a();if(te!==d){if(!G)return a();te?a(!1,te):i=setTimeout(()=>{a(!1,1e-7)},1e3)}G=!1}try{s=new IntersectionObserver(q,{...L,root:r.ownerDocument})}catch{s=new IntersectionObserver(q,L)}s.observe(t)}const l=B(t),p=()=>a(n);return l.addEventListener("resize",p),a(!0),()=>{l.removeEventListener("resize",p),o()}}function Wh(t,e,n,s){s===void 0&&(s={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=s,p=Is(t),h=i||r?[...p?Pt(p):[],...e?Pt(e):[]]:[];h.forEach(v=>{i&&v.addEventListener("scroll",n),r&&v.addEventListener("resize",n)});const d=p&&a?Gh(p,n,r):null;let f=-1,c=null;o&&(c=new ResizeObserver(v=>{let[y]=v;y&&y.target===p&&c&&e&&(c.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var A;(A=c)==null||A.observe(e)})),n()}),p&&!l&&c.observe(p),e&&c.observe(e));let g,u=l?Ie(t):null;l&&k();function k(){const v=Ie(t);u&&!Co(u,v)&&n(),u=v,g=requestAnimationFrame(k)}return n(),()=>{var v;h.forEach(y=>{i&&y.removeEventListener("scroll",n),r&&y.removeEventListener("resize",n)}),d?.(),(v=c)==null||v.disconnect(),c=null,l&&cancelAnimationFrame(g)}}const Kh=$h,Vh=Sh,Yh=xh,Zh=Ah,Qh=(t,e,n)=>{const s=new Map,i=n??{},r={...Fh,...i.platform,_c:s};return vh(t,e,{...i,platform:r})},To=(t,e)=>({top:e,bottom:e,right:t}),Ns=(t,e,n,s={})=>{if(typeof t.showPopover!="function")return()=>{};try{t.showPopover()}catch{return()=>{}}let i=!0,r=0;const o=e instanceof Element?e:{getBoundingClientRect:()=>({x:e.right,y:e.top,left:e.right,right:e.right,top:e.top,bottom:e.bottom,width:0,height:e.bottom-e.top})};t.style.width=`${n.width}px`,t.style.maxHeight=`${n.height}px`,t.style.inset="auto";const l=Wh(o,t,()=>{const p=++r;Qh(o,t,{strategy:"fixed",placement:s.placement??"bottom-end",middleware:[Kh(8),Yh({padding:8,fallbackAxisSideDirection:"end",...s.boundary===void 0?{}:{boundary:s.boundary}}),Vh({padding:8,...s.boundary===void 0?{}:{boundary:s.boundary}}),Zh({padding:8,...s.boundary===void 0?{}:{boundary:s.boundary},apply:({availableWidth:h,availableHeight:d})=>{!i||p!==r||(t.style.width=`${Math.max(0,Math.min(n.width,h))}px`,t.style.maxHeight=`${Math.max(0,Math.min(n.height,d))}px`)}})]}).then(({x:h,y:d})=>{!i||p!==r||!t.isConnected||(t.style.left=`${h}px`,t.style.top=`${d}px`)}).catch(()=>{})},{animationFrame:s.trackTransform??!1,elementResize:typeof ResizeObserver<"u",layoutShift:typeof IntersectionObserver<"u"});return()=>{i=!1,l()}},An=t=>{if(!(!t||typeof t.hidePopover!="function"))try{t.hidePopover()}catch{}},En=async t=>{try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(t),!0}catch{}const e=document.activeElement,n=document.createElement("textarea");try{return n.value=t,n.setAttribute("readonly",""),n.style.position="fixed",n.style.opacity="0",document.body.append(n),n.select(),document.execCommand("copy")}catch{return!1}finally{n.remove(),e instanceof HTMLElement&&e.focus()}},Xh=t=>{const{host:e,state:n,target:s,targetElement:i,resetViewElement:r,messages:o}=t,a=[],l=i?.textContent?.trim()??"";return s!==null&&l!==""&&a.push({kind:"item",id:"copy-text",label:o.copyText,run:()=>{En(l)}}),s!==null&&e.definition.hasTarget(n,s)&&a.push({kind:"item",id:"feedback",label:o.feedback,run:()=>e.requestComment(_(s))}),r!==null&&a.push({kind:"item",id:"reset-view",label:o.resetView,run:()=>r.resetView()}),a.length===0?null:{id:"common",entries:a}},qs={open:!1,x:0,y:0,groups:[],openPath:[],activeId:null},Jh=(t,e,n)=>({open:n.some(s=>s.entries.length>0),x:t,y:e,groups:n,openPath:[],activeId:null}),eu=t=>t.flatMap(e=>e.entries),Us=(t,e)=>t.find(n=>n.id===e),Hs=(t,e)=>{let n=eu(t);for(const s of e){const i=Us(n,s);if(i===void 0||i.kind!=="submenu")return n;n=i.items}return n},Ro=t=>t.filter(e=>!(e.kind==="item"&&e.disabled===!0)).map(e=>e.id),Mo=(t,e)=>{const n=Ro(Hs(t.groups,t.openPath));if(n.length===0)return t;const s=t.activeId===null?e===1?-1:n.length:n.indexOf(t.activeId),i=n[(s+e+n.length)%n.length];return i===void 0?t:{...t,activeId:i}},Oo=(t,e)=>{const n=Us(Hs(t.groups,t.openPath),e);if(n===void 0||n.kind!=="submenu")return t;const s=Ro(n.items)[0]??null;return{...t,openPath:[...t.openPath,e],activeId:s}},_o=t=>t.activeId===null?t:Oo(t,t.activeId),tu=t=>{if(t.openPath.length===0)return t;const e=t.openPath[t.openPath.length-1]??null;return{...t,openPath:t.openPath.slice(0,-1),activeId:e}},nu=t=>{const e=Us(Hs(t.groups,t.openPath),t.activeId??"");return e===void 0?{state:t,run:null}:e.kind==="submenu"?{state:_o(t),run:null}:e.disabled===!0?{state:t,run:null}:{state:qs,run:e.run}},Bs=(t,e)=>{const n=[],s=i=>{for(const r of i.querySelectorAll("*"))r.matches(e)&&n.push(r),r.shadowRoot&&s(r.shadowRoot)};return s(t),t instanceof Element&&t.shadowRoot&&s(t.shadowRoot),n},Po=(t,e)=>{const n=[];let s=t;for(;s;){const i=s instanceof Element&&s.assignedSlot?s.assignedSlot:s.parentNode;if(s=i instanceof ShadowRoot?i.host:i,!(s instanceof Element)||s===e)break;n.push(s)}return n},nt="data-dpk-target",su=2800,Lo=48,iu=t=>t.getClientRects().length>0,ru=(t,e)=>{const n=Bs(t,`[${nt}]`).filter(r=>(r.getAttribute(nt)??"").split(/\s+/).includes(e)),s=Bs(t,"[data-dpk-comment]").filter(r=>r.getAttribute("data-dpk-comment")===e),i=[...n,...s];return i.find(iu)??i[0]??null},zo=(t,e)=>{const n=getComputedStyle(t),s=e==="y"?n.overflowY:n.overflowX;return s!=="auto"&&s!=="scroll"?!1:e==="y"?t.scrollHeight>t.clientHeight:t.scrollWidth>t.clientWidth},ou=(t,e)=>{for(const n of Po(e,t))zo(n,"y")&&ws(n,e,Lo),zo(n,"x")&&Dr(n,e,Lo)},Io="color-mix(in srgb, var(--dpk-accent) 45%, transparent)",De={outline:"2px solid var(--dpk-accent)",outlineOffset:"3px"},Do={outline:"2px solid transparent",outlineOffset:"3px"},au=t=>t?[{...De},{...De,offset:.85},{...Do}]:[{...De,boxShadow:`0 0 0 0 ${Io}`},{...De,boxShadow:"0 0 0 14px transparent",offset:.3},{...De,boxShadow:`0 0 0 0 ${Io}`,offset:.31},{...De,boxShadow:"0 0 0 14px transparent",offset:.6},{...De,offset:.85},{...Do}],Lt={filter:"drop-shadow(0 0 3px var(--dpk-accent)) drop-shadow(0 0 3px var(--dpk-accent))"},Cn={filter:"drop-shadow(0 0 3px transparent) drop-shadow(0 0 3px transparent)"},lu=t=>t?[{...Lt},{...Lt,offset:.85},{...Cn}]:[{...Lt},{...Cn,offset:.3},{...Lt,offset:.31},{...Cn,offset:.6},{...Lt,offset:.61},{...Cn}],du=t=>{if(typeof t.animate!="function")return;const e=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches,n=t instanceof SVGElement&&!(t instanceof SVGSVGElement);t.animate(n?lu(e):au(e),{duration:su,easing:"ease-out"})},cu=t=>typeof t=="object"&&t!==null&&"getContextMenuItems"in t&&typeof t.getContextMenuItems=="function",pu=(t,e)=>{const n=[];for(const s of t){if(!cu(s))continue;const i=s.getContextMenuItems(e);i!==null&&n.push(...i)}return n},hu=t=>{for(const e of t)if(e instanceof Element)return e;return null},uu=t=>{for(const e of t){if(!(e instanceof Element))continue;const n=e.getAttribute(nt);if(n!==null&&n.trim()!=="")try{return Re(n)}catch{continue}const s=e.getAttribute("data-dpk-comment");if(s!==null&&s.trim()!=="")try{return Re(s)}catch{continue}}return null},gu=(t,e)=>{for(const n of t)if(n instanceof Element&&typeof Reflect.get(n,e)=="function")return n;return null},fu=t=>{for(const e of t)if(e instanceof Element&&(e.hasAttribute(nt)||e.hasAttribute("data-dpk-comment")))return e;return null},No="dpk-context-menu",qo=(t,e)=>`dpk-settings-option dpk-context-menu-option${e?" is-active":""}${t.kind==="item"&&t.danger===!0?" is-danger":""}`,Uo=(t,e,n,s)=>{const i=n.openPath.length===e&&n.activeId===t.id;if(t.kind==="submenu"){const r=n.openPath[e]===t.id;return m`<div class="dpk-context-menu-submenu-wrap">
241
239
  <button
242
- class=${Vo(t,i)}
240
+ class=${qo(t,i)}
243
241
  type="button"
244
242
  role="menuitem"
245
243
  aria-haspopup="menu"
@@ -249,11 +247,11 @@ const tr=[["path",{d:"M12 5v14"}],["path",{d:"m19 12-7 7-7-7"}]],Zd=[["path",{d:
249
247
  >
250
248
  <span class="dpk-settings-text"><span class="dpk-settings-name">${t.label}</span></span>
251
249
  </button>
252
- ${r?k`<div class="dpk-settings dpk-context-menu-submenu" role="menu">
253
- ${t.items.map(o=>Yo(o,e+1,n,s))}
250
+ ${r?m`<div class="dpk-settings dpk-context-menu-submenu" role="menu">
251
+ ${t.items.map(o=>Uo(o,e+1,n,s))}
254
252
  </div>`:b}
255
- </div>`}return k`<button
256
- class=${Vo(t,i)}
253
+ </div>`}return m`<button
254
+ class=${qo(t,i)}
257
255
  type="button"
258
256
  role="menuitem"
259
257
  ?disabled=${t.disabled===!0}
@@ -261,8 +259,8 @@ const tr=[["path",{d:"M12 5v14"}],["path",{d:"m19 12-7 7-7-7"}]],Zd=[["path",{d:
261
259
  @click=${()=>s.onInvoke(t)}
262
260
  >
263
261
  <span class="dpk-settings-text"><span class="dpk-settings-name">${t.label}</span></span>
264
- </button>`},vu=(t,e,n)=>{if(!t.open)return b;const s=t.groups.filter(i=>i.entries.length>0);return k`<div
265
- id=${Ko}
262
+ </button>`},mu=(t,e,n)=>{if(!t.open)return b;const s=t.groups.filter(i=>i.entries.length>0);return m`<div
263
+ id=${No}
266
264
  class="dpk-settings dpk-context-menu"
267
265
  popover="manual"
268
266
  role="menu"
@@ -270,20 +268,20 @@ const tr=[["path",{d:"M12 5v14"}],["path",{d:"m19 12-7 7-7-7"}]],Zd=[["path",{d:
270
268
  aria-label=${e.menu}
271
269
  @keydown=${n.onKeyDown}
272
270
  >
273
- ${s.map((i,r)=>k`${r>0?k`<hr class="dpk-context-menu-divider" />`:b}${i.heading===void 0?b:k`<div class="dpk-context-menu-heading">${i.heading}</div>`}${i.entries.map(o=>Yo(o,0,t,n))}`)}
274
- </div>`},xu={width:220,height:420},yu=t=>t.closest('input, textarea, [contenteditable=""], [contenteditable="true"]')!==null;class wu{#e;#s;#t;#n=Ws;#i=null;#r=null;#o=null;constructor(e,n){this.#e=e,this.#s=n,e.addController(this),new pn(e,{open:()=>this.#n.open,closesOn:s=>this.#i===null||!s.includes(this.#i),ownsEscape:()=>this.#n.open,dismiss:()=>this.#l()}),this.#t={onHover:s=>this.#d(s),onInvoke:s=>this.#c(s),onKeyDown:s=>this.#p(s)}}hostConnected(){this.#e.addEventListener("contextmenu",this.#h)}hostDisconnected(){this.#e.removeEventListener("contextmenu",this.#h),this.#a()}hostUpdated(){const e=this.#e.shadowRoot?.getElementById(Ko)??null;if(!this.#n.open||e===null){this.#a();return}(this.#i!==e||this.#r===null||this.#r.x!==this.#n.x||this.#r.y!==this.#n.y)&&(this.#o?.(),Mn(e),this.#o=Gs(e,Io(this.#n.x,this.#n.y),xu,{placement:"right-start"}),this.#i=e,this.#r={x:this.#n.x,y:this.#n.y},e.focus())}render(){return vu(this.#n,this.#s.messages(),this.#t)}#a(){this.#i!==null&&(Mn(this.#i),this.#o?.(),this.#o=null,this.#i=null,this.#r=null)}#l(){this.#n=Ws,this.#e.requestUpdate()}#d(e){this.#n={...this.#n,activeId:e},this.#e.requestUpdate()}#c(e){if(e.kind==="submenu"){this.#n=Uo(this.#n,e.id),this.#e.requestUpdate();return}e.disabled!==!0&&(this.#l(),e.run())}#p=e=>{switch(e.key){case"ArrowDown":e.preventDefault(),this.#n=qo(this.#n,1),this.#e.requestUpdate();return;case"ArrowUp":e.preventDefault(),this.#n=qo(this.#n,-1),this.#e.requestUpdate();return;case"ArrowRight":e.preventDefault(),this.#n=Ho(this.#n),this.#e.requestUpdate();return;case"ArrowLeft":e.preventDefault(),this.#n=iu(this.#n),this.#e.requestUpdate();return;case"Enter":case" ":{e.preventDefault();const n=ru(this.#n);this.#n=n.state,this.#e.requestUpdate(),n.run?.();return}case"Escape":e.preventDefault(),this.#l();return;case"Tab":this.#l();return;default:return}};#h=e=>{if(e.defaultPrevented||e.shiftKey)return;const n=e.composedPath(),s=fu(n);if(s!==null&&yu(s))return;e.preventDefault();const i=mu(n),r=gu(n,{clientX:e.clientX,clientY:e.clientY,target:i,origin:s}),o=tu({host:this.#e,state:this.#s.state(),target:i,targetElement:bu(n),resetViewElement:ku(n,"resetView"),messages:this.#s.messages()}),a=o===null?r:[...r,o];this.#n=nu(e.clientX,e.clientY,a),this.#e.requestUpdate()}}const Ln=t=>{let e=t;for(;e!==null;){if(e instanceof Element){const n=e.getAttribute("lang");if(n!==null)return n}e=e instanceof ShadowRoot?e.host:e.parentNode}return null},Zs=["en","ja"],Zo="en",Qo=t=>Zs.some(e=>e===t),zn=t=>{const e=(t??"").split("-")[0]?.toLowerCase()??"";return Qo(e)?e:Zo},Xo=t=>zn(Ln(t)),Qs="dpk-locale-change",Jo=t=>typeof t=="string"&&Qo(t)?t:null,$u=t=>t.preference??t.authored,Su=(t,e)=>t===e?null:t,je=t=>e=>e==="ja"?t.ja:t.en,ea=je({en:{menu:"Context menu",copyText:"Copy text",feedback:"Give feedback",reviewComment:"Review comment",resetView:"Reset view",resetPositions:"Reset positions",duplicate:"Duplicate",delete:"Delete"},ja:{menu:"\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u30E1\u30CB\u30E5\u30FC",copyText:"\u30C6\u30AD\u30B9\u30C8\u3092\u30B3\u30D4\u30FC",feedback:"\u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u3059\u308B",reviewComment:"\u30EC\u30D3\u30E5\u30FC\u30B3\u30E1\u30F3\u30C8",resetView:"\u8868\u793A\u3092\u30EA\u30BB\u30C3\u30C8",resetPositions:"\u4F4D\u7F6E\u3092\u30EA\u30BB\u30C3\u30C8",duplicate:"\u8907\u88FD",delete:"\u524A\u9664"}}),ta=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function na(t){return typeof ta.Buffer<"u"&&ta.Buffer.isBuffer(t)}function sa(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 ia(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function ra(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const Au="[object RegExp]",Eu="[object String]",Cu="[object Number]",Tu="[object Boolean]",Ru="[object Symbol]",_u="[object Date]",Mu="[object Map]",Ou="[object Set]",Pu="[object Array]",Lu="[object Function]",zu="[object ArrayBuffer]",Xs="[object Object]",Du="[object Error]",Iu="[object DataView]",Nu="[object Uint8Array]",qu="[object Uint8ClampedArray]",Uu="[object Uint16Array]",Hu="[object Uint32Array]",ju="[object BigUint64Array]",Bu="[object Int8Array]",Fu="[object Int16Array]",Gu="[object Int32Array]",Wu="[object BigInt64Array]",Ku="[object Float32Array]",Vu="[object Float64Array]";function Yu(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function Zu(t,e,n){return qt(t,e,void 0,void 0,void 0,void 0,n)}function qt(t,e,n,s,i,r,o){const a=o(t,e,n,s,i,r);if(a!==void 0)return a;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 Ut(t,e,r,o)}return Ut(t,e,r,o)}function Ut(t,e,n,s){if(Object.is(t,e))return!0;let i=ra(t),r=ra(e);if(i==="[object Arguments]"&&(i=Xs),r==="[object Arguments]"&&(r=Xs),i!==r)return!1;switch(i){case Eu:return t.toString()===e.toString();case Cu:return Yu(t.valueOf(),e.valueOf());case Tu:case _u:case Ru:return Object.is(t.valueOf(),e.valueOf());case Au:return t.source===e.source&&t.flags===e.flags;case Lu:return t===e}n=n??new Map;const o=n.get(t),a=n.get(e);if(o!=null&&a!=null)return o===e;n.set(t,e),n.set(e,t);try{switch(i){case Mu:if(t.size!==e.size)return!1;for(const[l,c]of t.entries())if(!e.has(l)||!qt(c,e.get(l),l,t,e,n,s))return!1;return!0;case Ou:{if(t.size!==e.size)return!1;const l=Array.from(t.values()),c=Array.from(e.values());for(let d=0;d<l.length;d++){const h=l[d],f=c.findIndex(p=>qt(h,p,void 0,t,e,n,s));if(f===-1)return!1;c.splice(f,1)}return!0}case Pu:case Nu:case qu:case Uu:case Hu:case ju:case Bu:case Fu:case Gu:case Wu:case Ku:case Vu:if(na(t)!==na(e)||t.length!==e.length)return!1;for(let l=0;l<t.length;l++)if(!qt(t[l],e[l],l,t,e,n,s))return!1;return!0;case zu:return t.byteLength!==e.byteLength?!1:Ut(new Uint8Array(t),new Uint8Array(e),n,s);case Iu:return t.byteLength!==e.byteLength||t.byteOffset!==e.byteOffset?!1:Ut(new Uint8Array(t),new Uint8Array(e),n,s);case Du:return t.name===e.name&&t.message===e.message;case Xs:{if(!(Ut(t.constructor,e.constructor,n,s)||sa(t)&&sa(e)))return!1;const l=[...Object.keys(t),...ia(t)],c=[...Object.keys(e),...ia(e)];if(l.length!==c.length)return!1;for(let d=0;d<l.length;d++){const h=l[d],f=t[h];if(!Object.hasOwn(e,h))return!1;const p=e[h];if(!qt(f,p,h,t,e,n,s))return!1}return!0}default:return!1}}finally{n.delete(t),n.delete(e)}}function Qu(){}function Dn(t,e){return Zu(t,e,Qu)}const oa=R({id:w(v(),S(1)),type:G(H),target:R({type:w(v(),S(1)),id:w(v(),S(1))}),payload:R({body:w(v(),S(1))}),note:B(v()),createdAt:w(v(),S(1))}),Js={schema:oa,mode:"append",targetType:"page"},Xu=R({body:v()}),Ht=t=>{const e=C(Xu,t.payload);return e.success?e.output.body:""},ei="data-dpk-grill",le="grill",In="answer",jt="data-grill-questions",Ju=B(v()),aa=t=>{const e=t?.trim();return e===void 0||e===""?void 0:e},eg=t=>{const e=aa(t);return e===void 0?{}:{questions:e}},lt={questions:[],rounds:[]},tg=L({id:Rs,label:w(v(),S(1))}),la=L({id:Rs,ref:N(w(v(),S(1))),title:w(v(),S(1)),description:N(v()),note:N(v()),options:N(U(tg),[]),freeText:N(gn(),!0)}),da=mn("kind",[L({kind:G("option"),optionId:w(v(),S(1))}),L({kind:G("free"),text:v()})]),ca=mn("kind",[...da.options,L({kind:G("clear")})]),ng=L({...la.entries,answer:N(da)}),sg=L({label:N(w(v(),S(1))),questions:U(ng)}),ig=L({questions:U(la),history:N(U(sg),[])}),pa=t=>{const e=new Set;return t.map((n,s)=>{if(e.has(n.id))throw new Error(`duplicate question id: ${n.id}`);e.add(n.id);const i=new Set;for(const r of n.options){if(i.has(r.id))throw new Error(`duplicate option id: ${r.id} in question ${n.id}`);i.add(r.id)}return{...n,ref:n.ref??`Q${s+1}`,description:n.description??null,note:n.note??null}})},ha=t=>({id:t.id,ref:t.ref,title:t.title,description:t.description,note:t.note,options:t.options,freeText:t.freeText}),rg=t=>{const e=t.answer??null;if(e?.kind==="option"&&!t.options.some(n=>n.id===e.optionId))throw new Error(`unknown option id: ${e.optionId} in question ${t.id}`);return{...ha(t),answer:e}},og=t=>{const e=Mt(ig,t);return{questions:pa(e.questions).map(ha),rounds:e.history.map((n,s)=>({label:n.label??`v${s+1}`,questions:pa(n.questions).map(rg)}))}},dt=(t,e)=>t.questions.find(n=>n.id===e),ti=(t,e)=>{const n=dt(t,e);return n?`${n.ref} \xB7 ${n.title}`:e},Nn=(t,e)=>e?e.kind==="option"?t.options.find(n=>n.id===e.optionId)?.label??"":e.text.trim():"",qn=(t,e)=>Nn(t,e)!=="",ag=t=>{let e="";for(let n=t+1;n>0;n=Math.floor((n-1)/26))e=String.fromCharCode(97+(n-1)%26)+e;return e},ua=(t,e)=>({total:t.questions.length,answered:t.questions.filter(n=>qn(n,e[n.id])).length}),lg=(t,e,n)=>{const s=t.questions,i=s.findIndex(o=>o.id===n);return(i===-1?s:[...s.slice(i+1),...s.slice(0,i)]).find(o=>!qn(o,e[o.id]))?.id??null},dg=w(v(),te(/^[A-Za-z0-9_-]+(?:@[A-Za-z0-9_-]+)?$/,"a question id, optionally qualified by its board (`retry@scope`)")),cg=R({id:w(v(),S(1)),type:G(In),target:R({type:G(le),id:dg}),payload:ca,note:B(v()),createdAt:w(v(),S(1))}),pg={schema:cg,mode:"patch",targetType:le},Q=t=>t.type===In&&t.target.type===le,hg=(t,e)=>({type:In,target:{type:le,id:t},payload:e}),ga=t=>{const e=C(ca,t.payload);return e.success?e.output:null},ug=(t,e)=>[...t.filter(n=>!(Q(n)&&n.target.id===e.target.id)),e],fa=(t,e,n)=>{const s=dt(t,n.target.id),i=ga(n);if(!s||!i)return null;const r=e[s.id];if(i.kind==="clear"){if(r===void 0)return e;const o={...e};return delete o[s.id],o}return i.kind==="option"&&!s.options.some(o=>o.id===i.optionId)||i.kind==="free"&&!s.freeText?null:r?.kind==="option"&&i.kind==="option"&&r.optionId===i.optionId||r?.kind==="free"&&i.kind==="free"&&r.text===i.text?e:{...e,[s.id]:i}},ma="page",ni="app",ka=t=>P(t),ba=(t,e,n,s=new Map,i=lt)=>{let r=e,o={};const a=[],l=[],c=[],d=[],h=new Map;for(const p of n){if(p.type===H)continue;if(re(p)){const m=s.get(p.id);m===void 0||m.stale!==void 0?l.push({action:p,reason:m?.stale??"target-missing"}):a.push(p);continue}if(Q(p)){const m=fa(i,o,p);m===null?l.push({action:p,reason:dt(i,p.target.id)?"constraint-violated":"target-missing"}):m===o?c.push(p):(o=m,a.push(p));continue}const g=tt(t.actions,p.type);if(!g){l.push({action:p,reason:"unsupported-action-type"});continue}const u=t.apply(r,p);if(u===null){l.push({action:p,reason:t.hasTarget(r,p.target)?"constraint-violated":"target-missing"});continue}if(g.mode!=="append"&&si(t,r,u)){c.push(p);continue}r=u,a.push(p)}for(const p of n){if(p.type!==H)continue;if(!(p.target.type===ma||p.target.type===ni?t.pageTargetExists?.(r,p.target)??!0:t.hasTarget(r,p.target))){l.push({action:p,reason:"target-missing"});continue}d.push(p);const m=ka(p.target);h.set(m,[...h.get(m)??[],p])}const f=new Map(n.map((p,g)=>[p.id,g]));return l.sort((p,g)=>(f.get(p.action.id)??0)-(f.get(g.action.id)??0)),{base:e,state:r,actions:n,applied:a,stale:l,obsolete:c,comments:d,commentsByTarget:h,grill:i,answers:o}},si=(t,e,n)=>e===n?!0:t.canonicalState===void 0?Dn(e,n):Dn(t.canonicalState(e),t.canonicalState(n)),va=t=>{const e=new Set(t.obsolete.map(n=>n.id));return t.actions.filter(n=>!e.has(n.id))},gg=(t,e,n,s)=>{let i=e;const r=s??xa(i).map(o=>o.id);for(const o of[...r].reverse())i=fg(t,i,n,o,s!==void 0)??i;return i},xa=t=>t.applied.filter(e=>!re(e)&&!Q(e)),fg=(t,e,n,s,i)=>{const r=xa(e),o=r.findIndex(u=>u.id===s),a=r[o];if(a===void 0)return null;const l=r.slice(0,o),c=ii(t,a),d=!t.hasTarget(e.state,a.target)||/^(?:DELETE|REMOVE)_/.test(a.type),h=c==="sequence"||d,f=[...i&&h?mg(t,e.base,r,o):[],...h?kg(t,l,a):[]],p=new Set,g=f.filter(u=>{const m=u.join(" ");return p.has(m)?!1:(p.add(m),!0)}).sort((u,m)=>m.length-u.length);for(const u of g){const m=bg(t,e,n,u);if(m!==null)return m}return null},mg=(t,e,n,s)=>{const i=[];let r=e;for(const o of n.slice(0,s+1))i.push(r),r=t.apply(r,o)??r;return i.flatMap((o,a)=>si(t,o,r)?[n.slice(a,s+1).map(l=>l.id)]:[])},kg=(t,e,n)=>{const s=ya(n),i=e.filter(l=>ya(l).some(c=>s.includes(c))),r=ii(t,n),o=i.filter(l=>ii(t,l)===r),a=l=>l.map((c,d)=>[...l.slice(d).map(h=>h.id),n.id]);return[...a(i),...a(o),...i.map(l=>[l.id,n.id]),...i.map(l=>[l.id])]},ya=t=>{const n=t.target.type===ma||t.target.type===ni?[]:t.target.id.split("."),s=typeof t.payload=="object"&&t.payload!==null?Object.values(t.payload).filter(i=>typeof i=="string"&&i!==""):[];return[...n,...s]},ii=(t,e)=>tt(t.actions,e.type)?.mode,bg=(t,e,n,s)=>{const i=new Set(e.stale.map(o=>o.action.id)),r=new Set(s);for(;;){const o=n(e.actions.filter(l=>!r.has(l.id))),a=o.stale.filter(l=>!i.has(l.action.id)).map(l=>l.action);if(a.length===0)return si(t,o.state,e.state)?o:null;if(a.some(l=>l.type===H||re(l)||Q(l)))return null;for(const l of a)r.add(l.id)}},vg={en:"English",ja:"\u65E5\u672C\u8A9E"},O=je({en:{review:"Review",reviewChanges:"Activity log",reviewComments:"Review comments",settings:"Settings",menu:"Page menu",menuMove:"Move this menu",menuReturn:"Put the menu back in the header",settingsDisplay:"Display",settingsAppearance:"Appearance",settingsTheme:"Theme",themeLight:"Light",themeDark:"Dark",settingsClose:"Close settings",settingsSections:"Settings sections",undoRedo:"Undo / redo",undo:"Undo",redo:"Redo",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)`,baseDataError:"Could not read the base data (showing an empty page)",pageEmpty:"This page holds no view or board",pageEmptyHint:"A page holds exactly one <dpk-view-*> or <dpk-board-*>.",pageUnavailable:"This page could not show its content",pageUnavailableHint:t=>`No loaded entry defines <${t}>. Load the entry that carries it.`,memo:"Memo",supplements:"Supplements",openSupplements:"Open supplements",closeSupplements:"Close supplements",resizeSupplements:"Resize supplements",resizeSupplementsHint:"Drag, or use the arrow keys, to change the height (double-click to reset)",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",changes:"Updates",changesUnread:t=>`Updates (${t} new)`,changesTitle:"Changes by version",changesCurrent:"This version",changesReadAll:"Mark all as read",changesNew:"New",changesShow:"Show",changesDismiss:"Dismiss",changesWaiting:t=>`${t} more`,changesSeeAll:"See all",changesError:"Could not read the change log",grill:"Questions",grillError:"Could not read the questions",grillGroup:"Question",grillProgress:(t,e)=>`${t} of ${e} answered`,grillAnswer:"Answer",grillAnswerFree:"Answer in your own words",grillAnswerClear:"Clear answer",grillQuoted:t=>`\u2192 \u201C${t}\u201D`,grillOpen:t=>`Open question ${t}`,grillFreeText:"Your own answer",grillFreeTextOf:t=>`Your own answer to ${t}`,grillFreeTextPlaceholder:"Type an answer\u2026 (\u2318/Ctrl+Enter for next)",grillRoundSelect:"Question round",grillCurrentRound:"Current questions",grillRoundOption:(t,e)=>`${t} (${e})`,grillPastRound:t=>`${t}: earlier questions, read-only`,grillUnanswered:"Not answered",grillNoQuestions:"No questions in this round.",checkMode:"Check Mode",checkModeOn:"Turn off Check Mode",checkModeOff:"Turn on Check Mode",checkModeUnchecked:"Mark as checked",checkModeChecked:"Checked \u2014 click to unmark",checkModeStale:"Changed since you checked it \u2014 click to check again",checkModeConfirmTitle:"Turn off Check Mode?",checkModeConfirmBody:"Every checkmark on this page will be cleared. This only affects what you see; it is never sent to the agent.",checkModeConfirmOk:"Turn off",checkModeConfirmCancel:"Cancel"},ja:{review:"\u30EC\u30D3\u30E5\u30FC",reviewChanges:"\u64CD\u4F5C\u30ED\u30B0",reviewComments:"\u30EC\u30D3\u30E5\u30FC\u30B3\u30E1\u30F3\u30C8",settings:"\u8A2D\u5B9A",menu:"\u30DA\u30FC\u30B8\u306E\u30E1\u30CB\u30E5\u30FC",menuMove:"\u3053\u306E\u30E1\u30CB\u30E5\u30FC\u3092\u79FB\u52D5",menuReturn:"\u30E1\u30CB\u30E5\u30FC\u3092\u30D8\u30C3\u30C0\u30FC\u306B\u623B\u3059",settingsDisplay:"\u8868\u793A",settingsAppearance:"\u5916\u89B3",settingsTheme:"\u30C6\u30FC\u30DE",themeLight:"\u30E9\u30A4\u30C8",themeDark:"\u30C0\u30FC\u30AF",settingsClose:"\u8A2D\u5B9A\u3092\u9589\u3058\u308B",settingsSections:"\u8A2D\u5B9A\u306E\u30BB\u30AF\u30B7\u30E7\u30F3",undoRedo:"\u53D6\u308A\u6D88\u3057\u30FB\u3084\u308A\u76F4\u3057",undo:"\u53D6\u308A\u6D88\u3057",redo:"\u3084\u308A\u76F4\u3057",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`,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",pageEmpty:"\u3053\u306E\u30DA\u30FC\u30B8\u306B\u306F view \u3082 board \u3082\u3042\u308A\u307E\u305B\u3093",pageEmptyHint:"\u30DA\u30FC\u30B8\u306B\u306F <dpk-view-*> \u304B <dpk-board-*> \u3092\u3072\u3068\u3064\u7F6E\u304D\u307E\u3059\u3002",pageUnavailable:"\u3053\u306E\u30DA\u30FC\u30B8\u306E\u5185\u5BB9\u3092\u8868\u793A\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F",pageUnavailableHint:t=>`<${t}> \u3092\u5B9A\u7FA9\u3059\u308B entry \u304C\u8AAD\u307F\u8FBC\u307E\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u305D\u306E entry \u3092\u8AAD\u307F\u8FBC\u3093\u3067\u304F\u3060\u3055\u3044\u3002`,memo:"\u30E1\u30E2",supplements:"\u88DC\u8DB3\u60C5\u5831",openSupplements:"\u88DC\u8DB3\u60C5\u5831\u3092\u958B\u304F",closeSupplements:"\u88DC\u8DB3\u60C5\u5831\u3092\u9589\u3058\u308B",resizeSupplements:"\u88DC\u8DB3\u60C5\u5831\u306E\u9AD8\u3055\u3092\u5909\u3048\u308B",resizeSupplementsHint:"\u30C9\u30E9\u30C3\u30B0\u3001\u307E\u305F\u306F\u77E2\u5370\u30AD\u30FC\u3067\u9AD8\u3055\u3092\u5909\u3048\u308B\uFF08\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u3067\u65E2\u5B9A\u306B\u623B\u3059\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",changes:"\u66F4\u65B0\u306E\u304A\u77E5\u3089\u305B",changesUnread:t=>`\u66F4\u65B0\u306E\u304A\u77E5\u3089\u305B\uFF08\u65B0\u7740 ${t} \u4EF6\uFF09`,changesTitle:"\u7248\u3054\u3068\u306E\u5909\u66F4",changesCurrent:"\u3053\u306E\u7248",changesReadAll:"\u3059\u3079\u3066\u65E2\u8AAD\u306B\u3059\u308B",changesNew:"\u65B0\u7740",changesShow:"\u898B\u308B",changesDismiss:"\u9589\u3058\u308B",changesWaiting:t=>`\u307B\u304B ${t} \u4EF6`,changesSeeAll:"\u3059\u3079\u3066\u898B\u308B",changesError:"\u5909\u66F4\u306E\u4E00\u89A7\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F",grill:"\u8CEA\u554F",grillError:"\u8CEA\u554F\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F",grillGroup:"\u8CEA\u554F",grillProgress:(t,e)=>`\u56DE\u7B54\u6E08\u307F ${t} / ${e}`,grillAnswer:"\u56DE\u7B54",grillAnswerFree:"\u81EA\u7531\u8A18\u8FF0\u3067\u56DE\u7B54",grillAnswerClear:"\u56DE\u7B54\u3092\u30AF\u30EA\u30A2",grillQuoted:t=>`\u2192 \u300C${t}\u300D`,grillOpen:t=>`\u8CEA\u554F ${t} \u3092\u3072\u3089\u304F`,grillFreeText:"\u81EA\u7531\u8A18\u8FF0",grillFreeTextOf:t=>`${t} \u306E\u81EA\u7531\u8A18\u8FF0`,grillFreeTextPlaceholder:"\u56DE\u7B54\u3092\u5165\u529B\u2026\uFF08\u2318/Ctrl+Enter \u3067\u6B21\u3078\uFF09",grillRoundSelect:"\u8CEA\u554F\u306E\u30E9\u30A6\u30F3\u30C9",grillCurrentRound:"\u73FE\u5728\u306E\u8CEA\u554F",grillRoundOption:(t,e)=>`${t}\uFF08${e} \u554F\uFF09`,grillPastRound:t=>`${t}: \u904E\u53BB\u306E\u8CEA\u554F\uFF08\u95B2\u89A7\u306E\u307F\uFF09`,grillUnanswered:"\u672A\u56DE\u7B54",grillNoQuestions:"\u3053\u306E\u30E9\u30A6\u30F3\u30C9\u306B\u8CEA\u554F\u306F\u3042\u308A\u307E\u305B\u3093\u3002",checkMode:"\u78BA\u8A8D\u30E2\u30FC\u30C9",checkModeOn:"\u78BA\u8A8D\u30E2\u30FC\u30C9\u3092\u7D42\u4E86",checkModeOff:"\u78BA\u8A8D\u30E2\u30FC\u30C9\u3092\u958B\u59CB",checkModeUnchecked:"\u78BA\u8A8D\u6E08\u307F\u306B\u3059\u308B",checkModeChecked:"\u78BA\u8A8D\u6E08\u307F\uFF08\u30AF\u30EA\u30C3\u30AF\u3067\u89E3\u9664\uFF09",checkModeStale:"\u3053\u306E\u78BA\u8A8D\u5F8C\u306B\u5909\u66F4\u304C\u3042\u308A\u307E\u3059\uFF08\u30AF\u30EA\u30C3\u30AF\u3067\u518D\u78BA\u8A8D\uFF09",checkModeConfirmTitle:"\u78BA\u8A8D\u30E2\u30FC\u30C9\u3092\u7D42\u4E86\u3057\u307E\u3059\u304B?",checkModeConfirmBody:"\u3053\u306E\u30DA\u30FC\u30B8\u306E\u30C1\u30A7\u30C3\u30AF\u306F\u3059\u3079\u3066\u6D88\u3048\u307E\u3059\u3002\u8868\u793A\u3060\u3051\u306E\u72B6\u614B\u306A\u306E\u3067\u3001Agent \u306B\u306F\u9001\u3089\u308C\u307E\u305B\u3093\u3002",checkModeConfirmOk:"\u7D42\u4E86\u3059\u308B",checkModeConfirmCancel:"\u30AD\u30E3\u30F3\u30BB\u30EB"}}),xg=(t,e,n)=>{const s=ga(n);if(s===null)return{title:n.type,tone:"meta"};if(s.kind==="clear")return{title:t.grillAnswerClear,tone:"delete"};if(s.kind==="option"){const i=dt(e,n.target.id)?.options.find(r=>r.id===s.optionId);return{title:t.grillAnswer,tone:"update",summary:t.grillQuoted(i?.label??s.optionId)}}return{title:t.grillAnswerFree,tone:"update",summary:t.grillQuoted(s.text.slice(0,120))}},yg=(t,e)=>{const{grill:n}=e,s=O(e.locale);return{...t,hasTarget:(i,r)=>r.type===le?dt(n,r.id)!==void 0:t.hasTarget(i,r),commentTargets:(i,r)=>[...t.commentTargets(i,r),...n.questions.map(o=>({value:P({type:le,id:o.id}),label:ti(n,o.id),group:s.grillGroup}))],describe:(i,r,o)=>{const a=ti(n,i.target.id);if(Q(i)){const{title:c,summary:d,tone:h}=xg(s,n,i);return{title:c,tone:h,targetLabel:a,...d===void 0?{}:{summary:d}}}const l=t.describe(i,r,o);return i.target.type===le?{...l,targetLabel:a}:l},serialize:i=>Q(i)?`${i.type} ${P(i.target)} ${JSON.stringify(i.payload)}`:t.serialize(i)}},wg=R({v:G(1),template:w(v(),S(1)),actions:U(xe())});class ri{constructor(e){this.storage=e}load(e,n){try{const s=this.storage.getItem(e);if(s===null)return[];const i=C(wg,JSON.parse(s));return!i.success||i.output.template!==n?[]:i.output.actions.flatMap(r=>{const o=C(Pe,r);return o.success?[o.output]:[]})}catch{return[]}}save(e,n,s){const i={v:1,template:n,actions:s};try{this.storage.setItem(e,JSON.stringify(i))}catch{}}clear(e){try{this.storage.removeItem(e)}catch{}}}class oi{constructor(){this.store=new Map}load(e,n){return new ri({getItem:s=>this.store.get(s)??null,setItem:(s,i)=>{this.store.set(s,i)},removeItem:s=>{this.store.delete(s)}}).load(e,n)}save(e,n,s){this.store.set(e,JSON.stringify({v:1,template:n,actions:s}))}clear(e){this.store.delete(e)}}const ai=()=>{try{if(typeof localStorage<"u")return new ri(localStorage)}catch{}return new oi},Bt=t=>`dev-process-kit:draft:${typeof location>"u"?"local":`${location.pathname}${location.search}`}:${t}`,wa={redoStack:[]},$g=(t,e)=>{const n=t.at(-1);return n===void 0?null:{actions:t.slice(0,-1),state:{redoStack:[...e.redoStack,n]}}},Sg=(t,e)=>{const n=e.redoStack.at(-1);return n===void 0?null:{actions:[...t,n],state:{redoStack:e.redoStack.slice(0,-1)}}},Ag=()=>wa,Eg=t=>t.length>0,Cg=t=>t.redoStack.length>0,Tg=U(xe());class $a{#e;#s;#t={targets:[],providers:[]};#n;#i=new Map;#r;#o;#a;#l;#d;#c=new Set;#p=[];#h=0;#f=wa;constructor(e){this.#e=e.definition,this.#n=e.grill??{grill:lt,locale:"en"},this.#s=this.#y(),this.#r=e.base,this.#d=e.storageKey??Bt(e.definition.name),this.#l=e.storage===void 0?ai():e.storage;const n=e.initialActions??this.#l?.load(this.#d,this.definition.name)??[];this.#o=Ea(this.definition,n),this.#a=this.#x(this.#o),this.#w()&&this.#T()}get definition(){return this.#s}setComponentSnapshot(e){const n=Mt(ah,e);if(!Dn(n,this.#t)){this.#t=n,this.#k(),this.#a=this.#x(this.#o);for(const s of this.#c)s()}}get componentSnapshot(){return this.#t}setTemplate(e){this.#e=e,this.#k(),this.#a=this.#x(this.#o);for(const n of this.#c)n()}setGrill(e){this.#n=e,this.#k(),this.#a=this.#x(this.#o);for(const n of this.#c)n()}#k(){this.#i=mo(this.#o,this.#t.providers),this.#s=this.#y()}#y(){return yg(vo(this.#e,this.#t.targets,this.#i),this.#n)}#x(e){return ba(this.definition,this.#r,e,mo(e,this.#t.providers),this.#n.grill)}get base(){return this.#r}get actions(){return this.#o}get derivation(){return this.#a}get lastIssues(){return this.#p}get prunedCount(){return this.#h}get canUndo(){return Eg(this.#o)}get canRedo(){return Cg(this.#f)}descriptorFor(e,n){return Sa(this.definition,e,n)}dispatch(e){const n=this.#v(e,this.#a.state);if(!n.ok)return this.#g([n.issue]);const s=this.descriptorFor(n.action.type,n.action.target);return s?(this.#m(Aa(this.#o,n.action,s),{dispatched:[n.action.id]}),{ok:!0,id:n.action.id}):this.#g([{path:"type",message:"unknown action type"}])}dispatchBatch(e){const n=C(Tg,e);if(!n.success)return this.#g([ze(n.issues)]);const s=n.output;if(s.length===0)return{ok:!0,ids:[]};let i=this.#o,r=this.#a.state,o=this.#a.answers;const a=[];for(const l of s){const c=this.#v(l,r);if(!c.ok)return this.#g([c.issue]);const d=c.action,h=this.descriptorFor(d.type,d.target);if(!h)return this.#g([{path:"type",message:"unknown action type"}]);if((Q(d)?fa(this.#n.grill,o,d)===null?null:r:d.type==="comment"||re(d)?d.target.type==="page"||this.definition.hasTarget(r,d.target)?r:null:this.definition.apply(r,d))===null)return this.#g([{path:"target",message:"batch action is not applicable"}]);i=Aa(i,d,h);const p=this.#x(i);r=p.state,o=p.answers,a.push(d.id)}return this.#m(i,{dispatched:a}),{ok:!0,ids:a}}#v(e,n){const s=C(Xr,e);if(!s.success)return{ok:!1,issue:ze(s.issues)};const i=this.descriptorFor(s.output.type,typeof s.output.target=="string"?vn(s.output.target,"page"):s.output.target);if(!i)return{ok:!1,issue:{path:"type",message:`unknown action type "${s.output.type}"`}};const r=Mp(s.output,i);if(!r.ok)return r;const o=this.definition.canonicalTarget?.(n,r.action.target)??r.action.target;return{ok:!0,action:{...r.action,target:o}}}#g(e){return this.#p=e,{ok:!1,issues:e}}editComment(e,n){const s=this.#o.find(a=>a.id===e);if(s?.type!==H)return this.#g([{path:"id",message:`no comment "${e}" in the draft`}]);if(Ht(s)===n)return{ok:!0,id:e};const i=C(Js.schema,{...s,payload:{body:n}});if(!i.success)return this.#g([ze(i.issues)]);const r=C(Pe,i.output);if(!r.success)return this.#g([ze(r.issues)]);const o=r.output;return this.#m(this.#o.map(a=>a===s?o:a),{dispatched:[]}),{ok:!0,id:e}}removeAction(e){const n=this.#o.filter(s=>s.id!==e);n.length!==this.#o.length&&this.#m(n)}clearActions(){this.#o.length>0&&this.#m([])}replaceActions(e){this.#m(Ea(this.definition,e))}setBase(e){this.#r=e,this.#m(this.#o)}undo(){const e=$g(this.#o,this.#f);return e===null?!1:(this.#f=e.state,this.#m([...e.actions],{preserveRedo:!0}),!0)}redo(){const e=Sg(this.#o,this.#f);return e===null?!1:(this.#f=e.state,this.#m([...e.actions],{preserveRedo:!0}),!0)}subscribe(e){return this.#c.add(e),()=>{this.#c.delete(e)}}exportDraft(e){return{template:this.definition.name,frameworkVersion:e,exportedAt:new Date().toISOString(),actions:this.#o}}#m(e,n){this.#p=[],this.#o=e,this.#k(),this.#a=this.#x(this.#o),this.#w(n?.dispatched),n?.preserveRedo!==!0&&(this.#f=Ag()),this.#T();for(const s of this.#c)s()}#w(e){const n=this.#$(),s=gg(this.definition,this.#a,i=>this.#x(i),e);return s===this.#a?n:(this.#h+=this.#o.length-s.actions.length,this.#o=[...s.actions],this.#k(),this.#a=this.#x(this.#o),this.#$(),!0)}#$(){return this.#a.obsolete.length===0?!1:(this.#h+=this.#a.obsolete.length,this.#o=va(this.#a),this.#k(),this.#a=this.#x(this.#o),!0)}#T(){this.#l?.save(this.#d,this.definition.name,this.#o)}}const Sa=(t,e,n)=>e==="comment"?Js:e===In?pg:n!==void 0&&re({type:e,target:n})?rh:t.actionFor?t.actionFor(e,n):tt(t.actions,e),Aa=(t,e,n)=>Q(e)?ug(t,e):Jr(t,e,n),Ea=(t,e)=>e.flatMap(n=>{const s=C(Pe,n);if(!s.success)return[];const i=s.output,r=Sa(t,i.type,i.target);if(!r)return[];const o=C(r.schema,i);if(!o.success)return[];const a=C(Pe,o.output);return a.success?[a.output]:[]}),Rg='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',_g=()=>{if(typeof document>"u")return null;let t=document.activeElement;for(;t?.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t instanceof HTMLElement?t:null},Mg=t=>{const e=t.querySelector("[autofocus]");if(e)return e;for(const n of t.querySelectorAll(Rg))if(!(n.hidden||n.closest("[hidden]")!==null))return n;return null},Og=t=>typeof t.showModal=="function",Un=t=>{const e=t.open;return typeof e=="boolean"?e:t.hasAttribute("open")},Pg=t=>{if(Og(t)){t.showModal();return}t.setAttribute("open","")},Ca=t=>{if(typeof t.close=="function"){t.close();return}Un(t)&&(t.removeAttribute("open"),t.dispatchEvent(new Event("close")))},Lg="dpk-dialog-close";class zg{constructor(e,n){this.#t=null,this.#n="close",this.handlers={cancel:s=>{s.preventDefault(),this.dismiss("escape")},close:()=>this.#o(),click:s=>{s.target===this.#s.dialog()&&this.dismiss("backdrop")}},this.#i=s=>{if(s.button!==0||!this.#s.open())return;const i=this.#s.dialog();i===null||s.composedPath().includes(i)||this.dismiss("backdrop")},this.#e=e,this.#s=n,e.addController(this)}#e;#s;#t;#n;hostConnected(){document.addEventListener("pointerdown",this.#i,!0)}hostUpdated(){const e=this.#s.dialog();if(e!==null){if(this.#s.open()){Un(e)||this.#r(e);return}Un(e)&&Ca(e)}}hostDisconnected(){document.removeEventListener("pointerdown",this.#i,!0);const e=this.#s.dialog();e!==null&&Un(e)&&Ca(e),this.#t=null}#i;dismiss(e="close"){this.#n=e,this.#s.dismiss(e)}#r(e){this.#n="close",this.#t=_g(),Pg(e);const n=Mg(e)??e;n===e&&!e.hasAttribute("tabindex")&&(e.tabIndex=-1),n.focus()}#o(){const e=this.#n,n=this.#t;this.#t=null,this.#s.open()&&this.#s.dismiss(e),n?.isConnected&&n.focus(),this.#e.dispatchEvent(new CustomEvent(Lg,{detail:{reason:e},bubbles:!0,composed:!0}))}}const Dg=(t,e="json")=>`\`\`\`${e}
271
+ ${s.map((i,r)=>m`${r>0?m`<hr class="dpk-context-menu-divider" />`:b}${i.heading===void 0?b:m`<div class="dpk-context-menu-heading">${i.heading}</div>`}${i.entries.map(o=>Uo(o,0,t,n))}`)}
272
+ </div>`},ku={width:220,height:420},bu=t=>t.closest('input, textarea, [contenteditable=""], [contenteditable="true"]')!==null;class vu{#e;#n;#s;#t=qs;#i=null;#r=null;#o=null;constructor(e,n){this.#e=e,this.#n=n,e.addController(this),new cn(e,{open:()=>this.#t.open,closesOn:s=>this.#i===null||!s.includes(this.#i),ownsEscape:()=>this.#t.open,dismiss:()=>this.#l()}),this.#s={onHover:s=>this.#d(s),onInvoke:s=>this.#c(s),onKeyDown:s=>this.#u(s)}}hostConnected(){this.#e.addEventListener("contextmenu",this.#h)}hostDisconnected(){this.#e.removeEventListener("contextmenu",this.#h),this.#a()}hostUpdated(){const e=this.#e.shadowRoot?.getElementById(No)??null;if(!this.#t.open||e===null){this.#a();return}(this.#i!==e||this.#r===null||this.#r.x!==this.#t.x||this.#r.y!==this.#t.y)&&(this.#o?.(),An(e),this.#o=Ns(e,To(this.#t.x,this.#t.y),ku,{placement:"right-start"}),this.#i=e,this.#r={x:this.#t.x,y:this.#t.y},e.focus())}render(){return mu(this.#t,this.#n.messages(),this.#s)}#a(){this.#i!==null&&(An(this.#i),this.#o?.(),this.#o=null,this.#i=null,this.#r=null)}#l(){this.#t=qs,this.#e.requestUpdate()}#d(e){this.#t={...this.#t,activeId:e},this.#e.requestUpdate()}#c(e){if(e.kind==="submenu"){this.#t=Oo(this.#t,e.id),this.#e.requestUpdate();return}e.disabled!==!0&&(this.#l(),e.run())}#u=e=>{switch(e.key){case"ArrowDown":e.preventDefault(),this.#t=Mo(this.#t,1),this.#e.requestUpdate();return;case"ArrowUp":e.preventDefault(),this.#t=Mo(this.#t,-1),this.#e.requestUpdate();return;case"ArrowRight":e.preventDefault(),this.#t=_o(this.#t),this.#e.requestUpdate();return;case"ArrowLeft":e.preventDefault(),this.#t=tu(this.#t),this.#e.requestUpdate();return;case"Enter":case" ":{e.preventDefault();const n=nu(this.#t);this.#t=n.state,this.#e.requestUpdate(),n.run?.();return}case"Escape":e.preventDefault(),this.#l();return;case"Tab":this.#l();return;default:return}};#h=e=>{if(e.defaultPrevented||e.shiftKey)return;const n=e.composedPath(),s=hu(n);if(s!==null&&bu(s))return;e.preventDefault();const i=uu(n),r=pu(n,{clientX:e.clientX,clientY:e.clientY,target:i,origin:s}),o=Xh({host:this.#e,state:this.#n.state(),target:i,targetElement:fu(n),resetViewElement:gu(n,"resetView"),messages:this.#n.messages()}),a=o===null?r:[...r,o];this.#t=Jh(e.clientX,e.clientY,a),this.#e.requestUpdate()}}const Tn=t=>{let e=t;for(;e!==null;){if(e instanceof Element){const n=e.getAttribute("lang");if(n!==null)return n}e=e instanceof ShadowRoot?e.host:e.parentNode}return null},js=["en","ja"],Ho="en",Bo=t=>js.some(e=>e===t),Rn=t=>{const e=(t??"").split("-")[0]?.toLowerCase()??"";return Bo(e)?e:Ho},jo=t=>Rn(Tn(t)),Fs="dpk-locale-change",Fo=t=>typeof t=="string"&&Bo(t)?t:null,xu=t=>t.preference??t.authored,wu=(t,e)=>t===e?null:t,Ne=t=>e=>e==="ja"?t.ja:t.en,Go=Ne({en:{menu:"Context menu",copyText:"Copy text",feedback:"Give feedback",reviewComment:"Review comment",resetView:"Reset view",resetPositions:"Reset positions",duplicate:"Duplicate",delete:"Delete"},ja:{menu:"\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u30E1\u30CB\u30E5\u30FC",copyText:"\u30C6\u30AD\u30B9\u30C8\u3092\u30B3\u30D4\u30FC",feedback:"\u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF\u3059\u308B",reviewComment:"\u30EC\u30D3\u30E5\u30FC\u30B3\u30E1\u30F3\u30C8",resetView:"\u8868\u793A\u3092\u30EA\u30BB\u30C3\u30C8",resetPositions:"\u4F4D\u7F6E\u3092\u30EA\u30BB\u30C3\u30C8",duplicate:"\u8907\u88FD",delete:"\u524A\u9664"}}),Wo=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function Ko(t){return typeof Wo.Buffer<"u"&&Wo.Buffer.isBuffer(t)}function Vo(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 Yo(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function Zo(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const yu="[object RegExp]",$u="[object String]",Su="[object Number]",Au="[object Boolean]",Eu="[object Symbol]",Cu="[object Date]",Tu="[object Map]",Ru="[object Set]",Mu="[object Array]",Ou="[object Function]",_u="[object ArrayBuffer]",Gs="[object Object]",Pu="[object Error]",Lu="[object DataView]",zu="[object Uint8Array]",Iu="[object Uint8ClampedArray]",Du="[object Uint16Array]",Nu="[object Uint32Array]",qu="[object BigUint64Array]",Uu="[object Int8Array]",Hu="[object Int16Array]",Bu="[object Int32Array]",ju="[object BigInt64Array]",Fu="[object Float32Array]",Gu="[object Float64Array]";function Wu(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function Ku(t,e,n){return zt(t,e,void 0,void 0,void 0,void 0,n)}function zt(t,e,n,s,i,r,o){const a=o(t,e,n,s,i,r);if(a!==void 0)return a;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 It(t,e,r,o)}return It(t,e,r,o)}function It(t,e,n,s){if(Object.is(t,e))return!0;let i=Zo(t),r=Zo(e);if(i==="[object Arguments]"&&(i=Gs),r==="[object Arguments]"&&(r=Gs),i!==r)return!1;switch(i){case $u:return t.toString()===e.toString();case Su:return Wu(t.valueOf(),e.valueOf());case Au:case Cu:case Eu:return Object.is(t.valueOf(),e.valueOf());case yu:return t.source===e.source&&t.flags===e.flags;case Ou:return t===e}n=n??new Map;const o=n.get(t),a=n.get(e);if(o!=null&&a!=null)return o===e;n.set(t,e),n.set(e,t);try{switch(i){case Tu:if(t.size!==e.size)return!1;for(const[l,p]of t.entries())if(!e.has(l)||!zt(p,e.get(l),l,t,e,n,s))return!1;return!0;case Ru:{if(t.size!==e.size)return!1;const l=Array.from(t.values()),p=Array.from(e.values());for(let h=0;h<l.length;h++){const d=l[h],f=p.findIndex(c=>zt(d,c,void 0,t,e,n,s));if(f===-1)return!1;p.splice(f,1)}return!0}case Mu:case zu:case Iu:case Du:case Nu:case qu:case Uu:case Hu:case Bu:case ju:case Fu:case Gu:if(Ko(t)!==Ko(e)||t.length!==e.length)return!1;for(let l=0;l<t.length;l++)if(!zt(t[l],e[l],l,t,e,n,s))return!1;return!0;case _u:return t.byteLength!==e.byteLength?!1:It(new Uint8Array(t),new Uint8Array(e),n,s);case Lu:return t.byteLength!==e.byteLength||t.byteOffset!==e.byteOffset?!1:It(new Uint8Array(t),new Uint8Array(e),n,s);case Pu:return t.name===e.name&&t.message===e.message;case Gs:{if(!(It(t.constructor,e.constructor,n,s)||Vo(t)&&Vo(e)))return!1;const l=[...Object.keys(t),...Yo(t)],p=[...Object.keys(e),...Yo(e)];if(l.length!==p.length)return!1;for(let h=0;h<l.length;h++){const d=l[h],f=t[d];if(!Object.hasOwn(e,d))return!1;const c=e[d];if(!zt(f,c,d,t,e,n,s))return!1}return!0}default:return!1}}finally{n.delete(t),n.delete(e)}}function Vu(){}function Mn(t,e){return Ku(t,e,Vu)}const Qo=O({id:$(x(),E(1)),type:K(D),target:O({type:$(x(),E(1)),id:$(x(),E(1))}),payload:O({body:$(x(),E(1))}),note:W(x()),createdAt:$(x(),E(1))}),Ws={schema:Qo,mode:"append",targetType:"page"},Yu=O({body:x()}),Dt=t=>{const e=C(Yu,t.payload);return e.success?e.output.body:""},Ks="data-dpk-grill",re="grill",On="answer",Nt="data-grill-questions",Zu=W(x()),Xo=t=>{const e=t?.trim();return e===void 0||e===""?void 0:e},Qu=t=>{const e=Xo(t);return e===void 0?{}:{questions:e}},st={questions:[],rounds:[]},Xu=z({id:tr,label:$(x(),E(1))}),Jo=z({id:tr,ref:I($(x(),E(1))),title:$(x(),E(1)),description:I(x()),note:I(x()),options:I(H(Xu),[]),freeText:I(Xi(),!0)}),ea=er("kind",[z({kind:K("option"),optionId:$(x(),E(1))}),z({kind:K("free"),text:x()})]),ta=er("kind",[...ea.options,z({kind:K("clear")})]),Ju=z({...Jo.entries,answer:I(ea)}),eg=z({label:I($(x(),E(1))),questions:H(Ju)}),tg=z({questions:H(Jo),history:I(H(eg),[])}),na=t=>{const e=new Set;return t.map((n,s)=>{if(e.has(n.id))throw new Error(`duplicate question id: ${n.id}`);e.add(n.id);const i=new Set;for(const r of n.options){if(i.has(r.id))throw new Error(`duplicate option id: ${r.id} in question ${n.id}`);i.add(r.id)}return{...n,ref:n.ref??`Q${s+1}`,description:n.description??null,note:n.note??null}})},sa=t=>({id:t.id,ref:t.ref,title:t.title,description:t.description,note:t.note,options:t.options,freeText:t.freeText}),ng=t=>{const e=t.answer??null;if(e?.kind==="option"&&!t.options.some(n=>n.id===e.optionId))throw new Error(`unknown option id: ${e.optionId} in question ${t.id}`);return{...sa(t),answer:e}},sg=t=>{const e=tn(tg,t);return{questions:na(e.questions).map(sa),rounds:e.history.map((n,s)=>({label:n.label??`v${s+1}`,questions:na(n.questions).map(ng)}))}},it=(t,e)=>t.questions.find(n=>n.id===e),Vs=(t,e)=>{const n=it(t,e);return n?`${n.ref} \xB7 ${n.title}`:e},_n=(t,e)=>e?e.kind==="option"?t.options.find(n=>n.id===e.optionId)?.label??"":e.text.trim():"",Pn=(t,e)=>_n(t,e)!=="",ig=t=>{let e="";for(let n=t+1;n>0;n=Math.floor((n-1)/26))e=String.fromCharCode(97+(n-1)%26)+e;return e},ia=(t,e)=>({total:t.questions.length,answered:t.questions.filter(n=>Pn(n,e[n.id])).length}),rg=(t,e,n)=>{const s=t.questions,i=s.findIndex(o=>o.id===n);return(i===-1?s:[...s.slice(i+1),...s.slice(0,i)]).find(o=>!Pn(o,e[o.id]))?.id??null},og=$(x(),le(/^[A-Za-z0-9_-]+(?:@[A-Za-z0-9_-]+)?$/,"a question id, optionally qualified by its board (`retry@scope`)")),ag=O({id:$(x(),E(1)),type:K(On),target:O({type:K(re),id:og}),payload:ta,note:W(x()),createdAt:$(x(),E(1))}),lg={schema:ag,mode:"patch",targetType:re},Y=t=>t.type===On&&t.target.type===re,dg=(t,e)=>({type:On,target:{type:re,id:t},payload:e}),ra=t=>{const e=C(ta,t.payload);return e.success?e.output:null},cg=(t,e)=>[...t.filter(n=>!(Y(n)&&n.target.id===e.target.id)),e],oa=(t,e,n)=>{const s=it(t,n.target.id),i=ra(n);if(!s||!i)return null;const r=e[s.id];if(i.kind==="clear"){if(r===void 0)return e;const o={...e};return delete o[s.id],o}return i.kind==="option"&&!s.options.some(o=>o.id===i.optionId)||i.kind==="free"&&!s.freeText?null:r?.kind==="option"&&i.kind==="option"&&r.optionId===i.optionId||r?.kind==="free"&&i.kind==="free"&&r.text===i.text?e:{...e,[s.id]:i}},Ys="page",Zs="app",aa=t=>_(t),la=(t,e,n,s=new Map,i=st)=>{let r=e,o={};const a=[],l=[],p=[],h=[],d=new Map;for(const c of n){if(c.type===D)continue;if(ne(c)){const k=s.get(c.id);k===void 0||k.stale!==void 0?l.push({action:c,reason:k?.stale??"target-missing"}):a.push(c);continue}if(Y(c)){const k=oa(i,o,c);k===null?l.push({action:c,reason:it(i,c.target.id)?"constraint-violated":"target-missing"}):k===o?p.push(c):(o=k,a.push(c));continue}const g=St(t.actions,c.type);if(!g){l.push({action:c,reason:"unsupported-action-type"});continue}const u=t.apply(r,c);if(u===null){l.push({action:c,reason:t.hasTarget(r,c.target)?"constraint-violated":"target-missing"});continue}if(g.mode!=="append"&&Qs(t,r,u)){p.push(c);continue}r=u,a.push(c)}for(const c of n){if(c.type!==D)continue;if(!(c.target.type===Ys||c.target.type===Zs?t.pageTargetExists?.(r,c.target)??!0:t.hasTarget(r,c.target))){l.push({action:c,reason:"target-missing"});continue}h.push(c);const k=aa(c.target);d.set(k,[...d.get(k)??[],c])}const f=new Map(n.map((c,g)=>[c.id,g]));return l.sort((c,g)=>(f.get(c.action.id)??0)-(f.get(g.action.id)??0)),{base:e,state:r,actions:n,applied:a,stale:l,obsolete:p,comments:h,commentsByTarget:d,grill:i,answers:o}},Qs=(t,e,n)=>e===n?!0:t.canonicalState===void 0?Mn(e,n):Mn(t.canonicalState(e),t.canonicalState(n)),da=t=>{const e=new Set(t.obsolete.map(n=>n.id));return t.actions.filter(n=>!e.has(n.id))},pg=(t,e,n,s)=>{let i=e;const r=s??ca(i).map(o=>o.id);for(const o of[...r].reverse())i=hg(t,i,n,o,s!==void 0)??i;return i},ca=t=>t.applied.filter(e=>!ne(e)&&!Y(e)),hg=(t,e,n,s,i)=>{const r=ca(e),o=r.findIndex(u=>u.id===s),a=r[o];if(a===void 0)return null;const l=r.slice(0,o),p=Xs(t,a),h=!t.hasTarget(e.state,a.target)||/^(?:DELETE|REMOVE)_/.test(a.type),d=p==="sequence"||h,f=[...i&&d?ug(t,e.base,r,o):[],...d?gg(t,l,a):[]],c=new Set,g=f.filter(u=>{const k=u.join(" ");return c.has(k)?!1:(c.add(k),!0)}).sort((u,k)=>k.length-u.length);for(const u of g){const k=fg(t,e,n,u);if(k!==null)return k}return null},ug=(t,e,n,s)=>{const i=[];let r=e;for(const o of n.slice(0,s+1))i.push(r),r=t.apply(r,o)??r;return i.flatMap((o,a)=>Qs(t,o,r)?[n.slice(a,s+1).map(l=>l.id)]:[])},gg=(t,e,n)=>{const s=pa(n),i=e.filter(l=>pa(l).some(p=>s.includes(p))),r=Xs(t,n),o=i.filter(l=>Xs(t,l)===r),a=l=>l.map((p,h)=>[...l.slice(h).map(d=>d.id),n.id]);return[...a(i),...a(o),...i.map(l=>[l.id,n.id]),...i.map(l=>[l.id])]},pa=t=>{const n=t.target.type===Ys||t.target.type===Zs?[]:t.target.id.split("."),s=typeof t.payload=="object"&&t.payload!==null?Object.values(t.payload).filter(i=>typeof i=="string"&&i!==""):[];return[...n,...s]},Xs=(t,e)=>St(t.actions,e.type)?.mode,fg=(t,e,n,s)=>{const i=new Set(e.stale.map(o=>o.action.id)),r=new Set(s);for(;;){const o=n(e.actions.filter(l=>!r.has(l.id))),a=o.stale.filter(l=>!i.has(l.action.id)).map(l=>l.action);if(a.length===0)return Qs(t,o.state,e.state)?o:null;if(a.some(l=>l.type===D||ne(l)||Y(l)))return null;for(const l of a)r.add(l.id)}},mg={en:"English",ja:"\u65E5\u672C\u8A9E"},R=Ne({en:{review:"Review",reviewChanges:"Activity log",reviewComments:"Review comments",settings:"Settings",menu:"Page menu",menuMove:"Move this menu",menuReturn:"Put the menu back in the header",settingsDisplay:"Display",settingsAppearance:"Appearance",settingsTheme:"Theme",themeLight:"Light",themeDark:"Dark",settingsClose:"Close settings",settingsSections:"Settings sections",undoRedo:"Undo / redo",undo:"Undo",redo:"Redo",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)`,baseDataError:"Could not read the base data (showing an empty page)",pageEmpty:"This page holds no view or board",pageEmptyHint:"A page holds exactly one <dpk-view-*> or <dpk-board-*>.",pageUnavailable:"This page could not show its content",pageUnavailableHint:t=>`No loaded entry defines <${t}>. Load the entry that carries it.`,memo:"Memo",supplements:"Supplements",openSupplements:"Open supplements",closeSupplements:"Close supplements",resizeSupplements:"Resize supplements",resizeSupplementsHint:"Drag, or use the arrow keys, to change the height (double-click to reset)",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",changes:"Updates",changesUnread:t=>`Updates (${t} new)`,changesTitle:"Changes by version",changesCurrent:"This version",changesReadAll:"Mark all as read",changesNew:"New",changesShow:"Show",changesDismiss:"Dismiss",changesWaiting:t=>`${t} more`,changesSeeAll:"See all",changesError:"Could not read the change log",grill:"Questions",grillError:"Could not read the questions",grillGroup:"Question",grillProgress:(t,e)=>`${t} of ${e} answered`,grillAnswer:"Answer",grillAnswerFree:"Answer in your own words",grillAnswerClear:"Clear answer",grillQuoted:t=>`\u2192 \u201C${t}\u201D`,grillOpen:t=>`Open question ${t}`,grillFreeText:"Your own answer",grillFreeTextOf:t=>`Your own answer to ${t}`,grillFreeTextPlaceholder:"Type an answer\u2026 (\u2318/Ctrl+Enter for next)",grillRoundSelect:"Question round",grillCurrentRound:"Current questions",grillRoundOption:(t,e)=>`${t} (${e})`,grillPastRound:t=>`${t}: earlier questions, read-only`,grillUnanswered:"Not answered",grillNoQuestions:"No questions in this round.",checkMode:"Check Mode",checkModeOn:"Turn off Check Mode",checkModeOff:"Turn on Check Mode",checkModeUnchecked:"Mark as checked",checkModeChecked:"Checked \u2014 click to unmark",checkModeStale:"Changed since you checked it \u2014 click to check again",checkModeConfirmTitle:"Turn off Check Mode?",checkModeConfirmBody:"Every checkmark on this page will be cleared. This only affects what you see; it is never sent to the agent.",checkModeConfirmOk:"Turn off",checkModeConfirmCancel:"Cancel",syncConnecting:"Syncing",syncSynced:"Synced",syncPending:t=>`${t} unsent`,syncOffline:"Offline",syncError:"Sync error",syncStatus:"Sharing",clearSharedTitle:"Clear the shared draft?",clearSharedBody:"Everything you see now disappears, including other people\u2019s changes. What others add while this is open stays.",clearSharedOk:"Clear all",clearSharedCancel:"Cancel"},ja:{review:"\u30EC\u30D3\u30E5\u30FC",reviewChanges:"\u64CD\u4F5C\u30ED\u30B0",reviewComments:"\u30EC\u30D3\u30E5\u30FC\u30B3\u30E1\u30F3\u30C8",settings:"\u8A2D\u5B9A",menu:"\u30DA\u30FC\u30B8\u306E\u30E1\u30CB\u30E5\u30FC",menuMove:"\u3053\u306E\u30E1\u30CB\u30E5\u30FC\u3092\u79FB\u52D5",menuReturn:"\u30E1\u30CB\u30E5\u30FC\u3092\u30D8\u30C3\u30C0\u30FC\u306B\u623B\u3059",settingsDisplay:"\u8868\u793A",settingsAppearance:"\u5916\u89B3",settingsTheme:"\u30C6\u30FC\u30DE",themeLight:"\u30E9\u30A4\u30C8",themeDark:"\u30C0\u30FC\u30AF",settingsClose:"\u8A2D\u5B9A\u3092\u9589\u3058\u308B",settingsSections:"\u8A2D\u5B9A\u306E\u30BB\u30AF\u30B7\u30E7\u30F3",undoRedo:"\u53D6\u308A\u6D88\u3057\u30FB\u3084\u308A\u76F4\u3057",undo:"\u53D6\u308A\u6D88\u3057",redo:"\u3084\u308A\u76F4\u3057",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`,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",pageEmpty:"\u3053\u306E\u30DA\u30FC\u30B8\u306B\u306F view \u3082 board \u3082\u3042\u308A\u307E\u305B\u3093",pageEmptyHint:"\u30DA\u30FC\u30B8\u306B\u306F <dpk-view-*> \u304B <dpk-board-*> \u3092\u3072\u3068\u3064\u7F6E\u304D\u307E\u3059\u3002",pageUnavailable:"\u3053\u306E\u30DA\u30FC\u30B8\u306E\u5185\u5BB9\u3092\u8868\u793A\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F",pageUnavailableHint:t=>`<${t}> \u3092\u5B9A\u7FA9\u3059\u308B entry \u304C\u8AAD\u307F\u8FBC\u307E\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u305D\u306E entry \u3092\u8AAD\u307F\u8FBC\u3093\u3067\u304F\u3060\u3055\u3044\u3002`,memo:"\u30E1\u30E2",supplements:"\u88DC\u8DB3\u60C5\u5831",openSupplements:"\u88DC\u8DB3\u60C5\u5831\u3092\u958B\u304F",closeSupplements:"\u88DC\u8DB3\u60C5\u5831\u3092\u9589\u3058\u308B",resizeSupplements:"\u88DC\u8DB3\u60C5\u5831\u306E\u9AD8\u3055\u3092\u5909\u3048\u308B",resizeSupplementsHint:"\u30C9\u30E9\u30C3\u30B0\u3001\u307E\u305F\u306F\u77E2\u5370\u30AD\u30FC\u3067\u9AD8\u3055\u3092\u5909\u3048\u308B\uFF08\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u3067\u65E2\u5B9A\u306B\u623B\u3059\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",changes:"\u66F4\u65B0\u306E\u304A\u77E5\u3089\u305B",changesUnread:t=>`\u66F4\u65B0\u306E\u304A\u77E5\u3089\u305B\uFF08\u65B0\u7740 ${t} \u4EF6\uFF09`,changesTitle:"\u7248\u3054\u3068\u306E\u5909\u66F4",changesCurrent:"\u3053\u306E\u7248",changesReadAll:"\u3059\u3079\u3066\u65E2\u8AAD\u306B\u3059\u308B",changesNew:"\u65B0\u7740",changesShow:"\u898B\u308B",changesDismiss:"\u9589\u3058\u308B",changesWaiting:t=>`\u307B\u304B ${t} \u4EF6`,changesSeeAll:"\u3059\u3079\u3066\u898B\u308B",changesError:"\u5909\u66F4\u306E\u4E00\u89A7\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F",grill:"\u8CEA\u554F",grillError:"\u8CEA\u554F\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F",grillGroup:"\u8CEA\u554F",grillProgress:(t,e)=>`\u56DE\u7B54\u6E08\u307F ${t} / ${e}`,grillAnswer:"\u56DE\u7B54",grillAnswerFree:"\u81EA\u7531\u8A18\u8FF0\u3067\u56DE\u7B54",grillAnswerClear:"\u56DE\u7B54\u3092\u30AF\u30EA\u30A2",grillQuoted:t=>`\u2192 \u300C${t}\u300D`,grillOpen:t=>`\u8CEA\u554F ${t} \u3092\u3072\u3089\u304F`,grillFreeText:"\u81EA\u7531\u8A18\u8FF0",grillFreeTextOf:t=>`${t} \u306E\u81EA\u7531\u8A18\u8FF0`,grillFreeTextPlaceholder:"\u56DE\u7B54\u3092\u5165\u529B\u2026\uFF08\u2318/Ctrl+Enter \u3067\u6B21\u3078\uFF09",grillRoundSelect:"\u8CEA\u554F\u306E\u30E9\u30A6\u30F3\u30C9",grillCurrentRound:"\u73FE\u5728\u306E\u8CEA\u554F",grillRoundOption:(t,e)=>`${t}\uFF08${e} \u554F\uFF09`,grillPastRound:t=>`${t}: \u904E\u53BB\u306E\u8CEA\u554F\uFF08\u95B2\u89A7\u306E\u307F\uFF09`,grillUnanswered:"\u672A\u56DE\u7B54",grillNoQuestions:"\u3053\u306E\u30E9\u30A6\u30F3\u30C9\u306B\u8CEA\u554F\u306F\u3042\u308A\u307E\u305B\u3093\u3002",checkMode:"\u78BA\u8A8D\u30E2\u30FC\u30C9",checkModeOn:"\u78BA\u8A8D\u30E2\u30FC\u30C9\u3092\u7D42\u4E86",checkModeOff:"\u78BA\u8A8D\u30E2\u30FC\u30C9\u3092\u958B\u59CB",checkModeUnchecked:"\u78BA\u8A8D\u6E08\u307F\u306B\u3059\u308B",checkModeChecked:"\u78BA\u8A8D\u6E08\u307F\uFF08\u30AF\u30EA\u30C3\u30AF\u3067\u89E3\u9664\uFF09",checkModeStale:"\u3053\u306E\u78BA\u8A8D\u5F8C\u306B\u5909\u66F4\u304C\u3042\u308A\u307E\u3059\uFF08\u30AF\u30EA\u30C3\u30AF\u3067\u518D\u78BA\u8A8D\uFF09",checkModeConfirmTitle:"\u78BA\u8A8D\u30E2\u30FC\u30C9\u3092\u7D42\u4E86\u3057\u307E\u3059\u304B?",checkModeConfirmBody:"\u3053\u306E\u30DA\u30FC\u30B8\u306E\u30C1\u30A7\u30C3\u30AF\u306F\u3059\u3079\u3066\u6D88\u3048\u307E\u3059\u3002\u8868\u793A\u3060\u3051\u306E\u72B6\u614B\u306A\u306E\u3067\u3001Agent \u306B\u306F\u9001\u3089\u308C\u307E\u305B\u3093\u3002",checkModeConfirmOk:"\u7D42\u4E86\u3059\u308B",checkModeConfirmCancel:"\u30AD\u30E3\u30F3\u30BB\u30EB",syncConnecting:"\u540C\u671F\u4E2D",syncSynced:"\u540C\u671F\u6E08\u307F",syncPending:t=>`\u672A\u9001\u4FE1 ${t} \u4EF6`,syncOffline:"\u30AA\u30D5\u30E9\u30A4\u30F3",syncError:"\u30A8\u30E9\u30FC",syncStatus:"\u5171\u6709",clearSharedTitle:"\u5171\u6709\u4E2D\u306E\u30C9\u30E9\u30D5\u30C8\u3092\u3059\u3079\u3066\u6D88\u3057\u307E\u3059\u304B?",clearSharedBody:"\u307B\u304B\u306E\u4EBA\u306E\u5909\u66F4\u3082\u542B\u3081\u3066\u3001\u4ECA\u898B\u3048\u3066\u3044\u308B\u3082\u306E\u304C\u3059\u3079\u3066\u6D88\u3048\u307E\u3059\u3002\u3053\u306E\u78BA\u8A8D\u4E2D\u306B\u307B\u304B\u306E\u4EBA\u304C\u52A0\u3048\u305F\u3082\u306E\u306F\u6B8B\u308A\u307E\u3059\u3002",clearSharedOk:"\u3059\u3079\u3066\u6D88\u3059",clearSharedCancel:"\u30AD\u30E3\u30F3\u30BB\u30EB"}}),kg=(t,e,n)=>{const s=ra(n);if(s===null)return{title:n.type,tone:"meta"};if(s.kind==="clear")return{title:t.grillAnswerClear,tone:"delete"};if(s.kind==="option"){const i=it(e,n.target.id)?.options.find(r=>r.id===s.optionId);return{title:t.grillAnswer,tone:"update",summary:t.grillQuoted(i?.label??s.optionId)}}return{title:t.grillAnswerFree,tone:"update",summary:t.grillQuoted(s.text.slice(0,120))}},bg=(t,e)=>{const{grill:n}=e,s=R(e.locale);return{...t,hasTarget:(i,r)=>r.type===re?it(n,r.id)!==void 0:t.hasTarget(i,r),commentTargets:(i,r)=>[...t.commentTargets(i,r),...n.questions.map(o=>({value:_({type:re,id:o.id}),label:Vs(n,o.id),group:s.grillGroup}))],describe:(i,r,o)=>{const a=Vs(n,i.target.id);if(Y(i)){const{title:p,summary:h,tone:d}=kg(s,n,i);return{title:p,tone:d,targetLabel:a,...h===void 0?{}:{summary:h}}}const l=t.describe(i,r,o);return i.target.type===re?{...l,targetLabel:a}:l},serialize:i=>Y(i)?`${i.type} ${_(i.target)} ${JSON.stringify(i.payload)}`:t.serialize(i)}},vg=O({v:K(1),template:$(x(),E(1)),actions:H(yt())});class Js{constructor(e){this.storage=e}load(e,n){try{const s=this.storage.getItem(e);if(s===null)return[];const i=C(vg,JSON.parse(s));return!i.success||i.output.template!==n?[]:i.output.actions.flatMap(r=>{const o=C(wt,r);return o.success?[o.output]:[]})}catch{return[]}}save(e,n,s){const i={v:1,template:n,actions:s};try{this.storage.setItem(e,JSON.stringify(i))}catch{}}clear(e){try{this.storage.removeItem(e)}catch{}}}class ei{constructor(){this.store=new Map}load(e,n){return new Js({getItem:s=>this.store.get(s)??null,setItem:(s,i)=>{this.store.set(s,i)},removeItem:s=>{this.store.delete(s)}}).load(e,n)}save(e,n,s){this.store.set(e,JSON.stringify({v:1,template:n,actions:s}))}clear(e){this.store.delete(e)}}const ti=()=>{try{if(typeof localStorage<"u")return new Js(localStorage)}catch{}return new ei},rt=t=>`dev-process-kit:draft:${typeof location>"u"?"local":`${location.pathname}${location.search}`}:${t}`,ni=new Set,xg=(t,e)=>ha({self:t,confirmed:[],cursor:void 0,marks:[],seq:0,pending:[]},e),ha=(t,e)=>({...t,pending:e.map(n=>t.pending.find(s=>nr(s.op,n))??{op:n,covers:ni})}),wg=t=>t.cursor!==void 0,qt=t=>t.pending.reduce((e,{op:n,covers:s})=>{switch(n.kind){case"append":return e.some(i=>i.action.id===n.action.id)?e:[...e,{action:n.action,author:t.self}];case"remove":return e.filter(i=>i.action.id!==n.id);case"clear":return e.filter(i=>!s.has(i.action.id))}},t.confirmed.map(({entry:e})=>e)),yg=t=>qt(t).map(e=>e.action),Ut=(t,e)=>e.author?.id===t.self.id,ua=(t,e)=>t.pending.some(({op:n})=>n.kind==="append"&&n.action.id===e),ga=(t,e,n)=>{const s=t.seq+1,i=e.kind==="snapshot"?$g(e.entries,s):Sg(t,e.ops,s);return{...t,confirmed:[...i],cursor:e.cursor,marks:[...e.kind==="snapshot"?[]:t.marks,{cursor:e.cursor,seq:s}].slice(-64),seq:s,pending:t.pending.filter(({op:r})=>n.some(o=>nr(o,r)))}},$g=(t,e)=>{const n=new Set;return t.flatMap(s=>n.has(s.action.id)?[]:(n.add(s.action.id),[{entry:s,seq:e}]))},Sg=(t,e,n)=>e.reduce((s,i)=>{switch(i.kind){case"append":return s.some(({entry:r})=>r.action.id===i.entry.action.id)?s:[...s,{entry:i.entry,seq:n}];case"remove":return s.filter(({entry:r})=>r.action.id!==i.id);case"clear":{const r=t.marks.find(o=>o.cursor===i.upTo)?.seq??n-1;return s.filter(o=>o.seq>r)}}},t.confirmed),Ag=(t,e)=>{const n={kind:"append",action:e};return{log:{...t,pending:[...t.pending,{op:n,covers:ni}]},push:[n]}},fa=(t,e,n)=>{const s=qt(t).find(o=>o.action.id===e);if(s===void 0)return{log:t,push:[]};if(!Ut(t,s)&&n?.others!==!0)return{log:t,push:[]};const i={kind:"remove",id:e},r=t.pending.filter(o=>!(o.op.kind==="append"&&o.op.action.id===e));return{log:{...t,pending:[...r,{op:i,covers:ni}]},push:[i]}},Eg=t=>t.cursor===void 0?null:{upTo:t.cursor,covers:new Set(t.confirmed.map(({entry:e})=>e.action.id))},Cg=(t,e)=>{const s=qt(t).filter(r=>Ut(t,r)&&!(e?.covers.has(r.action.id)??!1)).reduce((r,o)=>{const a=fa(r.log,o.action.id);return{log:a.log,push:[...r.push,...a.push]}},{log:t,push:[]});if(e===null)return s;const i={kind:"clear",upTo:e.upTo};return{log:{...s.log,pending:[...s.log.pending,{op:i,covers:e.covers}]},push:[...s.push,i]}},ma=(t,e,n)=>{const s=new Set(e.map(l=>l.id)),i=qt(t),r=new Set(i.map(l=>l.action.id)),a=i.filter(l=>!s.has(l.action.id)&&Tg(t,l,n)).reduce((l,p)=>{const h=fa(l.log,p.action.id,{others:n==="any"});return{log:h.log,push:[...l.push,...h.push]}},{log:t,push:[]});return e.filter(l=>!r.has(l.id)).reduce((l,p)=>{const h=Ag(l.log,p);return{log:h.log,push:[...l.push,...h.push]}},a)},Tg=(t,e,n)=>{switch(n){case"pending":return ua(t,e.action.id);case"own":return Ut(t,e);case"any":return!0}};class Rg{constructor(e,n,s){this.host=e,this.readAction=n,this.onChange=s,this.#e=xg(e.self,[]),this.#c()}#e;#n=[];#s=[];#t=null;#i=[];#r="connecting";#o;#a=null;#l=0;#d=0;get self(){return this.#e.self}get actions(){return this.#s}get connected(){return wg(this.#e)}get state(){return{status:this.#r,reason:this.#o,unsent:this.#u().length}}authorOf(e){const n=this.#n.find(s=>s.action.id===e);if(n!==void 0)return n.author??(Ut(this.#e,n)?this.#e.self:void 0)}isOwn(e){const n=this.#n.find(s=>s.action.id===e);return n!==void 0&&Ut(this.#e,n)}isPending(e){return ua(this.#e,e)}preview(e,n){return yg(ma(this.#e,e,n).log)}change(e,n){this.#h(ma(this.#e,e,n))}clearMark(){return Eg(this.#e)}clear(e){this.#h(Cg(this.#e,e))}close(){this.#d+=1,this.#t?.close(),this.#t=null}reopen(){this.#t===null&&this.#c()}#c(){this.#d+=1;const e=this.#d;this.#a=[];const n=this.host.open({receive:i=>{if(e!==this.#d)return;const r=Jd(i,this.readAction);r!==null&&(this.#a===null?this.#k(r):this.#a.push(r))},status:(i,r)=>{if(e!==this.#d)return;const o=this.#a===null?this.#u().length:this.#l;i===this.#r&&r?.reason===this.#o&&o===this.#l||(this.#r=i,this.#o=r?.reason,this.#l=o,this.#a===null&&this.onChange("status"))}});this.#t=n,this.#i.length>0&&n.push(this.#i),this.#i=[],this.#e=ha(this.#e,n.pending),this.#l=n.pending.length;const s=this.#a;this.#a=null;for(const i of s)this.#e=ga(this.#e,i,n.pending);this.#p()}#u(){return this.#t?.pending??this.#i}#h(e){this.#e=e.log,this.#p(),e.push.length!==0&&(this.#t===null?this.#i=[...this.#i,...e.push]:this.#t.push(e.push))}#k(e){this.#e=ga(this.#e,e,this.#u()),this.#p()&&this.onChange("received")}#p(){const e=qt(this.#e);return Mg(this.#n,e)?!1:(this.#n=e,this.#s=e.map(n=>n.action),!0)}}const Mg=(t,e)=>t.length===e.length&&t.every((n,s)=>{const i=e[s];return i!==void 0&&n.action.id===i.action.id&&n.author?.id===i.author?.id&&n.author?.name===i.author?.name}),ka={redoStack:[]},Og=(t,e)=>{const n=t.at(-1);return n===void 0?null:{actions:t.slice(0,-1),state:{redoStack:[...e.redoStack,n]}}},_g=(t,e)=>{const n=e.redoStack.at(-1);return n===void 0?null:{actions:[...t,n],state:{redoStack:e.redoStack.slice(0,-1)}}},Pg=()=>ka,Lg=t=>t.length>0,zg=t=>t.redoStack.length>0,Ig=H(yt());class ba{#e;#n;#s={targets:[],providers:[]};#t;#i=new Map;#r;#o;#a;#l;#d;#c=new Set;#u=[];#h=0;#k=ka;#p;#x=[];#A;#v=Oe;constructor(e){if(this.#e=e.definition,this.#A=e.settled??(()=>!1),this.#t=e.grill??{grill:st,locale:"en"},this.#n=this.#w(),this.#r=e.base,this.#d=e.storageKey??rt(e.definition.name),this.#p=e.sync===void 0?null:new Rg(e.sync,s=>si(this.definition,[s])[0]??null,s=>this.#q(s)),this.#p!==null){this.#l=null,this.#o=this.#p.actions,this.#f(),this.#a=this.#m(this.#o);return}this.#l=e.storage===void 0?ti():e.storage;const n=e.initialActions??this.#l?.load(this.#d,this.definition.name)??[];this.#o=si(this.definition,n),this.#a=this.#m(this.#o),this.#U()&&this.#_()}get definition(){return this.#n}setComponentSnapshot(e){const n=tn(ih,e);if(!Mn(n,this.#s)){this.#s=n,this.#f(),this.#a=this.#m(this.#o);for(const s of this.#c)s()}}get componentSnapshot(){return this.#s}setTemplate(e){this.#e=e,this.#f(),this.#a=this.#m(this.#o);for(const n of this.#c)n()}setGrill(e){this.#t=e,this.#f(),this.#a=this.#m(this.#o);for(const n of this.#c)n()}setAddressed(e){if(e!==this.#v){if(this.#v=e,this.#p!==null){this.#M(this.#p)&&this.#E();return}this.#o.some(n=>As(e,n.id))&&this.#y(this.#o)}}#f(){this.#i=oo(this.#o,this.#s.providers),this.#n=this.#w()}#w(){return bg(co(this.#e,this.#s.targets,this.#i),this.#t)}#m(e){return la(this.definition,this.#r,e,oo(e,this.#s.providers),this.#t.grill)}get base(){return this.#r}get actions(){return this.#o}get derivation(){return this.#a}get lastIssues(){return this.#u}get prunedCount(){return this.#h}get canUndo(){const e=this.#p;return e!==null?this.#o.some(n=>e.isOwn(n.id)):Lg(this.#o)}get canRedo(){return this.#p!==null?this.#x.length>0:zg(this.#k)}get sync(){return this.#p?.state??null}authorOf(e){return this.#p?.authorOf(e)}isOwnAction(e){return this.#p?.isOwn(e)??this.#o.some(n=>n.id===e)}close(){this.#p?.close()}reopen(){this.#p?.reopen()}descriptorFor(e,n){return va(this.definition,e,n)}dispatch(e){const n=this.#S(e,this.#a.state);if(!n.ok)return this.#$([n.issue]);const s=this.descriptorFor(n.action.type,n.action.target);return s?(this.#y(xa(this.#o,n.action,s),{dispatched:[n.action.id]}),{ok:!0,id:n.action.id}):this.#$([{path:"type",message:"unknown action type"}])}dispatchBatch(e){const n=C(Ig,e);if(!n.success)return this.#$([Me(n.issues)]);const s=n.output;if(s.length===0)return{ok:!0,ids:[]};let i=this.#o,r=this.#a.state,o=this.#a.answers;const a=[];for(const l of s){const p=this.#S(l,r);if(!p.ok)return this.#$([p.issue]);const h=p.action,d=this.descriptorFor(h.type,h.target);if(!d)return this.#$([{path:"type",message:"unknown action type"}]);if((Y(h)?oa(this.#t.grill,o,h)===null?null:r:h.type==="comment"||ne(h)?h.target.type==="page"||this.definition.hasTarget(r,h.target)?r:null:this.definition.apply(r,h))===null)return this.#$([{path:"target",message:"batch action is not applicable"}]);i=xa(i,h,d);const c=this.#m(i);r=c.state,o=c.answers,a.push(h.id)}return this.#y(i,{dispatched:a}),{ok:!0,ids:a}}#S(e,n){const s=C(Hr,e);if(!s.success)return{ok:!1,issue:Me(s.issues)};const i=this.descriptorFor(s.output.type,typeof s.output.target=="string"?hn(s.output.target,"page"):s.output.target);if(!i)return{ok:!1,issue:{path:"type",message:`unknown action type "${s.output.type}"`}};const r=yp(s.output,i);if(!r.ok)return r;const o=this.definition.canonicalTarget?.(n,r.action.target)??r.action.target;return{ok:!0,action:{...r.action,target:o}}}#$(e){return this.#u=e,{ok:!1,issues:e}}editComment(e,n){const s=this.#o.find(a=>a.id===e);if(s?.type!==D)return this.#$([{path:"id",message:`no comment "${e}" in the draft`}]);if(Dt(s)===n)return{ok:!0,id:e};const i=C(Ws.schema,{...s,payload:{body:n}});if(!i.success)return this.#$([Me(i.issues)]);const r=C(wt,i.output);if(!r.success)return this.#$([Me(r.issues)]);const o=r.output;if(this.#p!==null){if(!this.#p.isOwn(e))return this.#$([{path:"id",message:`comment "${e}" is another reader's`}]);const a={...o,id:pn()};return this.#y(this.#o.map(l=>l===s?a:l),{dispatched:[a.id],reach:"own"}),{ok:!0,id:a.id}}return this.#y(this.#o.map(a=>a===s?o:a),{dispatched:[]}),{ok:!0,id:e}}removeAction(e){const n=this.#o.filter(s=>s.id!==e);n.length!==this.#o.length&&this.#y(n,{reach:"any"})}clearActions(){this.prepareClear()()}prepareClear(){const e=this.#p;if(e===null)return()=>{this.#o.length>0&&this.#y([])};const n=e.clearMark();return()=>{e.clear(n),this.#x=[],this.#E()}}replaceActions(e){this.#y(si(this.definition,e),{reach:"any"})}setBase(e){this.#r=e,this.#y(this.#o)}undo(){const e=this.#p;if(e!==null){const s=[...this.#o].reverse().find(i=>e.isOwn(i.id));return s===void 0?!1:(this.#x=[...this.#x,s],this.#y(this.#o.filter(i=>i!==s),{preserveRedo:!0,reach:"own"}),!0)}const n=Og(this.#o,this.#k);return n===null?!1:(this.#k=n.state,this.#y([...n.actions],{preserveRedo:!0}),!0)}redo(){if(this.#p!==null){const n=this.#x.at(-1);if(n===void 0)return!1;this.#x=this.#x.slice(0,-1);const s={...n,id:pn()};return this.#y([...this.#o,s],{preserveRedo:!0,dispatched:[s.id]}),!0}const e=_g(this.#o,this.#k);return e===null?!1:(this.#k=e.state,this.#y([...e.actions],{preserveRedo:!0}),!0)}subscribe(e){return this.#c.add(e),()=>{this.#c.delete(e)}}exportDraft(e){return{template:this.definition.name,frameworkVersion:e,exportedAt:new Date().toISOString(),actions:this.#o}}#y(e,n){if(this.#p!==null){this.#C(this.#p,e,n);return}this.#u=[],this.#o=e,this.#f(),this.#a=this.#m(this.#o),this.#U(n?.dispatched),n?.preserveRedo!==!0&&(this.#k=Pg()),this.#_();for(const s of this.#c)s()}#C(e,n,s){this.#u=[];const i=new Set(this.#o.map(a=>a.id)),r=s?.reach??"pending",o=new Set(this.#m(e.preview(n,r)).obsolete.filter(a=>!i.has(a.id)||e.isPending(a.id)).map(a=>a.id));this.#h+=o.size,e.change(n.filter(a=>!o.has(a.id)),r),s?.preserveRedo!==!0&&(this.#x=[]),this.#E()}#q(e){const n=this.#p;if(n===null)return;if(e==="status"){for(const r of this.#c)r();return}const s=new Set(this.#a.stale.map(({action:r})=>r.id));this.#o=n.actions,this.#f(),this.#a=this.#m(this.#o);const i=new Set(this.#a.stale.filter(({action:r})=>r.type!==D&&!s.has(r.id)&&n.isPending(r.id)).map(({action:r})=>r.id));i.size>0&&n.change(this.#o.filter(r=>!i.has(r.id)),"pending"),this.#M(n),this.#E()}#M(e){const n=e.actions.filter(s=>As(this.#v,s.id));return n.length===0?!1:(this.#h+=n.length,e.change(e.actions.filter(s=>!n.includes(s)),"any"),!0)}#E(){this.#p!==null&&(this.#o=this.#p.actions),this.#f(),this.#a=this.#m(this.#o);for(const e of this.#c)e()}#U(e){const n=this.#K(),s=this.#L()||n,i=this.#H()||s,r=pg(this.definition,this.#a,o=>this.#m(o),e);return r===this.#a?i:(this.#h+=this.#o.length-r.actions.length,this.#o=[...r.actions],this.#f(),this.#a=this.#m(this.#o),this.#H(),!0)}#H(){return this.#a.obsolete.length===0?!1:(this.#h+=this.#a.obsolete.length,this.#o=da(this.#a),this.#f(),this.#a=this.#m(this.#o),!0)}#K(){const e=this.#o.filter(n=>!As(this.#v,n.id));return e.length===this.#o.length?!1:(this.#h+=this.#o.length-e.length,this.#o=e,this.#f(),this.#a=this.#m(this.#o),!0)}#L(){if(!this.#A())return!1;const e=new Set(this.#a.stale.filter(({action:n,reason:s})=>s==="target-missing"&&fn(n.target)===null).map(({action:n})=>n.id));return e.size===0?!1:(this.#h+=e.size,this.#o=this.#o.filter(n=>!e.has(n.id)),this.#f(),this.#a=this.#m(this.#o),!0)}#_(){this.#l?.save(this.#d,this.definition.name,this.#o)}}const va=(t,e,n)=>e==="comment"?Ws:e===On?lg:n!==void 0&&ne({type:e,target:n})?nh:t.actionFor?t.actionFor(e,n):St(t.actions,e),xa=(t,e,n)=>Y(e)?cg(t,e):Br(t,e,n),si=(t,e)=>e.flatMap(n=>{const s=C(wt,n);if(!s.success)return[];const i=s.output,r=va(t,i.type,i.target);if(!r)return[];const o=C(r.schema,i);if(!o.success)return[];const a=C(wt,o.output);return a.success?[a.output]:[]}),Dg='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',Ng=()=>{if(typeof document>"u")return null;let t=document.activeElement;for(;t?.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t instanceof HTMLElement?t:null},qg=t=>{const e=t.querySelector("[autofocus]");if(e)return e;for(const n of t.querySelectorAll(Dg))if(!(n.hidden||n.closest("[hidden]")!==null))return n;return null},Ug=t=>typeof t.showModal=="function",Ln=t=>{const e=t.open;return typeof e=="boolean"?e:t.hasAttribute("open")},Hg=t=>{if(Ug(t)){t.showModal();return}t.setAttribute("open","")},wa=t=>{if(typeof t.close=="function"){t.close();return}Ln(t)&&(t.removeAttribute("open"),t.dispatchEvent(new Event("close")))},Bg="dpk-dialog-close";class jg{constructor(e,n){this.#s=null,this.#t="close",this.handlers={cancel:s=>{s.preventDefault(),this.dismiss("escape")},close:()=>this.#o(),click:s=>{s.target===this.#n.dialog()&&this.dismiss("backdrop")}},this.#i=s=>{if(s.button!==0||!this.#n.open())return;const i=this.#n.dialog();i===null||s.composedPath().includes(i)||this.dismiss("backdrop")},this.#e=e,this.#n=n,e.addController(this)}#e;#n;#s;#t;hostConnected(){document.addEventListener("pointerdown",this.#i,!0)}hostUpdated(){const e=this.#n.dialog();if(e!==null){if(this.#n.open()){Ln(e)||this.#r(e);return}Ln(e)&&wa(e)}}hostDisconnected(){document.removeEventListener("pointerdown",this.#i,!0);const e=this.#n.dialog();e!==null&&Ln(e)&&wa(e),this.#s=null}#i;dismiss(e="close"){this.#t=e,this.#n.dismiss(e)}#r(e){this.#t="close",this.#s=Ng(),Hg(e);const n=qg(e)??e;n===e&&!e.hasAttribute("tabindex")&&(e.tabIndex=-1),n.focus()}#o(){const e=this.#t,n=this.#s;this.#s=null,this.#n.open()&&this.#n.dismiss(e),n?.isConnected&&n.focus(),this.#e.dispatchEvent(new CustomEvent(Bg,{detail:{reason:e},bubbles:!0,composed:!0}))}}const ya=(t,e="json")=>`\`\`\`${e}
275
273
  ${t}
276
- \`\`\``,Ig=t=>JSON.stringify({type:t.type,target:t.target,payload:t.payload,...t.note===void 0?{}:{note:t.note}},null,2),Hn=(t,e,n)=>{const{actions:s,state:i}=t,r=new Set(t.stale.map(h=>h.action.id)),o=s.filter(h=>!r.has(h.id)),a=o.filter(h=>h.type===H),l=o.filter(h=>h.type!==H&&!Q(h)),c=t.grill.questions.filter(h=>qn(h,t.answers[h.id])),d=[];if(d.push(`# Review draft \u2014 ${e.label}`),d.push(""),d.push(`- template: \`${e.name}\``),d.push(`- framework: \`dev-process-kit@${n}\``),d.push(`- navigation: \`${nt(t.navigation)||"(none)"}\``),d.push(`- pending: ${l.length} change(s), ${a.length} comment(s)`+(c.length>0?`, ${c.length} answer(s)`:"")),t.stale.length>0&&d.push(`- stale (not applicable to the current base): ${t.stale.length}`),d.push(""),d.push("## How to apply"),d.push(""),d.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."),l.some(re)&&(d.push(""),d.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.")),d.push(""),a.length>0){d.push(`## Comments (${a.length})`),d.push("");for(const[h,f]of a.entries()){const p=e.describe(f,i,t.base);d.push(`${h+1}. **${p.targetLabel}** \u2014 \`${P(f.target)}\``),d.push(` > ${Ht(f).replace(/\n/g,`
277
- > `)}`)}d.push("")}if(c.length>0){d.push(`## Answers (${c.length})`),d.push(""),d.push("The reader answered these questions from the `data-dpk-grill` block. Settle them in the page; when you ask the next round, move them into `history` with the answer as recorded."),d.push("");for(const[h,f]of c.entries()){const p=t.answers[f.id],g=p?.kind==="option"?` (option \`${p.optionId}\`)`:"";d.push(`${h+1}. **${ti(t.grill,f.id)}** \u2014 \`grill:${f.id}\``),d.push(` > ${Nn(f,p).replace(/\n/g,`
278
- > `)}${g}`)}d.push("")}if(l.length>0){d.push(`## Requested changes (${l.length})`),d.push("");for(const[h,f]of l.entries()){const p=e.describe(f,i,t.base),g=p.summary?` \u2014 ${p.summary}`:"";d.push(`${h+1}. **${p.title}**${g}`),d.push(` target: \`${P(f.target)}\` (${f.target.type})`),d.push(` \`\`\`json
279
- ${Ig(f).replace(/\n/g,`
274
+ \`\`\``,Fg=t=>JSON.stringify({type:t.type,target:t.target,payload:t.payload,...t.note===void 0?{}:{note:t.note}},null,2),zn=(t,e,n,s=Oe)=>{const{actions:i,state:r}=t,o=new Set(t.stale.map(f=>f.action.id)),a=i.filter(f=>!o.has(f.id)),l=a.filter(f=>f.type===D),p=a.filter(f=>f.type!==D&&!Y(f)),h=t.grill.questions.filter(f=>Pn(f,t.answers[f.id])),d=[];if(d.push(`# Review draft \u2014 ${e.label}`),d.push(""),d.push(`- template: \`${e.name}\``),d.push(`- framework: \`dev-process-kit@${n}\``),d.push(`- navigation: \`${Qe(t.navigation)||"(none)"}\``),d.push(`- pending: ${p.length} change(s), ${l.length} comment(s)`+(h.length>0?`, ${h.length} answer(s)`:"")),t.stale.length>0&&d.push(`- stale (not applicable to the current base): ${t.stale.length}`),d.push(""),d.push("## How to apply"),d.push(""),d.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."),p.some(ne)&&(d.push(""),d.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.")),d.push(""),l.length>0){d.push(`## Comments (${l.length})`),d.push("");for(const[f,c]of l.entries()){const g=e.describe(c,r,t.base);d.push(`${f+1}. **${g.targetLabel}** \u2014 \`${_(c.target)}\``),d.push(` > ${Dt(c).replace(/\n/g,`
275
+ > `)}`)}d.push("")}if(h.length>0){d.push(`## Answers (${h.length})`),d.push(""),d.push("The reader answered these questions from the `data-dpk-grill` block. Settle them in the page; when you ask the next round, move them into `history` with the answer as recorded."),d.push("");for(const[f,c]of h.entries()){const g=t.answers[c.id],u=g?.kind==="option"?` (option \`${g.optionId}\`)`:"";d.push(`${f+1}. **${Vs(t.grill,c.id)}** \u2014 \`grill:${c.id}\``),d.push(` > ${_n(c,g).replace(/\n/g,`
276
+ > `)}${u}`)}d.push("")}if(p.length>0){d.push(`## Requested changes (${p.length})`),d.push("");for(const[f,c]of p.entries()){const g=e.describe(c,r,t.base),u=g.summary?` \u2014 ${g.summary}`:"";d.push(`${f+1}. **${g.title}**${u}`),d.push(` target: \`${_(c.target)}\` (${c.target.type})`),d.push(` \`\`\`json
277
+ ${Fg(c).replace(/\n/g,`
280
278
  `)}
281
- \`\`\``)}d.push("")}if(l.length===0&&a.length===0&&c.length===0&&(d.push("_No pending draft actions._"),d.push("")),t.stale.length>0){d.push(`## Not applicable to the current base (${t.stale.length})`),d.push(""),d.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."),d.push("");for(const[h,{action:f,reason:p}]of t.stale.entries()){const g=e.describe(f,i,t.base),u=f.type===H?Ht(f):g.title;d.push(`${h+1}. \`${f.type}\` on \`${P(f.target)}\` (${p}) \u2014 ${u}`)}d.push("")}return d.push("## Canonical draft (JSON)"),d.push(""),d.push(Dg(Ms(s))),d.push(""),d.join(`
282
- `)},Ng=4096,qg="reviews",Ta="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.",Ug=t=>new TextEncoder().encode(t).length,Hg=t=>t.replace(/[\u0000-\u0008\u000B-\u001F\u007F]/g,""),jg=t=>{const e=`${Ta}
279
+ \`\`\``)}d.push("")}if(p.length===0&&l.length===0&&h.length===0&&(d.push("_No pending draft actions._"),d.push("")),t.stale.length>0){d.push(`## Not applicable to the current base (${t.stale.length})`),d.push(""),d.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."),d.push("");for(const[f,{action:c,reason:g}]of t.stale.entries()){const u=e.describe(c,r,t.base),k=c.type===D?Dt(c):u.title;d.push(`${f+1}. \`${c.type}\` on \`${_(c.target)}\` (${g}) \u2014 ${k}`)}d.push("")}if(i.some(f=>Ss(f.id)!==null)){const f=Tp(Rp(s,i.map(c=>c.id)));d.push("## Change log: addressed"),d.push(""),d.push('When you regenerate the page, set `"addressed"` at the top of its change log (`<script type="application/json" data-dpk-changes>`) to this value, replacing the old one:'),d.push(""),d.push(ya(f,"text")),d.push(""),d.push("It names every draft action handled so far, this round included, as `writer:from-to` ranges; readers' pages drop what it names. To leave a request for a later round, split its id out of the range (`a1:1-4,a1:6-9` leaves `a1:5`)."),d.push("")}return d.push("## Canonical draft (JSON)"),d.push(""),d.push(ya($s(i))),d.push(""),d.join(`
280
+ `)},Gg=4096,Wg="reviews",$a="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.",Kg=t=>new TextEncoder().encode(t).length,Vg=t=>t.replace(/[\u0000-\u0008\u000B-\u001F\u007F]/g,""),Yg=t=>{const e=`${$a}
283
281
 
284
- ${Hg(t)}`;return Ug(e)<=Ng?e:null},Bg=t=>`${Ta}
282
+ ${Vg(t)}`;return Kg(e)<=Gg?e:null},Zg=t=>`${$a}
285
283
 
286
- 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).`,Fg={consent_required:"consent",forbidden:"forbidden",not_granted:"forbidden",capability_disabled:"forbidden",capability_removed:"forbidden",claude_unavailable:"claude_unavailable",rate_limited:"rate_limited"},Gg=t=>{const e=typeof t=="object"&&t!==null&&"code"in t?t.code:void 0;return(typeof e=="string"?Fg[e]:void 0)??"error"},Wg={too_large:"handoffTooLarge",consent:"handoffConsent",forbidden:"handoffForbidden",claude_unavailable:"handoffClaudeUnavailable",rate_limited:"handoffRateLimited",storage:"handoffStorage",error:"handoffError"},Ra=(t,e)=>O(e)[Wg[t]],Kg=()=>({status:{kind:"idle"},request:0}),Vg=(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}},Yg=(t,e)=>{if(t.actions===0||t.railOpen)return null;const n=O(t.locale),s=e.status;return{send:t.sendable?{label:s.kind==="sending"?n.handoffSending:s.kind==="sent"?n.handoffSent:n.handoffSend,disabled:s.kind==="sending"}:null,copy:s.kind==="copied"?{label:n.handoffCopied,status:"copied"}:s.kind==="copy-failed"?{label:n.handoffCopyFailed,status:"failed"}:{label:n.handoffCopy,status:"idle"},note:s.kind==="send-failed"?Ra(s.reason,t.locale):null}},we={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4},Ft=t=>(...e)=>({_$litDirective$:t,values:e});let jn=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,n,s){this._$Ct=e,this._$AM=n,this._$Ci=s}_$AS(e,n){return this.update(e,n)}update(e,n){return this.render(...n)}};class Bn extends jn{constructor(e){if(super(e),this.it=b,e.type!==we.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===b||e==null)return this._t=void 0,this.it=e;if(e===Z)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const n=[e];return n.raw=n,this._t={_$litType$:this.constructor.resultType,strings:n,values:[]}}}Bn.directiveName="unsafeHTML",Bn.resultType=1;const _a=Ft(Bn);let li=class extends Bn{};li.directiveName="unsafeSVG",li.resultType=2;const Zg=Ft(li),Qg=t=>t.replaceAll("&","&amp;").replaceAll('"',"&quot;"),Xg=t=>t.map(([e,n])=>`<${e}${Object.entries(n).map(([s,i])=>` ${s}="${Qg(String(i))}"`).join("")}></${e}>`).join(""),y=t=>{const e=Xg(t);return()=>k`<svg
284
+ 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).`,Qg={consent_required:"consent",forbidden:"forbidden",not_granted:"forbidden",capability_disabled:"forbidden",capability_removed:"forbidden",claude_unavailable:"claude_unavailable",rate_limited:"rate_limited"},Xg=t=>{const e=typeof t=="object"&&t!==null&&"code"in t?t.code:void 0;return(typeof e=="string"?Qg[e]:void 0)??"error"},Jg={too_large:"handoffTooLarge",consent:"handoffConsent",forbidden:"handoffForbidden",claude_unavailable:"handoffClaudeUnavailable",rate_limited:"handoffRateLimited",storage:"handoffStorage",error:"handoffError"},Sa=(t,e)=>R(e)[Jg[t]],ef=()=>({status:{kind:"idle"},request:0}),tf=(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}},nf=(t,e)=>{if(t.actions===0||t.railOpen)return null;const n=R(t.locale),s=e.status;return{send:t.sendable?{label:s.kind==="sending"?n.handoffSending:s.kind==="sent"?n.handoffSent:n.handoffSend,disabled:s.kind==="sending"}:null,copy:s.kind==="copied"?{label:n.handoffCopied,status:"copied"}:s.kind==="copy-failed"?{label:n.handoffCopyFailed,status:"failed"}:{label:n.handoffCopy,status:"idle"},note:s.kind==="send-failed"?Sa(s.reason,t.locale):null}},ve={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4},Ht=t=>(...e)=>({_$litDirective$:t,values:e});let In=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,n,s){this._$Ct=e,this._$AM=n,this._$Ci=s}_$AS(e,n){return this.update(e,n)}update(e,n){return this.render(...n)}};class Dn extends In{constructor(e){if(super(e),this.it=b,e.type!==ve.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===b||e==null)return this._t=void 0,this.it=e;if(e===V)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const n=[e];return n.raw=n,this._t={_$litType$:this.constructor.resultType,strings:n,values:[]}}}Dn.directiveName="unsafeHTML",Dn.resultType=1;const Aa=Ht(Dn);let ii=class extends Dn{};ii.directiveName="unsafeSVG",ii.resultType=2;const sf=Ht(ii),rf=t=>t.replaceAll("&","&amp;").replaceAll('"',"&quot;"),of=t=>t.map(([e,n])=>`<${e}${Object.entries(n).map(([s,i])=>` ${s}="${rf(String(i))}"`).join("")}></${e}>`).join(""),w=t=>{const e=of(t);return()=>m`<svg
287
285
  viewBox="0 0 24 24"
288
286
  fill="none"
289
287
  stroke="currentColor"
@@ -293,15 +291,15 @@ The brief is too long for a comment, so it is stored in this artifact's database
293
291
  aria-hidden="true"
294
292
  focusable="false"
295
293
  >
296
- ${Zg(e)}
297
- </svg>`},ct=y(Dc),Ma=y(Lc),di=y(Ac),Fn=y(bc),Jg=y(kc),ef=y(Rc),Oa=y(or),tf=y(_c),Pa=y(gc),nf=y(rc),pt=y(tc),ci=y(Ec),sf=y(xc),La=y(pc),za=y(cc),Da=y($c),rf=y(ir),of=y(Xd),af=y(tr);y(nr),y(sr);const Ia=y(nc),Gt=y(sc),Na=y(rr),lf=y(mc),df=y(vc),cf=y(Oc),pf=y(wc),qa=y(Jd),hf=y(hc),uf=y(ac);y(Pc);const gf=y(Zd),ff=y(zc),mf=y(Tc),kf=y(dr),bf=()=>k`<svg viewBox="0 0 190 125" aria-hidden="true" focusable="false">
294
+ ${sf(e)}
295
+ </svg>`},ot=w(jc),Ea=w(Hc),ri=w(_c),Nn=w(Ac),af=w(Sc),lf=w(Ic),Ca=w(lr),df=w(Dc),Ta=w(wc),cf=w(hc),at=w(lc),oi=w(Pc),pf=w(Cc),Ra=w(bc),Ma=w(kc),Oa=w(Mc),hf=w(or),uf=w(rc),gf=w(sr);w(ir),w(rr);const _a=w(dc),Bt=w(cc),Pa=w(ar),ff=w($c),mf=w(Ec),kf=w(qc),bf=w(Rc),La=w(oc),vf=w(vc),xf=w(gc);w(Uc);const wf=w(sc),yf=w(Bc),$f=w(zc),Sf=w(pr),Af=()=>m`<svg viewBox="0 0 190 125" aria-hidden="true" focusable="false">
298
296
  <path
299
297
  fill="#7463fa"
300
298
  fill-rule="evenodd"
301
299
  d="M50 16.1c0 15-.1 16-1.7 15.4-1-.4-4.6-1.2-8.1-1.8C19 26-1.3 45 .3 66.8c1 13 10.4 25.7 22.3 30.1A36 36 0 0 0 57 91.3l3.9-3.5V125h20.9l-.1-13.7c-.2-15.6-1.3-14.2 9-12.3 8.3 1.5 16.9-.6 24.9-6l4.3-3v10h20l.2-13.5.3-13.6 11.4 13.6 11.4 13.5h13.4a48 48 0 0 0 13-.8l-16.1-19.3A245 245 0 0 1 158 60.4c0-.5 6-6.9 13.3-14l15.1-15.2 2-2.2h-26.7l-11 10.8-11 10.7.4-25 .4-25-10.2-.3L120 0v19c0 10.5-.2 19.1-.5 19.1s-2.3-1.3-4.7-2.9a34 34 0 0 0-37.8 0c-3.2 2.2-6 3.8-6 3.8-.2 0-.3-7.8-.1-17.2.2-9.5 0-18.3-.3-19.5C70 0 69.5 0 60 0H50zM31.4 49c-8 1.8-13 8.9-12.1 16.8.6 5 2.9 8.7 7.8 12 2.8 2 4.4 2.3 9 2C45.3 79 51 73.2 51 64.2c0-10.4-9.4-17.7-19.6-15.2m56.1 1.8c-4.1 2.6-6 5-7.5 9.5-2.2 7 1.2 14.7 8 18.2a18 18 0 0 0 16-.7c5.5-3.8 7.4-7.1 7.4-13q-.1-14.6-14.9-15.6c-4.6-.2-6.7.1-9 1.6"
302
300
  />
303
- </svg>`,vf={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)"],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)"]},Gn=t=>on(Object.entries(vf).map(([e,[n,s]])=>`--dpk-${e}: ${t(n,s)};`).join(`
304
- `)),Ua=(t,[e,n])=>({bare:`var(${t}, ${e})`,schemed:`var(${t}, light-dark(${e}, ${n}))`}),ht=Ua("--dpk-brand-primary",["#6253d4","#6858e0"]),ut=Ua("--dpk-brand-secondary",["#3563d9","#7aa2f7"]),gt=(t,e)=>on(`
301
+ </svg>`,Ef={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","#8a92a2"],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)"],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)"]},qn=t=>rn(Object.entries(Ef).map(([e,[n,s]])=>`--dpk-${e}: ${t(n,s)};`).join(`
302
+ `)),za=(t,[e,n])=>({bare:`var(${t}, ${e})`,schemed:`var(${t}, light-dark(${e}, ${n}))`}),lt=za("--dpk-brand-primary",["#6253d4","#6858e0"]),dt=za("--dpk-brand-secondary",["#3563d9","#7aa2f7"]),ct=(t,e)=>rn(`
305
303
  --dpk-accent: ${t};
306
304
  --dpk-accent-strong: color-mix(in oklab, var(--dpk-accent) 80%, black);
307
305
  --dpk-accent-bright: color-mix(in oklab, var(--dpk-accent) 88%, white);
@@ -310,7 +308,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
310
308
  --dpk-blue: ${e};
311
309
  --dpk-blue-strong: color-mix(in oklab, var(--dpk-blue) 80%, black);
312
310
  --dpk-blue-soft: color-mix(in srgb, var(--dpk-blue) 9%, transparent);
313
- `),Ha=z`
311
+ `),Ia=P`
314
312
  /* A surface appearing where it stands: a popover, a menu, a dialog backdrop. */
315
313
  @keyframes dpk-fade-in {
316
314
  from {
@@ -377,7 +375,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
377
375
  background-position: 250% 0;
378
376
  }
379
377
  }
380
- `,ja=z`
378
+ `,Da=P`
381
379
  --dpk-display: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
382
380
  --dpk-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
383
381
  --dpk-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
@@ -411,14 +409,14 @@ The brief is too long for a comment, so it is stored in this artifact's database
411
409
  --dpk-glass: color-mix(in srgb, var(--dpk-paper-raised) 78%, transparent);
412
410
  /* Working surface behind boards and canvases: a quiet dot lattice. */
413
411
  --dpk-dots: radial-gradient(circle at 1px 1px, var(--dpk-rule-strong) 1px, transparent 0) 0 0 / 20px 20px;
414
- `,ft=z`
415
- ${Ha}
412
+ `,pt=P`
413
+ ${Ia}
416
414
 
417
415
  :host {
418
416
  /* Browsers without light-dark() stay light. */
419
- ${Gn(t=>t)}
420
- ${gt(ht.bare,ut.bare)}
421
- ${ja}
417
+ ${qn(t=>t)}
418
+ ${ct(lt.bare,dt.bare)}
419
+ ${Da}
422
420
 
423
421
  color: var(--dpk-ink);
424
422
  font-family: var(--dpk-body);
@@ -431,8 +429,8 @@ The brief is too long for a comment, so it is stored in this artifact's database
431
429
 
432
430
  @supports (color: light-dark(#000, #fff)) {
433
431
  :host {
434
- ${Gn((t,e)=>`light-dark(${t}, ${e})`)}
435
- ${gt(ht.schemed,ut.schemed)}
432
+ ${qn((t,e)=>`light-dark(${t}, ${e})`)}
433
+ ${ct(lt.schemed,dt.schemed)}
436
434
  }
437
435
  }
438
436
 
@@ -495,30 +493,30 @@ The brief is too long for a comment, so it is stored in this artifact's database
495
493
  transition-delay: 0ms !important;
496
494
  }
497
495
  }
498
- `,xf=z`
496
+ `,Cf=P`
499
497
  :where(:root) {
500
- ${Gn(t=>t)}
501
- ${gt(ht.bare,ut.bare)}
502
- ${ja}
498
+ ${qn(t=>t)}
499
+ ${ct(lt.bare,dt.bare)}
500
+ ${Da}
503
501
  }
504
502
 
505
503
  @supports (color: light-dark(#000, #fff)) {
506
504
  :where(:root) {
507
- ${Gn((t,e)=>`light-dark(${t}, ${e})`)}
508
- ${gt(ht.schemed,ut.schemed)}
505
+ ${qn((t,e)=>`light-dark(${t}, ${e})`)}
506
+ ${ct(lt.schemed,dt.schemed)}
509
507
  }
510
508
  }
511
- `,yf=z`
509
+ `,Tf=P`
512
510
  :where([data-dpk-theme]) {
513
- ${gt(ht.bare,ut.bare)}
511
+ ${ct(lt.bare,dt.bare)}
514
512
  }
515
513
 
516
514
  @supports (color: light-dark(#000, #fff)) {
517
515
  :where([data-dpk-theme]) {
518
- ${gt(ht.schemed,ut.schemed)}
516
+ ${ct(lt.schemed,dt.schemed)}
519
517
  }
520
518
  }
521
- `,Ba=(t=e=>e)=>on(`
519
+ `,Na=(t=e=>e)=>rn(`
522
520
  ${t(".dpk-icon-btn")} {
523
521
  position: relative;
524
522
  display: inline-flex;
@@ -629,7 +627,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
629
627
  /* A count that just appeared lands with a little weight (shared 'dpk-pop'). */
630
628
  animation: dpk-pop var(--dpk-dur) var(--dpk-ease-spring);
631
629
  }
632
- `),pi=z`
630
+ `),ai=P`
633
631
  .dpk-btn {
634
632
  display: inline-flex;
635
633
  align-items: center;
@@ -763,7 +761,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
763
761
  0 8px 20px -6px color-mix(in srgb, var(--dpk-danger) 65%, transparent);
764
762
  }
765
763
 
766
- ${Ba()}
764
+ ${Na()}
767
765
 
768
766
  .dpk-input,
769
767
  .dpk-textarea,
@@ -1022,7 +1020,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
1022
1020
  gap: 8px;
1023
1021
  margin-top: 4px;
1024
1022
  }
1025
- `,wf=z`
1023
+ `,Rf=P`
1026
1024
  .comment-pop {
1027
1025
  box-sizing: border-box;
1028
1026
  overflow: auto;
@@ -1153,7 +1151,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
1153
1151
  align-items: center;
1154
1152
  justify-content: flex-end;
1155
1153
  }
1156
- `,Fa=z`
1154
+ `,qa=P`
1157
1155
  .dpk-prose {
1158
1156
  overflow-wrap: anywhere;
1159
1157
  }
@@ -1260,7 +1258,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
1260
1258
  .dpk-prose img {
1261
1259
  max-width: 100%;
1262
1260
  }
1263
- `;class $f extends ee{static{this.styles=[ft,z`
1261
+ `;class Mf extends X{static{this.styles=[pt,P`
1264
1262
  :host {
1265
1263
  display: grid;
1266
1264
  /* One column no wider than the host: a truncated title must not widen
@@ -1302,12 +1300,12 @@ The brief is too long for a comment, so it is stored in this artifact's database
1302
1300
  min-width: 0;
1303
1301
  min-height: 0;
1304
1302
  }
1305
- `]}render(){return k`
1303
+ `]}render(){return m`
1306
1304
  <div part="header" class="header"><slot name="header"></slot></div>
1307
1305
  <div part="body" class="body"><slot></slot></div>
1308
1306
  <div part="footer" class="footer"><slot name="footer"></slot></div>
1309
1307
  <slot name="overlay"></slot>
1310
- `}}const Sf=()=>{customElements.get("dpk-internal-layout-app")||customElements.define("dpk-internal-layout-app",$f)};class Wt{#e;#s;#t=Zo;constructor(e,n=()=>{}){this.#e=e,this.#s=n,e.addController(this)}get locale(){return this.#t}hostConnected(){this.#t=Xo(this.#e),document.addEventListener(Qs,this.#n)}hostDisconnected(){document.removeEventListener(Qs,this.#n)}#n=()=>{const e=Xo(this.#e);e!==this.#t&&(this.#t=e,this.#s(),this.#e.requestUpdate())}}const hi=(t,e)=>({read(n){try{const s=t.getItem(n);return s===null?null:e(JSON.parse(s))}catch{return null}},write(n,s){try{return t.setItem(n,JSON.stringify(s)),!0}catch{return!1}},remove(n){try{t.removeItem(n)}catch{}}}),X=t=>{const e=new Map;return hi({getItem:n=>e.get(n)??null,setItem:(n,s)=>{e.set(n,s)},removeItem:n=>{e.delete(n)}},t)},fe=t=>{try{if(typeof localStorage<"u")return hi(localStorage,t)}catch{}return X(t)},Af=t=>{try{if(typeof sessionStorage<"u")return hi(sessionStorage,t)}catch{}return X(t)},$e={min:180,max:560,step:16,largeStep:64},Ga={side:"left",defaultWidth:260},Wn=t=>Math.round(Math.min($e.max,Math.max($e.min,t))),Wa=t=>typeof t=="number"&&Number.isFinite(t)?Wn(t):null,ui=(t,e)=>t==="left"?e:-e,Ef=(t,e)=>Wn(t.startWidth+ui(t.side,e-t.startX)),Cf=(t,e,{key:n,shiftKey:s})=>{const i=s?$e.largeStep:$e.step;switch(n){case"ArrowLeft":return Wn(t+ui(e,-i));case"ArrowRight":return Wn(t+ui(e,i));case"Home":return $e.min;case"End":return $e.max;default:return null}},Ka=t=>typeof t=="boolean"?t:null,Be={inset:10,size:32},Tf=t=>t?Be.inset+Be.size:0,Rf=t=>t==="left"?"right":"left",_f=(t,e)=>e?{action:"expand",points:Rf(t)}:{action:"collapse",points:t},gi={width:Ga.defaultWidth,resizable:!0,collapsible:!0,narrow:"drawer",persistKey:null},Mf=(t,e)=>!e||t.narrow==="keep"?"beside":t.narrow==="stack"?"stack":t.collapsible?"drawer":"beside",Of=t=>`dev-process-kit:sidebar-collapsed:${t}`;class Pf{#e;#s;#t=null;#n="";#i=!1;#r=!1;constructor(e,n){this.#e=e,this.#s=n,e.addController(this)}hostConnected(){if(this.#t!==null)return;const e=this.#s.persistKey();this.#t=e===null?X(Ka):fe(Ka),this.#n=Of(e??""),this.#i=this.#t.read(this.#n)??!1}get collapsed(){return this.#i}get drawerOpen(){return this.#r}toggleDrawer(){this.#r=!this.#r,this.#e.requestUpdate()}closeDrawer(){this.#r&&(this.#r=!1,this.#e.requestUpdate())}toggle(){this.set(!this.#i)}set(e){e!==this.#i&&(this.#i=e,this.#i?this.#t?.write(this.#n,!0):this.#t?.remove(this.#n),this.#e.requestUpdate())}}const Va=je({en:{resizeSidebar:"Resize sidebar",resizeSidebarHint:"Drag to resize. Double-click to reset",collapseSidebar:"Collapse sidebar",expandSidebar:"Expand sidebar"},ja:{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"}}),Lf="(max-width: 760px)",zf=()=>typeof matchMedia=="function"?matchMedia(Lf):null;class Df{#e;#s=null;#t=!1;constructor(e){this.#e=e,e.addController(this)}hostConnected(){this.#s=zf(),this.#t=this.#s?.matches===!0,this.#s?.addEventListener("change",this.#n)}hostDisconnected(){this.#s?.removeEventListener("change",this.#n),this.#s=null}get narrow(){return this.#t}#n=e=>{this.#t=e.matches,this.#e.requestUpdate()}}const If=t=>`dev-process-kit:sidebar-width:${t}`,fi={kind:"idle"};class Nf{constructor(e,n){this.#t=null,this.#n="",this.#i=null,this.#r=fi,this.handlers={pointerdown:s=>{s.button===0&&(s.preventDefault(),s.currentTarget instanceof Element&&s.currentTarget.setPointerCapture(s.pointerId),this.#r={kind:"dragging",pointerId:s.pointerId,side:this.#s.side(),startX:s.clientX,startWidth:this.width},this.#e.requestUpdate())},pointermove:s=>{const i=this.#r;i.kind!=="dragging"||i.pointerId!==s.pointerId||this.#a(Ef(i,s.clientX))},pointerup:s=>this.#o(s),pointercancel:s=>this.#o(s),keydown:s=>{const i=Cf(this.width,this.#s.side(),s);i!==null&&(s.preventDefault(),this.#a(i),this.#l())},dblclick:()=>{this.#a(this.#s.defaultWidth()),this.#l()}},this.#e=e,this.#s=n,e.addController(this)}#e;#s;#t;#n;#i;#r;hostConnected(){if(this.#t!==null)return;const e=this.#s.persistKey();this.#t=e===null?X(Wa):fe(Wa),this.#n=If(e??""),this.#i=this.#t.read(this.#n)}hostDisconnected(){this.#r=fi}get width(){return this.#i??this.#s.defaultWidth()}get dragging(){return this.#r.kind==="dragging"}#o(e){const n=this.#r;n.kind!=="dragging"||n.pointerId!==e.pointerId||(this.#r=fi,this.#l(),this.#e.requestUpdate())}#a(e){const n=e===this.#s.defaultWidth()?null:e;n!==this.#i&&(this.#i=n,this.#e.requestUpdate())}#l(){this.#i===null?this.#t?.remove(this.#n):this.#t?.write(this.#n,this.#i)}}class Ya{constructor(e,n,s){this.side=n,this.layout=s,this.filled=!1,this.width=new Nf(e,{persistKey:()=>s().persistKey,side:()=>n,defaultWidth:()=>s().width}),this.fold=new Pf(e,{persistKey:()=>s().persistKey})}get drawnWidth(){return this.layout().resizable?this.width.width:this.layout().width}}class qf extends ee{static{this.styles=[ft,z`
1308
+ `}}const Of=()=>{customElements.get("dpk-internal-layout-app")||customElements.define("dpk-internal-layout-app",Mf)};class jt{#e;#n;#s=Ho;constructor(e,n=()=>{}){this.#e=e,this.#n=n,e.addController(this)}get locale(){return this.#s}hostConnected(){this.#s=jo(this.#e),document.addEventListener(Fs,this.#t)}hostDisconnected(){document.removeEventListener(Fs,this.#t)}#t=()=>{const e=jo(this.#e);e!==this.#s&&(this.#s=e,this.#n(),this.#e.requestUpdate())}}const li=(t,e)=>({read(n){try{const s=t.getItem(n);return s===null?null:e(JSON.parse(s))}catch{return null}},write(n,s){try{return t.setItem(n,JSON.stringify(s)),!0}catch{return!1}},remove(n){try{t.removeItem(n)}catch{}}}),Z=t=>{const e=new Map;return li({getItem:n=>e.get(n)??null,setItem:(n,s)=>{e.set(n,s)},removeItem:n=>{e.delete(n)}},t)},ue=t=>{try{if(typeof localStorage<"u")return li(localStorage,t)}catch{}return Z(t)},_f=t=>{try{if(typeof sessionStorage<"u")return li(sessionStorage,t)}catch{}return Z(t)},xe={min:180,max:560,step:16,largeStep:64},Ua={side:"left",defaultWidth:260},Un=t=>Math.round(Math.min(xe.max,Math.max(xe.min,t))),Ha=t=>typeof t=="number"&&Number.isFinite(t)?Un(t):null,di=(t,e)=>t==="left"?e:-e,Pf=(t,e)=>Un(t.startWidth+di(t.side,e-t.startX)),Lf=(t,e,{key:n,shiftKey:s})=>{const i=s?xe.largeStep:xe.step;switch(n){case"ArrowLeft":return Un(t+di(e,-i));case"ArrowRight":return Un(t+di(e,i));case"Home":return xe.min;case"End":return xe.max;default:return null}},Ba=t=>typeof t=="boolean"?t:null,qe={inset:10,size:32},zf=t=>t?qe.inset+qe.size:0,If=t=>t==="left"?"right":"left",Df=(t,e)=>e?{action:"expand",points:If(t)}:{action:"collapse",points:t},ci={width:Ua.defaultWidth,resizable:!0,collapsible:!0,narrow:"drawer",persistKey:null},Nf=(t,e)=>!e||t.narrow==="keep"?"beside":t.narrow==="stack"?"stack":t.collapsible?"drawer":"beside",qf=t=>`dev-process-kit:sidebar-collapsed:${t}`;class Uf{#e;#n;#s=null;#t="";#i=!1;#r=!1;constructor(e,n){this.#e=e,this.#n=n,e.addController(this)}hostConnected(){if(this.#s!==null)return;const e=this.#n.persistKey();this.#s=e===null?Z(Ba):ue(Ba),this.#t=qf(e??""),this.#i=this.#s.read(this.#t)??!1}get collapsed(){return this.#i}get drawerOpen(){return this.#r}toggleDrawer(){this.#r=!this.#r,this.#e.requestUpdate()}closeDrawer(){this.#r&&(this.#r=!1,this.#e.requestUpdate())}toggle(){this.set(!this.#i)}set(e){e!==this.#i&&(this.#i=e,this.#i?this.#s?.write(this.#t,!0):this.#s?.remove(this.#t),this.#e.requestUpdate())}}const ja=Ne({en:{resizeSidebar:"Resize sidebar",resizeSidebarHint:"Drag to resize. Double-click to reset",collapseSidebar:"Collapse sidebar",expandSidebar:"Expand sidebar"},ja:{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"}}),Hf="(max-width: 760px)",Bf=()=>typeof matchMedia=="function"?matchMedia(Hf):null;class jf{#e;#n=null;#s=!1;constructor(e){this.#e=e,e.addController(this)}hostConnected(){this.#n=Bf(),this.#s=this.#n?.matches===!0,this.#n?.addEventListener("change",this.#t)}hostDisconnected(){this.#n?.removeEventListener("change",this.#t),this.#n=null}get narrow(){return this.#s}#t=e=>{this.#s=e.matches,this.#e.requestUpdate()}}const Ff=t=>`dev-process-kit:sidebar-width:${t}`,pi={kind:"idle"};class Gf{constructor(e,n){this.#s=null,this.#t="",this.#i=null,this.#r=pi,this.handlers={pointerdown:s=>{s.button===0&&(s.preventDefault(),s.currentTarget instanceof Element&&s.currentTarget.setPointerCapture(s.pointerId),this.#r={kind:"dragging",pointerId:s.pointerId,side:this.#n.side(),startX:s.clientX,startWidth:this.width},this.#e.requestUpdate())},pointermove:s=>{const i=this.#r;i.kind!=="dragging"||i.pointerId!==s.pointerId||this.#a(Pf(i,s.clientX))},pointerup:s=>this.#o(s),pointercancel:s=>this.#o(s),keydown:s=>{const i=Lf(this.width,this.#n.side(),s);i!==null&&(s.preventDefault(),this.#a(i),this.#l())},dblclick:()=>{this.#a(this.#n.defaultWidth()),this.#l()}},this.#e=e,this.#n=n,e.addController(this)}#e;#n;#s;#t;#i;#r;hostConnected(){if(this.#s!==null)return;const e=this.#n.persistKey();this.#s=e===null?Z(Ha):ue(Ha),this.#t=Ff(e??""),this.#i=this.#s.read(this.#t)}hostDisconnected(){this.#r=pi}get width(){return this.#i??this.#n.defaultWidth()}get dragging(){return this.#r.kind==="dragging"}#o(e){const n=this.#r;n.kind!=="dragging"||n.pointerId!==e.pointerId||(this.#r=pi,this.#l(),this.#e.requestUpdate())}#a(e){const n=e===this.#n.defaultWidth()?null:e;n!==this.#i&&(this.#i=n,this.#e.requestUpdate())}#l(){this.#i===null?this.#s?.remove(this.#t):this.#s?.write(this.#t,this.#i)}}class Fa{constructor(e,n,s){this.side=n,this.layout=s,this.filled=!1,this.width=new Gf(e,{persistKey:()=>s().persistKey,side:()=>n,defaultWidth:()=>s().width}),this.fold=new Uf(e,{persistKey:()=>s().persistKey})}get drawnWidth(){return this.layout().resizable?this.width.width:this.layout().width}}class Wf extends X{static{this.styles=[pt,P`
1311
1309
  :host {
1312
1310
  display: flex;
1313
1311
  min-width: 0;
@@ -1439,10 +1437,10 @@ The brief is too long for a comment, so it is stored in this artifact's database
1439
1437
  /* Folded: a button floating a little in from the main column's outer edge, big enough to hit. */
1440
1438
  .toggle[data-float] {
1441
1439
  position: absolute;
1442
- top: ${Be.inset}px;
1440
+ top: ${qe.inset}px;
1443
1441
  z-index: 26;
1444
- width: ${Be.size}px;
1445
- height: ${Be.size}px;
1442
+ width: ${qe.size}px;
1443
+ height: ${qe.size}px;
1446
1444
  margin: 0;
1447
1445
  border-radius: var(--dpk-radius, 8px);
1448
1446
  box-shadow: var(--dpk-bevel), var(--dpk-shadow-sm);
@@ -1454,11 +1452,11 @@ The brief is too long for a comment, so it is stored in this artifact's database
1454
1452
  }
1455
1453
 
1456
1454
  .toggle[data-float='left'] {
1457
- left: ${Be.inset}px;
1455
+ left: ${qe.inset}px;
1458
1456
  }
1459
1457
 
1460
1458
  .toggle[data-float='right'] {
1461
- right: ${Be.inset}px;
1459
+ right: ${qe.inset}px;
1462
1460
  }
1463
1461
 
1464
1462
  /* An open drawer: the button rides its edge as a round one, ready to close it. */
@@ -1599,18 +1597,18 @@ The brief is too long for a comment, so it is stored in this artifact's database
1599
1597
  border-bottom: 0;
1600
1598
  border-top: 1px solid var(--dpk-rule);
1601
1599
  }
1602
- `]}static{this.properties={left:{attribute:!1},right:{attribute:!1},main:{type:String,reflect:!0}}}#e=new Wt(this);#s=new Df(this);#t={left:new Ya(this,"left",()=>this.left),right:new Ya(this,"right",()=>this.right)};#n=!1;#i=null;constructor(){super(),this.left=gi,this.right=gi,this.main=null}connectedCallback(){super.connectedCallback();const e=new Set(Array.from(this.children,n=>n.slot));this.#t.left.filled=e.has("left"),this.#t.right.filled=e.has("right"),this.#n=e.has("rail")}updated(){if(this.#i===null)return;const e=this.#i;this.#i=null,this.renderRoot.querySelector(`.toggle[data-side='${e}']`)?.focus()}#r(e){return Mf(e.layout(),this.#s.narrow)}#o(e){return e.layout().collapsible?this.#r(e)==="drawer"?!e.fold.drawerOpen:e.fold.collapsed:!1}foldedOn(e){const n=this.#t[e];return n.filled&&this.#o(n)}toggleFold(e){const n=this.#t[e];n.filled&&this.#a(n)}#a(e){this.#r(e)==="drawer"?e.fold.toggleDrawer():e.fold.toggle(),this.dispatchEvent(new CustomEvent("dpk-sidebar-fold",{bubbles:!0,composed:!0}))}render(){const{left:e,right:n}=this.#t,s=[e,n].filter(a=>a.filled),i=s.some(a=>this.#r(a)==="stack"),o=s.some(a=>this.#r(a)==="drawer"&&!this.#o(a))?k`<div
1600
+ `]}static{this.properties={left:{attribute:!1},right:{attribute:!1},main:{type:String,reflect:!0}}}#e=new jt(this);#n=new jf(this);#s={left:new Fa(this,"left",()=>this.left),right:new Fa(this,"right",()=>this.right)};#t=!1;#i=null;constructor(){super(),this.left=ci,this.right=ci,this.main=null}connectedCallback(){super.connectedCallback();const e=new Set(Array.from(this.children,n=>n.slot));this.#s.left.filled=e.has("left"),this.#s.right.filled=e.has("right"),this.#t=e.has("rail")}updated(){if(this.#i===null)return;const e=this.#i;this.#i=null,this.renderRoot.querySelector(`.toggle[data-side='${e}']`)?.focus()}#r(e){return Nf(e.layout(),this.#n.narrow)}#o(e){return e.layout().collapsible?this.#r(e)==="drawer"?!e.fold.drawerOpen:e.fold.collapsed:!1}foldedOn(e){const n=this.#s[e];return n.filled&&this.#o(n)}toggleFold(e){const n=this.#s[e];n.filled&&this.#a(n)}#a(e){this.#r(e)==="drawer"?e.fold.toggleDrawer():e.fold.toggle(),this.dispatchEvent(new CustomEvent("dpk-sidebar-fold",{bubbles:!0,composed:!0}))}render(){const{left:e,right:n}=this.#s,s=[e,n].filter(a=>a.filled),i=s.some(a=>this.#r(a)==="stack"),o=s.some(a=>this.#r(a)==="drawer"&&!this.#o(a))?m`<div
1603
1601
  part="scrim"
1604
1602
  class="scrim"
1605
1603
  @click=${()=>{e.fold.closeDrawer(),n.fold.closeDrawer()}}
1606
- ></div>`:b;return k`<div part="rail" class="rail" ?hidden=${!this.#n}>
1607
- <slot name="rail" @slotchange=${this.#y}></slot>
1604
+ ></div>`:b;return m`<div part="rail" class="rail" ?hidden=${!this.#t}>
1605
+ <slot name="rail" @slotchange=${this.#x}></slot>
1608
1606
  </div>
1609
1607
  <div class="body" ?data-stack=${i} ?data-resizing=${e.width.dragging||n.width.dragging}>
1610
- ${this.#d(e)}${this.#p(e)}
1608
+ ${this.#d(e)}${this.#u(e)}
1611
1609
  <div part="main" class="main" style=${this.#l()}><slot></slot></div>
1612
- ${this.#p(n)}${this.#d(n)} ${o}
1613
- </div>`}#l(){return["left","right"].map(e=>`--dpk-fold-clearance-${e}: ${Tf(this.foldedOn(e))}px;`).join(" ")}#d(e){return k`<div
1610
+ ${this.#u(n)}${this.#d(n)} ${o}
1611
+ </div>`}#l(){return["left","right"].map(e=>`--dpk-fold-clearance-${e}: ${zf(this.foldedOn(e))}px;`).join(" ")}#d(e){return m`<div
1614
1612
  id=${`sidebar-${e.side}`}
1615
1613
  part="sidebar"
1616
1614
  class="sidebar"
@@ -1620,8 +1618,8 @@ The brief is too long for a comment, so it is stored in this artifact's database
1620
1618
  style=${`--dpk-sidebar-width: ${e.drawnWidth}px`}
1621
1619
  @wheel=${this.#c}
1622
1620
  >
1623
- <slot name=${e.side} @slotchange=${n=>this.#k(e,n)}></slot>
1624
- </div>`}#c=e=>{e.currentTarget instanceof HTMLElement&&$p(e.currentTarget,e)&&e.preventDefault()};#p(e){if(!e.filled)return b;const n=e.layout(),s=this.#r(e),i=this.#o(e);if(s==="stack")return i?k`<div part="bar" class="bar" data-side=${e.side}>${this.#h(e,i)}</div>`:b;if(i||s==="drawer")return n.collapsible?this.#h(e,i,!0):b;const o=n.collapsible?this.#h(e,i):b,a=n.resizable?this.#f(e):b;return e.side==="left"?k`${a}${o}`:k`${o}${a}`}#h(e,n,s=!1){const i=Va(this.#e.locale),r=_f(e.side,n),o=r.action==="collapse"?i.collapseSidebar:i.expandSidebar;return k`<button
1621
+ <slot name=${e.side} @slotchange=${n=>this.#p(e,n)}></slot>
1622
+ </div>`}#c=e=>{e.currentTarget instanceof HTMLElement&&gp(e.currentTarget,e)&&e.preventDefault()};#u(e){if(!e.filled)return b;const n=e.layout(),s=this.#r(e),i=this.#o(e);if(s==="stack")return i?m`<div part="bar" class="bar" data-side=${e.side}>${this.#h(e,i)}</div>`:b;if(i||s==="drawer")return n.collapsible?this.#h(e,i,!0):b;const o=n.collapsible?this.#h(e,i):b,a=n.resizable?this.#k(e):b;return e.side==="left"?m`${a}${o}`:m`${o}${a}`}#h(e,n,s=!1){const i=ja(this.#e.locale),r=Df(e.side,n),o=r.action==="collapse"?i.collapseSidebar:i.expandSidebar;return m`<button
1625
1623
  part="toggle"
1626
1624
  class="toggle"
1627
1625
  type="button"
@@ -1635,8 +1633,8 @@ The brief is too long for a comment, so it is stored in this artifact's database
1635
1633
  title=${o}
1636
1634
  @click=${()=>{this.#i=e.side,this.#a(e)}}
1637
1635
  >
1638
- ${r.points==="left"?Ia():Gt()}
1639
- </button>`}#f(e){const n=Va(this.#e.locale),s=e.width.handlers;return k`<div
1636
+ ${r.points==="left"?_a():Bt()}
1637
+ </button>`}#k(e){const n=ja(this.#e.locale),s=e.width.handlers;return m`<div
1640
1638
  part="resizer"
1641
1639
  class="resizer"
1642
1640
  role="separator"
@@ -1646,8 +1644,8 @@ The brief is too long for a comment, so it is stored in this artifact's database
1646
1644
  aria-orientation="vertical"
1647
1645
  aria-controls=${`sidebar-${e.side}`}
1648
1646
  aria-label=${n.resizeSidebar}
1649
- aria-valuemin=${$e.min}
1650
- aria-valuemax=${$e.max}
1647
+ aria-valuemin=${xe.min}
1648
+ aria-valuemax=${xe.max}
1651
1649
  aria-valuenow=${e.width.width}
1652
1650
  title=${n.resizeSidebarHint}
1653
1651
  @pointerdown=${s.pointerdown}
@@ -1656,38 +1654,38 @@ The brief is too long for a comment, so it is stored in this artifact's database
1656
1654
  @pointercancel=${s.pointercancel}
1657
1655
  @keydown=${s.keydown}
1658
1656
  @dblclick=${s.dblclick}
1659
- ></div>`}#k(e,n){if(!(n.target instanceof HTMLSlotElement))return;const s=n.target.assignedNodes({flatten:!0}).length>0;s!==e.filled&&(e.filled=s,this.requestUpdate())}#y=e=>{if(!(e.target instanceof HTMLSlotElement))return;const n=e.target.assignedNodes({flatten:!0}).length>0;n!==this.#n&&(this.#n=n,this.requestUpdate())}}const Uf=()=>{customElements.get("dpk-internal-layout-sidebar")||customElements.define("dpk-internal-layout-sidebar",qf)},Hf=()=>{Sf(),Uf()},Kn="@",mt=Object.freeze({type:ni,id:"app"}),mi=/^[A-Za-z0-9_-]+$/,Se=t=>t.type===mt.type&&t.id===mt.id,Fe=t=>{const e=t.id.lastIndexOf(Kn);if(e<0)return null;const n=t.id.slice(e+1);return mi.test(n)?{page:n,target:{type:t.type,id:t.id.slice(0,e)}}:null},Za=(t,e)=>({type:t.type,id:`${t.id}${Kn}${e}`}),Qa=(t,e,n)=>{if(Se(t))return t;const s=Fe(t);return s!==null&&n.has(s.page)?t:Za(t,e)},kt=(t,e)=>`${t}${Kn}${e}`,Vn="dpk-page",Xa="dpk-app",bt="name",vt="data-dpk-draft-page",jf=t=>t.hasAttribute(vt)||t.parentElement?.hasAttribute(vt)===!0,Yn=Symbol.for("dev-process-kit.page-host"),Ja=t=>{const e=t.getAttribute(bt);return e!==null&&mi.test(e)?e:null},Bf=t=>Yn in t,el=t=>{if(!Bf(t))return null;const e=t[Yn];return Kf(e)?e:null},ki=t=>{const e=t.parentElement;return e?.localName===Vn?Ja(e):null},Ff=t=>t.parentElement?.localName===Xa?Ja(t):null,tl=t=>{const e=t.parentElement;return e===null||e.localName!==Vn?null:el(e)},Gf=t=>{const e=t.parentElement;if(e===null||e.localName!==Vn)return null;const n=Reflect.get(e,"delivered");return n instanceof Promise?n:null},Wf=t=>{const e=t.parentElement;return e===null||e.localName!==Xa?null:el(e)},Kf=t=>typeof t=="object"&&t!==null&&"dispatch"in t&&"navigation"in t,Ae="page",Zn=t=>`${t}.`,Ge=(t,e)=>{const n=Zn(e),s={};for(const[i,r]of Object.entries(t))i.startsWith(n)&&(s[i.slice(n.length)]=r);return s},nl=(t,e)=>Object.fromEntries(Object.entries(e).map(([n,s])=>[`${Zn(t)}${n}`,s])),Vf=(t,e,n,s,i=[])=>{const r={},o={};for(const[d,h]of Object.entries(n)){const f=d.indexOf(".");d===Ae||f>0&&s.has(d.slice(0,f))?r[d]=h:o[d]=h}if(Object.keys(o).length===0)return r;const a=Ge(t,e),l=yn(a,o,i),c={...r};for(const d of Object.keys(a))Object.hasOwn(l,d)||(c[`${Zn(e)}${d}`]=null);for(const[d,h]of Object.entries(l))c[`${Zn(e)}${d}`]=h;return c};class Qn{#e;#s=new Map;constructor(e){this.#e=e,e.addController(this)}hostConnected(){this.#e.requestUpdate()}hostUpdated(){for(const[e,n]of this.#s)e.isConnected||(n(),this.#s.delete(e))}hostDisconnected(){for(const e of this.#s.values())e();this.#s.clear()}open(e,n,s,i){this.#s.get(e)?.(),this.#s.set(e,Gs(e,n,s,i))}}const bi=(t,e)=>e===0?-1:Math.min(Math.max(t,0),e-1),Yf=(t,e,n)=>n===0?-1:t<0?e>0?0:n-1:(t+e+n)%n,Xn=(t,e)=>t.findIndex(n=>n.value===e),Zf=(t,e,n)=>{const s=e.trim().toLowerCase();if(s===""||t.length===0)return null;for(let i=1;i<=t.length;i+=1){const r=(n+i)%t.length;if(t[r]?.label.toLowerCase().startsWith(s))return r}return null};let Qf=0;const Xf=500;class Kt{#e;#s=`dpk-select-${++Qf}`;#t;#n=!1;#i=-1;#r="";#o;#a=null;constructor(e){this.#e=e,this.#t=new Qn(e),new pn(e,{open:()=>this.#n,closesOn:n=>!n.some(s=>s instanceof Element&&s.getAttribute("data-dpk-select")===this.#s),ownsEscape:()=>this.#n,dismiss:()=>this.#k()}),e.addController(this)}hostConnected(){}hostUpdated(){this.#y()}hostDisconnected(){clearTimeout(this.#o)}render(e){this.#a=e;const n=bi(this.#i,e.options.length),i=e.options.find(o=>o.value===e.value)?.label??e.placeholder??"",r=this.#n?e.options[n]:void 0;return k`
1657
+ ></div>`}#p(e,n){if(!(n.target instanceof HTMLSlotElement))return;const s=n.target.assignedNodes({flatten:!0}).length>0;s!==e.filled&&(e.filled=s,this.requestUpdate())}#x=e=>{if(!(e.target instanceof HTMLSlotElement))return;const n=e.target.assignedNodes({flatten:!0}).length>0;n!==this.#t&&(this.#t=n,this.requestUpdate())}}const Kf=()=>{customElements.get("dpk-internal-layout-sidebar")||customElements.define("dpk-internal-layout-sidebar",Wf)},Vf=()=>{Of(),Kf()},Hn="@",Ue=Object.freeze({type:Zs,id:"app"}),hi=/^[A-Za-z0-9_-]+$/,we=t=>t.type===Ue.type&&t.id===Ue.id,He=t=>{const e=t.id.lastIndexOf(Hn);if(e<0)return null;const n=t.id.slice(e+1);return hi.test(n)?{page:n,target:{type:t.type,id:t.id.slice(0,e)}}:null},Ga=(t,e)=>({type:t.type,id:`${t.id}${Hn}${e}`}),Wa=(t,e,n)=>{if(we(t))return t;const s=He(t);return s!==null&&n.has(s.page)?t:Ga(t,e)},ht=(t,e)=>`${t}${Hn}${e}`,Bn="dpk-page",Ka="dpk-app",ut="name",gt="data-dpk-draft-page",Yf=t=>t.hasAttribute(gt)||t.parentElement?.hasAttribute(gt)===!0,jn=Symbol.for("dev-process-kit.page-host"),Va=t=>{const e=t.getAttribute(ut);return e!==null&&hi.test(e)?e:null},Zf=t=>jn in t,Ya=t=>{if(!Zf(t))return null;const e=t[jn];return em(e)?e:null},ui=t=>{const e=t.parentElement;return e?.localName===Bn?Va(e):null},Qf=t=>t.parentElement?.localName===Ka?Va(t):null,Za=t=>{const e=t.parentElement;return e===null||e.localName!==Bn?null:Ya(e)},Xf=t=>{const e=t.parentElement;if(e===null||e.localName!==Bn)return null;const n=Reflect.get(e,"delivered");return n instanceof Promise?n:null},Jf=t=>{const e=t.parentElement;return e===null||e.localName!==Ka?null:Ya(e)},em=t=>typeof t=="object"&&t!==null&&"dispatch"in t&&"navigation"in t,ye="page",Fn=t=>`${t}.`,Be=(t,e)=>{const n=Fn(e),s={};for(const[i,r]of Object.entries(t))i.startsWith(n)&&(s[i.slice(n.length)]=r);return s},Qa=(t,e)=>Object.fromEntries(Object.entries(e).map(([n,s])=>[`${Fn(t)}${n}`,s])),tm=(t,e,n,s,i=[])=>{const r={},o={};for(const[h,d]of Object.entries(n)){const f=h.indexOf(".");h===ye||f>0&&s.has(h.slice(0,f))?r[h]=d:o[h]=d}if(Object.keys(o).length===0)return r;const a=Be(t,e),l=gn(a,o,i),p={...r};for(const h of Object.keys(a))Object.hasOwn(l,h)||(p[`${Fn(e)}${h}`]=null);for(const[h,d]of Object.entries(l))p[`${Fn(e)}${h}`]=d;return p};class Gn{#e;#n=new Map;constructor(e){this.#e=e,e.addController(this)}hostConnected(){this.#e.requestUpdate()}hostUpdated(){for(const[e,n]of this.#n)e.isConnected||(n(),this.#n.delete(e))}hostDisconnected(){for(const e of this.#n.values())e();this.#n.clear()}open(e,n,s,i){this.#n.get(e)?.(),this.#n.set(e,Ns(e,n,s,i))}}const gi=(t,e)=>e===0?-1:Math.min(Math.max(t,0),e-1),nm=(t,e,n)=>n===0?-1:t<0?e>0?0:n-1:(t+e+n)%n,Wn=(t,e)=>t.findIndex(n=>n.value===e),sm=(t,e,n)=>{const s=e.trim().toLowerCase();if(s===""||t.length===0)return null;for(let i=1;i<=t.length;i+=1){const r=(n+i)%t.length;if(t[r]?.label.toLowerCase().startsWith(s))return r}return null};let im=0;const rm=500;class Ft{#e;#n=`dpk-select-${++im}`;#s;#t=!1;#i=-1;#r="";#o;#a=null;constructor(e){this.#e=e,this.#s=new Gn(e),new cn(e,{open:()=>this.#t,closesOn:n=>!n.some(s=>s instanceof Element&&s.getAttribute("data-dpk-select")===this.#n),ownsEscape:()=>this.#t,dismiss:()=>this.#p()}),e.addController(this)}hostConnected(){}hostUpdated(){this.#x()}hostDisconnected(){clearTimeout(this.#o)}render(e){this.#a=e;const n=gi(this.#i,e.options.length),i=e.options.find(o=>o.value===e.value)?.label??e.placeholder??"",r=this.#t?e.options[n]:void 0;return m`
1660
1658
  <button
1661
1659
  type="button"
1662
1660
  class="dpk-rich-select ${e.className??""}"
1663
- data-dpk-select=${this.#s}
1661
+ data-dpk-select=${this.#n}
1664
1662
  ?disabled=${e.disabled??!1}
1665
1663
  aria-haspopup="listbox"
1666
- aria-expanded=${this.#n?"true":"false"}
1664
+ aria-expanded=${this.#t?"true":"false"}
1667
1665
  aria-controls=${this.#l}
1668
1666
  aria-label=${e.ariaLabel}
1669
1667
  aria-activedescendant=${r?this.#d(r.value):b}
1670
1668
  @click=${this.#h}
1671
- @keydown=${o=>this.#p(o,e)}
1669
+ @keydown=${o=>this.#u(o,e)}
1672
1670
  @focus=${()=>e.onActivate?.()}
1673
1671
  @pointerenter=${()=>e.onActivate?.()}
1674
1672
  >
1675
1673
  <span class="dpk-rich-select-label">${i}</span>
1676
- <span class="dpk-rich-select-chevron" aria-hidden="true" data-open=${this.#n?"true":"false"}>
1677
- ${Na()}
1674
+ <span class="dpk-rich-select-chevron" aria-hidden="true" data-open=${this.#t?"true":"false"}>
1675
+ ${Pa()}
1678
1676
  </span>
1679
1677
  </button>
1680
- ${this.#n?this.#c(e,n):b}
1681
- `}get#l(){return`${this.#s}-listbox`}#d(e){return`${this.#s}-option-${encodeURIComponent(e)}`}#c(e,n){return k`
1678
+ ${this.#t?this.#c(e,n):b}
1679
+ `}get#l(){return`${this.#n}-listbox`}#d(e){return`${this.#n}-option-${encodeURIComponent(e)}`}#c(e,n){return m`
1682
1680
  <div
1683
1681
  class="dpk-rich-select-listbox"
1684
1682
  popover="manual"
1685
1683
  role="listbox"
1686
1684
  id=${this.#l}
1687
- data-dpk-select=${this.#s}
1685
+ data-dpk-select=${this.#n}
1688
1686
  aria-label=${e.ariaLabel}
1689
1687
  >
1690
- ${e.options.map((s,i)=>k`
1688
+ ${e.options.map((s,i)=>m`
1691
1689
  <div
1692
1690
  class="dpk-rich-select-option"
1693
1691
  role="option"
@@ -1696,57 +1694,57 @@ The brief is too long for a comment, so it is stored in this artifact's database
1696
1694
  aria-selected=${s.value===e.value?"true":"false"}
1697
1695
  data-active=${i===n?"true":"false"}
1698
1696
  @mousedown=${r=>r.preventDefault()}
1699
- @click=${()=>this.#f(s.value,e)}
1697
+ @click=${()=>this.#k(s.value,e)}
1700
1698
  >
1701
1699
  <span class="dpk-rich-select-option-label">${s.label}</span>
1702
- ${s.value===e.value?k`<span class="dpk-rich-select-check" aria-hidden="true">${pt()}</span>`:b}
1700
+ ${s.value===e.value?m`<span class="dpk-rich-select-check" aria-hidden="true">${at()}</span>`:b}
1703
1701
  </div>
1704
1702
  `)}
1705
1703
  </div>
1706
- `}#p(e,n){if(n.disabled)return;if(e.key==="ArrowDown"||e.key==="ArrowUp"){e.preventDefault();const r=e.key==="ArrowDown"?1:-1;if(this.#n)this.#i=Yf(this.#i,r,n.options.length);else{this.#n=!0;const o=Xn(n.options,n.value);this.#i=o>=0?o:bi(r>0?0:n.options.length-1,n.options.length)}this.#e.requestUpdate();return}if(e.key==="Enter"||e.key===" "){if(e.preventDefault(),!this.#n){this.#n=!0,this.#i=Xn(n.options,n.value),this.#e.requestUpdate();return}const r=n.options[bi(this.#i,n.options.length)];r&&this.#f(r.value,n);return}if(e.key==="Tab"||e.ctrlKey||e.metaKey||e.altKey||e.key.length!==1)return;e.preventDefault(),this.#r+=e.key,clearTimeout(this.#o),this.#o=setTimeout(()=>{this.#r=""},Xf);const s=this.#n?this.#i:Xn(n.options,n.value),i=Zf(n.options,this.#r,s);if(i!==null){if(this.#i=i,!this.#n){const r=n.options[i]?.value;r!==void 0&&this.#f(r,n);return}this.#e.requestUpdate()}}#h=()=>{if(this.#a?.disabled)return;if(this.#n){this.#k();return}const e=this.#a;this.#n=!0,this.#i=e?Xn(e.options,e.value):-1,this.#e.requestUpdate()};#f(e,n){this.#k(),e!==n.value&&n.onChange(e)}#k(){this.#n&&(this.#n=!1,this.#i=-1,this.#e.requestUpdate())}#y(){const e=`[data-dpk-select="${this.#s}"]`,n=this.#e.renderRoot.querySelector(`button.dpk-rich-select${e}`),s=this.#e.renderRoot.querySelector(`.dpk-rich-select-listbox${e}`);!n||!s||this.#t.open(s,n,{width:Math.max(n.offsetWidth,160),height:280},{placement:"bottom-start"})}}class Jf{#e;#s=new Map;constructor(e){this.#e=e}get(e){const n=this.#s.get(e);if(n)return n;const s=new Kt(this.#e);return this.#s.set(e,s),s}}const me="0.3.2",vi=t=>{const e=t.derivation();return{base:e.base,state:e.state,navigation:t.navigation(),actions:t.controller().actions,comments:e.comments,stale:e.stale,issues:t.issues(),grill:e.grill,answers:e.answers}},em=t=>{const e=t.derivation();return{state:e.state,base:e.base,navigation:t.navigation(),actions:t.controller().actions,comments:e.comments,stale:e.stale,commentCount:n=>{const s=typeof n=="string"?n:P(n);return e.commentsByTarget.get(s)?.length??0},dispatch:n=>t.dispatch(n),dispatchBatch:n=>t.dispatchBatch(n),navigate:(n,s)=>t.navigate(n,s),hashFor:n=>t.hashFor(n),requestComment:n=>t.requestComment(n)}},sl=(t,e)=>{const n=()=>vi(t);return{version:me,template:t.definition.name,host:e,ready:t.ready,get base(){return t.controller().base},get state(){return t.derivation().state},get navigation(){return t.navigation()},get actions(){return t.controller().actions},get comments(){return t.derivation().comments},get stale(){return t.derivation().stale},get issues(){return t.issues()},dispatch:s=>t.dispatch(s),dispatchBatch:s=>t.dispatchBatch(s),comment:(s,i)=>t.dispatch({type:H,target:s,payload:{body:i}}),editComment:(s,i)=>t.editComment(s,i),removeAction:s=>t.removeAction(s),clearActions:()=>t.clearActions(),importDraft:s=>t.controller().replaceActions(s),navigate:(s,i)=>t.navigate(s,i),hashFor:s=>t.hashFor(s),snapshot:n,exportDraft:()=>t.controller().exportDraft(me),exportBrief:()=>t.brief?.(n())??Hn(n(),t.controller().definition,me),subscribe:s=>t.subscribe(s)}},tm='the <script type="application/json"> child is empty',nm='no <script type="application/json"> child found';class sm{#e;#s;#t=null;#n;constructor(e){this.#e=e}get error(){return this.#t}read(){return this.#o(this.#r()).state}observe(){this.#n===void 0&&(this.#n=new MutationObserver(()=>this.#i()),this.#n.observe(this.#e.host,{childList:!0,subtree:!0,characterData:!0}))}disconnect(){this.#n?.disconnect(),this.#n=void 0}#i(){const e=this.#r();e!==this.#s&&this.#e.onChange(this.#o(e))}#r(){const e=this.#e.script();return e===null?null:e.textContent??""}#o(e){if(this.#s=e,e===null||e.trim().length===0)return this.#e.optional()?this.#t=null:(this.#t=e===null?nm:tm,console.warn(`[dev-process-kit] ${this.#e.name()} has ${e===null?"no":"an empty"} base JSON; starting from an empty state.`)),{state:this.#e.empty(),error:this.#t};try{const n=this.#e.parse(JSON.parse(e));return this.#t=null,{state:n,error:null}}catch(n){return console.error("[dev-process-kit] invalid base data:",n),this.#t=n instanceof Error?n.message:String(n),{state:this.#e.empty(),error:this.#t}}}}const im=8e3,rm=t=>t.localName==="script"&&t.getAttribute("type")==="application/json"&&t.hasAttribute(eo);class om{#e;#s;#t=null;#n=null;#i=!1;#r=null;#o=null;#a="";#l=null;#d=new Map;#c=new Set;constructor(e,n){this.#e=e,this.#s=n,e.addController(this)}get view(){return this.#t&&this.#r?Yp(this.#t,this.#r):null}get log(){return this.#t}get error(){return this.#n}hostConnected(){!this.#h()&&!this.#f()&&this.#x(),document.addEventListener("pointerdown",this.#w,!0),document.addEventListener("keydown",this.#$)}hostUpdate(){!this.#h()&&this.#f()&&this.#v()}hostDisconnected(){this.#v(),document.removeEventListener("pointerdown",this.#w,!0),document.removeEventListener("keydown",this.#$);for(const e of this.#d.values())e.handle!==null&&clearTimeout(e.handle);this.#d.clear()}send(e){!this.#t||!this.#r||(this.#r=Fp(this.#t,this.#r,e),this.#k(),this.#g(),this.#e.requestUpdate())}toggleList(){this.send({kind:this.#r?.list.open?"close-list":"open-list"})}show(e){const n=this.#t?st(this.#t).flatMap(s=>s.entries).find(s=>s.key===e):void 0;n&&(this.send({kind:"jump",key:e}),this.#s.show(n))}pause(e){const n=this.#c.size>0;if(this.#c.add(e),n)return;const s=Date.now();for(const i of this.#d.values())i.handle!==null&&clearTimeout(i.handle),i.handle=null,i.remaining=Math.max(0,i.deadline-s)}resume(e){if(!(!this.#c.delete(e)||this.#c.size>0))for(const[n,s]of this.#d)this.#m(n,s)}#p(){return`${this.#s.storageKey()}:seen-changes`}#h(){return this.#t!==null||this.#n!==null||this.#i}#f(){const e=[...this.#e.children].find(rm);if(!e)return!1;if(this.#s.ignored?.()===!0)return console.warn("[dev-process-kit] a change log inside <dpk-page> is ignored: put it directly under <dpk-app>, qualify its targets with the page (`story:x@demo`) and prefix its navigate keys (`demo.step=\u2026`)."),this.#i=!0,!0;let n;try{n=JSON.parse(e.textContent??"")}catch(i){return this.#y(i instanceof Error?i.message:String(i))}const s=Up(n);return s.ok?(this.#t=s.log,this.#o=this.#s.persist()?fe(no):X(no),this.#r=Bp(s.log,this.#o.read(this.#p())),this.#k(),this.#g(),this.#e.requestUpdate(),!0):this.#y(s.error)}#k(){if(!this.#t||!this.#r)return;const e=Wp(this.#t,this.#r),n=JSON.stringify(e);n!==this.#a&&(this.#a=n,this.#o?.write(this.#p(),e))}#y(e){return console.error("[dev-process-kit] invalid change log:",e),this.#n=e,this.#e.requestUpdate(),!0}#x(){this.#l=new MutationObserver(()=>{(this.#h()||this.#f())&&this.#v()}),this.#l.observe(this.#e,{childList:!0})}#v(){this.#l?.disconnect(),this.#l=null}#g(){const e=new Set(this.view?.toasts.map(n=>n.key)??[]);for(const[n,s]of this.#d)e.has(n)||(s.handle!==null&&clearTimeout(s.handle),this.#d.delete(n));for(const n of e){if(this.#d.has(n))continue;const s={handle:null,deadline:0,remaining:im};this.#d.set(n,s),this.#c.size===0&&this.#m(n,s)}}#m(e,n){n.deadline=Date.now()+n.remaining,n.handle=setTimeout(()=>{n.handle=null,this.send({kind:"close-toast",key:e})},n.remaining)}#w=e=>{!this.#r?.list.open||this.#s.inside(e.composedPath())||this.send({kind:"close-list"})};#$=e=>{e.key!=="Escape"||!this.#r?.list.open||this.send({kind:"close-list"})}}const{I:am}=np,il=t=>t,lm=t=>t.strings===void 0,rl=()=>document.createComment(""),Vt=(t,e,n)=>{const s=t._$AA.parentNode,i=e===void 0?t._$AB:e._$AA;if(n===void 0){const r=s.insertBefore(rl(),i),o=s.insertBefore(rl(),i);n=new am(r,o,t,t.options)}else{const r=n._$AB.nextSibling,o=n._$AM,a=o!==t;if(a){let l;n._$AQ?.(t),n._$AM=t,n._$AP!==void 0&&(l=t._$AU)!==o._$AU&&n._$AP(l)}if(r!==i||a){let l=n._$AA;for(;l!==r;){const c=il(l).nextSibling;il(s).insertBefore(l,i),l=c}}}return n},We=(t,e,n=t)=>(t._$AI(e,n),t),dm={},xi=(t,e=dm)=>t._$AH=e,cm=t=>t._$AH,yi=t=>{t._$AR(),t._$AA.remove()},ol=(t,e,n)=>{const s=new Map;for(let i=e;i<=n;i++)s.set(t[i],i);return s},Ke=Ft(class extends jn{constructor(t){if(super(t),t.type!==we.CHILD)throw Error("repeat() can only be used in text expressions")}dt(t,e,n){let s;n===void 0?n=e:e!==void 0&&(s=e);const i=[],r=[];let o=0;for(const a of t)i[o]=s?s(a,o):o,r[o]=n(a,o),o++;return{values:r,keys:i}}render(t,e,n){return this.dt(t,e,n).values}update(t,[e,n,s]){const i=cm(t),{values:r,keys:o}=this.dt(e,n,s);if(!Array.isArray(i))return this.ut=o,r;const a=this.ut??=[],l=[];let c,d,h=0,f=i.length-1,p=0,g=r.length-1;for(;h<=f&&p<=g;)if(i[h]===null)h++;else if(i[f]===null)f--;else if(a[h]===o[p])l[p]=We(i[h],r[p]),h++,p++;else if(a[f]===o[g])l[g]=We(i[f],r[g]),f--,g--;else if(a[h]===o[g])l[g]=We(i[h],r[g]),Vt(t,l[g+1],i[h]),h++,g--;else if(a[f]===o[p])l[p]=We(i[f],r[p]),Vt(t,i[h],i[f]),f--,p++;else if(c===void 0&&(c=ol(o,p,g),d=ol(a,h,f)),c.has(a[h]))if(c.has(a[f])){const u=d.get(o[p]),m=u!==void 0?i[u]:null;if(m===null){const x=Vt(t,i[h]);We(x,r[p]),l[p]=x}else l[p]=We(m,r[p]),Vt(t,i[h],m),i[u]=null;p++}else yi(i[f]),f--;else yi(i[h]),h++;for(;p<=g;){const u=Vt(t,l[g+1]);We(u,r[p]),l[p++]=u}for(;h<=f;){const u=i[h++];u!==null&&yi(u)}return this.ut=o,xi(t,l),Z}}),Jn="dpk-changes",pm=(t,e,n)=>{const s=t.unread>0?e.changesUnread(t.unread):e.changes;return k`<button
1704
+ `}#u(e,n){if(n.disabled)return;if(e.key==="ArrowDown"||e.key==="ArrowUp"){e.preventDefault();const r=e.key==="ArrowDown"?1:-1;if(this.#t)this.#i=nm(this.#i,r,n.options.length);else{this.#t=!0;const o=Wn(n.options,n.value);this.#i=o>=0?o:gi(r>0?0:n.options.length-1,n.options.length)}this.#e.requestUpdate();return}if(e.key==="Enter"||e.key===" "){if(e.preventDefault(),!this.#t){this.#t=!0,this.#i=Wn(n.options,n.value),this.#e.requestUpdate();return}const r=n.options[gi(this.#i,n.options.length)];r&&this.#k(r.value,n);return}if(e.key==="Tab"||e.ctrlKey||e.metaKey||e.altKey||e.key.length!==1)return;e.preventDefault(),this.#r+=e.key,clearTimeout(this.#o),this.#o=setTimeout(()=>{this.#r=""},rm);const s=this.#t?this.#i:Wn(n.options,n.value),i=sm(n.options,this.#r,s);if(i!==null){if(this.#i=i,!this.#t){const r=n.options[i]?.value;r!==void 0&&this.#k(r,n);return}this.#e.requestUpdate()}}#h=()=>{if(this.#a?.disabled)return;if(this.#t){this.#p();return}const e=this.#a;this.#t=!0,this.#i=e?Wn(e.options,e.value):-1,this.#e.requestUpdate()};#k(e,n){this.#p(),e!==n.value&&n.onChange(e)}#p(){this.#t&&(this.#t=!1,this.#i=-1,this.#e.requestUpdate())}#x(){const e=`[data-dpk-select="${this.#n}"]`,n=this.#e.renderRoot.querySelector(`button.dpk-rich-select${e}`),s=this.#e.renderRoot.querySelector(`.dpk-rich-select-listbox${e}`);!n||!s||this.#s.open(s,n,{width:Math.max(n.offsetWidth,160),height:280},{placement:"bottom-start"})}}class om{#e;#n=new Map;constructor(e){this.#e=e}get(e){const n=this.#n.get(e);if(n)return n;const s=new Ft(this.#e);return this.#n.set(e,s),s}}const ge="0.4.0",fi=t=>{const e=t.derivation();return{base:e.base,state:e.state,navigation:t.navigation(),actions:t.controller().actions,comments:e.comments,stale:e.stale,issues:t.issues(),grill:e.grill,answers:e.answers}},am=t=>{const e=t.derivation();return{state:e.state,base:e.base,navigation:t.navigation(),actions:t.controller().actions,comments:e.comments,stale:e.stale,commentCount:n=>{const s=typeof n=="string"?n:_(n);return e.commentsByTarget.get(s)?.length??0},dispatch:n=>t.dispatch(n),dispatchBatch:n=>t.dispatchBatch(n),navigate:(n,s)=>t.navigate(n,s),hashFor:n=>t.hashFor(n),requestComment:n=>t.requestComment(n)}},Xa=(t,e)=>{const n=()=>fi(t);return{version:ge,template:t.definition.name,host:e,ready:t.ready,get base(){return t.controller().base},get state(){return t.derivation().state},get navigation(){return t.navigation()},get actions(){return t.controller().actions},get comments(){return t.derivation().comments},get stale(){return t.derivation().stale},get issues(){return t.issues()},dispatch:s=>t.dispatch(s),dispatchBatch:s=>t.dispatchBatch(s),comment:(s,i)=>t.dispatch({type:D,target:s,payload:{body:i}}),editComment:(s,i)=>t.editComment(s,i),removeAction:s=>t.removeAction(s),clearActions:()=>t.clearActions(),importDraft:s=>t.controller().replaceActions(s),navigate:(s,i)=>t.navigate(s,i),hashFor:s=>t.hashFor(s),snapshot:n,exportDraft:()=>t.controller().exportDraft(ge),exportBrief:()=>t.brief?.(n())??zn(n(),t.controller().definition,ge),subscribe:s=>t.subscribe(s)}},lm='the <script type="application/json"> child is empty',dm='no <script type="application/json"> child found';class cm{#e;#n;#s=null;#t;constructor(e){this.#e=e}get error(){return this.#s}read(){return this.#o(this.#r()).state}observe(){this.#t===void 0&&(this.#t=new MutationObserver(()=>this.#i()),this.#t.observe(this.#e.host,{childList:!0,subtree:!0,characterData:!0}))}disconnect(){this.#t?.disconnect(),this.#t=void 0}#i(){const e=this.#r();e!==this.#n&&this.#e.onChange(this.#o(e))}#r(){const e=this.#e.script();return e===null?null:e.textContent??""}#o(e){if(this.#n=e,e===null||e.trim().length===0)return this.#e.optional()?this.#s=null:(this.#s=e===null?dm:lm,console.warn(`[dev-process-kit] ${this.#e.name()} has ${e===null?"no":"an empty"} base JSON; starting from an empty state.`)),{state:this.#e.empty(),error:this.#s};try{const n=this.#e.parse(JSON.parse(e));return this.#s=null,{state:n,error:null}}catch(n){return console.error("[dev-process-kit] invalid base data:",n),this.#s=n instanceof Error?n.message:String(n),{state:this.#e.empty(),error:this.#s}}}}const pm=8e3,hm=t=>t.localName==="script"&&t.getAttribute("type")==="application/json"&&t.hasAttribute(Fr);class um{#e;#n;#s=null;#t=null;#i=!1;#r=null;#o=null;#a="";#l=null;#d=new Map;#c=new Set;constructor(e,n){this.#e=e,this.#n=n,e.addController(this)}get view(){return this.#s&&this.#r?Wp(this.#s,this.#r):null}get log(){return this.#s}get error(){return this.#t}hostConnected(){!this.#h()&&!this.#k()&&this.#A(),document.addEventListener("pointerdown",this.#m,!0),document.addEventListener("keydown",this.#S)}hostUpdate(){!this.#h()&&this.#k()&&this.#v()}hostDisconnected(){this.#v(),document.removeEventListener("pointerdown",this.#m,!0),document.removeEventListener("keydown",this.#S);for(const e of this.#d.values())e.handle!==null&&clearTimeout(e.handle);this.#d.clear()}send(e){!this.#s||!this.#r||(this.#r=Hp(this.#s,this.#r,e),this.#p(),this.#f(),this.#e.requestUpdate())}toggleList(){this.send({kind:this.#r?.list.open?"close-list":"open-list"})}show(e){const n=this.#s?Xe(this.#s).flatMap(s=>s.entries).find(s=>s.key===e):void 0;n&&(this.send({kind:"jump",key:e}),this.#n.show(n))}pause(e){const n=this.#c.size>0;if(this.#c.add(e),n)return;const s=Date.now();for(const i of this.#d.values())i.handle!==null&&clearTimeout(i.handle),i.handle=null,i.remaining=Math.max(0,i.deadline-s)}resume(e){if(!(!this.#c.delete(e)||this.#c.size>0))for(const[n,s]of this.#d)this.#w(n,s)}#u(){return`${this.#n.storageKey()}:seen-changes`}#h(){return this.#s!==null||this.#t!==null||this.#i}#k(){const e=[...this.#e.children].find(hm);if(!e)return!1;if(this.#n.ignored?.()===!0)return console.warn("[dev-process-kit] a change log inside <dpk-page> is ignored: put it directly under <dpk-app>, qualify its targets with the page (`story:x@demo`) and prefix its navigate keys (`demo.step=\u2026`)."),this.#i=!0,!0;let n;try{n=JSON.parse(e.textContent??"")}catch(i){return this.#x(i instanceof Error?i.message:String(i))}const s=Dp(n);return s.ok?(this.#s=s.log,this.#o=this.#n.persist()?ue(Kr):Z(Kr),this.#r=Up(s.log,this.#o.read(this.#u())),this.#p(),this.#f(),this.#n.read?.(s.log),this.#e.requestUpdate(),!0):this.#x(s.error)}#p(){if(!this.#s||!this.#r)return;const e=jp(this.#s,this.#r),n=JSON.stringify(e);n!==this.#a&&(this.#a=n,this.#o?.write(this.#u(),e))}#x(e){return console.error("[dev-process-kit] invalid change log:",e),this.#t=e,this.#e.requestUpdate(),!0}#A(){this.#l=new MutationObserver(()=>{(this.#h()||this.#k())&&this.#v()}),this.#l.observe(this.#e,{childList:!0})}#v(){this.#l?.disconnect(),this.#l=null}#f(){const e=new Set(this.view?.toasts.map(n=>n.key)??[]);for(const[n,s]of this.#d)e.has(n)||(s.handle!==null&&clearTimeout(s.handle),this.#d.delete(n));for(const n of e){if(this.#d.has(n))continue;const s={handle:null,deadline:0,remaining:pm};this.#d.set(n,s),this.#c.size===0&&this.#w(n,s)}}#w(e,n){n.deadline=Date.now()+n.remaining,n.handle=setTimeout(()=>{n.handle=null,this.send({kind:"close-toast",key:e})},n.remaining)}#m=e=>{!this.#r?.list.open||this.#n.inside(e.composedPath())||this.send({kind:"close-list"})};#S=e=>{e.key!=="Escape"||!this.#r?.list.open||this.send({kind:"close-list"})}}const{I:gm}=dp,Ja=t=>t,fm=t=>t.strings===void 0,el=()=>document.createComment(""),Gt=(t,e,n)=>{const s=t._$AA.parentNode,i=e===void 0?t._$AB:e._$AA;if(n===void 0){const r=s.insertBefore(el(),i),o=s.insertBefore(el(),i);n=new gm(r,o,t,t.options)}else{const r=n._$AB.nextSibling,o=n._$AM,a=o!==t;if(a){let l;n._$AQ?.(t),n._$AM=t,n._$AP!==void 0&&(l=t._$AU)!==o._$AU&&n._$AP(l)}if(r!==i||a){let l=n._$AA;for(;l!==r;){const p=Ja(l).nextSibling;Ja(s).insertBefore(l,i),l=p}}}return n},je=(t,e,n=t)=>(t._$AI(e,n),t),mm={},mi=(t,e=mm)=>t._$AH=e,km=t=>t._$AH,ki=t=>{t._$AR(),t._$AA.remove()},tl=(t,e,n)=>{const s=new Map;for(let i=e;i<=n;i++)s.set(t[i],i);return s},Fe=Ht(class extends In{constructor(t){if(super(t),t.type!==ve.CHILD)throw Error("repeat() can only be used in text expressions")}dt(t,e,n){let s;n===void 0?n=e:e!==void 0&&(s=e);const i=[],r=[];let o=0;for(const a of t)i[o]=s?s(a,o):o,r[o]=n(a,o),o++;return{values:r,keys:i}}render(t,e,n){return this.dt(t,e,n).values}update(t,[e,n,s]){const i=km(t),{values:r,keys:o}=this.dt(e,n,s);if(!Array.isArray(i))return this.ut=o,r;const a=this.ut??=[],l=[];let p,h,d=0,f=i.length-1,c=0,g=r.length-1;for(;d<=f&&c<=g;)if(i[d]===null)d++;else if(i[f]===null)f--;else if(a[d]===o[c])l[c]=je(i[d],r[c]),d++,c++;else if(a[f]===o[g])l[g]=je(i[f],r[g]),f--,g--;else if(a[d]===o[g])l[g]=je(i[d],r[g]),Gt(t,l[g+1],i[d]),d++,g--;else if(a[f]===o[c])l[c]=je(i[f],r[c]),Gt(t,i[d],i[f]),f--,c++;else if(p===void 0&&(p=tl(o,c,g),h=tl(a,d,f)),p.has(a[d]))if(p.has(a[f])){const u=h.get(o[c]),k=u!==void 0?i[u]:null;if(k===null){const v=Gt(t,i[d]);je(v,r[c]),l[c]=v}else l[c]=je(k,r[c]),Gt(t,i[d],k),i[u]=null;c++}else ki(i[f]),f--;else ki(i[d]),d++;for(;c<=g;){const u=Gt(t,l[g+1]);je(u,r[c]),l[c++]=u}for(;d<=f;){const u=i[d++];u!==null&&ki(u)}return this.ut=o,mi(t,l),V}}),Kn="dpk-changes",bm=(t,e,n)=>{const s=t.unread>0?e.changesUnread(t.unread):e.changes;return m`<button
1707
1705
  class="dpk-chrome-action dpk-bell"
1708
1706
  type="button"
1709
- aria-controls=${Jn}
1707
+ aria-controls=${Kn}
1710
1708
  aria-expanded=${t.open?"true":"false"}
1711
1709
  aria-label=${s}
1712
1710
  data-tooltip=${s}
1713
1711
  @click=${n.toggleList}
1714
1712
  >
1715
- ${qa()} ${t.unread>0?k`<span class="dpk-bell-badge" aria-hidden="true">${t.unread}</span>`:b}
1716
- </button>`},al=(t,e,n)=>t.jumpable?k`<button class="dpk-btn dpk-btn--accent dpk-notice-show" type="button" @click=${()=>n.show(t.key)}>
1713
+ ${La()} ${t.unread>0?m`<span class="dpk-bell-badge" aria-hidden="true">${t.unread}</span>`:b}
1714
+ </button>`},nl=(t,e,n)=>t.jumpable?m`<button class="dpk-btn dpk-btn--accent dpk-notice-show" type="button" @click=${()=>n.show(t.key)}>
1717
1715
  ${e.changesShow}
1718
- </button>`:b,ll=(t,e,n,s)=>s==="list"||t.unread>0?k`<button
1716
+ </button>`:b,sl=(t,e,n,s)=>s==="list"||t.unread>0?m`<button
1719
1717
  class=${s==="list"?"dpk-btn dpk-changes-read-all":"dpk-toast-more dpk-changes-read-all"}
1720
1718
  type="button"
1721
1719
  aria-disabled=${t.unread>0?"false":"true"}
1722
1720
  @click=${n.readAll}
1723
1721
  >
1724
1722
  ${e.changesReadAll}
1725
- </button>`:b,hm=(t,e,n)=>k`<section class="dpk-changes-group" data-revision=${t.revision}>
1723
+ </button>`:b,vm=(t,e,n)=>m`<section class="dpk-changes-group" data-revision=${t.revision}>
1726
1724
  <h3 class="dpk-changes-revision">
1727
1725
  <span>${t.revision}</span>
1728
- ${t.latest?k`<span class="dpk-changes-current">${e.changesCurrent}</span>`:b}
1726
+ ${t.latest?m`<span class="dpk-changes-current">${e.changesCurrent}</span>`:b}
1729
1727
  </h3>
1730
1728
  <ol class="dpk-changes-list">
1731
- ${Ke(t.cards,s=>s.key,s=>k`<li
1729
+ ${Fe(t.cards,s=>s.key,s=>m`<li
1732
1730
  class="dpk-change"
1733
1731
  data-key=${s.id}
1734
1732
  data-revision=${s.revision}
1735
1733
  ?data-fresh=${s.fresh}
1736
1734
  >
1737
1735
  <p class="dpk-change-title">
1738
- ${s.fresh?k`<span class="dpk-change-new">${e.changesNew}</span>`:b} ${s.title}
1736
+ ${s.fresh?m`<span class="dpk-change-new">${e.changesNew}</span>`:b} ${s.title}
1739
1737
  </p>
1740
- ${s.body===null?b:k`<p class="dpk-change-body">${s.body}</p>`} ${al(s,e,n)}
1738
+ ${s.body===null?b:m`<p class="dpk-change-body">${s.body}</p>`} ${nl(s,e,n)}
1741
1739
  </li>`)}
1742
1740
  </ol>
1743
- </section>`,um=(t,e,n)=>t.open?k`<div id=${Jn} class="dpk-changes" popover="manual" role="dialog" aria-label=${e.changesTitle}>
1741
+ </section>`,xm=(t,e,n)=>t.open?m`<div id=${Kn} class="dpk-changes" popover="manual" role="dialog" aria-label=${e.changesTitle}>
1744
1742
  <div class="dpk-changes-head">
1745
1743
  <h2 class="dpk-changes-title">${e.changesTitle}</h2>
1746
- ${ll(t,e,n,"list")}
1744
+ ${sl(t,e,n,"list")}
1747
1745
  </div>
1748
- ${Ke(t.groups,s=>s.revision,s=>hm(s,e,n))}
1749
- </div>`:b,gm=(t,e,n)=>k`<section
1746
+ ${Fe(t.groups,s=>s.revision,s=>vm(s,e,n))}
1747
+ </div>`:b,wm=(t,e,n)=>m`<section
1750
1748
  class="dpk-toasts"
1751
1749
  aria-live="polite"
1752
1750
  aria-label=${e.changes}
@@ -1755,13 +1753,13 @@ The brief is too long for a comment, so it is stored in this artifact's database
1755
1753
  @focusin=${()=>n.pause("focus")}
1756
1754
  @focusout=${()=>n.resume("focus")}
1757
1755
  >
1758
- ${Ke(t.toasts,s=>s.key,s=>k`<div class="dpk-toast" data-key=${s.id}>
1759
- <span class="dpk-toast-icon" aria-hidden="true">${qa()}</span>
1756
+ ${Fe(t.toasts,s=>s.key,s=>m`<div class="dpk-toast" data-key=${s.id}>
1757
+ <span class="dpk-toast-icon" aria-hidden="true">${La()}</span>
1760
1758
  <div class="dpk-toast-text">
1761
1759
  <p class="dpk-change-title">${s.title}</p>
1762
- ${s.body===null?b:k`<p class="dpk-change-body">${s.body}</p>`}
1760
+ ${s.body===null?b:m`<p class="dpk-change-body">${s.body}</p>`}
1763
1761
  </div>
1764
- ${al(s,e,n)}
1762
+ ${nl(s,e,n)}
1765
1763
  <button
1766
1764
  class="dpk-toast-close"
1767
1765
  type="button"
@@ -1769,23 +1767,27 @@ The brief is too long for a comment, so it is stored in this artifact's database
1769
1767
  title=${e.changesDismiss}
1770
1768
  @click=${()=>n.dismiss(s.key)}
1771
1769
  >
1772
- ${ct()}
1770
+ ${ot()}
1773
1771
  </button>
1774
1772
  </div>`)}
1775
- ${t.toasts.length+t.waiting>1?k`<div class="dpk-toast-actions">
1776
- ${t.waiting>0?k`<button class="dpk-toast-more" type="button" @click=${n.openList}>
1773
+ ${t.toasts.length+t.waiting>1?m`<div class="dpk-toast-actions">
1774
+ ${t.waiting>0?m`<button class="dpk-toast-more" type="button" @click=${n.openList}>
1777
1775
  ${e.changesWaiting(t.waiting)} · ${e.changesSeeAll}
1778
1776
  </button>`:b}
1779
- ${ll(t,e,n,"toasts")}
1777
+ ${sl(t,e,n,"toasts")}
1780
1778
  </div>`:b}
1781
- </section>`;function dl(t){return t===null?1:t===void 0?2:0}function cl(t,e){const n=dl(t),s=dl(e);return n<s?-1:n>s?1:n!==0?0:t<e?-1:t>e?1:0}function fm(t,e,n){return n==="asc"?cl(t,e):cl(e,t)}function mm(t,e,n){return t.slice().sort((s,i)=>{const r=n.length;for(let o=0;o<e.length;o++){const a=r>o?n[o]:n[r-1],l=e[o],c=typeof l=="function",d=fm(c?l(s):s[l],c?l(i):i[l],a);if(d!==0)return d}return 0})}function pl(t,e){return mm(t,e,["asc"])}function wi(t,e,n){return n==null?Math.min(t,e):Math.min(Math.max(t,e),n)}const km=5,$i=4,hl=8,bm=(t,e)=>{const n=e.badgeHeight,s=t.target.right+hl,i=t.target.left-hl,r=[];let o=0,a=s;for(let l=t.widths.length-1;l>=0;l-=1){const c=t.widths[l]??0;a!==s&&a-c<i&&(o+=1,a=s),r[l]={x:a-c,y:t.target.top-n/2-o*(n+$i)},a-=c+km}return r},ul=(t,e)=>{const n=t.map(()=>[]),s=pl(t.map((r,o)=>({group:r,index:o})).filter(({group:r})=>r.gutter),[({group:r})=>r.target.top]);let i=Number.NEGATIVE_INFINITY;for(const{group:r,index:o}of s){let a=Math.max(r.target.top,i);n[o]=r.widths.map(l=>{const c={x:e.width-l,y:a};return a+=e.badgeHeight+$i,c}),i=a}return{points:n,bottom:i-$i}},vm=(t,e)=>Math.max(0,ul(t,e).bottom),xm=(t,e)=>{const n=ul(t,e),s=Math.max(e.height,n.bottom);return t.map((i,r)=>(i.gutter?n.points[r]??[]:bm(i,e)).map((o,a)=>({x:wi(o.x,0,Math.max(0,e.width-(i.widths[a]??0))),y:wi(o.y,0,Math.max(0,s-e.badgeHeight))})))},gl="data-dpk-badge-gutter",ym=new Set(["TABLE","THEAD","TBODY","TFOOT","TR","COLGROUP"]),wm=t=>ym.has(t.localName.toUpperCase()),$m=t=>t.localName==="slot",fl=t=>t instanceof HTMLElement&&!wm(t)&&!$m(t),Si=/(auto|scroll|hidden|overlay)/,ml=3,es=t=>{const e=t.assignedSlot??null;if(e!==null)return e;const n=t.parentElement??null;if(n!==null)return n;const s=t.parentNode;return s instanceof ShadowRoot?s.host:null},kl=t=>getComputedStyle(t).position!=="static",bl=t=>{const e=getComputedStyle(t);return Si.test(e.overflow)||Si.test(e.overflowX)||Si.test(e.overflowY)},vl=t=>{for(let e=es(t);e!==null;e=es(e))if(fl(e)&&(kl(e)||bl(e)))return e;return Sm(t)},Sm=t=>{for(let e=es(t);e!==null;e=es(e))if(fl(e))return e;return null},ts=new Map,Am=t=>{const e=ts.get(t);if(e!==void 0){e.count+=1;return}const n=kl(t)?null:t.style.position;n!==null&&(t.style.position="relative"),ts.set(t,{count:1,previous:n})},Em=t=>{const e=ts.get(t);e!==void 0&&(e.count-=1,!(e.count>0)&&(e.previous!==null&&(t.style.position=e.previous),ts.delete(t)))},xl=(t,e)=>!(t instanceof HTMLElement)||t.offsetParent!==e,Cm=(t,e,n)=>{if(t.getClientRects().length===0)return null;if(!n&&t instanceof HTMLElement)return{left:t.offsetLeft,top:t.offsetTop,width:t.offsetWidth,height:t.offsetHeight};const s=t.getBoundingClientRect(),i=e.getBoundingClientRect(),r=e.offsetWidth>0&&i.width>0?i.width/e.offsetWidth:1;return{left:(s.left-i.left)/r-e.clientLeft+e.scrollLeft,top:(s.top-i.top)/r-e.clientTop+e.scrollTop,width:s.width/r,height:s.height/r}},Tm=t=>`
1779
+ </section>`;function il(t){return t===null?1:t===void 0?2:0}function rl(t,e){const n=il(t),s=il(e);return n<s?-1:n>s?1:n!==0?0:t<e?-1:t>e?1:0}function ym(t,e,n){return n==="asc"?rl(t,e):rl(e,t)}function $m(t,e,n){return t.slice().sort((s,i)=>{const r=n.length;for(let o=0;o<e.length;o++){const a=r>o?n[o]:n[r-1],l=e[o],p=typeof l=="function",h=ym(p?l(s):s[l],p?l(i):i[l],a);if(h!==0)return h}return 0})}function ol(t,e){return $m(t,e,["asc"])}function bi(t,e,n){return n==null?Math.min(t,e):Math.min(Math.max(t,e),n)}const Sm=5,vi=4,al=8,Am=(t,e)=>{const n=e.badgeHeight,s=t.target.right+al,i=t.target.left-al,r=[];let o=0,a=s;for(let l=t.widths.length-1;l>=0;l-=1){const p=t.widths[l]??0;a!==s&&a-p<i&&(o+=1,a=s),r[l]={x:a-p,y:t.target.top-n/2-o*(n+vi)},a-=p+Sm}return r},ll=(t,e)=>{const n=t.map(()=>[]),s=ol(t.map((r,o)=>({group:r,index:o})).filter(({group:r})=>r.gutter),[({group:r})=>r.target.top]);let i=Number.NEGATIVE_INFINITY;for(const{group:r,index:o}of s){let a=Math.max(r.target.top,i);n[o]=r.widths.map(l=>{const p={x:e.width-l,y:a};return a+=e.badgeHeight+vi,p}),i=a}return{points:n,bottom:i-vi}},Em=(t,e)=>Math.max(0,ll(t,e).bottom),Cm=(t,e)=>{const n=ll(t,e),s=Math.max(e.height,n.bottom);return t.map((i,r)=>(i.gutter?n.points[r]??[]:Am(i,e)).map((o,a)=>({x:bi(o.x,0,Math.max(0,e.width-(i.widths[a]??0))),y:bi(o.y,0,Math.max(0,s-e.badgeHeight))})))},dl="data-dpk-badge-gutter",Tm=new Set(["TABLE","THEAD","TBODY","TFOOT","TR","COLGROUP"]),Rm=t=>Tm.has(t.localName.toUpperCase()),Mm=t=>t.localName==="slot",cl=t=>t instanceof HTMLElement&&!Rm(t)&&!Mm(t),xi=/(auto|scroll|hidden|overlay)/,pl=3,Vn=t=>{const e=t.assignedSlot??null;if(e!==null)return e;const n=t.parentElement??null;if(n!==null)return n;const s=t.parentNode;return s instanceof ShadowRoot?s.host:null},hl=t=>getComputedStyle(t).position!=="static",ul=t=>{const e=getComputedStyle(t);return xi.test(e.overflow)||xi.test(e.overflowX)||xi.test(e.overflowY)},gl=t=>{for(let e=Vn(t);e!==null;e=Vn(e))if(cl(e)&&(hl(e)||ul(e)))return e;return Om(t)},Om=t=>{for(let e=Vn(t);e!==null;e=Vn(e))if(cl(e))return e;return null},Yn=new Map,_m=t=>{const e=Yn.get(t);if(e!==void 0){e.count+=1;return}const n=hl(t)?null:t.style.position;n!==null&&(t.style.position="relative"),Yn.set(t,{count:1,previous:n})},Pm=t=>{const e=Yn.get(t);e!==void 0&&(e.count-=1,!(e.count>0)&&(e.previous!==null&&(t.style.position=e.previous),Yn.delete(t)))},fl=(t,e)=>!(t instanceof HTMLElement)||t.offsetParent!==e,Lm=(t,e,n)=>{if(t.getClientRects().length===0)return null;if(!n&&t instanceof HTMLElement)return{left:t.offsetLeft,top:t.offsetTop,width:t.offsetWidth,height:t.offsetHeight};const s=t.getBoundingClientRect(),i=e.getBoundingClientRect(),r=e.offsetWidth>0&&i.width>0?i.width/e.offsetWidth:1;return{left:(s.left-i.left)/r-e.clientLeft+e.scrollLeft,top:(s.top-i.top)/r-e.clientTop+e.scrollTop,width:s.width/r,height:s.height/r}},zm=t=>`
1782
1780
  .${t} {
1783
1781
  position: absolute;
1784
1782
  inset: 0;
1785
- z-index: 1;
1783
+ z-index: var(--dpk-badge-layer-z, 1);
1786
1784
  pointer-events: none;
1787
1785
  }
1788
- `;class yl{#e;#s=new Map;#t=new Map;#n=null;#i=0;#r=null;#o=!1;constructor(e,n){this.#e=n,e.addController(this)}hostDisconnected(){this.#v(),this.#$(),this.#f()}hostUpdated(){if(!this.#e.active()){this.#v(),this.#$(),this.#f();return}this.#a(),this.#k(),this.#x()}refresh(){if(!this.#e.active()){this.#v(),this.#$(),this.#f();return}this.#a(),this.#k(),this.#x()}#a(){const{spec:e}=this.#e;this.#o=!1;const n=new Set;for(const s of this.#e.bindings()){const i=e.keyOf(s);n.add(i);const r=this.#s.get(i);if(r!==void 0&&r.target===s.target){e.update(r.button,s),r.width=r.button.offsetWidth,r.height=r.button.offsetHeight,r.gutter=e.gutterOf?.(s)??!1,this.#d(r);continue}r!==void 0&&this.#p(r),this.#l(s,i)}for(const[s,i]of this.#s)n.has(s)||this.#p(i);for(const s of this.#t.values())s.parent.toggleAttribute(gl,s.records.some(i=>i.gutter));this.#o&&(this.#o=!1,this.#i=ml,this.#m())}#l(e,n){if(!e.target.isConnected)return;const s=vl(e.target);if(s===null)return;const i=this.#c(s),r=this.#e.spec.create(e);this.#e.spec.update(r,e),i.layer.append(r);const o={key:n,target:e.target,button:r,portal:i,width:r.offsetWidth,height:r.offsetHeight,gutter:this.#e.spec.gutterOf?.(e)??!1,measured:xl(e.target,s)};i.records.push(o),this.#s.set(n,o),this.#o=!0}#d(e){const n=e.target;if(!e.measured&&n instanceof HTMLElement&&n.offsetParent===e.portal.parent)return;const s=vl(n);if(s===null||s===e.portal.parent)return;const i=e.portal;e.button.remove();const r=i.records.indexOf(e);r>=0&&i.records.splice(r,1),i.records.length===0&&this.#h(i);const o=this.#c(s);o.layer.append(e.button),e.portal=o,e.measured=xl(n,s),o.records.push(e),this.#o=!0}#c(e){const n=this.#t.get(e);if(n!==void 0)return n;Am(e);const s=document.createElement("div");s.className=this.#e.spec.portalClass;const i=document.createElement("style");i.textContent=`${Tm(this.#e.spec.portalClass)}${this.#e.spec.styles}`,s.append(i),e.append(s);const r={parent:e,layer:s,records:[],scrolls:bl(e)};return this.#t.set(e,r),r}#p(e){e.button.remove(),this.#s.delete(e.key);const{portal:n}=e,s=n.records.indexOf(e);s>=0&&n.records.splice(s,1),!(n.records.length>0)&&this.#h(n)}#h(e){e.layer.remove(),e.parent.removeAttribute(gl),e.parent.style.minHeight="",Em(e.parent),this.#t.delete(e.parent)}#f(){this.#$();for(const e of this.#t.values())this.#h(e);this.#t.clear(),this.#s.clear()}#k(){for(const e of this.#t.values())this.#y(e)}#y(e){const n=new Map;for(const c of e.records){const d=n.get(c.target);d===void 0?n.set(c.target,[c]):d.push(c)}const s=[],i=[];for(const[c,d]of n){const h=Cm(c,e.parent,d[0]?.measured??!1);for(const f of d)f.button.hidden=h===null;h!==null&&(i.push(d),s.push({target:{left:h.left,top:h.top,right:h.left+h.width,bottom:h.top+h.height},widths:d.map(f=>f.width),gutter:d.some(f=>f.gutter)}))}const r={width:e.scrolls?e.parent.scrollWidth:e.parent.clientWidth,height:e.scrolls?e.parent.scrollHeight:e.parent.clientHeight,badgeHeight:Math.max(0,...e.records.map(c=>c.height))},o=vm(s,r),a=o>0&&!e.scrolls?`${Math.ceil(o)}px`:"";e.parent.style.minHeight!==a&&(e.parent.style.minHeight=a);const l=xm(s,{...r,height:Math.max(r.height,o)});i.forEach((c,d)=>{c.forEach((h,f)=>{const p=l[d]?.[f];if(p===void 0)return;const g=`${p.x}px`,u=`${p.y}px`;h.button.style.left!==g&&(h.button.style.left=g),h.button.style.top!==u&&(h.button.style.top=u)})})}#x(){if(![...this.#t.values()].some(n=>n.records.some(s=>s.measured))){this.#v();return}this.#n===null&&(this.#n=requestAnimationFrame(this.#g))}#v(){this.#n!==null&&(cancelAnimationFrame(this.#n),this.#n=null)}#g=()=>{this.#n=null,this.#e.active()&&(this.#k(),this.#n=requestAnimationFrame(this.#g))};#m(){this.#r===null&&(this.#r=requestAnimationFrame(this.#w))}#w=()=>{if(this.#r=null,!(!this.#e.active()||this.#i<=0)){this.#i-=1;for(const e of this.#s.values())this.#d(e);this.#k(),this.#x(),this.#o&&(this.#i=ml),this.#o=!1,this.#i>0&&this.#m()}};#$(){this.#i=0,this.#o=!1,this.#r!==null&&(cancelAnimationFrame(this.#r),this.#r=null)}}const Rm="data-dpk-check",_m="off",Mm=t=>t.closest(`[${Rm}="${_m}"]`)===null,Om=(t,e,n)=>{if(!e.enabled)return[];const s=[];for(const i of Ys(t,`[${at}]`)){const r=i.getAttribute(at);r===null||r===""||!Mm(i)||s.push({index:s.length,target:i,ref:r,status:ao(e,r,n)})}return s},Pm=`
1786
+ /* A badge's own \`display\` would otherwise outrank the attribute. */
1787
+ .${t} > [hidden] {
1788
+ display: none;
1789
+ }
1790
+ `;class ml{#e;#n=new Map;#s=new Map;#t=null;#i=0;#r=null;#o=!1;#a;constructor(e,n){this.#e=n,e.addController(this)}hostDisconnected(){this.#m(),this.#C(),this.#A()}hostUpdated(){if(!this.#e.active()){this.#m(),this.#C(),this.#A();return}this.#l(),this.#v(),this.#w()}refresh(){if(!this.#e.active()){this.#m(),this.#C(),this.#A();return}this.#l(),this.#v(),this.#w()}#l(){const{spec:e}=this.#e;this.#o=!1;const n=new Set;for(const s of this.#e.bindings()){const i=e.keyOf(s);n.add(i);const r=this.#n.get(i);if(r!==void 0&&r.target===s.target){e.update(r.button,s),r.width=r.button.offsetWidth,r.height=r.button.offsetHeight,r.gutter=e.gutterOf?.(s)??!1,this.#c(r);continue}r!==void 0&&this.#h(r),this.#d(s,i)}for(const[s,i]of this.#n)n.has(s)||this.#h(i);this.#p();for(const s of this.#s.values())s.parent.toggleAttribute(dl,s.records.some(i=>i.gutter));this.#o&&(this.#o=!1,this.#i=pl,this.#$())}#d(e,n){if(!e.target.isConnected)return;const s=gl(e.target);if(s===null)return;const i=this.#u(s),r=this.#e.spec.create(e);this.#e.spec.update(r,e),i.layer.append(r);const o={key:n,target:e.target,button:r,portal:i,width:r.offsetWidth,height:r.offsetHeight,gutter:this.#e.spec.gutterOf?.(e)??!1,measured:fl(e.target,s)};i.records.push(o),this.#n.set(n,o),this.#o=!0}#c(e){const n=e.target;if(!e.measured&&n instanceof HTMLElement&&n.offsetParent===e.portal.parent)return;const s=gl(n);if(s===null||s===e.portal.parent)return;const i=e.portal;e.button.remove();const r=i.records.indexOf(e);r>=0&&i.records.splice(r,1),i.records.length===0&&this.#k(i);const o=this.#u(s);o.layer.append(e.button),e.portal=o,e.measured=fl(n,s),o.records.push(e),this.#o=!0}#u(e){const n=this.#s.get(e);if(n!==void 0)return n;_m(e);const s=document.createElement("div");s.className=this.#e.spec.portalClass;const i=document.createElement("style");i.textContent=`${zm(this.#e.spec.portalClass)}${this.#e.spec.styles}`,s.append(i),e.append(s);const r={parent:e,layer:s,records:[],scrolls:ul(e)};return this.#s.set(e,r),r}#h(e){e.button.remove(),this.#n.delete(e.key);const{portal:n}=e,s=n.records.indexOf(e);s>=0&&n.records.splice(s,1),!(n.records.length>0)&&this.#k(n)}#k(e){e.layer.remove(),e.parent.removeAttribute(dl),e.parent.style.minHeight="",Pm(e.parent),this.#s.delete(e.parent)}#p(){if(!(typeof ResizeObserver>"u")){this.#a??=new ResizeObserver(this.#x),this.#a.disconnect();for(const e of this.#s.values()){this.#a.observe(e.parent);for(const n of e.records)this.#a.observe(n.target)}}}#x=()=>{if(this.#e.active()){if([...this.#n.values()].some(e=>!e.target.isConnected)){this.refresh();return}for(const e of this.#n.values())this.#c(e);this.#o&&this.#p(),this.#o=!1,this.#v()}};#A(){this.#a?.disconnect(),this.#C();for(const e of this.#s.values())this.#k(e);this.#s.clear(),this.#n.clear()}#v(){for(const e of this.#s.values())this.#f(e)}#f(e){const n=new Map;for(const p of e.records){const h=n.get(p.target);h===void 0?n.set(p.target,[p]):h.push(p)}const s=[],i=[];for(const[p,h]of n){const d=Lm(p,e.parent,h[0]?.measured??!1);for(const f of h)f.button.hidden=d===null;d!==null&&(i.push(h),s.push({target:{left:d.left,top:d.top,right:d.left+d.width,bottom:d.top+d.height},widths:h.map(f=>f.width),gutter:h.some(f=>f.gutter)}))}const r={width:e.scrolls?e.parent.scrollWidth:e.parent.clientWidth,height:e.scrolls?e.parent.scrollHeight:e.parent.clientHeight,badgeHeight:Math.max(0,...e.records.map(p=>p.height))},o=Em(s,r),a=o>0&&!e.scrolls?`${Math.ceil(o)}px`:"";e.parent.style.minHeight!==a&&(e.parent.style.minHeight=a);const l=Cm(s,{...r,height:Math.max(r.height,o)});i.forEach((p,h)=>{p.forEach((d,f)=>{const c=l[h]?.[f];if(c===void 0)return;const g=`${c.x}px`,u=`${c.y}px`;d.button.style.left!==g&&(d.button.style.left=g),d.button.style.top!==u&&(d.button.style.top=u)})})}#w(){if(![...this.#s.values()].some(n=>n.records.some(s=>s.measured))){this.#m();return}this.#t===null&&(this.#t=requestAnimationFrame(this.#S))}#m(){this.#t!==null&&(cancelAnimationFrame(this.#t),this.#t=null)}#S=()=>{this.#t=null,this.#e.active()&&(this.#v(),this.#t=requestAnimationFrame(this.#S))};#$(){this.#r===null&&(this.#r=requestAnimationFrame(this.#y))}#y=()=>{if(this.#r=null,!(!this.#e.active()||this.#i<=0)){this.#i-=1;for(const e of this.#n.values())this.#c(e);this.#v(),this.#w(),this.#o&&(this.#p(),this.#i=pl),this.#o=!1,this.#i>0&&this.#$()}};#C(){this.#i=0,this.#o=!1,this.#r!==null&&(cancelAnimationFrame(this.#r),this.#r=null)}}const Im="data-dpk-check",Dm="off",Nm=t=>t.closest(`[${Im}="${Dm}"]`)===null,qm=(t,e,n)=>{if(!e.enabled)return[];const s=[];for(const i of Bs(t,`[${nt}]`)){const r=i.getAttribute(nt);r===null||r===""||!Nm(i)||s.push({index:s.length,target:i,ref:r,status:Xr(e,r,n)})}return s},Um=`
1789
1791
  .dpk-check-badge {
1790
1792
  position: absolute;
1791
1793
  display: inline-flex;
@@ -1841,13 +1843,13 @@ The brief is too long for a comment, so it is stored in this artifact's database
1841
1843
  transition: none;
1842
1844
  }
1843
1845
  }
1844
- `;class Lm extends yl{constructor(e,n){super(e,{active:n.active,bindings:n.bindings,spec:{portalClass:"dpk-check-portal",styles:Pm,keyOf:s=>`${s.index}:${s.ref}`,create:s=>{const i=document.createElement("button");return i.type="button",i.className="dpk-check-badge",i.dataset.checkKey=`${s.index}:${s.ref}`,i.addEventListener("click",r=>{r.preventDefault(),r.stopPropagation(),n.onToggle(i.dataset.checkRef??"")}),i},update:(s,i)=>{const r=n.labelOf(i.status);s.dataset.checkKey=`${i.index}:${i.ref}`,s.dataset.checkRef=i.ref,s.dataset.status=i.status,s.setAttribute("aria-label",r),s.title=r,Tr(i.status==="stale"?Oa():pt(),s)}}})}}class zm{#e;#s;#t=zs;#n=null;constructor(e,n){this.#e=e,this.#s=n,e.addController(this)}hostConnected(){this.#n=this.#s.persist()?fe(oo):X(oo),this.#t=this.#n.read(this.#i())??zs}hostDisconnected(){}get enabled(){return this.#t.enabled}get state(){return this.#t}setEnabled(e){e!==this.#t.enabled&&(this.#t=Xp(this.#t,e),this.#r(),this.#e.requestUpdate())}statusOf(e){return ao(this.#t,e,this.#s.log())}toggle(e){const n=this.statusOf(e);this.#t=th(this.#t,e,n,Jp(this.#s.log())),this.#r(),this.#e.requestUpdate()}#i(){return`${this.#s.storageKey()}:check-mode`}#r(){this.#n?.write(this.#i(),this.#t)}}const Ai=(t,e)=>typeof t=="object"&&t!==null&&e.every(n=>typeof Reflect.get(t,n)=="function"),Dm=t=>Ai(t,["use"]),Im=t=>Ai(t,["anchorFor","canSendToClaude","sendToClaude"]),Nm=t=>Ai(t,["collection"]),wl=async(t,e)=>{try{return await t.use(e)}catch{return null}},qm=(t,e)=>({async canSend(){try{return await t.canSendToClaude()==="available"}catch{return!1}},async send({brief:n,draft:s,anchor:i}){let r=jg(n);if(r===null){if(e===null)return{ok:!1,reason:"too_large"};try{const o=e.collection(qg).doc();await o.set({brief:n,draft:s,createdAt:new Date().toISOString()}),r=Bg(o.path)}catch{return{ok:!1,reason:"storage"}}}try{return await t.sendToClaude({anchor:await t.anchorFor(i),text:r}),{ok:!0}}catch(o){return{ok:!1,reason:Gg(o)}}}}),Um=async t=>{if(!Dm(t))return null;const[e,n]=await Promise.all([wl(t,"comments"),wl(t,"db")]);return Im(e)?qm(e,Nm(n)?n:null):null},Hm=()=>Reflect.get(globalThis,"claude");class jm{#e;#s;#t=null;#n=!1;constructor(e,n=Hm){this.#e=e,this.#s=n,e.addController(this)}get available(){return this.#n}hostConnected(){this.#t??=Um(this.#s()),this.#i(),window.addEventListener("focus",this.#i)}hostDisconnected(){window.removeEventListener("focus",this.#i)}async send(e){const n=await this.#t;if(!n)return{ok:!1,reason:"forbidden"};const s=await n.send(e);return this.#i(),s}#i=async()=>{const e=await this.#t,n=e?await e.canSend():!1;n!==this.#n&&(this.#n=n,this.#e.requestUpdate())}}const Ei="dev-process-kit:color-scheme",Bm="(prefers-color-scheme: dark)",$l=()=>typeof matchMedia=="function"?matchMedia(Bm):null,Sl=()=>De(document.documentElement.dataset.theme)??($l()?.matches===!0?"dark":"light");class Fm{#e;#s;#t=null;#n=null;#i="light";#r=null;#o=null;constructor(e,n){this.#e=e,this.#s=n,e.addController(this)}hostConnected(){this.#t===null&&(this.#t=this.#s()?fe(De):X(De),this.#n=this.#t.read(Ei)),this.#i=Sl(),this.#r=$l(),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 co(this.#l(e))}toggle(e){this.#a(nh(this.#l(e)))}pick(e,n){this.#a(po(this.#l(e),n))}#a(e){e!==this.#n&&(this.#n=e,e===null?this.#t?.remove(Ei):this.#t?.write(Ei,e),this.#e.requestUpdate())}#l(e){return{preference:this.#n,authored:e,environment:this.#i}}#d=()=>{const e=Sl();e!==this.#i&&(this.#i=e,this.#e.requestUpdate())}}const Gm=(t,e)=>{const n=[],s=i=>{(i===t||i instanceof ShadowRoot)&&e?.(i);for(const r of i.children)r.hasAttribute("data-template")||(("commentTargets"in r||"elementActions"in r)&&n.push(r),s(r),r.shadowRoot&&s(r.shadowRoot))};return s(t),n},Al=(t,e)=>{const n=new Map;for(const s of t)n.set(e(s),(n.get(e(s))??0)+1);return t.filter(s=>n.get(e(s))===1)},El=t=>Al(t.filter(e=>"elementActions"in e&&typeof e.id=="string"&&e.id.length>0),e=>e.id),Cl=(t,e)=>{for(const n of El(t)){const s=fo(e,n.id),i=Reflect.get(n,"elementActions");Array.isArray(i)&&i.length===s.length&&s.every((o,a)=>{const l=i[a];return typeof l=="object"&&l!==null&&"id"in l&&l.id===o.id})||Reflect.set(n,"elementActions",s)}},Wm=t=>{const e=Reflect.get(t,"elementActionResults");return Array.isArray(e)?e.flatMap(n=>{const s=C(go,n);return s.success?[s.output]:[]}):[]},Km=t=>{const e=[];for(const n of t){if(!("commentTargets"in n))continue;const s=C(ko,n.commentTargets);s.success&&e.push(...s.output)}return{targets:Al(e,n=>n.value),providers:El(t).map(n=>({id:n.id,results:Wm(n)}))}},Yt={kind:"header"},K={margin:12,default:Yt,fallback:{edge:"right",offset:12}},Tl=["top","right","bottom","left"],ns=t=>t==="top"||t==="bottom"?"horizontal":"vertical",Rl=t=>t.kind==="header"?"horizontal":ns(t.dock.edge),Vm=(t,e,n)=>t===n?e:{width:e.height,height:e.width},_l=(t,e,n)=>ns(t)==="horizontal"?{available:n.width,own:e.width}:{available:n.height,own:e.height},Ml=(t,e,n,s)=>{const{available:i,own:r}=_l(t,n,s),o=K.margin,a=Math.max(o,i-r-K.margin);return Math.round(Math.min(a,Math.max(o,e)))},ss=(t,e,n)=>({edge:t.edge,offset:Ml(t.edge,t.offset,e,n)}),Ol=(t,e,n)=>{const{margin:s}=K;switch(t.edge){case"top":return{left:n.left+t.offset,top:n.top+s};case"bottom":return{left:n.left+t.offset,top:n.top+n.height-e.height-s};case"left":return{left:n.left+s,top:n.top+t.offset};case"right":return{left:n.left+n.width-e.width-s,top:n.top+t.offset}}},Ym=(t,e)=>{const{margin:n}=K;switch(t.edge){case"top":return[{side:"top",value:e.top+n},{side:"left",value:e.left+t.offset}];case"bottom":return[{side:"bottom",value:n},{side:"left",value:e.left+t.offset}];case"left":return[{side:"left",value:e.left+n},{side:"top",value:e.top+t.offset}];case"right":return[{side:"right",value:n},{side:"top",value:e.top+t.offset}]}},Zm=(t,e)=>t.kind==="edge"&&t.dock.edge==="right"&&e>0?e+K.margin:0,Qm=t=>Math.max(t.width,t.height),Xm=(t,e,n)=>{const s=e===null?"none":e.kind==="header"?"targeted":"offered";return t.kind==="header"?{kind:"room",drop:s,width:n}:{kind:"return",drop:s}},Pl=t=>t.kind==="edge"?t.dock:K.fallback,Ll=(t,e,n,s)=>t.kind==="header"&&e!==null?{left:e.left,top:e.top}:Ol(Pl(t),n,s),Jm=(t,e,n)=>t.kind==="header"&&e!==null?[{side:"left",value:e.left},{side:"top",value:e.top}]:Ym(Pl(t),n),ek=(t,e,n,s)=>{const i=Vm(ns(t.edge),e,n);return{...Ol(ss(t,i,s),i,s),...i}},zl=1,tk=(t,e)=>Math.abs(t.left-e.left)<=zl&&Math.abs(t.top-e.top)<=zl,nk=(t,e,n)=>({top:t.top-n.top,right:n.left+n.width-(t.left+e.width),bottom:n.top+n.height-(t.top+e.height),left:t.left-n.left}),sk=(t,e,n)=>{const s=nk(t,e,n);let i="top";for(const r of Tl)s[r]<s[i]&&(i=r);return i},ik=(t,e,n)=>{const s=sk(t,e,n),i=ns(s)==="horizontal"?t.left-n.left:t.top-n.top;return{edge:s,offset:Ml(s,i,e,n)}},Dl=(t,e,n)=>({left:Math.round(t.box.left+e-t.startX),top:Math.round(t.box.top+n-t.startY)}),Il=(t,e,n,s)=>s&&t.top<n.top?Yt:{kind:"edge",dock:ik(t,e,n)},Nl={ArrowLeft:"left",ArrowRight:"right",ArrowUp:"top",ArrowDown:"bottom"},rk=(t,{key:e},n,s)=>{const i=Nl[e];if(i!==void 0)return ss({edge:i,offset:t.offset},n,s);const{available:r,own:o}=_l(t.edge,n,s),a=Math.max(K.margin,r-o-K.margin);return e==="Home"?{edge:t.edge,offset:K.margin}:e==="End"?{edge:t.edge,offset:a}:null},ok=(t,e,n,s,i)=>{if(t.kind==="header"){const o=Nl[e.key];return o===void 0||o==="top"?null:{kind:"edge",dock:ss({edge:o,offset:K.margin},n,s)}}if(i&&e.key==="ArrowUp"&&t.dock.edge==="top")return Yt;const r=rk(t.dock,e,n,s);return r===null?null:{kind:"edge",dock:r}},ql=t=>{const e=t.getBoundingClientRect();return e.width===0&&e.height===0?null:{left:e.left,top:e.top,width:e.width,height:e.height}},ak=t=>typeof t=="string"&&Tl.some(e=>e===t),lk=t=>{if(typeof t!="object"||t===null)return null;const{edge:e,offset:n}=t;return typeof n!="number"||!Number.isFinite(n)||!ak(e)?null:{edge:e,offset:Math.round(n)}},Ul=t=>{if(typeof t!="object"||t===null)return null;const{kind:e,dock:n}=t;if(e==="header")return Yt;const s=lk(e==="edge"?n:t);return s===null?null:{kind:"edge",dock:s}},dk=t=>`dev-process-kit:menu:${t}`,Ci=t=>t===null?{width:0,height:0}:{width:t.width,height:t.height},Ti={kind:"idle"};class ck{constructor(e,n){this.#t=null,this.#n="",this.#i=null,this.#r=Ti,this.#o="none",this.#a=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>this.#e.requestUpdate()),this.#l=null,this.toHeader=()=>{this.#i=Yt,this.#p(),this.#e.requestUpdate()},this.grip={pointerdown:s=>{if(s.button!==0)return;s.preventDefault(),s.currentTarget instanceof Element&&s.currentTarget.setPointerCapture(s.pointerId);const i=this.#h(),r=this.#k(i),o=Ci(i.rect),a=i.rect===null?Ll(r,i.slot,o,i.area):{left:i.rect.left,top:i.rect.top};this.#r={kind:"dragging",pointerId:s.pointerId,drag:{startX:s.clientX,startY:s.clientY,box:a},size:o,orientation:Rl(r),box:a},this.#e.requestUpdate()},pointermove:s=>{const i=this.#r;i.kind!=="dragging"||i.pointerId!==s.pointerId||(this.#r={...i,box:Dl(i.drag,s.clientX,s.clientY)},this.#e.requestUpdate())},pointerup:s=>this.#c(s,s),pointercancel:s=>this.#c(s,s),lostpointercapture:s=>this.#c(s,null),keydown:s=>{const i=this.#h(),r=ok(this.#k(i),s,Ci(i.rect),i.area,i.slot!==null);r!==null&&(s.preventDefault(),this.#i=r,this.#p(),this.#e.requestUpdate())}},this.#d=()=>{this.#e.requestUpdate()},this.#e=e,this.#s=n,e.addController(this)}#e;#s;#t;#n;#i;#r;#o;#a;#l;hostConnected(){if(this.#t===null){const e=this.#s.persistKey();this.#t=e===null?X(Ul):fe(Ul),this.#n=dk(e??""),this.#i=this.#t.read(this.#n)??K.default}typeof window<"u"&&window.addEventListener("resize",this.#d)}hostDisconnected(){this.#r=Ti,this.#a?.disconnect(),this.#l=null,typeof window<"u"&&window.removeEventListener("resize",this.#d)}hostUpdated(){this.#f(this.#s.surface());const e=this.#h(),n=this.#y(this.#k(e),e);if(e.rect!==null&&n!==null&&tk(e.rect,n)){this.#o="none";return}const s=e.rect===null?"unmeasurable":"misplaced";this.#o!==s&&(this.#o=s,queueMicrotask(()=>this.#e.requestUpdate()))}get placement(){const e=this.#h(),n=this.#k(e),s=this.#r,i=s.kind==="dragging"?Il(s.box,s.size,e.area,e.slot!==null):null,r=s.kind==="dragging"&&i?.kind==="edge"?ek(i.dock,s.size,s.orientation,e.area):null,o=s.kind==="dragging"?s.size:e.rect,a=o===null?null:Qm(o);return{spot:n,box:this.#y(n,e),insets:Jm(n,e.slot,e.area),drop:i,ghost:r,slot:Xm(n,i,a)}}get dragging(){return this.#r.kind==="dragging"}#d;#c(e,n){const s=this.#r;if(s.kind!=="dragging"||s.pointerId!==e.pointerId)return;this.#r=Ti;const i=this.#h(),r=n===null?s.box:Dl(s.drag,n.clientX,n.clientY);this.#i=Il(r,s.size,i.area,i.slot!==null),this.#p(),this.#e.requestUpdate()}#p(){this.#i!==null&&this.#t?.write(this.#n,this.#i)}#h(){const e=this.#s.surface(),n=this.#s.header();return{rect:e===null?null:ql(e),slot:n===null?null:ql(n),area:this.#s.area()}}#f(e){e!==this.#l&&(this.#l!==null&&this.#a?.unobserve(this.#l),this.#l=e,e!==null&&this.#a?.observe(e,{box:"border-box"}))}#k({rect:e,slot:n,area:s}){const i=this.#i??K.default;if(i.kind==="header"&&n!==null)return i;const r=i.kind==="edge"?i.dock:K.fallback;return{kind:"edge",dock:ss(r,Ci(e),s)}}#y(e,{rect:n,slot:s,area:i}){const r=this.#r;return r.kind==="dragging"?r.box:n===null?null:Ll(e,s,n,i)}}const pk=(t,e,n,s,i)=>{const r=Rl(e.spot),o=e.box;return k`${uk(e.ghost)}
1846
+ `;class Hm extends ml{constructor(e,n){super(e,{active:n.active,bindings:n.bindings,spec:{portalClass:"dpk-check-portal",styles:Um,keyOf:s=>`${s.index}:${s.ref}`,create:s=>{const i=document.createElement("button");return i.type="button",i.className="dpk-check-badge",i.dataset.checkKey=`${s.index}:${s.ref}`,i.addEventListener("click",r=>{r.preventDefault(),r.stopPropagation(),n.onToggle(i.dataset.checkRef??"")}),i},update:(s,i)=>{const r=n.labelOf(i.status);s.dataset.checkKey=`${i.index}:${i.ref}`,s.dataset.checkRef=i.ref,s.dataset.status=i.status,s.setAttribute("aria-label",r),s.title=r,Mr(i.status==="stale"?Ca():at(),s)}}})}}class Bm{#e;#n;#s=Rs;#t=null;constructor(e,n){this.#e=e,this.#n=n,e.addController(this)}hostConnected(){this.#t=this.#n.persist()?ue(Qr):Z(Qr),this.#s=this.#t.read(this.#i())??Rs}hostDisconnected(){}get enabled(){return this.#s.enabled}get state(){return this.#s}setEnabled(e){e!==this.#s.enabled&&(this.#s=Yp(this.#s,e),this.#r(),this.#e.requestUpdate())}statusOf(e){return Xr(this.#s,e,this.#n.log())}toggle(e){const n=this.statusOf(e);this.#s=Xp(this.#s,e,n,Zp(this.#n.log())),this.#r(),this.#e.requestUpdate()}#i(){return`${this.#n.storageKey()}:check-mode`}#r(){this.#t?.write(this.#i(),this.#s)}}const wi=(t,e)=>typeof t=="object"&&t!==null&&e.every(n=>typeof Reflect.get(t,n)=="function"),jm=t=>wi(t,["use"]),Fm=t=>wi(t,["anchorFor","canSendToClaude","sendToClaude"]),Gm=t=>wi(t,["collection"]),kl=async(t,e)=>{try{return await t.use(e)}catch{return null}},Wm=(t,e)=>({async canSend(){try{return await t.canSendToClaude()==="available"}catch{return!1}},async send({brief:n,draft:s,anchor:i}){let r=Yg(n);if(r===null){if(e===null)return{ok:!1,reason:"too_large"};try{const o=e.collection(Wg).doc();await o.set({brief:n,draft:s,createdAt:new Date().toISOString()}),r=Zg(o.path)}catch{return{ok:!1,reason:"storage"}}}try{return await t.sendToClaude({anchor:await t.anchorFor(i),text:r}),{ok:!0}}catch(o){return{ok:!1,reason:Xg(o)}}}}),Km=async t=>{if(!jm(t))return null;const[e,n]=await Promise.all([kl(t,"comments"),kl(t,"db")]);return Fm(e)?Wm(e,Gm(n)?n:null):null},Vm=()=>Reflect.get(globalThis,"claude");class Ym{#e;#n;#s=null;#t=!1;constructor(e,n=Vm){this.#e=e,this.#n=n,e.addController(this)}get available(){return this.#t}hostConnected(){this.#s??=Km(this.#n()),this.#i(),window.addEventListener("focus",this.#i)}hostDisconnected(){window.removeEventListener("focus",this.#i)}async send(e){const n=await this.#s;if(!n)return{ok:!1,reason:"forbidden"};const s=await n.send(e);return this.#i(),s}#i=async()=>{const e=await this.#s,n=e?await e.canSend():!1;n!==this.#t&&(this.#t=n,this.#e.requestUpdate())}}const yi="dev-process-kit:color-scheme",Zm="(prefers-color-scheme: dark)",bl=()=>typeof matchMedia=="function"?matchMedia(Zm):null,vl=()=>_e(document.documentElement.dataset.theme)??(bl()?.matches===!0?"dark":"light");class Qm{#e;#n;#s=null;#t=null;#i="light";#r=null;#o=null;constructor(e,n){this.#e=e,this.#n=n,e.addController(this)}hostConnected(){this.#s===null&&(this.#s=this.#n()?ue(_e):Z(_e),this.#t=this.#s.read(yi)),this.#i=vl(),this.#r=bl(),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 eo(this.#l(e))}toggle(e){this.#a(Jp(this.#l(e)))}pick(e,n){this.#a(to(this.#l(e),n))}#a(e){e!==this.#t&&(this.#t=e,e===null?this.#s?.remove(yi):this.#s?.write(yi,e),this.#e.requestUpdate())}#l(e){return{preference:this.#t,authored:e,environment:this.#i}}#d=()=>{const e=vl();e!==this.#i&&(this.#i=e,this.#e.requestUpdate())}}const Xm=(t,e)=>{const n=[],s=i=>{(i===t||i instanceof ShadowRoot)&&e?.(i);for(const r of i.children)r.hasAttribute("data-template")||(("commentTargets"in r||"elementActions"in r)&&n.push(r),s(r),r.shadowRoot&&s(r.shadowRoot))};return s(t),n},xl=(t,e)=>{const n=new Map;for(const s of t)n.set(e(s),(n.get(e(s))??0)+1);return t.filter(s=>n.get(e(s))===1)},wl=t=>xl(t.filter(e=>"elementActions"in e&&typeof e.id=="string"&&e.id.length>0),e=>e.id),yl=(t,e)=>{for(const n of wl(t)){const s=ro(e,n.id),i=Reflect.get(n,"elementActions");Array.isArray(i)&&i.length===s.length&&s.every((o,a)=>{const l=i[a];return typeof l=="object"&&l!==null&&"id"in l&&l.id===o.id})||Reflect.set(n,"elementActions",s)}},Jm=t=>{const e=Reflect.get(t,"elementActionResults");return Array.isArray(e)?e.flatMap(n=>{const s=C(io,n);return s.success?[s.output]:[]}):[]},ek=t=>{const e=[];for(const n of t){if(!("commentTargets"in n))continue;const s=C(ao,n.commentTargets);s.success&&e.push(...s.output)}return{targets:xl(e,n=>n.value),providers:wl(t).map(n=>({id:n.id,results:Jm(n)}))}},Wt={kind:"header"},j={margin:12,default:Wt,fallback:{edge:"right",offset:12}},$l=["top","right","bottom","left"],Zn=t=>t==="top"||t==="bottom"?"horizontal":"vertical",Sl=t=>t.kind==="header"?"horizontal":Zn(t.dock.edge),tk=(t,e,n)=>t===n?e:{width:e.height,height:e.width},Al=(t,e,n)=>Zn(t)==="horizontal"?{available:n.width,own:e.width}:{available:n.height,own:e.height},El=(t,e,n,s)=>{const{available:i,own:r}=Al(t,n,s),o=j.margin,a=Math.max(o,i-r-j.margin);return Math.round(Math.min(a,Math.max(o,e)))},Qn=(t,e,n)=>({edge:t.edge,offset:El(t.edge,t.offset,e,n)}),Cl=(t,e,n)=>{const{margin:s}=j;switch(t.edge){case"top":return{left:n.left+t.offset,top:n.top+s};case"bottom":return{left:n.left+t.offset,top:n.top+n.height-e.height-s};case"left":return{left:n.left+s,top:n.top+t.offset};case"right":return{left:n.left+n.width-e.width-s,top:n.top+t.offset}}},nk=(t,e)=>{const{margin:n}=j;switch(t.edge){case"top":return[{side:"top",value:e.top+n},{side:"left",value:e.left+t.offset}];case"bottom":return[{side:"bottom",value:n},{side:"left",value:e.left+t.offset}];case"left":return[{side:"left",value:e.left+n},{side:"top",value:e.top+t.offset}];case"right":return[{side:"right",value:n},{side:"top",value:e.top+t.offset}]}},sk=(t,e)=>t.kind==="edge"&&t.dock.edge==="right"&&e>0?e+j.margin:0,ik=t=>Math.max(t.width,t.height),rk=(t,e,n)=>{const s=e===null?"none":e.kind==="header"?"targeted":"offered";return t.kind==="header"?{kind:"room",drop:s,width:n}:{kind:"return",drop:s}},Tl=t=>t.kind==="edge"?t.dock:j.fallback,Rl=(t,e,n,s)=>t.kind==="header"&&e!==null?{left:e.left,top:e.top}:Cl(Tl(t),n,s),ok=(t,e,n)=>t.kind==="header"&&e!==null?[{side:"left",value:e.left},{side:"top",value:e.top}]:nk(Tl(t),n),ak=(t,e,n,s)=>{const i=tk(Zn(t.edge),e,n);return{...Cl(Qn(t,i,s),i,s),...i}},Ml=1,lk=(t,e)=>Math.abs(t.left-e.left)<=Ml&&Math.abs(t.top-e.top)<=Ml,dk=(t,e,n)=>({top:t.top-n.top,right:n.left+n.width-(t.left+e.width),bottom:n.top+n.height-(t.top+e.height),left:t.left-n.left}),ck=(t,e,n)=>{const s=dk(t,e,n);let i="top";for(const r of $l)s[r]<s[i]&&(i=r);return i},pk=(t,e,n)=>{const s=ck(t,e,n),i=Zn(s)==="horizontal"?t.left-n.left:t.top-n.top;return{edge:s,offset:El(s,i,e,n)}},Ol=(t,e,n)=>({left:Math.round(t.box.left+e-t.startX),top:Math.round(t.box.top+n-t.startY)}),_l=(t,e,n,s)=>s&&t.top<n.top?Wt:{kind:"edge",dock:pk(t,e,n)},Pl={ArrowLeft:"left",ArrowRight:"right",ArrowUp:"top",ArrowDown:"bottom"},hk=(t,{key:e},n,s)=>{const i=Pl[e];if(i!==void 0)return Qn({edge:i,offset:t.offset},n,s);const{available:r,own:o}=Al(t.edge,n,s),a=Math.max(j.margin,r-o-j.margin);return e==="Home"?{edge:t.edge,offset:j.margin}:e==="End"?{edge:t.edge,offset:a}:null},uk=(t,e,n,s,i)=>{if(t.kind==="header"){const o=Pl[e.key];return o===void 0||o==="top"?null:{kind:"edge",dock:Qn({edge:o,offset:j.margin},n,s)}}if(i&&e.key==="ArrowUp"&&t.dock.edge==="top")return Wt;const r=hk(t.dock,e,n,s);return r===null?null:{kind:"edge",dock:r}},Ll=t=>{const e=t.getBoundingClientRect();return e.width===0&&e.height===0?null:{left:e.left,top:e.top,width:e.width,height:e.height}},gk=t=>typeof t=="string"&&$l.some(e=>e===t),fk=t=>{if(typeof t!="object"||t===null)return null;const{edge:e,offset:n}=t;return typeof n!="number"||!Number.isFinite(n)||!gk(e)?null:{edge:e,offset:Math.round(n)}},zl=t=>{if(typeof t!="object"||t===null)return null;const{kind:e,dock:n}=t;if(e==="header")return Wt;const s=fk(e==="edge"?n:t);return s===null?null:{kind:"edge",dock:s}},mk=t=>`dev-process-kit:menu:${t}`,$i=t=>t===null?{width:0,height:0}:{width:t.width,height:t.height},Si={kind:"idle"};class kk{constructor(e,n){this.#s=null,this.#t="",this.#i=null,this.#r=Si,this.#o="none",this.#a=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>this.#e.requestUpdate()),this.#l=null,this.toHeader=()=>{this.#i=Wt,this.#u(),this.#e.requestUpdate()},this.grip={pointerdown:s=>{if(s.button!==0)return;s.preventDefault(),s.currentTarget instanceof Element&&s.currentTarget.setPointerCapture(s.pointerId);const i=this.#h(),r=this.#p(i),o=$i(i.rect),a=i.rect===null?Rl(r,i.slot,o,i.area):{left:i.rect.left,top:i.rect.top};this.#r={kind:"dragging",pointerId:s.pointerId,drag:{startX:s.clientX,startY:s.clientY,box:a},size:o,orientation:Sl(r),box:a},this.#e.requestUpdate()},pointermove:s=>{const i=this.#r;i.kind!=="dragging"||i.pointerId!==s.pointerId||(this.#r={...i,box:Ol(i.drag,s.clientX,s.clientY)},this.#e.requestUpdate())},pointerup:s=>this.#c(s,s),pointercancel:s=>this.#c(s,s),lostpointercapture:s=>this.#c(s,null),keydown:s=>{const i=this.#h(),r=uk(this.#p(i),s,$i(i.rect),i.area,i.slot!==null);r!==null&&(s.preventDefault(),this.#i=r,this.#u(),this.#e.requestUpdate())}},this.#d=()=>{this.#e.requestUpdate()},this.#e=e,this.#n=n,e.addController(this)}#e;#n;#s;#t;#i;#r;#o;#a;#l;hostConnected(){if(this.#s===null){const e=this.#n.persistKey();this.#s=e===null?Z(zl):ue(zl),this.#t=mk(e??""),this.#i=this.#s.read(this.#t)??j.default}typeof window<"u"&&window.addEventListener("resize",this.#d)}hostDisconnected(){this.#r=Si,this.#a?.disconnect(),this.#l=null,typeof window<"u"&&window.removeEventListener("resize",this.#d)}hostUpdated(){this.#k(this.#n.surface());const e=this.#h(),n=this.#x(this.#p(e),e);if(e.rect!==null&&n!==null&&lk(e.rect,n)){this.#o="none";return}const s=e.rect===null?"unmeasurable":"misplaced";this.#o!==s&&(this.#o=s,queueMicrotask(()=>this.#e.requestUpdate()))}get placement(){const e=this.#h(),n=this.#p(e),s=this.#r,i=s.kind==="dragging"?_l(s.box,s.size,e.area,e.slot!==null):null,r=s.kind==="dragging"&&i?.kind==="edge"?ak(i.dock,s.size,s.orientation,e.area):null,o=s.kind==="dragging"?s.size:e.rect,a=o===null?null:ik(o);return{spot:n,box:this.#x(n,e),insets:ok(n,e.slot,e.area),drop:i,ghost:r,slot:rk(n,i,a)}}get dragging(){return this.#r.kind==="dragging"}#d;#c(e,n){const s=this.#r;if(s.kind!=="dragging"||s.pointerId!==e.pointerId)return;this.#r=Si;const i=this.#h(),r=n===null?s.box:Ol(s.drag,n.clientX,n.clientY);this.#i=_l(r,s.size,i.area,i.slot!==null),this.#u(),this.#e.requestUpdate()}#u(){this.#i!==null&&this.#s?.write(this.#t,this.#i)}#h(){const e=this.#n.surface(),n=this.#n.header();return{rect:e===null?null:Ll(e),slot:n===null?null:Ll(n),area:this.#n.area()}}#k(e){e!==this.#l&&(this.#l!==null&&this.#a?.unobserve(this.#l),this.#l=e,e!==null&&this.#a?.observe(e,{box:"border-box"}))}#p({rect:e,slot:n,area:s}){const i=this.#i??j.default;if(i.kind==="header"&&n!==null)return i;const r=i.kind==="edge"?i.dock:j.fallback;return{kind:"edge",dock:Qn(r,$i(e),s)}}#x(e,{rect:n,slot:s,area:i}){const r=this.#r;return r.kind==="dragging"?r.box:n===null?null:Rl(e,s,n,i)}}const bk=(t,e,n,s,i)=>{const r=Sl(e.spot),o=e.box;return m`${xk(e.ghost)}
1845
1847
  <div
1846
1848
  class="dpk-floating-menu"
1847
1849
  data-edge=${e.spot.kind==="header"?"header":e.spot.dock.edge}
1848
1850
  data-orientation=${r}
1849
1851
  ?data-dragging=${i}
1850
- style=${o===null?gk(e.insets):`left: ${o.left}px; top: ${o.top}px`}
1852
+ style=${o===null?wk(e.insets):`left: ${o.left}px; top: ${o.top}px`}
1851
1853
  role="group"
1852
1854
  aria-label=${t.menu}
1853
1855
  >
@@ -1863,12 +1865,12 @@ The brief is too long for a comment, so it is stored in this artifact's database
1863
1865
  @lostpointercapture=${s.grip.lostpointercapture}
1864
1866
  @keydown=${s.grip.keydown}
1865
1867
  >
1866
- ${r==="horizontal"?za():La()}
1868
+ ${r==="horizontal"?Ma():Ra()}
1867
1869
  </button>
1868
- ${n.undoRedo} ${Hl(r)}
1870
+ ${n.undoRedo} ${Il(r)}
1869
1871
  <div class="dpk-menu-tools">${n.checkMode} ${n.notices}</div>
1870
- ${Hl(r)} ${n.review}
1871
- </div>`},hk=(t,e,n)=>{const s=e.slot;return s.kind==="return"?k`<button
1872
+ ${Il(r)} ${n.review}
1873
+ </div>`},vk=(t,e,n)=>{const s=e.slot;return s.kind==="return"?m`<button
1872
1874
  class="dpk-chrome-action dpk-menu-slot dpk-menu-return"
1873
1875
  type="button"
1874
1876
  data-drop=${s.drop}
@@ -1876,17 +1878,17 @@ The brief is too long for a comment, so it is stored in this artifact's database
1876
1878
  data-tooltip=${t.menuReturn}
1877
1879
  @click=${n.toHeader}
1878
1880
  >
1879
- ${of()}
1880
- </button>`:k`<div
1881
+ ${uf()}
1882
+ </button>`:m`<div
1881
1883
  class="dpk-menu-slot"
1882
1884
  data-drop=${s.drop}
1883
1885
  style=${s.width===null?"":`width: ${s.width}px`}
1884
1886
  aria-hidden="true"
1885
- ></div>`},uk=t=>t===null?b:k`<div
1887
+ ></div>`},xk=t=>t===null?b:m`<div
1886
1888
  class="dpk-menu-drop"
1887
1889
  style="left: ${t.left}px; top: ${t.top}px; width: ${t.width}px; height: ${t.height}px"
1888
1890
  aria-hidden="true"
1889
- ></div>`,gk=t=>t.map(({side:e,value:n})=>`${e}: ${n}px`).join("; "),Hl=t=>t==="horizontal"?k`<span class="dpk-menu-separator" role="separator" aria-orientation="vertical"></span>`:k`<span class="dpk-menu-separator" role="separator" aria-orientation="horizontal"></span>`,jl=z`
1891
+ ></div>`,wk=t=>t.map(({side:e,value:n})=>`${e}: ${n}px`).join("; "),Il=t=>t==="horizontal"?m`<span class="dpk-menu-separator" role="separator" aria-orientation="vertical"></span>`:m`<span class="dpk-menu-separator" role="separator" aria-orientation="horizontal"></span>`,Dl=P`
1890
1892
  .dpk-floating-menu {
1891
1893
  position: fixed;
1892
1894
  z-index: 50;
@@ -2044,7 +2046,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
2044
2046
  display: none;
2045
2047
  }
2046
2048
  }
2047
- `,fk=t=>{const e=[t];t.shadowRoot&&e.push(t.shadowRoot);for(const n of t.querySelectorAll("*"))n.shadowRoot&&e.push(n.shadowRoot);return e},mk=(t,e,n,s,i=(r,o)=>[o])=>{if(e.questions.length===0)return[];const r=new Map(e.questions.map(a=>[a.ref,a])),o=[];for(const a of fk(t))for(const l of a.querySelectorAll(`[${jt}]`)){const c=l.getAttribute(jt)??"";for(const d of c.split(/\s+/)){const h=i(l,d).map(f=>r.get(f)).find(f=>f!==void 0);h&&o.push({index:o.length,target:l,questionId:h.id,ref:h.ref,title:h.title,answered:qn(h,n[h.id]),open:h.id===s})}}return o},kk=`
2049
+ `,yk=t=>{const e=[t];t.shadowRoot&&e.push(t.shadowRoot);for(const n of t.querySelectorAll("*"))n.shadowRoot&&e.push(n.shadowRoot);return e},$k=(t,e,n,s,i=(r,o)=>[o])=>{if(e.questions.length===0)return[];const r=new Map(e.questions.map(a=>[a.ref,a])),o=[];for(const a of yk(t))for(const l of a.querySelectorAll(`[${Nt}]`)){const p=l.getAttribute(Nt)??"";for(const h of p.split(/\s+/)){const d=i(l,h).map(f=>r.get(f)).find(f=>f!==void 0);d&&o.push({index:o.length,target:l,questionId:d.id,ref:d.ref,title:d.title,answered:Pn(d,n[d.id]),open:d.id===s})}}return o},Sk=`
2048
2050
  .dpk-grill-badge {
2049
2051
  position: absolute;
2050
2052
  display: inline-flex;
@@ -2101,27 +2103,27 @@ The brief is too long for a comment, so it is stored in this artifact's database
2101
2103
  transition: none;
2102
2104
  }
2103
2105
  }
2104
- `,Bl={childList:!0,subtree:!0,attributes:!0,attributeFilter:[jt]},Fl="dpk-grill-portal",bk=t=>((t instanceof Element?t:t?.parentElement??null)?.closest(`.${Fl}`)??null)!==null;class vk extends yl{#e;#s;#t=null;#n="";constructor(e,n){super(e,{active:n.active,bindings:n.bindings,spec:{portalClass:Fl,styles:kk,keyOf:s=>`${s.index}:${s.ref}`,create:s=>{const i=document.createElement("button");return i.type="button",i.className="dpk-grill-badge",i.dataset.badge=String(s.index),i.addEventListener("click",r=>{r.preventDefault(),r.stopPropagation(),n.open(i.dataset.question??"")}),i},update:(s,i)=>{const r=n.labelOf(i);s.dataset.badge=String(i.index),s.dataset.question=i.questionId,s.dataset.answered=String(i.answered),s.setAttribute("aria-pressed",String(i.open)),s.setAttribute("aria-label",r),s.title=`${i.ref} \xB7 ${i.title}`,s.textContent!==i.ref&&(s.textContent=i.ref)},gutterOf:s=>n.gutterOf(s.target)}}),this.#e=e,this.#s=n}hostDisconnected(){super.hostDisconnected(),this.#t?.disconnect(),this.#t=null}hostUpdated(){if(this.#t?.disconnect(),!this.#s.active()){super.hostUpdated();return}const e=this.#i();e!==this.#n&&(this.#n=e,this.#e.requestUpdate()),this.#t??=new MutationObserver(n=>{n.every(s=>bk(s.target))||(this.#e.requestUpdate(),this.refresh())}),this.#t.observe(this.#e,Bl);for(const n of this.#e.querySelectorAll("*"))n.shadowRoot&&this.#t.observe(n.shadowRoot,Bl);super.hostUpdated()}#i(){const e=this.#e.shadowRoot?.querySelectorAll(`[${jt}]`)??[];return Array.from(e,n=>n.getAttribute(jt)??"").join("|")}}const Ri=(t,e)=>e!==null&&dt(t,e)?e:t.questions[0]?.id??null,xk=(t,e)=>e!=="current"&&t.rounds[e]!==void 0?e:"current",Gl=(t,e)=>t.options.map((n,s)=>({id:n.id,letter:ag(s),label:n.label,checked:e?.kind==="option"&&e.optionId===n.id})),yk=(t,e,n)=>{if(e.rounds.length===0)return[];const s=e.rounds.map((i,r)=>({value:String(r),label:t.grillRoundOption(i.label,i.questions.length),selected:n===r}));return[{value:"current",label:t.grillRoundOption(t.grillCurrentRound,e.questions.length),selected:n==="current"},...s.reverse()]},wk=(t,e,n,s)=>{const i=ua(e,n),r=xk(e,s.round),o=yk(t,e,r),a=t.grillProgress(i.answered,i.total),l=r==="current"?void 0:e.rounds[r];if(l!==void 0)return{progress:a,rounds:o,view:{kind:"past",note:t.grillPastRound(l.label),questions:l.questions.map(d=>{const h=Nn(d,d.answer);return{id:d.id,ref:d.ref,title:d.title,description:d.description,note:d.note,answered:h!=="",summary:h===""?t.grillUnanswered:h,choices:Gl(d,d.answer),freeText:d.answer?.kind==="free"?d.answer.text:null}})}};const c=Ri(e,s.open);return{progress:a,rounds:o,view:{kind:"current",questions:e.questions.map(d=>{const h=n[d.id],f=Nn(d,h);return{id:d.id,ref:d.ref,title:d.title,description:d.description,note:d.note,open:d.id===c,answered:f!=="",summary:f,choices:Gl(d,h),draft:h?.kind==="free"?h.text:"",freeSelected:h?.kind==="free",allowFreeText:d.freeText}})}}},$k=(t,e,n,s,i)=>k`
2106
+ `,Nl={childList:!0,subtree:!0,attributes:!0,attributeFilter:[Nt]},ql="dpk-grill-portal",Ak=t=>((t instanceof Element?t:t?.parentElement??null)?.closest(`.${ql}`)??null)!==null;class Ek extends ml{#e;#n;#s=null;#t="";constructor(e,n){super(e,{active:n.active,bindings:n.bindings,spec:{portalClass:ql,styles:Sk,keyOf:s=>`${s.index}:${s.ref}`,create:s=>{const i=document.createElement("button");return i.type="button",i.className="dpk-grill-badge",i.dataset.badge=String(s.index),i.addEventListener("click",r=>{r.preventDefault(),r.stopPropagation(),n.open(i.dataset.question??"")}),i},update:(s,i)=>{const r=n.labelOf(i);s.dataset.badge=String(i.index),s.dataset.question=i.questionId,s.dataset.answered=String(i.answered),s.setAttribute("aria-pressed",String(i.open)),s.setAttribute("aria-label",r),s.title=`${i.ref} \xB7 ${i.title}`,s.textContent!==i.ref&&(s.textContent=i.ref)},gutterOf:s=>n.gutterOf(s.target)}}),this.#e=e,this.#n=n}hostDisconnected(){super.hostDisconnected(),this.#s?.disconnect(),this.#s=null}hostUpdated(){if(this.#s?.disconnect(),!this.#n.active()){super.hostUpdated();return}const e=this.#i();e!==this.#t&&(this.#t=e,this.#e.requestUpdate()),this.#s??=new MutationObserver(n=>{n.every(s=>Ak(s.target))||(this.#e.requestUpdate(),this.refresh())}),this.#s.observe(this.#e,Nl);for(const n of this.#e.querySelectorAll("*"))n.shadowRoot&&this.#s.observe(n.shadowRoot,Nl);super.hostUpdated()}#i(){const e=this.#e.shadowRoot?.querySelectorAll(`[${Nt}]`)??[];return Array.from(e,n=>n.getAttribute(Nt)??"").join("|")}}const Ai=(t,e)=>e!==null&&it(t,e)?e:t.questions[0]?.id??null,Ck=(t,e)=>e!=="current"&&t.rounds[e]!==void 0?e:"current",Ul=(t,e)=>t.options.map((n,s)=>({id:n.id,letter:ig(s),label:n.label,checked:e?.kind==="option"&&e.optionId===n.id})),Tk=(t,e,n)=>{if(e.rounds.length===0)return[];const s=e.rounds.map((i,r)=>({value:String(r),label:t.grillRoundOption(i.label,i.questions.length),selected:n===r}));return[{value:"current",label:t.grillRoundOption(t.grillCurrentRound,e.questions.length),selected:n==="current"},...s.reverse()]},Rk=(t,e,n,s)=>{const i=ia(e,n),r=Ck(e,s.round),o=Tk(t,e,r),a=t.grillProgress(i.answered,i.total),l=r==="current"?void 0:e.rounds[r];if(l!==void 0)return{progress:a,rounds:o,view:{kind:"past",note:t.grillPastRound(l.label),questions:l.questions.map(h=>{const d=_n(h,h.answer);return{id:h.id,ref:h.ref,title:h.title,description:h.description,note:h.note,answered:d!=="",summary:d===""?t.grillUnanswered:d,choices:Ul(h,h.answer),freeText:h.answer?.kind==="free"?h.answer.text:null}})}};const p=Ai(e,s.open);return{progress:a,rounds:o,view:{kind:"current",questions:e.questions.map(h=>{const d=n[h.id],f=_n(h,d);return{id:h.id,ref:h.ref,title:h.title,description:h.description,note:h.note,open:h.id===p,answered:f!=="",summary:f,choices:Ul(h,d),draft:d?.kind==="free"?d.text:"",freeSelected:d?.kind==="free",allowFreeText:h.freeText}})}}},Mk=(t,e,n,s,i)=>m`
2105
2107
  <div class="dpk-grill">
2106
2108
  <header class="dpk-grill-head">
2107
2109
  <h2>${t.grill}</h2>
2108
2110
  <span class="dpk-grill-progress">${e.progress}</span>
2109
2111
  </header>
2110
- ${e.rounds.length===0?b:k`<div class="dpk-grill-rounds">
2112
+ ${e.rounds.length===0?b:m`<div class="dpk-grill-rounds">
2111
2113
  ${i.render({options:e.rounds,value:e.rounds.find(r=>r.selected)?.value??"current",onChange:r=>n.pickRound(r==="current"?"current":Number(r)),ariaLabel:t.grillRoundSelect,className:"dpk-grill-round"})}
2112
2114
  </div>`}
2113
2115
  <div class="dpk-grill-list">
2114
- ${e.view.kind==="past"?k`<p class="dpk-grill-round-note">${e.view.note}</p>`:b}
2115
- ${e.view.questions.length===0?k`<p class="dpk-grill-empty">${t.grillNoQuestions}</p>`:e.view.kind==="current"?Ke(e.view.questions,r=>r.id,r=>Sk(t,r,n)):Ke(e.view.questions,r=>r.id,Ek)}
2116
+ ${e.view.kind==="past"?m`<p class="dpk-grill-round-note">${e.view.note}</p>`:b}
2117
+ ${e.view.questions.length===0?m`<p class="dpk-grill-empty">${t.grillNoQuestions}</p>`:e.view.kind==="current"?Fe(e.view.questions,r=>r.id,r=>Ok(t,r,n)):Fe(e.view.questions,r=>r.id,Pk)}
2116
2118
  </div>
2117
2119
  ${s}
2118
2120
  </div>
2119
- `,Sk=(t,e,n)=>k`
2121
+ `,Ok=(t,e,n)=>m`
2120
2122
  <section
2121
2123
  class="dpk-grill-question"
2122
2124
  data-question=${e.id}
2123
2125
  data-answered=${String(e.answered)}
2124
- data-dpk-target=${P({type:le,id:e.id})}
2126
+ data-dpk-target=${_({type:re,id:e.id})}
2125
2127
  >
2126
2128
  <button
2127
2129
  class="dpk-grill-heading"
@@ -2133,16 +2135,16 @@ The brief is too long for a comment, so it is stored in this artifact's database
2133
2135
  <span class="dpk-grill-ref">${e.ref}</span>
2134
2136
  <span class="dpk-grill-heading-text">
2135
2137
  <strong>${e.title}</strong>
2136
- ${!e.open&&e.answered?k`<span class="dpk-grill-summary">${e.summary}</span>`:b}
2138
+ ${!e.open&&e.answered?m`<span class="dpk-grill-summary">${e.summary}</span>`:b}
2137
2139
  </span>
2138
- <span class="dpk-grill-chevron" aria-hidden="true">${Gt()}</span>
2140
+ <span class="dpk-grill-chevron" aria-hidden="true">${Bt()}</span>
2139
2141
  </button>
2140
- ${e.open?k`<div class="dpk-grill-body" id=${`dpk-grill-body-${e.id}`}>
2141
- ${e.description?k`<p class="dpk-grill-description">${e.description}</p>`:b}
2142
- ${e.note?k`<p class="dpk-grill-note">${e.note}</p>`:b}
2142
+ ${e.open?m`<div class="dpk-grill-body" id=${`dpk-grill-body-${e.id}`}>
2143
+ ${e.description?m`<p class="dpk-grill-description">${e.description}</p>`:b}
2144
+ ${e.note?m`<p class="dpk-grill-note">${e.note}</p>`:b}
2143
2145
  <div class="dpk-grill-choices" role="radiogroup" aria-label=${e.title}>
2144
- ${e.choices.map(s=>Ak(e.id,s,n))}
2145
- ${e.allowFreeText?k`<label class="dpk-grill-choice" data-free=${String(e.freeSelected)}>
2146
+ ${e.choices.map(s=>_k(e.id,s,n))}
2147
+ ${e.allowFreeText?m`<label class="dpk-grill-choice" data-free=${String(e.freeSelected)}>
2146
2148
  <input
2147
2149
  type="radio"
2148
2150
  name=${`dpk-grill-${e.id}`}
@@ -2153,7 +2155,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
2153
2155
  <span class="dpk-grill-choice-text">${t.grillFreeText}</span>
2154
2156
  </label>`:b}
2155
2157
  </div>
2156
- ${e.allowFreeText?k`<textarea
2158
+ ${e.allowFreeText?m`<textarea
2157
2159
  class="dpk-textarea dpk-grill-free"
2158
2160
  data-free-text=${e.id}
2159
2161
  aria-label=${t.grillFreeTextOf(e.ref)}
@@ -2163,7 +2165,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
2163
2165
  @input=${s=>{const i=s.currentTarget;i instanceof HTMLTextAreaElement&&n.answer(e.id,{kind:"free",text:i.value})}}
2164
2166
  @keydown=${s=>{s.isComposing||!(s.metaKey||s.ctrlKey)||s.key!=="Enter"||(s.preventDefault(),n.next(e.id))}}
2165
2167
  ></textarea>`:b}
2166
- ${e.answered||e.freeSelected?k`<button
2168
+ ${e.answered||e.freeSelected?m`<button
2167
2169
  type="button"
2168
2170
  class="dpk-grill-clear"
2169
2171
  @click=${()=>n.answer(e.id,{kind:"clear"})}
@@ -2172,7 +2174,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
2172
2174
  </button>`:b}
2173
2175
  </div>`:b}
2174
2176
  </section>
2175
- `,Ak=(t,e,n)=>k`
2177
+ `,_k=(t,e,n)=>m`
2176
2178
  <label class="dpk-grill-choice" data-choice=${e.id}>
2177
2179
  <input
2178
2180
  type="radio"
@@ -2186,7 +2188,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
2186
2188
  <span>${e.label}</span>
2187
2189
  </span>
2188
2190
  </label>
2189
- `,Ek=t=>k`
2191
+ `,Pk=t=>m`
2190
2192
  <details class="dpk-grill-question" data-past data-question=${t.id} data-answered=${String(t.answered)}>
2191
2193
  <summary class="dpk-grill-heading">
2192
2194
  <span class="dpk-grill-ref">${t.ref}</span>
@@ -2194,21 +2196,21 @@ The brief is too long for a comment, so it is stored in this artifact's database
2194
2196
  <strong>${t.title}</strong>
2195
2197
  <span class="dpk-grill-summary">${t.summary}</span>
2196
2198
  </span>
2197
- <span class="dpk-grill-chevron" aria-hidden="true">${Gt()}</span>
2199
+ <span class="dpk-grill-chevron" aria-hidden="true">${Bt()}</span>
2198
2200
  </summary>
2199
2201
  <div class="dpk-grill-body">
2200
- ${t.description?k`<p class="dpk-grill-description">${t.description}</p>`:b}
2201
- ${t.note?k`<p class="dpk-grill-note">${t.note}</p>`:b}
2202
- ${t.choices.length===0?b:k`<ul class="dpk-grill-past-choices">
2203
- ${t.choices.map(e=>k`<li class="dpk-grill-past-choice" data-checked=${String(e.checked)}>
2202
+ ${t.description?m`<p class="dpk-grill-description">${t.description}</p>`:b}
2203
+ ${t.note?m`<p class="dpk-grill-note">${t.note}</p>`:b}
2204
+ ${t.choices.length===0?b:m`<ul class="dpk-grill-past-choices">
2205
+ ${t.choices.map(e=>m`<li class="dpk-grill-past-choice" data-checked=${String(e.checked)}>
2204
2206
  <span class="dpk-grill-letter">(${e.letter})</span>
2205
2207
  <span>${e.label}</span>
2206
2208
  </li>`)}
2207
2209
  </ul>`}
2208
- ${t.freeText===null?b:k`<p class="dpk-grill-past-choice" data-checked="true">${t.freeText}</p>`}
2210
+ ${t.freeText===null?b:m`<p class="dpk-grill-past-choice" data-checked="true">${t.freeText}</p>`}
2209
2211
  </div>
2210
2212
  </details>
2211
- `,Ck=2400;class Tk{#e=Kg();#s=null;#t;constructor(e){this.#t=e,e.addController(this)}get state(){return this.#e}hostDisconnected(){this.#r()}async copy(e){this.#n({kind:"copy-started"});const n=this.#e.request,s=await On(e()).catch(()=>!1);this.#n({kind:"copy-finished",request:n,ok:s}),this.#i(n)}async send(e){if(this.#e.status.kind==="sending")return;this.#n({kind:"send-started"});const n=this.#e.request,s=await e().catch(()=>({ok:!1,reason:"error"}));this.#n({kind:"send-finished",request:n,outcome:s}),s.ok&&this.#i(n)}#n(e){(e.kind==="copy-started"||e.kind==="send-started")&&this.#r(),this.#e=Vg(this.#e,e),this.#t.requestUpdate()}#i(e){e===this.#e.request&&(this.#r(),this.#s=setTimeout(()=>{this.#s=null,this.#n({kind:"settled",request:e})},Ck))}#r(){this.#s!==null&&clearTimeout(this.#s),this.#s=null}}class Rk{#e;#s;#t=null;#n=null;constructor(e,n){this.#e=e,this.#s=n,e.addController(this)}hostConnected(){this.#t=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>this.#i())}hostUpdated(){const e=this.#s();if(e===this.#n){e&&this.#i();return}this.#n&&this.#t?.unobserve(this.#n),this.#n=e,e?(this.#t?.observe(e),this.#i()):this.#e.style.removeProperty("--dpk-header-height")}hostDisconnected(){this.#t?.disconnect(),this.#t=null,this.#n=null}#i(){this.#n&&this.#e.style.setProperty("--dpk-header-height",`${this.#n.getBoundingClientRect().height}px`)}}const _i="dev-process-kit:locale";class _k{#e;#s;#t;#n;#i=null;#r=null;#o;#a;constructor(e,n,s,i){this.#e=e,this.#s=n,this.#t=s,this.#n=i,e.addController(this)}get authored(){if(this.#o===void 0)return zn(Ln(this.#e));const e=this.#e.parentNode;return zn(this.#o??(e===null?null:Ln(e)))}get locale(){return this.#a??this.#l()}#l(){return $u({preference:this.#r,authored:this.authored})}hostConnected(){this.#t()&&(this.#i===null&&(this.#i=this.#s()?fe(Jo):X(Jo),this.#r=this.#i.read(_i)),this.#o??=this.#e.getAttribute("lang"),this.#d())}pick(e){this.#t()&&(this.#r=Su(e,this.authored),this.#r===null?this.#i?.remove(_i):this.#i?.write(_i,this.#r),this.#d(),this.#e.requestUpdate())}#d(){const e=this.#r??this.#o??null;e===null?this.#e.removeAttribute("lang"):this.#e.getAttribute("lang")!==e&&this.#e.setAttribute("lang",e);const n=this.#l();if(n===this.#a)return;const s=this.#a===void 0;this.#a=n,this.#n(),(!s||this.#r!==null)&&document.dispatchEvent(new Event(Qs))}}const Wl=()=>xn(typeof location>"u"?"":location.hash),Mk=(t,e)=>{if(typeof history>"u")return;const n=`${location.pathname}${location.search}${nt(t)}`;`${location.pathname}${location.search}${location.hash}`!==n&&(e?history.replaceState(null,"",n):history.pushState(null,"",n))},xt=(t,e)=>t instanceof e?t:null;class Ok{#e;#s=null;#t=0;constructor(e){this.#e=e}get orphans(){return this.#t}route(){const e=this.#e.renderRoot,n=xt(e.querySelector('slot[name="preview"]'),HTMLSlotElement);if(n===null)return;this.#s!==n&&(this.#s=n,n.addEventListener("slotchange",this.#n));const s=new Set(Array.from(e.querySelectorAll("slot")).map(r=>r.getAttribute("name")??"")),i=n.assignedElements();for(const r of i){const o=r.getAttribute("data-preview-id");if(!o)continue;const a=`preview:${o}`;r.getAttribute("slot")!==a&&s.has(a)&&r.setAttribute("slot",a)}i.length!==this.#t&&(this.#t=i.length,queueMicrotask(()=>this.#e.requestUpdate()))}#n=()=>{queueMicrotask(()=>this.route())}}const Mi=16,Pk=(t,e)=>t-e.bottom-Mi,Lk=t=>t.top-Mi,zk=(t,e)=>{const n=Pk(t,e),s=Lk(e),i=n>=s,r=i?n:s;return{placement:i?"bottom-end":"top-end",height:Math.max(0,Math.min(t-2*Mi,r))}},Dk=440,Kl=(t,e)=>e!==null&&t.includes(e);class Ik{#e;#s=null;constructor(e,n){this.#e=n,e.addController(this)}hostConnected(){window.addEventListener("keydown",this.#n),document.addEventListener("pointerdown",this.#i,!0)}hostUpdated(){const e=this.#e.surface(),n=this.#e.open()&&e!==null;if(n!==(this.#s!==null)){if(n){const s=this.#e.anchor()??{top:0,bottom:0,right:window.innerWidth},i=s instanceof Element?s.getBoundingClientRect():s,{placement:r,height:o}=zk(window.innerHeight,i);this.#s=Gs(e,s,{width:Dk,height:o},{placement:r});return}this.#t(),Mn(e)}}hostDisconnected(){window.removeEventListener("keydown",this.#n),document.removeEventListener("pointerdown",this.#i,!0),this.#t()}#t(){this.#s?.(),this.#s=null}#n=e=>{e.key!=="Escape"||e.defaultPrevented||e.isComposing||!this.#e.open()||this.#e.close()};#i=e=>{if(e.button!==0||!this.#e.open())return;const n=e.composedPath();Kl(n,this.#e.surface())||Kl(n,this.#e.trigger())||this.#e.close()}}const Nk=t=>k`
2213
+ `,Lk=2400;class zk{#e=ef();#n=null;#s;constructor(e){this.#s=e,e.addController(this)}get state(){return this.#e}hostDisconnected(){this.#r()}async copy(e){this.#t({kind:"copy-started"});const n=this.#e.request,s=await En(e()).catch(()=>!1);this.#t({kind:"copy-finished",request:n,ok:s}),this.#i(n)}async send(e){if(this.#e.status.kind==="sending")return;this.#t({kind:"send-started"});const n=this.#e.request,s=await e().catch(()=>({ok:!1,reason:"error"}));this.#t({kind:"send-finished",request:n,outcome:s}),s.ok&&this.#i(n)}#t(e){(e.kind==="copy-started"||e.kind==="send-started")&&this.#r(),this.#e=tf(this.#e,e),this.#s.requestUpdate()}#i(e){e===this.#e.request&&(this.#r(),this.#n=setTimeout(()=>{this.#n=null,this.#t({kind:"settled",request:e})},Lk))}#r(){this.#n!==null&&clearTimeout(this.#n),this.#n=null}}class Ik{#e;#n;#s=null;#t=null;constructor(e,n){this.#e=e,this.#n=n,e.addController(this)}hostConnected(){this.#s=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>this.#i())}hostUpdated(){const e=this.#n();if(e===this.#t){e&&this.#i();return}this.#t&&this.#s?.unobserve(this.#t),this.#t=e,e?(this.#s?.observe(e),this.#i()):this.#e.style.removeProperty("--dpk-header-height")}hostDisconnected(){this.#s?.disconnect(),this.#s=null,this.#t=null}#i(){this.#t&&this.#e.style.setProperty("--dpk-header-height",`${this.#t.getBoundingClientRect().height}px`)}}const Ei="dev-process-kit:locale";class Dk{#e;#n;#s;#t;#i=null;#r=null;#o;#a;constructor(e,n,s,i){this.#e=e,this.#n=n,this.#s=s,this.#t=i,e.addController(this)}get authored(){if(this.#o===void 0)return Rn(Tn(this.#e));const e=this.#e.parentNode;return Rn(this.#o??(e===null?null:Tn(e)))}get locale(){return this.#a??this.#l()}#l(){return xu({preference:this.#r,authored:this.authored})}hostConnected(){this.#s()&&(this.#i===null&&(this.#i=this.#n()?ue(Fo):Z(Fo),this.#r=this.#i.read(Ei)),this.#o??=this.#e.getAttribute("lang"),this.#d())}pick(e){this.#s()&&(this.#r=wu(e,this.authored),this.#r===null?this.#i?.remove(Ei):this.#i?.write(Ei,this.#r),this.#d(),this.#e.requestUpdate())}#d(){const e=this.#r??this.#o??null;e===null?this.#e.removeAttribute("lang"):this.#e.getAttribute("lang")!==e&&this.#e.setAttribute("lang",e);const n=this.#l();if(n===this.#a)return;const s=this.#a===void 0;this.#a=n,this.#t(),(!s||this.#r!==null)&&document.dispatchEvent(new Event(Fs))}}const Hl=()=>un(typeof location>"u"?"":location.hash),Nk=(t,e)=>{if(typeof history>"u")return;const n=`${location.pathname}${location.search}${Qe(t)}`;`${location.pathname}${location.search}${location.hash}`!==n&&(e?history.replaceState(null,"",n):history.pushState(null,"",n))},ft=(t,e)=>t instanceof e?t:null;class qk{#e;#n=null;#s=0;constructor(e){this.#e=e}get orphans(){return this.#s}route(){const e=this.#e.renderRoot,n=ft(e.querySelector('slot[name="preview"]'),HTMLSlotElement);if(n===null)return;this.#n!==n&&(this.#n=n,n.addEventListener("slotchange",this.#t));const s=new Set(Array.from(e.querySelectorAll("slot")).map(r=>r.getAttribute("name")??"")),i=n.assignedElements();for(const r of i){const o=r.getAttribute("data-preview-id");if(!o)continue;const a=`preview:${o}`;r.getAttribute("slot")!==a&&s.has(a)&&r.setAttribute("slot",a)}i.length!==this.#s&&(this.#s=i.length,queueMicrotask(()=>this.#e.requestUpdate()))}#t=()=>{queueMicrotask(()=>this.route())}}const Ci=16,Uk=(t,e)=>t-e.bottom-Ci,Hk=t=>t.top-Ci,Bk=(t,e)=>{const n=Uk(t,e),s=Hk(e),i=n>=s,r=i?n:s;return{placement:i?"bottom-end":"top-end",height:Math.max(0,Math.min(t-2*Ci,r))}},jk=440,Bl=(t,e)=>e!==null&&t.includes(e);class Fk{#e;#n=null;constructor(e,n){this.#e=n,e.addController(this)}hostConnected(){window.addEventListener("keydown",this.#t),document.addEventListener("pointerdown",this.#i,!0)}hostUpdated(){const e=this.#e.surface(),n=this.#e.open()&&e!==null;if(n!==(this.#n!==null)){if(n){const s=this.#e.anchor()??{top:0,bottom:0,right:window.innerWidth},i=s instanceof Element?s.getBoundingClientRect():s,{placement:r,height:o}=Bk(window.innerHeight,i);this.#n=Ns(e,s,{width:jk,height:o},{placement:r});return}this.#s(),An(e)}}hostDisconnected(){window.removeEventListener("keydown",this.#t),document.removeEventListener("pointerdown",this.#i,!0),this.#s()}#s(){this.#n?.(),this.#n=null}#t=e=>{e.key!=="Escape"||e.defaultPrevented||e.isComposing||!this.#e.open()||this.#e.close()};#i=e=>{if(e.button!==0||!this.#e.open())return;const n=e.composedPath();Bl(n,this.#e.surface())||Bl(n,this.#e.trigger())||this.#e.close()}}const Gk=t=>m`
2212
2214
  <dialog
2213
2215
  id=${t.id??b}
2214
2216
  class="dpk-dialog"
@@ -2232,28 +2234,28 @@ The brief is too long for a comment, so it is stored in this artifact's database
2232
2234
  title=${t.closeLabel}
2233
2235
  @click=${()=>t.controller.dismiss("close")}
2234
2236
  >
2235
- ${ct()}
2237
+ ${ot()}
2236
2238
  </button>
2237
2239
  </header>
2238
2240
  ${t.nav===void 0?b:t.nav}
2239
2241
  <div class="dpk-dialog-body" part="body">${t.content}</div>
2240
- ${t.footer===void 0?b:k`<footer class="dpk-dialog-footer" part="footer" ?hidden=${t.footerHidden??!1}>
2242
+ ${t.footer===void 0?b:m`<footer class="dpk-dialog-footer" part="footer" ?hidden=${t.footerHidden??!1}>
2241
2243
  ${t.footer}
2242
2244
  </footer>`}
2243
2245
  </dialog>
2244
- `,Oi="dpk-settings",Zt="display",qk="appearance",Uk=(t,e)=>k`<button
2246
+ `,Ti="dpk-settings",Kt="display",Wk="appearance",Kk=(t,e)=>m`<button
2245
2247
  class="dpk-chrome-action dpk-settings-trigger"
2246
2248
  type="button"
2247
- aria-controls=${Oi}
2249
+ aria-controls=${Ti}
2248
2250
  aria-haspopup="dialog"
2249
2251
  aria-expanded=${e.open?"true":"false"}
2250
2252
  aria-label=${t.settings}
2251
2253
  data-tooltip=${t.settings}
2252
2254
  @click=${e.toggle}
2253
2255
  >
2254
- ${tf()}
2255
- </button>`,Hk=(t,e,n,s)=>t.length<2?b:k`<nav class="dpk-dialog-nav" part="nav" aria-label=${n}>
2256
- ${t.map(i=>k`<button
2256
+ ${df()}
2257
+ </button>`,Vk=(t,e,n,s)=>t.length<2?b:m`<nav class="dpk-dialog-nav" part="nav" aria-label=${n}>
2258
+ ${t.map(i=>m`<button
2257
2259
  class="dpk-dialog-nav-item"
2258
2260
  type="button"
2259
2261
  data-section=${i.id}
@@ -2262,12 +2264,12 @@ The brief is too long for a comment, so it is stored in this artifact's database
2262
2264
  >
2263
2265
  ${i.label}
2264
2266
  </button>`)}
2265
- </nav>`,jk=t=>{const e=Bk(t.sections),n=e.find(r=>r.id===t.activeSection)??e[0],s=n?.id??Zt,i=n===void 0?b:n.id===Zt?t.display:n.render();return Nk({id:t.id,size:"md",fixedHeight:e.length>1,label:t.label,closeLabel:t.closeLabel,controller:t.controller,nav:Hk(e,s,t.sectionsLabel,t.onPick),content:t.open?i:b,footer:t.open?t.footer:void 0})},Bk=t=>{const e=new Set,n=[];for(const s of t)e.has(s.id)||(e.add(s.id),n.push(s));return n},Fk=(t,e,n)=>k`
2267
+ </nav>`,Yk=t=>{const e=Zk(t.sections),n=e.find(r=>r.id===t.activeSection)??e[0],s=n?.id??Kt,i=n===void 0?b:n.id===Kt?t.display:n.render();return Gk({id:t.id,size:"md",fixedHeight:e.length>1,label:t.label,closeLabel:t.closeLabel,controller:t.controller,nav:Vk(e,s,t.sectionsLabel,t.onPick),content:t.open?i:b,footer:t.open?t.footer:void 0})},Zk=t=>{const e=new Set,n=[];for(const s of t)e.has(s.id)||(e.add(s.id),n.push(s));return n},Qk=(t,e,n)=>m`
2266
2268
  <div class="dpk-settings-list" role="group" aria-label=${e.settings}>
2267
- ${t.items.map(s=>Gk(s,n))}
2269
+ ${t.items.map(s=>Xk(s,n))}
2268
2270
  </div>
2269
- ${t.note===void 0?b:k`<p class="dpk-settings-note">${t.note}</p>`}
2270
- `,Gk=(t,e)=>k`<button
2271
+ ${t.note===void 0?b:m`<p class="dpk-settings-note">${t.note}</p>`}
2272
+ `,Xk=(t,e)=>m`<button
2271
2273
  class="dpk-settings-option"
2272
2274
  type="button"
2273
2275
  role="switch"
@@ -2275,12 +2277,12 @@ The brief is too long for a comment, so it is stored in this artifact's database
2275
2277
  aria-checked=${t.on?"true":"false"}
2276
2278
  @click=${()=>e(t.toggle)}
2277
2279
  >
2278
- <span class="dpk-settings-check" aria-hidden="true">${t.on?pt():b}</span>
2280
+ <span class="dpk-settings-check" aria-hidden="true">${t.on?at():b}</span>
2279
2281
  <span class="dpk-settings-text">
2280
2282
  <span class="dpk-settings-name">${t.label}</span>
2281
- ${t.hint===void 0?b:k`<span class="dpk-settings-hint">${t.hint}</span>`}
2283
+ ${t.hint===void 0?b:m`<span class="dpk-settings-hint">${t.hint}</span>`}
2282
2284
  </span>
2283
- </button>`,Vl=z`
2285
+ </button>`,jl=P`
2284
2286
  .dpk-settings-list {
2285
2287
  display: grid;
2286
2288
  gap: 2px;
@@ -2342,7 +2344,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
2342
2344
  outline: none;
2343
2345
  box-shadow: var(--dpk-focus);
2344
2346
  }
2345
- `,Yl=[ft,pi,z`
2347
+ `,Fl=[pt,ai,P`
2346
2348
  :host {
2347
2349
  display: block;
2348
2350
  min-height: 100%;
@@ -2471,6 +2473,30 @@ The brief is too long for a comment, so it is stored in this artifact's database
2471
2473
  gap: 10px;
2472
2474
  }
2473
2475
 
2476
+ /* Where sharing the draft stands, only while a host shares it. */
2477
+ .dpk-sync-status {
2478
+ flex: none;
2479
+ padding: 3px 9px;
2480
+ border: 1px solid var(--dpk-rule);
2481
+ border-radius: 999px;
2482
+ font-size: 11.5px;
2483
+ font-weight: 520;
2484
+ color: var(--dpk-ink-soft);
2485
+ white-space: nowrap;
2486
+ }
2487
+
2488
+ .dpk-sync-status[data-status='pending'],
2489
+ .dpk-sync-status[data-status='offline'] {
2490
+ border-color: color-mix(in srgb, var(--dpk-amber) 40%, transparent);
2491
+ background: var(--dpk-amber-soft);
2492
+ color: var(--dpk-amber);
2493
+ }
2494
+
2495
+ .dpk-sync-status[data-status='error'] {
2496
+ border-color: color-mix(in srgb, var(--dpk-danger) 40%, transparent);
2497
+ color: var(--dpk-danger);
2498
+ }
2499
+
2474
2500
  /* The reader's own controls, in one pill at the end of the row: the
2475
2501
  language select and the theme toggle. */
2476
2502
  .dpk-header-tools {
@@ -3901,7 +3927,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
3901
3927
  order: 1;
3902
3928
  }
3903
3929
  }
3904
- `],de={default:320,min:140,step:24,largeStep:96},Wk=160,Zl=800,Pi=t=>Math.max(de.min,Math.round(t-Wk)),yt=(t,e)=>Math.round(Math.min(Pi(e),Math.max(de.min,t))),Kk=(t,e,n)=>yt(t.startHeight+t.startY-e,n),Vk=(t,{key:e,shiftKey:n},s)=>{const i=n?de.largeStep:de.step;switch(e){case"ArrowUp":return yt(t+i,s);case"ArrowDown":return yt(t-i,s);case"Home":return yt(de.min,s);case"End":return Pi(s);default:return null}},Ql=t=>typeof t=="number"&&Number.isFinite(t)&&t>=de.min?Math.round(t):null,Yk=()=>typeof window>"u"?Zl:window.innerHeight||document.documentElement.clientHeight||Zl,Zk=t=>`dev-process-kit:supplements-height:${t}`,Li={kind:"idle"};class Qk{constructor(e,n){this.#t=null,this.#n="",this.#i=null,this.#r=Li,this.handlers={pointerdown:s=>{s.button===0&&(s.preventDefault(),s.currentTarget instanceof Element&&s.currentTarget.setPointerCapture(s.pointerId),this.#r={kind:"dragging",pointerId:s.pointerId,startY:s.clientY,startHeight:this.height},this.#e.requestUpdate())},pointermove:s=>{const i=this.#r;i.kind!=="dragging"||i.pointerId!==s.pointerId||this.#l(Kk(i,s.clientY,this.#c()))},pointerup:s=>this.#a(s),pointercancel:s=>this.#a(s),lostpointercapture:s=>this.#a(s),keydown:s=>{const i=Vk(this.height,s,this.#c());i!==null&&(s.preventDefault(),this.#l(i),this.#d())},dblclick:()=>{this.#l(de.default),this.#d()}},this.#o=()=>{this.#e.requestUpdate()},this.#e=e,this.#s=n,e.addController(this)}#e;#s;#t;#n;#i;#r;hostConnected(){if(this.#t===null){const e=this.#s.persistKey();this.#t=e===null?X(Ql):fe(Ql),this.#n=Zk(e??""),this.#i=this.#t.read(this.#n)}typeof window<"u"&&window.addEventListener("resize",this.#o)}hostDisconnected(){this.#r=Li,typeof window<"u"&&window.removeEventListener("resize",this.#o)}get height(){return yt(this.#i??de.default,this.#c())}get max(){return Pi(this.#c())}get dragging(){return this.#r.kind==="dragging"}#o;#a(e){const n=this.#r;n.kind!=="dragging"||n.pointerId!==e.pointerId||(this.#r=Li,this.#d(),this.#e.requestUpdate())}#l(e){const n=yt(e,this.#c()),s=n===de.default?null:n;s!==this.#i&&(this.#i=s,this.#e.requestUpdate())}#d(){this.#i===null?this.#t?.remove(this.#n):this.#t?.write(this.#n,this.#i)}#c(){return this.#s.viewportHeight?.()??Yk()}}const zi="supplement",Xl="memo",Xk=(t,e)=>[...t.children].filter(n=>n.getAttribute("slot")===zi).map(n=>{const s=n.getAttribute("data-name")?.trim()??"";return{name:s===""?e:s,element:n}}),Jk=(t,e)=>`.dpk-supplements-body ::slotted(:not(:nth-child(${[...t.children].indexOf(e.element)+1}))) { display: none !important; }`,eb={selected:null,open:!1},tb=(t,e)=>t.open?e.find(n=>n.element===t.selected)??null:null,nb=(t,e)=>({selected:e,open:!(t.open&&t.selected===e)}),sb=(t,e)=>t.open?{...t,open:!1}:{selected:e.some(s=>s.element===t.selected)?t.selected:e[0]?.element??null,open:!0},ib=30,rb=Oe(v(),R({base:v(),value:v()})),Jl=t=>{const e=C(rb,t);return e.success?e.output:null},ob=t=>t.key===void 0?JSON.stringify(["field",t.hosts,t.name,t.base]):JSON.stringify(["key",t.key,t.name]),ab=(t,e,n)=>{const{[e]:s,...i}=t;if(n.value===n.base)return i;const r=Object.entries({...i,[e]:n});return Object.fromEntries(r.slice(Math.max(0,r.length-ib)))},lb=(t,e)=>{if(!(e in t))return t;const{[e]:n,...s}=t;return s},db=(t,e,n)=>{const s=t[e];return s===void 0||s.base!==n||s.value===n?null:s.value},cb=new Set(["text","search","url","email","tel"]),ed=t=>t instanceof HTMLTextAreaElement||t instanceof HTMLInputElement&&cb.has(t.type)?t:null,pb=(t,e)=>{const n=[];let s=e.getRootNode();for(;s instanceof ShadowRoot;){if(s.host===t)return n;n.unshift(s.host.localName),s=s.host.getRootNode()}return null},hb=t=>{let e=t;for(;e!==null;){const n=e.getAttribute("data-dpk-text-key");if(n!==null&&n!=="")return n;const s=e.getRootNode();e=e.parentElement??(s instanceof ShadowRoot?s.host:null)}},ub=t=>t.composedPath().find(e=>e instanceof Element&&e.hasAttribute("data-dpk-text-discard"))??null,gb=(t,e)=>{const n=[...e];for(let s=t.parentElement;s!==null;s=s.parentElement){const i=n.filter(r=>s.contains(r));if(i.length>0)return i}return[]},fb=t=>t.getAttribute("aria-label")??(t.placeholder||t.name||t.localName),Di=t=>typeof t=="string"?[t]:Array.isArray(t)?t.flatMap(Di):typeof t=="object"&&t!==null?Object.values(t).flatMap(Di):[],td=t=>t.replace(/\s+/g," ").trim();class mb{#e;#s;#t=null;#n="";#i=new WeakMap;#r=new Set;constructor(e,n){this.#e=e,this.#s=n,e.addController(this)}hostConnected(){this.#t===null&&(this.#t=this.#s.persist()?Af(Jl):X(Jl),this.#n=this.#s.storageKey()),this.#e.addEventListener("focusin",this.#l),this.#e.addEventListener("input",this.#d),this.#e.addEventListener("click",this.#a,!0)}hostDisconnected(){this.#e.removeEventListener("focusin",this.#l),this.#e.removeEventListener("input",this.#d),this.#e.removeEventListener("click",this.#a,!0)}settle(e){const n=new Set(e.flatMap(Di).map(td));this.#o([...this.#r].filter(s=>n.has(td(s.value))))}#o(e){for(const n of e){this.#r.delete(n);const s=this.#i.get(n);s!==void 0&&this.#p(lb(this.#c(),s.id))}}#a=e=>{const n=ub(e);n!==null&&this.#o(gb(n,this.#r))};#l=e=>{const n=ed(e.composedPath()[0]);if(n===null||this.#r.has(n))return;const s=pb(this.#e,n);if(s===null)return;const i=hb(n),r=n.value,o=ob({...i===void 0?{}:{key:i},hosts:s,name:fb(n),base:r});this.#i.set(n,{id:o,base:r});const a=db(this.#c(),o,r);a!==null&&queueMicrotask(()=>{if(n.value===r){n.value=a;try{n.setSelectionRange(a.length,a.length)}catch{}this.#r.add(n),n.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}})};#d=e=>{const n=ed(e.composedPath()[0]),s=n===null?void 0:this.#i.get(n);if(!(n===null||s===void 0)){for(const i of this.#r)i.isConnected||this.#r.delete(i);this.#r.add(n),this.#p(ab(this.#c(),s.id,{base:s.base,value:n.value}))}};#c(){return this.#t?.read(this.#n)??{}}#p(e){Object.keys(e).length===0?this.#t?.remove(this.#n):this.#t?.write(this.#n,e)}}const kb=(t,e,n,s)=>k`<div class="dpk-undo-redo" role="group" aria-label=${n.undoRedo}>
3930
+ `],oe={default:320,min:140,step:24,largeStep:96},Jk=160,Gl=800,Ri=t=>Math.max(oe.min,Math.round(t-Jk)),mt=(t,e)=>Math.round(Math.min(Ri(e),Math.max(oe.min,t))),eb=(t,e,n)=>mt(t.startHeight+t.startY-e,n),tb=(t,{key:e,shiftKey:n},s)=>{const i=n?oe.largeStep:oe.step;switch(e){case"ArrowUp":return mt(t+i,s);case"ArrowDown":return mt(t-i,s);case"Home":return mt(oe.min,s);case"End":return Ri(s);default:return null}},Wl=t=>typeof t=="number"&&Number.isFinite(t)&&t>=oe.min?Math.round(t):null,nb=()=>typeof window>"u"?Gl:window.innerHeight||document.documentElement.clientHeight||Gl,sb=t=>`dev-process-kit:supplements-height:${t}`,Mi={kind:"idle"};class ib{constructor(e,n){this.#s=null,this.#t="",this.#i=null,this.#r=Mi,this.handlers={pointerdown:s=>{s.button===0&&(s.preventDefault(),s.currentTarget instanceof Element&&s.currentTarget.setPointerCapture(s.pointerId),this.#r={kind:"dragging",pointerId:s.pointerId,startY:s.clientY,startHeight:this.height},this.#e.requestUpdate())},pointermove:s=>{const i=this.#r;i.kind!=="dragging"||i.pointerId!==s.pointerId||this.#l(eb(i,s.clientY,this.#c()))},pointerup:s=>this.#a(s),pointercancel:s=>this.#a(s),lostpointercapture:s=>this.#a(s),keydown:s=>{const i=tb(this.height,s,this.#c());i!==null&&(s.preventDefault(),this.#l(i),this.#d())},dblclick:()=>{this.#l(oe.default),this.#d()}},this.#o=()=>{this.#e.requestUpdate()},this.#e=e,this.#n=n,e.addController(this)}#e;#n;#s;#t;#i;#r;hostConnected(){if(this.#s===null){const e=this.#n.persistKey();this.#s=e===null?Z(Wl):ue(Wl),this.#t=sb(e??""),this.#i=this.#s.read(this.#t)}typeof window<"u"&&window.addEventListener("resize",this.#o)}hostDisconnected(){this.#r=Mi,typeof window<"u"&&window.removeEventListener("resize",this.#o)}get height(){return mt(this.#i??oe.default,this.#c())}get max(){return Ri(this.#c())}get dragging(){return this.#r.kind==="dragging"}#o;#a(e){const n=this.#r;n.kind!=="dragging"||n.pointerId!==e.pointerId||(this.#r=Mi,this.#d(),this.#e.requestUpdate())}#l(e){const n=mt(e,this.#c()),s=n===oe.default?null:n;s!==this.#i&&(this.#i=s,this.#e.requestUpdate())}#d(){this.#i===null?this.#s?.remove(this.#t):this.#s?.write(this.#t,this.#i)}#c(){return this.#n.viewportHeight?.()??nb()}}const Oi="supplement",Kl="memo",rb=(t,e)=>[...t.children].filter(n=>n.getAttribute("slot")===Oi).map(n=>{const s=n.getAttribute("data-name")?.trim()??"";return{name:s===""?e:s,element:n}}),ob=(t,e)=>`.dpk-supplements-body ::slotted(:not(:nth-child(${[...t.children].indexOf(e.element)+1}))) { display: none !important; }`,ab={selected:null,open:!1},lb=(t,e)=>t.open?e.find(n=>n.element===t.selected)??null:null,db=(t,e)=>({selected:e,open:!(t.open&&t.selected===e)}),cb=(t,e)=>t.open?{...t,open:!1}:{selected:e.some(s=>s.element===t.selected)?t.selected:e[0]?.element??null,open:!0},pb=30,hb=$t(x(),O({base:x(),value:x()})),Vl=t=>{const e=C(hb,t);return e.success?e.output:null},ub=t=>t.key===void 0?JSON.stringify(["field",t.hosts,t.name,t.base]):JSON.stringify(["key",t.key,t.name]),gb=(t,e,n)=>{const{[e]:s,...i}=t;if(n.value===n.base)return i;const r=Object.entries({...i,[e]:n});return Object.fromEntries(r.slice(Math.max(0,r.length-pb)))},fb=(t,e)=>{if(!(e in t))return t;const{[e]:n,...s}=t;return s},mb=(t,e,n)=>{const s=t[e];return s===void 0||s.base!==n||s.value===n?null:s.value},kb=new Set(["text","search","url","email","tel"]),Yl=t=>t instanceof HTMLTextAreaElement||t instanceof HTMLInputElement&&kb.has(t.type)?t:null,bb=(t,e)=>{const n=[];let s=e.getRootNode();for(;s instanceof ShadowRoot;){if(s.host===t)return n;n.unshift(s.host.localName),s=s.host.getRootNode()}return null},vb=t=>{let e=t;for(;e!==null;){const n=e.getAttribute("data-dpk-text-key");if(n!==null&&n!=="")return n;const s=e.getRootNode();e=e.parentElement??(s instanceof ShadowRoot?s.host:null)}},xb=t=>t.composedPath().find(e=>e instanceof Element&&e.hasAttribute("data-dpk-text-discard"))??null,wb=(t,e)=>{const n=[...e];for(let s=t.parentElement;s!==null;s=s.parentElement){const i=n.filter(r=>s.contains(r));if(i.length>0)return i}return[]},yb=t=>t.getAttribute("aria-label")??(t.placeholder||t.name||t.localName),_i=t=>typeof t=="string"?[t]:Array.isArray(t)?t.flatMap(_i):typeof t=="object"&&t!==null?Object.values(t).flatMap(_i):[],Zl=t=>t.replace(/\s+/g," ").trim();class $b{#e;#n;#s=null;#t="";#i=new WeakMap;#r=new Set;constructor(e,n){this.#e=e,this.#n=n,e.addController(this)}hostConnected(){this.#s===null&&(this.#s=this.#n.persist()?_f(Vl):Z(Vl),this.#t=this.#n.storageKey()),this.#e.addEventListener("focusin",this.#l),this.#e.addEventListener("input",this.#d),this.#e.addEventListener("click",this.#a,!0)}hostDisconnected(){this.#e.removeEventListener("focusin",this.#l),this.#e.removeEventListener("input",this.#d),this.#e.removeEventListener("click",this.#a,!0)}settle(e){const n=new Set(e.flatMap(_i).map(Zl));this.#o([...this.#r].filter(s=>n.has(Zl(s.value))))}#o(e){for(const n of e){this.#r.delete(n);const s=this.#i.get(n);s!==void 0&&this.#u(fb(this.#c(),s.id))}}#a=e=>{const n=xb(e);n!==null&&this.#o(wb(n,this.#r))};#l=e=>{const n=Yl(e.composedPath()[0]);if(n===null||this.#r.has(n))return;const s=bb(this.#e,n);if(s===null)return;const i=vb(n),r=n.value,o=ub({...i===void 0?{}:{key:i},hosts:s,name:yb(n),base:r});this.#i.set(n,{id:o,base:r});const a=mb(this.#c(),o,r);a!==null&&queueMicrotask(()=>{if(n.value===r){n.value=a;try{n.setSelectionRange(a.length,a.length)}catch{}this.#r.add(n),n.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}})};#d=e=>{const n=Yl(e.composedPath()[0]),s=n===null?void 0:this.#i.get(n);if(!(n===null||s===void 0)){for(const i of this.#r)i.isConnected||this.#r.delete(i);this.#r.add(n),this.#u(gb(this.#c(),s.id,{base:s.base,value:n.value}))}};#c(){return this.#s?.read(this.#t)??{}}#u(e){Object.keys(e).length===0?this.#s?.remove(this.#t):this.#s?.write(this.#t,e)}}const Sb=(t,e,n,s)=>m`<div class="dpk-undo-redo" role="group" aria-label=${n.undoRedo}>
3905
3931
  <button
3906
3932
  class="dpk-chrome-action dpk-undo"
3907
3933
  type="button"
@@ -3910,7 +3936,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
3910
3936
  data-tooltip=${n.undo}
3911
3937
  @click=${s.undo}
3912
3938
  >
3913
- ${ff()}
3939
+ ${yf()}
3914
3940
  </button>
3915
3941
  <button
3916
3942
  class="dpk-chrome-action dpk-redo"
@@ -3920,9 +3946,9 @@ The brief is too long for a comment, so it is stored in this artifact's database
3920
3946
  data-tooltip=${n.redo}
3921
3947
  @click=${s.redo}
3922
3948
  >
3923
- ${mf()}
3949
+ ${$f()}
3924
3950
  </button>
3925
- </div>`,bb=t=>{const e=t[0];return e instanceof HTMLElement?e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.tagName==="SELECT"?!0:e.isContentEditable:!1},vb=t=>{const e=t.key.toLowerCase();return(t.metaKey||t.ctrlKey)&&!t.altKey&&!t.shiftKey&&e==="z"},xb=t=>{if(!(t.metaKey||t.ctrlKey)||t.altKey)return!1;const e=t.key.toLowerCase();return e==="z"&&t.shiftKey||e==="y"&&!t.shiftKey};class yb{#e;constructor(e,n){this.#e=n,e.addController(this)}hostConnected(){document.addEventListener("keydown",this.#s)}hostDisconnected(){document.removeEventListener("keydown",this.#s)}#s=e=>{e.isComposing||e.defaultPrevented||bb(e.composedPath())||(xb(e)?(e.preventDefault(),this.#e.redo()):vb(e)&&(e.preventDefault(),this.#e.undo()))}}const wb=`script[type="application/json"]:not([${eo}]):not([${ei}])`,$b=`script[type="application/json"][${ei}]`,Sb=30,nd={width:360,height:480},Ii="dpk-review",Ab=t=>{try{return t.matches(":popover-open")}catch{return!1}},Eb=()=>new Promise(t=>requestAnimationFrame(()=>t())),sd=t=>t>0?String(t):null;class us extends ee{static{this.styles=[Yl,Mr,Or,Vl,jl]}static{this.properties={storageKey:{type:String,attribute:"storage-key"},storage:{type:String},notes:{type:String},theme:{type:String},notesOpen:{state:!0},settingsOpen:{state:!0},reviewSection:{state:!0}}}#e=lt;#s=null;#t=null;#n="current";#i=null;#r=null;#o=[];#a=[];#l={open:e=>this.#pe(e),answer:(e,n)=>this.#Pe(e,n),next:e=>this.#me(e),pickRound:e=>{this.#n=e,this.#r=null,this.requestUpdate()}};#d=!1;#c=new Ok(this);#p=eb;#h=new Qk(this,{persistKey:()=>this.storage==="off"||this.storage==="memory"?null:this.#J});#f=new Fm(this,()=>this.storage!=="off"&&this.storage!=="memory");#k=new jm(this);#y=new Tk(this);#x=new mb(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",storageKey:()=>`${this.storageKey??Bt(this.#J)}:unsent-text`});#v=null;#g=new om(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",storageKey:()=>this.storageKey??Bt(this.definition.name),inside:e=>e.some(n=>n instanceof Element&&(n.id===Jn||n.classList.contains("dpk-bell"))),show:e=>{this.#Ue(e)},ignored:()=>this.#u!==null});#m={toggleList:()=>this.#g.toggleList(),openList:()=>this.#g.send({kind:"open-list"}),show:e=>this.#g.show(e),dismiss:e=>this.#g.send({kind:"close-toast",key:e}),readAll:()=>this.#g.send({kind:"read-all"}),pause:e=>this.#g.pause(e),resume:e=>this.#g.resume(e)};#w=new zm(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",storageKey:()=>this.storageKey??Bt(this.definition.name),log:()=>this.#g.log});#$=new xo(this);#T=new Qn(this);#L=new wu(this,{state:()=>this.controller.derivation.state,messages:()=>ea(this.locale)});#H=Zt;#Y=new zg(this,{dialog:()=>this.renderRoot.querySelector(`#${Oi}`),open:()=>this.settingsOpen,dismiss:()=>{this.settingsOpen=!1}});#z={undo:()=>this.controller.undo(),redo:()=>this.controller.redo()};#C=new ck(this,{surface:()=>this.renderRoot.querySelector(".dpk-floating-menu"),header:()=>this.renderRoot.querySelector(".dpk-menu-slot"),area:()=>this.#de(),persistKey:()=>this.storage==="off"||this.storage==="memory"?null:this.#J});constructor(){super(),this.settingsOpen=!1,new Ik(this,{surface:()=>this.renderRoot.querySelector(`#${Ii}`),anchor:()=>this.renderRoot.querySelector(".dpk-floating-menu"),trigger:()=>this.renderRoot.querySelector(".dpk-review-toggles"),open:()=>this.notesOpen,close:()=>{this.notesOpen=!1}}),new vk(this,{active:()=>this.#e.questions.length>0,bindings:()=>this.#o,open:e=>this.#pe(e),labelOf:e=>O(this.locale).grillOpen(`${e.ref} \xB7 ${e.title}`),gutterOf:e=>this.contains(e)&&this.#ze(e)==="main"}),new Lm(this,{active:()=>this.#w.enabled,bindings:()=>this.#a,onToggle:e=>this.#w.toggle(e),labelOf:e=>{const n=O(this.locale);return e==="checked"?n.checkModeChecked:e==="stale"?n.checkModeStale:n.checkModeUnchecked}}),new Rk(this,()=>this.#u===null?this.renderRoot.querySelector(".dpk-header"):null)}#ne=new Kt(this);#se=new Kt(this);#ie=new Kt(this);#j=new _k(this,()=>this.storage!=="off"&&this.storage!=="memory",()=>this.#u===null,()=>{this.#b?.setTemplate(this.definition),this.#b?.setGrill({grill:this.#e,locale:this.locale})});#B;#b;#S=Pt;#D=null;#R=new Set;#_=new sm({host:this,name:()=>`<${this.tagName.toLowerCase()}>`,script:()=>this.scriptOf(wb),parse:e=>this.definition.parseBase(e),empty:()=>this.definition.emptyBase(),optional:()=>jf(this),onChange:e=>this.#et(e)});#Z;#I;#N=[];#Q="";#F;#re=new Promise(e=>{this.#F=e});#G;#M=new Promise(e=>{this.#G=e});#O;#u=null;#W;#K=!1;get locale(){return this.#A()?.locale()??this.#j.locale}get definition(){const e=this.locale;return this.#B?.locale!==e&&(this.#B={locale:e,value:this.definitionFor(e)}),this.#B.value}get liveDefinition(){return this.#b?.definition??this.definition}connectedCallback(){Hf(),this.#u=ki(this),this.toggleAttribute("data-dpk-page-content",this.#u!==null),this.#u===null&&!this.#K&&(this.#K=!0,new yb(this,this.#z)),super.connectedCallback(),this.dataset.template=this.definition.name,this.#d||(this.#d=!0,this.notesOpen=this.notes==="on"||this.notes==="open"||this.notes==="comments"||this.notes==="changes"||this.notes==="questions",this.reviewSection=this.notes==="changes"||this.notes==="questions"?this.notes:"comments"),this.#q(),this.#u===null&&this.hashMode!=="off"&&window.addEventListener("hashchange",this.#Ae),this.addEventListener("click",this.#Re),this.addEventListener("dpk-comment-targets-change",this.#E),this.addEventListener("dpk-comment-request",this.#Ee),this.addEventListener("dpk-comment-submit",this.#Ce),this.addEventListener("dpk-element-action",this.#Te),this.#I??=new MutationObserver(this.#E),this.#E()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("hashchange",this.#Ae),this.removeEventListener("click",this.#Re),this.#_.disconnect(),this.#I?.disconnect(),this.removeEventListener("dpk-comment-targets-change",this.#E),this.removeEventListener("dpk-comment-request",this.#Ee),this.removeEventListener("dpk-comment-submit",this.#Ce),this.removeEventListener("dpk-element-action",this.#Te)}#q(e=0){if(this.#b){this.#X();return}if(this.parentElement?.localName==="dpk-page"&&customElements.get("dpk-page")===void 0){customElements.whenDefined("dpk-page").then(()=>this.#q(e));return}if(this.childNodes.length===0&&e<2){queueMicrotask(()=>this.#q(e+1));return}const s=this.pendingStart();if(s!==null){s.then(()=>this.#q(e));return}this.#Qe()}#X(){this.#Z||(this.#Z=this.#b?.subscribe(()=>this.#tt()))}willUpdate(){const e=this.#A();this.dataset.theme=e?.theme()??this.#f.resolve(De(this.theme)),e!==null&&this.#b&&this.#W!==e.locale()&&(this.#W=e.locale(),this.#b.setTemplate(this.definition))}updated(){this.#rt(),this.#it(),this.#qe(),this.#Le(),this.#oe()}#oe(){if(this.#u!==null)return;const n=this.renderRoot.querySelector(".dpk-floating-menu")?.getBoundingClientRect().width??0,i=`${Zm(this.#C.placement.spot,n)}px`;this.style.getPropertyValue("--dpk-floating-menu-clearance")!==i&&this.style.setProperty("--dpk-floating-menu-clearance",i)}get api(){return this.#O??=this.#Ze(),this.#O}get started(){return this.#M}get controller(){if(!this.#b)throw new Error(`<${this.tagName.toLowerCase()}> is not initialized yet`);return this.#b}get componentSnapshot(){return this.#b?.componentSnapshot??null}get derivation(){return this.controller.derivation}get navigation(){return this.#u===null?this.#S:this.#U()}get board(){return this.#u}get hasOwnSidebar(){return this.renderRoot.querySelector(".dpk-sidebar")!==null}get sidebarFoldSide(){return this.hasOwnSidebar?this.sidebarLayout.side:null}get sidebarFolded(){const e=this.sidebarFoldSide;return e===null?null:this.renderRoot.querySelector("dpk-internal-layout-sidebar")?.foldedOn(e)??null}toggleSidebarFold(){const e=this.sidebarFoldSide;e!==null&&(this.renderRoot.querySelector("dpk-internal-layout-sidebar")?.toggleFold(e),this.requestUpdate())}dispatch(e){if(this.#u!==null)return this.#he(s=>s.dispatch(this.#we(e)));const n=this.controller.dispatch(e);return n.ok&&this.#x.settle([e.payload,e.note]),n.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:n.issues},bubbles:!0,composed:!0})),this.#P()),n}dispatchBatch(e){if(this.#u!==null)return this.#he(s=>s.dispatchBatch(e.map(i=>this.#we(i))));const n=this.controller.dispatchBatch(e);return n.ok&&this.#x.settle(e.flatMap(s=>[s.payload,s.note])),n.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:n.issues},bubbles:!0,composed:!0})),this.#P()),n}editComment(e,n){if(this.#u!==null)return this.#he(i=>i.editComment(e,n));const s=this.controller.editComment(e,n);return s.ok&&this.#x.settle([n]),s.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:s.issues},bubbles:!0,composed:!0})),this.#P()),s}removeAction(e){this.#u!==null?this.#A()?.removeAction(e):this.controller.removeAction(e)}clearActions(){if(this.#u===null){this.controller.clearActions();return}const e=this.#A();for(const n of this.controller.actions)e?.removeAction(n.id)}navigate(e,n={}){if(this.#u!==null){this.#A()?.navigate(this.#$e(e),n);return}const s=nt(this.#U());this.#S=yn(this.#S,e,this.definition.navigationHierarchy),this.#te(n.replace??!1);const i=nt(this.#U());this.requestUpdate(),s!==i&&(this.#P(),this.dispatchEvent(new CustomEvent("dpk-navigate",{detail:{navigation:this.#S},bubbles:!0,composed:!0})))}hashFor(e){const n=this.#A();if(n!==null)return n.hashFor(this.#$e(e));const s=this.#U();return nt(this.definition.resolveNavigation(this.derivation.state,yn(s,e,this.definition.navigationHierarchy)))}requestComment(e){if(this.#u!==null){this.#A()?.requestComment(P(this.#ye(e,"page")));return}this.#D=typeof e=="string"?e:P(e),this.notesOpen=!0,this.reviewSection="comments",this.requestUpdate()}get settingsSections(){if(!this.#b)return[];const e=this.#ee();return this.#xe(this.renderSettingsSections(e))}openSettings(e=Zt){const n=this.#Ve();if(n===null||n===this){this.#H=e,this.settingsOpen=!0,this.requestUpdate();return}n.openSettings(e)}renderSettingsSections(e){return[]}settingsSwitches(e){const n=this.definition.settings?.(e.state);return n===void 0||n.items.length===0?null:{settings:n,flip:s=>{this.dispatch(s)}}}get settingsTriggerIntents(){return{open:this.settingsOpen,toggle:()=>{if(this.settingsOpen){this.settingsOpen=!1;return}this.openSettings()}}}get canSendToClaude(){return this.#k.available}sendToClaude(){return this.#k.send({brief:this.api.exportBrief(),draft:Ms(this.derivation.actions),anchor:this})}renderReviewPanel(e){return k`<dpk-comment-panel
3951
+ </div>`,Ab=t=>{const e=t[0];return e instanceof HTMLElement?e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.tagName==="SELECT"?!0:e.isContentEditable:!1},Eb=t=>{const e=t.key.toLowerCase();return(t.metaKey||t.ctrlKey)&&!t.altKey&&!t.shiftKey&&e==="z"},Cb=t=>{if(!(t.metaKey||t.ctrlKey)||t.altKey)return!1;const e=t.key.toLowerCase();return e==="z"&&t.shiftKey||e==="y"&&!t.shiftKey};class Tb{#e;constructor(e,n){this.#e=n,e.addController(this)}hostConnected(){document.addEventListener("keydown",this.#n)}hostDisconnected(){document.removeEventListener("keydown",this.#n)}#n=e=>{e.isComposing||e.defaultPrevented||Ab(e.composedPath())||(Cb(e)?(e.preventDefault(),this.#e.redo()):Eb(e)&&(e.preventDefault(),this.#e.undo()))}}const Rb=(t,e)=>{switch(t.status){case"connecting":return e.syncConnecting;case"synced":return e.syncSynced;case"pending":return e.syncPending(t.unsent);case"offline":return e.syncOffline;case"error":return e.syncError}},Mb=O({protocol:K(cs),self:O({id:x(),name:W(x())}),open:tc()}),Ql=(t,e)=>{let n;const s={protocol:cs,storageKey:e.storageKey,template:e.template,connect:i=>{if(n!==void 0)return;const r=C(Mb,i);if(!r.success){console.warn("[dev-process-kit] dpk-sync-request: ignored a host that is not protocol 1",i);return}n={protocol:cs,self:r.output.self,open:o=>i.open(o)}}};return t.dispatchEvent(new CustomEvent(ec,{detail:s,bubbles:!0,composed:!0})),n},Ob=`script[type="application/json"]:not([${Fr}]):not([${Ks}])`,_b=`script[type="application/json"][${Ks}]`,Pb=30,Xl={width:360,height:480},Pi="dpk-review",Lb=t=>{try{return t.matches(":popover-open")}catch{return!1}},zb=()=>new Promise(t=>requestAnimationFrame(()=>t())),Jl=t=>t>0?String(t):null;class as extends X{static{this.styles=[Fl,Pr,Lr,jl,Dl]}static{this.properties={storageKey:{type:String,attribute:"storage-key"},storage:{type:String},notes:{type:String},theme:{type:String},notesOpen:{state:!0},settingsOpen:{state:!0},reviewSection:{state:!0}}}#e=st;#n=null;#s=null;#t="current";#i=null;#r=null;#o;#a;#l={open:e=>this.#pe(e),answer:(e,n)=>this.#ze(e,n),next:e=>this.#me(e),pickRound:e=>{this.#t=e,this.#r=null,this.requestUpdate()}};#d=!1;#c=new qk(this);#u=ab;#h=new ib(this,{persistKey:()=>this.storage==="off"||this.storage==="memory"?null:this.#se});#k=new Qm(this,()=>this.storage!=="off"&&this.storage!=="memory");#p=new Ym(this);#x=new zk(this);#A=new $b(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",storageKey:()=>`${this.storageKey??rt(this.#se)}:unsent-text`});#v=null;#f=new um(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",storageKey:()=>this.storageKey??rt(this.definition.name),inside:e=>e.some(n=>n instanceof Element&&(n.id===Kn||n.classList.contains("dpk-bell"))),show:e=>{this.#Be(e)},ignored:()=>this.#g!==null,read:e=>this.#b?.setAddressed(e.addressed??Oe)});#w={toggleList:()=>this.#f.toggleList(),openList:()=>this.#f.send({kind:"open-list"}),show:e=>this.#f.show(e),dismiss:e=>this.#f.send({kind:"close-toast",key:e}),readAll:()=>this.#f.send({kind:"read-all"}),pause:e=>this.#f.pause(e),resume:e=>this.#f.resume(e)};#m=new Bm(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",storageKey:()=>this.storageKey??rt(this.definition.name),log:()=>this.#f.log});#S=new po(this);#$=new Gn(this);#y=new vu(this,{state:()=>this.controller.derivation.state,messages:()=>Go(this.locale)});#C=Kt;#q=new jg(this,{dialog:()=>this.renderRoot.querySelector(`#${Ti}`),open:()=>this.settingsOpen,dismiss:()=>{this.settingsOpen=!1}});#M={undo:()=>this.controller.undo(),redo:()=>this.controller.redo()};#E=new kk(this,{surface:()=>this.renderRoot.querySelector(".dpk-floating-menu"),header:()=>this.renderRoot.querySelector(".dpk-menu-slot"),area:()=>this.#Oe(),persistKey:()=>this.storage==="off"||this.storage==="memory"?null:this.#se});constructor(){super(),this.settingsOpen=!1,new Fk(this,{surface:()=>this.renderRoot.querySelector(`#${Pi}`),anchor:()=>this.renderRoot.querySelector(".dpk-floating-menu"),trigger:()=>this.renderRoot.querySelector(".dpk-review-toggles"),open:()=>this.notesOpen,close:()=>{this.notesOpen=!1}}),this.#o=new Ek(this,{active:()=>this.#e.questions.length>0,bindings:()=>this.#g!==null||!this.#b?[]:$k(this,this.#e,this.derivation.answers,this.notesOpen&&this.reviewSection==="questions"?Ai(this.#e,this.#s):null,(e,n)=>this.grillRefsOf(e,n)),open:e=>this.#pe(e),labelOf:e=>R(this.locale).grillOpen(`${e.ref} \xB7 ${e.title}`),gutterOf:e=>this.contains(e)&&this.#De(e)==="main"}),this.#a=new Hm(this,{active:()=>this.#m.enabled,bindings:()=>this.#g!==null?[]:qm(this,this.#m.state,this.#f.log),onToggle:e=>this.#m.toggle(e),labelOf:e=>{const n=R(this.locale);return e==="checked"?n.checkModeChecked:e==="stale"?n.checkModeStale:n.checkModeUnchecked}}),new Ik(this,()=>this.#g===null?this.renderRoot.querySelector(".dpk-header"):null)}#U=new Ft(this);#H=new Ft(this);#K=new Ft(this);#L=new Dk(this,()=>this.storage!=="off"&&this.storage!=="memory",()=>this.#g===null,()=>{this.#b?.setTemplate(this.definition),this.#b?.setGrill({grill:this.#e,locale:this.locale})});#_;#b;#T=Rt;#B=null;#z=new Set;#P=new cm({host:this,name:()=>`<${this.tagName.toLowerCase()}>`,script:()=>this.scriptOf(Ob),parse:e=>this.definition.parseBase(e),empty:()=>this.definition.emptyBase(),optional:()=>Yf(this),onChange:e=>this.#st(e)});#J;#j;#F=[];#ee="";#V;#oe=new Promise(e=>{this.#V=e});#Y;#I=new Promise(e=>{this.#Y=e});#D;#g=null;#Z;#Q=!1;get locale(){return this.#R()?.locale()??this.#L.locale}get definition(){const e=this.locale;return this.#_?.locale!==e&&(this.#_={locale:e,value:this.definitionFor(e)}),this.#_.value}get liveDefinition(){return this.#b?.definition??this.definition}connectedCallback(){Vf(),this.#g=ui(this),this.toggleAttribute("data-dpk-page-content",this.#g!==null),this.#g===null&&!this.#Q&&(this.#Q=!0,new Tb(this,this.#M)),super.connectedCallback(),this.dataset.template=this.definition.name,this.#d||(this.#d=!0,this.notesOpen=this.notes==="on"||this.notes==="open"||this.notes==="comments"||this.notes==="changes"||this.notes==="questions",this.reviewSection=this.notes==="changes"||this.notes==="questions"?this.notes:"comments"),this.#G(),this.#g===null&&this.hashMode!=="off"&&window.addEventListener("hashchange",this.#Ae),this.addEventListener("click",this.#Re),this.addEventListener("dpk-comment-targets-change",this.#O),this.addEventListener("dpk-comment-request",this.#Ee),this.addEventListener("dpk-comment-submit",this.#Ce),this.addEventListener("dpk-element-action",this.#Te),this.#g===null&&this.addEventListener("dpk-board-rendered",this.#ne),this.#j??=new MutationObserver(this.#O),this.#O()}disconnectedCallback(){super.disconnectedCallback(),queueMicrotask(()=>{this.isConnected||this.#b?.close()}),window.removeEventListener("hashchange",this.#Ae),this.removeEventListener("click",this.#Re),this.#P.disconnect(),this.#j?.disconnect(),this.removeEventListener("dpk-comment-targets-change",this.#O),this.removeEventListener("dpk-comment-request",this.#Ee),this.removeEventListener("dpk-comment-submit",this.#Ce),this.removeEventListener("dpk-element-action",this.#Te),this.removeEventListener("dpk-board-rendered",this.#ne)}#G(e=0){if(this.#b){this.#b.reopen(),this.#te();return}if(this.parentElement?.localName==="dpk-page"&&customElements.get("dpk-page")===void 0){customElements.whenDefined("dpk-page").then(()=>this.#G(e));return}if(this.childNodes.length===0&&e<2){queueMicrotask(()=>this.#G(e+1));return}const s=this.pendingStart();if(s!==null){s.then(()=>this.#G(e));return}this.#et()}#te(){this.#J||(this.#J=this.#b?.subscribe(()=>this.#it()))}willUpdate(){const e=this.#R();this.dataset.theme=e?.theme()??this.#k.resolve(_e(this.theme)),e!==null&&this.#b&&this.#Z!==e.locale()&&(this.#Z=e.locale(),this.#b.setTemplate(this.definition))}updated(){this.#lt(),this.#at(),this.#He(),this.#Ie(),this.#ae(),this.#g!==null&&this.dispatchEvent(new Event("dpk-board-rendered",{bubbles:!0,composed:!0}))}#ne=e=>{e.target!==this&&(e.stopPropagation(),this.#o.refresh(),this.#a.refresh())};#ae(){if(this.#g!==null)return;const n=this.renderRoot.querySelector(".dpk-floating-menu")?.getBoundingClientRect().width??0,i=`${sk(this.#E.placement.spot,n)}px`;this.style.getPropertyValue("--dpk-floating-menu-clearance")!==i&&this.style.setProperty("--dpk-floating-menu-clearance",i)}get api(){return this.#D??=this.#Je(),this.#D}get started(){return this.#I}get controller(){if(!this.#b)throw new Error(`<${this.tagName.toLowerCase()}> is not initialized yet`);return this.#b}get componentSnapshot(){return this.#b?.componentSnapshot??null}get derivation(){return this.controller.derivation}get navigation(){return this.#g===null?this.#T:this.#W()}get board(){return this.#g}get hasOwnSidebar(){return this.renderRoot.querySelector(".dpk-sidebar")!==null}get sidebarFoldSide(){return this.hasOwnSidebar?this.sidebarLayout.side:null}get sidebarFolded(){const e=this.sidebarFoldSide;return e===null?null:this.renderRoot.querySelector("dpk-internal-layout-sidebar")?.foldedOn(e)??null}toggleSidebarFold(){const e=this.sidebarFoldSide;e!==null&&(this.renderRoot.querySelector("dpk-internal-layout-sidebar")?.toggleFold(e),this.requestUpdate())}dispatch(e){if(this.#g!==null)return this.#he(s=>s.dispatch(this.#ye(e)));const n=this.controller.dispatch(e);return n.ok&&this.#A.settle([e.payload,e.note]),n.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:n.issues},bubbles:!0,composed:!0})),this.#N()),n}dispatchBatch(e){if(this.#g!==null)return this.#he(s=>s.dispatchBatch(e.map(i=>this.#ye(i))));const n=this.controller.dispatchBatch(e);return n.ok&&this.#A.settle(e.flatMap(s=>[s.payload,s.note])),n.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:n.issues},bubbles:!0,composed:!0})),this.#N()),n}editComment(e,n){if(this.#g!==null)return this.#he(i=>i.editComment(e,n));const s=this.controller.editComment(e,n);return s.ok&&this.#A.settle([n]),s.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:s.issues},bubbles:!0,composed:!0})),this.#N()),s}removeAction(e){this.#g!==null?this.#R()?.removeAction(e):this.controller.removeAction(e)}async#le(){if(this.#g!==null||this.controller.sync===null){this.clearActions();return}const e=this.controller.prepareClear(),n=R(this.locale);await this.#S.ask({title:n.clearSharedTitle,body:n.clearSharedBody,confirmLabel:n.clearSharedOk,cancelLabel:n.clearSharedCancel,tone:"danger"})&&e()}clearActions(){if(this.#g===null){this.controller.clearActions();return}const e=this.#R();for(const n of this.controller.actions)e?.removeAction(n.id)}navigate(e,n={}){if(this.#g!==null){this.#R()?.navigate(this.#$e(e),n);return}const s=Qe(this.#W());this.#T=gn(this.#T,e,this.definition.navigationHierarchy),this.#re(n.replace??!1);const i=Qe(this.#W());this.requestUpdate(),s!==i&&(this.#N(),this.dispatchEvent(new CustomEvent("dpk-navigate",{detail:{navigation:this.#T},bubbles:!0,composed:!0})))}hashFor(e){const n=this.#R();if(n!==null)return n.hashFor(this.#$e(e));const s=this.#W();return Qe(this.definition.resolveNavigation(this.derivation.state,gn(s,e,this.definition.navigationHierarchy)))}requestComment(e){if(this.#g!==null){this.#R()?.requestComment(_(this.#we(e,"page")));return}this.#B=typeof e=="string"?e:_(e),this.notesOpen=!0,this.reviewSection="comments",this.requestUpdate()}get settingsSections(){if(!this.#b)return[];const e=this.#ie();return this.#xe(this.renderSettingsSections(e))}openSettings(e=Kt){const n=this.#Qe();if(n===null||n===this){this.#C=e,this.settingsOpen=!0,this.requestUpdate();return}n.openSettings(e)}renderSettingsSections(e){return[]}settingsSwitches(e){const n=this.definition.settings?.(e.state);return n===void 0||n.items.length===0?null:{settings:n,flip:s=>{this.dispatch(s)}}}get settingsTriggerIntents(){return{open:this.settingsOpen,toggle:()=>{if(this.settingsOpen){this.settingsOpen=!1;return}this.openSettings()}}}get canSendToClaude(){return this.#p.available}sendToClaude(){return this.#p.send({brief:this.api.exportBrief(),draft:$s(this.derivation.actions),anchor:this})}renderReviewPanel(e){return m`<dpk-comment-panel
3926
3952
  .definition=${this.controller.definition}
3927
3953
  .state=${e.state}
3928
3954
  .navigation=${e.navigation}
@@ -3930,16 +3956,18 @@ The brief is too long for a comment, so it is stored in this artifact's database
3930
3956
  .issues=${this.controller.lastIssues}
3931
3957
  .exportBrief=${()=>this.api.exportBrief()}
3932
3958
  .sendToClaude=${this.canSendToClaude?()=>this.sendToClaude():void 0}
3933
- .pendingTarget=${this.#D}
3934
- .section=${this.#V==="questions"?null:this.#V}
3959
+ .pendingTarget=${this.#B}
3960
+ .section=${this.#X==="questions"?null:this.#X}
3935
3961
  .onDelete=${n=>this.removeAction(n)}
3936
3962
  .onEditComment=${(n,s)=>this.editComment(n,s)}
3937
- .onClear=${()=>this.clearActions()}
3938
- .onComment=${(n,s)=>{const i=this.dispatch({type:H,target:n,payload:{body:s}});return i.ok&&(this.#D=null),i}}
3939
- ></dpk-comment-panel>`}renderChrome(e,n){if(this.#u!==null)return this.#ae(n);const s=e.actions.length,{changeCount:i,commentCount:r}=this.reviewCounts(e);this.#o=mk(this,this.#e,this.derivation.answers,this.notesOpen&&this.reviewSection==="questions"?Ri(this.#e,this.#t):null,(l,c)=>this.grillRefsOf(l,c)),this.#a=Om(this,this.#w.state,this.#g.log);const o=this.definition.title(e.state),a=O(this.locale);return k`
3963
+ .onClear=${()=>{this.#le()}}
3964
+ .authorOf=${this.controller.sync===null?void 0:n=>this.controller.authorOf(n)?.name}
3965
+ .canEditComment=${this.controller.sync===null?void 0:n=>this.controller.isOwnAction(n)}
3966
+ .onComment=${(n,s)=>{const i=this.dispatch({type:D,target:n,payload:{body:s}});return i.ok&&(this.#B=null),i}}
3967
+ ></dpk-comment-panel>`}renderChrome(e,n){if(this.#g!==null)return this.#de(n);const s=e.actions.length,{changeCount:i,commentCount:r}=this.reviewCounts(e),o=this.definition.title(e.state),a=R(this.locale);return m`
3940
3968
  <dpk-internal-layout-app class="dpk-shell">
3941
3969
  <header slot="header" class="dpk-header">
3942
- <span class="dpk-brand" aria-hidden="true">${bf()}</span>
3970
+ <span class="dpk-brand" aria-hidden="true">${Af()}</span>
3943
3971
  ${this.renderHeaderLead(e)}
3944
3972
  <div class="dpk-title">
3945
3973
  <h1 title=${o}>${o}</h1>
@@ -3948,18 +3976,19 @@ The brief is too long for a comment, so it is stored in this artifact's database
3948
3976
  ${n.header??b}
3949
3977
  <slot name="header"></slot>
3950
3978
  </div>
3951
- <div class="dpk-header-tools">${this.#ve()} ${this.#Fe()}</div>
3952
- ${Uk(a,this.settingsTriggerIntents)}
3953
- ${hk(a,this.#C.placement,{toHeader:this.#C.toHeader})}
3979
+ ${this.#We()}
3980
+ <div class="dpk-header-tools">${this.#ve()} ${this.#Ke()}</div>
3981
+ ${Kk(a,this.settingsTriggerIntents)}
3982
+ ${vk(a,this.#E.placement,{toHeader:this.#E.toHeader})}
3954
3983
  </header>
3955
3984
  ${this.#ge(n)} ${this.#fe(n)}
3956
3985
  <div slot="overlay" class="dpk-overlay">
3957
- ${this.#le(i,r)} ${this.#Me(e)}
3958
- ${this.#He(s)} ${this.#Ie()} ${this.#Ne()}
3959
- ${this.#$.render()} ${this.#Ge(e)}
3986
+ ${this.#Me(i,r)} ${this.#Pe(e)}
3987
+ ${this.#je(s)} ${this.#qe()} ${this.#Ue()}
3988
+ ${this.#S.render()} ${this.#Ve(e)}
3960
3989
  </div>
3961
3990
  </dpk-internal-layout-app>
3962
- `}renderHeaderLead(e){return b}#ae(e){this.#o=[],this.#a=[];const n=e.header!==void 0&&e.header!==b||this.querySelector(':scope > [slot="header"]')!==null;return k`
3991
+ `}renderHeaderLead(e){return b}#de(e){const n=e.header!==void 0&&e.header!==b||this.querySelector(':scope > [slot="header"]')!==null;return m`
3963
3992
  <dpk-internal-layout-app class="dpk-shell" data-board>
3964
3993
  <div slot="header" class="dpk-board-bar" ?hidden=${!n}>
3965
3994
  <div class="dpk-header-slot">
@@ -3969,31 +3998,31 @@ The brief is too long for a comment, so it is stored in this artifact's database
3969
3998
  </div>
3970
3999
  ${this.#ge(e)} ${this.#fe(e)}
3971
4000
  </dpk-internal-layout-app>
3972
- `}#le(e,n){const s=O(this.locale);return pk(s,this.#C.placement,{undoRedo:kb(this.controller.canUndo,this.controller.canRedo,s,this.#z),review:this.#_e(e,n),checkMode:this.#je(),notices:this.#De()},{grip:this.#C.grip},this.#C.dragging)}#de(){const e=window.innerWidth||document.documentElement.clientWidth,n=window.innerHeight||document.documentElement.clientHeight,s=this.renderRoot.querySelector(".dpk-header"),i=Math.min(s?.getBoundingClientRect().height??0,n);return{left:0,top:i,width:e,height:n-i}}#ge(e){const n=O(this.locale),s=e.sidebarHidden===!0||!e.sidebar&&!this.hasSidebarContent(),i=this.sidebarLayout,r=i.side==="left"?"right":"left",o=this.mainLayout==="fill",a=this.storage==="off"||this.storage==="memory"?null:this.#J,l={[i.side]:{width:i.defaultWidth,resizable:i.resizable!==!1,collapsible:i.collapsible!==!1,narrow:i.narrow??"drawer",persistKey:a},[r]:{...gi,persistKey:a===null?null:`${a}:aside`}};return k`<dpk-internal-layout-sidebar
4001
+ `}#Me(e,n){const s=R(this.locale);return bk(s,this.#E.placement,{undoRedo:Sb(this.controller.canUndo,this.controller.canRedo,s,this.#M),review:this.#_e(e,n),checkMode:this.#Fe(),notices:this.#Ne()},{grip:this.#E.grip},this.#E.dragging)}#Oe(){const e=window.innerWidth||document.documentElement.clientWidth,n=window.innerHeight||document.documentElement.clientHeight,s=this.renderRoot.querySelector(".dpk-header"),i=Math.min(s?.getBoundingClientRect().height??0,n);return{left:0,top:i,width:e,height:n-i}}#ge(e){const n=R(this.locale),s=e.sidebarHidden===!0||!e.sidebar&&!this.hasSidebarContent(),i=this.sidebarLayout,r=i.side==="left"?"right":"left",o=this.mainLayout==="fill",a=this.storage==="off"||this.storage==="memory"?null:this.#se,l={[i.side]:{width:i.defaultWidth,resizable:i.resizable!==!1,collapsible:i.collapsible!==!1,narrow:i.narrow??"drawer",persistKey:a},[r]:{...ci,persistKey:a===null?null:`${a}:aside`}};return m`<dpk-internal-layout-sidebar
3973
4002
  class="dpk-body"
3974
4003
  .left=${l.left}
3975
4004
  .right=${l.right}
3976
4005
  main=${o?"fill":"scroll"}
3977
4006
  >
3978
- ${e.rail===void 0||e.rail===b?b:k`<div slot="rail">${e.rail}</div>`}
3979
- ${s?b:k`<div slot=${i.side} class="dpk-sidebar">
4007
+ ${e.rail===void 0||e.rail===b?b:m`<div slot="rail">${e.rail}</div>`}
4008
+ ${s?b:m`<div slot=${i.side} class="dpk-sidebar">
3980
4009
  ${e.sidebar??b}
3981
4010
  <slot name="sidebar"></slot>
3982
4011
  </div>`}
3983
- ${this.hasAsideContent()?k`<div slot=${r} class="dpk-aside"><slot name="aside"></slot></div>`:b}
4012
+ ${this.hasAsideContent()?m`<div slot=${r} class="dpk-aside"><slot name="aside"></slot></div>`:b}
3984
4013
  <main class="dpk-main">
3985
4014
  <div class="dpk-main-body" ?data-fill=${o}>
3986
- ${this.#_.error?k`<div class="dpk-banner" role="alert">
4015
+ ${this.#P.error?m`<div class="dpk-banner" role="alert">
3987
4016
  <strong>${n.baseDataError}</strong>
3988
- <code>${this.#_.error}</code>
4017
+ <code>${this.#P.error}</code>
3989
4018
  </div>`:b}
3990
- ${this.#s===null?b:k`<div class="dpk-banner" role="alert">
4019
+ ${this.#n===null?b:m`<div class="dpk-banner" role="alert">
3991
4020
  <strong>${n.grillError}</strong>
3992
- <code>${this.#s}</code>
4021
+ <code>${this.#n}</code>
3993
4022
  </div>`}
3994
- ${this.#g.error===null?b:k`<div class="dpk-banner" role="alert">
4023
+ ${this.#f.error===null?b:m`<div class="dpk-banner" role="alert">
3995
4024
  <strong>${n.changesError}</strong>
3996
- <code>${this.#g.error}</code>
4025
+ <code>${this.#f.error}</code>
3997
4026
  </div>`}
3998
4027
  ${e.main??b}
3999
4028
  <slot name="main"></slot>
@@ -4002,45 +4031,45 @@ The brief is too long for a comment, so it is stored in this artifact's database
4002
4031
  <slot name="preview"></slot>
4003
4032
  </section>
4004
4033
  </div>
4005
- ${this.#st(n)}
4034
+ ${this.#ot(n)}
4006
4035
  </main>
4007
- </dpk-internal-layout-sidebar>`}#fe(e){return e.footer||this.hasFooterContent()?k`<footer slot="footer" class="dpk-footer">
4036
+ </dpk-internal-layout-sidebar>`}#fe(e){return e.footer||this.hasFooterContent()?m`<footer slot="footer" class="dpk-footer">
4008
4037
  ${e.footer??b}
4009
4038
  <slot name="footer"></slot>
4010
- </footer>`:b}#ce(e,n,s,i){const r=this.notesOpen&&this.#V===e;return k`<button
4039
+ </footer>`:b}#ce(e,n,s,i){const r=this.notesOpen&&this.#X===e;return m`<button
4011
4040
  class="dpk-chrome-action dpk-review-toggle"
4012
4041
  type="button"
4013
4042
  data-section=${e}
4014
- aria-controls=${Ii}
4043
+ aria-controls=${Pi}
4015
4044
  aria-pressed=${r?"true":"false"}
4016
4045
  aria-label=${`${n} (${i??0})`}
4017
4046
  data-tooltip=${n}
4018
4047
  @click=${()=>{this.notesOpen=!r,this.reviewSection=e}}
4019
4048
  >
4020
- ${s} ${i===null?b:k`<span class="dpk-review-badge">${i}</span>`}
4021
- </button>`}#_e(e,n){const s=O(this.locale),i=ua(this.#e,this.derivation.answers);return k`<div class="dpk-review-toggles" role="group" aria-label=${s.review}>
4022
- ${this.#ce("comments",s.reviewComments,Fn(),sd(n))}
4023
- ${this.#ce("changes",s.reviewChanges,ef(),sd(e))}
4024
- ${i.total===0?b:this.#ce("questions",s.grill,Oa(),`${i.answered}/${i.total}`)}
4025
- </div>`}reviewCounts(e){const n=e.actions.length,s=e.actions.filter(o=>o.type===H).length,i=new Set(this.derivation.stale.map(o=>o.action.id)),r=e.actions.filter(o=>Q(o)&&!i.has(o.id)).length;return{changeCount:n-s-r,commentCount:s}}#Me(e){const n=O(this.locale),s=this.#V,i=s==="changes"?n.reviewChanges:s==="questions"?n.grill:n.reviewComments;return k`<div
4026
- id=${Ii}
4049
+ ${s} ${i===null?b:m`<span class="dpk-review-badge">${i}</span>`}
4050
+ </button>`}#_e(e,n){const s=R(this.locale),i=ia(this.#e,this.derivation.answers);return m`<div class="dpk-review-toggles" role="group" aria-label=${s.review}>
4051
+ ${this.#ce("comments",s.reviewComments,Nn(),Jl(n))}
4052
+ ${this.#ce("changes",s.reviewChanges,lf(),Jl(e))}
4053
+ ${i.total===0?b:this.#ce("questions",s.grill,Ca(),`${i.answered}/${i.total}`)}
4054
+ </div>`}reviewCounts(e){const n=e.actions.length,s=e.actions.filter(o=>o.type===D).length,i=new Set(this.derivation.stale.map(o=>o.action.id)),r=e.actions.filter(o=>Y(o)&&!i.has(o.id)).length;return{changeCount:n-s-r,commentCount:s}}#Pe(e){const n=R(this.locale),s=this.#X,i=s==="changes"?n.reviewChanges:s==="questions"?n.grill:n.reviewComments;return m`<div
4055
+ id=${Pi}
4027
4056
  class="dpk-review"
4028
4057
  popover="manual"
4029
4058
  role="dialog"
4030
4059
  aria-label=${i}
4031
4060
  data-section=${s}
4032
4061
  >
4033
- ${s==="questions"?this.#Oe(e.actions.length):b}
4062
+ ${s==="questions"?this.#Le(e.actions.length):b}
4034
4063
  ${this.renderReviewPanel(e)}
4035
- </div>`}get#V(){return this.reviewSection==="questions"&&this.#e.questions.length===0?"comments":this.reviewSection}#Oe(e){const n=O(this.locale),s=wk(n,this.#e,this.derivation.answers,{open:this.#t,round:this.#n}),i=this.#ke(e,!1);return $k(n,s,this.#l,i?k`<footer class="dpk-grill-footer">${this.#be(i)}</footer>`:b,this.#ie)}#pe(e){this.notesOpen=!0,this.reviewSection="questions",this.#n="current",this.#t=e,this.#r=null,this.requestUpdate()}#Pe(e,n){this.dispatch(hg(e,n)).ok&&(n.kind==="option"?this.#me(e):n.kind==="free"&&n.text===""&&(this.#i=e))}#me(e){const n=lg(this.#e,this.derivation.answers,e);n!==null&&(this.#t=n,this.requestUpdate())}#Le(){if(!this.notesOpen||this.#V!=="questions")return;const e=this.#i;this.#i=null,e!==null&&this.renderRoot.querySelector(`[data-free-text="${e}"]`)?.focus();const n=Ri(this.#e,this.#t);if(this.#n!=="current"||n===null||n===this.#r)return;this.#r=n;const s=this.renderRoot.querySelector(`.dpk-grill [data-question="${n}"]`),i=s?.closest(".dpk-grill-list");s&&i&&Ts(i,s)}#ze(e){const n=this.renderRoot.querySelector(".dpk-sidebar");let s=e;for(;s!==null&&s!==this;){if(s===n)return"sidebar";const i=s.getRootNode();s=s.assignedSlot??s.parentElement??(i instanceof ShadowRoot?i.host:null)}return"main"}#De(){const e=this.#g.view;return e?pm(e,O(this.locale),this.#m):b}#Ie(){const e=this.#g.view;return e?um(e,O(this.locale),this.#m):b}#Ne(){const e=this.#g.view;return e?gm(e,O(this.locale),this.#m):b}#qe(){const e=this.renderRoot.querySelector(`#${Jn}`),n=this.renderRoot.querySelector(".dpk-bell");!e||!n||Ab(e)||this.#T.open(e,n,{width:nd.width,height:Math.min(nd.height,window.innerHeight-96)})}async#Ue(e){const n={};this.#v=n;const s=this.derivation.state,i=e.target===null?null:this.definition.canonicalTarget?.(s,Le(e.target))??Le(e.target),r=Kp({...e,target:i&&P(i)},a=>this.definition.navigationFor?this.definition.navigationFor(s,a):null);if(!r||(r.navigate&&this.navigate(r.navigate),i===null))return;i.type===le?this.#pe(i.id):this.showTarget(i);const o=P(i);for(let a=0;a<Sb;a+=1){if(await this.updateComplete,await Eb(),this.#v!==n)return;const l=lu(this,o);if(!(l===null||l.getClientRects().length===0)){du(this,l),hu(l);return}}}showTarget(e){}#He(e){const n=this.#ke(e,this.notesOpen);if(!n)return b;const s=O(this.locale);return k`<div class="dpk-dock" role="group" aria-label=${s.handoffLabel}>
4064
+ </div>`}get#X(){return this.reviewSection==="questions"&&this.#e.questions.length===0?"comments":this.reviewSection}#Le(e){const n=R(this.locale),s=Rk(n,this.#e,this.derivation.answers,{open:this.#s,round:this.#t}),i=this.#ke(e,!1);return Mk(n,s,this.#l,i?m`<footer class="dpk-grill-footer">${this.#be(i)}</footer>`:b,this.#K)}#pe(e){this.notesOpen=!0,this.reviewSection="questions",this.#t="current",this.#s=e,this.#r=null,this.requestUpdate()}#ze(e,n){this.dispatch(dg(e,n)).ok&&(n.kind==="option"?this.#me(e):n.kind==="free"&&n.text===""&&(this.#i=e))}#me(e){const n=rg(this.#e,this.derivation.answers,e);n!==null&&(this.#s=n,this.requestUpdate())}#Ie(){if(!this.notesOpen||this.#X!=="questions")return;const e=this.#i;this.#i=null,e!==null&&this.renderRoot.querySelector(`[data-free-text="${e}"]`)?.focus();const n=Ai(this.#e,this.#s);if(this.#t!=="current"||n===null||n===this.#r)return;this.#r=n;const s=this.renderRoot.querySelector(`.dpk-grill [data-question="${n}"]`),i=s?.closest(".dpk-grill-list");s&&i&&ws(i,s)}#De(e){const n=this.renderRoot.querySelector(".dpk-sidebar");let s=e;for(;s!==null&&s!==this;){if(s===n)return"sidebar";const i=s.getRootNode();s=s.assignedSlot??s.parentElement??(i instanceof ShadowRoot?i.host:null)}return"main"}#Ne(){const e=this.#f.view;return e?bm(e,R(this.locale),this.#w):b}#qe(){const e=this.#f.view;return e?xm(e,R(this.locale),this.#w):b}#Ue(){const e=this.#f.view;return e?wm(e,R(this.locale),this.#w):b}#He(){const e=this.renderRoot.querySelector(`#${Kn}`),n=this.renderRoot.querySelector(".dpk-bell");!e||!n||Lb(e)||this.#$.open(e,n,{width:Xl.width,height:Math.min(Xl.height,window.innerHeight-96)})}async#Be(e){const n={};this.#v=n;const s=this.derivation.state,i=e.target===null?null:this.definition.canonicalTarget?.(s,Re(e.target))??Re(e.target),r=Fp({...e,target:i&&_(i)},a=>this.definition.navigationFor?this.definition.navigationFor(s,a):null);if(!r||(r.navigate&&this.navigate(r.navigate),i===null))return;i.type===re?this.#pe(i.id):this.showTarget(i);const o=_(i);for(let a=0;a<Pb;a+=1){if(await this.updateComplete,await zb(),this.#v!==n)return;const l=ru(this,o);if(!(l===null||l.getClientRects().length===0)){ou(this,l),du(l);return}}}showTarget(e){}#je(e){const n=this.#ke(e,this.notesOpen);if(!n)return b;const s=R(this.locale);return m`<div class="dpk-dock" role="group" aria-label=${s.handoffLabel}>
4036
4065
  ${this.#be(n)}
4037
- </div>`}#ke(e,n){return Yg({actions:e,railOpen:n,sendable:this.canSendToClaude,locale:this.locale},this.#y.state)}#be(e){const n=O(this.locale);return k`${e.note?k`<p class="dpk-dock-note" role="alert">${e.note}</p>`:b}
4066
+ </div>`}#ke(e,n){return nf({actions:e,railOpen:n,sendable:this.canSendToClaude,locale:this.locale},this.#x.state)}#be(e){const n=R(this.locale);return m`${e.note?m`<p class="dpk-dock-note" role="alert">${e.note}</p>`:b}
4038
4067
  <div class="dpk-dock-actions">
4039
- ${e.send?k`<button
4068
+ ${e.send?m`<button
4040
4069
  class="dpk-btn dpk-btn--accent"
4041
4070
  type="button"
4042
4071
  ?disabled=${e.send.disabled}
4043
- @click=${()=>{this.#y.send(()=>this.sendToClaude())}}
4072
+ @click=${()=>{this.#x.send(()=>this.sendToClaude())}}
4044
4073
  >
4045
4074
  ${e.send.label}
4046
4075
  </button>`:b}
@@ -4049,32 +4078,38 @@ The brief is too long for a comment, so it is stored in this artifact's database
4049
4078
  type="button"
4050
4079
  data-status=${e.copy.status}
4051
4080
  title=${n.handoffCopyTitle}
4052
- @click=${()=>{this.#y.copy(()=>this.api.exportBrief())}}
4081
+ @click=${()=>{this.#x.copy(()=>this.api.exportBrief())}}
4053
4082
  >
4054
4083
  ${e.copy.label}
4055
4084
  </button>
4056
- </div>`}#ve(e=this.#ne){const n=this.locale,s=O(n).language;return e.render({options:Zs.map(i=>({value:i,label:vg[i]})),value:n,onChange:i=>{const r=Zs.find(o=>o===i);r!==void 0&&this.#j.pick(r)},ariaLabel:s,className:"dpk-lang-select"})}#je(){const e=this.#w.enabled,n=O(this.locale),s=e?n.checkModeOn:n.checkModeOff;return k`<button
4085
+ </div>`}#ve(e=this.#U){const n=this.locale,s=R(n).language;return e.render({options:js.map(i=>({value:i,label:mg[i]})),value:n,onChange:i=>{const r=js.find(o=>o===i);r!==void 0&&this.#L.pick(r)},ariaLabel:s,className:"dpk-lang-select"})}#Fe(){const e=this.#m.enabled,n=R(this.locale),s=e?n.checkModeOn:n.checkModeOff;return m`<button
4057
4086
  class="dpk-chrome-action dpk-check-toggle"
4058
4087
  type="button"
4059
4088
  data-active=${e?"true":"false"}
4060
4089
  aria-pressed=${e?"true":"false"}
4061
4090
  aria-label=${s}
4062
4091
  data-tooltip=${s}
4063
- @click=${()=>{this.#Be()}}
4092
+ @click=${()=>{this.#Ge()}}
4064
4093
  >
4065
- ${kf()}
4066
- </button>`}async#Be(){if(!this.#w.enabled){this.#w.setEnabled(!0);return}if(!eh(this.#w.state)){this.#w.setEnabled(!1);return}const e=O(this.locale);await this.#$.ask({title:e.checkModeConfirmTitle,body:e.checkModeConfirmBody,confirmLabel:e.checkModeConfirmOk,cancelLabel:e.checkModeConfirmCancel,tone:"danger"})&&this.#w.setEnabled(!1)}#Fe(){const e=this.dataset.theme==="dark",n=O(this.locale),s=e?n.useLightTheme:n.useDarkTheme;return k`<button
4094
+ ${Sf()}
4095
+ </button>`}async#Ge(){if(!this.#m.enabled){this.#m.setEnabled(!0);return}if(!Qp(this.#m.state)){this.#m.setEnabled(!1);return}const e=R(this.locale);await this.#S.ask({title:e.checkModeConfirmTitle,body:e.checkModeConfirmBody,confirmLabel:e.checkModeConfirmOk,cancelLabel:e.checkModeConfirmCancel,tone:"danger"})&&this.#m.setEnabled(!1)}#We(){const e=this.controller.sync;if(e===null)return b;const n=Rb(e,R(this.locale));return m`<span
4096
+ class="dpk-sync-status"
4097
+ role="status"
4098
+ data-status=${e.status}
4099
+ title=${e.reason===void 0?n:`${n}: ${e.reason}`}
4100
+ >${n}</span
4101
+ >`}#Ke(){const e=this.dataset.theme==="dark",n=R(this.locale),s=e?n.useLightTheme:n.useDarkTheme;return m`<button
4067
4102
  class="dpk-theme-toggle"
4068
4103
  type="button"
4069
4104
  aria-label=${s}
4070
4105
  title=${s}
4071
- @click=${()=>this.#f.toggle(De(this.theme))}
4106
+ @click=${()=>this.#k.toggle(_e(this.theme))}
4072
4107
  >
4073
- ${e?cf():pf()}
4074
- </button>`}render(){if(!this.#b)return b;const e=this.#ee();return k`${this.renderChrome(e,this.renderRegions(e))}${this.#Ye()}`}#Ge(e){if(this.#u!==null)return b;const n=O(this.locale),s=this.settingsOpen,i=s?this.settingsSwitches(e):null,r=i===null?b:Fk(i.settings,n,i.flip),o=s?[...i===null?[]:[{id:Zt,label:n.settingsDisplay,render:()=>r}],{id:qk,label:n.settingsAppearance,render:()=>this.#We()},...this.#xe(this.renderSettingsSections(e))]:[];return jk({id:Oi,open:s,label:n.settings,closeLabel:n.settingsClose,sectionsLabel:n.settingsSections,controller:this.#Y,sections:o,activeSection:this.#H,onPick:a=>this.#Ke(a),display:r})}#We(){const e=O(this.locale),n=this.#f.resolve(De(this.theme)),s=[{scheme:"light",label:e.themeLight},{scheme:"dark",label:e.themeDark}],i=(r,o)=>{this.#f.pick(De(this.theme),r),o&&this.updateComplete.then(()=>{this.renderRoot.querySelector(`[data-theme-choice="${r}"]`)?.focus()})};return k`<div class="dpk-settings-list">
4108
+ ${e?kf():bf()}
4109
+ </button>`}render(){if(!this.#b)return b;const e=this.#ie();return m`${this.renderChrome(e,this.renderRegions(e))}${this.#Xe()}`}#Ve(e){if(this.#g!==null)return b;const n=R(this.locale),s=this.settingsOpen,i=s?this.settingsSwitches(e):null,r=i===null?b:Qk(i.settings,n,i.flip),o=s?[...i===null?[]:[{id:Kt,label:n.settingsDisplay,render:()=>r}],{id:Wk,label:n.settingsAppearance,render:()=>this.#Ye()},...this.#xe(this.renderSettingsSections(e))]:[];return Yk({id:Ti,open:s,label:n.settings,closeLabel:n.settingsClose,sectionsLabel:n.settingsSections,controller:this.#q,sections:o,activeSection:this.#C,onPick:a=>this.#Ze(a),display:r})}#Ye(){const e=R(this.locale),n=this.#k.resolve(_e(this.theme)),s=[{scheme:"light",label:e.themeLight},{scheme:"dark",label:e.themeDark}],i=(r,o)=>{this.#k.pick(_e(this.theme),r),o&&this.updateComplete.then(()=>{this.renderRoot.querySelector(`[data-theme-choice="${r}"]`)?.focus()})};return m`<div class="dpk-settings-list">
4075
4110
  <div class="dpk-settings-row">
4076
4111
  <span class="dpk-settings-row-label">${e.language}</span>
4077
- ${this.#ve(this.#se)}
4112
+ ${this.#ve(this.#H)}
4078
4113
  </div>
4079
4114
  <div class="dpk-settings-row">
4080
4115
  <span class="dpk-settings-row-label">${e.settingsTheme}</span>
@@ -4084,7 +4119,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
4084
4119
  aria-label=${e.settingsTheme}
4085
4120
  @keydown=${r=>{r.key!=="ArrowLeft"&&r.key!=="ArrowRight"||(r.preventDefault(),i(n==="light"?"dark":"light",!0))}}
4086
4121
  >
4087
- ${s.map(r=>k`<button
4122
+ ${s.map(r=>m`<button
4088
4123
  type="button"
4089
4124
  role="radio"
4090
4125
  aria-checked=${n===r.scheme?"true":"false"}
@@ -4096,7 +4131,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
4096
4131
  </button>`)}
4097
4132
  </div>
4098
4133
  </div>
4099
- </div>`}#xe(e){return e.map(n=>({id:n.id,label:n.label,render:()=>n.render(this.#ee())}))}#Ke(e){this.#H=e,this.requestUpdate()}#Ve(){if(this.#u===null)return this;let e=this.parentNode;for(;e!==null;){if(e instanceof us&&e.board===null)return e;e=e.parentNode}return null}#Ye(){return this.#L.render()}get sidebarLayout(){return Ga}get mainLayout(){return"flow"}hasSidebarContent(){return this.querySelector(':scope > [slot="sidebar"]')!==null}hasAsideContent(){return this.querySelector(':scope > [slot="aside"]')!==null}hasFooterContent(){return this.querySelector(':scope > [slot="footer"]')!==null}context(){return this.#ee()}#A(){return this.#u===null?null:tl(this)}get#J(){return this.#u===null?this.definition.name:`${this.definition.name}@${this.#u}`}#he(e){const n=this.#A();if(n===null)return{ok:!1,issues:[{path:"board",message:"the page is not ready yet"}]};const s=e(n);return this.requestUpdate(),s}#ye(e,n){const s=this.#A(),i=this.#u,r=vn(e,n);return i===null||s===null?r:Qa(r,i,s.pageNames())}#we(e){const n=this.controller.descriptorFor(e.type)?.targetType??"page";return{...e,target:this.#ye(e.target,n)}}#$e(e){const n=this.#A(),s=this.#u;return n===null||s===null?e:Vf(n.navigation(),s,e,n.pageNames(),this.definition.navigationHierarchy)}#ue(){return{definition:this.definition,controller:()=>this.controller,derivation:()=>this.derivation,ready:this.#re,navigation:()=>this.#U(),issues:()=>this.controller.lastIssues,dispatch:e=>this.dispatch(e),dispatchBatch:e=>this.dispatchBatch(e),subscribe:e=>(this.#R.add(e),()=>{this.#R.delete(e)}),editComment:(e,n)=>this.editComment(e,n),removeAction:e=>this.removeAction(e),clearActions:()=>this.clearActions(),navigate:(e,n)=>this.navigate(e,n),hashFor:e=>this.hashFor(e),requestComment:e=>this.requestComment(e),brief:e=>this.buildBrief(e)}}#Ze(){return sl(this.#ue(),this)}#Se(){return vi(this.#ue())}#ee(){return em(this.#ue())}#U(){const e=this.#A(),n=this.#u===null?this.#S:Ge(e?.navigation()??Pt,this.#u);return this.#b?this.definition.resolveNavigation(this.derivation.state,n):n}#Qe(){const e=this.#_.read(),n=this.#u!==null;this.#e=n?lt:this.readGrill(),this.#Xe(),this.#S=n||this.hashMode==="off"?Pt:Wl(),this.#W=this.locale;const s=this.storageKey;this.#b=new $a({definition:this.definition,base:e,storage:n?null:this.#Je(),grill:{grill:this.#e,locale:this.locale},...typeof s=="string"?{storageKey:s}:{}}),this.#X(),this.#E(),this.#te(!0),this.#G?.();const i=Gf(this);i===null?this.#F?.():i.then(()=>this.#F?.()),this.#_.observe(),this.requestUpdate()}#Xe(){this.querySelector(`:scope > [slot="${Xl}"]`)!==null&&console.warn(`[dev-process-kit] <${this.tagName.toLowerCase()}> no longer shows slot="${Xl}"; slot each piece as slot="${zi}" data-name="\u2026" instead.`)}#Je(){return this.storage==="off"?null:this.storage==="memory"?new oi:ai()}scriptOf(e){return this.querySelector(e)}pendingStart(){return null}get hashMode(){return"auto"}buildBrief(e){return Hn(e,this.controller.definition,me)}readGrill(){return this.#s=null,this.parseGrillScript(this.scriptOf($b))}parseGrillScript(e,n){if(!e?.textContent||e.textContent.trim().length===0)return lt;try{return og(JSON.parse(e.textContent))}catch(s){console.error(`[dev-process-kit] invalid questions${n===void 0?"":` in ${n}`}:`,s);const i=s instanceof Error?s.message:String(s);return this.#s=n===void 0?i:`${n}: ${i}`,lt}}refreshGrill(){this.#u!==null||!this.#b||(this.#e=this.readGrill(),this.#b.setGrill({grill:this.#e,locale:this.locale}),this.requestUpdate())}grillRefsOf(e,n){return[n]}#et(e){this.#u===null&&(this.#e=this.readGrill()),this.controller.setGrill({grill:this.#e,locale:this.locale}),this.controller.setBase(e.state),this.requestUpdate()}#P(){const e=this.#Se();for(const n of this.#R)n(e)}#tt(){if(!this.isConnected){this.requestUpdate(),this.#P();return}this.#u===null&&this.#te(!0),Cl(this.#N,this.controller.actions),queueMicrotask(this.#E),this.requestUpdate(),this.#P(),this.#u===null&&this.dispatchEvent(new CustomEvent("dpk-change",{detail:this.#Se(),bubbles:!0,composed:!0}))}#te(e){if(this.#u!==null)return;const n=this.#U();this.#S=n,this.hashMode!=="off"&&Mk(n,e)}#Ae=()=>{this.#S=Wl(),this.#te(!0),this.requestUpdate(),this.#P(),this.dispatchEvent(new CustomEvent("dpk-navigate",{detail:{navigation:this.#S},bubbles:!0,composed:!0}))};#E=()=>{if(this.#I?.disconnect(),this.#N=Gm(this,s=>{this.isConnected&&this.#I?.observe(s,{childList:!0,subtree:!0})}),!this.#b)return;Cl(this.#N,this.#b.actions);const e=Km(this.#N),n=this.adoptedComponentProviders();this.#b.setComponentSnapshot(n.length===0?e:{targets:e.targets,providers:[...e.providers,...n]}),this.#nt()};adoptedComponentProviders(){return[]}#nt(){if(this.#u===null||!this.#b)return;const e=this.#b.componentSnapshot,n=JSON.stringify([e.targets,e.providers]);n!==this.#Q&&(this.#Q=n,this.dispatchEvent(new CustomEvent("dpk-comment-targets-change",{bubbles:!0,composed:!0})))}#Ee=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!this.#b)return;const n=e.detail;typeof n!="object"||n===null||!("target"in n)||typeof n.target!="string"||(this.#E(),!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(i=>i.value===n.target))||this.requestComment(n.target)};#Ce=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!e.cancelable||!this.#b)return;const n=C(lh,e.detail);if(!n.success)return;this.#E();const{target:s,body:i}=n.output;if(!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(a=>a.value===s))return;this.dispatch({type:H,target:s,payload:{body:i}}).ok&&e.preventDefault()};#Te=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!e.cancelable||!this.#b)return;const n=C(oh,e.detail);if(!n.success)return;this.#E();const{type:s,target:i,payload:r}=n.output;if(!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(l=>l.value===i))return;this.dispatch({type:s,target:i,payload:r}).ok&&e.preventDefault()};#Re=e=>{for(const n of e.composedPath()){if(!(n instanceof Element))continue;if(n===this||n.hasAttribute("data-template"))break;const s=n.getAttribute("data-dpk-navigate");if(s!==null){e.preventDefault(),this.navigate(xn(s.includes("=")?s:`step=${s}`));return}const i=n.getAttribute("data-dpk-comment");if(i!==null){e.preventDefault(),this.requestComment(i);return}}};#st(e){const n=Xk(this,e.memo),s=tb(this.#p,n),i=this.#h,r=a=>{this.#p=a,this.requestUpdate()},o=i.handlers;return k`<div
4134
+ </div>`}#xe(e){return e.map(n=>({id:n.id,label:n.label,render:()=>n.render(this.#ie())}))}#Ze(e){this.#C=e,this.requestUpdate()}#Qe(){if(this.#g===null)return this;let e=this.parentNode;for(;e!==null;){if(e instanceof as&&e.board===null)return e;e=e.parentNode}return null}#Xe(){return this.#y.render()}get sidebarLayout(){return Ua}get mainLayout(){return"flow"}hasSidebarContent(){return this.querySelector(':scope > [slot="sidebar"]')!==null}hasAsideContent(){return this.querySelector(':scope > [slot="aside"]')!==null}hasFooterContent(){return this.querySelector(':scope > [slot="footer"]')!==null}context(){return this.#ie()}#R(){return this.#g===null?null:Za(this)}get#se(){return this.#g===null?this.definition.name:`${this.definition.name}@${this.#g}`}#he(e){const n=this.#R();if(n===null)return{ok:!1,issues:[{path:"board",message:"the page is not ready yet"}]};const s=e(n);return this.requestUpdate(),s}#we(e,n){const s=this.#R(),i=this.#g,r=hn(e,n);return i===null||s===null?r:Wa(r,i,s.pageNames())}#ye(e){const n=this.controller.descriptorFor(e.type)?.targetType??"page";return{...e,target:this.#we(e.target,n)}}#$e(e){const n=this.#R(),s=this.#g;return n===null||s===null?e:tm(n.navigation(),s,e,n.pageNames(),this.definition.navigationHierarchy)}#ue(){return{definition:this.definition,controller:()=>this.controller,derivation:()=>this.derivation,ready:this.#oe,navigation:()=>this.#W(),issues:()=>this.controller.lastIssues,dispatch:e=>this.dispatch(e),dispatchBatch:e=>this.dispatchBatch(e),subscribe:e=>(this.#z.add(e),()=>{this.#z.delete(e)}),editComment:(e,n)=>this.editComment(e,n),removeAction:e=>this.removeAction(e),clearActions:()=>this.clearActions(),navigate:(e,n)=>this.navigate(e,n),hashFor:e=>this.hashFor(e),requestComment:e=>this.requestComment(e),brief:e=>this.buildBrief(e)}}#Je(){return Xa(this.#ue(),this)}#Se(){return fi(this.#ue())}#ie(){return am(this.#ue())}#W(){const e=this.#R(),n=this.#g===null?this.#T:Be(e?.navigation()??Rt,this.#g);return this.#b?this.definition.resolveNavigation(this.derivation.state,n):n}#et(){const e=this.#P.read(),n=this.#g!==null;this.#e=n?st:this.readGrill(),this.#tt(),this.#T=n||this.hashMode==="off"?Rt:Hl(),this.#Z=this.locale;const s=this.storageKey,i=n?void 0:Ql(this,{storageKey:s??rt(this.definition.name),template:this.definition.name});this.#b=new ba({definition:this.definition,base:e,storage:n||i!==void 0?null:this.#nt(),grill:{grill:this.#e,locale:this.locale},...typeof s=="string"?{storageKey:s}:{},...i===void 0?{}:{sync:i},settled:()=>!n&&this.#P.error===null&&this.#n===null&&this.draftSettled()}),this.#te(),n||this.#b.setAddressed(this.#f.log?.addressed??Oe),this.#O(),this.#re(!0),this.#Y?.();const r=Xf(this);r===null?this.#V?.():r.then(()=>this.#V?.()),this.#P.observe(),this.requestUpdate()}#tt(){this.querySelector(`:scope > [slot="${Kl}"]`)!==null&&console.warn(`[dev-process-kit] <${this.tagName.toLowerCase()}> no longer shows slot="${Kl}"; slot each piece as slot="${Oi}" data-name="\u2026" instead.`)}#nt(){return this.storage==="off"?null:this.storage==="memory"?new ei:ti()}scriptOf(e){return this.querySelector(e)}pendingStart(){return null}draftSettled(){return!0}get hashMode(){return"auto"}buildBrief(e){return zn(e,this.controller.definition,ge,this.#f.log?.addressed??Oe)}readGrill(){return this.#n=null,this.parseGrillScript(this.scriptOf(_b))}parseGrillScript(e,n){if(!e?.textContent||e.textContent.trim().length===0)return st;try{return sg(JSON.parse(e.textContent))}catch(s){console.error(`[dev-process-kit] invalid questions${n===void 0?"":` in ${n}`}:`,s);const i=s instanceof Error?s.message:String(s);return this.#n=n===void 0?i:`${n}: ${i}`,st}}refreshGrill(){this.#g!==null||!this.#b||(this.#e=this.readGrill(),this.#b.setGrill({grill:this.#e,locale:this.locale}),this.requestUpdate())}grillRefsOf(e,n){return[n]}#st(e){this.#g===null&&(this.#e=this.readGrill()),this.controller.setGrill({grill:this.#e,locale:this.locale}),this.controller.setBase(e.state),this.requestUpdate()}#N(){const e=this.#Se();for(const n of this.#z)n(e)}#it(){if(!this.isConnected){this.requestUpdate(),this.#N();return}this.#g===null&&this.#re(!0),yl(this.#F,this.controller.actions),queueMicrotask(this.#O),this.requestUpdate(),this.#N(),this.#g===null&&this.dispatchEvent(new CustomEvent("dpk-change",{detail:this.#Se(),bubbles:!0,composed:!0}))}#re(e){if(this.#g!==null)return;const n=this.#W();this.#T=n,this.hashMode!=="off"&&Nk(n,e)}#Ae=()=>{this.#T=Hl(),this.#re(!0),this.requestUpdate(),this.#N(),this.dispatchEvent(new CustomEvent("dpk-navigate",{detail:{navigation:this.#T},bubbles:!0,composed:!0}))};#O=()=>{if(this.#j?.disconnect(),this.#F=Xm(this,s=>{this.isConnected&&this.#j?.observe(s,{childList:!0,subtree:!0})}),!this.#b)return;yl(this.#F,this.#b.actions);const e=ek(this.#F),n=this.adoptedComponentProviders();this.#b.setComponentSnapshot(n.length===0?e:{targets:e.targets,providers:[...e.providers,...n]}),this.#rt()};adoptedComponentProviders(){return[]}#rt(){if(this.#g===null||!this.#b)return;const e=this.#b.componentSnapshot,n=JSON.stringify([e.targets,e.providers]);n!==this.#ee&&(this.#ee=n,this.dispatchEvent(new CustomEvent("dpk-comment-targets-change",{bubbles:!0,composed:!0})))}#Ee=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!this.#b)return;const n=e.detail;typeof n!="object"||n===null||!("target"in n)||typeof n.target!="string"||(this.#O(),!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(i=>i.value===n.target))||this.requestComment(n.target)};#Ce=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!e.cancelable||!this.#b)return;const n=C(rh,e.detail);if(!n.success)return;this.#O();const{target:s,body:i}=n.output;if(!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(a=>a.value===s))return;this.dispatch({type:D,target:s,payload:{body:i}}).ok&&e.preventDefault()};#Te=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!e.cancelable||!this.#b)return;const n=C(sh,e.detail);if(!n.success)return;this.#O();const{type:s,target:i,payload:r}=n.output;if(!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(l=>l.value===i))return;this.dispatch({type:s,target:i,payload:r}).ok&&e.preventDefault()};#Re=e=>{for(const n of e.composedPath()){if(!(n instanceof Element))continue;if(n===this||n.hasAttribute("data-template"))break;const s=n.getAttribute("data-dpk-navigate");if(s!==null){e.preventDefault(),this.navigate(un(s.includes("=")?s:`step=${s}`));return}const i=n.getAttribute("data-dpk-comment");if(i!==null){e.preventDefault(),this.requestComment(i);return}}};#ot(e){const n=rb(this,e.memo),s=lb(this.#u,n),i=this.#h,r=a=>{this.#u=a,this.requestUpdate()},o=i.handlers;return m`<div
4100
4135
  class="dpk-supplements"
4101
4136
  ?hidden=${n.length===0}
4102
4137
  ?data-open=${s!==null}
@@ -4110,7 +4145,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
4110
4145
  aria-orientation="horizontal"
4111
4146
  aria-controls="dpk-supplements-body"
4112
4147
  aria-label=${e.resizeSupplements}
4113
- aria-valuemin=${de.min}
4148
+ aria-valuemin=${oe.min}
4114
4149
  aria-valuemax=${i.max}
4115
4150
  aria-valuenow=${i.height}
4116
4151
  title=${e.resizeSupplementsHint}
@@ -4130,25 +4165,25 @@ The brief is too long for a comment, so it is stored in this artifact's database
4130
4165
  aria-expanded=${String(s!==null)}
4131
4166
  aria-controls="dpk-supplements-body"
4132
4167
  aria-label=${s===null?e.openSupplements:e.closeSupplements}
4133
- @click=${()=>r(sb(this.#p,n))}
4168
+ @click=${()=>r(cb(this.#u,n))}
4134
4169
  >
4135
- ${Gt()}
4170
+ ${Bt()}
4136
4171
  </button>
4137
- ${n.map(a=>k`<button
4172
+ ${n.map(a=>m`<button
4138
4173
  type="button"
4139
4174
  class="dpk-supplement-tab"
4140
4175
  aria-expanded=${String(a===s)}
4141
4176
  aria-controls="dpk-supplements-body"
4142
- @click=${()=>r(nb(this.#p,a.element))}
4177
+ @click=${()=>r(db(this.#u,a.element))}
4143
4178
  >
4144
4179
  ${a.name}
4145
4180
  </button>`)}
4146
4181
  </div>
4147
4182
  <div class="dpk-supplements-body" id="dpk-supplements-body" ?hidden=${s===null}>
4148
- <style .textContent=${s===null?"":Jk(this,s)}></style>
4149
- <slot name=${zi} @slotchange=${()=>this.requestUpdate()}></slot>
4183
+ <style .textContent=${s===null?"":ob(this,s)}></style>
4184
+ <slot name=${Oi} @slotchange=${()=>this.requestUpdate()}></slot>
4150
4185
  </div>
4151
- </div>`}#it(){const e=this.renderRoot.querySelector(".dpk-shell"),n=this.renderRoot.querySelector(".dpk-dock-actions");e&&(n?e.style.setProperty("--dpk-dock-space",`${n.offsetWidth+8}px`):e.style.removeProperty("--dpk-dock-space"))}#rt(){this.#c.route()}}const Ni="dpk-page-state",Cb=1e3,Tb=t=>t.localName.startsWith("dpk-view-")||t.localName.startsWith("dpk-board-"),Rb=t=>typeof t!="object"||t===null||!("status"in t)?!1:t.status==="ready"||t.status==="empty"?!0:t.status==="unavailable"&&"tag"in t&&typeof t.tag=="string",_b={kind:"view",name:"page",label:"Page",addable:!1,parseBase:()=>({}),emptyBase:()=>({}),actions:{},apply:()=>null,hasTarget:()=>!1,describe:t=>({title:t.type,targetLabel:"",tone:"meta"}),serialize:t=>t.type,resolveNavigation:()=>({}),commentTargets:()=>[],title:()=>""},Mb=z`
4186
+ </div>`}#at(){const e=this.renderRoot.querySelector(".dpk-shell"),n=this.renderRoot.querySelector(".dpk-dock-actions");e&&(n?e.style.setProperty("--dpk-dock-space",`${n.offsetWidth+8}px`):e.style.removeProperty("--dpk-dock-space"))}#lt(){this.#c.route()}}const Li="dpk-page-state",Ib=1e3,Db=t=>t.localName.startsWith("dpk-view-")||t.localName.startsWith("dpk-board-"),Nb=t=>typeof t!="object"||t===null||!("status"in t)?!1:t.status==="ready"||t.status==="empty"?!0:t.status==="unavailable"&&"tag"in t&&typeof t.tag=="string",qb={kind:"view",name:"page",label:"Page",addable:!1,parseBase:()=>({}),emptyBase:()=>({}),actions:{},apply:()=>null,hasTarget:()=>!1,describe:t=>({title:t.type,targetLabel:"",tone:"meta"}),serialize:t=>t.type,resolveNavigation:()=>({}),commentTargets:()=>[],title:()=>""},Ub=P`
4152
4187
  :host {
4153
4188
  display: block;
4154
4189
  height: 100%;
@@ -4186,20 +4221,20 @@ The brief is too long for a comment, so it is stored in this artifact's database
4186
4221
  font-family: var(--dpk-mono, ui-monospace, monospace);
4187
4222
  font-size: 11px;
4188
4223
  }
4189
- `;class Ob extends ee{static{this.styles=Mb}static{this.properties={name:{type:String},label:{type:String}}}#e=new Wt(this);#s=null;#t=!1;#n=null;#i;#r;#o;#a=new Promise(e=>{this.#o=e});constructor(){super(),this.#i=new Promise(e=>{this.#r=e})}get ready(){return this.#i}get contentState(){return this.#n}get content(){return this.#s}get definition(){return this.#s?.definition??_b}get liveDefinition(){return this.#s?.liveDefinition??this.definition}get api(){if(this.#s===null)throw new Error("<dpk-page> has no view or board content");return this.#s.api}get controller(){if(this.#s===null)throw new Error("<dpk-page> has no view or board content");return this.#s.controller}get componentSnapshot(){return this.#s?.componentSnapshot??null}get delivered(){return this.#a}deliver(){this.#o?.()}get[Yn](){return Wf(this)}connectedCallback(){super.connectedCallback(),this.#d()}refreshContent(){this.#s?.requestUpdate?.()}render(){return k`${this.#l()}<slot @slotchange=${()=>this.#d()}></slot>`}#l(){const e=this.#n,n=O(this.#e.locale);return e?.status==="empty"?k`<div class="dpk-page-notice" role="alert">
4224
+ `;class Hb extends X{static{this.styles=Ub}static{this.properties={name:{type:String},label:{type:String}}}#e=new jt(this);#n=null;#s=!1;#t=null;#i;#r;#o;#a=new Promise(e=>{this.#o=e});constructor(){super(),this.#i=new Promise(e=>{this.#r=e})}get ready(){return this.#i}get contentState(){return this.#t}get content(){return this.#n}get definition(){return this.#n?.definition??qb}get liveDefinition(){return this.#n?.liveDefinition??this.definition}get api(){if(this.#n===null)throw new Error("<dpk-page> has no view or board content");return this.#n.api}get controller(){if(this.#n===null)throw new Error("<dpk-page> has no view or board content");return this.#n.controller}get componentSnapshot(){return this.#n?.componentSnapshot??null}get delivered(){return this.#a}deliver(){this.#o?.()}get[jn](){return Jf(this)}connectedCallback(){super.connectedCallback(),this.#d()}refreshContent(){this.#n?.requestUpdate?.()}render(){return m`${this.#l()}<slot @slotchange=${()=>this.#d()}></slot>`}#l(){const e=this.#t,n=R(this.#e.locale);return e?.status==="empty"?m`<div class="dpk-page-notice" role="alert">
4190
4225
  <strong>${n.pageEmpty}</strong>
4191
4226
  <span>${n.pageEmptyHint}</span>
4192
- </div>`:e?.status==="unavailable"?k`<div class="dpk-page-notice" role="alert">
4227
+ </div>`:e?.status==="unavailable"?m`<div class="dpk-page-notice" role="alert">
4193
4228
  <strong>${n.pageUnavailable}</strong>
4194
4229
  <code>${n.pageUnavailableHint(e.tag)}</code>
4195
- </div>`:b}#d(){const e=Array.from(this.children).filter(Tb),n=e[0]??null;if(!(this.#t&&n===this.#s)){if(this.#t=!0,this.#s=n,this.#n=null,n===null){this.name!==null&&console.warn(`[dev-process-kit] <dpk-page name="${this.name}"> holds no view or board`),this.#f({status:"empty"});return}n.localName.startsWith("dpk-board-")&&n.setAttribute("data-dpk-page-content",""),e.length>1&&console.warn(`[dev-process-kit] <dpk-page name="${this.name}"> holds ${e.length} views or boards; only the first is used`),this.#p(n).then(s=>this.#c(n,s)),customElements.whenDefined(n.localName).then(()=>{this.#s!==n||this.#n?.status!=="unavailable"||this.#p(n).then(s=>this.#c(n,s))}),this.requestUpdate()}}#c(e,n){this.#s===e&&(this.#f(n),n.status==="ready"&&(this.requestUpdate(),e.localName.startsWith("dpk-board-")&&requestAnimationFrame(()=>e.resetView?.())))}async#p(e){const n=e.localName;if(!await this.#h(n))return console.error(`[dev-process-kit] <dpk-page name="${this.name}"> holds <${n}>, which no loaded entry defines`),{status:"unavailable",tag:n};const s=e.started??e.ready??e.api?.ready;return s!==void 0&&await s,{status:"ready"}}async#h(e){return customElements.get(e)!==void 0?!0:new Promise(n=>{const s=setTimeout(()=>n(customElements.get(e)!==void 0),Cb);customElements.whenDefined(e).then(()=>{clearTimeout(s),n(!0)})})}#f(e){const n=this.#n,s=n===null||n.status!==e.status||e.status==="unavailable"&&n.status==="unavailable"&&n.tag!==e.tag;this.#n=e,this.#r(),s&&this.dispatchEvent(new CustomEvent(Ni,{detail:e,bubbles:!0,composed:!0})),this.requestUpdate()}}const id=(t,e)=>({...t,id:kt(t.id,e),ref:kt(t.ref,e)}),Pb=(t,e)=>{const n=Math.max(t.length,...e.map(({grill:s})=>s.rounds.length));return Array.from({length:n},(s,i)=>({label:t[i]?.label??e.map(({grill:o})=>o.rounds[i]?.label).find(o=>o!==void 0)??`v${i+1}`,questions:[...t[i]?.questions??[],...e.flatMap(({page:o,grill:a})=>(a.rounds[i]?.questions??[]).map(l=>id(l,o)))]}))},Lb=(t,e)=>{const n=e.filter(({grill:s})=>s.questions.length>0||s.rounds.length>0);return n.length===0?t:{questions:[...t.questions,...n.flatMap(({page:s,grill:i})=>i.questions.map(r=>id(r,s)))],rounds:Pb(t.rounds,n)}},zb=(t,e)=>e===null||t.includes(Kn)?[t]:[kt(t,e),t],Db=t=>{let e=t;for(;e!==null;){const n=ki(e);if(n!==null)return n;const s=e.getRootNode();e=e.parentElement??(s instanceof ShadowRoot?s.host:null)}return null},is=w(v(),te(mi)),wt={ADD_PAGE:bn("ADD_PAGE","app",R({page:is,kind:_t(["view","board"]),content:w(v(),S(1)),label:w(v(),S(1))}),{mode:"append"}),REMOVE_PAGE:bn("REMOVE_PAGE","app",R({page:is}),{mode:"append"}),RENAME_PAGE:bn("RENAME_PAGE","app",R({page:is,label:w(v(),hn(),S(1))}),{mode:"patch",dedupeKey:t=>{const e=C(R({page:is}),t.payload);return e.success?`RENAME_PAGE|${e.output.page}`:null}})},Ib=t=>{const e=Ot(wt,t);return e===null?null:e.payload.page},Nb=(t,e)=>Se(t.target)?Ib(t)===e:Fe(t.target)?.page===e,qb="## How to apply",Ub=(t,e)=>{const n=new Map;for(const s of e){const i=Fe(s.target)?.page;if(i===void 0||Q(s))continue;const r=n.get(i)??{changes:0,comments:0};s.type===H?r.comments+=1:r.changes+=1,n.set(i,r)}return[`## Pages (${t.length})`,"","This document is a `<dpk-app>` holding `<dpk-page>` elements. Every target ending in `@<page>` belongs to that page: apply it to its `dpk-view-*` or `dpk-board-*` child, against that content's base JSON and action vocabulary, with the qualifier removed. `app:app` is the whole document.","",'`ADD_PAGE` on `app:app` asks for a new `<dpk-page name="<page>" label="<label>">` whose content is a `<dpk-view-<content>>` or `<dpk-board-<content>>` (the action says which), with its base JSON built from the actions on `@<page>`; `REMOVE_PAGE` asks to take that page out, with everything the draft says about it.',"","A question `grill:<id>@<page>` comes from the `data-dpk-grill` block of that page; one without a qualifier comes from the app's own block. Settle each in the page (or app) it was asked of, writing its id back into that block (`history` included) with the qualifier removed.","",...t.map(s=>{const i=n.get(s.id)??{changes:0,comments:0};return`- \`${s.id}\` \u2014 ${s.label} (\`${s.definition.kind}:${s.definition.name}\`): ${i.changes} change(s), ${i.comments} comment(s)`}),""]},Hb=(t,e)=>{const n=t.indexOf(qb),s=`${e.join(`
4230
+ </div>`:b}#d(){const e=Array.from(this.children).filter(Db),n=e[0]??null;if(!(this.#s&&n===this.#n)){if(this.#s=!0,this.#n=n,this.#t=null,n===null){this.name!==null&&console.warn(`[dev-process-kit] <dpk-page name="${this.name}"> holds no view or board`),this.#k({status:"empty"});return}n.localName.startsWith("dpk-board-")&&n.setAttribute("data-dpk-page-content",""),e.length>1&&console.warn(`[dev-process-kit] <dpk-page name="${this.name}"> holds ${e.length} views or boards; only the first is used`),this.#u(n).then(s=>this.#c(n,s)),customElements.whenDefined(n.localName).then(()=>{this.#n!==n||this.#t?.status!=="unavailable"||this.#u(n).then(s=>this.#c(n,s))}),this.requestUpdate()}}#c(e,n){this.#n===e&&(this.#k(n),n.status==="ready"&&(this.requestUpdate(),e.localName.startsWith("dpk-board-")&&requestAnimationFrame(()=>e.resetView?.())))}async#u(e){const n=e.localName;if(!await this.#h(n))return console.error(`[dev-process-kit] <dpk-page name="${this.name}"> holds <${n}>, which no loaded entry defines`),{status:"unavailable",tag:n};const s=e.started??e.ready??e.api?.ready;return s!==void 0&&await s,{status:"ready"}}async#h(e){return customElements.get(e)!==void 0?!0:new Promise(n=>{const s=setTimeout(()=>n(customElements.get(e)!==void 0),Ib);customElements.whenDefined(e).then(()=>{clearTimeout(s),n(!0)})})}#k(e){const n=this.#t,s=n===null||n.status!==e.status||e.status==="unavailable"&&n.status==="unavailable"&&n.tag!==e.tag;this.#t=e,this.#r(),s&&this.dispatchEvent(new CustomEvent(Li,{detail:e,bubbles:!0,composed:!0})),this.requestUpdate()}}const ed=(t,e)=>({...t,id:ht(t.id,e),ref:ht(t.ref,e)}),Bb=(t,e)=>{const n=Math.max(t.length,...e.map(({grill:s})=>s.rounds.length));return Array.from({length:n},(s,i)=>({label:t[i]?.label??e.map(({grill:o})=>o.rounds[i]?.label).find(o=>o!==void 0)??`v${i+1}`,questions:[...t[i]?.questions??[],...e.flatMap(({page:o,grill:a})=>(a.rounds[i]?.questions??[]).map(l=>ed(l,o)))]}))},jb=(t,e)=>{const n=e.filter(({grill:s})=>s.questions.length>0||s.rounds.length>0);return n.length===0?t:{questions:[...t.questions,...n.flatMap(({page:s,grill:i})=>i.questions.map(r=>ed(r,s)))],rounds:Bb(t.rounds,n)}},Fb=(t,e)=>e===null||t.includes(Hn)?[t]:[ht(t,e),t],Gb=t=>{let e=t;for(;e!==null;){const n=ui(e);if(n!==null)return n;const s=e.getRootNode();e=e.parentElement??(s instanceof ShadowRoot?s.host:null)}return null},Xn=$(x(),le(hi)),kt={ADD_PAGE:ps("ADD_PAGE","app",O({page:Xn,kind:ds(["view","board"]),content:$(x(),E(1)),label:$(x(),E(1))}),{mode:"append"}),REMOVE_PAGE:ps("REMOVE_PAGE","app",O({page:Xn}),{mode:"append"}),RENAME_PAGE:ps("RENAME_PAGE","app",O({page:Xn,label:$(x(),Ji(),E(1))}),{mode:"patch",dedupeKey:t=>{const e=C(O({page:Xn}),t.payload);return e.success?`RENAME_PAGE|${e.output.page}`:null}})},Wb=t=>{const e=nn(kt,t);return e===null?null:e.payload.page},Kb=(t,e)=>we(t.target)?Wb(t)===e:He(t.target)?.page===e,Vb="## How to apply",Yb=(t,e)=>{const n=new Map;for(const s of e){const i=He(s.target)?.page;if(i===void 0||Y(s))continue;const r=n.get(i)??{changes:0,comments:0};s.type===D?r.comments+=1:r.changes+=1,n.set(i,r)}return[`## Pages (${t.length})`,"","This document is a `<dpk-app>` holding `<dpk-page>` elements. Every target ending in `@<page>` belongs to that page: apply it to its `dpk-view-*` or `dpk-board-*` child, against that content's base JSON and action vocabulary, with the qualifier removed. `app:app` is the whole document.","",'`ADD_PAGE` on `app:app` asks for a new `<dpk-page name="<page>" label="<label>">` whose content is a `<dpk-view-<content>>` or `<dpk-board-<content>>` (the action says which), with its base JSON built from the actions on `@<page>`; `REMOVE_PAGE` asks to take that page out, with everything the draft says about it.',"","A question `grill:<id>@<page>` comes from the `data-dpk-grill` block of that page; one without a qualifier comes from the app's own block. Settle each in the page (or app) it was asked of, writing its id back into that block (`history` included) with the qualifier removed.","",...t.map(s=>{const i=n.get(s.id)??{changes:0,comments:0};return`- \`${s.id}\` \u2014 ${s.label} (\`${s.definition.kind}:${s.definition.name}\`): ${i.changes} change(s), ${i.comments} comment(s)`}),""]},Zb=(t,e)=>{const n=t.indexOf(Vb),s=`${e.join(`
4196
4231
  `)}
4197
4232
  `;return n<0?`${t}
4198
- ${s}`:`${t.slice(0,n)}${s}${t.slice(n)}`},jb=R({title:N(v())}),Bb={schema:jr(),mode:"append",targetType:"unknown"},Fb="app",Gb=(t,e)=>{if(!e.has(t))return t;let n=2;for(;e.has(`${t}-${n}`);)n+=1;return`${t}-${n}`},Wb=t=>{const e=t.messages,n=(p,g)=>t.catalog().find(u=>u.kind===p&&u.name===g),s=(p,g)=>{const u=p.layout.find(x=>x.id===g);if(u===void 0||!Object.hasOwn(p.pages,g))return;const m=t.pages().find(x=>x.id===g)?.definition??n(u.kind,u.content);return m===void 0?void 0:{id:g,label:u.label,definition:m}},i=p=>p.layout.flatMap(g=>{const u=s(p,g.id);return u===void 0?[]:[u]}),r=(p,g)=>{const u=Fe(g);return u===null?null:{...u,spec:s(p,u.page)}},o=(p,g)=>({...p,target:g}),a=(p,g,u)=>({...p,pages:{...p.pages,[g]:u}}),l=(p,g)=>{const u=i(p);return u.find(m=>m.id===g[Ae])??u[0]},c=(p,g)=>({title:p.type==="comment"?e.comment:p.type,targetLabel:g,tone:p.type==="comment"?"comment":"meta"}),d=p=>{const g=t.base();return{title:p,layout:g.layout,pages:g.pages}},h=(p,g)=>{const u=Ot(wt,g);if(u===null)return null;const{page:m}=u.payload,x=p.layout.some($=>$.id===m);if(u.type==="ADD_PAGE"){const $=n(u.payload.kind,u.payload.content);if(x||$===void 0)return null;const E=$.emptyBase();return{...p,layout:[...p.layout,{id:m,kind:u.payload.kind,content:$.name,label:u.payload.label}],pages:{...p.pages,[m]:E}}}return u.type==="RENAME_PAGE"?x?{...p,layout:p.layout.map($=>$.id===m?{...$,label:u.payload.label}:$)}:null:x?{...p,layout:p.layout.filter($=>$.id!==m),pages:Object.fromEntries(Object.entries(p.pages).filter(([$])=>$!==m))}:null},f=p=>{const g=Ot(wt,p);if(g===null)return c(p,e.wholePage);if(g.type==="ADD_PAGE"){const m=n(g.payload.kind,g.payload.content)?.label??g.payload.content;return{title:e.pageAdded,targetLabel:`${g.payload.label} (${m})`,tone:"create"}}if(g.type==="RENAME_PAGE")return{title:e.pageRenamed,targetLabel:g.payload.label,tone:"update"};const u=t.base().layout.find(m=>m.id===g.payload.page)?.label;return{title:e.pageRemoved,targetLabel:u??g.payload.page,tone:"delete"}};return{kind:"view",name:Fb,label:e.label,parseBase:p=>d(Mt(jb,p).title??e.untitled),emptyBase:()=>d(e.untitled),get actions(){return Object.fromEntries([...t.pages().flatMap(p=>Object.entries(p.definition.actions)),...Object.entries(wt)])},actionFor:(p,g)=>{if(g===void 0||Se(g))return tt(wt,p);const u=Fe(g);if(u===null)return;const m=t.pages().find(x=>x.id===u.page);return m===void 0?Bb:tt(m.definition.actions,p)},apply:(p,g)=>{if(Se(g.target))return h(p,g);const u=r(p,g.target);if(u?.spec===void 0)return null;const m=u.spec.definition.apply(p.pages[u.page],o(g,u.target));return m===null?null:a(p,u.page,m)},canonicalState:p=>({...p,pages:Object.fromEntries(Object.entries(p.pages).map(([g,u])=>{const m=s(p,g)?.definition;return[g,m?.canonicalState?m.canonicalState(u):u]}))}),canonicalTarget:(p,g)=>{const u=r(p,g),m=u?.spec?.definition;return u===null||m?.canonicalTarget===void 0?g:Za(m.canonicalTarget(p.pages[u.page],u.target),u.page)},hasTarget:(p,g)=>{if(Se(g))return!0;const u=r(p,g);return u?.spec===void 0?!1:u.spec.definition.hasTarget(p.pages[u.page],u.target)},pageTargetExists:(p,g)=>Se(g)||r(p,g)?.spec!==void 0,describe:(p,g,u)=>{if(Se(p.target))return p.type==="comment"?c(p,e.wholePage):f(p);const m=r(g,p.target);if(m===null)return c(p,P(p.target));if(m.spec===void 0)return c(p,e.missingPage(m.page));const x=m.spec.definition.describe(o(p,m.target),g.pages[m.page],u?.pages[m.page]);return{...x,targetLabel:`${m.spec.label} \u203A ${x.targetLabel}`}},serialize:p=>{const g=Fe(p.target),u=g===null?void 0:t.pages().find(m=>m.id===g.page);return g===null||u===void 0?`${p.type} ${P(p.target)} ${JSON.stringify(p.payload)}`:`${u.definition.serialize(o(p,g.target))} @${g.page}`},resolveNavigation:(p,g)=>{const u=l(p,g),m=u===void 0?{}:{[Ae]:u.id};for(const x of i(p)){const $=x.definition.resolveNavigation(p.pages[x.id],Ge(g,x.id));Object.assign(m,nl(x.id,$))}return m},navigationFor:(p,g)=>{const u=r(p,g);if(u?.spec===void 0)return null;const m=u.spec.definition.navigationFor?.(p.pages[u.page],u.target)??null;return{[Ae]:u.page,...nl(u.page,m??{})}},commentTargets:(p,g)=>[{value:P(mt),label:e.wholePage,group:e.pageGroup},...i(p).flatMap(u=>u.definition.commentTargets(p.pages[u.id],Ge(g,u.id)).map(m=>({value:kt(m.value,u.id),label:m.label,group:m.group===void 0?u.label:`${u.label} \xB7 ${m.group}`})))],currentTarget:(p,g)=>{const u=l(p,g);if(u===void 0)return null;const m=u.definition.currentTarget?.(p.pages[u.id],Ge(g,u.id));return m==null?{value:kt(`page:${u.definition.name}`,u.id),label:u.label,group:e.pageGroup}:{...m,value:kt(m.value,u.id),label:`${u.label} \u203A ${m.label}`}},title:p=>p.title}},rs=je({en:{label:"Document",wholePage:"Whole document",pages:"Pages",pageGroup:"Page",comment:"Comment",missingPage:t=>`Page "${t}" (no longer in the document)`,untitled:"Untitled document",addPage:"Add a page",removePage:t=>`Remove page "${t}"`,pageAdded:"Page added",pageRemoved:"Page removed",pageRenamed:"Page renamed",renamePage:"Rename",switcher:"Switch page",switcherCount:t=>`Switch page (${t} available)`,pageFallback:t=>`Page ${t}`},ja:{label:"\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8",wholePage:"\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u5168\u4F53",pages:"\u30DA\u30FC\u30B8",pageGroup:"\u30DA\u30FC\u30B8",comment:"\u30B3\u30E1\u30F3\u30C8",missingPage:t=>`\u30DA\u30FC\u30B8\u300C${t}\u300D\uFF08\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u304B\u3089\u7121\u304F\u306A\u308A\u307E\u3057\u305F\uFF09`,untitled:"\u7121\u984C\u306E\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8",addPage:"\u30DA\u30FC\u30B8\u3092\u8FFD\u52A0",removePage:t=>`\u30DA\u30FC\u30B8\u300C${t}\u300D\u3092\u524A\u9664`,pageAdded:"\u30DA\u30FC\u30B8\u3092\u8FFD\u52A0",pageRemoved:"\u30DA\u30FC\u30B8\u3092\u524A\u9664",pageRenamed:"\u30DA\u30FC\u30B8\u540D\u3092\u5909\u66F4",renamePage:"\u540D\u524D\u3092\u5909\u66F4",switcher:"\u30DA\u30FC\u30B8\u3092\u5207\u308A\u66FF\u3048",switcherCount:t=>`\u30DA\u30FC\u30B8\u3092\u5207\u308A\u66FF\u3048\uFF08${t}\u4EF6\uFF09`,pageFallback:t=>`\u30DA\u30FC\u30B8${t}`}}),Kb=R({value:v()}),rd=t=>e=>{if(!(e instanceof CustomEvent))return;const n=C(Kb,e.detail);n.success&&t(n.output.value)},Vb=t=>e=>{const n=xt(e.target,HTMLInputElement);n!==null&&t(n.value,n)},Yb=t=>e=>{const n=xt(e.target,HTMLInputElement);n!==null&&t(n.checked)},Qt="dpk-page-switcher-menu",Zb=(t,e,n,s,i,r={active:null})=>{const o=r.active===null?s.switcherCount(n):`${r.active} \xB7 ${s.switcherCount(n)}`;return k`<button
4233
+ ${s}`:`${t.slice(0,n)}${s}${t.slice(n)}`},Qb=O({title:I(x())}),Xb={schema:nc(),mode:"append",targetType:"unknown"},Jb="app",ev=(t,e)=>{if(!e.has(t))return t;let n=2;for(;e.has(`${t}-${n}`);)n+=1;return`${t}-${n}`},tv=t=>{const e=t.messages,n=(c,g)=>t.catalog().find(u=>u.kind===c&&u.name===g),s=(c,g)=>{const u=c.layout.find(v=>v.id===g);if(u===void 0||!Object.hasOwn(c.pages,g))return;const k=t.pages().find(v=>v.id===g)?.definition??n(u.kind,u.content);return k===void 0?void 0:{id:g,label:u.label,definition:k}},i=c=>c.layout.flatMap(g=>{const u=s(c,g.id);return u===void 0?[]:[u]}),r=(c,g)=>{const u=He(g);return u===null?null:{...u,spec:s(c,u.page)}},o=(c,g)=>({...c,target:g}),a=(c,g,u)=>({...c,pages:{...c.pages,[g]:u}}),l=(c,g)=>{const u=i(c);return u.find(k=>k.id===g[ye])??u[0]},p=(c,g)=>({title:c.type==="comment"?e.comment:c.type,targetLabel:g,tone:c.type==="comment"?"comment":"meta"}),h=c=>{const g=t.base();return{title:c,layout:g.layout,pages:g.pages}},d=(c,g)=>{const u=nn(kt,g);if(u===null)return null;const{page:k}=u.payload,v=c.layout.some(y=>y.id===k);if(u.type==="ADD_PAGE"){const y=n(u.payload.kind,u.payload.content);if(v||y===void 0)return null;const A=y.emptyBase();return{...c,layout:[...c.layout,{id:k,kind:u.payload.kind,content:y.name,label:u.payload.label}],pages:{...c.pages,[k]:A}}}return u.type==="RENAME_PAGE"?v?{...c,layout:c.layout.map(y=>y.id===k?{...y,label:u.payload.label}:y)}:null:v?{...c,layout:c.layout.filter(y=>y.id!==k),pages:Object.fromEntries(Object.entries(c.pages).filter(([y])=>y!==k))}:null},f=c=>{const g=nn(kt,c);if(g===null)return p(c,e.wholePage);if(g.type==="ADD_PAGE"){const k=n(g.payload.kind,g.payload.content)?.label??g.payload.content;return{title:e.pageAdded,targetLabel:`${g.payload.label} (${k})`,tone:"create"}}if(g.type==="RENAME_PAGE")return{title:e.pageRenamed,targetLabel:g.payload.label,tone:"update"};const u=t.base().layout.find(k=>k.id===g.payload.page)?.label;return{title:e.pageRemoved,targetLabel:u??g.payload.page,tone:"delete"}};return{kind:"view",name:Jb,label:e.label,parseBase:c=>h(tn(Qb,c).title??e.untitled),emptyBase:()=>h(e.untitled),get actions(){return Object.fromEntries([...t.pages().flatMap(c=>Object.entries(c.definition.actions)),...Object.entries(kt)])},actionFor:(c,g)=>{if(g===void 0||we(g))return St(kt,c);const u=He(g);if(u===null)return;const k=t.pages().find(v=>v.id===u.page);return k===void 0?Xb:St(k.definition.actions,c)},apply:(c,g)=>{if(we(g.target))return d(c,g);const u=r(c,g.target);if(u?.spec===void 0)return null;const k=u.spec.definition.apply(c.pages[u.page],o(g,u.target));return k===null?null:a(c,u.page,k)},canonicalState:c=>({...c,pages:Object.fromEntries(Object.entries(c.pages).map(([g,u])=>{const k=s(c,g)?.definition;return[g,k?.canonicalState?k.canonicalState(u):u]}))}),canonicalTarget:(c,g)=>{const u=r(c,g),k=u?.spec?.definition;return u===null||k?.canonicalTarget===void 0?g:Ga(k.canonicalTarget(c.pages[u.page],u.target),u.page)},hasTarget:(c,g)=>{if(we(g))return!0;const u=r(c,g);return u?.spec===void 0?!1:u.spec.definition.hasTarget(c.pages[u.page],u.target)},pageTargetExists:(c,g)=>we(g)||r(c,g)?.spec!==void 0,wholeTarget:Ue,describe:(c,g,u)=>{if(we(c.target))return c.type==="comment"?p(c,e.wholePage):f(c);const k=r(g,c.target);if(k===null)return p(c,_(c.target));if(k.spec===void 0)return p(c,e.missingPage(k.page));const v=k.spec.definition.describe(o(c,k.target),g.pages[k.page],u?.pages[k.page]);return{...v,targetLabel:`${k.spec.label} \u203A ${v.targetLabel}`}},serialize:c=>{const g=He(c.target),u=g===null?void 0:t.pages().find(k=>k.id===g.page);return g===null||u===void 0?`${c.type} ${_(c.target)} ${JSON.stringify(c.payload)}`:`${u.definition.serialize(o(c,g.target))} @${g.page}`},resolveNavigation:(c,g)=>{const u=l(c,g),k=u===void 0?{}:{[ye]:u.id};for(const v of i(c)){const y=v.definition.resolveNavigation(c.pages[v.id],Be(g,v.id));Object.assign(k,Qa(v.id,y))}return k},navigationFor:(c,g)=>{const u=r(c,g);if(u?.spec===void 0)return null;const k=u.spec.definition.navigationFor?.(c.pages[u.page],u.target)??null;return{[ye]:u.page,...Qa(u.page,k??{})}},commentTargets:(c,g)=>[{value:_(Ue),label:e.wholePage,group:e.pageGroup},...i(c).flatMap(u=>u.definition.commentTargets(c.pages[u.id],Be(g,u.id)).map(k=>({value:ht(k.value,u.id),label:k.label,group:k.group===void 0?u.label:`${u.label} \xB7 ${k.group}`})))],currentTarget:(c,g)=>{const u=l(c,g);if(u===void 0)return null;const k=u.definition.currentTarget?.(c.pages[u.id],Be(g,u.id));return k==null?{value:ht(`page:${u.definition.name}`,u.id),label:u.label,group:e.pageGroup}:{...k,value:ht(k.value,u.id),label:`${u.label} \u203A ${k.label}`}},title:c=>c.title}},Jn=Ne({en:{label:"Document",wholePage:"Whole document",pages:"Pages",pageGroup:"Page",comment:"Comment",missingPage:t=>`Page "${t}" (no longer in the document)`,untitled:"Untitled document",addPage:"Add a page",removePage:t=>`Remove page "${t}"`,pageAdded:"Page added",pageRemoved:"Page removed",pageRenamed:"Page renamed",renamePage:"Rename",switcher:"Switch page",switcherCount:t=>`Switch page (${t} available)`,pageFallback:t=>`Page ${t}`},ja:{label:"\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8",wholePage:"\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u5168\u4F53",pages:"\u30DA\u30FC\u30B8",pageGroup:"\u30DA\u30FC\u30B8",comment:"\u30B3\u30E1\u30F3\u30C8",missingPage:t=>`\u30DA\u30FC\u30B8\u300C${t}\u300D\uFF08\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u304B\u3089\u7121\u304F\u306A\u308A\u307E\u3057\u305F\uFF09`,untitled:"\u7121\u984C\u306E\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8",addPage:"\u30DA\u30FC\u30B8\u3092\u8FFD\u52A0",removePage:t=>`\u30DA\u30FC\u30B8\u300C${t}\u300D\u3092\u524A\u9664`,pageAdded:"\u30DA\u30FC\u30B8\u3092\u8FFD\u52A0",pageRemoved:"\u30DA\u30FC\u30B8\u3092\u524A\u9664",pageRenamed:"\u30DA\u30FC\u30B8\u540D\u3092\u5909\u66F4",renamePage:"\u540D\u524D\u3092\u5909\u66F4",switcher:"\u30DA\u30FC\u30B8\u3092\u5207\u308A\u66FF\u3048",switcherCount:t=>`\u30DA\u30FC\u30B8\u3092\u5207\u308A\u66FF\u3048\uFF08${t}\u4EF6\uFF09`,pageFallback:t=>`\u30DA\u30FC\u30B8${t}`}}),nv=O({value:x()}),td=t=>e=>{if(!(e instanceof CustomEvent))return;const n=C(nv,e.detail);n.success&&t(n.output.value)},sv=t=>e=>{const n=ft(e.target,HTMLInputElement);n!==null&&t(n.value,n)},iv=t=>e=>{const n=ft(e.target,HTMLInputElement);n!==null&&t(n.checked)},Vt="dpk-page-switcher-menu",rv=(t,e,n,s,i,r={active:null})=>{const o=r.active===null?s.switcherCount(n):`${r.active} \xB7 ${s.switcherCount(n)}`;return m`<button
4199
4234
  class="dpk-chrome-action dpk-page-switcher-trigger"
4200
4235
  type="button"
4201
4236
  aria-haspopup="menu"
4202
- aria-controls=${Qt}
4237
+ aria-controls=${Vt}
4203
4238
  aria-expanded=${e?"true":"false"}
4204
4239
  aria-label=${o}
4205
4240
  data-tooltip=${o}
@@ -4209,9 +4244,9 @@ ${s}`:`${t.slice(0,n)}${s}${t.slice(n)}`},jb=R({title:N(v())}),Bb={schema:jr(),m
4209
4244
  @click=${i.open}
4210
4245
  >
4211
4246
  ${t()}
4212
- ${n>1?k`<span class="dpk-page-switcher-count" aria-hidden="true">${n}</span>`:b}
4213
- </button>`},Qb=(t,e,n)=>k`<div
4214
- id=${Qt}
4247
+ ${n>1?m`<span class="dpk-page-switcher-count" aria-hidden="true">${n}</span>`:b}
4248
+ </button>`},ov=(t,e,n)=>m`<div
4249
+ id=${Vt}
4215
4250
  class="dpk-settings dpk-page-switcher-menu"
4216
4251
  popover="manual"
4217
4252
  role="menu"
@@ -4221,8 +4256,8 @@ ${s}`:`${t.slice(0,n)}${s}${t.slice(n)}`},jb=R({title:N(v())}),Bb={schema:jr(),m
4221
4256
  @focusin=${n.cancelClose}
4222
4257
  @focusout=${s=>{const i=s.currentTarget,r=s.relatedTarget;i instanceof Node&&r instanceof Node&&i.contains(r)||n.scheduleClose()}}
4223
4258
  >
4224
- ${t.map(s=>k`<div class="dpk-page-switcher-row" role="presentation">
4225
- ${s.rename===void 0?k`<button
4259
+ ${t.map(s=>m`<div class="dpk-page-switcher-row" role="presentation">
4260
+ ${s.rename===void 0?m`<button
4226
4261
  class="dpk-settings-option dpk-page-switcher-option"
4227
4262
  type="button"
4228
4263
  data-key=${s.key}
@@ -4230,37 +4265,37 @@ ${s}`:`${t.slice(0,n)}${s}${t.slice(n)}`},jb=R({title:N(v())}),Bb={schema:jr(),m
4230
4265
  aria-checked=${s.kind==="action"?b:s.current?"true":"false"}
4231
4266
  @click=${s.activate}
4232
4267
  >
4233
- <span class="dpk-settings-check" aria-hidden="true">${s.current?pt():s.icon()}</span>
4268
+ <span class="dpk-settings-check" aria-hidden="true">${s.current?at():s.icon()}</span>
4234
4269
  <span class="dpk-settings-text"><span class="dpk-settings-name">${s.label}</span></span>
4235
- </button>`:k`<div
4270
+ </button>`:m`<div
4236
4271
  class="dpk-settings-option dpk-page-switcher-option"
4237
4272
  data-key=${s.key}
4238
4273
  data-current
4239
4274
  role="menuitemradio"
4240
4275
  aria-checked="true"
4241
4276
  >
4242
- <span class="dpk-settings-check" aria-hidden="true">${pt()}</span>
4277
+ <span class="dpk-settings-check" aria-hidden="true">${at()}</span>
4243
4278
  <span class="dpk-settings-text">
4244
4279
  <span class="dpk-settings-name dpk-page-switcher-name"
4245
4280
  ><dpk-inline-edit
4246
4281
  .value=${s.label}
4247
4282
  .label=${s.rename.label}
4248
- @dpk-commit=${rd(s.rename.commit)}
4283
+ @dpk-commit=${td(s.rename.commit)}
4249
4284
  ></dpk-inline-edit
4250
4285
  ></span>
4251
4286
  </span>
4252
4287
  </div>`}
4253
- ${s.remove===void 0?b:k`<button
4288
+ ${s.remove===void 0?b:m`<button
4254
4289
  class="dpk-page-switcher-remove"
4255
4290
  type="button"
4256
4291
  aria-label=${s.remove.label}
4257
4292
  title=${s.remove.label}
4258
4293
  @click=${s.remove.activate}
4259
4294
  >
4260
- ${ct()}
4295
+ ${ot()}
4261
4296
  </button>`}
4262
4297
  </div>`)}
4263
- </div>`,Xb=t=>{try{const e=new URL(t),n=e.pathname.split("/");return n.pop(),n.at(-1)==="views"&&n.pop(),new URL(`${n.join("/")}/`,e)}catch{return null}},od=(t,e)=>{if(e===null)return null;const n=Xb(e);if(n===null)return null;try{return new URL(t,n).href}catch{return null}},ad=(t,e)=>od(`views/${t}.js`,e),ld=t=>od("boards.js",t),dd=t=>t instanceof HTMLElement&&"definition"in t&&"api"in t&&Ff(t)!==null,Jb=t=>t instanceof HTMLElement&&"settingsSections"in t,ev=t=>typeof t=="object"&&t!==null&&"name"in t&&"emptyBase"in t,tv=`:scope > script[type="application/json"][${ei}]`,nv=(t,e)=>t.flatMap(n=>{if(n.target.type===le)return[];const s=Fe(n.target);return s?.page===e?[{...n,target:s.target}]:[]}),sv=t=>typeof t=="object"&&t!==null&&Object.values(t).every(e=>typeof e=="string"),iv=(t,e)=>{const n=Object.keys(t);return n.length===Object.keys(e).length&&n.every(s=>t[s]===e[s])},rv=t=>{try{return t.matches(":popover-open")}catch{return!1}},ov=y(uc),av={width:240,height:420},lv=220,dv=z`
4298
+ </div>`,av=t=>{try{const e=new URL(t),n=e.pathname.split("/");return n.pop(),n.at(-1)==="views"&&n.pop(),new URL(`${n.join("/")}/`,e)}catch{return null}},nd=(t,e)=>{if(e===null)return null;const n=av(e);if(n===null)return null;try{return new URL(t,n).href}catch{return null}},sd=(t,e)=>nd(`views/${t}.js`,e),id=t=>nd("boards.js",t),rd=t=>t instanceof HTMLElement&&"definition"in t&&"api"in t&&Qf(t)!==null,lv=t=>t instanceof HTMLElement&&"settingsSections"in t,dv=t=>typeof t=="object"&&t!==null&&"name"in t&&"emptyBase"in t,cv=`:scope > script[type="application/json"][${Ks}]`,pv=(t,e)=>t.flatMap(n=>{if(n.target.type===re)return[];const s=He(n.target);return s?.page===e?[{...n,target:s.target}]:[]}),hv=t=>typeof t=="object"&&t!==null&&Object.values(t).every(e=>typeof e=="string"),uv=(t,e)=>{const n=Object.keys(t);return n.length===Object.keys(e).length&&n.every(s=>t[s]===e[s])},gv=t=>{try{return t.matches(":popover-open")}catch{return!1}},fv=w(xc),mv={width:240,height:420},kv=220,bv=P`
4264
4299
  .dpk-main-body {
4265
4300
  animation: none;
4266
4301
  }
@@ -4375,59 +4410,59 @@ ${s}`:`${t.slice(0,n)}${s}${t.slice(n)}`},jb=R({title:N(v())}),Bb={schema:jr(),m
4375
4410
  ::slotted([hidden]) {
4376
4411
  display: none !important;
4377
4412
  }
4378
- `;class cv extends us{static{this.styles=[Yl,Mr,Or,Vl,jl,dv]}static{this.properties={pageNav:{type:String,attribute:"page-nav"},hash:{type:String}}}get hashMode(){return this.hash==="off"?"off":"auto"}#e=!1;#s=!1;#t="";#n="";#i=new WeakMap;#r=new WeakMap;#o=new Map;#a=new Map;#l;#d=null;#c=!1;#p=!1;#h;#f=new Qn(this);constructor(){super(),new pn(this,{open:()=>this.#c,closesOn:e=>!e.some(n=>n instanceof Element&&(n.id===Qt||n.matches(".dpk-page-switcher-trigger"))),ownsEscape:()=>!0,dismiss:()=>this.#O()})}pageContents(){return[]}definitionFor(e){return Wb({pages:()=>this.#H(),base:()=>this.#$(),catalog:()=>this.#Y(),messages:rs(e)})}connectedCallback(){super.connectedCallback(),this.addEventListener("dpk-comment-targets-change",this.#x),this.addEventListener("dpk-navigate",this.#y),this.addEventListener(Ni,this.#k),this.#d=this.navigation,this.api.ready.then(()=>{this.#s=!0,this.#t=this.#L(this.#g()),this.requestUpdate()})}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("dpk-comment-targets-change",this.#x),this.removeEventListener("dpk-navigate",this.#y),this.removeEventListener(Ni,this.#k),this.#M()}#k=e=>{if(!(e instanceof CustomEvent)||!Rb(e.detail))return;const n=e.target;!(n instanceof HTMLElement)||!dd(n)||n.parentElement!==this||(this.#r.set(n,e.detail.status==="ready"),!(!this.#s||!this.#e)&&(n.hasAttribute(vt)?this.requestUpdate():this.#T()))};#y=e=>{if(e.target!==this||!(e instanceof CustomEvent))return;const n=e.detail;if(typeof n!="object"||n===null||!("navigation"in n))return;const s=n.navigation;if(!sv(s))return;const i=this.#d;if(this.#d=s,i!==null)for(const r of this.#v()){const o=this.#m(r),a=Ge(i,o),l=Ge(s,o);iv(a,l)||(r.content??r).dispatchEvent(new CustomEvent("dpk-navigate",{detail:{navigation:l},bubbles:!0,composed:!0}))}};#x=()=>{this.#s&&this.controller.setTemplate(this.definition)};get[Yn](){if(this.#s)return this.#l??={locale:()=>this.locale,theme:()=>this.dataset.theme,navigation:()=>this.navigation,pageNames:()=>new Set(this.#v().map(e=>this.#m(e))),dispatch:e=>this.dispatch(e),dispatchBatch:e=>this.dispatchBatch(e),editComment:(e,n)=>this.editComment(e,n),removeAction:e=>this.removeAction(e),clearActions:()=>this.clearActions(),navigate:(e,n)=>this.navigate(e,n),hashFor:e=>this.hashFor(e),requestComment:e=>this.requestComment(e)},this.#l}adoptedComponentProviders(){return this.#v().flatMap(e=>e.componentSnapshot?.providers??[])}#v(){return Array.from(this.children).filter(dd)}#g(){return this.#v().filter(e=>!e.hasAttribute(vt))}#m(e){return e.getAttribute(bt)??""}#w(e){return e.getAttribute("label")??e.definition.label}#$(){const e=this.#g();return{layout:e.map(n=>({id:this.#m(n),kind:n.definition.kind,content:n.definition.name,label:this.#w(n)})),pages:Object.fromEntries(e.map(n=>[this.#m(n),n.contentState?.status==="ready"?n.api.base:{}]))}}#T(){this.#i=new WeakMap,this.controller.setBase({...this.controller.base,...this.#$()}),this.refreshGrill()}#L(e){return e.map(n=>this.#m(n)).join(" ")}#H(){return this.#v().map(e=>({id:this.#m(e),label:this.#w(e),definition:e.liveDefinition??e.definition}))}#Y(){const e=this.locale,n=this.#o.get(e);if(n!==void 0)return n;const s=this.pageContents(),i=s.flatMap(({kind:r,name:o})=>{const a=this.#z(r,o,e);return a===void 0?[]:[a]});return i.length===s.length&&this.#o.set(e,i),i}#z(e,n,s){const i=`${e==="view"?"dpk-view":"dpk-board"}-${n}`;if(customElements.get(i)===void 0)return;const r=document.createElement(i);r.setAttribute("lang",s);const o="definition"in r?r.definition:void 0;return ev(o)?o:void 0}#C(){return this.pageContents().filter(e=>e.addable!==!1&&this.#ne(e))}#ne(e){const n=`${e.kind==="view"?"dpk-view":"dpk-board"}-${e.name}`;if(customElements.get(n)!==void 0)return!0;const s=_r();return e.kind==="view"?ad(e.name,s)!==null:ld(s)!==null}async#se(e){const n=this.locale,s=this.#z(e.kind,e.name,n);if(s!==void 0)return s;const i=_r(),r=e.kind==="view"?ad(e.name,i):ld(i);if(r===null)return;const o=e.kind==="view"?`view:${e.name}`:"boards";let a=this.#a.get(o);a??=import(r),this.#a.set(o,a);try{await a}catch(l){this.#a.delete(o),console.error(`dev-process-kit: could not load ${e.kind} "${e.name}" from ${r}`,l);return}return await customElements.whenDefined(`${e.kind==="view"?"dpk-view":"dpk-board"}-${e.name}`),this.#z(e.kind,e.name,n)}async#ie(e){await this.#se(e)!==void 0&&this.#q(e)}#j(e){return this.#v().find(n=>this.#m(n)===e.id)?.definition??this.#Y().find(n=>n.kind===e.kind&&n.name===e.content)}#B(e){return this.pageContents().find(n=>n.kind===e.kind&&n.name===e.content)?.icon??ov}pendingStart(){return this.#e?null:this.#b().then(()=>{this.#e=!0;for(const e of this.#v())this.#r.set(e,e.contentState?.status==="ready")})}#b(){return customElements.whenDefined("dpk-page").then(()=>Promise.all(this.#v().map(e=>e.ready))).then(()=>{})}#S(){this.#s&&this.#b().then(()=>{const e=this.#L(this.#g());e!==this.#t&&(this.#t=e,this.#T())})}scriptOf(e){return this.querySelector(`:scope > ${e}`)}readGrill(){const e=super.readGrill(),n=this.#D();return this.#n=this.#L(n),Lb(e,n.map(s=>{const i=this.#m(s);return{page:i,grill:this.parseGrillScript(s.content?.querySelector(tv)??null,`@${i}`)}}))}#D(){const e=this.#g();if(!this.#s)return e;const n=new Set(this.api.state.layout.map(s=>s.id));return e.filter(s=>n.has(this.#m(s)))}grillRefsOf(e,n){return zb(n,Db(e))}get mainLayout(){return"fill"}buildBrief(e){const n=e.state.layout.flatMap(s=>{const i=this.#j(s);return i===void 0?[]:[{id:s.id,label:s.label,definition:i}]});return Hb(super.buildBrief(e),Ub(n,e.actions))}#R(e,n){return e.layout.find(s=>s.id===n[Ae])}#_(){return this.pageNav==="none"}renderRegions(e){return{main:k`<div class="dpk-app-pages"><slot @slotchange=${()=>this.#S()}></slot></div>`}}renderHeaderLead(e){if(this.#_())return b;const n=e.state.layout,s=this.#R(e.state,e.navigation);return this.#Z(n,s,this.definition.title(e.state),this.#C())}#Z(e,n,s,i){if(e.length===0&&i.length===0)return b;const r=rs(this.locale),o={open:()=>this.#re(),scheduleClose:()=>this.#G()};return k`
4379
- ${Zb(gf,this.#c,e.length,r,o,{active:n===void 0?null:this.#K(n,this.#I(e,n),s)})}
4380
- ${this.#c?Qb(this.#N(e,n,s,i),r,{cancelClose:()=>this.#M(),scheduleClose:()=>this.#G()}):b}
4381
- `}#I(e,n){return e.findIndex(s=>s.id===n.id)}#N(e,n,s,i){const r=rs(this.locale);if(this.#p)return i.map(a=>({key:`content:${a.kind}:${a.name}`,label:a.label,icon:a.icon,current:!1,kind:"action",activate:()=>{this.#O(),this.#ie(a)}}));const o=e.map((a,l)=>{const c=this.#K(a,l,s),d=a.id===n?.id;return{key:`page:${a.id}`,label:c,icon:this.#B(a),current:d,activate:()=>{this.#O(),this.navigate({[Ae]:a.id})},...d?{rename:{label:r.renamePage,commit:h=>this.#F(a.id,h)}}:{},...e.length>1?{remove:{label:r.removePage(c),activate:()=>this.#X(a.id)}}:{}}});return i.length===0?o:[...o,{key:"add",label:r.addPage,icon:ci,current:!1,kind:"action",activate:()=>{this.#p=!0,this.requestUpdate(),this.#Q()}}]}#Q(){this.updateComplete.then(()=>{this.renderRoot.querySelector(`#${Qt} .dpk-page-switcher-option`)?.focus()})}#F(e,n){this.dispatch({type:"RENAME_PAGE",target:mt,payload:{page:e,label:n}})}#re(){this.#M(),!this.#c&&(this.#c=!0,this.requestUpdate())}#G(){this.#M(),this.#h=setTimeout(()=>this.#O(),lv)}#M(){this.#h!==void 0&&(clearTimeout(this.#h),this.#h=void 0)}#O(){this.#M(),!(!this.#c&&!this.#p)&&(this.#c=!1,this.#p=!1,this.requestUpdate())}renderSettingsSections(e){const n=this.#W(e);return n===null?[]:n.settingsSections.map(s=>({id:s.id,label:s.label,render:()=>s.render()}))}settingsSwitches(e){const n=this.#R(e.state,e.navigation),s=n===void 0?void 0:this.#u(n.id);if(n===void 0||s===void 0)return null;const i=s.definition.settings?.(e.state.pages[n.id]);return i===void 0||i.items.length===0?null:{settings:i,flip:r=>{s.api.dispatch(r)}}}#u(e){return this.#v().find(n=>this.#m(n)===e)}#W(e){const n=this.#R(e.state,e.navigation),s=(n===void 0?void 0:this.#u(n.id))?.content??null;return Jb(s)?s:null}#K(e,n,s){const i=this.#j(e);return i!==void 0&&e.label===i.label?n===0?s:rs(this.locale).pageFallback(n+1):e.label}#q(e){const n=new Set([...this.api.state.layout.map(r=>r.id),...Array.from(this.children,r=>r.getAttribute(bt)??"")]),s=Gb(e.name,n);this.dispatch({type:"ADD_PAGE",target:mt,payload:{page:s,kind:e.kind,content:e.name,label:e.label}}).ok&&this.navigate({[Ae]:s})}#X(e){const n=this.controller.actions,s=n.find(r=>{if(!Se(r.target))return!1;const o=Ot(wt,r);return o?.type==="ADD_PAGE"&&o.payload.page===e}),i=this.#$().layout.some(r=>r.id===e);if(s===void 0||i){this.dispatch({type:"REMOVE_PAGE",target:mt,payload:{page:e}});return}for(const r of n)Nb(r,e)&&this.removeAction(r.id)}updated(){super.updated(),this.#oe(),this.#ae()}#oe(){const e=this.renderRoot.querySelector(`#${Qt}`),n=this.renderRoot.querySelector(".dpk-page-switcher-trigger");!e||!n||rv(e)||this.#f.open(e,n,av,{placement:"bottom-end"})}#ae(){if(!this.#e)return;const e=this.api.state.layout,n=new Set(e.map(a=>a.id));this.#L(this.#D())!==this.#n&&this.refreshGrill();for(const a of this.#v())a.hasAttribute(vt)&&!n.has(this.#m(a))&&a.remove();const s=new Set(Array.from(this.children,a=>a.getAttribute(bt)));for(const a of e)s.has(a.id)||this.#le(a);const i=this.controller.actions,r=this.navigation[Ae];let o=!1;for(const a of this.#v()){const l=this.#m(a);a.hidden=l!==r||!n.has(l),this.#de(a)&&(this.#i.get(a)!==i&&(this.#i.set(a,i),a.controller.replaceActions(nv(i,l)),o=!0),a.refreshContent(),a.deliver())}o&&this.settingsOpen&&this.requestUpdate()}#le(e){const n="dpk-page",s=`${e.kind==="view"?"dpk-view":"dpk-board"}-${e.content}`;if(customElements.get(n)===void 0||customElements.get(s)===void 0)return;const i=document.createElement(n);i.setAttribute(bt,e.id),i.setAttribute("label",e.label),i.setAttribute(vt,"");const r=document.createElement(s);i.append(r),i.hidden=!0,this.append(i)}#de(e){const n=this.#r.get(e);return n!==void 0?n:(this.#r.set(e,!1),e.ready.then(()=>{const s=e.contentState?.status==="ready";this.#r.set(e,s),s&&this.requestUpdate()}),!1)}}const pv=[{kind:"view",name:"usm",label:"User Story Mapping",icon:y(fc)},{kind:"view",name:"prototype",label:"UX Prototype",icon:y(yc),addable:!1},{kind:"view",name:"task-board",label:"Task Context Board",icon:y(lr),addable:!1},{kind:"view",name:"delegation-poker",label:"Delegation Poker",icon:y(Mc),addable:!1},{kind:"view",name:"slides",label:"Slides",icon:y(Cc),addable:!1},{kind:"view",name:"plain",label:"Plain",icon:y(ar),addable:!1},{kind:"board",name:"er-diagram",label:"ER diagram",icon:y(oc),addable:!1},{kind:"board",name:"state-diagram",label:"State diagram",icon:y(ic),addable:!1},{kind:"board",name:"sequence-diagram",label:"Sequence diagram",icon:y(Qd),addable:!1},{kind:"board",name:"dependency-graph",label:"Dependency graph",icon:y(lc),addable:!1},{kind:"board",name:"architecture-map",label:"Architecture map",icon:y(ec),addable:!1},{kind:"board",name:"mind-map",label:"Mind map",icon:y(dc),addable:!1},{kind:"board",name:"event-storming",label:"Event Storming",icon:y(Ic)},{kind:"board",name:"example-mapping",label:"Example Mapping",icon:y(dr)},{kind:"board",name:"whiteboard",label:"Whiteboard",icon:y(Sc)},{kind:"board",name:"kanban",label:"Kanban",icon:y(lr)}];class cd extends cv{pageContents(){return pv}}const hv=()=>{customElements.get("dpk-app")||customElements.define("dpk-app",cd)},pd=Ft(class extends jn{constructor(t){if(super(t),t.type!==we.PROPERTY&&t.type!==we.ATTRIBUTE&&t.type!==we.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!lm(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,[e]){if(e===Z||e===b)return e;const n=t.element,s=t.name;if(t.type===we.PROPERTY){if(e===n[s])return Z}else if(t.type===we.BOOLEAN_ATTRIBUTE){if(!!e===n.hasAttribute(s))return Z}else if(t.type===we.ATTRIBUTE&&n.getAttribute(s)===e+"")return Z;return xi(t),e}});function qi(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ve=qi();function hd(t){Ve=t}var Ye={exec:()=>null};function $t(t){let e=[];return n=>{let s=Math.max(0,Math.min(3,n-1)),i=e[s];return i||(i=t(s),e[s]=i),i}}function A(t,e=""){let n=typeof t=="string"?t:t.source,s={replace:(i,r)=>{let o=typeof r=="string"?r:r.source;return o=o.replace(q.caret,"$1"),n=n.replace(i,o),s},getRegex:()=>new RegExp(n,e)};return s}var uv=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),q={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:$t(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:$t(t=>new RegExp(`^ {0,${t}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:$t(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:$t(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:$t(t=>new RegExp(`^ {0,${t}}(?:</?(?:${Jt})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,"i")),blockquoteBeginRegex:$t(t=>new RegExp(`^ {0,${t}}>`))},gv=/^(?:[ \t]*(?:\n|$))+/,fv=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,mv=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Xt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,kv=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ui=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ud=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,gd=A(ud).replace(/bull/g,Ui).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),bv=A(ud).replace(/bull/g,Ui).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Hi=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,vv=/^[^\n]+/,ji=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,xv=A(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ji).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),yv=A(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Ui).getRegex(),Jt="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Bi=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,wv=A("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Bi).replace("tag",Jt).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),fd=t=>A(Hi).replace("hr",Xt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",t).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Jt).getRegex(),$v=fd(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),Sv=fd(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Av=A(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Sv).getRegex(),Fi={blockquote:Av,code:fv,def:xv,fences:mv,heading:kv,hr:Xt,html:wv,lheading:gd,list:yv,newline:gv,paragraph:$v,table:Ye,text:vv},md=A("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Xt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Jt).getRegex(),Ev={...Fi,lheading:bv,table:md,paragraph:A(Hi).replace("hr",Xt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",md).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Jt).getRegex()},Cv={...Fi,html:A(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Bi).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ye,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:A(Hi).replace("hr",Xt).replace("heading",` *#{1,6} *[^
4382
- ]`).replace("lheading",gd).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Tv=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Rv=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,kd=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,_v=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ke=/[\p{P}\p{S}]/u,St=/[\s\p{P}\p{S}]/u,en=/[^\s\p{P}\p{S}]/u,Mv=A(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,St).getRegex(),Ov=/[\p{Pi}\p{Ps}"']/u,bd=/(?!~)[\p{P}\p{S}]/u,Pv=/(?!~)[\s\p{P}\p{S}]/u,Lv=/(?:[^\s\p{P}\p{S}]|~)/u,zv=A(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",uv?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),vd=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Dv=A(vd,"u").replace(/punct/g,ke).getRegex(),Iv=A(vd,"u").replace(/punct/g,bd).getRegex(),Nv=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,qv=A(Nv,"u").replace(/openQuote/g,Ov).replace(/punct/g,ke).getRegex(),xd="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Uv=A(xd,"gu").replace(/notPunctSpace/g,en).replace(/punctSpace/g,St).replace(/punct/g,ke).getRegex(),Hv=A(xd,"gu").replace(/notPunctSpace/g,Lv).replace(/punctSpace/g,Pv).replace(/punct/g,bd).getRegex(),jv="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",Bv=A(jv,"gu").replace(/notPunctSpace/g,en).replace(/punctSpace/g,St).replace(/punct/g,ke).getRegex(),Fv=A("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,en).replace(/punctSpace/g,St).replace(/punct/g,ke).getRegex(),Gv="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",Wv=A(Gv,"gu").replace(/notPunctSpace/g,en).replace(/punctSpace/g,St).replace(/punct/g,ke).getRegex(),Kv=A(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,ke).getRegex(),Vv="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Yv=A(Vv,"gu").replace(/notPunctSpace/g,en).replace(/punctSpace/g,St).replace(/punct/g,ke).getRegex(),Zv=A(/\\(punct)/,"gu").replace(/punct/g,ke).getRegex(),Qv=A(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Xv=A(Bi).replace("(?:-->|$)","-->").getRegex(),Jv=A("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Xv).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),yd=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,os=A(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",yd).getRegex(),ex=A(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label",os).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),tx=A(/^!?\[(label)\]\[(ref)\]/).replace("label",os).replace("ref",ji).getRegex(),nx=A(/^!?\[(ref)\](?:\[\])?/).replace("ref",ji).getRegex(),wd=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,sx=A(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",yd).getRegex(),ix=A("reflink|nolink(?!\\()","g").replace("reflink",A(/^!?\[(label)\]\[(ref)\]/).replace("label",sx).replace("ref",wd).getRegex()).replace("nolink",A(/^!?\[(ref)\](?:\[\])?/).replace("ref",wd).getRegex()).getRegex(),$d=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,rx=/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/,ox=A(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,rx).getRegex(),Gi={_backpedal:Ye,anyPunctuation:Zv,autolink:Qv,blockSkip:zv,br:kd,code:Rv,del:Ye,delLDelim:Ye,delRDelim:Ye,emStrongLDelim:Dv,emStrongRDelimAst:Uv,emStrongRDelimUnd:Fv,escape:Tv,link:ex,nolink:nx,punctuation:Mv,reflink:tx,reflinkSearch:ix,tag:Jv,text:_v,url:Ye},ax={...Gi,emStrongLDelim:qv,emStrongRDelimAst:Bv,emStrongRDelimUnd:Wv,link:A(/^!?\[(label)\]\((.*?)\)/).replace("label",os).getRegex(),reflink:A(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",os).getRegex()},Wi={...Gi,emStrongRDelimAst:Hv,emStrongLDelim:Iv,delLDelim:Kv,delRDelim:Yv,url:A(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",ox).replace("protocol",$d).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:A(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol",$d).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},lx={...Wi,br:A(kd).replace("{2,}","*").getRegex(),text:A(Wi.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},as={normal:Fi,gfm:Ev,pedantic:Cv},tn={normal:Gi,gfm:Wi,breaks:lx,pedantic:ax},dx={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Sd=t=>dx[t];function V(t,e){if(e){if(q.escapeTest.test(t))return t.replace(q.escapeReplace,Sd)}else if(q.escapeTestNoEncode.test(t))return t.replace(q.escapeReplaceNoEncode,Sd);return t}function cx(t){return t.replace(q.numericCharacterReference,(e,n,s)=>{let i=n===void 0?Number.parseInt(s,16):Number.parseInt(n,10);return i===0||i>1114111||i>=55296&&i<=57343?"\uFFFD":String.fromCodePoint(i)})}function Ad(t){try{t=encodeURI(t).replace(q.percentDecode,"%")}catch{return null}return t}function Ed(t,e){let n=t.replace(q.findPipe,(r,o,a)=>{let l=!1,c=o;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),s=n.split(q.splitPipe),i=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;i<s.length;i++)s[i]=s[i].trim().replace(q.slashPipe,"|");return s}function Ee(t,e,n){let s=t.length;if(s===0)return"";let i=0;for(;i<s&&t.charAt(s-i-1)===e;)i++;return t.slice(0,s-i)}function Cd(t){let e=t.split(`
4383
- `),n=e.length-1;for(;n>=0&&q.blankLine.test(e[n]);)n--;return e.length-n<=2?t:e.slice(0,n+1).join(`
4384
- `)}function ls(t){return t.trim().toLowerCase().toUpperCase().toLowerCase()}function Td(t,e){if(t.indexOf(e[0])===-1&&t.indexOf(e[1])===-1)return-1;let n=0;for(let s=0;s<t.length;s++)if(t[s]==="\\")s++;else if(t[s]===e[0])n++;else if(t[s]===e[1]&&(n--,n<0))return s;return n>0?-2:-1}function Rd(t,e=0){let n=e,s="";for(let i of t)if(i===" "){let r=4-n%4;s+=" ".repeat(r),n+=r}else s+=i,n++;return s}function _d(t,e,n,s,i){let r=e.href,o=e.title||null,a=t[1].replace(i.other.outputLinkReplace,"$1"),l=t[0].charAt(0)==="!";s.state.inLink=!0;let c=s.state.linkEmitted,d=s.state.inRawBlock;s.state.linkEmitted=!1;let h=s.inlineTokens(a),f=s.state.linkEmitted;if(s.state.linkEmitted=c,s.state.inLink=!1,!l){if(f){s.state.inRawBlock=d;return}s.state.linkEmitted=!0}return{type:l?"image":"link",raw:n,href:r,title:o,text:a,tokens:h}}function px(t,e,n){let s=t.match(n.other.indentCodeCompensation);if(s===null)return e;let i=s[1];return e.split(`
4413
+ `;class vv extends as{static{this.styles=[Fl,Pr,Lr,jl,Dl,bv]}static{this.properties={pageNav:{type:String,attribute:"page-nav"},hash:{type:String}}}get hashMode(){return this.hash==="off"?"off":"auto"}#e=!1;#n=!1;#s="";#t="";#i=new WeakMap;#r=new WeakMap;#o=new Map;#a=new Map;#l;#d=null;#c=!1;#u=!1;#h;#k=new Gn(this);constructor(){super(),new cn(this,{open:()=>this.#c,closesOn:e=>!e.some(n=>n instanceof Element&&(n.id===Vt||n.matches(".dpk-page-switcher-trigger"))),ownsEscape:()=>!0,dismiss:()=>this.#D()})}pageContents(){return[]}definitionFor(e){return tv({pages:()=>this.#C(),base:()=>this.#S(),catalog:()=>this.#q(),messages:Jn(e)})}connectedCallback(){super.connectedCallback(),this.addEventListener("dpk-comment-targets-change",this.#A),this.addEventListener("dpk-navigate",this.#x),this.addEventListener(Li,this.#p),this.#d=this.navigation,this.api.ready.then(()=>{this.#n=!0,this.#s=this.#y(this.#f()),this.requestUpdate()})}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("dpk-comment-targets-change",this.#A),this.removeEventListener("dpk-navigate",this.#x),this.removeEventListener(Li,this.#p),this.#I()}#p=e=>{if(!(e instanceof CustomEvent)||!Nb(e.detail))return;const n=e.target;!(n instanceof HTMLElement)||!rd(n)||n.parentElement!==this||(this.#r.set(n,e.detail.status==="ready"),!(!this.#n||!this.#e)&&(n.hasAttribute(gt)?this.requestUpdate():this.#$()))};#x=e=>{if(e.target!==this||!(e instanceof CustomEvent))return;const n=e.detail;if(typeof n!="object"||n===null||!("navigation"in n))return;const s=n.navigation;if(!hv(s))return;const i=this.#d;if(this.#d=s,i!==null)for(const r of this.#v()){const o=this.#w(r),a=Be(i,o),l=Be(s,o);uv(a,l)||(r.content??r).dispatchEvent(new CustomEvent("dpk-navigate",{detail:{navigation:l},bubbles:!0,composed:!0}))}};#A=()=>{this.#n&&this.controller.setTemplate(this.definition)};get[jn](){if(this.#n)return this.#l??={locale:()=>this.locale,theme:()=>this.dataset.theme,navigation:()=>this.navigation,pageNames:()=>new Set(this.#v().map(e=>this.#w(e))),dispatch:e=>this.dispatch(e),dispatchBatch:e=>this.dispatchBatch(e),editComment:(e,n)=>this.editComment(e,n),removeAction:e=>this.removeAction(e),clearActions:()=>this.clearActions(),navigate:(e,n)=>this.navigate(e,n),hashFor:e=>this.hashFor(e),requestComment:e=>this.requestComment(e)},this.#l}adoptedComponentProviders(){return this.#v().flatMap(e=>e.componentSnapshot?.providers??[])}#v(){return Array.from(this.children).filter(rd)}#f(){return this.#v().filter(e=>!e.hasAttribute(gt))}#w(e){return e.getAttribute(ut)??""}#m(e){return e.getAttribute("label")??e.definition.label}#S(){const e=this.#f();return{layout:e.map(n=>({id:this.#w(n),kind:n.definition.kind,content:n.definition.name,label:this.#m(n)})),pages:Object.fromEntries(e.map(n=>[this.#w(n),n.contentState?.status==="ready"?n.api.base:{}]))}}#$(){this.#i=new WeakMap,this.controller.setBase({...this.controller.base,...this.#S()}),this.refreshGrill()}#y(e){return e.map(n=>this.#w(n)).join(" ")}#C(){return this.#v().map(e=>({id:this.#w(e),label:this.#m(e),definition:e.liveDefinition??e.definition}))}#q(){const e=this.locale,n=this.#o.get(e);if(n!==void 0)return n;const s=this.pageContents(),i=s.flatMap(({kind:r,name:o})=>{const a=this.#M(r,o,e);return a===void 0?[]:[a]});return i.length===s.length&&this.#o.set(e,i),i}#M(e,n,s){const i=`${e==="view"?"dpk-view":"dpk-board"}-${n}`;if(customElements.get(i)===void 0)return;const r=document.createElement(i);r.setAttribute("lang",s);const o="definition"in r?r.definition:void 0;return dv(o)?o:void 0}#E(){return this.pageContents().filter(e=>e.addable!==!1&&this.#U(e))}#U(e){const n=`${e.kind==="view"?"dpk-view":"dpk-board"}-${e.name}`;if(customElements.get(n)!==void 0)return!0;const s=_r();return e.kind==="view"?sd(e.name,s)!==null:id(s)!==null}async#H(e){const n=this.locale,s=this.#M(e.kind,e.name,n);if(s!==void 0)return s;const i=_r(),r=e.kind==="view"?sd(e.name,i):id(i);if(r===null)return;const o=e.kind==="view"?`view:${e.name}`:"boards";let a=this.#a.get(o);a??=import(r),this.#a.set(o,a);try{await a}catch(l){this.#a.delete(o),console.error(`dev-process-kit: could not load ${e.kind} "${e.name}" from ${r}`,l);return}return await customElements.whenDefined(`${e.kind==="view"?"dpk-view":"dpk-board"}-${e.name}`),this.#M(e.kind,e.name,n)}async#K(e){await this.#H(e)!==void 0&&this.#G(e)}#L(e){return this.#v().find(n=>this.#w(n)===e.id)?.definition??this.#q().find(n=>n.kind===e.kind&&n.name===e.content)}#_(e){return this.pageContents().find(n=>n.kind===e.kind&&n.name===e.content)?.icon??fv}pendingStart(){return this.#e?null:this.#b().then(()=>{this.#e=!0;for(const e of this.#v())this.#r.set(e,e.contentState?.status==="ready")})}draftSettled(){return this.#e&&this.#f().every(e=>this.#r.get(e)===!0)}#b(){return customElements.whenDefined("dpk-page").then(()=>Promise.all(this.#v().map(e=>e.ready))).then(()=>{})}#T(){this.#n&&this.#b().then(()=>{const e=this.#y(this.#f());e!==this.#s&&(this.#s=e,this.#$())})}scriptOf(e){return this.querySelector(`:scope > ${e}`)}readGrill(){const e=super.readGrill(),n=this.#B();return this.#t=this.#y(n),jb(e,n.map(s=>{const i=this.#w(s);return{page:i,grill:this.parseGrillScript(s.content?.querySelector(cv)??null,`@${i}`)}}))}#B(){const e=this.#f();if(!this.#n)return e;const n=new Set(this.api.state.layout.map(s=>s.id));return e.filter(s=>n.has(this.#w(s)))}grillRefsOf(e,n){return Fb(n,Gb(e))}get mainLayout(){return"fill"}buildBrief(e){const n=e.state.layout.flatMap(s=>{const i=this.#L(s);return i===void 0?[]:[{id:s.id,label:s.label,definition:i}]});return Zb(super.buildBrief(e),Yb(n,e.actions))}#z(e,n){return e.layout.find(s=>s.id===n[ye])}#P(){return this.pageNav==="none"}renderRegions(e){return{main:m`<div class="dpk-app-pages"><slot @slotchange=${()=>this.#T()}></slot></div>`}}renderHeaderLead(e){if(this.#P())return b;const n=e.state.layout,s=this.#z(e.state,e.navigation);return this.#J(n,s,this.definition.title(e.state),this.#E())}#J(e,n,s,i){if(e.length===0&&i.length===0)return b;const r=Jn(this.locale),o={open:()=>this.#oe(),scheduleClose:()=>this.#Y()};return m`
4414
+ ${rv(wf,this.#c,e.length,r,o,{active:n===void 0?null:this.#Q(n,this.#j(e,n),s)})}
4415
+ ${this.#c?ov(this.#F(e,n,s,i),r,{cancelClose:()=>this.#I(),scheduleClose:()=>this.#Y()}):b}
4416
+ `}#j(e,n){return e.findIndex(s=>s.id===n.id)}#F(e,n,s,i){const r=Jn(this.locale);if(this.#u)return i.map(a=>({key:`content:${a.kind}:${a.name}`,label:a.label,icon:a.icon,current:!1,kind:"action",activate:()=>{this.#D(),this.#K(a)}}));const o=e.map((a,l)=>{const p=this.#Q(a,l,s),h=a.id===n?.id;return{key:`page:${a.id}`,label:p,icon:this.#_(a),current:h,activate:()=>{this.#D(),this.navigate({[ye]:a.id})},...h?{rename:{label:r.renamePage,commit:d=>this.#V(a.id,d)}}:{},...e.length>1?{remove:{label:r.removePage(p),activate:()=>this.#te(a.id)}}:{}}});return i.length===0?o:[...o,{key:"add",label:r.addPage,icon:oi,current:!1,kind:"action",activate:()=>{this.#u=!0,this.requestUpdate(),this.#ee()}}]}#ee(){this.updateComplete.then(()=>{this.renderRoot.querySelector(`#${Vt} .dpk-page-switcher-option`)?.focus()})}#V(e,n){this.dispatch({type:"RENAME_PAGE",target:Ue,payload:{page:e,label:n}})}#oe(){this.#I(),!this.#c&&(this.#c=!0,this.requestUpdate())}#Y(){this.#I(),this.#h=setTimeout(()=>this.#D(),kv)}#I(){this.#h!==void 0&&(clearTimeout(this.#h),this.#h=void 0)}#D(){this.#I(),!(!this.#c&&!this.#u)&&(this.#c=!1,this.#u=!1,this.requestUpdate())}renderSettingsSections(e){const n=this.#Z(e);return n===null?[]:n.settingsSections.map(s=>({id:s.id,label:s.label,render:()=>s.render()}))}settingsSwitches(e){const n=this.#z(e.state,e.navigation),s=n===void 0?void 0:this.#g(n.id);if(n===void 0||s===void 0)return null;const i=s.definition.settings?.(e.state.pages[n.id]);return i===void 0||i.items.length===0?null:{settings:i,flip:r=>{s.api.dispatch(r)}}}#g(e){return this.#v().find(n=>this.#w(n)===e)}#Z(e){const n=this.#z(e.state,e.navigation),s=(n===void 0?void 0:this.#g(n.id))?.content??null;return lv(s)?s:null}#Q(e,n,s){const i=this.#L(e);return i!==void 0&&e.label===i.label?n===0?s:Jn(this.locale).pageFallback(n+1):e.label}#G(e){const n=new Set([...this.api.state.layout.map(r=>r.id),...Array.from(this.children,r=>r.getAttribute(ut)??"")]),s=ev(e.name,n);this.dispatch({type:"ADD_PAGE",target:Ue,payload:{page:s,kind:e.kind,content:e.name,label:e.label}}).ok&&this.navigate({[ye]:s})}#te(e){const n=this.controller.actions,s=n.find(r=>{if(!we(r.target))return!1;const o=nn(kt,r);return o?.type==="ADD_PAGE"&&o.payload.page===e}),i=this.#S().layout.some(r=>r.id===e);if(s===void 0||i){this.dispatch({type:"REMOVE_PAGE",target:Ue,payload:{page:e}});return}for(const r of n)Kb(r,e)&&this.removeAction(r.id)}updated(){super.updated(),this.#ne(),this.#ae()}#ne(){const e=this.renderRoot.querySelector(`#${Vt}`),n=this.renderRoot.querySelector(".dpk-page-switcher-trigger");!e||!n||gv(e)||this.#k.open(e,n,mv,{placement:"bottom-end"})}#ae(){if(!this.#e)return;const e=this.api.state.layout,n=new Set(e.map(a=>a.id));this.#y(this.#B())!==this.#t&&this.refreshGrill();for(const a of this.#v())a.hasAttribute(gt)&&!n.has(this.#w(a))&&a.remove();const s=new Set(Array.from(this.children,a=>a.getAttribute(ut)));for(const a of e)s.has(a.id)||this.#le(a);const i=this.controller.actions,r=this.navigation[ye];let o=!1;for(const a of this.#v()){const l=this.#w(a);a.hidden=l!==r||!n.has(l),this.#de(a)&&(this.#i.get(a)!==i&&(this.#i.set(a,i),a.controller.replaceActions(pv(i,l)),o=!0),a.refreshContent(),a.deliver())}o&&this.settingsOpen&&this.requestUpdate()}#le(e){const n="dpk-page",s=`${e.kind==="view"?"dpk-view":"dpk-board"}-${e.content}`;if(customElements.get(n)===void 0||customElements.get(s)===void 0)return;const i=document.createElement(n);i.setAttribute(ut,e.id),i.setAttribute("label",e.label),i.setAttribute(gt,"");const r=document.createElement(s);i.append(r),i.hidden=!0,this.append(i)}#de(e){const n=this.#r.get(e);return n!==void 0?n:(this.#r.set(e,!1),e.ready.then(()=>{const s=e.contentState?.status==="ready";this.#r.set(e,s),s&&this.requestUpdate()}),!1)}}const xv=[{kind:"view",name:"usm",label:"User Story Mapping",icon:w(yc)},{kind:"view",name:"prototype",label:"UX Prototype",icon:w(Tc),addable:!1},{kind:"view",name:"task-board",label:"Task Context Board",icon:w(cr),addable:!1},{kind:"view",name:"delegation-poker",label:"Delegation Poker",icon:w(Nc),addable:!1},{kind:"view",name:"slides",label:"Slides",icon:w(Lc),addable:!1},{kind:"view",name:"plain",label:"Plain",icon:w(dr),addable:!1},{kind:"board",name:"er-diagram",label:"ER diagram",icon:w(uc),addable:!1},{kind:"board",name:"state-diagram",label:"State diagram",icon:w(pc),addable:!1},{kind:"board",name:"sequence-diagram",label:"Sequence diagram",icon:w(ic),addable:!1},{kind:"board",name:"dependency-graph",label:"Dependency graph",icon:w(fc),addable:!1},{kind:"board",name:"architecture-map",label:"Architecture map",icon:w(ac),addable:!1},{kind:"board",name:"mind-map",label:"Mind map",icon:w(mc),addable:!1},{kind:"board",name:"event-storming",label:"Event Storming",icon:w(Fc)},{kind:"board",name:"example-mapping",label:"Example Mapping",icon:w(pr)},{kind:"board",name:"whiteboard",label:"Whiteboard",icon:w(Oc)},{kind:"board",name:"kanban",label:"Kanban",icon:w(cr)}];class od extends vv{pageContents(){return xv}}const wv=()=>{customElements.get("dpk-app")||customElements.define("dpk-app",od)},ad=Ht(class extends In{constructor(t){if(super(t),t.type!==ve.PROPERTY&&t.type!==ve.ATTRIBUTE&&t.type!==ve.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!fm(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,[e]){if(e===V||e===b)return e;const n=t.element,s=t.name;if(t.type===ve.PROPERTY){if(e===n[s])return V}else if(t.type===ve.BOOLEAN_ATTRIBUTE){if(!!e===n.hasAttribute(s))return V}else if(t.type===ve.ATTRIBUTE&&n.getAttribute(s)===e+"")return V;return mi(t),e}});function zi(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ge=zi();function ld(t){Ge=t}var We={exec:()=>null};function bt(t){let e=[];return n=>{let s=Math.max(0,Math.min(3,n-1)),i=e[s];return i||(i=t(s),e[s]=i),i}}function S(t,e=""){let n=typeof t=="string"?t:t.source,s={replace:(i,r)=>{let o=typeof r=="string"?r:r.source;return o=o.replace(N.caret,"$1"),n=n.replace(i,o),s},getRegex:()=>new RegExp(n,e)};return s}var yv=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),N={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:bt(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:bt(t=>new RegExp(`^ {0,${t}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:bt(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:bt(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:bt(t=>new RegExp(`^ {0,${t}}(?:</?(?:${Zt})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,"i")),blockquoteBeginRegex:bt(t=>new RegExp(`^ {0,${t}}>`))},$v=/^(?:[ \t]*(?:\n|$))+/,Sv=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Av=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Yt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Ev=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ii=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,dd=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,cd=S(dd).replace(/bull/g,Ii).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Cv=S(dd).replace(/bull/g,Ii).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Di=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,Tv=/^[^\n]+/,Ni=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Rv=S(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ni).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Mv=S(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Ii).getRegex(),Zt="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",qi=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ov=S("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",qi).replace("tag",Zt).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),pd=t=>S(Di).replace("hr",Yt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",t).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Zt).getRegex(),_v=pd(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),Pv=pd(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Lv=S(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Pv).getRegex(),Ui={blockquote:Lv,code:Sv,def:Rv,fences:Av,heading:Ev,hr:Yt,html:Ov,lheading:cd,list:Mv,newline:$v,paragraph:_v,table:We,text:Tv},hd=S("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Yt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Zt).getRegex(),zv={...Ui,lheading:Cv,table:hd,paragraph:S(Di).replace("hr",Yt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",hd).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Zt).getRegex()},Iv={...Ui,html:S(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",qi).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:We,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:S(Di).replace("hr",Yt).replace("heading",` *#{1,6} *[^
4417
+ ]`).replace("lheading",cd).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Dv=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Nv=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ud=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,qv=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,fe=/[\p{P}\p{S}]/u,vt=/[\s\p{P}\p{S}]/u,Qt=/[^\s\p{P}\p{S}]/u,Uv=S(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,vt).getRegex(),Hv=/[\p{Pi}\p{Ps}"']/u,gd=/(?!~)[\p{P}\p{S}]/u,Bv=/(?!~)[\s\p{P}\p{S}]/u,jv=/(?:[^\s\p{P}\p{S}]|~)/u,Fv=S(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",yv?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),fd=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Gv=S(fd,"u").replace(/punct/g,fe).getRegex(),Wv=S(fd,"u").replace(/punct/g,gd).getRegex(),Kv=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,Vv=S(Kv,"u").replace(/openQuote/g,Hv).replace(/punct/g,fe).getRegex(),md="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Yv=S(md,"gu").replace(/notPunctSpace/g,Qt).replace(/punctSpace/g,vt).replace(/punct/g,fe).getRegex(),Zv=S(md,"gu").replace(/notPunctSpace/g,jv).replace(/punctSpace/g,Bv).replace(/punct/g,gd).getRegex(),Qv="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",Xv=S(Qv,"gu").replace(/notPunctSpace/g,Qt).replace(/punctSpace/g,vt).replace(/punct/g,fe).getRegex(),Jv=S("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Qt).replace(/punctSpace/g,vt).replace(/punct/g,fe).getRegex(),ex="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",tx=S(ex,"gu").replace(/notPunctSpace/g,Qt).replace(/punctSpace/g,vt).replace(/punct/g,fe).getRegex(),nx=S(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,fe).getRegex(),sx="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",ix=S(sx,"gu").replace(/notPunctSpace/g,Qt).replace(/punctSpace/g,vt).replace(/punct/g,fe).getRegex(),rx=S(/\\(punct)/,"gu").replace(/punct/g,fe).getRegex(),ox=S(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),ax=S(qi).replace("(?:-->|$)","-->").getRegex(),lx=S("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",ax).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),kd=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,es=S(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",kd).getRegex(),dx=S(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label",es).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),cx=S(/^!?\[(label)\]\[(ref)\]/).replace("label",es).replace("ref",Ni).getRegex(),px=S(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ni).getRegex(),bd=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,hx=S(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",kd).getRegex(),ux=S("reflink|nolink(?!\\()","g").replace("reflink",S(/^!?\[(label)\]\[(ref)\]/).replace("label",hx).replace("ref",bd).getRegex()).replace("nolink",S(/^!?\[(ref)\](?:\[\])?/).replace("ref",bd).getRegex()).getRegex(),vd=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,gx=/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/,fx=S(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,gx).getRegex(),Hi={_backpedal:We,anyPunctuation:rx,autolink:ox,blockSkip:Fv,br:ud,code:Nv,del:We,delLDelim:We,delRDelim:We,emStrongLDelim:Gv,emStrongRDelimAst:Yv,emStrongRDelimUnd:Jv,escape:Dv,link:dx,nolink:px,punctuation:Uv,reflink:cx,reflinkSearch:ux,tag:lx,text:qv,url:We},mx={...Hi,emStrongLDelim:Vv,emStrongRDelimAst:Xv,emStrongRDelimUnd:tx,link:S(/^!?\[(label)\]\((.*?)\)/).replace("label",es).getRegex(),reflink:S(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",es).getRegex()},Bi={...Hi,emStrongRDelimAst:Zv,emStrongLDelim:Wv,delLDelim:nx,delRDelim:ix,url:S(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",fx).replace("protocol",vd).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:S(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol",vd).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},kx={...Bi,br:S(ud).replace("{2,}","*").getRegex(),text:S(Bi.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ts={normal:Ui,gfm:zv,pedantic:Iv},Xt={normal:Hi,gfm:Bi,breaks:kx,pedantic:mx},bx={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},xd=t=>bx[t];function F(t,e){if(e){if(N.escapeTest.test(t))return t.replace(N.escapeReplace,xd)}else if(N.escapeTestNoEncode.test(t))return t.replace(N.escapeReplaceNoEncode,xd);return t}function vx(t){return t.replace(N.numericCharacterReference,(e,n,s)=>{let i=n===void 0?Number.parseInt(s,16):Number.parseInt(n,10);return i===0||i>1114111||i>=55296&&i<=57343?"\uFFFD":String.fromCodePoint(i)})}function wd(t){try{t=encodeURI(t).replace(N.percentDecode,"%")}catch{return null}return t}function yd(t,e){let n=t.replace(N.findPipe,(r,o,a)=>{let l=!1,p=o;for(;--p>=0&&a[p]==="\\";)l=!l;return l?"|":" |"}),s=n.split(N.splitPipe),i=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;i<s.length;i++)s[i]=s[i].trim().replace(N.slashPipe,"|");return s}function $e(t,e,n){let s=t.length;if(s===0)return"";let i=0;for(;i<s&&t.charAt(s-i-1)===e;)i++;return t.slice(0,s-i)}function $d(t){let e=t.split(`
4418
+ `),n=e.length-1;for(;n>=0&&N.blankLine.test(e[n]);)n--;return e.length-n<=2?t:e.slice(0,n+1).join(`
4419
+ `)}function ns(t){return t.trim().toLowerCase().toUpperCase().toLowerCase()}function Sd(t,e){if(t.indexOf(e[0])===-1&&t.indexOf(e[1])===-1)return-1;let n=0;for(let s=0;s<t.length;s++)if(t[s]==="\\")s++;else if(t[s]===e[0])n++;else if(t[s]===e[1]&&(n--,n<0))return s;return n>0?-2:-1}function Ad(t,e=0){let n=e,s="";for(let i of t)if(i===" "){let r=4-n%4;s+=" ".repeat(r),n+=r}else s+=i,n++;return s}function Ed(t,e,n,s,i){let r=e.href,o=e.title||null,a=t[1].replace(i.other.outputLinkReplace,"$1"),l=t[0].charAt(0)==="!";s.state.inLink=!0;let p=s.state.linkEmitted,h=s.state.inRawBlock;s.state.linkEmitted=!1;let d=s.inlineTokens(a),f=s.state.linkEmitted;if(s.state.linkEmitted=p,s.state.inLink=!1,!l){if(f){s.state.inRawBlock=h;return}s.state.linkEmitted=!0}return{type:l?"image":"link",raw:n,href:r,title:o,text:a,tokens:d}}function xx(t,e,n){let s=t.match(n.other.indentCodeCompensation);if(s===null)return e;let i=s[1];return e.split(`
4385
4420
  `).map(r=>{let o=r.match(n.other.beginningSpace);if(o===null)return r;let[a]=o;return r.slice(Math.min(a.length,i.length))}).join(`
4386
- `)}function Md(t,e,n,s){if(!e.includes("<"))return!1;for(let i=0;i<e.length;i++){if(e[i]==="\\"){i++;continue}if(e[i]==="`"){let a=s.inline.code.exec(e.slice(i));if(a){i+=a[0].length-1;continue}}if(e[i]!=="<")continue;let r=t.slice(n+i),o=s.inline.tag.exec(r)||s.inline.autolink.exec(r);if(o){if(o[0].length>e.length-i)return!0;i+=o[0].length-1}}return!1}var ds=class{options;rules;lexer;constructor(t){this.options=t||Ve}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=this.options.pedantic?e[0]:Cd(e[0]),s=n.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n,codeBlockStyle:"indented",text:s}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],s=px(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){let s=Ee(n,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceTabChar.test(s))&&(n=s.trim())}return{type:"heading",raw:Ee(e[0],`
4387
- `),depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:Ee(e[0],`
4388
- `)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=Ee(e[0],`
4421
+ `)}function Cd(t,e,n,s){if(!e.includes("<"))return!1;for(let i=0;i<e.length;i++){if(e[i]==="\\"){i++;continue}if(e[i]==="`"){let a=s.inline.code.exec(e.slice(i));if(a){i+=a[0].length-1;continue}}if(e[i]!=="<")continue;let r=t.slice(n+i),o=s.inline.tag.exec(r)||s.inline.autolink.exec(r);if(o){if(o[0].length>e.length-i)return!0;i+=o[0].length-1}}return!1}var ss=class{options;rules;lexer;constructor(t){this.options=t||Ge}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=this.options.pedantic?e[0]:$d(e[0]),s=n.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n,codeBlockStyle:"indented",text:s}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],s=xx(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){let s=$e(n,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceTabChar.test(s))&&(n=s.trim())}return{type:"heading",raw:$e(e[0],`
4422
+ `),depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:$e(e[0],`
4423
+ `)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=$e(e[0],`
4389
4424
  `).split(`
4390
- `),s="",i="",r=[];for(;n.length>0;){let o=!1,a=[],l;for(l=0;l<n.length;l++)if(this.rules.other.blockquoteStart.test(n[l]))a.push(n[l]),o=!0;else if(!o)a.push(n[l]);else break;n=n.slice(l);let c=a.join(`
4391
- `),d=c.replace(this.rules.other.blockquoteSetextReplace,`
4425
+ `),s="",i="",r=[];for(;n.length>0;){let o=!1,a=[],l;for(l=0;l<n.length;l++)if(this.rules.other.blockquoteStart.test(n[l]))a.push(n[l]),o=!0;else if(!o)a.push(n[l]);else break;n=n.slice(l);let p=a.join(`
4426
+ `),h=p.replace(this.rules.other.blockquoteSetextReplace,`
4392
4427
  $1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
4393
- ${c}`:c,i=i?`${i}
4394
- ${d}`:d;let h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(d,r,!0),this.lexer.state.top=h,n.length===0)break;let f=r.at(-1);if(f?.type==="code")break;if(f?.type==="blockquote"){let p=f,g=n.join(`
4395
- `),u=p.raw+`
4396
- `+g.replace(this.rules.other.blockquoteSetextReplace2,""),m=this.blockquote(u);r[r.length-1]=m;let x=u.substring(m.raw.length).replace(/^\n/,""),$=x?x.split(`
4397
- `).length:0,E=$?n.slice(0,-$):n;E.length>0&&(s=`${s}
4398
- ${E.join(`
4399
- `)}`),i=i.substring(0,i.length-p.text.length)+m.text;break}else if(f?.type==="list"){let p=f,g=p.raw+`
4428
+ ${p}`:p,i=i?`${i}
4429
+ ${h}`:h;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(h,r,!0),this.lexer.state.top=d,n.length===0)break;let f=r.at(-1);if(f?.type==="code")break;if(f?.type==="blockquote"){let c=f,g=n.join(`
4430
+ `),u=c.raw+`
4431
+ `+g.replace(this.rules.other.blockquoteSetextReplace2,""),k=this.blockquote(u);r[r.length-1]=k;let v=u.substring(k.raw.length).replace(/^\n/,""),y=v?v.split(`
4432
+ `).length:0,A=y?n.slice(0,-y):n;A.length>0&&(s=`${s}
4433
+ ${A.join(`
4434
+ `)}`),i=i.substring(0,i.length-c.text.length)+k.text;break}else if(f?.type==="list"){let c=f,g=c.raw+`
4400
4435
  `+n.join(`
4401
- `),u=this.list(g);r[r.length-1]=u,s=s.substring(0,s.length-f.raw.length)+u.raw,i=i.substring(0,i.length-p.raw.length)+u.raw,n=g.substring(r.at(-1).raw.length).split(`
4402
- `);continue}}return{type:"blockquote",raw:s,tokens:r,text:i}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim(),s=n.length>1,i={type:"list",raw:"",ordered:s,start:s?+n.slice(0,-1):"",loose:!1,items:[]};n=s?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=s?n:"[*+-]");let r=this.rules.other.listItemRegex(n),o=!1;for(;t;){let l=!1,c="",d="";if(!(e=r.exec(t))||this.rules.block.hr.test(t))break;c=e[0],t=t.substring(c.length);let h=e[2].split(`
4403
- `,1)[0],f=e[1].length,p=this.options.pedantic?Rd(h,f):h.replace(this.rules.other.leadingSpaceTab,x=>Rd(x,f)),g=t.split(`
4404
- `,1)[0],u=!p.trim(),m=0;if(this.options.pedantic?(m=2,d=p.trimStart()):u?m=f+1:(m=p.search(this.rules.other.nonSpaceChar),m=m>4?1:m,d=p.slice(m),m+=f),u&&this.rules.other.blankLine.test(g)&&(c+=g+`
4405
- `,t=t.substring(g.length+1),l=!0),!l){let x=this.rules.other.nextBulletRegex(m),$=this.rules.other.hrRegex(m),E=this.rules.other.fencesBeginRegex(m),M=this.rules.other.headingBeginRegex(m),F=this.rules.other.htmlBeginRegex(m),I=this.rules.other.blockquoteBeginRegex(m);for(;t;){let Y=t.split(`
4406
- `,1)[0],j;if(g=Y,this.options.pedantic?(g=g.replace(this.rules.other.listReplaceNesting," "),j=g):j=g.replace(this.rules.other.leadingSpaceTab,ce=>ce.replace(this.rules.other.tabCharGlobal," ")),E.test(g)||M.test(g)||F.test(g)||I.test(g)||x.test(g)||$.test(g))break;if(j.search(this.rules.other.nonSpaceChar)>=m||!g.trim())d+=`
4407
- `+j.slice(m);else{if(u||p.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||E.test(p)||M.test(p)||$.test(p))break;d+=`
4408
- `+g}u=!g.trim(),c+=Y+`
4409
- `,t=t.substring(Y.length+1),p=j.slice(m)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(o=!0)),i.items.push({type:"list_item",raw:c,task:!!this.options.gfm&&this.rules.other.listIsTask.test(d),loose:!1,text:d,tokens:[]}),i.raw+=c}let a=i.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let l of i.items)if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),!i.loose){let c=l.tokens.filter(h=>h.type==="space"),d=c.length>0&&c.some(h=>this.rules.other.anyLine.test(h.raw));i.loose=d}for(let l of i.items){let c=l.tokens[0];if(l.task&&(c?.type==="text"||c?.type==="paragraph")){l.text=l.text.replace(this.rules.other.listReplaceTask,""),c.raw=c.raw.replace(this.rules.other.listReplaceTask,""),c.text=c.text.replace(this.rules.other.listReplaceTask,"");for(let h=this.lexer.inlineQueue.length-1;h>=0;h--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[h].src)){this.lexer.inlineQueue[h].src=this.lexer.inlineQueue[h].src.replace(this.rules.other.listReplaceTask,"");break}let d=this.rules.other.listTaskCheckbox.exec(l.raw);if(d){let h={type:"checkbox",raw:d[0]+" ",checked:d[0]!=="[ ]"};l.checked=h.checked,i.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=h.raw+l.tokens[0].raw,l.tokens[0].text=h.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(h)):l.tokens.unshift({type:"paragraph",raw:h.raw,text:h.raw,tokens:[h]}):l.tokens.unshift(h)}}else l.task&&(l.task=!1)}if(i.loose)for(let l of i.items){l.loose=!0;for(let c of l.tokens)c.type==="text"&&(c.type="paragraph")}return i}}html(t){let e=this.rules.block.html.exec(t);if(e){let n=Cd(e[0]);return{type:"html",block:!0,raw:n,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:n}}}def(t){let e=this.rules.block.def.exec(t);if(e){if(!this.rules.other.startAngleBracket.test(e[2])&&Td(e[2],"()")!==-1)return;let n=ls(e[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:Ee(e[0],`
4410
- `),href:s,title:i}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=Ed(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
4411
- `):[],r={type:"table",raw:Ee(e[0],`
4412
- `),header:[],align:[],rows:[]};if(n.length===s.length){for(let o of s)this.rules.other.tableAlignRight.test(o)?r.align.push("right"):this.rules.other.tableAlignCenter.test(o)?r.align.push("center"):this.rules.other.tableAlignLeft.test(o)?r.align.push("left"):r.align.push(null);for(let o=0;o<n.length;o++)r.header.push({text:n[o],tokens:this.lexer.inline(n[o]),header:!0,align:r.align[o]});for(let o of i)r.rows.push(Ed(o,r.header.length).map((a,l)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:r.align[l]})));return r}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let n=e[1].trim();return{type:"heading",raw:Ee(e[0],`
4436
+ `),u=this.list(g);r[r.length-1]=u,s=s.substring(0,s.length-f.raw.length)+u.raw,i=i.substring(0,i.length-c.raw.length)+u.raw,n=g.substring(r.at(-1).raw.length).split(`
4437
+ `);continue}}return{type:"blockquote",raw:s,tokens:r,text:i}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim(),s=n.length>1,i={type:"list",raw:"",ordered:s,start:s?+n.slice(0,-1):"",loose:!1,items:[]};n=s?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=s?n:"[*+-]");let r=this.rules.other.listItemRegex(n),o=!1;for(;t;){let l=!1,p="",h="";if(!(e=r.exec(t))||this.rules.block.hr.test(t))break;p=e[0],t=t.substring(p.length);let d=e[2].split(`
4438
+ `,1)[0],f=e[1].length,c=this.options.pedantic?Ad(d,f):d.replace(this.rules.other.leadingSpaceTab,v=>Ad(v,f)),g=t.split(`
4439
+ `,1)[0],u=!c.trim(),k=0;if(this.options.pedantic?(k=2,h=c.trimStart()):u?k=f+1:(k=c.search(this.rules.other.nonSpaceChar),k=k>4?1:k,h=c.slice(k),k+=f),u&&this.rules.other.blankLine.test(g)&&(p+=g+`
4440
+ `,t=t.substring(g.length+1),l=!0),!l){let v=this.rules.other.nextBulletRegex(k),y=this.rules.other.hrRegex(k),A=this.rules.other.fencesBeginRegex(k),M=this.rules.other.headingBeginRegex(k),U=this.rules.other.htmlBeginRegex(k),L=this.rules.other.blockquoteBeginRegex(k);for(;t;){let G=t.split(`
4441
+ `,1)[0],q;if(g=G,this.options.pedantic?(g=g.replace(this.rules.other.listReplaceNesting," "),q=g):q=g.replace(this.rules.other.leadingSpaceTab,ae=>ae.replace(this.rules.other.tabCharGlobal," ")),A.test(g)||M.test(g)||U.test(g)||L.test(g)||v.test(g)||y.test(g))break;if(q.search(this.rules.other.nonSpaceChar)>=k||!g.trim())h+=`
4442
+ `+q.slice(k);else{if(u||c.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||A.test(c)||M.test(c)||y.test(c))break;h+=`
4443
+ `+g}u=!g.trim(),p+=G+`
4444
+ `,t=t.substring(G.length+1),c=q.slice(k)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(p)&&(o=!0)),i.items.push({type:"list_item",raw:p,task:!!this.options.gfm&&this.rules.other.listIsTask.test(h),loose:!1,text:h,tokens:[]}),i.raw+=p}let a=i.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let l of i.items)if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),!i.loose){let p=l.tokens.filter(d=>d.type==="space"),h=p.length>0&&p.some(d=>this.rules.other.anyLine.test(d.raw));i.loose=h}for(let l of i.items){let p=l.tokens[0];if(l.task&&(p?.type==="text"||p?.type==="paragraph")){l.text=l.text.replace(this.rules.other.listReplaceTask,""),p.raw=p.raw.replace(this.rules.other.listReplaceTask,""),p.text=p.text.replace(this.rules.other.listReplaceTask,"");for(let d=this.lexer.inlineQueue.length-1;d>=0;d--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[d].src)){this.lexer.inlineQueue[d].src=this.lexer.inlineQueue[d].src.replace(this.rules.other.listReplaceTask,"");break}let h=this.rules.other.listTaskCheckbox.exec(l.raw);if(h){let d={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};l.checked=d.checked,i.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=d.raw+l.tokens[0].raw,l.tokens[0].text=d.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(d)):l.tokens.unshift({type:"paragraph",raw:d.raw,text:d.raw,tokens:[d]}):l.tokens.unshift(d)}}else l.task&&(l.task=!1)}if(i.loose)for(let l of i.items){l.loose=!0;for(let p of l.tokens)p.type==="text"&&(p.type="paragraph")}return i}}html(t){let e=this.rules.block.html.exec(t);if(e){let n=$d(e[0]);return{type:"html",block:!0,raw:n,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:n}}}def(t){let e=this.rules.block.def.exec(t);if(e){if(!this.rules.other.startAngleBracket.test(e[2])&&Sd(e[2],"()")!==-1)return;let n=ns(e[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:$e(e[0],`
4445
+ `),href:s,title:i}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=yd(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
4446
+ `):[],r={type:"table",raw:$e(e[0],`
4447
+ `),header:[],align:[],rows:[]};if(n.length===s.length){for(let o of s)this.rules.other.tableAlignRight.test(o)?r.align.push("right"):this.rules.other.tableAlignCenter.test(o)?r.align.push("center"):this.rules.other.tableAlignLeft.test(o)?r.align.push("left"):r.align.push(null);for(let o=0;o<n.length;o++)r.header.push({text:n[o],tokens:this.lexer.inline(n[o]),header:!0,align:r.align[o]});for(let o of i)r.rows.push(yd(o,r.header.length).map((a,l)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:r.align[l]})));return r}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let n=e[1].trim();return{type:"heading",raw:$e(e[0],`
4413
4448
  `),depth:e[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let n=e[1].charAt(e[1].length-1)===`
4414
- `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){if(this.lexer.state.linkParenPossible===!1)return;let e=this.rules.inline.link.exec(t);if(e){let n=e[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&Md(t,e[1],n,this.rules))return;let s=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(s)){if(!this.rules.other.endAngleBracket.test(s))return;let o=Ee(s.slice(0,-1),"\\");if((s.length-o.length)%2===0)return}else{let o=Td(e[2],"()");if(o===-2)return;if(o>-1){let a=(e[0].indexOf("!")===0?5:4)+e[1].length+o;e[2]=e[2].substring(0,o),e[0]=e[0].substring(0,a).trim(),e[3]=""}}let i=e[2],r="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(i);o&&(i=o[1],r=o[3])}else r=e[3]?e[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(s)?i=i.slice(1):i=i.slice(1,-1)),_d(e,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let s=n[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&Md(t,n[1],s,this.rules))return;let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=e[ls(i)];if(!r){let o=n[0].charAt(0);return{type:"text",raw:o,text:o}}return _d(n,r,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let s=this.rules.inline.emStrongLDelim.exec(t);if(!(!s||!s[1]&&!s[2]&&!s[3]&&!s[4]||s[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...s[0]].length-1,r,o,a=i,l=0,c=s[0][0],d=n===c,h=c==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,e=e.slice(-1*t.length+i);(s=h.exec(e))!==null;){if(r=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!r)continue;if(o=[...r].length,s[3]||s[4]){a+=o;continue}else if(s[5]||s[6]){if(i%3&&!((i+o)%3)){l+=o;continue}if(d)break}if(a-=o,a>0)continue;o=Math.min(o,o+a+l);let f=[...s[0]][0].length,p=t.slice(0,i+s.index+f+o);if(Math.min(i,o)%2){let u=p.slice(1,-1);return{type:"em",raw:p,text:u,tokens:this.lexer.inlineTokens(u)}}let g=p.slice(2,-2);return{type:"strong",raw:p,text:g,tokens:this.lexer.inlineTokens(g)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return s&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,n=""){let s=this.rules.inline.delLDelim.exec(t);if(s&&(!s[1]||!n||this.rules.inline.punctuation.exec(n))){let i=[...s[0]].length-1,r,o,a=i,l=this.rules.inline.delRDelim;for(l.lastIndex=0,e=e.slice(-1*t.length+i);(s=l.exec(e))!==null;){if(r=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!r||(o=[...r].length,o!==i))continue;if(s[3]||s[4]){a+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a);let c=[...s[0]][0].length,d=t.slice(0,i+s.index+c+o),h=d.slice(i,-i);return{type:"del",raw:d,text:h,tokens:this.lexer.inlineTokens(h)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let n,s;return e[2]==="@"?(n=e[1],s="mailto:"+n):(n=e[1],s=n),{type:"link",raw:e[0],text:n,href:s,autolink:!0,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let n,s;if(e[2]==="@")n=e[0],s="mailto:"+n;else{let i;do i=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(i!==e[0]);n=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:n,href:s,autolink:!0,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:n?e[0]:cx(e[0]),escaped:n}}}},ne=class Zi{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Ve,this.options.tokenizer=this.options.tokenizer||new ds,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let n={other:q,block:as.normal,inline:tn.normal};this.options.pedantic?(n.block=as.pedantic,n.inline=tn.pedantic):this.options.gfm&&(n.block=as.gfm,this.options.breaks?n.inline=tn.breaks:n.inline=tn.gfm),this.tokenizer.rules=n}static get rules(){return{block:as,inline:tn}}static lex(e,n){return new Zi(n).lex(e)}static lexInline(e,n){return new Zi(n).inlineTokens(e)}lex(e){e=e.replace(q.carriageReturn,`
4415
- `),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let s=this.inlineQueue[n];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],s=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(q.tabCharGlobal," ").replace(q.spaceLine,""));let i=1/0;for(;e;){if(e.length<i)i=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let r;if(this.options.extensions?.block?.some(a=>(r=a.call({lexer:this},e,n))?(e=e.substring(r.raw.length),n.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let a=n.at(-1);r.raw.length===1&&a!==void 0?a.raw+=`
4449
+ `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){if(this.lexer.state.linkParenPossible===!1)return;let e=this.rules.inline.link.exec(t);if(e){let n=e[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&Cd(t,e[1],n,this.rules))return;let s=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(s)){if(!this.rules.other.endAngleBracket.test(s))return;let o=$e(s.slice(0,-1),"\\");if((s.length-o.length)%2===0)return}else{let o=Sd(e[2],"()");if(o===-2)return;if(o>-1){let a=(e[0].indexOf("!")===0?5:4)+e[1].length+o;e[2]=e[2].substring(0,o),e[0]=e[0].substring(0,a).trim(),e[3]=""}}let i=e[2],r="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(i);o&&(i=o[1],r=o[3])}else r=e[3]?e[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(s)?i=i.slice(1):i=i.slice(1,-1)),Ed(e,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let s=n[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&Cd(t,n[1],s,this.rules))return;let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=e[ns(i)];if(!r){let o=n[0].charAt(0);return{type:"text",raw:o,text:o}}return Ed(n,r,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let s=this.rules.inline.emStrongLDelim.exec(t);if(!(!s||!s[1]&&!s[2]&&!s[3]&&!s[4]||s[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...s[0]].length-1,r,o,a=i,l=0,p=s[0][0],h=n===p,d=p==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,e=e.slice(-1*t.length+i);(s=d.exec(e))!==null;){if(r=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!r)continue;if(o=[...r].length,s[3]||s[4]){a+=o;continue}else if(s[5]||s[6]){if(i%3&&!((i+o)%3)){l+=o;continue}if(h)break}if(a-=o,a>0)continue;o=Math.min(o,o+a+l);let f=[...s[0]][0].length,c=t.slice(0,i+s.index+f+o);if(Math.min(i,o)%2){let u=c.slice(1,-1);return{type:"em",raw:c,text:u,tokens:this.lexer.inlineTokens(u)}}let g=c.slice(2,-2);return{type:"strong",raw:c,text:g,tokens:this.lexer.inlineTokens(g)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return s&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,n=""){let s=this.rules.inline.delLDelim.exec(t);if(s&&(!s[1]||!n||this.rules.inline.punctuation.exec(n))){let i=[...s[0]].length-1,r,o,a=i,l=this.rules.inline.delRDelim;for(l.lastIndex=0,e=e.slice(-1*t.length+i);(s=l.exec(e))!==null;){if(r=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!r||(o=[...r].length,o!==i))continue;if(s[3]||s[4]){a+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a);let p=[...s[0]][0].length,h=t.slice(0,i+s.index+p+o),d=h.slice(i,-i);return{type:"del",raw:h,text:d,tokens:this.lexer.inlineTokens(d)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let n,s;return e[2]==="@"?(n=e[1],s="mailto:"+n):(n=e[1],s=n),{type:"link",raw:e[0],text:n,href:s,autolink:!0,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let n,s;if(e[2]==="@")n=e[0],s="mailto:"+n;else{let i;do i=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(i!==e[0]);n=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:n,href:s,autolink:!0,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:n?e[0]:vx(e[0]),escaped:n}}}},J=class Wi{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Ge,this.options.tokenizer=this.options.tokenizer||new ss,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let n={other:N,block:ts.normal,inline:Xt.normal};this.options.pedantic?(n.block=ts.pedantic,n.inline=Xt.pedantic):this.options.gfm&&(n.block=ts.gfm,this.options.breaks?n.inline=Xt.breaks:n.inline=Xt.gfm),this.tokenizer.rules=n}static get rules(){return{block:ts,inline:Xt}}static lex(e,n){return new Wi(n).lex(e)}static lexInline(e,n){return new Wi(n).inlineTokens(e)}lex(e){e=e.replace(N.carriageReturn,`
4450
+ `),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let s=this.inlineQueue[n];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],s=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(N.tabCharGlobal," ").replace(N.spaceLine,""));let i=1/0;for(;e;){if(e.length<i)i=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let r;if(this.options.extensions?.block?.some(a=>(r=a.call({lexer:this},e,n))?(e=e.substring(r.raw.length),n.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let a=n.at(-1);r.raw.length===1&&a!==void 0?a.raw+=`
4416
4451
  `:n.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let a=n.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
4417
4452
  `)?"":`
4418
4453
  `)+r.raw,a.text+=`
4419
4454
  `+r.text,this.inlineQueue.at(-1).src=a.text):n.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let a=n.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
4420
4455
  `)?"":`
4421
4456
  `)+r.raw,a.text+=`
4422
- `+r.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},n.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),n.push(r);continue}let o=e;if(this.options.extensions?.startBlock){let a=1/0,l=e.slice(1),c;this.options.extensions.startBlock.forEach(d=>{c=d.call({lexer:this},l),typeof c=="number"&&c>=0&&(a=Math.min(a,c))}),a<1/0&&a>=0&&(o=e.substring(0,a+1))}if(this.state.top&&(r=this.tokenizer.paragraph(o))){let a=n.at(-1);s&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(`
4457
+ `+r.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},n.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),n.push(r);continue}let o=e;if(this.options.extensions?.startBlock){let a=1/0,l=e.slice(1),p;this.options.extensions.startBlock.forEach(h=>{p=h.call({lexer:this},l),typeof p=="number"&&p>=0&&(a=Math.min(a,p))}),a<1/0&&a>=0&&(o=e.substring(0,a+1))}if(this.state.top&&(r=this.tokenizer.paragraph(o))){let a=n.at(-1);s&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(`
4423
4458
  `)?"":`
4424
4459
  `)+r.raw,a.text+=`
4425
4460
  `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(r),s=o.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let a=n.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
4426
4461
  `)?"":`
4427
4462
  `)+r.raw,a.text+=`
4428
- `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(r);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}linkInText(e){if(!e.includes("["))return!1;let n=this.tokenizer.rules.inline.link;for(let s of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(n.test(s[0])&&e.charAt(s.index-1)!=="!")return!0;for(let s of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let i=s[0],r=i.lastIndexOf("[");if(!(i.charAt(0)==="!"||!Object.hasOwn(this.tokens.links,ls(i.slice(r+1,-1))))&&!(r>1&&this.linkInText(i.slice(1,r-1))))return!0}return!1}inlineTokens(e,n=[]){this.tokenizer.lexer=this;let s=this.state.linkParenPossible;this.state.linkParenPossible=s&&e.includes(")");try{return this.#e(e,n)}finally{this.state.linkParenPossible=s}}#e(e,n){let s=e;if(this.tokens.links&&e.includes("[")){let a=this.tokenizer.rules.inline.reflinkSearch,l=c=>{let d=c.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,ls(c.slice(d+1,-1))))return c;if(d>1&&c.charAt(0)!=="!"){let h=c.slice(1,d-1);if(this.linkInText(h))return"["+h.replace(a,l)+"]["+"a".repeat(c.length-d-2)+"]"}return"["+"a".repeat(c.length-2)+"]"};s=s.replace(a,l)}s=s.replace(this.tokenizer.rules.inline.anyPunctuation,a=>"+".repeat(a.length)),s=s.replace(this.tokenizer.rules.inline.blockSkip,(a,l,c)=>{let d=c?c.length:0;return a.slice(0,d)+"["+"a".repeat(a.length-d-2)+"]"}),s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let i=!1,r="",o=1/0;for(;e;){if(e.length<o)o=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}i||(r=""),i=!1;let a;if(this.options.extensions?.inline?.some(c=>(a=c.call({lexer:this},e,n))?(e=e.substring(a.raw.length),n.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let c=n.at(-1);a.type==="text"&&c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):n.push(a);continue}if(a=this.tokenizer.emStrong(e,s,r)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.del(e,s,r)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),n.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),n.push(a);continue}let l=e;if(this.options.extensions?.startInline){let c=1/0,d=e.slice(1),h;this.options.extensions.startInline.forEach(f=>{h=f.call({lexer:this},d),typeof h=="number"&&h>=0&&(c=Math.min(c,h))}),c<1/0&&c>=0&&(l=e.substring(0,c+1))}if(a=this.tokenizer.inlineText(l)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(r=a.raw.slice(-1)),i=!0;let c=n.at(-1);c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):n.push(a);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return n}infiniteLoopError(e){let n="Infinite loop on byte: "+e;if(this.options.silent)console.error(n);else throw new Error(n)}},cs=class{options;parser;constructor(t){this.options=t||Ve}space(t){return""}code({text:t,lang:e,escaped:n}){let s=(e||"").match(q.notSpaceStart)?.[0],i=t?t.replace(q.endingNewline,"")+`
4429
- `:"";return s?'<pre><code class="language-'+V(s)+'">'+(n?i:V(i,!0))+`</code></pre>
4430
- `:"<pre><code>"+(n?i:V(i,!0))+`</code></pre>
4463
+ `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(r);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}linkInText(e){if(!e.includes("["))return!1;let n=this.tokenizer.rules.inline.link;for(let s of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(n.test(s[0])&&e.charAt(s.index-1)!=="!")return!0;for(let s of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let i=s[0],r=i.lastIndexOf("[");if(!(i.charAt(0)==="!"||!Object.hasOwn(this.tokens.links,ns(i.slice(r+1,-1))))&&!(r>1&&this.linkInText(i.slice(1,r-1))))return!0}return!1}inlineTokens(e,n=[]){this.tokenizer.lexer=this;let s=this.state.linkParenPossible;this.state.linkParenPossible=s&&e.includes(")");try{return this.#e(e,n)}finally{this.state.linkParenPossible=s}}#e(e,n){let s=e;if(this.tokens.links&&e.includes("[")){let a=this.tokenizer.rules.inline.reflinkSearch,l=p=>{let h=p.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,ns(p.slice(h+1,-1))))return p;if(h>1&&p.charAt(0)!=="!"){let d=p.slice(1,h-1);if(this.linkInText(d))return"["+d.replace(a,l)+"]["+"a".repeat(p.length-h-2)+"]"}return"["+"a".repeat(p.length-2)+"]"};s=s.replace(a,l)}s=s.replace(this.tokenizer.rules.inline.anyPunctuation,a=>"+".repeat(a.length)),s=s.replace(this.tokenizer.rules.inline.blockSkip,(a,l,p)=>{let h=p?p.length:0;return a.slice(0,h)+"["+"a".repeat(a.length-h-2)+"]"}),s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let i=!1,r="",o=1/0;for(;e;){if(e.length<o)o=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}i||(r=""),i=!1;let a;if(this.options.extensions?.inline?.some(p=>(a=p.call({lexer:this},e,n))?(e=e.substring(a.raw.length),n.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let p=n.at(-1);a.type==="text"&&p?.type==="text"?(p.raw+=a.raw,p.text+=a.text):n.push(a);continue}if(a=this.tokenizer.emStrong(e,s,r)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.del(e,s,r)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),n.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),n.push(a);continue}let l=e;if(this.options.extensions?.startInline){let p=1/0,h=e.slice(1),d;this.options.extensions.startInline.forEach(f=>{d=f.call({lexer:this},h),typeof d=="number"&&d>=0&&(p=Math.min(p,d))}),p<1/0&&p>=0&&(l=e.substring(0,p+1))}if(a=this.tokenizer.inlineText(l)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(r=a.raw.slice(-1)),i=!0;let p=n.at(-1);p?.type==="text"?(p.raw+=a.raw,p.text+=a.text):n.push(a);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return n}infiniteLoopError(e){let n="Infinite loop on byte: "+e;if(this.options.silent)console.error(n);else throw new Error(n)}},is=class{options;parser;constructor(t){this.options=t||Ge}space(t){return""}code({text:t,lang:e,escaped:n}){let s=(e||"").match(N.notSpaceStart)?.[0],i=t?t.replace(N.endingNewline,"")+`
4464
+ `:"";return s?'<pre><code class="language-'+F(s)+'">'+(n?i:F(i,!0))+`</code></pre>
4465
+ `:"<pre><code>"+(n?i:F(i,!0))+`</code></pre>
4431
4466
  `}blockquote({tokens:t}){return`<blockquote>
4432
4467
  ${this.parser.parse(t)}</blockquote>
4433
4468
  `}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
@@ -4443,8 +4478,8 @@ ${this.parser.parse(t)}</blockquote>
4443
4478
  `}tablerow({text:t}){return`<tr>
4444
4479
  ${t}</tr>
4445
4480
  `}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
4446
- `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${V(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,text:n,tokens:s,autolink:i}){let r=i?V(n,!0):this.parser.parseInline(s),o=Ad(t);if(o===null)return r;t=V(o,i);let a='<a href="'+t+'"';return e&&(a+=' title="'+V(e)+'"'),a+=">"+r+"</a>",a}image({href:t,title:e,text:n,tokens:s}){s&&(n=this.parser.parseInline(s,this.parser.textRenderer));let i=Ad(t);if(i===null)return V(n);t=i;let r=`<img src="${V(t)}" alt="${V(n)}"`;return e&&(r+=` title="${V(e)}"`),r+=">",r}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:V(t.text)}},Ki=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},se=class Qi{options;renderer;textRenderer;constructor(e){this.options=e||Ve,this.options.renderer=this.options.renderer||new cs,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ki}static parse(e,n){return new Qi(n).parse(e)}static parseInline(e,n){return new Qi(n).parseInline(e)}parse(e){this.renderer.parser=this;let n="";for(let s=0;s<e.length;s++){let i=e[s];if(this.options.extensions?.renderers?.[i.type]){let o=i,a=this.options.extensions.renderers[o.type].call({parser:this},o);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(o.type)){n+=a||"";continue}}let r=i;switch(r.type){case"space":{n+=this.renderer.space(r);break}case"hr":{n+=this.renderer.hr(r);break}case"heading":{n+=this.renderer.heading(r);break}case"code":{n+=this.renderer.code(r);break}case"table":{n+=this.renderer.table(r);break}case"blockquote":{n+=this.renderer.blockquote(r);break}case"list":{n+=this.renderer.list(r);break}case"checkbox":{n+=this.renderer.checkbox(r);break}case"html":{n+=this.renderer.html(r);break}case"def":{n+=this.renderer.def(r);break}case"paragraph":{n+=this.renderer.paragraph(r);break}case"text":{n+=this.renderer.text(r);break}default:{let o='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return n}parseInline(e,n=this.renderer){this.renderer.parser=this;let s="";for(let i=0;i<e.length;i++){let r=e[i];if(this.options.extensions?.renderers?.[r.type]){let a=this.options.extensions.renderers[r.type].call({parser:this},r);if(a!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(r.type)){s+=a||"";continue}}let o=r;switch(o.type){case"escape":{s+=n.text(o);break}case"html":{s+=n.html(o);break}case"link":{s+=n.link(o);break}case"image":{s+=n.image(o);break}case"checkbox":{s+=n.checkbox(o);break}case"strong":{s+=n.strong(o);break}case"em":{s+=n.em(o);break}case"codespan":{s+=n.codespan(o);break}case"br":{s+=n.br(o);break}case"del":{s+=n.del(o);break}case"text":{s+=n.text(o);break}default:{let a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return s}},nn=class{options;block;constructor(t){this.options=t||Ve}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?ne.lex:ne.lexInline}provideParser(t=this.block){return t?se.parse:se.parseInline}},Od=class{defaults=qi();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=se;Renderer=cs;TextRenderer=Ki;Lexer=ne;Tokenizer=ds;Hooks=nn;constructor(...t){this.use(...t)}walkTokens(t,e){let n=[];for(let s of t)switch(n=n.concat(e.call(this,s)),s.type){case"table":{let i=s;for(let r of i.header)n=n.concat(this.walkTokens(r.tokens,e));for(let r of i.rows)for(let o of r)n=n.concat(this.walkTokens(o.tokens,e));break}case"list":{let i=s;n=n.concat(this.walkTokens(i.items,e));break}default:{let i=s;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(r=>{let o=i[r].flat(1/0);n=n.concat(this.walkTokens(o,e))}):i.tokens&&(n=n.concat(this.walkTokens(i.tokens,e)))}}return n}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let s={...n};if(s.async=this.defaults.async||s.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let r=e.renderers[i.name];r?e.renderers[i.name]=function(...o){let a=i.renderer.apply(this,o);return a===!1&&(a=r.apply(this,o)),a}:e.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let r=e[i.level];r?r.unshift(i.tokenizer):e[i.level]=[i.tokenizer],i.start&&(i.level==="block"?e.startBlock?e.startBlock.push(i.start):e.startBlock=[i.start]:i.level==="inline"&&(e.startInline?e.startInline.push(i.start):e.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(e.childTokens[i.name]=i.childTokens)}),s.extensions=e),n.renderer){let i=this.defaults.renderer||new cs(this.defaults);for(let r in n.renderer){if(!(r in i))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;let o=r,a=n.renderer[o],l=i[o];i[o]=(...c)=>{let d=a.apply(i,c);return d===!1&&(d=l.apply(i,c)),d||""}}s.renderer=i}if(n.tokenizer){let i=this.defaults.tokenizer||new ds(this.defaults);for(let r in n.tokenizer){if(!(r in i))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;let o=r,a=n.tokenizer[o],l=i[o];i[o]=(...c)=>{let d=a.apply(i,c);return d===!1&&(d=l.apply(i,c)),d}}s.tokenizer=i}if(n.hooks){let i=this.defaults.hooks||new nn;for(let r in n.hooks){if(!(r in i))throw new Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;let o=r,a=n.hooks[o],l=i[o];nn.passThroughHooks.has(r)?i[o]=c=>{if(this.defaults.async&&nn.passThroughHooksRespectAsync.has(r))return(async()=>{let h=await a.call(i,c);return l.call(i,h)})();let d=a.call(i,c);return l.call(i,d)}:i[o]=(...c)=>{if(this.defaults.async)return(async()=>{let h=await a.apply(i,c);return h===!1&&(h=await l.apply(i,c)),h})();let d=a.apply(i,c);return d===!1&&(d=l.apply(i,c)),d}}s.hooks=i}if(n.walkTokens){let i=this.defaults.walkTokens,r=n.walkTokens;s.walkTokens=function(o){let a=[];return a.push(r.call(this,o)),i&&(a=a.concat(i.call(this,o))),a}}this.defaults={...this.defaults,...s}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return ne.lex(t,e??this.defaults)}parser(t,e){return se.parse(t,e??this.defaults)}parseMarkdown(t){return(e,n)=>{let s={...n},i={...this.defaults,...s},r=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&s.async===!1)return r(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return r(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return r(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=t),i.async)return(async()=>{let o=i.hooks?await i.hooks.preprocess(e):e,a=await(i.hooks?await i.hooks.provideLexer(t):t?ne.lex:ne.lexInline)(o,i),l=i.hooks?await i.hooks.processAllTokens(a):a;i.walkTokens&&await Promise.all(this.walkTokens(l,i.walkTokens));let c=await(i.hooks?await i.hooks.provideParser(t):t?se.parse:se.parseInline)(l,i);return i.hooks?await i.hooks.postprocess(c):c})().catch(r);try{i.hooks&&(e=i.hooks.preprocess(e));let o=(i.hooks?i.hooks.provideLexer(t):t?ne.lex:ne.lexInline)(e,i);i.hooks&&(o=i.hooks.processAllTokens(o)),i.walkTokens&&this.walkTokens(o,i.walkTokens);let a=(i.hooks?i.hooks.provideParser(t):t?se.parse:se.parseInline)(o,i);return i.hooks&&(a=i.hooks.postprocess(a)),a}catch(o){return r(o)}}}onError(t,e){return n=>{if(n.message+=`
4447
- Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error occurred:</p><pre>"+V(n.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(n);throw n}}},Ze=new Od;function _(t,e){return Ze.parse(t,e)}_.options=_.setOptions=function(t){return Ze.setOptions(t),_.defaults=Ze.defaults,hd(_.defaults),_},_.getDefaults=qi,_.defaults=Ve;function hx(...t){return Ze.use(...t),_.defaults=Ze.defaults,hd(_.defaults),_}_.use=hx,_.walkTokens=function(t,e){return Ze.walkTokens(t,e)},_.parseInline=Ze.parseInline,_.Parser=se,_.parser=se.parse,_.Renderer=cs,_.TextRenderer=Ki,_.Lexer=ne,_.lexer=ne.lex,_.Tokenizer=ds,_.Hooks=nn,_.parse=_,_.options,_.setOptions,_.walkTokens,_.parseInline,se.parse,ne.lex;const ux={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Qe=t=>t.replace(/[&<>"']/g,e=>ux[e]??e),gx=new Set(["http","https","mailto"]),Pd=t=>{const e=t.replace(/[\u0000- \u007f]/g,""),n=/^([a-z][a-z0-9+.-]*):/i.exec(e)?.[1];return n===void 0||gx.has(n.toLowerCase())},fx=t=>/^https?:/i.test(t.trim()),mx=new Od({gfm:!0,breaks:!0,renderer:{html({text:t}){return Qe(t)},link({href:t,title:e,tokens:n}){const s=this.parser.parseInline(n);if(!Pd(t))return s;const i=e?` title="${Qe(e)}"`:"",r=fx(t)?' target="_blank" rel="noopener noreferrer"':"";return`<a href="${Qe(t)}"${i}${r}>${s}</a>`},image({href:t,title:e,text:n}){if(!Pd(t))return Qe(n);const s=e?` title="${Qe(e)}"`:"";return`<img src="${Qe(t)}" alt="${Qe(n)}"${s}>`}}}),Ld=t=>mx.parse(t,{async:!1}),kx=je({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 zd extends ee{static{this.styles=[ft,Fa,z`
4481
+ `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${F(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,text:n,tokens:s,autolink:i}){let r=i?F(n,!0):this.parser.parseInline(s),o=wd(t);if(o===null)return r;t=F(o,i);let a='<a href="'+t+'"';return e&&(a+=' title="'+F(e)+'"'),a+=">"+r+"</a>",a}image({href:t,title:e,text:n,tokens:s}){s&&(n=this.parser.parseInline(s,this.parser.textRenderer));let i=wd(t);if(i===null)return F(n);t=i;let r=`<img src="${F(t)}" alt="${F(n)}"`;return e&&(r+=` title="${F(e)}"`),r+=">",r}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:F(t.text)}},ji=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},ee=class Ki{options;renderer;textRenderer;constructor(e){this.options=e||Ge,this.options.renderer=this.options.renderer||new is,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ji}static parse(e,n){return new Ki(n).parse(e)}static parseInline(e,n){return new Ki(n).parseInline(e)}parse(e){this.renderer.parser=this;let n="";for(let s=0;s<e.length;s++){let i=e[s];if(this.options.extensions?.renderers?.[i.type]){let o=i,a=this.options.extensions.renderers[o.type].call({parser:this},o);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(o.type)){n+=a||"";continue}}let r=i;switch(r.type){case"space":{n+=this.renderer.space(r);break}case"hr":{n+=this.renderer.hr(r);break}case"heading":{n+=this.renderer.heading(r);break}case"code":{n+=this.renderer.code(r);break}case"table":{n+=this.renderer.table(r);break}case"blockquote":{n+=this.renderer.blockquote(r);break}case"list":{n+=this.renderer.list(r);break}case"checkbox":{n+=this.renderer.checkbox(r);break}case"html":{n+=this.renderer.html(r);break}case"def":{n+=this.renderer.def(r);break}case"paragraph":{n+=this.renderer.paragraph(r);break}case"text":{n+=this.renderer.text(r);break}default:{let o='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return n}parseInline(e,n=this.renderer){this.renderer.parser=this;let s="";for(let i=0;i<e.length;i++){let r=e[i];if(this.options.extensions?.renderers?.[r.type]){let a=this.options.extensions.renderers[r.type].call({parser:this},r);if(a!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(r.type)){s+=a||"";continue}}let o=r;switch(o.type){case"escape":{s+=n.text(o);break}case"html":{s+=n.html(o);break}case"link":{s+=n.link(o);break}case"image":{s+=n.image(o);break}case"checkbox":{s+=n.checkbox(o);break}case"strong":{s+=n.strong(o);break}case"em":{s+=n.em(o);break}case"codespan":{s+=n.codespan(o);break}case"br":{s+=n.br(o);break}case"del":{s+=n.del(o);break}case"text":{s+=n.text(o);break}default:{let a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return s}},Jt=class{options;block;constructor(t){this.options=t||Ge}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?J.lex:J.lexInline}provideParser(t=this.block){return t?ee.parse:ee.parseInline}},Td=class{defaults=zi();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=ee;Renderer=is;TextRenderer=ji;Lexer=J;Tokenizer=ss;Hooks=Jt;constructor(...t){this.use(...t)}walkTokens(t,e){let n=[];for(let s of t)switch(n=n.concat(e.call(this,s)),s.type){case"table":{let i=s;for(let r of i.header)n=n.concat(this.walkTokens(r.tokens,e));for(let r of i.rows)for(let o of r)n=n.concat(this.walkTokens(o.tokens,e));break}case"list":{let i=s;n=n.concat(this.walkTokens(i.items,e));break}default:{let i=s;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(r=>{let o=i[r].flat(1/0);n=n.concat(this.walkTokens(o,e))}):i.tokens&&(n=n.concat(this.walkTokens(i.tokens,e)))}}return n}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let s={...n};if(s.async=this.defaults.async||s.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let r=e.renderers[i.name];r?e.renderers[i.name]=function(...o){let a=i.renderer.apply(this,o);return a===!1&&(a=r.apply(this,o)),a}:e.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let r=e[i.level];r?r.unshift(i.tokenizer):e[i.level]=[i.tokenizer],i.start&&(i.level==="block"?e.startBlock?e.startBlock.push(i.start):e.startBlock=[i.start]:i.level==="inline"&&(e.startInline?e.startInline.push(i.start):e.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(e.childTokens[i.name]=i.childTokens)}),s.extensions=e),n.renderer){let i=this.defaults.renderer||new is(this.defaults);for(let r in n.renderer){if(!(r in i))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;let o=r,a=n.renderer[o],l=i[o];i[o]=(...p)=>{let h=a.apply(i,p);return h===!1&&(h=l.apply(i,p)),h||""}}s.renderer=i}if(n.tokenizer){let i=this.defaults.tokenizer||new ss(this.defaults);for(let r in n.tokenizer){if(!(r in i))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;let o=r,a=n.tokenizer[o],l=i[o];i[o]=(...p)=>{let h=a.apply(i,p);return h===!1&&(h=l.apply(i,p)),h}}s.tokenizer=i}if(n.hooks){let i=this.defaults.hooks||new Jt;for(let r in n.hooks){if(!(r in i))throw new Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;let o=r,a=n.hooks[o],l=i[o];Jt.passThroughHooks.has(r)?i[o]=p=>{if(this.defaults.async&&Jt.passThroughHooksRespectAsync.has(r))return(async()=>{let d=await a.call(i,p);return l.call(i,d)})();let h=a.call(i,p);return l.call(i,h)}:i[o]=(...p)=>{if(this.defaults.async)return(async()=>{let d=await a.apply(i,p);return d===!1&&(d=await l.apply(i,p)),d})();let h=a.apply(i,p);return h===!1&&(h=l.apply(i,p)),h}}s.hooks=i}if(n.walkTokens){let i=this.defaults.walkTokens,r=n.walkTokens;s.walkTokens=function(o){let a=[];return a.push(r.call(this,o)),i&&(a=a.concat(i.call(this,o))),a}}this.defaults={...this.defaults,...s}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return J.lex(t,e??this.defaults)}parser(t,e){return ee.parse(t,e??this.defaults)}parseMarkdown(t){return(e,n)=>{let s={...n},i={...this.defaults,...s},r=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&s.async===!1)return r(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return r(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return r(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=t),i.async)return(async()=>{let o=i.hooks?await i.hooks.preprocess(e):e,a=await(i.hooks?await i.hooks.provideLexer(t):t?J.lex:J.lexInline)(o,i),l=i.hooks?await i.hooks.processAllTokens(a):a;i.walkTokens&&await Promise.all(this.walkTokens(l,i.walkTokens));let p=await(i.hooks?await i.hooks.provideParser(t):t?ee.parse:ee.parseInline)(l,i);return i.hooks?await i.hooks.postprocess(p):p})().catch(r);try{i.hooks&&(e=i.hooks.preprocess(e));let o=(i.hooks?i.hooks.provideLexer(t):t?J.lex:J.lexInline)(e,i);i.hooks&&(o=i.hooks.processAllTokens(o)),i.walkTokens&&this.walkTokens(o,i.walkTokens);let a=(i.hooks?i.hooks.provideParser(t):t?ee.parse:ee.parseInline)(o,i);return i.hooks&&(a=i.hooks.postprocess(a)),a}catch(o){return r(o)}}}onError(t,e){return n=>{if(n.message+=`
4482
+ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error occurred:</p><pre>"+F(n.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(n);throw n}}},Ke=new Td;function T(t,e){return Ke.parse(t,e)}T.options=T.setOptions=function(t){return Ke.setOptions(t),T.defaults=Ke.defaults,ld(T.defaults),T},T.getDefaults=zi,T.defaults=Ge;function wx(...t){return Ke.use(...t),T.defaults=Ke.defaults,ld(T.defaults),T}T.use=wx,T.walkTokens=function(t,e){return Ke.walkTokens(t,e)},T.parseInline=Ke.parseInline,T.Parser=ee,T.parser=ee.parse,T.Renderer=is,T.TextRenderer=ji,T.Lexer=J,T.lexer=J.lex,T.Tokenizer=ss,T.Hooks=Jt,T.parse=T,T.options,T.setOptions,T.walkTokens,T.parseInline,ee.parse,J.lex;const yx={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ve=t=>t.replace(/[&<>"']/g,e=>yx[e]??e),$x=new Set(["http","https","mailto"]),Rd=t=>{const e=t.replace(/[\u0000- \u007f]/g,""),n=/^([a-z][a-z0-9+.-]*):/i.exec(e)?.[1];return n===void 0||$x.has(n.toLowerCase())},Sx=t=>/^https?:/i.test(t.trim()),Ax=new Td({gfm:!0,breaks:!0,renderer:{html({text:t}){return Ve(t)},link({href:t,title:e,tokens:n}){const s=this.parser.parseInline(n);if(!Rd(t))return s;const i=e?` title="${Ve(e)}"`:"",r=Sx(t)?' target="_blank" rel="noopener noreferrer"':"";return`<a href="${Ve(t)}"${i}${r}>${s}</a>`},image({href:t,title:e,text:n}){if(!Rd(t))return Ve(n);const s=e?` title="${Ve(e)}"`:"";return`<img src="${Ve(t)}" alt="${Ve(n)}"${s}>`}}}),Md=t=>Ax.parse(t,{async:!1}),Ex=Ne({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 Od extends X{static{this.styles=[pt,qa,P`
4448
4483
  :host {
4449
4484
  display: inline-block;
4450
4485
  max-width: 100%;
@@ -4668,7 +4703,7 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
4668
4703
  :host([truncate]:not([wrap]):not([multiline])) .view {
4669
4704
  -webkit-line-clamp: 1;
4670
4705
  }
4671
- `]}static{this.properties={value:{type:String},placeholder:{type:String},multiline:{type:Boolean},wrap:{type:Boolean,reflect:!0},truncate:{type:Boolean,reflect:!0},seamless:{type:Boolean,reflect:!0},markdown:{type:Boolean},label:{type:String},editing:{type:Boolean,reflect:!0,attribute:"data-editing"},clipped:{type:Boolean,reflect:!0,attribute:"data-clipped"}}}#e="";#s=0;#t="end";#n=new Wt(this);#i=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>this.#r());connectedCallback(){super.connectedCallback(),this.#s+=1,this.#i?.observe(this)}disconnectedCallback(){super.disconnectedCallback(),this.#i?.disconnect()}constructor(){super(),this.value="",this.placeholder="",this.multiline=!1,this.wrap=!1,this.truncate=!1,this.seamless=!1,this.markdown=!1,this.label="",this.editing=!1,this.clipped=!1,this.#e=""}startEditing(){this.#t="end",this.#e=this.value,this.editing=!0}willUpdate(e){e.has("value")&&!this.editing&&(this.#e=this.value)}updated(){if(this.#r(),!this.editing)return;const e=this.renderRoot.querySelector(".field");if(!e)return;const n=this.renderRoot,s=n instanceof ShadowRoot?n.activeElement:document.activeElement,i=this.#t;if(this.#t="end",s!==e&&e.focus(),i==="end"){const r=e.value.length;e.setSelectionRange(r,r)}}#r(){if(!this.truncate||!(this.wrap||this.multiline)){this.clipped&&(this.clipped=!1);return}const e=this.renderRoot.querySelector(".box > .mirror"),n=e!==null&&e.scrollHeight>e.clientHeight+1;n!==this.clipped&&(this.clipped=n)}render(){const e=kx(this.#n.locale),n=this.placeholder||e.unset,{editing:s}=this,i=s?this.#e:this.value,r=this.label||this.placeholder||e.edit;if(this.markdown&&!s&&i!=="")return k`<span class="box"
4706
+ `]}static{this.properties={value:{type:String},placeholder:{type:String},multiline:{type:Boolean},wrap:{type:Boolean,reflect:!0},truncate:{type:Boolean,reflect:!0},seamless:{type:Boolean,reflect:!0},markdown:{type:Boolean},label:{type:String},editing:{type:Boolean,reflect:!0,attribute:"data-editing"},clipped:{type:Boolean,reflect:!0,attribute:"data-clipped"}}}#e="";#n=0;#s="end";#t=new jt(this);#i=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>this.#r());connectedCallback(){super.connectedCallback(),this.#n+=1,this.#i?.observe(this)}disconnectedCallback(){super.disconnectedCallback(),this.#i?.disconnect()}constructor(){super(),this.value="",this.placeholder="",this.multiline=!1,this.wrap=!1,this.truncate=!1,this.seamless=!1,this.markdown=!1,this.label="",this.editing=!1,this.clipped=!1,this.#e=""}startEditing(){this.#s="end",this.#e=this.value,this.editing=!0}willUpdate(e){e.has("value")&&!this.editing&&(this.#e=this.value)}updated(){if(this.#r(),!this.editing)return;const e=this.renderRoot.querySelector(".field");if(!e)return;const n=this.renderRoot,s=n instanceof ShadowRoot?n.activeElement:document.activeElement,i=this.#s;if(this.#s="end",s!==e&&e.focus(),i==="end"){const r=e.value.length;e.setSelectionRange(r,r)}}#r(){if(!this.truncate||!(this.wrap||this.multiline)){this.clipped&&(this.clipped=!1);return}const e=this.renderRoot.querySelector(".box > .mirror"),n=e!==null&&e.scrollHeight>e.clientHeight+1;n!==this.clipped&&(this.clipped=n)}render(){const e=Ex(this.#t.locale),n=this.placeholder||e.unset,{editing:s}=this,i=s?this.#e:this.value,r=this.label||this.placeholder||e.edit;if(this.markdown&&!s&&i!=="")return m`<span class="box"
4672
4707
  ><div
4673
4708
  class="view dpk-prose"
4674
4709
  role="button"
@@ -4677,26 +4712,26 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
4677
4712
  @click=${this.#o}
4678
4713
  @keydown=${this.#a}
4679
4714
  >
4680
- ${_a(Ld(i).trim())}
4715
+ ${Aa(Md(i).trim())}
4681
4716
  </div></span
4682
4717
  >`;const o=i===""?n:i.endsWith(`
4683
- `)?`${i}\u200B`:i;return k`<span class="box"
4718
+ `)?`${i}\u200B`:i;return m`<span class="box"
4684
4719
  ><span class="mirror" aria-hidden="true">${o}</span
4685
4720
  ><textarea
4686
4721
  class="field"
4687
4722
  ?readonly=${!s}
4688
4723
  rows="1"
4689
4724
  wrap=${this.multiline||this.wrap?"soft":"off"}
4690
- .value=${pd(i)}
4725
+ .value=${ad(i)}
4691
4726
  placeholder=${n}
4692
4727
  aria-label=${r}
4693
4728
  title=${s?b:e.clickToEdit}
4694
4729
  @click=${this.#l}
4695
4730
  @input=${this.#d}
4696
4731
  @keydown=${this.#c}
4697
- @blur=${this.#p}
4732
+ @blur=${this.#u}
4698
4733
  ></textarea>
4699
- </span>`}#o=e=>{e.composedPath().some(n=>n instanceof HTMLAnchorElement)||(e.stopPropagation(),!this.editing&&(this.#t="end",this.#e=this.value,this.editing=!0))};#a=e=>{e.isComposing||this.editing||e.target instanceof HTMLAnchorElement||(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.#t="end",this.editing=!0)};#l=e=>{e.stopPropagation(),!this.editing&&(this.#t="click",this.#e=this.value,this.editing=!0)};#d=e=>{const n=xt(e.target,HTMLTextAreaElement);n!==null&&(this.#e=n.value,this.requestUpdate())};#c=e=>{if(!e.isComposing){if(!this.editing){(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.#t="end",this.#e=this.value,this.editing=!0);return}if(e.key==="Escape"){e.preventDefault(),this.#e=this.value,this.editing=!1;return}if(e.key==="Enter"){if(e.shiftKey&&this.multiline||(e.preventDefault(),e.shiftKey))return;this.#h()}}};#p=e=>{const n=xt(e.currentTarget,HTMLTextAreaElement);if(n===null)return;const s=this.#s,{selectionStart:i,selectionEnd:r}=n;queueMicrotask(()=>{!this.isConnected||!this.editing||(s!==this.#s?(n.focus(),n.setSelectionRange(i,r)):this.#h())})};#h=()=>{if(!this.editing)return;this.editing=!1;const n=(this.wrap?this.#e.replace(/\r?\n/g," "):this.#e).trim();n!==this.value&&this.dispatchEvent(new CustomEvent("dpk-commit",{detail:{value:n},bubbles:!0,composed:!0}))}}const bx=()=>{customElements.get("dpk-inline-edit")||customElements.define("dpk-inline-edit",zd)},Dd=je({en:{heading:"Review notes",rejected:"Action rejected.",commentLabel:"Review comment",commentPlaceholder:"What the agent should fix, or what you noticed (handed to the agent as a review comment)",detach:"Detach",attachTo:t=>`Attach to this ${t}`,addNote:"Add to review",changesHeading:"Changes",commentsHeading:"Review comments",empty:"No draft actions yet.",emptyHint:"Comments and structural patches both land here, and survive reload via LocalStorage.",emptyChanges:"No changes yet.",emptyChangesHint:"What you edit, add or move on the page lands here and reaches the agent as a change.",emptyComments:"No review comments yet.",emptyCommentsHint:"Write what the agent should fix. Comments reach the agent with the changes and are not kept on the page.",sendToClaude:"Send to Claude",copy:"Copy changes & comments",copyTitle:"Copy the review to paste it to the agent",clear:"Clear all",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 close",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:"Agent \u306B\u76F4\u3057\u3066\u307B\u3057\u3044\u3053\u3068 / \u6C17\u3065\u304D\u3092\u66F8\u304F\uFF08\u30EC\u30D3\u30E5\u30FC\u30B3\u30E1\u30F3\u30C8\u3068\u3057\u3066\u6E21\u308B\uFF09",detach:"\u7D10\u3065\u3051\u3092\u89E3\u9664",attachTo:t=>`\u3053\u306E ${t} \u306B\u7D10\u3065\u3051\u308B`,addNote:"\u30EC\u30D3\u30E5\u30FC\u306B\u8FFD\u52A0",changesHeading:"\u5909\u66F4",commentsHeading:"\u30EC\u30D3\u30E5\u30FC\u30B3\u30E1\u30F3\u30C8",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",emptyChanges:"\u5909\u66F4\u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002",emptyChangesHint:"\u30DA\u30FC\u30B8\u4E0A\u3067\u7DE8\u96C6\u30FB\u8FFD\u52A0\u30FB\u79FB\u52D5\u3057\u305F\u5185\u5BB9\u304C\u3053\u3053\u306B\u96C6\u307E\u308A\u3001\u5909\u66F4\u3068\u3057\u3066 Agent \u306B\u6E21\u308A\u307E\u3059\u3002",emptyComments:"\u30EC\u30D3\u30E5\u30FC\u30B3\u30E1\u30F3\u30C8\u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002",emptyCommentsHint:"Agent \u306B\u76F4\u3057\u3066\u307B\u3057\u3044\u3053\u3068\u3092\u66F8\u304D\u307E\u3059\u3002\u5909\u66F4\u3068\u4E00\u7DD2\u306B Agent \u306B\u6E21\u308A\u3001\u30DA\u30FC\u30B8\u306B\u306F\u6B8B\u308A\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:"\u3059\u3079\u3066\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\u9589\u3058\u308B",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"}}),vx=()=>({body:"",editing:null,attachment:{kind:"page"},copy:{kind:"idle"},copyRequest:0,send:{kind:"idle"},sendRequest:0}),Id=t=>t.kind==="explicit"?{kind:t.resume}:t,Nd=(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:Id(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:Id(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}}}},xx=(t,e)=>{const n=t.body.trim();return n===""?null:{target:e,body:n}},yx=t=>{if(!t.editing)return null;const e=t.editing.body.trim();return e===""?null:{id:t.editing.id,body:e}},qd=t=>t.group?`${t.group} \xB7 ${t.label}`:t.label,Ud=(t,e)=>{const{definition:n,state:s,navigation:i,derivation:r}=t,o=Dd(t.locale),a=n.currentTarget?.(s,i)??null,l=e.attachment,c=l.kind==="explicit"?n.commentTargets(s,i).find(u=>u.value===l.ref):null,d=l.kind==="explicit"?{ref:l.ref,label:c?qd(c):l.ref}:l.kind==="current"&&a?{ref:a.value,label:qd(a)}:{ref:`page:${n.name}`,label:o.wholePage},h=new Map(r.stale.map(u=>[u.action.id,u.reason])),f=t.section??"all",g=r.actions.filter(u=>!Q(u)||h.has(u.id)).map(u=>{const m=n.describe(u,s,r.base),x=u.type===H;return{kind:x?"comments":"changes",id:u.id,title:x?o.comment:m.title,targetLabel:m.targetLabel,tone:x?"comment":m.tone,text:{kind:x?"comment":"summary",body:x?Ht(u):m.summary??""},code:x?null:n.serialize(u),stale:h.get(u.id)??null,edit:!x||t.editable!==!0?{kind:"none"}:e.editing?.id===u.id?{kind:"editing",body:e.editing.body,canSave:e.editing.body.trim().length>0}:{kind:"available"}}});return{body:e.body,target:d,attachment:l.kind==="explicit"?{kind:"explicit"}:a?{kind:"checkbox",checked:l.kind==="current",group:a.group??""}:{kind:"none"},canSubmit:e.body.trim().length>0,section:f,composer:f!=="changes",groups:["comments","changes"].filter(u=>f==="all"||f===u).map(u=>({kind:u,items:g.filter(m=>m.kind===u)})),hasDraft:r.actions.length>0,issues:t.issues.map(u=>`${u.path?`${u.path}: `:""}${u.message}`),send:t.sendable!==!0?"hidden":r.actions.length===0||e.send.kind==="pending"?"disabled":"ready",flash:e.send.kind==="sent"?o.sent:e.send.kind==="failed"?Ra(e.send.reason,t.locale):e.copy.kind==="copied"?o.copied:e.copy.kind==="failed"?o.copyFailed:""}},wx=[ft,pi,z`
4734
+ </span>`}#o=e=>{e.composedPath().some(n=>n instanceof HTMLAnchorElement)||(e.stopPropagation(),!this.editing&&(this.#s="end",this.#e=this.value,this.editing=!0))};#a=e=>{e.isComposing||this.editing||e.target instanceof HTMLAnchorElement||(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.#s="end",this.editing=!0)};#l=e=>{e.stopPropagation(),!this.editing&&(this.#s="click",this.#e=this.value,this.editing=!0)};#d=e=>{const n=ft(e.target,HTMLTextAreaElement);n!==null&&(this.#e=n.value,this.requestUpdate())};#c=e=>{if(!e.isComposing){if(!this.editing){(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.#s="end",this.#e=this.value,this.editing=!0);return}if(e.key==="Escape"){e.preventDefault(),this.#e=this.value,this.editing=!1;return}if(e.key==="Enter"){if(e.shiftKey&&this.multiline||(e.preventDefault(),e.shiftKey))return;this.#h()}}};#u=e=>{const n=ft(e.currentTarget,HTMLTextAreaElement);if(n===null)return;const s=this.#n,{selectionStart:i,selectionEnd:r}=n;queueMicrotask(()=>{!this.isConnected||!this.editing||(s!==this.#n?(n.focus(),n.setSelectionRange(i,r)):this.#h())})};#h=()=>{if(!this.editing)return;this.editing=!1;const n=(this.wrap?this.#e.replace(/\r?\n/g," "):this.#e).trim();n!==this.value&&this.dispatchEvent(new CustomEvent("dpk-commit",{detail:{value:n},bubbles:!0,composed:!0}))}}const Cx=()=>{customElements.get("dpk-inline-edit")||customElements.define("dpk-inline-edit",Od)},_d=Ne({en:{heading:"Review notes",rejected:"Action rejected.",commentLabel:"Review comment",commentPlaceholder:"What the agent should fix, or what you noticed (handed to the agent as a review comment)",detach:"Detach",attachTo:t=>`Attach to this ${t}`,addNote:"Add to review",changesHeading:"Changes",commentsHeading:"Review comments",empty:"No draft actions yet.",emptyHint:"Comments and structural patches both land here, and survive reload via LocalStorage.",emptyChanges:"No changes yet.",emptyChangesHint:"What you edit, add or move on the page lands here and reaches the agent as a change.",emptyComments:"No review comments yet.",emptyCommentsHint:"Write what the agent should fix. Comments reach the agent with the changes and are not kept on the page.",sendToClaude:"Send to Claude",copy:"Copy changes & comments",copyTitle:"Copy the review to paste it to the agent",clear:"Clear all",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 close",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:"Agent \u306B\u76F4\u3057\u3066\u307B\u3057\u3044\u3053\u3068 / \u6C17\u3065\u304D\u3092\u66F8\u304F\uFF08\u30EC\u30D3\u30E5\u30FC\u30B3\u30E1\u30F3\u30C8\u3068\u3057\u3066\u6E21\u308B\uFF09",detach:"\u7D10\u3065\u3051\u3092\u89E3\u9664",attachTo:t=>`\u3053\u306E ${t} \u306B\u7D10\u3065\u3051\u308B`,addNote:"\u30EC\u30D3\u30E5\u30FC\u306B\u8FFD\u52A0",changesHeading:"\u5909\u66F4",commentsHeading:"\u30EC\u30D3\u30E5\u30FC\u30B3\u30E1\u30F3\u30C8",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",emptyChanges:"\u5909\u66F4\u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002",emptyChangesHint:"\u30DA\u30FC\u30B8\u4E0A\u3067\u7DE8\u96C6\u30FB\u8FFD\u52A0\u30FB\u79FB\u52D5\u3057\u305F\u5185\u5BB9\u304C\u3053\u3053\u306B\u96C6\u307E\u308A\u3001\u5909\u66F4\u3068\u3057\u3066 Agent \u306B\u6E21\u308A\u307E\u3059\u3002",emptyComments:"\u30EC\u30D3\u30E5\u30FC\u30B3\u30E1\u30F3\u30C8\u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002",emptyCommentsHint:"Agent \u306B\u76F4\u3057\u3066\u307B\u3057\u3044\u3053\u3068\u3092\u66F8\u304D\u307E\u3059\u3002\u5909\u66F4\u3068\u4E00\u7DD2\u306B Agent \u306B\u6E21\u308A\u3001\u30DA\u30FC\u30B8\u306B\u306F\u6B8B\u308A\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:"\u3059\u3079\u3066\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\u9589\u3058\u308B",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"}}),Tx=()=>({body:"",editing:null,attachment:{kind:"page"},copy:{kind:"idle"},copyRequest:0,send:{kind:"idle"},sendRequest:0}),Pd=t=>t.kind==="explicit"?{kind:t.resume}:t,Ld=(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:Pd(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:Pd(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}}}},Rx=(t,e)=>{const n=t.body.trim();return n===""?null:{target:e,body:n}},Mx=t=>{if(!t.editing)return null;const e=t.editing.body.trim();return e===""?null:{id:t.editing.id,body:e}},zd=t=>t.group?`${t.group} \xB7 ${t.label}`:t.label,Id=(t,e)=>{const{definition:n,state:s,navigation:i,derivation:r}=t,o=_d(t.locale),a=n.currentTarget?.(s,i)??null,l=e.attachment,p=l.kind==="explicit"?n.commentTargets(s,i).find(u=>u.value===l.ref):null,h=l.kind==="explicit"?{ref:l.ref,label:p?zd(p):l.ref}:l.kind==="current"&&a?{ref:a.value,label:zd(a)}:{ref:_(n.wholeTarget??{type:Ys,id:n.name}),label:o.wholePage},d=new Map(r.stale.map(u=>[u.action.id,u.reason])),f=t.section??"all",g=r.actions.filter(u=>!Y(u)||d.has(u.id)).map(u=>{const k=n.describe(u,s,r.base),v=u.type===D;return{kind:v?"comments":"changes",id:u.id,title:v?o.comment:k.title,targetLabel:k.targetLabel,author:t.authorOf?.(u.id)??null,tone:v?"comment":k.tone,text:{kind:v?"comment":"summary",body:v?Dt(u):k.summary??""},code:v?null:n.serialize(u),stale:d.get(u.id)??null,edit:!v||t.editable!==!0||t.canEdit?.(u.id)===!1?{kind:"none"}:e.editing?.id===u.id?{kind:"editing",body:e.editing.body,canSave:e.editing.body.trim().length>0}:{kind:"available"}}});return{body:e.body,target:h,attachment:l.kind==="explicit"?{kind:"explicit"}:a?{kind:"checkbox",checked:l.kind==="current",group:a.group??""}:{kind:"none"},canSubmit:e.body.trim().length>0,section:f,composer:f!=="changes",groups:["comments","changes"].filter(u=>f==="all"||f===u).map(u=>({kind:u,items:g.filter(k=>k.kind===u)})),hasDraft:r.actions.length>0,issues:t.issues.map(u=>`${u.path?`${u.path}: `:""}${u.message}`),send:t.sendable!==!0?"hidden":r.actions.length===0||e.send.kind==="pending"?"disabled":"ready",flash:e.send.kind==="sent"?o.sent:e.send.kind==="failed"?Sa(e.send.reason,t.locale):e.copy.kind==="copied"?o.copied:e.copy.kind==="failed"?o.copyFailed:""}},Ox=[pt,ai,P`
4700
4735
  :host {
4701
4736
  display: flex;
4702
4737
  flex-direction: column;
@@ -4992,6 +5027,18 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
4992
5027
  margin-left: -4px;
4993
5028
  }
4994
5029
 
5030
+ .item-meta {
5031
+ display: flex;
5032
+ flex-wrap: wrap;
5033
+ align-items: center;
5034
+ gap: 6px;
5035
+ }
5036
+
5037
+ .item-author {
5038
+ font-size: 10.5px;
5039
+ color: var(--dpk-ink-faint);
5040
+ }
5041
+
4995
5042
  .item-target {
4996
5043
  display: inline-flex;
4997
5044
  align-items: center;
@@ -5135,17 +5182,17 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
5135
5182
  color: var(--dpk-green);
5136
5183
  animation: dpk-pop var(--dpk-dur) var(--dpk-ease-spring);
5137
5184
  }
5138
- `],$x=t=>{switch(t){case"comment":return Fn();case"create":return ci();case"update":return di();case"delete":return Ma();case"move":return Da();default:return Pa()}},Sx=(t,e,n,s=!1)=>k`
5139
- ${s?b:k`<header><h2>${Ax(t,e.section)}</h2></header>`}
5140
- ${e.issues.length>0?k`<div class="issues" role="alert">
5185
+ `],_x=t=>{switch(t){case"comment":return Nn();case"create":return oi();case"update":return ri();case"delete":return Ea();case"move":return Oa();default:return Ta()}},Px=(t,e,n,s=!1)=>m`
5186
+ ${s?b:m`<header><h2>${Lx(t,e.section)}</h2></header>`}
5187
+ ${e.issues.length>0?m`<div class="issues" role="alert">
5141
5188
  <strong>${t.rejected}</strong>
5142
5189
  <ul>
5143
- ${e.issues.map(i=>k`<li>${i}</li>`)}
5190
+ ${e.issues.map(i=>m`<li>${i}</li>`)}
5144
5191
  </ul>
5145
5192
  </div>`:b}
5146
- ${e.composer?Ex(t,e,n):b} ${Cx(t,e,n)}
5193
+ ${e.composer?zx(t,e,n):b} ${Ix(t,e,n)}
5147
5194
  <footer>
5148
- ${s||e.send==="hidden"?b:k`<button
5195
+ ${s||e.send==="hidden"?b:m`<button
5149
5196
  class="dpk-btn dpk-btn--accent"
5150
5197
  type="button"
5151
5198
  ?disabled=${e.send==="disabled"}
@@ -5154,7 +5201,7 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
5154
5201
  ${t.sendToClaude}
5155
5202
  </button>`}
5156
5203
  <div class="footer-actions">
5157
- ${s?b:k`<button
5204
+ ${s?b:m`<button
5158
5205
  class=${e.send==="hidden"?"dpk-btn dpk-btn--accent":"dpk-btn"}
5159
5206
  type="button"
5160
5207
  title=${t.copyTitle}
@@ -5172,9 +5219,9 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
5172
5219
  ${t.clear}
5173
5220
  </button>
5174
5221
  </div>
5175
- ${e.flash?k`<span class="flash" role="status">${e.flash}</span>`:b}
5222
+ ${e.flash?m`<span class="flash" role="status">${e.flash}</span>`:b}
5176
5223
  </footer>
5177
- `,Ax=(t,e)=>e==="changes"?t.changesHeading:e==="comments"?t.commentsHeading:t.heading,Ex=(t,e,n)=>k`
5224
+ `,Lx=(t,e)=>e==="changes"?t.changesHeading:e==="comments"?t.commentsHeading:t.heading,zx=(t,e,n)=>m`
5178
5225
  <div class="composer">
5179
5226
  <textarea
5180
5227
  class="dpk-textarea"
@@ -5184,11 +5231,11 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
5184
5231
  @input=${s=>{s.currentTarget instanceof HTMLTextAreaElement&&n({kind:"input",body:s.currentTarget.value})}}
5185
5232
  @keydown=${s=>{!s.isComposing&&s.key==="Enter"&&(s.metaKey||s.ctrlKey)&&(s.preventDefault(),n({kind:"submit"}))}}
5186
5233
  ></textarea>
5187
- ${e.attachment.kind==="explicit"?k`<div class="row">
5234
+ ${e.attachment.kind==="explicit"?m`<div class="row">
5188
5235
  <button class="chip" type="button" aria-label=${t.detach} @click=${()=>n({kind:"clear-target"})}>
5189
- ${e.target.label} ${ct()}
5236
+ ${e.target.label} ${ot()}
5190
5237
  </button>
5191
- </div>`:e.attachment.kind==="checkbox"?k`<div class="row">
5238
+ </div>`:e.attachment.kind==="checkbox"?m`<div class="row">
5192
5239
  <label class="attach">
5193
5240
  <input
5194
5241
  type="checkbox"
@@ -5210,38 +5257,38 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
5210
5257
  </button>
5211
5258
  </div>
5212
5259
  </div>
5213
- `,Vi=(t,e)=>k`<div class="empty">
5260
+ `,Fi=(t,e)=>m`<div class="empty">
5214
5261
  <div class="empty-box">
5215
- ${Fn()}
5262
+ ${Nn()}
5216
5263
  <p>${t}</p>
5217
5264
  <p class="empty-hint">${e}</p>
5218
5265
  </div>
5219
- </div>`,Hd=(t,e,n)=>k`<ul
5266
+ </div>`,Dd=(t,e,n)=>m`<ul
5220
5267
  class="list"
5221
5268
  >
5222
- ${Ke(e,s=>s.id,s=>Tx(t,s,n))}
5223
- </ul>`,Cx=(t,e,n)=>{const[s]=e.groups;return e.groups.length===1&&s?s.items.length>0?k`<div class="groups">${Hd(t,s.items,n)}</div>`:s.kind==="changes"?Vi(t.emptyChanges,t.emptyChangesHint):Vi(t.emptyComments,t.emptyCommentsHint):e.groups.every(i=>i.items.length===0)?Vi(t.empty,t.emptyHint):k`<div class="groups">
5224
- ${e.groups.filter(i=>i.items.length>0).map(i=>k`<section class="group" data-kind=${i.kind}>
5269
+ ${Fe(e,s=>s.id,s=>Dx(t,s,n))}
5270
+ </ul>`,Ix=(t,e,n)=>{const[s]=e.groups;return e.groups.length===1&&s?s.items.length>0?m`<div class="groups">${Dd(t,s.items,n)}</div>`:s.kind==="changes"?Fi(t.emptyChanges,t.emptyChangesHint):Fi(t.emptyComments,t.emptyCommentsHint):e.groups.every(i=>i.items.length===0)?Fi(t.empty,t.emptyHint):m`<div class="groups">
5271
+ ${e.groups.filter(i=>i.items.length>0).map(i=>m`<section class="group" data-kind=${i.kind}>
5225
5272
  <h3 class="group-head">
5226
5273
  ${i.kind==="changes"?t.changesHeading:t.commentsHeading}
5227
5274
  <span class="group-count">${i.items.length}</span>
5228
5275
  </h3>
5229
- ${Hd(t,i.items,n)}
5276
+ ${Dd(t,i.items,n)}
5230
5277
  </section>`)}
5231
- </div>`},Tx=(t,e,n)=>k`
5278
+ </div>`},Dx=(t,e,n)=>m`
5232
5279
  <li class="item" data-tone=${e.tone} data-stale=${String(e.stale!==null)} data-id=${e.id}>
5233
5280
  <div class="item-head">
5234
- <span class="item-icon">${$x(e.tone)}</span>
5281
+ <span class="item-icon">${_x(e.tone)}</span>
5235
5282
  <span class="item-title">${e.title}</span>
5236
- ${e.stale?k`<span class="stale-badge">${e.stale}</span>`:b}
5237
- ${e.edit.kind==="available"?k`<button
5283
+ ${e.stale?m`<span class="stale-badge">${e.stale}</span>`:b}
5284
+ ${e.edit.kind==="available"?m`<button
5238
5285
  class="dpk-icon-btn item-edit"
5239
5286
  type="button"
5240
5287
  aria-label=${t.editComment}
5241
5288
  title=${t.editComment}
5242
5289
  @click=${()=>n({kind:"edit-start",id:e.id,body:e.text.body})}
5243
5290
  >
5244
- ${di()}
5291
+ ${ri()}
5245
5292
  </button>`:b}
5246
5293
  <button
5247
5294
  class="dpk-icon-btn"
@@ -5249,14 +5296,17 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
5249
5296
  aria-label=${t.deleteAction}
5250
5297
  @click=${()=>n({kind:"delete",id:e.id})}
5251
5298
  >
5252
- ${ct()}
5299
+ ${ot()}
5253
5300
  </button>
5254
5301
  </div>
5255
- <div class="item-target">${e.targetLabel}</div>
5256
- ${e.edit.kind==="editing"?Rx(t,e.edit,n):e.text.kind==="comment"?k`<p class="item-body">${e.text.body}</p>`:e.text.body?k`<div class="item-summary">${e.text.body}</div>`:b}
5257
- ${e.code===null?b:k`<code class="item-code">${e.code}</code>`}
5302
+ <div class="item-meta">
5303
+ <span class="item-target">${e.targetLabel}</span>
5304
+ ${e.author===null?b:m`<span class="item-author">${e.author}</span>`}
5305
+ </div>
5306
+ ${e.edit.kind==="editing"?Nx(t,e.edit,n):e.text.kind==="comment"?m`<p class="item-body">${e.text.body}</p>`:e.text.body?m`<div class="item-summary">${e.text.body}</div>`:b}
5307
+ ${e.code===null?b:m`<code class="item-code">${e.code}</code>`}
5258
5308
  </li>
5259
- `,Rx=(t,e,n)=>k`
5309
+ `,Nx=(t,e,n)=>m`
5260
5310
  <div class="item-editor">
5261
5311
  <textarea
5262
5312
  class="dpk-textarea"
@@ -5285,8 +5335,8 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
5285
5335
  </button>
5286
5336
  </div>
5287
5337
  </div>
5288
- `,_x=t=>t==="changes"||t==="comments"?t:"all";class jd extends ee{static{this.styles=wx}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},section:{type:String}}}#e=vx();#s=null;#t=new Wt(this);constructor(){super(),this.embedded=!1,this.definition=null,this.state=void 0,this.navigation={},this.derivation=null,this.issues=[],this.pendingTarget=null,this.section=null}willUpdate(e){e.has("pendingTarget")&&this.pendingTarget&&(this.#e=Nd(this.#e,{kind:"target-requested",ref:this.pendingTarget}))}updated(e){e.has("pendingTarget")&&this.pendingTarget&&this.isConnected&&this.renderRoot.querySelector("textarea")?.focus();const n=this.#s;n&&(this.#s=null,[...this.renderRoot.querySelectorAll(".item")].find(i=>i.dataset.id===n.id)?.querySelector(n.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.#t.locale,section:_x(this.section)}}render(){const e=this.#n();return e?Sx(Dd(this.#t.locale),Ud(e,this.#e),this.#r,this.embedded):b}#i(e){this.#e=Nd(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.#s={kind:"editor",id:e.id},this.#i(e);return;case"edit-cancel":{const n=this.#e.editing;n&&(this.#s={kind:"edit-button",id:n.id}),this.#i(e);return}case"edit-save":{const n=yx(this.#e);if(!n||!this.onEditComment||!this.onEditComment(n.id,n.body).ok)return;this.#s={kind:"edit-button",id:n.id},this.#i({kind:"edited"});return}case"submit":{const n=this.#n();if(!n||!this.onComment)return;const s=xx(this.#e,Ud(n,this.#e).target.ref);if(!s||!this.onComment(s.target,s.body).ok)return;this.#i({kind:"submitted"});return}default:this.#i(e)}};async#o(){const e=this.sendToClaude;if(!e||this.#e.send.kind==="pending")return;this.#i({kind:"send-started"});const n=this.#e.sendRequest,s=await e().catch(()=>({ok:!1,reason:"error"}));this.isConnected&&this.#i({kind:"send-finished",request:n,outcome:s})}async#a(){const e=this.#n();if(!e)return;this.#i({kind:"copy-started"});const n=this.#e.copyRequest;try{const s=this.exportBrief?.()??Hn({...e.derivation,navigation:e.navigation,issues:e.issues},e.definition,me),i=await On(s);this.isConnected&&this.#i({kind:"copy-finished",request:n,ok:i})}catch{this.isConnected&&this.#i({kind:"copy-finished",request:n,ok:!1})}}}const Mx=()=>{customElements.get("dpk-comment-panel")||customElements.define("dpk-comment-panel",jd)},sn="dpk-version",Bd="version",Ox=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/,ps=t=>Ox.test(t),Px="https://cdn.jsdelivr.net/npm/dev-process-kit@",Fd="https://data.jsdelivr.com/v1/packages/npm/dev-process-kit",Gd=t=>{const e=new URLSearchParams(t),n=e.get(sn)??e.get(Bd);return n!==null&&ps(n)?n:null},Lx=(t,e)=>{const n=Gd(t);return n===null||n===e?null:n},zx=(t,e)=>{if(!ps(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`${Px}${t}/dist/${e}`},Dx=(t,e)=>{const n=new URL(t);return n.searchParams.delete(Bd),e===null?n.searchParams.delete(sn):n.searchParams.set(sn,e),n.href},Ix=R({tags:N(Oe(v(),xe()),{}),versions:U(R({version:v()}))}),Nx=t=>{const e=Mt(Ix,t),n=e.tags.latest;return{latest:typeof n=="string"&&ps(n)?n:null,versions:e.versions.map(s=>s.version).filter(ps)}},qx=t=>{const e=t.published?.versions??[],n=e.includes(t.current)?e:[t.current,...e],s=t.published?.latest??null;return{value:t.current,options:[...t.requested?[{value:"",label:t.text.pinned}]:[],...n.map(i=>({value:i,label:i===s&&i!==t.current?t.text.latest(i):i}))]}};let hs;const Ux=()=>(hs??=fetch(Fd).then(async t=>{if(!t.ok)throw new Error(`${Fd} answered ${t.status}`);return Nx(await t.json())}),hs.catch(()=>{hs=void 0}),hs),Hx=t=>{location.assign(Dx(location.href,t))},jx=t=>import(t),Bx=({entry:t,views:e,url:n,register:s,importModule:i=jx})=>{const r=()=>{s(),Rr(me,e,sn,n)},o=typeof location>"u"?null:Lx(location.search,me);if(o===null){r();return}i(zx(o,t)).then(()=>{Fx()||Wx(o)},a=>{console.error(`dev-process-kit@${o} could not be loaded; running ${me}`,a),r()})},Fx=()=>{const t=Reflect.get(window,"devProcessKit");return typeof t=="object"&&t!==null&&"versionParam"in t},Yi="dpk-version-fallback",Gx=`
5289
- .${Yi} {
5338
+ `,qx=t=>t==="changes"||t==="comments"?t:"all";class Nd extends X{static{this.styles=Ox}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},authorOf:{attribute:!1},canEditComment:{attribute:!1},sendToClaude:{attribute:!1},embedded:{type:Boolean},section:{type:String}}}#e=Tx();#n=null;#s=new jt(this);constructor(){super(),this.embedded=!1,this.definition=null,this.state=void 0,this.navigation={},this.derivation=null,this.issues=[],this.pendingTarget=null,this.section=null}willUpdate(e){e.has("pendingTarget")&&this.pendingTarget&&(this.#e=Ld(this.#e,{kind:"target-requested",ref:this.pendingTarget}))}updated(e){e.has("pendingTarget")&&this.pendingTarget&&this.isConnected&&this.renderRoot.querySelector("textarea")?.focus();const n=this.#n;n&&(this.#n=null,[...this.renderRoot.querySelectorAll(".item")].find(i=>i.dataset.id===n.id)?.querySelector(n.kind==="editor"?".item-editor textarea":".item-edit")?.focus())}#t(){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,section:qx(this.section),...this.authorOf===void 0?{}:{authorOf:this.authorOf},...this.canEditComment===void 0?{}:{canEdit:this.canEditComment}}}render(){const e=this.#t();return e?Px(_d(this.#s.locale),Id(e,this.#e),this.#r,this.embedded):b}#i(e){this.#e=Ld(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.#n={kind:"editor",id:e.id},this.#i(e);return;case"edit-cancel":{const n=this.#e.editing;n&&(this.#n={kind:"edit-button",id:n.id}),this.#i(e);return}case"edit-save":{const n=Mx(this.#e);if(!n||!this.onEditComment||!this.onEditComment(n.id,n.body).ok)return;this.#n={kind:"edit-button",id:n.id},this.#i({kind:"edited"});return}case"submit":{const n=this.#t();if(!n||!this.onComment)return;const s=Rx(this.#e,Id(n,this.#e).target.ref);if(!s||!this.onComment(s.target,s.body).ok)return;this.#i({kind:"submitted"});return}default:this.#i(e)}};async#o(){const e=this.sendToClaude;if(!e||this.#e.send.kind==="pending")return;this.#i({kind:"send-started"});const n=this.#e.sendRequest,s=await e().catch(()=>({ok:!1,reason:"error"}));this.isConnected&&this.#i({kind:"send-finished",request:n,outcome:s})}async#a(){const e=this.#t();if(!e)return;this.#i({kind:"copy-started"});const n=this.#e.copyRequest;try{const s=this.exportBrief?.()??zn({...e.derivation,navigation:e.navigation,issues:e.issues},e.definition,ge),i=await En(s);this.isConnected&&this.#i({kind:"copy-finished",request:n,ok:i})}catch{this.isConnected&&this.#i({kind:"copy-finished",request:n,ok:!1})}}}const Ux=()=>{customElements.get("dpk-comment-panel")||customElements.define("dpk-comment-panel",Nd)},en="dpk-version",qd="version",Hx=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/,rs=t=>Hx.test(t),Bx="https://cdn.jsdelivr.net/npm/dev-process-kit@",Ud="https://data.jsdelivr.com/v1/packages/npm/dev-process-kit",Hd=t=>{const e=new URLSearchParams(t),n=e.get(en)??e.get(qd);return n!==null&&rs(n)?n:null},jx=(t,e)=>{const n=Hd(t);return n===null||n===e?null:n},Fx=(t,e)=>{if(!rs(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`${Bx}${t}/dist/${e}`},Gx=(t,e)=>{const n=new URL(t);return n.searchParams.delete(qd),e===null?n.searchParams.delete(en):n.searchParams.set(en,e),n.href},Wx=O({tags:I($t(x(),yt()),{}),versions:H(O({version:x()}))}),Kx=t=>{const e=tn(Wx,t),n=e.tags.latest;return{latest:typeof n=="string"&&rs(n)?n:null,versions:e.versions.map(s=>s.version).filter(rs)}},Vx=t=>{const e=t.published?.versions??[],n=e.includes(t.current)?e:[t.current,...e],s=t.published?.latest??null;return{value:t.current,options:[...t.requested?[{value:"",label:t.text.pinned}]:[],...n.map(i=>({value:i,label:i===s&&i!==t.current?t.text.latest(i):i}))]}};let os;const Yx=()=>(os??=fetch(Ud).then(async t=>{if(!t.ok)throw new Error(`${Ud} answered ${t.status}`);return Kx(await t.json())}),os.catch(()=>{os=void 0}),os),Zx=t=>{location.assign(Gx(location.href,t))},Qx=t=>import(t),Xx=({entry:t,views:e,url:n,register:s,importModule:i=Qx})=>{const r=()=>{s(),Or(ge,e,en,n)},o=typeof location>"u"?null:jx(location.search,ge);if(o===null){r();return}i(Fx(o,t)).then(()=>{Jx()||tw(o)},a=>{console.error(`dev-process-kit@${o} could not be loaded; running ${ge}`,a),r()})},Jx=()=>{const t=Reflect.get(window,"devProcessKit");return typeof t=="object"&&t!==null&&"versionParam"in t},Gi="dpk-version-fallback",ew=`
5339
+ .${Gi} {
5290
5340
  flex: none;
5291
5341
  height: 24px;
5292
5342
  margin-left: auto;
@@ -5304,4 +5354,4 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
5304
5354
  letter-spacing: 0.02em;
5305
5355
  cursor: pointer;
5306
5356
  }
5307
- `,Wx=t=>{const e=[...document.body.querySelectorAll("*")].filter(n=>n.localName.startsWith("dpk-view-")&&!n.querySelector(`:scope > .${Yi}`));if(e.length!==0){document.head.append(Object.assign(document.createElement("style"),{textContent:Gx}));for(const n of e)n.append(Kx(n,t))}},Kx=(t,e)=>{const n=O(zn(Ln(t))),s=document.createElement("select");s.className=Yi,s.slot="header",s.setAttribute("aria-label",n.versionLabel),s.title=n.versionLabel;const i=o=>{const a=qx({current:e,requested:Gd(location.search)!==null,published:o,text:{pinned:n.versionPinned,latest:n.versionLatest}});s.replaceChildren(...a.options.map(l=>Object.assign(document.createElement("option"),{value:l.value,textContent:l.label}))),s.value=a.value},r=()=>{Ux().then(i,o=>console.warn(o))};return s.addEventListener("pointerenter",r,{once:!0}),s.addEventListener("focus",r,{once:!0}),s.addEventListener("change",()=>Hx(s.value===""?null:s.value)),i(null),s};class Wd extends Ob{}const Vx=()=>{customElements.get("dpk-page")||customElements.define("dpk-page",Wd)};export{bx as $,La as A,Pa as B,H as C,$a as D,Pt as E,Da as F,di as G,ci as H,Ma as I,va as J,xn as K,Le as L,oi as M,Ot as N,yn as O,Ap as P,Ms as Q,Zr as R,P as S,kn as T,vn as U,us as V,ri as W,ft as X,jd as Y,zd as Z,Mx as _,Vx as a,Lr as a$,Rr as a0,sn as a1,cd as a2,Wd as a3,vo as a4,je as a5,X as a6,fe as a7,C as a8,R as a9,hn as aA,gn as aB,mn as aC,fn as aD,Qn as aE,Kt as aF,pn as aG,Ke as aH,uf as aI,hf as aJ,Ts as aK,B as aL,Rs as aM,Ju as aN,Fr as aO,rd as aP,wi as aQ,Dn as aR,aa as aS,Io as aT,qr as aU,Dr as aV,On as aW,Br as aX,xe as aY,Gt as aZ,Na as a_,U as aa,G as ab,v as ac,Gr as ad,Vn as ae,bt as af,wf as ag,z as ah,b as ai,Yc as aj,ee as ak,Wt as al,ki as am,sl as an,fo as ao,tl as ap,Qa as aq,ea as ar,k as as,vi as at,Mt as au,L as av,N as aw,w as ax,S as ay,_t as az,Js as b,y as b0,tr as b1,ir as b2,sf as b3,df as b4,lf as b5,za as b6,bp as b7,xf as b8,Oe as b9,yf as bA,Ha as bB,Ba as bC,Ir as bD,pl as bE,Vb as bF,or as bG,ar as bH,Yr as bI,Ur as bJ,Cs as bK,jo as ba,te as bb,pt as bc,nf as bd,xo as be,eg as bf,Yb as bg,Jf as bh,Pr as bi,Nr as bj,Sp as bk,vp as bl,_a as bm,Ld as bn,rr as bo,Jg as bp,Fa as bq,Mn as br,Ft as bs,jn as bt,xi as bu,nr as bv,sr as bw,pd as bx,Ia as by,xt as bz,Jr as c,hv as d,Ep as e,Hn as f,oa as g,Ht as h,ka as i,pi as j,Qr as k,_p as l,_s as m,ai as n,Bt as o,bn as p,ba as q,Pe as r,Bx as s,Tp as t,nt as u,me as v,af as w,rf as x,ct as y,Fn as z};
5357
+ `,tw=t=>{const e=[...document.body.querySelectorAll("*")].filter(n=>n.localName.startsWith("dpk-view-")&&!n.querySelector(`:scope > .${Gi}`));if(e.length!==0){document.head.append(Object.assign(document.createElement("style"),{textContent:ew}));for(const n of e)n.append(nw(n,t))}},nw=(t,e)=>{const n=R(Rn(Tn(t))),s=document.createElement("select");s.className=Gi,s.slot="header",s.setAttribute("aria-label",n.versionLabel),s.title=n.versionLabel;const i=o=>{const a=Vx({current:e,requested:Hd(location.search)!==null,published:o,text:{pinned:n.versionPinned,latest:n.versionLatest}});s.replaceChildren(...a.options.map(l=>Object.assign(document.createElement("option"),{value:l.value,textContent:l.label}))),s.value=a.value},r=()=>{Yx().then(i,o=>console.warn(o))};return s.addEventListener("pointerenter",r,{once:!0}),s.addEventListener("focus",r,{once:!0}),s.addEventListener("change",()=>Zx(s.value===""?null:s.value)),i(null),s};class Bd extends Hb{}const sw=()=>{customElements.get("dpk-page")||customElements.define("dpk-page",Bd)};export{Z as $,oi as A,Ea as B,D as C,ba as D,Rt as E,da as F,un as G,Re as H,gn as I,$s as J,Ur as K,_ as L,ei as M,hn as N,pt as O,Nd as P,Od as Q,Ux as R,Cx as S,Or as T,en as U,as as V,Js as W,od as X,Bd as Y,co as Z,Ne as _,sw as a,Tf as a$,ue as a0,Bn as a1,ut as a2,Rf as a3,P as a4,b as a5,np as a6,X as a7,jt as a8,ui as a9,or as aA,pf as aB,mf as aC,ff as aD,Ma as aE,Cf as aF,Po as aG,at as aH,cf as aI,po as aJ,Qu as aK,iv as aL,om as aM,Aa as aN,Md as aO,ar as aP,af as aQ,qa as aR,An as aS,Ht as aT,In as aU,mi as aV,ir as aW,rr as aX,ad as aY,_a as aZ,ft as a_,Xa as aa,Ql as ab,ro as ac,Za as ad,Wa as ae,Go as af,m as ag,fi as ah,Gn as ai,Ft as aj,cn as ak,Fe as al,xf as am,vf as an,ws as ao,Zu as ap,td as aq,bi as ar,Mn as as,Xo as at,To as au,En as av,Bt as aw,Pa as ax,w as ay,sr as az,Ws as b,Ia as b0,Na as b1,ol as b2,sv as b3,lr as b4,dr as b5,Dr as b6,Br as c,wv as d,zn as e,Qo as f,Dt as g,aa as h,ai as i,pn as j,wp as k,ys as l,ti as m,rt as n,la as o,Qe as p,gf as q,hf as r,Xx as s,ot as t,Nn as u,ge as v,Ra as w,Ta as x,Oa as y,ri as z};