dev-process-kit 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/shared-BjyoXjSO.js +1 -0
- package/dist/chunks/shared-C-d71uRP.js +573 -0
- package/dist/chunks/{shared-BkM7jfZs.js → shared-C5n6LBUz.js} +41 -40
- package/dist/chunks/{shared-BCmqTEeQ.js → shared-CAWKGcWJ.js} +55 -53
- package/dist/chunks/{shared-DLdJfSN-.js → shared-CdZhkPto.js} +1 -1
- package/dist/chunks/{shared-C02b6b2m.js → shared-DB_C1Mdu.js} +1 -1
- package/dist/chunks/{shared-Ae8HmujL.js → shared-DDOpqbVL.js} +1 -1
- package/dist/chunks/shared-DeXM1v86.js +610 -0
- package/dist/chunks/{shared-DbBoZvUP.js → shared-DehzCTC2.js} +179 -172
- package/dist/chunks/{shared-v63w_5VP.js → shared-Dfj6O0K4.js} +1 -1
- package/dist/chunks/{shared-DnJBtKmH.js → shared-DiFAX1_p.js} +155 -144
- package/dist/chunks/{shared-DbnPOaXf.js → shared-DkPo0jX3.js} +236 -232
- package/dist/chunks/{shared-Bo8OdTee.js → shared-GL2Z98Cz.js} +1 -1
- package/dist/chunks/shared-cMhjZGRs.js +301 -0
- package/dist/chunks/{shared-DJruxrrR.js → shared-zZF1zU0o.js} +1 -1
- package/dist/components.js +1 -1
- package/dist/index.js +1 -1
- package/dist/templates/delegation-poker.js +1 -1
- package/dist/templates/event-storming.js +1 -1
- package/dist/templates/example-mapping.js +1 -1
- package/dist/templates/plain.js +1 -1
- package/dist/templates/prototype.js +1 -1
- package/dist/templates/slides.js +1 -1
- package/dist/templates/task-board.js +1 -1
- package/dist/templates/usm.js +1 -1
- package/dist/templates/whiteboard.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/shared-C-7mxPbV.js +0 -301
- package/dist/chunks/shared-C-Os1zsf.js +0 -572
- package/dist/chunks/shared-DYKbMmHn.js +0 -610
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
const
|
|
2
|
-
\f\r]`,rt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,
|
|
3
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),hr=/'/g,ur=/"/g,fr=/^(?:script|style|textarea|title)$/i,gr=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),m=gr(1),rl=gr(2),K=Symbol.for("lit-noChange"),k=Symbol.for("lit-nothing"),mr=new WeakMap,Te=Se.createTreeWalker(Se,129);function kr(t,e){if(!En(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return ar!==void 0?ar.createHTML(e):e}const il=(t,e)=>{const n=t.length-1,s=[];let r,i=e===2?"<svg>":e===3?"<math>":"",o=rt;for(let a=0;a<n;a++){const l=t[a];let d,c,p=-1,u=0;for(;u<l.length&&(o.lastIndex=u,c=o.exec(l),c!==null);)u=o.lastIndex,o===rt?c[1]==="!--"?o=dr:c[1]!==void 0?o=pr:c[2]!==void 0?(fr.test(c[2])&&(r=RegExp("</"+c[2],"g")),o=Ae):c[3]!==void 0&&(o=Ae):o===Ae?c[0]===">"?(o=r??rt,p=-1):c[1]===void 0?p=-2:(p=o.lastIndex-c[2].length,d=c[1],o=c[3]===void 0?Ae:c[3]==='"'?ur:hr):o===ur||o===hr?o=Ae:o===dr||o===pr?o=rt:(o=Ae,r=void 0);const h=o===Ae&&t[a+1].startsWith("/>")?" ":"";i+=o===rt?l+nl:p>=0?(s.push(d),l.slice(0,p)+lr+l.slice(p)+ge+h):l+ge+(p===-2?a:h)}return[kr(t,i+(t[n]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),s]};let _n=class Fa{constructor({strings:e,_$litType$:n},s){let r;this.parts=[];let i=0,o=0;const a=e.length-1,l=this.parts,[d,c]=il(e,n);if(this.el=Fa.createElement(d,s),Te.currentNode=this.el.content,n===2||n===3){const p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(r=Te.nextNode())!==null&&l.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(const p of r.getAttributeNames())if(p.endsWith(lr)){const u=c[o++],h=r.getAttribute(p).split(ge),f=/([.?@])?(.*)/.exec(u);l.push({type:1,index:i,name:f[2],strings:h,ctor:f[1]==="."?al:f[1]==="?"?ll:f[1]==="@"?cl:Ot}),r.removeAttribute(p)}else p.startsWith(ge)&&(l.push({type:6,index:i}),r.removeAttribute(p));if(fr.test(r.tagName)){const p=r.textContent.split(ge),u=p.length-1;if(u>0){r.textContent=Rt?Rt.emptyScript:"";for(let h=0;h<u;h++)r.append(p[h],nt()),Te.nextNode(),l.push({type:2,index:++i});r.append(p[u],nt())}}}else if(r.nodeType===8)if(r.data===cr)l.push({type:2,index:i});else{let p=-1;for(;(p=r.data.indexOf(ge,p+1))!==-1;)l.push({type:7,index:i}),p+=ge.length-1}i++}}static createElement(e,n){const s=Se.createElement("template");return s.innerHTML=e,s}};function He(t,e,n=t,s){if(e===K)return e;let r=s!==void 0?n._$Co?.[s]:n._$Cl;const i=st(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,n,s)),s!==void 0?(n._$Co??=[])[s]=r:n._$Cl=r),r!==void 0&&(e=He(t,r._$AS(t,e.values),r,s)),e}let ol=class{constructor(e,n){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=n}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:n},parts:s}=this._$AD,r=(e?.creationScope??Se).importNode(n,!0);Te.currentNode=r;let i=Te.nextNode(),o=0,a=0,l=s[0];for(;l!==void 0;){if(o===l.index){let d;l.type===2?d=new _t(i,i.nextSibling,this,e):l.type===1?d=new l.ctor(i,l.name,l.strings,this,e):l.type===6&&(d=new dl(i,this,e)),this._$AV.push(d),l=s[++a]}o!==l?.index&&(i=Te.nextNode(),o++)}return Te.currentNode=Se,r}p(e){let n=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(e,s,n),n+=s.strings.length-2):s._$AI(e[n])),n++}},_t=class Wa{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,n,s,r){this.type=2,this._$AH=k,this._$AN=void 0,this._$AA=e,this._$AB=n,this._$AM=s,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const n=this._$AM;return n!==void 0&&e?.nodeType===11&&(e=n.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,n=this){e=He(this,e,n),st(e)?e===k||e==null||e===""?(this._$AH!==k&&this._$AR(),this._$AH=k):e!==this._$AH&&e!==K&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):sl(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!==k&&st(this._$AH)?this._$AA.nextSibling.data=e:this.T(Se.createTextNode(e)),this._$AH=e}$(e){const{values:n,_$litType$:s}=e,r=typeof s=="number"?this._$AC(e):(s.el===void 0&&(s.el=_n.createElement(kr(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===r)this._$AH.p(n);else{const i=new ol(r,this),o=i.u(this.options);i.p(n),this.T(o),this._$AH=i}}_$AC(e){let n=mr.get(e.strings);return n===void 0&&mr.set(e.strings,n=new _n(e)),n}k(e){En(this._$AH)||(this._$AH=[],this._$AR());const n=this._$AH;let s,r=0;for(const i of e)r===n.length?n.push(s=new Wa(this.O(nt()),this.O(nt()),this,this.options)):s=n[r],s._$AI(i),r++;r<n.length&&(this._$AR(s&&s._$AB.nextSibling,r),n.length=r)}_$AR(e=this._$AA.nextSibling,n){for(this._$AP?.(!1,!0,n);e!==this._$AB;){const s=or(e).nextSibling;or(e).remove(),e=s}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}};class Ot{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,n,s,r,i){this.type=1,this._$AH=k,this._$AN=void 0,this.element=e,this.name=n,this._$AM=r,this.options=i,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=k}_$AI(e,n=this,s,r){const i=this.strings;let o=!1;if(i===void 0)e=He(this,e,n,0),o=!st(e)||e!==this._$AH&&e!==K,o&&(this._$AH=e);else{const a=e;let l,d;for(e=i[0],l=0;l<i.length-1;l++)d=He(this,a[s+l],n,l),d===K&&(d=this._$AH[l]),o||=!st(d)||d!==this._$AH[l],d===k?e=k:e!==k&&(e+=(d??"")+i[l+1]),this._$AH[l]=d}o&&!r&&this.j(e)}j(e){e===k?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}let al=class extends Ot{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===k?void 0:e}},ll=class extends Ot{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==k)}},cl=class extends Ot{constructor(e,n,s,r,i){super(e,n,s,r,i),this.type=5}_$AI(e,n=this){if((e=He(this,e,n,0)??k)===K)return;const s=this._$AH,r=e===k&&s!==k||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,i=e!==k&&(s===k||r);r&&this.element.removeEventListener(this.name,this,s),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 dl{constructor(e,n,s){this.element=e,this.type=6,this._$AN=void 0,this._$AM=n,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(e){He(this,e)}}const pl={I:_t},hl=Cn.litHtmlPolyfillSupport;hl?.(_n,_t),(Cn.litHtmlVersions??=[]).push("3.3.3");const ul=(t,e,n)=>{const s=n?.renderBefore??e;let r=s._$litPart$;if(r===void 0){const i=n?.renderBefore??null;s._$litPart$=r=new _t(e.insertBefore(nt(),i),i,void 0,n??{})}return r._$AI(t),r},On=globalThis;let me=class extends Be{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=ul(n,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return K}};me._$litElement$=!0,me.finalized=!0,On.litElementHydrateSupport?.({LitElement:me});const fl=On.litElementPolyfillSupport;fl?.({LitElement:me}),(On.litElementVersions??=[]).push("4.2.2");const ke={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4},it=t=>(...e)=>({_$litDirective$:t,values:e});let Lt=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,n,s){this._$Ct=e,this._$AM=n,this._$Ci=s}_$AS(e,n){return this.update(e,n)}update(e,n){return this.render(...n)}};const{I:gl}=pl,br=t=>t,ml=t=>t.strings===void 0,vr=()=>document.createComment(""),ot=(t,e,n)=>{const s=t._$AA.parentNode,r=e===void 0?t._$AB:e._$AA;if(n===void 0){const i=s.insertBefore(vr(),r),o=s.insertBefore(vr(),r);n=new gl(i,o,t,t.options)}else{const i=n._$AB.nextSibling,o=n._$AM,a=o!==t;if(a){let l;n._$AQ?.(t),n._$AM=t,n._$AP!==void 0&&(l=t._$AU)!==o._$AU&&n._$AP(l)}if(i!==r||a){let l=n._$AA;for(;l!==i;){const d=br(l).nextSibling;br(s).insertBefore(l,r),l=d}}}return n},Ce=(t,e,n=t)=>(t._$AI(e,n),t),kl={},Ln=(t,e=kl)=>t._$AH=e,bl=t=>t._$AH,Pn=t=>{t._$AR(),t._$AA.remove()},zn=it(class extends Lt{constructor(t){if(super(t),t.type!==ke.PROPERTY&&t.type!==ke.ATTRIBUTE&&t.type!==ke.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!ml(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,[e]){if(e===K||e===k)return e;const n=t.element,s=t.name;if(t.type===ke.PROPERTY){if(e===n[s])return K}else if(t.type===ke.BOOLEAN_ATTRIBUTE){if(!!e===n.hasAttribute(s))return K}else if(t.type===ke.ATTRIBUTE&&n.getAttribute(s)===e+"")return K;return Ln(t),e}});class Pt extends Lt{constructor(e){if(super(e),this.it=k,e.type!==ke.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===k||e==null)return this._t=void 0,this.it=e;if(e===K)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const n=[e];return n.raw=n,this._t={_$litType$:this.constructor.resultType,strings:n,values:[]}}}Pt.directiveName="unsafeHTML",Pt.resultType=1;const xr=it(Pt),zt=t=>{let e=t;for(;e!==null;){if(e instanceof Element){const n=e.getAttribute("lang");if(n!==null)return n}e=e instanceof ShadowRoot?e.host:e.parentNode}return null},Mn=["en","ja"],yr="en",wr=t=>Mn.some(e=>e===t),Mt=t=>{const e=(t??"").split("-")[0]?.toLowerCase()??"";return wr(e)?e:yr},$r=t=>Mt(zt(t)),In="dpk-locale-change",Sr=t=>typeof t=="string"&&wr(t)?t:null,vl=t=>t.preference??t.authored,xl=(t,e)=>t===e?null:t,It=t=>e=>e==="ja"?t.ja:t.en;class Nn{#e;#t;#n=yr;constructor(e,n=()=>{}){this.#e=e,this.#t=n,e.addController(this)}get locale(){return this.#n}hostConnected(){this.#n=$r(this.#e),document.addEventListener(In,this.#r)}hostDisconnected(){document.removeEventListener(In,this.#r)}#r=()=>{const e=$r(this.#e);e!==this.#n&&(this.#n=e,this.#t(),this.#e.requestUpdate())}}const yl={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)"]},Ar=t=>tr(Object.entries(yl).map(([e,[n,s]])=>`--dpk-${e}: ${t(n,s)};`).join(`
|
|
4
|
-
`)),
|
|
1
|
+
const Et=globalThis,An=Et.ShadowRoot&&(Et.ShadyCSS===void 0||Et.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Tn=Symbol(),er=new WeakMap;let tr=class{constructor(e,n,s){if(this._$cssResult$=!0,s!==Tn)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=n}get styleSheet(){let e=this.o;const n=this.t;if(An&&e===void 0){const s=n!==void 0&&n.length===1;s&&(e=er.get(n)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),s&&er.set(n,e))}return e}toString(){return this.cssText}};const nr=t=>new tr(typeof t=="string"?t:t+"",void 0,Tn),fe=(t,...e)=>{const n=t.length===1?t[0]:e.reduce((s,r,i)=>s+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+t[i+1],t[0]);return new tr(n,t,Tn)},Ka=(t,e)=>{if(An)t.adoptedStyleSheets=e.map(n=>n instanceof CSSStyleSheet?n:n.styleSheet);else for(const n of e){const s=document.createElement("style"),r=Et.litNonce;r!==void 0&&s.setAttribute("nonce",r),s.textContent=n.cssText,t.appendChild(s)}},sr=An?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let n="";for(const s of e.cssRules)n+=s.cssText;return nr(n)})(t):t,{is:Qa,defineProperty:Za,getOwnPropertyDescriptor:Ya,getOwnPropertyNames:Ja,getOwnPropertySymbols:Xa,getPrototypeOf:el}=Object,Rt=globalThis,rr=Rt.trustedTypes,tl=rr?rr.emptyScript:"",nl=Rt.reactiveElementPolyfillSupport,tt=(t,e)=>t,Cn={toAttribute(t,e){switch(e){case Boolean:t=t?tl:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let n=t;switch(e){case Boolean:n=t!==null;break;case Number:n=t===null?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch{n=null}}return n}},ir=(t,e)=>!Qa(t,e),or={attribute:!0,type:String,converter:Cn,reflect:!1,useDefault:!1,hasChanged:ir};Symbol.metadata??=Symbol("metadata"),Rt.litPropertyMetadata??=new WeakMap;let Be=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,n=or){if(n.state&&(n.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((n=Object.create(n)).wrapped=!0),this.elementProperties.set(e,n),!n.noAccessor){const s=Symbol(),r=this.getPropertyDescriptor(e,s,n);r!==void 0&&Za(this.prototype,e,r)}}static getPropertyDescriptor(e,n,s){const{get:r,set:i}=Ya(this.prototype,e)??{get(){return this[n]},set(o){this[n]=o}};return{get:r,set(o){const a=r?.call(this);i?.call(this,o),this.requestUpdate(e,a,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??or}static _$Ei(){if(this.hasOwnProperty(tt("elementProperties")))return;const e=el(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(tt("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(tt("properties"))){const n=this.properties,s=[...Ja(n),...Xa(n)];for(const r of s)this.createProperty(r,n[r])}const e=this[Symbol.metadata];if(e!==null){const n=litPropertyMetadata.get(e);if(n!==void 0)for(const[s,r]of n)this.elementProperties.set(s,r)}this._$Eh=new Map;for(const[n,s]of this.elementProperties){const r=this._$Eu(n,s);r!==void 0&&this._$Eh.set(r,n)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const n=[];if(Array.isArray(e)){const s=new Set(e.flat(1/0).reverse());for(const r of s)n.unshift(sr(r))}else e!==void 0&&n.push(sr(e));return n}static _$Eu(e,n){const s=n.attribute;return s===!1?void 0:typeof s=="string"?s:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,n=this.constructor.elementProperties;for(const s of n.keys())this.hasOwnProperty(s)&&(e.set(s,this[s]),delete this[s]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Ka(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,n,s){this._$AK(e,s)}_$ET(e,n){const s=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,s);if(r!==void 0&&s.reflect===!0){const i=(s.converter?.toAttribute!==void 0?s.converter:Cn).toAttribute(n,s.type);this._$Em=e,i==null?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,n){const s=this.constructor,r=s._$Eh.get(e);if(r!==void 0&&this._$Em!==r){const i=s.getPropertyOptions(r),o=typeof i.converter=="function"?{fromAttribute:i.converter}:i.converter?.fromAttribute!==void 0?i.converter:Cn;this._$Em=r;const a=o.fromAttribute(n,i.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(e,n,s,r=!1,i){if(e!==void 0){const o=this.constructor;if(r===!1&&(i=this[e]),s??=o.getPropertyOptions(e),!((s.hasChanged??ir)(i,n)||s.useDefault&&s.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(o._$Eu(e,s))))return;this.C(e,n,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,n,{useDefault:s,reflect:r,wrapped:i},o){s&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??n??this[e]),i!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||s||(n=void 0),this._$AL.set(e,n)),r===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(n){Promise.reject(n)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[r,i]of this._$Ep)this[r]=i;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[r,i]of s){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 n=this._$AL;try{e=this.shouldUpdate(n),e?(this.willUpdate(n),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(n)):this._$EM()}catch(s){throw e=!1,this._$EM(),s}e&&this._$AE(n)}willUpdate(e){}_$AE(e){this._$EO?.forEach(n=>n.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(n=>this._$ET(n,this[n])),this._$EM()}updated(e){}firstUpdated(e){}};Be.elementStyles=[],Be.shadowRootOptions={mode:"open"},Be[tt("elementProperties")]=new Map,Be[tt("finalized")]=new Map,nl?.({ReactiveElement:Be}),(Rt.reactiveElementVersions??=[]).push("2.1.2");const En=globalThis,ar=t=>t,_t=En.trustedTypes,lr=_t?_t.createPolicy("lit-html",{createHTML:t=>t}):void 0,cr="$lit$",ge=`lit$${Math.random().toFixed(9).slice(2)}$`,dr="?"+ge,sl=`<${dr}>`,Se=document,nt=()=>Se.createComment(""),st=t=>t===null||typeof t!="object"&&typeof t!="function",Rn=Array.isArray,rl=t=>Rn(t)||typeof t?.[Symbol.iterator]=="function",_n=`[
|
|
2
|
+
\f\r]`,rt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,pr=/-->/g,hr=/>/g,Ae=RegExp(`>|${_n}(?:([^\\s"'>=/]+)(${_n}*=${_n}*(?:[^
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),ur=/'/g,fr=/"/g,gr=/^(?:script|style|textarea|title)$/i,mr=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),m=mr(1),il=mr(2),K=Symbol.for("lit-noChange"),k=Symbol.for("lit-nothing"),kr=new WeakMap,Te=Se.createTreeWalker(Se,129);function br(t,e){if(!Rn(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return lr!==void 0?lr.createHTML(e):e}const ol=(t,e)=>{const n=t.length-1,s=[];let r,i=e===2?"<svg>":e===3?"<math>":"",o=rt;for(let a=0;a<n;a++){const l=t[a];let d,c,p=-1,u=0;for(;u<l.length&&(o.lastIndex=u,c=o.exec(l),c!==null);)u=o.lastIndex,o===rt?c[1]==="!--"?o=pr:c[1]!==void 0?o=hr:c[2]!==void 0?(gr.test(c[2])&&(r=RegExp("</"+c[2],"g")),o=Ae):c[3]!==void 0&&(o=Ae):o===Ae?c[0]===">"?(o=r??rt,p=-1):c[1]===void 0?p=-2:(p=o.lastIndex-c[2].length,d=c[1],o=c[3]===void 0?Ae:c[3]==='"'?fr:ur):o===fr||o===ur?o=Ae:o===pr||o===hr?o=rt:(o=Ae,r=void 0);const h=o===Ae&&t[a+1].startsWith("/>")?" ":"";i+=o===rt?l+sl:p>=0?(s.push(d),l.slice(0,p)+cr+l.slice(p)+ge+h):l+ge+(p===-2?a:h)}return[br(t,i+(t[n]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),s]};let On=class Wa{constructor({strings:e,_$litType$:n},s){let r;this.parts=[];let i=0,o=0;const a=e.length-1,l=this.parts,[d,c]=ol(e,n);if(this.el=Wa.createElement(d,s),Te.currentNode=this.el.content,n===2||n===3){const p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(r=Te.nextNode())!==null&&l.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(const p of r.getAttributeNames())if(p.endsWith(cr)){const u=c[o++],h=r.getAttribute(p).split(ge),f=/([.?@])?(.*)/.exec(u);l.push({type:1,index:i,name:f[2],strings:h,ctor:f[1]==="."?ll:f[1]==="?"?cl:f[1]==="@"?dl:Lt}),r.removeAttribute(p)}else p.startsWith(ge)&&(l.push({type:6,index:i}),r.removeAttribute(p));if(gr.test(r.tagName)){const p=r.textContent.split(ge),u=p.length-1;if(u>0){r.textContent=_t?_t.emptyScript:"";for(let h=0;h<u;h++)r.append(p[h],nt()),Te.nextNode(),l.push({type:2,index:++i});r.append(p[u],nt())}}}else if(r.nodeType===8)if(r.data===dr)l.push({type:2,index:i});else{let p=-1;for(;(p=r.data.indexOf(ge,p+1))!==-1;)l.push({type:7,index:i}),p+=ge.length-1}i++}}static createElement(e,n){const s=Se.createElement("template");return s.innerHTML=e,s}};function He(t,e,n=t,s){if(e===K)return e;let r=s!==void 0?n._$Co?.[s]:n._$Cl;const i=st(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,n,s)),s!==void 0?(n._$Co??=[])[s]=r:n._$Cl=r),r!==void 0&&(e=He(t,r._$AS(t,e.values),r,s)),e}let al=class{constructor(e,n){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=n}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:n},parts:s}=this._$AD,r=(e?.creationScope??Se).importNode(n,!0);Te.currentNode=r;let i=Te.nextNode(),o=0,a=0,l=s[0];for(;l!==void 0;){if(o===l.index){let d;l.type===2?d=new Ot(i,i.nextSibling,this,e):l.type===1?d=new l.ctor(i,l.name,l.strings,this,e):l.type===6&&(d=new pl(i,this,e)),this._$AV.push(d),l=s[++a]}o!==l?.index&&(i=Te.nextNode(),o++)}return Te.currentNode=Se,r}p(e){let n=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(e,s,n),n+=s.strings.length-2):s._$AI(e[n])),n++}},Ot=class Ga{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,n,s,r){this.type=2,this._$AH=k,this._$AN=void 0,this._$AA=e,this._$AB=n,this._$AM=s,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const n=this._$AM;return n!==void 0&&e?.nodeType===11&&(e=n.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,n=this){e=He(this,e,n),st(e)?e===k||e==null||e===""?(this._$AH!==k&&this._$AR(),this._$AH=k):e!==this._$AH&&e!==K&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):rl(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!==k&&st(this._$AH)?this._$AA.nextSibling.data=e:this.T(Se.createTextNode(e)),this._$AH=e}$(e){const{values:n,_$litType$:s}=e,r=typeof s=="number"?this._$AC(e):(s.el===void 0&&(s.el=On.createElement(br(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===r)this._$AH.p(n);else{const i=new al(r,this),o=i.u(this.options);i.p(n),this.T(o),this._$AH=i}}_$AC(e){let n=kr.get(e.strings);return n===void 0&&kr.set(e.strings,n=new On(e)),n}k(e){Rn(this._$AH)||(this._$AH=[],this._$AR());const n=this._$AH;let s,r=0;for(const i of e)r===n.length?n.push(s=new Ga(this.O(nt()),this.O(nt()),this,this.options)):s=n[r],s._$AI(i),r++;r<n.length&&(this._$AR(s&&s._$AB.nextSibling,r),n.length=r)}_$AR(e=this._$AA.nextSibling,n){for(this._$AP?.(!1,!0,n);e!==this._$AB;){const s=ar(e).nextSibling;ar(e).remove(),e=s}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}};class Lt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,n,s,r,i){this.type=1,this._$AH=k,this._$AN=void 0,this.element=e,this.name=n,this._$AM=r,this.options=i,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=k}_$AI(e,n=this,s,r){const i=this.strings;let o=!1;if(i===void 0)e=He(this,e,n,0),o=!st(e)||e!==this._$AH&&e!==K,o&&(this._$AH=e);else{const a=e;let l,d;for(e=i[0],l=0;l<i.length-1;l++)d=He(this,a[s+l],n,l),d===K&&(d=this._$AH[l]),o||=!st(d)||d!==this._$AH[l],d===k?e=k:e!==k&&(e+=(d??"")+i[l+1]),this._$AH[l]=d}o&&!r&&this.j(e)}j(e){e===k?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}let ll=class extends Lt{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===k?void 0:e}},cl=class extends Lt{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==k)}},dl=class extends Lt{constructor(e,n,s,r,i){super(e,n,s,r,i),this.type=5}_$AI(e,n=this){if((e=He(this,e,n,0)??k)===K)return;const s=this._$AH,r=e===k&&s!==k||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,i=e!==k&&(s===k||r);r&&this.element.removeEventListener(this.name,this,s),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 pl{constructor(e,n,s){this.element=e,this.type=6,this._$AN=void 0,this._$AM=n,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(e){He(this,e)}}const hl={I:Ot},ul=En.litHtmlPolyfillSupport;ul?.(On,Ot),(En.litHtmlVersions??=[]).push("3.3.3");const fl=(t,e,n)=>{const s=n?.renderBefore??e;let r=s._$litPart$;if(r===void 0){const i=n?.renderBefore??null;s._$litPart$=r=new Ot(e.insertBefore(nt(),i),i,void 0,n??{})}return r._$AI(t),r},Ln=globalThis;let me=class extends Be{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=fl(n,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return K}};me._$litElement$=!0,me.finalized=!0,Ln.litElementHydrateSupport?.({LitElement:me});const gl=Ln.litElementPolyfillSupport;gl?.({LitElement:me}),(Ln.litElementVersions??=[]).push("4.2.2");const ke={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4},it=t=>(...e)=>({_$litDirective$:t,values:e});let Pt=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,n,s){this._$Ct=e,this._$AM=n,this._$Ci=s}_$AS(e,n){return this.update(e,n)}update(e,n){return this.render(...n)}};const{I:ml}=hl,vr=t=>t,kl=t=>t.strings===void 0,xr=()=>document.createComment(""),ot=(t,e,n)=>{const s=t._$AA.parentNode,r=e===void 0?t._$AB:e._$AA;if(n===void 0){const i=s.insertBefore(xr(),r),o=s.insertBefore(xr(),r);n=new ml(i,o,t,t.options)}else{const i=n._$AB.nextSibling,o=n._$AM,a=o!==t;if(a){let l;n._$AQ?.(t),n._$AM=t,n._$AP!==void 0&&(l=t._$AU)!==o._$AU&&n._$AP(l)}if(i!==r||a){let l=n._$AA;for(;l!==i;){const d=vr(l).nextSibling;vr(s).insertBefore(l,r),l=d}}}return n},Ce=(t,e,n=t)=>(t._$AI(e,n),t),bl={},Pn=(t,e=bl)=>t._$AH=e,vl=t=>t._$AH,zn=t=>{t._$AR(),t._$AA.remove()},Mn=it(class extends Pt{constructor(t){if(super(t),t.type!==ke.PROPERTY&&t.type!==ke.ATTRIBUTE&&t.type!==ke.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!kl(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,[e]){if(e===K||e===k)return e;const n=t.element,s=t.name;if(t.type===ke.PROPERTY){if(e===n[s])return K}else if(t.type===ke.BOOLEAN_ATTRIBUTE){if(!!e===n.hasAttribute(s))return K}else if(t.type===ke.ATTRIBUTE&&n.getAttribute(s)===e+"")return K;return Pn(t),e}});class zt extends Pt{constructor(e){if(super(e),this.it=k,e.type!==ke.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===k||e==null)return this._t=void 0,this.it=e;if(e===K)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const n=[e];return n.raw=n,this._t={_$litType$:this.constructor.resultType,strings:n,values:[]}}}zt.directiveName="unsafeHTML",zt.resultType=1;const yr=it(zt),Mt=t=>{let e=t;for(;e!==null;){if(e instanceof Element){const n=e.getAttribute("lang");if(n!==null)return n}e=e instanceof ShadowRoot?e.host:e.parentNode}return null},In=["en","ja"],wr="en",$r=t=>In.some(e=>e===t),It=t=>{const e=(t??"").split("-")[0]?.toLowerCase()??"";return $r(e)?e:wr},Sr=t=>It(Mt(t)),Nn="dpk-locale-change",Ar=t=>typeof t=="string"&&$r(t)?t:null,xl=t=>t.preference??t.authored,yl=(t,e)=>t===e?null:t,Nt=t=>e=>e==="ja"?t.ja:t.en;class Dn{#e;#t;#n=wr;constructor(e,n=()=>{}){this.#e=e,this.#t=n,e.addController(this)}get locale(){return this.#n}hostConnected(){this.#n=Sr(this.#e),document.addEventListener(Nn,this.#r)}hostDisconnected(){document.removeEventListener(Nn,this.#r)}#r=()=>{const e=Sr(this.#e);e!==this.#n&&(this.#n=e,this.#t(),this.#e.requestUpdate())}}const wl={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)"]},Tr=t=>nr(Object.entries(wl).map(([e,[n,s]])=>`--dpk-${e}: ${t(n,s)};`).join(`
|
|
4
|
+
`)),Dt=fe`
|
|
5
5
|
:host {
|
|
6
6
|
/* Browsers without light-dark() stay light. */
|
|
7
|
-
${
|
|
7
|
+
${Tr(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 Ct=globalThis,Sn=Ct.ShadowRoot&&(Ct.ShadyCSS===void 0||Ct.ShadyCSS.nativeS
|
|
|
42
42
|
|
|
43
43
|
@supports (color: light-dark(#000, #fff)) {
|
|
44
44
|
:host {
|
|
45
|
-
${
|
|
45
|
+
${Tr((t,e)=>`light-dark(${t}, ${e})`)}
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
|
|
@@ -95,7 +95,7 @@ const Ct=globalThis,Sn=Ct.ShadowRoot&&(Ct.ShadyCSS===void 0||Ct.ShadyCSS.nativeS
|
|
|
95
95
|
transition-duration: 1ms !important;
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
|
-
`,
|
|
98
|
+
`,jn=fe`
|
|
99
99
|
.dpk-btn {
|
|
100
100
|
display: inline-flex;
|
|
101
101
|
align-items: center;
|
|
@@ -328,7 +328,7 @@ const Ct=globalThis,Sn=Ct.ShadowRoot&&(Ct.ShadyCSS===void 0||Ct.ShadyCSS.nativeS
|
|
|
328
328
|
min-height: 64px;
|
|
329
329
|
line-height: 1.55;
|
|
330
330
|
}
|
|
331
|
-
|
|
331
|
+
`,$l=fe`
|
|
332
332
|
.comment-pop {
|
|
333
333
|
box-sizing: border-box;
|
|
334
334
|
overflow: auto;
|
|
@@ -447,7 +447,7 @@ const Ct=globalThis,Sn=Ct.ShadowRoot&&(Ct.ShadyCSS===void 0||Ct.ShadyCSS.nativeS
|
|
|
447
447
|
align-items: center;
|
|
448
448
|
justify-content: flex-end;
|
|
449
449
|
}
|
|
450
|
-
`,
|
|
450
|
+
`,Cr=fe`
|
|
451
451
|
.dpk-prose {
|
|
452
452
|
overflow-wrap: anywhere;
|
|
453
453
|
}
|
|
@@ -554,12 +554,12 @@ const Ct=globalThis,Sn=Ct.ShadowRoot&&(Ct.ShadyCSS===void 0||Ct.ShadyCSS.nativeS
|
|
|
554
554
|
.dpk-prose img {
|
|
555
555
|
max-width: 100%;
|
|
556
556
|
}
|
|
557
|
-
`,Ee=(t,e)=>t instanceof e?t:null;function
|
|
558
|
-
]`).replace("lheading",
|
|
557
|
+
`,Ee=(t,e)=>t instanceof e?t:null;function qn(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Re=qn();function Er(t){Re=t}var _e={exec:()=>null};function Ue(t){let e=[];return n=>{let s=Math.max(0,Math.min(3,n-1)),r=e[s];return r||(r=t(s),e[s]=r),r}}function w(t,e=""){let n=typeof t=="string"?t:t.source,s={replace:(r,i)=>{let o=typeof i=="string"?i:i.source;return o=o.replace(N.caret,"$1"),n=n.replace(r,o),s},getRegex:()=>new RegExp(n,e)};return s}var Sl=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),N={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Ue(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Ue(t=>new RegExp(`^ {0,${t}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:Ue(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:Ue(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:Ue(t=>new RegExp(`^ {0,${t}}(?:</?(?:${lt})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,"i")),blockquoteBeginRegex:Ue(t=>new RegExp(`^ {0,${t}}>`))},Al=/^(?:[ \t]*(?:\n|$))+/,Tl=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Cl=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,at=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,El=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Bn=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Rr=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_r=w(Rr).replace(/bull/g,Bn).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(),Rl=w(Rr).replace(/bull/g,Bn).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(),Hn=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,_l=/^[^\n]+/,Un=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Ol=w(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Un).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ll=w(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Bn).getRegex(),lt="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",Fn=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Pl=w("^ {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",Fn).replace("tag",lt).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Or=t=>w(Hn).replace("hr",at).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",lt).getRegex(),zl=Or(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),Ml=Or(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Il=w(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ml).getRegex(),Wn={blockquote:Il,code:Tl,def:Ol,fences:Cl,heading:El,hr:at,html:Pl,lheading:_r,list:Ll,newline:Al,paragraph:zl,table:_e,text:_l},Lr=w("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",at).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",lt).getRegex(),Nl={...Wn,lheading:Rl,table:Lr,paragraph:w(Hn).replace("hr",at).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Lr).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",lt).getRegex()},Dl={...Wn,html:w(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Fn).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:_e,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:w(Hn).replace("hr",at).replace("heading",` *#{1,6} *[^
|
|
558
|
+
]`).replace("lheading",_r).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},jl=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ql=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Pr=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,Bl=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ae=/[\p{P}\p{S}]/u,Fe=/[\s\p{P}\p{S}]/u,ct=/[^\s\p{P}\p{S}]/u,Hl=w(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Fe).getRegex(),Ul=/[\p{Pi}\p{Ps}"']/u,zr=/(?!~)[\p{P}\p{S}]/u,Fl=/(?!~)[\s\p{P}\p{S}]/u,Wl=/(?:[^\s\p{P}\p{S}]|~)/u,Gl=w(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Sl?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Mr=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Vl=w(Mr,"u").replace(/punct/g,ae).getRegex(),Kl=w(Mr,"u").replace(/punct/g,zr).getRegex(),Ql=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,Zl=w(Ql,"u").replace(/openQuote/g,Ul).replace(/punct/g,ae).getRegex(),Ir="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Yl=w(Ir,"gu").replace(/notPunctSpace/g,ct).replace(/punctSpace/g,Fe).replace(/punct/g,ae).getRegex(),Jl=w(Ir,"gu").replace(/notPunctSpace/g,Wl).replace(/punctSpace/g,Fl).replace(/punct/g,zr).getRegex(),Xl="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",ec=w(Xl,"gu").replace(/notPunctSpace/g,ct).replace(/punctSpace/g,Fe).replace(/punct/g,ae).getRegex(),tc=w("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ct).replace(/punctSpace/g,Fe).replace(/punct/g,ae).getRegex(),nc="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",sc=w(nc,"gu").replace(/notPunctSpace/g,ct).replace(/punctSpace/g,Fe).replace(/punct/g,ae).getRegex(),rc=w(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,ae).getRegex(),ic="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",oc=w(ic,"gu").replace(/notPunctSpace/g,ct).replace(/punctSpace/g,Fe).replace(/punct/g,ae).getRegex(),ac=w(/\\(punct)/,"gu").replace(/punct/g,ae).getRegex(),lc=w(/^<(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(),cc=w(Fn).replace("(?:-->|$)","-->").getRegex(),dc=w("^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",cc).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Nr=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,jt=w(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",Nr).getRegex(),pc=w(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label",jt).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),hc=w(/^!?\[(label)\]\[(ref)\]/).replace("label",jt).replace("ref",Un).getRegex(),uc=w(/^!?\[(ref)\](?:\[\])?/).replace("ref",Un).getRegex(),Dr=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,fc=w(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",Nr).getRegex(),gc=w("reflink|nolink(?!\\()","g").replace("reflink",w(/^!?\[(label)\]\[(ref)\]/).replace("label",fc).replace("ref",Dr).getRegex()).replace("nolink",w(/^!?\[(ref)\](?:\[\])?/).replace("ref",Dr).getRegex()).getRegex(),jr=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,mc=/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/,kc=w(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,mc).getRegex(),Gn={_backpedal:_e,anyPunctuation:ac,autolink:lc,blockSkip:Gl,br:Pr,code:ql,del:_e,delLDelim:_e,delRDelim:_e,emStrongLDelim:Vl,emStrongRDelimAst:Yl,emStrongRDelimUnd:tc,escape:jl,link:pc,nolink:uc,punctuation:Hl,reflink:hc,reflinkSearch:gc,tag:dc,text:Bl,url:_e},bc={...Gn,emStrongLDelim:Zl,emStrongRDelimAst:ec,emStrongRDelimUnd:sc,link:w(/^!?\[(label)\]\((.*?)\)/).replace("label",jt).getRegex(),reflink:w(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",jt).getRegex()},Vn={...Gn,emStrongRDelimAst:Jl,emStrongLDelim:Kl,delLDelim:rc,delRDelim:oc,url:w(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",kc).replace("protocol",jr).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:w(/^(?:[^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",jr).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},vc={...Vn,br:w(Pr).replace("{2,}","*").getRegex(),text:w(Vn.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},qt={normal:Wn,gfm:Nl,pedantic:Dl},dt={normal:Gn,gfm:Vn,breaks:vc,pedantic:bc},xc={"&":"&","<":"<",">":">",'"':""","'":"'"},qr=t=>xc[t];function W(t,e){if(e){if(N.escapeTest.test(t))return t.replace(N.escapeReplace,qr)}else if(N.escapeTestNoEncode.test(t))return t.replace(N.escapeReplaceNoEncode,qr);return t}function yc(t){return t.replace(N.numericCharacterReference,(e,n,s)=>{let r=n===void 0?Number.parseInt(s,16):Number.parseInt(n,10);return r===0||r>1114111||r>=55296&&r<=57343?"\uFFFD":String.fromCodePoint(r)})}function Br(t){try{t=encodeURI(t).replace(N.percentDecode,"%")}catch{return null}return t}function Hr(t,e){let n=t.replace(N.findPipe,(i,o,a)=>{let l=!1,d=o;for(;--d>=0&&a[d]==="\\";)l=!l;return l?"|":" |"}),s=n.split(N.splitPipe),r=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;r<s.length;r++)s[r]=s[r].trim().replace(N.slashPipe,"|");return s}function be(t,e,n){let s=t.length;if(s===0)return"";let r=0;for(;r<s&&t.charAt(s-r-1)===e;)r++;return t.slice(0,s-r)}function Ur(t){let e=t.split(`
|
|
559
559
|
`),n=e.length-1;for(;n>=0&&N.blankLine.test(e[n]);)n--;return e.length-n<=2?t:e.slice(0,n+1).join(`
|
|
560
|
-
`)}function
|
|
560
|
+
`)}function Bt(t){return t.trim().toLowerCase().toUpperCase().toLowerCase()}function Fr(t,e){if(t.indexOf(e[0])===-1&&t.indexOf(e[1])===-1)return-1;let n=0;for(let s=0;s<t.length;s++)if(t[s]==="\\")s++;else if(t[s]===e[0])n++;else if(t[s]===e[1]&&(n--,n<0))return s;return n>0?-2:-1}function Wr(t,e=0){let n=e,s="";for(let r of t)if(r===" "){let i=4-n%4;s+=" ".repeat(i),n+=i}else s+=r,n++;return s}function Gr(t,e,n,s,r){let i=e.href,o=e.title||null,a=t[1].replace(r.other.outputLinkReplace,"$1"),l=t[0].charAt(0)==="!";s.state.inLink=!0;let d=s.state.linkEmitted,c=s.state.inRawBlock;s.state.linkEmitted=!1;let p=s.inlineTokens(a),u=s.state.linkEmitted;if(s.state.linkEmitted=d,s.state.inLink=!1,!l){if(u){s.state.inRawBlock=c;return}s.state.linkEmitted=!0}return{type:l?"image":"link",raw:n,href:i,title:o,text:a,tokens:p}}function wc(t,e,n){let s=t.match(n.other.indentCodeCompensation);if(s===null)return e;let r=s[1];return e.split(`
|
|
561
561
|
`).map(i=>{let o=i.match(n.other.beginningSpace);if(o===null)return i;let[a]=o;return i.slice(Math.min(a.length,r.length))}).join(`
|
|
562
|
-
`)}function
|
|
562
|
+
`)}function Vr(t,e,n,s){if(!e.includes("<"))return!1;for(let r=0;r<e.length;r++){if(e[r]==="\\"){r++;continue}if(e[r]==="`"){let a=s.inline.code.exec(e.slice(r));if(a){r+=a[0].length-1;continue}}if(e[r]!=="<")continue;let i=t.slice(n+r),o=s.inline.tag.exec(i)||s.inline.autolink.exec(i);if(o){if(o[0].length>e.length-r)return!0;r+=o[0].length-1}}return!1}var Ht=class{options;rules;lexer;constructor(t){this.options=t||Re}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=this.options.pedantic?e[0]:Ur(e[0]),s=n.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n,codeBlockStyle:"indented",text:s}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],s=wc(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){let s=be(n,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceTabChar.test(s))&&(n=s.trim())}return{type:"heading",raw:be(e[0],`
|
|
563
563
|
`),depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:be(e[0],`
|
|
564
564
|
`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=be(e[0],`
|
|
565
565
|
`).split(`
|
|
@@ -576,18 +576,18 @@ ${T.join(`
|
|
|
576
576
|
`+n.join(`
|
|
577
577
|
`),g=this.list(f);i[i.length-1]=g,s=s.substring(0,s.length-u.raw.length)+g.raw,r=r.substring(0,r.length-h.raw.length)+g.raw,n=f.substring(i.at(-1).raw.length).split(`
|
|
578
578
|
`);continue}}return{type:"blockquote",raw:s,tokens:i,text:r}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim(),s=n.length>1,r={type:"list",raw:"",ordered:s,start:s?+n.slice(0,-1):"",loose:!1,items:[]};n=s?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=s?n:"[*+-]");let i=this.rules.other.listItemRegex(n),o=!1;for(;t;){let l=!1,d="",c="";if(!(e=i.exec(t))||this.rules.block.hr.test(t))break;d=e[0],t=t.substring(d.length);let p=e[2].split(`
|
|
579
|
-
`,1)[0],u=e[1].length,h=this.options.pedantic?
|
|
579
|
+
`,1)[0],u=e[1].length,h=this.options.pedantic?Wr(p,u):p.replace(this.rules.other.leadingSpaceTab,x=>Wr(x,u)),f=t.split(`
|
|
580
580
|
`,1)[0],g=!h.trim(),b=0;if(this.options.pedantic?(b=2,c=h.trimStart()):g?b=u+1:(b=h.search(this.rules.other.nonSpaceChar),b=b>4?1:b,c=h.slice(b),b+=u),g&&this.rules.other.blankLine.test(f)&&(d+=f+`
|
|
581
|
-
`,t=t.substring(f.length+1),l=!0),!l){let x=this.rules.other.nextBulletRegex(b),S=this.rules.other.hrRegex(b),T=this.rules.other.fencesBeginRegex(b),_=this.rules.other.headingBeginRegex(b),
|
|
582
|
-
`,1)[0],q;if(f=V,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),q=f):q=f.replace(this.rules.other.leadingSpaceTab,
|
|
581
|
+
`,t=t.substring(f.length+1),l=!0),!l){let x=this.rules.other.nextBulletRegex(b),S=this.rules.other.hrRegex(b),T=this.rules.other.fencesBeginRegex(b),_=this.rules.other.headingBeginRegex(b),U=this.rules.other.htmlBeginRegex(b),P=this.rules.other.blockquoteBeginRegex(b);for(;t;){let V=t.split(`
|
|
582
|
+
`,1)[0],q;if(f=V,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),q=f):q=f.replace(this.rules.other.leadingSpaceTab,oe=>oe.replace(this.rules.other.tabCharGlobal," ")),T.test(f)||_.test(f)||U.test(f)||P.test(f)||x.test(f)||S.test(f))break;if(q.search(this.rules.other.nonSpaceChar)>=b||!f.trim())c+=`
|
|
583
583
|
`+q.slice(b);else{if(g||h.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||T.test(h)||_.test(h)||S.test(h))break;c+=`
|
|
584
584
|
`+f}g=!f.trim(),d+=V+`
|
|
585
|
-
`,t=t.substring(V.length+1),h=q.slice(b)}}r.loose||(o?r.loose=!0:this.rules.other.doubleBlankLine.test(d)&&(o=!0)),r.items.push({type:"list_item",raw:d,task:!!this.options.gfm&&this.rules.other.listIsTask.test(c),loose:!1,text:c,tokens:[]}),r.raw+=d}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 d=l.tokens.filter(p=>p.type==="space"),c=d.length>0&&d.some(p=>this.rules.other.anyLine.test(p.raw));r.loose=c}for(let l of r.items){let d=l.tokens[0];if(l.task&&(d?.type==="text"||d?.type==="paragraph")){l.text=l.text.replace(this.rules.other.listReplaceTask,""),d.raw=d.raw.replace(this.rules.other.listReplaceTask,""),d.text=d.text.replace(this.rules.other.listReplaceTask,"");for(let p=this.lexer.inlineQueue.length-1;p>=0;p--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[p].src)){this.lexer.inlineQueue[p].src=this.lexer.inlineQueue[p].src.replace(this.rules.other.listReplaceTask,"");break}let c=this.rules.other.listTaskCheckbox.exec(l.raw);if(c){let p={type:"checkbox",raw:c[0]+" ",checked:c[0]!=="[ ]"};l.checked=p.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=p.raw+l.tokens[0].raw,l.tokens[0].text=p.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(p)):l.tokens.unshift({type:"paragraph",raw:p.raw,text:p.raw,tokens:[p]}):l.tokens.unshift(p)}}else l.task&&(l.task=!1)}if(r.loose)for(let l of r.items){l.loose=!0;for(let d of l.tokens)d.type==="text"&&(d.type="paragraph")}return r}}html(t){let e=this.rules.block.html.exec(t);if(e){let n=
|
|
586
|
-
`),href:s,title:r}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=
|
|
585
|
+
`,t=t.substring(V.length+1),h=q.slice(b)}}r.loose||(o?r.loose=!0:this.rules.other.doubleBlankLine.test(d)&&(o=!0)),r.items.push({type:"list_item",raw:d,task:!!this.options.gfm&&this.rules.other.listIsTask.test(c),loose:!1,text:c,tokens:[]}),r.raw+=d}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 d=l.tokens.filter(p=>p.type==="space"),c=d.length>0&&d.some(p=>this.rules.other.anyLine.test(p.raw));r.loose=c}for(let l of r.items){let d=l.tokens[0];if(l.task&&(d?.type==="text"||d?.type==="paragraph")){l.text=l.text.replace(this.rules.other.listReplaceTask,""),d.raw=d.raw.replace(this.rules.other.listReplaceTask,""),d.text=d.text.replace(this.rules.other.listReplaceTask,"");for(let p=this.lexer.inlineQueue.length-1;p>=0;p--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[p].src)){this.lexer.inlineQueue[p].src=this.lexer.inlineQueue[p].src.replace(this.rules.other.listReplaceTask,"");break}let c=this.rules.other.listTaskCheckbox.exec(l.raw);if(c){let p={type:"checkbox",raw:c[0]+" ",checked:c[0]!=="[ ]"};l.checked=p.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=p.raw+l.tokens[0].raw,l.tokens[0].text=p.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(p)):l.tokens.unshift({type:"paragraph",raw:p.raw,text:p.raw,tokens:[p]}):l.tokens.unshift(p)}}else l.task&&(l.task=!1)}if(r.loose)for(let l of r.items){l.loose=!0;for(let d of l.tokens)d.type==="text"&&(d.type="paragraph")}return r}}html(t){let e=this.rules.block.html.exec(t);if(e){let n=Ur(e[0]);return{type:"html",block:!0,raw:n,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:n}}}def(t){let e=this.rules.block.def.exec(t);if(e){if(!this.rules.other.startAngleBracket.test(e[2])&&Fr(e[2],"()")!==-1)return;let n=Bt(e[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=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:n,raw:be(e[0],`
|
|
586
|
+
`),href:s,title:r}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=Hr(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
587
587
|
`):[],i={type:"table",raw:be(e[0],`
|
|
588
|
-
`),header:[],align:[],rows:[]};if(n.length===s.length){for(let o of s)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<n.length;o++)i.header.push({text:n[o],tokens:this.lexer.inline(n[o]),header:!0,align:i.align[o]});for(let o of r)i.rows.push(
|
|
588
|
+
`),header:[],align:[],rows:[]};if(n.length===s.length){for(let o of s)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<n.length;o++)i.header.push({text:n[o],tokens:this.lexer.inline(n[o]),header:!0,align:i.align[o]});for(let o of r)i.rows.push(Hr(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 n=e[1].trim();return{type:"heading",raw:be(e[0],`
|
|
589
589
|
`),depth:e[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let n=e[1].charAt(e[1].length-1)===`
|
|
590
|
-
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){if(this.lexer.state.linkParenPossible===!1)return;let e=this.rules.inline.link.exec(t);if(e){let n=e[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&
|
|
590
|
+
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){if(this.lexer.state.linkParenPossible===!1)return;let e=this.rules.inline.link.exec(t);if(e){let n=e[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&Vr(t,e[1],n,this.rules))return;let s=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(s)){if(!this.rules.other.endAngleBracket.test(s))return;let o=be(s.slice(0,-1),"\\");if((s.length-o.length)%2===0)return}else{let o=Fr(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(s)?r=r.slice(1):r=r.slice(1,-1)),Gr(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 n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let s=n[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&Vr(t,n[1],s,this.rules))return;let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=e[Bt(r)];if(!i){let o=n[0].charAt(0);return{type:"text",raw:o,text:o}}return Gr(n,i,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let s=this.rules.inline.emStrongLDelim.exec(t);if(!(!s||!s[1]&&!s[2]&&!s[3]&&!s[4]||s[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[3])||!n||this.rules.inline.punctuation.exec(n))){let r=[...s[0]].length-1,i,o,a=r,l=0,d=s[0][0],c=n===d,p=d==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,e=e.slice(-1*t.length+r);(s=p.exec(e))!==null;){if(i=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!i)continue;if(o=[...i].length,s[3]||s[4]){a+=o;continue}else if(s[5]||s[6]){if(r%3&&!((r+o)%3)){l+=o;continue}if(c)break}if(a-=o,a>0)continue;o=Math.min(o,o+a+l);let u=[...s[0]][0].length,h=t.slice(0,r+s.index+u+o);if(Math.min(r,o)%2){let g=h.slice(1,-1);return{type:"em",raw:h,text:g,tokens:this.lexer.inlineTokens(g)}}let f=h.slice(2,-2);return{type:"strong",raw:h,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(n),r=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return s&&r&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,n=""){let s=this.rules.inline.delLDelim.exec(t);if(s&&(!s[1]||!n||this.rules.inline.punctuation.exec(n))){let r=[...s[0]].length-1,i,o,a=r,l=this.rules.inline.delRDelim;for(l.lastIndex=0,e=e.slice(-1*t.length+r);(s=l.exec(e))!==null;){if(i=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!i||(o=[...i].length,o!==r))continue;if(s[3]||s[4]){a+=o;continue}if(a-=o,a>0)continue;o=Math.min(o,o+a);let d=[...s[0]][0].length,c=t.slice(0,r+s.index+d+o),p=c.slice(r,-r);return{type:"del",raw:c,text:p,tokens:this.lexer.inlineTokens(p)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let n,s;return e[2]==="@"?(n=e[1],s="mailto:"+n):(n=e[1],s=n),{type:"link",raw:e[0],text:n,href:s,autolink:!0,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let n,s;if(e[2]==="@")n=e[0],s="mailto:"+n;else{let r;do r=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(r!==e[0]);n=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:n,href:s,autolink:!0,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:n?e[0]:yc(e[0]),escaped:n}}}},Y=class Qs{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Re,this.options.tokenizer=this.options.tokenizer||new Ht,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let n={other:N,block:qt.normal,inline:dt.normal};this.options.pedantic?(n.block=qt.pedantic,n.inline=dt.pedantic):this.options.gfm&&(n.block=qt.gfm,this.options.breaks?n.inline=dt.breaks:n.inline=dt.gfm),this.tokenizer.rules=n}static get rules(){return{block:qt,inline:dt}}static lex(e,n){return new Qs(n).lex(e)}static lexInline(e,n){return new Qs(n).inlineTokens(e)}lex(e){e=e.replace(N.carriageReturn,`
|
|
591
591
|
`),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let s=this.inlineQueue[n];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],s=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(N.tabCharGlobal," ").replace(N.spaceLine,""));let 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,n))?(e=e.substring(i.raw.length),n.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let a=n.at(-1);i.raw.length===1&&a!==void 0?a.raw+=`
|
|
592
592
|
`:n.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let a=n.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
593
593
|
`)?"":`
|
|
@@ -601,7 +601,7 @@ ${T.join(`
|
|
|
601
601
|
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(i),s=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=n.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
602
602
|
`)?"":`
|
|
603
603
|
`)+i.raw,a.text+=`
|
|
604
|
-
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}linkInText(e){if(!e.includes("["))return!1;let n=this.tokenizer.rules.inline.link;for(let s of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(n.test(s[0])&&e.charAt(s.index-1)!=="!")return!0;for(let s of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let r=s[0],i=r.lastIndexOf("[");if(!(r.charAt(0)==="!"||!Object.hasOwn(this.tokens.links,
|
|
604
|
+
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}linkInText(e){if(!e.includes("["))return!1;let n=this.tokenizer.rules.inline.link;for(let s of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(n.test(s[0])&&e.charAt(s.index-1)!=="!")return!0;for(let s of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let r=s[0],i=r.lastIndexOf("[");if(!(r.charAt(0)==="!"||!Object.hasOwn(this.tokens.links,Bt(r.slice(i+1,-1))))&&!(i>1&&this.linkInText(r.slice(1,i-1))))return!0}return!1}inlineTokens(e,n=[]){this.tokenizer.lexer=this;let s=this.state.linkParenPossible;this.state.linkParenPossible=s&&e.includes(")");try{return this.#e(e,n)}finally{this.state.linkParenPossible=s}}#e(e,n){let s=e;if(this.tokens.links&&e.includes("[")){let a=this.tokenizer.rules.inline.reflinkSearch,l=d=>{let c=d.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,Bt(d.slice(c+1,-1))))return d;if(c>1&&d.charAt(0)!=="!"){let p=d.slice(1,c-1);if(this.linkInText(p))return"["+p.replace(a,l)+"]["+"a".repeat(d.length-c-2)+"]"}return"["+"a".repeat(d.length-2)+"]"};s=s.replace(a,l)}s=s.replace(this.tokenizer.rules.inline.anyPunctuation,a=>"+".repeat(a.length)),s=s.replace(this.tokenizer.rules.inline.blockSkip,(a,l,d)=>{let c=d?d.length:0;return a.slice(0,c)+"["+"a".repeat(a.length-c-2)+"]"}),s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;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(d=>(a=d.call({lexer:this},e,n))?(e=e.substring(a.raw.length),n.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let d=n.at(-1);a.type==="text"&&d?.type==="text"?(d.raw+=a.raw,d.text+=a.text):n.push(a);continue}if(a=this.tokenizer.emStrong(e,s,i)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.del(e,s,i)){e=e.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),n.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),n.push(a);continue}let l=e;if(this.options.extensions?.startInline){let d=1/0,c=e.slice(1),p;this.options.extensions.startInline.forEach(u=>{p=u.call({lexer:this},c),typeof p=="number"&&p>=0&&(d=Math.min(d,p))}),d<1/0&&d>=0&&(l=e.substring(0,d+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 d=n.at(-1);d?.type==="text"?(d.raw+=a.raw,d.text+=a.text):n.push(a);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return n}infiniteLoopError(e){let n="Infinite loop on byte: "+e;if(this.options.silent)console.error(n);else throw new Error(n)}},Ut=class{options;parser;constructor(t){this.options=t||Re}space(t){return""}code({text:t,lang:e,escaped:n}){let s=(e||"").match(N.notSpaceStart)?.[0],r=t?t.replace(N.endingNewline,"")+`
|
|
605
605
|
`:"";return s?'<pre><code class="language-'+W(s)+'">'+(n?r:W(r,!0))+`</code></pre>
|
|
606
606
|
`:"<pre><code>"+(n?r:W(r,!0))+`</code></pre>
|
|
607
607
|
`}blockquote({tokens:t}){return`<blockquote>
|
|
@@ -619,8 +619,8 @@ ${this.parser.parse(t)}</blockquote>
|
|
|
619
619
|
`}tablerow({text:t}){return`<tr>
|
|
620
620
|
${t}</tr>
|
|
621
621
|
`}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
|
|
622
|
-
`}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>${W(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,text:n,tokens:s,autolink:r}){let i=r?W(n,!0):this.parser.parseInline(s),o=
|
|
623
|
-
Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error occurred:</p><pre>"+W(n.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(n);throw n}}},Oe=new
|
|
622
|
+
`}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>${W(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,text:n,tokens:s,autolink:r}){let i=r?W(n,!0):this.parser.parseInline(s),o=Br(t);if(o===null)return i;t=W(o,r);let a='<a href="'+t+'"';return e&&(a+=' title="'+W(e)+'"'),a+=">"+i+"</a>",a}image({href:t,title:e,text:n,tokens:s}){s&&(n=this.parser.parseInline(s,this.parser.textRenderer));let r=Br(t);if(r===null)return W(n);t=r;let i=`<img src="${W(t)}" alt="${W(n)}"`;return e&&(i+=` title="${W(e)}"`),i+=">",i}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:W(t.text)}},Kn=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 Zs{options;renderer;textRenderer;constructor(e){this.options=e||Re,this.options.renderer=this.options.renderer||new Ut,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Kn}static parse(e,n){return new Zs(n).parse(e)}static parseInline(e,n){return new Zs(n).parseInline(e)}parse(e){this.renderer.parser=this;let n="";for(let s=0;s<e.length;s++){let r=e[s];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)){n+=a||"";continue}}let i=r;switch(i.type){case"space":{n+=this.renderer.space(i);break}case"hr":{n+=this.renderer.hr(i);break}case"heading":{n+=this.renderer.heading(i);break}case"code":{n+=this.renderer.code(i);break}case"table":{n+=this.renderer.table(i);break}case"blockquote":{n+=this.renderer.blockquote(i);break}case"list":{n+=this.renderer.list(i);break}case"checkbox":{n+=this.renderer.checkbox(i);break}case"html":{n+=this.renderer.html(i);break}case"def":{n+=this.renderer.def(i);break}case"paragraph":{n+=this.renderer.paragraph(i);break}case"text":{n+=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 n}parseInline(e,n=this.renderer){this.renderer.parser=this;let s="";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)){s+=a||"";continue}}let o=i;switch(o.type){case"escape":{s+=n.text(o);break}case"html":{s+=n.html(o);break}case"link":{s+=n.link(o);break}case"image":{s+=n.image(o);break}case"checkbox":{s+=n.checkbox(o);break}case"strong":{s+=n.strong(o);break}case"em":{s+=n.em(o);break}case"codespan":{s+=n.codespan(o);break}case"br":{s+=n.br(o);break}case"del":{s+=n.del(o);break}case"text":{s+=n.text(o);break}default:{let a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return s}},pt=class{options;block;constructor(t){this.options=t||Re}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?Y.lex:Y.lexInline}provideParser(t=this.block){return t?J.parse:J.parseInline}},Kr=class{defaults=qn();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=J;Renderer=Ut;TextRenderer=Kn;Lexer=Y;Tokenizer=Ht;Hooks=pt;constructor(...t){this.use(...t)}walkTokens(t,e){let n=[];for(let s of t)switch(n=n.concat(e.call(this,s)),s.type){case"table":{let r=s;for(let i of r.header)n=n.concat(this.walkTokens(i.tokens,e));for(let i of r.rows)for(let o of i)n=n.concat(this.walkTokens(o.tokens,e));break}case"list":{let r=s;n=n.concat(this.walkTokens(r.items,e));break}default:{let r=s;this.defaults.extensions?.childTokens?.[r.type]?this.defaults.extensions.childTokens[r.type].forEach(i=>{let o=r[i].flat(1/0);n=n.concat(this.walkTokens(o,e))}):r.tokens&&(n=n.concat(this.walkTokens(r.tokens,e)))}}return n}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let s={...n};if(s.async=this.defaults.async||s.async||!1,n.extensions&&(n.extensions.forEach(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)}),s.extensions=e),n.renderer){let r=this.defaults.renderer||new Ut(this.defaults);for(let i in n.renderer){if(!(i in r))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let o=i,a=n.renderer[o],l=r[o];r[o]=(...d)=>{let c=a.apply(r,d);return c===!1&&(c=l.apply(r,d)),c||""}}s.renderer=r}if(n.tokenizer){let r=this.defaults.tokenizer||new Ht(this.defaults);for(let i in n.tokenizer){if(!(i in r))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let o=i,a=n.tokenizer[o],l=r[o];r[o]=(...d)=>{let c=a.apply(r,d);return c===!1&&(c=l.apply(r,d)),c}}s.tokenizer=r}if(n.hooks){let r=this.defaults.hooks||new pt;for(let i in n.hooks){if(!(i in r))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let o=i,a=n.hooks[o],l=r[o];pt.passThroughHooks.has(i)?r[o]=d=>{if(this.defaults.async&&pt.passThroughHooksRespectAsync.has(i))return(async()=>{let p=await a.call(r,d);return l.call(r,p)})();let c=a.call(r,d);return l.call(r,c)}:r[o]=(...d)=>{if(this.defaults.async)return(async()=>{let p=await a.apply(r,d);return p===!1&&(p=await l.apply(r,d)),p})();let c=a.apply(r,d);return c===!1&&(c=l.apply(r,d)),c}}s.hooks=r}if(n.walkTokens){let r=this.defaults.walkTokens,i=n.walkTokens;s.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,...s}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return Y.lex(t,e??this.defaults)}parser(t,e){return J.parse(t,e??this.defaults)}parseMarkdown(t){return(e,n)=>{let s={...n},r={...this.defaults,...s},i=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&s.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?Y.lex:Y.lexInline)(o,r),l=r.hooks?await r.hooks.processAllTokens(a):a;r.walkTokens&&await Promise.all(this.walkTokens(l,r.walkTokens));let d=await(r.hooks?await r.hooks.provideParser(t):t?J.parse:J.parseInline)(l,r);return r.hooks?await r.hooks.postprocess(d):d})().catch(i);try{r.hooks&&(e=r.hooks.preprocess(e));let o=(r.hooks?r.hooks.provideLexer(t):t?Y.lex:Y.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 n=>{if(n.message+=`
|
|
623
|
+
Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error occurred:</p><pre>"+W(n.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(n);throw n}}},Oe=new Kr;function E(t,e){return Oe.parse(t,e)}E.options=E.setOptions=function(t){return Oe.setOptions(t),E.defaults=Oe.defaults,Er(E.defaults),E},E.getDefaults=qn,E.defaults=Re;function $c(...t){return Oe.use(...t),E.defaults=Oe.defaults,Er(E.defaults),E}E.use=$c,E.walkTokens=function(t,e){return Oe.walkTokens(t,e)},E.parseInline=Oe.parseInline,E.Parser=J,E.parser=J.parse,E.Renderer=Ut,E.TextRenderer=Kn,E.Lexer=Y,E.lexer=Y.lex,E.Tokenizer=Ht,E.Hooks=pt,E.parse=E,E.options,E.setOptions,E.walkTokens,E.parseInline,J.parse,Y.lex;const Sc={"&":"&","<":"<",">":">",'"':""","'":"'"},Le=t=>t.replace(/[&<>"']/g,e=>Sc[e]??e),Ac=new Set(["http","https","mailto"]),Qr=t=>{const e=t.replace(/[\u0000- \u007f]/g,""),n=/^([a-z][a-z0-9+.-]*):/i.exec(e)?.[1];return n===void 0||Ac.has(n.toLowerCase())},Tc=t=>/^https?:/i.test(t.trim()),Cc=new Kr({gfm:!0,breaks:!0,renderer:{html({text:t}){return Le(t)},link({href:t,title:e,tokens:n}){const s=this.parser.parseInline(n);if(!Qr(t))return s;const r=e?` title="${Le(e)}"`:"",i=Tc(t)?' target="_blank" rel="noopener noreferrer"':"";return`<a href="${Le(t)}"${r}${i}>${s}</a>`},image({href:t,title:e,text:n}){if(!Qr(t))return Le(n);const s=e?` title="${Le(e)}"`:"";return`<img src="${Le(t)}" alt="${Le(n)}"${s}>`}}}),Zr=t=>Cc.parse(t,{async:!1}),Ec=Nt({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 Yr extends me{static{this.styles=[Dt,Cr,fe`
|
|
624
624
|
/* One atomic box in both states, so the text can be edited where it sits:
|
|
625
625
|
while editing, the text stays (hidden) underneath and keeps sizing the
|
|
626
626
|
box, and the field lies over it. Starting an edit moves nothing; the
|
|
@@ -750,7 +750,7 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
|
|
|
750
750
|
background: transparent;
|
|
751
751
|
box-shadow: none;
|
|
752
752
|
}
|
|
753
|
-
`]}static{this.properties={value:{type:String},placeholder:{type:String},multiline:{type:Boolean},wrap:{type:Boolean,reflect:!0},truncate:{type:Boolean,reflect:!0},seamless:{type:Boolean,reflect:!0},markdown:{type:Boolean},label:{type:String},editing:{state:!0}}}#e="";#t=0;#n=new
|
|
753
|
+
`]}static{this.properties={value:{type:String},placeholder:{type:String},multiline:{type:Boolean},wrap:{type:Boolean,reflect:!0},truncate:{type:Boolean,reflect:!0},seamless:{type:Boolean,reflect:!0},markdown:{type:Boolean},label:{type:String},editing:{state:!0}}}#e="";#t=0;#n=new Dn(this);connectedCallback(){super.connectedCallback(),this.#t+=1}constructor(){super(),this.value="",this.placeholder="",this.multiline=!1,this.wrap=!1,this.truncate=!1,this.seamless=!1,this.markdown=!1,this.label="",this.editing=!1,this.#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"),n=this.renderRoot,s=n instanceof ShadowRoot?n.activeElement:document.activeElement;e&&s!==e&&(e.focus(),e.setSelectionRange(0,e.value.length,"backward"),e.scrollLeft=0,e.scrollTop=0)}render(){const e=Ec(this.#n.locale),n=this.placeholder||e.unset,{editing:s}=this,r=s?this.#e:this.value,i=r===""?n:s&&r.endsWith(`
|
|
754
754
|
`)?`${r}\u200B`:r;return this.markdown&&!s&&r!==""?m`<span class="box"
|
|
755
755
|
><div
|
|
756
756
|
class="view dpk-prose"
|
|
@@ -761,7 +761,7 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
|
|
|
761
761
|
@click=${this.#s}
|
|
762
762
|
@keydown=${this.#i}
|
|
763
763
|
>
|
|
764
|
-
${
|
|
764
|
+
${yr(Zr(r))}
|
|
765
765
|
</div></span
|
|
766
766
|
>`:m`<span class="box"
|
|
767
767
|
><span
|
|
@@ -778,7 +778,7 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
|
|
|
778
778
|
>`}#r(e,n){return this.multiline||this.wrap?m`<textarea
|
|
779
779
|
class="field"
|
|
780
780
|
rows="1"
|
|
781
|
-
.value=${
|
|
781
|
+
.value=${Mn(this.#e)}
|
|
782
782
|
placeholder=${n}
|
|
783
783
|
aria-label=${e}
|
|
784
784
|
@input=${this.#o}
|
|
@@ -786,27 +786,27 @@ Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error
|
|
|
786
786
|
@blur=${this.#l}
|
|
787
787
|
></textarea>`:m`<input
|
|
788
788
|
class="field"
|
|
789
|
-
.value=${
|
|
789
|
+
.value=${Mn(this.#e)}
|
|
790
790
|
placeholder=${n}
|
|
791
791
|
aria-label=${e}
|
|
792
792
|
@input=${this.#o}
|
|
793
793
|
@keydown=${this.#a}
|
|
794
794
|
@blur=${this.#l}
|
|
795
|
-
/>`}#s=e=>{e.composedPath().some(n=>n instanceof HTMLAnchorElement)||(e.stopPropagation(),!this.editing&&(this.#e=this.value,this.editing=!0))};#i=e=>{e.isComposing||this.editing||e.target instanceof HTMLAnchorElement||(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.editing=!0)};#o=e=>{const n=Ee(e.target,HTMLInputElement)??Ee(e.target,HTMLTextAreaElement);n!==null&&(this.#e=n.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.#d())}};#l=e=>{const n=e.currentTarget;if(!(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement))return;const s=this.#t,{selectionStart:r,selectionEnd:i}=n;queueMicrotask(()=>{!this.isConnected||!this.editing||(s!==this.#t?(n.focus(),n.setSelectionRange(r,i)):this.#d())})};#d=()=>{if(!this.editing)return;this.editing=!1;const n=(this.wrap?this.#e.replace(/\r?\n/g," "):this.#e).trim();n!==this.value&&this.dispatchEvent(new CustomEvent("dpk-commit",{detail:{value:n},bubbles:!0,composed:!0}))}}const Ec=()=>{customElements.get("dpk-component-inline-edit")||customElements.define("dpk-component-inline-edit",Zr)},Rc={lang:void 0,message:void 0,abortEarly:void 0,abortPipeEarly:void 0};function Kn(t){return Rc}let _c;function Oc(t){return _c?.get(t)}let Lc;function Pc(t){return Lc?.get(t)}let zc;function Mc(t,e){return zc?.get(t)?.get(e)}function We(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 R(t,e,n,s,r){const i=r&&"input"in r?r.input:n.value,o=r?.expected??t.expects??null,a=r?.received??We(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:s.lang,abortEarly:s.abortEarly,abortPipeEarly:s.abortPipeEarly},d=t.kind==="schema",c=r?.message??t.message??Mc(t.reference,l.lang)??(d?Pc(l.lang):null)??s.message??Oc(l.lang);c!==void 0&&(l.message=typeof c=="function"?c(l):c),d&&(n.typed=!1),n.issues?n.issues.push(l):n.issues=[l]}function Ic(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function Nc(t,e){return Object.prototype.hasOwnProperty.call(t,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function Qn(t,e){const n=[...new Set(t)];return n.length>1?`(${n.join(` ${e} `)})`:n[0]??"never"}function M(t){return t["~standard"]={version:1,vendor:"valibot",validate:e=>t["~run"]({value:e},Kn())},t}function Dc(t){if(t.path){let e="";for(const n of t.path)if(typeof n.key=="string"||typeof n.key=="number")e?e+=`.${n.key}`:e+=n.key;else return null;return e}return null}var jc=class extends Error{constructor(t){super(t[0].message),this.name="ValiError",this.issues=t}};const qc=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])$/u,Bc=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])[T ](?:0\d|1\d|2[0-3])(?::[0-5]\d){2}(?:\.\d{1,9})?(?:Z| ?[+-](?:0\d|1\d|2[0-3])(?::?[0-5]\d)?)$/u;function Yr(t,e){return{kind:"validation",type:"check",reference:Yr,async:!1,expects:null,requirement:t,message:e,"~run"(n,s){return n.typed&&!this.requirement(n.value)&&R(this,"input",n,s),n}}}function Jr(t){return{kind:"validation",type:"finite",reference:Jr,async:!1,expects:null,requirement:Number.isFinite,message:t,"~run"(e,n){return e.typed&&!this.requirement(e.value)&&R(this,"finite",e,n),e}}}function Xr(t,e){const n=We(t);return{kind:"validation",type:"includes",reference:Xr,async:!1,expects:n,requirement:t,message:e,"~run"(s,r){return s.typed&&!s.value.includes(this.requirement)&&R(this,"content",s,r,{received:`!${n}`}),s}}}function ei(t){return{kind:"validation",type:"integer",reference:ei,async:!1,expects:null,requirement:Number.isInteger,message:t,"~run"(e,n){return e.typed&&!this.requirement(e.value)&&R(this,"integer",e,n),e}}}function ti(t){return{kind:"validation",type:"iso_date",reference:ti,async:!1,expects:null,requirement:qc,message:t,"~run"(e,n){return e.typed&&!this.requirement.test(e.value)&&R(this,"date",e,n),e}}}function ni(t){return{kind:"validation",type:"iso_timestamp",reference:ni,async:!1,expects:null,requirement:Bc,message:t,"~run"(e,n){return e.typed&&!this.requirement.test(e.value)&&R(this,"timestamp",e,n),e}}}function $(t,e){return{kind:"validation",type:"min_length",reference:$,async:!1,expects:`>=${t}`,requirement:t,message:e,"~run"(n,s){return n.typed&&n.value.length<this.requirement&&R(this,"length",n,s,{received:`${n.value.length}`}),n}}}function si(t,e){return{kind:"validation",type:"min_value",reference:si,async:!1,expects:`>=${t instanceof Date?t.toJSON():We(t)}`,requirement:t,message:e,"~run"(n,s){return n.typed&&!(n.value>=this.requirement)&&R(this,"value",n,s,{received:n.value instanceof Date?n.value.toJSON():We(n.value)}),n}}}function oe(t,e){return{kind:"validation",type:"regex",reference:oe,async:!1,expects:`${t}`,requirement:t,message:e,"~run"(n,s){return n.typed&&!this.requirement.test(n.value)&&R(this,"format",n,s),n}}}function Zn(){return{kind:"transformation",type:"trim",reference:Zn,async:!1,"~run"(t){return t.value=t.value.trim(),t}}}function ri(t){return{kind:"validation",type:"url",reference:ri,async:!1,expects:null,requirement(e){try{return URL.canParse?URL.canParse(e):(new URL(e),!0)}catch{return!1}},message:t,"~run"(e,n){return e.typed&&!this.requirement(e.value)&&R(this,"URL",e,n),e}}}const ii={abortEarly:!0};function oi(t,e,n){return typeof t.fallback=="function"?t.fallback(e,n):t.fallback}function Ut(t,e,n){return typeof t.default=="function"?t.default(e,n):t.default}function Hc(t,e){return!t["~run"]({value:e},ii).issues}function ai(){return M({kind:"schema",type:"any",reference:ai,expects:"any",async:!1,"~run"(t){return t.typed=!0,t}})}function j(t,e){return M({kind:"schema",type:"array",reference:j,expects:"Array",async:!1,item:t,message:e,"~run"(n,s){const r=n.value;if(Array.isArray(r)){n.typed=!0,n.value=[];for(let i=0;i<r.length;i++){const o=r[i],a=this.item["~run"]({value:o},s);if(a.issues){const l={type:"array",origin:"value",input:r,key:i,value:o};for(const d of a.issues)d.path?d.path.unshift(l):d.path=[l],n.issues?.push(d);if(n.issues||(n.issues=a.issues),s.abortEarly){n.typed=!1;break}}a.typed||(n.typed=!1),n.value.push(a.value)}}else R(this,"type",n,s);return n}})}function Yn(t){return M({kind:"schema",type:"boolean",reference:Yn,expects:"boolean",async:!1,message:t,"~run"(e,n){return typeof e.value=="boolean"?e.typed=!0:R(this,"type",e,n),e}})}function U(t,e){return M({kind:"schema",type:"exact_optional",reference:U,expects:t.expects,async:!1,wrapped:t,default:e,"~run"(n,s){return this.wrapped["~run"](n,s)}})}function li(t){return M({kind:"schema",type:"lazy",reference:li,expects:"unknown",async:!1,getter:t,"~run"(e,n){return this.getter(e.value)["~run"](e,n)}})}function G(t,e){return M({kind:"schema",type:"literal",reference:G,expects:We(t),async:!1,literal:t,message:e,"~run"(n,s){return Ic(n.value,this.literal)?n.typed=!0:R(this,"type",n,s),n}})}function ci(t,e){return M({kind:"schema",type:"nullable",reference:ci,expects:`(${t.expects} | null)`,async:!1,wrapped:t,default:e,"~run"(n,s){return n.value===null&&(this.default!==void 0&&(n.value=Ut(this,n,s)),n.value===null)?(n.typed=!0,n):this.wrapped["~run"](n,s)}})}function di(t){return M({kind:"schema",type:"number",reference:di,expects:"number",async:!1,message:t,"~run"(e,n){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:R(this,"type",e,n),e}})}function O(t,e){return M({kind:"schema",type:"object",reference:O,expects:"Object",async:!1,entries:t,message:e,"~run"(n,s){const r=n.value;if(r&&typeof r=="object"){n.typed=!0,n.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]:Ut(o),l=o["~run"]({value:a},s);if(l.issues){const d={type:"object",origin:"value",input:r,key:i,value:a};for(const c of l.issues)c.path?c.path.unshift(d):c.path=[d],n.issues?.push(c);if(n.issues||(n.issues=l.issues),s.abortEarly){n.typed=!1;break}}l.typed||(n.typed=!1),n.value[i]=l.value}else if(o.fallback!==void 0)n.value[i]=oi(o);else if(o.type!=="exact_optional"&&o.type!=="optional"&&o.type!=="nullish"&&(R(this,"key",n,s,{input:void 0,expected:`"${i}"`,path:[{type:"object",origin:"key",input:r,key:i,value:r[i]}]}),s.abortEarly))break}}else R(this,"type",n,s);return n}})}function D(t,e){return M({kind:"schema",type:"optional",reference:D,expects:`(${t.expects} | undefined)`,async:!1,wrapped:t,default:e,"~run"(n,s){return n.value===void 0&&(this.default!==void 0&&(n.value=Ut(this,n,s)),n.value===void 0)?(n.typed=!0,n):this.wrapped["~run"](n,s)}})}function Ft(t,e){return M({kind:"schema",type:"picklist",reference:Ft,expects:Qn(t.map(We),"|"),async:!1,options:t,message:e,"~run"(n,s){return this.options.includes(n.value)?n.typed=!0:R(this,"type",n,s),n}})}function Ge(t,e,n){return M({kind:"schema",type:"record",reference:Ge,expects:"Object",async:!1,key:t,value:e,message:n,"~run"(s,r){const i=s.value;if(i&&typeof i=="object"){s.typed=!0,s.value={};for(const o in i)if(Nc(i,o)){const a=i[o],l=this.key["~run"]({value:o},r);if(l.issues){const c={type:"object",origin:"key",input:i,key:o,value:a};for(const p of l.issues)p.path=[c],s.issues?.push(p);if(s.issues||(s.issues=l.issues),r.abortEarly){s.typed=!1;break}}const d=this.value["~run"]({value:a},r);if(d.issues){const c={type:"object",origin:"value",input:i,key:o,value:a};for(const p of d.issues)p.path?p.path.unshift(c):p.path=[c],s.issues?.push(p);if(s.issues||(s.issues=d.issues),r.abortEarly){s.typed=!1;break}}(!l.typed||!d.typed)&&(s.typed=!1),l.typed&&(s.value[l.value]=d.value)}}else R(this,"type",s,r);return s}})}function z(t,e){return M({kind:"schema",type:"strict_object",reference:z,expects:"Object",async:!1,entries:t,message:e,"~run"(n,s){const r=n.value;if(r&&typeof r=="object"){n.typed=!0,n.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]:Ut(o),l=o["~run"]({value:a},s);if(l.issues){const d={type:"object",origin:"value",input:r,key:i,value:a};for(const c of l.issues)c.path?c.path.unshift(d):c.path=[d],n.issues?.push(c);if(n.issues||(n.issues=l.issues),s.abortEarly){n.typed=!1;break}}l.typed||(n.typed=!1),n.value[i]=l.value}else if(o.fallback!==void 0)n.value[i]=oi(o);else if(o.type!=="exact_optional"&&o.type!=="optional"&&o.type!=="nullish"&&(R(this,"key",n,s,{input:void 0,expected:`"${i}"`,path:[{type:"object",origin:"key",input:r,key:i,value:r[i]}]}),s.abortEarly))break}if(!n.issues||!s.abortEarly){for(const i in r)if(!Object.prototype.hasOwnProperty.call(this.entries,i)){R(this,"key",n,s,{input:i,expected:"never",path:[{type:"object",origin:"key",input:r,key:i,value:r[i]}]});break}}}else R(this,"type",n,s);return n}})}function v(t){return M({kind:"schema",type:"string",reference:v,expects:"string",async:!1,message:t,"~run"(e,n){return typeof e.value=="string"?e.typed=!0:R(this,"type",e,n),e}})}function pi(t){let e;if(t)for(const n of t)if(e)for(const s of n.issues)e.push(s);else e=n.issues;return e}function Jn(t,e){return M({kind:"schema",type:"union",reference:Jn,expects:Qn(t.map(n=>n.expects),"|"),async:!1,options:t,message:e,"~run"(n,s){let r,i,o;for(const a of this.options){const l=a["~run"]({value:n.value},s);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];R(this,"type",n,s,{issues:pi(i)}),n.typed=!0}else{if(o?.length===1)return o[0];R(this,"type",n,s,{issues:pi(o)})}return n}})}function ve(){return M({kind:"schema",type:"unknown",reference:ve,expects:"unknown",async:!1,"~run"(t){return t.typed=!0,t}})}function Wt(t,e,n){return M({kind:"schema",type:"variant",reference:Wt,expects:"Object",async:!1,key:t,options:e,message:n,"~run"(s,r){const i=s.value;if(i&&typeof i=="object"){let o,a=0,l=this.key,d=[];const c=(p,u)=>{for(const h of p.options){if(h.type==="variant")c(h,new Set(u).add(h.key));else{let f=!0,g=0;for(const b of u){const x=h.entries[b];if(b in i?x["~run"]({typed:!1,value:i[b]},ii).issues:x.type!=="exact_optional"&&x.type!=="optional"&&x.type!=="nullish"){f=!1,l!==b&&(a<g||a===g&&b in i&&!(l in i))&&(a=g,l=b,d=[]),l===b&&d.push(h.entries[b].expects);break}g++}if(f){const b=h["~run"]({value:i},r);(!o||!o.typed&&b.typed)&&(o=b)}}if(o&&!o.issues)break}};if(c(this,new Set([this.key])),o)return o;R(this,"type",s,r,{input:i[l],expected:Qn(d,"|"),path:[{type:"object",origin:"value",input:i,key:l,value:i[l]}]})}else R(this,"type",s,r);return s}})}function Gt(t,e,n){const s=t["~run"]({value:e},Kn());if(s.issues)throw new jc(s.issues);return s.value}function y(...t){return M({...t[0],pipe:t,"~run"(e,n){for(const s of t)if(s.kind!=="metadata"){if(e.issues&&(s.kind==="schema"||s.kind==="transformation")){e.typed=!1;break}(!e.issues||!n.abortEarly&&!n.abortPipeEarly)&&(e=s["~run"](e,n))}return e}})}function C(t,e,n){const s=t["~run"]({value:e},Kn());return{typed:s.typed,success:!s.issues,output:s.value,issues:s.issues}}function Uc(t){let e="";for(const n of t){e&&(e+=`
|
|
796
|
-
`),e+=`\xD7 ${n.message}`;const s=
|
|
797
|
-
\u2192 at ${s}`)}return e}const
|
|
795
|
+
/>`}#s=e=>{e.composedPath().some(n=>n instanceof HTMLAnchorElement)||(e.stopPropagation(),!this.editing&&(this.#e=this.value,this.editing=!0))};#i=e=>{e.isComposing||this.editing||e.target instanceof HTMLAnchorElement||(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.editing=!0)};#o=e=>{const n=Ee(e.target,HTMLInputElement)??Ee(e.target,HTMLTextAreaElement);n!==null&&(this.#e=n.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 n=e.currentTarget;if(!(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement))return;const s=this.#t,{selectionStart:r,selectionEnd:i}=n;queueMicrotask(()=>{!this.isConnected||!this.editing||(s!==this.#t?(n.focus(),n.setSelectionRange(r,i)):this.#p())})};#p=()=>{if(!this.editing)return;this.editing=!1;const n=(this.wrap?this.#e.replace(/\r?\n/g," "):this.#e).trim();n!==this.value&&this.dispatchEvent(new CustomEvent("dpk-commit",{detail:{value:n},bubbles:!0,composed:!0}))}}const Rc=()=>{customElements.get("dpk-component-inline-edit")||customElements.define("dpk-component-inline-edit",Yr)},_c={lang:void 0,message:void 0,abortEarly:void 0,abortPipeEarly:void 0};function Qn(t){return _c}let Oc;function Lc(t){return Oc?.get(t)}let Pc;function zc(t){return Pc?.get(t)}let Mc;function Ic(t,e){return Mc?.get(t)?.get(e)}function We(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 R(t,e,n,s,r){const i=r&&"input"in r?r.input:n.value,o=r?.expected??t.expects??null,a=r?.received??We(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:s.lang,abortEarly:s.abortEarly,abortPipeEarly:s.abortPipeEarly},d=t.kind==="schema",c=r?.message??t.message??Ic(t.reference,l.lang)??(d?zc(l.lang):null)??s.message??Lc(l.lang);c!==void 0&&(l.message=typeof c=="function"?c(l):c),d&&(n.typed=!1),n.issues?n.issues.push(l):n.issues=[l]}function Nc(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function Dc(t,e){return Object.prototype.hasOwnProperty.call(t,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function Zn(t,e){const n=[...new Set(t)];return n.length>1?`(${n.join(` ${e} `)})`:n[0]??"never"}function M(t){return t["~standard"]={version:1,vendor:"valibot",validate:e=>t["~run"]({value:e},Qn())},t}function jc(t){if(t.path){let e="";for(const n of t.path)if(typeof n.key=="string"||typeof n.key=="number")e?e+=`.${n.key}`:e+=n.key;else return null;return e}return null}var qc=class extends Error{constructor(t){super(t[0].message),this.name="ValiError",this.issues=t}};const Bc=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])$/u,Hc=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])[T ](?:0\d|1\d|2[0-3])(?::[0-5]\d){2}(?:\.\d{1,9})?(?:Z| ?[+-](?:0\d|1\d|2[0-3])(?::?[0-5]\d)?)$/u;function Jr(t,e){return{kind:"validation",type:"check",reference:Jr,async:!1,expects:null,requirement:t,message:e,"~run"(n,s){return n.typed&&!this.requirement(n.value)&&R(this,"input",n,s),n}}}function Xr(t){return{kind:"validation",type:"finite",reference:Xr,async:!1,expects:null,requirement:Number.isFinite,message:t,"~run"(e,n){return e.typed&&!this.requirement(e.value)&&R(this,"finite",e,n),e}}}function ei(t,e){const n=We(t);return{kind:"validation",type:"includes",reference:ei,async:!1,expects:n,requirement:t,message:e,"~run"(s,r){return s.typed&&!s.value.includes(this.requirement)&&R(this,"content",s,r,{received:`!${n}`}),s}}}function ti(t){return{kind:"validation",type:"integer",reference:ti,async:!1,expects:null,requirement:Number.isInteger,message:t,"~run"(e,n){return e.typed&&!this.requirement(e.value)&&R(this,"integer",e,n),e}}}function ni(t){return{kind:"validation",type:"iso_date",reference:ni,async:!1,expects:null,requirement:Bc,message:t,"~run"(e,n){return e.typed&&!this.requirement.test(e.value)&&R(this,"date",e,n),e}}}function si(t){return{kind:"validation",type:"iso_timestamp",reference:si,async:!1,expects:null,requirement:Hc,message:t,"~run"(e,n){return e.typed&&!this.requirement.test(e.value)&&R(this,"timestamp",e,n),e}}}function $(t,e){return{kind:"validation",type:"min_length",reference:$,async:!1,expects:`>=${t}`,requirement:t,message:e,"~run"(n,s){return n.typed&&n.value.length<this.requirement&&R(this,"length",n,s,{received:`${n.value.length}`}),n}}}function ri(t,e){return{kind:"validation",type:"min_value",reference:ri,async:!1,expects:`>=${t instanceof Date?t.toJSON():We(t)}`,requirement:t,message:e,"~run"(n,s){return n.typed&&!(n.value>=this.requirement)&&R(this,"value",n,s,{received:n.value instanceof Date?n.value.toJSON():We(n.value)}),n}}}function te(t,e){return{kind:"validation",type:"regex",reference:te,async:!1,expects:`${t}`,requirement:t,message:e,"~run"(n,s){return n.typed&&!this.requirement.test(n.value)&&R(this,"format",n,s),n}}}function Yn(){return{kind:"transformation",type:"trim",reference:Yn,async:!1,"~run"(t){return t.value=t.value.trim(),t}}}function ii(t){return{kind:"validation",type:"url",reference:ii,async:!1,expects:null,requirement(e){try{return URL.canParse?URL.canParse(e):(new URL(e),!0)}catch{return!1}},message:t,"~run"(e,n){return e.typed&&!this.requirement(e.value)&&R(this,"URL",e,n),e}}}const oi={abortEarly:!0};function ai(t,e,n){return typeof t.fallback=="function"?t.fallback(e,n):t.fallback}function Ft(t,e,n){return typeof t.default=="function"?t.default(e,n):t.default}function Uc(t,e){return!t["~run"]({value:e},oi).issues}function li(){return M({kind:"schema",type:"any",reference:li,expects:"any",async:!1,"~run"(t){return t.typed=!0,t}})}function j(t,e){return M({kind:"schema",type:"array",reference:j,expects:"Array",async:!1,item:t,message:e,"~run"(n,s){const r=n.value;if(Array.isArray(r)){n.typed=!0,n.value=[];for(let i=0;i<r.length;i++){const o=r[i],a=this.item["~run"]({value:o},s);if(a.issues){const l={type:"array",origin:"value",input:r,key:i,value:o};for(const d of a.issues)d.path?d.path.unshift(l):d.path=[l],n.issues?.push(d);if(n.issues||(n.issues=a.issues),s.abortEarly){n.typed=!1;break}}a.typed||(n.typed=!1),n.value.push(a.value)}}else R(this,"type",n,s);return n}})}function Jn(t){return M({kind:"schema",type:"boolean",reference:Jn,expects:"boolean",async:!1,message:t,"~run"(e,n){return typeof e.value=="boolean"?e.typed=!0:R(this,"type",e,n),e}})}function B(t,e){return M({kind:"schema",type:"exact_optional",reference:B,expects:t.expects,async:!1,wrapped:t,default:e,"~run"(n,s){return this.wrapped["~run"](n,s)}})}function ci(t){return M({kind:"schema",type:"lazy",reference:ci,expects:"unknown",async:!1,getter:t,"~run"(e,n){return this.getter(e.value)["~run"](e,n)}})}function G(t,e){return M({kind:"schema",type:"literal",reference:G,expects:We(t),async:!1,literal:t,message:e,"~run"(n,s){return Nc(n.value,this.literal)?n.typed=!0:R(this,"type",n,s),n}})}function di(t,e){return M({kind:"schema",type:"nullable",reference:di,expects:`(${t.expects} | null)`,async:!1,wrapped:t,default:e,"~run"(n,s){return n.value===null&&(this.default!==void 0&&(n.value=Ft(this,n,s)),n.value===null)?(n.typed=!0,n):this.wrapped["~run"](n,s)}})}function pi(t){return M({kind:"schema",type:"number",reference:pi,expects:"number",async:!1,message:t,"~run"(e,n){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:R(this,"type",e,n),e}})}function O(t,e){return M({kind:"schema",type:"object",reference:O,expects:"Object",async:!1,entries:t,message:e,"~run"(n,s){const r=n.value;if(r&&typeof r=="object"){n.typed=!0,n.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]:Ft(o),l=o["~run"]({value:a},s);if(l.issues){const d={type:"object",origin:"value",input:r,key:i,value:a};for(const c of l.issues)c.path?c.path.unshift(d):c.path=[d],n.issues?.push(c);if(n.issues||(n.issues=l.issues),s.abortEarly){n.typed=!1;break}}l.typed||(n.typed=!1),n.value[i]=l.value}else if(o.fallback!==void 0)n.value[i]=ai(o);else if(o.type!=="exact_optional"&&o.type!=="optional"&&o.type!=="nullish"&&(R(this,"key",n,s,{input:void 0,expected:`"${i}"`,path:[{type:"object",origin:"key",input:r,key:i,value:r[i]}]}),s.abortEarly))break}}else R(this,"type",n,s);return n}})}function D(t,e){return M({kind:"schema",type:"optional",reference:D,expects:`(${t.expects} | undefined)`,async:!1,wrapped:t,default:e,"~run"(n,s){return n.value===void 0&&(this.default!==void 0&&(n.value=Ft(this,n,s)),n.value===void 0)?(n.typed=!0,n):this.wrapped["~run"](n,s)}})}function Wt(t,e){return M({kind:"schema",type:"picklist",reference:Wt,expects:Zn(t.map(We),"|"),async:!1,options:t,message:e,"~run"(n,s){return this.options.includes(n.value)?n.typed=!0:R(this,"type",n,s),n}})}function Ge(t,e,n){return M({kind:"schema",type:"record",reference:Ge,expects:"Object",async:!1,key:t,value:e,message:n,"~run"(s,r){const i=s.value;if(i&&typeof i=="object"){s.typed=!0,s.value={};for(const o in i)if(Dc(i,o)){const a=i[o],l=this.key["~run"]({value:o},r);if(l.issues){const c={type:"object",origin:"key",input:i,key:o,value:a};for(const p of l.issues)p.path=[c],s.issues?.push(p);if(s.issues||(s.issues=l.issues),r.abortEarly){s.typed=!1;break}}const d=this.value["~run"]({value:a},r);if(d.issues){const c={type:"object",origin:"value",input:i,key:o,value:a};for(const p of d.issues)p.path?p.path.unshift(c):p.path=[c],s.issues?.push(p);if(s.issues||(s.issues=d.issues),r.abortEarly){s.typed=!1;break}}(!l.typed||!d.typed)&&(s.typed=!1),l.typed&&(s.value[l.value]=d.value)}}else R(this,"type",s,r);return s}})}function z(t,e){return M({kind:"schema",type:"strict_object",reference:z,expects:"Object",async:!1,entries:t,message:e,"~run"(n,s){const r=n.value;if(r&&typeof r=="object"){n.typed=!0,n.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]:Ft(o),l=o["~run"]({value:a},s);if(l.issues){const d={type:"object",origin:"value",input:r,key:i,value:a};for(const c of l.issues)c.path?c.path.unshift(d):c.path=[d],n.issues?.push(c);if(n.issues||(n.issues=l.issues),s.abortEarly){n.typed=!1;break}}l.typed||(n.typed=!1),n.value[i]=l.value}else if(o.fallback!==void 0)n.value[i]=ai(o);else if(o.type!=="exact_optional"&&o.type!=="optional"&&o.type!=="nullish"&&(R(this,"key",n,s,{input:void 0,expected:`"${i}"`,path:[{type:"object",origin:"key",input:r,key:i,value:r[i]}]}),s.abortEarly))break}if(!n.issues||!s.abortEarly){for(const i in r)if(!Object.prototype.hasOwnProperty.call(this.entries,i)){R(this,"key",n,s,{input:i,expected:"never",path:[{type:"object",origin:"key",input:r,key:i,value:r[i]}]});break}}}else R(this,"type",n,s);return n}})}function v(t){return M({kind:"schema",type:"string",reference:v,expects:"string",async:!1,message:t,"~run"(e,n){return typeof e.value=="string"?e.typed=!0:R(this,"type",e,n),e}})}function hi(t){let e;if(t)for(const n of t)if(e)for(const s of n.issues)e.push(s);else e=n.issues;return e}function Xn(t,e){return M({kind:"schema",type:"union",reference:Xn,expects:Zn(t.map(n=>n.expects),"|"),async:!1,options:t,message:e,"~run"(n,s){let r,i,o;for(const a of this.options){const l=a["~run"]({value:n.value},s);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];R(this,"type",n,s,{issues:hi(i)}),n.typed=!0}else{if(o?.length===1)return o[0];R(this,"type",n,s,{issues:hi(o)})}return n}})}function ve(){return M({kind:"schema",type:"unknown",reference:ve,expects:"unknown",async:!1,"~run"(t){return t.typed=!0,t}})}function Gt(t,e,n){return M({kind:"schema",type:"variant",reference:Gt,expects:"Object",async:!1,key:t,options:e,message:n,"~run"(s,r){const i=s.value;if(i&&typeof i=="object"){let o,a=0,l=this.key,d=[];const c=(p,u)=>{for(const h of p.options){if(h.type==="variant")c(h,new Set(u).add(h.key));else{let f=!0,g=0;for(const b of u){const x=h.entries[b];if(b in i?x["~run"]({typed:!1,value:i[b]},oi).issues:x.type!=="exact_optional"&&x.type!=="optional"&&x.type!=="nullish"){f=!1,l!==b&&(a<g||a===g&&b in i&&!(l in i))&&(a=g,l=b,d=[]),l===b&&d.push(h.entries[b].expects);break}g++}if(f){const b=h["~run"]({value:i},r);(!o||!o.typed&&b.typed)&&(o=b)}}if(o&&!o.issues)break}};if(c(this,new Set([this.key])),o)return o;R(this,"type",s,r,{input:i[l],expected:Zn(d,"|"),path:[{type:"object",origin:"value",input:i,key:l,value:i[l]}]})}else R(this,"type",s,r);return s}})}function Vt(t,e,n){const s=t["~run"]({value:e},Qn());if(s.issues)throw new qc(s.issues);return s.value}function y(...t){return M({...t[0],pipe:t,"~run"(e,n){for(const s of t)if(s.kind!=="metadata"){if(e.issues&&(s.kind==="schema"||s.kind==="transformation")){e.typed=!1;break}(!e.issues||!n.abortEarly&&!n.abortPipeEarly)&&(e=s["~run"](e,n))}return e}})}function C(t,e,n){const s=t["~run"]({value:e},Qn());return{typed:s.typed,success:!s.issues,output:s.value,issues:s.issues}}function Fc(t){let e="";for(const n of t){e&&(e+=`
|
|
796
|
+
`),e+=`\xD7 ${n.message}`;const s=jc(n);s&&(e+=`
|
|
797
|
+
\u2192 at ${s}`)}return e}const Kt=O({type:y(v(),$(1)),id:y(v(),$(1))}),es=y(v(),$(1),te(/^[A-Za-z0-9_-]+$/,'ids may only contain letters, digits, "_" and "-" (a "." builds a path)')),Wc=(t,e)=>{if(e===1)return t.includes(".")?null:[t];const n=t.split(".");return n.length===e&&n.every(s=>s.length>0)?n:null},Pe=O({id:y(v(),$(1)),type:y(v(),$(1)),target:Kt,payload:ve(),note:B(v()),createdAt:y(v(),$(1))}),Gc=(t,e,n,s={})=>{const r=O({id:y(v(),$(1)),type:G(t),target:Kt,payload:n,note:B(v()),createdAt:y(v(),$(1))}),i=o=>{const a=C(Pe,o);if(!a.success||a.output.type!==t)return null;const l=C(n,o.payload);return l.success?{id:a.output.id,type:t,target:a.output.target,payload:l.output,...a.output.note===void 0?{}:{note:a.output.note},createdAt:a.output.createdAt}:null};return{schema:r,mode:s.mode??"patch",targetType:e,actionType:t,payloadSchema:n,parse:i,...s.dedupeKey?{dedupeKey:s.dedupeKey}:{}}},Vc=(t,e)=>{const n=ht(t,e.type);if(n===void 0)return null;const s=n.parse(e);return s===null?null:s},Kc=(t,e)=>{const n=C(t.payloadSchema,e.payload);if(!n.success)throw new Error(`invalid payload for action "${e.type}"`);return n.output},ht=(t,e)=>Object.hasOwn(t,e)?t[e]:void 0,Qc=t=>{throw new Error(`unhandled action: ${JSON.stringify(t)}`)},Zc=O({id:y(v(),$(1))}),Yc=t=>{const e=C(Zc,t.payload);return`${t.type}|${e.success?e.output.id:JSON.stringify(t.payload)}`},I=t=>`${t.type}:${t.id}`,ut=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"?ut(t.includes(":")?t:`${e}:${t}`):{type:t.type,id:t.id},Jc=(t,e)=>t.type===e.type&&t.id===e.id,ui=t=>{const e=t.normalize("NFKD").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40);return e.length>0?e:"item"},Xc=(t,e)=>{const n=ui(t),s=new Set(e);if(!s.has(n))return n;for(let r=2;r<1e3;r+=1){const i=`${n}-${r}`;if(!s.has(i))return i}return`${n}-${Math.random().toString(36).slice(2,8)}`},fi=()=>{const t=globalThis.crypto;return t?.randomUUID?t.randomUUID():`a-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`},H="comment",ze=t=>{const[e]=t;return{path:e?.path?.map(n=>String(n.key)).join(".")??"",message:e?.message??"invalid action"}},gi=O({type:y(v(),$(1)),target:Xn([y(v(),$(1)),Kt]),payload:D(ve()),note:B(v()),id:B(y(v(),$(1))),createdAt:B(y(v(),$(1)))}),ed=(t,e)=>{const n=C(gi,t);if(!n.success)return{ok:!1,issue:ze(n.issues)};const s=n.output,r=Qt(s.target,e.targetType),i={id:s.id??fi(),type:s.type,target:r,payload:s.payload??{},...s.note===void 0?{}:{note:s.note},createdAt:s.createdAt??new Date().toISOString()},o=C(e.schema,i);if(!o.success)return{ok:!1,issue:ze(o.issues)};const a=C(Pe,o.output);return a.success?{ok:!0,action:a.output}:{ok:!1,issue:ze(a.issues)}},ts=(t,e)=>e.dedupeKey?e.dedupeKey(t):e.mode!=="patch"?null:`${t.type}|${I(t.target)}`,mi=(t,e,n)=>{const s=ts(e,n);if(s===null)return[...t,e];const r=t.at(-1);return!r||ts(r,n)!==s||!td(r,e)?[...t,e]:[...t.slice(0,-1),e]},td=(t,e)=>Jc(t.target,e.target),ns=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),ki=O({id:y(v(),$(1)),type:G(H),target:O({type:y(v(),$(1)),id:y(v(),$(1))}),payload:O({body:y(v(),$(1))}),note:B(v()),createdAt:y(v(),$(1))}),ss={schema:ki,mode:"append",targetType:"page"},nd=O({body:v()}),ft=t=>{const e=C(nd,t.payload);return e.success?e.output.body:""},rs="element",bi=y(v(),te(/^[A-Z][A-Z0-9_]*$/,"component action types are CONSTANT_CASE")),vi=Ge(v(),ve()),sd=O({type:G(rs),id:y(v(),te(/^[^/]+\/.+/,"component references start with a provider id"))}),rd=O({id:y(v(),$(1)),type:bi,target:sd,payload:vi,note:B(v()),createdAt:y(v(),$(1))}),id={schema:rd,mode:"sequence",targetType:rs},od=z({type:bi,target:y(v(),te(/^element:[^/]+\/.+/)),payload:D(vi,{})}),xi=z({id:y(v(),$(1)),title:y(v(),$(1)),summary:B(v()),tone:B(Wt(["create","update","delete","move","meta"])),stale:B(Wt(["unsupported-action-type","target-missing","constraint-violated"]))}),is=t=>{if(t.type!==rs)return null;const e=t.id.indexOf("/");if(e<=0)return null;try{return decodeURIComponent(t.id.slice(0,e))}catch{return null}},ne=t=>t.type!==H&&is(t.target)!==null,ad=(t,e)=>t.filter(n=>ne(n)&&is(n.target)===e),yi=(t,e)=>{const n=new Map(t.flatMap(s=>ne(s)?[[s.id,is(s.target)]]:[]));return new Map(e.flatMap(s=>s.results.flatMap(r=>n.get(r.id)===s.id?[[r.id,r]]:[])))},os="data-dpk-grill",se="grill",Zt="answer",gt="data-grill-questions",ld=B(v()),wi=t=>{const e=t?.trim();return e===void 0||e===""?void 0:e},cd=t=>{const e=wi(t);return e===void 0?{}:{questions:e}},Ve={questions:[],rounds:[]},dd=z({id:es,label:y(v(),$(1))}),$i=z({id:es,ref:D(y(v(),$(1))),title:y(v(),$(1)),description:D(v()),note:D(v()),options:D(j(dd),[]),freeText:D(Jn(),!0)}),Si=Gt("kind",[z({kind:G("option"),optionId:y(v(),$(1))}),z({kind:G("free"),text:v()})]),Ai=Gt("kind",[...Si.options,z({kind:G("clear")})]),pd=z({...$i.entries,answer:D(Si)}),hd=z({label:D(y(v(),$(1))),questions:j(pd)}),ud=z({questions:j($i),history:D(j(hd),[])}),Ti=t=>{const e=new Set;return t.map((n,s)=>{if(e.has(n.id))throw new Error(`duplicate question id: ${n.id}`);e.add(n.id);const r=new Set;for(const i of n.options){if(r.has(i.id))throw new Error(`duplicate option id: ${i.id} in question ${n.id}`);r.add(i.id)}return{...n,ref:n.ref??`Q${s+1}`,description:n.description??null,note:n.note??null}})},Ci=t=>({id:t.id,ref:t.ref,title:t.title,description:t.description,note:t.note,options:t.options,freeText:t.freeText}),fd=t=>{const e=t.answer??null;if(e?.kind==="option"&&!t.options.some(n=>n.id===e.optionId))throw new Error(`unknown option id: ${e.optionId} in question ${t.id}`);return{...Ci(t),answer:e}},gd=t=>{const e=Vt(ud,t);return{questions:Ti(e.questions).map(Ci),rounds:e.history.map((n,s)=>({label:n.label??`v${s+1}`,questions:Ti(n.questions).map(fd)}))}},Ke=(t,e)=>t.questions.find(n=>n.id===e),as=(t,e)=>{const n=Ke(t,e);return n?`${n.ref} \xB7 ${n.title}`:e},Yt=(t,e)=>e?e.kind==="option"?t.options.find(n=>n.id===e.optionId)?.label??"":e.text.trim():"",Jt=(t,e)=>Yt(t,e)!=="",md=t=>{let e="";for(let n=t+1;n>0;n=Math.floor((n-1)/26))e=String.fromCharCode(97+(n-1)%26)+e;return e},Ei=(t,e)=>({total:t.questions.length,answered:t.questions.filter(n=>Jt(n,e[n.id])).length}),kd=(t,e,n)=>{const s=t.questions,r=s.findIndex(o=>o.id===n);return(r===-1?s:[...s.slice(r+1),...s.slice(0,r)]).find(o=>!Jt(o,e[o.id]))?.id??null},bd=y(v(),te(/^[A-Za-z0-9_-]+(?:@[A-Za-z0-9_-]+)?$/,"a question id, optionally qualified by its board (`retry@scope`)")),vd=O({id:y(v(),$(1)),type:G(Zt),target:O({type:G(se),id:bd}),payload:Ai,note:B(v()),createdAt:y(v(),$(1))}),xd={schema:vd,mode:"patch",targetType:se},Q=t=>t.type===Zt&&t.target.type===se,yd=(t,e)=>({type:Zt,target:{type:se,id:t},payload:e}),Ri=t=>{const e=C(Ai,t.payload);return e.success?e.output:null},wd=(t,e)=>[...t.filter(n=>!(Q(n)&&n.target.id===e.target.id)),e],_i=(t,e,n)=>{const s=Ke(t,n.target.id),r=Ri(n);if(!s||!r)return null;const i=e[s.id];if(r.kind==="clear"){if(i===void 0)return e;const o={...e};return delete o[s.id],o}return r.kind==="option"&&!s.options.some(o=>o.id===r.optionId)||r.kind==="free"&&!s.freeText?null:i?.kind==="option"&&r.kind==="option"&&i.optionId===r.optionId||i?.kind==="free"&&r.kind==="free"&&i.text===r.text?e:{...e,[s.id]:r}},mt=Object.freeze({}),Xt=t=>{const e=t.startsWith("#")?t.slice(1):t;if(e.length===0)return mt;const n=new URLSearchParams(e.startsWith("?")?e.slice(1):e),s={};for(const[r,i]of n)r.length>0&&i.length>0&&(s[r]=i);return s},Qe=t=>{const e=new URLSearchParams;for(const s of Object.keys(t).sort((r,i)=>r<i?-1:r>i?1:0)){const r=t[s];r!=null&&r!==""&&e.set(s,r)}const n=e.toString();return n.length===0?"":`#${n}`},en=(t,e,n=[])=>{const s={...t},r=Object.keys(e).map(i=>n.indexOf(i)).filter(i=>i>=0);if(r.length>0)for(const i of n.slice(Math.min(...r)+1))Object.hasOwn(e,i)||delete s[i];for(const[i,o]of Object.entries(e))o==null||o===""?delete s[i]:s[i]=o;return s},$d=(t,e="json")=>`\`\`\`${e}
|
|
798
798
|
${t}
|
|
799
|
-
\`\`\``,
|
|
800
|
-
> `)}`)}c.push("")}if(d.length>0){c.push(`## Answers (${d.length})`),c.push(""),c.push("The reader answered these questions from the `data-dpk-grill` block. Settle them in the page; when you ask the next round, move them into `history` with the answer as recorded."),c.push("");for(const[p,u]of d.entries()){const h=t.answers[u.id],f=h?.kind==="option"?` (option \`${h.optionId}\`)`:"";c.push(`${p+1}. **${
|
|
799
|
+
\`\`\``,Sd=t=>JSON.stringify({type:t.type,target:t.target,payload:t.payload,...t.note===void 0?{}:{note:t.note}},null,2),tn=(t,e,n)=>{const{actions:s,state:r}=t,i=new Set(t.stale.map(p=>p.action.id)),o=s.filter(p=>!i.has(p.id)),a=o.filter(p=>p.type===H),l=o.filter(p=>p.type!==H&&!Q(p)),d=t.grill.questions.filter(p=>Jt(p,t.answers[p.id])),c=[];if(c.push(`# Review draft \u2014 ${e.label}`),c.push(""),c.push(`- template: \`${e.name}\``),c.push(`- framework: \`dev-process-kit@${n}\``),c.push(`- navigation: \`${Qe(t.navigation)||"(none)"}\``),c.push(`- pending: ${l.length} change(s), ${a.length} comment(s)`+(d.length>0?`, ${d.length} answer(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(ne)&&(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,u]of a.entries()){const h=e.describe(u,r,t.base);c.push(`${p+1}. **${h.targetLabel}** \u2014 \`${I(u.target)}\``),c.push(` > ${ft(u).replace(/\n/g,`
|
|
800
|
+
> `)}`)}c.push("")}if(d.length>0){c.push(`## Answers (${d.length})`),c.push(""),c.push("The reader answered these questions from the `data-dpk-grill` block. Settle them in the page; when you ask the next round, move them into `history` with the answer as recorded."),c.push("");for(const[p,u]of d.entries()){const h=t.answers[u.id],f=h?.kind==="option"?` (option \`${h.optionId}\`)`:"";c.push(`${p+1}. **${as(t.grill,u.id)}** \u2014 \`grill:${u.id}\``),c.push(` > ${Yt(u,h).replace(/\n/g,`
|
|
801
801
|
> `)}${f}`)}c.push("")}if(l.length>0){c.push(`## Requested changes (${l.length})`),c.push("");for(const[p,u]of l.entries()){const h=e.describe(u,r,t.base),f=h.summary?` \u2014 ${h.summary}`:"";c.push(`${p+1}. **${h.title}**${f}`),c.push(` target: \`${I(u.target)}\` (${u.target.type})`),c.push(` \`\`\`json
|
|
802
|
-
${
|
|
802
|
+
${Sd(u).replace(/\n/g,`
|
|
803
803
|
`)}
|
|
804
|
-
\`\`\``)}c.push("")}if(l.length===0&&a.length===0&&d.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:u,reason:h}]of t.stale.entries()){const f=e.describe(u,r,t.base),g=u.type===
|
|
805
|
-
`)},X="0.2.0",os=async t=>{try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(t),!0}catch{}const e=document.activeElement,n=document.createElement("textarea");try{return n.value=t,n.setAttribute("readonly",""),n.style.position="fixed",n.style.opacity="0",document.body.append(n),n.select(),document.execCommand("copy")}catch{return!1}finally{n.remove(),e instanceof HTMLElement&&e.focus()}},_i=It({en:{heading:"Review notes",rejected:"Action rejected.",commentLabel:"Review comment",commentPlaceholder:"What the agent should fix, or what you noticed (handed to the agent as a review comment)",detach:"Detach",attachTo:t=>`Attach to this ${t}`,addNote:"Add to review",changesHeading:"Changes",commentsHeading:"Review comments",empty:"No draft actions yet.",emptyHint:"Comments and structural patches both land here, and survive reload via LocalStorage.",emptyChanges:"No changes yet.",emptyChangesHint:"What you edit, add or move on the page lands here and reaches the agent as a change.",emptyComments:"No review comments yet.",emptyCommentsHint:"Write what the agent should fix. Comments reach the agent with the changes and are not kept on the page.",sendToClaude:"Send to Claude",copy:"Copy changes & comments",copyTitle:"Copy the review to paste it to the agent",clear:"Clear all",deleteAction:"Delete this draft action",editComment:"Edit this comment",editLabel:"Edit the comment",saveEdit:"Save",cancelEdit:"Cancel",editHint:"Ctrl/Cmd + Enter to save, Esc to close",wholePage:"Whole page",comment:"Comment",sent:"Sent to Claude \u2713",copied:"Copied \u2713",copyFailed:"Could not copy"},ja:{heading:"\u30EC\u30D3\u30E5\u30FC\u30CE\u30FC\u30C8",rejected:"action \u3092\u53D7\u3051\u4ED8\u3051\u3089\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002",commentLabel:"\u30EC\u30D3\u30E5\u30FC\u30B3\u30E1\u30F3\u30C8",commentPlaceholder:"Agent \u306B\u76F4\u3057\u3066\u307B\u3057\u3044\u3053\u3068 / \u6C17\u3065\u304D\u3092\u66F8\u304F\uFF08\u30EC\u30D3\u30E5\u30FC\u30B3\u30E1\u30F3\u30C8\u3068\u3057\u3066\u6E21\u308B\uFF09",detach:"\u7D10\u3065\u3051\u3092\u89E3\u9664",attachTo:t=>`\u3053\u306E ${t} \u306B\u7D10\u3065\u3051\u308B`,addNote:"\u30EC\u30D3\u30E5\u30FC\u306B\u8FFD\u52A0",changesHeading:"\u5909\u66F4",commentsHeading:"\u30EC\u30D3\u30E5\u30FC\u30B3\u30E1\u30F3\u30C8",empty:"draft action \u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002",emptyHint:"\u30B3\u30E1\u30F3\u30C8\u3082\u69CB\u9020\u306E\u5909\u66F4\u3082\u3053\u3053\u306B\u96C6\u307E\u308A\u3001LocalStorage \u306B\u6B8B\u308B\u306E\u3067\u30EA\u30ED\u30FC\u30C9\u3057\u3066\u3082\u6D88\u3048\u307E\u305B\u3093\u3002",emptyChanges:"\u5909\u66F4\u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002",emptyChangesHint:"\u30DA\u30FC\u30B8\u4E0A\u3067\u7DE8\u96C6\u30FB\u8FFD\u52A0\u30FB\u79FB\u52D5\u3057\u305F\u5185\u5BB9\u304C\u3053\u3053\u306B\u96C6\u307E\u308A\u3001\u5909\u66F4\u3068\u3057\u3066 Agent \u306B\u6E21\u308A\u307E\u3059\u3002",emptyComments:"\u30EC\u30D3\u30E5\u30FC\u30B3\u30E1\u30F3\u30C8\u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002",emptyCommentsHint:"Agent \u306B\u76F4\u3057\u3066\u307B\u3057\u3044\u3053\u3068\u3092\u66F8\u304D\u307E\u3059\u3002\u5909\u66F4\u3068\u4E00\u7DD2\u306B Agent \u306B\u6E21\u308A\u3001\u30DA\u30FC\u30B8\u306B\u306F\u6B8B\u308A\u307E\u305B\u3093\u3002",sendToClaude:"Claude \u306B\u9001\u308B",copy:"\u5909\u66F4\u30FB\u30B3\u30E1\u30F3\u30C8\u3092\u30B3\u30D4\u30FC",copyTitle:"Review \u3092\u30B3\u30D4\u30FC\u3057\u3066 Agent \u306B\u8CBC\u308A\u4ED8\u3051\u308B",clear:"\u3059\u3079\u3066\u30AF\u30EA\u30A2",deleteAction:"\u3053\u306E draft action \u3092\u524A\u9664",editComment:"\u3053\u306E\u30B3\u30E1\u30F3\u30C8\u3092\u7DE8\u96C6",editLabel:"\u30B3\u30E1\u30F3\u30C8\u3092\u7DE8\u96C6",saveEdit:"\u4FDD\u5B58",cancelEdit:"\u30AD\u30E3\u30F3\u30BB\u30EB",editHint:"Ctrl/Cmd + Enter \u3067\u4FDD\u5B58\u3001Esc \u3067\u9589\u3058\u308B",wholePage:"\u30DA\u30FC\u30B8\u5168\u4F53",comment:"\u30B3\u30E1\u30F3\u30C8",sent:"Claude \u306B\u9001\u308A\u307E\u3057\u305F \u2713",copied:"\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F \u2713",copyFailed:"\u30B3\u30D4\u30FC\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F"}}),yd=()=>({body:"",editing:null,attachment:{kind:"page"},copy:{kind:"idle"},copyRequest:0,send:{kind:"idle"},sendRequest:0}),Oi=t=>t.kind==="explicit"?{kind:t.resume}:t,Li=(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:Oi(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:Oi(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}}}},wd=(t,e)=>{const n=t.body.trim();return n===""?null:{target:e,body:n}},$d=t=>{if(!t.editing)return null;const e=t.editing.body.trim();return e===""?null:{id:t.editing.id,body:e}},Sd={en:"English",ja:"\u65E5\u672C\u8A9E"},L=It({en:{review:"Review",reviewChanges:"Activity log",reviewComments:"Review comments",settings:"Settings",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",supplements:"Supplements",openSupplements:"Open supplements",closeSupplements:"Close supplements",handoffTooLarge:"The review is too long to send. Copy it and paste it instead",handoffConsent:"Commenting needs your permission. Allow it, then send again",handoffForbidden:"This page cannot send to Claude. Copy the review and paste it instead",handoffClaudeUnavailable:"Could not reach the Claude session. Copy the review and paste it instead",handoffRateLimited:"Too many sends in a row. Wait a moment, then send again",handoffStorage:"Could not save the review. Copy it and paste it instead",handoffError:"Could not send. Copy the review and paste it instead",handoffLabel:"Hand the review to the agent",handoffSend:"Send to Claude",handoffSending:"Sending\u2026",handoffSent:"Sent to Claude \u2713",handoffCopy:"Copy changes & comments",handoffCopyTitle:"Copy the review to paste it to the agent",handoffCopied:"Copied \u2713",handoffCopyFailed:"Could not copy",changes:"Updates",changesUnread:t=>`Updates (${t} new)`,changesTitle:"Changes by version",changesCurrent:"This version",changesReadAll:"Mark all as read",changesNew:"New",changesShow:"Show",changesDismiss:"Dismiss",changesWaiting:t=>`${t} more`,changesSeeAll:"See all",changesError:"Could not read the change log",grill:"Questions",grillError:"Could not read the questions",grillGroup:"Question",grillProgress:(t,e)=>`${t} of ${e} answered`,grillAnswer:"Answer",grillAnswerFree:"Answer in your own words",grillAnswerClear:"Clear answer",grillQuoted:t=>`\u2192 \u201C${t}\u201D`,grillOpen:t=>`Open question ${t}`,grillFreeText:"Your own answer",grillFreeTextOf:t=>`Your own answer to ${t}`,grillFreeTextPlaceholder:"Type an answer\u2026 (\u2318/Ctrl+Enter for next)",grillRoundSelect:"Question round",grillCurrentRound:"Current questions",grillRoundOption:(t,e)=>`${t} (${e})`,grillPastRound:t=>`${t}: earlier questions, read-only`,grillUnanswered:"Not answered",grillNoQuestions:"No questions in this round."},ja:{review:"\u30EC\u30D3\u30E5\u30FC",reviewChanges:"\u64CD\u4F5C\u30ED\u30B0",reviewComments:"\u30EC\u30D3\u30E5\u30FC\u30B3\u30E1\u30F3\u30C8",settings:"\u8A2D\u5B9A",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",supplements:"\u88DC\u8DB3\u60C5\u5831",openSupplements:"\u88DC\u8DB3\u60C5\u5831\u3092\u958B\u304F",closeSupplements:"\u88DC\u8DB3\u60C5\u5831\u3092\u9589\u3058\u308B",handoffTooLarge:"Review \u304C\u9577\u3059\u304E\u3066\u9001\u308C\u307E\u305B\u3093\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffConsent:"\u30B3\u30E1\u30F3\u30C8\u306E\u8A31\u53EF\u304C\u5FC5\u8981\u3067\u3059\u3002\u8A31\u53EF\u3057\u3066\u304B\u3089\u3082\u3046\u4E00\u5EA6\u9001\u3063\u3066\u304F\u3060\u3055\u3044",handoffForbidden:"\u3053\u306E\u30DA\u30FC\u30B8\u304B\u3089\u306F\u9001\u308C\u307E\u305B\u3093\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffClaudeUnavailable:"Claude \u306E\u30BB\u30C3\u30B7\u30E7\u30F3\u306B\u5C4A\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffRateLimited:"\u9001\u4FE1\u304C\u7D9A\u3044\u3066\u3044\u307E\u3059\u3002\u5C11\u3057\u5F85\u3063\u3066\u304B\u3089\u9001\u3063\u3066\u304F\u3060\u3055\u3044",handoffStorage:"Review \u3092\u4FDD\u5B58\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffError:"\u9001\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffLabel:"Review \u3092 Agent \u306B\u6E21\u3059",handoffSend:"Claude \u306B\u9001\u308B",handoffSending:"\u9001\u4FE1\u4E2D\u2026",handoffSent:"Claude \u306B\u9001\u308A\u307E\u3057\u305F \u2713",handoffCopy:"\u5909\u66F4\u30FB\u30B3\u30E1\u30F3\u30C8\u3092\u30B3\u30D4\u30FC",handoffCopyTitle:"Review \u3092\u30B3\u30D4\u30FC\u3057\u3066 Agent \u306B\u8CBC\u308A\u4ED8\u3051\u308B",handoffCopied:"\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F \u2713",handoffCopyFailed:"\u30B3\u30D4\u30FC\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F",changes:"\u66F4\u65B0\u306E\u304A\u77E5\u3089\u305B",changesUnread:t=>`\u66F4\u65B0\u306E\u304A\u77E5\u3089\u305B\uFF08\u65B0\u7740 ${t} \u4EF6\uFF09`,changesTitle:"\u7248\u3054\u3068\u306E\u5909\u66F4",changesCurrent:"\u3053\u306E\u7248",changesReadAll:"\u3059\u3079\u3066\u65E2\u8AAD\u306B\u3059\u308B",changesNew:"\u65B0\u7740",changesShow:"\u898B\u308B",changesDismiss:"\u9589\u3058\u308B",changesWaiting:t=>`\u307B\u304B ${t} \u4EF6`,changesSeeAll:"\u3059\u3079\u3066\u898B\u308B",changesError:"\u5909\u66F4\u306E\u4E00\u89A7\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F",grill:"\u8CEA\u554F",grillError:"\u8CEA\u554F\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F",grillGroup:"\u8CEA\u554F",grillProgress:(t,e)=>`\u56DE\u7B54\u6E08\u307F ${t} / ${e}`,grillAnswer:"\u56DE\u7B54",grillAnswerFree:"\u81EA\u7531\u8A18\u8FF0\u3067\u56DE\u7B54",grillAnswerClear:"\u56DE\u7B54\u3092\u30AF\u30EA\u30A2",grillQuoted:t=>`\u2192 \u300C${t}\u300D`,grillOpen:t=>`\u8CEA\u554F ${t} \u3092\u3072\u3089\u304F`,grillFreeText:"\u81EA\u7531\u8A18\u8FF0",grillFreeTextOf:t=>`${t} \u306E\u81EA\u7531\u8A18\u8FF0`,grillFreeTextPlaceholder:"\u56DE\u7B54\u3092\u5165\u529B\u2026\uFF08\u2318/Ctrl+Enter \u3067\u6B21\u3078\uFF09",grillRoundSelect:"\u8CEA\u554F\u306E\u30E9\u30A6\u30F3\u30C9",grillCurrentRound:"\u73FE\u5728\u306E\u8CEA\u554F",grillRoundOption:(t,e)=>`${t}\uFF08${e} \u554F\uFF09`,grillPastRound:t=>`${t}: \u904E\u53BB\u306E\u8CEA\u554F\uFF08\u95B2\u89A7\u306E\u307F\uFF09`,grillUnanswered:"\u672A\u56DE\u7B54",grillNoQuestions:"\u3053\u306E\u30E9\u30A6\u30F3\u30C9\u306B\u8CEA\u554F\u306F\u3042\u308A\u307E\u305B\u3093\u3002"}}),Ad=4096,Td="reviews",Pi="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.",Cd=t=>new TextEncoder().encode(t).length,Ed=t=>t.replace(/[\u0000-\u0008\u000B-\u001F\u007F]/g,""),Rd=t=>{const e=`${Pi}
|
|
804
|
+
\`\`\``)}c.push("")}if(l.length===0&&a.length===0&&d.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:u,reason:h}]of t.stale.entries()){const f=e.describe(u,r,t.base),g=u.type===H?ft(u):f.title;c.push(`${p+1}. \`${u.type}\` on \`${I(u.target)}\` (${h}) \u2014 ${g}`)}c.push("")}return c.push("## Canonical draft (JSON)"),c.push(""),c.push($d(ns(s))),c.push(""),c.join(`
|
|
805
|
+
`)},X="0.2.1",ls=async t=>{try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(t),!0}catch{}const e=document.activeElement,n=document.createElement("textarea");try{return n.value=t,n.setAttribute("readonly",""),n.style.position="fixed",n.style.opacity="0",document.body.append(n),n.select(),document.execCommand("copy")}catch{return!1}finally{n.remove(),e instanceof HTMLElement&&e.focus()}},Oi=Nt({en:{heading:"Review notes",rejected:"Action rejected.",commentLabel:"Review comment",commentPlaceholder:"What the agent should fix, or what you noticed (handed to the agent as a review comment)",detach:"Detach",attachTo:t=>`Attach to this ${t}`,addNote:"Add to review",changesHeading:"Changes",commentsHeading:"Review comments",empty:"No draft actions yet.",emptyHint:"Comments and structural patches both land here, and survive reload via LocalStorage.",emptyChanges:"No changes yet.",emptyChangesHint:"What you edit, add or move on the page lands here and reaches the agent as a change.",emptyComments:"No review comments yet.",emptyCommentsHint:"Write what the agent should fix. Comments reach the agent with the changes and are not kept on the page.",sendToClaude:"Send to Claude",copy:"Copy changes & comments",copyTitle:"Copy the review to paste it to the agent",clear:"Clear all",deleteAction:"Delete this draft action",editComment:"Edit this comment",editLabel:"Edit the comment",saveEdit:"Save",cancelEdit:"Cancel",editHint:"Ctrl/Cmd + Enter to save, Esc to close",wholePage:"Whole page",comment:"Comment",sent:"Sent to Claude \u2713",copied:"Copied \u2713",copyFailed:"Could not copy"},ja:{heading:"\u30EC\u30D3\u30E5\u30FC\u30CE\u30FC\u30C8",rejected:"action \u3092\u53D7\u3051\u4ED8\u3051\u3089\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002",commentLabel:"\u30EC\u30D3\u30E5\u30FC\u30B3\u30E1\u30F3\u30C8",commentPlaceholder:"Agent \u306B\u76F4\u3057\u3066\u307B\u3057\u3044\u3053\u3068 / \u6C17\u3065\u304D\u3092\u66F8\u304F\uFF08\u30EC\u30D3\u30E5\u30FC\u30B3\u30E1\u30F3\u30C8\u3068\u3057\u3066\u6E21\u308B\uFF09",detach:"\u7D10\u3065\u3051\u3092\u89E3\u9664",attachTo:t=>`\u3053\u306E ${t} \u306B\u7D10\u3065\u3051\u308B`,addNote:"\u30EC\u30D3\u30E5\u30FC\u306B\u8FFD\u52A0",changesHeading:"\u5909\u66F4",commentsHeading:"\u30EC\u30D3\u30E5\u30FC\u30B3\u30E1\u30F3\u30C8",empty:"draft action \u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002",emptyHint:"\u30B3\u30E1\u30F3\u30C8\u3082\u69CB\u9020\u306E\u5909\u66F4\u3082\u3053\u3053\u306B\u96C6\u307E\u308A\u3001LocalStorage \u306B\u6B8B\u308B\u306E\u3067\u30EA\u30ED\u30FC\u30C9\u3057\u3066\u3082\u6D88\u3048\u307E\u305B\u3093\u3002",emptyChanges:"\u5909\u66F4\u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002",emptyChangesHint:"\u30DA\u30FC\u30B8\u4E0A\u3067\u7DE8\u96C6\u30FB\u8FFD\u52A0\u30FB\u79FB\u52D5\u3057\u305F\u5185\u5BB9\u304C\u3053\u3053\u306B\u96C6\u307E\u308A\u3001\u5909\u66F4\u3068\u3057\u3066 Agent \u306B\u6E21\u308A\u307E\u3059\u3002",emptyComments:"\u30EC\u30D3\u30E5\u30FC\u30B3\u30E1\u30F3\u30C8\u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002",emptyCommentsHint:"Agent \u306B\u76F4\u3057\u3066\u307B\u3057\u3044\u3053\u3068\u3092\u66F8\u304D\u307E\u3059\u3002\u5909\u66F4\u3068\u4E00\u7DD2\u306B Agent \u306B\u6E21\u308A\u3001\u30DA\u30FC\u30B8\u306B\u306F\u6B8B\u308A\u307E\u305B\u3093\u3002",sendToClaude:"Claude \u306B\u9001\u308B",copy:"\u5909\u66F4\u30FB\u30B3\u30E1\u30F3\u30C8\u3092\u30B3\u30D4\u30FC",copyTitle:"Review \u3092\u30B3\u30D4\u30FC\u3057\u3066 Agent \u306B\u8CBC\u308A\u4ED8\u3051\u308B",clear:"\u3059\u3079\u3066\u30AF\u30EA\u30A2",deleteAction:"\u3053\u306E draft action \u3092\u524A\u9664",editComment:"\u3053\u306E\u30B3\u30E1\u30F3\u30C8\u3092\u7DE8\u96C6",editLabel:"\u30B3\u30E1\u30F3\u30C8\u3092\u7DE8\u96C6",saveEdit:"\u4FDD\u5B58",cancelEdit:"\u30AD\u30E3\u30F3\u30BB\u30EB",editHint:"Ctrl/Cmd + Enter \u3067\u4FDD\u5B58\u3001Esc \u3067\u9589\u3058\u308B",wholePage:"\u30DA\u30FC\u30B8\u5168\u4F53",comment:"\u30B3\u30E1\u30F3\u30C8",sent:"Claude \u306B\u9001\u308A\u307E\u3057\u305F \u2713",copied:"\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F \u2713",copyFailed:"\u30B3\u30D4\u30FC\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F"}}),Ad=()=>({body:"",editing:null,attachment:{kind:"page"},copy:{kind:"idle"},copyRequest:0,send:{kind:"idle"},sendRequest:0}),Li=t=>t.kind==="explicit"?{kind:t.resume}:t,Pi=(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:Li(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:Li(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}}}},Td=(t,e)=>{const n=t.body.trim();return n===""?null:{target:e,body:n}},Cd=t=>{if(!t.editing)return null;const e=t.editing.body.trim();return e===""?null:{id:t.editing.id,body:e}},Ed={en:"English",ja:"\u65E5\u672C\u8A9E"},L=Nt({en:{review:"Review",reviewChanges:"Activity log",reviewComments:"Review comments",settings:"Settings",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",supplements:"Supplements",openSupplements:"Open supplements",closeSupplements:"Close supplements",handoffTooLarge:"The review is too long to send. Copy it and paste it instead",handoffConsent:"Commenting needs your permission. Allow it, then send again",handoffForbidden:"This page cannot send to Claude. Copy the review and paste it instead",handoffClaudeUnavailable:"Could not reach the Claude session. Copy the review and paste it instead",handoffRateLimited:"Too many sends in a row. Wait a moment, then send again",handoffStorage:"Could not save the review. Copy it and paste it instead",handoffError:"Could not send. Copy the review and paste it instead",handoffLabel:"Hand the review to the agent",handoffSend:"Send to Claude",handoffSending:"Sending\u2026",handoffSent:"Sent to Claude \u2713",handoffCopy:"Copy changes & comments",handoffCopyTitle:"Copy the review to paste it to the agent",handoffCopied:"Copied \u2713",handoffCopyFailed:"Could not copy",changes:"Updates",changesUnread:t=>`Updates (${t} new)`,changesTitle:"Changes by version",changesCurrent:"This version",changesReadAll:"Mark all as read",changesNew:"New",changesShow:"Show",changesDismiss:"Dismiss",changesWaiting:t=>`${t} more`,changesSeeAll:"See all",changesError:"Could not read the change log",grill:"Questions",grillError:"Could not read the questions",grillGroup:"Question",grillProgress:(t,e)=>`${t} of ${e} answered`,grillAnswer:"Answer",grillAnswerFree:"Answer in your own words",grillAnswerClear:"Clear answer",grillQuoted:t=>`\u2192 \u201C${t}\u201D`,grillOpen:t=>`Open question ${t}`,grillFreeText:"Your own answer",grillFreeTextOf:t=>`Your own answer to ${t}`,grillFreeTextPlaceholder:"Type an answer\u2026 (\u2318/Ctrl+Enter for next)",grillRoundSelect:"Question round",grillCurrentRound:"Current questions",grillRoundOption:(t,e)=>`${t} (${e})`,grillPastRound:t=>`${t}: earlier questions, read-only`,grillUnanswered:"Not answered",grillNoQuestions:"No questions in this round."},ja:{review:"\u30EC\u30D3\u30E5\u30FC",reviewChanges:"\u64CD\u4F5C\u30ED\u30B0",reviewComments:"\u30EC\u30D3\u30E5\u30FC\u30B3\u30E1\u30F3\u30C8",settings:"\u8A2D\u5B9A",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",supplements:"\u88DC\u8DB3\u60C5\u5831",openSupplements:"\u88DC\u8DB3\u60C5\u5831\u3092\u958B\u304F",closeSupplements:"\u88DC\u8DB3\u60C5\u5831\u3092\u9589\u3058\u308B",handoffTooLarge:"Review \u304C\u9577\u3059\u304E\u3066\u9001\u308C\u307E\u305B\u3093\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffConsent:"\u30B3\u30E1\u30F3\u30C8\u306E\u8A31\u53EF\u304C\u5FC5\u8981\u3067\u3059\u3002\u8A31\u53EF\u3057\u3066\u304B\u3089\u3082\u3046\u4E00\u5EA6\u9001\u3063\u3066\u304F\u3060\u3055\u3044",handoffForbidden:"\u3053\u306E\u30DA\u30FC\u30B8\u304B\u3089\u306F\u9001\u308C\u307E\u305B\u3093\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffClaudeUnavailable:"Claude \u306E\u30BB\u30C3\u30B7\u30E7\u30F3\u306B\u5C4A\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffRateLimited:"\u9001\u4FE1\u304C\u7D9A\u3044\u3066\u3044\u307E\u3059\u3002\u5C11\u3057\u5F85\u3063\u3066\u304B\u3089\u9001\u3063\u3066\u304F\u3060\u3055\u3044",handoffStorage:"Review \u3092\u4FDD\u5B58\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffError:"\u9001\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30B3\u30D4\u30FC\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",handoffLabel:"Review \u3092 Agent \u306B\u6E21\u3059",handoffSend:"Claude \u306B\u9001\u308B",handoffSending:"\u9001\u4FE1\u4E2D\u2026",handoffSent:"Claude \u306B\u9001\u308A\u307E\u3057\u305F \u2713",handoffCopy:"\u5909\u66F4\u30FB\u30B3\u30E1\u30F3\u30C8\u3092\u30B3\u30D4\u30FC",handoffCopyTitle:"Review \u3092\u30B3\u30D4\u30FC\u3057\u3066 Agent \u306B\u8CBC\u308A\u4ED8\u3051\u308B",handoffCopied:"\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F \u2713",handoffCopyFailed:"\u30B3\u30D4\u30FC\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F",changes:"\u66F4\u65B0\u306E\u304A\u77E5\u3089\u305B",changesUnread:t=>`\u66F4\u65B0\u306E\u304A\u77E5\u3089\u305B\uFF08\u65B0\u7740 ${t} \u4EF6\uFF09`,changesTitle:"\u7248\u3054\u3068\u306E\u5909\u66F4",changesCurrent:"\u3053\u306E\u7248",changesReadAll:"\u3059\u3079\u3066\u65E2\u8AAD\u306B\u3059\u308B",changesNew:"\u65B0\u7740",changesShow:"\u898B\u308B",changesDismiss:"\u9589\u3058\u308B",changesWaiting:t=>`\u307B\u304B ${t} \u4EF6`,changesSeeAll:"\u3059\u3079\u3066\u898B\u308B",changesError:"\u5909\u66F4\u306E\u4E00\u89A7\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F",grill:"\u8CEA\u554F",grillError:"\u8CEA\u554F\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F",grillGroup:"\u8CEA\u554F",grillProgress:(t,e)=>`\u56DE\u7B54\u6E08\u307F ${t} / ${e}`,grillAnswer:"\u56DE\u7B54",grillAnswerFree:"\u81EA\u7531\u8A18\u8FF0\u3067\u56DE\u7B54",grillAnswerClear:"\u56DE\u7B54\u3092\u30AF\u30EA\u30A2",grillQuoted:t=>`\u2192 \u300C${t}\u300D`,grillOpen:t=>`\u8CEA\u554F ${t} \u3092\u3072\u3089\u304F`,grillFreeText:"\u81EA\u7531\u8A18\u8FF0",grillFreeTextOf:t=>`${t} \u306E\u81EA\u7531\u8A18\u8FF0`,grillFreeTextPlaceholder:"\u56DE\u7B54\u3092\u5165\u529B\u2026\uFF08\u2318/Ctrl+Enter \u3067\u6B21\u3078\uFF09",grillRoundSelect:"\u8CEA\u554F\u306E\u30E9\u30A6\u30F3\u30C9",grillCurrentRound:"\u73FE\u5728\u306E\u8CEA\u554F",grillRoundOption:(t,e)=>`${t}\uFF08${e} \u554F\uFF09`,grillPastRound:t=>`${t}: \u904E\u53BB\u306E\u8CEA\u554F\uFF08\u95B2\u89A7\u306E\u307F\uFF09`,grillUnanswered:"\u672A\u56DE\u7B54",grillNoQuestions:"\u3053\u306E\u30E9\u30A6\u30F3\u30C9\u306B\u8CEA\u554F\u306F\u3042\u308A\u307E\u305B\u3093\u3002"}}),Rd=4096,_d="reviews",zi="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.",Od=t=>new TextEncoder().encode(t).length,Ld=t=>t.replace(/[\u0000-\u0008\u000B-\u001F\u007F]/g,""),Pd=t=>{const e=`${zi}
|
|
806
806
|
|
|
807
|
-
${
|
|
807
|
+
${Ld(t)}`;return Od(e)<=Rd?e:null},zd=t=>`${zi}
|
|
808
808
|
|
|
809
|
-
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).`,
|
|
809
|
+
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).`,Md={consent_required:"consent",forbidden:"forbidden",not_granted:"forbidden",capability_disabled:"forbidden",capability_removed:"forbidden",claude_unavailable:"claude_unavailable",rate_limited:"rate_limited"},Id=t=>{const e=typeof t=="object"&&t!==null&&"code"in t?t.code:void 0;return(typeof e=="string"?Md[e]:void 0)??"error"},Nd={too_large:"handoffTooLarge",consent:"handoffConsent",forbidden:"handoffForbidden",claude_unavailable:"handoffClaudeUnavailable",rate_limited:"handoffRateLimited",storage:"handoffStorage",error:"handoffError"},Mi=(t,e)=>L(e)[Nd[t]],Ii=t=>t.group?`${t.group} \xB7 ${t.label}`:t.label,Ni=(t,e)=>{const{definition:n,state:s,navigation:r,derivation:i}=t,o=Oi(t.locale),a=n.currentTarget?.(s,r)??null,l=e.attachment,d=l.kind==="explicit"?n.commentTargets(s,r).find(g=>g.value===l.ref):null,c=l.kind==="explicit"?{ref:l.ref,label:d?Ii(d):l.ref}:l.kind==="current"&&a?{ref:a.value,label:Ii(a)}:{ref:`page:${n.name}`,label:o.wholePage},p=new Map(i.stale.map(g=>[g.action.id,g.reason])),u=t.section??"all",f=i.actions.filter(g=>!Q(g)||p.has(g.id)).map(g=>{const b=n.describe(g,s,i.base),x=g.type===H;return{kind:x?"comments":"changes",id:g.id,title:x?o.comment:b.title,targetLabel:b.targetLabel,tone:x?"comment":b.tone,text:{kind:x?"comment":"summary",body:x?ft(g):b.summary??""},code:x?null:n.serialize(g),stale:p.get(g.id)??null,edit:!x||t.editable!==!0?{kind:"none"}:e.editing?.id===g.id?{kind:"editing",body:e.editing.body,canSave:e.editing.body.trim().length>0}:{kind:"available"}}});return{body:e.body,target:c,attachment:l.kind==="explicit"?{kind:"explicit"}:a?{kind:"checkbox",checked:l.kind==="current",group:a.group??""}:{kind:"none"},canSubmit:e.body.trim().length>0,section:u,composer:u!=="changes",groups:["comments","changes"].filter(g=>u==="all"||u===g).map(g=>({kind:g,items:f.filter(b=>b.kind===g)})),hasDraft:i.actions.length>0,issues:t.issues.map(g=>`${g.path?`${g.path}: `:""}${g.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"?Mi(e.send.reason,t.locale):e.copy.kind==="copied"?o.copied:e.copy.kind==="failed"?o.copyFailed:""}},Dd=[Dt,jn,fe`
|
|
810
810
|
:host {
|
|
811
811
|
display: flex;
|
|
812
812
|
flex-direction: column;
|
|
@@ -1220,7 +1220,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1220
1220
|
letter-spacing: 0.04em;
|
|
1221
1221
|
color: var(--dpk-green);
|
|
1222
1222
|
}
|
|
1223
|
-
`],
|
|
1223
|
+
`],Di=(t,e,n)=>{const s=new Map;for(let r=e;r<=n;r++)s.set(t[r],r);return s},Me=it(class extends Pt{constructor(t){if(super(t),t.type!==ke.CHILD)throw Error("repeat() can only be used in text expressions")}dt(t,e,n){let s;n===void 0?n=e:e!==void 0&&(s=e);const r=[],i=[];let o=0;for(const a of t)r[o]=s?s(a,o):o,i[o]=n(a,o),o++;return{values:i,keys:r}}render(t,e,n){return this.dt(t,e,n).values}update(t,[e,n,s]){const r=vl(t),{values:i,keys:o}=this.dt(e,n,s);if(!Array.isArray(r))return this.ut=o,i;const a=this.ut??=[],l=[];let d,c,p=0,u=r.length-1,h=0,f=i.length-1;for(;p<=u&&h<=f;)if(r[p]===null)p++;else if(r[u]===null)u--;else if(a[p]===o[h])l[h]=Ce(r[p],i[h]),p++,h++;else if(a[u]===o[f])l[f]=Ce(r[u],i[f]),u--,f--;else if(a[p]===o[f])l[f]=Ce(r[p],i[f]),ot(t,l[f+1],r[p]),p++,f--;else if(a[u]===o[h])l[h]=Ce(r[u],i[h]),ot(t,r[p],r[u]),u--,h++;else if(d===void 0&&(d=Di(o,h,f),c=Di(a,p,u)),d.has(a[p]))if(d.has(a[u])){const g=c.get(o[h]),b=g!==void 0?r[g]:null;if(b===null){const x=ot(t,r[p]);Ce(x,i[h]),l[h]=x}else l[h]=Ce(b,i[h]),ot(t,r[p],b),r[g]=null;h++}else zn(r[u]),u--;else zn(r[p]),p++;for(;h<=f;){const g=ot(t,l[f+1]);Ce(g,i[h]),l[h++]=g}for(;p<=u;){const g=r[p++];g!==null&&zn(g)}return this.ut=o,Pn(t,l),K}});class cs extends zt{}cs.directiveName="unsafeSVG",cs.resultType=2;const jd=it(cs),ji=[["path",{d:"M12 5v14"}],["path",{d:"m19 12-7 7-7-7"}]],qi=[["path",{d:"m12 19-7-7 7-7"}],["path",{d:"M19 12H5"}]],Bi=[["path",{d:"M5 12h14"}],["path",{d:"m12 5 7 7-7 7"}]],Hi=[["path",{d:"m5 12 7-7 7 7"}],["path",{d:"M12 19V5"}]],qd=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326"}]],Bd=[["path",{d:"M20 6 9 17l-5-5"}]],Ui=[["path",{d:"m6 9 6 6 6-6"}]],Hd=[["path",{d:"m15 18-6-6 6-6"}]],Ud=[["path",{d:"m9 18 6-6-6-6"}]],Fi=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}],["path",{d:"M12 17h.01"}]],Fd=[["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"}]],Wd=[["path",{d:"M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z"}]],Gd=[["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"}]],Vd=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor"}]],Kd=[["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"}]],Qd=[["path",{d:"M15 3h6v6"}],["path",{d:"m21 3-7 7"}],["path",{d:"m3 21 7-7"}],["path",{d:"M9 21H3v-6"}]],Zd=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z"}],["path",{d:"M7 11h10"}],["path",{d:"M7 15h6"}],["path",{d:"M7 7h8"}]],Yd=[["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"}]],Jd=[["path",{d:"m14 10 7-7"}],["path",{d:"M20 10h-6V4"}],["path",{d:"m3 21 7-7"}],["path",{d:"M4 14h6v6"}]],Xd=[["path",{d:"M5 12h14"}]],ep=[["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"}]],tp=[["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"}]],np=[["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"}]],sp=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]],rp=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}],["path",{d:"M3 3v5h5"}],["path",{d:"M12 7v5l4 2"}]],ip=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915"}],["circle",{cx:"12",cy:"12",r:"3"}]],op=[["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"}]],ap=[["path",{d:"M3 9h18"}],["path",{d:"M9 3v18"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}]],lp=[["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"}]],cp=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]],dp=t=>t.replaceAll("&","&").replaceAll('"',"""),pp=t=>t.map(([e,n])=>`<${e}${Object.entries(n).map(([s,r])=>` ${s}="${dp(String(r))}"`).join("")}></${e}>`).join(""),A=t=>{const e=pp(t);return()=>m`<svg
|
|
1224
1224
|
viewBox="0 0 24 24"
|
|
1225
1225
|
fill="none"
|
|
1226
1226
|
stroke="currentColor"
|
|
@@ -1230,16 +1230,16 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1230
1230
|
aria-hidden="true"
|
|
1231
1231
|
focusable="false"
|
|
1232
1232
|
>
|
|
1233
|
-
${
|
|
1234
|
-
</svg>`},nn=A(
|
|
1235
|
-
${s?k:m`<header><h2>${
|
|
1233
|
+
${jd(e)}
|
|
1234
|
+
</svg>`},nn=A(cp),Wi=A(lp),ds=A(np),sn=A(Yd),hp=A(Zd),up=A(rp),fp=A(Fi),gp=A(ip),Gi=A(Kd),mp=A(Fd),Vi=A(Bd),Ki=A(sp),kp=A(Xd),bp=A(Gd),Qi=A(tp),vp=A(Hi),xp=A(ji);A(qi),A(Bi);const Zi=A(Hd),kt=A(Ud),yp=A(Ui),wp=A(Qd),$p=A(Jd),Sp=A(op),Ap=A(ep),Yi=A(qd),Tp=A(Vd),Cp=A(Wd),Ep=A(ap),Rp=t=>{switch(t){case"comment":return sn();case"create":return Ki();case"update":return ds();case"delete":return Wi();case"move":return Qi();default:return Gi()}},_p=(t,e,n,s=!1)=>m`
|
|
1235
|
+
${s?k:m`<header><h2>${Op(t,e.section)}</h2></header>`}
|
|
1236
1236
|
${e.issues.length>0?m`<div class="issues" role="alert">
|
|
1237
1237
|
<strong>${t.rejected}</strong>
|
|
1238
1238
|
<ul>
|
|
1239
1239
|
${e.issues.map(r=>m`<li>${r}</li>`)}
|
|
1240
1240
|
</ul>
|
|
1241
1241
|
</div>`:k}
|
|
1242
|
-
${e.composer?
|
|
1242
|
+
${e.composer?Lp(t,e,n):k} ${Pp(t,e,n)}
|
|
1243
1243
|
<footer>
|
|
1244
1244
|
${s||e.send==="hidden"?k:m`<button
|
|
1245
1245
|
class="dpk-btn dpk-btn--accent"
|
|
@@ -1270,7 +1270,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1270
1270
|
</div>
|
|
1271
1271
|
${e.flash?m`<span class="flash" role="status">${e.flash}</span>`:k}
|
|
1272
1272
|
</footer>
|
|
1273
|
-
`,
|
|
1273
|
+
`,Op=(t,e)=>e==="changes"?t.changesHeading:e==="comments"?t.commentsHeading:t.heading,Lp=(t,e,n)=>m`
|
|
1274
1274
|
<div class="composer">
|
|
1275
1275
|
<textarea
|
|
1276
1276
|
class="dpk-textarea"
|
|
@@ -1306,28 +1306,28 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1306
1306
|
</button>
|
|
1307
1307
|
</div>
|
|
1308
1308
|
</div>
|
|
1309
|
-
`,
|
|
1309
|
+
`,ps=(t,e)=>m`<div class="empty">
|
|
1310
1310
|
<div class="empty-box">
|
|
1311
1311
|
${sn()}
|
|
1312
1312
|
<p>${t}</p>
|
|
1313
1313
|
<p class="empty-hint">${e}</p>
|
|
1314
1314
|
</div>
|
|
1315
|
-
</div>`,
|
|
1315
|
+
</div>`,Ji=(t,e,n)=>m`<ul
|
|
1316
1316
|
class="list"
|
|
1317
1317
|
>
|
|
1318
|
-
${Me(e,s=>s.id,s=>
|
|
1319
|
-
</ul>`,
|
|
1318
|
+
${Me(e,s=>s.id,s=>zp(t,s,n))}
|
|
1319
|
+
</ul>`,Pp=(t,e,n)=>{const[s]=e.groups;return e.groups.length===1&&s?s.items.length>0?m`<div class="groups">${Ji(t,s.items,n)}</div>`:s.kind==="changes"?ps(t.emptyChanges,t.emptyChangesHint):ps(t.emptyComments,t.emptyCommentsHint):e.groups.every(r=>r.items.length===0)?ps(t.empty,t.emptyHint):m`<div class="groups">
|
|
1320
1320
|
${e.groups.filter(r=>r.items.length>0).map(r=>m`<section class="group" data-kind=${r.kind}>
|
|
1321
1321
|
<h3 class="group-head">
|
|
1322
1322
|
${r.kind==="changes"?t.changesHeading:t.commentsHeading}
|
|
1323
1323
|
<span class="group-count">${r.items.length}</span>
|
|
1324
1324
|
</h3>
|
|
1325
|
-
${
|
|
1325
|
+
${Ji(t,r.items,n)}
|
|
1326
1326
|
</section>`)}
|
|
1327
|
-
</div>`},
|
|
1327
|
+
</div>`},zp=(t,e,n)=>m`
|
|
1328
1328
|
<li class="item" data-tone=${e.tone} data-stale=${String(e.stale!==null)} data-id=${e.id}>
|
|
1329
1329
|
<div class="item-head">
|
|
1330
|
-
<span class="item-icon">${
|
|
1330
|
+
<span class="item-icon">${Rp(e.tone)}</span>
|
|
1331
1331
|
<span class="item-title">${e.title}</span>
|
|
1332
1332
|
${e.stale?m`<span class="stale-badge">${e.stale}</span>`:k}
|
|
1333
1333
|
${e.edit.kind==="available"?m`<button
|
|
@@ -1337,7 +1337,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1337
1337
|
title=${t.editComment}
|
|
1338
1338
|
@click=${()=>n({kind:"edit-start",id:e.id,body:e.text.body})}
|
|
1339
1339
|
>
|
|
1340
|
-
${
|
|
1340
|
+
${ds()}
|
|
1341
1341
|
</button>`:k}
|
|
1342
1342
|
<button
|
|
1343
1343
|
class="dpk-icon-btn"
|
|
@@ -1349,10 +1349,10 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1349
1349
|
</button>
|
|
1350
1350
|
</div>
|
|
1351
1351
|
<div class="item-target">${e.targetLabel}</div>
|
|
1352
|
-
${e.edit.kind==="editing"?
|
|
1352
|
+
${e.edit.kind==="editing"?Mp(t,e.edit,n):e.text.kind==="comment"?m`<p class="item-body">${e.text.body}</p>`:e.text.body?m`<div class="item-summary">${e.text.body}</div>`:k}
|
|
1353
1353
|
${e.code===null?k:m`<code class="item-code">${e.code}</code>`}
|
|
1354
1354
|
</li>
|
|
1355
|
-
`,
|
|
1355
|
+
`,Mp=(t,e,n)=>m`
|
|
1356
1356
|
<div class="item-editor">
|
|
1357
1357
|
<textarea
|
|
1358
1358
|
class="dpk-textarea"
|
|
@@ -1381,8 +1381,8 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1381
1381
|
</button>
|
|
1382
1382
|
</div>
|
|
1383
1383
|
</div>
|
|
1384
|
-
`,Lp=t=>t==="changes"||t==="comments"?t:"all";class Ji extends me{static{this.styles=zd}static{this.properties={definition:{attribute:!1},state:{attribute:!1},navigation:{attribute:!1},derivation:{attribute:!1},issues:{attribute:!1},pendingTarget:{attribute:!1},onDelete:{attribute:!1},onClear:{attribute:!1},onComment:{attribute:!1},onEditComment:{attribute:!1},exportBrief:{attribute:!1},sendToClaude:{attribute:!1},embedded:{type:Boolean},section:{type:String}}}#e=yd();#t=null;#n=new Nn(this);constructor(){super(),this.embedded=!1,this.definition=null,this.state=void 0,this.navigation={},this.derivation=null,this.issues=[],this.pendingTarget=null,this.section=null}willUpdate(e){e.has("pendingTarget")&&this.pendingTarget&&(this.#e=Li(this.#e,{kind:"target-requested",ref:this.pendingTarget}))}updated(e){e.has("pendingTarget")&&this.pendingTarget&&this.isConnected&&this.renderRoot.querySelector("textarea")?.focus();const n=this.#t;n&&(this.#t=null,[...this.renderRoot.querySelectorAll(".item")].find(r=>r.dataset.id===n.id)?.querySelector(n.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,section:Lp(this.section)}}render(){const e=this.#r();return e?Tp(_i(this.#n.locale),Ii(e,this.#e),this.#i,this.embedded):k}#s(e){this.#e=Li(this.#e,e),this.requestUpdate()}#i=e=>{switch(e.kind){case"delete":this.onDelete?.(e.id);return;case"clear":this.onClear?.();return;case"copy":this.#a();return;case"send":this.#o();return;case"edit-start":this.#t={kind:"editor",id:e.id},this.#s(e);return;case"edit-cancel":{const n=this.#e.editing;n&&(this.#t={kind:"edit-button",id:n.id}),this.#s(e);return}case"edit-save":{const n=$d(this.#e);if(!n||!this.onEditComment||!this.onEditComment(n.id,n.body).ok)return;this.#t={kind:"edit-button",id:n.id},this.#s({kind:"edited"});return}case"submit":{const n=this.#r();if(!n||!this.onComment)return;const s=wd(this.#e,Ii(n,this.#e).target.ref);if(!s||!this.onComment(s.target,s.body).ok)return;this.#s({kind:"submitted"});return}default:this.#s(e)}};async#o(){const e=this.sendToClaude;if(!e||this.#e.send.kind==="pending")return;this.#s({kind:"send-started"});const n=this.#e.sendRequest,s=await e().catch(()=>({ok:!1,reason:"error"}));this.isConnected&&this.#s({kind:"send-finished",request:n,outcome:s})}async#a(){const e=this.#r();if(!e)return;this.#s({kind:"copy-started"});const n=this.#e.copyRequest;try{const s=this.exportBrief?.()??tn({...e.derivation,navigation:e.navigation,issues:e.issues},e.definition,X),r=await os(s);this.isConnected&&this.#s({kind:"copy-finished",request:n,ok:r})}catch{this.isConnected&&this.#s({kind:"copy-finished",request:n,ok:!1})}}}const Pp=()=>{customElements.get("dpk-component-comment-panel")||customElements.define("dpk-component-comment-panel",Ji)},Ze=Math.min,le=Math.max,rn=Math.round,on=Math.floor,ce=t=>({x:t,y:t}),zp={left:"right",right:"left",bottom:"top",top:"bottom"};function Mp(t,e,n){return le(t,Ze(e,n))}function kt(t,e){return typeof t=="function"?t(e):t}function Ie(t){return t.split("-")[0]}function bt(t){return t.split("-")[1]}function Xi(t){return t==="x"?"y":"x"}function eo(t){return t==="y"?"height":"width"}function de(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function to(t){return Xi(de(t))}function Ip(t,e,n){n===void 0&&(n=!1);const s=bt(t),r=to(t),i=eo(r);let o=r==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(o=an(o)),[o,an(o)]}function Np(t){const e=an(t);return[ds(t),e,ds(e)]}function ds(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const no=["left","right"],so=["right","left"],Dp=["top","bottom"],jp=["bottom","top"];function qp(t,e,n){switch(t){case"top":case"bottom":return n?e?so:no:e?no:so;case"left":case"right":return e?Dp:jp;default:return[]}}function Bp(t,e,n,s){const r=bt(t);let i=qp(Ie(t),n==="start",s);return r&&(i=i.map(o=>o+"-"+r),e&&(i=i.concat(i.map(ds)))),i}function an(t){const e=Ie(t);return zp[e]+t.slice(e.length)}function Hp(t){var e,n,s,r;return{top:(e=t.top)!=null?e:0,right:(n=t.right)!=null?n:0,bottom:(s=t.bottom)!=null?s:0,left:(r=t.left)!=null?r:0}}function Up(t){return typeof t!="number"?Hp(t):{top:t,right:t,bottom:t,left:t}}function ln(t){const{x:e,y:n,width:s,height:r}=t;return{width:s,height:r,top:n,left:e,right:e+s,bottom:n+r,x:e,y:n}}function ro(t,e,n){let{reference:s,floating:r}=t;const i=de(e),o=to(e),a=eo(o),l=Ie(e),d=i==="y",c=s.x+s.width/2-r.width/2,p=s.y+s.height/2-r.height/2,u=s[a]/2-r[a]/2;let h;switch(l){case"top":h={x:c,y:s.y-r.height};break;case"bottom":h={x:c,y:s.y+s.height};break;case"right":h={x:s.x+s.width,y:p};break;case"left":h={x:s.x-r.width,y:p};break;default:h={x:s.x,y:s.y}}const f=bt(e);return f&&(h[o]+=u*(f==="end"?1:-1)*(n&&d?-1:1)),h}async function Fp(t,e){var n;e===void 0&&(e={});const{x:s,y:r,platform:i,rects:o,elements:a,strategy:l}=t,{boundary:d="clippingAncestors",rootBoundary:c="viewport",elementContext:p="floating",altBoundary:u=!1,padding:h=0}=kt(e,t),f=Up(h),b=a[u?p==="floating"?"reference":"floating":p],x=ln(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(b)))==null||n?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:d,rootBoundary:c,strategy:l})),S=p==="floating"?{x:s,y:r,width:o.floating.width,height:o.floating.height}:o.reference,T=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),_=await(i.isElement==null?void 0:i.isElement(T))&&await(i.getScale==null?void 0:i.getScale(T))||{x:1,y:1},H=ln(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:S,offsetParent:T,strategy:l}):S);return{top:(x.top-H.top+f.top)/_.y,bottom:(H.bottom-x.bottom+f.bottom)/_.y,left:(x.left-H.left+f.left)/_.x,right:(H.right-x.right+f.right)/_.x}}const Wp=50,Gp=async(t,e,n)=>{const{placement:s="bottom",strategy:r="absolute",middleware:i=[],platform:o}=n,a=o.detectOverflow?o:{...o,detectOverflow:Fp},l=await(o.isRTL==null?void 0:o.isRTL(e));let d=await o.getElementRects({reference:t,floating:e,strategy:r}),{x:c,y:p}=ro(d,s,l),u=s,h=0;const f={};for(let g=0;g<i.length;g++){const b=i[g];if(!b)continue;const{name:x,fn:S}=b,{x:T,y:_,data:H,reset:P}=await S({x:c,y:p,initialPlacement:s,placement:u,strategy:r,middlewareData:f,rects:d,platform:a,elements:{reference:t,floating:e}});c=T??c,p=_??p,f[x]={...f[x],...H},P&&h<Wp&&(h++,typeof P=="object"&&(P.placement&&(u=P.placement),P.rects&&(d=P.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:r}):P.rects),{x:c,y:p}=ro(d,u,l)),g=-1)}return{x:c,y:p,placement:u,strategy:r,middlewareData:f}},Vp=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,s;const{placement:r,middlewareData:i,rects:o,initialPlacement:a,platform:l,elements:d}=e,{mainAxis:c=!0,crossAxis:p=!0,fallbackPlacements:u,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:g=!0,...b}=kt(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const x=Ie(r),S=de(a),T=Ie(a)===a,_=await(l.isRTL==null?void 0:l.isRTL(d.floating)),H=u||(T||!g?[an(a)]:Np(a)),P=f!=="none";!u&&P&&H.push(...Bp(a,g,f,_));const V=[a,...H],q=await l.detectOverflow(e,b),re=[];let ee=((s=i.flip)==null?void 0:s.overflows)||[];if(c&&re.push(q[x]),p){const we=Ip(r,o,_);re.push(q[we[0]],q[we[1]])}if(ee=[...ee,{placement:r,overflows:re}],!re.every(we=>we<=0)){var Zs,Ys;const we=(((Zs=i.flip)==null?void 0:Zs.index)||0)+1,$n=V[we];if($n&&(!(p==="alignment"?S!==de($n):!1)||ee.every(Z=>de(Z.placement)===S?Z.overflows[0]>0:!0)))return{data:{index:we,overflows:ee},reset:{placement:$n}};let et=(Ys=ee.filter($e=>$e.overflows[0]<=0).sort(($e,Z)=>$e.overflows[1]-Z.overflows[1])[0])==null?void 0:Ys.placement;if(!et)switch(h){case"bestFit":{var Js;const $e=(Js=ee.filter(Z=>{if(P){const ue=de(Z.placement);return ue===S||ue==="y"}return!0}).map(Z=>[Z.placement,Z.overflows.filter(ue=>ue>0).reduce((ue,Ga)=>ue+Ga,0)]).sort((Z,ue)=>Z[1]-ue[1])[0])==null?void 0:Js[0];$e&&(et=$e);break}case"initialPlacement":et=a;break}if(r!==et)return{reset:{placement:et}}}return{}}}},Kp=new Set(["left","top"]);async function Qp(t,e){const{placement:n,platform:s,elements:r}=t,i=await(s.isRTL==null?void 0:s.isRTL(r.floating)),o=Ie(n),a=bt(n),l=de(n)==="y",d=Kp.has(o)?-1:1,c=i&&l?-1:1,p=kt(e,t);let{mainAxis:u,crossAxis:h,alignmentAxis:f}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return a&&typeof f=="number"&&(h=a==="end"?f*-1:f),l?{x:h*c,y:u*d}:{x:u*d,y:h*c}}const Zp=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,s;const{x:r,y:i,placement:o,middlewareData:a}=e,l=await Qp(e,t);return o===((n=a.offset)==null?void 0:n.placement)&&(s=a.arrow)!=null&&s.alignmentOffset?{}:{x:r+l.x,y:i+l.y,data:{...l,placement:o}}}}},Yp=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:s,placement:r,platform:i}=e,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:S=>{let{x:T,y:_}=S;return{x:T,y:_}}},...d}=kt(t,e),c={x:n,y:s},p=await i.detectOverflow(e,d),u=de(r),h=Xi(u);let f=c[h],g=c[u];const b=(S,T)=>Mp(T+p[S==="y"?"top":"left"],T,T-p[S==="y"?"bottom":"right"]);o&&(f=b(h,f)),a&&(g=b(u,g));const x=l.fn({...e,[h]:f,[u]:g});return{...x,data:{x:x.x-n,y:x.y-s,enabled:{[h]:o,[u]:a}}}}}},Jp=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:s,platform:r,elements:i}=e,{apply:o=()=>{},...a}=kt(t,e),l=await r.detectOverflow(e,a),d=Ie(n),c=bt(n),p=de(n)==="y",{width:u,height:h}=s.floating;let f,g;d==="top"||d==="bottom"?(f=d,g=c===(await(r.isRTL==null?void 0:r.isRTL(i.floating))?"start":"end")?"left":"right"):(g=d,f=c==="end"?"top":"bottom");const b=h-l.top-l.bottom,x=u-l.left-l.right,S=Ze(h-l[f],b),T=Ze(u-l[g],x),_=e.middlewareData.shift,H=!_;let P=S,V=T;_!=null&&_.enabled.x&&(V=x),_!=null&&_.enabled.y&&(P=b),H&&!c&&(p?V=u-2*le(l.left,l.right):P=h-2*le(l.top,l.bottom)),await o({...e,availableWidth:V,availableHeight:P});const q=await r.getDimensions(i.floating);return u!==q.width||h!==q.height?{reset:{rects:!0}}:{}}}};function cn(){return typeof window<"u"}function Ye(t){return io(t)?(t.nodeName||"").toLowerCase():"#document"}function F(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function pe(t){var e;return(e=(io(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function io(t){return cn()?t instanceof Node||t instanceof F(t).Node:!1}function ne(t){return cn()?t instanceof Element||t instanceof F(t).Element:!1}function xe(t){return cn()?t instanceof HTMLElement||t instanceof F(t).HTMLElement:!1}function oo(t){return!cn()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof F(t).ShadowRoot}function dn(t){const{overflow:e,overflowX:n,overflowY:s,display:r}=se(t);return/auto|scroll|overlay|hidden|clip/.test(e+s+n)&&r!=="inline"&&r!=="contents"}function Xp(t){return/^(table|td|th)$/.test(Ye(t))}function pn(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const eh=/transform|translate|scale|rotate|perspective|filter/,th=/paint|layout|strict|content/,Ne=t=>!!t&&t!=="none";let ps;function hs(t){const e=ne(t)?se(t):t;return Ne(e.transform)||Ne(e.translate)||Ne(e.scale)||Ne(e.rotate)||Ne(e.perspective)||!us()&&(Ne(e.backdropFilter)||Ne(e.filter))||eh.test(e.willChange||"")||th.test(e.contain||"")}function nh(t){let e=De(t);for(;xe(e)&&!vt(e);){if(hs(e))return e;if(pn(e))return null;e=De(e)}return null}function us(){return ps==null&&(ps=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),ps}function vt(t){return/^(html|body|#document)$/.test(Ye(t))}function se(t){return F(t).getComputedStyle(t)}function hn(t){return ne(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function De(t){if(Ye(t)==="html")return t;const e=t.assignedSlot||t.parentNode||oo(t)&&t.host||pe(t);return oo(e)?e.host:e}function ao(t){const e=De(t);return vt(e)?(t.ownerDocument||t).body:xe(e)&&dn(e)?e:ao(e)}function xt(t,e,n){var s;e===void 0&&(e=[]),n===void 0&&(n=!0);const r=ao(t),i=r===((s=t.ownerDocument)==null?void 0:s.body),o=F(r);if(i){const a=fs(o);return e.concat(o,o.visualViewport||[],dn(r)?r:[],a&&n?xt(a):[])}else return e.concat(r,xt(r,[],n))}function fs(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function lo(t){const e=se(t);let n=parseFloat(e.width)||0,s=parseFloat(e.height)||0;const r=xe(t),i=r?t.offsetWidth:n,o=r?t.offsetHeight:s,a=rn(n)!==i||rn(s)!==o;return a&&(n=i,s=o),{width:n,height:s,$:a}}function gs(t){return ne(t)?t:t.contextElement}function Je(t){const e=gs(t);if(!xe(e))return ce(1);const n=e.getBoundingClientRect(),{width:s,height:r,$:i}=lo(e);let o=(i?rn(n.width):n.width)/s,a=(i?rn(n.height):n.height)/r;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const sh=ce(0);function co(t){const e=F(t);return!us()||!e.visualViewport?sh:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function rh(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===F(t)}function je(t,e,n,s){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=gs(t);let o=ce(1);e&&(s?ne(s)&&(o=Je(s)):o=Je(t));const a=rh(i,n,s)?co(i):ce(0);let l=(r.left+a.x)/o.x,d=(r.top+a.y)/o.y,c=r.width/o.x,p=r.height/o.y;if(i&&s){const u=F(i),h=ne(s)?F(s):s;let f=u,g=fs(f);for(;g&&h!==f;){const b=Je(g),x=g.getBoundingClientRect(),S=se(g),T=x.left+(g.clientLeft+parseFloat(S.paddingLeft))*b.x,_=x.top+(g.clientTop+parseFloat(S.paddingTop))*b.y;l*=b.x,d*=b.y,c*=b.x,p*=b.y,l+=T,d+=_,f=F(g),g=fs(f)}}return ln({width:c,height:p,x:l,y:d})}function un(t,e){const n=hn(t).scrollLeft;return e?e.left+n:je(pe(t)).left+n}function po(t,e){const n=t.getBoundingClientRect(),s=n.left+e.scrollLeft-un(t,n),r=n.top+e.scrollTop;return{x:s,y:r}}function ih(t){let{elements:e,rect:n,offsetParent:s,strategy:r}=t;const i=r==="fixed",o=pe(s),a=e?pn(e.floating):!1;if(s===o||a&&i)return n;let l={scrollLeft:0,scrollTop:0},d=ce(1);const c=ce(0),p=xe(s);if((p||!i)&&((Ye(s)!=="body"||dn(o))&&(l=hn(s)),p)){const h=je(s);d=Je(s),c.x=h.x+s.clientLeft,c.y=h.y+s.clientTop}const u=o&&!p&&!i?po(o,l):ce(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-l.scrollLeft*d.x+c.x+u.x,y:n.y*d.y-l.scrollTop*d.y+c.y+u.y}}function oh(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function ah(t){const e=hn(t),n=t.ownerDocument.body,s=le(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),r=le(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-e.scrollLeft+un(t);const o=-e.scrollTop;return se(n).direction==="rtl"&&(i+=le(t.clientWidth,n.clientWidth)-s),{width:s,height:r,x:i,y:o}}const lh=25;function ch(t,e,n){n===void 0&&(n="viewport");const s=n==="layoutViewport",r=F(t),i=pe(t),o=r.visualViewport;let a=i.clientWidth,l=i.clientHeight,d=0,c=0;if(o){const u=!us()||e==="fixed";s?u||(d=-o.offsetLeft,c=-o.offsetTop):(a=o.width,l=o.height,u&&(d=o.offsetLeft,c=o.offsetTop))}if(un(i)<=0){const u=i.ownerDocument,h=u.body,f=getComputedStyle(h),g=u.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,b=Math.abs(i.clientWidth-h.clientWidth-g),x=getComputedStyle(i).scrollbarGutter==="stable both-edges"?b/2:b;x<=lh&&(a-=x)}return{width:a,height:l,x:d,y:c}}function dh(t,e){const n=je(t,!0,e==="fixed"),s=n.top+t.clientTop,r=n.left+t.clientLeft,i=Je(t),o=t.clientWidth*i.x,a=t.clientHeight*i.y,l=r*i.x,d=s*i.y;return{width:o,height:a,x:l,y:d}}function ho(t,e,n){let s;if(e==="viewport"||e==="layoutViewport")s=ch(t,n,e);else if(e==="document")s=ah(pe(t));else if(ne(e))s=dh(e,n);else{const r=co(t);s={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return ln(s)}function ph(t,e){const n=e.get(t);if(n)return n;let s=xt(t,[],!1).filter(a=>ne(a)&&Ye(a)!=="body"),r=null;const i=se(t).position==="fixed";let o=i?De(t):t;for(;ne(o)&&!vt(o);){const a=se(o),l=hs(o),d=r?r.position:i?"fixed":"";!l&&(d==="fixed"||d==="absolute"&&a.position==="static")?s=s.filter(p=>p!==o):r=a,o=De(o)}return e.set(t,s),s}function hh(t){let{element:e,boundary:n,rootBoundary:s,strategy:r}=t;const o=[...n==="clippingAncestors"?pn(e)?[]:ph(e,this._c):[].concat(n),s],a=ho(e,o[0],r);let l=a.top,d=a.right,c=a.bottom,p=a.left;for(let u=1;u<o.length;u++){const h=ho(e,o[u],r);l=le(h.top,l),d=Ze(h.right,d),c=Ze(h.bottom,c),p=le(h.left,p)}return{width:d-p,height:c-l,x:p,y:l}}function uh(t){const{width:e,height:n}=lo(t);return{width:e,height:n}}function fh(t,e,n){const s=xe(e),r=pe(e),i=n==="fixed",o=je(t,!0,i,e);let a={scrollLeft:0,scrollTop:0};const l=ce(0);if((s||!i)&&((Ye(e)!=="body"||dn(r))&&(a=hn(e)),s)){const u=je(e,!0,i,e);l.x=u.x+e.clientLeft,l.y=u.y+e.clientTop}!s&&r&&(l.x=un(r));const d=r&&!s&&!i?po(r,a):ce(0),c=o.left+a.scrollLeft-l.x-d.x,p=o.top+a.scrollTop-l.y-d.y;return{x:c,y:p,width:o.width,height:o.height}}function ms(t){return se(t).position==="static"}function uo(t,e){if(!xe(t)||se(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return pe(t)===n&&(n=n.ownerDocument.body),n}function fo(t,e){const n=F(t);if(pn(t))return n;if(!xe(t)){let r=De(t);for(;r&&!vt(r);){if(ne(r)&&!ms(r))return r;r=De(r)}return n}let s=uo(t,e);for(;s&&Xp(s)&&ms(s);)s=uo(s,e);return s&&vt(s)&&ms(s)&&!hs(s)?n:s||nh(t)||n}const gh=async function(t){const e=this.getOffsetParent||fo,n=this.getDimensions,s=await n(t.floating);return{reference:fh(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function mh(t){return se(t).direction==="rtl"}const kh={convertOffsetParentRelativeRectToViewportRelativeRect:ih,getDocumentElement:pe,getClippingRect:hh,getOffsetParent:fo,getElementRects:gh,getClientRects:oh,getDimensions:uh,getScale:Je,isElement:ne,isRTL:mh};function go(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function bh(t,e,n){let s=null,r;const i=pe(t);function o(){var c;clearTimeout(r),(c=s)==null||c.disconnect(),s=null}function a(c,p){c===void 0&&(c=!1),p===void 0&&(p=1),o();const u=t.getBoundingClientRect(),{left:h,top:f,width:g,height:b}=u;if(c||e(),!g||!b)return;const x=on(f),S=on(i.clientWidth-(h+g)),T=on(i.clientHeight-(f+b)),_=on(h),P={rootMargin:-x+"px "+-S+"px "+-T+"px "+-_+"px",threshold:le(0,Ze(1,p))||1};let V=!0;function q(re){const ee=re[0].intersectionRatio;if(!go(u,t.getBoundingClientRect()))return a();if(ee!==p){if(!V)return a();ee?a(!1,ee):r=setTimeout(()=>{a(!1,1e-7)},1e3)}V=!1}try{s=new IntersectionObserver(q,{...P,root:i.ownerDocument})}catch{s=new IntersectionObserver(q,P)}s.observe(t)}const l=F(t),d=()=>a(n);return l.addEventListener("resize",d),a(!0),()=>{l.removeEventListener("resize",d),o()}}function vh(t,e,n,s){s===void 0&&(s={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=s,d=gs(t),c=r||i?[...d?xt(d):[],...e?xt(e):[]]:[];c.forEach(x=>{r&&x.addEventListener("scroll",n),i&&x.addEventListener("resize",n)});const p=d&&a?bh(d,n,i):null;let u=-1,h=null;o&&(h=new ResizeObserver(x=>{let[S]=x;S&&S.target===d&&h&&e&&(h.unobserve(e),cancelAnimationFrame(u),u=requestAnimationFrame(()=>{var T;(T=h)==null||T.observe(e)})),n()}),d&&!l&&h.observe(d),e&&h.observe(e));let f,g=l?je(t):null;l&&b();function b(){const x=je(t);g&&!go(g,x)&&n(),g=x,f=requestAnimationFrame(b)}return n(),()=>{var x;c.forEach(S=>{r&&S.removeEventListener("scroll",n),i&&S.removeEventListener("resize",n)}),p?.(),(x=h)==null||x.disconnect(),h=null,l&&cancelAnimationFrame(f)}}const xh=Zp,yh=Yp,wh=Vp,$h=Jp,Sh=(t,e,n)=>{const s=new Map,r=n??{},i={...kh,...r.platform,_c:s};return Gp(t,e,{...r,platform:i})},Ah=(t,e)=>({top:e,bottom:e,right:t}),mo=(t,e,n,s={})=>{if(typeof t.showPopover!="function")return()=>{};try{t.showPopover()}catch{return()=>{}}let r=!0,i=0;const o=e instanceof Element?e:{getBoundingClientRect:()=>({x:e.right,y:e.top,left:e.right,right:e.right,top:e.top,bottom:e.bottom,width:0,height:e.bottom-e.top})};t.style.width=`${n.width}px`,t.style.maxHeight=`${n.height}px`;const l=vh(o,t,()=>{const d=++i;Sh(o,t,{strategy:"fixed",placement:s.placement??"bottom-end",middleware:[xh(8),wh({padding:8,fallbackAxisSideDirection:"end"}),yh({padding:8}),$h({padding:8,apply:({availableWidth:c,availableHeight:p})=>{!r||d!==i||(t.style.width=`${Math.max(0,Math.min(n.width,c))}px`,t.style.maxHeight=`${Math.max(0,Math.min(n.height,p))}px`)}})]}).then(({x:c,y:p})=>{!r||d!==i||!t.isConnected||(t.style.left=`${c}px`,t.style.top=`${p}px`)}).catch(()=>{})},{animationFrame:s.trackTransform??!1,elementResize:typeof ResizeObserver<"u",layoutShift:typeof IntersectionObserver<"u"});return()=>{r=!1,l()}},ko=t=>{if(!(!t||typeof t.hidePopover!="function"))try{t.hidePopover()}catch{}};class bo{#e;#t=new Map;constructor(e){this.#e=e,e.addController(this)}hostConnected(){this.#e.requestUpdate()}hostUpdated(){for(const[e,n]of this.#t)e.isConnected||(n(),this.#t.delete(e))}hostDisconnected(){for(const e of this.#t.values())e();this.#t.clear()}open(e,n,s,r){this.#t.get(e)?.(),this.#t.set(e,mo(e,n,s,r))}}function ks(t,e,n){return n==null?Math.min(t,e):Math.min(Math.max(t,e),n)}class vo{#e;constructor(e,n){this.#e=n,e.addController(this)}hostConnected(){document.addEventListener("pointerdown",this.#t,!0),document.addEventListener("keydown",this.#n)}hostDisconnected(){document.removeEventListener("pointerdown",this.#t,!0),document.removeEventListener("keydown",this.#n)}#t=e=>{e.button!==0||!this.#e.open()||this.#e.closesOn(e.composedPath())&&this.#e.dismiss()};#n=e=>{e.key!=="Escape"||e.isComposing||e.defaultPrevented||!this.#e.open()||this.#e.ownsEscape(e.composedPath())&&(e.preventDefault(),this.#e.dismiss())}}const xo=(t,e,n)=>n.top<e.top?t+n.top-e.top:n.bottom<=e.bottom?t:t+Math.min(n.bottom-e.bottom,n.top-e.top),yo=(t,e,n)=>{const s=Math.min(n,e/4);return{top:t+s,bottom:t+e-s}},bs=(t,e,n=0)=>{const s=t.getBoundingClientRect();t.scrollTop=xo(t.scrollTop,yo(s.top+t.clientTop,t.clientHeight,n),e.getBoundingClientRect())},wo=(t,e,n=0)=>{const s=t.getBoundingClientRect(),r=e.getBoundingClientRect();t.scrollLeft=xo(t.scrollLeft,yo(s.left+t.clientLeft,t.clientWidth,n),{top:r.left,bottom:r.right})},$o=(t,e,n)=>{typeof window>"u"||Object.assign(window,{devProcessKit:{version:t,templates:e,versionParam:n}})},yt="dpk-version",So="version",Th=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/,fn=t=>Th.test(t),Ch="https://cdn.jsdelivr.net/npm/dev-process-kit@",Ao="https://data.jsdelivr.com/v1/packages/npm/dev-process-kit",vs=t=>{const e=new URLSearchParams(t),n=e.get(yt)??e.get(So);return n!==null&&fn(n)?n:null},Eh=(t,e)=>{const n=vs(t);return n===null||n===e?null:n},Rh=(t,e)=>{if(!fn(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`${Ch}${t}/dist/${e}`},_h=(t,e)=>{const n=new URL(t);return n.searchParams.delete(So),e===null?n.searchParams.delete(yt):n.searchParams.set(yt,e),n.href},Oh=O({tags:D(Ge(v(),ve()),{}),versions:j(O({version:v()}))}),Lh=t=>{const e=Gt(Oh,t),n=e.tags.latest;return{latest:typeof n=="string"&&fn(n)?n:null,versions:e.versions.map(s=>s.version).filter(fn)}},To=t=>{const e=t.published?.versions??[],n=e.includes(t.current)?e:[t.current,...e],s=t.published?.latest??null;return{value:t.current,options:[...t.requested?[{value:"",label:t.text.pinned}]:[],...n.map(r=>({value:r,label:r===s&&r!==t.current?t.text.latest(r):r}))]}};let gn;const Co=()=>(gn??=fetch(Ao).then(async t=>{if(!t.ok)throw new Error(`${Ao} answered ${t.status}`);return Lh(await t.json())}),gn.catch(()=>{gn=void 0}),gn),Eo=t=>{location.assign(_h(location.href,t))},Ph=t=>import(t),zh=({entry:t,templates:e,register:n,importModule:s=Ph})=>{const r=()=>{n(),$o(X,e,yt)},i=typeof location>"u"?null:Eh(location.search,X);if(i===null){r();return}s(Rh(i,t)).then(()=>{Mh()||Nh(i)},o=>{console.error(`dev-process-kit@${i} could not be loaded; running ${X}`,o),r()})},Mh=()=>{const t=Reflect.get(window,"devProcessKit");return typeof t=="object"&&t!==null&&"versionParam"in t},xs="dpk-version-fallback",Ih=`
|
|
1385
|
-
.${
|
|
1384
|
+
`,Ip=t=>t==="changes"||t==="comments"?t:"all";class Xi extends me{static{this.styles=Dd}static{this.properties={definition:{attribute:!1},state:{attribute:!1},navigation:{attribute:!1},derivation:{attribute:!1},issues:{attribute:!1},pendingTarget:{attribute:!1},onDelete:{attribute:!1},onClear:{attribute:!1},onComment:{attribute:!1},onEditComment:{attribute:!1},exportBrief:{attribute:!1},sendToClaude:{attribute:!1},embedded:{type:Boolean},section:{type:String}}}#e=Ad();#t=null;#n=new Dn(this);constructor(){super(),this.embedded=!1,this.definition=null,this.state=void 0,this.navigation={},this.derivation=null,this.issues=[],this.pendingTarget=null,this.section=null}willUpdate(e){e.has("pendingTarget")&&this.pendingTarget&&(this.#e=Pi(this.#e,{kind:"target-requested",ref:this.pendingTarget}))}updated(e){e.has("pendingTarget")&&this.pendingTarget&&this.isConnected&&this.renderRoot.querySelector("textarea")?.focus();const n=this.#t;n&&(this.#t=null,[...this.renderRoot.querySelectorAll(".item")].find(r=>r.dataset.id===n.id)?.querySelector(n.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,section:Ip(this.section)}}render(){const e=this.#r();return e?_p(Oi(this.#n.locale),Ni(e,this.#e),this.#i,this.embedded):k}#s(e){this.#e=Pi(this.#e,e),this.requestUpdate()}#i=e=>{switch(e.kind){case"delete":this.onDelete?.(e.id);return;case"clear":this.onClear?.();return;case"copy":this.#a();return;case"send":this.#o();return;case"edit-start":this.#t={kind:"editor",id:e.id},this.#s(e);return;case"edit-cancel":{const n=this.#e.editing;n&&(this.#t={kind:"edit-button",id:n.id}),this.#s(e);return}case"edit-save":{const n=Cd(this.#e);if(!n||!this.onEditComment||!this.onEditComment(n.id,n.body).ok)return;this.#t={kind:"edit-button",id:n.id},this.#s({kind:"edited"});return}case"submit":{const n=this.#r();if(!n||!this.onComment)return;const s=Td(this.#e,Ni(n,this.#e).target.ref);if(!s||!this.onComment(s.target,s.body).ok)return;this.#s({kind:"submitted"});return}default:this.#s(e)}};async#o(){const e=this.sendToClaude;if(!e||this.#e.send.kind==="pending")return;this.#s({kind:"send-started"});const n=this.#e.sendRequest,s=await e().catch(()=>({ok:!1,reason:"error"}));this.isConnected&&this.#s({kind:"send-finished",request:n,outcome:s})}async#a(){const e=this.#r();if(!e)return;this.#s({kind:"copy-started"});const n=this.#e.copyRequest;try{const s=this.exportBrief?.()??tn({...e.derivation,navigation:e.navigation,issues:e.issues},e.definition,X),r=await ls(s);this.isConnected&&this.#s({kind:"copy-finished",request:n,ok:r})}catch{this.isConnected&&this.#s({kind:"copy-finished",request:n,ok:!1})}}}const Np=()=>{customElements.get("dpk-component-comment-panel")||customElements.define("dpk-component-comment-panel",Xi)},Ze=Math.min,le=Math.max,rn=Math.round,on=Math.floor,ce=t=>({x:t,y:t}),Dp={left:"right",right:"left",bottom:"top",top:"bottom"};function jp(t,e,n){return le(t,Ze(e,n))}function bt(t,e){return typeof t=="function"?t(e):t}function Ie(t){return t.split("-")[0]}function vt(t){return t.split("-")[1]}function eo(t){return t==="x"?"y":"x"}function to(t){return t==="y"?"height":"width"}function de(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function no(t){return eo(de(t))}function qp(t,e,n){n===void 0&&(n=!1);const s=vt(t),r=no(t),i=to(r);let o=r==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(o=an(o)),[o,an(o)]}function Bp(t){const e=an(t);return[hs(t),e,hs(e)]}function hs(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const so=["left","right"],ro=["right","left"],Hp=["top","bottom"],Up=["bottom","top"];function Fp(t,e,n){switch(t){case"top":case"bottom":return n?e?ro:so:e?so:ro;case"left":case"right":return e?Hp:Up;default:return[]}}function Wp(t,e,n,s){const r=vt(t);let i=Fp(Ie(t),n==="start",s);return r&&(i=i.map(o=>o+"-"+r),e&&(i=i.concat(i.map(hs)))),i}function an(t){const e=Ie(t);return Dp[e]+t.slice(e.length)}function Gp(t){var e,n,s,r;return{top:(e=t.top)!=null?e:0,right:(n=t.right)!=null?n:0,bottom:(s=t.bottom)!=null?s:0,left:(r=t.left)!=null?r:0}}function Vp(t){return typeof t!="number"?Gp(t):{top:t,right:t,bottom:t,left:t}}function ln(t){const{x:e,y:n,width:s,height:r}=t;return{width:s,height:r,top:n,left:e,right:e+s,bottom:n+r,x:e,y:n}}function io(t,e,n){let{reference:s,floating:r}=t;const i=de(e),o=no(e),a=to(o),l=Ie(e),d=i==="y",c=s.x+s.width/2-r.width/2,p=s.y+s.height/2-r.height/2,u=s[a]/2-r[a]/2;let h;switch(l){case"top":h={x:c,y:s.y-r.height};break;case"bottom":h={x:c,y:s.y+s.height};break;case"right":h={x:s.x+s.width,y:p};break;case"left":h={x:s.x-r.width,y:p};break;default:h={x:s.x,y:s.y}}const f=vt(e);return f&&(h[o]+=u*(f==="end"?1:-1)*(n&&d?-1:1)),h}async function Kp(t,e){var n;e===void 0&&(e={});const{x:s,y:r,platform:i,rects:o,elements:a,strategy:l}=t,{boundary:d="clippingAncestors",rootBoundary:c="viewport",elementContext:p="floating",altBoundary:u=!1,padding:h=0}=bt(e,t),f=Vp(h),b=a[u?p==="floating"?"reference":"floating":p],x=ln(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(b)))==null||n?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:d,rootBoundary:c,strategy:l})),S=p==="floating"?{x:s,y:r,width:o.floating.width,height:o.floating.height}:o.reference,T=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),_=await(i.isElement==null?void 0:i.isElement(T))&&await(i.getScale==null?void 0:i.getScale(T))||{x:1,y:1},U=ln(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:S,offsetParent:T,strategy:l}):S);return{top:(x.top-U.top+f.top)/_.y,bottom:(U.bottom-x.bottom+f.bottom)/_.y,left:(x.left-U.left+f.left)/_.x,right:(U.right-x.right+f.right)/_.x}}const Qp=50,Zp=async(t,e,n)=>{const{placement:s="bottom",strategy:r="absolute",middleware:i=[],platform:o}=n,a=o.detectOverflow?o:{...o,detectOverflow:Kp},l=await(o.isRTL==null?void 0:o.isRTL(e));let d=await o.getElementRects({reference:t,floating:e,strategy:r}),{x:c,y:p}=io(d,s,l),u=s,h=0;const f={};for(let g=0;g<i.length;g++){const b=i[g];if(!b)continue;const{name:x,fn:S}=b,{x:T,y:_,data:U,reset:P}=await S({x:c,y:p,initialPlacement:s,placement:u,strategy:r,middlewareData:f,rects:d,platform:a,elements:{reference:t,floating:e}});c=T??c,p=_??p,f[x]={...f[x],...U},P&&h<Qp&&(h++,typeof P=="object"&&(P.placement&&(u=P.placement),P.rects&&(d=P.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:r}):P.rects),{x:c,y:p}=io(d,u,l)),g=-1)}return{x:c,y:p,placement:u,strategy:r,middlewareData:f}},Yp=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,s;const{placement:r,middlewareData:i,rects:o,initialPlacement:a,platform:l,elements:d}=e,{mainAxis:c=!0,crossAxis:p=!0,fallbackPlacements:u,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:g=!0,...b}=bt(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const x=Ie(r),S=de(a),T=Ie(a)===a,_=await(l.isRTL==null?void 0:l.isRTL(d.floating)),U=u||(T||!g?[an(a)]:Bp(a)),P=f!=="none";!u&&P&&U.push(...Wp(a,g,f,_));const V=[a,...U],q=await l.detectOverflow(e,b),oe=[];let ee=((s=i.flip)==null?void 0:s.overflows)||[];if(c&&oe.push(q[x]),p){const we=qp(r,o,_);oe.push(q[we[0]],q[we[1]])}if(ee=[...ee,{placement:r,overflows:oe}],!oe.every(we=>we<=0)){var Ys,Js;const we=(((Ys=i.flip)==null?void 0:Ys.index)||0)+1,Sn=V[we];if(Sn&&(!(p==="alignment"?S!==de(Sn):!1)||ee.every(Z=>de(Z.placement)===S?Z.overflows[0]>0:!0)))return{data:{index:we,overflows:ee},reset:{placement:Sn}};let et=(Js=ee.filter($e=>$e.overflows[0]<=0).sort(($e,Z)=>$e.overflows[1]-Z.overflows[1])[0])==null?void 0:Js.placement;if(!et)switch(h){case"bestFit":{var Xs;const $e=(Xs=ee.filter(Z=>{if(P){const ue=de(Z.placement);return ue===S||ue==="y"}return!0}).map(Z=>[Z.placement,Z.overflows.filter(ue=>ue>0).reduce((ue,Va)=>ue+Va,0)]).sort((Z,ue)=>Z[1]-ue[1])[0])==null?void 0:Xs[0];$e&&(et=$e);break}case"initialPlacement":et=a;break}if(r!==et)return{reset:{placement:et}}}return{}}}},Jp=new Set(["left","top"]);async function Xp(t,e){const{placement:n,platform:s,elements:r}=t,i=await(s.isRTL==null?void 0:s.isRTL(r.floating)),o=Ie(n),a=vt(n),l=de(n)==="y",d=Jp.has(o)?-1:1,c=i&&l?-1:1,p=bt(e,t);let{mainAxis:u,crossAxis:h,alignmentAxis:f}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return a&&typeof f=="number"&&(h=a==="end"?f*-1:f),l?{x:h*c,y:u*d}:{x:u*d,y:h*c}}const eh=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,s;const{x:r,y:i,placement:o,middlewareData:a}=e,l=await Xp(e,t);return o===((n=a.offset)==null?void 0:n.placement)&&(s=a.arrow)!=null&&s.alignmentOffset?{}:{x:r+l.x,y:i+l.y,data:{...l,placement:o}}}}},th=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:s,placement:r,platform:i}=e,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:S=>{let{x:T,y:_}=S;return{x:T,y:_}}},...d}=bt(t,e),c={x:n,y:s},p=await i.detectOverflow(e,d),u=de(r),h=eo(u);let f=c[h],g=c[u];const b=(S,T)=>jp(T+p[S==="y"?"top":"left"],T,T-p[S==="y"?"bottom":"right"]);o&&(f=b(h,f)),a&&(g=b(u,g));const x=l.fn({...e,[h]:f,[u]:g});return{...x,data:{x:x.x-n,y:x.y-s,enabled:{[h]:o,[u]:a}}}}}},nh=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:s,platform:r,elements:i}=e,{apply:o=()=>{},...a}=bt(t,e),l=await r.detectOverflow(e,a),d=Ie(n),c=vt(n),p=de(n)==="y",{width:u,height:h}=s.floating;let f,g;d==="top"||d==="bottom"?(f=d,g=c===(await(r.isRTL==null?void 0:r.isRTL(i.floating))?"start":"end")?"left":"right"):(g=d,f=c==="end"?"top":"bottom");const b=h-l.top-l.bottom,x=u-l.left-l.right,S=Ze(h-l[f],b),T=Ze(u-l[g],x),_=e.middlewareData.shift,U=!_;let P=S,V=T;_!=null&&_.enabled.x&&(V=x),_!=null&&_.enabled.y&&(P=b),U&&!c&&(p?V=u-2*le(l.left,l.right):P=h-2*le(l.top,l.bottom)),await o({...e,availableWidth:V,availableHeight:P});const q=await r.getDimensions(i.floating);return u!==q.width||h!==q.height?{reset:{rects:!0}}:{}}}};function cn(){return typeof window<"u"}function Ye(t){return oo(t)?(t.nodeName||"").toLowerCase():"#document"}function F(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function pe(t){var e;return(e=(oo(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function oo(t){return cn()?t instanceof Node||t instanceof F(t).Node:!1}function re(t){return cn()?t instanceof Element||t instanceof F(t).Element:!1}function xe(t){return cn()?t instanceof HTMLElement||t instanceof F(t).HTMLElement:!1}function ao(t){return!cn()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof F(t).ShadowRoot}function dn(t){const{overflow:e,overflowX:n,overflowY:s,display:r}=ie(t);return/auto|scroll|overlay|hidden|clip/.test(e+s+n)&&r!=="inline"&&r!=="contents"}function sh(t){return/^(table|td|th)$/.test(Ye(t))}function pn(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const rh=/transform|translate|scale|rotate|perspective|filter/,ih=/paint|layout|strict|content/,Ne=t=>!!t&&t!=="none";let us;function fs(t){const e=re(t)?ie(t):t;return Ne(e.transform)||Ne(e.translate)||Ne(e.scale)||Ne(e.rotate)||Ne(e.perspective)||!gs()&&(Ne(e.backdropFilter)||Ne(e.filter))||rh.test(e.willChange||"")||ih.test(e.contain||"")}function oh(t){let e=De(t);for(;xe(e)&&!xt(e);){if(fs(e))return e;if(pn(e))return null;e=De(e)}return null}function gs(){return us==null&&(us=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),us}function xt(t){return/^(html|body|#document)$/.test(Ye(t))}function ie(t){return F(t).getComputedStyle(t)}function hn(t){return re(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function De(t){if(Ye(t)==="html")return t;const e=t.assignedSlot||t.parentNode||ao(t)&&t.host||pe(t);return ao(e)?e.host:e}function lo(t){const e=De(t);return xt(e)?(t.ownerDocument||t).body:xe(e)&&dn(e)?e:lo(e)}function yt(t,e,n){var s;e===void 0&&(e=[]),n===void 0&&(n=!0);const r=lo(t),i=r===((s=t.ownerDocument)==null?void 0:s.body),o=F(r);if(i){const a=ms(o);return e.concat(o,o.visualViewport||[],dn(r)?r:[],a&&n?yt(a):[])}else return e.concat(r,yt(r,[],n))}function ms(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function co(t){const e=ie(t);let n=parseFloat(e.width)||0,s=parseFloat(e.height)||0;const r=xe(t),i=r?t.offsetWidth:n,o=r?t.offsetHeight:s,a=rn(n)!==i||rn(s)!==o;return a&&(n=i,s=o),{width:n,height:s,$:a}}function ks(t){return re(t)?t:t.contextElement}function Je(t){const e=ks(t);if(!xe(e))return ce(1);const n=e.getBoundingClientRect(),{width:s,height:r,$:i}=co(e);let o=(i?rn(n.width):n.width)/s,a=(i?rn(n.height):n.height)/r;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const ah=ce(0);function po(t){const e=F(t);return!gs()||!e.visualViewport?ah:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function lh(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===F(t)}function je(t,e,n,s){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=ks(t);let o=ce(1);e&&(s?re(s)&&(o=Je(s)):o=Je(t));const a=lh(i,n,s)?po(i):ce(0);let l=(r.left+a.x)/o.x,d=(r.top+a.y)/o.y,c=r.width/o.x,p=r.height/o.y;if(i&&s){const u=F(i),h=re(s)?F(s):s;let f=u,g=ms(f);for(;g&&h!==f;){const b=Je(g),x=g.getBoundingClientRect(),S=ie(g),T=x.left+(g.clientLeft+parseFloat(S.paddingLeft))*b.x,_=x.top+(g.clientTop+parseFloat(S.paddingTop))*b.y;l*=b.x,d*=b.y,c*=b.x,p*=b.y,l+=T,d+=_,f=F(g),g=ms(f)}}return ln({width:c,height:p,x:l,y:d})}function un(t,e){const n=hn(t).scrollLeft;return e?e.left+n:je(pe(t)).left+n}function ho(t,e){const n=t.getBoundingClientRect(),s=n.left+e.scrollLeft-un(t,n),r=n.top+e.scrollTop;return{x:s,y:r}}function ch(t){let{elements:e,rect:n,offsetParent:s,strategy:r}=t;const i=r==="fixed",o=pe(s),a=e?pn(e.floating):!1;if(s===o||a&&i)return n;let l={scrollLeft:0,scrollTop:0},d=ce(1);const c=ce(0),p=xe(s);if((p||!i)&&((Ye(s)!=="body"||dn(o))&&(l=hn(s)),p)){const h=je(s);d=Je(s),c.x=h.x+s.clientLeft,c.y=h.y+s.clientTop}const u=o&&!p&&!i?ho(o,l):ce(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-l.scrollLeft*d.x+c.x+u.x,y:n.y*d.y-l.scrollTop*d.y+c.y+u.y}}function dh(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function ph(t){const e=hn(t),n=t.ownerDocument.body,s=le(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),r=le(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-e.scrollLeft+un(t);const o=-e.scrollTop;return ie(n).direction==="rtl"&&(i+=le(t.clientWidth,n.clientWidth)-s),{width:s,height:r,x:i,y:o}}const hh=25;function uh(t,e,n){n===void 0&&(n="viewport");const s=n==="layoutViewport",r=F(t),i=pe(t),o=r.visualViewport;let a=i.clientWidth,l=i.clientHeight,d=0,c=0;if(o){const u=!gs()||e==="fixed";s?u||(d=-o.offsetLeft,c=-o.offsetTop):(a=o.width,l=o.height,u&&(d=o.offsetLeft,c=o.offsetTop))}if(un(i)<=0){const u=i.ownerDocument,h=u.body,f=getComputedStyle(h),g=u.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,b=Math.abs(i.clientWidth-h.clientWidth-g),x=getComputedStyle(i).scrollbarGutter==="stable both-edges"?b/2:b;x<=hh&&(a-=x)}return{width:a,height:l,x:d,y:c}}function fh(t,e){const n=je(t,!0,e==="fixed"),s=n.top+t.clientTop,r=n.left+t.clientLeft,i=Je(t),o=t.clientWidth*i.x,a=t.clientHeight*i.y,l=r*i.x,d=s*i.y;return{width:o,height:a,x:l,y:d}}function uo(t,e,n){let s;if(e==="viewport"||e==="layoutViewport")s=uh(t,n,e);else if(e==="document")s=ph(pe(t));else if(re(e))s=fh(e,n);else{const r=po(t);s={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return ln(s)}function gh(t,e){const n=e.get(t);if(n)return n;let s=yt(t,[],!1).filter(a=>re(a)&&Ye(a)!=="body"),r=null;const i=ie(t).position==="fixed";let o=i?De(t):t;for(;re(o)&&!xt(o);){const a=ie(o),l=fs(o),d=r?r.position:i?"fixed":"";!l&&(d==="fixed"||d==="absolute"&&a.position==="static")?s=s.filter(p=>p!==o):r=a,o=De(o)}return e.set(t,s),s}function mh(t){let{element:e,boundary:n,rootBoundary:s,strategy:r}=t;const o=[...n==="clippingAncestors"?pn(e)?[]:gh(e,this._c):[].concat(n),s],a=uo(e,o[0],r);let l=a.top,d=a.right,c=a.bottom,p=a.left;for(let u=1;u<o.length;u++){const h=uo(e,o[u],r);l=le(h.top,l),d=Ze(h.right,d),c=Ze(h.bottom,c),p=le(h.left,p)}return{width:d-p,height:c-l,x:p,y:l}}function kh(t){const{width:e,height:n}=co(t);return{width:e,height:n}}function bh(t,e,n){const s=xe(e),r=pe(e),i=n==="fixed",o=je(t,!0,i,e);let a={scrollLeft:0,scrollTop:0};const l=ce(0);if((s||!i)&&((Ye(e)!=="body"||dn(r))&&(a=hn(e)),s)){const u=je(e,!0,i,e);l.x=u.x+e.clientLeft,l.y=u.y+e.clientTop}!s&&r&&(l.x=un(r));const d=r&&!s&&!i?ho(r,a):ce(0),c=o.left+a.scrollLeft-l.x-d.x,p=o.top+a.scrollTop-l.y-d.y;return{x:c,y:p,width:o.width,height:o.height}}function bs(t){return ie(t).position==="static"}function fo(t,e){if(!xe(t)||ie(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return pe(t)===n&&(n=n.ownerDocument.body),n}function go(t,e){const n=F(t);if(pn(t))return n;if(!xe(t)){let r=De(t);for(;r&&!xt(r);){if(re(r)&&!bs(r))return r;r=De(r)}return n}let s=fo(t,e);for(;s&&sh(s)&&bs(s);)s=fo(s,e);return s&&xt(s)&&bs(s)&&!fs(s)?n:s||oh(t)||n}const vh=async function(t){const e=this.getOffsetParent||go,n=this.getDimensions,s=await n(t.floating);return{reference:bh(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function xh(t){return ie(t).direction==="rtl"}const yh={convertOffsetParentRelativeRectToViewportRelativeRect:ch,getDocumentElement:pe,getClippingRect:mh,getOffsetParent:go,getElementRects:vh,getClientRects:dh,getDimensions:kh,getScale:Je,isElement:re,isRTL:xh};function mo(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function wh(t,e,n){let s=null,r;const i=pe(t);function o(){var c;clearTimeout(r),(c=s)==null||c.disconnect(),s=null}function a(c,p){c===void 0&&(c=!1),p===void 0&&(p=1),o();const u=t.getBoundingClientRect(),{left:h,top:f,width:g,height:b}=u;if(c||e(),!g||!b)return;const x=on(f),S=on(i.clientWidth-(h+g)),T=on(i.clientHeight-(f+b)),_=on(h),P={rootMargin:-x+"px "+-S+"px "+-T+"px "+-_+"px",threshold:le(0,Ze(1,p))||1};let V=!0;function q(oe){const ee=oe[0].intersectionRatio;if(!mo(u,t.getBoundingClientRect()))return a();if(ee!==p){if(!V)return a();ee?a(!1,ee):r=setTimeout(()=>{a(!1,1e-7)},1e3)}V=!1}try{s=new IntersectionObserver(q,{...P,root:i.ownerDocument})}catch{s=new IntersectionObserver(q,P)}s.observe(t)}const l=F(t),d=()=>a(n);return l.addEventListener("resize",d),a(!0),()=>{l.removeEventListener("resize",d),o()}}function $h(t,e,n,s){s===void 0&&(s={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=s,d=ks(t),c=r||i?[...d?yt(d):[],...e?yt(e):[]]:[];c.forEach(x=>{r&&x.addEventListener("scroll",n),i&&x.addEventListener("resize",n)});const p=d&&a?wh(d,n,i):null;let u=-1,h=null;o&&(h=new ResizeObserver(x=>{let[S]=x;S&&S.target===d&&h&&e&&(h.unobserve(e),cancelAnimationFrame(u),u=requestAnimationFrame(()=>{var T;(T=h)==null||T.observe(e)})),n()}),d&&!l&&h.observe(d),e&&h.observe(e));let f,g=l?je(t):null;l&&b();function b(){const x=je(t);g&&!mo(g,x)&&n(),g=x,f=requestAnimationFrame(b)}return n(),()=>{var x;c.forEach(S=>{r&&S.removeEventListener("scroll",n),i&&S.removeEventListener("resize",n)}),p?.(),(x=h)==null||x.disconnect(),h=null,l&&cancelAnimationFrame(f)}}const Sh=eh,Ah=th,Th=Yp,Ch=nh,Eh=(t,e,n)=>{const s=new Map,r=n??{},i={...yh,...r.platform,_c:s};return Zp(t,e,{...r,platform:i})},Rh=(t,e)=>({top:e,bottom:e,right:t}),ko=(t,e,n,s={})=>{if(typeof t.showPopover!="function")return()=>{};try{t.showPopover()}catch{return()=>{}}let r=!0,i=0;const o=e instanceof Element?e:{getBoundingClientRect:()=>({x:e.right,y:e.top,left:e.right,right:e.right,top:e.top,bottom:e.bottom,width:0,height:e.bottom-e.top})};t.style.width=`${n.width}px`,t.style.maxHeight=`${n.height}px`;const l=$h(o,t,()=>{const d=++i;Eh(o,t,{strategy:"fixed",placement:s.placement??"bottom-end",middleware:[Sh(8),Th({padding:8,fallbackAxisSideDirection:"end"}),Ah({padding:8}),Ch({padding:8,apply:({availableWidth:c,availableHeight:p})=>{!r||d!==i||(t.style.width=`${Math.max(0,Math.min(n.width,c))}px`,t.style.maxHeight=`${Math.max(0,Math.min(n.height,p))}px`)}})]}).then(({x:c,y:p})=>{!r||d!==i||!t.isConnected||(t.style.left=`${c}px`,t.style.top=`${p}px`)}).catch(()=>{})},{animationFrame:s.trackTransform??!1,elementResize:typeof ResizeObserver<"u",layoutShift:typeof IntersectionObserver<"u"});return()=>{r=!1,l()}},bo=t=>{if(!(!t||typeof t.hidePopover!="function"))try{t.hidePopover()}catch{}};class vo{#e;#t=new Map;constructor(e){this.#e=e,e.addController(this)}hostConnected(){this.#e.requestUpdate()}hostUpdated(){for(const[e,n]of this.#t)e.isConnected||(n(),this.#t.delete(e))}hostDisconnected(){for(const e of this.#t.values())e();this.#t.clear()}open(e,n,s,r){this.#t.get(e)?.(),this.#t.set(e,ko(e,n,s,r))}}function vs(t,e,n){return n==null?Math.min(t,e):Math.min(Math.max(t,e),n)}class xo{#e;constructor(e,n){this.#e=n,e.addController(this)}hostConnected(){document.addEventListener("pointerdown",this.#t,!0),document.addEventListener("keydown",this.#n)}hostDisconnected(){document.removeEventListener("pointerdown",this.#t,!0),document.removeEventListener("keydown",this.#n)}#t=e=>{e.button!==0||!this.#e.open()||this.#e.closesOn(e.composedPath())&&this.#e.dismiss()};#n=e=>{e.key!=="Escape"||e.isComposing||e.defaultPrevented||!this.#e.open()||this.#e.ownsEscape(e.composedPath())&&(e.preventDefault(),this.#e.dismiss())}}const yo=(t,e,n)=>n.top<e.top?t+n.top-e.top:n.bottom<=e.bottom?t:t+Math.min(n.bottom-e.bottom,n.top-e.top),wo=(t,e,n)=>{const s=Math.min(n,e/4);return{top:t+s,bottom:t+e-s}},xs=(t,e,n=0)=>{const s=t.getBoundingClientRect();t.scrollTop=yo(t.scrollTop,wo(s.top+t.clientTop,t.clientHeight,n),e.getBoundingClientRect())},$o=(t,e,n=0)=>{const s=t.getBoundingClientRect(),r=e.getBoundingClientRect();t.scrollLeft=yo(t.scrollLeft,wo(s.left+t.clientLeft,t.clientWidth,n),{top:r.left,bottom:r.right})},So=(t,e,n)=>{typeof window>"u"||Object.assign(window,{devProcessKit:{version:t,templates:e,versionParam:n}})},wt="dpk-version",Ao="version",_h=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/,fn=t=>_h.test(t),Oh="https://cdn.jsdelivr.net/npm/dev-process-kit@",To="https://data.jsdelivr.com/v1/packages/npm/dev-process-kit",ys=t=>{const e=new URLSearchParams(t),n=e.get(wt)??e.get(Ao);return n!==null&&fn(n)?n:null},Lh=(t,e)=>{const n=ys(t);return n===null||n===e?null:n},Ph=(t,e)=>{if(!fn(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`${Oh}${t}/dist/${e}`},zh=(t,e)=>{const n=new URL(t);return n.searchParams.delete(Ao),e===null?n.searchParams.delete(wt):n.searchParams.set(wt,e),n.href},Mh=O({tags:D(Ge(v(),ve()),{}),versions:j(O({version:v()}))}),Ih=t=>{const e=Vt(Mh,t),n=e.tags.latest;return{latest:typeof n=="string"&&fn(n)?n:null,versions:e.versions.map(s=>s.version).filter(fn)}},Co=t=>{const e=t.published?.versions??[],n=e.includes(t.current)?e:[t.current,...e],s=t.published?.latest??null;return{value:t.current,options:[...t.requested?[{value:"",label:t.text.pinned}]:[],...n.map(r=>({value:r,label:r===s&&r!==t.current?t.text.latest(r):r}))]}};let gn;const Eo=()=>(gn??=fetch(To).then(async t=>{if(!t.ok)throw new Error(`${To} answered ${t.status}`);return Ih(await t.json())}),gn.catch(()=>{gn=void 0}),gn),Ro=t=>{location.assign(zh(location.href,t))},Nh=t=>import(t),Dh=({entry:t,templates:e,register:n,importModule:s=Nh})=>{const r=()=>{n(),So(X,e,wt)},i=typeof location>"u"?null:Lh(location.search,X);if(i===null){r();return}s(Ph(i,t)).then(()=>{jh()||Bh(i)},o=>{console.error(`dev-process-kit@${i} could not be loaded; running ${X}`,o),r()})},jh=()=>{const t=Reflect.get(window,"devProcessKit");return typeof t=="object"&&t!==null&&"versionParam"in t},ws="dpk-version-fallback",qh=`
|
|
1385
|
+
.${ws} {
|
|
1386
1386
|
flex: none;
|
|
1387
1387
|
height: 24px;
|
|
1388
1388
|
margin-left: auto;
|
|
@@ -1400,26 +1400,26 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1400
1400
|
letter-spacing: 0.02em;
|
|
1401
1401
|
cursor: pointer;
|
|
1402
1402
|
}
|
|
1403
|
-
`,Nh=t=>{const e=[...document.body.querySelectorAll("*")].filter(n=>n.localName.startsWith("dpk-template-")&&!n.querySelector(`:scope > .${xs}`));if(e.length!==0){document.head.append(Object.assign(document.createElement("style"),{textContent:Ih}));for(const n of e)n.append(Dh(n,t))}},Dh=(t,e)=>{const n=L(Mt(zt(t))),s=document.createElement("select");s.className=xs,s.slot="header",s.setAttribute("aria-label",n.versionLabel),s.title=n.versionLabel;const r=o=>{const a=To({current:e,requested:vs(location.search)!==null,published:o,text:{pinned:n.versionPinned,latest:n.versionLatest}});s.replaceChildren(...a.options.map(l=>Object.assign(document.createElement("option"),{value:l.value,textContent:l.label}))),s.value=a.value},i=()=>{Co().then(r,o=>console.warn(o))};return s.addEventListener("pointerenter",i,{once:!0}),s.addEventListener("focus",i,{once:!0}),s.addEventListener("change",()=>Eo(s.value===""?null:s.value)),r(null),s},jh=O({value:v()}),qh=t=>e=>{if(!(e instanceof CustomEvent))return;const n=C(jh,e.detail);n.success&&t(n.output.value)},ys=t=>e=>{const n=Ee(e.target,HTMLSelectElement);n!==null&&t(n.value)},Bh=t=>e=>{const n=Ee(e.target,HTMLInputElement);n!==null&&t(n.value,n)},Hh=t=>e=>{const n=Ee(e.target,HTMLInputElement);n!==null&&t(n.checked)},Ro="data-dpk-changes",Uh=/^[^:\s]+:\S+$/,Fh=z({id:D(y(v(),$(1))),title:y(v(),$(1)),body:D(v()),target:D(y(v(),oe(Uh,'target must be written "type:id"'))),navigate:D(y(v(),Xr("=",'navigate must be written "key=value"')))}),Wh=j(Fh),Gh=y(v(),$(1)),_o=z({revision:Gh,changes:Wh}),Vh=z({revisions:y(j(_o),$(1,"list at least one version"))}),Kh=(t,e)=>JSON.stringify([t,e]),wt=t=>[...t.earlier,t.latest],Qh=t=>{const e=t.changes.map((s,r)=>{const i=s.id??String(r);return{key:Kh(t.revision,i),id:i,revision:t.revision,title:s.title,body:s.body??null,target:s.target??null,navigate:s.navigate??null}});return new Set(e.map(s=>s.id)).size!==e.length?`change ids must be unique within version "${t.revision}"`:{revision:t.revision,entries:e}},Zh=t=>{const e=typeof t=="object"&&t!==null&&"revisions"in t,n=C(e?Vh:_o,t);if(!n.success)return{ok:!1,error:Uc(n.issues)};const s=n.output,r="revisions"in s?s.revisions:[s],i=[];for(const a of r){if(i.some(d=>d.revision===a.revision))return{ok:!1,error:`version "${a.revision}" is listed twice`};const l=Qh(a);if(typeof l=="string")return{ok:!1,error:l};i.push(l)}const o=i.pop();return o?{ok:!0,log:{earlier:i,latest:o}}:{ok:!1,error:"list at least one version"}},Yh=z({v:G(1),revision:v(),seen:j(v())}),Jh=z({v:G(2),since:v(),seen:Ge(v(),j(v()))}),Oo=t=>{const e=C(Jh,t);if(e.success)return e.output;const n=C(Yh,t);return n.success?{v:2,since:n.output.revision,seen:{[n.output.revision]:n.output.seen}}:null},ws={open:!1,fresh:new Set},Lo=t=>e=>t.told.has(e.revision)&&!t.seen.has(e.key),$s=(t,e)=>wt(t).flatMap(n=>n.entries.filter(Lo(e))),Po=t=>t.target!==null||t.navigate!==null,Xh=(t,e)=>{const n=wt(t),s=e===null?-1:n.findIndex(o=>o.revision===e.since),r=e===null?[t.latest]:n.slice(Math.max(0,s)),i=new Set(r.flatMap(o=>{const a=new Set(e?.seen[o.revision]??[]);return o.entries.filter(l=>a.has(l.id)).map(l=>l.key)}));return{told:new Set(r.map(o=>o.revision)),seen:i,toasts:t.latest.entries.filter(o=>!i.has(o.key)).map(o=>o.key),list:ws}},Ss=(t,e)=>new Set([...t.seen,...e]),eu=(t,e,n)=>{switch(n.kind){case"open-list":{const s=$s(t,e),r=new Set(s.map(o=>o.key)),i=s.filter(o=>!Po(o)).map(o=>o.key);return{...e,seen:Ss(e,i),toasts:[],list:{open:!0,fresh:r}}}case"close-list":return{...e,list:ws};case"close-toast":return{...e,toasts:e.toasts.filter(s=>s!==n.key)};case"jump":return{...e,seen:Ss(e,[n.key]),toasts:e.toasts.filter(s=>s!==n.key),list:ws};case"read-all":return{...e,seen:Ss(e,$s(t,e).map(s=>s.key)),toasts:[],list:{open:e.list.open,fresh:new Set}}}},tu=(t,e)=>$s(t,e).length,nu=(t,e)=>{const n=wt(t),s=n.findIndex(o=>e.told.has(o.revision)&&o.entries.some(Lo(e))),r=s===-1?n.length-1:s,i=n.slice(r).flatMap(o=>{const a=o.entries.filter(l=>e.seen.has(l.key)).map(l=>l.id);return a.length>0?[[o.revision,a]]:[]});return{v:2,since:n[r]?.revision??t.latest.revision,seen:Object.fromEntries(i)}},su=(t,e)=>t.target===null&&t.navigate===null?null:{navigate:t.navigate!==null?Xt(t.navigate):t.target!==null?e(ut(t.target)):null,target:t.target},zo=3,ru=t=>e=>({key:e.key,id:e.id,revision:e.revision,title:e.title,body:e.body,jumpable:Po(e),fresh:t.list.fresh.has(e.key)}),iu=(t,e)=>{const n=wt(t).map(i=>({revision:i.revision,latest:i===t.latest,cards:i.entries.map(ru(e))})).reverse(),s=new Map(n.flatMap(i=>i.cards.map(o=>[o.key,o]))),r=e.toasts.flatMap(i=>{const o=s.get(i);return o?[o]:[]});return{unread:tu(t,e),open:e.list.open,groups:n,toasts:r.slice(0,zo),waiting:Math.max(0,r.length-zo)}},$t=t=>t==="light"||t==="dark"?t:null,Mo=t=>t.authored??t.environment,Io=t=>t.preference??Mo(t),ou=t=>{const e=Io(t)==="dark"?"light":"dark";return e===Mo(t)?null:e},No=j(z({value:y(v(),oe(/^element:.+/)),label:y(v(),$(1)),group:U(v())})),au=O({targets:No,providers:j(O({id:y(v(),$(1)),results:j(vi)}))}),lu=z({target:y(v(),oe(/^element:.+/)),body:y(v(),Zn(),$(1))}),Do=t=>t.group?`${t.group} \xB7 ${t.label}`:t.label,cu=(t,e,n)=>{const s=new Map(e.map(r=>[r.value,r]));return{...t,hasTarget:(r,i)=>t.hasTarget(r,i)||s.has(I(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(te(r)){const d=n.get(r.id),c=s.get(I(r.target));return{title:d?.title??r.type,...d?.summary===void 0?{}:{summary:d.summary},tone:d?.tone??"update",targetLabel:c?Do(c):r.target.id}}const a=t.describe(r,i,o),l=r.type==="comment"&&!t.hasTarget(i,r.target)?s.get(I(r.target)):void 0;return l===void 0?a:{...a,targetLabel:Do(l)}},serialize:r=>te(r)?`${r.type} ${I(r.target)} ${JSON.stringify(r.payload)}`:t.serialize(r)}},jo=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function qo(t){return typeof jo.Buffer<"u"&&jo.Buffer.isBuffer(t)}function Bo(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 Ho(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function Uo(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const du="[object RegExp]",pu="[object String]",hu="[object Number]",uu="[object Boolean]",fu="[object Symbol]",gu="[object Date]",mu="[object Map]",ku="[object Set]",bu="[object Array]",vu="[object Function]",xu="[object ArrayBuffer]",As="[object Object]",yu="[object Error]",wu="[object DataView]",$u="[object Uint8Array]",Su="[object Uint8ClampedArray]",Au="[object Uint16Array]",Tu="[object Uint32Array]",Cu="[object BigUint64Array]",Eu="[object Int8Array]",Ru="[object Int16Array]",_u="[object Int32Array]",Ou="[object BigInt64Array]",Lu="[object Float32Array]",Pu="[object Float64Array]";function zu(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function Mu(t,e,n){return St(t,e,void 0,void 0,void 0,void 0,n)}function St(t,e,n,s,r,i,o){const a=o(t,e,n,s,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 At(t,e,i,o)}return At(t,e,i,o)}function At(t,e,n,s){if(Object.is(t,e))return!0;let r=Uo(t),i=Uo(e);if(r==="[object Arguments]"&&(r=As),i==="[object Arguments]"&&(i=As),r!==i)return!1;switch(r){case pu:return t.toString()===e.toString();case hu:return zu(t.valueOf(),e.valueOf());case uu:case gu:case fu:return Object.is(t.valueOf(),e.valueOf());case du:return t.source===e.source&&t.flags===e.flags;case vu:return t===e}n=n??new Map;const o=n.get(t),a=n.get(e);if(o!=null&&a!=null)return o===e;n.set(t,e),n.set(e,t);try{switch(r){case mu:if(t.size!==e.size)return!1;for(const[l,d]of t.entries())if(!e.has(l)||!St(d,e.get(l),l,t,e,n,s))return!1;return!0;case ku:{if(t.size!==e.size)return!1;const l=Array.from(t.values()),d=Array.from(e.values());for(let c=0;c<l.length;c++){const p=l[c],u=d.findIndex(h=>St(p,h,void 0,t,e,n,s));if(u===-1)return!1;d.splice(u,1)}return!0}case bu:case $u:case Su:case Au:case Tu:case Cu:case Eu:case Ru:case _u:case Ou:case Lu:case Pu:if(qo(t)!==qo(e)||t.length!==e.length)return!1;for(let l=0;l<t.length;l++)if(!St(t[l],e[l],l,t,e,n,s))return!1;return!0;case xu:return t.byteLength!==e.byteLength?!1:At(new Uint8Array(t),new Uint8Array(e),n,s);case wu:return t.byteLength!==e.byteLength||t.byteOffset!==e.byteOffset?!1:At(new Uint8Array(t),new Uint8Array(e),n,s);case yu:return t.name===e.name&&t.message===e.message;case As:{if(!(At(t.constructor,e.constructor,n,s)||Bo(t)&&Bo(e)))return!1;const l=[...Object.keys(t),...Ho(t)],d=[...Object.keys(e),...Ho(e)];if(l.length!==d.length)return!1;for(let c=0;c<l.length;c++){const p=l[c],u=t[p];if(!Object.hasOwn(e,p))return!1;const h=e[p];if(!St(u,h,p,t,e,n,s))return!1}return!0}default:return!1}}finally{n.delete(t),n.delete(e)}}function Iu(){}function mn(t,e){return Mu(t,e,Iu)}const Ts="page",Fo=t=>I(t),Wo=(t,e,n,s=new Map,r=Ve)=>{let i=e,o={};const a=[],l=[],d=[],c=[],p=new Map;for(const h of n){if(h.type===B)continue;if(te(h)){const b=s.get(h.id);b===void 0||b.stale!==void 0?l.push({action:h,reason:b?.stale??"target-missing"}):a.push(h);continue}if(Q(h)){const b=Ri(r,o,h);b===null?l.push({action:h,reason:Ke(r,h.target.id)?"constraint-violated":"target-missing"}):b===o?d.push(h):(o=b,a.push(h));continue}const f=ht(t.actions,h.type);if(!f){l.push({action:h,reason:"unsupported-action-type"});continue}const g=t.apply(i,h);if(g===null){l.push({action:h,reason:t.hasTarget(i,h.target)?"constraint-violated":"target-missing"});continue}if(f.mode!=="append"&&Cs(t,i,g)){d.push(h);continue}i=g,a.push(h)}for(const h of n){if(h.type!==B)continue;if(!(h.target.type===Ts?t.pageTargetExists?.(i,h.target)??!0:t.hasTarget(i,h.target))){l.push({action:h,reason:"target-missing"});continue}c.push(h);const g=Fo(h.target);p.set(g,[...p.get(g)??[],h])}const u=new Map(n.map((h,f)=>[h.id,f]));return l.sort((h,f)=>(u.get(h.action.id)??0)-(u.get(f.action.id)??0)),{base:e,state:i,actions:n,applied:a,stale:l,obsolete:d,comments:c,commentsByTarget:p,grill:r,answers:o}},Cs=(t,e,n)=>e===n?!0:t.canonicalState===void 0?mn(e,n):mn(t.canonicalState(e),t.canonicalState(n)),Go=t=>{const e=new Set(t.obsolete.map(n=>n.id));return t.actions.filter(n=>!e.has(n.id))},Nu=(t,e,n,s)=>{let r=e;const i=s??Vo(r).map(o=>o.id);for(const o of[...i].reverse())r=Du(t,r,n,o,s!==void 0)??r;return r},Vo=t=>t.applied.filter(e=>!te(e)&&!Q(e)),Du=(t,e,n,s,r)=>{const i=Vo(e),o=i.findIndex(u=>u.id===s),a=i[o];if(a===void 0)return null;const l=i.slice(0,o),d=[...r?ju(t,e.base,i,o):[],...qu(t,l,a)],c=new Set,p=d.filter(u=>{const h=u.join(" ");return c.has(h)?!1:(c.add(h),!0)}).sort((u,h)=>h.length-u.length);for(const u of p){const h=Bu(t,e,n,u);if(h!==null)return h}return null},ju=(t,e,n,s)=>{const r=[];let i=e;for(const o of n.slice(0,s+1))r.push(i),i=t.apply(i,o)??i;return r.flatMap((o,a)=>Cs(t,o,i)?[n.slice(a,s+1).map(l=>l.id)]:[])},qu=(t,e,n)=>{const s=Ko(n),r=e.filter(l=>Ko(l).some(d=>s.includes(d))),i=Qo(t,n),o=r.filter(l=>Qo(t,l)===i),a=l=>l.map((d,c)=>[...l.slice(c).map(p=>p.id),n.id]);return[...a(r),...a(o),...r.map(l=>[l.id,n.id]),...r.map(l=>[l.id])]},Ko=t=>{const e=t.target.type===Ts?[]:t.target.id.split("."),n=typeof t.payload=="object"&&t.payload!==null?Object.values(t.payload).filter(s=>typeof s=="string"&&s!==""):[];return[...e,...n]},Qo=(t,e)=>ht(t.actions,e.type)?.mode,Bu=(t,e,n,s)=>{const r=new Set(e.stale.map(o=>o.action.id)),i=new Set(s);for(;;){const o=n(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 Cs(t,o.state,e.state)?o:null;if(a.some(l=>l.type===B||te(l)||Q(l)))return null;for(const l of a)i.add(l.id)}},Hu=(t,e,n)=>{const s=Ei(n);if(s===null)return{title:n.type,tone:"meta"};if(s.kind==="clear")return{title:t.grillAnswerClear,tone:"delete"};if(s.kind==="option"){const r=Ke(e,n.target.id)?.options.find(i=>i.id===s.optionId);return{title:t.grillAnswer,tone:"update",summary:t.grillQuoted(r?.label??s.optionId)}}return{title:t.grillAnswerFree,tone:"update",summary:t.grillQuoted(s.text.slice(0,120))}},Uu=(t,e)=>{const{grill:n}=e,s=L(e.locale);return{...t,hasTarget:(r,i)=>i.type===ae?Ke(n,i.id)!==void 0:t.hasTarget(r,i),commentTargets:(r,i)=>[...t.commentTargets(r,i),...n.questions.map(o=>({value:I({type:ae,id:o.id}),label:is(n,o.id),group:s.grillGroup}))],describe:(r,i,o)=>{const a=is(n,r.target.id);if(Q(r)){const{title:d,summary:c,tone:p}=Hu(s,n,r);return{title:d,tone:p,targetLabel:a,...c===void 0?{}:{summary:c}}}const l=t.describe(r,i,o);return r.target.type===ae?{...l,targetLabel:a}:l},serialize:r=>Q(r)?`${r.type} ${I(r.target)} ${JSON.stringify(r.payload)}`:t.serialize(r)}},Fu=O({v:G(1),template:y(v(),$(1)),actions:j(ve())});class Es{constructor(e){this.storage=e}load(e,n){try{const s=this.storage.getItem(e);if(s===null)return[];const r=C(Fu,JSON.parse(s));return!r.success||r.output.template!==n?[]:r.output.actions.flatMap(i=>{const o=C(Pe,i);return o.success?[o.output]:[]})}catch{return[]}}save(e,n,s){const r={v:1,template:n,actions:s};try{this.storage.setItem(e,JSON.stringify(r))}catch{}}clear(e){try{this.storage.removeItem(e)}catch{}}}class Rs{constructor(){this.store=new Map}load(e,n){return new Es({getItem:s=>this.store.get(s)??null,setItem:(s,r)=>{this.store.set(s,r)},removeItem:s=>{this.store.delete(s)}}).load(e,n)}save(e,n,s){this.store.set(e,JSON.stringify({v:1,template:n,actions:s}))}clear(e){this.store.delete(e)}}const _s=()=>{try{if(typeof localStorage<"u")return new Es(localStorage)}catch{}return new Rs},kn=t=>`dev-process-kit:draft:${typeof location>"u"?"local":`${location.pathname}${location.search}`}:${t}`,Wu=j(ve());class Zo{#e;#t;#n={targets:[],providers:[]};#r;#s=new Map;#i;#o;#a;#l;#d;#p=new Set;#m=[];#y=0;constructor(e){this.#e=e.definition,this.#r=e.grill??{grill:Ve,locale:"en"},this.#t=this.#v(),this.#i=e.base,this.#d=e.storageKey??kn(e.definition.name),this.#l=e.storage===void 0?_s():e.storage;const n=e.initialActions??this.#l?.load(this.#d,this.definition.name)??[];this.#o=Xo(this.definition,n),this.#a=this.#h(this.#o),this.#u()&&this.#E()}get definition(){return this.#t}setComponentSnapshot(e){const n=Gt(au,e);if(!mn(n,this.#n)){this.#n=n,this.#k(),this.#a=this.#h(this.#o);for(const s of this.#p)s()}}setTemplate(e){this.#e=e,this.#k(),this.#a=this.#h(this.#o);for(const n of this.#p)n()}setGrill(e){this.#r=e,this.#k(),this.#a=this.#h(this.#o);for(const n of this.#p)n()}#k(){this.#s=xi(this.#o,this.#n.providers),this.#t=this.#v()}#v(){return Uu(cu(this.#e,this.#n.targets,this.#s),this.#r)}#h(e){return Wo(this.definition,this.#i,e,xi(e,this.#n.providers),this.#r.grill)}get base(){return this.#i}get actions(){return this.#o}get derivation(){return this.#a}get lastIssues(){return this.#m}get prunedCount(){return this.#y}descriptorFor(e,n){return Yo(this.definition,e,n)}dispatch(e){const n=this.#A(e,this.#a.state);if(!n.ok)return this.#g([n.issue]);const s=this.descriptorFor(n.action.type,n.action.target);return s?(this.#b(Jo(this.#o,n.action,s),[n.action.id]),{ok:!0,id:n.action.id}):this.#g([{path:"type",message:"unknown action type"}])}dispatchBatch(e){const n=C(Wu,e);if(!n.success)return this.#g([ze(n.issues)]);const s=n.output;if(s.length===0)return{ok:!0,ids:[]};let r=this.#o,i=this.#a.state,o=this.#a.answers;const a=[];for(const l of s){const d=this.#A(l,i);if(!d.ok)return this.#g([d.issue]);const c=d.action,p=this.descriptorFor(c.type,c.target);if(!p)return this.#g([{path:"type",message:"unknown action type"}]);if((Q(c)?Ri(this.#r.grill,o,c)===null?null:i:c.type==="comment"||te(c)?c.target.type==="page"||this.definition.hasTarget(i,c.target)?i:null:this.definition.apply(i,c))===null)return this.#g([{path:"target",message:"batch action is not applicable"}]);r=Jo(r,c,p);const h=this.#h(r);i=h.state,o=h.answers,a.push(c.id)}return this.#b(r,a),{ok:!0,ids:a}}#A(e,n){const s=C(fi,e);if(!s.success)return{ok:!1,issue:ze(s.issues)};const r=this.descriptorFor(s.output.type,typeof s.output.target=="string"?Qt(s.output.target,"page"):s.output.target);if(!r)return{ok:!1,issue:{path:"type",message:`unknown action type "${s.output.type}"`}};const i=Xc(s.output,r);if(!i.ok)return i;const o=this.definition.canonicalTarget?.(n,i.action.target)??i.action.target;return{ok:!0,action:{...i.action,target:o}}}#g(e){return this.#m=e,{ok:!1,issues:e}}editComment(e,n){const s=this.#o.find(a=>a.id===e);if(s?.type!==B)return this.#g([{path:"id",message:`no comment "${e}" in the draft`}]);if(ft(s)===n)return{ok:!0,id:e};const r=C(ts.schema,{...s,payload:{body:n}});if(!r.success)return this.#g([ze(r.issues)]);const i=C(Pe,r.output);if(!i.success)return this.#g([ze(i.issues)]);const o=i.output;return this.#b(this.#o.map(a=>a===s?o:a),[]),{ok:!0,id:e}}removeAction(e){const n=this.#o.filter(s=>s.id!==e);n.length!==this.#o.length&&this.#b(n)}clearActions(){this.#o.length>0&&this.#b([])}replaceActions(e){this.#b(Xo(this.definition,e))}setBase(e){this.#i=e,this.#b(this.#o)}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.#o}}#b(e,n){this.#m=[],this.#o=e,this.#k(),this.#a=this.#h(this.#o),this.#u(n),this.#E();for(const s of this.#p)s()}#u(e){const n=this.#w(),s=Nu(this.definition,this.#a,r=>this.#h(r),e);return s===this.#a?n:(this.#y+=this.#o.length-s.actions.length,this.#o=[...s.actions],this.#k(),this.#a=this.#h(this.#o),this.#w(),!0)}#w(){return this.#a.obsolete.length===0?!1:(this.#y+=this.#a.obsolete.length,this.#o=Go(this.#a),this.#k(),this.#a=this.#h(this.#o),!0)}#E(){this.#l?.save(this.#d,this.definition.name,this.#o)}}const Yo=(t,e,n)=>e==="comment"?ts:e===Zt?md:n!==void 0&&te({type:e,target:n})?rd:t.actionFor?t.actionFor(e,n):ht(t.actions,e),Jo=(t,e,n)=>Q(e)?bd(t,e):gi(t,e,n),Xo=(t,e)=>e.flatMap(n=>{const s=C(Pe,n);if(!s.success)return[];const r=s.output,i=Yo(t,r.type,r.target);if(!i)return[];const o=C(i.schema,r);if(!o.success)return[];const a=C(Pe,o.output);return a.success?[a.output]:[]}),Gu=()=>({status:{kind:"idle"},request:0}),Vu=(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}},Ku=(t,e)=>{if(t.actions===0||t.railOpen)return null;const n=L(t.locale),s=e.status;return{send:t.sendable?{label:s.kind==="sending"?n.handoffSending:s.kind==="sent"?n.handoffSent:n.handoffSend,disabled:s.kind==="sending"}:null,copy:s.kind==="copied"?{label:n.handoffCopied,status:"copied"}:s.kind==="copy-failed"?{label:n.handoffCopyFailed,status:"failed"}:{label:n.handoffCopy,status:"idle"},note:s.kind==="send-failed"?zi(s.reason,t.locale):null}},Os="@",Ls=Object.freeze({type:Ts,id:"page"}),Ps=/^[A-Za-z0-9_-]+$/,ea=t=>t.type===Ls.type&&t.id===Ls.id,ta=t=>{const e=t.id.lastIndexOf(Os);if(e<0)return null;const n=t.id.slice(e+1);return Ps.test(n)?{board:n,target:{type:t.type,id:t.id.slice(0,e)}}:null},na=(t,e)=>({type:t.type,id:`${t.id}${Os}${e}`}),Qu=(t,e,n)=>{if(ea(t))return t;const s=ta(t);return s!==null&&n.has(s.board)?t:na(t,e)},Zu=(t,e)=>`${t}${Os}${e}`,Yu="dpk-page",sa="board",ra="data-dpk-draft-board",zs=Symbol.for("dev-process-kit.board-host"),ia=t=>{if(t.parentElement?.localName!==Yu)return null;const e=t.getAttribute(sa);return e!==null&&Ps.test(e)?e:null},Ju=t=>{const e=t.parentElement;if(e===null||!(zs in e))return null;const n=e[zs];return Xu(n)?n:null},Xu=t=>typeof t=="object"&&t!==null&&"dispatch"in t&&"navigation"in t,oa="board",bn=t=>`${t}.`,Ms=(t,e)=>{const n=bn(e),s={};for(const[r,i]of Object.entries(t))r.startsWith(n)&&(s[r.slice(n.length)]=i);return s},ef=(t,e)=>Object.fromEntries(Object.entries(e).map(([n,s])=>[`${bn(t)}${n}`,s])),tf=(t,e,n,s,r=[])=>{const i={},o={};for(const[c,p]of Object.entries(n)){const u=c.indexOf(".");c===oa||u>0&&s.has(c.slice(0,u))?i[c]=p:o[c]=p}if(Object.keys(o).length===0)return i;const a=Ms(t,e),l=en(a,o,r),d={...i};for(const c of Object.keys(a))Object.hasOwn(l,c)||(d[`${bn(e)}${c}`]=null);for(const[c,p]of Object.entries(l))d[`${bn(e)}${c}`]=p;return d},aa=t=>{const e=t.derivation();return{base:e.base,state:e.state,navigation:t.navigation(),actions:t.controller().actions,comments:e.comments,stale:e.stale,issues:t.issues(),grill:e.grill,answers:e.answers}},nf=t=>{const e=t.derivation();return{state:e.state,base:e.base,navigation:t.navigation(),actions:t.controller().actions,comments:e.comments,stale:e.stale,commentCount:n=>{const s=typeof n=="string"?n:I(n);return e.commentsByTarget.get(s)?.length??0},dispatch:n=>t.dispatch(n),dispatchBatch:n=>t.dispatchBatch(n),navigate:(n,s)=>t.navigate(n,s),hashFor:n=>t.hashFor(n),requestComment:n=>t.requestComment(n)}},sf=(t,e)=>{const n=()=>aa(t);return{version:X,template:t.definition.name,host:e,ready:t.ready,get base(){return t.controller().base},get state(){return t.derivation().state},get navigation(){return t.navigation()},get actions(){return t.controller().actions},get comments(){return t.derivation().comments},get stale(){return t.derivation().stale},get issues(){return t.issues()},dispatch:s=>t.dispatch(s),dispatchBatch:s=>t.dispatchBatch(s),comment:(s,r)=>t.dispatch({type:B,target:s,payload:{body:r}}),editComment:(s,r)=>t.editComment(s,r),removeAction:s=>t.removeAction(s),clearActions:()=>t.clearActions(),importDraft:s=>t.controller().replaceActions(s),navigate:(s,r)=>t.navigate(s,r),hashFor:s=>t.hashFor(s),snapshot:n,exportDraft:()=>t.controller().exportDraft(X),exportBrief:()=>t.brief?.(n())??tn(n(),t.controller().definition,X),subscribe:s=>t.subscribe(s)}},Is=(t,e)=>({read(n){try{const s=t.getItem(n);return s===null?null:e(JSON.parse(s))}catch{return null}},write(n,s){try{return t.setItem(n,JSON.stringify(s)),!0}catch{return!1}},remove(n){try{t.removeItem(n)}catch{}}}),he=t=>{const e=new Map;return Is({getItem:n=>e.get(n)??null,setItem:(n,s)=>{e.set(n,s)},removeItem:n=>{e.delete(n)}},t)},Xe=t=>{try{if(typeof localStorage<"u")return Is(localStorage,t)}catch{}return he(t)},rf=t=>{try{if(typeof sessionStorage<"u")return Is(sessionStorage,t)}catch{}return he(t)},of=8e3,af=t=>t.localName==="script"&&t.getAttribute("type")==="application/json"&&t.hasAttribute(Ro);class lf{#e;#t;#n=null;#r=null;#s=null;#i=null;#o="";#a=null;#l=new Map;#d=new Set;constructor(e,n){this.#e=e,this.#t=n,e.addController(this)}get view(){return this.#n&&this.#s?iu(this.#n,this.#s):null}get error(){return this.#r}hostConnected(){!this.#m()&&!this.#y()&&this.#h(),document.addEventListener("pointerdown",this.#u,!0),document.addEventListener("keydown",this.#w)}hostUpdate(){!this.#m()&&this.#y()&&this.#A()}hostDisconnected(){this.#A(),document.removeEventListener("pointerdown",this.#u,!0),document.removeEventListener("keydown",this.#w);for(const e of this.#l.values())e.handle!==null&&clearTimeout(e.handle);this.#l.clear()}send(e){!this.#n||!this.#s||(this.#s=eu(this.#n,this.#s,e),this.#k(),this.#g(),this.#e.requestUpdate())}toggleList(){this.send({kind:this.#s?.list.open?"close-list":"open-list"})}show(e){const n=this.#n?wt(this.#n).flatMap(s=>s.entries).find(s=>s.key===e):void 0;n&&(this.send({kind:"jump",key:e}),this.#t.show(n))}pause(e){const n=this.#d.size>0;if(this.#d.add(e),n)return;const s=Date.now();for(const r of this.#l.values())r.handle!==null&&clearTimeout(r.handle),r.handle=null,r.remaining=Math.max(0,r.deadline-s)}resume(e){if(!(!this.#d.delete(e)||this.#d.size>0))for(const[n,s]of this.#l)this.#b(n,s)}#p(){return`${this.#t.storageKey()}:seen-changes`}#m(){return this.#n!==null||this.#r!==null}#y(){const e=[...this.#e.children].find(af);if(!e)return!1;let n;try{n=JSON.parse(e.textContent??"")}catch(r){return this.#v(r instanceof Error?r.message:String(r))}const s=Zh(n);return s.ok?(this.#n=s.log,this.#i=this.#t.persist()?Xe(Oo):he(Oo),this.#s=Xh(s.log,this.#i.read(this.#p())),this.#k(),this.#g(),this.#e.requestUpdate(),!0):this.#v(s.error)}#k(){if(!this.#n||!this.#s)return;const e=nu(this.#n,this.#s),n=JSON.stringify(e);n!==this.#o&&(this.#o=n,this.#i?.write(this.#p(),e))}#v(e){return console.error("[dev-process-kit] invalid change log:",e),this.#r=e,this.#e.requestUpdate(),!0}#h(){this.#a=new MutationObserver(()=>{(this.#m()||this.#y())&&this.#A()}),this.#a.observe(this.#e,{childList:!0})}#A(){this.#a?.disconnect(),this.#a=null}#g(){const e=new Set(this.view?.toasts.map(n=>n.key)??[]);for(const[n,s]of this.#l)e.has(n)||(s.handle!==null&&clearTimeout(s.handle),this.#l.delete(n));for(const n of e){if(this.#l.has(n))continue;const s={handle:null,deadline:0,remaining:of};this.#l.set(n,s),this.#d.size===0&&this.#b(n,s)}}#b(e,n){n.deadline=Date.now()+n.remaining,n.handle=setTimeout(()=>{n.handle=null,this.send({kind:"close-toast",key:e})},n.remaining)}#u=e=>{!this.#s?.list.open||this.#t.inside(e.composedPath())||this.send({kind:"close-list"})};#w=e=>{e.key!=="Escape"||!this.#s?.list.open||this.send({kind:"close-list"})}}const vn="dpk-changes",cf=(t,e,n)=>{const s=t.unread>0?e.changesUnread(t.unread):e.changes;return m`<button
|
|
1403
|
+
`,Bh=t=>{const e=[...document.body.querySelectorAll("*")].filter(n=>n.localName.startsWith("dpk-template-")&&!n.querySelector(`:scope > .${ws}`));if(e.length!==0){document.head.append(Object.assign(document.createElement("style"),{textContent:qh}));for(const n of e)n.append(Hh(n,t))}},Hh=(t,e)=>{const n=L(It(Mt(t))),s=document.createElement("select");s.className=ws,s.slot="header",s.setAttribute("aria-label",n.versionLabel),s.title=n.versionLabel;const r=o=>{const a=Co({current:e,requested:ys(location.search)!==null,published:o,text:{pinned:n.versionPinned,latest:n.versionLatest}});s.replaceChildren(...a.options.map(l=>Object.assign(document.createElement("option"),{value:l.value,textContent:l.label}))),s.value=a.value},i=()=>{Eo().then(r,o=>console.warn(o))};return s.addEventListener("pointerenter",i,{once:!0}),s.addEventListener("focus",i,{once:!0}),s.addEventListener("change",()=>Ro(s.value===""?null:s.value)),r(null),s},Uh=O({value:v()}),Fh=t=>e=>{if(!(e instanceof CustomEvent))return;const n=C(Uh,e.detail);n.success&&t(n.output.value)},$s=t=>e=>{const n=Ee(e.target,HTMLSelectElement);n!==null&&t(n.value)},Wh=t=>e=>{const n=Ee(e.target,HTMLInputElement);n!==null&&t(n.value,n)},Gh=t=>e=>{const n=Ee(e.target,HTMLInputElement);n!==null&&t(n.checked)},_o="data-dpk-changes",Vh=/^[^:\s]+:\S+$/,Kh=z({id:D(y(v(),$(1))),title:y(v(),$(1)),body:D(v()),target:D(y(v(),te(Vh,'target must be written "type:id"'))),navigate:D(y(v(),ei("=",'navigate must be written "key=value"')))}),Qh=j(Kh),Zh=y(v(),$(1)),Oo=z({revision:Zh,changes:Qh}),Yh=z({revisions:y(j(Oo),$(1,"list at least one version"))}),Jh=(t,e)=>JSON.stringify([t,e]),$t=t=>[...t.earlier,t.latest],Xh=t=>{const e=t.changes.map((s,r)=>{const i=s.id??String(r);return{key:Jh(t.revision,i),id:i,revision:t.revision,title:s.title,body:s.body??null,target:s.target??null,navigate:s.navigate??null}});return new Set(e.map(s=>s.id)).size!==e.length?`change ids must be unique within version "${t.revision}"`:{revision:t.revision,entries:e}},eu=t=>{const e=typeof t=="object"&&t!==null&&"revisions"in t,n=C(e?Yh:Oo,t);if(!n.success)return{ok:!1,error:Fc(n.issues)};const s=n.output,r="revisions"in s?s.revisions:[s],i=[];for(const a of r){if(i.some(d=>d.revision===a.revision))return{ok:!1,error:`version "${a.revision}" is listed twice`};const l=Xh(a);if(typeof l=="string")return{ok:!1,error:l};i.push(l)}const o=i.pop();return o?{ok:!0,log:{earlier:i,latest:o}}:{ok:!1,error:"list at least one version"}},tu=z({v:G(1),revision:v(),seen:j(v())}),nu=z({v:G(2),since:v(),seen:Ge(v(),j(v()))}),Lo=t=>{const e=C(nu,t);if(e.success)return e.output;const n=C(tu,t);return n.success?{v:2,since:n.output.revision,seen:{[n.output.revision]:n.output.seen}}:null},Ss={open:!1,fresh:new Set},Po=t=>e=>t.told.has(e.revision)&&!t.seen.has(e.key),As=(t,e)=>$t(t).flatMap(n=>n.entries.filter(Po(e))),zo=t=>t.target!==null||t.navigate!==null,su=(t,e)=>{const n=$t(t),s=e===null?-1:n.findIndex(o=>o.revision===e.since),r=e===null?[t.latest]:n.slice(Math.max(0,s)),i=new Set(r.flatMap(o=>{const a=new Set(e?.seen[o.revision]??[]);return o.entries.filter(l=>a.has(l.id)).map(l=>l.key)}));return{told:new Set(r.map(o=>o.revision)),seen:i,toasts:t.latest.entries.filter(o=>!i.has(o.key)).map(o=>o.key),list:Ss}},Ts=(t,e)=>new Set([...t.seen,...e]),ru=(t,e,n)=>{switch(n.kind){case"open-list":{const s=As(t,e),r=new Set(s.map(o=>o.key)),i=s.filter(o=>!zo(o)).map(o=>o.key);return{...e,seen:Ts(e,i),toasts:[],list:{open:!0,fresh:r}}}case"close-list":return{...e,list:Ss};case"close-toast":return{...e,toasts:e.toasts.filter(s=>s!==n.key)};case"jump":return{...e,seen:Ts(e,[n.key]),toasts:e.toasts.filter(s=>s!==n.key),list:Ss};case"read-all":return{...e,seen:Ts(e,As(t,e).map(s=>s.key)),toasts:[],list:{open:e.list.open,fresh:new Set}}}},iu=(t,e)=>As(t,e).length,ou=(t,e)=>{const n=$t(t),s=n.findIndex(o=>e.told.has(o.revision)&&o.entries.some(Po(e))),r=s===-1?n.length-1:s,i=n.slice(r).flatMap(o=>{const a=o.entries.filter(l=>e.seen.has(l.key)).map(l=>l.id);return a.length>0?[[o.revision,a]]:[]});return{v:2,since:n[r]?.revision??t.latest.revision,seen:Object.fromEntries(i)}},au=(t,e)=>t.target===null&&t.navigate===null?null:{navigate:t.navigate!==null?Xt(t.navigate):t.target!==null?e(ut(t.target)):null,target:t.target},Mo=3,lu=t=>e=>({key:e.key,id:e.id,revision:e.revision,title:e.title,body:e.body,jumpable:zo(e),fresh:t.list.fresh.has(e.key)}),cu=(t,e)=>{const n=$t(t).map(i=>({revision:i.revision,latest:i===t.latest,cards:i.entries.map(lu(e))})).reverse(),s=new Map(n.flatMap(i=>i.cards.map(o=>[o.key,o]))),r=e.toasts.flatMap(i=>{const o=s.get(i);return o?[o]:[]});return{unread:iu(t,e),open:e.list.open,groups:n,toasts:r.slice(0,Mo),waiting:Math.max(0,r.length-Mo)}},St=t=>t==="light"||t==="dark"?t:null,Io=t=>t.authored??t.environment,No=t=>t.preference??Io(t),du=t=>{const e=No(t)==="dark"?"light":"dark";return e===Io(t)?null:e},Do=j(z({value:y(v(),te(/^element:.+/)),label:y(v(),$(1)),group:B(v())})),pu=O({targets:Do,providers:j(O({id:y(v(),$(1)),results:j(xi)}))}),hu=z({target:y(v(),te(/^element:.+/)),body:y(v(),Yn(),$(1))}),jo=t=>t.group?`${t.group} \xB7 ${t.label}`:t.label,uu=(t,e,n)=>{const s=new Map(e.map(r=>[r.value,r]));return{...t,hasTarget:(r,i)=>t.hasTarget(r,i)||s.has(I(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(ne(r)){const d=n.get(r.id),c=s.get(I(r.target));return{title:d?.title??r.type,...d?.summary===void 0?{}:{summary:d.summary},tone:d?.tone??"update",targetLabel:c?jo(c):r.target.id}}const a=t.describe(r,i,o),l=r.type==="comment"&&!t.hasTarget(i,r.target)?s.get(I(r.target)):void 0;return l===void 0?a:{...a,targetLabel:jo(l)}},serialize:r=>ne(r)?`${r.type} ${I(r.target)} ${JSON.stringify(r.payload)}`:t.serialize(r)}},qo=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function Bo(t){return typeof qo.Buffer<"u"&&qo.Buffer.isBuffer(t)}function Ho(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 Uo(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function Fo(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const fu="[object RegExp]",gu="[object String]",mu="[object Number]",ku="[object Boolean]",bu="[object Symbol]",vu="[object Date]",xu="[object Map]",yu="[object Set]",wu="[object Array]",$u="[object Function]",Su="[object ArrayBuffer]",Cs="[object Object]",Au="[object Error]",Tu="[object DataView]",Cu="[object Uint8Array]",Eu="[object Uint8ClampedArray]",Ru="[object Uint16Array]",_u="[object Uint32Array]",Ou="[object BigUint64Array]",Lu="[object Int8Array]",Pu="[object Int16Array]",zu="[object Int32Array]",Mu="[object BigInt64Array]",Iu="[object Float32Array]",Nu="[object Float64Array]";function Du(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function ju(t,e,n){return At(t,e,void 0,void 0,void 0,void 0,n)}function At(t,e,n,s,r,i,o){const a=o(t,e,n,s,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 Tt(t,e,i,o)}return Tt(t,e,i,o)}function Tt(t,e,n,s){if(Object.is(t,e))return!0;let r=Fo(t),i=Fo(e);if(r==="[object Arguments]"&&(r=Cs),i==="[object Arguments]"&&(i=Cs),r!==i)return!1;switch(r){case gu:return t.toString()===e.toString();case mu:return Du(t.valueOf(),e.valueOf());case ku:case vu:case bu:return Object.is(t.valueOf(),e.valueOf());case fu:return t.source===e.source&&t.flags===e.flags;case $u:return t===e}n=n??new Map;const o=n.get(t),a=n.get(e);if(o!=null&&a!=null)return o===e;n.set(t,e),n.set(e,t);try{switch(r){case xu:if(t.size!==e.size)return!1;for(const[l,d]of t.entries())if(!e.has(l)||!At(d,e.get(l),l,t,e,n,s))return!1;return!0;case yu:{if(t.size!==e.size)return!1;const l=Array.from(t.values()),d=Array.from(e.values());for(let c=0;c<l.length;c++){const p=l[c],u=d.findIndex(h=>At(p,h,void 0,t,e,n,s));if(u===-1)return!1;d.splice(u,1)}return!0}case wu:case Cu:case Eu:case Ru:case _u:case Ou:case Lu:case Pu:case zu:case Mu:case Iu:case Nu:if(Bo(t)!==Bo(e)||t.length!==e.length)return!1;for(let l=0;l<t.length;l++)if(!At(t[l],e[l],l,t,e,n,s))return!1;return!0;case Su:return t.byteLength!==e.byteLength?!1:Tt(new Uint8Array(t),new Uint8Array(e),n,s);case Tu:return t.byteLength!==e.byteLength||t.byteOffset!==e.byteOffset?!1:Tt(new Uint8Array(t),new Uint8Array(e),n,s);case Au:return t.name===e.name&&t.message===e.message;case Cs:{if(!(Tt(t.constructor,e.constructor,n,s)||Ho(t)&&Ho(e)))return!1;const l=[...Object.keys(t),...Uo(t)],d=[...Object.keys(e),...Uo(e)];if(l.length!==d.length)return!1;for(let c=0;c<l.length;c++){const p=l[c],u=t[p];if(!Object.hasOwn(e,p))return!1;const h=e[p];if(!At(u,h,p,t,e,n,s))return!1}return!0}default:return!1}}finally{n.delete(t),n.delete(e)}}function qu(){}function mn(t,e){return ju(t,e,qu)}const Es="page",Wo=t=>I(t),Go=(t,e,n,s=new Map,r=Ve)=>{let i=e,o={};const a=[],l=[],d=[],c=[],p=new Map;for(const h of n){if(h.type===H)continue;if(ne(h)){const b=s.get(h.id);b===void 0||b.stale!==void 0?l.push({action:h,reason:b?.stale??"target-missing"}):a.push(h);continue}if(Q(h)){const b=_i(r,o,h);b===null?l.push({action:h,reason:Ke(r,h.target.id)?"constraint-violated":"target-missing"}):b===o?d.push(h):(o=b,a.push(h));continue}const f=ht(t.actions,h.type);if(!f){l.push({action:h,reason:"unsupported-action-type"});continue}const g=t.apply(i,h);if(g===null){l.push({action:h,reason:t.hasTarget(i,h.target)?"constraint-violated":"target-missing"});continue}if(f.mode!=="append"&&Rs(t,i,g)){d.push(h);continue}i=g,a.push(h)}for(const h of n){if(h.type!==H)continue;if(!(h.target.type===Es?t.pageTargetExists?.(i,h.target)??!0:t.hasTarget(i,h.target))){l.push({action:h,reason:"target-missing"});continue}c.push(h);const g=Wo(h.target);p.set(g,[...p.get(g)??[],h])}const u=new Map(n.map((h,f)=>[h.id,f]));return l.sort((h,f)=>(u.get(h.action.id)??0)-(u.get(f.action.id)??0)),{base:e,state:i,actions:n,applied:a,stale:l,obsolete:d,comments:c,commentsByTarget:p,grill:r,answers:o}},Rs=(t,e,n)=>e===n?!0:t.canonicalState===void 0?mn(e,n):mn(t.canonicalState(e),t.canonicalState(n)),Vo=t=>{const e=new Set(t.obsolete.map(n=>n.id));return t.actions.filter(n=>!e.has(n.id))},Bu=(t,e,n,s)=>{let r=e;const i=s??Ko(r).map(o=>o.id);for(const o of[...i].reverse())r=Hu(t,r,n,o,s!==void 0)??r;return r},Ko=t=>t.applied.filter(e=>!ne(e)&&!Q(e)),Hu=(t,e,n,s,r)=>{const i=Ko(e),o=i.findIndex(u=>u.id===s),a=i[o];if(a===void 0)return null;const l=i.slice(0,o),d=[...r?Uu(t,e.base,i,o):[],...Fu(t,l,a)],c=new Set,p=d.filter(u=>{const h=u.join(" ");return c.has(h)?!1:(c.add(h),!0)}).sort((u,h)=>h.length-u.length);for(const u of p){const h=Wu(t,e,n,u);if(h!==null)return h}return null},Uu=(t,e,n,s)=>{const r=[];let i=e;for(const o of n.slice(0,s+1))r.push(i),i=t.apply(i,o)??i;return r.flatMap((o,a)=>Rs(t,o,i)?[n.slice(a,s+1).map(l=>l.id)]:[])},Fu=(t,e,n)=>{const s=Qo(n),r=e.filter(l=>Qo(l).some(d=>s.includes(d))),i=Zo(t,n),o=r.filter(l=>Zo(t,l)===i),a=l=>l.map((d,c)=>[...l.slice(c).map(p=>p.id),n.id]);return[...a(r),...a(o),...r.map(l=>[l.id,n.id]),...r.map(l=>[l.id])]},Qo=t=>{const e=t.target.type===Es?[]:t.target.id.split("."),n=typeof t.payload=="object"&&t.payload!==null?Object.values(t.payload).filter(s=>typeof s=="string"&&s!==""):[];return[...e,...n]},Zo=(t,e)=>ht(t.actions,e.type)?.mode,Wu=(t,e,n,s)=>{const r=new Set(e.stale.map(o=>o.action.id)),i=new Set(s);for(;;){const o=n(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 Rs(t,o.state,e.state)?o:null;if(a.some(l=>l.type===H||ne(l)||Q(l)))return null;for(const l of a)i.add(l.id)}},Gu=(t,e,n)=>{const s=Ri(n);if(s===null)return{title:n.type,tone:"meta"};if(s.kind==="clear")return{title:t.grillAnswerClear,tone:"delete"};if(s.kind==="option"){const r=Ke(e,n.target.id)?.options.find(i=>i.id===s.optionId);return{title:t.grillAnswer,tone:"update",summary:t.grillQuoted(r?.label??s.optionId)}}return{title:t.grillAnswerFree,tone:"update",summary:t.grillQuoted(s.text.slice(0,120))}},Vu=(t,e)=>{const{grill:n}=e,s=L(e.locale);return{...t,hasTarget:(r,i)=>i.type===se?Ke(n,i.id)!==void 0:t.hasTarget(r,i),commentTargets:(r,i)=>[...t.commentTargets(r,i),...n.questions.map(o=>({value:I({type:se,id:o.id}),label:as(n,o.id),group:s.grillGroup}))],describe:(r,i,o)=>{const a=as(n,r.target.id);if(Q(r)){const{title:d,summary:c,tone:p}=Gu(s,n,r);return{title:d,tone:p,targetLabel:a,...c===void 0?{}:{summary:c}}}const l=t.describe(r,i,o);return r.target.type===se?{...l,targetLabel:a}:l},serialize:r=>Q(r)?`${r.type} ${I(r.target)} ${JSON.stringify(r.payload)}`:t.serialize(r)}},Ku=O({v:G(1),template:y(v(),$(1)),actions:j(ve())});class _s{constructor(e){this.storage=e}load(e,n){try{const s=this.storage.getItem(e);if(s===null)return[];const r=C(Ku,JSON.parse(s));return!r.success||r.output.template!==n?[]:r.output.actions.flatMap(i=>{const o=C(Pe,i);return o.success?[o.output]:[]})}catch{return[]}}save(e,n,s){const r={v:1,template:n,actions:s};try{this.storage.setItem(e,JSON.stringify(r))}catch{}}clear(e){try{this.storage.removeItem(e)}catch{}}}class Os{constructor(){this.store=new Map}load(e,n){return new _s({getItem:s=>this.store.get(s)??null,setItem:(s,r)=>{this.store.set(s,r)},removeItem:s=>{this.store.delete(s)}}).load(e,n)}save(e,n,s){this.store.set(e,JSON.stringify({v:1,template:n,actions:s}))}clear(e){this.store.delete(e)}}const Ls=()=>{try{if(typeof localStorage<"u")return new _s(localStorage)}catch{}return new Os},kn=t=>`dev-process-kit:draft:${typeof location>"u"?"local":`${location.pathname}${location.search}`}:${t}`,Qu=j(ve());class Yo{#e;#t;#n={targets:[],providers:[]};#r;#s=new Map;#i;#o;#a;#l;#p;#h=new Set;#m=[];#y=0;constructor(e){this.#e=e.definition,this.#r=e.grill??{grill:Ve,locale:"en"},this.#t=this.#v(),this.#i=e.base,this.#p=e.storageKey??kn(e.definition.name),this.#l=e.storage===void 0?Ls():e.storage;const n=e.initialActions??this.#l?.load(this.#p,this.definition.name)??[];this.#o=ea(this.definition,n),this.#a=this.#u(this.#o),this.#f()&&this.#E()}get definition(){return this.#t}setComponentSnapshot(e){const n=Vt(pu,e);if(!mn(n,this.#n)){this.#n=n,this.#k(),this.#a=this.#u(this.#o);for(const s of this.#h)s()}}setTemplate(e){this.#e=e,this.#k(),this.#a=this.#u(this.#o);for(const n of this.#h)n()}setGrill(e){this.#r=e,this.#k(),this.#a=this.#u(this.#o);for(const n of this.#h)n()}#k(){this.#s=yi(this.#o,this.#n.providers),this.#t=this.#v()}#v(){return Vu(uu(this.#e,this.#n.targets,this.#s),this.#r)}#u(e){return Go(this.definition,this.#i,e,yi(e,this.#n.providers),this.#r.grill)}get base(){return this.#i}get actions(){return this.#o}get derivation(){return this.#a}get lastIssues(){return this.#m}get prunedCount(){return this.#y}descriptorFor(e,n){return Jo(this.definition,e,n)}dispatch(e){const n=this.#A(e,this.#a.state);if(!n.ok)return this.#g([n.issue]);const s=this.descriptorFor(n.action.type,n.action.target);return s?(this.#b(Xo(this.#o,n.action,s),[n.action.id]),{ok:!0,id:n.action.id}):this.#g([{path:"type",message:"unknown action type"}])}dispatchBatch(e){const n=C(Qu,e);if(!n.success)return this.#g([ze(n.issues)]);const s=n.output;if(s.length===0)return{ok:!0,ids:[]};let r=this.#o,i=this.#a.state,o=this.#a.answers;const a=[];for(const l of s){const d=this.#A(l,i);if(!d.ok)return this.#g([d.issue]);const c=d.action,p=this.descriptorFor(c.type,c.target);if(!p)return this.#g([{path:"type",message:"unknown action type"}]);if((Q(c)?_i(this.#r.grill,o,c)===null?null:i:c.type==="comment"||ne(c)?c.target.type==="page"||this.definition.hasTarget(i,c.target)?i:null:this.definition.apply(i,c))===null)return this.#g([{path:"target",message:"batch action is not applicable"}]);r=Xo(r,c,p);const h=this.#u(r);i=h.state,o=h.answers,a.push(c.id)}return this.#b(r,a),{ok:!0,ids:a}}#A(e,n){const s=C(gi,e);if(!s.success)return{ok:!1,issue:ze(s.issues)};const r=this.descriptorFor(s.output.type,typeof s.output.target=="string"?Qt(s.output.target,"page"):s.output.target);if(!r)return{ok:!1,issue:{path:"type",message:`unknown action type "${s.output.type}"`}};const i=ed(s.output,r);if(!i.ok)return i;const o=this.definition.canonicalTarget?.(n,i.action.target)??i.action.target;return{ok:!0,action:{...i.action,target:o}}}#g(e){return this.#m=e,{ok:!1,issues:e}}editComment(e,n){const s=this.#o.find(a=>a.id===e);if(s?.type!==H)return this.#g([{path:"id",message:`no comment "${e}" in the draft`}]);if(ft(s)===n)return{ok:!0,id:e};const r=C(ss.schema,{...s,payload:{body:n}});if(!r.success)return this.#g([ze(r.issues)]);const i=C(Pe,r.output);if(!i.success)return this.#g([ze(i.issues)]);const o=i.output;return this.#b(this.#o.map(a=>a===s?o:a),[]),{ok:!0,id:e}}removeAction(e){const n=this.#o.filter(s=>s.id!==e);n.length!==this.#o.length&&this.#b(n)}clearActions(){this.#o.length>0&&this.#b([])}replaceActions(e){this.#b(ea(this.definition,e))}setBase(e){this.#i=e,this.#b(this.#o)}subscribe(e){return this.#h.add(e),()=>{this.#h.delete(e)}}exportDraft(e){return{template:this.definition.name,frameworkVersion:e,exportedAt:new Date().toISOString(),actions:this.#o}}#b(e,n){this.#m=[],this.#o=e,this.#k(),this.#a=this.#u(this.#o),this.#f(n),this.#E();for(const s of this.#h)s()}#f(e){const n=this.#w(),s=Bu(this.definition,this.#a,r=>this.#u(r),e);return s===this.#a?n:(this.#y+=this.#o.length-s.actions.length,this.#o=[...s.actions],this.#k(),this.#a=this.#u(this.#o),this.#w(),!0)}#w(){return this.#a.obsolete.length===0?!1:(this.#y+=this.#a.obsolete.length,this.#o=Vo(this.#a),this.#k(),this.#a=this.#u(this.#o),!0)}#E(){this.#l?.save(this.#p,this.definition.name,this.#o)}}const Jo=(t,e,n)=>e==="comment"?ss:e===Zt?xd:n!==void 0&&ne({type:e,target:n})?id:t.actionFor?t.actionFor(e,n):ht(t.actions,e),Xo=(t,e,n)=>Q(e)?wd(t,e):mi(t,e,n),ea=(t,e)=>e.flatMap(n=>{const s=C(Pe,n);if(!s.success)return[];const r=s.output,i=Jo(t,r.type,r.target);if(!i)return[];const o=C(i.schema,r);if(!o.success)return[];const a=C(Pe,o.output);return a.success?[a.output]:[]}),Zu=()=>({status:{kind:"idle"},request:0}),Yu=(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}},Ju=(t,e)=>{if(t.actions===0||t.railOpen)return null;const n=L(t.locale),s=e.status;return{send:t.sendable?{label:s.kind==="sending"?n.handoffSending:s.kind==="sent"?n.handoffSent:n.handoffSend,disabled:s.kind==="sending"}:null,copy:s.kind==="copied"?{label:n.handoffCopied,status:"copied"}:s.kind==="copy-failed"?{label:n.handoffCopyFailed,status:"failed"}:{label:n.handoffCopy,status:"idle"},note:s.kind==="send-failed"?Mi(s.reason,t.locale):null}},bn="@",Ps=Object.freeze({type:Es,id:"page"}),zs=/^[A-Za-z0-9_-]+$/,ta=t=>t.type===Ps.type&&t.id===Ps.id,na=t=>{const e=t.id.lastIndexOf(bn);if(e<0)return null;const n=t.id.slice(e+1);return zs.test(n)?{board:n,target:{type:t.type,id:t.id.slice(0,e)}}:null},sa=(t,e)=>({type:t.type,id:`${t.id}${bn}${e}`}),Xu=(t,e,n)=>{if(ta(t))return t;const s=na(t);return s!==null&&n.has(s.board)?t:sa(t,e)},ef=(t,e)=>`${t}${bn}${e}`,tf="dpk-page",ra="board",ia="data-dpk-draft-board",Ms=Symbol.for("dev-process-kit.board-host"),oa=t=>{if(t.parentElement?.localName!==tf)return null;const e=t.getAttribute(ra);return e!==null&&zs.test(e)?e:null},nf=t=>{const e=t.parentElement;if(e===null||!(Ms in e))return null;const n=e[Ms];return sf(n)?n:null},sf=t=>typeof t=="object"&&t!==null&&"dispatch"in t&&"navigation"in t,aa="board",vn=t=>`${t}.`,Is=(t,e)=>{const n=vn(e),s={};for(const[r,i]of Object.entries(t))r.startsWith(n)&&(s[r.slice(n.length)]=i);return s},rf=(t,e)=>Object.fromEntries(Object.entries(e).map(([n,s])=>[`${vn(t)}${n}`,s])),of=(t,e,n,s,r=[])=>{const i={},o={};for(const[c,p]of Object.entries(n)){const u=c.indexOf(".");c===aa||u>0&&s.has(c.slice(0,u))?i[c]=p:o[c]=p}if(Object.keys(o).length===0)return i;const a=Is(t,e),l=en(a,o,r),d={...i};for(const c of Object.keys(a))Object.hasOwn(l,c)||(d[`${vn(e)}${c}`]=null);for(const[c,p]of Object.entries(l))d[`${vn(e)}${c}`]=p;return d},la=t=>{const e=t.derivation();return{base:e.base,state:e.state,navigation:t.navigation(),actions:t.controller().actions,comments:e.comments,stale:e.stale,issues:t.issues(),grill:e.grill,answers:e.answers}},af=t=>{const e=t.derivation();return{state:e.state,base:e.base,navigation:t.navigation(),actions:t.controller().actions,comments:e.comments,stale:e.stale,commentCount:n=>{const s=typeof n=="string"?n:I(n);return e.commentsByTarget.get(s)?.length??0},dispatch:n=>t.dispatch(n),dispatchBatch:n=>t.dispatchBatch(n),navigate:(n,s)=>t.navigate(n,s),hashFor:n=>t.hashFor(n),requestComment:n=>t.requestComment(n)}},lf=(t,e)=>{const n=()=>la(t);return{version:X,template:t.definition.name,host:e,ready:t.ready,get base(){return t.controller().base},get state(){return t.derivation().state},get navigation(){return t.navigation()},get actions(){return t.controller().actions},get comments(){return t.derivation().comments},get stale(){return t.derivation().stale},get issues(){return t.issues()},dispatch:s=>t.dispatch(s),dispatchBatch:s=>t.dispatchBatch(s),comment:(s,r)=>t.dispatch({type:H,target:s,payload:{body:r}}),editComment:(s,r)=>t.editComment(s,r),removeAction:s=>t.removeAction(s),clearActions:()=>t.clearActions(),importDraft:s=>t.controller().replaceActions(s),navigate:(s,r)=>t.navigate(s,r),hashFor:s=>t.hashFor(s),snapshot:n,exportDraft:()=>t.controller().exportDraft(X),exportBrief:()=>t.brief?.(n())??tn(n(),t.controller().definition,X),subscribe:s=>t.subscribe(s)}},Ns=(t,e)=>({read(n){try{const s=t.getItem(n);return s===null?null:e(JSON.parse(s))}catch{return null}},write(n,s){try{return t.setItem(n,JSON.stringify(s)),!0}catch{return!1}},remove(n){try{t.removeItem(n)}catch{}}}),he=t=>{const e=new Map;return Ns({getItem:n=>e.get(n)??null,setItem:(n,s)=>{e.set(n,s)},removeItem:n=>{e.delete(n)}},t)},Xe=t=>{try{if(typeof localStorage<"u")return Ns(localStorage,t)}catch{}return he(t)},cf=t=>{try{if(typeof sessionStorage<"u")return Ns(sessionStorage,t)}catch{}return he(t)},df=8e3,pf=t=>t.localName==="script"&&t.getAttribute("type")==="application/json"&&t.hasAttribute(_o);class hf{#e;#t;#n=null;#r=null;#s=null;#i=null;#o="";#a=null;#l=new Map;#p=new Set;constructor(e,n){this.#e=e,this.#t=n,e.addController(this)}get view(){return this.#n&&this.#s?cu(this.#n,this.#s):null}get error(){return this.#r}hostConnected(){!this.#m()&&!this.#y()&&this.#u(),document.addEventListener("pointerdown",this.#f,!0),document.addEventListener("keydown",this.#w)}hostUpdate(){!this.#m()&&this.#y()&&this.#A()}hostDisconnected(){this.#A(),document.removeEventListener("pointerdown",this.#f,!0),document.removeEventListener("keydown",this.#w);for(const e of this.#l.values())e.handle!==null&&clearTimeout(e.handle);this.#l.clear()}send(e){!this.#n||!this.#s||(this.#s=ru(this.#n,this.#s,e),this.#k(),this.#g(),this.#e.requestUpdate())}toggleList(){this.send({kind:this.#s?.list.open?"close-list":"open-list"})}show(e){const n=this.#n?$t(this.#n).flatMap(s=>s.entries).find(s=>s.key===e):void 0;n&&(this.send({kind:"jump",key:e}),this.#t.show(n))}pause(e){const n=this.#p.size>0;if(this.#p.add(e),n)return;const s=Date.now();for(const r of this.#l.values())r.handle!==null&&clearTimeout(r.handle),r.handle=null,r.remaining=Math.max(0,r.deadline-s)}resume(e){if(!(!this.#p.delete(e)||this.#p.size>0))for(const[n,s]of this.#l)this.#b(n,s)}#h(){return`${this.#t.storageKey()}:seen-changes`}#m(){return this.#n!==null||this.#r!==null}#y(){const e=[...this.#e.children].find(pf);if(!e)return!1;let n;try{n=JSON.parse(e.textContent??"")}catch(r){return this.#v(r instanceof Error?r.message:String(r))}const s=eu(n);return s.ok?(this.#n=s.log,this.#i=this.#t.persist()?Xe(Lo):he(Lo),this.#s=su(s.log,this.#i.read(this.#h())),this.#k(),this.#g(),this.#e.requestUpdate(),!0):this.#v(s.error)}#k(){if(!this.#n||!this.#s)return;const e=ou(this.#n,this.#s),n=JSON.stringify(e);n!==this.#o&&(this.#o=n,this.#i?.write(this.#h(),e))}#v(e){return console.error("[dev-process-kit] invalid change log:",e),this.#r=e,this.#e.requestUpdate(),!0}#u(){this.#a=new MutationObserver(()=>{(this.#m()||this.#y())&&this.#A()}),this.#a.observe(this.#e,{childList:!0})}#A(){this.#a?.disconnect(),this.#a=null}#g(){const e=new Set(this.view?.toasts.map(n=>n.key)??[]);for(const[n,s]of this.#l)e.has(n)||(s.handle!==null&&clearTimeout(s.handle),this.#l.delete(n));for(const n of e){if(this.#l.has(n))continue;const s={handle:null,deadline:0,remaining:df};this.#l.set(n,s),this.#p.size===0&&this.#b(n,s)}}#b(e,n){n.deadline=Date.now()+n.remaining,n.handle=setTimeout(()=>{n.handle=null,this.send({kind:"close-toast",key:e})},n.remaining)}#f=e=>{!this.#s?.list.open||this.#t.inside(e.composedPath())||this.send({kind:"close-list"})};#w=e=>{e.key!=="Escape"||!this.#s?.list.open||this.send({kind:"close-list"})}}const xn="dpk-changes",uf=(t,e,n)=>{const s=t.unread>0?e.changesUnread(t.unread):e.changes;return m`<button
|
|
1404
1404
|
class="dpk-bell"
|
|
1405
1405
|
type="button"
|
|
1406
|
-
aria-controls=${
|
|
1406
|
+
aria-controls=${xn}
|
|
1407
1407
|
aria-expanded=${t.open?"true":"false"}
|
|
1408
1408
|
aria-label=${s}
|
|
1409
1409
|
title=${s}
|
|
1410
1410
|
@click=${n.toggleList}
|
|
1411
1411
|
>
|
|
1412
|
-
${
|
|
1413
|
-
</button>`},
|
|
1412
|
+
${Yi()} ${t.unread>0?m`<span class="dpk-bell-badge" aria-hidden="true">${t.unread}</span>`:k}
|
|
1413
|
+
</button>`},ca=(t,e,n)=>t.jumpable?m`<button class="dpk-btn dpk-btn--accent dpk-notice-show" type="button" @click=${()=>n.show(t.key)}>
|
|
1414
1414
|
${e.changesShow}
|
|
1415
|
-
</button>`:k,
|
|
1415
|
+
</button>`:k,da=(t,e,n,s)=>s==="list"||t.unread>0?m`<button
|
|
1416
1416
|
class=${s==="list"?"dpk-btn dpk-changes-read-all":"dpk-toast-more dpk-changes-read-all"}
|
|
1417
1417
|
type="button"
|
|
1418
1418
|
aria-disabled=${t.unread>0?"false":"true"}
|
|
1419
1419
|
@click=${n.readAll}
|
|
1420
1420
|
>
|
|
1421
1421
|
${e.changesReadAll}
|
|
1422
|
-
</button>`:k,
|
|
1422
|
+
</button>`:k,ff=(t,e,n)=>m`<section class="dpk-changes-group" data-revision=${t.revision}>
|
|
1423
1423
|
<h3 class="dpk-changes-revision">
|
|
1424
1424
|
<span>${t.revision}</span>
|
|
1425
1425
|
${t.latest?m`<span class="dpk-changes-current">${e.changesCurrent}</span>`:k}
|
|
@@ -1434,16 +1434,16 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1434
1434
|
<p class="dpk-change-title">
|
|
1435
1435
|
${s.fresh?m`<span class="dpk-change-new">${e.changesNew}</span>`:k} ${s.title}
|
|
1436
1436
|
</p>
|
|
1437
|
-
${s.body===null?k:m`<p class="dpk-change-body">${s.body}</p>`} ${
|
|
1437
|
+
${s.body===null?k:m`<p class="dpk-change-body">${s.body}</p>`} ${ca(s,e,n)}
|
|
1438
1438
|
</li>`)}
|
|
1439
1439
|
</ol>
|
|
1440
|
-
</section>`,
|
|
1440
|
+
</section>`,gf=(t,e,n)=>t.open?m`<div id=${xn} class="dpk-changes" popover="manual" role="dialog" aria-label=${e.changesTitle}>
|
|
1441
1441
|
<div class="dpk-changes-head">
|
|
1442
1442
|
<h2 class="dpk-changes-title">${e.changesTitle}</h2>
|
|
1443
|
-
${
|
|
1443
|
+
${da(t,e,n,"list")}
|
|
1444
1444
|
</div>
|
|
1445
|
-
${Me(t.groups,s=>s.revision,s=>
|
|
1446
|
-
</div>`:k,
|
|
1445
|
+
${Me(t.groups,s=>s.revision,s=>ff(s,e,n))}
|
|
1446
|
+
</div>`:k,mf=(t,e,n)=>m`<section
|
|
1447
1447
|
class="dpk-toasts"
|
|
1448
1448
|
aria-live="polite"
|
|
1449
1449
|
aria-label=${e.changes}
|
|
@@ -1453,12 +1453,12 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1453
1453
|
@focusout=${()=>n.resume("focus")}
|
|
1454
1454
|
>
|
|
1455
1455
|
${Me(t.toasts,s=>s.key,s=>m`<div class="dpk-toast" data-key=${s.id}>
|
|
1456
|
-
<span class="dpk-toast-icon" aria-hidden="true">${
|
|
1456
|
+
<span class="dpk-toast-icon" aria-hidden="true">${Yi()}</span>
|
|
1457
1457
|
<div class="dpk-toast-text">
|
|
1458
1458
|
<p class="dpk-change-title">${s.title}</p>
|
|
1459
1459
|
${s.body===null?k:m`<p class="dpk-change-body">${s.body}</p>`}
|
|
1460
1460
|
</div>
|
|
1461
|
-
${
|
|
1461
|
+
${ca(s,e,n)}
|
|
1462
1462
|
<button
|
|
1463
1463
|
class="dpk-toast-close"
|
|
1464
1464
|
type="button"
|
|
@@ -1473,9 +1473,9 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1473
1473
|
${t.waiting>0?m`<button class="dpk-toast-more" type="button" @click=${n.openList}>
|
|
1474
1474
|
${e.changesWaiting(t.waiting)} · ${e.changesSeeAll}
|
|
1475
1475
|
</button>`:k}
|
|
1476
|
-
${
|
|
1476
|
+
${da(t,e,n,"toasts")}
|
|
1477
1477
|
</div>`:k}
|
|
1478
|
-
</section>`,
|
|
1478
|
+
</section>`,Ds=(t,e)=>typeof t=="object"&&t!==null&&e.every(n=>typeof Reflect.get(t,n)=="function"),kf=t=>Ds(t,["use"]),bf=t=>Ds(t,["anchorFor","canSendToClaude","sendToClaude"]),vf=t=>Ds(t,["collection"]),pa=async(t,e)=>{try{return await t.use(e)}catch{return null}},xf=(t,e)=>({async canSend(){try{return await t.canSendToClaude()==="available"}catch{return!1}},async send({brief:n,draft:s,anchor:r}){let i=Pd(n);if(i===null){if(e===null)return{ok:!1,reason:"too_large"};try{const o=e.collection(_d).doc();await o.set({brief:n,draft:s,createdAt:new Date().toISOString()}),i=zd(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:Id(o)}}}}),yf=async t=>{if(!kf(t))return null;const[e,n]=await Promise.all([pa(t,"comments"),pa(t,"db")]);return bf(e)?xf(e,vf(n)?n:null):null},wf=()=>Reflect.get(globalThis,"claude");class $f{#e;#t;#n=null;#r=!1;constructor(e,n=wf){this.#e=e,this.#t=n,e.addController(this)}get available(){return this.#r}hostConnected(){this.#n??=yf(this.#t()),this.#s(),window.addEventListener("focus",this.#s)}hostDisconnected(){window.removeEventListener("focus",this.#s)}async send(e){const n=await this.#n;if(!n)return{ok:!1,reason:"forbidden"};const s=await n.send(e);return this.#s(),s}#s=async()=>{const e=await this.#n,n=e?await e.canSend():!1;n!==this.#r&&(this.#r=n,this.#e.requestUpdate())}}const js="dev-process-kit:color-scheme",Sf="(prefers-color-scheme: dark)",ha=()=>typeof matchMedia=="function"?matchMedia(Sf):null,ua=()=>St(document.documentElement.dataset.theme)??(ha()?.matches===!0?"dark":"light");class Af{#e;#t;#n=null;#r=null;#s="light";#i=null;#o=null;constructor(e,n){this.#e=e,this.#t=n,e.addController(this)}hostConnected(){this.#n===null&&(this.#n=this.#t()?Xe(St):he(St),this.#r=this.#n.read(js)),this.#s=ua(),this.#i=ha(),this.#i?.addEventListener("change",this.#l),this.#o=new MutationObserver(this.#l),this.#o.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]})}hostDisconnected(){this.#i?.removeEventListener("change",this.#l),this.#i=null,this.#o?.disconnect(),this.#o=null}resolve(e){return No(this.#a(e))}toggle(e){this.#r=du(this.#a(e)),this.#r===null?this.#n?.remove(js):this.#n?.write(js,this.#r),this.#e.requestUpdate()}#a(e){return{preference:this.#r,authored:e,environment:this.#s}}#l=()=>{const e=ua();e!==this.#s&&(this.#s=e,this.#e.requestUpdate())}}const Tf=(t,e)=>{const n=[],s=r=>{(r===t||r instanceof ShadowRoot)&&e?.(r);for(const i of r.children)i.hasAttribute("data-template")||(("commentTargets"in i||"elementActions"in i)&&n.push(i),s(i),i.shadowRoot&&s(i.shadowRoot))};return s(t),n},fa=(t,e)=>{const n=new Map;for(const s of t)n.set(e(s),(n.get(e(s))??0)+1);return t.filter(s=>n.get(e(s))===1)},ga=t=>fa(t.filter(e=>"elementActions"in e&&e.id.length>0),e=>e.id),ma=(t,e)=>{for(const n of ga(t)){const s=ad(e,n.id),r=Reflect.get(n,"elementActions");Array.isArray(r)&&r.length===s.length&&s.every((o,a)=>{const l=r[a];return typeof l=="object"&&l!==null&&"id"in l&&l.id===o.id})||Reflect.set(n,"elementActions",s)}},Cf=t=>{const e=Reflect.get(t,"elementActionResults");return Array.isArray(e)?e.flatMap(n=>{const s=C(xi,n);return s.success?[s.output]:[]}):[]},Ef=t=>{const e=[];for(const n of t){if(!("commentTargets"in n))continue;const s=C(Do,n.commentTargets);s.success&&e.push(...s.output)}return{targets:fa(e,n=>n.value),providers:ga(t).map(n=>({id:n.id,results:Cf(n)}))}};function ka(t){return t===null?1:t===void 0?2:0}function ba(t,e){const n=ka(t),s=ka(e);return n<s?-1:n>s?1:n!==0?0:t<e?-1:t>e?1:0}function Rf(t,e,n){return n==="asc"?ba(t,e):ba(e,t)}function _f(t,e,n){return t.slice().sort((s,r)=>{const i=n.length;for(let o=0;o<e.length;o++){const a=i>o?n[o]:n[i-1],l=e[o],d=typeof l=="function",c=Rf(d?l(s):s[l],d?l(r):r[l],a);if(c!==0)return c}return 0})}function va(t,e){return _f(t,e,["asc"])}const Of=5,qs=4,xa=8,Lf=(t,e)=>{const n=e.badgeHeight,s=t.target.right+xa,r=t.target.left-xa,i=[];let o=0,a=s;for(let l=t.widths.length-1;l>=0;l-=1){const d=t.widths[l]??0;a!==s&&a-d<r&&(o+=1,a=s),i[l]={x:a-d,y:t.target.top-n/2-o*(n+qs)},a-=d+Of}return i},ya=(t,e)=>{const n=t.map(()=>[]),s=va(t.map((i,o)=>({group:i,index:o})).filter(({group:i})=>i.gutter),[({group:i})=>i.target.top]);let r=Number.NEGATIVE_INFINITY;for(const{group:i,index:o}of s){let a=Math.max(i.target.top,r);n[o]=i.widths.map(l=>{const d={x:e.width-l,y:a};return a+=e.badgeHeight+qs,d}),r=a}return{points:n,bottom:r-qs}},Pf=(t,e)=>Math.max(0,ya(t,e).bottom),zf=(t,e)=>{const n=ya(t,e),s=Math.max(e.height,n.bottom);return t.map((r,i)=>(r.gutter?n.points[i]??[]:Lf(r,e)).map((o,a)=>({x:vs(o.x,0,Math.max(0,e.width-(r.widths[a]??0))),y:vs(o.y,0,Math.max(0,s-e.badgeHeight))})))},Mf=t=>{const e=[t];t.shadowRoot&&e.push(t.shadowRoot);for(const n of t.querySelectorAll("*"))n.shadowRoot&&e.push(n.shadowRoot);return e},If=(t,e,n,s,r=(i,o)=>[o])=>{if(e.questions.length===0)return[];const i=new Map(e.questions.map(a=>[a.ref,a])),o=[];for(const a of Mf(t))for(const l of a.querySelectorAll(`[${gt}]`)){const d=l.getAttribute(gt)??"";for(const c of d.split(/\s+/)){const p=r(l,c).map(u=>i.get(u)).find(u=>u!==void 0);p&&o.push({index:o.length,target:l,questionId:p.id,ref:p.ref,title:p.title,answered:Jt(p,n[p.id]),open:p.id===s})}}return o},Nf=(t,e)=>{const n=t.getRootNode(),s=n instanceof ShadowRoot?n.host:null,r=s?.shadowRoot?.querySelector(".diagram-canvas")??null;return r instanceof Element?r.getBoundingClientRect():s instanceof Element?s.getBoundingClientRect():e.getBoundingClientRect()},Df=(t,e)=>{const n=t.getBoundingClientRect(),s=t.getRootNode(),r=s instanceof ShadowRoot?s.host:null,i=new Map;for(const u of e){const h=t.querySelector(`[data-badge="${u.index}"]`);if(!h)continue;const f=i.get(u.target)??[];f.push(h),i.set(u.target,f)}const o=[];for(const[u,h]of i){const f=u.getBoundingClientRect(),g=Nf(u,t),b=(f.width>0||f.height>0)&&f.bottom>n.top&&f.top<n.bottom&&f.right>n.left&&f.left<n.right&&f.bottom>g.top&&f.top<g.bottom;for(const x of h)x.dataset.visible=String(b);b&&o.push({buttons:h,group:{target:{left:f.left-n.left,top:f.top-n.top,right:f.right-n.left,bottom:f.bottom-n.top},widths:h.map(x=>x.offsetWidth),gutter:r?.contains(u)===!0&&t.dataset.region!=="sidebar"}})}const a=o[0]?.buttons[0]?.offsetHeight??0,l=o.map(({group:u})=>u),d={width:t.clientWidth,height:t.clientHeight,badgeHeight:a},c=Pf(l,d);t.parentElement&&(t.parentElement.style.minHeight=c>0?`${Math.ceil(c)}px`:"");const p=zf(l,{...d,height:Math.max(d.height,c)});o.forEach(({buttons:u},h)=>{u.forEach((f,g)=>{const b=p[h]?.[g];b&&(f.style.transform=`translate(${b.x}px, ${b.y}px)`)})})},wa={childList:!0,subtree:!0,attributes:!0,attributeFilter:[gt]};class jf{#e;#t;#n=null;#r=!1;#s="";#i=new Set;constructor(e,n){this.#e=e,this.#t=n,e.addController(this)}hostConnected(){document.addEventListener("scroll",this.#l,!0),window.addEventListener("resize",this.#l),this.#e.addEventListener("dpk-diagram-view",this.#l)}hostDisconnected(){document.removeEventListener("scroll",this.#l,!0),window.removeEventListener("resize",this.#l),this.#e.removeEventListener("dpk-diagram-view",this.#l),this.#n?.disconnect(),this.#n=null;for(const e of this.#i)e.removeEventListener("scroll",this.#l,!0);this.#i.clear()}hostUpdated(){if(this.#n?.disconnect(),!this.#t.active())return;const e=this.#a();e!==this.#s&&(this.#s=e,this.#e.requestUpdate()),this.#n??=new MutationObserver(()=>{this.#e.requestUpdate(),this.#l()}),this.#n.observe(this.#e,wa);for(const n of this.#e.querySelectorAll("*"))n.shadowRoot&&this.#n.observe(n.shadowRoot,wa);this.#o(),this.#l()}#o(){const e=[this.#e.shadowRoot,...Array.from(this.#e.querySelectorAll("*"),n=>n.shadowRoot)];for(const n of e)n===null||this.#i.has(n)||(n.addEventListener("scroll",this.#l,!0),this.#i.add(n))}#a(){const e=this.#e.shadowRoot?.querySelectorAll(`[${gt}]`)??[];return Array.from(e,n=>n.getAttribute(gt)??"").join("|")}#l=()=>{this.#r||!this.#t.active()||(this.#r=!0,requestAnimationFrame(()=>{this.#r=!1;const e=this.#t.bindings();for(const n of this.#t.layers())Df(n,e)}))}}const Bs=(t,e)=>e!==null&&Ke(t,e)?e:t.questions[0]?.id??null,qf=(t,e)=>e!=="current"&&t.rounds[e]!==void 0?e:"current",$a=(t,e)=>t.options.map((n,s)=>({id:n.id,letter:md(s),label:n.label,checked:e?.kind==="option"&&e.optionId===n.id})),Bf=(t,e,n)=>{if(e.rounds.length===0)return[];const s=e.rounds.map((r,i)=>({value:String(i),label:t.grillRoundOption(r.label,r.questions.length),selected:n===i}));return[{value:"current",label:t.grillRoundOption(t.grillCurrentRound,e.questions.length),selected:n==="current"},...s.reverse()]},Hf=(t,e,n,s)=>{const r=Ei(e,n),i=qf(e,s.round),o=Bf(t,e,i),a=t.grillProgress(r.answered,r.total),l=i==="current"?void 0:e.rounds[i];if(l!==void 0)return{progress:a,rounds:o,view:{kind:"past",note:t.grillPastRound(l.label),questions:l.questions.map(c=>{const p=Yt(c,c.answer);return{id:c.id,ref:c.ref,title:c.title,description:c.description,note:c.note,answered:p!=="",summary:p===""?t.grillUnanswered:p,choices:$a(c,c.answer),freeText:c.answer?.kind==="free"?c.answer.text:null}})}};const d=Bs(e,s.open);return{progress:a,rounds:o,view:{kind:"current",questions:e.questions.map(c=>{const p=n[c.id],u=Yt(c,p);return{id:c.id,ref:c.ref,title:c.title,description:c.description,note:c.note,open:c.id===d,answered:u!=="",summary:u,choices:$a(c,p),draft:p?.kind==="free"?p.text:"",freeSelected:p?.kind==="free",allowFreeText:c.freeText}})}}},Uf=(t,e,n,s)=>m`
|
|
1479
1479
|
<div class="dpk-grill">
|
|
1480
1480
|
<header class="dpk-grill-head">
|
|
1481
1481
|
<h2>${t.grill}</h2>
|
|
@@ -1492,16 +1492,16 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1492
1492
|
</div>`}
|
|
1493
1493
|
<div class="dpk-grill-list">
|
|
1494
1494
|
${e.view.kind==="past"?m`<p class="dpk-grill-round-note">${e.view.note}</p>`:k}
|
|
1495
|
-
${e.view.questions.length===0?m`<p class="dpk-grill-empty">${t.grillNoQuestions}</p>`:e.view.kind==="current"?Me(e.view.questions,r=>r.id,r=>
|
|
1495
|
+
${e.view.questions.length===0?m`<p class="dpk-grill-empty">${t.grillNoQuestions}</p>`:e.view.kind==="current"?Me(e.view.questions,r=>r.id,r=>Ff(t,r,n)):Me(e.view.questions,r=>r.id,Gf)}
|
|
1496
1496
|
</div>
|
|
1497
1497
|
${s}
|
|
1498
1498
|
</div>
|
|
1499
|
-
`,
|
|
1499
|
+
`,Ff=(t,e,n)=>m`
|
|
1500
1500
|
<section
|
|
1501
1501
|
class="dpk-grill-question"
|
|
1502
1502
|
data-question=${e.id}
|
|
1503
1503
|
data-answered=${String(e.answered)}
|
|
1504
|
-
data-dpk-target=${I({type:
|
|
1504
|
+
data-dpk-target=${I({type:se,id:e.id})}
|
|
1505
1505
|
>
|
|
1506
1506
|
<button
|
|
1507
1507
|
class="dpk-grill-heading"
|
|
@@ -1515,13 +1515,13 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1515
1515
|
<strong>${e.title}</strong>
|
|
1516
1516
|
${!e.open&&e.answered?m`<span class="dpk-grill-summary">${e.summary}</span>`:k}
|
|
1517
1517
|
</span>
|
|
1518
|
-
<span class="dpk-grill-chevron" aria-hidden="true">${
|
|
1518
|
+
<span class="dpk-grill-chevron" aria-hidden="true">${kt()}</span>
|
|
1519
1519
|
</button>
|
|
1520
1520
|
${e.open?m`<div class="dpk-grill-body" id=${`dpk-grill-body-${e.id}`}>
|
|
1521
1521
|
${e.description?m`<p class="dpk-grill-description">${e.description}</p>`:k}
|
|
1522
1522
|
${e.note?m`<p class="dpk-grill-note">${e.note}</p>`:k}
|
|
1523
1523
|
<div class="dpk-grill-choices" role="radiogroup" aria-label=${e.title}>
|
|
1524
|
-
${e.choices.map(s=>
|
|
1524
|
+
${e.choices.map(s=>Wf(e.id,s,n))}
|
|
1525
1525
|
${e.allowFreeText?m`<label class="dpk-grill-choice" data-free=${String(e.freeSelected)}>
|
|
1526
1526
|
<input
|
|
1527
1527
|
type="radio"
|
|
@@ -1552,7 +1552,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1552
1552
|
</button>`:k}
|
|
1553
1553
|
</div>`:k}
|
|
1554
1554
|
</section>
|
|
1555
|
-
`,
|
|
1555
|
+
`,Wf=(t,e,n)=>m`
|
|
1556
1556
|
<label class="dpk-grill-choice" data-choice=${e.id}>
|
|
1557
1557
|
<input
|
|
1558
1558
|
type="radio"
|
|
@@ -1566,7 +1566,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1566
1566
|
<span>${e.label}</span>
|
|
1567
1567
|
</span>
|
|
1568
1568
|
</label>
|
|
1569
|
-
`,
|
|
1569
|
+
`,Gf=t=>m`
|
|
1570
1570
|
<details class="dpk-grill-question" data-past data-question=${t.id} data-answered=${String(t.answered)}>
|
|
1571
1571
|
<summary class="dpk-grill-heading">
|
|
1572
1572
|
<span class="dpk-grill-ref">${t.ref}</span>
|
|
@@ -1574,7 +1574,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1574
1574
|
<strong>${t.title}</strong>
|
|
1575
1575
|
<span class="dpk-grill-summary">${t.summary}</span>
|
|
1576
1576
|
</span>
|
|
1577
|
-
<span class="dpk-grill-chevron" aria-hidden="true">${
|
|
1577
|
+
<span class="dpk-grill-chevron" aria-hidden="true">${kt()}</span>
|
|
1578
1578
|
</summary>
|
|
1579
1579
|
<div class="dpk-grill-body">
|
|
1580
1580
|
${t.description?m`<p class="dpk-grill-description">${t.description}</p>`:k}
|
|
@@ -1588,21 +1588,21 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1588
1588
|
${t.freeText===null?k:m`<p class="dpk-grill-past-choice" data-checked="true">${t.freeText}</p>`}
|
|
1589
1589
|
</div>
|
|
1590
1590
|
</details>
|
|
1591
|
-
`,
|
|
1591
|
+
`,Vf=2400;class Kf{#e=Zu();#t=null;#n;constructor(e){this.#n=e,e.addController(this)}get state(){return this.#e}hostDisconnected(){this.#i()}async copy(e){this.#r({kind:"copy-started"});const n=this.#e.request,s=await ls(e()).catch(()=>!1);this.#r({kind:"copy-finished",request:n,ok:s}),this.#s(n)}async send(e){if(this.#e.status.kind==="sending")return;this.#r({kind:"send-started"});const n=this.#e.request,s=await e().catch(()=>({ok:!1,reason:"error"}));this.#r({kind:"send-finished",request:n,outcome:s}),s.ok&&this.#s(n)}#r(e){(e.kind==="copy-started"||e.kind==="send-started")&&this.#i(),this.#e=Yu(this.#e,e),this.#n.requestUpdate()}#s(e){e===this.#e.request&&(this.#i(),this.#t=setTimeout(()=>{this.#t=null,this.#r({kind:"settled",request:e})},Vf))}#i(){this.#t!==null&&clearTimeout(this.#t),this.#t=null}}const Hs="dev-process-kit:locale";class Qf{#e;#t;#n;#r=null;#s=null;#i;#o;constructor(e,n,s){this.#e=e,this.#t=n,this.#n=s,e.addController(this)}get authored(){if(this.#i===void 0)return It(Mt(this.#e));const e=this.#e.parentNode;return It(this.#i??(e===null?null:Mt(e)))}get locale(){return this.#o??this.#a()}#a(){return xl({preference:this.#s,authored:this.authored})}hostConnected(){this.#r===null&&(this.#r=this.#t()?Xe(Ar):he(Ar),this.#s=this.#r.read(Hs)),this.#i??=this.#e.getAttribute("lang"),this.#l()}pick(e){this.#s=yl(e,this.authored),this.#s===null?this.#r?.remove(Hs):this.#r?.write(Hs,this.#s),this.#l(),this.#e.requestUpdate()}#l(){const e=this.#s??this.#i??null;e===null?this.#e.removeAttribute("lang"):this.#e.getAttribute("lang")!==e&&this.#e.setAttribute("lang",e);const n=this.#a();if(n===this.#o)return;const s=this.#o===void 0;this.#o=n,this.#n(),(!s||this.#s!==null)&&document.dispatchEvent(new Event(Nn))}}const Zf="(max-width: 760px)",Yf=()=>typeof matchMedia=="function"?matchMedia(Zf):null;class Jf{#e;#t=null;#n=!1;constructor(e){this.#e=e,e.addController(this)}hostConnected(){this.#t=Yf(),this.#n=this.#t?.matches===!0,this.#t?.addEventListener("change",this.#r)}hostDisconnected(){this.#t?.removeEventListener("change",this.#r),this.#t=null}get narrow(){return this.#n}#r=e=>{this.#n=e.matches,this.#e.requestUpdate()}}const Sa=()=>Xt(typeof location>"u"?"":location.hash),Xf=(t,e)=>{if(typeof history>"u")return;const n=`${location.pathname}${location.search}${Qe(t)}`;`${location.pathname}${location.search}${location.hash}`!==n&&(e?history.replaceState(null,"",n):history.pushState(null,"",n))};class eg{#e;#t=null;#n=0;constructor(e){this.#e=e}get orphans(){return this.#n}route(){const e=this.#e.renderRoot,n=Ee(e.querySelector('slot[name="preview"]'),HTMLSlotElement);if(n===null)return;this.#t!==n&&(this.#t=n,n.addEventListener("slotchange",this.#r));const s=new Set(Array.from(e.querySelectorAll("slot")).map(i=>i.getAttribute("name")??"")),r=n.assignedElements();for(const i of r){const o=i.getAttribute("data-preview-id");if(!o)continue;const a=`preview:${o}`;i.getAttribute("slot")!==a&&s.has(a)&&i.setAttribute("slot",a)}r.length!==this.#n&&(this.#n=r.length,queueMicrotask(()=>this.#e.requestUpdate()))}#r=()=>{queueMicrotask(()=>this.route())}}const Aa=(t,e)=>{const n=[],s=r=>{for(const i of r.querySelectorAll("*"))i.matches(e)&&n.push(i),i.shadowRoot&&s(i.shadowRoot)};return s(t),t instanceof Element&&t.shadowRoot&&s(t.shadowRoot),n},tg=(t,e)=>{const n=[];let s=t;for(;s;){const r=s instanceof Element&&s.assignedSlot?s.assignedSlot:s.parentNode;if(s=r instanceof ShadowRoot?r.host:r,!(s instanceof Element)||s===e)break;n.push(s)}return n},Ta="data-dpk-target",ng=2800,Ca=48,sg=t=>t.getClientRects().length>0,Ea=(t,e)=>{const n=Aa(t,`[${Ta}]`).filter(i=>(i.getAttribute(Ta)??"").split(/\s+/).includes(e)),s=Aa(t,"[data-dpk-comment]").filter(i=>i.getAttribute("data-dpk-comment")===e),r=[...n,...s];return r.find(sg)??r[0]??null},Ra=(t,e)=>{const n=getComputedStyle(t),s=e==="y"?n.overflowY:n.overflowX;return s!=="auto"&&s!=="scroll"?!1:e==="y"?t.scrollHeight>t.clientHeight:t.scrollWidth>t.clientWidth},rg=(t,e)=>{for(const n of tg(e,t))Ra(n,"y")&&xs(n,e,Ca),Ra(n,"x")&&$o(n,e,Ca)},_a="color-mix(in srgb, var(--dpk-accent) 45%, transparent)",qe={outline:"2px solid var(--dpk-accent)",outlineOffset:"3px"},Oa={outline:"2px solid transparent",outlineOffset:"3px"},ig=t=>t?[{...qe},{...qe,offset:.85},{...Oa}]:[{...qe,boxShadow:`0 0 0 0 ${_a}`},{...qe,boxShadow:"0 0 0 14px transparent",offset:.3},{...qe,boxShadow:`0 0 0 0 ${_a}`,offset:.31},{...qe,boxShadow:"0 0 0 14px transparent",offset:.6},{...qe,offset:.85},{...Oa}],Ct={filter:"drop-shadow(0 0 3px var(--dpk-accent)) drop-shadow(0 0 3px var(--dpk-accent))"},yn={filter:"drop-shadow(0 0 3px transparent) drop-shadow(0 0 3px transparent)"},og=t=>t?[{...Ct},{...Ct,offset:.85},{...yn}]:[{...Ct},{...yn,offset:.3},{...Ct,offset:.31},{...yn,offset:.6},{...Ct,offset:.61},{...yn}],ag=t=>{if(typeof t.animate!="function")return;const e=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches,n=t instanceof SVGElement&&!(t instanceof SVGSVGElement);t.animate(n?og(e):ig(e),{duration:ng,easing:"ease-out"})},lg=440,cg=16;class dg{#e;#t=null;constructor(e,n){this.#e=n,e.addController(this)}hostConnected(){window.addEventListener("keydown",this.#r)}hostUpdated(){const e=this.#e.surface(),n=this.#e.open()&&e!==null;if(n!==(this.#t!==null)){if(n){const s=this.#e.anchor()??{top:0,bottom:0,right:window.innerWidth},r=s instanceof Element?s.getBoundingClientRect().bottom:s.bottom,i=Math.max(0,window.innerHeight-r-cg);this.#t=ko(e,s,{width:lg,height:i},{placement:"bottom-end"});return}this.#n(),bo(e)}}hostDisconnected(){window.removeEventListener("keydown",this.#r),this.#n()}#n(){this.#t?.(),this.#t=null}#r=e=>{e.key!=="Escape"||e.defaultPrevented||e.isComposing||!this.#e.open()||this.#e.close()}}const wn="dpk-settings",La="dpk-settings-anchor",Pa={width:320,height:420},za=(t,e,n)=>m`<button
|
|
1592
1592
|
class="dpk-header-action dpk-settings-trigger"
|
|
1593
1593
|
type="button"
|
|
1594
|
-
aria-controls=${
|
|
1594
|
+
aria-controls=${wn}
|
|
1595
1595
|
aria-haspopup="menu"
|
|
1596
1596
|
aria-expanded=${t?"true":"false"}
|
|
1597
1597
|
aria-label=${e.settings}
|
|
1598
1598
|
data-tooltip=${e.settings}
|
|
1599
1599
|
@click=${n.toggle}
|
|
1600
1600
|
>
|
|
1601
|
-
${
|
|
1602
|
-
</button>`,
|
|
1603
|
-
${t.items.map(s=>
|
|
1601
|
+
${gp()}
|
|
1602
|
+
</button>`,Ma=(t,e,n)=>m`<div id=${wn} class="dpk-settings" popover="manual" role="menu" aria-label=${e.settings}>
|
|
1603
|
+
${t.items.map(s=>pg(s,n))}
|
|
1604
1604
|
${t.note===void 0?k:m`<p class="dpk-settings-note">${t.note}</p>`}
|
|
1605
|
-
</div>`,
|
|
1605
|
+
</div>`,pg=(t,e)=>m`<button
|
|
1606
1606
|
class="dpk-settings-option"
|
|
1607
1607
|
type="button"
|
|
1608
1608
|
role="menuitemcheckbox"
|
|
@@ -1610,12 +1610,12 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
1610
1610
|
aria-checked=${t.on?"true":"false"}
|
|
1611
1611
|
@click=${()=>e.flip(t.toggle)}
|
|
1612
1612
|
>
|
|
1613
|
-
<span class="dpk-settings-check" aria-hidden="true">${t.on?
|
|
1613
|
+
<span class="dpk-settings-check" aria-hidden="true">${t.on?Vi():k}</span>
|
|
1614
1614
|
<span class="dpk-settings-text">
|
|
1615
1615
|
<span class="dpk-settings-name">${t.label}</span>
|
|
1616
1616
|
${t.hint===void 0?k:m`<span class="dpk-settings-hint">${t.hint}</span>`}
|
|
1617
1617
|
</span>
|
|
1618
|
-
</button>`,ye={min:180,max:560,step:16,largeStep:64},
|
|
1618
|
+
</button>`,ye={min:180,max:560,step:16,largeStep:64},hg={side:"left",defaultWidth:260},$n=t=>Math.round(Math.min(ye.max,Math.max(ye.min,t))),Ia=t=>typeof t=="number"&&Number.isFinite(t)?$n(t):null,Us=(t,e)=>t==="left"?e:-e,ug=(t,e)=>$n(t.startWidth+Us(t.side,e-t.startX)),fg=(t,e,{key:n,shiftKey:s})=>{const r=s?ye.largeStep:ye.step;switch(n){case"ArrowLeft":return $n(t+Us(e,-r));case"ArrowRight":return $n(t+Us(e,r));case"Home":return ye.min;case"End":return ye.max;default:return null}},Na=t=>typeof t=="boolean"?t:null,gg=t=>t==="left"?"right":"left",mg=(t,e)=>e?{action:"expand",points:gg(t)}:{action:"collapse",points:t},kg=t=>`dev-process-kit:sidebar-collapsed:${t}`;class bg{#e;#t;#n=null;#r="";#s=!1;#i=!1;constructor(e,n){this.#e=e,this.#t=n,e.addController(this)}hostConnected(){this.#n===null&&(this.#n=this.#t.persist()?Xe(Na):he(Na),this.#r=kg(this.#t.template()),this.#s=this.#n.read(this.#r)??!1)}get collapsed(){return this.#s}get drawerOpen(){return this.#i}toggleDrawer(){this.#i=!this.#i,this.#e.requestUpdate()}closeDrawer(){this.#i&&(this.#i=!1,this.#e.requestUpdate())}toggle(){this.#s=!this.#s,this.#s?this.#n?.write(this.#r,!0):this.#n?.remove(this.#r),this.#e.requestUpdate()}}const vg=t=>`dev-process-kit:sidebar-width:${t}`,Fs={kind:"idle"};class xg{constructor(e,n){this.#n=null,this.#r="",this.#s=null,this.#i=Fs,this.handlers={pointerdown:s=>{s.button===0&&(s.preventDefault(),s.currentTarget instanceof Element&&s.currentTarget.setPointerCapture(s.pointerId),this.#i={kind:"dragging",pointerId:s.pointerId,side:this.#t.layout().side,startX:s.clientX,startWidth:this.width},this.#e.requestUpdate())},pointermove:s=>{const r=this.#i;r.kind!=="dragging"||r.pointerId!==s.pointerId||this.#a(ug(r,s.clientX))},pointerup:s=>this.#o(s),pointercancel:s=>this.#o(s),keydown:s=>{const r=fg(this.width,this.#t.layout().side,s);r!==null&&(s.preventDefault(),this.#a(r),this.#l())},dblclick:()=>{this.#a(this.#t.layout().defaultWidth),this.#l()}},this.#e=e,this.#t=n,e.addController(this)}#e;#t;#n;#r;#s;#i;hostConnected(){this.#n===null&&(this.#n=this.#t.persist()?Xe(Ia):he(Ia),this.#r=vg(this.#t.template()),this.#s=this.#n.read(this.#r))}hostDisconnected(){this.#i=Fs}get width(){return this.#s??this.#t.layout().defaultWidth}get dragging(){return this.#i.kind==="dragging"}#o(e){const n=this.#i;n.kind!=="dragging"||n.pointerId!==e.pointerId||(this.#i=Fs,this.#l(),this.#e.requestUpdate())}#a(e){const n=e===this.#t.layout().defaultWidth?null:e;n!==this.#s&&(this.#s=n,this.#e.requestUpdate())}#l(){this.#s===null?this.#n?.remove(this.#r):this.#n?.write(this.#r,this.#s)}}const Da=[Dt,jn,fe`
|
|
1619
1619
|
:host {
|
|
1620
1620
|
display: block;
|
|
1621
1621
|
min-height: 100%;
|
|
@@ -2254,6 +2254,11 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
2254
2254
|
display: none;
|
|
2255
2255
|
}
|
|
2256
2256
|
|
|
2257
|
+
/* Spans the sidebar's content, so its badge layer scrolls with it. */
|
|
2258
|
+
.dpk-sidebar-body {
|
|
2259
|
+
position: relative;
|
|
2260
|
+
}
|
|
2261
|
+
|
|
2257
2262
|
/*
|
|
2258
2263
|
* A right-hand sidebar: a rail beside the main column rather than a list
|
|
2259
2264
|
* before it. \`:where\` keeps these as weak as the rules above, so a
|
|
@@ -3533,18 +3538,18 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
3533
3538
|
order: 1;
|
|
3534
3539
|
}
|
|
3535
3540
|
}
|
|
3536
|
-
`],
|
|
3541
|
+
`],Ws="supplement",ja="memo",yg=(t,e)=>[...t.children].filter(n=>n.getAttribute("slot")===Ws).map(n=>{const s=n.getAttribute("data-name")?.trim()??"";return{name:s===""?e:s,element:n}}),wg=(t,e)=>`.dpk-supplements-body ::slotted(:not(:nth-child(${[...t.children].indexOf(e.element)+1}))) { display: none !important; }`,$g={selected:null,open:!1},Sg=(t,e)=>t.open?e.find(n=>n.element===t.selected)??null:null,Ag=(t,e)=>({selected:e,open:!(t.open&&t.selected===e)}),Tg=(t,e)=>t.open?{...t,open:!1}:{selected:e.some(s=>s.element===t.selected)?t.selected:e[0]?.element??null,open:!0},Cg=30,Eg=Ge(v(),O({base:v(),value:v()})),qa=t=>{const e=C(Eg,t);return e.success?e.output:null},Rg=t=>t.key===void 0?JSON.stringify(["field",t.hosts,t.name,t.base]):JSON.stringify(["key",t.key,t.name]),_g=(t,e,n)=>{const{[e]:s,...r}=t;if(n.value===n.base)return r;const i=Object.entries({...r,[e]:n});return Object.fromEntries(i.slice(Math.max(0,i.length-Cg)))},Og=(t,e)=>{if(!(e in t))return t;const{[e]:n,...s}=t;return s},Lg=(t,e,n)=>{const s=t[e];return s===void 0||s.base!==n||s.value===n?null:s.value},Pg=new Set(["text","search","url","email","tel"]),Ba=t=>t instanceof HTMLTextAreaElement||t instanceof HTMLInputElement&&Pg.has(t.type)?t:null,zg=(t,e)=>{const n=[];let s=e.getRootNode();for(;s instanceof ShadowRoot;){if(s.host===t)return n;n.unshift(s.host.localName),s=s.host.getRootNode()}return null},Mg=t=>{let e=t;for(;e!==null;){const n=e.getAttribute("data-dpk-text-key");if(n!==null&&n!=="")return n;const s=e.getRootNode();e=e.parentElement??(s instanceof ShadowRoot?s.host:null)}},Ig=t=>t.composedPath().find(e=>e instanceof Element&&e.hasAttribute("data-dpk-text-discard"))??null,Ng=(t,e)=>{const n=[...e];for(let s=t.parentElement;s!==null;s=s.parentElement){const r=n.filter(i=>s.contains(i));if(r.length>0)return r}return[]},Dg=t=>t.getAttribute("aria-label")??(t.placeholder||t.name||t.localName),Gs=t=>typeof t=="string"?[t]:Array.isArray(t)?t.flatMap(Gs):typeof t=="object"&&t!==null?Object.values(t).flatMap(Gs):[],Ha=t=>t.replace(/\s+/g," ").trim();class jg{#e;#t;#n=null;#r="";#s=new WeakMap;#i=new Set;constructor(e,n){this.#e=e,this.#t=n,e.addController(this)}hostConnected(){this.#n===null&&(this.#n=this.#t.persist()?cf(qa):he(qa),this.#r=this.#t.storageKey()),this.#e.addEventListener("focusin",this.#l),this.#e.addEventListener("input",this.#p),this.#e.addEventListener("click",this.#a,!0)}hostDisconnected(){this.#e.removeEventListener("focusin",this.#l),this.#e.removeEventListener("input",this.#p),this.#e.removeEventListener("click",this.#a,!0)}settle(e){const n=new Set(e.flatMap(Gs).map(Ha));this.#o([...this.#i].filter(s=>n.has(Ha(s.value))))}#o(e){for(const n of e){this.#i.delete(n);const s=this.#s.get(n);s!==void 0&&this.#m(Og(this.#h(),s.id))}}#a=e=>{const n=Ig(e);n!==null&&this.#o(Ng(n,this.#i))};#l=e=>{const n=Ba(e.composedPath()[0]);if(n===null||this.#i.has(n))return;const s=zg(this.#e,n);if(s===null)return;const r=Mg(n),i=n.value,o=Rg({...r===void 0?{}:{key:r},hosts:s,name:Dg(n),base:i});this.#s.set(n,{id:o,base:i});const a=Lg(this.#h(),o,i);a!==null&&queueMicrotask(()=>{if(n.value===i){n.value=a;try{n.setSelectionRange(a.length,a.length)}catch{}this.#i.add(n),n.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}})};#p=e=>{const n=Ba(e.composedPath()[0]),s=n===null?void 0:this.#s.get(n);if(!(n===null||s===void 0)){for(const r of this.#i)r.isConnected||this.#i.delete(r);this.#i.add(n),this.#m(_g(this.#h(),s.id,{base:s.base,value:n.value}))}};#h(){return this.#n?.read(this.#r)??{}}#m(e){Object.keys(e).length===0?this.#n?.remove(this.#r):this.#n?.write(this.#r,e)}}class qg{#e;#t;#n;#r=null;#s=!1;constructor(e,n={}){this.#e=e,this.#t=n.fetchVersions??Eo,this.#n=n.switchTo??Ro,e.addController(this)}hostConnected(){}load(){this.#s||this.#r!==null||(this.#s=!0,this.#t().then(e=>{this.#r=e,this.#s=!1,this.#e.requestUpdate()},e=>{this.#s=!1,console.warn("dev-process-kit: could not list the published versions",e)}))}pick(e){e!==X&&this.#n(e===""?null:e)}render(e){const n=L(e),s=Co({current:X,requested:ys(location.search)!==null,published:this.#r,text:{pinned:n.versionPinned,latest:n.versionLatest}}),r=()=>this.load();return m`<span class="dpk-version"
|
|
3537
3542
|
>dev-process-kit@<select
|
|
3538
3543
|
class="dpk-version-select"
|
|
3539
3544
|
aria-label=${n.versionLabel}
|
|
3540
3545
|
title=${n.versionLabel}
|
|
3541
3546
|
@pointerenter=${r}
|
|
3542
3547
|
@focus=${r}
|
|
3543
|
-
@change=${
|
|
3548
|
+
@change=${$s(i=>this.pick(i))}
|
|
3544
3549
|
>
|
|
3545
3550
|
${s.options.map(i=>m`<option value=${i.value} ?selected=${i.value===s.value}>${i.label}</option>`)}
|
|
3546
3551
|
</select></span
|
|
3547
|
-
>`}}const
|
|
3552
|
+
>`}}const Vs=`script[type="application/json"]:not([${_o}]):not([${os}])`,Bg=`script[type="application/json"][${os}]`,Hg=30,Ua={width:360,height:480},Ks="dpk-review",Fa=t=>{try{return t.matches(":popover-open")}catch{return!1}},Ug=()=>new Promise(t=>requestAnimationFrame(()=>t()));class Fg extends me{static{this.styles=Da}static{this.properties={storageKey:{type:String,attribute:"storage-key"},storage:{type:String},notes:{type:String},theme:{type:String},notesOpen:{state:!0},settingsOpen:{state:!0},reviewSection:{state:!0}}}#e=Ve;#t=null;#n=null;#r="current";#s=null;#i=null;#o=[];#a={open:e=>this.#B(e),answer:(e,n)=>this.#Se(e,n),next:e=>this.#ee(e),pickRound:e=>{this.#r=e,this.#i=null,this.requestUpdate()}};#l=!1;#p=new eg(this);#h=$g;#m=new Af(this,()=>this.storage!=="off"&&this.storage!=="memory");#y=new $f(this);#k=new Kf(this);#v=new xg(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",template:()=>this.#U,layout:()=>this.sidebarLayout});#u=new bg(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",template:()=>this.#U});#A=new Jf(this);#g=new jg(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",storageKey:()=>`${this.storageKey??kn(this.#U)}:unsent-text`});#b=null;#f=new hf(this,{persist:()=>this.storage!=="off"&&this.storage!=="memory",storageKey:()=>this.storageKey??kn(this.definition.name),inside:e=>e.some(n=>n instanceof Element&&(n.id===xn||n.classList.contains("dpk-bell"))),show:e=>{this.#Re(e)}});#w={toggleList:()=>this.#f.toggleList(),openList:()=>this.#f.send({kind:"open-list"}),show:e=>this.#f.show(e),dismiss:e=>this.#f.send({kind:"close-toast",key:e}),readAll:()=>this.#f.send({kind:"read-all"}),pause:e=>this.#f.pause(e),resume:e=>this.#f.resume(e)};#E=new vo(this);#G={toggle:()=>{this.settingsOpen=!this.settingsOpen},flip:e=>{this.dispatch(e)}};constructor(){super(),this.settingsOpen=!1,new dg(this,{surface:()=>this.renderRoot.querySelector(`#${Ks}`),anchor:()=>this.renderRoot.querySelector(".dpk-header-actions"),open:()=>this.notesOpen,close:()=>{this.notesOpen=!1}}),new jf(this,{active:()=>this.#e.questions.length>0,layers:()=>Array.from(this.renderRoot.querySelectorAll(".dpk-grill-badges")),bindings:()=>this.#o}),new xo(this,{open:()=>this.settingsOpen,closesOn:e=>!e.some(n=>n instanceof Element&&(n.id===wn||n.matches(".dpk-settings-trigger"))),ownsEscape:()=>!0,dismiss:()=>{this.settingsOpen=!1}})}#M=!1;#me=new qg(this);#V=new Qf(this,()=>this.storage!=="off"&&this.storage!=="memory",()=>{this.#d?.setTemplate(this.definition),this.#d?.setGrill({grill:this.#e,locale:this.locale})});#I;#d;#$=mt;#N=null;#D=new Set;#O=null;#K;#R;#L;#P=[];#Q;#ke=new Promise(e=>{this.#Q=e});#Z;#c=null;#j;get locale(){return this.#x()?.locale()??this.#V.locale}get definition(){const e=this.locale;return this.#I?.locale!==e&&(this.#I={locale:e,value:this.definitionFor(e)}),this.#I.value}connectedCallback(){this.#c=oa(this),super.connectedCallback(),this.dataset.template=this.definition.name,this.#l||(this.#l=!0,this.notesOpen=this.notes==="on"||this.notes==="open"||this.notes==="comments"||this.notes==="changes"||this.notes==="questions",this.reviewSection=this.notes==="changes"||this.notes==="questions"?this.notes:"comments"),this.#q(),this.#c===null&&window.addEventListener("hashchange",this.#pe),this.addEventListener("click",this.#ge),this.addEventListener("dpk-comment-targets-change",this.#S),this.addEventListener("dpk-comment-request",this.#he),this.addEventListener("dpk-comment-submit",this.#ue),this.addEventListener("dpk-element-action",this.#fe),this.#L??=new MutationObserver(this.#S),this.#S()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("hashchange",this.#pe),this.removeEventListener("click",this.#ge),this.#R?.disconnect(),this.#L?.disconnect(),this.removeEventListener("dpk-comment-targets-change",this.#S),this.removeEventListener("dpk-comment-request",this.#he),this.removeEventListener("dpk-comment-submit",this.#ue),this.removeEventListener("dpk-element-action",this.#fe)}#q(e=0){if(this.#d){this.#Y();return}if(this.childNodes.length===0&&e<2){queueMicrotask(()=>this.#q(e+1));return}const n=this.pendingStart();if(n!==null){n.then(()=>this.#q(e));return}this.#Ne()}#Y(){this.#K||(this.#K=this.#d?.subscribe(()=>this.#He()))}willUpdate(){const e=this.#x();this.dataset.theme=e?.theme()??this.#m.resolve(St(this.theme)),e!==null&&this.#d&&this.#j!==e.locale()&&(this.#j=e.locale(),this.#d.setTemplate(this.definition))}updated(){this.#We(),this.#Fe(),this.#Ee(),this.#xe(),this.#Ae(),this.#M&&(this.#M=!1,this.renderRoot.querySelector(".dpk-sidebar-toggle")?.focus())}get api(){return this.#Z??=this.#Ie(),this.#Z}get controller(){if(!this.#d)throw new Error(`<${this.tagName.toLowerCase()}> is not initialized yet`);return this.#d}get derivation(){return this.controller.derivation}get navigation(){return this.#c===null?this.#$:this.#C()}get board(){return this.#c}dispatch(e){if(this.#c!==null)return this.#F(s=>s.dispatch(this.#ae(e)));const n=this.controller.dispatch(e);return n.ok&&this.#g.settle([e.payload,e.note]),n.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:n.issues},bubbles:!0,composed:!0})),this.#T()),n}dispatchBatch(e){if(this.#c!==null)return this.#F(s=>s.dispatchBatch(e.map(r=>this.#ae(r))));const n=this.controller.dispatchBatch(e);return n.ok&&this.#g.settle(e.flatMap(s=>[s.payload,s.note])),n.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:n.issues},bubbles:!0,composed:!0})),this.#T()),n}editComment(e,n){if(this.#c!==null)return this.#F(r=>r.editComment(e,n));const s=this.controller.editComment(e,n);return s.ok&&this.#g.settle([n]),s.ok||(this.requestUpdate(),this.dispatchEvent(new CustomEvent("dpk-error",{detail:{issues:s.issues},bubbles:!0,composed:!0})),this.#T()),s}removeAction(e){this.#c!==null?this.#x()?.removeAction(e):this.controller.removeAction(e)}clearActions(){if(this.#c===null){this.controller.clearActions();return}const e=this.#x();for(const n of this.controller.actions)e?.removeAction(n.id)}navigate(e,n={}){if(this.#c!==null){this.#x()?.navigate(this.#le(e),n);return}const s=Qe(this.#C());this.#$=en(this.#$,e,this.definition.navigationHierarchy),this.#z(n.replace??!1);const r=Qe(this.#C());this.requestUpdate(),s!==r&&(this.#T(),this.dispatchEvent(new CustomEvent("dpk-navigate",{detail:{navigation:this.#$},bubbles:!0,composed:!0})))}hashFor(e){const n=this.#x();if(n!==null)return n.hashFor(this.#le(e));const s=this.#C();return Qe(this.definition.resolveNavigation(this.derivation.state,en(s,e,this.definition.navigationHierarchy)))}requestComment(e){if(this.#c!==null){this.#x()?.requestComment(I(this.#oe(e,"page")));return}this.#N=typeof e=="string"?e:I(e),this.notesOpen=!0,this.reviewSection="comments",this.requestUpdate()}get canSendToClaude(){return this.#y.available}sendToClaude(){return this.#y.send({brief:this.api.exportBrief(),draft:ns(this.derivation.actions),anchor:this})}renderReviewPanel(e){return m`<dpk-component-comment-panel
|
|
3548
3553
|
.definition=${this.controller.definition}
|
|
3549
3554
|
.state=${e.state}
|
|
3550
3555
|
.navigation=${e.navigation}
|
|
@@ -3557,8 +3562,8 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
3557
3562
|
.onDelete=${n=>this.removeAction(n)}
|
|
3558
3563
|
.onEditComment=${(n,s)=>this.editComment(n,s)}
|
|
3559
3564
|
.onClear=${()=>this.clearActions()}
|
|
3560
|
-
.onComment=${(n,s)=>{const r=this.dispatch({type:
|
|
3561
|
-
></dpk-component-comment-panel>`}renderChrome(e,n){if(this.#c!==null)return this.#
|
|
3565
|
+
.onComment=${(n,s)=>{const r=this.dispatch({type:H,target:n,payload:{body:s}});return r.ok&&(this.#N=null),r}}
|
|
3566
|
+
></dpk-component-comment-panel>`}renderChrome(e,n){if(this.#c!==null)return this.#be(n);const s=e.actions.length,r=e.actions.filter(d=>d.type===H).length,i=new Set(this.derivation.stale.map(d=>d.action.id)),o=e.actions.filter(d=>Q(d)&&!i.has(d.id)).length,a=s-r-o;this.#o=If(this,this.#e,this.derivation.answers,this.notesOpen&&this.reviewSection==="questions"?Bs(this.#e,this.#n):null,(d,c)=>this.grillRefsOf(d,c));const l=this.definition.title(e.state);return m`
|
|
3562
3567
|
<div class="dpk-shell" ?data-resizing=${this.#v.dragging}>
|
|
3563
3568
|
<header class="dpk-header">
|
|
3564
3569
|
<span class="dpk-brand" aria-hidden="true"></span>
|
|
@@ -3571,7 +3576,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
3571
3576
|
<slot name="header"></slot>
|
|
3572
3577
|
</div>
|
|
3573
3578
|
<div class="dpk-header-meta">
|
|
3574
|
-
${this.#
|
|
3579
|
+
${this.#me.render(this.locale)}
|
|
3575
3580
|
<span class="dpk-meta-name">${this.templateIdentity().name}</span>
|
|
3576
3581
|
</div>
|
|
3577
3582
|
<div class="dpk-header-tools">
|
|
@@ -3579,10 +3584,10 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
3579
3584
|
</div>
|
|
3580
3585
|
</header>
|
|
3581
3586
|
${this.#J(n)} ${this.#X(n)}
|
|
3582
|
-
${this.#
|
|
3587
|
+
${this.#ve(e,a,r)} ${this.#we(e)}
|
|
3583
3588
|
${this.#_e(s)} ${this.#Ce()}
|
|
3584
3589
|
</div>
|
|
3585
|
-
`}#
|
|
3590
|
+
`}#be(e){this.#o=[];const n=e.header!==void 0&&e.header!==k||this.querySelector(':scope > [slot="header"]')!==null;return m`
|
|
3586
3591
|
<div class="dpk-shell" data-board ?data-resizing=${this.#v.dragging}>
|
|
3587
3592
|
<div class="dpk-board-bar" ?hidden=${!n}>
|
|
3588
3593
|
<div class="dpk-header-slot">
|
|
@@ -3592,7 +3597,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
3592
3597
|
</div>
|
|
3593
3598
|
${this.#J(e)} ${this.#X(e)}
|
|
3594
3599
|
</div>
|
|
3595
|
-
`}#J(e){const n=L(this.locale),s=e.sidebarHidden===!0||!e.sidebar&&!this.hasSidebarContent(),r=this.sidebarLayout.side,i=this.#Pe,o=!s&&this.#H&&(i?!this.#
|
|
3600
|
+
`}#J(e){const n=L(this.locale),s=e.sidebarHidden===!0||!e.sidebar&&!this.hasSidebarContent(),r=this.sidebarLayout.side,i=this.#Pe,o=!s&&this.#H&&(i?!this.#u.drawerOpen:this.#u.collapsed),a=s?k:this.#ze(o,i);return m`<div class="dpk-body" data-sidebar-side=${r} ?data-sidebar-drawer=${i}>
|
|
3596
3601
|
${r==="right"?a:k}
|
|
3597
3602
|
<aside
|
|
3598
3603
|
id="dpk-sidebar"
|
|
@@ -3600,13 +3605,19 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
3600
3605
|
?hidden=${s||o}
|
|
3601
3606
|
style=${`--dpk-sidebar-width: ${this.#v.width}px`}
|
|
3602
3607
|
>
|
|
3603
|
-
|
|
3604
|
-
|
|
3608
|
+
<div class="dpk-sidebar-body">
|
|
3609
|
+
${e.sidebar??k}
|
|
3610
|
+
<slot name="sidebar"></slot>
|
|
3611
|
+
${this.#ne("sidebar")}
|
|
3612
|
+
</div>
|
|
3605
3613
|
</aside>
|
|
3606
3614
|
${r==="left"?a:k}
|
|
3607
|
-
${i&&!o&&!s?m`<div class="dpk-sidebar-scrim" @click=${()=>this.#
|
|
3615
|
+
${i&&!o&&!s?m`<div class="dpk-sidebar-scrim" @click=${()=>this.#u.closeDrawer()}></div>`:k}
|
|
3608
3616
|
<main class="dpk-main">
|
|
3609
|
-
<div
|
|
3617
|
+
<div
|
|
3618
|
+
class="dpk-main-body"
|
|
3619
|
+
?data-grill-gutter=${this.#o.some(l=>this.contains(l.target)&&this.#te(l)==="main")}
|
|
3620
|
+
>
|
|
3610
3621
|
${this.#O?m`<div class="dpk-banner" role="alert">
|
|
3611
3622
|
<strong>${n.baseDataError}</strong>
|
|
3612
3623
|
<code>${this.#O}</code>
|
|
@@ -3615,70 +3626,70 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
3615
3626
|
<strong>${n.grillError}</strong>
|
|
3616
3627
|
<code>${this.#t}</code>
|
|
3617
3628
|
</div>`}
|
|
3618
|
-
${this.#
|
|
3629
|
+
${this.#f.error===null?k:m`<div class="dpk-banner" role="alert">
|
|
3619
3630
|
<strong>${n.changesError}</strong>
|
|
3620
|
-
<code>${this.#
|
|
3631
|
+
<code>${this.#f.error}</code>
|
|
3621
3632
|
</div>`}
|
|
3622
3633
|
${e.main??k}
|
|
3623
3634
|
<slot name="main"></slot>
|
|
3624
|
-
<section class="dpk-orphans" ?hidden=${this.#
|
|
3635
|
+
<section class="dpk-orphans" ?hidden=${this.#p.orphans===0}>
|
|
3625
3636
|
<p class="dpk-label">previews without metadata</p>
|
|
3626
3637
|
<slot name="preview"></slot>
|
|
3627
3638
|
</section>
|
|
3628
|
-
${this.#
|
|
3639
|
+
${this.#ne("main")}
|
|
3629
3640
|
</div>
|
|
3630
3641
|
${this.#Ue(n)}
|
|
3631
3642
|
</main>
|
|
3632
3643
|
</div>`}#X(e){return e.footer||this.hasFooterContent()?m`<footer class="dpk-footer">
|
|
3633
3644
|
${e.footer??k}
|
|
3634
3645
|
<slot name="footer"></slot>
|
|
3635
|
-
</footer>`:k}#
|
|
3636
|
-
${i?
|
|
3637
|
-
${i&&this.settingsOpen?
|
|
3638
|
-
${this.#
|
|
3639
|
-
</div>`}#
|
|
3646
|
+
</footer>`:k}#ve(e,n,s){const r=this.definition.settings?.(e.state),i=r!==void 0&&r.items.length>0,o=L(this.locale);return m`<div class="dpk-header-actions">
|
|
3647
|
+
${i?za(this.settingsOpen,o,this.#G):k}
|
|
3648
|
+
${i&&this.settingsOpen?Ma(r,o,this.#G):k}
|
|
3649
|
+
${this.#ye(n,s)}
|
|
3650
|
+
</div>`}#xe(){const e=this.renderRoot.querySelector(`#${wn}`),n=this.renderRoot.querySelector(`.${La}`),s=n??this.renderRoot.querySelector(".dpk-header-actions");!e||!s||Fa(e)||this.#E.open(e,s,{width:Pa.width,height:Math.min(Pa.height,window.innerHeight-96)},{placement:n===null?"bottom-end":"bottom-start"})}#ye(e,n){const s=L(this.locale),r=(a,l,d,c)=>{const p=this.notesOpen&&this.#_===a;return m`<button
|
|
3640
3651
|
class="dpk-header-action dpk-review-toggle"
|
|
3641
3652
|
type="button"
|
|
3642
3653
|
data-section=${a}
|
|
3643
|
-
aria-controls=${
|
|
3654
|
+
aria-controls=${Ks}
|
|
3644
3655
|
aria-pressed=${p?"true":"false"}
|
|
3645
3656
|
aria-label=${`${l} (${c??0})`}
|
|
3646
3657
|
data-tooltip=${l}
|
|
3647
3658
|
@click=${()=>{this.notesOpen=!p,this.reviewSection=a}}
|
|
3648
3659
|
>
|
|
3649
3660
|
${d} ${c===null?k:m`<span class="dpk-review-badge">${c}</span>`}
|
|
3650
|
-
</button>`},i=a=>a>0?String(a):null,o=
|
|
3651
|
-
${r("changes",s.reviewChanges,
|
|
3652
|
-
${o.total===0?k:r("questions",s.grill,
|
|
3661
|
+
</button>`},i=a=>a>0?String(a):null,o=Ei(this.#e,this.derivation.answers);return m`<div class="dpk-review-toggles" role="group" aria-label=${s.review}>
|
|
3662
|
+
${r("changes",s.reviewChanges,up(),i(e))}
|
|
3663
|
+
${o.total===0?k:r("questions",s.grill,fp(),`${o.answered}/${o.total}`)}
|
|
3653
3664
|
${r("comments",s.reviewComments,sn(),i(n))}
|
|
3654
|
-
</div>`}#
|
|
3655
|
-
id=${
|
|
3665
|
+
</div>`}#we(e){const n=L(this.locale),s=this.#_,r=s==="changes"?n.reviewChanges:s==="questions"?n.grill:n.reviewComments;return m`<div
|
|
3666
|
+
id=${Ks}
|
|
3656
3667
|
class="dpk-review"
|
|
3657
3668
|
popover="manual"
|
|
3658
3669
|
role="dialog"
|
|
3659
3670
|
aria-label=${r}
|
|
3660
3671
|
data-section=${s}
|
|
3661
3672
|
>
|
|
3662
|
-
${s==="questions"?this
|
|
3673
|
+
${s==="questions"?this.#$e(e.actions.length):k}
|
|
3663
3674
|
${this.renderReviewPanel(e)}
|
|
3664
|
-
</div>`}get#_(){return this.reviewSection==="questions"&&this.#e.questions.length===0?"comments":this.reviewSection}
|
|
3665
|
-
${
|
|
3675
|
+
</div>`}get#_(){return this.reviewSection==="questions"&&this.#e.questions.length===0?"comments":this.reviewSection}#$e(e){const n=L(this.locale),s=Hf(n,this.#e,this.derivation.answers,{open:this.#n,round:this.#r}),r=this.#se(e,!1);return Uf(n,s,this.#a,r?m`<footer class="dpk-grill-footer">${this.#re(r)}</footer>`:k)}#B(e){this.notesOpen=!0,this.reviewSection="questions",this.#r="current",this.#n=e,this.#i=null,this.requestUpdate()}#Se(e,n){this.dispatch(yd(e,n)).ok&&(n.kind==="option"?this.#ee(e):n.kind==="free"&&n.text===""&&(this.#s=e))}#ee(e){const n=kd(this.#e,this.derivation.answers,e);n!==null&&(this.#n=n,this.requestUpdate())}#Ae(){if(!this.notesOpen||this.#_!=="questions")return;const e=this.#s;this.#s=null,e!==null&&this.renderRoot.querySelector(`[data-free-text="${e}"]`)?.focus();const n=Bs(this.#e,this.#n);if(this.#r!=="current"||n===null||n===this.#i)return;this.#i=n;const s=this.renderRoot.querySelector(`.dpk-grill [data-question="${n}"]`),r=s?.closest(".dpk-grill-list");s&&r&&xs(r,s)}#te(e){const n=this.renderRoot.querySelector(".dpk-sidebar");let s=e.target;for(;s!==null&&s!==this;){if(s===n)return"sidebar";const r=s.getRootNode();s=s.assignedSlot??s.parentElement??(r instanceof ShadowRoot?r.host:null)}return"main"}#ne(e){const n=this.#o.filter(r=>this.#te(r)===e);if(n.length===0)return k;const s=L(this.locale);return m`<div class="dpk-grill-badges" data-region=${e}>
|
|
3676
|
+
${n.map(r=>m`<button
|
|
3666
3677
|
type="button"
|
|
3667
3678
|
class="dpk-grill-badge"
|
|
3668
|
-
data-badge=${
|
|
3669
|
-
data-answered=${String(
|
|
3679
|
+
data-badge=${r.index}
|
|
3680
|
+
data-answered=${String(r.answered)}
|
|
3670
3681
|
data-visible="false"
|
|
3671
|
-
aria-pressed=${
|
|
3672
|
-
aria-label=${
|
|
3673
|
-
title=${`${
|
|
3674
|
-
@click=${()=>this.#B(
|
|
3682
|
+
aria-pressed=${r.open?"true":"false"}
|
|
3683
|
+
aria-label=${s.grillOpen(`${r.ref} \xB7 ${r.title}`)}
|
|
3684
|
+
title=${`${r.ref} \xB7 ${r.title}`}
|
|
3685
|
+
@click=${()=>this.#B(r.questionId)}
|
|
3675
3686
|
>
|
|
3676
|
-
${
|
|
3687
|
+
${r.ref}
|
|
3677
3688
|
</button>`)}
|
|
3678
|
-
</div>`}#Te(){const e=this.#
|
|
3679
|
-
${
|
|
3680
|
-
${this.#
|
|
3681
|
-
</div>`}#
|
|
3689
|
+
</div>`}#Te(){const e=this.#f.view;if(!e)return k;const n=L(this.locale);return m`${uf(e,n,this.#w)}
|
|
3690
|
+
${gf(e,n,this.#w)}`}#Ce(){const e=this.#f.view;return e?mf(e,L(this.locale),this.#w):k}#Ee(){const e=this.renderRoot.querySelector(`#${xn}`),n=this.renderRoot.querySelector(".dpk-bell");!e||!n||Fa(e)||this.#E.open(e,n,{width:Ua.width,height:Math.min(Ua.height,window.innerHeight-96)})}async#Re(e){const n={};this.#b=n;const s=this.derivation.state,r=e.target===null?null:this.definition.canonicalTarget?.(s,ut(e.target))??ut(e.target),i=au({...e,target:r&&I(r)},a=>this.definition.navigationFor?this.definition.navigationFor(s,a):null);if(!i||(i.navigate&&this.navigate(i.navigate),r===null))return;r.type===se?this.#B(r.id):this.showTarget(r);const o=I(r);for(let a=0;a<Hg;a+=1){if(await this.updateComplete,await Ug(),this.#b!==n)return;const l=Ea(this,o);if(!(l===null||l.getClientRects().length===0)){rg(this,l),ag(l);return}}}showTarget(e){}#_e(e){const n=this.#se(e,this.notesOpen);if(!n)return k;const s=L(this.locale);return m`<div class="dpk-dock" role="group" aria-label=${s.handoffLabel}>
|
|
3691
|
+
${this.#re(n)}
|
|
3692
|
+
</div>`}#se(e,n){return Ju({actions:e,railOpen:n,sendable:this.canSendToClaude,locale:this.locale},this.#k.state)}#re(e){const n=L(this.locale);return m`${e.note?m`<p class="dpk-dock-note" role="alert">${e.note}</p>`:k}
|
|
3682
3693
|
<div class="dpk-dock-actions">
|
|
3683
3694
|
${e.send?m`<button
|
|
3684
3695
|
class="dpk-btn dpk-btn--accent"
|
|
@@ -3701,30 +3712,30 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
3701
3712
|
class="dpk-lang-select"
|
|
3702
3713
|
aria-label=${n}
|
|
3703
3714
|
title=${n}
|
|
3704
|
-
@change=${
|
|
3715
|
+
@change=${$s(s=>{const r=In.find(i=>i===s);r!==void 0&&this.#V.pick(r)})}
|
|
3705
3716
|
>
|
|
3706
|
-
${
|
|
3707
|
-
${
|
|
3717
|
+
${In.map(s=>m`<option value=${s} lang=${s} ?selected=${s===e}>
|
|
3718
|
+
${Ed[s]}
|
|
3708
3719
|
</option>`)}
|
|
3709
3720
|
</select>`}#Le(){const e=this.dataset.theme==="dark",n=L(this.locale),s=e?n.useLightTheme:n.useDarkTheme;return m`<button
|
|
3710
3721
|
class="dpk-theme-toggle"
|
|
3711
3722
|
type="button"
|
|
3712
3723
|
aria-label=${s}
|
|
3713
3724
|
title=${s}
|
|
3714
|
-
@click=${()=>this.#m.toggle(
|
|
3725
|
+
@click=${()=>this.#m.toggle(St(this.theme))}
|
|
3715
3726
|
>
|
|
3716
|
-
${e?
|
|
3717
|
-
</button>`}get#H(){return this.sidebarLayout.collapsible!==!1}get#Pe(){return this.#A.narrow&&this.#H&&this.sidebarLayout.narrow!=="stack"}#ze(e,n){const s=this.#H?this.#Me(e,n):k;return e||n?m`<div class="dpk-sidebar-strip">${s}</div>`:this.sidebarLayout.side==="left"?m`${this.#
|
|
3727
|
+
${e?Sp():Ap()}
|
|
3728
|
+
</button>`}get#H(){return this.sidebarLayout.collapsible!==!1}get#Pe(){return this.#A.narrow&&this.#H&&this.sidebarLayout.narrow!=="stack"}#ze(e,n){const s=this.#H?this.#Me(e,n):k;return e||n?m`<div class="dpk-sidebar-strip">${s}</div>`:this.sidebarLayout.side==="left"?m`${this.#ie()}${s}`:m`${s}${this.#ie()}`}#Me(e,n){const s=L(this.locale),r=mg(this.sidebarLayout.side,e),i=r.action==="collapse"?s.collapseSidebar:s.expandSidebar;return m`<button
|
|
3718
3729
|
class="dpk-sidebar-toggle"
|
|
3719
3730
|
type="button"
|
|
3720
3731
|
aria-controls="dpk-sidebar"
|
|
3721
3732
|
aria-expanded=${e?"false":"true"}
|
|
3722
3733
|
aria-label=${i}
|
|
3723
3734
|
title=${i}
|
|
3724
|
-
@click=${()=>{this.#M=!0,n?this.#
|
|
3735
|
+
@click=${()=>{this.#M=!0,n?this.#u.toggleDrawer():this.#u.toggle()}}
|
|
3725
3736
|
>
|
|
3726
|
-
${r.points==="left"?
|
|
3727
|
-
</button>`}#
|
|
3737
|
+
${r.points==="left"?Zi():kt()}
|
|
3738
|
+
</button>`}#ie(){const e=L(this.locale),n=this.#v.handlers;return m`<div
|
|
3728
3739
|
class="dpk-sidebar-resizer"
|
|
3729
3740
|
role="separator"
|
|
3730
3741
|
tabindex="0"
|
|
@@ -3740,7 +3751,7 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
3740
3751
|
@pointercancel=${n.pointercancel}
|
|
3741
3752
|
@keydown=${n.keydown}
|
|
3742
3753
|
@dblclick=${n.dblclick}
|
|
3743
|
-
></div>`}render(){if(!this.#
|
|
3754
|
+
></div>`}render(){if(!this.#d)return k;const e=this.#de();return this.renderChrome(e,this.renderRegions(e))}get sidebarLayout(){return hg}hasSidebarContent(){return this.querySelector('[slot="sidebar"]')!==null}hasFooterContent(){return this.querySelector('[slot="footer"]')!==null}context(){return this.#de()}#x(){return this.#c===null?null:nf(this)}get#U(){return this.#c===null?this.definition.name:`${this.definition.name}@${this.#c}`}#F(e){const n=this.#x();if(n===null)return{ok:!1,issues:[{path:"board",message:"the page is not ready yet"}]};const s=e(n);return this.requestUpdate(),s}#oe(e,n){const s=this.#x(),r=this.#c,i=Qt(e,n);return r===null||s===null?i:Xu(i,r,s.boardIds())}#ae(e){const n=this.controller.descriptorFor(e.type)?.targetType??"page";return{...e,target:this.#oe(e.target,n)}}#le(e){const n=this.#x(),s=this.#c;return n===null||s===null?e:of(n.navigation(),s,e,n.boardIds(),this.definition.navigationHierarchy)}#W(){return{definition:this.definition,controller:()=>this.controller,derivation:()=>this.derivation,ready:this.#ke,navigation:()=>this.#C(),issues:()=>this.controller.lastIssues,dispatch:e=>this.dispatch(e),dispatchBatch:e=>this.dispatchBatch(e),subscribe:e=>(this.#D.add(e),()=>{this.#D.delete(e)}),editComment:(e,n)=>this.editComment(e,n),removeAction:e=>this.removeAction(e),clearActions:()=>this.clearActions(),navigate:(e,n)=>this.navigate(e,n),hashFor:e=>this.hashFor(e),requestComment:e=>this.requestComment(e),brief:e=>this.buildBrief(e)}}#Ie(){return lf(this.#W(),this)}#ce(){return la(this.#W())}#de(){return af(this.#W())}#C(){const e=this.#x(),n=this.#c===null?this.#$:Is(e?.navigation()??mt,this.#c);return this.#d?this.definition.resolveNavigation(this.derivation.state,n):n}#Ne(){const e=this.#qe(),n=this.#c!==null;this.#e=n?Ve:this.readGrill(),this.#De(),this.#$=n?mt:Sa(),this.#j=this.locale;const s=this.storageKey;this.#d=new Yo({definition:this.definition,base:e,storage:n?null:this.#je(),grill:{grill:this.#e,locale:this.locale},...typeof s=="string"?{storageKey:s}:{}}),this.#Y(),this.#S(),this.#z(!0),this.#Q?.(),this.#Be(),this.requestUpdate()}#De(){this.querySelector(`:scope > [slot="${ja}"]`)!==null&&console.warn(`[dev-process-kit] <${this.tagName.toLowerCase()}> no longer shows slot="${ja}"; slot each piece as slot="${Ws}" data-name="\u2026" instead.`)}#je(){return this.storage==="off"?null:this.storage==="memory"?new Os:Ls()}scriptOf(e){return this.querySelector(e)}pendingStart(){return null}templateIdentity(){return this.definition}buildBrief(e){return tn(e,this.controller.definition,X)}#qe(){const e=this.scriptOf(Vs);if(e===null&&this.hasAttribute(ia))return this.definition.emptyBase();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.#O='no <script type="application/json"> child found',this.definition.emptyBase();try{return this.definition.parseBase(JSON.parse(e.textContent))}catch(n){return console.error("[dev-process-kit] invalid base data:",n),this.#O=n instanceof Error?n.message:String(n),this.definition.emptyBase()}}readGrill(){return this.#t=null,this.parseGrillScript(this.scriptOf(Bg))}parseGrillScript(e,n){if(!e?.textContent||e.textContent.trim().length===0)return Ve;try{return gd(JSON.parse(e.textContent))}catch(s){console.error(`[dev-process-kit] invalid questions${n===void 0?"":` in ${n}`}:`,s);const r=s instanceof Error?s.message:String(s);return this.#t=n===void 0?r:`${n}: ${r}`,Ve}}refreshGrill(){this.#c!==null||!this.#d||(this.#e=this.readGrill(),this.#d.setGrill({grill:this.#e,locale:this.locale}),this.requestUpdate())}grillRefsOf(e,n){return[n]}#Be(){this.scriptOf(Vs)||(this.#R=new MutationObserver(()=>{const e=this.scriptOf(Vs);if(e){this.#R?.disconnect(),this.#R=void 0,this.#c===null&&(this.#e=this.readGrill()),this.controller.setGrill({grill:this.#e,locale:this.locale});try{this.controller.setBase(this.definition.parseBase(JSON.parse(e.textContent??"null")))}catch(n){console.error("[dev-process-kit] invalid base data:",n)}}}),this.#R.observe(this,{childList:!0,subtree:!0}))}#T(){const e=this.#ce();for(const n of this.#D)n(e)}#He(){if(!this.isConnected){this.requestUpdate(),this.#T();return}this.#c===null&&this.#z(!0),ma(this.#P,this.controller.actions),queueMicrotask(this.#S),this.requestUpdate(),this.#T(),this.#c===null&&this.dispatchEvent(new CustomEvent("dpk-change",{detail:this.#ce(),bubbles:!0,composed:!0}))}#z(e){if(this.#c!==null)return;const n=this.#C();this.#$=n,Xf(n,e)}#pe=()=>{this.#$=Sa(),this.#z(!0),this.requestUpdate(),this.#T(),this.dispatchEvent(new CustomEvent("dpk-navigate",{detail:{navigation:this.#$},bubbles:!0,composed:!0}))};#S=()=>{this.#L?.disconnect(),this.#P=Tf(this,e=>{this.isConnected&&this.#L?.observe(e,{childList:!0,subtree:!0})}),this.#d&&(ma(this.#P,this.#d.actions),this.#d.setComponentSnapshot(Ef(this.#P)))};#he=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!this.#d)return;const n=e.detail;typeof n!="object"||n===null||!("target"in n)||typeof n.target!="string"||(this.#S(),!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(r=>r.value===n.target))||this.requestComment(n.target)};#ue=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!e.cancelable||!this.#d)return;const n=C(hu,e.detail);if(!n.success)return;this.#S();const{target:s,body:r}=n.output;if(!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(a=>a.value===s))return;this.dispatch({type:H,target:s,payload:{body:r}}).ok&&e.preventDefault()};#fe=e=>{if(e.stopPropagation(),!(e instanceof CustomEvent)||!e.cancelable||!this.#d)return;const n=C(od,e.detail);if(!n.success)return;this.#S();const{type:s,target:r,payload:i}=n.output;if(!this.controller.definition.commentTargets(this.derivation.state,this.navigation).some(l=>l.value===r))return;this.dispatch({type:s,target:r,payload:i}).ok&&e.preventDefault()};#ge=e=>{for(const n of e.composedPath()){if(!(n instanceof Element))continue;if(n===this||n.hasAttribute("data-template"))break;const s=n.getAttribute("data-dpk-navigate");if(s!==null){e.preventDefault(),this.navigate(Xt(s.includes("=")?s:`step=${s}`));return}const r=n.getAttribute("data-dpk-comment");if(r!==null){e.preventDefault(),this.requestComment(r);return}}};#Ue(e){const n=yg(this,e.memo),s=Sg(this.#h,n),r=i=>{this.#h=i,this.requestUpdate()};return m`<div class="dpk-supplements" ?hidden=${n.length===0} ?data-open=${s!==null}>
|
|
3744
3755
|
<div class="dpk-supplements-bar" role="group" aria-label=${e.supplements}>
|
|
3745
3756
|
<button
|
|
3746
3757
|
type="button"
|
|
@@ -3748,22 +3759,22 @@ The brief is too long for a comment, so it is stored in this artifact's database
|
|
|
3748
3759
|
aria-expanded=${String(s!==null)}
|
|
3749
3760
|
aria-controls="dpk-supplements-body"
|
|
3750
3761
|
aria-label=${s===null?e.openSupplements:e.closeSupplements}
|
|
3751
|
-
@click=${()=>r(
|
|
3762
|
+
@click=${()=>r(Tg(this.#h,n))}
|
|
3752
3763
|
>
|
|
3753
|
-
${
|
|
3764
|
+
${kt()}
|
|
3754
3765
|
</button>
|
|
3755
3766
|
${n.map(i=>m`<button
|
|
3756
3767
|
type="button"
|
|
3757
3768
|
class="dpk-supplement-tab"
|
|
3758
3769
|
aria-expanded=${String(i===s)}
|
|
3759
3770
|
aria-controls="dpk-supplements-body"
|
|
3760
|
-
@click=${()=>r(
|
|
3771
|
+
@click=${()=>r(Ag(this.#h,i.element))}
|
|
3761
3772
|
>
|
|
3762
3773
|
${i.name}
|
|
3763
3774
|
</button>`)}
|
|
3764
3775
|
</div>
|
|
3765
3776
|
<div class="dpk-supplements-body" id="dpk-supplements-body" ?hidden=${s===null}>
|
|
3766
|
-
<style .textContent=${s===null?"":
|
|
3767
|
-
<slot name=${
|
|
3777
|
+
<style .textContent=${s===null?"":wg(this,s)}></style>
|
|
3778
|
+
<slot name=${Ws} @slotchange=${()=>this.requestUpdate()}></slot>
|
|
3768
3779
|
</div>
|
|
3769
|
-
</div>`}#Fe(){const e=this.renderRoot.querySelector(".dpk-shell"),n=this.renderRoot.querySelector(".dpk-dock-actions");e&&(n?e.style.setProperty("--dpk-dock-space",`${n.offsetWidth+8}px`):e.style.removeProperty("--dpk-dock-space"))}#We(){this.#
|
|
3780
|
+
</div>`}#Fe(){const e=this.renderRoot.querySelector(".dpk-shell"),n=this.renderRoot.querySelector(".dpk-dock-actions");e&&(n?e.style.setProperty("--dpk-dock-space",`${n.offsetWidth+8}px`):e.style.removeProperty("--dpk-dock-space"))}#We(){this.#p.route()}}export{wt as $,nn as A,sn as B,H as C,Xi as D,mt as E,bp as F,Gi as G,Qi as H,ds as I,Ki as J,Wi as K,Vo as L,Os as M,Xt as N,ut as O,Vc as P,en as Q,Kc as R,ns as S,Fg as T,ui as U,I as V,_s as W,Kt as X,Qt as Y,Dt as Z,So as _,ss as a,Zr as a$,Nt as a0,$l as a1,fe as a2,k as a3,m as a4,Me as a5,kp as a6,il as a7,vs as a8,me as a9,Tp as aA,xs as aB,ci as aC,di as aD,ri as aE,ti as aF,es as aG,ld as aH,B as aI,cd as aJ,Xe as aK,he as aL,Fh as aM,$s as aN,Gh as aO,mn as aP,Ee as aQ,wi as aR,Rh as aS,Ea as aT,va as aU,Jr as aV,si as aW,Wc as aX,Uc as aY,Ge as aZ,yr as a_,vo as aa,Dn as ab,wp as ac,$p as ad,Vt as ae,z as af,D as ag,j as ah,v as ai,Wt as aj,y as ak,$ as al,pi as am,Gt as an,ve as ao,G as ap,Jn as aq,kt as ar,yp as as,C as at,O as au,Yn as av,Xn as aw,xo as ax,Ep as ay,Cp as az,Yr as b,A as b0,Ui as b1,qi as b2,Bi as b3,Mn as b4,hp as b5,Cr as b6,bo as b7,it as b8,Pt as b9,bn as bA,oa as bB,Da as bC,Ms as bD,ia as bE,ra as bF,os as bG,L as bH,La as bI,za as bJ,Ma as bK,se as bL,Pn as ba,Zi as bb,Vi as bc,mp as bd,ls as be,Xr as bf,ni as bg,ii as bh,Wh as bi,Fi as bj,$o as bk,ji as bl,Hi as bm,te as bn,zs as bo,na as bp,Q as bq,Is as br,ef as bs,Ps as bt,rf as bu,aa as bv,ta as bw,sa as bx,ht as by,li as bz,Yo as c,mi as d,Qc as e,tn as f,ki as g,ft as h,Wo as i,jn as j,fi as k,Xc as l,ts as m,Ls as n,kn as o,Gc as p,Np as q,Rc as r,Dh as s,Go as t,Pe as u,X as v,Yc as w,Qe as x,xp as y,vp as z};
|