dev-process-kit 0.0.11 → 0.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/THIRD_PARTY_LICENSES.md +46 -0
  2. package/dist/chunks/{shared-B_MMP97h.js → shared-BC5MlWBY.js} +155 -348
  3. package/dist/chunks/{shared-BgCDocVX.js → shared-BvuW5NtY.js} +8 -8
  4. package/dist/chunks/{shared-DGI_sFo5.js → shared-BwaDMwUS.js} +8 -8
  5. package/dist/chunks/{shared-DZfXwU7f.js → shared-CLnfjHCQ.js} +1 -1
  6. package/dist/chunks/{shared-BSFZSMH5.js → shared-C__W71Hw.js} +1 -1
  7. package/dist/chunks/shared-CcrRNZCH.js +30 -0
  8. package/dist/chunks/shared-CoDXb-Yj.js +556 -0
  9. package/dist/chunks/shared-D7CMQLaX.js +2323 -0
  10. package/dist/chunks/{shared-CrE-y5oF.js → shared-DBJaP5gF.js} +65 -48
  11. package/dist/chunks/shared-DUq2-pM9.js +2023 -0
  12. package/dist/chunks/{shared-TW6kWbUL.js → shared-DYe0OZr-.js} +4 -4
  13. package/dist/chunks/shared-DhwK_dh_.js +1093 -0
  14. package/dist/chunks/{shared-CHaHI5X3.js → shared-DkkBQzIf.js} +14 -14
  15. package/dist/chunks/shared-aDPp8Vry.js +1 -0
  16. package/dist/chunks/{shared-OGH3pSVq.js → shared-y3FwoRgh.js} +8 -8
  17. package/dist/components.js +1 -1
  18. package/dist/index.js +1 -1
  19. package/dist/templates/delegation-poker.js +1 -1
  20. package/dist/templates/event-storming.js +1 -1
  21. package/dist/templates/example-mapping.js +1 -1
  22. package/dist/templates/grill.js +1 -1
  23. package/dist/templates/plain.js +1 -1
  24. package/dist/templates/prototype.js +1 -1
  25. package/dist/templates/slides.js +1 -1
  26. package/dist/templates/task-board.js +1 -1
  27. package/dist/templates/usm.js +1 -1
  28. package/dist/templates/whiteboard.js +1 -1
  29. package/package.json +1 -1
  30. package/dist/chunks/shared-B4ewpBuM.js +0 -30
  31. package/dist/chunks/shared-B9OVJ7XA.js +0 -556
  32. package/dist/chunks/shared-BHRhwgui.js +0 -1252
  33. package/dist/chunks/shared-CxFItadP.js +0 -1094
  34. package/dist/chunks/shared-DIJgMVpY.js +0 -2239
@@ -1,10 +1,10 @@
1
- const je=globalThis,lt=je.ShadowRoot&&(je.ShadyCSS===void 0||je.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ct=Symbol(),xs=new WeakMap;let ys=class{constructor(e,s,n){if(this._$cssResult$=!0,n!==ct)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=s}get styleSheet(){let e=this.o;const s=this.t;if(lt&&e===void 0){const n=s!==void 0&&s.length===1;n&&(e=xs.get(s)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&xs.set(s,e))}return e}toString(){return this.cssText}};const ws=t=>new ys(typeof t=="string"?t:t+"",void 0,ct),D=(t,...e)=>{const s=t.length===1?t[0]:e.reduce((n,r,i)=>n+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+t[i+1],t[0]);return new ys(s,t,ct)},Fr=(t,e)=>{if(lt)t.adoptedStyleSheets=e.map(s=>s instanceof CSSStyleSheet?s:s.styleSheet);else for(const s of e){const n=document.createElement("style"),r=je.litNonce;r!==void 0&&n.setAttribute("nonce",r),n.textContent=s.cssText,t.appendChild(n)}},$s=lt?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let s="";for(const n of e.cssRules)s+=n.cssText;return ws(s)})(t):t,{is:Kr,defineProperty:Zr,getOwnPropertyDescriptor:Wr,getOwnPropertyNames:Vr,getOwnPropertySymbols:Gr,getPrototypeOf:Jr}=Object,Ie=globalThis,Ss=Ie.trustedTypes,Yr=Ss?Ss.emptyScript:"",Qr=Ie.reactiveElementPolyfillSupport,be=(t,e)=>t,dt={toAttribute(t,e){switch(e){case Boolean:t=t?Yr:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=t!==null;break;case Number:s=t===null?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch{s=null}}return s}},As=(t,e)=>!Kr(t,e),Cs={attribute:!0,type:String,converter:dt,reflect:!1,useDefault:!1,hasChanged:As};Symbol.metadata??=Symbol("metadata"),Ie.litPropertyMetadata??=new WeakMap;let ae=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,s=Cs){if(s.state&&(s.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((s=Object.create(s)).wrapped=!0),this.elementProperties.set(e,s),!s.noAccessor){const n=Symbol(),r=this.getPropertyDescriptor(e,n,s);r!==void 0&&Zr(this.prototype,e,r)}}static getPropertyDescriptor(e,s,n){const{get:r,set:i}=Wr(this.prototype,e)??{get(){return this[s]},set(o){this[s]=o}};return{get:r,set(o){const a=r?.call(this);i?.call(this,o),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Cs}static _$Ei(){if(this.hasOwnProperty(be("elementProperties")))return;const e=Jr(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(be("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(be("properties"))){const s=this.properties,n=[...Vr(s),...Gr(s)];for(const r of n)this.createProperty(r,s[r])}const e=this[Symbol.metadata];if(e!==null){const s=litPropertyMetadata.get(e);if(s!==void 0)for(const[n,r]of s)this.elementProperties.set(n,r)}this._$Eh=new Map;for(const[s,n]of this.elementProperties){const r=this._$Eu(s,n);r!==void 0&&this._$Eh.set(r,s)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const s=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const r of n)s.unshift($s(r))}else e!==void 0&&s.push($s(e));return s}static _$Eu(e,s){const n=s.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,s=this.constructor.elementProperties;for(const n of s.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Fr(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,s,n){this._$AK(e,n)}_$ET(e,s){const n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(r!==void 0&&n.reflect===!0){const i=(n.converter?.toAttribute!==void 0?n.converter:dt).toAttribute(s,n.type);this._$Em=e,i==null?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,s){const n=this.constructor,r=n._$Eh.get(e);if(r!==void 0&&this._$Em!==r){const i=n.getPropertyOptions(r),o=typeof i.converter=="function"?{fromAttribute:i.converter}:i.converter?.fromAttribute!==void 0?i.converter:dt;this._$Em=r;const a=o.fromAttribute(s,i.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(e,s,n,r=!1,i){if(e!==void 0){const o=this.constructor;if(r===!1&&(i=this[e]),n??=o.getPropertyOptions(e),!((n.hasChanged??As)(i,s)||n.useDefault&&n.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(o._$Eu(e,n))))return;this.C(e,s,n)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,s,{useDefault:n,reflect:r,wrapped:i},o){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??s??this[e]),i!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(s=void 0),this._$AL.set(e,s)),r===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(s){Promise.reject(s)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[r,i]of this._$Ep)this[r]=i;this._$Ep=void 0}const n=this.constructor.elementProperties;if(n.size>0)for(const[r,i]of n){const{wrapped:o}=i,a=this[r];o!==!0||this._$AL.has(r)||a===void 0||this.C(r,void 0,i,a)}}let e=!1;const s=this._$AL;try{e=this.shouldUpdate(s),e?(this.willUpdate(s),this._$EO?.forEach(n=>n.hostUpdate?.()),this.update(s)):this._$EM()}catch(n){throw e=!1,this._$EM(),n}e&&this._$AE(s)}willUpdate(e){}_$AE(e){this._$EO?.forEach(s=>s.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(s=>this._$ET(s,this[s])),this._$EM()}updated(e){}firstUpdated(e){}};ae.elementStyles=[],ae.shadowRootOptions={mode:"open"},ae[be("elementProperties")]=new Map,ae[be("finalized")]=new Map,Qr?.({ReactiveElement:ae}),(Ie.reactiveElementVersions??=[]).push("2.1.2");const pt=globalThis,Ts=t=>t,qe=pt.trustedTypes,Es=qe?qe.createPolicy("lit-html",{createHTML:t=>t}):void 0,_s="$lit$",U=`lit$${Math.random().toFixed(9).slice(2)}$`,Rs="?"+U,Xr=`<${Rs}>`,J=document,ve=()=>J.createComment(""),xe=t=>t===null||typeof t!="object"&&typeof t!="function",ht=Array.isArray,ei=t=>ht(t)||typeof t?.[Symbol.iterator]=="function",ut=`[
2
- \f\r]`,ye=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ls=/-->/g,Ps=/>/g,Y=RegExp(`>|${ut}(?:([^\\s"'>=/]+)(${ut}*=${ut}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),zs=/'/g,Ms=/"/g,Os=/^(?:script|style|textarea|title)$/i,js=t=>(e,...s)=>({_$litType$:t,strings:e,values:s}),g=js(1),ti=js(2),z=Symbol.for("lit-noChange"),m=Symbol.for("lit-nothing"),Is=new WeakMap,Q=J.createTreeWalker(J,129);function qs(t,e){if(!ht(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return Es!==void 0?Es.createHTML(e):e}const si=(t,e)=>{const s=t.length-1,n=[];let r,i=e===2?"<svg>":e===3?"<math>":"",o=ye;for(let a=0;a<s;a++){const l=t[a];let c,p,d=-1,h=0;for(;h<l.length&&(o.lastIndex=h,p=o.exec(l),p!==null);)h=o.lastIndex,o===ye?p[1]==="!--"?o=Ls:p[1]!==void 0?o=Ps:p[2]!==void 0?(Os.test(p[2])&&(r=RegExp("</"+p[2],"g")),o=Y):p[3]!==void 0&&(o=Y):o===Y?p[0]===">"?(o=r??ye,d=-1):p[1]===void 0?d=-2:(d=o.lastIndex-p[2].length,c=p[1],o=p[3]===void 0?Y:p[3]==='"'?Ms:zs):o===Ms||o===zs?o=Y:o===Ls||o===Ps?o=ye:(o=Y,r=void 0);const u=o===Y&&t[a+1].startsWith("/>")?" ":"";i+=o===ye?l+Xr:d>=0?(n.push(c),l.slice(0,d)+_s+l.slice(d)+U+u):l+U+(d===-2?a:u)}return[qs(t,i+(t[s]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]};let ft=class Nr{constructor({strings:e,_$litType$:s},n){let r;this.parts=[];let i=0,o=0;const a=e.length-1,l=this.parts,[c,p]=si(e,s);if(this.el=Nr.createElement(c,n),Q.currentNode=this.el.content,s===2||s===3){const d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(r=Q.nextNode())!==null&&l.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(const d of r.getAttributeNames())if(d.endsWith(_s)){const h=p[o++],u=r.getAttribute(d).split(U),f=/([.?@])?(.*)/.exec(h);l.push({type:1,index:i,name:f[2],strings:u,ctor:f[1]==="."?ri:f[1]==="?"?ii:f[1]==="@"?oi:Be}),r.removeAttribute(d)}else d.startsWith(U)&&(l.push({type:6,index:i}),r.removeAttribute(d));if(Os.test(r.tagName)){const d=r.textContent.split(U),h=d.length-1;if(h>0){r.textContent=qe?qe.emptyScript:"";for(let u=0;u<h;u++)r.append(d[u],ve()),Q.nextNode(),l.push({type:2,index:++i});r.append(d[h],ve())}}}else if(r.nodeType===8)if(r.data===Rs)l.push({type:2,index:i});else{let d=-1;for(;(d=r.data.indexOf(U,d+1))!==-1;)l.push({type:7,index:i}),d+=U.length-1}i++}}static createElement(e,s){const n=J.createElement("template");return n.innerHTML=e,n}};function le(t,e,s=t,n){if(e===z)return e;let r=n!==void 0?s._$Co?.[n]:s._$Cl;const i=xe(e)?void 0:e._$litDirective$;return r?.constructor!==i&&(r?._$AO?.(!1),i===void 0?r=void 0:(r=new i(t),r._$AT(t,s,n)),n!==void 0?(s._$Co??=[])[n]=r:s._$Cl=r),r!==void 0&&(e=le(t,r._$AS(t,e.values),r,n)),e}let ni=class{constructor(e,s){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=s}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:s},parts:n}=this._$AD,r=(e?.creationScope??J).importNode(s,!0);Q.currentNode=r;let i=Q.nextNode(),o=0,a=0,l=n[0];for(;l!==void 0;){if(o===l.index){let c;l.type===2?c=new Ne(i,i.nextSibling,this,e):l.type===1?c=new l.ctor(i,l.name,l.strings,this,e):l.type===6&&(c=new ai(i,this,e)),this._$AV.push(c),l=n[++a]}o!==l?.index&&(i=Q.nextNode(),o++)}return Q.currentNode=J,r}p(e){let s=0;for(const n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,s),s+=n.strings.length-2):n._$AI(e[s])),s++}},Ne=class Br{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,s,n,r){this.type=2,this._$AH=m,this._$AN=void 0,this._$AA=e,this._$AB=s,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const s=this._$AM;return s!==void 0&&e?.nodeType===11&&(e=s.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,s=this){e=le(this,e,s),xe(e)?e===m||e==null||e===""?(this._$AH!==m&&this._$AR(),this._$AH=m):e!==this._$AH&&e!==z&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):ei(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!==m&&xe(this._$AH)?this._$AA.nextSibling.data=e:this.T(J.createTextNode(e)),this._$AH=e}$(e){const{values:s,_$litType$:n}=e,r=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=ft.createElement(qs(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(s);else{const i=new ni(r,this),o=i.u(this.options);i.p(s),this.T(o),this._$AH=i}}_$AC(e){let s=Is.get(e.strings);return s===void 0&&Is.set(e.strings,s=new ft(e)),s}k(e){ht(this._$AH)||(this._$AH=[],this._$AR());const s=this._$AH;let n,r=0;for(const i of e)r===s.length?s.push(n=new Br(this.O(ve()),this.O(ve()),this,this.options)):n=s[r],n._$AI(i),r++;r<s.length&&(this._$AR(n&&n._$AB.nextSibling,r),s.length=r)}_$AR(e=this._$AA.nextSibling,s){for(this._$AP?.(!1,!0,s);e!==this._$AB;){const n=Ts(e).nextSibling;Ts(e).remove(),e=n}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}};class Be{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,s,n,r,i){this.type=1,this._$AH=m,this._$AN=void 0,this.element=e,this.name=s,this._$AM=r,this.options=i,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=m}_$AI(e,s=this,n,r){const i=this.strings;let o=!1;if(i===void 0)e=le(this,e,s,0),o=!xe(e)||e!==this._$AH&&e!==z,o&&(this._$AH=e);else{const a=e;let l,c;for(e=i[0],l=0;l<i.length-1;l++)c=le(this,a[n+l],s,l),c===z&&(c=this._$AH[l]),o||=!xe(c)||c!==this._$AH[l],c===m?e=m:e!==m&&(e+=(c??"")+i[l+1]),this._$AH[l]=c}o&&!r&&this.j(e)}j(e){e===m?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}let ri=class extends Be{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===m?void 0:e}},ii=class extends Be{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==m)}},oi=class extends Be{constructor(e,s,n,r,i){super(e,s,n,r,i),this.type=5}_$AI(e,s=this){if((e=le(this,e,s,0)??m)===z)return;const n=this._$AH,r=e===m&&n!==m||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,i=e!==m&&(n===m||r);r&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}};class ai{constructor(e,s,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=s,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){le(this,e)}}const li={I:Ne},ci=pt.litHtmlPolyfillSupport;ci?.(ft,Ne),(pt.litHtmlVersions??=[]).push("3.3.3");const di=(t,e,s)=>{const n=s?.renderBefore??e;let r=n._$litPart$;if(r===void 0){const i=s?.renderBefore??null;n._$litPart$=r=new Ne(e.insertBefore(ve(),i),i,void 0,s??{})}return r._$AI(t),r},gt=globalThis;let H=class extends ae{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const s=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=di(s,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return z}};H._$litElement$=!0,H.finalized=!0,gt.litElementHydrateSupport?.({LitElement:H});const pi=gt.litElementPolyfillSupport;pi?.({LitElement:H}),(gt.litElementVersions??=[]).push("4.2.2");const F={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4},De=t=>(...e)=>({_$litDirective$:t,values:e});let Ue=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,s,n){this._$Ct=e,this._$AM=s,this._$Ci=n}_$AS(e,s){return this.update(e,s)}update(e,s){return this.render(...s)}};const{I:hi}=li,Ns=t=>t,ui=t=>t.strings===void 0,Bs=()=>document.createComment(""),we=(t,e,s)=>{const n=t._$AA.parentNode,r=e===void 0?t._$AB:e._$AA;if(s===void 0){const i=n.insertBefore(Bs(),r),o=n.insertBefore(Bs(),r);s=new hi(i,o,t,t.options)}else{const i=s._$AB.nextSibling,o=s._$AM,a=o!==t;if(a){let l;s._$AQ?.(t),s._$AM=t,s._$AP!==void 0&&(l=t._$AU)!==o._$AU&&s._$AP(l)}if(i!==r||a){let l=s._$AA;for(;l!==i;){const c=Ns(l).nextSibling;Ns(n).insertBefore(l,r),l=c}}}return s},X=(t,e,s=t)=>(t._$AI(e,s),t),fi={},mt=(t,e=fi)=>t._$AH=e,gi=t=>t._$AH,kt=t=>{t._$AR(),t._$AA.remove()},bt=De(class extends Ue{constructor(t){if(super(t),t.type!==F.PROPERTY&&t.type!==F.ATTRIBUTE&&t.type!==F.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!ui(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,[e]){if(e===z||e===m)return e;const s=t.element,n=t.name;if(t.type===F.PROPERTY){if(e===s[n])return z}else if(t.type===F.BOOLEAN_ATTRIBUTE){if(!!e===s.hasAttribute(n))return z}else if(t.type===F.ATTRIBUTE&&s.getAttribute(n)===e+"")return z;return mt(t),e}});class vt extends Ue{constructor(e){if(super(e),this.it=m,e.type!==F.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===m||e==null)return this._t=void 0,this.it=e;if(e===z)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const s=[e];return s.raw=s,this._t={_$litType$:this.constructor.resultType,strings:s,values:[]}}}vt.directiveName="unsafeHTML",vt.resultType=1;const Ds=De(vt),He=t=>{let e=t;for(;e!==null;){if(e instanceof Element){const s=e.getAttribute("lang");if(s!==null)return s}e=e instanceof ShadowRoot?e.host:e.parentNode}return null},xt=["en","ja"],Us="en",Hs=t=>xt.some(e=>e===t),Fe=t=>{const e=(t??"").split("-")[0]?.toLowerCase()??"";return Hs(e)?e:Us},Fs=t=>Fe(He(t)),yt="dpk-locale-change",Ks=t=>typeof t=="string"&&Hs(t)?t:null,mi=t=>t.preference??t.authored,ki=(t,e)=>t===e?null:t,Ke=t=>e=>e==="ja"?t.ja:t.en;class wt{#e;#i;#n=Us;constructor(e,s=()=>{}){this.#e=e,this.#i=s,e.addController(this)}get locale(){return this.#n}hostConnected(){this.#n=Fs(this.#e),document.addEventListener(yt,this.#r)}hostDisconnected(){document.removeEventListener(yt,this.#r)}#r=()=>{const e=Fs(this.#e);e!==this.#n&&(this.#n=e,this.#i(),this.#e.requestUpdate())}}const bi={paper:["#f6f7f9","#0e1014"],"paper-raised":["#ffffff","#171a20"],"paper-sunken":["#eff1f4","#0a0b0e"],"paper-inset":["#e7eaef","#22262e"],ink:["#11141b","#eceef3"],"ink-soft":["#464e5f","#a9b0bd"],"ink-faint":["#788195","#737b8b"],rule:["rgba(17, 24, 39, 0.08)","rgba(226, 232, 244, 0.08)"],"rule-strong":["rgba(17, 24, 39, 0.13)","rgba(226, 232, 244, 0.14)"],"rule-hover":["rgba(17, 24, 39, 0.24)","rgba(226, 232, 244, 0.26)"],accent:["#e04e1f","#f26a3d"],"accent-strong":["#c63f12","#dc5226"],"accent-bright":["#f0652f","#ff8a5e"],"accent-soft":["rgba(224, 78, 31, 0.08)","rgba(242, 106, 61, 0.14)"],"accent-ink":["#ffffff","#ffffff"],blue:["#3563d9","#7aa2f7"],"blue-strong":["#2a4fb3","#5b86e8"],"blue-soft":["rgba(53, 99, 217, 0.09)","rgba(122, 162, 247, 0.15)"],green:["#15894a","#4cc787"],"green-soft":["rgba(21, 137, 74, 0.09)","rgba(76, 199, 135, 0.14)"],amber:["#b27406","#e9ae45"],"amber-soft":["rgba(178, 116, 6, 0.1)","rgba(233, 174, 69, 0.15)"],violet:["#7549d6","#ab90f5"],"violet-soft":["rgba(117, 73, 214, 0.09)","rgba(171, 144, 245, 0.15)"],danger:["#c11d38","#f5707f"],"danger-soft":["rgba(214, 53, 80, 0.09)","rgba(245, 112, 127, 0.14)"],shade:["rgb(17, 24, 39)","rgb(0, 0, 0)"],"shade-1":["rgba(17, 24, 39, 0.06)","rgba(0, 0, 0, 0.32)"],"shade-2":["rgba(17, 24, 39, 0.08)","rgba(0, 0, 0, 0.38)"],"shade-3":["rgba(17, 24, 39, 0.13)","rgba(0, 0, 0, 0.5)"],highlight:["rgba(255, 255, 255, 0.9)","rgba(255, 255, 255, 0.05)"]},Zs=t=>ws(Object.entries(bi).map(([e,[s,n]])=>`--dpk-${e}: ${t(s,n)};`).join(`
4
- `)),Ze=D`
1
+ const qe=globalThis,dt=qe.ShadowRoot&&(qe.ShadyCSS===void 0||qe.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,pt=Symbol(),ws=new WeakMap;let $s=class{constructor(e,s,n){if(this._$cssResult$=!0,n!==pt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=s}get styleSheet(){let e=this.o;const s=this.t;if(dt&&e===void 0){const n=s!==void 0&&s.length===1;n&&(e=ws.get(s)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&ws.set(s,e))}return e}toString(){return this.cssText}};const Ss=t=>new $s(typeof t=="string"?t:t+"",void 0,pt),B=(t,...e)=>{const s=t.length===1?t[0]:e.reduce((n,r,i)=>n+(a=>{if(a._$cssResult$===!0)return a.cssText;if(typeof a=="number")return a;throw Error("Value passed to 'css' function must be a 'css' function result: "+a+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+t[i+1],t[0]);return new $s(s,t,pt)},Yr=(t,e)=>{if(dt)t.adoptedStyleSheets=e.map(s=>s instanceof CSSStyleSheet?s:s.styleSheet);else for(const s of e){const n=document.createElement("style"),r=qe.litNonce;r!==void 0&&n.setAttribute("nonce",r),n.textContent=s.cssText,t.appendChild(n)}},As=dt?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let s="";for(const n of e.cssRules)s+=n.cssText;return Ss(s)})(t):t,{is:Qr,defineProperty:Xr,getOwnPropertyDescriptor:ei,getOwnPropertyNames:ti,getOwnPropertySymbols:si,getPrototypeOf:ni}=Object,Ne=globalThis,Ts=Ne.trustedTypes,ri=Ts?Ts.emptyScript:"",ii=Ne.reactiveElementPolyfillSupport,xe=(t,e)=>t,ht={toAttribute(t,e){switch(e){case Boolean:t=t?ri:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=t!==null;break;case Number:s=t===null?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch{s=null}}return s}},Cs=(t,e)=>!Qr(t,e),Es={attribute:!0,type:String,converter:ht,reflect:!1,useDefault:!1,hasChanged:Cs};Symbol.metadata??=Symbol("metadata"),Ne.litPropertyMetadata??=new WeakMap;let le=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,s=Es){if(s.state&&(s.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((s=Object.create(s)).wrapped=!0),this.elementProperties.set(e,s),!s.noAccessor){const n=Symbol(),r=this.getPropertyDescriptor(e,n,s);r!==void 0&&Xr(this.prototype,e,r)}}static getPropertyDescriptor(e,s,n){const{get:r,set:i}=ei(this.prototype,e)??{get(){return this[s]},set(a){this[s]=a}};return{get:r,set(a){const o=r?.call(this);i?.call(this,a),this.requestUpdate(e,o,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Es}static _$Ei(){if(this.hasOwnProperty(xe("elementProperties")))return;const e=ni(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(xe("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(xe("properties"))){const s=this.properties,n=[...ti(s),...si(s)];for(const r of n)this.createProperty(r,s[r])}const e=this[Symbol.metadata];if(e!==null){const s=litPropertyMetadata.get(e);if(s!==void 0)for(const[n,r]of s)this.elementProperties.set(n,r)}this._$Eh=new Map;for(const[s,n]of this.elementProperties){const r=this._$Eu(s,n);r!==void 0&&this._$Eh.set(r,s)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const s=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const r of n)s.unshift(As(r))}else e!==void 0&&s.push(As(e));return s}static _$Eu(e,s){const n=s.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,s=this.constructor.elementProperties;for(const n of s.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Yr(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,s,n){this._$AK(e,n)}_$ET(e,s){const n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(r!==void 0&&n.reflect===!0){const i=(n.converter?.toAttribute!==void 0?n.converter:ht).toAttribute(s,n.type);this._$Em=e,i==null?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,s){const n=this.constructor,r=n._$Eh.get(e);if(r!==void 0&&this._$Em!==r){const i=n.getPropertyOptions(r),a=typeof i.converter=="function"?{fromAttribute:i.converter}:i.converter?.fromAttribute!==void 0?i.converter:ht;this._$Em=r;const o=a.fromAttribute(s,i.type);this[r]=o??this._$Ej?.get(r)??o,this._$Em=null}}requestUpdate(e,s,n,r=!1,i){if(e!==void 0){const a=this.constructor;if(r===!1&&(i=this[e]),n??=a.getPropertyOptions(e),!((n.hasChanged??Cs)(i,s)||n.useDefault&&n.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(a._$Eu(e,n))))return;this.C(e,s,n)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,s,{useDefault:n,reflect:r,wrapped:i},a){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??s??this[e]),i!==!0||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(s=void 0),this._$AL.set(e,s)),r===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(s){Promise.reject(s)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[r,i]of this._$Ep)this[r]=i;this._$Ep=void 0}const n=this.constructor.elementProperties;if(n.size>0)for(const[r,i]of n){const{wrapped:a}=i,o=this[r];a!==!0||this._$AL.has(r)||o===void 0||this.C(r,void 0,i,o)}}let e=!1;const s=this._$AL;try{e=this.shouldUpdate(s),e?(this.willUpdate(s),this._$EO?.forEach(n=>n.hostUpdate?.()),this.update(s)):this._$EM()}catch(n){throw e=!1,this._$EM(),n}e&&this._$AE(s)}willUpdate(e){}_$AE(e){this._$EO?.forEach(s=>s.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(s=>this._$ET(s,this[s])),this._$EM()}updated(e){}firstUpdated(e){}};le.elementStyles=[],le.shadowRootOptions={mode:"open"},le[xe("elementProperties")]=new Map,le[xe("finalized")]=new Map,ii?.({ReactiveElement:le}),(Ne.reactiveElementVersions??=[]).push("2.1.2");const ut=globalThis,_s=t=>t,De=ut.trustedTypes,Rs=De?De.createPolicy("lit-html",{createHTML:t=>t}):void 0,Ls="$lit$",H=`lit$${Math.random().toFixed(9).slice(2)}$`,Ps="?"+H,ai=`<${Ps}>`,Y=document,ve=()=>Y.createComment(""),ye=t=>t===null||typeof t!="object"&&typeof t!="function",ft=Array.isArray,oi=t=>ft(t)||typeof t?.[Symbol.iterator]=="function",gt=`[
2
+ \f\r]`,we=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,zs=/-->/g,Os=/>/g,Q=RegExp(`>|${gt}(?:([^\\s"'>=/]+)(${gt}*=${gt}*(?:[^
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Ms=/'/g,js=/"/g,Is=/^(?:script|style|textarea|title)$/i,qs=t=>(e,...s)=>({_$litType$:t,strings:e,values:s}),k=qs(1),li=qs(2),O=Symbol.for("lit-noChange"),g=Symbol.for("lit-nothing"),Ns=new WeakMap,X=Y.createTreeWalker(Y,129);function Ds(t,e){if(!ft(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return Rs!==void 0?Rs.createHTML(e):e}const ci=(t,e)=>{const s=t.length-1,n=[];let r,i=e===2?"<svg>":e===3?"<math>":"",a=we;for(let o=0;o<s;o++){const l=t[o];let c,p,d=-1,h=0;for(;h<l.length&&(a.lastIndex=h,p=a.exec(l),p!==null);)h=a.lastIndex,a===we?p[1]==="!--"?a=zs:p[1]!==void 0?a=Os:p[2]!==void 0?(Is.test(p[2])&&(r=RegExp("</"+p[2],"g")),a=Q):p[3]!==void 0&&(a=Q):a===Q?p[0]===">"?(a=r??we,d=-1):p[1]===void 0?d=-2:(d=a.lastIndex-p[2].length,c=p[1],a=p[3]===void 0?Q:p[3]==='"'?js:Ms):a===js||a===Ms?a=Q:a===zs||a===Os?a=we:(a=Q,r=void 0);const u=a===Q&&t[o+1].startsWith("/>")?" ":"";i+=a===we?l+ai:d>=0?(n.push(c),l.slice(0,d)+Ls+l.slice(d)+H+u):l+H+(d===-2?o:u)}return[Ds(t,i+(t[s]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]};let mt=class Zr{constructor({strings:e,_$litType$:s},n){let r;this.parts=[];let i=0,a=0;const o=e.length-1,l=this.parts,[c,p]=ci(e,s);if(this.el=Zr.createElement(c,n),X.currentNode=this.el.content,s===2||s===3){const d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(r=X.nextNode())!==null&&l.length<o;){if(r.nodeType===1){if(r.hasAttributes())for(const d of r.getAttributeNames())if(d.endsWith(Ls)){const h=p[a++],u=r.getAttribute(d).split(H),f=/([.?@])?(.*)/.exec(h);l.push({type:1,index:i,name:f[2],strings:u,ctor:f[1]==="."?pi:f[1]==="?"?hi:f[1]==="@"?ui:Be}),r.removeAttribute(d)}else d.startsWith(H)&&(l.push({type:6,index:i}),r.removeAttribute(d));if(Is.test(r.tagName)){const d=r.textContent.split(H),h=d.length-1;if(h>0){r.textContent=De?De.emptyScript:"";for(let u=0;u<h;u++)r.append(d[u],ve()),X.nextNode(),l.push({type:2,index:++i});r.append(d[h],ve())}}}else if(r.nodeType===8)if(r.data===Ps)l.push({type:2,index:i});else{let d=-1;for(;(d=r.data.indexOf(H,d+1))!==-1;)l.push({type:7,index:i}),d+=H.length-1}i++}}static createElement(e,s){const n=Y.createElement("template");return n.innerHTML=e,n}};function ce(t,e,s=t,n){if(e===O)return e;let r=n!==void 0?s._$Co?.[n]:s._$Cl;const i=ye(e)?void 0:e._$litDirective$;return r?.constructor!==i&&(r?._$AO?.(!1),i===void 0?r=void 0:(r=new i(t),r._$AT(t,s,n)),n!==void 0?(s._$Co??=[])[n]=r:s._$Cl=r),r!==void 0&&(e=ce(t,r._$AS(t,e.values),r,n)),e}let di=class{constructor(e,s){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=s}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:s},parts:n}=this._$AD,r=(e?.creationScope??Y).importNode(s,!0);X.currentNode=r;let i=X.nextNode(),a=0,o=0,l=n[0];for(;l!==void 0;){if(a===l.index){let c;l.type===2?c=new Ue(i,i.nextSibling,this,e):l.type===1?c=new l.ctor(i,l.name,l.strings,this,e):l.type===6&&(c=new fi(i,this,e)),this._$AV.push(c),l=n[++o]}a!==l?.index&&(i=X.nextNode(),a++)}return X.currentNode=Y,r}p(e){let s=0;for(const n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,s),s+=n.strings.length-2):n._$AI(e[s])),s++}},Ue=class Wr{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,s,n,r){this.type=2,this._$AH=g,this._$AN=void 0,this._$AA=e,this._$AB=s,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const s=this._$AM;return s!==void 0&&e?.nodeType===11&&(e=s.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,s=this){e=ce(this,e,s),ye(e)?e===g||e==null||e===""?(this._$AH!==g&&this._$AR(),this._$AH=g):e!==this._$AH&&e!==O&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):oi(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==g&&ye(this._$AH)?this._$AA.nextSibling.data=e:this.T(Y.createTextNode(e)),this._$AH=e}$(e){const{values:s,_$litType$:n}=e,r=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=mt.createElement(Ds(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(s);else{const i=new di(r,this),a=i.u(this.options);i.p(s),this.T(a),this._$AH=i}}_$AC(e){let s=Ns.get(e.strings);return s===void 0&&Ns.set(e.strings,s=new mt(e)),s}k(e){ft(this._$AH)||(this._$AH=[],this._$AR());const s=this._$AH;let n,r=0;for(const i of e)r===s.length?s.push(n=new Wr(this.O(ve()),this.O(ve()),this,this.options)):n=s[r],n._$AI(i),r++;r<s.length&&(this._$AR(n&&n._$AB.nextSibling,r),s.length=r)}_$AR(e=this._$AA.nextSibling,s){for(this._$AP?.(!1,!0,s);e!==this._$AB;){const n=_s(e).nextSibling;_s(e).remove(),e=n}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}};class Be{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,s,n,r,i){this.type=1,this._$AH=g,this._$AN=void 0,this.element=e,this.name=s,this._$AM=r,this.options=i,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=g}_$AI(e,s=this,n,r){const i=this.strings;let a=!1;if(i===void 0)e=ce(this,e,s,0),a=!ye(e)||e!==this._$AH&&e!==O,a&&(this._$AH=e);else{const o=e;let l,c;for(e=i[0],l=0;l<i.length-1;l++)c=ce(this,o[n+l],s,l),c===O&&(c=this._$AH[l]),a||=!ye(c)||c!==this._$AH[l],c===g?e=g:e!==g&&(e+=(c??"")+i[l+1]),this._$AH[l]=c}a&&!r&&this.j(e)}j(e){e===g?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}let pi=class extends Be{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===g?void 0:e}},hi=class extends Be{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==g)}},ui=class extends Be{constructor(e,s,n,r,i){super(e,s,n,r,i),this.type=5}_$AI(e,s=this){if((e=ce(this,e,s,0)??g)===O)return;const n=this._$AH,r=e===g&&n!==g||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,i=e!==g&&(n===g||r);r&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}};class fi{constructor(e,s,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=s,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){ce(this,e)}}const gi={I:Ue},mi=ut.litHtmlPolyfillSupport;mi?.(mt,Ue),(ut.litHtmlVersions??=[]).push("3.3.3");const ki=(t,e,s)=>{const n=s?.renderBefore??e;let r=n._$litPart$;if(r===void 0){const i=s?.renderBefore??null;n._$litPart$=r=new Ue(e.insertBefore(ve(),i),i,void 0,s??{})}return r._$AI(t),r},kt=globalThis;let F=class extends le{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const s=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=ki(s,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return O}};F._$litElement$=!0,F.finalized=!0,kt.litElementHydrateSupport?.({LitElement:F});const bi=kt.litElementPolyfillSupport;bi?.({LitElement:F}),(kt.litElementVersions??=[]).push("4.2.2");const K={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4},$e=t=>(...e)=>({_$litDirective$:t,values:e});let He=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,s,n){this._$Ct=e,this._$AM=s,this._$Ci=n}_$AS(e,s){return this.update(e,s)}update(e,s){return this.render(...s)}};const{I:xi}=gi,Us=t=>t,vi=t=>t.strings===void 0,Bs=()=>document.createComment(""),Se=(t,e,s)=>{const n=t._$AA.parentNode,r=e===void 0?t._$AB:e._$AA;if(s===void 0){const i=n.insertBefore(Bs(),r),a=n.insertBefore(Bs(),r);s=new xi(i,a,t,t.options)}else{const i=s._$AB.nextSibling,a=s._$AM,o=a!==t;if(o){let l;s._$AQ?.(t),s._$AM=t,s._$AP!==void 0&&(l=t._$AU)!==a._$AU&&s._$AP(l)}if(i!==r||o){let l=s._$AA;for(;l!==i;){const c=Us(l).nextSibling;Us(n).insertBefore(l,r),l=c}}}return s},ee=(t,e,s=t)=>(t._$AI(e,s),t),yi={},bt=(t,e=yi)=>t._$AH=e,wi=t=>t._$AH,xt=t=>{t._$AR(),t._$AA.remove()},vt=$e(class extends He{constructor(t){if(super(t),t.type!==K.PROPERTY&&t.type!==K.ATTRIBUTE&&t.type!==K.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!vi(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,[e]){if(e===O||e===g)return e;const s=t.element,n=t.name;if(t.type===K.PROPERTY){if(e===s[n])return O}else if(t.type===K.BOOLEAN_ATTRIBUTE){if(!!e===s.hasAttribute(n))return O}else if(t.type===K.ATTRIBUTE&&s.getAttribute(n)===e+"")return O;return bt(t),e}});class Fe extends He{constructor(e){if(super(e),this.it=g,e.type!==K.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===g||e==null)return this._t=void 0,this.it=e;if(e===O)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 s=[e];return s.raw=s,this._t={_$litType$:this.constructor.resultType,strings:s,values:[]}}}Fe.directiveName="unsafeHTML",Fe.resultType=1;const Hs=$e(Fe),Ke=t=>{let e=t;for(;e!==null;){if(e instanceof Element){const s=e.getAttribute("lang");if(s!==null)return s}e=e instanceof ShadowRoot?e.host:e.parentNode}return null},yt=["en","ja"],Fs="en",Ks=t=>yt.some(e=>e===t),Ze=t=>{const e=(t??"").split("-")[0]?.toLowerCase()??"";return Ks(e)?e:Fs},Zs=t=>Ze(Ke(t)),wt="dpk-locale-change",Ws=t=>typeof t=="string"&&Ks(t)?t:null,$i=t=>t.preference??t.authored,Si=(t,e)=>t===e?null:t,We=t=>e=>e==="ja"?t.ja:t.en;class $t{#e;#i;#n=Fs;constructor(e,s=()=>{}){this.#e=e,this.#i=s,e.addController(this)}get locale(){return this.#n}hostConnected(){this.#n=Zs(this.#e),document.addEventListener(wt,this.#r)}hostDisconnected(){document.removeEventListener(wt,this.#r)}#r=()=>{const e=Zs(this.#e);e!==this.#n&&(this.#n=e,this.#i(),this.#e.requestUpdate())}}const Ai={paper:["#f6f7f9","#0e1014"],"paper-raised":["#ffffff","#171a20"],"paper-sunken":["#eff1f4","#0a0b0e"],"paper-inset":["#e7eaef","#22262e"],ink:["#11141b","#eceef3"],"ink-soft":["#464e5f","#a9b0bd"],"ink-faint":["#788195","#737b8b"],rule:["rgba(17, 24, 39, 0.08)","rgba(226, 232, 244, 0.08)"],"rule-strong":["rgba(17, 24, 39, 0.13)","rgba(226, 232, 244, 0.14)"],"rule-hover":["rgba(17, 24, 39, 0.24)","rgba(226, 232, 244, 0.26)"],accent:["#e04e1f","#f26a3d"],"accent-strong":["#c63f12","#dc5226"],"accent-bright":["#f0652f","#ff8a5e"],"accent-soft":["rgba(224, 78, 31, 0.08)","rgba(242, 106, 61, 0.14)"],"accent-ink":["#ffffff","#ffffff"],blue:["#3563d9","#7aa2f7"],"blue-strong":["#2a4fb3","#5b86e8"],"blue-soft":["rgba(53, 99, 217, 0.09)","rgba(122, 162, 247, 0.15)"],green:["#15894a","#4cc787"],"green-soft":["rgba(21, 137, 74, 0.09)","rgba(76, 199, 135, 0.14)"],amber:["#b27406","#e9ae45"],"amber-soft":["rgba(178, 116, 6, 0.1)","rgba(233, 174, 69, 0.15)"],violet:["#7549d6","#ab90f5"],"violet-soft":["rgba(117, 73, 214, 0.09)","rgba(171, 144, 245, 0.15)"],danger:["#c11d38","#f5707f"],"danger-soft":["rgba(214, 53, 80, 0.09)","rgba(245, 112, 127, 0.14)"],shade:["rgb(17, 24, 39)","rgb(0, 0, 0)"],"shade-1":["rgba(17, 24, 39, 0.06)","rgba(0, 0, 0, 0.32)"],"shade-2":["rgba(17, 24, 39, 0.08)","rgba(0, 0, 0, 0.38)"],"shade-3":["rgba(17, 24, 39, 0.13)","rgba(0, 0, 0, 0.5)"],highlight:["rgba(255, 255, 255, 0.9)","rgba(255, 255, 255, 0.05)"]},Vs=t=>Ss(Object.entries(Ai).map(([e,[s,n]])=>`--dpk-${e}: ${t(s,n)};`).join(`
4
+ `)),Ve=B`
5
5
  :host {
6
6
  /* Browsers without light-dark() stay light. */
7
- ${Zs(t=>t)}
7
+ ${Vs(t=>t)}
8
8
  --dpk-display: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
9
9
  --dpk-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
10
10
  --dpk-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
@@ -42,7 +42,7 @@ const je=globalThis,lt=je.ShadowRoot&&(je.ShadyCSS===void 0||je.ShadyCSS.nativeS
42
42
 
43
43
  @supports (color: light-dark(#000, #fff)) {
44
44
  :host {
45
- ${Zs((t,e)=>`light-dark(${t}, ${e})`)}
45
+ ${Vs((t,e)=>`light-dark(${t}, ${e})`)}
46
46
  }
47
47
  }
48
48
 
@@ -95,7 +95,7 @@ const je=globalThis,lt=je.ShadowRoot&&(je.ShadyCSS===void 0||je.ShadyCSS.nativeS
95
95
  transition-duration: 1ms !important;
96
96
  }
97
97
  }
98
- `,$t=D`
98
+ `,St=B`
99
99
  .dpk-btn {
100
100
  display: inline-flex;
101
101
  align-items: center;
@@ -328,7 +328,7 @@ const je=globalThis,lt=je.ShadowRoot&&(je.ShadyCSS===void 0||je.ShadyCSS.nativeS
328
328
  min-height: 64px;
329
329
  line-height: 1.55;
330
330
  }
331
- `,vi=D`
331
+ `,Ti=B`
332
332
  .comment-pop {
333
333
  box-sizing: border-box;
334
334
  overflow: auto;
@@ -383,7 +383,7 @@ const je=globalThis,lt=je.ShadowRoot&&(je.ShadyCSS===void 0||je.ShadyCSS.nativeS
383
383
  align-items: center;
384
384
  justify-content: flex-end;
385
385
  }
386
- `,Ws=D`
386
+ `,Gs=B`
387
387
  .dpk-prose {
388
388
  overflow-wrap: anywhere;
389
389
  }
@@ -482,73 +482,73 @@ const je=globalThis,lt=je.ShadowRoot&&(je.ShadyCSS===void 0||je.ShadyCSS.nativeS
482
482
  .dpk-prose img {
483
483
  max-width: 100%;
484
484
  }
485
- `,ce=(t,e)=>t instanceof e?t:null;function St(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ee=St();function Vs(t){ee=t}var te={exec:()=>null};function de(t){let e=[];return s=>{let n=Math.max(0,Math.min(3,s-1)),r=e[n];return r||(r=t(n),e[n]=r),r}}function b(t,e=""){let s=typeof t=="string"?t:t.source,n={replace:(r,i)=>{let o=typeof i=="string"?i:i.source;return o=o.replace(T.caret,"$1"),s=s.replace(r,o),n},getRegex:()=>new RegExp(s,e)};return n}var xi=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),T={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:de(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:de(t=>new RegExp(`^ {0,${t}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:de(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:de(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:de(t=>new RegExp(`^ {0,${t}}(?:</?(?:${Se})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,"i")),blockquoteBeginRegex:de(t=>new RegExp(`^ {0,${t}}>`))},yi=/^(?:[ \t]*(?:\n|$))+/,wi=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,$i=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,$e=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Si=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,At=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Gs=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Js=b(Gs).replace(/bull/g,At).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(),Ai=b(Gs).replace(/bull/g,At).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(),Ct=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,Ci=/^[^\n]+/,Tt=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Ti=b(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Tt).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ei=b(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,At).getRegex(),Se="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",Et=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,_i=b("^ {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",Et).replace("tag",Se).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ys=t=>b(Ct).replace("hr",$e).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",Se).getRegex(),Ri=Ys(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),Li=Ys(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Pi=b(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Li).getRegex(),_t={blockquote:Pi,code:wi,def:Ti,fences:$i,heading:Si,hr:$e,html:_i,lheading:Js,list:Ei,newline:yi,paragraph:Ri,table:te,text:Ci},Qs=b("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",$e).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",Se).getRegex(),zi={..._t,lheading:Ai,table:Qs,paragraph:b(Ct).replace("hr",$e).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Qs).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",Se).getRegex()},Mi={..._t,html:b(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Et).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:te,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:b(Ct).replace("hr",$e).replace("heading",` *#{1,6} *[^
486
- ]`).replace("lheading",Js).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Oi=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ji=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Xs=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,Ii=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,B=/[\p{P}\p{S}]/u,pe=/[\s\p{P}\p{S}]/u,Ae=/[^\s\p{P}\p{S}]/u,qi=b(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,pe).getRegex(),Ni=/[\p{Pi}\p{Ps}"']/u,en=/(?!~)[\p{P}\p{S}]/u,Bi=/(?!~)[\s\p{P}\p{S}]/u,Di=/(?:[^\s\p{P}\p{S}]|~)/u,Ui=b(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",xi?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),tn=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Hi=b(tn,"u").replace(/punct/g,B).getRegex(),Fi=b(tn,"u").replace(/punct/g,en).getRegex(),Ki=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,Zi=b(Ki,"u").replace(/openQuote/g,Ni).replace(/punct/g,B).getRegex(),sn="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Wi=b(sn,"gu").replace(/notPunctSpace/g,Ae).replace(/punctSpace/g,pe).replace(/punct/g,B).getRegex(),Vi=b(sn,"gu").replace(/notPunctSpace/g,Di).replace(/punctSpace/g,Bi).replace(/punct/g,en).getRegex(),Gi="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",Ji=b(Gi,"gu").replace(/notPunctSpace/g,Ae).replace(/punctSpace/g,pe).replace(/punct/g,B).getRegex(),Yi=b("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ae).replace(/punctSpace/g,pe).replace(/punct/g,B).getRegex(),Qi="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",Xi=b(Qi,"gu").replace(/notPunctSpace/g,Ae).replace(/punctSpace/g,pe).replace(/punct/g,B).getRegex(),eo=b(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,B).getRegex(),to="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",so=b(to,"gu").replace(/notPunctSpace/g,Ae).replace(/punctSpace/g,pe).replace(/punct/g,B).getRegex(),no=b(/\\(punct)/,"gu").replace(/punct/g,B).getRegex(),ro=b(/^<(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(),io=b(Et).replace("(?:-->|$)","-->").getRegex(),oo=b("^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",io).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),nn=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,We=b(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",nn).getRegex(),ao=b(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label",We).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),lo=b(/^!?\[(label)\]\[(ref)\]/).replace("label",We).replace("ref",Tt).getRegex(),co=b(/^!?\[(ref)\](?:\[\])?/).replace("ref",Tt).getRegex(),rn=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,po=b(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",nn).getRegex(),ho=b("reflink|nolink(?!\\()","g").replace("reflink",b(/^!?\[(label)\]\[(ref)\]/).replace("label",po).replace("ref",rn).getRegex()).replace("nolink",b(/^!?\[(ref)\](?:\[\])?/).replace("ref",rn).getRegex()).getRegex(),on=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,uo=/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/,fo=b(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,uo).getRegex(),Rt={_backpedal:te,anyPunctuation:no,autolink:ro,blockSkip:Ui,br:Xs,code:ji,del:te,delLDelim:te,delRDelim:te,emStrongLDelim:Hi,emStrongRDelimAst:Wi,emStrongRDelimUnd:Yi,escape:Oi,link:ao,nolink:co,punctuation:qi,reflink:lo,reflinkSearch:ho,tag:oo,text:Ii,url:te},go={...Rt,emStrongLDelim:Zi,emStrongRDelimAst:Ji,emStrongRDelimUnd:Xi,link:b(/^!?\[(label)\]\((.*?)\)/).replace("label",We).getRegex(),reflink:b(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",We).getRegex()},Lt={...Rt,emStrongRDelimAst:Vi,emStrongLDelim:Fi,delLDelim:eo,delRDelim:so,url:b(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",fo).replace("protocol",on).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:b(/^(?:[^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",on).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},mo={...Lt,br:b(Xs).replace("{2,}","*").getRegex(),text:b(Lt.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ve={normal:_t,gfm:zi,pedantic:Mi},Ce={normal:Rt,gfm:Lt,breaks:mo,pedantic:go},ko={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},an=t=>ko[t];function R(t,e){if(e){if(T.escapeTest.test(t))return t.replace(T.escapeReplace,an)}else if(T.escapeTestNoEncode.test(t))return t.replace(T.escapeReplaceNoEncode,an);return t}function bo(t){return t.replace(T.numericCharacterReference,(e,s,n)=>{let r=s===void 0?Number.parseInt(n,16):Number.parseInt(s,10);return r===0||r>1114111||r>=55296&&r<=57343?"\uFFFD":String.fromCodePoint(r)})}function ln(t){try{t=encodeURI(t).replace(T.percentDecode,"%")}catch{return null}return t}function cn(t,e){let s=t.replace(T.findPipe,(i,o,a)=>{let l=!1,c=o;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),n=s.split(T.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(T.slashPipe,"|");return n}function K(t,e,s){let n=t.length;if(n===0)return"";let r=0;for(;r<n&&t.charAt(n-r-1)===e;)r++;return t.slice(0,n-r)}function dn(t){let e=t.split(`
487
- `),s=e.length-1;for(;s>=0&&T.blankLine.test(e[s]);)s--;return e.length-s<=2?t:e.slice(0,s+1).join(`
488
- `)}function Ge(t){return t.trim().toLowerCase().toUpperCase().toLowerCase()}function pn(t,e){if(t.indexOf(e[0])===-1&&t.indexOf(e[1])===-1)return-1;let s=0;for(let n=0;n<t.length;n++)if(t[n]==="\\")n++;else if(t[n]===e[0])s++;else if(t[n]===e[1]&&(s--,s<0))return n;return s>0?-2:-1}function hn(t,e=0){let s=e,n="";for(let r of t)if(r===" "){let i=4-s%4;n+=" ".repeat(i),s+=i}else n+=r,s++;return n}function un(t,e,s,n,r){let i=e.href,o=e.title||null,a=t[1].replace(r.other.outputLinkReplace,"$1"),l=t[0].charAt(0)==="!";n.state.inLink=!0;let c=n.state.linkEmitted,p=n.state.inRawBlock;n.state.linkEmitted=!1;let d=n.inlineTokens(a),h=n.state.linkEmitted;if(n.state.linkEmitted=c,n.state.inLink=!1,!l){if(h){n.state.inRawBlock=p;return}n.state.linkEmitted=!0}return{type:l?"image":"link",raw:s,href:i,title:o,text:a,tokens:d}}function vo(t,e,s){let n=t.match(s.other.indentCodeCompensation);if(n===null)return e;let r=n[1];return e.split(`
489
- `).map(i=>{let o=i.match(s.other.beginningSpace);if(o===null)return i;let[a]=o;return i.slice(Math.min(a.length,r.length))}).join(`
490
- `)}function fn(t,e,s,n){if(!e.includes("<"))return!1;for(let r=0;r<e.length;r++){if(e[r]==="\\"){r++;continue}if(e[r]==="`"){let a=n.inline.code.exec(e.slice(r));if(a){r+=a[0].length-1;continue}}if(e[r]!=="<")continue;let i=t.slice(s+r),o=n.inline.tag.exec(i)||n.inline.autolink.exec(i);if(o){if(o[0].length>e.length-r)return!0;r+=o[0].length-1}}return!1}var Je=class{options;rules;lexer;constructor(t){this.options=t||ee}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 s=this.options.pedantic?e[0]:dn(e[0]),n=s.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:s,codeBlockStyle:"indented",text:n}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let s=e[0],n=vo(s,e[3]||"",this.rules);return{type:"code",raw:s,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:n}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let s=e[2].trim();if(this.rules.other.endingHash.test(s)){let n=K(s,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceTabChar.test(n))&&(s=n.trim())}return{type:"heading",raw:K(e[0],`
491
- `),depth:e[1].length,text:s,tokens:this.lexer.inline(s)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:K(e[0],`
492
- `)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let s=K(e[0],`
485
+ `,de=(t,e)=>t instanceof e?t:null;function At(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var te=At();function Js(t){te=t}var se={exec:()=>null};function pe(t){let e=[];return s=>{let n=Math.max(0,Math.min(3,s-1)),r=e[n];return r||(r=t(n),e[n]=r),r}}function b(t,e=""){let s=typeof t=="string"?t:t.source,n={replace:(r,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(E.caret,"$1"),s=s.replace(r,a),n},getRegex:()=>new RegExp(s,e)};return n}var Ci=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),E={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:pe(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:pe(t=>new RegExp(`^ {0,${t}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:pe(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:pe(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:pe(t=>new RegExp(`^ {0,${t}}(?:</?(?:${Te})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,"i")),blockquoteBeginRegex:pe(t=>new RegExp(`^ {0,${t}}>`))},Ei=/^(?:[ \t]*(?:\n|$))+/,_i=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ri=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ae=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Li=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Tt=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Ys=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Qs=b(Ys).replace(/bull/g,Tt).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(),Pi=b(Ys).replace(/bull/g,Tt).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(),Ct=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,zi=/^[^\n]+/,Et=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Oi=b(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Et).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Mi=b(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Tt).getRegex(),Te="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",_t=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ji=b("^ {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",_t).replace("tag",Te).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Xs=t=>b(Ct).replace("hr",Ae).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",Te).getRegex(),Ii=Xs(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),qi=Xs(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Ni=b(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",qi).getRegex(),Rt={blockquote:Ni,code:_i,def:Oi,fences:Ri,heading:Li,hr:Ae,html:ji,lheading:Qs,list:Mi,newline:Ei,paragraph:Ii,table:se,text:zi},en=b("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ae).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",Te).getRegex(),Di={...Rt,lheading:Pi,table:en,paragraph:b(Ct).replace("hr",Ae).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",en).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",Te).getRegex()},Ui={...Rt,html:b(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",_t).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:se,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:b(Ct).replace("hr",Ae).replace("heading",` *#{1,6} *[^
486
+ ]`).replace("lheading",Qs).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Bi=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Hi=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,tn=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,Fi=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,U=/[\p{P}\p{S}]/u,he=/[\s\p{P}\p{S}]/u,Ce=/[^\s\p{P}\p{S}]/u,Ki=b(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,he).getRegex(),Zi=/[\p{Pi}\p{Ps}"']/u,sn=/(?!~)[\p{P}\p{S}]/u,Wi=/(?!~)[\s\p{P}\p{S}]/u,Vi=/(?:[^\s\p{P}\p{S}]|~)/u,Gi=b(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Ci?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),nn=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Ji=b(nn,"u").replace(/punct/g,U).getRegex(),Yi=b(nn,"u").replace(/punct/g,sn).getRegex(),Qi=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,Xi=b(Qi,"u").replace(/openQuote/g,Zi).replace(/punct/g,U).getRegex(),rn="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",ea=b(rn,"gu").replace(/notPunctSpace/g,Ce).replace(/punctSpace/g,he).replace(/punct/g,U).getRegex(),ta=b(rn,"gu").replace(/notPunctSpace/g,Vi).replace(/punctSpace/g,Wi).replace(/punct/g,sn).getRegex(),sa="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",na=b(sa,"gu").replace(/notPunctSpace/g,Ce).replace(/punctSpace/g,he).replace(/punct/g,U).getRegex(),ra=b("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ce).replace(/punctSpace/g,he).replace(/punct/g,U).getRegex(),ia="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",aa=b(ia,"gu").replace(/notPunctSpace/g,Ce).replace(/punctSpace/g,he).replace(/punct/g,U).getRegex(),oa=b(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,U).getRegex(),la="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",ca=b(la,"gu").replace(/notPunctSpace/g,Ce).replace(/punctSpace/g,he).replace(/punct/g,U).getRegex(),da=b(/\\(punct)/,"gu").replace(/punct/g,U).getRegex(),pa=b(/^<(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(),ha=b(_t).replace("(?:-->|$)","-->").getRegex(),ua=b("^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",ha).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),an=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,Ge=b(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",an).getRegex(),fa=b(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label",Ge).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ga=b(/^!?\[(label)\]\[(ref)\]/).replace("label",Ge).replace("ref",Et).getRegex(),ma=b(/^!?\[(ref)\](?:\[\])?/).replace("ref",Et).getRegex(),on=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,ka=b(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",an).getRegex(),ba=b("reflink|nolink(?!\\()","g").replace("reflink",b(/^!?\[(label)\]\[(ref)\]/).replace("label",ka).replace("ref",on).getRegex()).replace("nolink",b(/^!?\[(ref)\](?:\[\])?/).replace("ref",on).getRegex()).getRegex(),ln=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,xa=/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/,va=b(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,xa).getRegex(),Lt={_backpedal:se,anyPunctuation:da,autolink:pa,blockSkip:Gi,br:tn,code:Hi,del:se,delLDelim:se,delRDelim:se,emStrongLDelim:Ji,emStrongRDelimAst:ea,emStrongRDelimUnd:ra,escape:Bi,link:fa,nolink:ma,punctuation:Ki,reflink:ga,reflinkSearch:ba,tag:ua,text:Fi,url:se},ya={...Lt,emStrongLDelim:Xi,emStrongRDelimAst:na,emStrongRDelimUnd:aa,link:b(/^!?\[(label)\]\((.*?)\)/).replace("label",Ge).getRegex(),reflink:b(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ge).getRegex()},Pt={...Lt,emStrongRDelimAst:ta,emStrongLDelim:Yi,delLDelim:oa,delRDelim:ca,url:b(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",va).replace("protocol",ln).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:b(/^(?:[^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",ln).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},wa={...Pt,br:b(tn).replace("{2,}","*").getRegex(),text:b(Pt.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Je={normal:Rt,gfm:Di,pedantic:Ui},Ee={normal:Lt,gfm:Pt,breaks:wa,pedantic:ya},$a={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},cn=t=>$a[t];function L(t,e){if(e){if(E.escapeTest.test(t))return t.replace(E.escapeReplace,cn)}else if(E.escapeTestNoEncode.test(t))return t.replace(E.escapeReplaceNoEncode,cn);return t}function Sa(t){return t.replace(E.numericCharacterReference,(e,s,n)=>{let r=s===void 0?Number.parseInt(n,16):Number.parseInt(s,10);return r===0||r>1114111||r>=55296&&r<=57343?"\uFFFD":String.fromCodePoint(r)})}function dn(t){try{t=encodeURI(t).replace(E.percentDecode,"%")}catch{return null}return t}function pn(t,e){let s=t.replace(E.findPipe,(i,a,o)=>{let l=!1,c=a;for(;--c>=0&&o[c]==="\\";)l=!l;return l?"|":" |"}),n=s.split(E.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(E.slashPipe,"|");return n}function Z(t,e,s){let n=t.length;if(n===0)return"";let r=0;for(;r<n&&t.charAt(n-r-1)===e;)r++;return t.slice(0,n-r)}function hn(t){let e=t.split(`
487
+ `),s=e.length-1;for(;s>=0&&E.blankLine.test(e[s]);)s--;return e.length-s<=2?t:e.slice(0,s+1).join(`
488
+ `)}function Ye(t){return t.trim().toLowerCase().toUpperCase().toLowerCase()}function un(t,e){if(t.indexOf(e[0])===-1&&t.indexOf(e[1])===-1)return-1;let s=0;for(let n=0;n<t.length;n++)if(t[n]==="\\")n++;else if(t[n]===e[0])s++;else if(t[n]===e[1]&&(s--,s<0))return n;return s>0?-2:-1}function fn(t,e=0){let s=e,n="";for(let r of t)if(r===" "){let i=4-s%4;n+=" ".repeat(i),s+=i}else n+=r,s++;return n}function gn(t,e,s,n,r){let i=e.href,a=e.title||null,o=t[1].replace(r.other.outputLinkReplace,"$1"),l=t[0].charAt(0)==="!";n.state.inLink=!0;let c=n.state.linkEmitted,p=n.state.inRawBlock;n.state.linkEmitted=!1;let d=n.inlineTokens(o),h=n.state.linkEmitted;if(n.state.linkEmitted=c,n.state.inLink=!1,!l){if(h){n.state.inRawBlock=p;return}n.state.linkEmitted=!0}return{type:l?"image":"link",raw:s,href:i,title:a,text:o,tokens:d}}function Aa(t,e,s){let n=t.match(s.other.indentCodeCompensation);if(n===null)return e;let r=n[1];return e.split(`
489
+ `).map(i=>{let a=i.match(s.other.beginningSpace);if(a===null)return i;let[o]=a;return i.slice(Math.min(o.length,r.length))}).join(`
490
+ `)}function mn(t,e,s,n){if(!e.includes("<"))return!1;for(let r=0;r<e.length;r++){if(e[r]==="\\"){r++;continue}if(e[r]==="`"){let o=n.inline.code.exec(e.slice(r));if(o){r+=o[0].length-1;continue}}if(e[r]!=="<")continue;let i=t.slice(s+r),a=n.inline.tag.exec(i)||n.inline.autolink.exec(i);if(a){if(a[0].length>e.length-r)return!0;r+=a[0].length-1}}return!1}var Qe=class{options;rules;lexer;constructor(t){this.options=t||te}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 s=this.options.pedantic?e[0]:hn(e[0]),n=s.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:s,codeBlockStyle:"indented",text:n}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let s=e[0],n=Aa(s,e[3]||"",this.rules);return{type:"code",raw:s,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:n}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let s=e[2].trim();if(this.rules.other.endingHash.test(s)){let n=Z(s,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceTabChar.test(n))&&(s=n.trim())}return{type:"heading",raw:Z(e[0],`
491
+ `),depth:e[1].length,text:s,tokens:this.lexer.inline(s)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:Z(e[0],`
492
+ `)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let s=Z(e[0],`
493
493
  `).split(`
494
- `),n="",r="",i=[];for(;s.length>0;){let o=!1,a=[],l;for(l=0;l<s.length;l++)if(this.rules.other.blockquoteStart.test(s[l]))a.push(s[l]),o=!0;else if(!o)a.push(s[l]);else break;s=s.slice(l);let c=a.join(`
494
+ `),n="",r="",i=[];for(;s.length>0;){let a=!1,o=[],l;for(l=0;l<s.length;l++)if(this.rules.other.blockquoteStart.test(s[l]))o.push(s[l]),a=!0;else if(!a)o.push(s[l]);else break;s=s.slice(l);let c=o.join(`
495
495
  `),p=c.replace(this.rules.other.blockquoteSetextReplace,`
496
496
  $1`).replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}
497
497
  ${c}`:c,r=r?`${r}
498
498
  ${p}`:p;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,i,!0),this.lexer.state.top=d,s.length===0)break;let h=i.at(-1);if(h?.type==="code")break;if(h?.type==="blockquote"){let u=h,f=s.join(`
499
499
  `),y=u.raw+`
500
- `+f.replace(this.rules.other.blockquoteSetextReplace2,""),v=this.blockquote(y);i[i.length-1]=v;let _=y.substring(v.raw.length).replace(/^\n/,""),ge=_?_.split(`
501
- `).length:0,me=ge?s.slice(0,-ge):s;me.length>0&&(n=`${n}
502
- ${me.join(`
503
- `)}`),r=r.substring(0,r.length-u.text.length)+v.text;break}else if(h?.type==="list"){let u=h,f=u.raw+`
500
+ `+f.replace(this.rules.other.blockquoteSetextReplace2,""),x=this.blockquote(y);i[i.length-1]=x;let R=y.substring(x.raw.length).replace(/^\n/,""),me=R?R.split(`
501
+ `).length:0,ke=me?s.slice(0,-me):s;ke.length>0&&(n=`${n}
502
+ ${ke.join(`
503
+ `)}`),r=r.substring(0,r.length-u.text.length)+x.text;break}else if(h?.type==="list"){let u=h,f=u.raw+`
504
504
  `+s.join(`
505
505
  `),y=this.list(f);i[i.length-1]=y,n=n.substring(0,n.length-h.raw.length)+y.raw,r=r.substring(0,r.length-u.raw.length)+y.raw,s=f.substring(i.at(-1).raw.length).split(`
506
- `);continue}}return{type:"blockquote",raw:n,tokens:i,text:r}}}list(t){let e=this.rules.block.list.exec(t);if(e){let s=e[1].trim(),n=s.length>1,r={type:"list",raw:"",ordered:n,start:n?+s.slice(0,-1):"",loose:!1,items:[]};s=n?`\\d{1,9}\\${s.slice(-1)}`:`\\${s}`,this.options.pedantic&&(s=n?s:"[*+-]");let i=this.rules.other.listItemRegex(s),o=!1;for(;t;){let l=!1,c="",p="";if(!(e=i.exec(t))||this.rules.block.hr.test(t))break;c=e[0],t=t.substring(c.length);let d=e[2].split(`
507
- `,1)[0],h=e[1].length,u=this.options.pedantic?hn(d,h):d.replace(this.rules.other.leadingSpaceTab,_=>hn(_,h)),f=t.split(`
508
- `,1)[0],y=!u.trim(),v=0;if(this.options.pedantic?(v=2,p=u.trimStart()):y?v=h+1:(v=u.search(this.rules.other.nonSpaceChar),v=v>4?1:v,p=u.slice(v),v+=h),y&&this.rules.other.blankLine.test(f)&&(c+=f+`
509
- `,t=t.substring(f.length+1),l=!0),!l){let _=this.rules.other.nextBulletRegex(v),ge=this.rules.other.hrRegex(v),me=this.rules.other.fencesBeginRegex(v),vs=this.rules.other.headingBeginRegex(v),Dr=this.rules.other.htmlBeginRegex(v),Ur=this.rules.other.blockquoteBeginRegex(v);for(;t;){let at=t.split(`
510
- `,1)[0],ke;if(f=at,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),ke=f):ke=f.replace(this.rules.other.leadingSpaceTab,Hr=>Hr.replace(this.rules.other.tabCharGlobal," ")),me.test(f)||vs.test(f)||Dr.test(f)||Ur.test(f)||_.test(f)||ge.test(f))break;if(ke.search(this.rules.other.nonSpaceChar)>=v||!f.trim())p+=`
511
- `+ke.slice(v);else{if(y||u.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||me.test(u)||vs.test(u)||ge.test(u))break;p+=`
512
- `+f}y=!f.trim(),c+=at+`
513
- `,t=t.substring(at.length+1),u=ke.slice(v)}}r.loose||(o?r.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(o=!0)),r.items.push({type:"list_item",raw:c,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]}),r.raw+=c}let a=r.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let l of r.items)if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),!r.loose){let c=l.tokens.filter(d=>d.type==="space"),p=c.length>0&&c.some(d=>this.rules.other.anyLine.test(d.raw));r.loose=p}for(let l of r.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 d=this.lexer.inlineQueue.length-1;d>=0;d--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[d].src)){this.lexer.inlineQueue[d].src=this.lexer.inlineQueue[d].src.replace(this.rules.other.listReplaceTask,"");break}let p=this.rules.other.listTaskCheckbox.exec(l.raw);if(p){let d={type:"checkbox",raw:p[0]+" ",checked:p[0]!=="[ ]"};l.checked=d.checked,r.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=d.raw+l.tokens[0].raw,l.tokens[0].text=d.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(d)):l.tokens.unshift({type:"paragraph",raw:d.raw,text:d.raw,tokens:[d]}):l.tokens.unshift(d)}}else l.task&&(l.task=!1)}if(r.loose)for(let l of r.items){l.loose=!0;for(let c of l.tokens)c.type==="text"&&(c.type="paragraph")}return r}}html(t){let e=this.rules.block.html.exec(t);if(e){let s=dn(e[0]);return{type:"html",block:!0,raw:s,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:s}}}def(t){let e=this.rules.block.def.exec(t);if(e){if(!this.rules.other.startAngleBracket.test(e[2])&&pn(e[2],"()")!==-1)return;let s=Ge(e[1]).replace(this.rules.other.multipleSpaceGlobal," "),n=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:s,raw:K(e[0],`
514
- `),href:n,title:r}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let s=cn(e[1]),n=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
515
- `):[],i={type:"table",raw:K(e[0],`
516
- `),header:[],align:[],rows:[]};if(s.length===n.length){for(let o of n)this.rules.other.tableAlignRight.test(o)?i.align.push("right"):this.rules.other.tableAlignCenter.test(o)?i.align.push("center"):this.rules.other.tableAlignLeft.test(o)?i.align.push("left"):i.align.push(null);for(let o=0;o<s.length;o++)i.header.push({text:s[o],tokens:this.lexer.inline(s[o]),header:!0,align:i.align[o]});for(let o of r)i.rows.push(cn(o,i.header.length).map((a,l)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:i.align[l]})));return i}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let s=e[1].trim();return{type:"heading",raw:K(e[0],`
506
+ `);continue}}return{type:"blockquote",raw:n,tokens:i,text:r}}}list(t){let e=this.rules.block.list.exec(t);if(e){let s=e[1].trim(),n=s.length>1,r={type:"list",raw:"",ordered:n,start:n?+s.slice(0,-1):"",loose:!1,items:[]};s=n?`\\d{1,9}\\${s.slice(-1)}`:`\\${s}`,this.options.pedantic&&(s=n?s:"[*+-]");let i=this.rules.other.listItemRegex(s),a=!1;for(;t;){let l=!1,c="",p="";if(!(e=i.exec(t))||this.rules.block.hr.test(t))break;c=e[0],t=t.substring(c.length);let d=e[2].split(`
507
+ `,1)[0],h=e[1].length,u=this.options.pedantic?fn(d,h):d.replace(this.rules.other.leadingSpaceTab,R=>fn(R,h)),f=t.split(`
508
+ `,1)[0],y=!u.trim(),x=0;if(this.options.pedantic?(x=2,p=u.trimStart()):y?x=h+1:(x=u.search(this.rules.other.nonSpaceChar),x=x>4?1:x,p=u.slice(x),x+=h),y&&this.rules.other.blankLine.test(f)&&(c+=f+`
509
+ `,t=t.substring(f.length+1),l=!0),!l){let R=this.rules.other.nextBulletRegex(x),me=this.rules.other.hrRegex(x),ke=this.rules.other.fencesBeginRegex(x),ys=this.rules.other.headingBeginRegex(x),Vr=this.rules.other.htmlBeginRegex(x),Gr=this.rules.other.blockquoteBeginRegex(x);for(;t;){let ct=t.split(`
510
+ `,1)[0],be;if(f=ct,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),be=f):be=f.replace(this.rules.other.leadingSpaceTab,Jr=>Jr.replace(this.rules.other.tabCharGlobal," ")),ke.test(f)||ys.test(f)||Vr.test(f)||Gr.test(f)||R.test(f)||me.test(f))break;if(be.search(this.rules.other.nonSpaceChar)>=x||!f.trim())p+=`
511
+ `+be.slice(x);else{if(y||u.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||ke.test(u)||ys.test(u)||me.test(u))break;p+=`
512
+ `+f}y=!f.trim(),c+=ct+`
513
+ `,t=t.substring(ct.length+1),u=be.slice(x)}}r.loose||(a?r.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(a=!0)),r.items.push({type:"list_item",raw:c,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]}),r.raw+=c}let o=r.items.at(-1);if(o)o.raw=o.raw.trimEnd(),o.text=o.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let l of r.items)if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),!r.loose){let c=l.tokens.filter(d=>d.type==="space"),p=c.length>0&&c.some(d=>this.rules.other.anyLine.test(d.raw));r.loose=p}for(let l of r.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 d=this.lexer.inlineQueue.length-1;d>=0;d--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[d].src)){this.lexer.inlineQueue[d].src=this.lexer.inlineQueue[d].src.replace(this.rules.other.listReplaceTask,"");break}let p=this.rules.other.listTaskCheckbox.exec(l.raw);if(p){let d={type:"checkbox",raw:p[0]+" ",checked:p[0]!=="[ ]"};l.checked=d.checked,r.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=d.raw+l.tokens[0].raw,l.tokens[0].text=d.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(d)):l.tokens.unshift({type:"paragraph",raw:d.raw,text:d.raw,tokens:[d]}):l.tokens.unshift(d)}}else l.task&&(l.task=!1)}if(r.loose)for(let l of r.items){l.loose=!0;for(let c of l.tokens)c.type==="text"&&(c.type="paragraph")}return r}}html(t){let e=this.rules.block.html.exec(t);if(e){let s=hn(e[0]);return{type:"html",block:!0,raw:s,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:s}}}def(t){let e=this.rules.block.def.exec(t);if(e){if(!this.rules.other.startAngleBracket.test(e[2])&&un(e[2],"()")!==-1)return;let s=Ye(e[1]).replace(this.rules.other.multipleSpaceGlobal," "),n=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:s,raw:Z(e[0],`
514
+ `),href:n,title:r}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let s=pn(e[1]),n=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
515
+ `):[],i={type:"table",raw:Z(e[0],`
516
+ `),header:[],align:[],rows:[]};if(s.length===n.length){for(let a of n)this.rules.other.tableAlignRight.test(a)?i.align.push("right"):this.rules.other.tableAlignCenter.test(a)?i.align.push("center"):this.rules.other.tableAlignLeft.test(a)?i.align.push("left"):i.align.push(null);for(let a=0;a<s.length;a++)i.header.push({text:s[a],tokens:this.lexer.inline(s[a]),header:!0,align:i.align[a]});for(let a of r)i.rows.push(pn(a,i.header.length).map((o,l)=>({text:o,tokens:this.lexer.inline(o),header:!1,align:i.align[l]})));return i}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let s=e[1].trim();return{type:"heading",raw:Z(e[0],`
517
517
  `),depth:e[2].charAt(0)==="="?1:2,text:s,tokens:this.lexer.inline(s)}}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let s=e[1].charAt(e[1].length-1)===`
518
- `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:s,tokens:this.lexer.inline(s)}}}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 s=e[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&fn(t,e[1],s,this.rules))return;let n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let o=K(n.slice(0,-1),"\\");if((n.length-o.length)%2===0)return}else{let o=pn(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 r=e[2],i="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(r);o&&(r=o[1],i=o[3])}else i=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),un(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let s;if((s=this.rules.inline.reflink.exec(t))||(s=this.rules.inline.nolink.exec(t))){let n=s[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&fn(t,s[1],n,this.rules))return;let r=(s[2]||s[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=e[Ge(r)];if(!i){let o=s[0].charAt(0);return{type:"text",raw:o,text:o}}return un(s,i,s[0],this.lexer,this.rules)}}emStrong(t,e,s=""){let n=this.rules.inline.emStrongLDelim.exec(t);if(!(!n||!n[1]&&!n[2]&&!n[3]&&!n[4]||n[4]&&s.match(this.rules.other.unicodeAlphaNumeric))&&(!(n[1]||n[3])||!s||this.rules.inline.punctuation.exec(s))){let r=[...n[0]].length-1,i,o,a=r,l=0,c=n[0][0],p=s===c,d=c==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,e=e.slice(-1*t.length+r);(n=d.exec(e))!==null;){if(i=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!i)continue;if(o=[...i].length,n[3]||n[4]){a+=o;continue}else if(n[5]||n[6]){if(r%3&&!((r+o)%3)){l+=o;continue}if(p)break}if(a-=o,a>0)continue;o=Math.min(o,o+a+l);let h=[...n[0]][0].length,u=t.slice(0,r+n.index+h+o);if(Math.min(r,o)%2){let y=u.slice(1,-1);return{type:"em",raw:u,text:y,tokens:this.lexer.inlineTokens(y)}}let f=u.slice(2,-2);return{type:"strong",raw:u,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let s=e[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(s),r=this.rules.other.startingSpaceChar.test(s)&&this.rules.other.endingSpaceChar.test(s);return n&&r&&(s=s.substring(1,s.length-1)),{type:"codespan",raw:e[0],text:s}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,s=""){let n=this.rules.inline.delLDelim.exec(t);if(n&&(!n[1]||!s||this.rules.inline.punctuation.exec(s))){let r=[...n[0]].length-1,i,o,a=r,l=this.rules.inline.delRDelim;for(l.lastIndex=0,e=e.slice(-1*t.length+r);(n=l.exec(e))!==null;){if(i=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!i||(o=[...i].length,o!==r))continue;if(n[3]||n[4]){a+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a);let c=[...n[0]][0].length,p=t.slice(0,r+n.index+c+o),d=p.slice(r,-r);return{type:"del",raw:p,text:d,tokens:this.lexer.inlineTokens(d)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let s,n;return e[2]==="@"?(s=e[1],n="mailto:"+s):(s=e[1],n=s),{type:"link",raw:e[0],text:s,href:n,autolink:!0,tokens:[{type:"text",raw:s,text:s}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let s,n;if(e[2]==="@")s=e[0],n="mailto:"+s;else{let r;do r=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(r!==e[0]);s=e[0],e[1]==="www."?n="http://"+e[0]:n=e[0]}return{type:"link",raw:e[0],text:s,href:n,autolink:!0,tokens:[{type:"text",raw:s,text:s}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let s=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:s?e[0]:bo(e[0]),escaped:s}}}},O=class ks{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ee,this.options.tokenizer=this.options.tokenizer||new Je,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 s={other:T,block:Ve.normal,inline:Ce.normal};this.options.pedantic?(s.block=Ve.pedantic,s.inline=Ce.pedantic):this.options.gfm&&(s.block=Ve.gfm,this.options.breaks?s.inline=Ce.breaks:s.inline=Ce.gfm),this.tokenizer.rules=s}static get rules(){return{block:Ve,inline:Ce}}static lex(e,s){return new ks(s).lex(e)}static lexInline(e,s){return new ks(s).inlineTokens(e)}lex(e){e=e.replace(T.carriageReturn,`
519
- `),this.blockTokens(e,this.tokens);for(let s=0;s<this.inlineQueue.length;s++){let n=this.inlineQueue[s];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,s=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(T.tabCharGlobal," ").replace(T.spaceLine,""));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(a=>(i=a.call({lexer:this},e,s))?(e=e.substring(i.raw.length),s.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let a=s.at(-1);i.raw.length===1&&a!==void 0?a.raw+=`
520
- `:s.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let a=s.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
518
+ `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:s,tokens:this.lexer.inline(s)}}}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 s=e[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&mn(t,e[1],s,this.rules))return;let n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let a=Z(n.slice(0,-1),"\\");if((n.length-a.length)%2===0)return}else{let a=un(e[2],"()");if(a===-2)return;if(a>-1){let o=(e[0].indexOf("!")===0?5:4)+e[1].length+a;e[2]=e[2].substring(0,a),e[0]=e[0].substring(0,o).trim(),e[3]=""}}let r=e[2],i="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(r);a&&(r=a[1],i=a[3])}else i=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),gn(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let s;if((s=this.rules.inline.reflink.exec(t))||(s=this.rules.inline.nolink.exec(t))){let n=s[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&mn(t,s[1],n,this.rules))return;let r=(s[2]||s[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=e[Ye(r)];if(!i){let a=s[0].charAt(0);return{type:"text",raw:a,text:a}}return gn(s,i,s[0],this.lexer,this.rules)}}emStrong(t,e,s=""){let n=this.rules.inline.emStrongLDelim.exec(t);if(!(!n||!n[1]&&!n[2]&&!n[3]&&!n[4]||n[4]&&s.match(this.rules.other.unicodeAlphaNumeric))&&(!(n[1]||n[3])||!s||this.rules.inline.punctuation.exec(s))){let r=[...n[0]].length-1,i,a,o=r,l=0,c=n[0][0],p=s===c,d=c==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,e=e.slice(-1*t.length+r);(n=d.exec(e))!==null;){if(i=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!i)continue;if(a=[...i].length,n[3]||n[4]){o+=a;continue}else if(n[5]||n[6]){if(r%3&&!((r+a)%3)){l+=a;continue}if(p)break}if(o-=a,o>0)continue;a=Math.min(a,a+o+l);let h=[...n[0]][0].length,u=t.slice(0,r+n.index+h+a);if(Math.min(r,a)%2){let y=u.slice(1,-1);return{type:"em",raw:u,text:y,tokens:this.lexer.inlineTokens(y)}}let f=u.slice(2,-2);return{type:"strong",raw:u,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let s=e[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(s),r=this.rules.other.startingSpaceChar.test(s)&&this.rules.other.endingSpaceChar.test(s);return n&&r&&(s=s.substring(1,s.length-1)),{type:"codespan",raw:e[0],text:s}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,s=""){let n=this.rules.inline.delLDelim.exec(t);if(n&&(!n[1]||!s||this.rules.inline.punctuation.exec(s))){let r=[...n[0]].length-1,i,a,o=r,l=this.rules.inline.delRDelim;for(l.lastIndex=0,e=e.slice(-1*t.length+r);(n=l.exec(e))!==null;){if(i=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!i||(a=[...i].length,a!==r))continue;if(n[3]||n[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let c=[...n[0]][0].length,p=t.slice(0,r+n.index+c+a),d=p.slice(r,-r);return{type:"del",raw:p,text:d,tokens:this.lexer.inlineTokens(d)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let s,n;return e[2]==="@"?(s=e[1],n="mailto:"+s):(s=e[1],n=s),{type:"link",raw:e[0],text:s,href:n,autolink:!0,tokens:[{type:"text",raw:s,text:s}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let s,n;if(e[2]==="@")s=e[0],n="mailto:"+s;else{let r;do r=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(r!==e[0]);s=e[0],e[1]==="www."?n="http://"+e[0]:n=e[0]}return{type:"link",raw:e[0],text:s,href:n,autolink:!0,tokens:[{type:"text",raw:s,text:s}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let s=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:s?e[0]:Sa(e[0]),escaped:s}}}},j=class xs{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||te,this.options.tokenizer=this.options.tokenizer||new Qe,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 s={other:E,block:Je.normal,inline:Ee.normal};this.options.pedantic?(s.block=Je.pedantic,s.inline=Ee.pedantic):this.options.gfm&&(s.block=Je.gfm,this.options.breaks?s.inline=Ee.breaks:s.inline=Ee.gfm),this.tokenizer.rules=s}static get rules(){return{block:Je,inline:Ee}}static lex(e,s){return new xs(s).lex(e)}static lexInline(e,s){return new xs(s).inlineTokens(e)}lex(e){e=e.replace(E.carriageReturn,`
519
+ `),this.blockTokens(e,this.tokens);for(let s=0;s<this.inlineQueue.length;s++){let n=this.inlineQueue[s];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,s=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(E.tabCharGlobal," ").replace(E.spaceLine,""));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(o=>(i=o.call({lexer:this},e,s))?(e=e.substring(i.raw.length),s.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let o=s.at(-1);i.raw.length===1&&o!==void 0?o.raw+=`
520
+ `:s.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let o=s.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
521
521
  `)?"":`
522
- `)+i.raw,a.text+=`
523
- `+i.text,this.inlineQueue.at(-1).src=a.text):s.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),s.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),s.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),s.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),s.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),s.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),s.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let a=s.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
522
+ `)+i.raw,o.text+=`
523
+ `+i.text,this.inlineQueue.at(-1).src=o.text):s.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),s.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),s.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),s.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),s.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),s.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),s.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let o=s.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
524
524
  `)?"":`
525
- `)+i.raw,a.text+=`
526
- `+i.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},s.push(i));continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),s.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),s.push(i);continue}let o=e;if(this.options.extensions?.startBlock){let a=1/0,l=e.slice(1),c;this.options.extensions.startBlock.forEach(p=>{c=p.call({lexer:this},l),typeof c=="number"&&c>=0&&(a=Math.min(a,c))}),a<1/0&&a>=0&&(o=e.substring(0,a+1))}if(this.state.top&&(i=this.tokenizer.paragraph(o))){let a=s.at(-1);n&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(`
525
+ `)+i.raw,o.text+=`
526
+ `+i.raw,this.inlineQueue.at(-1).src=o.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},s.push(i));continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),s.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),s.push(i);continue}let a=e;if(this.options.extensions?.startBlock){let o=1/0,l=e.slice(1),c;this.options.extensions.startBlock.forEach(p=>{c=p.call({lexer:this},l),typeof c=="number"&&c>=0&&(o=Math.min(o,c))}),o<1/0&&o>=0&&(a=e.substring(0,o+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let o=s.at(-1);n&&o?.type==="paragraph"?(o.raw+=(o.raw.endsWith(`
527
527
  `)?"":`
528
- `)+i.raw,a.text+=`
529
- `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):s.push(i),n=o.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let a=s.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
528
+ `)+i.raw,o.text+=`
529
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):s.push(i),n=a.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let o=s.at(-1);o?.type==="text"?(o.raw+=(o.raw.endsWith(`
530
530
  `)?"":`
531
- `)+i.raw,a.text+=`
532
- `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):s.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,s}inline(e,s=[]){return this.inlineQueue.push({src:e,tokens:s}),s}linkInText(e){if(!e.includes("["))return!1;let s=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(s.test(n[0])&&e.charAt(n.index-1)!=="!")return!0;for(let n of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let r=n[0],i=r.lastIndexOf("[");if(!(r.charAt(0)==="!"||!Object.hasOwn(this.tokens.links,Ge(r.slice(i+1,-1))))&&!(i>1&&this.linkInText(r.slice(1,i-1))))return!0}return!1}inlineTokens(e,s=[]){this.tokenizer.lexer=this;let n=this.state.linkParenPossible;this.state.linkParenPossible=n&&e.includes(")");try{return this.#e(e,s)}finally{this.state.linkParenPossible=n}}#e(e,s){let n=e;if(this.tokens.links&&e.includes("[")){let a=this.tokenizer.rules.inline.reflinkSearch,l=c=>{let p=c.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,Ge(c.slice(p+1,-1))))return c;if(p>1&&c.charAt(0)!=="!"){let d=c.slice(1,p-1);if(this.linkInText(d))return"["+d.replace(a,l)+"]["+"a".repeat(c.length-p-2)+"]"}return"["+"a".repeat(c.length-2)+"]"};n=n.replace(a,l)}n=n.replace(this.tokenizer.rules.inline.anyPunctuation,a=>"+".repeat(a.length)),n=n.replace(this.tokenizer.rules.inline.blockSkip,(a,l,c)=>{let p=c?c.length:0;return a.slice(0,p)+"["+"a".repeat(a.length-p-2)+"]"}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,i="",o=1/0;for(;e;){if(e.length<o)o=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=""),r=!1;let a;if(this.options.extensions?.inline?.some(c=>(a=c.call({lexer:this},e,s))?(e=e.substring(a.raw.length),s.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),s.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),s.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),s.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let c=s.at(-1);a.type==="text"&&c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):s.push(a);continue}if(a=this.tokenizer.emStrong(e,n,i)){e=e.substring(a.raw.length),s.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),s.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),s.push(a);continue}if(a=this.tokenizer.del(e,n,i)){e=e.substring(a.raw.length),s.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),s.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),s.push(a);continue}let l=e;if(this.options.extensions?.startInline){let c=1/0,p=e.slice(1),d;this.options.extensions.startInline.forEach(h=>{d=h.call({lexer:this},p),typeof d=="number"&&d>=0&&(c=Math.min(c,d))}),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)!=="_"&&(i=a.raw.slice(-1)),r=!0;let c=s.at(-1);c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):s.push(a);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return s}infiniteLoopError(e){let s="Infinite loop on byte: "+e;if(this.options.silent)console.error(s);else throw new Error(s)}},Ye=class{options;parser;constructor(t){this.options=t||ee}space(t){return""}code({text:t,lang:e,escaped:s}){let n=(e||"").match(T.notSpaceStart)?.[0],r=t?t.replace(T.endingNewline,"")+`
533
- `:"";return n?'<pre><code class="language-'+R(n)+'">'+(s?r:R(r,!0))+`</code></pre>
534
- `:"<pre><code>"+(s?r:R(r,!0))+`</code></pre>
531
+ `)+i.raw,o.text+=`
532
+ `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):s.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,s}inline(e,s=[]){return this.inlineQueue.push({src:e,tokens:s}),s}linkInText(e){if(!e.includes("["))return!1;let s=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(s.test(n[0])&&e.charAt(n.index-1)!=="!")return!0;for(let n of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let r=n[0],i=r.lastIndexOf("[");if(!(r.charAt(0)==="!"||!Object.hasOwn(this.tokens.links,Ye(r.slice(i+1,-1))))&&!(i>1&&this.linkInText(r.slice(1,i-1))))return!0}return!1}inlineTokens(e,s=[]){this.tokenizer.lexer=this;let n=this.state.linkParenPossible;this.state.linkParenPossible=n&&e.includes(")");try{return this.#e(e,s)}finally{this.state.linkParenPossible=n}}#e(e,s){let n=e;if(this.tokens.links&&e.includes("[")){let o=this.tokenizer.rules.inline.reflinkSearch,l=c=>{let p=c.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,Ye(c.slice(p+1,-1))))return c;if(p>1&&c.charAt(0)!=="!"){let d=c.slice(1,p-1);if(this.linkInText(d))return"["+d.replace(o,l)+"]["+"a".repeat(c.length-p-2)+"]"}return"["+"a".repeat(c.length-2)+"]"};n=n.replace(o,l)}n=n.replace(this.tokenizer.rules.inline.anyPunctuation,o=>"+".repeat(o.length)),n=n.replace(this.tokenizer.rules.inline.blockSkip,(o,l,c)=>{let p=c?c.length:0;return o.slice(0,p)+"["+"a".repeat(o.length-p-2)+"]"}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,i="",a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=""),r=!1;let o;if(this.options.extensions?.inline?.some(c=>(o=c.call({lexer:this},e,s))?(e=e.substring(o.raw.length),s.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let c=s.at(-1);o.type==="text"&&c?.type==="text"?(c.raw+=o.raw,c.text+=o.text):s.push(o);continue}if(o=this.tokenizer.emStrong(e,n,i)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.del(e,n,i)){e=e.substring(o.raw.length),s.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),s.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),s.push(o);continue}let l=e;if(this.options.extensions?.startInline){let c=1/0,p=e.slice(1),d;this.options.extensions.startInline.forEach(h=>{d=h.call({lexer:this},p),typeof d=="number"&&d>=0&&(c=Math.min(c,d))}),c<1/0&&c>=0&&(l=e.substring(0,c+1))}if(o=this.tokenizer.inlineText(l)){e=e.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(i=o.raw.slice(-1)),r=!0;let c=s.at(-1);c?.type==="text"?(c.raw+=o.raw,c.text+=o.text):s.push(o);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return s}infiniteLoopError(e){let s="Infinite loop on byte: "+e;if(this.options.silent)console.error(s);else throw new Error(s)}},Xe=class{options;parser;constructor(t){this.options=t||te}space(t){return""}code({text:t,lang:e,escaped:s}){let n=(e||"").match(E.notSpaceStart)?.[0],r=t?t.replace(E.endingNewline,"")+`
533
+ `:"";return n?'<pre><code class="language-'+L(n)+'">'+(s?r:L(r,!0))+`</code></pre>
534
+ `:"<pre><code>"+(s?r:L(r,!0))+`</code></pre>
535
535
  `}blockquote({tokens:t}){return`<blockquote>
536
536
  ${this.parser.parse(t)}</blockquote>
537
537
  `}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
538
538
  `}hr(t){return`<hr>
539
- `}list(t){let e=t.ordered,s=t.start,n="";for(let o=0;o<t.items.length;o++){let a=t.items[o];n+=this.listitem(a)}let r=e?"ol":"ul",i=e&&s!==1?' start="'+s+'"':"";return"<"+r+i+`>
539
+ `}list(t){let e=t.ordered,s=t.start,n="";for(let a=0;a<t.items.length;a++){let o=t.items[a];n+=this.listitem(o)}let r=e?"ol":"ul",i=e&&s!==1?' start="'+s+'"':"";return"<"+r+i+`>
540
540
  `+n+"</"+r+`>
541
541
  `}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
542
542
  `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
543
- `}table(t){let e="",s="";for(let r=0;r<t.header.length;r++)s+=this.tablecell(t.header[r]);e+=this.tablerow({text:s});let n="";for(let r=0;r<t.rows.length;r++){let i=t.rows[r];s="";for(let o=0;o<i.length;o++)s+=this.tablecell(i[o]);n+=this.tablerow({text:s})}return n&&(n=`<tbody>${n}</tbody>`),`<table>
543
+ `}table(t){let e="",s="";for(let r=0;r<t.header.length;r++)s+=this.tablecell(t.header[r]);e+=this.tablerow({text:s});let n="";for(let r=0;r<t.rows.length;r++){let i=t.rows[r];s="";for(let a=0;a<i.length;a++)s+=this.tablecell(i[a]);n+=this.tablerow({text:s})}return n&&(n=`<tbody>${n}</tbody>`),`<table>
544
544
  <thead>
545
545
  `+e+`</thead>
546
546
  `+n+`</table>
547
547
  `}tablerow({text:t}){return`<tr>
548
548
  ${t}</tr>
549
549
  `}tablecell(t){let e=this.parser.parseInline(t.tokens),s=t.header?"th":"td";return(t.align?`<${s} align="${t.align}">`:`<${s}>`)+e+`</${s}>
550
- `}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>${R(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,text:s,tokens:n,autolink:r}){let i=r?R(s,!0):this.parser.parseInline(n),o=ln(t);if(o===null)return i;t=R(o,r);let a='<a href="'+t+'"';return e&&(a+=' title="'+R(e)+'"'),a+=">"+i+"</a>",a}image({href:t,title:e,text:s,tokens:n}){n&&(s=this.parser.parseInline(n,this.parser.textRenderer));let r=ln(t);if(r===null)return R(s);t=r;let i=`<img src="${R(t)}" alt="${R(s)}"`;return e&&(i+=` title="${R(e)}"`),i+=">",i}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:R(t.text)}},Pt=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}},j=class bs{options;renderer;textRenderer;constructor(e){this.options=e||ee,this.options.renderer=this.options.renderer||new Ye,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Pt}static parse(e,s){return new bs(s).parse(e)}static parseInline(e,s){return new bs(s).parseInline(e)}parse(e){this.renderer.parser=this;let s="";for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let o=r,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)){s+=a||"";continue}}let i=r;switch(i.type){case"space":{s+=this.renderer.space(i);break}case"hr":{s+=this.renderer.hr(i);break}case"heading":{s+=this.renderer.heading(i);break}case"code":{s+=this.renderer.code(i);break}case"table":{s+=this.renderer.table(i);break}case"blockquote":{s+=this.renderer.blockquote(i);break}case"list":{s+=this.renderer.list(i);break}case"checkbox":{s+=this.renderer.checkbox(i);break}case"html":{s+=this.renderer.html(i);break}case"def":{s+=this.renderer.def(i);break}case"paragraph":{s+=this.renderer.paragraph(i);break}case"text":{s+=this.renderer.text(i);break}default:{let o='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return s}parseInline(e,s=this.renderer){this.renderer.parser=this;let n="";for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let a=this.options.extensions.renderers[i.type].call({parser:this},i);if(a!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(i.type)){n+=a||"";continue}}let o=i;switch(o.type){case"escape":{n+=s.text(o);break}case"html":{n+=s.html(o);break}case"link":{n+=s.link(o);break}case"image":{n+=s.image(o);break}case"checkbox":{n+=s.checkbox(o);break}case"strong":{n+=s.strong(o);break}case"em":{n+=s.em(o);break}case"codespan":{n+=s.codespan(o);break}case"br":{n+=s.br(o);break}case"del":{n+=s.del(o);break}case"text":{n+=s.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 n}},Te=class{options;block;constructor(t){this.options=t||ee}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?O.lex:O.lexInline}provideParser(t=this.block){return t?j.parse:j.parseInline}},gn=class{defaults=St();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=j;Renderer=Ye;TextRenderer=Pt;Lexer=O;Tokenizer=Je;Hooks=Te;constructor(...t){this.use(...t)}walkTokens(t,e){let s=[];for(let n of t)switch(s=s.concat(e.call(this,n)),n.type){case"table":{let r=n;for(let i of r.header)s=s.concat(this.walkTokens(i.tokens,e));for(let i of r.rows)for(let o of i)s=s.concat(this.walkTokens(o.tokens,e));break}case"list":{let r=n;s=s.concat(this.walkTokens(r.items,e));break}default:{let r=n;this.defaults.extensions?.childTokens?.[r.type]?this.defaults.extensions.childTokens[r.type].forEach(i=>{let o=r[i].flat(1/0);s=s.concat(this.walkTokens(o,e))}):r.tokens&&(s=s.concat(this.walkTokens(r.tokens,e)))}}return s}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(s=>{let n={...s};if(n.async=this.defaults.async||n.async||!1,s.extensions&&(s.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let i=e.renderers[r.name];i?e.renderers[r.name]=function(...o){let a=r.renderer.apply(this,o);return a===!1&&(a=i.apply(this,o)),a}:e.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[r.level];i?i.unshift(r.tokenizer):e[r.level]=[r.tokenizer],r.start&&(r.level==="block"?e.startBlock?e.startBlock.push(r.start):e.startBlock=[r.start]:r.level==="inline"&&(e.startInline?e.startInline.push(r.start):e.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(e.childTokens[r.name]=r.childTokens)}),n.extensions=e),s.renderer){let r=this.defaults.renderer||new Ye(this.defaults);for(let i in s.renderer){if(!(i in r))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let o=i,a=s.renderer[o],l=r[o];r[o]=(...c)=>{let p=a.apply(r,c);return p===!1&&(p=l.apply(r,c)),p||""}}n.renderer=r}if(s.tokenizer){let r=this.defaults.tokenizer||new Je(this.defaults);for(let i in s.tokenizer){if(!(i in r))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let o=i,a=s.tokenizer[o],l=r[o];r[o]=(...c)=>{let p=a.apply(r,c);return p===!1&&(p=l.apply(r,c)),p}}n.tokenizer=r}if(s.hooks){let r=this.defaults.hooks||new Te;for(let i in s.hooks){if(!(i in r))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let o=i,a=s.hooks[o],l=r[o];Te.passThroughHooks.has(i)?r[o]=c=>{if(this.defaults.async&&Te.passThroughHooksRespectAsync.has(i))return(async()=>{let d=await a.call(r,c);return l.call(r,d)})();let p=a.call(r,c);return l.call(r,p)}:r[o]=(...c)=>{if(this.defaults.async)return(async()=>{let d=await a.apply(r,c);return d===!1&&(d=await l.apply(r,c)),d})();let p=a.apply(r,c);return p===!1&&(p=l.apply(r,c)),p}}n.hooks=r}if(s.walkTokens){let r=this.defaults.walkTokens,i=s.walkTokens;n.walkTokens=function(o){let a=[];return a.push(i.call(this,o)),r&&(a=a.concat(r.call(this,o))),a}}this.defaults={...this.defaults,...n}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return O.lex(t,e??this.defaults)}parser(t,e){return j.parse(t,e??this.defaults)}parseMarkdown(t){return(e,s)=>{let n={...s},r={...this.defaults,...n},i=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&n.async===!1)return i(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 i(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(r.hooks&&(r.hooks.options=r,r.hooks.block=t),r.async)return(async()=>{let o=r.hooks?await r.hooks.preprocess(e):e,a=await(r.hooks?await r.hooks.provideLexer(t):t?O.lex:O.lexInline)(o,r),l=r.hooks?await r.hooks.processAllTokens(a):a;r.walkTokens&&await Promise.all(this.walkTokens(l,r.walkTokens));let c=await(r.hooks?await r.hooks.provideParser(t):t?j.parse:j.parseInline)(l,r);return r.hooks?await r.hooks.postprocess(c):c})().catch(i);try{r.hooks&&(e=r.hooks.preprocess(e));let o=(r.hooks?r.hooks.provideLexer(t):t?O.lex:O.lexInline)(e,r);r.hooks&&(o=r.hooks.processAllTokens(o)),r.walkTokens&&this.walkTokens(o,r.walkTokens);let a=(r.hooks?r.hooks.provideParser(t):t?j.parse:j.parseInline)(o,r);return r.hooks&&(a=r.hooks.postprocess(a)),a}catch(o){return i(o)}}}onError(t,e){return s=>{if(s.message+=`
551
- Please report this to https://github.com/markedjs/marked.`,t){let n="<p>An error occurred:</p><pre>"+R(s.message+"",!0)+"</pre>";return e?Promise.resolve(n):n}if(e)return Promise.reject(s);throw s}}},se=new gn;function $(t,e){return se.parse(t,e)}$.options=$.setOptions=function(t){return se.setOptions(t),$.defaults=se.defaults,Vs($.defaults),$},$.getDefaults=St,$.defaults=ee;function xo(...t){return se.use(...t),$.defaults=se.defaults,Vs($.defaults),$}$.use=xo,$.walkTokens=function(t,e){return se.walkTokens(t,e)},$.parseInline=se.parseInline,$.Parser=j,$.parser=j.parse,$.Renderer=Ye,$.TextRenderer=Pt,$.Lexer=O,$.lexer=O.lex,$.Tokenizer=Je,$.Hooks=Te,$.parse=$,$.options,$.setOptions,$.walkTokens,$.parseInline,j.parse,O.lex;const yo={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ne=t=>t.replace(/[&<>"']/g,e=>yo[e]??e),wo=new Set(["http","https","mailto"]),mn=t=>{const e=t.replace(/[\u0000- \u007f]/g,""),s=/^([a-z][a-z0-9+.-]*):/i.exec(e)?.[1];return s===void 0||wo.has(s.toLowerCase())},$o=t=>/^https?:/i.test(t.trim()),So=new gn({gfm:!0,breaks:!0,renderer:{html({text:t}){return ne(t)},link({href:t,title:e,tokens:s}){const n=this.parser.parseInline(s);if(!mn(t))return n;const r=e?` title="${ne(e)}"`:"",i=$o(t)?' target="_blank" rel="noopener noreferrer"':"";return`<a href="${ne(t)}"${r}${i}>${n}</a>`},image({href:t,title:e,text:s}){if(!mn(t))return ne(s);const n=e?` title="${ne(e)}"`:"";return`<img src="${ne(t)}" alt="${ne(s)}"${n}>`}}}),kn=t=>So.parse(t,{async:!1}),Ao=Ke({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 bn extends H{static{this.styles=[Ze,Ws,D`
550
+ `}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>${L(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,text:s,tokens:n,autolink:r}){let i=r?L(s,!0):this.parser.parseInline(n),a=dn(t);if(a===null)return i;t=L(a,r);let o='<a href="'+t+'"';return e&&(o+=' title="'+L(e)+'"'),o+=">"+i+"</a>",o}image({href:t,title:e,text:s,tokens:n}){n&&(s=this.parser.parseInline(n,this.parser.textRenderer));let r=dn(t);if(r===null)return L(s);t=r;let i=`<img src="${L(t)}" alt="${L(s)}"`;return e&&(i+=` title="${L(e)}"`),i+=">",i}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:L(t.text)}},zt=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}},I=class vs{options;renderer;textRenderer;constructor(e){this.options=e||te,this.options.renderer=this.options.renderer||new Xe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new zt}static parse(e,s){return new vs(s).parse(e)}static parseInline(e,s){return new vs(s).parseInline(e)}parse(e){this.renderer.parser=this;let s="";for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let a=r,o=this.options.extensions.renderers[a.type].call({parser:this},a);if(o!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(a.type)){s+=o||"";continue}}let i=r;switch(i.type){case"space":{s+=this.renderer.space(i);break}case"hr":{s+=this.renderer.hr(i);break}case"heading":{s+=this.renderer.heading(i);break}case"code":{s+=this.renderer.code(i);break}case"table":{s+=this.renderer.table(i);break}case"blockquote":{s+=this.renderer.blockquote(i);break}case"list":{s+=this.renderer.list(i);break}case"checkbox":{s+=this.renderer.checkbox(i);break}case"html":{s+=this.renderer.html(i);break}case"def":{s+=this.renderer.def(i);break}case"paragraph":{s+=this.renderer.paragraph(i);break}case"text":{s+=this.renderer.text(i);break}default:{let a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return s}parseInline(e,s=this.renderer){this.renderer.parser=this;let n="";for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let o=this.options.extensions.renderers[i.type].call({parser:this},i);if(o!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(i.type)){n+=o||"";continue}}let a=i;switch(a.type){case"escape":{n+=s.text(a);break}case"html":{n+=s.html(a);break}case"link":{n+=s.link(a);break}case"image":{n+=s.image(a);break}case"checkbox":{n+=s.checkbox(a);break}case"strong":{n+=s.strong(a);break}case"em":{n+=s.em(a);break}case"codespan":{n+=s.codespan(a);break}case"br":{n+=s.br(a);break}case"del":{n+=s.del(a);break}case"text":{n+=s.text(a);break}default:{let o='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return n}},_e=class{options;block;constructor(t){this.options=t||te}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?j.lex:j.lexInline}provideParser(t=this.block){return t?I.parse:I.parseInline}},kn=class{defaults=At();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=I;Renderer=Xe;TextRenderer=zt;Lexer=j;Tokenizer=Qe;Hooks=_e;constructor(...t){this.use(...t)}walkTokens(t,e){let s=[];for(let n of t)switch(s=s.concat(e.call(this,n)),n.type){case"table":{let r=n;for(let i of r.header)s=s.concat(this.walkTokens(i.tokens,e));for(let i of r.rows)for(let a of i)s=s.concat(this.walkTokens(a.tokens,e));break}case"list":{let r=n;s=s.concat(this.walkTokens(r.items,e));break}default:{let r=n;this.defaults.extensions?.childTokens?.[r.type]?this.defaults.extensions.childTokens[r.type].forEach(i=>{let a=r[i].flat(1/0);s=s.concat(this.walkTokens(a,e))}):r.tokens&&(s=s.concat(this.walkTokens(r.tokens,e)))}}return s}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(s=>{let n={...s};if(n.async=this.defaults.async||n.async||!1,s.extensions&&(s.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let i=e.renderers[r.name];i?e.renderers[r.name]=function(...a){let o=r.renderer.apply(this,a);return o===!1&&(o=i.apply(this,a)),o}:e.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[r.level];i?i.unshift(r.tokenizer):e[r.level]=[r.tokenizer],r.start&&(r.level==="block"?e.startBlock?e.startBlock.push(r.start):e.startBlock=[r.start]:r.level==="inline"&&(e.startInline?e.startInline.push(r.start):e.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(e.childTokens[r.name]=r.childTokens)}),n.extensions=e),s.renderer){let r=this.defaults.renderer||new Xe(this.defaults);for(let i in s.renderer){if(!(i in r))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let a=i,o=s.renderer[a],l=r[a];r[a]=(...c)=>{let p=o.apply(r,c);return p===!1&&(p=l.apply(r,c)),p||""}}n.renderer=r}if(s.tokenizer){let r=this.defaults.tokenizer||new Qe(this.defaults);for(let i in s.tokenizer){if(!(i in r))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let a=i,o=s.tokenizer[a],l=r[a];r[a]=(...c)=>{let p=o.apply(r,c);return p===!1&&(p=l.apply(r,c)),p}}n.tokenizer=r}if(s.hooks){let r=this.defaults.hooks||new _e;for(let i in s.hooks){if(!(i in r))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let a=i,o=s.hooks[a],l=r[a];_e.passThroughHooks.has(i)?r[a]=c=>{if(this.defaults.async&&_e.passThroughHooksRespectAsync.has(i))return(async()=>{let d=await o.call(r,c);return l.call(r,d)})();let p=o.call(r,c);return l.call(r,p)}:r[a]=(...c)=>{if(this.defaults.async)return(async()=>{let d=await o.apply(r,c);return d===!1&&(d=await l.apply(r,c)),d})();let p=o.apply(r,c);return p===!1&&(p=l.apply(r,c)),p}}n.hooks=r}if(s.walkTokens){let r=this.defaults.walkTokens,i=s.walkTokens;n.walkTokens=function(a){let o=[];return o.push(i.call(this,a)),r&&(o=o.concat(r.call(this,a))),o}}this.defaults={...this.defaults,...n}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return j.lex(t,e??this.defaults)}parser(t,e){return I.parse(t,e??this.defaults)}parseMarkdown(t){return(e,s)=>{let n={...s},r={...this.defaults,...n},i=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&n.async===!1)return i(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 i(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(r.hooks&&(r.hooks.options=r,r.hooks.block=t),r.async)return(async()=>{let a=r.hooks?await r.hooks.preprocess(e):e,o=await(r.hooks?await r.hooks.provideLexer(t):t?j.lex:j.lexInline)(a,r),l=r.hooks?await r.hooks.processAllTokens(o):o;r.walkTokens&&await Promise.all(this.walkTokens(l,r.walkTokens));let c=await(r.hooks?await r.hooks.provideParser(t):t?I.parse:I.parseInline)(l,r);return r.hooks?await r.hooks.postprocess(c):c})().catch(i);try{r.hooks&&(e=r.hooks.preprocess(e));let a=(r.hooks?r.hooks.provideLexer(t):t?j.lex:j.lexInline)(e,r);r.hooks&&(a=r.hooks.processAllTokens(a)),r.walkTokens&&this.walkTokens(a,r.walkTokens);let o=(r.hooks?r.hooks.provideParser(t):t?I.parse:I.parseInline)(a,r);return r.hooks&&(o=r.hooks.postprocess(o)),o}catch(a){return i(a)}}}onError(t,e){return s=>{if(s.message+=`
551
+ Please report this to https://github.com/markedjs/marked.`,t){let n="<p>An error occurred:</p><pre>"+L(s.message+"",!0)+"</pre>";return e?Promise.resolve(n):n}if(e)return Promise.reject(s);throw s}}},ne=new kn;function $(t,e){return ne.parse(t,e)}$.options=$.setOptions=function(t){return ne.setOptions(t),$.defaults=ne.defaults,Js($.defaults),$},$.getDefaults=At,$.defaults=te;function Ta(...t){return ne.use(...t),$.defaults=ne.defaults,Js($.defaults),$}$.use=Ta,$.walkTokens=function(t,e){return ne.walkTokens(t,e)},$.parseInline=ne.parseInline,$.Parser=I,$.parser=I.parse,$.Renderer=Xe,$.TextRenderer=zt,$.Lexer=j,$.lexer=j.lex,$.Tokenizer=Qe,$.Hooks=_e,$.parse=$,$.options,$.setOptions,$.walkTokens,$.parseInline,I.parse,j.lex;const Ca={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},re=t=>t.replace(/[&<>"']/g,e=>Ca[e]??e),Ea=new Set(["http","https","mailto"]),bn=t=>{const e=t.replace(/[\u0000- \u007f]/g,""),s=/^([a-z][a-z0-9+.-]*):/i.exec(e)?.[1];return s===void 0||Ea.has(s.toLowerCase())},_a=t=>/^https?:/i.test(t.trim()),Ra=new kn({gfm:!0,breaks:!0,renderer:{html({text:t}){return re(t)},link({href:t,title:e,tokens:s}){const n=this.parser.parseInline(s);if(!bn(t))return n;const r=e?` title="${re(e)}"`:"",i=_a(t)?' target="_blank" rel="noopener noreferrer"':"";return`<a href="${re(t)}"${r}${i}>${n}</a>`},image({href:t,title:e,text:s}){if(!bn(t))return re(s);const n=e?` title="${re(e)}"`:"";return`<img src="${re(t)}" alt="${re(s)}"${n}>`}}}),xn=t=>Ra.parse(t,{async:!1}),La=We({en:{clickToEdit:"Click to edit",unset:"Not set",edit:"Edit"},ja:{clickToEdit:"\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u7DE8\u96C6",unset:"\u672A\u8A2D\u5B9A",edit:"\u7DE8\u96C6"}});class vn extends F{static{this.styles=[Ve,Gs,B`
552
552
  /* One atomic box in both states, so the text can be edited where it sits:
553
553
  while editing, the text stays (hidden) underneath and keeps sizing the
554
554
  box, and the field lies over it. Starting an edit moves nothing; the
@@ -663,8 +663,8 @@ Please report this to https://github.com/markedjs/marked.`,t){let n="<p>An error
663
663
  background: transparent;
664
664
  box-shadow: none;
665
665
  }
666
- `]}static{this.properties={value:{type:String},placeholder:{type:String},multiline:{type:Boolean},wrap:{type:Boolean,reflect:!0},seamless:{type:Boolean,reflect:!0},markdown:{type:Boolean},label:{type:String},editing:{state:!0}}}#e="";#i=0;#n=new wt(this);connectedCallback(){super.connectedCallback(),this.#i+=1}constructor(){super(),this.value="",this.placeholder="",this.multiline=!1,this.wrap=!1,this.seamless=!1,this.markdown=!1,this.label="",this.editing=!1,this.#e=""}startEditing(){this.#e=this.value,this.editing=!0}willUpdate(e){e.has("value")&&!this.editing&&(this.#e=this.value)}updated(){if(!this.editing)return;const e=this.renderRoot.querySelector(".field"),s=this.renderRoot,n=s instanceof ShadowRoot?s.activeElement:document.activeElement;e&&n!==e&&(e.focus(),e.select())}render(){const e=Ao(this.#n.locale),s=this.placeholder||e.unset,{editing:n}=this,r=n?this.#e:this.value,i=r===""?s:n&&r.endsWith(`
667
- `)?`${r}\u200B`:r;return this.markdown&&!n&&r!==""?g`<span class="box"
666
+ `]}static{this.properties={value:{type:String},placeholder:{type:String},multiline:{type:Boolean},wrap:{type:Boolean,reflect:!0},seamless:{type:Boolean,reflect:!0},markdown:{type:Boolean},label:{type:String},editing:{state:!0}}}#e="";#i=0;#n=new $t(this);connectedCallback(){super.connectedCallback(),this.#i+=1}constructor(){super(),this.value="",this.placeholder="",this.multiline=!1,this.wrap=!1,this.seamless=!1,this.markdown=!1,this.label="",this.editing=!1,this.#e=""}startEditing(){this.#e=this.value,this.editing=!0}willUpdate(e){e.has("value")&&!this.editing&&(this.#e=this.value)}updated(){if(!this.editing)return;const e=this.renderRoot.querySelector(".field"),s=this.renderRoot,n=s instanceof ShadowRoot?s.activeElement:document.activeElement;e&&n!==e&&(e.focus(),e.select())}render(){const e=La(this.#n.locale),s=this.placeholder||e.unset,{editing:n}=this,r=n?this.#e:this.value,i=r===""?s:n&&r.endsWith(`
667
+ `)?`${r}\u200B`:r;return this.markdown&&!n&&r!==""?k`<span class="box"
668
668
  ><div
669
669
  class="view dpk-prose"
670
670
  data-empty="false"
@@ -674,49 +674,49 @@ Please report this to https://github.com/markedjs/marked.`,t){let n="<p>An error
674
674
  @click=${this.#t}
675
675
  @keydown=${this.#s}
676
676
  >
677
- ${Ds(kn(r))}
677
+ ${Hs(xn(r))}
678
678
  </div></span
679
- >`:g`<span class="box"
679
+ >`:k`<span class="box"
680
680
  ><span
681
681
  class="view"
682
682
  data-empty=${String(r==="")}
683
- aria-hidden=${n?"true":m}
684
- role=${n?m:"button"}
685
- tabindex=${n?m:"0"}
686
- title=${n?m:e.clickToEdit}
683
+ aria-hidden=${n?"true":g}
684
+ role=${n?g:"button"}
685
+ tabindex=${n?g:"0"}
686
+ title=${n?g:e.clickToEdit}
687
687
  @click=${this.#t}
688
688
  @keydown=${this.#s}
689
689
  >${i}</span
690
- >${n?this.#r(this.label||this.placeholder||e.edit,s):m}</span
691
- >`}#r(e,s){return this.multiline||this.wrap?g`<textarea
690
+ >${n?this.#r(this.label||this.placeholder||e.edit,s):g}</span
691
+ >`}#r(e,s){return this.multiline||this.wrap?k`<textarea
692
692
  class="field"
693
693
  rows="1"
694
- .value=${bt(this.#e)}
694
+ .value=${vt(this.#e)}
695
695
  placeholder=${s}
696
696
  aria-label=${e}
697
- @input=${this.#o}
698
- @keydown=${this.#a}
697
+ @input=${this.#a}
698
+ @keydown=${this.#o}
699
699
  @blur=${this.#l}
700
- ></textarea>`:g`<input
700
+ ></textarea>`:k`<input
701
701
  class="field"
702
- .value=${bt(this.#e)}
702
+ .value=${vt(this.#e)}
703
703
  placeholder=${s}
704
704
  aria-label=${e}
705
- @input=${this.#o}
706
- @keydown=${this.#a}
705
+ @input=${this.#a}
706
+ @keydown=${this.#o}
707
707
  @blur=${this.#l}
708
- />`}#t=e=>{e.composedPath().some(s=>s instanceof HTMLAnchorElement)||(e.stopPropagation(),!this.editing&&(this.#e=this.value,this.editing=!0))};#s=e=>{e.isComposing||this.editing||e.target instanceof HTMLAnchorElement||(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.editing=!0)};#o=e=>{const s=ce(e.target,HTMLInputElement)??ce(e.target,HTMLTextAreaElement);s!==null&&(this.#e=s.value,this.requestUpdate())};#a=e=>{if(!e.isComposing){if(e.key==="Escape"){e.preventDefault(),this.#e=this.value,this.editing=!1;return}e.key==="Enter"&&(!this.multiline||this.wrap||e.metaKey||e.ctrlKey)&&(e.preventDefault(),this.#p())}};#l=e=>{const s=e.currentTarget;if(!(s instanceof HTMLInputElement||s instanceof HTMLTextAreaElement))return;const n=this.#i,{selectionStart:r,selectionEnd:i}=s;queueMicrotask(()=>{!this.isConnected||!this.editing||(n!==this.#i?(s.focus(),s.setSelectionRange(r,i)):this.#p())})};#p=()=>{if(!this.editing)return;this.editing=!1;const s=(this.wrap?this.#e.replace(/\r?\n/g," "):this.#e).trim();s!==this.value&&this.dispatchEvent(new CustomEvent("dpk-commit",{detail:{value:s},bubbles:!0,composed:!0}))}}const Co=()=>{customElements.get("dpk-component-inline-edit")||customElements.define("dpk-component-inline-edit",bn)},To={lang:void 0,message:void 0,abortEarly:void 0,abortPipeEarly:void 0};function zt(t){return To}let Eo;function _o(t){return Eo?.get(t)}let Ro;function Lo(t){return Ro?.get(t)}let Po;function zo(t,e){return Po?.get(t)?.get(e)}function Ee(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 A(t,e,s,n,r){const i=r&&"input"in r?r.input:s.value,o=r?.expected??t.expects??null,a=r?.received??Ee(i),l={kind:t.kind,type:t.type,input:i,expected:o,received:a,message:`Invalid ${e}: ${o?`Expected ${o} but r`:"R"}eceived ${a}`,requirement:t.requirement,path:r?.path,issues:r?.issues,lang:n.lang,abortEarly:n.abortEarly,abortPipeEarly:n.abortPipeEarly},c=t.kind==="schema",p=r?.message??t.message??zo(t.reference,l.lang)??(c?Lo(l.lang):null)??n.message??_o(l.lang);p!==void 0&&(l.message=typeof p=="function"?p(l):p),c&&(s.typed=!1),s.issues?s.issues.push(l):s.issues=[l]}function Mo(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function Oo(t,e){return Object.prototype.hasOwnProperty.call(t,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function Mt(t,e){const s=[...new Set(t)];return s.length>1?`(${s.join(` ${e} `)})`:s[0]??"never"}function E(t){return t["~standard"]={version:1,vendor:"valibot",validate:e=>t["~run"]({value:e},zt())},t}var jo=class extends Error{constructor(t){super(t[0].message),this.name="ValiError",this.issues=t}};function vn(t,e){return{kind:"validation",type:"check",reference:vn,async:!1,expects:null,requirement:t,message:e,"~run"(s,n){return s.typed&&!this.requirement(s.value)&&A(this,"input",s,n),s}}}function xn(t){return{kind:"validation",type:"finite",reference:xn,async:!1,expects:null,requirement:Number.isFinite,message:t,"~run"(e,s){return e.typed&&!this.requirement(e.value)&&A(this,"finite",e,s),e}}}function yn(t){return{kind:"validation",type:"integer",reference:yn,async:!1,expects:null,requirement:Number.isInteger,message:t,"~run"(e,s){return e.typed&&!this.requirement(e.value)&&A(this,"integer",e,s),e}}}function w(t,e){return{kind:"validation",type:"min_length",reference:w,async:!1,expects:`>=${t}`,requirement:t,message:e,"~run"(s,n){return s.typed&&s.value.length<this.requirement&&A(this,"length",s,n,{received:`${s.value.length}`}),s}}}function wn(t,e){return{kind:"validation",type:"min_value",reference:wn,async:!1,expects:`>=${t instanceof Date?t.toJSON():Ee(t)}`,requirement:t,message:e,"~run"(s,n){return s.typed&&!(s.value>=this.requirement)&&A(this,"value",s,n,{received:s.value instanceof Date?s.value.toJSON():Ee(s.value)}),s}}}function re(t,e){return{kind:"validation",type:"regex",reference:re,async:!1,expects:`${t}`,requirement:t,message:e,"~run"(s,n){return s.typed&&!this.requirement.test(s.value)&&A(this,"format",s,n),s}}}function Ot(){return{kind:"transformation",type:"trim",reference:Ot,async:!1,"~run"(t){return t.value=t.value.trim(),t}}}const $n={abortEarly:!0};function Sn(t,e,s){return typeof t.fallback=="function"?t.fallback(e,s):t.fallback}function Qe(t,e,s){return typeof t.default=="function"?t.default(e,s):t.default}function Io(t,e){return!t["~run"]({value:e},$n).issues}function Z(t,e){return E({kind:"schema",type:"array",reference:Z,expects:"Array",async:!1,item:t,message:e,"~run"(s,n){const r=s.value;if(Array.isArray(r)){s.typed=!0,s.value=[];for(let i=0;i<r.length;i++){const o=r[i],a=this.item["~run"]({value:o},n);if(a.issues){const l={type:"array",origin:"value",input:r,key:i,value:o};for(const c of a.issues)c.path?c.path.unshift(l):c.path=[l],s.issues?.push(c);if(s.issues||(s.issues=a.issues),n.abortEarly){s.typed=!1;break}}a.typed||(s.typed=!1),s.value.push(a.value)}}else A(this,"type",s,n);return s}})}function An(t){return E({kind:"schema",type:"boolean",reference:An,expects:"boolean",async:!1,message:t,"~run"(e,s){return typeof e.value=="boolean"?e.typed=!0:A(this,"type",e,s),e}})}function L(t,e){return E({kind:"schema",type:"exact_optional",reference:L,expects:t.expects,async:!1,wrapped:t,default:e,"~run"(s,n){return this.wrapped["~run"](s,n)}})}function Cn(t){return E({kind:"schema",type:"lazy",reference:Cn,expects:"unknown",async:!1,getter:t,"~run"(e,s){return this.getter(e.value)["~run"](e,s)}})}function he(t,e){return E({kind:"schema",type:"literal",reference:he,expects:Ee(t),async:!1,literal:t,message:e,"~run"(s,n){return Mo(s.value,this.literal)?s.typed=!0:A(this,"type",s,n),s}})}function Tn(t,e){return E({kind:"schema",type:"nullable",reference:Tn,expects:`(${t.expects} | null)`,async:!1,wrapped:t,default:e,"~run"(s,n){return s.value===null&&(this.default!==void 0&&(s.value=Qe(this,s,n)),s.value===null)?(s.typed=!0,s):this.wrapped["~run"](s,n)}})}function En(t){return E({kind:"schema",type:"number",reference:En,expects:"number",async:!1,message:t,"~run"(e,s){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:A(this,"type",e,s),e}})}function C(t,e){return E({kind:"schema",type:"object",reference:C,expects:"Object",async:!1,entries:t,message:e,"~run"(s,n){const r=s.value;if(r&&typeof r=="object"){s.typed=!0,s.value={};for(const i in this.entries){const o=this.entries[i];if(i in r||(o.type==="exact_optional"||o.type==="optional"||o.type==="nullish")&&o.default!==void 0){const a=i in r?r[i]:Qe(o),l=o["~run"]({value:a},n);if(l.issues){const c={type:"object",origin:"value",input:r,key:i,value:a};for(const p of l.issues)p.path?p.path.unshift(c):p.path=[c],s.issues?.push(p);if(s.issues||(s.issues=l.issues),n.abortEarly){s.typed=!1;break}}l.typed||(s.typed=!1),s.value[i]=l.value}else if(o.fallback!==void 0)s.value[i]=Sn(o);else if(o.type!=="exact_optional"&&o.type!=="optional"&&o.type!=="nullish"&&(A(this,"key",s,n,{input:void 0,expected:`"${i}"`,path:[{type:"object",origin:"key",input:r,key:i,value:r[i]}]}),n.abortEarly))break}}else A(this,"type",s,n);return s}})}function _e(t,e){return E({kind:"schema",type:"optional",reference:_e,expects:`(${t.expects} | undefined)`,async:!1,wrapped:t,default:e,"~run"(s,n){return s.value===void 0&&(this.default!==void 0&&(s.value=Qe(this,s,n)),s.value===void 0)?(s.typed=!0,s):this.wrapped["~run"](s,n)}})}function Xe(t,e){return E({kind:"schema",type:"picklist",reference:Xe,expects:Mt(t.map(Ee),"|"),async:!1,options:t,message:e,"~run"(s,n){return this.options.includes(s.value)?s.typed=!0:A(this,"type",s,n),s}})}function et(t,e,s){return E({kind:"schema",type:"record",reference:et,expects:"Object",async:!1,key:t,value:e,message:s,"~run"(n,r){const i=n.value;if(i&&typeof i=="object"){n.typed=!0,n.value={};for(const o in i)if(Oo(i,o)){const a=i[o],l=this.key["~run"]({value:o},r);if(l.issues){const p={type:"object",origin:"key",input:i,key:o,value:a};for(const d of l.issues)d.path=[p],n.issues?.push(d);if(n.issues||(n.issues=l.issues),r.abortEarly){n.typed=!1;break}}const c=this.value["~run"]({value:a},r);if(c.issues){const p={type:"object",origin:"value",input:i,key:o,value:a};for(const d of c.issues)d.path?d.path.unshift(p):d.path=[p],n.issues?.push(d);if(n.issues||(n.issues=c.issues),r.abortEarly){n.typed=!1;break}}(!l.typed||!c.typed)&&(n.typed=!1),l.typed&&(n.value[l.value]=c.value)}}else A(this,"type",n,r);return n}})}function ue(t,e){return E({kind:"schema",type:"strict_object",reference:ue,expects:"Object",async:!1,entries:t,message:e,"~run"(s,n){const r=s.value;if(r&&typeof r=="object"){s.typed=!0,s.value={};for(const i in this.entries){const o=this.entries[i];if(i in r||(o.type==="exact_optional"||o.type==="optional"||o.type==="nullish")&&o.default!==void 0){const a=i in r?r[i]:Qe(o),l=o["~run"]({value:a},n);if(l.issues){const c={type:"object",origin:"value",input:r,key:i,value:a};for(const p of l.issues)p.path?p.path.unshift(c):p.path=[c],s.issues?.push(p);if(s.issues||(s.issues=l.issues),n.abortEarly){s.typed=!1;break}}l.typed||(s.typed=!1),s.value[i]=l.value}else if(o.fallback!==void 0)s.value[i]=Sn(o);else if(o.type!=="exact_optional"&&o.type!=="optional"&&o.type!=="nullish"&&(A(this,"key",s,n,{input:void 0,expected:`"${i}"`,path:[{type:"object",origin:"key",input:r,key:i,value:r[i]}]}),n.abortEarly))break}if(!s.issues||!n.abortEarly){for(const i in r)if(!Object.prototype.hasOwnProperty.call(this.entries,i)){A(this,"key",s,n,{input:i,expected:"never",path:[{type:"object",origin:"key",input:r,key:i,value:r[i]}]});break}}}else A(this,"type",s,n);return s}})}function k(t){return E({kind:"schema",type:"string",reference:k,expects:"string",async:!1,message:t,"~run"(e,s){return typeof e.value=="string"?e.typed=!0:A(this,"type",e,s),e}})}function _n(t){let e;if(t)for(const s of t)if(e)for(const n of s.issues)e.push(n);else e=s.issues;return e}function jt(t,e){return E({kind:"schema",type:"union",reference:jt,expects:Mt(t.map(s=>s.expects),"|"),async:!1,options:t,message:e,"~run"(s,n){let r,i,o;for(const a of this.options){const l=a["~run"]({value:s.value},n);if(l.typed)if(l.issues)i?i.push(l):i=[l];else{r=l;break}else o?o.push(l):o=[l]}if(r)return r;if(i){if(i.length===1)return i[0];A(this,"type",s,n,{issues:_n(i)}),s.typed=!0}else{if(o?.length===1)return o[0];A(this,"type",s,n,{issues:_n(o)})}return s}})}function W(){return E({kind:"schema",type:"unknown",reference:W,expects:"unknown",async:!1,"~run"(t){return t.typed=!0,t}})}function Rn(t,e,s){return E({kind:"schema",type:"variant",reference:Rn,expects:"Object",async:!1,key:t,options:e,message:s,"~run"(n,r){const i=n.value;if(i&&typeof i=="object"){let o,a=0,l=this.key,c=[];const p=(d,h)=>{for(const u of d.options){if(u.type==="variant")p(u,new Set(h).add(u.key));else{let f=!0,y=0;for(const v of h){const _=u.entries[v];if(v in i?_["~run"]({typed:!1,value:i[v]},$n).issues:_.type!=="exact_optional"&&_.type!=="optional"&&_.type!=="nullish"){f=!1,l!==v&&(a<y||a===y&&v in i&&!(l in i))&&(a=y,l=v,c=[]),l===v&&c.push(u.entries[v].expects);break}y++}if(f){const v=u["~run"]({value:i},r);(!o||!o.typed&&v.typed)&&(o=v)}}if(o&&!o.issues)break}};if(p(this,new Set([this.key])),o)return o;A(this,"type",n,r,{input:i[l],expected:Mt(c,"|"),path:[{type:"object",origin:"value",input:i,key:l,value:i[l]}]})}else A(this,"type",n,r);return n}})}function It(t,e,s){const n=t["~run"]({value:e},zt());if(n.issues)throw new jo(n.issues);return n.value}function x(...t){return E({...t[0],pipe:t,"~run"(e,s){for(const n of t)if(n.kind!=="metadata"){if(e.issues&&(n.kind==="schema"||n.kind==="transformation")){e.typed=!1;break}(!e.issues||!s.abortEarly&&!s.abortPipeEarly)&&(e=n["~run"](e,s))}return e}})}function S(t,e,s){const n=t["~run"]({value:e},zt());return{typed:n.typed,success:!n.issues,output:n.value,issues:n.issues}}const tt=C({type:x(k(),w(1)),id:x(k(),w(1))}),qo=x(k(),w(1),re(/^[A-Za-z0-9_-]+$/,'ids may only contain letters, digits, "_" and "-" (a "." builds a path)')),No=(t,e)=>{if(e===1)return t.includes(".")?null:[t];const s=t.split(".");return s.length===e&&s.every(n=>n.length>0)?s:null},ie=C({id:x(k(),w(1)),type:x(k(),w(1)),target:tt,payload:W(),note:L(k()),createdAt:x(k(),w(1))}),Bo=(t,e,s,n={})=>{const r=C({id:x(k(),w(1)),type:he(t),target:tt,payload:s,note:L(k()),createdAt:x(k(),w(1))}),i=o=>{const a=S(ie,o);if(!a.success||a.output.type!==t)return null;const l=S(s,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:r,mode:n.mode??"patch",targetType:e,actionType:t,payloadSchema:s,parse:i,...n.dedupeKey?{dedupeKey:n.dedupeKey}:{}}},Do=(t,e)=>{const s=st(t,e.type);if(s===void 0)return null;const n=s.parse(e);return n===null?null:n},Uo=(t,e)=>{const s=S(t.payloadSchema,e.payload);if(!s.success)throw new Error(`invalid payload for action "${e.type}"`);return s.output},st=(t,e)=>Object.hasOwn(t,e)?t[e]:void 0,Ho=t=>{throw new Error(`unhandled action: ${JSON.stringify(t)}`)},Fo=C({id:x(k(),w(1))}),Ko=t=>{const e=S(Fo,t.payload);return`${t.type}|${e.success?e.output.id:JSON.stringify(t.payload)}`},M=t=>`${t.type}:${t.id}`,Ln=t=>{const e=t.indexOf(":");return e<=0?{type:"unknown",id:t}:{type:t.slice(0,e),id:t.slice(e+1)}},qt=(t,e)=>typeof t=="string"?Ln(t.includes(":")?t:`${e}:${t}`):{type:t.type,id:t.id},Zo=(t,e)=>t.type===e.type&&t.id===e.id,Pn=t=>{const e=t.normalize("NFKD").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40);return e.length>0?e:"item"},Wo=(t,e)=>{const s=Pn(t),n=new Set(e);if(!n.has(s))return s;for(let r=2;r<1e3;r+=1){const i=`${s}-${r}`;if(!n.has(i))return i}return`${s}-${Math.random().toString(36).slice(2,8)}`},zn=()=>{const t=globalThis.crypto;return t?.randomUUID?t.randomUUID():`a-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`},P="comment",oe=t=>{const[e]=t;return{path:e?.path?.map(s=>String(s.key)).join(".")??"",message:e?.message??"invalid action"}},Mn=C({type:x(k(),w(1)),target:jt([x(k(),w(1)),tt]),payload:_e(W()),note:L(k()),id:L(x(k(),w(1))),createdAt:L(x(k(),w(1)))}),Vo=(t,e)=>{const s=S(Mn,t);if(!s.success)return{ok:!1,issue:oe(s.issues)};const n=s.output,r=qt(n.target,e.targetType),i={id:n.id??zn(),type:n.type,target:r,payload:n.payload??{},...n.note===void 0?{}:{note:n.note},createdAt:n.createdAt??new Date().toISOString()},o=S(e.schema,i);if(!o.success)return{ok:!1,issue:oe(o.issues)};const a=S(ie,o.output);return a.success?{ok:!0,action:a.output}:{ok:!1,issue:oe(a.issues)}},Nt=(t,e)=>e.dedupeKey?e.dedupeKey(t):e.mode!=="patch"?null:`${t.type}|${M(t.target)}`,Bt=(t,e,s)=>{const n=Nt(e,s);if(n===null)return[...t,e];const r=t.at(-1);return!r||Nt(r,s)!==n||!Go(r,e)?[...t,e]:[...t.slice(0,-1),e]},Go=(t,e)=>Zo(t.target,e.target),Dt=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),On=C({id:x(k(),w(1)),type:he(P),target:C({type:x(k(),w(1)),id:x(k(),w(1))}),payload:C({body:x(k(),w(1))}),note:L(k()),createdAt:x(k(),w(1))}),Ut={schema:On,mode:"append",targetType:"page"},Jo=C({body:k()}),Re=t=>{const e=S(Jo,t.payload);return e.success?e.output.body:""},Ht="element",jn=x(k(),re(/^[A-Z][A-Z0-9_]*$/,"component action types are CONSTANT_CASE")),In=et(k(),W()),Yo=C({type:he(Ht),id:x(k(),re(/^[^/]+\/.+/,"component references start with a provider id"))}),Qo=C({id:x(k(),w(1)),type:jn,target:Yo,payload:In,note:L(k()),createdAt:x(k(),w(1))}),Xo={schema:Qo,mode:"sequence",targetType:Ht},ea=ue({type:jn,target:x(k(),re(/^element:[^/]+\/.+/)),payload:_e(In,{})}),qn=ue({id:x(k(),w(1)),title:x(k(),w(1)),summary:L(k()),tone:L(Xe(["create","update","delete","move","meta"])),stale:L(Xe(["unsupported-action-type","target-missing","constraint-violated"]))}),Ft=t=>{if(t.type!==Ht)return null;const e=t.id.indexOf("/");if(e<=0)return null;try{return decodeURIComponent(t.id.slice(0,e))}catch{return null}},I=t=>t.type!==P&&Ft(t.target)!==null,ta=(t,e)=>t.filter(s=>I(s)&&Ft(s.target)===e),Nn=(t,e)=>{const s=new Map(t.flatMap(n=>I(n)?[[n.id,Ft(n.target)]]:[]));return new Map(e.flatMap(n=>n.results.flatMap(r=>s.get(r.id)===n.id?[[r.id,r]]:[])))},Kt=Object.freeze({}),Zt=t=>{const e=t.startsWith("#")?t.slice(1):t;if(e.length===0)return Kt;const s=new URLSearchParams(e.startsWith("?")?e.slice(1):e),n={};for(const[r,i]of s)r.length>0&&i.length>0&&(n[r]=i);return n},fe=t=>{const e=new URLSearchParams;for(const n of Object.keys(t).sort((r,i)=>r<i?-1:r>i?1:0)){const r=t[n];r!=null&&r!==""&&e.set(n,r)}const s=e.toString();return s.length===0?"":`#${s}`},Wt=(t,e,s=[])=>{const n={...t},r=Object.keys(e).map(i=>s.indexOf(i)).filter(i=>i>=0);if(r.length>0)for(const i of s.slice(Math.min(...r)+1))Object.hasOwn(e,i)||delete n[i];for(const[i,o]of Object.entries(e))o==null||o===""?delete n[i]:n[i]=o;return n},sa=(t,e="json")=>`\`\`\`${e}
708
+ />`}#t=e=>{e.composedPath().some(s=>s instanceof HTMLAnchorElement)||(e.stopPropagation(),!this.editing&&(this.#e=this.value,this.editing=!0))};#s=e=>{e.isComposing||this.editing||e.target instanceof HTMLAnchorElement||(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.editing=!0)};#a=e=>{const s=de(e.target,HTMLInputElement)??de(e.target,HTMLTextAreaElement);s!==null&&(this.#e=s.value,this.requestUpdate())};#o=e=>{if(!e.isComposing){if(e.key==="Escape"){e.preventDefault(),this.#e=this.value,this.editing=!1;return}e.key==="Enter"&&(!this.multiline||this.wrap||e.metaKey||e.ctrlKey)&&(e.preventDefault(),this.#p())}};#l=e=>{const s=e.currentTarget;if(!(s instanceof HTMLInputElement||s instanceof HTMLTextAreaElement))return;const n=this.#i,{selectionStart:r,selectionEnd:i}=s;queueMicrotask(()=>{!this.isConnected||!this.editing||(n!==this.#i?(s.focus(),s.setSelectionRange(r,i)):this.#p())})};#p=()=>{if(!this.editing)return;this.editing=!1;const s=(this.wrap?this.#e.replace(/\r?\n/g," "):this.#e).trim();s!==this.value&&this.dispatchEvent(new CustomEvent("dpk-commit",{detail:{value:s},bubbles:!0,composed:!0}))}}const Pa=()=>{customElements.get("dpk-component-inline-edit")||customElements.define("dpk-component-inline-edit",vn)},za={lang:void 0,message:void 0,abortEarly:void 0,abortPipeEarly:void 0};function Ot(t){return za}let Oa;function Ma(t){return Oa?.get(t)}let ja;function Ia(t){return ja?.get(t)}let qa;function Na(t,e){return qa?.get(t)?.get(e)}function Re(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 A(t,e,s,n,r){const i=r&&"input"in r?r.input:s.value,a=r?.expected??t.expects??null,o=r?.received??Re(i),l={kind:t.kind,type:t.type,input:i,expected:a,received:o,message:`Invalid ${e}: ${a?`Expected ${a} but r`:"R"}eceived ${o}`,requirement:t.requirement,path:r?.path,issues:r?.issues,lang:n.lang,abortEarly:n.abortEarly,abortPipeEarly:n.abortPipeEarly},c=t.kind==="schema",p=r?.message??t.message??Na(t.reference,l.lang)??(c?Ia(l.lang):null)??n.message??Ma(l.lang);p!==void 0&&(l.message=typeof p=="function"?p(l):p),c&&(s.typed=!1),s.issues?s.issues.push(l):s.issues=[l]}function Da(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function Ua(t,e){return Object.prototype.hasOwnProperty.call(t,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function Mt(t,e){const s=[...new Set(t)];return s.length>1?`(${s.join(` ${e} `)})`:s[0]??"never"}function _(t){return t["~standard"]={version:1,vendor:"valibot",validate:e=>t["~run"]({value:e},Ot())},t}var Ba=class extends Error{constructor(t){super(t[0].message),this.name="ValiError",this.issues=t}};function yn(t,e){return{kind:"validation",type:"check",reference:yn,async:!1,expects:null,requirement:t,message:e,"~run"(s,n){return s.typed&&!this.requirement(s.value)&&A(this,"input",s,n),s}}}function wn(t){return{kind:"validation",type:"finite",reference:wn,async:!1,expects:null,requirement:Number.isFinite,message:t,"~run"(e,s){return e.typed&&!this.requirement(e.value)&&A(this,"finite",e,s),e}}}function $n(t){return{kind:"validation",type:"integer",reference:$n,async:!1,expects:null,requirement:Number.isInteger,message:t,"~run"(e,s){return e.typed&&!this.requirement(e.value)&&A(this,"integer",e,s),e}}}function w(t,e){return{kind:"validation",type:"min_length",reference:w,async:!1,expects:`>=${t}`,requirement:t,message:e,"~run"(s,n){return s.typed&&s.value.length<this.requirement&&A(this,"length",s,n,{received:`${s.value.length}`}),s}}}function Sn(t,e){return{kind:"validation",type:"min_value",reference:Sn,async:!1,expects:`>=${t instanceof Date?t.toJSON():Re(t)}`,requirement:t,message:e,"~run"(s,n){return s.typed&&!(s.value>=this.requirement)&&A(this,"value",s,n,{received:s.value instanceof Date?s.value.toJSON():Re(s.value)}),s}}}function ie(t,e){return{kind:"validation",type:"regex",reference:ie,async:!1,expects:`${t}`,requirement:t,message:e,"~run"(s,n){return s.typed&&!this.requirement.test(s.value)&&A(this,"format",s,n),s}}}function jt(){return{kind:"transformation",type:"trim",reference:jt,async:!1,"~run"(t){return t.value=t.value.trim(),t}}}function An(t){return{kind:"validation",type:"url",reference:An,async:!1,expects:null,requirement(e){try{return URL.canParse?URL.canParse(e):(new URL(e),!0)}catch{return!1}},message:t,"~run"(e,s){return e.typed&&!this.requirement(e.value)&&A(this,"URL",e,s),e}}}const Tn={abortEarly:!0};function Cn(t,e,s){return typeof t.fallback=="function"?t.fallback(e,s):t.fallback}function et(t,e,s){return typeof t.default=="function"?t.default(e,s):t.default}function Ha(t,e){return!t["~run"]({value:e},Tn).issues}function W(t,e){return _({kind:"schema",type:"array",reference:W,expects:"Array",async:!1,item:t,message:e,"~run"(s,n){const r=s.value;if(Array.isArray(r)){s.typed=!0,s.value=[];for(let i=0;i<r.length;i++){const a=r[i],o=this.item["~run"]({value:a},n);if(o.issues){const l={type:"array",origin:"value",input:r,key:i,value:a};for(const c of o.issues)c.path?c.path.unshift(l):c.path=[l],s.issues?.push(c);if(s.issues||(s.issues=o.issues),n.abortEarly){s.typed=!1;break}}o.typed||(s.typed=!1),s.value.push(o.value)}}else A(this,"type",s,n);return s}})}function En(t){return _({kind:"schema",type:"boolean",reference:En,expects:"boolean",async:!1,message:t,"~run"(e,s){return typeof e.value=="boolean"?e.typed=!0:A(this,"type",e,s),e}})}function P(t,e){return _({kind:"schema",type:"exact_optional",reference:P,expects:t.expects,async:!1,wrapped:t,default:e,"~run"(s,n){return this.wrapped["~run"](s,n)}})}function _n(t){return _({kind:"schema",type:"lazy",reference:_n,expects:"unknown",async:!1,getter:t,"~run"(e,s){return this.getter(e.value)["~run"](e,s)}})}function ue(t,e){return _({kind:"schema",type:"literal",reference:ue,expects:Re(t),async:!1,literal:t,message:e,"~run"(s,n){return Da(s.value,this.literal)?s.typed=!0:A(this,"type",s,n),s}})}function Rn(t,e){return _({kind:"schema",type:"nullable",reference:Rn,expects:`(${t.expects} | null)`,async:!1,wrapped:t,default:e,"~run"(s,n){return s.value===null&&(this.default!==void 0&&(s.value=et(this,s,n)),s.value===null)?(s.typed=!0,s):this.wrapped["~run"](s,n)}})}function Ln(t){return _({kind:"schema",type:"number",reference:Ln,expects:"number",async:!1,message:t,"~run"(e,s){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:A(this,"type",e,s),e}})}function C(t,e){return _({kind:"schema",type:"object",reference:C,expects:"Object",async:!1,entries:t,message:e,"~run"(s,n){const r=s.value;if(r&&typeof r=="object"){s.typed=!0,s.value={};for(const i in this.entries){const a=this.entries[i];if(i in r||(a.type==="exact_optional"||a.type==="optional"||a.type==="nullish")&&a.default!==void 0){const o=i in r?r[i]:et(a),l=a["~run"]({value:o},n);if(l.issues){const c={type:"object",origin:"value",input:r,key:i,value:o};for(const p of l.issues)p.path?p.path.unshift(c):p.path=[c],s.issues?.push(p);if(s.issues||(s.issues=l.issues),n.abortEarly){s.typed=!1;break}}l.typed||(s.typed=!1),s.value[i]=l.value}else if(a.fallback!==void 0)s.value[i]=Cn(a);else if(a.type!=="exact_optional"&&a.type!=="optional"&&a.type!=="nullish"&&(A(this,"key",s,n,{input:void 0,expected:`"${i}"`,path:[{type:"object",origin:"key",input:r,key:i,value:r[i]}]}),n.abortEarly))break}}else A(this,"type",s,n);return s}})}function Le(t,e){return _({kind:"schema",type:"optional",reference:Le,expects:`(${t.expects} | undefined)`,async:!1,wrapped:t,default:e,"~run"(s,n){return s.value===void 0&&(this.default!==void 0&&(s.value=et(this,s,n)),s.value===void 0)?(s.typed=!0,s):this.wrapped["~run"](s,n)}})}function tt(t,e){return _({kind:"schema",type:"picklist",reference:tt,expects:Mt(t.map(Re),"|"),async:!1,options:t,message:e,"~run"(s,n){return this.options.includes(s.value)?s.typed=!0:A(this,"type",s,n),s}})}function st(t,e,s){return _({kind:"schema",type:"record",reference:st,expects:"Object",async:!1,key:t,value:e,message:s,"~run"(n,r){const i=n.value;if(i&&typeof i=="object"){n.typed=!0,n.value={};for(const a in i)if(Ua(i,a)){const o=i[a],l=this.key["~run"]({value:a},r);if(l.issues){const p={type:"object",origin:"key",input:i,key:a,value:o};for(const d of l.issues)d.path=[p],n.issues?.push(d);if(n.issues||(n.issues=l.issues),r.abortEarly){n.typed=!1;break}}const c=this.value["~run"]({value:o},r);if(c.issues){const p={type:"object",origin:"value",input:i,key:a,value:o};for(const d of c.issues)d.path?d.path.unshift(p):d.path=[p],n.issues?.push(d);if(n.issues||(n.issues=c.issues),r.abortEarly){n.typed=!1;break}}(!l.typed||!c.typed)&&(n.typed=!1),l.typed&&(n.value[l.value]=c.value)}}else A(this,"type",n,r);return n}})}function fe(t,e){return _({kind:"schema",type:"strict_object",reference:fe,expects:"Object",async:!1,entries:t,message:e,"~run"(s,n){const r=s.value;if(r&&typeof r=="object"){s.typed=!0,s.value={};for(const i in this.entries){const a=this.entries[i];if(i in r||(a.type==="exact_optional"||a.type==="optional"||a.type==="nullish")&&a.default!==void 0){const o=i in r?r[i]:et(a),l=a["~run"]({value:o},n);if(l.issues){const c={type:"object",origin:"value",input:r,key:i,value:o};for(const p of l.issues)p.path?p.path.unshift(c):p.path=[c],s.issues?.push(p);if(s.issues||(s.issues=l.issues),n.abortEarly){s.typed=!1;break}}l.typed||(s.typed=!1),s.value[i]=l.value}else if(a.fallback!==void 0)s.value[i]=Cn(a);else if(a.type!=="exact_optional"&&a.type!=="optional"&&a.type!=="nullish"&&(A(this,"key",s,n,{input:void 0,expected:`"${i}"`,path:[{type:"object",origin:"key",input:r,key:i,value:r[i]}]}),n.abortEarly))break}if(!s.issues||!n.abortEarly){for(const i in r)if(!Object.prototype.hasOwnProperty.call(this.entries,i)){A(this,"key",s,n,{input:i,expected:"never",path:[{type:"object",origin:"key",input:r,key:i,value:r[i]}]});break}}}else A(this,"type",s,n);return s}})}function m(t){return _({kind:"schema",type:"string",reference:m,expects:"string",async:!1,message:t,"~run"(e,s){return typeof e.value=="string"?e.typed=!0:A(this,"type",e,s),e}})}function Pn(t){let e;if(t)for(const s of t)if(e)for(const n of s.issues)e.push(n);else e=s.issues;return e}function It(t,e){return _({kind:"schema",type:"union",reference:It,expects:Mt(t.map(s=>s.expects),"|"),async:!1,options:t,message:e,"~run"(s,n){let r,i,a;for(const o of this.options){const l=o["~run"]({value:s.value},n);if(l.typed)if(l.issues)i?i.push(l):i=[l];else{r=l;break}else a?a.push(l):a=[l]}if(r)return r;if(i){if(i.length===1)return i[0];A(this,"type",s,n,{issues:Pn(i)}),s.typed=!0}else{if(a?.length===1)return a[0];A(this,"type",s,n,{issues:Pn(a)})}return s}})}function V(){return _({kind:"schema",type:"unknown",reference:V,expects:"unknown",async:!1,"~run"(t){return t.typed=!0,t}})}function zn(t,e,s){return _({kind:"schema",type:"variant",reference:zn,expects:"Object",async:!1,key:t,options:e,message:s,"~run"(n,r){const i=n.value;if(i&&typeof i=="object"){let a,o=0,l=this.key,c=[];const p=(d,h)=>{for(const u of d.options){if(u.type==="variant")p(u,new Set(h).add(u.key));else{let f=!0,y=0;for(const x of h){const R=u.entries[x];if(x in i?R["~run"]({typed:!1,value:i[x]},Tn).issues:R.type!=="exact_optional"&&R.type!=="optional"&&R.type!=="nullish"){f=!1,l!==x&&(o<y||o===y&&x in i&&!(l in i))&&(o=y,l=x,c=[]),l===x&&c.push(u.entries[x].expects);break}y++}if(f){const x=u["~run"]({value:i},r);(!a||!a.typed&&x.typed)&&(a=x)}}if(a&&!a.issues)break}};if(p(this,new Set([this.key])),a)return a;A(this,"type",n,r,{input:i[l],expected:Mt(c,"|"),path:[{type:"object",origin:"value",input:i,key:l,value:i[l]}]})}else A(this,"type",n,r);return n}})}function qt(t,e,s){const n=t["~run"]({value:e},Ot());if(n.issues)throw new Ba(n.issues);return n.value}function v(...t){return _({...t[0],pipe:t,"~run"(e,s){for(const n of t)if(n.kind!=="metadata"){if(e.issues&&(n.kind==="schema"||n.kind==="transformation")){e.typed=!1;break}(!e.issues||!s.abortEarly&&!s.abortPipeEarly)&&(e=n["~run"](e,s))}return e}})}function S(t,e,s){const n=t["~run"]({value:e},Ot());return{typed:n.typed,success:!n.issues,output:n.value,issues:n.issues}}const nt=C({type:v(m(),w(1)),id:v(m(),w(1))}),Fa=v(m(),w(1),ie(/^[A-Za-z0-9_-]+$/,'ids may only contain letters, digits, "_" and "-" (a "." builds a path)')),Ka=(t,e)=>{if(e===1)return t.includes(".")?null:[t];const s=t.split(".");return s.length===e&&s.every(n=>n.length>0)?s:null},ae=C({id:v(m(),w(1)),type:v(m(),w(1)),target:nt,payload:V(),note:P(m()),createdAt:v(m(),w(1))}),Za=(t,e,s,n={})=>{const r=C({id:v(m(),w(1)),type:ue(t),target:nt,payload:s,note:P(m()),createdAt:v(m(),w(1))}),i=a=>{const o=S(ae,a);if(!o.success||o.output.type!==t)return null;const l=S(s,a.payload);return l.success?{id:o.output.id,type:t,target:o.output.target,payload:l.output,...o.output.note===void 0?{}:{note:o.output.note},createdAt:o.output.createdAt}:null};return{schema:r,mode:n.mode??"patch",targetType:e,actionType:t,payloadSchema:s,parse:i,...n.dedupeKey?{dedupeKey:n.dedupeKey}:{}}},Wa=(t,e)=>{const s=rt(t,e.type);if(s===void 0)return null;const n=s.parse(e);return n===null?null:n},Va=(t,e)=>{const s=S(t.payloadSchema,e.payload);if(!s.success)throw new Error(`invalid payload for action "${e.type}"`);return s.output},rt=(t,e)=>Object.hasOwn(t,e)?t[e]:void 0,Ga=t=>{throw new Error(`unhandled action: ${JSON.stringify(t)}`)},Ja=C({id:v(m(),w(1))}),Ya=t=>{const e=S(Ja,t.payload);return`${t.type}|${e.success?e.output.id:JSON.stringify(t.payload)}`},M=t=>`${t.type}:${t.id}`,On=t=>{const e=t.indexOf(":");return e<=0?{type:"unknown",id:t}:{type:t.slice(0,e),id:t.slice(e+1)}},Nt=(t,e)=>typeof t=="string"?On(t.includes(":")?t:`${e}:${t}`):{type:t.type,id:t.id},Qa=(t,e)=>t.type===e.type&&t.id===e.id,Mn=t=>{const e=t.normalize("NFKD").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40);return e.length>0?e:"item"},Xa=(t,e)=>{const s=Mn(t),n=new Set(e);if(!n.has(s))return s;for(let r=2;r<1e3;r+=1){const i=`${s}-${r}`;if(!n.has(i))return i}return`${s}-${Math.random().toString(36).slice(2,8)}`},jn=()=>{const t=globalThis.crypto;return t?.randomUUID?t.randomUUID():`a-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`},z="comment",oe=t=>{const[e]=t;return{path:e?.path?.map(s=>String(s.key)).join(".")??"",message:e?.message??"invalid action"}},In=C({type:v(m(),w(1)),target:It([v(m(),w(1)),nt]),payload:Le(V()),note:P(m()),id:P(v(m(),w(1))),createdAt:P(v(m(),w(1)))}),eo=(t,e)=>{const s=S(In,t);if(!s.success)return{ok:!1,issue:oe(s.issues)};const n=s.output,r=Nt(n.target,e.targetType),i={id:n.id??jn(),type:n.type,target:r,payload:n.payload??{},...n.note===void 0?{}:{note:n.note},createdAt:n.createdAt??new Date().toISOString()},a=S(e.schema,i);if(!a.success)return{ok:!1,issue:oe(a.issues)};const o=S(ae,a.output);return o.success?{ok:!0,action:o.output}:{ok:!1,issue:oe(o.issues)}},Dt=(t,e)=>e.dedupeKey?e.dedupeKey(t):e.mode!=="patch"?null:`${t.type}|${M(t.target)}`,Ut=(t,e,s)=>{const n=Dt(e,s);if(n===null)return[...t,e];const r=t.at(-1);return!r||Dt(r,s)!==n||!to(r,e)?[...t,e]:[...t.slice(0,-1),e]},to=(t,e)=>Qa(t.target,e.target),Bt=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),qn=C({id:v(m(),w(1)),type:ue(z),target:C({type:v(m(),w(1)),id:v(m(),w(1))}),payload:C({body:v(m(),w(1))}),note:P(m()),createdAt:v(m(),w(1))}),Ht={schema:qn,mode:"append",targetType:"page"},so=C({body:m()}),Pe=t=>{const e=S(so,t.payload);return e.success?e.output.body:""},Ft="element",Nn=v(m(),ie(/^[A-Z][A-Z0-9_]*$/,"component action types are CONSTANT_CASE")),Dn=st(m(),V()),no=C({type:ue(Ft),id:v(m(),ie(/^[^/]+\/.+/,"component references start with a provider id"))}),ro=C({id:v(m(),w(1)),type:Nn,target:no,payload:Dn,note:P(m()),createdAt:v(m(),w(1))}),io={schema:ro,mode:"sequence",targetType:Ft},ao=fe({type:Nn,target:v(m(),ie(/^element:[^/]+\/.+/)),payload:Le(Dn,{})}),Un=fe({id:v(m(),w(1)),title:v(m(),w(1)),summary:P(m()),tone:P(tt(["create","update","delete","move","meta"])),stale:P(tt(["unsupported-action-type","target-missing","constraint-violated"]))}),Kt=t=>{if(t.type!==Ft)return null;const e=t.id.indexOf("/");if(e<=0)return null;try{return decodeURIComponent(t.id.slice(0,e))}catch{return null}},q=t=>t.type!==z&&Kt(t.target)!==null,oo=(t,e)=>t.filter(s=>q(s)&&Kt(s.target)===e),Bn=(t,e)=>{const s=new Map(t.flatMap(n=>q(n)?[[n.id,Kt(n.target)]]:[]));return new Map(e.flatMap(n=>n.results.flatMap(r=>s.get(r.id)===n.id?[[r.id,r]]:[])))},Zt=Object.freeze({}),Wt=t=>{const e=t.startsWith("#")?t.slice(1):t;if(e.length===0)return Zt;const s=new URLSearchParams(e.startsWith("?")?e.slice(1):e),n={};for(const[r,i]of s)r.length>0&&i.length>0&&(n[r]=i);return n},ge=t=>{const e=new URLSearchParams;for(const n of Object.keys(t).sort((r,i)=>r<i?-1:r>i?1:0)){const r=t[n];r!=null&&r!==""&&e.set(n,r)}const s=e.toString();return s.length===0?"":`#${s}`},Vt=(t,e,s=[])=>{const n={...t},r=Object.keys(e).map(i=>s.indexOf(i)).filter(i=>i>=0);if(r.length>0)for(const i of s.slice(Math.min(...r)+1))Object.hasOwn(e,i)||delete n[i];for(const[i,a]of Object.entries(e))a==null||a===""?delete n[i]:n[i]=a;return n},lo=(t,e="json")=>`\`\`\`${e}
709
709
  ${t}
710
- \`\`\``,na=t=>JSON.stringify({type:t.type,target:t.target,payload:t.payload,...t.note===void 0?{}:{note:t.note}},null,2),Vt=(t,e,s)=>{const{actions:n,state:r}=t,i=new Set(t.stale.map(p=>p.action.id)),o=n.filter(p=>!i.has(p.id)),a=o.filter(p=>p.type===P),l=o.filter(p=>p.type!==P),c=[];if(c.push(`# Review draft \u2014 ${e.label}`),c.push(""),c.push(`- template: \`${e.name}\``),c.push(`- framework: \`dev-process-kit@${s}\``),c.push(`- navigation: \`${fe(t.navigation)||"(none)"}\``),c.push(`- pending: ${l.length} change(s), ${a.length} comment(s)`),t.stale.length>0&&c.push(`- stale (not applicable to the current base): ${t.stale.length}`),c.push(""),c.push("## How to apply"),c.push(""),c.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(I)&&(c.push(""),c.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.")),c.push(""),a.length>0){c.push(`## Comments (${a.length})`),c.push("");for(const[p,d]of a.entries()){const h=e.describe(d,r,t.base);c.push(`${p+1}. **${h.targetLabel}** \u2014 \`${M(d.target)}\``),c.push(` > ${Re(d).replace(/\n/g,`
710
+ \`\`\``,co=t=>JSON.stringify({type:t.type,target:t.target,payload:t.payload,...t.note===void 0?{}:{note:t.note}},null,2),Gt=(t,e,s)=>{const{actions:n,state:r}=t,i=new Set(t.stale.map(p=>p.action.id)),a=n.filter(p=>!i.has(p.id)),o=a.filter(p=>p.type===z),l=a.filter(p=>p.type!==z),c=[];if(c.push(`# Review draft \u2014 ${e.label}`),c.push(""),c.push(`- template: \`${e.name}\``),c.push(`- framework: \`dev-process-kit@${s}\``),c.push(`- navigation: \`${ge(t.navigation)||"(none)"}\``),c.push(`- pending: ${l.length} change(s), ${o.length} comment(s)`),t.stale.length>0&&c.push(`- stale (not applicable to the current base): ${t.stale.length}`),c.push(""),c.push("## How to apply"),c.push(""),c.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(q)&&(c.push(""),c.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.")),c.push(""),o.length>0){c.push(`## Comments (${o.length})`),c.push("");for(const[p,d]of o.entries()){const h=e.describe(d,r,t.base);c.push(`${p+1}. **${h.targetLabel}** \u2014 \`${M(d.target)}\``),c.push(` > ${Pe(d).replace(/\n/g,`
711
711
  > `)}`)}c.push("")}if(l.length>0){c.push(`## Requested changes (${l.length})`),c.push("");for(const[p,d]of l.entries()){const h=e.describe(d,r,t.base),u=h.summary?` \u2014 ${h.summary}`:"";c.push(`${p+1}. **${h.title}**${u}`),c.push(` target: \`${M(d.target)}\` (${d.target.type})`),c.push(` \`\`\`json
712
- ${na(d).replace(/\n/g,`
712
+ ${co(d).replace(/\n/g,`
713
713
  `)}
714
- \`\`\``)}c.push("")}if(l.length===0&&a.length===0&&(c.push("_No pending draft actions._"),c.push("")),t.stale.length>0){c.push(`## Not applicable to the current base (${t.stale.length})`),c.push(""),c.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."),c.push("");for(const[p,{action:d,reason:h}]of t.stale.entries()){const u=e.describe(d,r,t.base),f=d.type===P?Re(d):u.title;c.push(`${p+1}. \`${d.type}\` on \`${M(d.target)}\` (${h}) \u2014 ${f}`)}c.push("")}return c.push("## Canonical draft (JSON)"),c.push(""),c.push(sa(Dt(n))),c.push(""),c.join(`
715
- `)},q="0.0.11",Gt=async t=>{try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(t),!0}catch{}const e=document.activeElement,s=document.createElement("textarea");try{return s.value=t,s.setAttribute("readonly",""),s.style.position="fixed",s.style.opacity="0",document.body.append(s),s.select(),document.execCommand("copy")}catch{return!1}finally{s.remove(),e instanceof HTMLElement&&e.focus()}},Bn=Ke({en:{heading:"Review notes",rejected:"Action rejected.",commentLabel:"Review comment",commentPlaceholder:"What should change, or what you noticed (passed to the agent as an instruction)",detach:"Detach",attachTo:t=>`Attach to this ${t}`,addNote:"Add note",empty:"No draft actions yet.",emptyHint:"Comments and structural patches both land here, and survive reload via LocalStorage.",sendToClaude:"Send to Claude",copy:"Copy changes & comments",copyTitle:"Copy the review to paste it to the agent",clear:"Clear",deleteAction:"Delete this draft action",editComment:"Edit this comment",editLabel:"Edit the comment",saveEdit:"Save",cancelEdit:"Cancel",editHint:"Ctrl/Cmd + Enter to save, Esc to cancel",wholePage:"Whole page",comment:"Comment",sent:"Sent to Claude \u2713",copied:"Copied \u2713",copyFailed:"Could not copy"},ja:{heading:"\u30EC\u30D3\u30E5\u30FC\u30CE\u30FC\u30C8",rejected:"action \u3092\u53D7\u3051\u4ED8\u3051\u3089\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002",commentLabel:"\u30EC\u30D3\u30E5\u30FC\u30B3\u30E1\u30F3\u30C8",commentPlaceholder:"\u5909\u66F4\u3057\u305F\u3044\u3053\u3068 / \u6C17\u3065\u304D\u3092\u66F8\u304F\uFF08Agent \u3078\u306E\u6307\u793A\u3068\u3057\u3066\u6E21\u308B\uFF09",detach:"\u7D10\u3065\u3051\u3092\u89E3\u9664",attachTo:t=>`\u3053\u306E ${t} \u306B\u7D10\u3065\u3051\u308B`,addNote:"\u30CE\u30FC\u30C8\u3092\u8FFD\u52A0",empty:"draft action \u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002",emptyHint:"\u30B3\u30E1\u30F3\u30C8\u3082\u69CB\u9020\u306E\u5909\u66F4\u3082\u3053\u3053\u306B\u96C6\u307E\u308A\u3001LocalStorage \u306B\u6B8B\u308B\u306E\u3067\u30EA\u30ED\u30FC\u30C9\u3057\u3066\u3082\u6D88\u3048\u307E\u305B\u3093\u3002",sendToClaude:"Claude \u306B\u9001\u308B",copy:"\u5909\u66F4\u30FB\u30B3\u30E1\u30F3\u30C8\u3092\u30B3\u30D4\u30FC",copyTitle:"Review \u3092\u30B3\u30D4\u30FC\u3057\u3066 Agent \u306B\u8CBC\u308A\u4ED8\u3051\u308B",clear:"\u30AF\u30EA\u30A2",deleteAction:"\u3053\u306E draft action \u3092\u524A\u9664",editComment:"\u3053\u306E\u30B3\u30E1\u30F3\u30C8\u3092\u7DE8\u96C6",editLabel:"\u30B3\u30E1\u30F3\u30C8\u3092\u7DE8\u96C6",saveEdit:"\u4FDD\u5B58",cancelEdit:"\u30AD\u30E3\u30F3\u30BB\u30EB",editHint:"Ctrl/Cmd + Enter \u3067\u4FDD\u5B58\u3001Esc \u3067\u30AD\u30E3\u30F3\u30BB\u30EB",wholePage:"\u30DA\u30FC\u30B8\u5168\u4F53",comment:"\u30B3\u30E1\u30F3\u30C8",sent:"Claude \u306B\u9001\u308A\u307E\u3057\u305F \u2713",copied:"\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F \u2713",copyFailed:"\u30B3\u30D4\u30FC\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F"}}),ra=()=>({body:"",editing:null,attachment:{kind:"page"},copy:{kind:"idle"},copyRequest:0,send:{kind:"idle"},sendRequest:0}),Dn=t=>t.kind==="explicit"?{kind:t.resume}:t,Un=(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:Dn(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:Dn(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}}}},ia=(t,e)=>{const s=t.body.trim();return s===""?null:{target:e,body:s}},oa=t=>{if(!t.editing)return null;const e=t.editing.body.trim();return e===""?null:{id:t.editing.id,body:e}},aa={en:"English",ja:"\u65E5\u672C\u8A9E"},N=Ke({en:{review:"Review",reviewToggle:"Review / comments",useLightTheme:"Switch to light theme",useDarkTheme:"Switch to dark theme",language:"Language",versionLabel:"dev-process-kit version (reloads the page)",versionPinned:"Pinned by the page",versionLatest:t=>`${t} (latest)`,resizeSidebar:"Resize sidebar",resizeSidebarHint:"Drag to resize. Double-click to reset",collapseSidebar:"Collapse sidebar",expandSidebar:"Expand sidebar",baseDataError:"Could not read the base data (showing an empty page)",memo:"Memo",handoffTooLarge:"The review is too long to send. Copy it and paste it instead",handoffConsent:"Commenting needs your permission. Allow it, then send again",handoffForbidden:"This page cannot send to Claude. Copy the review and paste it instead",handoffClaudeUnavailable:"Could not reach the Claude session. Copy the review and paste it instead",handoffRateLimited:"Too many sends in a row. Wait a moment, then send again",handoffStorage:"Could not save the review. Copy it and paste it instead",handoffError:"Could not send. Copy the review and paste it instead",handoffLabel:"Hand the review to the agent",handoffSend:"Send to Claude",handoffSending:"Sending\u2026",handoffSent:"Sent to Claude \u2713",handoffCopy:"Copy changes & comments",handoffCopyTitle:"Copy the review to paste it to the agent",handoffCopied:"Copied \u2713",handoffCopyFailed:"Could not copy"},ja:{review:"\u30EC\u30D3\u30E5\u30FC",reviewToggle:"\u30EC\u30D3\u30E5\u30FC / \u30B3\u30E1\u30F3\u30C8",useLightTheme:"\u30E9\u30A4\u30C8\u30C6\u30FC\u30DE\u306B\u3059\u308B",useDarkTheme:"\u30C0\u30FC\u30AF\u30C6\u30FC\u30DE\u306B\u3059\u308B",language:"\u8A00\u8A9E",versionLabel:"dev-process-kit \u306E\u30D0\u30FC\u30B8\u30E7\u30F3\uFF08\u30DA\u30FC\u30B8\u3092\u518D\u8AAD\u307F\u8FBC\u307F\u3057\u307E\u3059\uFF09",versionPinned:"\u30DA\u30FC\u30B8\u6307\u5B9A\u306E\u30D0\u30FC\u30B8\u30E7\u30F3",versionLatest:t=>`${t}\uFF08\u6700\u65B0\uFF09`,resizeSidebar:"\u30B5\u30A4\u30C9\u30D0\u30FC\u306E\u5E45\u3092\u5909\u66F4",resizeSidebarHint:"\u30C9\u30E9\u30C3\u30B0\u3067\u5E45\u3092\u5909\u66F4\u3002\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u3067\u5143\u306B\u623B\u3059",collapseSidebar:"\u30B5\u30A4\u30C9\u30D0\u30FC\u3092\u6298\u308A\u305F\u305F\u3080",expandSidebar:"\u30B5\u30A4\u30C9\u30D0\u30FC\u3092\u958B\u304F",baseDataError:"base data \u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F\uFF08\u7A7A\u306E\u30DA\u30FC\u30B8\u3068\u3057\u3066\u8868\u793A\u4E2D\uFF09",memo:"\u30E1\u30E2",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"}}),la=4096,ca="reviews",Hn="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.",da=t=>new TextEncoder().encode(t).length,pa=t=>t.replace(/[\u0000-\u0008\u000B-\u001F\u007F]/g,""),ha=t=>{const e=`${Hn}
714
+ \`\`\``)}c.push("")}if(l.length===0&&o.length===0&&(c.push("_No pending draft actions._"),c.push("")),t.stale.length>0){c.push(`## Not applicable to the current base (${t.stale.length})`),c.push(""),c.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."),c.push("");for(const[p,{action:d,reason:h}]of t.stale.entries()){const u=e.describe(d,r,t.base),f=d.type===z?Pe(d):u.title;c.push(`${p+1}. \`${d.type}\` on \`${M(d.target)}\` (${h}) \u2014 ${f}`)}c.push("")}return c.push("## Canonical draft (JSON)"),c.push(""),c.push(lo(Bt(n))),c.push(""),c.join(`
715
+ `)},N="0.0.12",Jt=async t=>{try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(t),!0}catch{}const e=document.activeElement,s=document.createElement("textarea");try{return s.value=t,s.setAttribute("readonly",""),s.style.position="fixed",s.style.opacity="0",document.body.append(s),s.select(),document.execCommand("copy")}catch{return!1}finally{s.remove(),e instanceof HTMLElement&&e.focus()}},Hn=We({en:{heading:"Review notes",rejected:"Action rejected.",commentLabel:"Review comment",commentPlaceholder:"What should change, or what you noticed (passed to the agent as an instruction)",detach:"Detach",attachTo:t=>`Attach to this ${t}`,addNote:"Add note",empty:"No draft actions yet.",emptyHint:"Comments and structural patches both land here, and survive reload via LocalStorage.",sendToClaude:"Send to Claude",copy:"Copy changes & comments",copyTitle:"Copy the review to paste it to the agent",clear:"Clear",deleteAction:"Delete this draft action",editComment:"Edit this comment",editLabel:"Edit the comment",saveEdit:"Save",cancelEdit:"Cancel",editHint:"Ctrl/Cmd + Enter to save, Esc to cancel",wholePage:"Whole page",comment:"Comment",sent:"Sent to Claude \u2713",copied:"Copied \u2713",copyFailed:"Could not copy"},ja:{heading:"\u30EC\u30D3\u30E5\u30FC\u30CE\u30FC\u30C8",rejected:"action \u3092\u53D7\u3051\u4ED8\u3051\u3089\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002",commentLabel:"\u30EC\u30D3\u30E5\u30FC\u30B3\u30E1\u30F3\u30C8",commentPlaceholder:"\u5909\u66F4\u3057\u305F\u3044\u3053\u3068 / \u6C17\u3065\u304D\u3092\u66F8\u304F\uFF08Agent \u3078\u306E\u6307\u793A\u3068\u3057\u3066\u6E21\u308B\uFF09",detach:"\u7D10\u3065\u3051\u3092\u89E3\u9664",attachTo:t=>`\u3053\u306E ${t} \u306B\u7D10\u3065\u3051\u308B`,addNote:"\u30CE\u30FC\u30C8\u3092\u8FFD\u52A0",empty:"draft action \u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002",emptyHint:"\u30B3\u30E1\u30F3\u30C8\u3082\u69CB\u9020\u306E\u5909\u66F4\u3082\u3053\u3053\u306B\u96C6\u307E\u308A\u3001LocalStorage \u306B\u6B8B\u308B\u306E\u3067\u30EA\u30ED\u30FC\u30C9\u3057\u3066\u3082\u6D88\u3048\u307E\u305B\u3093\u3002",sendToClaude:"Claude \u306B\u9001\u308B",copy:"\u5909\u66F4\u30FB\u30B3\u30E1\u30F3\u30C8\u3092\u30B3\u30D4\u30FC",copyTitle:"Review \u3092\u30B3\u30D4\u30FC\u3057\u3066 Agent \u306B\u8CBC\u308A\u4ED8\u3051\u308B",clear:"\u30AF\u30EA\u30A2",deleteAction:"\u3053\u306E draft action \u3092\u524A\u9664",editComment:"\u3053\u306E\u30B3\u30E1\u30F3\u30C8\u3092\u7DE8\u96C6",editLabel:"\u30B3\u30E1\u30F3\u30C8\u3092\u7DE8\u96C6",saveEdit:"\u4FDD\u5B58",cancelEdit:"\u30AD\u30E3\u30F3\u30BB\u30EB",editHint:"Ctrl/Cmd + Enter \u3067\u4FDD\u5B58\u3001Esc \u3067\u30AD\u30E3\u30F3\u30BB\u30EB",wholePage:"\u30DA\u30FC\u30B8\u5168\u4F53",comment:"\u30B3\u30E1\u30F3\u30C8",sent:"Claude \u306B\u9001\u308A\u307E\u3057\u305F \u2713",copied:"\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F \u2713",copyFailed:"\u30B3\u30D4\u30FC\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F"}}),po=()=>({body:"",editing:null,attachment:{kind:"page"},copy:{kind:"idle"},copyRequest:0,send:{kind:"idle"},sendRequest:0}),Fn=t=>t.kind==="explicit"?{kind:t.resume}:t,Kn=(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:Fn(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:Fn(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}}}},ho=(t,e)=>{const s=t.body.trim();return s===""?null:{target:e,body:s}},uo=t=>{if(!t.editing)return null;const e=t.editing.body.trim();return e===""?null:{id:t.editing.id,body:e}},fo={en:"English",ja:"\u65E5\u672C\u8A9E"},D=We({en:{review:"Review",reviewToggle:"Review / comments",useLightTheme:"Switch to light theme",useDarkTheme:"Switch to dark theme",language:"Language",versionLabel:"dev-process-kit version (reloads the page)",versionPinned:"Pinned by the page",versionLatest:t=>`${t} (latest)`,resizeSidebar:"Resize sidebar",resizeSidebarHint:"Drag to resize. Double-click to reset",collapseSidebar:"Collapse sidebar",expandSidebar:"Expand sidebar",baseDataError:"Could not read the base data (showing an empty page)",memo:"Memo",handoffTooLarge:"The review is too long to send. Copy it and paste it instead",handoffConsent:"Commenting needs your permission. Allow it, then send again",handoffForbidden:"This page cannot send to Claude. Copy the review and paste it instead",handoffClaudeUnavailable:"Could not reach the Claude session. Copy the review and paste it instead",handoffRateLimited:"Too many sends in a row. Wait a moment, then send again",handoffStorage:"Could not save the review. Copy it and paste it instead",handoffError:"Could not send. Copy the review and paste it instead",handoffLabel:"Hand the review to the agent",handoffSend:"Send to Claude",handoffSending:"Sending\u2026",handoffSent:"Sent to Claude \u2713",handoffCopy:"Copy changes & comments",handoffCopyTitle:"Copy the review to paste it to the agent",handoffCopied:"Copied \u2713",handoffCopyFailed:"Could not copy"},ja:{review:"\u30EC\u30D3\u30E5\u30FC",reviewToggle:"\u30EC\u30D3\u30E5\u30FC / \u30B3\u30E1\u30F3\u30C8",useLightTheme:"\u30E9\u30A4\u30C8\u30C6\u30FC\u30DE\u306B\u3059\u308B",useDarkTheme:"\u30C0\u30FC\u30AF\u30C6\u30FC\u30DE\u306B\u3059\u308B",language:"\u8A00\u8A9E",versionLabel:"dev-process-kit \u306E\u30D0\u30FC\u30B8\u30E7\u30F3\uFF08\u30DA\u30FC\u30B8\u3092\u518D\u8AAD\u307F\u8FBC\u307F\u3057\u307E\u3059\uFF09",versionPinned:"\u30DA\u30FC\u30B8\u6307\u5B9A\u306E\u30D0\u30FC\u30B8\u30E7\u30F3",versionLatest:t=>`${t}\uFF08\u6700\u65B0\uFF09`,resizeSidebar:"\u30B5\u30A4\u30C9\u30D0\u30FC\u306E\u5E45\u3092\u5909\u66F4",resizeSidebarHint:"\u30C9\u30E9\u30C3\u30B0\u3067\u5E45\u3092\u5909\u66F4\u3002\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u3067\u5143\u306B\u623B\u3059",collapseSidebar:"\u30B5\u30A4\u30C9\u30D0\u30FC\u3092\u6298\u308A\u305F\u305F\u3080",expandSidebar:"\u30B5\u30A4\u30C9\u30D0\u30FC\u3092\u958B\u304F",baseDataError:"base data \u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F\uFF08\u7A7A\u306E\u30DA\u30FC\u30B8\u3068\u3057\u3066\u8868\u793A\u4E2D\uFF09",memo:"\u30E1\u30E2",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"}}),go=4096,mo="reviews",Zn="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.",ko=t=>new TextEncoder().encode(t).length,bo=t=>t.replace(/[\u0000-\u0008\u000B-\u001F\u007F]/g,""),xo=t=>{const e=`${Zn}
716
716
 
717
- ${pa(t)}`;return da(e)<=la?e:null},ua=t=>`${Hn}
717
+ ${bo(t)}`;return ko(e)<=go?e:null},vo=t=>`${Zn}
718
718
 
719
- 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).`,fa={consent_required:"consent",forbidden:"forbidden",not_granted:"forbidden",capability_disabled:"forbidden",capability_removed:"forbidden",claude_unavailable:"claude_unavailable",rate_limited:"rate_limited"},ga=t=>{const e=typeof t=="object"&&t!==null&&"code"in t?t.code:void 0;return(typeof e=="string"?fa[e]:void 0)??"error"},ma={too_large:"handoffTooLarge",consent:"handoffConsent",forbidden:"handoffForbidden",claude_unavailable:"handoffClaudeUnavailable",rate_limited:"handoffRateLimited",storage:"handoffStorage",error:"handoffError"},Jt=(t,e)=>N(e)[ma[t]],Fn=t=>t.group?`${t.group} \xB7 ${t.label}`:t.label,Kn=(t,e)=>{const{definition:s,state:n,navigation:r,derivation:i}=t,o=Bn(t.locale),a=s.currentTarget?.(n,r)??null,l=e.attachment,c=l.kind==="explicit"?s.commentTargets(n,r).find(h=>h.value===l.ref):null,p=l.kind==="explicit"?{ref:l.ref,label:c?Fn(c):l.ref}:l.kind==="current"&&a?{ref:a.value,label:Fn(a)}:{ref:`page:${s.name}`,label:o.wholePage},d=new Map(i.stale.map(h=>[h.action.id,h.reason]));return{body:e.body,target:p,attachment:l.kind==="explicit"?{kind:"explicit"}:a?{kind:"checkbox",checked:l.kind==="current",group:a.group??""}:{kind:"none"},canSubmit:e.body.trim().length>0,items:i.actions.map(h=>{const u=s.describe(h,n,i.base),f=h.type==="comment";return{id:h.id,title:f?o.comment:u.title,targetLabel:u.targetLabel,tone:f?"comment":u.tone,text:{kind:f?"comment":"summary",body:f?Re(h):u.summary??""},code:s.serialize(h),stale:d.get(h.id)??null,edit:!f||t.editable!==!0?{kind:"none"}:e.editing?.id===h.id?{kind:"editing",body:e.editing.body,canSave:e.editing.body.trim().length>0}:{kind:"available"}}}),issues:t.issues.map(h=>`${h.path?`${h.path}: `:""}${h.message}`),send:t.sendable!==!0?"hidden":i.actions.length===0||e.send.kind==="pending"?"disabled":"ready",flash:e.send.kind==="sent"?o.sent:e.send.kind==="failed"?Jt(e.send.reason,t.locale):e.copy.kind==="copied"?o.copied:e.copy.kind==="failed"?o.copyFailed:""}},ka=[Ze,$t,D`
719
+ 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).`,yo={consent_required:"consent",forbidden:"forbidden",not_granted:"forbidden",capability_disabled:"forbidden",capability_removed:"forbidden",claude_unavailable:"claude_unavailable",rate_limited:"rate_limited"},wo=t=>{const e=typeof t=="object"&&t!==null&&"code"in t?t.code:void 0;return(typeof e=="string"?yo[e]:void 0)??"error"},$o={too_large:"handoffTooLarge",consent:"handoffConsent",forbidden:"handoffForbidden",claude_unavailable:"handoffClaudeUnavailable",rate_limited:"handoffRateLimited",storage:"handoffStorage",error:"handoffError"},Yt=(t,e)=>D(e)[$o[t]],Wn=t=>t.group?`${t.group} \xB7 ${t.label}`:t.label,Vn=(t,e)=>{const{definition:s,state:n,navigation:r,derivation:i}=t,a=Hn(t.locale),o=s.currentTarget?.(n,r)??null,l=e.attachment,c=l.kind==="explicit"?s.commentTargets(n,r).find(h=>h.value===l.ref):null,p=l.kind==="explicit"?{ref:l.ref,label:c?Wn(c):l.ref}:l.kind==="current"&&o?{ref:o.value,label:Wn(o)}:{ref:`page:${s.name}`,label:a.wholePage},d=new Map(i.stale.map(h=>[h.action.id,h.reason]));return{body:e.body,target:p,attachment:l.kind==="explicit"?{kind:"explicit"}:o?{kind:"checkbox",checked:l.kind==="current",group:o.group??""}:{kind:"none"},canSubmit:e.body.trim().length>0,items:i.actions.map(h=>{const u=s.describe(h,n,i.base),f=h.type==="comment";return{id:h.id,title:f?a.comment:u.title,targetLabel:u.targetLabel,tone:f?"comment":u.tone,text:{kind:f?"comment":"summary",body:f?Pe(h):u.summary??""},code:s.serialize(h),stale:d.get(h.id)??null,edit:!f||t.editable!==!0?{kind:"none"}:e.editing?.id===h.id?{kind:"editing",body:e.editing.body,canSave:e.editing.body.trim().length>0}:{kind:"available"}}}),issues:t.issues.map(h=>`${h.path?`${h.path}: `:""}${h.message}`),send:t.sendable!==!0?"hidden":i.actions.length===0||e.send.kind==="pending"?"disabled":"ready",flash:e.send.kind==="sent"?a.sent:e.send.kind==="failed"?Yt(e.send.reason,t.locale):e.copy.kind==="copied"?a.copied:e.copy.kind==="failed"?a.copyFailed:""}},So=[Ve,St,B`
720
720
  :host {
721
721
  display: flex;
722
722
  flex-direction: column;
@@ -1095,218 +1095,25 @@ The brief is too long for a comment, so it is stored in this artifact's database
1095
1095
  letter-spacing: 0.04em;
1096
1096
  color: var(--dpk-green);
1097
1097
  }
1098
- `],Zn=(t,e,s)=>{const n=new Map;for(let r=e;r<=s;r++)n.set(t[r],r);return n},Wn=De(class extends Ue{constructor(t){if(super(t),t.type!==F.CHILD)throw Error("repeat() can only be used in text expressions")}dt(t,e,s){let n;s===void 0?s=e:e!==void 0&&(n=e);const r=[],i=[];let o=0;for(const a of t)r[o]=n?n(a,o):o,i[o]=s(a,o),o++;return{values:i,keys:r}}render(t,e,s){return this.dt(t,e,s).values}update(t,[e,s,n]){const r=gi(t),{values:i,keys:o}=this.dt(e,s,n);if(!Array.isArray(r))return this.ut=o,i;const a=this.ut??=[],l=[];let c,p,d=0,h=r.length-1,u=0,f=i.length-1;for(;d<=h&&u<=f;)if(r[d]===null)d++;else if(r[h]===null)h--;else if(a[d]===o[u])l[u]=X(r[d],i[u]),d++,u++;else if(a[h]===o[f])l[f]=X(r[h],i[f]),h--,f--;else if(a[d]===o[f])l[f]=X(r[d],i[f]),we(t,l[f+1],r[d]),d++,f--;else if(a[h]===o[u])l[u]=X(r[h],i[u]),we(t,r[d],r[h]),h--,u++;else if(c===void 0&&(c=Zn(o,u,f),p=Zn(a,d,h)),c.has(a[d]))if(c.has(a[h])){const y=p.get(o[u]),v=y!==void 0?r[y]:null;if(v===null){const _=we(t,r[d]);X(_,i[u]),l[u]=_}else l[u]=X(v,i[u]),we(t,r[d],v),r[y]=null;u++}else kt(r[h]),h--;else kt(r[d]),d++;for(;u<=f;){const y=we(t,l[f+1]);X(y,i[u]),l[u++]=y}for(;d<=h;){const y=r[d++];y!==null&&kt(y)}return this.ut=o,mt(t,l),z}}),Yt=()=>g`<svg
1099
- viewBox="0 0 16 16"
1100
- fill="none"
1101
- stroke="currentColor"
1102
- stroke-width="1.5"
1103
- stroke-linecap="round"
1104
- stroke-linejoin="round"
1105
- aria-hidden="true"
1106
- focusable="false"
1107
- >
1108
- <path d="M4 4l8 8M12 4l-8 8" />
1109
- </svg>`,Vn=()=>g`<svg
1110
- viewBox="0 0 16 16"
1111
- fill="none"
1112
- stroke="currentColor"
1113
- stroke-width="1.5"
1114
- stroke-linecap="round"
1115
- stroke-linejoin="round"
1116
- aria-hidden="true"
1117
- focusable="false"
1118
- >
1119
- <path d="M3.5 5h9M5.5 5V3.5a1 1 0 011-1h3a1 1 0 011 1V5" />
1120
- <path d="M5 5l.5 7.5h5L11 5" />
1121
- <path d="M6.8 7.5v3.5M9.2 7.5v3.5" />
1122
- </svg>`,Qt=()=>g`<svg
1123
- viewBox="0 0 16 16"
1124
- fill="none"
1125
- stroke="currentColor"
1126
- stroke-width="1.5"
1127
- stroke-linecap="round"
1128
- stroke-linejoin="round"
1129
- aria-hidden="true"
1130
- focusable="false"
1131
- >
1132
- <path d="M3 13l1.5-1.5M11.3 2.7a1.5 1.5 0 012.1 2.1L5.5 12.7l-3 .8.8-3z" />
1133
- </svg>`,Xt=()=>g`<svg
1134
- viewBox="0 0 16 16"
1135
- fill="none"
1136
- stroke="currentColor"
1137
- stroke-width="1.5"
1138
- stroke-linecap="round"
1139
- stroke-linejoin="round"
1140
- aria-hidden="true"
1141
- focusable="false"
1142
- >
1143
- <path d="M3.5 3.5h9a1 1 0 011 1v5a1 1 0 01-1 1H8.2l-2.7 2.2v-2.2H3.5a1 1 0 01-1-1v-5a1 1 0 011-1z" />
1144
- </svg>`,Gn=()=>g`<svg
1145
- viewBox="0 0 16 16"
1146
- fill="none"
1147
- stroke="currentColor"
1148
- stroke-width="1.5"
1149
- stroke-linecap="round"
1150
- stroke-linejoin="round"
1151
- aria-hidden="true"
1152
- focusable="false"
1153
- >
1154
- <path d="M6.5 9.5l3-3" />
1155
- <path d="M7 5.5l1-1a2.1 2.1 0 013 3l-1 1" />
1156
- <path d="M9 10.5l-1 1a2.1 2.1 0 01-3-3l1-1" />
1157
- </svg>`,ba=()=>g`<svg
1158
- viewBox="0 0 16 16"
1159
- fill="none"
1160
- stroke="currentColor"
1161
- stroke-width="1.5"
1162
- stroke-linecap="round"
1163
- stroke-linejoin="round"
1164
- aria-hidden="true"
1165
- focusable="false"
1166
- >
1167
- <rect x="5.5" y="5.5" width="7" height="7" rx="1.5" />
1168
- <path d="M10.5 5.5V4.5a1 1 0 00-1-1h-5a1 1 0 00-1 1v5a1 1 0 001 1h1" />
1169
- </svg>`,va=()=>g`<svg
1170
- viewBox="0 0 16 16"
1171
- fill="none"
1172
- stroke="currentColor"
1173
- stroke-width="1.5"
1174
- stroke-linecap="round"
1175
- stroke-linejoin="round"
1176
- aria-hidden="true"
1177
- focusable="false"
1178
- >
1179
- <path d="M3.5 8.5l3 3 6-7" />
1180
- </svg>`,Jn=()=>g`<svg
1181
- viewBox="0 0 16 16"
1182
- fill="none"
1183
- stroke="currentColor"
1184
- stroke-width="1.5"
1185
- stroke-linecap="round"
1186
- stroke-linejoin="round"
1187
- aria-hidden="true"
1188
- focusable="false"
1189
- >
1190
- <path d="M8 3.5v9M3.5 8h9" />
1191
- </svg>`,xa=()=>g`<svg viewBox="0 0 16 16" fill="currentColor" aria-hidden="true" focusable="false">
1192
- <circle cx="6.5" cy="4.5" r="1" />
1193
- <circle cx="9.5" cy="4.5" r="1" />
1194
- <circle cx="6.5" cy="8" r="1" />
1195
- <circle cx="9.5" cy="8" r="1" />
1196
- <circle cx="6.5" cy="11.5" r="1" />
1197
- <circle cx="9.5" cy="11.5" r="1" />
1198
- </svg>`,Yn=()=>g`<svg
1199
- viewBox="0 0 16 16"
1200
- fill="none"
1201
- stroke="currentColor"
1202
- stroke-width="1.5"
1203
- stroke-linecap="round"
1204
- stroke-linejoin="round"
1205
- aria-hidden="true"
1206
- focusable="false"
1207
- >
1208
- <path
1209
- d="M8 2.5v11M8 2.5L5.5 5M8 2.5l2.5 2.5M8 13.5l-2.5-2.5M8 13.5l2.5-2.5M2.5 8h11M2.5 8L5 5.5M2.5 8l2.5 2.5M13.5 8L11 5.5M13.5 8L11 10.5"
1210
- />
1211
- </svg>`,ya=()=>g`<svg
1212
- viewBox="0 0 16 16"
1213
- fill="none"
1214
- stroke="currentColor"
1215
- stroke-width="1.5"
1216
- stroke-linecap="round"
1217
- stroke-linejoin="round"
1218
- aria-hidden="true"
1219
- focusable="false"
1220
- >
1221
- <path d="M8 12.5V3.5M4.5 7L8 3.5 11.5 7" />
1222
- </svg>`,wa=()=>g`<svg
1223
- viewBox="0 0 16 16"
1224
- fill="none"
1225
- stroke="currentColor"
1226
- stroke-width="1.5"
1227
- stroke-linecap="round"
1228
- stroke-linejoin="round"
1229
- aria-hidden="true"
1230
- focusable="false"
1231
- >
1232
- <path d="M8 3.5v9M4.5 9L8 12.5 11.5 9" />
1233
- </svg>`,Qn=()=>g`<svg
1234
- viewBox="0 0 16 16"
1235
- fill="none"
1236
- stroke="currentColor"
1237
- stroke-width="1.5"
1238
- stroke-linecap="round"
1239
- stroke-linejoin="round"
1240
- aria-hidden="true"
1241
- focusable="false"
1242
- >
1243
- <path d="M10 3.5L5.5 8 10 12.5" />
1244
- </svg>`,es=()=>g`<svg
1245
- viewBox="0 0 16 16"
1246
- fill="none"
1247
- stroke="currentColor"
1248
- stroke-width="1.5"
1249
- stroke-linecap="round"
1250
- stroke-linejoin="round"
1251
- aria-hidden="true"
1252
- focusable="false"
1253
- >
1254
- <path d="M6 3.5L10.5 8 6 12.5" />
1255
- </svg>`,$a=()=>g`<svg
1256
- viewBox="0 0 16 16"
1257
- fill="none"
1258
- stroke="currentColor"
1259
- stroke-width="1.5"
1260
- stroke-linecap="round"
1261
- stroke-linejoin="round"
1262
- aria-hidden="true"
1263
- focusable="false"
1264
- >
1265
- <path d="M9.5 2.5h4v4M6.5 13.5h-4v-4M13.5 2.5L9 7M2.5 13.5L7 9" />
1266
- </svg>`,Sa=()=>g`<svg
1267
- viewBox="0 0 16 16"
1268
- fill="none"
1269
- stroke="currentColor"
1270
- stroke-width="1.5"
1271
- stroke-linecap="round"
1272
- stroke-linejoin="round"
1273
- aria-hidden="true"
1274
- focusable="false"
1275
- >
1276
- <path d="M13.5 7h-4.5v-4.5M2.5 9h4.5v4.5M9 7l4.5-4.5M7 9l-4.5 4.5" />
1277
- </svg>`,Aa=()=>g`<svg
1278
- viewBox="0 0 16 16"
1279
- fill="none"
1280
- stroke="currentColor"
1281
- stroke-width="1.5"
1282
- stroke-linecap="round"
1283
- stroke-linejoin="round"
1284
- aria-hidden="true"
1285
- focusable="false"
1286
- >
1287
- <circle cx="8" cy="8" r="2.75" />
1288
- <path
1289
- d="M8 1.5v1.5M8 13v1.5M1.5 8H3M13 8h1.5M3.4 3.4l1.06 1.06M11.54 11.54l1.06 1.06M3.4 12.6l1.06-1.06M11.54 4.46l1.06-1.06"
1290
- />
1291
- </svg>`,Ca=()=>g`<svg
1292
- viewBox="0 0 16 16"
1293
- fill="none"
1294
- stroke="currentColor"
1295
- stroke-width="1.5"
1296
- stroke-linecap="round"
1297
- stroke-linejoin="round"
1298
- aria-hidden="true"
1299
- focusable="false"
1300
- >
1301
- <path d="M13.5 9.6A5.75 5.75 0 016.4 2.5a5.75 5.75 0 107.1 7.1z" />
1302
- </svg>`,Ta=t=>{switch(t){case"comment":return Xt();case"create":return Jn();case"update":return Qt();case"delete":return Vn();case"move":return Yn();default:return Gn()}},Ea=(t,e,s,n=!1)=>g`
1303
- ${n?m:g`<header><h2>${t.heading}</h2></header>`}
1304
- ${e.issues.length>0?g`<div class="issues" role="alert">
1098
+ `],Gn=(t,e,s)=>{const n=new Map;for(let r=e;r<=s;r++)n.set(t[r],r);return n},Jn=$e(class extends He{constructor(t){if(super(t),t.type!==K.CHILD)throw Error("repeat() can only be used in text expressions")}dt(t,e,s){let n;s===void 0?s=e:e!==void 0&&(n=e);const r=[],i=[];let a=0;for(const o of t)r[a]=n?n(o,a):a,i[a]=s(o,a),a++;return{values:i,keys:r}}render(t,e,s){return this.dt(t,e,s).values}update(t,[e,s,n]){const r=wi(t),{values:i,keys:a}=this.dt(e,s,n);if(!Array.isArray(r))return this.ut=a,i;const o=this.ut??=[],l=[];let c,p,d=0,h=r.length-1,u=0,f=i.length-1;for(;d<=h&&u<=f;)if(r[d]===null)d++;else if(r[h]===null)h--;else if(o[d]===a[u])l[u]=ee(r[d],i[u]),d++,u++;else if(o[h]===a[f])l[f]=ee(r[h],i[f]),h--,f--;else if(o[d]===a[f])l[f]=ee(r[d],i[f]),Se(t,l[f+1],r[d]),d++,f--;else if(o[h]===a[u])l[u]=ee(r[h],i[u]),Se(t,r[d],r[h]),h--,u++;else if(c===void 0&&(c=Gn(a,u,f),p=Gn(o,d,h)),c.has(o[d]))if(c.has(o[h])){const y=p.get(a[u]),x=y!==void 0?r[y]:null;if(x===null){const R=Se(t,r[d]);ee(R,i[u]),l[u]=R}else l[u]=ee(x,i[u]),Se(t,r[d],x),r[y]=null;u++}else xt(r[h]),h--;else xt(r[d]),d++;for(;u<=f;){const y=Se(t,l[f+1]);ee(y,i[u]),l[u++]=y}for(;d<=h;){const y=r[d++];y!==null&&xt(y)}return this.ut=a,bt(t,l),O}});class Qt extends Fe{}Qt.directiveName="unsafeSVG",Qt.resultType=2;const Ao=$e(Qt),Yn=[["path",{d:"M12 5v14"}],["path",{d:"m19 12-7 7-7-7"}]],Qn=[["path",{d:"m12 19-7-7 7-7"}],["path",{d:"M19 12H5"}]],Xn=[["path",{d:"M5 12h14"}],["path",{d:"m12 5 7 7-7 7"}]],er=[["path",{d:"m5 12 7-7 7 7"}],["path",{d:"M12 19V5"}]],To=[["path",{d:"M20 6 9 17l-5-5"}]],Co=[["path",{d:"m6 9 6 6 6-6"}]],Eo=[["path",{d:"m15 18-6-6 6-6"}]],_o=[["path",{d:"m9 18 6-6-6-6"}]],Ro=[["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"}]],Lo=[["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"}]],Po=[["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"}]],zo=[["path",{d:"M15 3h6v6"}],["path",{d:"m21 3-7 7"}],["path",{d:"m3 21 7-7"}],["path",{d:"M9 21H3v-6"}]],Oo=[["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"}]],Mo=[["path",{d:"m14 10 7-7"}],["path",{d:"M20 10h-6V4"}],["path",{d:"m3 21 7-7"}],["path",{d:"M4 14h6v6"}]],jo=[["path",{d:"M5 12h14"}]],Io=[["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"}]],qo=[["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"}]],No=[["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"}]],Do=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]],Uo=[["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"}]],Bo=[["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"}]],Ho=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]],Fo=t=>t.replaceAll("&","&amp;").replaceAll('"',"&quot;"),Ko=t=>t.map(([e,s])=>`<${e}${Object.entries(s).map(([n,r])=>` ${n}="${Fo(String(r))}"`).join("")}></${e}>`).join(""),T=t=>{const e=Ko(t);return()=>k`<svg
1099
+ viewBox="0 0 24 24"
1100
+ fill="none"
1101
+ stroke="currentColor"
1102
+ stroke-width="2"
1103
+ stroke-linecap="round"
1104
+ stroke-linejoin="round"
1105
+ aria-hidden="true"
1106
+ focusable="false"
1107
+ >
1108
+ ${Ao(e)}
1109
+ </svg>`},Xt=T(Ho),tr=T(Bo),es=T(No),ts=T(Oo),sr=T(Po),Zo=T(Ro),Wo=T(To),nr=T(Do),Vo=T(jo),Go=T(Lo),rr=T(qo),Jo=T(er),Yo=T(Yn);T(Qn),T(Xn);const ir=T(Eo),ss=T(_o),Qo=T(Co),Xo=T(zo),el=T(Mo),tl=T(Uo),sl=T(Io),nl=t=>{switch(t){case"comment":return ts();case"create":return nr();case"update":return es();case"delete":return tr();case"move":return rr();default:return sr()}},rl=(t,e,s,n=!1)=>k`
1110
+ ${n?g:k`<header><h2>${t.heading}</h2></header>`}
1111
+ ${e.issues.length>0?k`<div class="issues" role="alert">
1305
1112
  <strong>${t.rejected}</strong>
1306
1113
  <ul>
1307
- ${e.issues.map(r=>g`<li>${r}</li>`)}
1114
+ ${e.issues.map(r=>k`<li>${r}</li>`)}
1308
1115
  </ul>
1309
- </div>`:m}
1116
+ </div>`:g}
1310
1117
  <div class="composer">
1311
1118
  <textarea
1312
1119
  class="dpk-textarea"
@@ -1316,11 +1123,11 @@ The brief is too long for a comment, so it is stored in this artifact's database
1316
1123
  @input=${r=>{r.currentTarget instanceof HTMLTextAreaElement&&s({kind:"input",body:r.currentTarget.value})}}
1317
1124
  @keydown=${r=>{!r.isComposing&&r.key==="Enter"&&(r.metaKey||r.ctrlKey)&&(r.preventDefault(),s({kind:"submit"}))}}
1318
1125
  ></textarea>
1319
- ${e.attachment.kind==="explicit"?g`<div class="row">
1126
+ ${e.attachment.kind==="explicit"?k`<div class="row">
1320
1127
  <button class="chip" type="button" aria-label=${t.detach} @click=${()=>s({kind:"clear-target"})}>
1321
- ${e.target.label} ${Yt()}
1128
+ ${e.target.label} ${Xt()}
1322
1129
  </button>
1323
- </div>`:e.attachment.kind==="checkbox"?g`<div class="row">
1130
+ </div>`:e.attachment.kind==="checkbox"?k`<div class="row">
1324
1131
  <label class="attach">
1325
1132
  <input
1326
1133
  type="checkbox"
@@ -1329,7 +1136,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
1329
1136
  />
1330
1137
  <span>${t.attachTo(e.attachment.group)}</span>
1331
1138
  </label>
1332
- </div>`:m}
1139
+ </div>`:g}
1333
1140
  <div class="row">
1334
1141
  <span class="target-line">→ ${e.target.label}</span>
1335
1142
  <button
@@ -1343,16 +1150,16 @@ The brief is too long for a comment, so it is stored in this artifact's database
1343
1150
  </div>
1344
1151
  </div>
1345
1152
  <ul class="list">
1346
- ${e.items.length===0?g`<li class="empty">
1153
+ ${e.items.length===0?k`<li class="empty">
1347
1154
  <div class="empty-box">
1348
- ${Xt()}
1155
+ ${ts()}
1349
1156
  <p>${t.empty}</p>
1350
1157
  <p class="empty-hint">${t.emptyHint}</p>
1351
1158
  </div>
1352
- </li>`:Wn(e.items,r=>r.id,r=>_a(t,r,s))}
1159
+ </li>`:Jn(e.items,r=>r.id,r=>il(t,r,s))}
1353
1160
  </ul>
1354
1161
  <footer>
1355
- ${n||e.send==="hidden"?m:g`<button
1162
+ ${n||e.send==="hidden"?g:k`<button
1356
1163
  class="dpk-btn dpk-btn--accent"
1357
1164
  type="button"
1358
1165
  ?disabled=${e.send==="disabled"}
@@ -1361,7 +1168,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
1361
1168
  ${t.sendToClaude}
1362
1169
  </button>`}
1363
1170
  <div class="footer-actions">
1364
- ${n?m:g`<button
1171
+ ${n?g:k`<button
1365
1172
  class=${e.send==="hidden"?"dpk-btn dpk-btn--accent":"dpk-btn"}
1366
1173
  type="button"
1367
1174
  title=${t.copyTitle}
@@ -1379,37 +1186,37 @@ The brief is too long for a comment, so it is stored in this artifact's database
1379
1186
  ${t.clear}
1380
1187
  </button>
1381
1188
  </div>
1382
- ${e.flash?g`<span class="flash" role="status">${e.flash}</span>`:m}
1189
+ ${e.flash?k`<span class="flash" role="status">${e.flash}</span>`:g}
1383
1190
  </footer>
1384
- `,_a=(t,e,s)=>g`
1191
+ `,il=(t,e,s)=>k`
1385
1192
  <li class="item" data-tone=${e.tone} data-stale=${String(e.stale!==null)} data-id=${e.id}>
1386
1193
  <div class="item-head">
1387
- <span class="item-icon">${Ta(e.tone)}</span>
1194
+ <span class="item-icon">${nl(e.tone)}</span>
1388
1195
  <span class="item-title">${e.title}</span>
1389
- ${e.stale?g`<span class="stale-badge">${e.stale}</span>`:m}
1390
- ${e.edit.kind==="available"?g`<button
1196
+ ${e.stale?k`<span class="stale-badge">${e.stale}</span>`:g}
1197
+ ${e.edit.kind==="available"?k`<button
1391
1198
  class="dpk-icon-btn item-edit"
1392
1199
  type="button"
1393
1200
  aria-label=${t.editComment}
1394
1201
  title=${t.editComment}
1395
1202
  @click=${()=>s({kind:"edit-start",id:e.id,body:e.text.body})}
1396
1203
  >
1397
- ${Qt()}
1398
- </button>`:m}
1204
+ ${es()}
1205
+ </button>`:g}
1399
1206
  <button
1400
1207
  class="dpk-icon-btn"
1401
1208
  type="button"
1402
1209
  aria-label=${t.deleteAction}
1403
1210
  @click=${()=>s({kind:"delete",id:e.id})}
1404
1211
  >
1405
- ${Yt()}
1212
+ ${Xt()}
1406
1213
  </button>
1407
1214
  </div>
1408
1215
  <div class="item-target">${e.targetLabel}</div>
1409
- ${e.edit.kind==="editing"?Ra(t,e.edit,s):e.text.kind==="comment"?g`<p class="item-body">${e.text.body}</p>`:e.text.body?g`<div class="item-summary">${e.text.body}</div>`:m}
1216
+ ${e.edit.kind==="editing"?al(t,e.edit,s):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>`:g}
1410
1217
  <code class="item-code">${e.code}</code>
1411
1218
  </li>
1412
- `,Ra=(t,e,s)=>g`
1219
+ `,al=(t,e,s)=>k`
1413
1220
  <div class="item-editor">
1414
1221
  <textarea
1415
1222
  class="dpk-textarea"
@@ -1433,8 +1240,8 @@ The brief is too long for a comment, so it is stored in this artifact's database
1433
1240
  </button>
1434
1241
  </div>
1435
1242
  </div>
1436
- `;class Xn extends H{static{this.styles=ka}static{this.properties={definition:{attribute:!1},state:{attribute:!1},navigation:{attribute:!1},derivation:{attribute:!1},issues:{attribute:!1},pendingTarget:{attribute:!1},onDelete:{attribute:!1},onClear:{attribute:!1},onComment:{attribute:!1},onEditComment:{attribute:!1},exportBrief:{attribute:!1},sendToClaude:{attribute:!1},embedded:{type:Boolean}}}#e=ra();#i=null;#n=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}willUpdate(e){e.has("pendingTarget")&&this.pendingTarget&&(this.#e=Un(this.#e,{kind:"target-requested",ref:this.pendingTarget}))}updated(e){e.has("pendingTarget")&&this.pendingTarget&&this.isConnected&&this.renderRoot.querySelector("textarea")?.focus();const s=this.#i;s&&(this.#i=null,[...this.renderRoot.querySelectorAll(".item")].find(r=>r.dataset.id===s.id)?.querySelector(s.kind==="editor"?".item-editor textarea":".item-edit")?.focus())}#r(){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.#n.locale}}render(){const e=this.#r();return e?Ea(Bn(this.#n.locale),Kn(e,this.#e),this.#s,this.embedded):m}#t(e){this.#e=Un(this.#e,e),this.requestUpdate()}#s=e=>{switch(e.kind){case"delete":this.onDelete?.(e.id);return;case"clear":this.onClear?.();return;case"copy":this.#a();return;case"send":this.#o();return;case"edit-start":this.#i={kind:"editor",id:e.id},this.#t(e);return;case"edit-cancel":{const s=this.#e.editing;s&&(this.#i={kind:"edit-button",id:s.id}),this.#t(e);return}case"edit-save":{const s=oa(this.#e);if(!s||!this.onEditComment||!this.onEditComment(s.id,s.body).ok)return;this.#i={kind:"edit-button",id:s.id},this.#t({kind:"edited"});return}case"submit":{const s=this.#r();if(!s||!this.onComment)return;const n=ia(this.#e,Kn(s,this.#e).target.ref);if(!n||!this.onComment(n.target,n.body).ok)return;this.#t({kind:"submitted"});return}default:this.#t(e)}};async#o(){const e=this.sendToClaude;if(!e||this.#e.send.kind==="pending")return;this.#t({kind:"send-started"});const s=this.#e.sendRequest,n=await e().catch(()=>({ok:!1,reason:"error"}));this.isConnected&&this.#t({kind:"send-finished",request:s,outcome:n})}async#a(){const e=this.#r();if(!e)return;this.#t({kind:"copy-started"});const s=this.#e.copyRequest;try{const n=this.exportBrief?.()??Vt({...e.derivation,navigation:e.navigation,issues:e.issues},e.definition,q),r=await Gt(n);this.isConnected&&this.#t({kind:"copy-finished",request:s,ok:r})}catch{this.isConnected&&this.#t({kind:"copy-finished",request:s,ok:!1})}}}const La=()=>{customElements.get("dpk-component-comment-panel")||customElements.define("dpk-component-comment-panel",Xn)},er=(t,e,s)=>{typeof window>"u"||Object.assign(window,{devProcessKit:{version:t,templates:e,versionParam:s}})},Le="dpk-version",tr="version",Pa=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/,nt=t=>Pa.test(t),za="https://cdn.jsdelivr.net/npm/dev-process-kit@",sr="https://data.jsdelivr.com/v1/packages/npm/dev-process-kit",ts=t=>{const e=new URLSearchParams(t),s=e.get(Le)??e.get(tr);return s!==null&&nt(s)?s:null},Ma=(t,e)=>{const s=ts(t);return s===null||s===e?null:s},Oa=(t,e)=>{if(!nt(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`${za}${t}/dist/${e}`},ja=(t,e)=>{const s=new URL(t);return s.searchParams.delete(tr),e===null?s.searchParams.delete(Le):s.searchParams.set(Le,e),s.href},Ia=C({tags:_e(et(k(),W()),{}),versions:Z(C({version:k()}))}),qa=t=>{const e=It(Ia,t),s=e.tags.latest;return{latest:typeof s=="string"&&nt(s)?s:null,versions:e.versions.map(n=>n.version).filter(nt)}},nr=t=>{const e=t.published?.versions??[],s=e.includes(t.current)?e:[t.current,...e],n=t.published?.latest??null;return{value:t.current,options:[...t.requested?[{value:"",label:t.text.pinned}]:[],...s.map(r=>({value:r,label:r===n&&r!==t.current?t.text.latest(r):r}))]}};let rt;const rr=()=>(rt??=fetch(sr).then(async t=>{if(!t.ok)throw new Error(`${sr} answered ${t.status}`);return qa(await t.json())}),rt.catch(()=>{rt=void 0}),rt),ir=t=>{location.assign(ja(location.href,t))},Na=t=>import(t),Ba=({entry:t,templates:e,register:s,importModule:n=Na})=>{const r=()=>{s(),er(q,e,Le)},i=typeof location>"u"?null:Ma(location.search,q);if(i===null){r();return}n(Oa(i,t)).then(()=>{Da()||Ha(i)},o=>{console.error(`dev-process-kit@${i} could not be loaded; running ${q}`,o),r()})},Da=()=>{const t=Reflect.get(window,"devProcessKit");return typeof t=="object"&&t!==null&&"versionParam"in t},ss="dpk-version-fallback",Ua=`
1437
- .${ss} {
1243
+ `;class ar extends F{static{this.styles=So}static{this.properties={definition:{attribute:!1},state:{attribute:!1},navigation:{attribute:!1},derivation:{attribute:!1},issues:{attribute:!1},pendingTarget:{attribute:!1},onDelete:{attribute:!1},onClear:{attribute:!1},onComment:{attribute:!1},onEditComment:{attribute:!1},exportBrief:{attribute:!1},sendToClaude:{attribute:!1},embedded:{type:Boolean}}}#e=po();#i=null;#n=new $t(this);constructor(){super(),this.embedded=!1,this.definition=null,this.state=void 0,this.navigation={},this.derivation=null,this.issues=[],this.pendingTarget=null}willUpdate(e){e.has("pendingTarget")&&this.pendingTarget&&(this.#e=Kn(this.#e,{kind:"target-requested",ref:this.pendingTarget}))}updated(e){e.has("pendingTarget")&&this.pendingTarget&&this.isConnected&&this.renderRoot.querySelector("textarea")?.focus();const s=this.#i;s&&(this.#i=null,[...this.renderRoot.querySelectorAll(".item")].find(r=>r.dataset.id===s.id)?.querySelector(s.kind==="editor"?".item-editor textarea":".item-edit")?.focus())}#r(){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.#n.locale}}render(){const e=this.#r();return e?rl(Hn(this.#n.locale),Vn(e,this.#e),this.#s,this.embedded):g}#t(e){this.#e=Kn(this.#e,e),this.requestUpdate()}#s=e=>{switch(e.kind){case"delete":this.onDelete?.(e.id);return;case"clear":this.onClear?.();return;case"copy":this.#o();return;case"send":this.#a();return;case"edit-start":this.#i={kind:"editor",id:e.id},this.#t(e);return;case"edit-cancel":{const s=this.#e.editing;s&&(this.#i={kind:"edit-button",id:s.id}),this.#t(e);return}case"edit-save":{const s=uo(this.#e);if(!s||!this.onEditComment||!this.onEditComment(s.id,s.body).ok)return;this.#i={kind:"edit-button",id:s.id},this.#t({kind:"edited"});return}case"submit":{const s=this.#r();if(!s||!this.onComment)return;const n=ho(this.#e,Vn(s,this.#e).target.ref);if(!n||!this.onComment(n.target,n.body).ok)return;this.#t({kind:"submitted"});return}default:this.#t(e)}};async#a(){const e=this.sendToClaude;if(!e||this.#e.send.kind==="pending")return;this.#t({kind:"send-started"});const s=this.#e.sendRequest,n=await e().catch(()=>({ok:!1,reason:"error"}));this.isConnected&&this.#t({kind:"send-finished",request:s,outcome:n})}async#o(){const e=this.#r();if(!e)return;this.#t({kind:"copy-started"});const s=this.#e.copyRequest;try{const n=this.exportBrief?.()??Gt({...e.derivation,navigation:e.navigation,issues:e.issues},e.definition,N),r=await Jt(n);this.isConnected&&this.#t({kind:"copy-finished",request:s,ok:r})}catch{this.isConnected&&this.#t({kind:"copy-finished",request:s,ok:!1})}}}const ol=()=>{customElements.get("dpk-component-comment-panel")||customElements.define("dpk-component-comment-panel",ar)},or=(t,e,s)=>{typeof window>"u"||Object.assign(window,{devProcessKit:{version:t,templates:e,versionParam:s}})},ze="dpk-version",lr="version",ll=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/,it=t=>ll.test(t),cl="https://cdn.jsdelivr.net/npm/dev-process-kit@",cr="https://data.jsdelivr.com/v1/packages/npm/dev-process-kit",ns=t=>{const e=new URLSearchParams(t),s=e.get(ze)??e.get(lr);return s!==null&&it(s)?s:null},dl=(t,e)=>{const s=ns(t);return s===null||s===e?null:s},pl=(t,e)=>{if(!it(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`${cl}${t}/dist/${e}`},hl=(t,e)=>{const s=new URL(t);return s.searchParams.delete(lr),e===null?s.searchParams.delete(ze):s.searchParams.set(ze,e),s.href},ul=C({tags:Le(st(m(),V()),{}),versions:W(C({version:m()}))}),fl=t=>{const e=qt(ul,t),s=e.tags.latest;return{latest:typeof s=="string"&&it(s)?s:null,versions:e.versions.map(n=>n.version).filter(it)}},dr=t=>{const e=t.published?.versions??[],s=e.includes(t.current)?e:[t.current,...e],n=t.published?.latest??null;return{value:t.current,options:[...t.requested?[{value:"",label:t.text.pinned}]:[],...s.map(r=>({value:r,label:r===n&&r!==t.current?t.text.latest(r):r}))]}};let at;const pr=()=>(at??=fetch(cr).then(async t=>{if(!t.ok)throw new Error(`${cr} answered ${t.status}`);return fl(await t.json())}),at.catch(()=>{at=void 0}),at),hr=t=>{location.assign(hl(location.href,t))},gl=t=>import(t),ml=({entry:t,templates:e,register:s,importModule:n=gl})=>{const r=()=>{s(),or(N,e,ze)},i=typeof location>"u"?null:dl(location.search,N);if(i===null){r();return}n(pl(i,t)).then(()=>{kl()||xl(i)},a=>{console.error(`dev-process-kit@${i} could not be loaded; running ${N}`,a),r()})},kl=()=>{const t=Reflect.get(window,"devProcessKit");return typeof t=="object"&&t!==null&&"versionParam"in t},rs="dpk-version-fallback",bl=`
1244
+ .${rs} {
1438
1245
  flex: none;
1439
1246
  height: 24px;
1440
1247
  margin-left: auto;
@@ -1452,7 +1259,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
1452
1259
  letter-spacing: 0.02em;
1453
1260
  cursor: pointer;
1454
1261
  }
1455
- `,Ha=t=>{const e=[...document.body.querySelectorAll("*")].filter(s=>s.localName.startsWith("dpk-template-")&&!s.querySelector(`:scope > .${ss}`));if(e.length!==0){document.head.append(Object.assign(document.createElement("style"),{textContent:Ua}));for(const s of e)s.append(Fa(s,t))}},Fa=(t,e)=>{const s=N(Fe(He(t))),n=document.createElement("select");n.className=ss,n.slot="header",n.setAttribute("aria-label",s.versionLabel),n.title=s.versionLabel;const r=o=>{const a=nr({current:e,requested:ts(location.search)!==null,published:o,text:{pinned:s.versionPinned,latest:s.versionLatest}});n.replaceChildren(...a.options.map(l=>Object.assign(document.createElement("option"),{value:l.value,textContent:l.label}))),n.value=a.value},i=()=>{rr().then(r,o=>console.warn(o))};return n.addEventListener("pointerenter",i,{once:!0}),n.addEventListener("focus",i,{once:!0}),n.addEventListener("change",()=>ir(n.value===""?null:n.value)),r(null),n},Ka=C({value:k()}),Za=t=>e=>{if(!(e instanceof CustomEvent))return;const s=S(Ka,e.detail);s.success&&t(s.output.value)},ns=t=>e=>{const s=ce(e.target,HTMLSelectElement);s!==null&&t(s.value)},Wa=t=>e=>{const s=ce(e.target,HTMLInputElement);s!==null&&t(s.checked)},Pe=t=>t==="light"||t==="dark"?t:null,or=t=>t.authored??t.environment,ar=t=>t.preference??or(t),Va=t=>{const e=ar(t)==="dark"?"light":"dark";return e===or(t)?null:e},lr=Z(ue({value:x(k(),re(/^element:.+/)),label:x(k(),w(1)),group:L(k())})),Ga=C({targets:lr,providers:Z(C({id:x(k(),w(1)),results:Z(qn)}))}),Ja=ue({target:x(k(),re(/^element:.+/)),body:x(k(),Ot(),w(1))}),cr=t=>t.group?`${t.group} \xB7 ${t.label}`:t.label,dr=(t,e,s)=>{const n=new Map(e.map(r=>[r.value,r]));return{...t,hasTarget:(r,i)=>t.hasTarget(r,i)||n.has(M(i)),commentTargets:(r,i)=>{const o=t.commentTargets(r,i),a=new Set(o.map(l=>l.value));return[...o,...e.filter(l=>!a.has(l.value))]},describe:(r,i,o)=>{if(I(r)){const c=s.get(r.id),p=n.get(M(r.target));return{title:c?.title??r.type,...c?.summary===void 0?{}:{summary:c.summary},tone:c?.tone??"update",targetLabel:p?cr(p):r.target.id}}const a=t.describe(r,i,o),l=r.type==="comment"&&!t.hasTarget(i,r.target)?n.get(M(r.target)):void 0;return l===void 0?a:{...a,targetLabel:cr(l)}},serialize:r=>I(r)?`${r.type} ${M(r.target)} ${JSON.stringify(r.payload)}`:t.serialize(r)}},pr=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function hr(t){return typeof pr.Buffer<"u"&&pr.Buffer.isBuffer(t)}function ur(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 fr(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function gr(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const Ya="[object RegExp]",Qa="[object String]",Xa="[object Number]",el="[object Boolean]",tl="[object Symbol]",sl="[object Date]",nl="[object Map]",rl="[object Set]",il="[object Array]",ol="[object Function]",al="[object ArrayBuffer]",rs="[object Object]",ll="[object Error]",cl="[object DataView]",dl="[object Uint8Array]",pl="[object Uint8ClampedArray]",hl="[object Uint16Array]",ul="[object Uint32Array]",fl="[object BigUint64Array]",gl="[object Int8Array]",ml="[object Int16Array]",kl="[object Int32Array]",bl="[object BigInt64Array]",vl="[object Float32Array]",xl="[object Float64Array]";function yl(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function wl(t,e,s){return ze(t,e,void 0,void 0,void 0,void 0,s)}function ze(t,e,s,n,r,i,o){const a=o(t,e,s,n,r,i);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 Me(t,e,i,o)}return Me(t,e,i,o)}function Me(t,e,s,n){if(Object.is(t,e))return!0;let r=gr(t),i=gr(e);if(r==="[object Arguments]"&&(r=rs),i==="[object Arguments]"&&(i=rs),r!==i)return!1;switch(r){case Qa:return t.toString()===e.toString();case Xa:return yl(t.valueOf(),e.valueOf());case el:case sl:case tl:return Object.is(t.valueOf(),e.valueOf());case Ya:return t.source===e.source&&t.flags===e.flags;case ol:return t===e}s=s??new Map;const o=s.get(t),a=s.get(e);if(o!=null&&a!=null)return o===e;s.set(t,e),s.set(e,t);try{switch(r){case nl:if(t.size!==e.size)return!1;for(const[l,c]of t.entries())if(!e.has(l)||!ze(c,e.get(l),l,t,e,s,n))return!1;return!0;case rl:{if(t.size!==e.size)return!1;const l=Array.from(t.values()),c=Array.from(e.values());for(let p=0;p<l.length;p++){const d=l[p],h=c.findIndex(u=>ze(d,u,void 0,t,e,s,n));if(h===-1)return!1;c.splice(h,1)}return!0}case il:case dl:case pl:case hl:case ul:case fl:case gl:case ml:case kl:case bl:case vl:case xl:if(hr(t)!==hr(e)||t.length!==e.length)return!1;for(let l=0;l<t.length;l++)if(!ze(t[l],e[l],l,t,e,s,n))return!1;return!0;case al:return t.byteLength!==e.byteLength?!1:Me(new Uint8Array(t),new Uint8Array(e),s,n);case cl:return t.byteLength!==e.byteLength||t.byteOffset!==e.byteOffset?!1:Me(new Uint8Array(t),new Uint8Array(e),s,n);case ll:return t.name===e.name&&t.message===e.message;case rs:{if(!(Me(t.constructor,e.constructor,s,n)||ur(t)&&ur(e)))return!1;const l=[...Object.keys(t),...fr(t)],c=[...Object.keys(e),...fr(e)];if(l.length!==c.length)return!1;for(let p=0;p<l.length;p++){const d=l[p],h=t[d];if(!Object.hasOwn(e,d))return!1;const u=e[d];if(!ze(h,u,d,t,e,s,n))return!1}return!0}default:return!1}}finally{s.delete(t),s.delete(e)}}function $l(){}function it(t,e){return wl(t,e,$l)}const mr="page",kr=t=>M(t),br=(t,e,s,n=new Map)=>{let r=e;const i=[],o=[],a=[],l=[],c=new Map;for(const d of s){if(d.type===P)continue;if(I(d)){const f=n.get(d.id);f===void 0||f.stale!==void 0?o.push({action:d,reason:f?.stale??"target-missing"}):i.push(d);continue}const h=st(t.actions,d.type);if(!h){o.push({action:d,reason:"unsupported-action-type"});continue}const u=t.apply(r,d);if(u===null){o.push({action:d,reason:t.hasTarget(r,d.target)?"constraint-violated":"target-missing"});continue}if(h.mode!=="append"&&is(t,r,u)){a.push(d);continue}r=u,i.push(d)}for(const d of s){if(d.type!==P)continue;if(d.target.type!==mr&&!t.hasTarget(r,d.target)){o.push({action:d,reason:"target-missing"});continue}l.push(d);const h=kr(d.target);c.set(h,[...c.get(h)??[],d])}const p=new Map(s.map((d,h)=>[d.id,h]));return o.sort((d,h)=>(p.get(d.action.id)??0)-(p.get(h.action.id)??0)),{base:e,state:r,actions:s,applied:i,stale:o,obsolete:a,comments:l,commentsByTarget:c}},is=(t,e,s)=>e===s?!0:t.canonicalState===void 0?it(e,s):it(t.canonicalState(e),t.canonicalState(s)),vr=t=>{const e=new Set(t.obsolete.map(s=>s.id));return t.actions.filter(s=>!e.has(s.id))},Sl=(t,e,s,n)=>{let r=e;const i=n??xr(r).map(o=>o.id);for(const o of[...i].reverse())r=Al(t,r,s,o,n!==void 0)??r;return r},xr=t=>t.applied.filter(e=>!I(e)),Al=(t,e,s,n,r)=>{const i=xr(e),o=i.findIndex(h=>h.id===n),a=i[o];if(a===void 0)return null;const l=i.slice(0,o),c=[...r?Cl(t,e.base,i,o):[],...Tl(t,l,a)],p=new Set,d=c.filter(h=>{const u=h.join(" ");return p.has(u)?!1:(p.add(u),!0)}).sort((h,u)=>u.length-h.length);for(const h of d){const u=El(t,e,s,h);if(u!==null)return u}return null},Cl=(t,e,s,n)=>{const r=[];let i=e;for(const o of s.slice(0,n+1))r.push(i),i=t.apply(i,o)??i;return r.flatMap((o,a)=>is(t,o,i)?[s.slice(a,n+1).map(l=>l.id)]:[])},Tl=(t,e,s)=>{const n=yr(s),r=e.filter(l=>yr(l).some(c=>n.includes(c))),i=wr(t,s),o=r.filter(l=>wr(t,l)===i),a=l=>l.map((c,p)=>[...l.slice(p).map(d=>d.id),s.id]);return[...a(r),...a(o),...r.map(l=>[l.id,s.id]),...r.map(l=>[l.id])]},yr=t=>{const e=t.target.type===mr?[]:t.target.id.split("."),s=typeof t.payload=="object"&&t.payload!==null?Object.values(t.payload).filter(n=>typeof n=="string"&&n!==""):[];return[...e,...s]},wr=(t,e)=>st(t.actions,e.type)?.mode,El=(t,e,s,n)=>{const r=new Set(e.stale.map(o=>o.action.id)),i=new Set(n);for(;;){const o=s(e.actions.filter(l=>!i.has(l.id))),a=o.stale.filter(l=>!r.has(l.action.id)).map(l=>l.action);if(a.length===0)return is(t,o.state,e.state)?o:null;if(a.some(l=>l.type===P||I(l)))return null;for(const l of a)i.add(l.id)}},_l=C({v:he(1),template:x(k(),w(1)),actions:Z(W())});class os{constructor(e){this.storage=e}load(e,s){try{const n=this.storage.getItem(e);if(n===null)return[];const r=S(_l,JSON.parse(n));return!r.success||r.output.template!==s?[]:r.output.actions.flatMap(i=>{const o=S(ie,i);return o.success?[o.output]:[]})}catch{return[]}}save(e,s,n){const r={v:1,template:s,actions:n};try{this.storage.setItem(e,JSON.stringify(r))}catch{}}clear(e){try{this.storage.removeItem(e)}catch{}}}class as{constructor(){this.store=new Map}load(e,s){return new os({getItem:n=>this.store.get(n)??null,setItem:(n,r)=>{this.store.set(n,r)},removeItem:n=>{this.store.delete(n)}}).load(e,s)}save(e,s,n){this.store.set(e,JSON.stringify({v:1,template:s,actions:n}))}clear(e){this.store.delete(e)}}const ls=()=>{try{if(typeof localStorage<"u")return new os(localStorage)}catch{}return new as},cs=t=>`dev-process-kit:draft:${typeof location>"u"?"local":`${location.pathname}${location.search}`}:${t}`,Rl=Z(W());class $r{#e;#i;#n={targets:[],providers:[]};#r=new Map;#t;#s;#o;#a;#l;#p=new Set;#v=[];#m=0;constructor(e){this.#e=e.definition,this.#i=dr(e.definition,[],this.#r),this.#t=e.base,this.#l=e.storageKey??cs(e.definition.name),this.#a=e.storage===void 0?ls():e.storage;const s=e.initialActions??this.#a?.load(this.#l,this.definition.name)??[];this.#s=Ar(this.definition,s),this.#o=this.#d(this.#s),this.#y()&&this.#k()}get definition(){return this.#i}setComponentSnapshot(e){const s=It(Ga,e);if(!it(s,this.#n)){this.#n=s,this.#c(),this.#o=this.#d(this.#s);for(const n of this.#p)n()}}setTemplate(e){this.#e=e,this.#c(),this.#o=this.#d(this.#s);for(const s of this.#p)s()}#c(){this.#r=Nn(this.#s,this.#n.providers),this.#i=dr(this.#e,this.#n.targets,this.#r)}#d(e){return br(this.definition,this.#t,e,Nn(e,this.#n.providers))}get base(){return this.#t}get actions(){return this.#s}get derivation(){return this.#o}get lastIssues(){return this.#v}get prunedCount(){return this.#m}descriptorFor(e,s){return Sr(this.definition,e,s)}dispatch(e){const s=this.#x(e,this.#o.state);if(!s.ok)return this.#h([s.issue]);const n=this.descriptorFor(s.action.type,s.action.target);return n?(this.#u(Bt(this.#s,s.action,n),[s.action.id]),{ok:!0,id:s.action.id}):this.#h([{path:"type",message:"unknown action type"}])}dispatchBatch(e){const s=S(Rl,e);if(!s.success)return this.#h([oe(s.issues)]);const n=s.output;if(n.length===0)return{ok:!0,ids:[]};let r=this.#s,i=this.#o.state;const o=[];for(const a of n){const l=this.#x(a,i);if(!l.ok)return this.#h([l.issue]);const c=l.action,p=this.descriptorFor(c.type,c.target);if(!p)return this.#h([{path:"type",message:"unknown action type"}]);if((c.type==="comment"||I(c)?c.target.type==="page"||this.definition.hasTarget(i,c.target)?i:null:this.definition.apply(i,c))===null)return this.#h([{path:"target",message:"batch action is not applicable"}]);r=Bt(r,c,p),i=this.#d(r).state,o.push(c.id)}return this.#u(r,o),{ok:!0,ids:o}}#x(e,s){const n=S(Mn,e);if(!n.success)return{ok:!1,issue:oe(n.issues)};const r=this.descriptorFor(n.output.type,typeof n.output.target=="string"?qt(n.output.target,"page"):n.output.target);if(!r)return{ok:!1,issue:{path:"type",message:`unknown action type "${n.output.type}"`}};const i=Vo(n.output,r);if(!i.ok)return i;const o=this.definition.canonicalTarget?.(s,i.action.target)??i.action.target;return{ok:!0,action:{...i.action,target:o}}}#h(e){return this.#v=e,{ok:!1,issues:e}}editComment(e,s){const n=this.#s.find(a=>a.id===e);if(n?.type!==P)return this.#h([{path:"id",message:`no comment "${e}" in the draft`}]);if(Re(n)===s)return{ok:!0,id:e};const r=S(Ut.schema,{...n,payload:{body:s}});if(!r.success)return this.#h([oe(r.issues)]);const i=S(ie,r.output);if(!i.success)return this.#h([oe(i.issues)]);const o=i.output;return this.#u(this.#s.map(a=>a===n?o:a),[]),{ok:!0,id:e}}removeAction(e){const s=this.#s.filter(n=>n.id!==e);s.length!==this.#s.length&&this.#u(s)}clearActions(){this.#s.length>0&&this.#u([])}replaceActions(e){this.#u(Ar(this.definition,e))}setBase(e){this.#t=e,this.#u(this.#s)}subscribe(e){return this.#p.add(e),()=>{this.#p.delete(e)}}exportDraft(e){return{template:this.definition.name,frameworkVersion:e,exportedAt:new Date().toISOString(),actions:this.#s}}#u(e,s){this.#v=[],this.#s=e,this.#c(),this.#o=this.#d(this.#s),this.#y(s),this.#k();for(const n of this.#p)n()}#y(e){const s=this.#g(),n=Sl(this.definition,this.#o,r=>this.#d(r),e);return n===this.#o?s:(this.#m+=this.#s.length-n.actions.length,this.#s=[...n.actions],this.#c(),this.#o=this.#d(this.#s),this.#g(),!0)}#g(){return this.#o.obsolete.length===0?!1:(this.#m+=this.#o.obsolete.length,this.#s=vr(this.#o),this.#c(),this.#o=this.#d(this.#s),!0)}#k(){this.#a?.save(this.#l,this.definition.name,this.#s)}}const Sr=(t,e,s)=>e==="comment"?Ut:s!==void 0&&I({type:e,target:s})?Xo:st(t.actions,e),Ar=(t,e)=>e.flatMap(s=>{const n=S(ie,s);if(!n.success)return[];const r=n.output,i=Sr(t,r.type,r.target);if(!i)return[];const o=S(i.schema,r);if(!o.success)return[];const a=S(ie,o.output);return a.success?[a.output]:[]}),Ll=()=>({status:{kind:"idle"},request:0}),Pl=(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}},zl=(t,e)=>{if(t.actions===0||t.railOpen)return null;const s=N(t.locale),n=e.status;return{send:t.sendable?{label:n.kind==="sending"?s.handoffSending:n.kind==="sent"?s.handoffSent:s.handoffSend,disabled:n.kind==="sending"}:null,copy:n.kind==="copied"?{label:s.handoffCopied,status:"copied"}:n.kind==="copy-failed"?{label:s.handoffCopyFailed,status:"failed"}:{label:s.handoffCopy,status:"idle"},note:n.kind==="send-failed"?Jt(n.reason,t.locale):null}},Cr=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()}},Ml=t=>{const e=t.derivation();return{state:e.state,base:e.base,navigation:t.navigation(),actions:t.controller().actions,comments:e.comments,stale:e.stale,commentCount:s=>{const n=typeof s=="string"?s:M(s);return e.commentsByTarget.get(n)?.length??0},dispatch:s=>t.dispatch(s),dispatchBatch:s=>t.dispatchBatch(s),navigate:(s,n)=>t.navigate(s,n),hashFor:s=>t.hashFor(s),requestComment:s=>t.requestComment(s)}},Ol=(t,e)=>{const s=()=>Cr(t);return{version:q,template:t.definition.name,host:e,ready:t.ready,get base(){return t.controller().base},get state(){return t.derivation().state},get navigation(){return t.navigation()},get actions(){return t.controller().actions},get comments(){return t.derivation().comments},get stale(){return t.derivation().stale},get issues(){return t.issues()},dispatch:n=>t.dispatch(n),dispatchBatch:n=>t.dispatchBatch(n),comment:(n,r)=>t.dispatch({type:P,target:n,payload:{body:r}}),editComment:(n,r)=>t.editComment(n,r),removeAction:n=>t.removeAction(n),clearActions:()=>t.clearActions(),importDraft:n=>t.controller().replaceActions(n),navigate:(n,r)=>t.navigate(n,r),hashFor:n=>t.hashFor(n),snapshot:s,exportDraft:()=>t.controller().exportDraft(q),exportBrief:()=>Vt(s(),t.controller().definition,q),subscribe:n=>t.subscribe(n)}},ds=(t,e)=>typeof t=="object"&&t!==null&&e.every(s=>typeof Reflect.get(t,s)=="function"),jl=t=>ds(t,["use"]),Il=t=>ds(t,["anchorFor","canSendToClaude","sendToClaude"]),ql=t=>ds(t,["collection"]),Tr=async(t,e)=>{try{return await t.use(e)}catch{return null}},Nl=(t,e)=>({async canSend(){try{return await t.canSendToClaude()==="available"}catch{return!1}},async send({brief:s,draft:n,anchor:r}){let i=ha(s);if(i===null){if(e===null)return{ok:!1,reason:"too_large"};try{const o=e.collection(ca).doc();await o.set({brief:s,draft:n,createdAt:new Date().toISOString()}),i=ua(o.path)}catch{return{ok:!1,reason:"storage"}}}try{return await t.sendToClaude({anchor:await t.anchorFor(r),text:i}),{ok:!0}}catch(o){return{ok:!1,reason:ga(o)}}}}),Bl=async t=>{if(!jl(t))return null;const[e,s]=await Promise.all([Tr(t,"comments"),Tr(t,"db")]);return Il(e)?Nl(e,ql(s)?s:null):null},Dl=()=>Reflect.get(globalThis,"claude");class Ul{#e;#i;#n=null;#r=!1;constructor(e,s=Dl){this.#e=e,this.#i=s,e.addController(this)}get available(){return this.#r}hostConnected(){this.#n??=Bl(this.#i()),this.#t(),window.addEventListener("focus",this.#t)}hostDisconnected(){window.removeEventListener("focus",this.#t)}async send(e){const s=await this.#n;if(!s)return{ok:!1,reason:"forbidden"};const n=await s.send(e);return this.#t(),n}#t=async()=>{const e=await this.#n,s=e?await e.canSend():!1;s!==this.#r&&(this.#r=s,this.#e.requestUpdate())}}const ps=(t,e)=>({read(s){try{const n=t.getItem(s);return n===null?null:e(JSON.parse(n))}catch{return null}},write(s,n){try{return t.setItem(s,JSON.stringify(n)),!0}catch{return!1}},remove(s){try{t.removeItem(s)}catch{}}}),V=t=>{const e=new Map;return ps({getItem:s=>e.get(s)??null,setItem:(s,n)=>{e.set(s,n)},removeItem:s=>{e.delete(s)}},t)},Oe=t=>{try{if(typeof localStorage<"u")return ps(localStorage,t)}catch{}return V(t)},Hl=t=>{try{if(typeof sessionStorage<"u")return ps(sessionStorage,t)}catch{}return V(t)},hs="dev-process-kit:color-scheme",Fl="(prefers-color-scheme: dark)",Er=()=>typeof matchMedia=="function"?matchMedia(Fl):null,_r=()=>Pe(document.documentElement.dataset.theme)??(Er()?.matches===!0?"dark":"light");class Kl{#e;#i;#n=null;#r=null;#t="light";#s=null;#o=null;constructor(e,s){this.#e=e,this.#i=s,e.addController(this)}hostConnected(){this.#n===null&&(this.#n=this.#i()?Oe(Pe):V(Pe),this.#r=this.#n.read(hs)),this.#t=_r(),this.#s=Er(),this.#s?.addEventListener("change",this.#l),this.#o=new MutationObserver(this.#l),this.#o.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})}hostDisconnected(){this.#s?.removeEventListener("change",this.#l),this.#s=null,this.#o?.disconnect(),this.#o=null}resolve(e){return ar(this.#a(e))}toggle(e){this.#r=Va(this.#a(e)),this.#r===null?this.#n?.remove(hs):this.#n?.write(hs,this.#r),this.#e.requestUpdate()}#a(e){return{preference:this.#r,authored:e,environment:this.#t}}#l=()=>{const e=_r();e!==this.#t&&(this.#t=e,this.#e.requestUpdate())}}const Zl=(t,e)=>{const s=[],n=r=>{(r===t||r instanceof ShadowRoot)&&e?.(r);for(const i of r.children)i.hasAttribute("data-template")||(("commentTargets"in i||"elementActions"in i)&&s.push(i),n(i),i.shadowRoot&&n(i.shadowRoot))};return n(t),s},Rr=(t,e)=>{const s=new Map;for(const n of t)s.set(e(n),(s.get(e(n))??0)+1);return t.filter(n=>s.get(e(n))===1)},Lr=t=>Rr(t.filter(e=>"elementActions"in e&&e.id.length>0),e=>e.id),Pr=(t,e)=>{for(const s of Lr(t)){const n=ta(e,s.id),r=Reflect.get(s,"elementActions");Array.isArray(r)&&r.length===n.length&&n.every((o,a)=>{const l=r[a];return typeof l=="object"&&l!==null&&"id"in l&&l.id===o.id})||Reflect.set(s,"elementActions",n)}},Wl=t=>{const e=Reflect.get(t,"elementActionResults");return Array.isArray(e)?e.flatMap(s=>{const n=S(qn,s);return n.success?[n.output]:[]}):[]},Vl=t=>{const e=[];for(const s of t){if(!("commentTargets"in s))continue;const n=S(lr,s.commentTargets);n.success&&e.push(...n.output)}return{targets:Rr(e,s=>s.value),providers:Lr(t).map(s=>({id:s.id,results:Wl(s)}))}},Gl=2400;class Jl{#e=Ll();#i=null;#n;constructor(e){this.#n=e,e.addController(this)}get state(){return this.#e}hostDisconnected(){this.#s()}async copy(e){this.#r({kind:"copy-started"});const s=this.#e.request,n=await Gt(e()).catch(()=>!1);this.#r({kind:"copy-finished",request:s,ok:n}),this.#t(s)}async send(e){if(this.#e.status.kind==="sending")return;this.#r({kind:"send-started"});const s=this.#e.request,n=await e().catch(()=>({ok:!1,reason:"error"}));this.#r({kind:"send-finished",request:s,outcome:n}),n.ok&&this.#t(s)}#r(e){(e.kind==="copy-started"||e.kind==="send-started")&&this.#s(),this.#e=Pl(this.#e,e),this.#n.requestUpdate()}#t(e){e===this.#e.request&&(this.#s(),this.#i=setTimeout(()=>{this.#i=null,this.#r({kind:"settled",request:e})},Gl))}#s(){this.#i!==null&&clearTimeout(this.#i),this.#i=null}}const us="dev-process-kit:locale";class Yl{#e;#i;#n;#r=null;#t=null;#s;#o;constructor(e,s,n){this.#e=e,this.#i=s,this.#n=n,e.addController(this)}get authored(){if(this.#s===void 0)return Fe(He(this.#e));const e=this.#e.parentNode;return Fe(this.#s??(e===null?null:He(e)))}get locale(){return this.#o??this.#a()}#a(){return mi({preference:this.#t,authored:this.authored})}hostConnected(){this.#r===null&&(this.#r=this.#i()?Oe(Ks):V(Ks),this.#t=this.#r.read(us)),this.#s??=this.#e.getAttribute("lang"),this.#l()}pick(e){this.#t=ki(e,this.authored),this.#t===null?this.#r?.remove(us):this.#r?.write(us,this.#t),this.#l(),this.#e.requestUpdate()}#l(){const e=this.#t??this.#s??null;e===null?this.#e.removeAttribute("lang"):this.#e.getAttribute("lang")!==e&&this.#e.setAttribute("lang",e);const s=this.#a();if(s===this.#o)return;const n=this.#o===void 0;this.#o=s,this.#n(),(!n||this.#t!==null)&&document.dispatchEvent(new Event(yt))}}const zr=()=>Zt(typeof location>"u"?"":location.hash),Ql=(t,e)=>{if(typeof history>"u")return;const s=`${location.pathname}${location.search}${fe(t)}`;`${location.pathname}${location.search}${location.hash}`!==s&&(e?history.replaceState(null,"",s):history.pushState(null,"",s))};class Xl{#e;#i=null;#n=0;constructor(e){this.#e=e}get orphans(){return this.#n}route(){const e=this.#e.renderRoot,s=ce(e.querySelector('slot[name="preview"]'),HTMLSlotElement);if(s===null)return;this.#i!==s&&(this.#i=s,s.addEventListener("slotchange",this.#r));const n=new Set(Array.from(e.querySelectorAll("slot")).map(i=>i.getAttribute("name")??"")),r=s.assignedElements();for(const i of r){const o=i.getAttribute("data-preview-id");if(!o)continue;const a=`preview:${o}`;i.getAttribute("slot")!==a&&n.has(a)&&i.setAttribute("slot",a)}r.length!==this.#n&&(this.#n=r.length,queueMicrotask(()=>this.#e.requestUpdate()))}#r=()=>{queueMicrotask(()=>this.route())}}const G={min:180,max:560,step:16,largeStep:64},ec={side:"left",defaultWidth:260},ot=t=>Math.round(Math.min(G.max,Math.max(G.min,t))),Mr=t=>typeof t=="number"&&Number.isFinite(t)?ot(t):null,fs=(t,e)=>t==="left"?e:-e,tc=(t,e)=>ot(t.startWidth+fs(t.side,e-t.startX)),sc=(t,e,{key:s,shiftKey:n})=>{const r=n?G.largeStep:G.step;switch(s){case"ArrowLeft":return ot(t+fs(e,-r));case"ArrowRight":return ot(t+fs(e,r));case"Home":return G.min;case"End":return G.max;default:return null}},Or=t=>typeof t=="boolean"?t:null,nc=t=>t==="left"?"right":"left",rc=(t,e)=>e?{action:"expand",points:nc(t)}:{action:"collapse",points:t},ic=t=>`dev-process-kit:sidebar-collapsed:${t}`;class oc{#e;#i;#n=null;#r="";#t=!1;constructor(e,s){this.#e=e,this.#i=s,e.addController(this)}hostConnected(){this.#n===null&&(this.#n=this.#i.persist()?Oe(Or):V(Or),this.#r=ic(this.#i.template()),this.#t=this.#n.read(this.#r)??!1)}get collapsed(){return this.#t}toggle(){this.#t=!this.#t,this.#t?this.#n?.write(this.#r,!0):this.#n?.remove(this.#r),this.#e.requestUpdate()}}const ac=t=>`dev-process-kit:sidebar-width:${t}`,gs={kind:"idle"};class lc{constructor(e,s){this.#n=null,this.#r="",this.#t=null,this.#s=gs,this.handlers={pointerdown:n=>{n.button===0&&(n.preventDefault(),n.currentTarget instanceof Element&&n.currentTarget.setPointerCapture(n.pointerId),this.#s={kind:"dragging",pointerId:n.pointerId,side:this.#i.layout().side,startX:n.clientX,startWidth:this.width},this.#e.requestUpdate())},pointermove:n=>{const r=this.#s;r.kind!=="dragging"||r.pointerId!==n.pointerId||this.#a(tc(r,n.clientX))},pointerup:n=>this.#o(n),pointercancel:n=>this.#o(n),keydown:n=>{const r=sc(this.width,this.#i.layout().side,n);r!==null&&(n.preventDefault(),this.#a(r),this.#l())},dblclick:()=>{this.#a(this.#i.layout().defaultWidth),this.#l()}},this.#e=e,this.#i=s,e.addController(this)}#e;#i;#n;#r;#t;#s;hostConnected(){this.#n===null&&(this.#n=this.#i.persist()?Oe(Mr):V(Mr),this.#r=ac(this.#i.template()),this.#t=this.#n.read(this.#r))}hostDisconnected(){this.#s=gs}get width(){return this.#t??this.#i.layout().defaultWidth}get dragging(){return this.#s.kind==="dragging"}#o(e){const s=this.#s;s.kind!=="dragging"||s.pointerId!==e.pointerId||(this.#s=gs,this.#l(),this.#e.requestUpdate())}#a(e){const s=e===this.#i.layout().defaultWidth?null:e;s!==this.#t&&(this.#t=s,this.#e.requestUpdate())}#l(){this.#t===null?this.#n?.remove(this.#r):this.#n?.write(this.#r,this.#t)}}const cc=[Ze,$t,D`
1262
+ `,xl=t=>{const e=[...document.body.querySelectorAll("*")].filter(s=>s.localName.startsWith("dpk-template-")&&!s.querySelector(`:scope > .${rs}`));if(e.length!==0){document.head.append(Object.assign(document.createElement("style"),{textContent:bl}));for(const s of e)s.append(vl(s,t))}},vl=(t,e)=>{const s=D(Ze(Ke(t))),n=document.createElement("select");n.className=rs,n.slot="header",n.setAttribute("aria-label",s.versionLabel),n.title=s.versionLabel;const r=a=>{const o=dr({current:e,requested:ns(location.search)!==null,published:a,text:{pinned:s.versionPinned,latest:s.versionLatest}});n.replaceChildren(...o.options.map(l=>Object.assign(document.createElement("option"),{value:l.value,textContent:l.label}))),n.value=o.value},i=()=>{pr().then(r,a=>console.warn(a))};return n.addEventListener("pointerenter",i,{once:!0}),n.addEventListener("focus",i,{once:!0}),n.addEventListener("change",()=>hr(n.value===""?null:n.value)),r(null),n},yl=C({value:m()}),wl=t=>e=>{if(!(e instanceof CustomEvent))return;const s=S(yl,e.detail);s.success&&t(s.output.value)},is=t=>e=>{const s=de(e.target,HTMLSelectElement);s!==null&&t(s.value)},$l=t=>e=>{const s=de(e.target,HTMLInputElement);s!==null&&t(s.checked)},Oe=t=>t==="light"||t==="dark"?t:null,ur=t=>t.authored??t.environment,fr=t=>t.preference??ur(t),Sl=t=>{const e=fr(t)==="dark"?"light":"dark";return e===ur(t)?null:e},gr=W(fe({value:v(m(),ie(/^element:.+/)),label:v(m(),w(1)),group:P(m())})),Al=C({targets:gr,providers:W(C({id:v(m(),w(1)),results:W(Un)}))}),Tl=fe({target:v(m(),ie(/^element:.+/)),body:v(m(),jt(),w(1))}),mr=t=>t.group?`${t.group} \xB7 ${t.label}`:t.label,kr=(t,e,s)=>{const n=new Map(e.map(r=>[r.value,r]));return{...t,hasTarget:(r,i)=>t.hasTarget(r,i)||n.has(M(i)),commentTargets:(r,i)=>{const a=t.commentTargets(r,i),o=new Set(a.map(l=>l.value));return[...a,...e.filter(l=>!o.has(l.value))]},describe:(r,i,a)=>{if(q(r)){const c=s.get(r.id),p=n.get(M(r.target));return{title:c?.title??r.type,...c?.summary===void 0?{}:{summary:c.summary},tone:c?.tone??"update",targetLabel:p?mr(p):r.target.id}}const o=t.describe(r,i,a),l=r.type==="comment"&&!t.hasTarget(i,r.target)?n.get(M(r.target)):void 0;return l===void 0?o:{...o,targetLabel:mr(l)}},serialize:r=>q(r)?`${r.type} ${M(r.target)} ${JSON.stringify(r.payload)}`:t.serialize(r)}},br=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function xr(t){return typeof br.Buffer<"u"&&br.Buffer.isBuffer(t)}function vr(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 yr(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function wr(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const Cl="[object RegExp]",El="[object String]",_l="[object Number]",Rl="[object Boolean]",Ll="[object Symbol]",Pl="[object Date]",zl="[object Map]",Ol="[object Set]",Ml="[object Array]",jl="[object Function]",Il="[object ArrayBuffer]",as="[object Object]",ql="[object Error]",Nl="[object DataView]",Dl="[object Uint8Array]",Ul="[object Uint8ClampedArray]",Bl="[object Uint16Array]",Hl="[object Uint32Array]",Fl="[object BigUint64Array]",Kl="[object Int8Array]",Zl="[object Int16Array]",Wl="[object Int32Array]",Vl="[object BigInt64Array]",Gl="[object Float32Array]",Jl="[object Float64Array]";function Yl(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function Ql(t,e,s){return Me(t,e,void 0,void 0,void 0,void 0,s)}function Me(t,e,s,n,r,i,a){const o=a(t,e,s,n,r,i);if(o!==void 0)return o;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 je(t,e,i,a)}return je(t,e,i,a)}function je(t,e,s,n){if(Object.is(t,e))return!0;let r=wr(t),i=wr(e);if(r==="[object Arguments]"&&(r=as),i==="[object Arguments]"&&(i=as),r!==i)return!1;switch(r){case El:return t.toString()===e.toString();case _l:return Yl(t.valueOf(),e.valueOf());case Rl:case Pl:case Ll:return Object.is(t.valueOf(),e.valueOf());case Cl:return t.source===e.source&&t.flags===e.flags;case jl:return t===e}s=s??new Map;const a=s.get(t),o=s.get(e);if(a!=null&&o!=null)return a===e;s.set(t,e),s.set(e,t);try{switch(r){case zl:if(t.size!==e.size)return!1;for(const[l,c]of t.entries())if(!e.has(l)||!Me(c,e.get(l),l,t,e,s,n))return!1;return!0;case Ol:{if(t.size!==e.size)return!1;const l=Array.from(t.values()),c=Array.from(e.values());for(let p=0;p<l.length;p++){const d=l[p],h=c.findIndex(u=>Me(d,u,void 0,t,e,s,n));if(h===-1)return!1;c.splice(h,1)}return!0}case Ml:case Dl:case Ul:case Bl:case Hl:case Fl:case Kl:case Zl:case Wl:case Vl:case Gl:case Jl:if(xr(t)!==xr(e)||t.length!==e.length)return!1;for(let l=0;l<t.length;l++)if(!Me(t[l],e[l],l,t,e,s,n))return!1;return!0;case Il:return t.byteLength!==e.byteLength?!1:je(new Uint8Array(t),new Uint8Array(e),s,n);case Nl:return t.byteLength!==e.byteLength||t.byteOffset!==e.byteOffset?!1:je(new Uint8Array(t),new Uint8Array(e),s,n);case ql:return t.name===e.name&&t.message===e.message;case as:{if(!(je(t.constructor,e.constructor,s,n)||vr(t)&&vr(e)))return!1;const l=[...Object.keys(t),...yr(t)],c=[...Object.keys(e),...yr(e)];if(l.length!==c.length)return!1;for(let p=0;p<l.length;p++){const d=l[p],h=t[d];if(!Object.hasOwn(e,d))return!1;const u=e[d];if(!Me(h,u,d,t,e,s,n))return!1}return!0}default:return!1}}finally{s.delete(t),s.delete(e)}}function Xl(){}function ot(t,e){return Ql(t,e,Xl)}const $r="page",Sr=t=>M(t),Ar=(t,e,s,n=new Map)=>{let r=e;const i=[],a=[],o=[],l=[],c=new Map;for(const d of s){if(d.type===z)continue;if(q(d)){const f=n.get(d.id);f===void 0||f.stale!==void 0?a.push({action:d,reason:f?.stale??"target-missing"}):i.push(d);continue}const h=rt(t.actions,d.type);if(!h){a.push({action:d,reason:"unsupported-action-type"});continue}const u=t.apply(r,d);if(u===null){a.push({action:d,reason:t.hasTarget(r,d.target)?"constraint-violated":"target-missing"});continue}if(h.mode!=="append"&&os(t,r,u)){o.push(d);continue}r=u,i.push(d)}for(const d of s){if(d.type!==z)continue;if(d.target.type!==$r&&!t.hasTarget(r,d.target)){a.push({action:d,reason:"target-missing"});continue}l.push(d);const h=Sr(d.target);c.set(h,[...c.get(h)??[],d])}const p=new Map(s.map((d,h)=>[d.id,h]));return a.sort((d,h)=>(p.get(d.action.id)??0)-(p.get(h.action.id)??0)),{base:e,state:r,actions:s,applied:i,stale:a,obsolete:o,comments:l,commentsByTarget:c}},os=(t,e,s)=>e===s?!0:t.canonicalState===void 0?ot(e,s):ot(t.canonicalState(e),t.canonicalState(s)),Tr=t=>{const e=new Set(t.obsolete.map(s=>s.id));return t.actions.filter(s=>!e.has(s.id))},ec=(t,e,s,n)=>{let r=e;const i=n??Cr(r).map(a=>a.id);for(const a of[...i].reverse())r=tc(t,r,s,a,n!==void 0)??r;return r},Cr=t=>t.applied.filter(e=>!q(e)),tc=(t,e,s,n,r)=>{const i=Cr(e),a=i.findIndex(h=>h.id===n),o=i[a];if(o===void 0)return null;const l=i.slice(0,a),c=[...r?sc(t,e.base,i,a):[],...nc(t,l,o)],p=new Set,d=c.filter(h=>{const u=h.join(" ");return p.has(u)?!1:(p.add(u),!0)}).sort((h,u)=>u.length-h.length);for(const h of d){const u=rc(t,e,s,h);if(u!==null)return u}return null},sc=(t,e,s,n)=>{const r=[];let i=e;for(const a of s.slice(0,n+1))r.push(i),i=t.apply(i,a)??i;return r.flatMap((a,o)=>os(t,a,i)?[s.slice(o,n+1).map(l=>l.id)]:[])},nc=(t,e,s)=>{const n=Er(s),r=e.filter(l=>Er(l).some(c=>n.includes(c))),i=_r(t,s),a=r.filter(l=>_r(t,l)===i),o=l=>l.map((c,p)=>[...l.slice(p).map(d=>d.id),s.id]);return[...o(r),...o(a),...r.map(l=>[l.id,s.id]),...r.map(l=>[l.id])]},Er=t=>{const e=t.target.type===$r?[]:t.target.id.split("."),s=typeof t.payload=="object"&&t.payload!==null?Object.values(t.payload).filter(n=>typeof n=="string"&&n!==""):[];return[...e,...s]},_r=(t,e)=>rt(t.actions,e.type)?.mode,rc=(t,e,s,n)=>{const r=new Set(e.stale.map(a=>a.action.id)),i=new Set(n);for(;;){const a=s(e.actions.filter(l=>!i.has(l.id))),o=a.stale.filter(l=>!r.has(l.action.id)).map(l=>l.action);if(o.length===0)return os(t,a.state,e.state)?a:null;if(o.some(l=>l.type===z||q(l)))return null;for(const l of o)i.add(l.id)}},ic=C({v:ue(1),template:v(m(),w(1)),actions:W(V())});class ls{constructor(e){this.storage=e}load(e,s){try{const n=this.storage.getItem(e);if(n===null)return[];const r=S(ic,JSON.parse(n));return!r.success||r.output.template!==s?[]:r.output.actions.flatMap(i=>{const a=S(ae,i);return a.success?[a.output]:[]})}catch{return[]}}save(e,s,n){const r={v:1,template:s,actions:n};try{this.storage.setItem(e,JSON.stringify(r))}catch{}}clear(e){try{this.storage.removeItem(e)}catch{}}}class cs{constructor(){this.store=new Map}load(e,s){return new ls({getItem:n=>this.store.get(n)??null,setItem:(n,r)=>{this.store.set(n,r)},removeItem:n=>{this.store.delete(n)}}).load(e,s)}save(e,s,n){this.store.set(e,JSON.stringify({v:1,template:s,actions:n}))}clear(e){this.store.delete(e)}}const ds=()=>{try{if(typeof localStorage<"u")return new ls(localStorage)}catch{}return new cs},ps=t=>`dev-process-kit:draft:${typeof location>"u"?"local":`${location.pathname}${location.search}`}:${t}`,ac=W(V());class Rr{#e;#i;#n={targets:[],providers:[]};#r=new Map;#t;#s;#a;#o;#l;#p=new Set;#x=[];#m=0;constructor(e){this.#e=e.definition,this.#i=kr(e.definition,[],this.#r),this.#t=e.base,this.#l=e.storageKey??ps(e.definition.name),this.#o=e.storage===void 0?ds():e.storage;const s=e.initialActions??this.#o?.load(this.#l,this.definition.name)??[];this.#s=Pr(this.definition,s),this.#a=this.#d(this.#s),this.#y()&&this.#k()}get definition(){return this.#i}setComponentSnapshot(e){const s=qt(Al,e);if(!ot(s,this.#n)){this.#n=s,this.#c(),this.#a=this.#d(this.#s);for(const n of this.#p)n()}}setTemplate(e){this.#e=e,this.#c(),this.#a=this.#d(this.#s);for(const s of this.#p)s()}#c(){this.#r=Bn(this.#s,this.#n.providers),this.#i=kr(this.#e,this.#n.targets,this.#r)}#d(e){return Ar(this.definition,this.#t,e,Bn(e,this.#n.providers))}get base(){return this.#t}get actions(){return this.#s}get derivation(){return this.#a}get lastIssues(){return this.#x}get prunedCount(){return this.#m}descriptorFor(e,s){return Lr(this.definition,e,s)}dispatch(e){const s=this.#v(e,this.#a.state);if(!s.ok)return this.#h([s.issue]);const n=this.descriptorFor(s.action.type,s.action.target);return n?(this.#u(Ut(this.#s,s.action,n),[s.action.id]),{ok:!0,id:s.action.id}):this.#h([{path:"type",message:"unknown action type"}])}dispatchBatch(e){const s=S(ac,e);if(!s.success)return this.#h([oe(s.issues)]);const n=s.output;if(n.length===0)return{ok:!0,ids:[]};let r=this.#s,i=this.#a.state;const a=[];for(const o of n){const l=this.#v(o,i);if(!l.ok)return this.#h([l.issue]);const c=l.action,p=this.descriptorFor(c.type,c.target);if(!p)return this.#h([{path:"type",message:"unknown action type"}]);if((c.type==="comment"||q(c)?c.target.type==="page"||this.definition.hasTarget(i,c.target)?i:null:this.definition.apply(i,c))===null)return this.#h([{path:"target",message:"batch action is not applicable"}]);r=Ut(r,c,p),i=this.#d(r).state,a.push(c.id)}return this.#u(r,a),{ok:!0,ids:a}}#v(e,s){const n=S(In,e);if(!n.success)return{ok:!1,issue:oe(n.issues)};const r=this.descriptorFor(n.output.type,typeof n.output.target=="string"?Nt(n.output.target,"page"):n.output.target);if(!r)return{ok:!1,issue:{path:"type",message:`unknown action type "${n.output.type}"`}};const i=eo(n.output,r);if(!i.ok)return i;const a=this.definition.canonicalTarget?.(s,i.action.target)??i.action.target;return{ok:!0,action:{...i.action,target:a}}}#h(e){return this.#x=e,{ok:!1,issues:e}}editComment(e,s){const n=this.#s.find(o=>o.id===e);if(n?.type!==z)return this.#h([{path:"id",message:`no comment "${e}" in the draft`}]);if(Pe(n)===s)return{ok:!0,id:e};const r=S(Ht.schema,{...n,payload:{body:s}});if(!r.success)return this.#h([oe(r.issues)]);const i=S(ae,r.output);if(!i.success)return this.#h([oe(i.issues)]);const a=i.output;return this.#u(this.#s.map(o=>o===n?a:o),[]),{ok:!0,id:e}}removeAction(e){const s=this.#s.filter(n=>n.id!==e);s.length!==this.#s.length&&this.#u(s)}clearActions(){this.#s.length>0&&this.#u([])}replaceActions(e){this.#u(Pr(this.definition,e))}setBase(e){this.#t=e,this.#u(this.#s)}subscribe(e){return this.#p.add(e),()=>{this.#p.delete(e)}}exportDraft(e){return{template:this.definition.name,frameworkVersion:e,exportedAt:new Date().toISOString(),actions:this.#s}}#u(e,s){this.#x=[],this.#s=e,this.#c(),this.#a=this.#d(this.#s),this.#y(s),this.#k();for(const n of this.#p)n()}#y(e){const s=this.#g(),n=ec(this.definition,this.#a,r=>this.#d(r),e);return n===this.#a?s:(this.#m+=this.#s.length-n.actions.length,this.#s=[...n.actions],this.#c(),this.#a=this.#d(this.#s),this.#g(),!0)}#g(){return this.#a.obsolete.length===0?!1:(this.#m+=this.#a.obsolete.length,this.#s=Tr(this.#a),this.#c(),this.#a=this.#d(this.#s),!0)}#k(){this.#o?.save(this.#l,this.definition.name,this.#s)}}const Lr=(t,e,s)=>e==="comment"?Ht:s!==void 0&&q({type:e,target:s})?io:rt(t.actions,e),Pr=(t,e)=>e.flatMap(s=>{const n=S(ae,s);if(!n.success)return[];const r=n.output,i=Lr(t,r.type,r.target);if(!i)return[];const a=S(i.schema,r);if(!a.success)return[];const o=S(ae,a.output);return o.success?[o.output]:[]}),oc=()=>({status:{kind:"idle"},request:0}),lc=(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}},cc=(t,e)=>{if(t.actions===0||t.railOpen)return null;const s=D(t.locale),n=e.status;return{send:t.sendable?{label:n.kind==="sending"?s.handoffSending:n.kind==="sent"?s.handoffSent:s.handoffSend,disabled:n.kind==="sending"}:null,copy:n.kind==="copied"?{label:s.handoffCopied,status:"copied"}:n.kind==="copy-failed"?{label:s.handoffCopyFailed,status:"failed"}:{label:s.handoffCopy,status:"idle"},note:n.kind==="send-failed"?Yt(n.reason,t.locale):null}},zr=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()}},dc=t=>{const e=t.derivation();return{state:e.state,base:e.base,navigation:t.navigation(),actions:t.controller().actions,comments:e.comments,stale:e.stale,commentCount:s=>{const n=typeof s=="string"?s:M(s);return e.commentsByTarget.get(n)?.length??0},dispatch:s=>t.dispatch(s),dispatchBatch:s=>t.dispatchBatch(s),navigate:(s,n)=>t.navigate(s,n),hashFor:s=>t.hashFor(s),requestComment:s=>t.requestComment(s)}},pc=(t,e)=>{const s=()=>zr(t);return{version:N,template:t.definition.name,host:e,ready:t.ready,get base(){return t.controller().base},get state(){return t.derivation().state},get navigation(){return t.navigation()},get actions(){return t.controller().actions},get comments(){return t.derivation().comments},get stale(){return t.derivation().stale},get issues(){return t.issues()},dispatch:n=>t.dispatch(n),dispatchBatch:n=>t.dispatchBatch(n),comment:(n,r)=>t.dispatch({type:z,target:n,payload:{body:r}}),editComment:(n,r)=>t.editComment(n,r),removeAction:n=>t.removeAction(n),clearActions:()=>t.clearActions(),importDraft:n=>t.controller().replaceActions(n),navigate:(n,r)=>t.navigate(n,r),hashFor:n=>t.hashFor(n),snapshot:s,exportDraft:()=>t.controller().exportDraft(N),exportBrief:()=>Gt(s(),t.controller().definition,N),subscribe:n=>t.subscribe(n)}},hs=(t,e)=>typeof t=="object"&&t!==null&&e.every(s=>typeof Reflect.get(t,s)=="function"),hc=t=>hs(t,["use"]),uc=t=>hs(t,["anchorFor","canSendToClaude","sendToClaude"]),fc=t=>hs(t,["collection"]),Or=async(t,e)=>{try{return await t.use(e)}catch{return null}},gc=(t,e)=>({async canSend(){try{return await t.canSendToClaude()==="available"}catch{return!1}},async send({brief:s,draft:n,anchor:r}){let i=xo(s);if(i===null){if(e===null)return{ok:!1,reason:"too_large"};try{const a=e.collection(mo).doc();await a.set({brief:s,draft:n,createdAt:new Date().toISOString()}),i=vo(a.path)}catch{return{ok:!1,reason:"storage"}}}try{return await t.sendToClaude({anchor:await t.anchorFor(r),text:i}),{ok:!0}}catch(a){return{ok:!1,reason:wo(a)}}}}),mc=async t=>{if(!hc(t))return null;const[e,s]=await Promise.all([Or(t,"comments"),Or(t,"db")]);return uc(e)?gc(e,fc(s)?s:null):null},kc=()=>Reflect.get(globalThis,"claude");class bc{#e;#i;#n=null;#r=!1;constructor(e,s=kc){this.#e=e,this.#i=s,e.addController(this)}get available(){return this.#r}hostConnected(){this.#n??=mc(this.#i()),this.#t(),window.addEventListener("focus",this.#t)}hostDisconnected(){window.removeEventListener("focus",this.#t)}async send(e){const s=await this.#n;if(!s)return{ok:!1,reason:"forbidden"};const n=await s.send(e);return this.#t(),n}#t=async()=>{const e=await this.#n,s=e?await e.canSend():!1;s!==this.#r&&(this.#r=s,this.#e.requestUpdate())}}const us=(t,e)=>({read(s){try{const n=t.getItem(s);return n===null?null:e(JSON.parse(n))}catch{return null}},write(s,n){try{return t.setItem(s,JSON.stringify(n)),!0}catch{return!1}},remove(s){try{t.removeItem(s)}catch{}}}),G=t=>{const e=new Map;return us({getItem:s=>e.get(s)??null,setItem:(s,n)=>{e.set(s,n)},removeItem:s=>{e.delete(s)}},t)},Ie=t=>{try{if(typeof localStorage<"u")return us(localStorage,t)}catch{}return G(t)},xc=t=>{try{if(typeof sessionStorage<"u")return us(sessionStorage,t)}catch{}return G(t)},fs="dev-process-kit:color-scheme",vc="(prefers-color-scheme: dark)",Mr=()=>typeof matchMedia=="function"?matchMedia(vc):null,jr=()=>Oe(document.documentElement.dataset.theme)??(Mr()?.matches===!0?"dark":"light");class yc{#e;#i;#n=null;#r=null;#t="light";#s=null;#a=null;constructor(e,s){this.#e=e,this.#i=s,e.addController(this)}hostConnected(){this.#n===null&&(this.#n=this.#i()?Ie(Oe):G(Oe),this.#r=this.#n.read(fs)),this.#t=jr(),this.#s=Mr(),this.#s?.addEventListener("change",this.#l),this.#a=new MutationObserver(this.#l),this.#a.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})}hostDisconnected(){this.#s?.removeEventListener("change",this.#l),this.#s=null,this.#a?.disconnect(),this.#a=null}resolve(e){return fr(this.#o(e))}toggle(e){this.#r=Sl(this.#o(e)),this.#r===null?this.#n?.remove(fs):this.#n?.write(fs,this.#r),this.#e.requestUpdate()}#o(e){return{preference:this.#r,authored:e,environment:this.#t}}#l=()=>{const e=jr();e!==this.#t&&(this.#t=e,this.#e.requestUpdate())}}const wc=(t,e)=>{const s=[],n=r=>{(r===t||r instanceof ShadowRoot)&&e?.(r);for(const i of r.children)i.hasAttribute("data-template")||(("commentTargets"in i||"elementActions"in i)&&s.push(i),n(i),i.shadowRoot&&n(i.shadowRoot))};return n(t),s},Ir=(t,e)=>{const s=new Map;for(const n of t)s.set(e(n),(s.get(e(n))??0)+1);return t.filter(n=>s.get(e(n))===1)},qr=t=>Ir(t.filter(e=>"elementActions"in e&&e.id.length>0),e=>e.id),Nr=(t,e)=>{for(const s of qr(t)){const n=oo(e,s.id),r=Reflect.get(s,"elementActions");Array.isArray(r)&&r.length===n.length&&n.every((a,o)=>{const l=r[o];return typeof l=="object"&&l!==null&&"id"in l&&l.id===a.id})||Reflect.set(s,"elementActions",n)}},$c=t=>{const e=Reflect.get(t,"elementActionResults");return Array.isArray(e)?e.flatMap(s=>{const n=S(Un,s);return n.success?[n.output]:[]}):[]},Sc=t=>{const e=[];for(const s of t){if(!("commentTargets"in s))continue;const n=S(gr,s.commentTargets);n.success&&e.push(...n.output)}return{targets:Ir(e,s=>s.value),providers:qr(t).map(s=>({id:s.id,results:$c(s)}))}},Ac=2400;class Tc{#e=oc();#i=null;#n;constructor(e){this.#n=e,e.addController(this)}get state(){return this.#e}hostDisconnected(){this.#s()}async copy(e){this.#r({kind:"copy-started"});const s=this.#e.request,n=await Jt(e()).catch(()=>!1);this.#r({kind:"copy-finished",request:s,ok:n}),this.#t(s)}async send(e){if(this.#e.status.kind==="sending")return;this.#r({kind:"send-started"});const s=this.#e.request,n=await e().catch(()=>({ok:!1,reason:"error"}));this.#r({kind:"send-finished",request:s,outcome:n}),n.ok&&this.#t(s)}#r(e){(e.kind==="copy-started"||e.kind==="send-started")&&this.#s(),this.#e=lc(this.#e,e),this.#n.requestUpdate()}#t(e){e===this.#e.request&&(this.#s(),this.#i=setTimeout(()=>{this.#i=null,this.#r({kind:"settled",request:e})},Ac))}#s(){this.#i!==null&&clearTimeout(this.#i),this.#i=null}}const gs="dev-process-kit:locale";class Cc{#e;#i;#n;#r=null;#t=null;#s;#a;constructor(e,s,n){this.#e=e,this.#i=s,this.#n=n,e.addController(this)}get authored(){if(this.#s===void 0)return Ze(Ke(this.#e));const e=this.#e.parentNode;return Ze(this.#s??(e===null?null:Ke(e)))}get locale(){return this.#a??this.#o()}#o(){return $i({preference:this.#t,authored:this.authored})}hostConnected(){this.#r===null&&(this.#r=this.#i()?Ie(Ws):G(Ws),this.#t=this.#r.read(gs)),this.#s??=this.#e.getAttribute("lang"),this.#l()}pick(e){this.#t=Si(e,this.authored),this.#t===null?this.#r?.remove(gs):this.#r?.write(gs,this.#t),this.#l(),this.#e.requestUpdate()}#l(){const e=this.#t??this.#s??null;e===null?this.#e.removeAttribute("lang"):this.#e.getAttribute("lang")!==e&&this.#e.setAttribute("lang",e);const s=this.#o();if(s===this.#a)return;const n=this.#a===void 0;this.#a=s,this.#n(),(!n||this.#t!==null)&&document.dispatchEvent(new Event(wt))}}const Dr=()=>Wt(typeof location>"u"?"":location.hash),Ec=(t,e)=>{if(typeof history>"u")return;const s=`${location.pathname}${location.search}${ge(t)}`;`${location.pathname}${location.search}${location.hash}`!==s&&(e?history.replaceState(null,"",s):history.pushState(null,"",s))};class _c{#e;#i=null;#n=0;constructor(e){this.#e=e}get orphans(){return this.#n}route(){const e=this.#e.renderRoot,s=de(e.querySelector('slot[name="preview"]'),HTMLSlotElement);if(s===null)return;this.#i!==s&&(this.#i=s,s.addEventListener("slotchange",this.#r));const n=new Set(Array.from(e.querySelectorAll("slot")).map(i=>i.getAttribute("name")??"")),r=s.assignedElements();for(const i of r){const a=i.getAttribute("data-preview-id");if(!a)continue;const o=`preview:${a}`;i.getAttribute("slot")!==o&&n.has(o)&&i.setAttribute("slot",o)}r.length!==this.#n&&(this.#n=r.length,queueMicrotask(()=>this.#e.requestUpdate()))}#r=()=>{queueMicrotask(()=>this.route())}}const J={min:180,max:560,step:16,largeStep:64},Rc={side:"left",defaultWidth:260},lt=t=>Math.round(Math.min(J.max,Math.max(J.min,t))),Ur=t=>typeof t=="number"&&Number.isFinite(t)?lt(t):null,ms=(t,e)=>t==="left"?e:-e,Lc=(t,e)=>lt(t.startWidth+ms(t.side,e-t.startX)),Pc=(t,e,{key:s,shiftKey:n})=>{const r=n?J.largeStep:J.step;switch(s){case"ArrowLeft":return lt(t+ms(e,-r));case"ArrowRight":return lt(t+ms(e,r));case"Home":return J.min;case"End":return J.max;default:return null}},Br=t=>typeof t=="boolean"?t:null,zc=t=>t==="left"?"right":"left",Oc=(t,e)=>e?{action:"expand",points:zc(t)}:{action:"collapse",points:t},Mc=t=>`dev-process-kit:sidebar-collapsed:${t}`;class jc{#e;#i;#n=null;#r="";#t=!1;constructor(e,s){this.#e=e,this.#i=s,e.addController(this)}hostConnected(){this.#n===null&&(this.#n=this.#i.persist()?Ie(Br):G(Br),this.#r=Mc(this.#i.template()),this.#t=this.#n.read(this.#r)??!1)}get collapsed(){return this.#t}toggle(){this.#t=!this.#t,this.#t?this.#n?.write(this.#r,!0):this.#n?.remove(this.#r),this.#e.requestUpdate()}}const Ic=t=>`dev-process-kit:sidebar-width:${t}`,ks={kind:"idle"};class qc{constructor(e,s){this.#n=null,this.#r="",this.#t=null,this.#s=ks,this.handlers={pointerdown:n=>{n.button===0&&(n.preventDefault(),n.currentTarget instanceof Element&&n.currentTarget.setPointerCapture(n.pointerId),this.#s={kind:"dragging",pointerId:n.pointerId,side:this.#i.layout().side,startX:n.clientX,startWidth:this.width},this.#e.requestUpdate())},pointermove:n=>{const r=this.#s;r.kind!=="dragging"||r.pointerId!==n.pointerId||this.#o(Lc(r,n.clientX))},pointerup:n=>this.#a(n),pointercancel:n=>this.#a(n),keydown:n=>{const r=Pc(this.width,this.#i.layout().side,n);r!==null&&(n.preventDefault(),this.#o(r),this.#l())},dblclick:()=>{this.#o(this.#i.layout().defaultWidth),this.#l()}},this.#e=e,this.#i=s,e.addController(this)}#e;#i;#n;#r;#t;#s;hostConnected(){this.#n===null&&(this.#n=this.#i.persist()?Ie(Ur):G(Ur),this.#r=Ic(this.#i.template()),this.#t=this.#n.read(this.#r))}hostDisconnected(){this.#s=ks}get width(){return this.#t??this.#i.layout().defaultWidth}get dragging(){return this.#s.kind==="dragging"}#a(e){const s=this.#s;s.kind!=="dragging"||s.pointerId!==e.pointerId||(this.#s=ks,this.#l(),this.#e.requestUpdate())}#o(e){const s=e===this.#i.layout().defaultWidth?null:e;s!==this.#t&&(this.#t=s,this.#e.requestUpdate())}#l(){this.#t===null?this.#n?.remove(this.#r):this.#n?.write(this.#r,this.#t)}}const Nc=[Ve,St,B`
1456
1263
  :host {
1457
1264
  display: block;
1458
1265
  min-height: 100%;
@@ -2233,18 +2040,18 @@ The brief is too long for a comment, so it is stored in this artifact's database
2233
2040
  display: none;
2234
2041
  }
2235
2042
  }
2236
- `],dc=30,pc=et(k(),C({base:k(),value:k()})),jr=t=>{const e=S(pc,t);return e.success?e.output:null},hc=t=>t.key===void 0?JSON.stringify(["field",t.hosts,t.name,t.base]):JSON.stringify(["key",t.key,t.name]),uc=(t,e,s)=>{const{[e]:n,...r}=t;if(s.value===s.base)return r;const i=Object.entries({...r,[e]:s});return Object.fromEntries(i.slice(Math.max(0,i.length-dc)))},fc=(t,e)=>{if(!(e in t))return t;const{[e]:s,...n}=t;return n},gc=(t,e,s)=>{const n=t[e];return n===void 0||n.base!==s||n.value===s?null:n.value},mc=new Set(["text","search","url","email","tel"]),Ir=t=>t instanceof HTMLTextAreaElement||t instanceof HTMLInputElement&&mc.has(t.type)?t:null,kc=(t,e)=>{const s=[];let n=e.getRootNode();for(;n instanceof ShadowRoot;){if(n.host===t)return s;s.unshift(n.host.localName),n=n.host.getRootNode()}return null},bc=t=>{let e=t;for(;e!==null;){const s=e.getAttribute("data-dpk-text-key");if(s!==null&&s!=="")return s;const n=e.getRootNode();e=e.parentElement??(n instanceof ShadowRoot?n.host:null)}},vc=t=>t.getAttribute("aria-label")??(t.placeholder||t.name||t.localName),ms=t=>typeof t=="string"?[t]:Array.isArray(t)?t.flatMap(ms):typeof t=="object"&&t!==null?Object.values(t).flatMap(ms):[],qr=t=>t.replace(/\s+/g," ").trim();class xc{#e;#i;#n=null;#r="";#t=new WeakMap;#s=new Set;constructor(e,s){this.#e=e,this.#i=s,e.addController(this)}hostConnected(){this.#n===null&&(this.#n=this.#i.persist()?Hl(jr):V(jr),this.#r=this.#i.storageKey()),this.#e.addEventListener("focusin",this.#o),this.#e.addEventListener("input",this.#a)}hostDisconnected(){this.#e.removeEventListener("focusin",this.#o),this.#e.removeEventListener("input",this.#a)}settle(e){const s=new Set(e.flatMap(ms).map(qr));for(const n of this.#s){if(!s.has(qr(n.value)))continue;this.#s.delete(n);const r=this.#t.get(n);r!==void 0&&this.#p(fc(this.#l(),r.id))}}#o=e=>{const s=Ir(e.composedPath()[0]);if(s===null||this.#s.has(s))return;const n=kc(this.#e,s);if(n===null)return;const r=bc(s),i=s.value,o=hc({...r===void 0?{}:{key:r},hosts:n,name:vc(s),base:i});this.#t.set(s,{id:o,base:i});const a=gc(this.#l(),o,i);a!==null&&queueMicrotask(()=>{if(s.value===i){s.value=a;try{s.setSelectionRange(a.length,a.length)}catch{}this.#s.add(s),s.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}})};#a=e=>{const s=Ir(e.composedPath()[0]),n=s===null?void 0:this.#t.get(s);if(!(s===null||n===void 0)){for(const r of this.#s)r.isConnected||this.#s.delete(r);this.#s.add(s),this.#p(uc(this.#l(),n.id,{base:n.base,value:s.value}))}};#l(){return this.#n?.read(this.#r)??{}}#p(e){Object.keys(e).length===0?this.#n?.remove(this.#r):this.#n?.write(this.#r,e)}}class yc{#e;#i;#n;#r=null;#t=!1;constructor(e,s={}){this.#e=e,this.#i=s.fetchVersions??rr,this.#n=s.switchTo??ir,e.addController(this)}hostConnected(){}load(){this.#t||this.#r!==null||(this.#t=!0,this.#i().then(e=>{this.#r=e,this.#t=!1,this.#e.requestUpdate()},e=>{this.#t=!1,console.warn("dev-process-kit: could not list the published versions",e)}))}pick(e){e!==q&&this.#n(e===""?null:e)}render(e){const s=N(e),n=nr({current:q,requested:ts(location.search)!==null,published:this.#r,text:{pinned:s.versionPinned,latest:s.versionLatest}}),r=()=>this.load();return g`<span class="dpk-version"
2043
+ `],Dc=30,Uc=st(m(),C({base:m(),value:m()})),Hr=t=>{const e=S(Uc,t);return e.success?e.output:null},Bc=t=>t.key===void 0?JSON.stringify(["field",t.hosts,t.name,t.base]):JSON.stringify(["key",t.key,t.name]),Hc=(t,e,s)=>{const{[e]:n,...r}=t;if(s.value===s.base)return r;const i=Object.entries({...r,[e]:s});return Object.fromEntries(i.slice(Math.max(0,i.length-Dc)))},Fc=(t,e)=>{if(!(e in t))return t;const{[e]:s,...n}=t;return n},Kc=(t,e,s)=>{const n=t[e];return n===void 0||n.base!==s||n.value===s?null:n.value},Zc=new Set(["text","search","url","email","tel"]),Fr=t=>t instanceof HTMLTextAreaElement||t instanceof HTMLInputElement&&Zc.has(t.type)?t:null,Wc=(t,e)=>{const s=[];let n=e.getRootNode();for(;n instanceof ShadowRoot;){if(n.host===t)return s;s.unshift(n.host.localName),n=n.host.getRootNode()}return null},Vc=t=>{let e=t;for(;e!==null;){const s=e.getAttribute("data-dpk-text-key");if(s!==null&&s!=="")return s;const n=e.getRootNode();e=e.parentElement??(n instanceof ShadowRoot?n.host:null)}},Gc=t=>t.getAttribute("aria-label")??(t.placeholder||t.name||t.localName),bs=t=>typeof t=="string"?[t]:Array.isArray(t)?t.flatMap(bs):typeof t=="object"&&t!==null?Object.values(t).flatMap(bs):[],Kr=t=>t.replace(/\s+/g," ").trim();class Jc{#e;#i;#n=null;#r="";#t=new WeakMap;#s=new Set;constructor(e,s){this.#e=e,this.#i=s,e.addController(this)}hostConnected(){this.#n===null&&(this.#n=this.#i.persist()?xc(Hr):G(Hr),this.#r=this.#i.storageKey()),this.#e.addEventListener("focusin",this.#a),this.#e.addEventListener("input",this.#o)}hostDisconnected(){this.#e.removeEventListener("focusin",this.#a),this.#e.removeEventListener("input",this.#o)}settle(e){const s=new Set(e.flatMap(bs).map(Kr));for(const n of this.#s){if(!s.has(Kr(n.value)))continue;this.#s.delete(n);const r=this.#t.get(n);r!==void 0&&this.#p(Fc(this.#l(),r.id))}}#a=e=>{const s=Fr(e.composedPath()[0]);if(s===null||this.#s.has(s))return;const n=Wc(this.#e,s);if(n===null)return;const r=Vc(s),i=s.value,a=Bc({...r===void 0?{}:{key:r},hosts:n,name:Gc(s),base:i});this.#t.set(s,{id:a,base:i});const o=Kc(this.#l(),a,i);o!==null&&queueMicrotask(()=>{if(s.value===i){s.value=o;try{s.setSelectionRange(o.length,o.length)}catch{}this.#s.add(s),s.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}})};#o=e=>{const s=Fr(e.composedPath()[0]),n=s===null?void 0:this.#t.get(s);if(!(s===null||n===void 0)){for(const r of this.#s)r.isConnected||this.#s.delete(r);this.#s.add(s),this.#p(Hc(this.#l(),n.id,{base:n.base,value:s.value}))}};#l(){return this.#n?.read(this.#r)??{}}#p(e){Object.keys(e).length===0?this.#n?.remove(this.#r):this.#n?.write(this.#r,e)}}class Yc{#e;#i;#n;#r=null;#t=!1;constructor(e,s={}){this.#e=e,this.#i=s.fetchVersions??pr,this.#n=s.switchTo??hr,e.addController(this)}hostConnected(){}load(){this.#t||this.#r!==null||(this.#t=!0,this.#i().then(e=>{this.#r=e,this.#t=!1,this.#e.requestUpdate()},e=>{this.#t=!1,console.warn("dev-process-kit: could not list the published versions",e)}))}pick(e){e!==N&&this.#n(e===""?null:e)}render(e){const s=D(e),n=dr({current:N,requested:ns(location.search)!==null,published:this.#r,text:{pinned:s.versionPinned,latest:s.versionLatest}}),r=()=>this.load();return k`<span class="dpk-version"
2237
2044
  >dev-process-kit@<select
2238
2045
  class="dpk-version-select"
2239
2046
  aria-label=${s.versionLabel}
2240
2047
  title=${s.versionLabel}
2241
2048
  @pointerenter=${r}
2242
2049
  @focus=${r}
2243
- @change=${ns(i=>this.pick(i))}
2050
+ @change=${is(i=>this.pick(i))}
2244
2051
  >
2245
- ${n.options.map(i=>g`<option value=${i.value} ?selected=${i.value===n.value}>${i.label}</option>`)}
2052
+ ${n.options.map(i=>k`<option value=${i.value} ?selected=${i.value===n.value}>${i.label}</option>`)}
2246
2053
  </select></span
2247
- >`}}class wc extends H{static{this.styles=cc}static{this.properties={storageKey:{type:String,attribute:"storage-key"},storage:{type:String},notes:{type:String},theme:{type:String},notesOpen:{state:!0}}}#e=!1;#i=new Xl(this);#n=new Kl(this,()=>this.storage!=="off"&&this.storage!=="memory");#r=new Ul(this);#t=new Jl(this);#s=new lc(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",template:()=>this.definition.name,layout:()=>this.sidebarLayout});#o=new oc(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",template:()=>this.definition.name});#a=new xc(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",storageKey:()=>`${this.storageKey??cs(this.definition.name)}:unsent-text`});#l=!1;#p=new yc(this);#v=new Yl(this,()=>this.storage!=="off"&&this.storage!=="memory",()=>this.#c?.setTemplate(this.definition));#m;#c;#d=Kt;#x=null;#h=new Set;#u=null;#y;#g;#k;#$=[];#C;#N=new Promise(e=>{this.#C=e});#T;get locale(){return this.#v.locale}get definition(){const e=this.locale;return this.#m?.locale!==e&&(this.#m={locale:e,value:this.definitionFor(e)}),this.#m.value}connectedCallback(){super.connectedCallback(),this.dataset.template=this.definition.name,this.#e||(this.#e=!0,this.notesOpen=this.notes==="on"||this.notes==="open"),this.#E(),window.addEventListener("hashchange",this.#M),this.addEventListener("click",this.#q),this.addEventListener("dpk-comment-targets-change",this.#f),this.addEventListener("dpk-comment-request",this.#O),this.addEventListener("dpk-comment-submit",this.#j),this.addEventListener("dpk-element-action",this.#I),this.#k??=new MutationObserver(this.#f),this.#f()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("hashchange",this.#M),this.removeEventListener("click",this.#q),this.#g?.disconnect(),this.#k?.disconnect(),this.removeEventListener("dpk-comment-targets-change",this.#f),this.removeEventListener("dpk-comment-request",this.#O),this.removeEventListener("dpk-comment-submit",this.#j),this.removeEventListener("dpk-element-action",this.#I)}#E(e=0){if(this.#c){this.#_();return}if(this.childNodes.length===0&&e<2){queueMicrotask(()=>this.#E(e+1));return}this.#Z()}#_(){this.#y||(this.#y=this.#c?.subscribe(()=>this.#J()))}willUpdate(){this.dataset.theme=this.#n.resolve(Pe(this.theme))}updated(){this.#Q(),this.#Y(),this.#l&&(this.#l=!1,this.renderRoot.querySelector(".dpk-sidebar-toggle")?.focus())}get api(){return this.#T??=this.#K(),this.#T}get controller(){if(!this.#c)throw new Error(`<${this.tagName.toLowerCase()}> is not initialized yet`);return this.#c}get derivation(){return this.controller.derivation}get navigation(){return this.#d}dispatch(e){const s=this.controller.dispatch(e);return s.ok&&this.#a.settle([e.payload,e.note]),s.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:s.issues},bubbles:!0,composed:!0})),this.#b()),s}dispatchBatch(e){const s=this.controller.dispatchBatch(e);return s.ok&&this.#a.settle(e.flatMap(n=>[n.payload,n.note])),s.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:s.issues},bubbles:!0,composed:!0})),this.#b()),s}editComment(e,s){const n=this.controller.editComment(e,s);return n.ok&&this.#a.settle([s]),n.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:n.issues},bubbles:!0,composed:!0})),this.#b()),n}removeAction(e){this.controller.removeAction(e)}clearActions(){this.controller.clearActions()}navigate(e,s={}){const n=fe(this.#w());this.#d=Wt(this.#d,e,this.definition.navigationHierarchy),this.#S(s.replace??!1);const r=fe(this.#w());this.requestUpdate(),n!==r&&(this.#b(),this.dispatchEvent(new CustomEvent("dpk-navigate",{detail:{navigation:this.#d},bubbles:!0,composed:!0})))}hashFor(e){const s=this.#w();return fe(this.definition.resolveNavigation(this.derivation.state,Wt(s,e,this.definition.navigationHierarchy)))}requestComment(e){this.#x=typeof e=="string"?e:M(e),this.notesOpen=!0,this.requestUpdate()}get integratedReview(){return!1}get canSendToClaude(){return this.#r.available}sendToClaude(){return this.#r.send({brief:this.api.exportBrief(),draft:Dt(this.derivation.actions),anchor:this})}renderReviewPanel(e){return g`<dpk-component-comment-panel
2054
+ >`}}class Qc extends F{static{this.styles=Nc}static{this.properties={storageKey:{type:String,attribute:"storage-key"},storage:{type:String},notes:{type:String},theme:{type:String},notesOpen:{state:!0}}}#e=!1;#i=new _c(this);#n=new yc(this,()=>this.storage!=="off"&&this.storage!=="memory");#r=new bc(this);#t=new Tc(this);#s=new qc(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",template:()=>this.definition.name,layout:()=>this.sidebarLayout});#a=new jc(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",template:()=>this.definition.name});#o=new Jc(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",storageKey:()=>`${this.storageKey??ps(this.definition.name)}:unsent-text`});#l=!1;#p=new Yc(this);#x=new Cc(this,()=>this.storage!=="off"&&this.storage!=="memory",()=>this.#c?.setTemplate(this.definition));#m;#c;#d=Zt;#v=null;#h=new Set;#u=null;#y;#g;#k;#$=[];#T;#N=new Promise(e=>{this.#T=e});#C;get locale(){return this.#x.locale}get definition(){const e=this.locale;return this.#m?.locale!==e&&(this.#m={locale:e,value:this.definitionFor(e)}),this.#m.value}connectedCallback(){super.connectedCallback(),this.dataset.template=this.definition.name,this.#e||(this.#e=!0,this.notesOpen=this.notes==="on"||this.notes==="open"),this.#E(),window.addEventListener("hashchange",this.#O),this.addEventListener("click",this.#q),this.addEventListener("dpk-comment-targets-change",this.#f),this.addEventListener("dpk-comment-request",this.#M),this.addEventListener("dpk-comment-submit",this.#j),this.addEventListener("dpk-element-action",this.#I),this.#k??=new MutationObserver(this.#f),this.#f()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("hashchange",this.#O),this.removeEventListener("click",this.#q),this.#g?.disconnect(),this.#k?.disconnect(),this.removeEventListener("dpk-comment-targets-change",this.#f),this.removeEventListener("dpk-comment-request",this.#M),this.removeEventListener("dpk-comment-submit",this.#j),this.removeEventListener("dpk-element-action",this.#I)}#E(e=0){if(this.#c){this.#_();return}if(this.childNodes.length===0&&e<2){queueMicrotask(()=>this.#E(e+1));return}this.#Z()}#_(){this.#y||(this.#y=this.#c?.subscribe(()=>this.#J()))}willUpdate(){this.dataset.theme=this.#n.resolve(Oe(this.theme))}updated(){this.#Q(),this.#Y(),this.#l&&(this.#l=!1,this.renderRoot.querySelector(".dpk-sidebar-toggle")?.focus())}get api(){return this.#C??=this.#K(),this.#C}get controller(){if(!this.#c)throw new Error(`<${this.tagName.toLowerCase()}> is not initialized yet`);return this.#c}get derivation(){return this.controller.derivation}get navigation(){return this.#d}dispatch(e){const s=this.controller.dispatch(e);return s.ok&&this.#o.settle([e.payload,e.note]),s.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:s.issues},bubbles:!0,composed:!0})),this.#b()),s}dispatchBatch(e){const s=this.controller.dispatchBatch(e);return s.ok&&this.#o.settle(e.flatMap(n=>[n.payload,n.note])),s.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:s.issues},bubbles:!0,composed:!0})),this.#b()),s}editComment(e,s){const n=this.controller.editComment(e,s);return n.ok&&this.#o.settle([s]),n.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:n.issues},bubbles:!0,composed:!0})),this.#b()),n}removeAction(e){this.controller.removeAction(e)}clearActions(){this.controller.clearActions()}navigate(e,s={}){const n=ge(this.#w());this.#d=Vt(this.#d,e,this.definition.navigationHierarchy),this.#S(s.replace??!1);const r=ge(this.#w());this.requestUpdate(),n!==r&&(this.#b(),this.dispatchEvent(new CustomEvent("dpk-navigate",{detail:{navigation:this.#d},bubbles:!0,composed:!0})))}hashFor(e){const s=this.#w();return ge(this.definition.resolveNavigation(this.derivation.state,Vt(s,e,this.definition.navigationHierarchy)))}requestComment(e){this.#v=typeof e=="string"?e:M(e),this.notesOpen=!0,this.requestUpdate()}get integratedReview(){return!1}get canSendToClaude(){return this.#r.available}sendToClaude(){return this.#r.send({brief:this.api.exportBrief(),draft:Bt(this.derivation.actions),anchor:this})}renderReviewPanel(e){return k`<dpk-component-comment-panel
2248
2055
  .definition=${this.controller.definition}
2249
2056
  .state=${e.state}
2250
2057
  .navigation=${e.navigation}
@@ -2252,13 +2059,13 @@ The brief is too long for a comment, so it is stored in this artifact's database
2252
2059
  .issues=${this.controller.lastIssues}
2253
2060
  .exportBrief=${()=>this.api.exportBrief()}
2254
2061
  .sendToClaude=${this.canSendToClaude?()=>this.sendToClaude():void 0}
2255
- .pendingTarget=${this.#x}
2062
+ .pendingTarget=${this.#v}
2256
2063
  .embedded=${this.integratedReview}
2257
2064
  .onDelete=${s=>this.removeAction(s)}
2258
2065
  .onEditComment=${(s,n)=>this.editComment(s,n)}
2259
2066
  .onClear=${()=>this.clearActions()}
2260
- .onComment=${(s,n)=>{const r=this.dispatch({type:P,target:s,payload:{body:n}});return r.ok&&(this.#x=null),r}}
2261
- ></dpk-component-comment-panel>`}renderChrome(e,s){const n=e.actions.length,r=e.comments.length,i=N(this.locale),o=s.sidebarHidden===!0||!s.sidebar&&!this.hasSidebarContent(),a=this.sidebarLayout.side,l=!o&&this.#R&&this.#o.collapsed,c=o?m:this.#H(l);return g`
2067
+ .onComment=${(s,n)=>{const r=this.dispatch({type:z,target:s,payload:{body:n}});return r.ok&&(this.#v=null),r}}
2068
+ ></dpk-component-comment-panel>`}renderChrome(e,s){const n=e.actions.length,r=e.comments.length,i=D(this.locale),a=s.sidebarHidden===!0||!s.sidebar&&!this.hasSidebarContent(),o=this.sidebarLayout.side,l=!a&&this.#R&&this.#a.collapsed,c=a?g:this.#H(l);return k`
2262
2069
  <div class="dpk-shell" ?data-resizing=${this.#s.dragging}>
2263
2070
  <header class="dpk-header">
2264
2071
  <span class="dpk-brand" aria-hidden="true"></span>
@@ -2267,7 +2074,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
2267
2074
  <h1>${this.definition.title(e.state)}</h1>
2268
2075
  </div>
2269
2076
  <div class="dpk-header-slot">
2270
- ${s.header??m}
2077
+ ${s.header??g}
2271
2078
  <slot name="header"></slot>
2272
2079
  </div>
2273
2080
  <div class="dpk-header-meta">
@@ -2277,27 +2084,27 @@ The brief is too long for a comment, so it is stored in this artifact's database
2277
2084
  ${n} draft · ${r} note
2278
2085
  </span>
2279
2086
  </div>
2280
- <div class="dpk-header-tools">${this.#D()} ${this.#U()}</div>
2087
+ <div class="dpk-header-tools">${this.#U()} ${this.#B()}</div>
2281
2088
  </header>
2282
- <div class="dpk-body" data-sidebar-side=${a}>
2283
- ${a==="right"?c:m}
2089
+ <div class="dpk-body" data-sidebar-side=${o}>
2090
+ ${o==="right"?c:g}
2284
2091
  <aside
2285
2092
  id="dpk-sidebar"
2286
2093
  class="dpk-sidebar"
2287
- ?hidden=${o||l}
2094
+ ?hidden=${a||l}
2288
2095
  style=${`--dpk-sidebar-width: ${this.#s.width}px`}
2289
2096
  >
2290
- ${s.sidebar??m}
2097
+ ${s.sidebar??g}
2291
2098
  <slot name="sidebar"></slot>
2292
2099
  </aside>
2293
- ${a==="left"?c:m}
2100
+ ${o==="left"?c:g}
2294
2101
  <main class="dpk-main">
2295
2102
  <div class="dpk-main-body">
2296
- ${this.#u?g`<div class="dpk-banner" role="alert">
2103
+ ${this.#u?k`<div class="dpk-banner" role="alert">
2297
2104
  <strong>${i.baseDataError}</strong>
2298
2105
  <code>${this.#u}</code>
2299
- </div>`:m}
2300
- ${s.main??m}
2106
+ </div>`:g}
2107
+ ${s.main??g}
2301
2108
  <slot name="main"></slot>
2302
2109
  <section class="dpk-orphans" ?hidden=${this.#i.orphans===0}>
2303
2110
  <p class="dpk-label">previews without metadata</p>
@@ -2306,18 +2113,18 @@ The brief is too long for a comment, so it is stored in this artifact's database
2306
2113
  </div>
2307
2114
  <div class="dpk-memo" ?hidden=${!this.hasMemoContent()}>
2308
2115
  <details class="dpk-memo-fold">
2309
- <summary class="dpk-memo-bar">${es()} ${i.memo}</summary>
2116
+ <summary class="dpk-memo-bar">${ss()} ${i.memo}</summary>
2310
2117
  <div class="dpk-memo-body"><slot name="memo"></slot></div>
2311
2118
  </details>
2312
2119
  </div>
2313
2120
  </main>
2314
- ${this.integratedReview?m:g`<aside class="dpk-notes" ?hidden=${!this.notesOpen}>${this.renderReviewPanel(e)}</aside>`}
2121
+ ${this.integratedReview?g:k`<aside class="dpk-notes" ?hidden=${!this.notesOpen}>${this.renderReviewPanel(e)}</aside>`}
2315
2122
  </div>
2316
- ${s.footer||this.hasFooterContent()?g`<footer class="dpk-footer">
2317
- ${s.footer??m}
2123
+ ${s.footer||this.hasFooterContent()?k`<footer class="dpk-footer">
2124
+ ${s.footer??g}
2318
2125
  <slot name="footer"></slot>
2319
- </footer>`:m}
2320
- ${this.integratedReview?m:g`<button
2126
+ </footer>`:g}
2127
+ ${this.integratedReview?g:k`<button
2321
2128
  class="dpk-fab"
2322
2129
  type="button"
2323
2130
  aria-expanded=${this.notesOpen?"true":"false"}
@@ -2331,21 +2138,21 @@ The brief is too long for a comment, so it is stored in this artifact's database
2331
2138
  >
2332
2139
  ${i.review}
2333
2140
  </span>
2334
- ${n>0?g`<span class="dpk-fab-badge">${n}</span>`:m}
2141
+ ${n>0?k`<span class="dpk-fab-badge">${n}</span>`:g}
2335
2142
  </button>`}
2336
- ${this.integratedReview?m:this.#B(n)}
2143
+ ${this.integratedReview?g:this.#D(n)}
2337
2144
  </div>
2338
- `}#B(e){const s=zl({actions:e,railOpen:this.notesOpen,sendable:this.canSendToClaude,locale:this.locale},this.#t.state);if(!s)return m;const n=N(this.locale);return g`<div class="dpk-dock" role="group" aria-label=${n.handoffLabel}>
2339
- ${s.note?g`<p class="dpk-dock-note" role="alert">${s.note}</p>`:m}
2145
+ `}#D(e){const s=cc({actions:e,railOpen:this.notesOpen,sendable:this.canSendToClaude,locale:this.locale},this.#t.state);if(!s)return g;const n=D(this.locale);return k`<div class="dpk-dock" role="group" aria-label=${n.handoffLabel}>
2146
+ ${s.note?k`<p class="dpk-dock-note" role="alert">${s.note}</p>`:g}
2340
2147
  <div class="dpk-dock-actions">
2341
- ${s.send?g`<button
2148
+ ${s.send?k`<button
2342
2149
  class="dpk-btn dpk-btn--accent"
2343
2150
  type="button"
2344
2151
  ?disabled=${s.send.disabled}
2345
2152
  @click=${()=>{this.#t.send(()=>this.sendToClaude())}}
2346
2153
  >
2347
2154
  ${s.send.label}
2348
- </button>`:m}
2155
+ </button>`:g}
2349
2156
  <button
2350
2157
  class=${s.send?"dpk-btn":"dpk-btn dpk-btn--accent"}
2351
2158
  type="button"
@@ -2356,41 +2163,41 @@ The brief is too long for a comment, so it is stored in this artifact's database
2356
2163
  ${s.copy.label}
2357
2164
  </button>
2358
2165
  </div>
2359
- </div>`}#D(){const e=this.locale,s=N(e).language;return g`<select
2166
+ </div>`}#U(){const e=this.locale,s=D(e).language;return k`<select
2360
2167
  class="dpk-lang-select"
2361
2168
  aria-label=${s}
2362
2169
  title=${s}
2363
- @change=${ns(n=>{const r=xt.find(i=>i===n);r!==void 0&&this.#v.pick(r)})}
2170
+ @change=${is(n=>{const r=yt.find(i=>i===n);r!==void 0&&this.#x.pick(r)})}
2364
2171
  >
2365
- ${xt.map(n=>g`<option value=${n} lang=${n} ?selected=${n===e}>
2366
- ${aa[n]}
2172
+ ${yt.map(n=>k`<option value=${n} lang=${n} ?selected=${n===e}>
2173
+ ${fo[n]}
2367
2174
  </option>`)}
2368
- </select>`}#U(){const e=this.dataset.theme==="dark",s=N(this.locale),n=e?s.useLightTheme:s.useDarkTheme;return g`<button
2175
+ </select>`}#B(){const e=this.dataset.theme==="dark",s=D(this.locale),n=e?s.useLightTheme:s.useDarkTheme;return k`<button
2369
2176
  class="dpk-theme-toggle"
2370
2177
  type="button"
2371
2178
  aria-label=${n}
2372
2179
  title=${n}
2373
- @click=${()=>this.#n.toggle(Pe(this.theme))}
2180
+ @click=${()=>this.#n.toggle(Oe(this.theme))}
2374
2181
  >
2375
- ${e?Aa():Ca()}
2376
- </button>`}get#R(){return this.sidebarLayout.collapsible!==!1}#H(e){const s=this.#R?this.#F(e):m;return e?g`<div class="dpk-sidebar-strip">${s}</div>`:this.sidebarLayout.side==="left"?g`${this.#L()}${s}`:g`${s}${this.#L()}`}#F(e){const s=N(this.locale),n=rc(this.sidebarLayout.side,e),r=n.action==="collapse"?s.collapseSidebar:s.expandSidebar;return g`<button
2182
+ ${e?tl():sl()}
2183
+ </button>`}get#R(){return this.sidebarLayout.collapsible!==!1}#H(e){const s=this.#R?this.#F(e):g;return e?k`<div class="dpk-sidebar-strip">${s}</div>`:this.sidebarLayout.side==="left"?k`${this.#L()}${s}`:k`${s}${this.#L()}`}#F(e){const s=D(this.locale),n=Oc(this.sidebarLayout.side,e),r=n.action==="collapse"?s.collapseSidebar:s.expandSidebar;return k`<button
2377
2184
  class="dpk-sidebar-toggle"
2378
2185
  type="button"
2379
2186
  aria-controls="dpk-sidebar"
2380
2187
  aria-expanded=${e?"false":"true"}
2381
2188
  aria-label=${r}
2382
2189
  title=${r}
2383
- @click=${()=>{this.#l=!0,this.#o.toggle()}}
2190
+ @click=${()=>{this.#l=!0,this.#a.toggle()}}
2384
2191
  >
2385
- ${n.points==="left"?Qn():es()}
2386
- </button>`}#L(){const e=N(this.locale),s=this.#s.handlers;return g`<div
2192
+ ${n.points==="left"?ir():ss()}
2193
+ </button>`}#L(){const e=D(this.locale),s=this.#s.handlers;return k`<div
2387
2194
  class="dpk-sidebar-resizer"
2388
2195
  role="separator"
2389
2196
  tabindex="0"
2390
2197
  aria-orientation="vertical"
2391
2198
  aria-label=${e.resizeSidebar}
2392
- aria-valuemin=${G.min}
2393
- aria-valuemax=${G.max}
2199
+ aria-valuemin=${J.min}
2200
+ aria-valuemax=${J.max}
2394
2201
  aria-valuenow=${this.#s.width}
2395
2202
  title=${e.resizeSidebarHint}
2396
2203
  @pointerdown=${s.pointerdown}
@@ -2399,4 +2206,4 @@ The brief is too long for a comment, so it is stored in this artifact's database
2399
2206
  @pointercancel=${s.pointercancel}
2400
2207
  @keydown=${s.keydown}
2401
2208
  @dblclick=${s.dblclick}
2402
- ></div>`}render(){if(!this.#c)return m;const e=this.#z();return this.renderChrome(e,this.renderRegions(e))}get sidebarLayout(){return ec}hasSidebarContent(){return this.querySelector('[slot="sidebar"]')!==null}hasMemoContent(){return this.querySelector('[slot="memo"]')!==null}hasFooterContent(){return this.querySelector('[slot="footer"]')!==null}context(){return this.#z()}#A(){return{definition:this.definition,controller:()=>this.controller,derivation:()=>this.derivation,ready:this.#N,navigation:()=>this.#w(),issues:()=>this.controller.lastIssues,dispatch:e=>this.dispatch(e),dispatchBatch:e=>this.dispatchBatch(e),subscribe:e=>(this.#h.add(e),()=>{this.#h.delete(e)}),editComment:(e,s)=>this.editComment(e,s),removeAction:e=>this.removeAction(e),clearActions:()=>this.clearActions(),navigate:(e,s)=>this.navigate(e,s),hashFor:e=>this.hashFor(e),requestComment:e=>this.requestComment(e)}}#K(){return Ol(this.#A(),this)}#P(){return Cr(this.#A())}#z(){return Ml(this.#A())}#w(){return this.definition.resolveNavigation(this.derivation.state,this.#d)}#Z(){const e=this.#V();this.#d=zr();const s=this.storageKey;this.#c=new $r({definition:this.definition,base:e,storage:this.#W(),...typeof s=="string"?{storageKey:s}:{}}),this.#_(),this.#f(),this.#S(!0),this.#C?.(),this.#G(),this.requestUpdate()}#W(){return this.storage==="off"?null:this.storage==="memory"?new as:ls()}#V(){const e=this.querySelector('script[type="application/json"]');if(!e?.textContent||e.textContent.trim().length===0)return console.warn(`[dev-process-kit] <${this.tagName.toLowerCase()}> has no base JSON; starting from an empty state.`),this.#u='no <script type="application/json"> child found',this.definition.emptyBase();try{return this.definition.parseBase(JSON.parse(e.textContent))}catch(s){return console.error("[dev-process-kit] invalid base data:",s),this.#u=s instanceof Error?s.message:String(s),this.definition.emptyBase()}}#G(){this.querySelector('script[type="application/json"]')||(this.#g=new MutationObserver(()=>{const e=this.querySelector('script[type="application/json"]');if(e){this.#g?.disconnect(),this.#g=void 0;try{this.controller.setBase(this.definition.parseBase(JSON.parse(e.textContent??"null")))}catch(s){console.error("[dev-process-kit] invalid base data:",s)}}}),this.#g.observe(this,{childList:!0,subtree:!0}))}#b(){const e=this.#P();for(const s of this.#h)s(e)}#J(){if(!this.isConnected){this.requestUpdate(),this.#b();return}this.#S(!0),Pr(this.#$,this.controller.actions),queueMicrotask(this.#f),this.requestUpdate(),this.#b(),this.dispatchEvent(new CustomEvent("dpk-change",{detail:this.#P(),bubbles:!0,composed:!0}))}#S(e){const s=this.#w();this.#d=s,Ql(s,e)}#M=()=>{this.#d=zr(),this.#S(!0),this.requestUpdate(),this.#b(),this.dispatchEvent(new CustomEvent("dpk-navigate",{detail:{navigation:this.#d},bubbles:!0,composed:!0}))};#f=()=>{this.#k?.disconnect(),this.#$=Zl(this,e=>{this.isConnected&&this.#k?.observe(e,{childList:!0,subtree:!0})}),this.#c&&(Pr(this.#$,this.#c.actions),this.#c.setComponentSnapshot(Vl(this.#$)))};#O=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!this.#c)return;const s=e.detail;typeof s!="object"||s===null||!("target"in s)||typeof s.target!="string"||(this.#f(),!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(r=>r.value===s.target))||this.requestComment(s.target)};#j=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!e.cancelable||!this.#c)return;const s=S(Ja,e.detail);if(!s.success)return;this.#f();const{target:n,body:r}=s.output;if(!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(a=>a.value===n))return;this.dispatch({type:P,target:n,payload:{body:r}}).ok&&e.preventDefault()};#I=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!e.cancelable||!this.#c)return;const s=S(ea,e.detail);if(!s.success)return;this.#f();const{type:n,target:r,payload:i}=s.output;if(!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(l=>l.value===r))return;this.dispatch({type:n,target:r,payload:i}).ok&&e.preventDefault()};#q=e=>{for(const s of e.composedPath()){if(!(s instanceof Element))continue;if(s===this||s.hasAttribute("data-template"))break;const n=s.getAttribute("data-dpk-navigate");if(n!==null){e.preventDefault(),this.navigate(Zt(n.includes("=")?n:`step=${n}`));return}const r=s.getAttribute("data-dpk-comment");if(r!==null){e.preventDefault(),this.requestComment(r);return}}};#Y(){const e=this.renderRoot.querySelector(".dpk-shell"),s=this.renderRoot.querySelector(".dpk-dock-actions");e&&(s?e.style.setProperty("--dpk-dock-space",`${s.offsetWidth+8}px`):e.style.removeProperty("--dpk-dock-space"))}#Q(){this.#i.route()}}export{Le as $,Xt as A,xa as B,P as C,Xn as D,Kt as E,q as F,Gn as G,Yn as H,Qt as I,Jn as J,Vn as K,vr as L,as as M,Zt as N,Ln as O,Do as P,Wt as Q,Uo as R,Dt as S,wc as T,Pn as U,M as V,os as W,tt as X,qt as Y,Ze as Z,er as _,Ut as a,Ke as a0,vi as a1,D as a2,m as a3,g as a4,Wn as a5,ti as a6,H as a7,wt as a8,$a as a9,V as aA,Za as aB,ns as aC,Wa as aD,it as aE,ce as aF,Jt as aG,Gt as aH,vn as aI,No as aJ,Io as aK,Ds as aL,kn as aM,bt as aN,Ws as aO,De as aP,Ue as aQ,mt as aR,Qn as aS,va as aT,ba as aU,xn as aV,Sa as aa,It as ab,ue as ac,_e as ad,Z as ae,k as af,Xe as ag,x as ah,w as ai,En as aj,Rn as ak,W as al,he as am,An as an,jt as ao,S as ap,C as aq,Cn as ar,Ot as as,wn as at,yn as au,Tn as av,qo as aw,es as ax,L as ay,Oe as az,bn as b,$r as c,Bt as d,Ho as e,Vt as f,On as g,Re as h,kr as i,$t as j,zn as k,Wo as l,Nt as m,ls as n,cs as o,Bo as p,La as q,Co as r,Ba as s,br as t,ie as u,Ko as v,fe as w,wa as x,ya as y,Yt as z};
2209
+ ></div>`}render(){if(!this.#c)return g;const e=this.#z();return this.renderChrome(e,this.renderRegions(e))}get sidebarLayout(){return Rc}hasSidebarContent(){return this.querySelector('[slot="sidebar"]')!==null}hasMemoContent(){return this.querySelector('[slot="memo"]')!==null}hasFooterContent(){return this.querySelector('[slot="footer"]')!==null}context(){return this.#z()}#A(){return{definition:this.definition,controller:()=>this.controller,derivation:()=>this.derivation,ready:this.#N,navigation:()=>this.#w(),issues:()=>this.controller.lastIssues,dispatch:e=>this.dispatch(e),dispatchBatch:e=>this.dispatchBatch(e),subscribe:e=>(this.#h.add(e),()=>{this.#h.delete(e)}),editComment:(e,s)=>this.editComment(e,s),removeAction:e=>this.removeAction(e),clearActions:()=>this.clearActions(),navigate:(e,s)=>this.navigate(e,s),hashFor:e=>this.hashFor(e),requestComment:e=>this.requestComment(e)}}#K(){return pc(this.#A(),this)}#P(){return zr(this.#A())}#z(){return dc(this.#A())}#w(){return this.definition.resolveNavigation(this.derivation.state,this.#d)}#Z(){const e=this.#V();this.#d=Dr();const s=this.storageKey;this.#c=new Rr({definition:this.definition,base:e,storage:this.#W(),...typeof s=="string"?{storageKey:s}:{}}),this.#_(),this.#f(),this.#S(!0),this.#T?.(),this.#G(),this.requestUpdate()}#W(){return this.storage==="off"?null:this.storage==="memory"?new cs:ds()}#V(){const e=this.querySelector('script[type="application/json"]');if(!e?.textContent||e.textContent.trim().length===0)return console.warn(`[dev-process-kit] <${this.tagName.toLowerCase()}> has no base JSON; starting from an empty state.`),this.#u='no <script type="application/json"> child found',this.definition.emptyBase();try{return this.definition.parseBase(JSON.parse(e.textContent))}catch(s){return console.error("[dev-process-kit] invalid base data:",s),this.#u=s instanceof Error?s.message:String(s),this.definition.emptyBase()}}#G(){this.querySelector('script[type="application/json"]')||(this.#g=new MutationObserver(()=>{const e=this.querySelector('script[type="application/json"]');if(e){this.#g?.disconnect(),this.#g=void 0;try{this.controller.setBase(this.definition.parseBase(JSON.parse(e.textContent??"null")))}catch(s){console.error("[dev-process-kit] invalid base data:",s)}}}),this.#g.observe(this,{childList:!0,subtree:!0}))}#b(){const e=this.#P();for(const s of this.#h)s(e)}#J(){if(!this.isConnected){this.requestUpdate(),this.#b();return}this.#S(!0),Nr(this.#$,this.controller.actions),queueMicrotask(this.#f),this.requestUpdate(),this.#b(),this.dispatchEvent(new CustomEvent("dpk-change",{detail:this.#P(),bubbles:!0,composed:!0}))}#S(e){const s=this.#w();this.#d=s,Ec(s,e)}#O=()=>{this.#d=Dr(),this.#S(!0),this.requestUpdate(),this.#b(),this.dispatchEvent(new CustomEvent("dpk-navigate",{detail:{navigation:this.#d},bubbles:!0,composed:!0}))};#f=()=>{this.#k?.disconnect(),this.#$=wc(this,e=>{this.isConnected&&this.#k?.observe(e,{childList:!0,subtree:!0})}),this.#c&&(Nr(this.#$,this.#c.actions),this.#c.setComponentSnapshot(Sc(this.#$)))};#M=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!this.#c)return;const s=e.detail;typeof s!="object"||s===null||!("target"in s)||typeof s.target!="string"||(this.#f(),!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(r=>r.value===s.target))||this.requestComment(s.target)};#j=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!e.cancelable||!this.#c)return;const s=S(Tl,e.detail);if(!s.success)return;this.#f();const{target:n,body:r}=s.output;if(!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(o=>o.value===n))return;this.dispatch({type:z,target:n,payload:{body:r}}).ok&&e.preventDefault()};#I=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!e.cancelable||!this.#c)return;const s=S(ao,e.detail);if(!s.success)return;this.#f();const{type:n,target:r,payload:i}=s.output;if(!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(l=>l.value===r))return;this.dispatch({type:n,target:r,payload:i}).ok&&e.preventDefault()};#q=e=>{for(const s of e.composedPath()){if(!(s instanceof Element))continue;if(s===this||s.hasAttribute("data-template"))break;const n=s.getAttribute("data-dpk-navigate");if(n!==null){e.preventDefault(),this.navigate(Wt(n.includes("=")?n:`step=${n}`));return}const r=s.getAttribute("data-dpk-comment");if(r!==null){e.preventDefault(),this.requestComment(r);return}}};#Y(){const e=this.renderRoot.querySelector(".dpk-shell"),s=this.renderRoot.querySelector(".dpk-dock-actions");e&&(s?e.style.setProperty("--dpk-dock-space",`${s.offsetWidth+8}px`):e.style.removeProperty("--dpk-dock-space"))}#Q(){this.#i.route()}}export{ze as $,ts as A,Go as B,z as C,ar as D,Zt as E,N as F,sr as G,rr as H,es as I,nr as J,tr as K,Tr as L,cs as M,Wt as N,On as O,Wa as P,Vt as Q,Va as R,Bt as S,Qc as T,Mn as U,M as V,ls as W,nt as X,Nt as Y,Ve as Z,or as _,Ht as a,wn as a$,We as a0,Ti as a1,B as a2,g as a3,k as a4,Jn as a5,Vo as a6,li as a7,F as a8,$t as a9,P as aA,Ie as aB,G as aC,wl as aD,is as aE,$l as aF,ot as aG,de as aH,Yt as aI,Jt as aJ,yn as aK,Ka as aL,Ha as aM,Hs as aN,xn as aO,T as aP,Qn as aQ,Xn as aR,vt as aS,Gs as aT,$e as aU,He as aV,bt as aW,ir as aX,Wo as aY,Zo as aZ,An as a_,Xo as aa,el as ab,qt as ac,fe as ad,Le as ae,W as af,m as ag,tt as ah,v as ai,w as aj,Ln as ak,zn as al,V as am,ue as an,En as ao,ss as ap,Qo as aq,It as ar,S as as,C as at,_n as au,jt as av,Sn as aw,$n as ax,Rn as ay,Fa as az,vn as b,Yn as b0,er as b1,Rr as c,Ut as d,Ga as e,Gt as f,qn as g,Pe as h,Sr as i,St as j,jn as k,Xa as l,Dt as m,ds as n,ps as o,Za as p,ol as q,Pa as r,ml as s,Ar as t,ae as u,Ya as v,ge as w,Yo as x,Jo as y,Xt as z};