dev-process-kit 0.3.0-beta.3 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -8
- package/dist/boards.js +1 -1
- package/dist/chunks/{shared-BzKZc8e7.js → shared-2OsWmhrI.js} +1 -1
- package/dist/chunks/{shared-CO-HhC8m.js → shared-B57TT0rn.js} +1 -1
- package/dist/chunks/{shared-CXefnQqJ.js → shared-B8ZhyjWv.js} +140 -137
- package/dist/chunks/{shared-D9js0mlL.js → shared-BXywwm1a.js} +740 -366
- package/dist/chunks/shared-Be43xweD.js +43 -0
- package/dist/chunks/{shared-CJnwvCXE.js → shared-C0M3Ib7z.js} +1 -1
- package/dist/chunks/{shared-BYr9ZouD.js → shared-C89fKgKG.js} +98 -94
- package/dist/chunks/{shared-D6X_HEJN.js → shared-CF2_VP2x.js} +1 -1
- package/dist/chunks/{shared-DXPlz1s4.js → shared-CeCpFPDQ.js} +1 -1
- package/dist/chunks/{shared-BhUEVKpO.js → shared-DIEJ9E2G.js} +1 -1
- package/dist/chunks/shared-DJtGS7Ct.js +1598 -0
- package/dist/chunks/{shared-DEco37gW.js → shared-Dd8JfvQe.js} +1 -1
- package/dist/chunks/{shared-NkccEMPc.js → shared-Dn92ukYW.js} +1 -1
- package/dist/chunks/{shared-BYcLqnFV.js → shared-Dql0ZVdC.js} +1 -1
- package/dist/chunks/shared-LHG2FbnK.js +1 -0
- package/dist/chunks/{shared-naTB_LaU.js → shared-egtdNQhY.js} +264 -281
- package/dist/chunks/{shared-BLzPmv14.js → shared-ubG0-RQ-.js} +1 -1
- package/dist/components.js +1 -1
- package/dist/index.js +1 -1
- package/dist/views/delegation-poker.js +1 -1
- package/dist/views/plain.js +1 -1
- package/dist/views/prototype.js +1 -1
- package/dist/views/slides.js +1 -1
- package/dist/views/task-board.js +1 -1
- package/dist/views/usm.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/shared-Bt5HGgX9.js +0 -1636
- package/dist/chunks/shared-DIHtcDps.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const Xi=[["path",{d:"M12 5v14"}],["path",{d:"m19 12-7 7-7-7"}]],Fd=[["path",{d:"M8 3 4 7l4 4"}],["path",{d:"M4 7h16"}],["path",{d:"m16 21 4-4-4-4"}],["path",{d:"M20 17H4"}]],Ji=[["path",{d:"m12 19-7-7 7-7"}],["path",{d:"M19 12H5"}]],Gd=[["path",{d:"m16 3 4 4-4 4"}],["path",{d:"M20 7H4"}],["path",{d:"m8 21-4-4 4-4"}],["path",{d:"M4 17h16"}]],er=[["path",{d:"M5 12h14"}],["path",{d:"m12 5 7 7-7 7"}]],tr=[["path",{d:"m5 12 7-7 7 7"}],["path",{d:"M12 19V5"}]],Wd=[["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"}]],Kd=[["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"}]],Vd=[["path",{d:"M20 6 9 17l-5-5"}]],nr=[["path",{d:"m6 9 6 6 6-6"}]],Yd=[["path",{d:"m15 18-6-6 6-6"}]],Zd=[["path",{d:"m9 18 6-6-6-6"}]],Qd=[["circle",{cx:"12",cy:"12",r:"1"}],["circle",{cx:"12",cy:"12",r:"10"}]],sr=[["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"}]],Xd=[["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"}]],Jd=[["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"}]],ec=[["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"}]],ir=[["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"}]],tc=[["path",{d:"M15 6a9 9 0 0 0-9 9V3"}],["circle",{cx:"18",cy:"6",r:"3"}],["circle",{cx:"6",cy:"18",r:"3"}]],nc=[["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"}]],sc=[["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"}]],ic=[["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"}]],rc=[["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"}]],rr=[["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"}]],oc=[["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"}]],ac=[["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"}]],or=[["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"}]],lc=[["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"}]],dc=[["path",{d:"M15 3h6v6"}],["path",{d:"m21 3-7 7"}],["path",{d:"m3 21 7-7"}],["path",{d:"M9 21H3v-6"}]],cc=[["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"}]],pc=[["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"}]],hc=[["path",{d:"m14 10 7-7"}],["path",{d:"M20 10h-6V4"}],["path",{d:"m3 21 7-7"}],["path",{d:"M4 14h6v6"}]],uc=[["path",{d:"M5 12h14"}]],gc=[["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"}]],fc=[["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"}]],kc=[["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"}]],bc=[["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"}]],vc=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]],xc=[["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"}]],yc=[["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"}]],wc=[["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"}]],Sc=[["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"}]],Ac=[["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"}]],Ec=[["path",{d:"M3 9h18"}],["path",{d:"M9 3v18"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}]],Cc=[["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"}]],Tc=[["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"}]],Rc=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]],_c=[["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,ps=sn.ShadowRoot&&(sn.ShadyCSS===void 0||sn.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,hs=Symbol(),ar=new WeakMap;let lr=class{constructor(e,n,s){if(this._$cssResult$=!0,s!==hs)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(ps&&e===void 0){const s=n!==void 0&&n.length===1;s&&(e=ar.get(n)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),s&&ar.set(n,e))}return e}toString(){return this.cssText}};const rn=t=>new lr(typeof t=="string"?t:t+"",void 0,hs),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 lr(n,t,hs)},Mc=(t,e)=>{if(ps)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)}},dr=ps?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let n="";for(const s of e.cssRules)n+=s.cssText;return rn(n)})(t):t,{is:Oc,defineProperty:Pc,getOwnPropertyDescriptor:Lc,getOwnPropertyNames:zc,getOwnPropertySymbols:Dc,getPrototypeOf:Ic}=Object,on=globalThis,cr=on.trustedTypes,Nc=cr?cr.emptyScript:"",qc=on.reactiveElementPolyfillSupport,Et=(t,e)=>t,us={toAttribute(t,e){switch(e){case Boolean:t=t?Nc: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}},pr=(t,e)=>!Oc(t,e),hr={attribute:!0,type:String,converter:us,reflect:!1,useDefault:!1,hasChanged:pr};Symbol.metadata??=Symbol("metadata"),on.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=hr){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&&Pc(this.prototype,e,i)}}static getPropertyDescriptor(e,n,s){const{get:i,set:r}=Lc(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)??hr}static _$Ei(){if(this.hasOwnProperty(Et("elementProperties")))return;const e=Ic(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=[...zc(n),...Dc(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(dr(i))}else e!==void 0&&n.push(dr(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 Mc(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:us).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:us;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??pr)(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,qc?.({ReactiveElement:Xe}),(on.reactiveElementVersions??=[]).push("2.1.2");const gs=globalThis,ur=t=>t,an=gs.trustedTypes,gr=an?an.createPolicy("lit-html",{createHTML:t=>t}):void 0,fr="$lit$",ve=`lit$${Math.random().toFixed(9).slice(2)}$`,mr="?"+ve,Uc=`<${mr}>`,Re=document,Ct=()=>Re.createComment(""),Tt=t=>t===null||typeof t!="object"&&typeof t!="function",fs=Array.isArray,Hc=t=>fs(t)||typeof t?.[Symbol.iterator]=="function",ms=`[
|
|
2
|
-
\f\r]`,Rt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,kr=/-->/g,br=/>/g,_e=RegExp(`>|${
|
|
3
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),vr=/'/g,xr=/"/g,yr=/^(?:script|style|textarea|title)$/i,wr=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),k=wr(1),jc=wr(2),Y=Symbol.for("lit-noChange"),b=Symbol.for("lit-nothing"),$r=new WeakMap,Me=Re.createTreeWalker(Re,129);function Sr(t,e){if(!
|
|
1
|
+
const Xi=[["path",{d:"M12 5v14"}],["path",{d:"m19 12-7 7-7-7"}]],Fd=[["path",{d:"M8 3 4 7l4 4"}],["path",{d:"M4 7h16"}],["path",{d:"m16 21 4-4-4-4"}],["path",{d:"M20 17H4"}]],Ji=[["path",{d:"m12 19-7-7 7-7"}],["path",{d:"M19 12H5"}]],Gd=[["path",{d:"m16 3 4 4-4 4"}],["path",{d:"M20 7H4"}],["path",{d:"m8 21-4-4 4-4"}],["path",{d:"M4 17h16"}]],er=[["path",{d:"M5 12h14"}],["path",{d:"m12 5 7 7-7 7"}]],tr=[["path",{d:"m5 12 7-7 7 7"}],["path",{d:"M12 19V5"}]],Wd=[["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"}]],Kd=[["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"}]],Vd=[["path",{d:"M20 6 9 17l-5-5"}]],nr=[["path",{d:"m6 9 6 6 6-6"}]],Yd=[["path",{d:"m15 18-6-6 6-6"}]],Zd=[["path",{d:"m9 18 6-6-6-6"}]],Qd=[["circle",{cx:"12",cy:"12",r:"1"}],["circle",{cx:"12",cy:"12",r:"10"}]],sr=[["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"}]],Xd=[["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"}]],Jd=[["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"}]],ec=[["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"}]],ir=[["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"}]],tc=[["path",{d:"M15 6a9 9 0 0 0-9 9V3"}],["circle",{cx:"18",cy:"6",r:"3"}],["circle",{cx:"6",cy:"18",r:"3"}]],nc=[["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"}]],sc=[["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"}]],ic=[["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"}]],rc=[["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"}]],rr=[["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"}]],oc=[["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"}]],ac=[["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"}]],or=[["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"}]],lc=[["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"}]],dc=[["path",{d:"M15 3h6v6"}],["path",{d:"m21 3-7 7"}],["path",{d:"m3 21 7-7"}],["path",{d:"M9 21H3v-6"}]],cc=[["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"}]],pc=[["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"}]],hc=[["path",{d:"m14 10 7-7"}],["path",{d:"M20 10h-6V4"}],["path",{d:"m3 21 7-7"}],["path",{d:"M4 14h6v6"}]],uc=[["path",{d:"M5 12h14"}]],gc=[["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"}]],fc=[["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"}]],kc=[["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"}]],bc=[["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"}]],vc=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]],xc=[["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"}]],yc=[["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"}]],wc=[["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"}]],Sc=[["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"}]],Ac=[["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"}]],Ec=[["path",{d:"M3 9h18"}],["path",{d:"M9 3v18"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}]],Cc=[["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"}]],Tc=[["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"}]],Rc=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]],_c=[["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(),ar=new WeakMap;let lr=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=ar.get(n)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),s&&ar.set(n,e))}return e}toString(){return this.cssText}};const rn=t=>new lr(typeof t=="string"?t:t+"",void 0,us),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 lr(n,t,us)},Mc=(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)}},dr=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:Oc,defineProperty:Pc,getOwnPropertyDescriptor:Lc,getOwnPropertyNames:zc,getOwnPropertySymbols:Dc,getPrototypeOf:Ic}=Object,on=globalThis,cr=on.trustedTypes,Nc=cr?cr.emptyScript:"",qc=on.reactiveElementPolyfillSupport,Et=(t,e)=>t,gs={toAttribute(t,e){switch(e){case Boolean:t=t?Nc: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}},pr=(t,e)=>!Oc(t,e),hr={attribute:!0,type:String,converter:gs,reflect:!1,useDefault:!1,hasChanged:pr};Symbol.metadata??=Symbol("metadata"),on.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=hr){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&&Pc(this.prototype,e,i)}}static getPropertyDescriptor(e,n,s){const{get:i,set:r}=Lc(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)??hr}static _$Ei(){if(this.hasOwnProperty(Et("elementProperties")))return;const e=Ic(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=[...zc(n),...Dc(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(dr(i))}else e!==void 0&&n.push(dr(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 Mc(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??pr)(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,qc?.({ReactiveElement:Xe}),(on.reactiveElementVersions??=[]).push("2.1.2");const fs=globalThis,ur=t=>t,an=fs.trustedTypes,gr=an?an.createPolicy("lit-html",{createHTML:t=>t}):void 0,fr="$lit$",ve=`lit$${Math.random().toFixed(9).slice(2)}$`,mr="?"+ve,Uc=`<${mr}>`,Re=document,Ct=()=>Re.createComment(""),Tt=t=>t===null||typeof t!="object"&&typeof t!="function",ms=Array.isArray,Hc=t=>ms(t)||typeof t?.[Symbol.iterator]=="function",ks=`[
|
|
2
|
+
\f\r]`,Rt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,kr=/-->/g,br=/>/g,_e=RegExp(`>|${ks}(?:([^\\s"'>=/]+)(${ks}*=${ks}*(?:[^
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),vr=/'/g,xr=/"/g,yr=/^(?:script|style|textarea|title)$/i,wr=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),k=wr(1),jc=wr(2),Y=Symbol.for("lit-noChange"),b=Symbol.for("lit-nothing"),$r=new WeakMap,Me=Re.createTreeWalker(Re,129);function Sr(t,e){if(!ms(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return gr!==void 0?gr.createHTML(e):e}const Bc=(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=kr:d[1]!==void 0?o=br:d[2]!==void 0?(yr.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]==='"'?xr:vr):o===xr||o===vr?o=_e:o===kr||o===br?o=Rt:(o=_e,i=void 0);const p=o===_e&&t[a+1].startsWith("/>")?" ":"";r+=o===Rt?l+Uc:h>=0?(s.push(c),l.slice(0,h)+fr+l.slice(h)+ve+p):l+ve+(h===-2?a:p)}return[Sr(t,r+(t[n]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),s]};let bs=class Hd{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]=Bc(e,n);if(this.el=Hd.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(fr)){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]==="."?Gc:g[1]==="?"?Wc:g[1]==="@"?Kc:dn}),i.removeAttribute(h)}else h.startsWith(ve)&&(l.push({type:6,index:r}),i.removeAttribute(h));if(yr.test(i.tagName)){const h=i.textContent.split(ve),f=h.length-1;if(f>0){i.textContent=an?an.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===mr)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===Y)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 Fc=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 ln(r,r.nextSibling,this,e):l.type===1?c=new l.ctor(r,l.name,l.strings,this,e):l.type===6&&(c=new Vc(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++}},ln=class jd{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!==Y&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Hc(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=bs.createElement(Sr(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(n);else{const r=new Fc(i,this),o=r.u(this.options);r.p(n),this.T(o),this._$AH=r}}_$AC(e){let n=$r.get(e.strings);return n===void 0&&$r.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 jd(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=ur(e).nextSibling;ur(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=Je(this,e,n,0),o=!Tt(e)||e!==this._$AH&&e!==Y,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===Y&&(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 Gc=class extends dn{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===b?void 0:e}},Wc=class extends dn{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==b)}},Kc=class extends dn{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)===Y)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 Vc{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 Yc={I:ln},Zc=fs.litHtmlPolyfillSupport;Zc?.(bs,ln),(fs.litHtmlVersions??=[]).push("3.3.3");const Ar=(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(Ct(),r),r,void 0,n??{})}return i._$AI(t),i},vs=globalThis;let J=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=Ar(n,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Y}};J._$litElement$=!0,J.finalized=!0,vs.litElementHydrateSupport?.({LitElement:J});const Qc=vs.litElementPolyfillSupport;Qc?.({LitElement:J}),(vs.litElementVersions??=[]).push("4.2.2");const Er=(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")),Cr=()=>{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.#t)}hostDisconnected(){document.removeEventListener("pointerdown",this.#n,!0),document.removeEventListener("keydown",this.#t)}#n=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 Tr=z`
|
|
4
4
|
.dpk-context-menu {
|
|
5
5
|
min-width: 180px;
|
|
6
6
|
}
|
|
@@ -218,10 +218,10 @@ const Xi=[["path",{d:"M12 5v14"}],["path",{d:"m19 12-7 7-7-7"}]],Fd=[["path",{d:
|
|
|
218
218
|
.dpk-dialog-footer[hidden] {
|
|
219
219
|
display: none;
|
|
220
220
|
}
|
|
221
|
-
`,Xc={lang:void 0,message:void 0,abortEarly:void 0,abortPipeEarly:void 0};function xs(t){return Xc}let Jc;function ep(t){return Jc?.get(t)}let tp;function np(t){return tp?.get(t)}let sp;function ip(t,e){return sp?.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??ip(t.reference,l.lang)??(c?np(l.lang):null)??s.message??ep(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 rp(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function op(t,e){return Object.prototype.hasOwnProperty.call(t,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function ys(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},xs())},t}function ap(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 lp=class extends Error{constructor(t){super(t[0].message),this.name="ValiError",this.issues=t}};const dp=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])$/u,cp=/^\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 _r(t,e){return{kind:"validation",type:"check",reference:_r,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 Mr(t){return{kind:"validation",type:"finite",reference:Mr,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 Or(t,e){const n=et(t);return{kind:"validation",type:"includes",reference:Or,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 Pr(t){return{kind:"validation",type:"integer",reference:Pr,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 Lr(t){return{kind:"validation",type:"iso_date",reference:Lr,async:!1,expects:null,requirement:dp,message:t,"~run"(e,n){return e.typed&&!this.requirement.test(e.value)&&T(this,"date",e,n),e}}}function zr(t){return{kind:"validation",type:"iso_timestamp",reference:zr,async:!1,expects:null,requirement:cp,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 Dr(t,e){return{kind:"validation",type:"min_value",reference:Dr,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 ee(t,e){return{kind:"validation",type:"regex",reference:ee,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 pn(){return{kind:"transformation",type:"trim",reference:pn,async:!1,"~run"(t){return t.value=t.value.trim(),t}}}function Ir(t){return{kind:"validation",type:"url",reference:Ir,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 Nr={abortEarly:!0};function ws(t,e,n){return typeof t.fallback=="function"?t.fallback(e,n):t.fallback}function pp(t,e){return D({...t,fallback:e,"~run"(n,s){const i=t["~run"](n,s);return i.issues?{typed:!0,value:ws(this,i,s)}:i}})}function hn(t,e,n){return typeof t.default=="function"?t.default(e,n):t.default}function hp(t,e){return!t["~run"]({value:e},Nr).issues}function qr(){return D({kind:"schema",type:"any",reference:qr,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 un(t){return D({kind:"schema",type:"boolean",reference:un,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 Ur(t){return D({kind:"schema",type:"lazy",reference:Ur,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 rp(n.value,this.literal)?n.typed=!0:T(this,"type",n,s),n}})}function $s(t){return D({kind:"schema",type:"null",reference:$s,expects:"null",async:!1,message:t,"~run"(e,n){return e.value===null?e.typed=!0:T(this,"type",e,n),e}})}function Hr(t,e){return D({kind:"schema",type:"nullable",reference:Hr,expects:`(${t.expects} | null)`,async:!1,wrapped:t,default:e,"~run"(n,s){return n.value===null&&(this.default!==void 0&&(n.value=hn(this,n,s)),n.value===null)?(n.typed=!0,n):this.wrapped["~run"](n,s)}})}function jr(t){return D({kind:"schema",type:"number",reference:jr,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]:hn(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]=ws(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=hn(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:ys(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(op(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]:hn(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]=ws(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 Br(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 gn(t,e){return D({kind:"schema",type:"union",reference:gn,expects:ys(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:Br(r)}),n.typed=!0}else{if(o?.length===1)return o[0];T(this,"type",n,s,{issues:Br(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 fn(t,e,n){return D({kind:"schema",type:"variant",reference:fn,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]},Nr).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:ys(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},xs());if(s.issues)throw new lp(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},xs());return{typed:s.typed,success:!s.issues,output:s.value,issues:s.issues}}function up(t){let e="";for(const n of t){e&&(e+=`
|
|
221
|
+
`,Xc={lang:void 0,message:void 0,abortEarly:void 0,abortPipeEarly:void 0};function ys(t){return Xc}let Jc;function ep(t){return Jc?.get(t)}let tp;function np(t){return tp?.get(t)}let sp;function ip(t,e){return sp?.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??ip(t.reference,l.lang)??(c?np(l.lang):null)??s.message??ep(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 rp(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function op(t,e){return Object.prototype.hasOwnProperty.call(t,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function ws(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},ys())},t}function ap(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 lp=class extends Error{constructor(t){super(t[0].message),this.name="ValiError",this.issues=t}};const dp=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])$/u,cp=/^\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 _r(t,e){return{kind:"validation",type:"check",reference:_r,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 Mr(t){return{kind:"validation",type:"finite",reference:Mr,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 Or(t,e){const n=et(t);return{kind:"validation",type:"includes",reference:Or,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 Pr(t){return{kind:"validation",type:"integer",reference:Pr,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 Lr(t){return{kind:"validation",type:"iso_date",reference:Lr,async:!1,expects:null,requirement:dp,message:t,"~run"(e,n){return e.typed&&!this.requirement.test(e.value)&&T(this,"date",e,n),e}}}function zr(t){return{kind:"validation",type:"iso_timestamp",reference:zr,async:!1,expects:null,requirement:cp,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 Dr(t,e){return{kind:"validation",type:"min_value",reference:Dr,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 ee(t,e){return{kind:"validation",type:"regex",reference:ee,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 pn(){return{kind:"transformation",type:"trim",reference:pn,async:!1,"~run"(t){return t.value=t.value.trim(),t}}}function Ir(t){return{kind:"validation",type:"url",reference:Ir,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 Nr={abortEarly:!0};function $s(t,e,n){return typeof t.fallback=="function"?t.fallback(e,n):t.fallback}function pp(t,e){return D({...t,fallback:e,"~run"(n,s){const i=t["~run"](n,s);return i.issues?{typed:!0,value:$s(this,i,s)}:i}})}function hn(t,e,n){return typeof t.default=="function"?t.default(e,n):t.default}function hp(t,e){return!t["~run"]({value:e},Nr).issues}function qr(){return D({kind:"schema",type:"any",reference:qr,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 un(t){return D({kind:"schema",type:"boolean",reference:un,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 Ur(t){return D({kind:"schema",type:"lazy",reference:Ur,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 rp(n.value,this.literal)?n.typed=!0:T(this,"type",n,s),n}})}function Ss(t){return D({kind:"schema",type:"null",reference:Ss,expects:"null",async:!1,message:t,"~run"(e,n){return e.value===null?e.typed=!0:T(this,"type",e,n),e}})}function Hr(t,e){return D({kind:"schema",type:"nullable",reference:Hr,expects:`(${t.expects} | null)`,async:!1,wrapped:t,default:e,"~run"(n,s){return n.value===null&&(this.default!==void 0&&(n.value=hn(this,n,s)),n.value===null)?(n.typed=!0,n):this.wrapped["~run"](n,s)}})}function jr(t){return D({kind:"schema",type:"number",reference:jr,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]:hn(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]=$s(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=hn(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:ws(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(op(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]:hn(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]=$s(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 Br(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 gn(t,e){return D({kind:"schema",type:"union",reference:gn,expects:ws(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:Br(r)}),n.typed=!0}else{if(o?.length===1)return o[0];T(this,"type",n,s,{issues:Br(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 fn(t,e,n){return D({kind:"schema",type:"variant",reference:fn,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]},Nr).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:ws(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},ys());if(s.issues)throw new lp(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},ys());return{typed:s.typed,success:!s.issues,output:s.value,issues:s.issues}}function up(t){let e="";for(const n of t){e&&(e+=`
|
|
222
222
|
`),e+=`\xD7 ${n.message}`;const s=ap(n);s&&(e+=`
|
|
223
|
-
\u2192 at ${s}`)}return e}const Fr=(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),Gr=(t,e,n)=>{const s=Math.min(n,e/4);return{top:t+s,bottom:t+e-s}},Ss=(t,e,n=0)=>{const s=t.getBoundingClientRect();t.scrollTop=Fr(t.scrollTop,Gr(s.top+t.clientTop,t.clientHeight,n),e.getBoundingClientRect())},Wr=(t,e,n=0)=>{const s=t.getBoundingClientRect(),i=e.getBoundingClientRect();t.scrollLeft=Fr(t.scrollLeft,Gr(s.left+t.clientLeft,t.clientWidth,n),{top:i.left,bottom:i.right})},gp=16,fp=(t,e)=>{const n=t.deltaMode===1?gp:t.deltaMode===2?e:1;return{dx:t.deltaX*n,dy:t.deltaY*n}},mp=(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}=fp(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)},mn=R({type:w(v(),S(1)),id:w(v(),S(1))}),As=w(v(),S(1),ee(/^[A-Za-z0-9_-]+$/,'ids may only contain letters, digits, "_" and "-" (a "." builds a path)')),kp=(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:mn,payload:xe(),note:B(v()),createdAt:w(v(),S(1))}),kn=(t,e,n,s={})=>{const i=R({id:w(v(),S(1)),type:G(t),target:mn,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},bp=(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,vp=t=>{throw new Error(`unhandled action: ${JSON.stringify(t)}`)},xp=R({id:w(v(),S(1))}),yp=t=>{const e=C(xp,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)}},bn=(t,e)=>typeof t=="string"?Le(t.includes(":")?t:`${e}:${t}`):{type:t.type,id:t.id},wp=(t,e)=>t.type===e.type&&t.id===e.id,Kr=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=Kr(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)}`},Vr=()=>{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"}},Yr=R({type:w(v(),S(1)),target:gn([w(v(),S(1)),mn]),payload:N(xe()),note:B(v()),id:B(w(v(),S(1))),createdAt:B(w(v(),S(1)))}),Sp=(t,e)=>{const n=C(Yr,t);if(!n.success)return{ok:!1,issue:ze(n.issues)};const s=n.output,i=bn(s.target,e.targetType),r={id:s.id??Vr(),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)}},Es=(t,e)=>e.dedupeKey?e.dedupeKey(t):e.mode!=="patch"?null:`${t.type}|${P(t.target)}`,Zr=(t,e,n)=>{const s=Es(e,n);if(s===null)return[...t,e];const i=t.at(-1);return!i||i.type!==e.type||Es(i,n)!==s||!Ap(i,e)?[...t,e]:[...t.slice(0,-1),e]},Ap=(t,e)=>wp(t.target,e.target),Cs=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({}),vn=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}`},xn=(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},Qr="data-dpk-changes",Ep=/^[^:\s]+:\S+$/,Cp=L({id:N(w(v(),S(1))),title:w(v(),S(1)),body:N(v()),target:N(w(v(),ee(Ep,'target must be written "type:id"'))),navigate:N(w(v(),Or("=",'navigate must be written "key=value"')))}),Tp=U(Cp),Rp=w(v(),S(1)),Xr=L({revision:Rp,changes:Tp}),_p=L({revisions:w(U(Xr),S(1,"list at least one version"))}),Mp=(t,e)=>JSON.stringify([t,e]),st=t=>[...t.earlier,t.latest],Op=t=>{const e=t.changes.map((s,i)=>{const r=s.id??String(i);return{key:Mp(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}},Pp=t=>{const e=typeof t=="object"&&t!==null&&"revisions"in t,n=C(e?_p:Xr,t);if(!n.success)return{ok:!1,error:up(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=Op(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"}},Lp=L({v:G(1),revision:v(),seen:U(v())}),zp=L({v:G(2),since:v(),seen:Oe(v(),U(v()))}),Jr=t=>{const e=C(zp,t);if(e.success)return e.output;const n=C(Lp,t);return n.success?{v:2,since:n.output.revision,seen:{[n.output.revision]:n.output.seen}}:null},Ts={open:!1,fresh:new Set},eo=t=>e=>t.told.has(e.revision)&&!t.seen.has(e.key),Rs=(t,e)=>st(t).flatMap(n=>n.entries.filter(eo(e))),to=t=>t.target!==null||t.navigate!==null,Dp=(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:Ts}},_s=(t,e)=>new Set([...t.seen,...e]),Ip=(t,e,n)=>{switch(n.kind){case"open-list":{const s=Rs(t,e),i=new Set(s.map(o=>o.key)),r=s.filter(o=>!to(o)).map(o=>o.key);return{...e,seen:_s(e,r),toasts:[],list:{open:!0,fresh:i}}}case"close-list":return{...e,list:Ts};case"close-toast":return{...e,toasts:e.toasts.filter(s=>s!==n.key)};case"jump":return{...e,seen:_s(e,[n.key]),toasts:e.toasts.filter(s=>s!==n.key),list:Ts};case"read-all":return{...e,seen:_s(e,Rs(t,e).map(s=>s.key)),toasts:[],list:{open:e.list.open,fresh:new Set}}}},Np=(t,e)=>Rs(t,e).length,qp=(t,e)=>{const n=st(t),s=n.findIndex(o=>e.told.has(o.revision)&&o.entries.some(eo(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)}},Up=(t,e)=>t.target===null&&t.navigate===null?null:{navigate:t.navigate!==null?vn(t.navigate):t.target!==null?e(Le(t.target)):null,target:t.target},no=3,Hp=t=>e=>({key:e.key,id:e.id,revision:e.revision,title:e.title,body:e.body,jumpable:to(e),fresh:t.list.fresh.has(e.key)}),jp=(t,e)=>{const n=st(t).map(r=>({revision:r.revision,latest:r===t.latest,cards:r.entries.map(Hp(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:Np(t,e),open:e.list.open,groups:n,toasts:i.slice(0,no),waiting:Math.max(0,i.length-no)}},Bp=L({revision:gn([v(),$s()])}),Fp=L({v:G(1),enabled:un(),checked:Oe(v(),Bp)}),Ms={v:1,enabled:!1,checked:{}},so=t=>{const e=C(Fp,t);return e.success?e.output:null},Gp=(t,e)=>e?{...t,enabled:!0}:{...Ms,enabled:!1},Wp=t=>t===null?null:t.latest.revision,io=(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"},Kp=t=>Object.keys(t.checked).length>0,Vp=(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,ro=t=>t.authored??t.environment,oo=t=>t.preference??ro(t),Yp=t=>{const e=oo(t)==="dark"?"light":"dark";return ao(t,e)},ao=(t,e)=>e===ro(t)?null:e,Os="element",lo=w(v(),ee(/^[A-Z][A-Z0-9_]*$/,"component action types are CONSTANT_CASE")),co=Oe(v(),xe()),Zp=R({type:G(Os),id:w(v(),ee(/^[^/]+\/.+/,"component references start with a provider id"))}),Qp=R({id:w(v(),S(1)),type:lo,target:Zp,payload:co,note:B(v()),createdAt:w(v(),S(1))}),Xp={schema:Qp,mode:"sequence",targetType:Os},Jp=L({type:lo,target:w(v(),ee(/^element:[^/]+\/.+/)),payload:N(co,{})}),po=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"]))}),Ps=t=>{if(t.type!==Os)return null;const e=t.id.indexOf("/");if(e<=0)return null;try{return decodeURIComponent(t.id.slice(0,e))}catch{return null}},ie=t=>t.type!==H&&Ps(t.target)!==null,ho=(t,e)=>t.filter(n=>ie(n)&&Ps(n.target)===e),uo=(t,e)=>{const n=new Map(t.flatMap(s=>ie(s)?[[s.id,Ps(s.target)]]:[]));return new Map(e.flatMap(s=>s.results.flatMap(i=>n.get(i.id)===s.id?[[i.id,i]]:[])))},go=U(L({value:w(v(),ee(/^element:.+/)),label:w(v(),S(1)),group:B(v())})),eh=R({targets:go,providers:U(R({id:w(v(),S(1)),results:U(po)}))}),th=L({target:w(v(),ee(/^element:.+/)),body:w(v(),pn(),S(1))}),fo=t=>t.group?`${t.group} \xB7 ${t.label}`:t.label,mo=(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(ie(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?fo(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:fo(l)}},serialize:i=>ie(i)?`${i.type} ${P(i.target)} ${JSON.stringify(i.payload)}`:t.serialize(i)}};let nh=0;class ko{#e;#s=`dpk-confirm-dialog-${++nh}`;#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.#
|
|
223
|
+
\u2192 at ${s}`)}return e}const Fr=(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),Gr=(t,e,n)=>{const s=Math.min(n,e/4);return{top:t+s,bottom:t+e-s}},As=(t,e,n=0)=>{const s=t.getBoundingClientRect();t.scrollTop=Fr(t.scrollTop,Gr(s.top+t.clientTop,t.clientHeight,n),e.getBoundingClientRect())},Wr=(t,e,n=0)=>{const s=t.getBoundingClientRect(),i=e.getBoundingClientRect();t.scrollLeft=Fr(t.scrollLeft,Gr(s.left+t.clientLeft,t.clientWidth,n),{top:i.left,bottom:i.right})},gp=16,fp=(t,e)=>{const n=t.deltaMode===1?gp:t.deltaMode===2?e:1;return{dx:t.deltaX*n,dy:t.deltaY*n}},mp=(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}=fp(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)},mn=R({type:w(v(),S(1)),id:w(v(),S(1))}),Es=w(v(),S(1),ee(/^[A-Za-z0-9_-]+$/,'ids may only contain letters, digits, "_" and "-" (a "." builds a path)')),kp=(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:mn,payload:xe(),note:B(v()),createdAt:w(v(),S(1))}),kn=(t,e,n,s={})=>{const i=R({id:w(v(),S(1)),type:G(t),target:mn,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},bp=(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,vp=t=>{throw new Error(`unhandled action: ${JSON.stringify(t)}`)},xp=R({id:w(v(),S(1))}),yp=t=>{const e=C(xp,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)}},bn=(t,e)=>typeof t=="string"?Le(t.includes(":")?t:`${e}:${t}`):{type:t.type,id:t.id},wp=(t,e)=>t.type===e.type&&t.id===e.id,Kr=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=Kr(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)}`},Vr=()=>{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"}},Yr=R({type:w(v(),S(1)),target:gn([w(v(),S(1)),mn]),payload:N(xe()),note:B(v()),id:B(w(v(),S(1))),createdAt:B(w(v(),S(1)))}),Sp=(t,e)=>{const n=C(Yr,t);if(!n.success)return{ok:!1,issue:ze(n.issues)};const s=n.output,i=bn(s.target,e.targetType),r={id:s.id??Vr(),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)}},Cs=(t,e)=>e.dedupeKey?e.dedupeKey(t):e.mode!=="patch"?null:`${t.type}|${P(t.target)}`,Zr=(t,e,n)=>{const s=Cs(e,n);if(s===null)return[...t,e];const i=t.at(-1);return!i||i.type!==e.type||Cs(i,n)!==s||!Ap(i,e)?[...t,e]:[...t.slice(0,-1),e]},Ap=(t,e)=>wp(t.target,e.target),Ts=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({}),vn=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}`},xn=(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},Qr="data-dpk-changes",Ep=/^[^:\s]+:\S+$/,Cp=L({id:N(w(v(),S(1))),title:w(v(),S(1)),body:N(v()),target:N(w(v(),ee(Ep,'target must be written "type:id"'))),navigate:N(w(v(),Or("=",'navigate must be written "key=value"')))}),Tp=U(Cp),Rp=w(v(),S(1)),Xr=L({revision:Rp,changes:Tp}),_p=L({revisions:w(U(Xr),S(1,"list at least one version"))}),Mp=(t,e)=>JSON.stringify([t,e]),st=t=>[...t.earlier,t.latest],Op=t=>{const e=t.changes.map((s,i)=>{const r=s.id??String(i);return{key:Mp(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}},Pp=t=>{const e=typeof t=="object"&&t!==null&&"revisions"in t,n=C(e?_p:Xr,t);if(!n.success)return{ok:!1,error:up(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=Op(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"}},Lp=L({v:G(1),revision:v(),seen:U(v())}),zp=L({v:G(2),since:v(),seen:Oe(v(),U(v()))}),Jr=t=>{const e=C(zp,t);if(e.success)return e.output;const n=C(Lp,t);return n.success?{v:2,since:n.output.revision,seen:{[n.output.revision]:n.output.seen}}:null},Rs={open:!1,fresh:new Set},eo=t=>e=>t.told.has(e.revision)&&!t.seen.has(e.key),_s=(t,e)=>st(t).flatMap(n=>n.entries.filter(eo(e))),to=t=>t.target!==null||t.navigate!==null,Dp=(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:Rs}},Ms=(t,e)=>new Set([...t.seen,...e]),Ip=(t,e,n)=>{switch(n.kind){case"open-list":{const s=_s(t,e),i=new Set(s.map(o=>o.key)),r=s.filter(o=>!to(o)).map(o=>o.key);return{...e,seen:Ms(e,r),toasts:[],list:{open:!0,fresh:i}}}case"close-list":return{...e,list:Rs};case"close-toast":return{...e,toasts:e.toasts.filter(s=>s!==n.key)};case"jump":return{...e,seen:Ms(e,[n.key]),toasts:e.toasts.filter(s=>s!==n.key),list:Rs};case"read-all":return{...e,seen:Ms(e,_s(t,e).map(s=>s.key)),toasts:[],list:{open:e.list.open,fresh:new Set}}}},Np=(t,e)=>_s(t,e).length,qp=(t,e)=>{const n=st(t),s=n.findIndex(o=>e.told.has(o.revision)&&o.entries.some(eo(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)}},Up=(t,e)=>t.target===null&&t.navigate===null?null:{navigate:t.navigate!==null?vn(t.navigate):t.target!==null?e(Le(t.target)):null,target:t.target},no=3,Hp=t=>e=>({key:e.key,id:e.id,revision:e.revision,title:e.title,body:e.body,jumpable:to(e),fresh:t.list.fresh.has(e.key)}),jp=(t,e)=>{const n=st(t).map(r=>({revision:r.revision,latest:r===t.latest,cards:r.entries.map(Hp(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:Np(t,e),open:e.list.open,groups:n,toasts:i.slice(0,no),waiting:Math.max(0,i.length-no)}},Bp=L({revision:gn([v(),Ss()])}),Fp=L({v:G(1),enabled:un(),checked:Oe(v(),Bp)}),Os={v:1,enabled:!1,checked:{}},so=t=>{const e=C(Fp,t);return e.success?e.output:null},Gp=(t,e)=>e?{...t,enabled:!0}:{...Os,enabled:!1},Wp=t=>t===null?null:t.latest.revision,io=(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"},Kp=t=>Object.keys(t.checked).length>0,Vp=(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,ro=t=>t.authored??t.environment,oo=t=>t.preference??ro(t),Yp=t=>{const e=oo(t)==="dark"?"light":"dark";return ao(t,e)},ao=(t,e)=>e===ro(t)?null:e,Ps="element",lo=w(v(),ee(/^[A-Z][A-Z0-9_]*$/,"component action types are CONSTANT_CASE")),co=Oe(v(),xe()),Zp=R({type:G(Ps),id:w(v(),ee(/^[^/]+\/.+/,"component references start with a provider id"))}),Qp=R({id:w(v(),S(1)),type:lo,target:Zp,payload:co,note:B(v()),createdAt:w(v(),S(1))}),Xp={schema:Qp,mode:"sequence",targetType:Ps},Jp=L({type:lo,target:w(v(),ee(/^element:[^/]+\/.+/)),payload:N(co,{})}),po=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"]))}),Ls=t=>{if(t.type!==Ps)return null;const e=t.id.indexOf("/");if(e<=0)return null;try{return decodeURIComponent(t.id.slice(0,e))}catch{return null}},ie=t=>t.type!==H&&Ls(t.target)!==null,ho=(t,e)=>t.filter(n=>ie(n)&&Ls(n.target)===e),uo=(t,e)=>{const n=new Map(t.flatMap(s=>ie(s)?[[s.id,Ls(s.target)]]:[]));return new Map(e.flatMap(s=>s.results.flatMap(i=>n.get(i.id)===s.id?[[i.id,i]]:[])))},go=U(L({value:w(v(),ee(/^element:.+/)),label:w(v(),S(1)),group:B(v())})),eh=R({targets:go,providers:U(R({id:w(v(),S(1)),results:U(po)}))}),th=L({target:w(v(),ee(/^element:.+/)),body:w(v(),pn(),S(1))}),fo=t=>t.group?`${t.group} \xB7 ${t.label}`:t.label,mo=(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(ie(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?fo(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:fo(l)}},serialize:i=>ie(i)?`${i.type} ${P(i.target)} ${JSON.stringify(i.payload)}`:t.serialize(i)}};let nh=0;class ko{#e;#n=`dpk-confirm-dialog-${++nh}`;#t=null;#s=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.#s=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.#n} @close=${this.#o}>
|
|
225
225
|
<form method="dialog" class="dpk-confirm-dialog-body">
|
|
226
226
|
<h2 class="dpk-confirm-dialog-title">${e}</h2>
|
|
227
227
|
${n?k`<p class="dpk-confirm-dialog-text">${n}</p>`:b}
|
|
@@ -237,7 +237,7 @@ const Xi=[["path",{d:"M12 5v14"}],["path",{d:"m19 12-7 7-7-7"}]],Fd=[["path",{d:
|
|
|
237
237
|
</div>
|
|
238
238
|
</form>
|
|
239
239
|
</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,ce=Math.max,yn=Math.round,wn=Math.floor,pe=t=>({x:t,y:t}),sh={left:"right",right:"left",bottom:"top",top:"bottom"};function ih(t,e,n){return ce(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 bo(t){return t==="x"?"y":"x"}function vo(t){return t==="y"?"height":"width"}function he(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function xo(t){return bo(he(t))}function rh(t,e,n){n===void 0&&(n=!1);const s=zt(t),i=xo(t),r=vo(i);let o=i==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(o=$n(o)),[o,$n(o)]}function oh(t){const e=$n(t);return[Ls(t),e,Ls(e)]}function Ls(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const yo=["left","right"],wo=["right","left"],ah=["top","bottom"],lh=["bottom","top"];function dh(t,e,n){switch(t){case"top":case"bottom":return n?e?wo:yo:e?yo:wo;case"left":case"right":return e?ah:lh;default:return[]}}function ch(t,e,n,s){const i=zt(t);let r=dh(Ie(t),n==="start",s);return i&&(r=r.map(o=>o+"-"+i),e&&(r=r.concat(r.map(Ls)))),r}function $n(t){const e=Ie(t);return sh[e]+t.slice(e.length)}function ph(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 hh(t){return typeof t!="number"?ph(t):{top:t,right:t,bottom:t,left:t}}function Sn(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 $o(t,e,n){let{reference:s,floating:i}=t;const r=he(e),o=xo(e),a=vo(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 uh(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=hh(p),m=a[f?h==="floating"?"reference":"floating":h],x=Sn(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=Sn(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 gh=50,fh=async(t,e,n)=>{const{placement:s="bottom",strategy:i="absolute",middleware:r=[],platform:o}=n,a=o.detectOverflow?o:{...o,detectOverflow:uh},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}=$o(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<gh&&(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}=$o(c,f,l)),u=-1)}return{x:d,y:h,placement:f,strategy:i,middlewareData:g}},mh=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),$=he(a),E=Ie(a)===a,M=await(l.isRTL==null?void 0:l.isRTL(c.floating)),F=f||(E||!u?[$n(a)]:oh(a)),I=g!=="none";!f&&I&&F.push(...ch(a,u,g,M));const V=[a,...F],j=await l.detectOverflow(e,m),de=[];let se=((s=r.flip)==null?void 0:s.overflows)||[];if(d&&de.push(j[x]),h){const Ce=rh(i,o,M);de.push(j[Ce[0]],j[Ce[1]])}if(se=[...se,{placement:i,overflows:de}],!de.every(Ce=>Ce<=0)){var Yi,Zi;const Ce=(((Yi=r.flip)==null?void 0:Yi.index)||0)+1,cs=V[Ce];if(cs&&(!(h==="alignment"?$!==he(cs):!1)||se.every(X=>he(X.placement)===$?X.overflows[0]>0:!0)))return{data:{index:Ce,overflows:se},reset:{placement:cs}};let At=(Zi=se.filter(Te=>Te.overflows[0]<=0).sort((Te,X)=>Te.overflows[1]-X.overflows[1])[0])==null?void 0:Zi.placement;if(!At)switch(p){case"bestFit":{var Qi;const Te=(Qi=se.filter(X=>{if(I){const be=he(X.placement);return be===$||be==="y"}return!0}).map(X=>[X.placement,X.overflows.filter(be=>be>0).reduce((be,Bd)=>be+Bd,0)]).sort((X,be)=>X[1]-be[1])[0])==null?void 0:Qi[0];Te&&(At=Te);break}case"initialPlacement":At=a;break}if(i!==At)return{reset:{placement:At}}}return{}}}},kh=new Set(["left","top"]);async function bh(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=he(n)==="y",c=kh.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 vh=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 bh(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}}}}},xh=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=he(i),p=bo(f);let g=d[p],u=d[f];const m=($,E)=>ih(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}}}}}},yh=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=he(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=$,V=E;M!=null&&M.enabled.x&&(V=x),M!=null&&M.enabled.y&&(I=m),F&&!d&&(h?V=f-2*ce(l.left,l.right):I=p-2*ce(l.top,l.bottom)),await o({...e,availableWidth:V,availableHeight:I});const j=await i.getDimensions(r.floating);return f!==j.width||p!==j.height?{reset:{rects:!0}}:{}}}};function An(){return typeof window<"u"}function rt(t){return So(t)?(t.nodeName||"").toLowerCase():"#document"}function W(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function ue(t){var e;return(e=(So(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function So(t){return An()?t instanceof Node||t instanceof W(t).Node:!1}function re(t){return An()?t instanceof Element||t instanceof W(t).Element:!1}function ye(t){return An()?t instanceof HTMLElement||t instanceof W(t).HTMLElement:!1}function Ao(t){return!An()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof W(t).ShadowRoot}function En(t){const{overflow:e,overflowX:n,overflowY:s,display:i}=oe(t);return/auto|scroll|overlay|hidden|clip/.test(e+s+n)&&i!=="inline"&&i!=="contents"}function wh(t){return/^(table|td|th)$/.test(rt(t))}function Cn(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/,Sh=/paint|layout|strict|content/,Ne=t=>!!t&&t!=="none";let zs;function Ds(t){const e=re(t)?oe(t):t;return Ne(e.transform)||Ne(e.translate)||Ne(e.scale)||Ne(e.rotate)||Ne(e.perspective)||!Is()&&(Ne(e.backdropFilter)||Ne(e.filter))||$h.test(e.willChange||"")||Sh.test(e.contain||"")}function Ah(t){let e=qe(t);for(;ye(e)&&!Dt(e);){if(Ds(e))return e;if(Cn(e))return null;e=qe(e)}return null}function Is(){return zs==null&&(zs=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),zs}function Dt(t){return/^(html|body|#document)$/.test(rt(t))}function oe(t){return W(t).getComputedStyle(t)}function Tn(t){return re(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||Ao(t)&&t.host||ue(t);return Ao(e)?e.host:e}function Eo(t){const e=qe(t);return Dt(e)?(t.ownerDocument||t).body:ye(e)&&En(e)?e:Eo(e)}function It(t,e,n){var s;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Eo(t),r=i===((s=t.ownerDocument)==null?void 0:s.body),o=W(i);if(r){const a=Ns(o);return e.concat(o,o.visualViewport||[],En(i)?i:[],a&&n?It(a):[])}else return e.concat(i,It(i,[],n))}function Ns(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Co(t){const e=oe(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=yn(n)!==r||yn(s)!==o;return a&&(n=r,s=o),{width:n,height:s,$:a}}function qs(t){return re(t)?t:t.contextElement}function ot(t){const e=qs(t);if(!ye(e))return pe(1);const n=e.getBoundingClientRect(),{width:s,height:i,$:r}=Co(e);let o=(r?yn(n.width):n.width)/s,a=(r?yn(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const Eh=pe(0);function To(t){const e=W(t);return!Is()||!e.visualViewport?Eh:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Ch(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=qs(t);let o=pe(1);e&&(s?re(s)&&(o=ot(s)):o=ot(t));const a=Ch(r,n,s)?To(r):pe(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=re(s)?W(s):s;let g=f,u=Ns(g);for(;u&&p!==g;){const m=ot(u),x=u.getBoundingClientRect(),$=oe(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=Ns(g)}}return Sn({width:d,height:h,x:l,y:c})}function Rn(t,e){const n=Tn(t).scrollLeft;return e?e.left+n:Ue(ue(t)).left+n}function Ro(t,e){const n=t.getBoundingClientRect(),s=n.left+e.scrollLeft-Rn(t,n),i=n.top+e.scrollTop;return{x:s,y:i}}function Th(t){let{elements:e,rect:n,offsetParent:s,strategy:i}=t;const r=i==="fixed",o=ue(s),a=e?Cn(e.floating):!1;if(s===o||a&&r)return n;let l={scrollLeft:0,scrollTop:0},c=pe(1);const d=pe(0),h=ye(s);if((h||!r)&&((rt(s)!=="body"||En(o))&&(l=Tn(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?Ro(o,l):pe(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 Rh(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function _h(t){const e=Tn(t),n=t.ownerDocument.body,s=ce(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=ce(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let r=-e.scrollLeft+Rn(t);const o=-e.scrollTop;return oe(n).direction==="rtl"&&(r+=ce(t.clientWidth,n.clientWidth)-s),{width:s,height:i,x:r,y:o}}const Mh=25;function Oh(t,e,n){n===void 0&&(n="viewport");const s=n==="layoutViewport",i=W(t),r=ue(t),o=i.visualViewport;let a=r.clientWidth,l=r.clientHeight,c=0,d=0;if(o){const f=!Is()||e==="fixed";s?f||(c=-o.offsetLeft,d=-o.offsetTop):(a=o.width,l=o.height,f&&(c=o.offsetLeft,d=o.offsetTop))}if(Rn(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<=Mh&&(a-=x)}return{width:a,height:l,x:c,y:d}}function Ph(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 _o(t,e,n){let s;if(e==="viewport"||e==="layoutViewport")s=Oh(t,n,e);else if(e==="document")s=_h(ue(t));else if(re(e))s=Ph(e,n);else{const i=To(t);s={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Sn(s)}function Lh(t,e){const n=e.get(t);if(n)return n;let s=It(t,[],!1).filter(a=>re(a)&&rt(a)!=="body"),i=null;const r=oe(t).position==="fixed";let o=r?qe(t):t;for(;re(o)&&!Dt(o);){const a=oe(o),l=Ds(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 zh(t){let{element:e,boundary:n,rootBoundary:s,strategy:i}=t;const o=[...n==="clippingAncestors"?Cn(e)?[]:Lh(e,this._c):[].concat(n),s],a=_o(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=_o(e,o[f],i);l=ce(p.top,l),c=it(p.right,c),d=it(p.bottom,d),h=ce(p.left,h)}return{width:c-h,height:d-l,x:h,y:l}}function Dh(t){const{width:e,height:n}=Co(t);return{width:e,height:n}}function Ih(t,e,n){const s=ye(e),i=ue(e),r=n==="fixed",o=Ue(t,!0,r,e);let a={scrollLeft:0,scrollTop:0};const l=pe(0);if((s||!r)&&((rt(e)!=="body"||En(i))&&(a=Tn(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=Rn(i));const c=i&&!s&&!r?Ro(i,a):pe(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 Us(t){return oe(t).position==="static"}function Mo(t,e){if(!ye(t)||oe(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return ue(t)===n&&(n=n.ownerDocument.body),n}function Oo(t,e){const n=W(t);if(Cn(t))return n;if(!ye(t)){let i=qe(t);for(;i&&!Dt(i);){if(re(i)&&!Us(i))return i;i=qe(i)}return n}let s=Mo(t,e);for(;s&&wh(s)&&Us(s);)s=Mo(s,e);return s&&Dt(s)&&Us(s)&&!Ds(s)?n:s||Ah(t)||n}const Nh=async function(t){const e=this.getOffsetParent||Oo,n=this.getDimensions,s=await n(t.floating);return{reference:Ih(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function qh(t){return oe(t).direction==="rtl"}const Uh={convertOffsetParentRelativeRectToViewportRelativeRect:Th,getDocumentElement:ue,getClippingRect:zh,getOffsetParent:Oo,getElementRects:Nh,getClientRects:Rh,getDimensions:Dh,getScale:ot,isElement:re,isRTL:qh};function Po(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Hh(t,e,n){let s=null,i;const r=ue(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=wn(g),$=wn(r.clientWidth-(p+u)),E=wn(r.clientHeight-(g+m)),M=wn(p),I={rootMargin:-x+"px "+-$+"px "+-E+"px "+-M+"px",threshold:ce(0,it(1,h))||1};let V=!0;function j(de){const se=de[0].intersectionRatio;if(!Po(f,t.getBoundingClientRect()))return a();if(se!==h){if(!V)return a();se?a(!1,se):i=setTimeout(()=>{a(!1,1e-7)},1e3)}V=!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 jh(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=qs(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?Hh(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&&!Po(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 Bh=vh,Fh=xh,Gh=mh,Wh=yh,Kh=(t,e,n)=>{const s=new Map,i=n??{},r={...Uh,...i.platform,_c:s};return fh(t,e,{...i,platform:r})},Lo=(t,e)=>({top:e,bottom:e,right:t}),Hs=(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=jh(o,t,()=>{const c=++r;Kh(o,t,{strategy:"fixed",placement:s.placement??"bottom-end",middleware:[Bh(8),Gh({padding:8,fallbackAxisSideDirection:"end",...s.boundary===void 0?{}:{boundary:s.boundary}}),Fh({padding:8,...s.boundary===void 0?{}:{boundary:s.boundary}}),Wh({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()}},_n=t=>{if(!(!t||typeof t.hidePopover!="function"))try{t.hidePopover()}catch{}},Mn=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()}},Vh=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:()=>{Mn(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}},js={open:!1,x:0,y:0,groups:[],openPath:[],activeId:null},Yh=(t,e,n)=>({open:n.some(s=>s.entries.length>0),x:t,y:e,groups:n,openPath:[],activeId:null}),Zh=t=>t.flatMap(e=>e.entries),Bs=(t,e)=>t.find(n=>n.id===e),Fs=(t,e)=>{let n=Zh(t);for(const s of e){const i=Bs(n,s);if(i===void 0||i.kind!=="submenu")return n;n=i.items}return n},zo=t=>t.filter(e=>!(e.kind==="item"&&e.disabled===!0)).map(e=>e.id),Do=(t,e)=>{const n=zo(Fs(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}},Io=(t,e)=>{const n=Bs(Fs(t.groups,t.openPath),e);if(n===void 0||n.kind!=="submenu")return t;const s=zo(n.items)[0]??null;return{...t,openPath:[...t.openPath,e],activeId:s}},No=t=>t.activeId===null?t:Io(t,t.activeId),Qh=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}},Xh=t=>{const e=Bs(Fs(t.groups,t.openPath),t.activeId??"");return e===void 0?{state:t,run:null}:e.kind==="submenu"?{state:No(t),run:null}:e.disabled===!0?{state:t,run:null}:{state:js,run:e.run}},Gs=(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},qo=(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",Jh=2800,Uo=48,eu=t=>t.getClientRects().length>0,tu=(t,e)=>{const n=Gs(t,`[${at}]`).filter(r=>(r.getAttribute(at)??"").split(/\s+/).includes(e)),s=Gs(t,"[data-dpk-comment]").filter(r=>r.getAttribute("data-dpk-comment")===e),i=[...n,...s];return i.find(eu)??i[0]??null},Ho=(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},nu=(t,e)=>{for(const n of qo(e,t))Ho(n,"y")&&Ss(n,e,Uo),Ho(n,"x")&&Wr(n,e,Uo)},jo="color-mix(in srgb, var(--dpk-accent) 45%, transparent)",He={outline:"2px solid var(--dpk-accent)",outlineOffset:"3px"},Bo={outline:"2px solid transparent",outlineOffset:"3px"},su=t=>t?[{...He},{...He,offset:.85},{...Bo}]:[{...He,boxShadow:`0 0 0 0 ${jo}`},{...He,boxShadow:"0 0 0 14px transparent",offset:.3},{...He,boxShadow:`0 0 0 0 ${jo}`,offset:.31},{...He,boxShadow:"0 0 0 14px transparent",offset:.6},{...He,offset:.85},{...Bo}],Nt={filter:"drop-shadow(0 0 3px var(--dpk-accent)) drop-shadow(0 0 3px var(--dpk-accent))"},On={filter:"drop-shadow(0 0 3px transparent) drop-shadow(0 0 3px transparent)"},iu=t=>t?[{...Nt},{...Nt,offset:.85},{...On}]:[{...Nt},{...On,offset:.3},{...Nt,offset:.31},{...On,offset:.6},{...Nt,offset:.61},{...On}],ru=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?iu(e):su(e),{duration:Jh,easing:"ease-out"})},ou=t=>typeof t=="object"&&t!==null&&"getContextMenuItems"in t&&typeof t.getContextMenuItems=="function",au=(t,e)=>{const n=[];for(const s of t){if(!ou(s))continue;const i=s.getContextMenuItems(e);i!==null&&n.push(...i)}return n},lu=t=>{for(const e of t)if(e instanceof Element)return e;return null},du=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},cu=(t,e)=>{for(const n of t)if(n instanceof Element&&typeof Reflect.get(n,e)=="function")return n;return null},pu=t=>{for(const e of t)if(e instanceof Element&&(e.hasAttribute(at)||e.hasAttribute("data-dpk-comment")))return e;return null},Fo="dpk-context-menu",Go=(t,e)=>`dpk-settings-option dpk-context-menu-option${e?" is-active":""}${t.kind==="item"&&t.danger===!0?" is-danger":""}`,Wo=(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">
|
|
240
|
+
`}#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.#s;this.#s=null,this.#t=null,this.#i=!1,this.#e.requestUpdate(),n?.(e)}}const it=Math.min,pe=Math.max,yn=Math.round,wn=Math.floor,he=t=>({x:t,y:t}),sh={left:"right",right:"left",bottom:"top",top:"bottom"};function ih(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 bo(t){return t==="x"?"y":"x"}function vo(t){return t==="y"?"height":"width"}function ue(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function xo(t){return bo(ue(t))}function rh(t,e,n){n===void 0&&(n=!1);const s=zt(t),i=xo(t),r=vo(i);let o=i==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(o=$n(o)),[o,$n(o)]}function oh(t){const e=$n(t);return[zs(t),e,zs(e)]}function zs(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const yo=["left","right"],wo=["right","left"],ah=["top","bottom"],lh=["bottom","top"];function dh(t,e,n){switch(t){case"top":case"bottom":return n?e?wo:yo:e?yo:wo;case"left":case"right":return e?ah:lh;default:return[]}}function ch(t,e,n,s){const i=zt(t);let r=dh(Ie(t),n==="start",s);return i&&(r=r.map(o=>o+"-"+i),e&&(r=r.concat(r.map(zs)))),r}function $n(t){const e=Ie(t);return sh[e]+t.slice(e.length)}function ph(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 hh(t){return typeof t!="number"?ph(t):{top:t,right:t,bottom:t,left:t}}function Sn(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 $o(t,e,n){let{reference:s,floating:i}=t;const r=ue(e),o=xo(e),a=vo(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 uh(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=hh(p),m=a[f?h==="floating"?"reference":"floating":h],x=Sn(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=Sn(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 gh=50,fh=async(t,e,n)=>{const{placement:s="bottom",strategy:i="absolute",middleware:r=[],platform:o}=n,a=o.detectOverflow?o:{...o,detectOverflow:uh},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}=$o(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<gh&&(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}=$o(c,f,l)),u=-1)}return{x:d,y:h,placement:f,strategy:i,middlewareData:g}},mh=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?[$n(a)]:oh(a)),I=g!=="none";!f&&I&&F.push(...ch(a,u,g,M));const V=[a,...F],j=await l.detectOverflow(e,m),ce=[];let se=((s=r.flip)==null?void 0:s.overflows)||[];if(d&&ce.push(j[x]),h){const Ce=rh(i,o,M);ce.push(j[Ce[0]],j[Ce[1]])}if(se=[...se,{placement:i,overflows:ce}],!ce.every(Ce=>Ce<=0)){var Yi,Zi;const Ce=(((Yi=r.flip)==null?void 0:Yi.index)||0)+1,ps=V[Ce];if(ps&&(!(h==="alignment"?$!==ue(ps):!1)||se.every(X=>ue(X.placement)===$?X.overflows[0]>0:!0)))return{data:{index:Ce,overflows:se},reset:{placement:ps}};let At=(Zi=se.filter(Te=>Te.overflows[0]<=0).sort((Te,X)=>Te.overflows[1]-X.overflows[1])[0])==null?void 0:Zi.placement;if(!At)switch(p){case"bestFit":{var Qi;const Te=(Qi=se.filter(X=>{if(I){const be=ue(X.placement);return be===$||be==="y"}return!0}).map(X=>[X.placement,X.overflows.filter(be=>be>0).reduce((be,Bd)=>be+Bd,0)]).sort((X,be)=>X[1]-be[1])[0])==null?void 0:Qi[0];Te&&(At=Te);break}case"initialPlacement":At=a;break}if(i!==At)return{reset:{placement:At}}}return{}}}},kh=new Set(["left","top"]);async function bh(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=kh.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 vh=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 bh(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}}}}},xh=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=bo(f);let g=d[p],u=d[f];const m=($,E)=>ih(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}}}}}},yh=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=$,V=E;M!=null&&M.enabled.x&&(V=x),M!=null&&M.enabled.y&&(I=m),F&&!d&&(h?V=f-2*pe(l.left,l.right):I=p-2*pe(l.top,l.bottom)),await o({...e,availableWidth:V,availableHeight:I});const j=await i.getDimensions(r.floating);return f!==j.width||p!==j.height?{reset:{rects:!0}}:{}}}};function An(){return typeof window<"u"}function rt(t){return So(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=(So(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function So(t){return An()?t instanceof Node||t instanceof W(t).Node:!1}function re(t){return An()?t instanceof Element||t instanceof W(t).Element:!1}function ye(t){return An()?t instanceof HTMLElement||t instanceof W(t).HTMLElement:!1}function Ao(t){return!An()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof W(t).ShadowRoot}function En(t){const{overflow:e,overflowX:n,overflowY:s,display:i}=oe(t);return/auto|scroll|overlay|hidden|clip/.test(e+s+n)&&i!=="inline"&&i!=="contents"}function wh(t){return/^(table|td|th)$/.test(rt(t))}function Cn(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/,Sh=/paint|layout|strict|content/,Ne=t=>!!t&&t!=="none";let Ds;function Is(t){const e=re(t)?oe(t):t;return Ne(e.transform)||Ne(e.translate)||Ne(e.scale)||Ne(e.rotate)||Ne(e.perspective)||!Ns()&&(Ne(e.backdropFilter)||Ne(e.filter))||$h.test(e.willChange||"")||Sh.test(e.contain||"")}function Ah(t){let e=qe(t);for(;ye(e)&&!Dt(e);){if(Is(e))return e;if(Cn(e))return null;e=qe(e)}return null}function Ns(){return Ds==null&&(Ds=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ds}function Dt(t){return/^(html|body|#document)$/.test(rt(t))}function oe(t){return W(t).getComputedStyle(t)}function Tn(t){return re(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||Ao(t)&&t.host||ge(t);return Ao(e)?e.host:e}function Eo(t){const e=qe(t);return Dt(e)?(t.ownerDocument||t).body:ye(e)&&En(e)?e:Eo(e)}function It(t,e,n){var s;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Eo(t),r=i===((s=t.ownerDocument)==null?void 0:s.body),o=W(i);if(r){const a=qs(o);return e.concat(o,o.visualViewport||[],En(i)?i:[],a&&n?It(a):[])}else return e.concat(i,It(i,[],n))}function qs(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Co(t){const e=oe(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=yn(n)!==r||yn(s)!==o;return a&&(n=r,s=o),{width:n,height:s,$:a}}function Us(t){return re(t)?t:t.contextElement}function ot(t){const e=Us(t);if(!ye(e))return he(1);const n=e.getBoundingClientRect(),{width:s,height:i,$:r}=Co(e);let o=(r?yn(n.width):n.width)/s,a=(r?yn(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const Eh=he(0);function To(t){const e=W(t);return!Ns()||!e.visualViewport?Eh:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Ch(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=Us(t);let o=he(1);e&&(s?re(s)&&(o=ot(s)):o=ot(t));const a=Ch(r,n,s)?To(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=re(s)?W(s):s;let g=f,u=qs(g);for(;u&&p!==g;){const m=ot(u),x=u.getBoundingClientRect(),$=oe(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=qs(g)}}return Sn({width:d,height:h,x:l,y:c})}function Rn(t,e){const n=Tn(t).scrollLeft;return e?e.left+n:Ue(ge(t)).left+n}function Ro(t,e){const n=t.getBoundingClientRect(),s=n.left+e.scrollLeft-Rn(t,n),i=n.top+e.scrollTop;return{x:s,y:i}}function Th(t){let{elements:e,rect:n,offsetParent:s,strategy:i}=t;const r=i==="fixed",o=ge(s),a=e?Cn(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"||En(o))&&(l=Tn(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?Ro(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 Rh(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function _h(t){const e=Tn(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+Rn(t);const o=-e.scrollTop;return oe(n).direction==="rtl"&&(r+=pe(t.clientWidth,n.clientWidth)-s),{width:s,height:i,x:r,y:o}}const Mh=25;function Oh(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=!Ns()||e==="fixed";s?f||(c=-o.offsetLeft,d=-o.offsetTop):(a=o.width,l=o.height,f&&(c=o.offsetLeft,d=o.offsetTop))}if(Rn(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<=Mh&&(a-=x)}return{width:a,height:l,x:c,y:d}}function Ph(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 _o(t,e,n){let s;if(e==="viewport"||e==="layoutViewport")s=Oh(t,n,e);else if(e==="document")s=_h(ge(t));else if(re(e))s=Ph(e,n);else{const i=To(t);s={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Sn(s)}function Lh(t,e){const n=e.get(t);if(n)return n;let s=It(t,[],!1).filter(a=>re(a)&&rt(a)!=="body"),i=null;const r=oe(t).position==="fixed";let o=r?qe(t):t;for(;re(o)&&!Dt(o);){const a=oe(o),l=Is(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 zh(t){let{element:e,boundary:n,rootBoundary:s,strategy:i}=t;const o=[...n==="clippingAncestors"?Cn(e)?[]:Lh(e,this._c):[].concat(n),s],a=_o(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=_o(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 Dh(t){const{width:e,height:n}=Co(t);return{width:e,height:n}}function Ih(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"||En(i))&&(a=Tn(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=Rn(i));const c=i&&!s&&!r?Ro(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 Hs(t){return oe(t).position==="static"}function Mo(t,e){if(!ye(t)||oe(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return ge(t)===n&&(n=n.ownerDocument.body),n}function Oo(t,e){const n=W(t);if(Cn(t))return n;if(!ye(t)){let i=qe(t);for(;i&&!Dt(i);){if(re(i)&&!Hs(i))return i;i=qe(i)}return n}let s=Mo(t,e);for(;s&&wh(s)&&Hs(s);)s=Mo(s,e);return s&&Dt(s)&&Hs(s)&&!Is(s)?n:s||Ah(t)||n}const Nh=async function(t){const e=this.getOffsetParent||Oo,n=this.getDimensions,s=await n(t.floating);return{reference:Ih(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function qh(t){return oe(t).direction==="rtl"}const Uh={convertOffsetParentRelativeRectToViewportRelativeRect:Th,getDocumentElement:ge,getClippingRect:zh,getOffsetParent:Oo,getElementRects:Nh,getClientRects:Rh,getDimensions:Dh,getScale:ot,isElement:re,isRTL:qh};function Po(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Hh(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=wn(g),$=wn(r.clientWidth-(p+u)),E=wn(r.clientHeight-(g+m)),M=wn(p),I={rootMargin:-x+"px "+-$+"px "+-E+"px "+-M+"px",threshold:pe(0,it(1,h))||1};let V=!0;function j(ce){const se=ce[0].intersectionRatio;if(!Po(f,t.getBoundingClientRect()))return a();if(se!==h){if(!V)return a();se?a(!1,se):i=setTimeout(()=>{a(!1,1e-7)},1e3)}V=!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 jh(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=Us(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?Hh(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&&!Po(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 Bh=vh,Fh=xh,Gh=mh,Wh=yh,Kh=(t,e,n)=>{const s=new Map,i=n??{},r={...Uh,...i.platform,_c:s};return fh(t,e,{...i,platform:r})},Lo=(t,e)=>({top:e,bottom:e,right:t}),js=(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=jh(o,t,()=>{const c=++r;Kh(o,t,{strategy:"fixed",placement:s.placement??"bottom-end",middleware:[Bh(8),Gh({padding:8,fallbackAxisSideDirection:"end",...s.boundary===void 0?{}:{boundary:s.boundary}}),Fh({padding:8,...s.boundary===void 0?{}:{boundary:s.boundary}}),Wh({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()}},_n=t=>{if(!(!t||typeof t.hidePopover!="function"))try{t.hidePopover()}catch{}},Mn=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()}},Vh=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:()=>{Mn(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}},Bs={open:!1,x:0,y:0,groups:[],openPath:[],activeId:null},Yh=(t,e,n)=>({open:n.some(s=>s.entries.length>0),x:t,y:e,groups:n,openPath:[],activeId:null}),Zh=t=>t.flatMap(e=>e.entries),Fs=(t,e)=>t.find(n=>n.id===e),Gs=(t,e)=>{let n=Zh(t);for(const s of e){const i=Fs(n,s);if(i===void 0||i.kind!=="submenu")return n;n=i.items}return n},zo=t=>t.filter(e=>!(e.kind==="item"&&e.disabled===!0)).map(e=>e.id),Do=(t,e)=>{const n=zo(Gs(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}},Io=(t,e)=>{const n=Fs(Gs(t.groups,t.openPath),e);if(n===void 0||n.kind!=="submenu")return t;const s=zo(n.items)[0]??null;return{...t,openPath:[...t.openPath,e],activeId:s}},No=t=>t.activeId===null?t:Io(t,t.activeId),Qh=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}},Xh=t=>{const e=Fs(Gs(t.groups,t.openPath),t.activeId??"");return e===void 0?{state:t,run:null}:e.kind==="submenu"?{state:No(t),run:null}:e.disabled===!0?{state:t,run:null}:{state:Bs,run:e.run}},Ws=(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},qo=(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",Jh=2800,Uo=48,eu=t=>t.getClientRects().length>0,tu=(t,e)=>{const n=Ws(t,`[${at}]`).filter(r=>(r.getAttribute(at)??"").split(/\s+/).includes(e)),s=Ws(t,"[data-dpk-comment]").filter(r=>r.getAttribute("data-dpk-comment")===e),i=[...n,...s];return i.find(eu)??i[0]??null},Ho=(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},nu=(t,e)=>{for(const n of qo(e,t))Ho(n,"y")&&As(n,e,Uo),Ho(n,"x")&&Wr(n,e,Uo)},jo="color-mix(in srgb, var(--dpk-accent) 45%, transparent)",He={outline:"2px solid var(--dpk-accent)",outlineOffset:"3px"},Bo={outline:"2px solid transparent",outlineOffset:"3px"},su=t=>t?[{...He},{...He,offset:.85},{...Bo}]:[{...He,boxShadow:`0 0 0 0 ${jo}`},{...He,boxShadow:"0 0 0 14px transparent",offset:.3},{...He,boxShadow:`0 0 0 0 ${jo}`,offset:.31},{...He,boxShadow:"0 0 0 14px transparent",offset:.6},{...He,offset:.85},{...Bo}],Nt={filter:"drop-shadow(0 0 3px var(--dpk-accent)) drop-shadow(0 0 3px var(--dpk-accent))"},On={filter:"drop-shadow(0 0 3px transparent) drop-shadow(0 0 3px transparent)"},iu=t=>t?[{...Nt},{...Nt,offset:.85},{...On}]:[{...Nt},{...On,offset:.3},{...Nt,offset:.31},{...On,offset:.6},{...Nt,offset:.61},{...On}],ru=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?iu(e):su(e),{duration:Jh,easing:"ease-out"})},ou=t=>typeof t=="object"&&t!==null&&"getContextMenuItems"in t&&typeof t.getContextMenuItems=="function",au=(t,e)=>{const n=[];for(const s of t){if(!ou(s))continue;const i=s.getContextMenuItems(e);i!==null&&n.push(...i)}return n},lu=t=>{for(const e of t)if(e instanceof Element)return e;return null},du=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},cu=(t,e)=>{for(const n of t)if(n instanceof Element&&typeof Reflect.get(n,e)=="function")return n;return null},pu=t=>{for(const e of t)if(e instanceof Element&&(e.hasAttribute(at)||e.hasAttribute("data-dpk-comment")))return e;return null},Fo="dpk-context-menu",Go=(t,e)=>`dpk-settings-option dpk-context-menu-option${e?" is-active":""}${t.kind==="item"&&t.danger===!0?" is-danger":""}`,Wo=(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">
|
|
241
241
|
<button
|
|
242
242
|
class=${Go(t,i)}
|
|
243
243
|
type="button"
|
|
@@ -271,19 +271,19 @@ const Xi=[["path",{d:"M12 5v14"}],["path",{d:"m19 12-7 7-7-7"}]],Fd=[["path",{d:
|
|
|
271
271
|
@keydown=${n.onKeyDown}
|
|
272
272
|
>
|
|
273
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=>Wo(o,0,t,n))}`)}
|
|
274
|
-
</div>`},uu={width:220,height:420},gu=t=>t.closest('input, textarea, [contenteditable=""], [contenteditable="true"]')!==null;class fu{#e;#s;#t;#n=js;#i=null;#r=null;#o=null;constructor(e,n){this.#e=e,this.#s=n,e.addController(this),new cn(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(Fo)??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?.(),_n(e),this.#o=Hs(e,Lo(this.#n.x,this.#n.y),uu,{placement:"right-start"}),this.#i=e,this.#r={x:this.#n.x,y:this.#n.y},e.focus())}render(){return hu(this.#n,this.#s.messages(),this.#t)}#a(){this.#i!==null&&(_n(this.#i),this.#o?.(),this.#o=null,this.#i=null,this.#r=null)}#l(){this.#n=js,this.#e.requestUpdate()}#d(e){this.#n={...this.#n,activeId:e},this.#e.requestUpdate()}#c(e){if(e.kind==="submenu"){this.#n=Io(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=Do(this.#n,1),this.#e.requestUpdate();return;case"ArrowUp":e.preventDefault(),this.#n=Do(this.#n,-1),this.#e.requestUpdate();return;case"ArrowRight":e.preventDefault(),this.#n=No(this.#n),this.#e.requestUpdate();return;case"ArrowLeft":e.preventDefault(),this.#n=Qh(this.#n),this.#e.requestUpdate();return;case"Enter":case" ":{e.preventDefault();const n=Xh(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=lu(n);if(s!==null&&gu(s))return;e.preventDefault();const i=du(n),r=au(n,{clientX:e.clientX,clientY:e.clientY,target:i,origin:s}),o=Vh({host:this.#e,state:this.#s.state(),target:i,targetElement:pu(n),resetViewElement:cu(n,"resetView"),messages:this.#s.messages()}),a=o===null?r:[...r,o];this.#n=Yh(e.clientX,e.clientY,a),this.#e.requestUpdate()}}const Pn=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},Ws=["en","ja"],Ko="en",Vo=t=>Ws.some(e=>e===t),Ln=t=>{const e=(t??"").split("-")[0]?.toLowerCase()??"";return Vo(e)?e:Ko},Yo=t=>Ln(Pn(t)),Ks="dpk-locale-change",Zo=t=>typeof t=="string"&&Vo(t)?t:null,mu=t=>t.preference??t.authored,ku=(t,e)=>t===e?null:t,je=t=>e=>e==="ja"?t.ja:t.en,Qo=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"}}),Xo=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function Jo(t){return typeof Xo.Buffer<"u"&&Xo.Buffer.isBuffer(t)}function ea(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 ta(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function na(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const bu="[object RegExp]",vu="[object String]",xu="[object Number]",yu="[object Boolean]",wu="[object Symbol]",$u="[object Date]",Su="[object Map]",Au="[object Set]",Eu="[object Array]",Cu="[object Function]",Tu="[object ArrayBuffer]",Vs="[object Object]",Ru="[object Error]",_u="[object DataView]",Mu="[object Uint8Array]",Ou="[object Uint8ClampedArray]",Pu="[object Uint16Array]",Lu="[object Uint32Array]",zu="[object BigUint64Array]",Du="[object Int8Array]",Iu="[object Int16Array]",Nu="[object Int32Array]",qu="[object BigInt64Array]",Uu="[object Float32Array]",Hu="[object Float64Array]";function ju(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function Bu(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=na(t),r=na(e);if(i==="[object Arguments]"&&(i=Vs),r==="[object Arguments]"&&(r=Vs),i!==r)return!1;switch(i){case vu:return t.toString()===e.toString();case xu:return ju(t.valueOf(),e.valueOf());case yu:case $u:case wu:return Object.is(t.valueOf(),e.valueOf());case bu:return t.source===e.source&&t.flags===e.flags;case Cu: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 Su: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 Au:{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 Eu:case Mu:case Ou:case Pu:case Lu:case zu:case Du:case Iu:case Nu:case qu:case Uu:case Hu:if(Jo(t)!==Jo(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 Tu:return t.byteLength!==e.byteLength?!1:Ut(new Uint8Array(t),new Uint8Array(e),n,s);case _u:return t.byteLength!==e.byteLength||t.byteOffset!==e.byteOffset?!1:Ut(new Uint8Array(t),new Uint8Array(e),n,s);case Ru:return t.name===e.name&&t.message===e.message;case Vs:{if(!(Ut(t.constructor,e.constructor,n,s)||ea(t)&&ea(e)))return!1;const l=[...Object.keys(t),...ta(t)],c=[...Object.keys(e),...ta(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 Fu(){}function zn(t,e){return Bu(t,e,Fu)}const sa=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))}),Ys={schema:sa,mode:"append",targetType:"page"},Gu=R({body:v()}),Ht=t=>{const e=C(Gu,t.payload);return e.success?e.output.body:""},Zs="data-dpk-grill",ae="grill",Dn="answer",jt="data-grill-questions",Wu=B(v()),ia=t=>{const e=t?.trim();return e===void 0||e===""?void 0:e},Ku=t=>{const e=ia(t);return e===void 0?{}:{questions:e}},lt={questions:[],rounds:[]},Vu=L({id:As,label:w(v(),S(1))}),ra=L({id:As,ref:N(w(v(),S(1))),title:w(v(),S(1)),description:N(v()),note:N(v()),options:N(U(Vu),[]),freeText:N(un(),!0)}),oa=fn("kind",[L({kind:G("option"),optionId:w(v(),S(1))}),L({kind:G("free"),text:v()})]),aa=fn("kind",[...oa.options,L({kind:G("clear")})]),Yu=L({...ra.entries,answer:N(oa)}),Zu=L({label:N(w(v(),S(1))),questions:U(Yu)}),Qu=L({questions:U(ra),history:N(U(Zu),[])}),la=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}})},da=t=>({id:t.id,ref:t.ref,title:t.title,description:t.description,note:t.note,options:t.options,freeText:t.freeText}),Xu=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{...da(t),answer:e}},Ju=t=>{const e=Mt(Qu,t);return{questions:la(e.questions).map(da),rounds:e.history.map((n,s)=>({label:n.label??`v${s+1}`,questions:la(n.questions).map(Xu)}))}},dt=(t,e)=>t.questions.find(n=>n.id===e),Qs=(t,e)=>{const n=dt(t,e);return n?`${n.ref} \xB7 ${n.title}`:e},In=(t,e)=>e?e.kind==="option"?t.options.find(n=>n.id===e.optionId)?.label??"":e.text.trim():"",Nn=(t,e)=>In(t,e)!=="",eg=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},ca=(t,e)=>({total:t.questions.length,answered:t.questions.filter(n=>Nn(n,e[n.id])).length}),tg=(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=>!Nn(o,e[o.id]))?.id??null},ng=w(v(),ee(/^[A-Za-z0-9_-]+(?:@[A-Za-z0-9_-]+)?$/,"a question id, optionally qualified by its board (`retry@scope`)")),sg=R({id:w(v(),S(1)),type:G(Dn),target:R({type:G(ae),id:ng}),payload:aa,note:B(v()),createdAt:w(v(),S(1))}),ig={schema:sg,mode:"patch",targetType:ae},Z=t=>t.type===Dn&&t.target.type===ae,rg=(t,e)=>({type:Dn,target:{type:ae,id:t},payload:e}),pa=t=>{const e=C(aa,t.payload);return e.success?e.output:null},og=(t,e)=>[...t.filter(n=>!(Z(n)&&n.target.id===e.target.id)),e],ha=(t,e,n)=>{const s=dt(t,n.target.id),i=pa(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}},ua="page",Xs="app",ga=t=>P(t),fa=(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(ie(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(Z(p)){const m=ha(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"&&Js(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===ua||p.target.type===Xs?t.pageTargetExists?.(r,p.target)??!0:t.hasTarget(r,p.target))){l.push({action:p,reason:"target-missing"});continue}d.push(p);const m=ga(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}},Js=(t,e,n)=>e===n?!0:t.canonicalState===void 0?zn(e,n):zn(t.canonicalState(e),t.canonicalState(n)),ma=t=>{const e=new Set(t.obsolete.map(n=>n.id));return t.actions.filter(n=>!e.has(n.id))},ag=(t,e,n,s)=>{let i=e;const r=s??ka(i).map(o=>o.id);for(const o of[...r].reverse())i=lg(t,i,n,o,s!==void 0)??i;return i},ka=t=>t.applied.filter(e=>!ie(e)&&!Z(e)),lg=(t,e,n,s,i)=>{const r=ka(e),o=r.findIndex(u=>u.id===s),a=r[o];if(a===void 0)return null;const l=r.slice(0,o),c=ei(t,a),d=!t.hasTarget(e.state,a.target)||/^(?:DELETE|REMOVE)_/.test(a.type),h=c==="sequence"||d,f=[...i&&h?dg(t,e.base,r,o):[],...h?cg(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=pg(t,e,n,u);if(m!==null)return m}return null},dg=(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)=>Js(t,o,r)?[n.slice(a,s+1).map(l=>l.id)]:[])},cg=(t,e,n)=>{const s=ba(n),i=e.filter(l=>ba(l).some(c=>s.includes(c))),r=ei(t,n),o=i.filter(l=>ei(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])]},ba=t=>{const n=t.target.type===ua||t.target.type===Xs?[]: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]},ei=(t,e)=>tt(t.actions,e.type)?.mode,pg=(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 Js(t,o.state,e.state)?o:null;if(a.some(l=>l.type===H||ie(l)||Z(l)))return null;for(const l of a)r.add(l.id)}},hg={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",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",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"}}),ug=(t,e,n)=>{const s=pa(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))}},gg=(t,e)=>{const{grill:n}=e,s=O(e.locale);return{...t,hasTarget:(i,r)=>r.type===ae?dt(n,r.id)!==void 0:t.hasTarget(i,r),commentTargets:(i,r)=>[...t.commentTargets(i,r),...n.questions.map(o=>({value:P({type:ae,id:o.id}),label:Qs(n,o.id),group:s.grillGroup}))],describe:(i,r,o)=>{const a=Qs(n,i.target.id);if(Z(i)){const{title:c,summary:d,tone:h}=ug(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===ae?{...l,targetLabel:a}:l},serialize:i=>Z(i)?`${i.type} ${P(i.target)} ${JSON.stringify(i.payload)}`:t.serialize(i)}},fg=R({v:G(1),template:w(v(),S(1)),actions:U(xe())});class ti{constructor(e){this.storage=e}load(e,n){try{const s=this.storage.getItem(e);if(s===null)return[];const i=C(fg,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 ni{constructor(){this.store=new Map}load(e,n){return new ti({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 si=()=>{try{if(typeof localStorage<"u")return new ti(localStorage)}catch{}return new ni},Bt=t=>`dev-process-kit:draft:${typeof location>"u"?"local":`${location.pathname}${location.search}`}:${t}`,va={redoStack:[]},mg=(t,e)=>{const n=t.at(-1);return n===void 0?null:{actions:t.slice(0,-1),state:{redoStack:[...e.redoStack,n]}}},kg=(t,e)=>{const n=e.redoStack.at(-1);return n===void 0?null:{actions:[...t,n],state:{redoStack:e.redoStack.slice(0,-1)}}},bg=()=>va,vg=t=>t.length>0,xg=t=>t.redoStack.length>0,yg=U(xe());class xa{#e;#s;#t={targets:[],providers:[]};#n;#i=new Map;#r;#o;#a;#l;#d;#c=new Set;#p=[];#h=0;#k=va;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?si():e.storage;const n=e.initialActions??this.#l?.load(this.#d,this.definition.name)??[];this.#o=$a(this.definition,n),this.#a=this.#b(this.#o),this.#w()&&this.#T()}get definition(){return this.#s}setComponentSnapshot(e){const n=Mt(eh,e);if(!zn(n,this.#t)){this.#t=n,this.#m(),this.#a=this.#b(this.#o);for(const s of this.#c)s()}}setTemplate(e){this.#e=e,this.#m(),this.#a=this.#b(this.#o);for(const n of this.#c)n()}setGrill(e){this.#n=e,this.#m(),this.#a=this.#b(this.#o);for(const n of this.#c)n()}#m(){this.#i=uo(this.#o,this.#t.providers),this.#s=this.#y()}#y(){return gg(mo(this.#e,this.#t.targets,this.#i),this.#n)}#b(e){return fa(this.definition,this.#r,e,uo(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 vg(this.#o)}get canRedo(){return xg(this.#k)}descriptorFor(e,n){return ya(this.definition,e,n)}dispatch(e){const n=this.#v(e,this.#a.state);if(!n.ok)return this.#u([n.issue]);const s=this.descriptorFor(n.action.type,n.action.target);return s?(this.#f(wa(this.#o,n.action,s),{dispatched:[n.action.id]}),{ok:!0,id:n.action.id}):this.#u([{path:"type",message:"unknown action type"}])}dispatchBatch(e){const n=C(yg,e);if(!n.success)return this.#u([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.#u([c.issue]);const d=c.action,h=this.descriptorFor(d.type,d.target);if(!h)return this.#u([{path:"type",message:"unknown action type"}]);if((Z(d)?ha(this.#n.grill,o,d)===null?null:r:d.type==="comment"||ie(d)?d.target.type==="page"||this.definition.hasTarget(r,d.target)?r:null:this.definition.apply(r,d))===null)return this.#u([{path:"target",message:"batch action is not applicable"}]);i=wa(i,d,h);const p=this.#b(i);r=p.state,o=p.answers,a.push(d.id)}return this.#f(i,{dispatched:a}),{ok:!0,ids:a}}#v(e,n){const s=C(Yr,e);if(!s.success)return{ok:!1,issue:ze(s.issues)};const i=this.descriptorFor(s.output.type,typeof s.output.target=="string"?bn(s.output.target,"page"):s.output.target);if(!i)return{ok:!1,issue:{path:"type",message:`unknown action type "${s.output.type}"`}};const r=Sp(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}}}#u(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.#u([{path:"id",message:`no comment "${e}" in the draft`}]);if(Ht(s)===n)return{ok:!0,id:e};const i=C(Ys.schema,{...s,payload:{body:n}});if(!i.success)return this.#u([ze(i.issues)]);const r=C(Pe,i.output);if(!r.success)return this.#u([ze(r.issues)]);const o=r.output;return this.#f(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.#f(n)}clearActions(){this.#o.length>0&&this.#f([])}replaceActions(e){this.#f($a(this.definition,e))}setBase(e){this.#r=e,this.#f(this.#o)}undo(){const e=mg(this.#o,this.#k);return e===null?!1:(this.#k=e.state,this.#f([...e.actions],{preserveRedo:!0}),!0)}redo(){const e=kg(this.#o,this.#k);return e===null?!1:(this.#k=e.state,this.#f([...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}}#f(e,n){this.#p=[],this.#o=e,this.#m(),this.#a=this.#b(this.#o),this.#w(n?.dispatched),n?.preserveRedo!==!0&&(this.#k=bg()),this.#T();for(const s of this.#c)s()}#w(e){const n=this.#$(),s=ag(this.definition,this.#a,i=>this.#b(i),e);return s===this.#a?n:(this.#h+=this.#o.length-s.actions.length,this.#o=[...s.actions],this.#m(),this.#a=this.#b(this.#o),this.#$(),!0)}#$(){return this.#a.obsolete.length===0?!1:(this.#h+=this.#a.obsolete.length,this.#o=ma(this.#a),this.#m(),this.#a=this.#b(this.#o),!0)}#T(){this.#l?.save(this.#d,this.definition.name,this.#o)}}const ya=(t,e,n)=>e==="comment"?Ys:e===Dn?ig:n!==void 0&&ie({type:e,target:n})?Xp:t.actionFor?t.actionFor(e,n):tt(t.actions,e),wa=(t,e,n)=>Z(e)?og(t,e):Zr(t,e,n),$a=(t,e)=>e.flatMap(n=>{const s=C(Pe,n);if(!s.success)return[];const i=s.output,r=ya(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]:[]}),wg='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},Sg=t=>{const e=t.querySelector("[autofocus]");if(e)return e;for(const n of t.querySelectorAll(wg))if(!(n.hidden||n.closest("[hidden]")!==null))return n;return null},Ag=t=>typeof t.showModal=="function",qn=t=>{const e=t.open;return typeof e=="boolean"?e:t.hasAttribute("open")},Eg=t=>{if(Ag(t)){t.showModal();return}t.setAttribute("open","")},Sa=t=>{if(typeof t.close=="function"){t.close();return}qn(t)&&(t.removeAttribute("open"),t.dispatchEvent(new Event("close")))},Cg="dpk-dialog-close";class Tg{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()){qn(e)||this.#r(e);return}qn(e)&&Sa(e)}}hostDisconnected(){document.removeEventListener("pointerdown",this.#i,!0);const e=this.#s.dialog();e!==null&&qn(e)&&Sa(e),this.#t=null}#i;dismiss(e="close"){this.#n=e,this.#s.dismiss(e)}#r(e){this.#n="close",this.#t=$g(),Eg(e);const n=Sg(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(Cg,{detail:{reason:e},bubbles:!0,composed:!0}))}}const Rg=(t,e="json")=>`\`\`\`${e}
|
|
274
|
+
</div>`},uu={width:220,height:420},gu=t=>t.closest('input, textarea, [contenteditable=""], [contenteditable="true"]')!==null;class fu{#e;#n;#t;#s=Bs;#i=null;#r=null;#o=null;constructor(e,n){this.#e=e,this.#n=n,e.addController(this),new cn(e,{open:()=>this.#s.open,closesOn:s=>this.#i===null||!s.includes(this.#i),ownsEscape:()=>this.#s.open,dismiss:()=>this.#l()}),this.#t={onHover:s=>this.#d(s),onInvoke:s=>this.#c(s),onKeyDown:s=>this.#h(s)}}hostConnected(){this.#e.addEventListener("contextmenu",this.#p)}hostDisconnected(){this.#e.removeEventListener("contextmenu",this.#p),this.#a()}hostUpdated(){const e=this.#e.shadowRoot?.getElementById(Fo)??null;if(!this.#s.open||e===null){this.#a();return}(this.#i!==e||this.#r===null||this.#r.x!==this.#s.x||this.#r.y!==this.#s.y)&&(this.#o?.(),_n(e),this.#o=js(e,Lo(this.#s.x,this.#s.y),uu,{placement:"right-start"}),this.#i=e,this.#r={x:this.#s.x,y:this.#s.y},e.focus())}render(){return hu(this.#s,this.#n.messages(),this.#t)}#a(){this.#i!==null&&(_n(this.#i),this.#o?.(),this.#o=null,this.#i=null,this.#r=null)}#l(){this.#s=Bs,this.#e.requestUpdate()}#d(e){this.#s={...this.#s,activeId:e},this.#e.requestUpdate()}#c(e){if(e.kind==="submenu"){this.#s=Io(this.#s,e.id),this.#e.requestUpdate();return}e.disabled!==!0&&(this.#l(),e.run())}#h=e=>{switch(e.key){case"ArrowDown":e.preventDefault(),this.#s=Do(this.#s,1),this.#e.requestUpdate();return;case"ArrowUp":e.preventDefault(),this.#s=Do(this.#s,-1),this.#e.requestUpdate();return;case"ArrowRight":e.preventDefault(),this.#s=No(this.#s),this.#e.requestUpdate();return;case"ArrowLeft":e.preventDefault(),this.#s=Qh(this.#s),this.#e.requestUpdate();return;case"Enter":case" ":{e.preventDefault();const n=Xh(this.#s);this.#s=n.state,this.#e.requestUpdate(),n.run?.();return}case"Escape":e.preventDefault(),this.#l();return;case"Tab":this.#l();return;default:return}};#p=e=>{if(e.defaultPrevented||e.shiftKey)return;const n=e.composedPath(),s=lu(n);if(s!==null&&gu(s))return;e.preventDefault();const i=du(n),r=au(n,{clientX:e.clientX,clientY:e.clientY,target:i,origin:s}),o=Vh({host:this.#e,state:this.#n.state(),target:i,targetElement:pu(n),resetViewElement:cu(n,"resetView"),messages:this.#n.messages()}),a=o===null?r:[...r,o];this.#s=Yh(e.clientX,e.clientY,a),this.#e.requestUpdate()}}const Pn=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},Ks=["en","ja"],Ko="en",Vo=t=>Ks.some(e=>e===t),Ln=t=>{const e=(t??"").split("-")[0]?.toLowerCase()??"";return Vo(e)?e:Ko},Yo=t=>Ln(Pn(t)),Vs="dpk-locale-change",Zo=t=>typeof t=="string"&&Vo(t)?t:null,mu=t=>t.preference??t.authored,ku=(t,e)=>t===e?null:t,je=t=>e=>e==="ja"?t.ja:t.en,Qo=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"}}),Xo=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function Jo(t){return typeof Xo.Buffer<"u"&&Xo.Buffer.isBuffer(t)}function ea(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 ta(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function na(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const bu="[object RegExp]",vu="[object String]",xu="[object Number]",yu="[object Boolean]",wu="[object Symbol]",$u="[object Date]",Su="[object Map]",Au="[object Set]",Eu="[object Array]",Cu="[object Function]",Tu="[object ArrayBuffer]",Ys="[object Object]",Ru="[object Error]",_u="[object DataView]",Mu="[object Uint8Array]",Ou="[object Uint8ClampedArray]",Pu="[object Uint16Array]",Lu="[object Uint32Array]",zu="[object BigUint64Array]",Du="[object Int8Array]",Iu="[object Int16Array]",Nu="[object Int32Array]",qu="[object BigInt64Array]",Uu="[object Float32Array]",Hu="[object Float64Array]";function ju(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function Bu(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=na(t),r=na(e);if(i==="[object Arguments]"&&(i=Ys),r==="[object Arguments]"&&(r=Ys),i!==r)return!1;switch(i){case vu:return t.toString()===e.toString();case xu:return ju(t.valueOf(),e.valueOf());case yu:case $u:case wu:return Object.is(t.valueOf(),e.valueOf());case bu:return t.source===e.source&&t.flags===e.flags;case Cu: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 Su: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 Au:{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 Eu:case Mu:case Ou:case Pu:case Lu:case zu:case Du:case Iu:case Nu:case qu:case Uu:case Hu:if(Jo(t)!==Jo(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 Tu:return t.byteLength!==e.byteLength?!1:Ut(new Uint8Array(t),new Uint8Array(e),n,s);case _u:return t.byteLength!==e.byteLength||t.byteOffset!==e.byteOffset?!1:Ut(new Uint8Array(t),new Uint8Array(e),n,s);case Ru:return t.name===e.name&&t.message===e.message;case Ys:{if(!(Ut(t.constructor,e.constructor,n,s)||ea(t)&&ea(e)))return!1;const l=[...Object.keys(t),...ta(t)],c=[...Object.keys(e),...ta(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 Fu(){}function zn(t,e){return Bu(t,e,Fu)}const sa=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))}),Zs={schema:sa,mode:"append",targetType:"page"},Gu=R({body:v()}),Ht=t=>{const e=C(Gu,t.payload);return e.success?e.output.body:""},Qs="data-dpk-grill",ae="grill",Dn="answer",jt="data-grill-questions",Wu=B(v()),ia=t=>{const e=t?.trim();return e===void 0||e===""?void 0:e},Ku=t=>{const e=ia(t);return e===void 0?{}:{questions:e}},lt={questions:[],rounds:[]},Vu=L({id:Es,label:w(v(),S(1))}),ra=L({id:Es,ref:N(w(v(),S(1))),title:w(v(),S(1)),description:N(v()),note:N(v()),options:N(U(Vu),[]),freeText:N(un(),!0)}),oa=fn("kind",[L({kind:G("option"),optionId:w(v(),S(1))}),L({kind:G("free"),text:v()})]),aa=fn("kind",[...oa.options,L({kind:G("clear")})]),Yu=L({...ra.entries,answer:N(oa)}),Zu=L({label:N(w(v(),S(1))),questions:U(Yu)}),Qu=L({questions:U(ra),history:N(U(Zu),[])}),la=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}})},da=t=>({id:t.id,ref:t.ref,title:t.title,description:t.description,note:t.note,options:t.options,freeText:t.freeText}),Xu=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{...da(t),answer:e}},Ju=t=>{const e=Mt(Qu,t);return{questions:la(e.questions).map(da),rounds:e.history.map((n,s)=>({label:n.label??`v${s+1}`,questions:la(n.questions).map(Xu)}))}},dt=(t,e)=>t.questions.find(n=>n.id===e),Xs=(t,e)=>{const n=dt(t,e);return n?`${n.ref} \xB7 ${n.title}`:e},In=(t,e)=>e?e.kind==="option"?t.options.find(n=>n.id===e.optionId)?.label??"":e.text.trim():"",Nn=(t,e)=>In(t,e)!=="",eg=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},ca=(t,e)=>({total:t.questions.length,answered:t.questions.filter(n=>Nn(n,e[n.id])).length}),tg=(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=>!Nn(o,e[o.id]))?.id??null},ng=w(v(),ee(/^[A-Za-z0-9_-]+(?:@[A-Za-z0-9_-]+)?$/,"a question id, optionally qualified by its board (`retry@scope`)")),sg=R({id:w(v(),S(1)),type:G(Dn),target:R({type:G(ae),id:ng}),payload:aa,note:B(v()),createdAt:w(v(),S(1))}),ig={schema:sg,mode:"patch",targetType:ae},Z=t=>t.type===Dn&&t.target.type===ae,rg=(t,e)=>({type:Dn,target:{type:ae,id:t},payload:e}),pa=t=>{const e=C(aa,t.payload);return e.success?e.output:null},og=(t,e)=>[...t.filter(n=>!(Z(n)&&n.target.id===e.target.id)),e],ha=(t,e,n)=>{const s=dt(t,n.target.id),i=pa(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}},ua="page",Js="app",ga=t=>P(t),fa=(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(ie(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(Z(p)){const m=ha(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"&&ei(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===ua||p.target.type===Js?t.pageTargetExists?.(r,p.target)??!0:t.hasTarget(r,p.target))){l.push({action:p,reason:"target-missing"});continue}d.push(p);const m=ga(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}},ei=(t,e,n)=>e===n?!0:t.canonicalState===void 0?zn(e,n):zn(t.canonicalState(e),t.canonicalState(n)),ma=t=>{const e=new Set(t.obsolete.map(n=>n.id));return t.actions.filter(n=>!e.has(n.id))},ag=(t,e,n,s)=>{let i=e;const r=s??ka(i).map(o=>o.id);for(const o of[...r].reverse())i=lg(t,i,n,o,s!==void 0)??i;return i},ka=t=>t.applied.filter(e=>!ie(e)&&!Z(e)),lg=(t,e,n,s,i)=>{const r=ka(e),o=r.findIndex(u=>u.id===s),a=r[o];if(a===void 0)return null;const l=r.slice(0,o),c=ti(t,a),d=!t.hasTarget(e.state,a.target)||/^(?:DELETE|REMOVE)_/.test(a.type),h=c==="sequence"||d,f=[...i&&h?dg(t,e.base,r,o):[],...h?cg(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=pg(t,e,n,u);if(m!==null)return m}return null},dg=(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)=>ei(t,o,r)?[n.slice(a,s+1).map(l=>l.id)]:[])},cg=(t,e,n)=>{const s=ba(n),i=e.filter(l=>ba(l).some(c=>s.includes(c))),r=ti(t,n),o=i.filter(l=>ti(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])]},ba=t=>{const n=t.target.type===ua||t.target.type===Js?[]: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]},ti=(t,e)=>tt(t.actions,e.type)?.mode,pg=(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 ei(t,o.state,e.state)?o:null;if(a.some(l=>l.type===H||ie(l)||Z(l)))return null;for(const l of a)r.add(l.id)}},hg={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",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",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"}}),ug=(t,e,n)=>{const s=pa(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))}},gg=(t,e)=>{const{grill:n}=e,s=O(e.locale);return{...t,hasTarget:(i,r)=>r.type===ae?dt(n,r.id)!==void 0:t.hasTarget(i,r),commentTargets:(i,r)=>[...t.commentTargets(i,r),...n.questions.map(o=>({value:P({type:ae,id:o.id}),label:Xs(n,o.id),group:s.grillGroup}))],describe:(i,r,o)=>{const a=Xs(n,i.target.id);if(Z(i)){const{title:c,summary:d,tone:h}=ug(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===ae?{...l,targetLabel:a}:l},serialize:i=>Z(i)?`${i.type} ${P(i.target)} ${JSON.stringify(i.payload)}`:t.serialize(i)}},fg=R({v:G(1),template:w(v(),S(1)),actions:U(xe())});class ni{constructor(e){this.storage=e}load(e,n){try{const s=this.storage.getItem(e);if(s===null)return[];const i=C(fg,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 si{constructor(){this.store=new Map}load(e,n){return new ni({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 ii=()=>{try{if(typeof localStorage<"u")return new ni(localStorage)}catch{}return new si},Bt=t=>`dev-process-kit:draft:${typeof location>"u"?"local":`${location.pathname}${location.search}`}:${t}`,va={redoStack:[]},mg=(t,e)=>{const n=t.at(-1);return n===void 0?null:{actions:t.slice(0,-1),state:{redoStack:[...e.redoStack,n]}}},kg=(t,e)=>{const n=e.redoStack.at(-1);return n===void 0?null:{actions:[...t,n],state:{redoStack:e.redoStack.slice(0,-1)}}},bg=()=>va,vg=t=>t.length>0,xg=t=>t.redoStack.length>0,yg=U(xe());class xa{#e;#n;#t={targets:[],providers:[]};#s;#i=new Map;#r;#o;#a;#l;#d;#c=new Set;#h=[];#p=0;#f=va;constructor(e){this.#e=e.definition,this.#s=e.grill??{grill:lt,locale:"en"},this.#n=this.#y(),this.#r=e.base,this.#d=e.storageKey??Bt(e.definition.name),this.#l=e.storage===void 0?ii():e.storage;const n=e.initialActions??this.#l?.load(this.#d,this.definition.name)??[];this.#o=$a(this.definition,n),this.#a=this.#x(this.#o),this.#w()&&this.#C()}get definition(){return this.#n}setComponentSnapshot(e){const n=Mt(eh,e);if(!zn(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.#s=e,this.#k(),this.#a=this.#x(this.#o);for(const n of this.#c)n()}#k(){this.#i=uo(this.#o,this.#t.providers),this.#n=this.#y()}#y(){return gg(mo(this.#e,this.#t.targets,this.#i),this.#s)}#x(e){return fa(this.definition,this.#r,e,uo(e,this.#t.providers),this.#s.grill)}get base(){return this.#r}get actions(){return this.#o}get derivation(){return this.#a}get lastIssues(){return this.#h}get prunedCount(){return this.#p}get canUndo(){return vg(this.#o)}get canRedo(){return xg(this.#f)}descriptorFor(e,n){return ya(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(wa(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(yg,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((Z(d)?ha(this.#s.grill,o,d)===null?null:r:d.type==="comment"||ie(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=wa(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(Yr,e);if(!s.success)return{ok:!1,issue:ze(s.issues)};const i=this.descriptorFor(s.output.type,typeof s.output.target=="string"?bn(s.output.target,"page"):s.output.target);if(!i)return{ok:!1,issue:{path:"type",message:`unknown action type "${s.output.type}"`}};const r=Sp(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.#h=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(Zs.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($a(this.definition,e))}setBase(e){this.#r=e,this.#m(this.#o)}undo(){const e=mg(this.#o,this.#f);return e===null?!1:(this.#f=e.state,this.#m([...e.actions],{preserveRedo:!0}),!0)}redo(){const e=kg(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.#h=[],this.#o=e,this.#k(),this.#a=this.#x(this.#o),this.#w(n?.dispatched),n?.preserveRedo!==!0&&(this.#f=bg()),this.#C();for(const s of this.#c)s()}#w(e){const n=this.#$(),s=ag(this.definition,this.#a,i=>this.#x(i),e);return s===this.#a?n:(this.#p+=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.#p+=this.#a.obsolete.length,this.#o=ma(this.#a),this.#k(),this.#a=this.#x(this.#o),!0)}#C(){this.#l?.save(this.#d,this.definition.name,this.#o)}}const ya=(t,e,n)=>e==="comment"?Zs:e===Dn?ig:n!==void 0&&ie({type:e,target:n})?Xp:t.actionFor?t.actionFor(e,n):tt(t.actions,e),wa=(t,e,n)=>Z(e)?og(t,e):Zr(t,e,n),$a=(t,e)=>e.flatMap(n=>{const s=C(Pe,n);if(!s.success)return[];const i=s.output,r=ya(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]:[]}),wg='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},Sg=t=>{const e=t.querySelector("[autofocus]");if(e)return e;for(const n of t.querySelectorAll(wg))if(!(n.hidden||n.closest("[hidden]")!==null))return n;return null},Ag=t=>typeof t.showModal=="function",qn=t=>{const e=t.open;return typeof e=="boolean"?e:t.hasAttribute("open")},Eg=t=>{if(Ag(t)){t.showModal();return}t.setAttribute("open","")},Sa=t=>{if(typeof t.close=="function"){t.close();return}qn(t)&&(t.removeAttribute("open"),t.dispatchEvent(new Event("close")))},Cg="dpk-dialog-close";class Tg{constructor(e,n){this.#t=null,this.#s="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;#t;#s;hostConnected(){document.addEventListener("pointerdown",this.#i,!0)}hostUpdated(){const e=this.#n.dialog();if(e!==null){if(this.#n.open()){qn(e)||this.#r(e);return}qn(e)&&Sa(e)}}hostDisconnected(){document.removeEventListener("pointerdown",this.#i,!0);const e=this.#n.dialog();e!==null&&qn(e)&&Sa(e),this.#t=null}#i;dismiss(e="close"){this.#s=e,this.#n.dismiss(e)}#r(e){this.#s="close",this.#t=$g(),Eg(e);const n=Sg(e)??e;n===e&&!e.hasAttribute("tabindex")&&(e.tabIndex=-1),n.focus()}#o(){const e=this.#s,n=this.#t;this.#t=null,this.#n.open()&&this.#n.dismiss(e),n?.isConnected&&n.focus(),this.#e.dispatchEvent(new CustomEvent(Cg,{detail:{reason:e},bubbles:!0,composed:!0}))}}const Rg=(t,e="json")=>`\`\`\`${e}
|
|
275
275
|
${t}
|
|
276
276
|
\`\`\``,_g=t=>JSON.stringify({type:t.type,target:t.target,payload:t.payload,...t.note===void 0?{}:{note:t.note}},null,2),Un=(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&&!Z(h)),c=t.grill.questions.filter(h=>Nn(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(ie)&&(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}. **${
|
|
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}. **${Xs(t.grill,f.id)}** \u2014 \`grill:${f.id}\``),d.push(` > ${In(f,p).replace(/\n/g,`
|
|
278
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
279
|
${_g(f).replace(/\n/g,`
|
|
280
280
|
`)}
|
|
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(Rg(
|
|
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(Rg(Ts(s))),d.push(""),d.join(`
|
|
282
282
|
`)},Mg=4096,Og="reviews",Aa="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.",Pg=t=>new TextEncoder().encode(t).length,Lg=t=>t.replace(/[\u0000-\u0008\u000B-\u001F\u007F]/g,""),zg=t=>{const e=`${Aa}
|
|
283
283
|
|
|
284
284
|
${Lg(t)}`;return Pg(e)<=Mg?e:null},Dg=t=>`${Aa}
|
|
285
285
|
|
|
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).`,Ig={consent_required:"consent",forbidden:"forbidden",not_granted:"forbidden",capability_disabled:"forbidden",capability_removed:"forbidden",claude_unavailable:"claude_unavailable",rate_limited:"rate_limited"},Ng=t=>{const e=typeof t=="object"&&t!==null&&"code"in t?t.code:void 0;return(typeof e=="string"?Ig[e]:void 0)??"error"},qg={too_large:"handoffTooLarge",consent:"handoffConsent",forbidden:"handoffForbidden",claude_unavailable:"handoffClaudeUnavailable",rate_limited:"handoffRateLimited",storage:"handoffStorage",error:"handoffError"},Ea=(t,e)=>O(e)[qg[t]],Ug=()=>({status:{kind:"idle"},request:0}),Hg=(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}},jg=(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"?Ea(s.reason,t.locale):null}},we={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4},Ft=t=>(...e)=>({_$litDirective$:t,values:e});let Hn=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 jn extends Hn{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===Y)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:[]}}}jn.directiveName="unsafeHTML",jn.resultType=1;const Ca=Ft(jn);let
|
|
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).`,Ig={consent_required:"consent",forbidden:"forbidden",not_granted:"forbidden",capability_disabled:"forbidden",capability_removed:"forbidden",claude_unavailable:"claude_unavailable",rate_limited:"rate_limited"},Ng=t=>{const e=typeof t=="object"&&t!==null&&"code"in t?t.code:void 0;return(typeof e=="string"?Ig[e]:void 0)??"error"},qg={too_large:"handoffTooLarge",consent:"handoffConsent",forbidden:"handoffForbidden",claude_unavailable:"handoffClaudeUnavailable",rate_limited:"handoffRateLimited",storage:"handoffStorage",error:"handoffError"},Ea=(t,e)=>O(e)[qg[t]],Ug=()=>({status:{kind:"idle"},request:0}),Hg=(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}},jg=(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"?Ea(s.reason,t.locale):null}},we={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4},Ft=t=>(...e)=>({_$litDirective$:t,values:e});let Hn=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 jn extends Hn{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===Y)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:[]}}}jn.directiveName="unsafeHTML",jn.resultType=1;const Ca=Ft(jn);let ri=class extends jn{};ri.directiveName="unsafeSVG",ri.resultType=2;const Bg=Ft(ri),Fg=t=>t.replaceAll("&","&").replaceAll('"',"""),Gg=t=>t.map(([e,n])=>`<${e}${Object.entries(n).map(([s,i])=>` ${s}="${Fg(String(i))}"`).join("")}></${e}>`).join(""),y=t=>{const e=Gg(t);return()=>k`<svg
|
|
287
287
|
viewBox="0 0 24 24"
|
|
288
288
|
fill="none"
|
|
289
289
|
stroke="currentColor"
|
|
@@ -294,7 +294,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
294
294
|
focusable="false"
|
|
295
295
|
>
|
|
296
296
|
${Bg(e)}
|
|
297
|
-
</svg>`},ct=y(Rc),Ta=y(Cc),
|
|
297
|
+
</svg>`},ct=y(Rc),Ta=y(Cc),oi=y(bc),Bn=y(pc),Wg=y(cc),Kg=y(wc),Ra=y(sr),Vg=y($c),_a=y(ac),Yg=y(Xd),pt=y(Vd),ai=y(vc),Zg=y(uc),Ma=y(ic),Oa=y(sc),Pa=y(mc),Qg=y(tr),Xg=y(Xi);y(Ji),y(er);const La=y(Yd),Gt=y(Zd),za=y(nr),Jg=y(dc),ef=y(hc),tf=y(Ac),nf=y(fc),Da=y(Wd),sf=y(rc),rf=y(ec);y(Ec);const of=y(Fd),af=y(Tc),lf=y(yc),df=y(or),cf=()=>k`<svg viewBox="0 0 190 125" aria-hidden="true" focusable="false">
|
|
298
298
|
<path
|
|
299
299
|
fill="#7463fa"
|
|
300
300
|
fill-rule="evenodd"
|
|
@@ -629,7 +629,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
629
629
|
/* A count that just appeared lands with a little weight (shared 'dpk-pop'). */
|
|
630
630
|
animation: dpk-pop var(--dpk-dur) var(--dpk-ease-spring);
|
|
631
631
|
}
|
|
632
|
-
`),
|
|
632
|
+
`),li=z`
|
|
633
633
|
.dpk-btn {
|
|
634
634
|
display: inline-flex;
|
|
635
635
|
align-items: center;
|
|
@@ -1307,7 +1307,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1307
1307
|
<div part="body" class="body"><slot></slot></div>
|
|
1308
1308
|
<div part="footer" class="footer"><slot name="footer"></slot></div>
|
|
1309
1309
|
<slot name="overlay"></slot>
|
|
1310
|
-
`}}const mf=()=>{customElements.get("dpk-internal-layout-app")||customElements.define("dpk-internal-layout-app",ff)};class Wt{#e;#
|
|
1310
|
+
`}}const mf=()=>{customElements.get("dpk-internal-layout-app")||customElements.define("dpk-internal-layout-app",ff)};class Wt{#e;#n;#t=Ko;constructor(e,n=()=>{}){this.#e=e,this.#n=n,e.addController(this)}get locale(){return this.#t}hostConnected(){this.#t=Yo(this.#e),document.addEventListener(Vs,this.#s)}hostDisconnected(){document.removeEventListener(Vs,this.#s)}#s=()=>{const e=Yo(this.#e);e!==this.#t&&(this.#t=e,this.#n(),this.#e.requestUpdate())}}const di=(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{}}}),Q=t=>{const e=new Map;return di({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 di(localStorage,t)}catch{}return Q(t)},kf=t=>{try{if(typeof sessionStorage<"u")return di(sessionStorage,t)}catch{}return Q(t)},$e={min:180,max:560,step:16,largeStep:64},ja={side:"left",defaultWidth:260},Gn=t=>Math.round(Math.min($e.max,Math.max($e.min,t))),Ba=t=>typeof t=="number"&&Number.isFinite(t)?Gn(t):null,ci=(t,e)=>t==="left"?e:-e,bf=(t,e)=>Gn(t.startWidth+ci(t.side,e-t.startX)),vf=(t,e,{key:n,shiftKey:s})=>{const i=s?$e.largeStep:$e.step;switch(n){case"ArrowLeft":return Gn(t+ci(e,-i));case"ArrowRight":return Gn(t+ci(e,i));case"Home":return $e.min;case"End":return $e.max;default:return null}},Fa=t=>typeof t=="boolean"?t:null,Be={inset:10,size:32},xf=t=>t?Be.inset+Be.size:0,yf=t=>t==="left"?"right":"left",wf=(t,e)=>e?{action:"expand",points:yf(t)}:{action:"collapse",points:t},pi={width:ja.defaultWidth,resizable:!0,collapsible:!0,narrow:"drawer",persistKey:null},$f=(t,e)=>!e||t.narrow==="keep"?"beside":t.narrow==="stack"?"stack":t.collapsible?"drawer":"beside",Sf=t=>`dev-process-kit:sidebar-collapsed:${t}`;class Af{#e;#n;#t=null;#s="";#i=!1;#r=!1;constructor(e,n){this.#e=e,this.#n=n,e.addController(this)}hostConnected(){if(this.#t!==null)return;const e=this.#n.persistKey();this.#t=e===null?Q(Fa):fe(Fa),this.#s=Sf(e??""),this.#i=this.#t.read(this.#s)??!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.#s,!0):this.#t?.remove(this.#s),this.#e.requestUpdate())}}const Ga=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"}}),Ef="(max-width: 760px)",Cf=()=>typeof matchMedia=="function"?matchMedia(Ef):null;class Tf{#e;#n=null;#t=!1;constructor(e){this.#e=e,e.addController(this)}hostConnected(){this.#n=Cf(),this.#t=this.#n?.matches===!0,this.#n?.addEventListener("change",this.#s)}hostDisconnected(){this.#n?.removeEventListener("change",this.#s),this.#n=null}get narrow(){return this.#t}#s=e=>{this.#t=e.matches,this.#e.requestUpdate()}}const Rf=t=>`dev-process-kit:sidebar-width:${t}`,hi={kind:"idle"};class _f{constructor(e,n){this.#t=null,this.#s="",this.#i=null,this.#r=hi,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(bf(i,s.clientX))},pointerup:s=>this.#o(s),pointercancel:s=>this.#o(s),keydown:s=>{const i=vf(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;#t;#s;#i;#r;hostConnected(){if(this.#t!==null)return;const e=this.#n.persistKey();this.#t=e===null?Q(Ba):fe(Ba),this.#s=Rf(e??""),this.#i=this.#t.read(this.#s)}hostDisconnected(){this.#r=hi}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=hi,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.#t?.remove(this.#s):this.#t?.write(this.#s,this.#i)}}class Wa{constructor(e,n,s){this.side=n,this.layout=s,this.filled=!1,this.width=new _f(e,{persistKey:()=>s().persistKey,side:()=>n,defaultWidth:()=>s().width}),this.fold=new Af(e,{persistKey:()=>s().persistKey})}get drawnWidth(){return this.layout().resizable?this.width.width:this.layout().width}}class Mf extends J{static{this.styles=[ft,z`
|
|
1311
1311
|
:host {
|
|
1312
1312
|
display: flex;
|
|
1313
1313
|
min-width: 0;
|
|
@@ -1599,17 +1599,17 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1599
1599
|
border-bottom: 0;
|
|
1600
1600
|
border-top: 1px solid var(--dpk-rule);
|
|
1601
1601
|
}
|
|
1602
|
-
`]}static{this.properties={left:{attribute:!1},right:{attribute:!1},main:{type:String,reflect:!0}}}#e=new Wt(this);#
|
|
1602
|
+
`]}static{this.properties={left:{attribute:!1},right:{attribute:!1},main:{type:String,reflect:!0}}}#e=new Wt(this);#n=new Tf(this);#t={left:new Wa(this,"left",()=>this.left),right:new Wa(this,"right",()=>this.right)};#s=!1;#i=null;constructor(){super(),this.left=pi,this.right=pi,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.#s=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 $f(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.#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
|
|
1603
1603
|
part="scrim"
|
|
1604
1604
|
class="scrim"
|
|
1605
1605
|
@click=${()=>{e.fold.closeDrawer(),n.fold.closeDrawer()}}
|
|
1606
|
-
></div>`:b;return k`<div part="rail" class="rail" ?hidden=${!this.#
|
|
1606
|
+
></div>`:b;return k`<div part="rail" class="rail" ?hidden=${!this.#s}>
|
|
1607
1607
|
<slot name="rail" @slotchange=${this.#y}></slot>
|
|
1608
1608
|
</div>
|
|
1609
1609
|
<div class="body" ?data-stack=${i} ?data-resizing=${e.width.dragging||n.width.dragging}>
|
|
1610
|
-
${this.#d(e)}${this.#
|
|
1610
|
+
${this.#d(e)}${this.#h(e)}
|
|
1611
1611
|
<div part="main" class="main" style=${this.#l()}><slot></slot></div>
|
|
1612
|
-
${this.#
|
|
1612
|
+
${this.#h(n)}${this.#d(n)} ${o}
|
|
1613
1613
|
</div>`}#l(){return["left","right"].map(e=>`--dpk-fold-clearance-${e}: ${xf(this.foldedOn(e))}px;`).join(" ")}#d(e){return k`<div
|
|
1614
1614
|
id=${`sidebar-${e.side}`}
|
|
1615
1615
|
part="sidebar"
|
|
@@ -1620,8 +1620,8 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1620
1620
|
style=${`--dpk-sidebar-width: ${e.drawnWidth}px`}
|
|
1621
1621
|
@wheel=${this.#c}
|
|
1622
1622
|
>
|
|
1623
|
-
<slot name=${e.side} @slotchange=${n=>this.#
|
|
1624
|
-
</div>`}#c=e=>{e.currentTarget instanceof HTMLElement&&mp(e.currentTarget,e)&&e.preventDefault()};#
|
|
1623
|
+
<slot name=${e.side} @slotchange=${n=>this.#k(e,n)}></slot>
|
|
1624
|
+
</div>`}#c=e=>{e.currentTarget instanceof HTMLElement&&mp(e.currentTarget,e)&&e.preventDefault()};#h(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.#p(e,i)}</div>`:b;if(i||s==="drawer")return n.collapsible?this.#p(e,i,!0):b;const o=n.collapsible?this.#p(e,i):b,a=n.resizable?this.#f(e):b;return e.side==="left"?k`${a}${o}`:k`${o}${a}`}#p(e,n,s=!1){const i=Ga(this.#e.locale),r=wf(e.side,n),o=r.action==="collapse"?i.collapseSidebar:i.expandSidebar;return k`<button
|
|
1625
1625
|
part="toggle"
|
|
1626
1626
|
class="toggle"
|
|
1627
1627
|
type="button"
|
|
@@ -1636,7 +1636,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1636
1636
|
@click=${()=>{this.#i=e.side,this.#a(e)}}
|
|
1637
1637
|
>
|
|
1638
1638
|
${r.points==="left"?La():Gt()}
|
|
1639
|
-
</button>`}#
|
|
1639
|
+
</button>`}#f(e){const n=Ga(this.#e.locale),s=e.width.handlers;return k`<div
|
|
1640
1640
|
part="resizer"
|
|
1641
1641
|
class="resizer"
|
|
1642
1642
|
role="separator"
|
|
@@ -1656,35 +1656,35 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1656
1656
|
@pointercancel=${s.pointercancel}
|
|
1657
1657
|
@keydown=${s.keydown}
|
|
1658
1658
|
@dblclick=${s.dblclick}
|
|
1659
|
-
></div>`}#
|
|
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.#s&&(this.#s=n,this.requestUpdate())}}const Of=()=>{customElements.get("dpk-internal-layout-sidebar")||customElements.define("dpk-internal-layout-sidebar",Mf)},Pf=()=>{mf(),Of()},Wn="@",mt=Object.freeze({type:Js,id:"app"}),ui=/^[A-Za-z0-9_-]+$/,Se=t=>t.type===mt.type&&t.id===mt.id,Fe=t=>{const e=t.id.lastIndexOf(Wn);if(e<0)return null;const n=t.id.slice(e+1);return ui.test(n)?{page:n,target:{type:t.type,id:t.id.slice(0,e)}}:null},Ka=(t,e)=>({type:t.type,id:`${t.id}${Wn}${e}`}),Va=(t,e,n)=>{if(Se(t))return t;const s=Fe(t);return s!==null&&n.has(s.page)?t:Ka(t,e)},kt=(t,e)=>`${t}${Wn}${e}`,Kn="dpk-page",Ya="dpk-app",bt="name",vt="data-dpk-draft-page",Lf=t=>t.hasAttribute(vt)||t.parentElement?.hasAttribute(vt)===!0,Vn=Symbol.for("dev-process-kit.page-host"),Za=t=>{const e=t.getAttribute(bt);return e!==null&&ui.test(e)?e:null},zf=t=>Vn in t,Qa=t=>{if(!zf(t))return null;const e=t[Vn];return qf(e)?e:null},gi=t=>{const e=t.parentElement;return e?.localName===Kn?Za(e):null},Df=t=>t.parentElement?.localName===Ya?Za(t):null,Xa=t=>{const e=t.parentElement;return e===null||e.localName!==Kn?null:Qa(e)},If=t=>{const e=t.parentElement;if(e===null||e.localName!==Kn)return null;const n=Reflect.get(e,"delivered");return n instanceof Promise?n:null},Nf=t=>{const e=t.parentElement;return e===null||e.localName!==Ya?null:Qa(e)},qf=t=>typeof t=="object"&&t!==null&&"dispatch"in t&&"navigation"in t,Ae="page",Yn=t=>`${t}.`,Ge=(t,e)=>{const n=Yn(e),s={};for(const[i,r]of Object.entries(t))i.startsWith(n)&&(s[i.slice(n.length)]=r);return s},Ja=(t,e)=>Object.fromEntries(Object.entries(e).map(([n,s])=>[`${Yn(t)}${n}`,s])),Uf=(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=xn(a,o,i),c={...r};for(const d of Object.keys(a))Object.hasOwn(l,d)||(c[`${Yn(e)}${d}`]=null);for(const[d,h]of Object.entries(l))c[`${Yn(e)}${d}`]=h;return c};class Zn{#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,js(e,n,s,i))}}const fi=(t,e)=>e===0?-1:Math.min(Math.max(t,0),e-1),Hf=(t,e,n)=>n===0?-1:t<0?e>0?0:n-1:(t+e+n)%n,Qn=(t,e)=>t.findIndex(n=>n.value===e),jf=(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 Bf=0;const Ff=500;class Kt{#e;#n=`dpk-select-${++Bf}`;#t;#s=!1;#i=-1;#r="";#o;#a=null;constructor(e){this.#e=e,this.#t=new Zn(e),new cn(e,{open:()=>this.#s,closesOn:n=>!n.some(s=>s instanceof Element&&s.getAttribute("data-dpk-select")===this.#n),ownsEscape:()=>this.#s,dismiss:()=>this.#k()}),e.addController(this)}hostConnected(){}hostUpdated(){this.#y()}hostDisconnected(){clearTimeout(this.#o)}render(e){this.#a=e;const n=fi(this.#i,e.options.length),i=e.options.find(o=>o.value===e.value)?.label??e.placeholder??"",r=this.#s?e.options[n]:void 0;return k`
|
|
1660
1660
|
<button
|
|
1661
1661
|
type="button"
|
|
1662
1662
|
class="dpk-rich-select ${e.className??""}"
|
|
1663
|
-
data-dpk-select=${this.#
|
|
1663
|
+
data-dpk-select=${this.#n}
|
|
1664
1664
|
?disabled=${e.disabled??!1}
|
|
1665
1665
|
aria-haspopup="listbox"
|
|
1666
|
-
aria-expanded=${this.#
|
|
1666
|
+
aria-expanded=${this.#s?"true":"false"}
|
|
1667
1667
|
aria-controls=${this.#l}
|
|
1668
1668
|
aria-label=${e.ariaLabel}
|
|
1669
1669
|
aria-activedescendant=${r?this.#d(r.value):b}
|
|
1670
|
-
@click=${this.#
|
|
1671
|
-
@keydown=${o=>this.#
|
|
1670
|
+
@click=${this.#p}
|
|
1671
|
+
@keydown=${o=>this.#h(o,e)}
|
|
1672
1672
|
@focus=${()=>e.onActivate?.()}
|
|
1673
1673
|
@pointerenter=${()=>e.onActivate?.()}
|
|
1674
1674
|
>
|
|
1675
1675
|
<span class="dpk-rich-select-label">${i}</span>
|
|
1676
|
-
<span class="dpk-rich-select-chevron" aria-hidden="true" data-open=${this.#
|
|
1676
|
+
<span class="dpk-rich-select-chevron" aria-hidden="true" data-open=${this.#s?"true":"false"}>
|
|
1677
1677
|
${za()}
|
|
1678
1678
|
</span>
|
|
1679
1679
|
</button>
|
|
1680
|
-
${this.#
|
|
1681
|
-
`}get#l(){return`${this.#
|
|
1680
|
+
${this.#s?this.#c(e,n):b}
|
|
1681
|
+
`}get#l(){return`${this.#n}-listbox`}#d(e){return`${this.#n}-option-${encodeURIComponent(e)}`}#c(e,n){return k`
|
|
1682
1682
|
<div
|
|
1683
1683
|
class="dpk-rich-select-listbox"
|
|
1684
1684
|
popover="manual"
|
|
1685
1685
|
role="listbox"
|
|
1686
1686
|
id=${this.#l}
|
|
1687
|
-
data-dpk-select=${this.#
|
|
1687
|
+
data-dpk-select=${this.#n}
|
|
1688
1688
|
aria-label=${e.ariaLabel}
|
|
1689
1689
|
>
|
|
1690
1690
|
${e.options.map((s,i)=>k`
|
|
@@ -1696,17 +1696,17 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1696
1696
|
aria-selected=${s.value===e.value?"true":"false"}
|
|
1697
1697
|
data-active=${i===n?"true":"false"}
|
|
1698
1698
|
@mousedown=${r=>r.preventDefault()}
|
|
1699
|
-
@click=${()=>this.#
|
|
1699
|
+
@click=${()=>this.#f(s.value,e)}
|
|
1700
1700
|
>
|
|
1701
1701
|
<span class="dpk-rich-select-option-label">${s.label}</span>
|
|
1702
1702
|
${s.value===e.value?k`<span class="dpk-rich-select-check" aria-hidden="true">${pt()}</span>`:b}
|
|
1703
1703
|
</div>
|
|
1704
1704
|
`)}
|
|
1705
1705
|
</div>
|
|
1706
|
-
`}#
|
|
1706
|
+
`}#h(e,n){if(n.disabled)return;if(e.key==="ArrowDown"||e.key==="ArrowUp"){e.preventDefault();const r=e.key==="ArrowDown"?1:-1;if(this.#s)this.#i=Hf(this.#i,r,n.options.length);else{this.#s=!0;const o=Qn(n.options,n.value);this.#i=o>=0?o:fi(r>0?0:n.options.length-1,n.options.length)}this.#e.requestUpdate();return}if(e.key==="Enter"||e.key===" "){if(e.preventDefault(),!this.#s){this.#s=!0,this.#i=Qn(n.options,n.value),this.#e.requestUpdate();return}const r=n.options[fi(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=""},Ff);const s=this.#s?this.#i:Qn(n.options,n.value),i=jf(n.options,this.#r,s);if(i!==null){if(this.#i=i,!this.#s){const r=n.options[i]?.value;r!==void 0&&this.#f(r,n);return}this.#e.requestUpdate()}}#p=()=>{if(this.#a?.disabled)return;if(this.#s){this.#k();return}const e=this.#a;this.#s=!0,this.#i=e?Qn(e.options,e.value):-1,this.#e.requestUpdate()};#f(e,n){this.#k(),e!==n.value&&n.onChange(e)}#k(){this.#s&&(this.#s=!1,this.#i=-1,this.#e.requestUpdate())}#y(){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.#t.open(s,n,{width:Math.max(n.offsetWidth,160),height:280},{placement:"bottom-start"})}}class Gf{#e;#n=new Map;constructor(e){this.#e=e}get(e){const n=this.#n.get(e);if(n)return n;const s=new Kt(this.#e);return this.#n.set(e,s),s}}const me="0.3.1",mi=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}},Wf=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)}},el=(t,e)=>{const n=()=>mi(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())??Un(n(),t.controller().definition,me),subscribe:s=>t.subscribe(s)}},Kf='the <script type="application/json"> child is empty',Vf='no <script type="application/json"> child found';class Yf{#e;#n;#t=null;#s;constructor(e){this.#e=e}get error(){return this.#t}read(){return this.#o(this.#r()).state}observe(){this.#s===void 0&&(this.#s=new MutationObserver(()=>this.#i()),this.#s.observe(this.#e.host,{childList:!0,subtree:!0,characterData:!0}))}disconnect(){this.#s?.disconnect(),this.#s=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.#t=null:(this.#t=e===null?Vf:Kf,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 Zf=8e3,Qf=t=>t.localName==="script"&&t.getAttribute("type")==="application/json"&&t.hasAttribute(Qr);class Xf{#e;#n;#t=null;#s=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.#t&&this.#r?jp(this.#t,this.#r):null}get log(){return this.#t}get error(){return this.#s}hostConnected(){!this.#p()&&!this.#f()&&this.#x(),document.addEventListener("pointerdown",this.#w,!0),document.addEventListener("keydown",this.#$)}hostUpdate(){!this.#p()&&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=Ip(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.#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.#m(n,s)}#h(){return`${this.#n.storageKey()}:seen-changes`}#p(){return this.#t!==null||this.#s!==null||this.#i}#f(){const e=[...this.#e.children].find(Qf);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.#y(i instanceof Error?i.message:String(i))}const s=Pp(n);return s.ok?(this.#t=s.log,this.#o=this.#n.persist()?fe(Jr):Q(Jr),this.#r=Dp(s.log,this.#o.read(this.#h())),this.#k(),this.#g(),this.#e.requestUpdate(),!0):this.#y(s.error)}#k(){if(!this.#t||!this.#r)return;const e=qp(this.#t,this.#r),n=JSON.stringify(e);n!==this.#a&&(this.#a=n,this.#o?.write(this.#h(),e))}#y(e){return console.error("[dev-process-kit] invalid change log:",e),this.#s=e,this.#e.requestUpdate(),!0}#x(){this.#l=new MutationObserver(()=>{(this.#p()||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:Zf};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.#n.inside(e.composedPath())||this.send({kind:"close-list"})};#$=e=>{e.key!=="Escape"||!this.#r?.list.open||this.send({kind:"close-list"})}}const{I:Jf}=Yc,tl=t=>t,em=t=>t.strings===void 0,nl=()=>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(nl(),i),o=s.insertBefore(nl(),i);n=new Jf(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=tl(l).nextSibling;tl(s).insertBefore(l,i),l=c}}}return n},We=(t,e,n=t)=>(t._$AI(e,n),t),tm={},ki=(t,e=tm)=>t._$AH=e,nm=t=>t._$AH,bi=t=>{t._$AR(),t._$AA.remove()},sl=(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 Hn{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=nm(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=sl(o,p,g),d=sl(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 bi(i[f]),f--;else bi(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&&bi(u)}return this.ut=o,ki(t,l),Y}}),Xn="dpk-changes",sm=(t,e,n)=>{const s=t.unread>0?e.changesUnread(t.unread):e.changes;return k`<button
|
|
1707
1707
|
class="dpk-chrome-action dpk-bell"
|
|
1708
1708
|
type="button"
|
|
1709
|
-
aria-controls=${
|
|
1709
|
+
aria-controls=${Xn}
|
|
1710
1710
|
aria-expanded=${t.open?"true":"false"}
|
|
1711
1711
|
aria-label=${s}
|
|
1712
1712
|
data-tooltip=${s}
|
|
@@ -1722,7 +1722,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1722
1722
|
@click=${n.readAll}
|
|
1723
1723
|
>
|
|
1724
1724
|
${e.changesReadAll}
|
|
1725
|
-
</button>`:b,
|
|
1725
|
+
</button>`:b,im=(t,e,n)=>k`<section class="dpk-changes-group" data-revision=${t.revision}>
|
|
1726
1726
|
<h3 class="dpk-changes-revision">
|
|
1727
1727
|
<span>${t.revision}</span>
|
|
1728
1728
|
${t.latest?k`<span class="dpk-changes-current">${e.changesCurrent}</span>`:b}
|
|
@@ -1740,13 +1740,13 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1740
1740
|
${s.body===null?b:k`<p class="dpk-change-body">${s.body}</p>`} ${il(s,e,n)}
|
|
1741
1741
|
</li>`)}
|
|
1742
1742
|
</ol>
|
|
1743
|
-
</section>`,
|
|
1743
|
+
</section>`,rm=(t,e,n)=>t.open?k`<div id=${Xn} class="dpk-changes" popover="manual" role="dialog" aria-label=${e.changesTitle}>
|
|
1744
1744
|
<div class="dpk-changes-head">
|
|
1745
1745
|
<h2 class="dpk-changes-title">${e.changesTitle}</h2>
|
|
1746
1746
|
${rl(t,e,n,"list")}
|
|
1747
1747
|
</div>
|
|
1748
|
-
${Ke(t.groups,s=>s.revision,s=>
|
|
1749
|
-
</div>`:b,
|
|
1748
|
+
${Ke(t.groups,s=>s.revision,s=>im(s,e,n))}
|
|
1749
|
+
</div>`:b,om=(t,e,n)=>k`<section
|
|
1750
1750
|
class="dpk-toasts"
|
|
1751
1751
|
aria-live="polite"
|
|
1752
1752
|
aria-label=${e.changes}
|
|
@@ -1778,14 +1778,14 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1778
1778
|
</button>`:b}
|
|
1779
1779
|
${rl(t,e,n,"toasts")}
|
|
1780
1780
|
</div>`:b}
|
|
1781
|
-
</section>`;function ol(t){return t===null?1:t===void 0?2:0}function al(t,e){const n=ol(t),s=ol(e);return n<s?-1:n>s?1:n!==0?0:t<e?-1:t>e?1:0}function
|
|
1781
|
+
</section>`;function ol(t){return t===null?1:t===void 0?2:0}function al(t,e){const n=ol(t),s=ol(e);return n<s?-1:n>s?1:n!==0?0:t<e?-1:t>e?1:0}function am(t,e,n){return n==="asc"?al(t,e):al(e,t)}function lm(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=am(c?l(s):s[l],c?l(i):i[l],a);if(d!==0)return d}return 0})}function ll(t,e){return lm(t,e,["asc"])}function vi(t,e,n){return n==null?Math.min(t,e):Math.min(Math.max(t,e),n)}const dm=5,xi=4,dl=8,cm=(t,e)=>{const n=e.badgeHeight,s=t.target.right+dl,i=t.target.left-dl,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+xi)},a-=c+dm}return r},cl=(t,e)=>{const n=t.map(()=>[]),s=ll(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+xi,c}),i=a}return{points:n,bottom:i-xi}},pm=(t,e)=>Math.max(0,cl(t,e).bottom),hm=(t,e)=>{const n=cl(t,e),s=Math.max(e.height,n.bottom);return t.map((i,r)=>(i.gutter?n.points[r]??[]:cm(i,e)).map((o,a)=>({x:vi(o.x,0,Math.max(0,e.width-(i.widths[a]??0))),y:vi(o.y,0,Math.max(0,s-e.badgeHeight))})))},pl="data-dpk-badge-gutter",um=new Set(["TABLE","THEAD","TBODY","TFOOT","TR","COLGROUP"]),gm=t=>um.has(t.localName.toUpperCase()),fm=t=>t.localName==="slot",hl=t=>t instanceof HTMLElement&&!gm(t)&&!fm(t),yi=/(auto|scroll|hidden|overlay)/,ul=3,Jn=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},gl=t=>getComputedStyle(t).position!=="static",fl=t=>{const e=getComputedStyle(t);return yi.test(e.overflow)||yi.test(e.overflowX)||yi.test(e.overflowY)},ml=t=>{for(let e=Jn(t);e!==null;e=Jn(e))if(hl(e)&&(gl(e)||fl(e)))return e;return mm(t)},mm=t=>{for(let e=Jn(t);e!==null;e=Jn(e))if(hl(e))return e;return null},es=new Map,km=t=>{const e=es.get(t);if(e!==void 0){e.count+=1;return}const n=gl(t)?null:t.style.position;n!==null&&(t.style.position="relative"),es.set(t,{count:1,previous:n})},bm=t=>{const e=es.get(t);e!==void 0&&(e.count-=1,!(e.count>0)&&(e.previous!==null&&(t.style.position=e.previous),es.delete(t)))},kl=(t,e)=>!(t instanceof HTMLElement)||t.offsetParent!==e,vm=(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}},xm=t=>`
|
|
1782
1782
|
.${t} {
|
|
1783
1783
|
position: absolute;
|
|
1784
1784
|
inset: 0;
|
|
1785
1785
|
z-index: 1;
|
|
1786
1786
|
pointer-events: none;
|
|
1787
1787
|
}
|
|
1788
|
-
`;class bl{#e;#
|
|
1788
|
+
`;class bl{#e;#n=new Map;#t=new Map;#s=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.#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.#d(r);continue}r!==void 0&&this.#h(r),this.#l(s,i)}for(const[s,i]of this.#n)n.has(s)||this.#h(i);for(const s of this.#t.values())s.parent.toggleAttribute(pl,s.records.some(i=>i.gutter));this.#o&&(this.#o=!1,this.#i=ul,this.#m())}#l(e,n){if(!e.target.isConnected)return;const s=ml(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:kl(e.target,s)};i.records.push(o),this.#n.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=ml(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.#p(i);const o=this.#c(s);o.layer.append(e.button),e.portal=o,e.measured=kl(n,s),o.records.push(e),this.#o=!0}#c(e){const n=this.#t.get(e);if(n!==void 0)return n;km(e);const s=document.createElement("div");s.className=this.#e.spec.portalClass;const i=document.createElement("style");i.textContent=`${xm(this.#e.spec.portalClass)}${this.#e.spec.styles}`,s.append(i),e.append(s);const r={parent:e,layer:s,records:[],scrolls:fl(e)};return this.#t.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.#p(n)}#p(e){e.layer.remove(),e.parent.removeAttribute(pl),e.parent.style.minHeight="",bm(e.parent),this.#t.delete(e.parent)}#f(){this.#$();for(const e of this.#t.values())this.#p(e);this.#t.clear(),this.#n.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=vm(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=pm(s,r),a=o>0&&!e.scrolls?`${Math.ceil(o)}px`:"";e.parent.style.minHeight!==a&&(e.parent.style.minHeight=a);const l=hm(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.#s===null&&(this.#s=requestAnimationFrame(this.#g))}#v(){this.#s!==null&&(cancelAnimationFrame(this.#s),this.#s=null)}#g=()=>{this.#s=null,this.#e.active()&&(this.#k(),this.#s=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.#n.values())this.#d(e);this.#k(),this.#x(),this.#o&&(this.#i=ul),this.#o=!1,this.#i>0&&this.#m()}};#$(){this.#i=0,this.#o=!1,this.#r!==null&&(cancelAnimationFrame(this.#r),this.#r=null)}}const ym="data-dpk-check",wm="off",$m=t=>t.closest(`[${ym}="${wm}"]`)===null,Sm=(t,e,n)=>{if(!e.enabled)return[];const s=[];for(const i of Ws(t,`[${at}]`)){const r=i.getAttribute(at);r===null||r===""||!$m(i)||s.push({index:s.length,target:i,ref:r,status:io(e,r,n)})}return s},Am=`
|
|
1789
1789
|
.dpk-check-badge {
|
|
1790
1790
|
position: absolute;
|
|
1791
1791
|
display: inline-flex;
|
|
@@ -1841,12 +1841,12 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1841
1841
|
transition: none;
|
|
1842
1842
|
}
|
|
1843
1843
|
}
|
|
1844
|
-
`;class
|
|
1844
|
+
`;class Em extends bl{constructor(e,n){super(e,{active:n.active,bindings:n.bindings,spec:{portalClass:"dpk-check-portal",styles:Am,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,Ar(i.status==="stale"?Ra():pt(),s)}}})}}class Cm{#e;#n;#t=Os;#s=null;constructor(e,n){this.#e=e,this.#n=n,e.addController(this)}hostConnected(){this.#s=this.#n.persist()?fe(so):Q(so),this.#t=this.#s.read(this.#i())??Os}hostDisconnected(){}get enabled(){return this.#t.enabled}get state(){return this.#t}setEnabled(e){e!==this.#t.enabled&&(this.#t=Gp(this.#t,e),this.#r(),this.#e.requestUpdate())}statusOf(e){return io(this.#t,e,this.#n.log())}toggle(e){const n=this.statusOf(e);this.#t=Vp(this.#t,e,n,Wp(this.#n.log())),this.#r(),this.#e.requestUpdate()}#i(){return`${this.#n.storageKey()}:check-mode`}#r(){this.#s?.write(this.#i(),this.#t)}}const wi=(t,e)=>typeof t=="object"&&t!==null&&e.every(n=>typeof Reflect.get(t,n)=="function"),Tm=t=>wi(t,["use"]),Rm=t=>wi(t,["anchorFor","canSendToClaude","sendToClaude"]),_m=t=>wi(t,["collection"]),vl=async(t,e)=>{try{return await t.use(e)}catch{return null}},Mm=(t,e)=>({async canSend(){try{return await t.canSendToClaude()==="available"}catch{return!1}},async send({brief:n,draft:s,anchor:i}){let r=zg(n);if(r===null){if(e===null)return{ok:!1,reason:"too_large"};try{const o=e.collection(Og).doc();await o.set({brief:n,draft:s,createdAt:new Date().toISOString()}),r=Dg(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:Ng(o)}}}}),Om=async t=>{if(!Tm(t))return null;const[e,n]=await Promise.all([vl(t,"comments"),vl(t,"db")]);return Rm(e)?Mm(e,_m(n)?n:null):null},Pm=()=>Reflect.get(globalThis,"claude");class Lm{#e;#n;#t=null;#s=!1;constructor(e,n=Pm){this.#e=e,this.#n=n,e.addController(this)}get available(){return this.#s}hostConnected(){this.#t??=Om(this.#n()),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.#s&&(this.#s=n,this.#e.requestUpdate())}}const $i="dev-process-kit:color-scheme",zm="(prefers-color-scheme: dark)",xl=()=>typeof matchMedia=="function"?matchMedia(zm):null,yl=()=>De(document.documentElement.dataset.theme)??(xl()?.matches===!0?"dark":"light");class Dm{#e;#n;#t=null;#s=null;#i="light";#r=null;#o=null;constructor(e,n){this.#e=e,this.#n=n,e.addController(this)}hostConnected(){this.#t===null&&(this.#t=this.#n()?fe(De):Q(De),this.#s=this.#t.read($i)),this.#i=yl(),this.#r=xl(),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 oo(this.#l(e))}toggle(e){this.#a(Yp(this.#l(e)))}pick(e,n){this.#a(ao(this.#l(e),n))}#a(e){e!==this.#s&&(this.#s=e,e===null?this.#t?.remove($i):this.#t?.write($i,e),this.#e.requestUpdate())}#l(e){return{preference:this.#s,authored:e,environment:this.#i}}#d=()=>{const e=yl();e!==this.#i&&(this.#i=e,this.#e.requestUpdate())}}const Im=(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},wl=(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)},$l=t=>wl(t.filter(e=>"elementActions"in e&&typeof e.id=="string"&&e.id.length>0),e=>e.id),Sl=(t,e)=>{for(const n of $l(t)){const s=ho(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)}},Nm=t=>{const e=Reflect.get(t,"elementActionResults");return Array.isArray(e)?e.flatMap(n=>{const s=C(po,n);return s.success?[s.output]:[]}):[]},qm=t=>{const e=[];for(const n of t){if(!("commentTargets"in n))continue;const s=C(go,n.commentTargets);s.success&&e.push(...s.output)}return{targets:wl(e,n=>n.value),providers:$l(t).map(n=>({id:n.id,results:Nm(n)}))}},le={margin:12,default:{edge:"right",offset:12}},Al=["top","right","bottom","left"],Si=t=>t==="top"||t==="bottom"?"horizontal":"vertical",El=(t,e,n)=>Si(t)==="horizontal"?{available:n.width,own:e.width}:{available:n.height,own:e.height},Cl=(t,e,n,s)=>{const{available:i,own:r}=El(t,n,s),o=le.margin,a=Math.max(o,i-r-le.margin);return Math.round(Math.min(a,Math.max(o,e)))},Tl=(t,e,n)=>({edge:t.edge,offset:Cl(t.edge,t.offset,e,n)}),Rl=(t,e,n)=>{const{margin:s}=le;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}}},Um=(t,e)=>{const{margin:n}=le;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}]}},Hm=(t,e)=>t==="right"&&e>0?e+le.margin:0,_l=1,jm=(t,e)=>Math.abs(t.left-e.left)<=_l&&Math.abs(t.top-e.top)<=_l,Bm=(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}),Fm=(t,e,n)=>{const s=Bm(t,e,n);let i="top";for(const r of Al)s[r]<s[i]&&(i=r);return i},Ml=(t,e,n)=>{const s=Fm(t,e,n),i=Si(s)==="horizontal"?t.left-n.left:t.top-n.top;return{edge:s,offset:Cl(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)}),Gm=(t,e,n,s,i)=>Ml(Ol(t,e,n),s,i),Wm={ArrowLeft:"left",ArrowRight:"right",ArrowUp:"top",ArrowDown:"bottom"},Km=(t,{key:e},n,s)=>{const i=Wm[e];if(i!==void 0)return Tl({edge:i,offset:t.offset},n,s);const{available:r,own:o}=El(t.edge,n,s),a=Math.max(le.margin,r-o-le.margin);return e==="Home"?{edge:t.edge,offset:le.margin}:e==="End"?{edge:t.edge,offset:a}:null},Vm=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}},Ym=t=>typeof t=="string"&&Al.some(e=>e===t),Pl=t=>{if(typeof t!="object"||t===null)return null;const{edge:e,offset:n}=t;return typeof n!="number"||!Number.isFinite(n)||!Ym(e)?null:{edge:e,offset:Math.round(n)}},Zm=t=>`dev-process-kit:menu:${t}`,Ll=t=>t===null?{width:0,height:0}:{width:t.width,height:t.height},Ai={kind:"idle"};class Qm{constructor(e,n){this.#t=null,this.#s="",this.#i=null,this.#r=Ai,this.#o="none",this.#a=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>this.#e.requestUpdate()),this.#l=null,this.grip={pointerdown:s=>{if(s.button!==0)return;s.preventDefault(),s.currentTarget instanceof Element&&s.currentTarget.setPointerCapture(s.pointerId);const i=this.#n.area(),r=this.#x(),o=Rl(this.#k(this.#p(),i),r,i);this.#r={kind:"dragging",pointerId:s.pointerId,drag:{startX:s.clientX,startY:s.clientY,box:o},size:r,box:o},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.#n.area(),r=Km(this.#k(this.#p(),i),s,this.#x(),i);r!==null&&(s.preventDefault(),this.#i=r,this.#h(),this.#e.requestUpdate())}},this.#d=()=>{this.#e.requestUpdate()},this.#e=e,this.#n=n,e.addController(this)}#e;#n;#t;#s;#i;#r;#o;#a;#l;hostConnected(){if(this.#t===null){const e=this.#n.persistKey();this.#t=e===null?Q(Pl):fe(Pl),this.#s=Zm(e??""),this.#i=this.#t.read(this.#s)??le.default}typeof window<"u"&&window.addEventListener("resize",this.#d)}hostDisconnected(){this.#r=Ai,this.#a?.disconnect(),this.#l=null,typeof window<"u"&&window.removeEventListener("resize",this.#d)}hostUpdated(){const e=this.#n.surface();this.#f(e);const n=this.#n.area(),s=this.#p(),i=this.#y(this.#k(s,n),s,n);if(s!==null&&i!==null&&jm(s,i)){this.#o="none";return}const r=s===null?"unmeasurable":"misplaced";this.#o!==r&&(this.#o=r,queueMicrotask(()=>this.#e.requestUpdate()))}get placement(){const e=this.#n.area(),n=this.#p(),s=this.#k(n,e);return{dock:s,box:this.#y(s,n,e),insets:Um(s,e)}}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=Ai;const i=this.#n.area();this.#i=n===null?Ml(s.box,s.size,i):Gm(s.drag,n.clientX,n.clientY,s.size,i),this.#h(),this.#e.requestUpdate()}#h(){this.#i!==null&&this.#t?.write(this.#s,this.#i)}#p(){const e=this.#n.surface();return e===null?null:Vm(e)}#f(e){e!==this.#l&&(this.#l!==null&&this.#a?.unobserve(this.#l),this.#l=e,e!==null&&this.#a?.observe(e))}#k(e,n){return Tl(this.#i??le.default,Ll(e),n)}#y(e,n,s){const i=this.#r;return i.kind==="dragging"?i.box:n===null?null:Rl(e,n,s)}#x(){return Ll(this.#p())}}const Xm=(t,e,n,s,i)=>{const r=Si(e.dock.edge),o=e.box;return k`<div
|
|
1845
1845
|
class="dpk-floating-menu"
|
|
1846
1846
|
data-edge=${e.dock.edge}
|
|
1847
1847
|
data-orientation=${r}
|
|
1848
1848
|
?data-dragging=${i}
|
|
1849
|
-
style=${o===null?
|
|
1849
|
+
style=${o===null?Jm(e.insets):`left: ${o.left}px; top: ${o.top}px`}
|
|
1850
1850
|
role="group"
|
|
1851
1851
|
aria-label=${t.menu}
|
|
1852
1852
|
>
|
|
@@ -1866,7 +1866,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1866
1866
|
</button>
|
|
1867
1867
|
${n.undoRedo} ${zl(r)} ${n.review} ${zl(r)}
|
|
1868
1868
|
<div class="dpk-menu-tools">${n.checkMode} ${n.notices}</div>
|
|
1869
|
-
</div>`},
|
|
1869
|
+
</div>`},Jm=t=>t.map(({side:e,value:n})=>`${e}: ${n}px`).join("; "),zl=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>`,Dl=z`
|
|
1870
1870
|
.dpk-floating-menu {
|
|
1871
1871
|
position: fixed;
|
|
1872
1872
|
z-index: 50;
|
|
@@ -1963,7 +1963,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1963
1963
|
max-width: calc(100vw - 24px);
|
|
1964
1964
|
}
|
|
1965
1965
|
}
|
|
1966
|
-
`,
|
|
1966
|
+
`,ek=t=>{const e=[t];t.shadowRoot&&e.push(t.shadowRoot);for(const n of t.querySelectorAll("*"))n.shadowRoot&&e.push(n.shadowRoot);return e},tk=(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 ek(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:Nn(h,n[h.id]),open:h.id===s})}}return o},nk=`
|
|
1967
1967
|
.dpk-grill-badge {
|
|
1968
1968
|
position: absolute;
|
|
1969
1969
|
display: inline-flex;
|
|
@@ -2020,7 +2020,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
2020
2020
|
transition: none;
|
|
2021
2021
|
}
|
|
2022
2022
|
}
|
|
2023
|
-
`,Il={childList:!0,subtree:!0,attributes:!0,attributeFilter:[jt]},Nl="dpk-grill-portal",
|
|
2023
|
+
`,Il={childList:!0,subtree:!0,attributes:!0,attributeFilter:[jt]},Nl="dpk-grill-portal",sk=t=>((t instanceof Element?t:t?.parentElement??null)?.closest(`.${Nl}`)??null)!==null;class ik extends bl{#e;#n;#t=null;#s="";constructor(e,n){super(e,{active:n.active,bindings:n.bindings,spec:{portalClass:Nl,styles:nk,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.#t?.disconnect(),this.#t=null}hostUpdated(){if(this.#t?.disconnect(),!this.#n.active()){super.hostUpdated();return}const e=this.#i();e!==this.#s&&(this.#s=e,this.#e.requestUpdate()),this.#t??=new MutationObserver(n=>{n.every(s=>sk(s.target))||(this.#e.requestUpdate(),this.refresh())}),this.#t.observe(this.#e,Il);for(const n of this.#e.querySelectorAll("*"))n.shadowRoot&&this.#t.observe(n.shadowRoot,Il);super.hostUpdated()}#i(){const e=this.#e.shadowRoot?.querySelectorAll(`[${jt}]`)??[];return Array.from(e,n=>n.getAttribute(jt)??"").join("|")}}const Ei=(t,e)=>e!==null&&dt(t,e)?e:t.questions[0]?.id??null,rk=(t,e)=>e!=="current"&&t.rounds[e]!==void 0?e:"current",ql=(t,e)=>t.options.map((n,s)=>({id:n.id,letter:eg(s),label:n.label,checked:e?.kind==="option"&&e.optionId===n.id})),ok=(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()]},ak=(t,e,n,s)=>{const i=ca(e,n),r=rk(e,s.round),o=ok(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=In(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:ql(d,d.answer),freeText:d.answer?.kind==="free"?d.answer.text:null}})}};const c=Ei(e,s.open);return{progress:a,rounds:o,view:{kind:"current",questions:e.questions.map(d=>{const h=n[d.id],f=In(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:ql(d,h),draft:h?.kind==="free"?h.text:"",freeSelected:h?.kind==="free",allowFreeText:d.freeText}})}}},lk=(t,e,n,s,i)=>k`
|
|
2024
2024
|
<div class="dpk-grill">
|
|
2025
2025
|
<header class="dpk-grill-head">
|
|
2026
2026
|
<h2>${t.grill}</h2>
|
|
@@ -2031,11 +2031,11 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
2031
2031
|
</div>`}
|
|
2032
2032
|
<div class="dpk-grill-list">
|
|
2033
2033
|
${e.view.kind==="past"?k`<p class="dpk-grill-round-note">${e.view.note}</p>`:b}
|
|
2034
|
-
${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=>
|
|
2034
|
+
${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=>dk(t,r,n)):Ke(e.view.questions,r=>r.id,pk)}
|
|
2035
2035
|
</div>
|
|
2036
2036
|
${s}
|
|
2037
2037
|
</div>
|
|
2038
|
-
`,
|
|
2038
|
+
`,dk=(t,e,n)=>k`
|
|
2039
2039
|
<section
|
|
2040
2040
|
class="dpk-grill-question"
|
|
2041
2041
|
data-question=${e.id}
|
|
@@ -2060,7 +2060,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
2060
2060
|
${e.description?k`<p class="dpk-grill-description">${e.description}</p>`:b}
|
|
2061
2061
|
${e.note?k`<p class="dpk-grill-note">${e.note}</p>`:b}
|
|
2062
2062
|
<div class="dpk-grill-choices" role="radiogroup" aria-label=${e.title}>
|
|
2063
|
-
${e.choices.map(s=>
|
|
2063
|
+
${e.choices.map(s=>ck(e.id,s,n))}
|
|
2064
2064
|
${e.allowFreeText?k`<label class="dpk-grill-choice" data-free=${String(e.freeSelected)}>
|
|
2065
2065
|
<input
|
|
2066
2066
|
type="radio"
|
|
@@ -2091,7 +2091,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
2091
2091
|
</button>`:b}
|
|
2092
2092
|
</div>`:b}
|
|
2093
2093
|
</section>
|
|
2094
|
-
`,
|
|
2094
|
+
`,ck=(t,e,n)=>k`
|
|
2095
2095
|
<label class="dpk-grill-choice" data-choice=${e.id}>
|
|
2096
2096
|
<input
|
|
2097
2097
|
type="radio"
|
|
@@ -2105,7 +2105,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
2105
2105
|
<span>${e.label}</span>
|
|
2106
2106
|
</span>
|
|
2107
2107
|
</label>
|
|
2108
|
-
`,
|
|
2108
|
+
`,pk=t=>k`
|
|
2109
2109
|
<details class="dpk-grill-question" data-past data-question=${t.id} data-answered=${String(t.answered)}>
|
|
2110
2110
|
<summary class="dpk-grill-heading">
|
|
2111
2111
|
<span class="dpk-grill-ref">${t.ref}</span>
|
|
@@ -2127,7 +2127,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
2127
2127
|
${t.freeText===null?b:k`<p class="dpk-grill-past-choice" data-checked="true">${t.freeText}</p>`}
|
|
2128
2128
|
</div>
|
|
2129
2129
|
</details>
|
|
2130
|
-
`,
|
|
2130
|
+
`,hk=2400;class uk{#e=Ug();#n=null;#t;constructor(e){this.#t=e,e.addController(this)}get state(){return this.#e}hostDisconnected(){this.#r()}async copy(e){this.#s({kind:"copy-started"});const n=this.#e.request,s=await Mn(e()).catch(()=>!1);this.#s({kind:"copy-finished",request:n,ok:s}),this.#i(n)}async send(e){if(this.#e.status.kind==="sending")return;this.#s({kind:"send-started"});const n=this.#e.request,s=await e().catch(()=>({ok:!1,reason:"error"}));this.#s({kind:"send-finished",request:n,outcome:s}),s.ok&&this.#i(n)}#s(e){(e.kind==="copy-started"||e.kind==="send-started")&&this.#r(),this.#e=Hg(this.#e,e),this.#t.requestUpdate()}#i(e){e===this.#e.request&&(this.#r(),this.#n=setTimeout(()=>{this.#n=null,this.#s({kind:"settled",request:e})},hk))}#r(){this.#n!==null&&clearTimeout(this.#n),this.#n=null}}class gk{#e;#n;#t=null;#s=null;constructor(e,n){this.#e=e,this.#n=n,e.addController(this)}hostConnected(){this.#t=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>this.#i())}hostUpdated(){const e=this.#n();if(e===this.#s){e&&this.#i();return}this.#s&&this.#t?.unobserve(this.#s),this.#s=e,e?(this.#t?.observe(e),this.#i()):this.#e.style.removeProperty("--dpk-header-height")}hostDisconnected(){this.#t?.disconnect(),this.#t=null,this.#s=null}#i(){this.#s&&this.#e.style.setProperty("--dpk-header-height",`${this.#s.getBoundingClientRect().height}px`)}}const Ci="dev-process-kit:locale";class fk{#e;#n;#t;#s;#i=null;#r=null;#o;#a;constructor(e,n,s,i){this.#e=e,this.#n=n,this.#t=s,this.#s=i,e.addController(this)}get authored(){if(this.#o===void 0)return Ln(Pn(this.#e));const e=this.#e.parentNode;return Ln(this.#o??(e===null?null:Pn(e)))}get locale(){return this.#a??this.#l()}#l(){return mu({preference:this.#r,authored:this.authored})}hostConnected(){this.#t()&&(this.#i===null&&(this.#i=this.#n()?fe(Zo):Q(Zo),this.#r=this.#i.read(Ci)),this.#o??=this.#e.getAttribute("lang"),this.#d())}pick(e){this.#t()&&(this.#r=ku(e,this.authored),this.#r===null?this.#i?.remove(Ci):this.#i?.write(Ci,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.#s(),(!s||this.#r!==null)&&document.dispatchEvent(new Event(Vs))}}const Ul=()=>vn(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 kk{#e;#n=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.#n!==n&&(this.#n=n,n.addEventListener("slotchange",this.#s));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()))}#s=()=>{queueMicrotask(()=>this.route())}}const Ti=16,bk=(t,e)=>t-e.bottom-Ti,vk=t=>t.top-Ti,xk=(t,e)=>{const n=bk(t,e),s=vk(e),i=n>=s,r=i?n:s;return{placement:i?"bottom-end":"top-end",height:Math.max(0,Math.min(t-2*Ti,r))}},yk=440,Hl=(t,e)=>e!==null&&t.includes(e);class wk{#e;#n=null;constructor(e,n){this.#e=n,e.addController(this)}hostConnected(){window.addEventListener("keydown",this.#s),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}=xk(window.innerHeight,i);this.#n=js(e,s,{width:yk,height:o},{placement:r});return}this.#t(),_n(e)}}hostDisconnected(){window.removeEventListener("keydown",this.#s),document.removeEventListener("pointerdown",this.#i,!0),this.#t()}#t(){this.#n?.(),this.#n=null}#s=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();Hl(n,this.#e.surface())||Hl(n,this.#e.trigger())||this.#e.close()}}const $k=t=>k`
|
|
2131
2131
|
<dialog
|
|
2132
2132
|
id=${t.id??b}
|
|
2133
2133
|
class="dpk-dialog"
|
|
@@ -2160,7 +2160,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
2160
2160
|
${t.footer}
|
|
2161
2161
|
</footer>`}
|
|
2162
2162
|
</dialog>
|
|
2163
|
-
`,Ri="dpk-settings",Yt="display",
|
|
2163
|
+
`,Ri="dpk-settings",Yt="display",Sk="appearance",Ak=(t,e)=>k`<button
|
|
2164
2164
|
class="dpk-chrome-action dpk-settings-trigger"
|
|
2165
2165
|
type="button"
|
|
2166
2166
|
aria-controls=${Ri}
|
|
@@ -2171,7 +2171,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
2171
2171
|
@click=${e.toggle}
|
|
2172
2172
|
>
|
|
2173
2173
|
${Vg()}
|
|
2174
|
-
</button>`,
|
|
2174
|
+
</button>`,Ek=(t,e,n,s)=>t.length<2?b:k`<nav class="dpk-dialog-nav" part="nav" aria-label=${n}>
|
|
2175
2175
|
${t.map(i=>k`<button
|
|
2176
2176
|
class="dpk-dialog-nav-item"
|
|
2177
2177
|
type="button"
|
|
@@ -2181,12 +2181,12 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
2181
2181
|
>
|
|
2182
2182
|
${i.label}
|
|
2183
2183
|
</button>`)}
|
|
2184
|
-
</nav>`,
|
|
2184
|
+
</nav>`,Ck=t=>{const e=Tk(t.sections),n=e.find(r=>r.id===t.activeSection)??e[0],s=n?.id??Yt,i=n===void 0?b:n.id===Yt?t.display:n.render();return $k({id:t.id,size:"md",fixedHeight:e.length>1,label:t.label,closeLabel:t.closeLabel,controller:t.controller,nav:Ek(e,s,t.sectionsLabel,t.onPick),content:t.open?i:b,footer:t.open?t.footer:void 0})},Tk=t=>{const e=new Set,n=[];for(const s of t)e.has(s.id)||(e.add(s.id),n.push(s));return n},Rk=(t,e,n)=>k`
|
|
2185
2185
|
<div class="dpk-settings-list" role="group" aria-label=${e.settings}>
|
|
2186
|
-
${t.items.map(s=>
|
|
2186
|
+
${t.items.map(s=>_k(s,n))}
|
|
2187
2187
|
</div>
|
|
2188
2188
|
${t.note===void 0?b:k`<p class="dpk-settings-note">${t.note}</p>`}
|
|
2189
|
-
`,
|
|
2189
|
+
`,_k=(t,e)=>k`<button
|
|
2190
2190
|
class="dpk-settings-option"
|
|
2191
2191
|
type="button"
|
|
2192
2192
|
role="switch"
|
|
@@ -2261,7 +2261,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
2261
2261
|
outline: none;
|
|
2262
2262
|
box-shadow: var(--dpk-focus);
|
|
2263
2263
|
}
|
|
2264
|
-
`,Bl=[ft,
|
|
2264
|
+
`,Bl=[ft,li,z`
|
|
2265
2265
|
:host {
|
|
2266
2266
|
display: block;
|
|
2267
2267
|
min-height: 100%;
|
|
@@ -2616,12 +2616,15 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
2616
2616
|
.dpk-toasts {
|
|
2617
2617
|
position: fixed;
|
|
2618
2618
|
top: 64px;
|
|
2619
|
-
right:
|
|
2619
|
+
/* The floating menu docks at the right edge by default: the toasts step
|
|
2620
|
+
aside by the room it takes (--dpk-floating-menu-clearance), so neither
|
|
2621
|
+
their text nor their Show button sits under it. */
|
|
2622
|
+
right: calc(16px + var(--dpk-floating-menu-clearance, 0px));
|
|
2620
2623
|
z-index: 70;
|
|
2621
2624
|
display: grid;
|
|
2622
2625
|
justify-items: end;
|
|
2623
2626
|
gap: 8px;
|
|
2624
|
-
width: min(360px, calc(100vw - 32px));
|
|
2627
|
+
width: min(360px, calc(100vw - 32px - var(--dpk-floating-menu-clearance, 0px)));
|
|
2625
2628
|
pointer-events: none;
|
|
2626
2629
|
}
|
|
2627
2630
|
|
|
@@ -3817,7 +3820,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
3817
3820
|
order: 1;
|
|
3818
3821
|
}
|
|
3819
3822
|
}
|
|
3820
|
-
`],
|
|
3823
|
+
`],de={default:320,min:140,step:24,largeStep:96},Mk=160,Fl=800,_i=t=>Math.max(de.min,Math.round(t-Mk)),yt=(t,e)=>Math.round(Math.min(_i(e),Math.max(de.min,t))),Ok=(t,e,n)=>yt(t.startHeight+t.startY-e,n),Pk=(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 _i(s);default:return null}},Gl=t=>typeof t=="number"&&Number.isFinite(t)&&t>=de.min?Math.round(t):null,Lk=()=>typeof window>"u"?Fl:window.innerHeight||document.documentElement.clientHeight||Fl,zk=t=>`dev-process-kit:supplements-height:${t}`,Mi={kind:"idle"};class Dk{constructor(e,n){this.#t=null,this.#s="",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(Ok(i,s.clientY,this.#c()))},pointerup:s=>this.#a(s),pointercancel:s=>this.#a(s),lostpointercapture:s=>this.#a(s),keydown:s=>{const i=Pk(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.#n=n,e.addController(this)}#e;#n;#t;#s;#i;#r;hostConnected(){if(this.#t===null){const e=this.#n.persistKey();this.#t=e===null?Q(Gl):fe(Gl),this.#s=zk(e??""),this.#i=this.#t.read(this.#s)}typeof window<"u"&&window.addEventListener("resize",this.#o)}hostDisconnected(){this.#r=Mi,typeof window<"u"&&window.removeEventListener("resize",this.#o)}get height(){return yt(this.#i??de.default,this.#c())}get max(){return _i(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=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.#s):this.#t?.write(this.#s,this.#i)}#c(){return this.#n.viewportHeight?.()??Lk()}}const Oi="supplement",Wl="memo",Ik=(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}}),Nk=(t,e)=>`.dpk-supplements-body ::slotted(:not(:nth-child(${[...t.children].indexOf(e.element)+1}))) { display: none !important; }`,qk={selected:null,open:!1},Uk=(t,e)=>t.open?e.find(n=>n.element===t.selected)??null:null,Hk=(t,e)=>({selected:e,open:!(t.open&&t.selected===e)}),jk=(t,e)=>t.open?{...t,open:!1}:{selected:e.some(s=>s.element===t.selected)?t.selected:e[0]?.element??null,open:!0},Bk=30,Fk=Oe(v(),R({base:v(),value:v()})),Kl=t=>{const e=C(Fk,t);return e.success?e.output:null},Gk=t=>t.key===void 0?JSON.stringify(["field",t.hosts,t.name,t.base]):JSON.stringify(["key",t.key,t.name]),Wk=(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-Bk)))},Kk=(t,e)=>{if(!(e in t))return t;const{[e]:n,...s}=t;return s},Vk=(t,e,n)=>{const s=t[e];return s===void 0||s.base!==n||s.value===n?null:s.value},Yk=new Set(["text","search","url","email","tel"]),Vl=t=>t instanceof HTMLTextAreaElement||t instanceof HTMLInputElement&&Yk.has(t.type)?t:null,Zk=(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},Qk=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)}},Xk=t=>t.composedPath().find(e=>e instanceof Element&&e.hasAttribute("data-dpk-text-discard"))??null,Jk=(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[]},eb=t=>t.getAttribute("aria-label")??(t.placeholder||t.name||t.localName),Pi=t=>typeof t=="string"?[t]:Array.isArray(t)?t.flatMap(Pi):typeof t=="object"&&t!==null?Object.values(t).flatMap(Pi):[],Yl=t=>t.replace(/\s+/g," ").trim();class tb{#e;#n;#t=null;#s="";#i=new WeakMap;#r=new Set;constructor(e,n){this.#e=e,this.#n=n,e.addController(this)}hostConnected(){this.#t===null&&(this.#t=this.#n.persist()?kf(Kl):Q(Kl),this.#s=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(Pi).map(Yl));this.#o([...this.#r].filter(s=>n.has(Yl(s.value))))}#o(e){for(const n of e){this.#r.delete(n);const s=this.#i.get(n);s!==void 0&&this.#h(Kk(this.#c(),s.id))}}#a=e=>{const n=Xk(e);n!==null&&this.#o(Jk(n,this.#r))};#l=e=>{const n=Vl(e.composedPath()[0]);if(n===null||this.#r.has(n))return;const s=Zk(this.#e,n);if(s===null)return;const i=Qk(n),r=n.value,o=Gk({...i===void 0?{}:{key:i},hosts:s,name:eb(n),base:r});this.#i.set(n,{id:o,base:r});const a=Vk(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=Vl(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.#h(Wk(this.#c(),s.id,{base:s.base,value:n.value}))}};#c(){return this.#t?.read(this.#s)??{}}#h(e){Object.keys(e).length===0?this.#t?.remove(this.#s):this.#t?.write(this.#s,e)}}const nb=(t,e,n,s)=>k`<div class="dpk-undo-redo" role="group" aria-label=${n.undoRedo}>
|
|
3821
3824
|
<button
|
|
3822
3825
|
class="dpk-chrome-action dpk-undo"
|
|
3823
3826
|
type="button"
|
|
@@ -3838,7 +3841,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
3838
3841
|
>
|
|
3839
3842
|
${lf()}
|
|
3840
3843
|
</button>
|
|
3841
|
-
</div>`,tb=t=>{const e=t[0];return e instanceof HTMLElement?e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.tagName==="SELECT"?!0:e.isContentEditable:!1},nb=t=>{const e=t.key.toLowerCase();return(t.metaKey||t.ctrlKey)&&!t.altKey&&!t.shiftKey&&e==="z"},sb=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 ib{#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||tb(e.composedPath())||(sb(e)?(e.preventDefault(),this.#e.redo()):nb(e)&&(e.preventDefault(),this.#e.undo()))}}const rb=`script[type="application/json"]:not([${Qr}]):not([${Zs}])`,ob=`script[type="application/json"][${Zs}]`,ab=30,Zl={width:360,height:480},Li="dpk-review",lb=t=>{try{return t.matches(":popover-open")}catch{return!1}},db=()=>new Promise(t=>requestAnimationFrame(()=>t())),Ql=t=>t>0?String(t):null;class ds extends J{static{this.styles=[Bl,Tr,Rr,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=lt;#s=null;#t=null;#n="current";#i=null;#r=null;#o=[];#a=[];#l={open:e=>this.#ce(e),answer:(e,n)=>this.#Re(e,n),next:e=>this.#ue(e),pickRound:e=>{this.#n=e,this.#r=null,this.requestUpdate()}};#d=!1;#c=new fk(this);#p=Ik;#h=new Lk(this,{persistKey:()=>this.storage==="off"||this.storage==="memory"?null:this.#ee});#k=new zm(this,()=>this.storage!=="off"&&this.storage!=="memory");#m=new Pm(this);#y=new pk(this);#b=new Jk(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",storageKey:()=>`${this.storageKey??Bt(this.#ee)}:unsent-text`});#v=null;#u=new Qf(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===Qn||n.classList.contains("dpk-bell"))),show:e=>{this.#De(e)}});#f={toggleList:()=>this.#u.toggleList(),openList:()=>this.#u.send({kind:"open-list"}),show:e=>this.#u.show(e),dismiss:e=>this.#u.send({kind:"close-toast",key:e}),readAll:()=>this.#u.send({kind:"read-all"}),pause:e=>this.#u.pause(e),resume:e=>this.#u.resume(e)};#w=new Em(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",storageKey:()=>this.storageKey??Bt(this.definition.name),log:()=>this.#u.log});#$=new ko(this);#T=new Yn(this);#P=new fu(this,{state:()=>this.controller.derivation.state,messages:()=>Qo(this.locale)});#U=Yt;#W=new Tg(this,{dialog:()=>this.renderRoot.querySelector(`#${Ri}`),open:()=>this.settingsOpen,dismiss:()=>{this.settingsOpen=!1}});#L={undo:()=>this.controller.undo(),redo:()=>this.controller.redo()};#H=new Ym(this,{surface:()=>this.renderRoot.querySelector(".dpk-floating-menu"),area:()=>this.#le(),persistKey:()=>this.storage==="off"||this.storage==="memory"?null:this.#ee});constructor(){super(),this.settingsOpen=!1,new xk(this,{surface:()=>this.renderRoot.querySelector(`#${Li}`),anchor:()=>this.renderRoot.querySelector(".dpk-floating-menu"),trigger:()=>this.renderRoot.querySelector(".dpk-review-toggles"),open:()=>this.notesOpen,close:()=>{this.notesOpen=!1}}),new nk(this,{active:()=>this.#e.questions.length>0,bindings:()=>this.#o,open:e=>this.#ce(e),labelOf:e=>O(this.locale).grillOpen(`${e.ref} \xB7 ${e.title}`),gutterOf:e=>this.contains(e)&&this.#Me(e)==="main"}),new Am(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 hk(this,()=>this.#g===null?this.renderRoot.querySelector(".dpk-header"):null)}#se=new Kt(this);#ie=new Kt(this);#re=new Kt(this);#j=new uk(this,()=>this.storage!=="off"&&this.storage!=="memory",()=>this.#g===null,()=>{this.#x?.setTemplate(this.definition),this.#x?.setGrill({grill:this.#e,locale:this.locale})});#B;#x;#S=Pt;#z=null;#R=new Set;#_=new Vf({host:this,name:()=>`<${this.tagName.toLowerCase()}>`,script:()=>this.scriptOf(rb),parse:e=>this.definition.parseBase(e),empty:()=>this.definition.emptyBase(),optional:()=>Lf(this),onChange:e=>this.#Ze(e)});#K;#D;#I=[];#V;#oe=new Promise(e=>{this.#V=e});#Y;#g=null;#E;#M=!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.#x?.definition??this.definition}connectedCallback(){Pf(),this.#g=gi(this),this.toggleAttribute("data-dpk-page-content",this.#g!==null),this.#g===null&&!this.#M&&(this.#M=!0,new ib(this,this.#L)),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.#N(),this.#g===null&&this.hashMode!=="off"&&window.addEventListener("hashchange",this.#we),this.addEventListener("click",this.#Ee),this.addEventListener("dpk-comment-targets-change",this.#C),this.addEventListener("dpk-comment-request",this.#$e),this.addEventListener("dpk-comment-submit",this.#Se),this.addEventListener("dpk-element-action",this.#Ae),this.#D??=new MutationObserver(this.#C),this.#C()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("hashchange",this.#we),this.removeEventListener("click",this.#Ee),this.#_.disconnect(),this.#D?.disconnect(),this.removeEventListener("dpk-comment-targets-change",this.#C),this.removeEventListener("dpk-comment-request",this.#$e),this.removeEventListener("dpk-comment-submit",this.#Se),this.removeEventListener("dpk-element-action",this.#Ae)}#N(e=0){if(this.#x){this.#Z();return}if(this.childNodes.length===0&&e<2){queueMicrotask(()=>this.#N(e+1));return}const n=this.pendingStart();if(n!==null){n.then(()=>this.#N(e));return}this.#Ke()}#Z(){this.#K||(this.#K=this.#x?.subscribe(()=>this.#Qe()))}willUpdate(){const e=this.#A();this.dataset.theme=e?.theme()??this.#k.resolve(De(this.theme)),e!==null&&this.#x&&this.#E!==e.locale()&&(this.#E=e.locale(),this.#x.setTemplate(this.definition))}updated(){this.#et(),this.#Je(),this.#ze(),this.#_e()}get api(){return this.#Y??=this.#We(),this.#Y}get controller(){if(!this.#x)throw new Error(`<${this.tagName.toLowerCase()}> is not initialized yet`);return this.#x}get derivation(){return this.controller.derivation}get navigation(){return this.#g===null?this.#S:this.#q()}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.#pe(s=>s.dispatch(this.#ve(e)));const n=this.controller.dispatch(e);return n.ok&&this.#b.settle([e.payload,e.note]),n.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:n.issues},bubbles:!0,composed:!0})),this.#O()),n}dispatchBatch(e){if(this.#g!==null)return this.#pe(s=>s.dispatchBatch(e.map(i=>this.#ve(i))));const n=this.controller.dispatchBatch(e);return n.ok&&this.#b.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.#O()),n}editComment(e,n){if(this.#g!==null)return this.#pe(i=>i.editComment(e,n));const s=this.controller.editComment(e,n);return s.ok&&this.#b.settle([n]),s.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:s.issues},bubbles:!0,composed:!0})),this.#O()),s}removeAction(e){this.#g!==null?this.#A()?.removeAction(e):this.controller.removeAction(e)}clearActions(){if(this.#g===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.#g!==null){this.#A()?.navigate(this.#xe(e),n);return}const s=nt(this.#q());this.#S=xn(this.#S,e,this.definition.navigationHierarchy),this.#ne(n.replace??!1);const i=nt(this.#q());this.requestUpdate(),s!==i&&(this.#O(),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.#xe(e));const s=this.#q();return nt(this.definition.resolveNavigation(this.derivation.state,xn(s,e,this.definition.navigationHierarchy)))}requestComment(e){if(this.#g!==null){this.#A()?.requestComment(P(this.#be(e,"page")));return}this.#z=typeof e=="string"?e:P(e),this.notesOpen=!0,this.reviewSection="comments",this.requestUpdate()}get settingsSections(){if(!this.#x)return[];const e=this.#te();return this.#ke(this.renderSettingsSections(e))}openSettings(e=Yt){const n=this.#Fe();if(n===null||n===this){this.#U=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.#m.available}sendToClaude(){return this.#m.send({brief:this.api.exportBrief(),draft:Cs(this.derivation.actions),anchor:this})}renderReviewPanel(e){return k`<dpk-comment-panel
|
|
3844
|
+
</div>`,sb=t=>{const e=t[0];return e instanceof HTMLElement?e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.tagName==="SELECT"?!0:e.isContentEditable:!1},ib=t=>{const e=t.key.toLowerCase();return(t.metaKey||t.ctrlKey)&&!t.altKey&&!t.shiftKey&&e==="z"},rb=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 ob{#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||sb(e.composedPath())||(rb(e)?(e.preventDefault(),this.#e.redo()):ib(e)&&(e.preventDefault(),this.#e.undo()))}}const ab=`script[type="application/json"]:not([${Qr}]):not([${Qs}])`,lb=`script[type="application/json"][${Qs}]`,db=30,Zl={width:360,height:480},Li="dpk-review",cb=t=>{try{return t.matches(":popover-open")}catch{return!1}},pb=()=>new Promise(t=>requestAnimationFrame(()=>t())),Ql=t=>t>0?String(t):null;class cs extends J{static{this.styles=[Bl,Tr,Rr,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=lt;#n=null;#t=null;#s="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.#s=e,this.#r=null,this.requestUpdate()}};#d=!1;#c=new kk(this);#h=qk;#p=new Dk(this,{persistKey:()=>this.storage==="off"||this.storage==="memory"?null:this.#J});#f=new Dm(this,()=>this.storage!=="off"&&this.storage!=="memory");#k=new Lm(this);#y=new uk(this);#x=new tb(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",storageKey:()=>`${this.storageKey??Bt(this.#J)}:unsent-text`});#v=null;#g=new Xf(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===Xn||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 Cm(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",storageKey:()=>this.storageKey??Bt(this.definition.name),log:()=>this.#g.log});#$=new ko(this);#C=new Zn(this);#P=new fu(this,{state:()=>this.controller.derivation.state,messages:()=>Qo(this.locale)});#H=Yt;#Y=new Tg(this,{dialog:()=>this.renderRoot.querySelector(`#${Ri}`),open:()=>this.settingsOpen,dismiss:()=>{this.settingsOpen=!1}});#L={undo:()=>this.controller.undo(),redo:()=>this.controller.redo()};#z=new Qm(this,{surface:()=>this.renderRoot.querySelector(".dpk-floating-menu"),area:()=>this.#de(),persistKey:()=>this.storage==="off"||this.storage==="memory"?null:this.#J});constructor(){super(),this.settingsOpen=!1,new wk(this,{surface:()=>this.renderRoot.querySelector(`#${Li}`),anchor:()=>this.renderRoot.querySelector(".dpk-floating-menu"),trigger:()=>this.renderRoot.querySelector(".dpk-review-toggles"),open:()=>this.notesOpen,close:()=>{this.notesOpen=!1}}),new ik(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 Em(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 gk(this,()=>this.#u===null?this.renderRoot.querySelector(".dpk-header"):null)}#ne=new Kt(this);#se=new Kt(this);#ie=new Kt(this);#j=new fk(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;#T=new Set;#R=new Yf({host:this,name:()=>`<${this.tagName.toLowerCase()}>`,script:()=>this.scriptOf(ab),parse:e=>this.definition.parseBase(e),empty:()=>this.definition.emptyBase(),optional:()=>Lf(this),onChange:e=>this.#et(e)});#Z;#I;#N=[];#Q="";#F;#re=new Promise(e=>{this.#F=e});#G;#_=new Promise(e=>{this.#G=e});#M;#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(){Pf(),this.#u=gi(this),this.toggleAttribute("data-dpk-page-content",this.#u!==null),this.#u===null&&!this.#K&&(this.#K=!0,new ob(this,this.#L)),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.#R.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=`${Hm(this.#z.placement.dock.edge,n)}px`;this.style.getPropertyValue("--dpk-floating-menu-clearance")!==i&&this.style.setProperty("--dpk-floating-menu-clearance",i)}get api(){return this.#M??=this.#Ze(),this.#M}get started(){return this.#_}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.#O()),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.#O()),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.#O()),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=xn(this.#S,e,this.definition.navigationHierarchy),this.#te(n.replace??!1);const i=nt(this.#U());this.requestUpdate(),s!==i&&(this.#O(),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,xn(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=Yt){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:Ts(this.derivation.actions),anchor:this})}renderReviewPanel(e){return k`<dpk-comment-panel
|
|
3842
3845
|
.definition=${this.controller.definition}
|
|
3843
3846
|
.state=${e.state}
|
|
3844
3847
|
.navigation=${e.navigation}
|
|
@@ -3846,13 +3849,13 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
3846
3849
|
.issues=${this.controller.lastIssues}
|
|
3847
3850
|
.exportBrief=${()=>this.api.exportBrief()}
|
|
3848
3851
|
.sendToClaude=${this.canSendToClaude?()=>this.sendToClaude():void 0}
|
|
3849
|
-
.pendingTarget=${this.#
|
|
3850
|
-
.section=${this.#
|
|
3852
|
+
.pendingTarget=${this.#D}
|
|
3853
|
+
.section=${this.#V==="questions"?null:this.#V}
|
|
3851
3854
|
.onDelete=${n=>this.removeAction(n)}
|
|
3852
3855
|
.onEditComment=${(n,s)=>this.editComment(n,s)}
|
|
3853
3856
|
.onClear=${()=>this.clearActions()}
|
|
3854
|
-
.onComment=${(n,s)=>{const i=this.dispatch({type:H,target:n,payload:{body:s}});return i.ok&&(this.#
|
|
3855
|
-
></dpk-comment-panel>`}renderChrome(e,n){if(this.#
|
|
3857
|
+
.onComment=${(n,s)=>{const i=this.dispatch({type:H,target:n,payload:{body:s}});return i.ok&&(this.#D=null),i}}
|
|
3858
|
+
></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=tk(this,this.#e,this.derivation.answers,this.notesOpen&&this.reviewSection==="questions"?Ei(this.#e,this.#t):null,(l,c)=>this.grillRefsOf(l,c)),this.#a=Sm(this,this.#w.state,this.#g.log);const o=this.definition.title(e.state),a=O(this.locale);return k`
|
|
3856
3859
|
<dpk-internal-layout-app class="dpk-shell">
|
|
3857
3860
|
<header slot="header" class="dpk-header">
|
|
3858
3861
|
<span class="dpk-brand" aria-hidden="true">${cf()}</span>
|
|
@@ -3864,17 +3867,17 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
3864
3867
|
${n.header??b}
|
|
3865
3868
|
<slot name="header"></slot>
|
|
3866
3869
|
</div>
|
|
3867
|
-
<div class="dpk-header-tools">${this.#
|
|
3868
|
-
${
|
|
3870
|
+
<div class="dpk-header-tools">${this.#ve()} ${this.#Fe()}</div>
|
|
3871
|
+
${Ak(a,this.settingsTriggerIntents)}
|
|
3869
3872
|
</header>
|
|
3870
|
-
${this.#
|
|
3873
|
+
${this.#ge(n)} ${this.#fe(n)}
|
|
3871
3874
|
<div slot="overlay" class="dpk-overlay">
|
|
3872
|
-
${this.#
|
|
3873
|
-
${this.#
|
|
3874
|
-
${this.#$.render()} ${this.#
|
|
3875
|
+
${this.#le(i,r)} ${this.#Me(e)}
|
|
3876
|
+
${this.#He(s)} ${this.#Ie()} ${this.#Ne()}
|
|
3877
|
+
${this.#$.render()} ${this.#Ge(e)}
|
|
3875
3878
|
</div>
|
|
3876
3879
|
</dpk-internal-layout-app>
|
|
3877
|
-
`}renderHeaderLead(e){return b}#
|
|
3880
|
+
`}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`
|
|
3878
3881
|
<dpk-internal-layout-app class="dpk-shell" data-board>
|
|
3879
3882
|
<div slot="header" class="dpk-board-bar" ?hidden=${!n}>
|
|
3880
3883
|
<div class="dpk-header-slot">
|
|
@@ -3882,9 +3885,9 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
3882
3885
|
<slot name="header"></slot>
|
|
3883
3886
|
</div>
|
|
3884
3887
|
</div>
|
|
3885
|
-
${this.#
|
|
3888
|
+
${this.#ge(e)} ${this.#fe(e)}
|
|
3886
3889
|
</dpk-internal-layout-app>
|
|
3887
|
-
`}#
|
|
3890
|
+
`}#le(e,n){const s=O(this.locale);return Xm(s,this.#z.placement,{undoRedo:nb(this.controller.canUndo,this.controller.canRedo,s,this.#L),review:this.#_e(e,n),checkMode:this.#je(),notices:this.#De()},{grip:this.#z.grip},this.#z.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]:{...pi,persistKey:a===null?null:`${a}:aside`}};return k`<dpk-internal-layout-sidebar
|
|
3888
3891
|
class="dpk-body"
|
|
3889
3892
|
.left=${l.left}
|
|
3890
3893
|
.right=${l.right}
|
|
@@ -3898,17 +3901,17 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
3898
3901
|
${this.hasAsideContent()?k`<div slot=${r} class="dpk-aside"><slot name="aside"></slot></div>`:b}
|
|
3899
3902
|
<main class="dpk-main">
|
|
3900
3903
|
<div class="dpk-main-body" ?data-fill=${o}>
|
|
3901
|
-
${this.#
|
|
3904
|
+
${this.#R.error?k`<div class="dpk-banner" role="alert">
|
|
3902
3905
|
<strong>${n.baseDataError}</strong>
|
|
3903
|
-
<code>${this.#
|
|
3906
|
+
<code>${this.#R.error}</code>
|
|
3904
3907
|
</div>`:b}
|
|
3905
|
-
${this.#
|
|
3908
|
+
${this.#n===null?b:k`<div class="dpk-banner" role="alert">
|
|
3906
3909
|
<strong>${n.grillError}</strong>
|
|
3907
|
-
<code>${this.#
|
|
3910
|
+
<code>${this.#n}</code>
|
|
3908
3911
|
</div>`}
|
|
3909
|
-
${this.#
|
|
3912
|
+
${this.#g.error===null?b:k`<div class="dpk-banner" role="alert">
|
|
3910
3913
|
<strong>${n.changesError}</strong>
|
|
3911
|
-
<code>${this.#
|
|
3914
|
+
<code>${this.#g.error}</code>
|
|
3912
3915
|
</div>`}
|
|
3913
3916
|
${e.main??b}
|
|
3914
3917
|
<slot name="main"></slot>
|
|
@@ -3917,12 +3920,12 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
3917
3920
|
<slot name="preview"></slot>
|
|
3918
3921
|
</section>
|
|
3919
3922
|
</div>
|
|
3920
|
-
${this.#
|
|
3923
|
+
${this.#st(n)}
|
|
3921
3924
|
</main>
|
|
3922
|
-
</dpk-internal-layout-sidebar>`}#
|
|
3925
|
+
</dpk-internal-layout-sidebar>`}#fe(e){return e.footer||this.hasFooterContent()?k`<footer slot="footer" class="dpk-footer">
|
|
3923
3926
|
${e.footer??b}
|
|
3924
3927
|
<slot name="footer"></slot>
|
|
3925
|
-
</footer>`:b}#
|
|
3928
|
+
</footer>`:b}#ce(e,n,s,i){const r=this.notesOpen&&this.#V===e;return k`<button
|
|
3926
3929
|
class="dpk-chrome-action dpk-review-toggle"
|
|
3927
3930
|
type="button"
|
|
3928
3931
|
data-section=${e}
|
|
@@ -3933,11 +3936,11 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
3933
3936
|
@click=${()=>{this.notesOpen=!r,this.reviewSection=e}}
|
|
3934
3937
|
>
|
|
3935
3938
|
${s} ${i===null?b:k`<span class="dpk-review-badge">${i}</span>`}
|
|
3936
|
-
</button>`}#
|
|
3937
|
-
${this.#
|
|
3938
|
-
${this.#
|
|
3939
|
-
${i.total===0?b:this.#
|
|
3940
|
-
</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=>Z(o)&&!i.has(o.id)).length;return{changeCount:n-s-r,commentCount:s}}#
|
|
3939
|
+
</button>`}#_e(e,n){const s=O(this.locale),i=ca(this.#e,this.derivation.answers);return k`<div class="dpk-review-toggles" role="group" aria-label=${s.review}>
|
|
3940
|
+
${this.#ce("comments",s.reviewComments,Bn(),Ql(n))}
|
|
3941
|
+
${this.#ce("changes",s.reviewChanges,Kg(),Ql(e))}
|
|
3942
|
+
${i.total===0?b:this.#ce("questions",s.grill,Ra(),`${i.answered}/${i.total}`)}
|
|
3943
|
+
</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=>Z(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
|
|
3941
3944
|
id=${Li}
|
|
3942
3945
|
class="dpk-review"
|
|
3943
3946
|
popover="manual"
|
|
@@ -3945,11 +3948,11 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
3945
3948
|
aria-label=${i}
|
|
3946
3949
|
data-section=${s}
|
|
3947
3950
|
>
|
|
3948
|
-
${s==="questions"?this.#
|
|
3951
|
+
${s==="questions"?this.#Oe(e.actions.length):b}
|
|
3949
3952
|
${this.renderReviewPanel(e)}
|
|
3950
|
-
</div>`}get#
|
|
3951
|
-
${this.#
|
|
3952
|
-
</div>`}#
|
|
3953
|
+
</div>`}get#V(){return this.reviewSection==="questions"&&this.#e.questions.length===0?"comments":this.reviewSection}#Oe(e){const n=O(this.locale),s=ak(n,this.#e,this.derivation.answers,{open:this.#t,round:this.#s}),i=this.#ke(e,!1);return lk(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.#s="current",this.#t=e,this.#r=null,this.requestUpdate()}#Pe(e,n){this.dispatch(rg(e,n)).ok&&(n.kind==="option"?this.#me(e):n.kind==="free"&&n.text===""&&(this.#i=e))}#me(e){const n=tg(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=Ei(this.#e,this.#t);if(this.#s!=="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&&As(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?sm(e,O(this.locale),this.#m):b}#Ie(){const e=this.#g.view;return e?rm(e,O(this.locale),this.#m):b}#Ne(){const e=this.#g.view;return e?om(e,O(this.locale),this.#m):b}#qe(){const e=this.renderRoot.querySelector(`#${Xn}`),n=this.renderRoot.querySelector(".dpk-bell");!e||!n||cb(e)||this.#C.open(e,n,{width:Zl.width,height:Math.min(Zl.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=Up({...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===ae?this.#pe(i.id):this.showTarget(i);const o=P(i);for(let a=0;a<db;a+=1){if(await this.updateComplete,await pb(),this.#v!==n)return;const l=tu(this,o);if(!(l===null||l.getClientRects().length===0)){nu(this,l),ru(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}>
|
|
3954
|
+
${this.#be(n)}
|
|
3955
|
+
</div>`}#ke(e,n){return jg({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}
|
|
3953
3956
|
<div class="dpk-dock-actions">
|
|
3954
3957
|
${e.send?k`<button
|
|
3955
3958
|
class="dpk-btn dpk-btn--accent"
|
|
@@ -3968,28 +3971,28 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
3968
3971
|
>
|
|
3969
3972
|
${e.copy.label}
|
|
3970
3973
|
</button>
|
|
3971
|
-
</div>`}#
|
|
3974
|
+
</div>`}#ve(e=this.#ne){const n=this.locale,s=O(n).language;return e.render({options:Ks.map(i=>({value:i,label:hg[i]})),value:n,onChange:i=>{const r=Ks.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
|
|
3972
3975
|
class="dpk-chrome-action dpk-check-toggle"
|
|
3973
3976
|
type="button"
|
|
3974
3977
|
data-active=${e?"true":"false"}
|
|
3975
3978
|
aria-pressed=${e?"true":"false"}
|
|
3976
3979
|
aria-label=${s}
|
|
3977
3980
|
data-tooltip=${s}
|
|
3978
|
-
@click=${()=>{this.#
|
|
3981
|
+
@click=${()=>{this.#Be()}}
|
|
3979
3982
|
>
|
|
3980
3983
|
${df()}
|
|
3981
|
-
</button>`}async#
|
|
3984
|
+
</button>`}async#Be(){if(!this.#w.enabled){this.#w.setEnabled(!0);return}if(!Kp(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
|
|
3982
3985
|
class="dpk-theme-toggle"
|
|
3983
3986
|
type="button"
|
|
3984
3987
|
aria-label=${s}
|
|
3985
3988
|
title=${s}
|
|
3986
|
-
@click=${()=>this.#
|
|
3989
|
+
@click=${()=>this.#f.toggle(De(this.theme))}
|
|
3987
3990
|
>
|
|
3988
3991
|
${e?tf():nf()}
|
|
3989
|
-
</button>`}render(){if(!this.#
|
|
3992
|
+
</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:Rk(i.settings,n,i.flip),o=s?[...i===null?[]:[{id:Yt,label:n.settingsDisplay,render:()=>r}],{id:Sk,label:n.settingsAppearance,render:()=>this.#We()},...this.#xe(this.renderSettingsSections(e))]:[];return Ck({id:Ri,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">
|
|
3990
3993
|
<div class="dpk-settings-row">
|
|
3991
3994
|
<span class="dpk-settings-row-label">${e.language}</span>
|
|
3992
|
-
${this.#
|
|
3995
|
+
${this.#ve(this.#se)}
|
|
3993
3996
|
</div>
|
|
3994
3997
|
<div class="dpk-settings-row">
|
|
3995
3998
|
<span class="dpk-settings-row-label">${e.settingsTheme}</span>
|
|
@@ -4011,7 +4014,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
4011
4014
|
</button>`)}
|
|
4012
4015
|
</div>
|
|
4013
4016
|
</div>
|
|
4014
|
-
</div>`}#
|
|
4017
|
+
</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 cs&&e.board===null)return e;e=e.parentNode}return null}#Ye(){return this.#P.render()}get sidebarLayout(){return ja}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:Xa(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=bn(e,n);return i===null||s===null?r:Va(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:Uf(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.#T.add(e),()=>{this.#T.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 el(this.#ue(),this)}#Se(){return mi(this.#ue())}#ee(){return Wf(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.#R.read(),n=this.#u!==null;this.#e=n?lt:this.readGrill(),this.#Xe(),this.#S=n||this.hashMode==="off"?Pt:Ul(),this.#W=this.locale;const s=this.storageKey;this.#b=new xa({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=If(this);i===null?this.#F?.():i.then(()=>this.#F?.()),this.#R.observe(),this.requestUpdate()}#Xe(){this.querySelector(`:scope > [slot="${Wl}"]`)!==null&&console.warn(`[dev-process-kit] <${this.tagName.toLowerCase()}> no longer shows slot="${Wl}"; slot each piece as slot="${Oi}" data-name="\u2026" instead.`)}#Je(){return this.storage==="off"?null:this.storage==="memory"?new si:ii()}scriptOf(e){return this.querySelector(e)}pendingStart(){return null}get hashMode(){return"auto"}buildBrief(e){return Un(e,this.controller.definition,me)}readGrill(){return this.#n=null,this.parseGrillScript(this.scriptOf(lb))}parseGrillScript(e,n){if(!e?.textContent||e.textContent.trim().length===0)return lt;try{return Ju(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}`,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()}#O(){const e=this.#Se();for(const n of this.#T)n(e)}#tt(){if(!this.isConnected){this.requestUpdate(),this.#O();return}this.#u===null&&this.#te(!0),Sl(this.#N,this.controller.actions),queueMicrotask(this.#E),this.requestUpdate(),this.#O(),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=Ul(),this.#te(!0),this.requestUpdate(),this.#O(),this.dispatchEvent(new CustomEvent("dpk-navigate",{detail:{navigation:this.#S},bubbles:!0,composed:!0}))};#E=()=>{if(this.#I?.disconnect(),this.#N=Im(this,s=>{this.isConnected&&this.#I?.observe(s,{childList:!0,subtree:!0})}),!this.#b)return;Sl(this.#N,this.#b.actions);const e=qm(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(th,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(Jp,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(vn(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=Ik(this,e.memo),s=Uk(this.#h,n),i=this.#p,r=a=>{this.#h=a,this.requestUpdate()},o=i.handlers;return k`<div
|
|
4015
4018
|
class="dpk-supplements"
|
|
4016
4019
|
?hidden=${n.length===0}
|
|
4017
4020
|
?data-open=${s!==null}
|
|
@@ -4025,7 +4028,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
4025
4028
|
aria-orientation="horizontal"
|
|
4026
4029
|
aria-controls="dpk-supplements-body"
|
|
4027
4030
|
aria-label=${e.resizeSupplements}
|
|
4028
|
-
aria-valuemin=${
|
|
4031
|
+
aria-valuemin=${de.min}
|
|
4029
4032
|
aria-valuemax=${i.max}
|
|
4030
4033
|
aria-valuenow=${i.height}
|
|
4031
4034
|
title=${e.resizeSupplementsHint}
|
|
@@ -4045,7 +4048,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
4045
4048
|
aria-expanded=${String(s!==null)}
|
|
4046
4049
|
aria-controls="dpk-supplements-body"
|
|
4047
4050
|
aria-label=${s===null?e.openSupplements:e.closeSupplements}
|
|
4048
|
-
@click=${()=>r(
|
|
4051
|
+
@click=${()=>r(jk(this.#h,n))}
|
|
4049
4052
|
>
|
|
4050
4053
|
${Gt()}
|
|
4051
4054
|
</button>
|
|
@@ -4054,16 +4057,16 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
4054
4057
|
class="dpk-supplement-tab"
|
|
4055
4058
|
aria-expanded=${String(a===s)}
|
|
4056
4059
|
aria-controls="dpk-supplements-body"
|
|
4057
|
-
@click=${()=>r(
|
|
4060
|
+
@click=${()=>r(Hk(this.#h,a.element))}
|
|
4058
4061
|
>
|
|
4059
4062
|
${a.name}
|
|
4060
4063
|
</button>`)}
|
|
4061
4064
|
</div>
|
|
4062
4065
|
<div class="dpk-supplements-body" id="dpk-supplements-body" ?hidden=${s===null}>
|
|
4063
|
-
<style .textContent=${s===null?"":
|
|
4066
|
+
<style .textContent=${s===null?"":Nk(this,s)}></style>
|
|
4064
4067
|
<slot name=${Oi} @slotchange=${()=>this.requestUpdate()}></slot>
|
|
4065
4068
|
</div>
|
|
4066
|
-
</div>`}#
|
|
4069
|
+
</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 zi="dpk-page-state",hb=1e3,ub=t=>t.localName.startsWith("dpk-view-")||t.localName.startsWith("dpk-board-"),gb=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",fb={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`
|
|
4067
4070
|
:host {
|
|
4068
4071
|
display: block;
|
|
4069
4072
|
height: 100%;
|
|
@@ -4101,16 +4104,16 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
4101
4104
|
font-family: var(--dpk-mono, ui-monospace, monospace);
|
|
4102
4105
|
font-size: 11px;
|
|
4103
4106
|
}
|
|
4104
|
-
`;class
|
|
4107
|
+
`;class kb extends J{static{this.styles=mb}static{this.properties={name:{type:String},label:{type:String}}}#e=new Wt(this);#n=null;#t=!1;#s=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.#s}get content(){return this.#n}get definition(){return this.#n?.definition??fb}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[Vn](){return Nf(this)}connectedCallback(){super.connectedCallback(),this.#d()}refreshContent(){this.#n?.requestUpdate?.()}render(){return k`${this.#l()}<slot @slotchange=${()=>this.#d()}></slot>`}#l(){const e=this.#s,n=O(this.#e.locale);return e?.status==="empty"?k`<div class="dpk-page-notice" role="alert">
|
|
4105
4108
|
<strong>${n.pageEmpty}</strong>
|
|
4106
4109
|
<span>${n.pageEmptyHint}</span>
|
|
4107
4110
|
</div>`:e?.status==="unavailable"?k`<div class="dpk-page-notice" role="alert">
|
|
4108
4111
|
<strong>${n.pageUnavailable}</strong>
|
|
4109
4112
|
<code>${n.pageUnavailableHint(e.tag)}</code>
|
|
4110
|
-
</div>`:b}#
|
|
4113
|
+
</div>`:b}#d(){const e=Array.from(this.children).filter(ub),n=e[0]??null;if(!(this.#t&&n===this.#n)){if(this.#t=!0,this.#n=n,this.#s=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.#h(n).then(s=>this.#c(n,s)),customElements.whenDefined(n.localName).then(()=>{this.#n!==n||this.#s?.status!=="unavailable"||this.#h(n).then(s=>this.#c(n,s))}),this.requestUpdate()}}#c(e,n){this.#n===e&&(this.#f(n),n.status==="ready"&&(this.requestUpdate(),e.localName.startsWith("dpk-board-")&&requestAnimationFrame(()=>e.resetView?.())))}async#h(e){const n=e.localName;if(!await this.#p(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#p(e){return customElements.get(e)!==void 0?!0:document.readyState==="complete"?!1:new Promise(n=>{const s=o=>{clearTimeout(r),window.removeEventListener("load",i),n(o)},i=()=>s(customElements.get(e)!==void 0),r=setTimeout(()=>s(customElements.get(e)!==void 0),hb);window.addEventListener("load",i,{once:!0}),customElements.whenDefined(e).then(()=>s(!0))})}#f(e){const n=this.#s,s=n===null||n.status!==e.status||e.status==="unavailable"&&n.status==="unavailable"&&n.tag!==e.tag;this.#s=e,this.#r(),s&&this.dispatchEvent(new CustomEvent(zi,{detail:e,bubbles:!0,composed:!0})),this.requestUpdate()}}const Xl=(t,e)=>({...t,id:kt(t.id,e),ref:kt(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=>Xl(l,o)))]}))},vb=(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=>Xl(r,s)))],rounds:bb(t.rounds,n)}},xb=(t,e)=>e===null||t.includes(Wn)?[t]:[kt(t,e),t],yb=t=>{let e=t;for(;e!==null;){const n=gi(e);if(n!==null)return n;const s=e.getRootNode();e=e.parentElement??(s instanceof ShadowRoot?s.host:null)}return null},ts=w(v(),ee(ui)),wt={ADD_PAGE:kn("ADD_PAGE","app",R({page:ts,kind:_t(["view","board"]),content:w(v(),S(1)),label:w(v(),S(1))}),{mode:"append"}),REMOVE_PAGE:kn("REMOVE_PAGE","app",R({page:ts}),{mode:"append"}),RENAME_PAGE:kn("RENAME_PAGE","app",R({page:ts,label:w(v(),pn(),S(1))}),{mode:"patch",dedupeKey:t=>{const e=C(R({page:ts}),t.payload);return e.success?`RENAME_PAGE|${e.output.page}`:null}})},wb=t=>{const e=Ot(wt,t);return e===null?null:e.payload.page},$b=(t,e)=>Se(t.target)?wb(t)===e:Fe(t.target)?.page===e,Sb="## How to apply",Ab=(t,e)=>{const n=new Map;for(const s of e){const i=Fe(s.target)?.page;if(i===void 0||Z(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)`}),""]},Eb=(t,e)=>{const n=t.indexOf(Sb),s=`${e.join(`
|
|
4111
4114
|
`)}
|
|
4112
4115
|
`;return n<0?`${t}
|
|
4113
|
-
${s}`:`${t.slice(0,n)}${s}${t.slice(n)}`},
|
|
4116
|
+
${s}`:`${t.slice(0,n)}${s}${t.slice(n)}`},Cb=R({title:N(v())}),Tb={schema:qr(),mode:"append",targetType:"unknown"},Rb="app",_b=(t,e)=>{if(!e.has(t))return t;let n=2;for(;e.has(`${t}-${n}`);)n+=1;return`${t}-${n}`},Mb=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:Rb,label:e.label,parseBase:p=>d(Mt(Cb,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?Tb: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:Ka(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,Ja(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,...Ja(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}},ns=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}`}}),Ob=R({value:v()}),Jl=t=>e=>{if(!(e instanceof CustomEvent))return;const n=C(Ob,e.detail);n.success&&t(n.output.value)},Pb=t=>e=>{const n=xt(e.target,HTMLInputElement);n!==null&&t(n.value,n)},Lb=t=>e=>{const n=xt(e.target,HTMLInputElement);n!==null&&t(n.checked)},Zt="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
|
|
4114
4117
|
class="dpk-chrome-action dpk-page-switcher-trigger"
|
|
4115
4118
|
type="button"
|
|
4116
4119
|
aria-haspopup="menu"
|
|
@@ -4125,7 +4128,7 @@ ${s}`:`${t.slice(0,n)}${s}${t.slice(n)}`},Ab=R({title:N(v())}),Eb={schema:qr(),m
|
|
|
4125
4128
|
>
|
|
4126
4129
|
${t()}
|
|
4127
4130
|
${n>1?k`<span class="dpk-page-switcher-count" aria-hidden="true">${n}</span>`:b}
|
|
4128
|
-
</button>`},
|
|
4131
|
+
</button>`},Db=(t,e,n)=>k`<div
|
|
4129
4132
|
id=${Zt}
|
|
4130
4133
|
class="dpk-settings dpk-page-switcher-menu"
|
|
4131
4134
|
popover="manual"
|
|
@@ -4175,7 +4178,7 @@ ${s}`:`${t.slice(0,n)}${s}${t.slice(n)}`},Ab=R({title:N(v())}),Eb={schema:qr(),m
|
|
|
4175
4178
|
${ct()}
|
|
4176
4179
|
</button>`}
|
|
4177
4180
|
</div>`)}
|
|
4178
|
-
</div>`,
|
|
4181
|
+
</div>`,Ib=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}},ed=(t,e)=>{if(e===null)return null;const n=Ib(e);if(n===null)return null;try{return new URL(t,n).href}catch{return null}},td=(t,e)=>ed(`views/${t}.js`,e),nd=t=>ed("boards.js",t),sd=t=>t instanceof HTMLElement&&"definition"in t&&"api"in t&&Df(t)!==null,Nb=t=>t instanceof HTMLElement&&"settingsSections"in t,qb=t=>typeof t=="object"&&t!==null&&"name"in t&&"emptyBase"in t,Ub=`:scope > script[type="application/json"][${Qs}]`,Hb=(t,e)=>t.flatMap(n=>{if(n.target.type===ae)return[];const s=Fe(n.target);return s?.page===e?[{...n,target:s.target}]:[]}),jb=t=>typeof t=="object"&&t!==null&&Object.values(t).every(e=>typeof e=="string"),Bb=(t,e)=>{const n=Object.keys(t);return n.length===Object.keys(e).length&&n.every(s=>t[s]===e[s])},Fb=t=>{try{return t.matches(":popover-open")}catch{return!1}},Gb=y(oc),Wb={width:240,height:420},Kb=220,Vb=z`
|
|
4179
4182
|
.dpk-main-body {
|
|
4180
4183
|
animation: none;
|
|
4181
4184
|
}
|
|
@@ -4290,15 +4293,15 @@ ${s}`:`${t.slice(0,n)}${s}${t.slice(n)}`},Ab=R({title:N(v())}),Eb={schema:qr(),m
|
|
|
4290
4293
|
::slotted([hidden]) {
|
|
4291
4294
|
display: none !important;
|
|
4292
4295
|
}
|
|
4293
|
-
`;class
|
|
4294
|
-
${
|
|
4295
|
-
${this.#c?
|
|
4296
|
-
`}#D(e,n){return e.findIndex(s=>s.id===n.id)}#I(e,n,s,i){const r=ts(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.#M(),this.#re(a)}}));const o=e.map((a,l)=>{const c=this.#Q(a,l,s),d=a.id===n?.id;return{key:`page:${a.id}`,label:c,icon:this.#B(a),current:d,activate:()=>{this.#M(),this.navigate({[Ae]:a.id})},...d?{rename:{label:r.renamePage,commit:h=>this.#oe(a.id,h)}}:{},...e.length>1?{remove:{label:r.removePage(c),activate:()=>this.#le(a.id)}}:{}}});return i.length===0?o:[...o,{key:"add",label:r.addPage,icon:oi,current:!1,kind:"action",activate:()=>{this.#p=!0,this.requestUpdate(),this.#V()}}]}#V(){this.updateComplete.then(()=>{this.renderRoot.querySelector(`#${Zt} .dpk-page-switcher-option`)?.focus()})}#oe(e,n){this.dispatch({type:"RENAME_PAGE",target:mt,payload:{page:e,label:n}})}#Y(){this.#E(),!this.#c&&(this.#c=!0,this.requestUpdate())}#g(){this.#E(),this.#h=setTimeout(()=>this.#M(),Gb)}#E(){this.#h!==void 0&&(clearTimeout(this.#h),this.#h=void 0)}#M(){this.#E(),!(!this.#c&&!this.#p)&&(this.#c=!1,this.#p=!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.#R(e.state,e.navigation),s=n===void 0?void 0:this.#N(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)}}}#N(e){return this.#v().find(n=>this.#f(n)===e)}#Z(e){const n=this.#R(e.state,e.navigation),s=(n===void 0?void 0:this.#N(n.id))?.content??null;return Db(s)?s:null}#Q(e,n,s){const i=this.#j(e);return i!==void 0&&e.label===i.label?n===0?s:ts(this.locale).pageFallback(n+1):e.label}#ae(e){const n=new Set([...this.api.state.layout.map(r=>r.id),...Array.from(this.children,r=>r.getAttribute(bt)??"")]),s=Tb(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})}#le(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)yb(r,e)&&this.removeAction(r.id)}updated(){super.updated(),this.#X(),this.#J()}#X(){const e=this.renderRoot.querySelector(`#${Zt}`),n=this.renderRoot.querySelector(".dpk-page-switcher-trigger");!e||!n||jb(e)||this.#k.open(e,n,Fb,{placement:"bottom-end"})}#J(){if(!this.#e)return;const e=this.api.state.layout,n=new Set(e.map(a=>a.id));this.#P(this.#z())!==this.#n&&this.refreshGrill();for(const a of this.#v())a.hasAttribute(vt)&&!n.has(this.#f(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.#F(a);const i=this.controller.actions,r=this.navigation[Ae];let o=!1;for(const a of this.#v()){const l=this.#f(a);a.hidden=l!==r||!n.has(l),this.#de(a)&&(this.#i.get(a)!==i&&(this.#i.set(a,i),a.controller.replaceActions(qb(i,l)),o=!0),a.refreshContent())}o&&this.settingsOpen&&this.requestUpdate()}#F(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 Vb=[{kind:"view",name:"usm",label:"User Story Mapping",icon:y(lc)},{kind:"view",name:"prototype",label:"UX Prototype",icon:y(gc),addable:!1},{kind:"view",name:"task-board",label:"Task Context Board",icon:y(rr),addable:!1},{kind:"view",name:"delegation-poker",label:"Delegation Poker",icon:y(Sc),addable:!1},{kind:"view",name:"slides",label:"Slides",icon:y(xc),addable:!1},{kind:"view",name:"plain",label:"Plain",icon:y(ir),addable:!1},{kind:"board",name:"er-diagram",label:"ER diagram",icon:y(Jd),addable:!1},{kind:"board",name:"state-diagram",label:"State diagram",icon:y(Qd),addable:!1},{kind:"board",name:"sequence-diagram",label:"Sequence diagram",icon:y(Gd),addable:!1},{kind:"board",name:"dependency-graph",label:"Dependency graph",icon:y(tc),addable:!1},{kind:"board",name:"architecture-map",label:"Architecture map",icon:y(Kd),addable:!1},{kind:"board",name:"mind-map",label:"Mind map",icon:y(nc),addable:!1},{kind:"board",name:"event-storming",label:"Event Storming",icon:y(_c)},{kind:"board",name:"example-mapping",label:"Example Mapping",icon:y(or)},{kind:"board",name:"whiteboard",label:"Whiteboard",icon:y(kc)},{kind:"board",name:"kanban",label:"Kanban",icon:y(rr)}];class id extends Kb{pageContents(){return Vb}}const Yb=()=>{customElements.get("dpk-app")||customElements.define("dpk-app",id)},rd=Ft(class extends Hn{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(!Jf(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,[e]){if(e===Y||e===b)return e;const n=t.element,s=t.name;if(t.type===we.PROPERTY){if(e===n[s])return Y}else if(t.type===we.BOOLEAN_ATTRIBUTE){if(!!e===n.hasAttribute(s))return Y}else if(t.type===we.ATTRIBUTE&&n.getAttribute(s)===e+"")return Y;return ki(t),e}});function Di(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ve=Di();function od(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 Zb=((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}}(?:</?(?:${Xt})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,"i")),blockquoteBeginRegex:$t(t=>new RegExp(`^ {0,${t}}>`))},Qb=/^(?:[ \t]*(?:\n|$))+/,Xb=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Jb=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Qt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ev=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ii=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ad=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ld=A(ad).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(),tv=A(ad).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(),Ni=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,nv=/^[^\n]+/,qi=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,sv=A(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",qi).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),iv=A(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Ii).getRegex(),Xt="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",Ui=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,rv=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",Ui).replace("tag",Xt).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),dd=t=>A(Ni).replace("hr",Qt).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",Xt).getRegex(),ov=dd(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),av=dd(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),lv=A(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",av).getRegex(),Hi={blockquote:lv,code:Xb,def:sv,fences:Jb,heading:ev,hr:Qt,html:rv,lheading:ld,list:iv,newline:Qb,paragraph:ov,table:Ye,text:nv},cd=A("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Qt).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",Xt).getRegex(),dv={...Hi,lheading:tv,table:cd,paragraph:A(Ni).replace("hr",Qt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",cd).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",Xt).getRegex()},cv={...Hi,html:A(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ui).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(Ni).replace("hr",Qt).replace("heading",` *#{1,6} *[^
|
|
4297
|
-
]`).replace("lheading",ld).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},
|
|
4296
|
+
`;class Yb extends cs{static{this.styles=[Bl,Tr,Rr,jl,Dl,Vb]}static{this.properties={pageNav:{type:String,attribute:"page-nav"},hash:{type:String}}}get hashMode(){return this.hash==="off"?"off":"auto"}#e=!1;#n=!1;#t="";#s="";#i=new WeakMap;#r=new WeakMap;#o=new Map;#a=new Map;#l;#d=null;#c=!1;#h=!1;#p;#f=new Zn(this);constructor(){super(),new cn(this,{open:()=>this.#c,closesOn:e=>!e.some(n=>n instanceof Element&&(n.id===Zt||n.matches(".dpk-page-switcher-trigger"))),ownsEscape:()=>!0,dismiss:()=>this.#M()})}pageContents(){return[]}definitionFor(e){return Mb({pages:()=>this.#H(),base:()=>this.#$(),catalog:()=>this.#Y(),messages:ns(e)})}connectedCallback(){super.connectedCallback(),this.addEventListener("dpk-comment-targets-change",this.#x),this.addEventListener("dpk-navigate",this.#y),this.addEventListener(zi,this.#k),this.#d=this.navigation,this.api.ready.then(()=>{this.#n=!0,this.#t=this.#P(this.#g()),this.requestUpdate()})}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("dpk-comment-targets-change",this.#x),this.removeEventListener("dpk-navigate",this.#y),this.removeEventListener(zi,this.#k),this.#_()}#k=e=>{if(!(e instanceof CustomEvent)||!gb(e.detail))return;const n=e.target;!(n instanceof HTMLElement)||!sd(n)||n.parentElement!==this||(this.#r.set(n,e.detail.status==="ready"),!(!this.#n||!this.#e)&&(n.hasAttribute(vt)?this.requestUpdate():this.#C()))};#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(!jb(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);Bb(a,l)||(r.content??r).dispatchEvent(new CustomEvent("dpk-navigate",{detail:{navigation:l},bubbles:!0,composed:!0}))}};#x=()=>{this.#n&&this.controller.setTemplate(this.definition)};get[Vn](){if(this.#n)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(sd)}#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:{}]))}}#C(){this.#i=new WeakMap,this.controller.setBase({...this.controller.base,...this.#$()}),this.refreshGrill()}#P(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.#L(r,o,e);return a===void 0?[]:[a]});return i.length===s.length&&this.#o.set(e,i),i}#L(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 qb(o)?o:void 0}#z(){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=Cr();return e.kind==="view"?td(e.name,s)!==null:nd(s)!==null}async#se(e){const n=this.locale,s=this.#L(e.kind,e.name,n);if(s!==void 0)return s;const i=Cr(),r=e.kind==="view"?td(e.name,i):nd(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.#L(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??Gb}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.#n&&this.#b().then(()=>{const e=this.#P(this.#g());e!==this.#t&&(this.#t=e,this.#C())})}scriptOf(e){return this.querySelector(`:scope > ${e}`)}readGrill(){const e=super.readGrill(),n=this.#D();return this.#s=this.#P(n),vb(e,n.map(s=>{const i=this.#m(s);return{page:i,grill:this.parseGrillScript(s.content?.querySelector(Ub)??null,`@${i}`)}}))}#D(){const e=this.#g();if(!this.#n)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 xb(n,yb(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 Eb(super.buildBrief(e),Ab(n,e.actions))}#T(e,n){return e.layout.find(s=>s.id===n[Ae])}#R(){return this.pageNav==="none"}renderRegions(e){return{main:k`<div class="dpk-app-pages"><slot @slotchange=${()=>this.#S()}></slot></div>`}}renderHeaderLead(e){if(this.#R())return b;const n=e.state.layout,s=this.#T(e.state,e.navigation);return this.#Z(n,s,this.definition.title(e.state),this.#z())}#Z(e,n,s,i){if(e.length===0&&i.length===0)return b;const r=ns(this.locale),o={open:()=>this.#re(),scheduleClose:()=>this.#G()};return k`
|
|
4297
|
+
${zb(of,this.#c,e.length,r,o,{active:n===void 0?null:this.#K(n,this.#I(e,n),s)})}
|
|
4298
|
+
${this.#c?Db(this.#N(e,n,s,i),r,{cancelClose:()=>this.#_(),scheduleClose:()=>this.#G()}):b}
|
|
4299
|
+
`}#I(e,n){return e.findIndex(s=>s.id===n.id)}#N(e,n,s,i){const r=ns(this.locale);if(this.#h)return i.map(a=>({key:`content:${a.kind}:${a.name}`,label:a.label,icon:a.icon,current:!1,kind:"action",activate:()=>{this.#M(),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.#M(),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:ai,current:!1,kind:"action",activate:()=>{this.#h=!0,this.requestUpdate(),this.#Q()}}]}#Q(){this.updateComplete.then(()=>{this.renderRoot.querySelector(`#${Zt} .dpk-page-switcher-option`)?.focus()})}#F(e,n){this.dispatch({type:"RENAME_PAGE",target:mt,payload:{page:e,label:n}})}#re(){this.#_(),!this.#c&&(this.#c=!0,this.requestUpdate())}#G(){this.#_(),this.#p=setTimeout(()=>this.#M(),Kb)}#_(){this.#p!==void 0&&(clearTimeout(this.#p),this.#p=void 0)}#M(){this.#_(),!(!this.#c&&!this.#h)&&(this.#c=!1,this.#h=!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.#T(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.#T(e.state,e.navigation),s=(n===void 0?void 0:this.#u(n.id))?.content??null;return Nb(s)?s:null}#K(e,n,s){const i=this.#j(e);return i!==void 0&&e.label===i.label?n===0?s:ns(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=_b(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)$b(r,e)&&this.removeAction(r.id)}updated(){super.updated(),this.#oe(),this.#ae()}#oe(){const e=this.renderRoot.querySelector(`#${Zt}`),n=this.renderRoot.querySelector(".dpk-page-switcher-trigger");!e||!n||Fb(e)||this.#f.open(e,n,Wb,{placement:"bottom-end"})}#ae(){if(!this.#e)return;const e=this.api.state.layout,n=new Set(e.map(a=>a.id));this.#P(this.#D())!==this.#s&&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(Hb(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 Zb=[{kind:"view",name:"usm",label:"User Story Mapping",icon:y(lc)},{kind:"view",name:"prototype",label:"UX Prototype",icon:y(gc),addable:!1},{kind:"view",name:"task-board",label:"Task Context Board",icon:y(rr),addable:!1},{kind:"view",name:"delegation-poker",label:"Delegation Poker",icon:y(Sc),addable:!1},{kind:"view",name:"slides",label:"Slides",icon:y(xc),addable:!1},{kind:"view",name:"plain",label:"Plain",icon:y(ir),addable:!1},{kind:"board",name:"er-diagram",label:"ER diagram",icon:y(Jd),addable:!1},{kind:"board",name:"state-diagram",label:"State diagram",icon:y(Qd),addable:!1},{kind:"board",name:"sequence-diagram",label:"Sequence diagram",icon:y(Gd),addable:!1},{kind:"board",name:"dependency-graph",label:"Dependency graph",icon:y(tc),addable:!1},{kind:"board",name:"architecture-map",label:"Architecture map",icon:y(Kd),addable:!1},{kind:"board",name:"mind-map",label:"Mind map",icon:y(nc),addable:!1},{kind:"board",name:"event-storming",label:"Event Storming",icon:y(_c)},{kind:"board",name:"example-mapping",label:"Example Mapping",icon:y(or)},{kind:"board",name:"whiteboard",label:"Whiteboard",icon:y(kc)},{kind:"board",name:"kanban",label:"Kanban",icon:y(rr)}];class id extends Yb{pageContents(){return Zb}}const Qb=()=>{customElements.get("dpk-app")||customElements.define("dpk-app",id)},rd=Ft(class extends Hn{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(!em(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,[e]){if(e===Y||e===b)return e;const n=t.element,s=t.name;if(t.type===we.PROPERTY){if(e===n[s])return Y}else if(t.type===we.BOOLEAN_ATTRIBUTE){if(!!e===n.hasAttribute(s))return Y}else if(t.type===we.ATTRIBUTE&&n.getAttribute(s)===e+"")return Y;return ki(t),e}});function Di(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ve=Di();function od(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 Xb=((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}}(?:</?(?:${Xt})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,"i")),blockquoteBeginRegex:$t(t=>new RegExp(`^ {0,${t}}>`))},Jb=/^(?:[ \t]*(?:\n|$))+/,ev=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,tv=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Qt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,nv=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ii=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ad=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ld=A(ad).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(),sv=A(ad).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(),Ni=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,iv=/^[^\n]+/,qi=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,rv=A(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",qi).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ov=A(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Ii).getRegex(),Xt="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",Ui=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,av=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",Ui).replace("tag",Xt).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),dd=t=>A(Ni).replace("hr",Qt).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",Xt).getRegex(),lv=dd(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),dv=dd(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),cv=A(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",dv).getRegex(),Hi={blockquote:cv,code:ev,def:rv,fences:tv,heading:nv,hr:Qt,html:av,lheading:ld,list:ov,newline:Jb,paragraph:lv,table:Ye,text:iv},cd=A("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Qt).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",Xt).getRegex(),pv={...Hi,lheading:sv,table:cd,paragraph:A(Ni).replace("hr",Qt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",cd).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",Xt).getRegex()},hv={...Hi,html:A(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ui).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(Ni).replace("hr",Qt).replace("heading",` *#{1,6} *[^
|
|
4300
|
+
]`).replace("lheading",ld).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},uv=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,gv=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,pd=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,fv=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ke=/[\p{P}\p{S}]/u,St=/[\s\p{P}\p{S}]/u,Jt=/[^\s\p{P}\p{S}]/u,mv=A(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,St).getRegex(),kv=/[\p{Pi}\p{Ps}"']/u,hd=/(?!~)[\p{P}\p{S}]/u,bv=/(?!~)[\s\p{P}\p{S}]/u,vv=/(?:[^\s\p{P}\p{S}]|~)/u,xv=A(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Xb?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ud=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,yv=A(ud,"u").replace(/punct/g,ke).getRegex(),wv=A(ud,"u").replace(/punct/g,hd).getRegex(),$v=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,Sv=A($v,"u").replace(/openQuote/g,kv).replace(/punct/g,ke).getRegex(),gd="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Av=A(gd,"gu").replace(/notPunctSpace/g,Jt).replace(/punctSpace/g,St).replace(/punct/g,ke).getRegex(),Ev=A(gd,"gu").replace(/notPunctSpace/g,vv).replace(/punctSpace/g,bv).replace(/punct/g,hd).getRegex(),Cv="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",Tv=A(Cv,"gu").replace(/notPunctSpace/g,Jt).replace(/punctSpace/g,St).replace(/punct/g,ke).getRegex(),Rv=A("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Jt).replace(/punctSpace/g,St).replace(/punct/g,ke).getRegex(),_v="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",Mv=A(_v,"gu").replace(/notPunctSpace/g,Jt).replace(/punctSpace/g,St).replace(/punct/g,ke).getRegex(),Ov=A(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,ke).getRegex(),Pv="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Lv=A(Pv,"gu").replace(/notPunctSpace/g,Jt).replace(/punctSpace/g,St).replace(/punct/g,ke).getRegex(),zv=A(/\\(punct)/,"gu").replace(/punct/g,ke).getRegex(),Dv=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(),Iv=A(Ui).replace("(?:-->|$)","-->").getRegex(),Nv=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",Iv).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),fd=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,ss=A(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",fd).getRegex(),qv=A(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label",ss).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Uv=A(/^!?\[(label)\]\[(ref)\]/).replace("label",ss).replace("ref",qi).getRegex(),Hv=A(/^!?\[(ref)\](?:\[\])?/).replace("ref",qi).getRegex(),md=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,jv=A(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",fd).getRegex(),Bv=A("reflink|nolink(?!\\()","g").replace("reflink",A(/^!?\[(label)\]\[(ref)\]/).replace("label",jv).replace("ref",md).getRegex()).replace("nolink",A(/^!?\[(ref)\](?:\[\])?/).replace("ref",md).getRegex()).getRegex(),kd=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Fv=/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/,Gv=A(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,Fv).getRegex(),ji={_backpedal:Ye,anyPunctuation:zv,autolink:Dv,blockSkip:xv,br:pd,code:gv,del:Ye,delLDelim:Ye,delRDelim:Ye,emStrongLDelim:yv,emStrongRDelimAst:Av,emStrongRDelimUnd:Rv,escape:uv,link:qv,nolink:Hv,punctuation:mv,reflink:Uv,reflinkSearch:Bv,tag:Nv,text:fv,url:Ye},Wv={...ji,emStrongLDelim:Sv,emStrongRDelimAst:Tv,emStrongRDelimUnd:Mv,link:A(/^!?\[(label)\]\((.*?)\)/).replace("label",ss).getRegex(),reflink:A(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ss).getRegex()},Bi={...ji,emStrongRDelimAst:Ev,emStrongLDelim:wv,delLDelim:Ov,delRDelim:Lv,url:A(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",Gv).replace("protocol",kd).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",kd).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},Kv={...Bi,br:A(pd).replace("{2,}","*").getRegex(),text:A(Bi.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},is={normal:Hi,gfm:pv,pedantic:hv},en={normal:ji,gfm:Bi,breaks:Kv,pedantic:Wv},Vv={"&":"&","<":"<",">":">",'"':""","'":"'"},bd=t=>Vv[t];function K(t,e){if(e){if(q.escapeTest.test(t))return t.replace(q.escapeReplace,bd)}else if(q.escapeTestNoEncode.test(t))return t.replace(q.escapeReplaceNoEncode,bd);return t}function Yv(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 vd(t){try{t=encodeURI(t).replace(q.percentDecode,"%")}catch{return null}return t}function xd(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 yd(t){let e=t.split(`
|
|
4298
4301
|
`),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(`
|
|
4299
|
-
`)}function
|
|
4302
|
+
`)}function rs(t){return t.trim().toLowerCase().toUpperCase().toLowerCase()}function wd(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 $d(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 Sd(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 Zv(t,e,n){let s=t.match(n.other.indentCodeCompensation);if(s===null)return e;let i=s[1];return e.split(`
|
|
4300
4303
|
`).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(`
|
|
4301
|
-
`)}function Ad(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
|
|
4304
|
+
`)}function Ad(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 os=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]:yd(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=Zv(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],`
|
|
4302
4305
|
`),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],`
|
|
4303
4306
|
`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=Ee(e[0],`
|
|
4304
4307
|
`).split(`
|
|
@@ -4318,15 +4321,15 @@ ${E.join(`
|
|
|
4318
4321
|
`,1)[0],f=e[1].length,p=this.options.pedantic?$d(h,f):h.replace(this.rules.other.leadingSpaceTab,x=>$d(x,f)),g=t.split(`
|
|
4319
4322
|
`,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+`
|
|
4320
4323
|
`,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 V=t.split(`
|
|
4321
|
-
`,1)[0],j;if(g=V,this.options.pedantic?(g=g.replace(this.rules.other.listReplaceNesting," "),j=g):j=g.replace(this.rules.other.leadingSpaceTab,
|
|
4324
|
+
`,1)[0],j;if(g=V,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+=`
|
|
4322
4325
|
`+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+=`
|
|
4323
4326
|
`+g}u=!g.trim(),c+=V+`
|
|
4324
|
-
`,t=t.substring(V.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=yd(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])&&wd(e[2],"()")!==-1)return;let n=
|
|
4327
|
+
`,t=t.substring(V.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=yd(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])&&wd(e[2],"()")!==-1)return;let n=rs(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],`
|
|
4325
4328
|
`),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=xd(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
4326
4329
|
`):[],r={type:"table",raw:Ee(e[0],`
|
|
4327
4330
|
`),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(xd(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],`
|
|
4328
4331
|
`),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)===`
|
|
4329
|
-
`?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&&Ad(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=wd(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)),Sd(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&&Ad(t,n[1],s,this.rules))return;let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=e[
|
|
4332
|
+
`?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&&Ad(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=wd(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)),Sd(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&&Ad(t,n[1],s,this.rules))return;let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=e[rs(i)];if(!r){let o=n[0].charAt(0);return{type:"text",raw:o,text:o}}return Sd(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]:Yv(e[0]),escaped:n}}}},te=class Ki{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 os,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:is.normal,inline:en.normal};this.options.pedantic?(n.block=is.pedantic,n.inline=en.pedantic):this.options.gfm&&(n.block=is.gfm,this.options.breaks?n.inline=en.breaks:n.inline=en.gfm),this.tokenizer.rules=n}static get rules(){return{block:is,inline:en}}static lex(e,n){return new Ki(n).lex(e)}static lexInline(e,n){return new Ki(n).inlineTokens(e)}lex(e){e=e.replace(q.carriageReturn,`
|
|
4330
4333
|
`),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+=`
|
|
4331
4334
|
`: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(`
|
|
4332
4335
|
`)?"":`
|
|
@@ -4340,7 +4343,7 @@ ${E.join(`
|
|
|
4340
4343
|
`+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(`
|
|
4341
4344
|
`)?"":`
|
|
4342
4345
|
`)+r.raw,a.text+=`
|
|
4343
|
-
`+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,
|
|
4346
|
+
`+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,rs(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,rs(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)}},as=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,"")+`
|
|
4344
4347
|
`:"";return s?'<pre><code class="language-'+K(s)+'">'+(n?i:K(i,!0))+`</code></pre>
|
|
4345
4348
|
`:"<pre><code>"+(n?i:K(i,!0))+`</code></pre>
|
|
4346
4349
|
`}blockquote({tokens:t}){return`<blockquote>
|
|
@@ -4358,8 +4361,8 @@ ${this.parser.parse(t)}</blockquote>
|
|
|
4358
4361
|
`}tablerow({text:t}){return`<tr>
|
|
4359
4362
|
${t}</tr>
|
|
4360
4363
|
`}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
|
|
4361
|
-
`}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>${K(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?K(n,!0):this.parser.parseInline(s),o=vd(t);if(o===null)return r;t=K(o,i);let a='<a href="'+t+'"';return e&&(a+=' title="'+K(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=vd(t);if(i===null)return K(n);t=i;let r=`<img src="${K(t)}" alt="${K(n)}"`;return e&&(r+=` title="${K(e)}"`),r+=">",r}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:K(t.text)}},Fi=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}},ne=class Vi{options;renderer;textRenderer;constructor(e){this.options=e||Ve,this.options.renderer=this.options.renderer||new
|
|
4362
|
-
Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error occurred:</p><pre>"+K(n.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(n);throw n}}},Ze=new Ed;function _(t,e){return Ze.parse(t,e)}_.options=_.setOptions=function(t){return Ze.setOptions(t),_.defaults=Ze.defaults,od(_.defaults),_},_.getDefaults=Di,_.defaults=Ve;function
|
|
4364
|
+
`}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>${K(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?K(n,!0):this.parser.parseInline(s),o=vd(t);if(o===null)return r;t=K(o,i);let a='<a href="'+t+'"';return e&&(a+=' title="'+K(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=vd(t);if(i===null)return K(n);t=i;let r=`<img src="${K(t)}" alt="${K(n)}"`;return e&&(r+=` title="${K(e)}"`),r+=">",r}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:K(t.text)}},Fi=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}},ne=class Vi{options;renderer;textRenderer;constructor(e){this.options=e||Ve,this.options.renderer=this.options.renderer||new as,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Fi}static parse(e,n){return new Vi(n).parse(e)}static parseInline(e,n){return new Vi(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}},tn=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?te.lex:te.lexInline}provideParser(t=this.block){return t?ne.parse:ne.parseInline}},Ed=class{defaults=Di();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=ne;Renderer=as;TextRenderer=Fi;Lexer=te;Tokenizer=os;Hooks=tn;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 as(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 os(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 tn;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];tn.passThroughHooks.has(r)?i[o]=c=>{if(this.defaults.async&&tn.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 te.lex(t,e??this.defaults)}parser(t,e){return ne.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?te.lex:te.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?ne.parse:ne.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?te.lex:te.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?ne.parse:ne.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+=`
|
|
4365
|
+
Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error occurred:</p><pre>"+K(n.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(n);throw n}}},Ze=new Ed;function _(t,e){return Ze.parse(t,e)}_.options=_.setOptions=function(t){return Ze.setOptions(t),_.defaults=Ze.defaults,od(_.defaults),_},_.getDefaults=Di,_.defaults=Ve;function Qv(...t){return Ze.use(...t),_.defaults=Ze.defaults,od(_.defaults),_}_.use=Qv,_.walkTokens=function(t,e){return Ze.walkTokens(t,e)},_.parseInline=Ze.parseInline,_.Parser=ne,_.parser=ne.parse,_.Renderer=as,_.TextRenderer=Fi,_.Lexer=te,_.lexer=te.lex,_.Tokenizer=os,_.Hooks=tn,_.parse=_,_.options,_.setOptions,_.walkTokens,_.parseInline,ne.parse,te.lex;const Xv={"&":"&","<":"<",">":">",'"':""","'":"'"},Qe=t=>t.replace(/[&<>"']/g,e=>Xv[e]??e),Jv=new Set(["http","https","mailto"]),Cd=t=>{const e=t.replace(/[\u0000- \u007f]/g,""),n=/^([a-z][a-z0-9+.-]*):/i.exec(e)?.[1];return n===void 0||Jv.has(n.toLowerCase())},ex=t=>/^https?:/i.test(t.trim()),tx=new Ed({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(!Cd(t))return s;const i=e?` title="${Qe(e)}"`:"",r=ex(t)?' target="_blank" rel="noopener noreferrer"':"";return`<a href="${Qe(t)}"${i}${r}>${s}</a>`},image({href:t,title:e,text:n}){if(!Cd(t))return Qe(n);const s=e?` title="${Qe(e)}"`:"";return`<img src="${Qe(t)}" alt="${Qe(n)}"${s}>`}}}),Td=t=>tx.parse(t,{async:!1}),nx=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 Rd extends J{static{this.styles=[ft,Ha,z`
|
|
4363
4366
|
:host {
|
|
4364
4367
|
display: inline-block;
|
|
4365
4368
|
max-width: 100%;
|
|
@@ -4583,7 +4586,7 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
|
|
|
4583
4586
|
:host([truncate]:not([wrap]):not([multiline])) .view {
|
|
4584
4587
|
-webkit-line-clamp: 1;
|
|
4585
4588
|
}
|
|
4586
|
-
`]}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="";#
|
|
4589
|
+
`]}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;#t="end";#s=new Wt(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.#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=nx(this.#s.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"
|
|
4587
4590
|
><div
|
|
4588
4591
|
class="view dpk-prose"
|
|
4589
4592
|
role="button"
|
|
@@ -4609,9 +4612,9 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
|
|
|
4609
4612
|
@click=${this.#l}
|
|
4610
4613
|
@input=${this.#d}
|
|
4611
4614
|
@keydown=${this.#c}
|
|
4612
|
-
@blur=${this.#
|
|
4615
|
+
@blur=${this.#h}
|
|
4613
4616
|
></textarea>
|
|
4614
|
-
</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.#
|
|
4617
|
+
</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.#p()}}};#h=e=>{const n=xt(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.#p())})};#p=()=>{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 sx=()=>{customElements.get("dpk-inline-edit")||customElements.define("dpk-inline-edit",Rd)},_d=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"}}),ix=()=>({body:"",editing:null,attachment:{kind:"page"},copy:{kind:"idle"},copyRequest:0,send:{kind:"idle"},sendRequest:0}),Md=t=>t.kind==="explicit"?{kind:t.resume}:t,Od=(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:Md(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:Md(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}},ox=t=>{if(!t.editing)return null;const e=t.editing.body.trim();return e===""?null:{id:t.editing.id,body:e}},Pd=t=>t.group?`${t.group} \xB7 ${t.label}`:t.label,Ld=(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,c=l.kind==="explicit"?n.commentTargets(s,i).find(u=>u.value===l.ref):null,d=l.kind==="explicit"?{ref:l.ref,label:c?Pd(c):l.ref}:l.kind==="current"&&a?{ref:a.value,label:Pd(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=>!Z(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"?Ea(e.send.reason,t.locale):e.copy.kind==="copied"?o.copied:e.copy.kind==="failed"?o.copyFailed:""}},ax=[ft,li,z`
|
|
4615
4618
|
:host {
|
|
4616
4619
|
display: flex;
|
|
4617
4620
|
flex-direction: column;
|
|
@@ -5050,15 +5053,15 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
|
|
|
5050
5053
|
color: var(--dpk-green);
|
|
5051
5054
|
animation: dpk-pop var(--dpk-dur) var(--dpk-ease-spring);
|
|
5052
5055
|
}
|
|
5053
|
-
`],
|
|
5054
|
-
${s?b:k`<header><h2>${
|
|
5056
|
+
`],lx=t=>{switch(t){case"comment":return Bn();case"create":return ai();case"update":return oi();case"delete":return Ta();case"move":return Pa();default:return _a()}},dx=(t,e,n,s=!1)=>k`
|
|
5057
|
+
${s?b:k`<header><h2>${cx(t,e.section)}</h2></header>`}
|
|
5055
5058
|
${e.issues.length>0?k`<div class="issues" role="alert">
|
|
5056
5059
|
<strong>${t.rejected}</strong>
|
|
5057
5060
|
<ul>
|
|
5058
5061
|
${e.issues.map(i=>k`<li>${i}</li>`)}
|
|
5059
5062
|
</ul>
|
|
5060
5063
|
</div>`:b}
|
|
5061
|
-
${e.composer?
|
|
5064
|
+
${e.composer?px(t,e,n):b} ${hx(t,e,n)}
|
|
5062
5065
|
<footer>
|
|
5063
5066
|
${s||e.send==="hidden"?b:k`<button
|
|
5064
5067
|
class="dpk-btn dpk-btn--accent"
|
|
@@ -5089,7 +5092,7 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
|
|
|
5089
5092
|
</div>
|
|
5090
5093
|
${e.flash?k`<span class="flash" role="status">${e.flash}</span>`:b}
|
|
5091
5094
|
</footer>
|
|
5092
|
-
`,
|
|
5095
|
+
`,cx=(t,e)=>e==="changes"?t.changesHeading:e==="comments"?t.commentsHeading:t.heading,px=(t,e,n)=>k`
|
|
5093
5096
|
<div class="composer">
|
|
5094
5097
|
<textarea
|
|
5095
5098
|
class="dpk-textarea"
|
|
@@ -5134,8 +5137,8 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
|
|
|
5134
5137
|
</div>`,zd=(t,e,n)=>k`<ul
|
|
5135
5138
|
class="list"
|
|
5136
5139
|
>
|
|
5137
|
-
${Ke(e,s=>s.id,s=>
|
|
5138
|
-
</ul>`,
|
|
5140
|
+
${Ke(e,s=>s.id,s=>ux(t,s,n))}
|
|
5141
|
+
</ul>`,hx=(t,e,n)=>{const[s]=e.groups;return e.groups.length===1&&s?s.items.length>0?k`<div class="groups">${zd(t,s.items,n)}</div>`:s.kind==="changes"?Gi(t.emptyChanges,t.emptyChangesHint):Gi(t.emptyComments,t.emptyCommentsHint):e.groups.every(i=>i.items.length===0)?Gi(t.empty,t.emptyHint):k`<div class="groups">
|
|
5139
5142
|
${e.groups.filter(i=>i.items.length>0).map(i=>k`<section class="group" data-kind=${i.kind}>
|
|
5140
5143
|
<h3 class="group-head">
|
|
5141
5144
|
${i.kind==="changes"?t.changesHeading:t.commentsHeading}
|
|
@@ -5143,10 +5146,10 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
|
|
|
5143
5146
|
</h3>
|
|
5144
5147
|
${zd(t,i.items,n)}
|
|
5145
5148
|
</section>`)}
|
|
5146
|
-
</div>`},
|
|
5149
|
+
</div>`},ux=(t,e,n)=>k`
|
|
5147
5150
|
<li class="item" data-tone=${e.tone} data-stale=${String(e.stale!==null)} data-id=${e.id}>
|
|
5148
5151
|
<div class="item-head">
|
|
5149
|
-
<span class="item-icon">${
|
|
5152
|
+
<span class="item-icon">${lx(e.tone)}</span>
|
|
5150
5153
|
<span class="item-title">${e.title}</span>
|
|
5151
5154
|
${e.stale?k`<span class="stale-badge">${e.stale}</span>`:b}
|
|
5152
5155
|
${e.edit.kind==="available"?k`<button
|
|
@@ -5156,7 +5159,7 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
|
|
|
5156
5159
|
title=${t.editComment}
|
|
5157
5160
|
@click=${()=>n({kind:"edit-start",id:e.id,body:e.text.body})}
|
|
5158
5161
|
>
|
|
5159
|
-
${
|
|
5162
|
+
${oi()}
|
|
5160
5163
|
</button>`:b}
|
|
5161
5164
|
<button
|
|
5162
5165
|
class="dpk-icon-btn"
|
|
@@ -5168,10 +5171,10 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
|
|
|
5168
5171
|
</button>
|
|
5169
5172
|
</div>
|
|
5170
5173
|
<div class="item-target">${e.targetLabel}</div>
|
|
5171
|
-
${e.edit.kind==="editing"?
|
|
5174
|
+
${e.edit.kind==="editing"?gx(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}
|
|
5172
5175
|
${e.code===null?b:k`<code class="item-code">${e.code}</code>`}
|
|
5173
5176
|
</li>
|
|
5174
|
-
`,
|
|
5177
|
+
`,gx=(t,e,n)=>k`
|
|
5175
5178
|
<div class="item-editor">
|
|
5176
5179
|
<textarea
|
|
5177
5180
|
class="dpk-textarea"
|
|
@@ -5200,7 +5203,7 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
|
|
|
5200
5203
|
</button>
|
|
5201
5204
|
</div>
|
|
5202
5205
|
</div>
|
|
5203
|
-
`,
|
|
5206
|
+
`,fx=t=>t==="changes"||t==="comments"?t:"all";class Dd extends J{static{this.styles=ax}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=ix();#n=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=Od(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())}#s(){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:fx(this.section)}}render(){const e=this.#s();return e?dx(_d(this.#t.locale),Ld(e,this.#e),this.#r,this.embedded):b}#i(e){this.#e=Od(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=ox(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.#s();if(!n||!this.onComment)return;const s=rx(this.#e,Ld(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.#s();if(!e)return;this.#i({kind:"copy-started"});const n=this.#e.copyRequest;try{const s=this.exportBrief?.()??Un({...e.derivation,navigation:e.navigation,issues:e.issues},e.definition,me),i=await Mn(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",Dd)},nn="dpk-version",Id="version",kx=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/,ls=t=>kx.test(t),bx="https://cdn.jsdelivr.net/npm/dev-process-kit@",Nd="https://data.jsdelivr.com/v1/packages/npm/dev-process-kit",qd=t=>{const e=new URLSearchParams(t),n=e.get(nn)??e.get(Id);return n!==null&&ls(n)?n:null},vx=(t,e)=>{const n=qd(t);return n===null||n===e?null:n},xx=(t,e)=>{if(!ls(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}`},yx=(t,e)=>{const n=new URL(t);return n.searchParams.delete(Id),e===null?n.searchParams.delete(nn):n.searchParams.set(nn,e),n.href},wx=R({tags:N(Oe(v(),xe()),{}),versions:U(R({version:v()}))}),$x=t=>{const e=Mt(wx,t),n=e.tags.latest;return{latest:typeof n=="string"&&ls(n)?n:null,versions:e.versions.map(s=>s.version).filter(ls)}},Sx=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 ds;const Ax=()=>(ds??=fetch(Nd).then(async t=>{if(!t.ok)throw new Error(`${Nd} answered ${t.status}`);return $x(await t.json())}),ds.catch(()=>{ds=void 0}),ds),Ex=t=>{location.assign(yx(location.href,t))},Cx=t=>import(t),Tx=({entry:t,views:e,url:n,register:s,importModule:i=Cx})=>{const r=()=>{s(),Er(me,e,nn,n)},o=typeof location>"u"?null:vx(location.search,me);if(o===null){r();return}i(xx(o,t)).then(()=>{Rx()||Mx(o)},a=>{console.error(`dev-process-kit@${o} could not be loaded; running ${me}`,a),r()})},Rx=()=>{const t=Reflect.get(window,"devProcessKit");return typeof t=="object"&&t!==null&&"versionParam"in t},Wi="dpk-version-fallback",_x=`
|
|
5204
5207
|
.${Wi} {
|
|
5205
5208
|
flex: none;
|
|
5206
5209
|
height: 24px;
|
|
@@ -5219,4 +5222,4 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
|
|
|
5219
5222
|
letter-spacing: 0.02em;
|
|
5220
5223
|
cursor: pointer;
|
|
5221
5224
|
}
|
|
5222
|
-
`,
|
|
5225
|
+
`,Mx=t=>{const e=[...document.body.querySelectorAll("*")].filter(n=>n.localName.startsWith("dpk-view-")&&!n.querySelector(`:scope > .${Wi}`));if(e.length!==0){document.head.append(Object.assign(document.createElement("style"),{textContent:_x}));for(const n of e)n.append(Ox(n,t))}},Ox=(t,e)=>{const n=O(Ln(Pn(t))),s=document.createElement("select");s.className=Wi,s.slot="header",s.setAttribute("aria-label",n.versionLabel),s.title=n.versionLabel;const i=o=>{const a=Sx({current:e,requested:qd(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=()=>{Ax().then(i,o=>console.warn(o))};return s.addEventListener("pointerenter",r,{once:!0}),s.addEventListener("focus",r,{once:!0}),s.addEventListener("change",()=>Ex(s.value===""?null:s.value)),i(null),s};class Ud extends kb{}const Px=()=>{customElements.get("dpk-page")||customElements.define("dpk-page",Ud)};export{sx as $,Ma as A,_a as B,H as C,xa as D,Pt as E,Pa as F,oi as G,ai as H,Ta as I,ma as J,vn as K,Le as L,si as M,Ot as N,xn as O,bp as P,Ts as Q,Kr as R,P as S,mn as T,bn as U,cs as V,ni as W,ft as X,Dd as Y,Rd as Z,mx as _,Px as a,Mr as a$,Er as a0,nn as a1,id as a2,Ud as a3,mo as a4,je as a5,Q as a6,fe as a7,C as a8,R as a9,pn as aA,un as aB,fn as aC,gn as aD,Zn as aE,Kt as aF,cn as aG,Ke as aH,rf as aI,sf as aJ,As as aK,B as aL,Es as aM,Wu as aN,Hr as aO,Jl as aP,vi as aQ,zn as aR,ia as aS,Lo as aT,Dr as aU,Pr as aV,Mn as aW,Ur as aX,xe as aY,Gt as aZ,za as a_,U as aa,G as ab,v as ac,jr as ad,Kn as ae,bt as af,gf as ag,z as ah,b as ai,jc as aj,J as ak,Wt as al,gi as am,el as an,ho as ao,Xa as ap,Va as aq,Qo as ar,k as as,mi as at,Mt as au,L as av,N as aw,w as ax,S as ay,_t as az,Zs as b,y as b0,Xi as b1,tr as b2,Zg as b3,ef as b4,Jg as b5,Oa as b6,pp as b7,hf as b8,Oe as b9,uf as bA,Na as bB,Ua as bC,Lr as bD,ll as bE,Pb as bF,sr as bG,ir as bH,Wr as bI,Ir as bJ,Ss as bK,qo as ba,ee as bb,pt as bc,Yg as bd,ko as be,Ku as bf,Lb as bg,Gf as bh,_r as bi,zr as bj,kp as bk,hp as bl,Ca as bm,Td as bn,nr as bo,Wg as bp,Ha as bq,_n as br,Ft as bs,Hn as bt,ki as bu,Ji as bv,er as bw,rd as bx,La as by,xt as bz,Zr as c,Qb as d,vp as e,Un as f,sa as g,Ht as h,ga as i,li as j,Vr as k,$p as l,Cs as m,ii as n,Bt as o,kn as p,fa as q,Pe as r,Tx as s,yp as t,nt as u,me as v,Xg as w,Qg as x,ct as y,Bn as z};
|