1import{Y as C,_ as L}from"../post-GibXXg97.js";import{F as S}from"../base-Ci7vLHE_.js";import q from"./g2ui-posted-message-mGANrOaz.js";import A from"./g2ui-highlight-message-BAvnr_hU.js";import"../events-DNd9BXmE.js";import"../preload-helper-BVLnHgTN.js";import"./g2ui-avatar-buYzc9-t.js";import"./g2ui-lightbox-BlkDBrpN.js";var R=Object.defineProperty,f=s=>{throw TypeError(s)},M=(s,e,t)=>e in s?R(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,x=(s,e,t)=>M(s,e+"",t),g=(s,e,t)=>e.has(s)||f("Cannot "+t),c=(s,e,t)=>(g(s,e,"read from private field"),e.get(s)),p=(s,e,t)=>e.has(s)?f("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(s):e.set(s,t),b=(s,e,t,o)=>(g(s,e,"write to private field"),e.set(s,t),t),v=(s,e,t)=>(g(s,e,"access private method"),t),l,n,u,m;const w=class y extends C{constructor(){super(),p(this,u),p(this,l),p(this,n,!1),b(this,l,S().newTranslator())}connectedCallback(){super.connectedCallback(),v(this,u,m).call(this),c(this,n)||b(this,n,!0)}attributeChangedCallback(e,t,o){var r,a;if(c(this,n)&&(super.attributeChangedCallback(e,t,o),(e==="features"||e==="display"||e==="user-id")&&t!==o)){for(const d of this.value.messages.values())((r=this.value.thread)==null?void 0:r.id)===d.id&&this.showThread(d,{force:!0});(a=this.shadowRoot.querySelector("div.post"))==null||a.remove(),v(this,u,m).call(this)}}static register(){q.register(),A.register(),L(),customElements.get("g2ui-message-feed")||customElements.define("g2ui-message-feed",y)}};l=new WeakMap,n=new WeakMap,u=new WeakSet,m=function(){const s=this.value.features,e=this.value.display;if(s.includes("post")&&this.getAttribute("user-id")&&!this.shadowRoot.querySelector("div.post")){const t=this.shadowRoot.ownerDocument.createElement("div");t.classList.add("post");const o=this.listenerRegistry.get(t);t.innerHTML=` 2 ${e.includes("compose")?'<button type="button" class="new">+</button>':""} 3 <dialog> 4 <header> 5 <h2>${c(this,l).lookup("post_a_message")}</h2> 6 <button type="button" class="close">${c(this,l).lookup("close")}</button> 7 </header> 8 </dialog> 9 `;const r=t.querySelector("button.new"),a=t.querySelector("dialog"),d=t.querySelector("button.close");o.getChildListener(d).addEventListener("click",()=>a.close()),o.getChildListener(a).addEventListener("close",()=>{a.dispatchEvent(new Event("modal:close",{bubbles:!0,composed:!0}))}),r&&o.getChildListener(r).addEventListener("click",()=>{let i=a.querySelector("g2ui-post-message");i||(i=this.ownerDocument.createElement("g2ui-post-message"),i.setAttribute("user-id",this.getAttribute("user-id")),i.setAttribute("user-name",this.getAttribute("user-name")),i.setAttribute("user-avatar",this.getAttribute("user-avatar")),i.setAttribute("features",s.includes("subject")?"subject":""),o.getChildListener(i).addEventListener("posted",async({detail:{formData:k,message:h}})=>{const E=this.addMessages([h.value]);a.close(),await this.value.postMessage(h.value,k),E.complete(),h.classList.remove("loading")}),a.appendChild(i)),a.showModal(),a.dispatchEvent(new Event("modal:open",{bubbles:!0,composed:!0}))}),this.shadowRoot.insertBefore(t,this.shadowRoot.querySelector(".wrapper")||this.shadowRoot.querySelector("link").nextElementSibling)}},x(w,"adopt",[new URL("/apps/framework/build/css/g2ui-message-feed-BYXKGkyu.css",import.meta.url)]);let F=w;export{F as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.