PageSourceSearch

https://estimator.faector.nl/apps/framework/build/web-component/g2ui-highlight-message-BAvnr_hU.js

js faector.nl collected 2026-10-03 21:41:13 UTC 11,335 bytes, 1 lines download raw bytes

1import{p as yt,I as J,E as _}from"../base-Ci7vLHE_.js";import{p as tt,w as St}from"../events-DNd9BXmE.js";import bt from"./g2ui-avatar-buYzc9-t.js";import"../preload-helper-BVLnHgTN.js";var kt=Object.defineProperty,et=o=>{throw TypeError(o)},qt=(o,t,e)=>t in o?kt(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,Lt=(o,t,e)=>qt(o,t+"",e),Y=(o,t,e)=>t.has(o)||et("Cannot "+e),s=(o,t,e)=>(Y(o,t,"read from private field"),e?e.call(o):t.get(o)),a=(o,t,e)=>t.has(o)?et("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(o):t.set(o,e),n=(o,t,e,i)=>(Y(o,t,"write to private field"),t.set(o,e),e),d=(o,t,e)=>(Y(o,t,"access private method"),e),l,S,R,b,k,g,w,q,x,v,L,y,f,O,A,E,B,M,P,C,W,h,c;class Et{constructor(t){a(this,h),a(this,l),a(this,S,null),a(this,R,null),a(this,b,null),a(this,k,null),a(this,g,!1),a(this,w,null),a(this,q,null),a(this,x,null),a(this,v,0),a(this,L,null),a(this,y,null),a(this,f,null),a(this,O),a(this,A),a(this,E,[]),a(this,B,[]),a(this,M,null),a(this,P,null),a(this,C,null),a(this,W,!1),n(this,l,t),n(this,A,new Map),n(this,L,new Map),n(this,O,new J)}get type(){return"highlight"}get element(){return s(this,l)}set id(t){n(this,S,t||null),s(this,l).setAttribute("message-id",s(this,S)||"")}get id(){return s(this,S)}set feedId(t){n(this,R,t||null),s(this,l).setAttribute("feed-id",s(this,R)||"")}get feedId(){return s(this,R)}get inReplyTo(){return null}set sortId(t){t!==s(this,b)&&(n(this,b,t),d(this,h,c).call(this).dataset.sortId=s(this,b))}get sortId(){return s(this,b)}set time(t){var e;if(t.getTime()===((e=s(this,y))==null?void 0:e.getTime()))return;n(this,y,t);const i=d(this,h,c).call(this),r=i.querySelector("footer.meta")||i.ownerDocument.createElement("footer");r.classList.add("meta"),i.insertBefore(r,i.querySelector(".actions"));const m=r.querySelector("time")||i.ownerDocument.createElement("time");m.setAttribute("datetime",s(this,y).toISOString()),m.textContent=s(this,y),r.appendChild(m)}get time(){return s(this,y)}get title(){return s(this,k)}get titleHide(){return s(this,g)}get subtitle(){return s(this,w)}get routing(){return s(this,L)}get authorUserId(){return s(this,P)}get recipients(){return s(this,E)}get feeds(){return s(this,M)}set features(t){n(this,B,t),s(this,l).setAttribute("features",t.join(" "))}get features(){return s(this,B)}set title(t){if(s(this,k)===t)return;n(this,k,t);const e=d(this,h,c).call(this),i=e.querySelector(".body")||e.ownerDocument.createElement("div");i.classList.add("body");const r=e.querySelector("h1")||e.ownerDocument.createElement("h1");r.textContent=s(this,k),r.classList.toggle("hide",s(this,g)),i.insertBefore(r,i.firstElementChild),e.insertBefore(i,e.firstElementChild)}set subtitle(t){if(s(this,w)===t)return;n(this,w,t);const e=d(this,h,c).call(this),i=e.querySelector(".body")||e.ownerDocument.createElement("div");i.classList.add("body");const r=e.querySelector("h2")||e.ownerDocument.createElement("h2");r.classList.toggle("hide",s(this,g)),s(this,w)?(r.textContent=s(this,w),i.appendChild(r)):r.remove(),e.insertBefore(i,e.firstElementChild)}set titleHide(t){var e,i;if(s(this,g)===t)return;n(this,g,t);const r=d(this,h,c).call(this);(e=r.querySelector("h1"))==null||e.classList.toggle("hide",s(this,g)),(i=r.querySelector("h2"))==null||i.classList.toggle("hide",s(this,g))}get content(){return s(this,q)}set content(t){if(t===s(this,q))return;n(this,q,t);const e=d(this,h,c).call(this),i=e.querySelector(".content")||e.ownerDocument.createElement("div");i.classList.add("content"),i.innerHTML=s(this,q),i.parentNode||e.insertBefore(i,e.querySelector("div.actions"))}set routing(t){if(t===s(this,L))return;n(this,L,t);const e=d(this,h,c).call(this),i=s(this,l).shadowRoot.querySelector("script.routing")||e.ownerDocument.createElement("script");i.classList.add("routing"),i.type="application/json",i.textContent=JSON.stringify(Object.fromEntries(t)),i.parentNode||s(this,l).shadowRoot.insertBefore(i,e)}set recipients(t){if(t===s(this,E))return;n(this,E,t);const e=d(this,h,c).call(this);e.dataset.recipients=s(this,E).join(" ")}set feeds(t){if(t===s(this,M))return;n(this,M,t.map(i=>i.toString()));
1const e=d(this,h,c).call(this);e.dataset.feeds=s(this,M).join(" ")}get source(){return s(this,x)}set source(t){if(t===s(this,x))return;n(this,x,t);const e=d(this,h,c).call(this),i=e.querySelector(".content")||e.ownerDocument.createElement("div");i.classList.add("content"),i.dataset.source=t,i.parentNode||e.insertBefore(i,e.querySelector("div.actions"))}set colorOverlay(t){if(t===s(this,v))return;n(this,v,t);const e=d(this,h,c).call(this).querySelector("picture");e==null||e.classList.remove(...e.classList),e==null||e.classList.add("color-overlay"),e==null||e.classList.add(`color-overlay--${s(this,v)}`)}get colorOverlay(){return s(this,v)}set pinned(t){if(t===s(this,W))return;n(this,W,t);const e=s(this,l).querySelector("button.pin-status");e&&e.classList.toggle("disabled",!s(this,W))}get pinned(){return s(this,W)}get stats(){return s(this,f)}set stats(t){if(t===s(this,f))return;n(this,f,t);const e=s(this,l).querySelector("button.likes");e&&(e.classList.toggle("actioned",s(this,f).liked),e.textContent=s(this,f).likes.toString());const i=s(this,l).querySelector("button.replies");i&&(i.textContent=s(this,f).replies.toString());const r=s(this,l).querySelector("button.unread");r&&(r.classList.toggle("disabled",!this.stats.hasBadge),r.textContent=s(this,f).badgeContent)}set conversation(t){if(t===s(this,C))return;n(this,C,t),d(this,h,c).call(this).classList.toggle("conversation-disabled",!s(this,C));const e=s(this,l).querySelector("button.replies");e&&e.classList.toggle("disabled",!this.conversation)}get conversation(){return s(this,C)}set attachments(t){n(this,O,t);const e=d(this,h,c).call(this);e.querySelectorAll("picture").forEach(r=>r.remove());const i=t.images;if(i.length===1){const r=e.ownerDocument.createElement("picture"),m=e.ownerDocument.createElement("img");m.src=i[0].url,m.dataset.name=i[0].name,m.dataset.mime=i[0].mime,r.classList.add("color-overlay"),r.classList.add(`color-overlay--${s(this,v)}`),r.appendChild(m),e.insertBefore(r,e.querySelector(".content")||e.querySelector(".actions"))}}get attachments(){return s(this,O)}addReply(t){s(this,A).set(t.id,t)}removeReply(t){s(this,A).delete(t.id)}get replies(){return s(this,A)}updateWithServerData(t){this.id=t.id,this.feedId=t.feedId,this.features=t.features,this.sortId=t.sortId,this.title=t.title,this.titleHide=t.titleHide,this.subtitle=t.subtitle,this.colorOverlay=t.colorOverlay,this.content=t.content,this.source=t.source,this.routing=new Map(Object.entries(t.routing)),this.attachments=new J((t.attachments||[]).map(e=>new _(e.src,e.name,e.mime))),this.conversation=t.conversation,this.recipients=t.recipients,this.feeds=t.feeds,this.pinned=t.pinned,this.time=new Date(t.time)}copy(t){this.id=t.id,this.feedId=t.feedId,this.sortId=t.sortId,this.title=t.title,this.titleHide=t.titleHide,this.subtitle=t.subtitle,this.colorOverlay=t.colorOverlay,this.content=t.content,this.source=t.source,this.routing=t.routing,this.attachments=t.attachments,this.conversation=t.conversation,this.recipients=t.recipients,this.feeds=t.feeds,this.pinned=t.pinned,this.time=t.time}get feed(){var t;return((t=s(this,l).feed)==null?void 0:t.value)||null}parse(){var t,e,i,r,m,z,G,K;const p=s(this,l),u=p.shadowRoot.querySelector(".wrapper");if(!u)return null;const H=u.querySelector("h1"),N=p.querySelector("button.likes"),T=p.querySelector("button.unread"),Q=p.querySelector("button.pin-status"),nt=((t=u.querySelector(".content"))==null?void 0:t.innerHTML)||"",rt=((e=u.querySelector(".content"))==null?void 0:e.dataset.source)||"",V=((i=p.shadowRoot.querySelector("script.routing"))==null?void 0:i.textContent)||null,ot=parseInt((N==null?void 0:N.textContent)||0),at=N&&N.classList.contains("actioned"),lt=parseInt((T==null?void 0:T.textContent)||0),ht=Q&&!Q.classList.contains("disabled"),ct=T&&T.classList.contains("notified"),ut=!u.classList.contains("conversation-disabled"),dt=parseInt(((r=p.querySelector(".replies"))==null?void 0:r.textContent)||0),pt=(H==null?void 0:H.textContent.trim())||null,mt=!!(H!=null&&H.classList.contains("hide")),gt=((m=u.querySelector("h2"))==null?void 0:m.textContent.trim())||null,X=(z=u.querySelector("time"))==null?void 0:z.getAttribute("datetime"),U=u.querySelector("picture img"),Z=u.querySelector("picture"),ft=((G=u.dataset.recipients)==null?void 0:G.split(" "))||[],wt=((K=u.dataset.feeds)==null?void 0:K.split(" "))||[],vt=new Date(X);let $=0;if(Z){for(const D of Z.classList.values())D.startsWith("color-overlay--")&&($=parseInt(D.substring(15)));($>100||$<0)&&($=0)}n(this,S,p.hasAttribute("message-id")?p.getAttribute("message-id"):null),n(this,R,p.hasAttribute("feed-id")?p.getAttribute("feed-id"):null),n(this,B,(p.hasAttribute("features")?p.getAttribute("features"):"").split(" ").map(D=>D.trim()).filter(D=>!!D)),n(this,q,nt),n(this,x,rt),n(this,L,V?new Map(Object.entries(JSON.parse(V))):new Map),n(this,k,pt),n(this,g,mt),n(this,w,gt),n(this,v,$),n(this,y,vt),n(this,P,u.dataset.authorUserId||null),n(this,C,ut),n(this,b,u.dataset.sortId||`000-${X}-${s(this,S)}
1`),n(this,f,new St(ot,dt,at,ct,lt)),n(this,O,new J(U?[new _(U.src,U.dataset.name,U.dataset.mime)]:[])),n(this,E,ft),n(this,M,wt),n(this,W,ht)}}l=new WeakMap,S=new WeakMap,R=new WeakMap,b=new WeakMap,k=new WeakMap,g=new WeakMap,w=new WeakMap,q=new WeakMap,x=new WeakMap,v=new WeakMap,L=new WeakMap,y=new WeakMap,f=new WeakMap,O=new WeakMap,A=new WeakMap,E=new WeakMap,B=new WeakMap,M=new WeakMap,P=new WeakMap,C=new WeakMap,W=new WeakMap,h=new WeakSet,c=function(){let o=s(this,l).shadowRoot.querySelector(".wrapper")||s(this,l).shadowRoot.ownerDocument.createElement("div");return o.classList.add("wrapper"),o.parentNode||s(this,l).shadowRoot.insertBefore(o,s(this,l).shadowRoot.firstElementChild.nextElementSibling),o};var j,F,I;const st=class it extends yt{constructor(){super(),a(this,j,!0),a(this,F,null),a(this,I),n(this,j,this.isDeclarativeShadowDom);let t=this.shadowRoot.querySelector(".wrapper");if(!t){t=this.ownerDocument.createElement("div"),t.classList.add("wrapper");const e=this.ownerDocument.createElement("div");e.classList.add("actions");const i=this.ownerDocument.createElement("slot");i.name="actions",this.shadowRoot.appendChild(t),t.appendChild(e),e.appendChild(i)}n(this,I,new Et(this))}connectedCallback(){s(this,j)&&(s(this,I).parse(),n(this,j,!1)),this.shadowRoot.querySelector(".wrapper").addEventListener("click",this,!1)}disconnectedCallback(){this.shadowRoot.querySelector(".wrapper").removeEventListener("click",this,!1)}handleEvent(t){const e=t.target;if(t.type==="click"){if(!this.shadowRoot.contains(e))return;const i=e.closest("a");if(i&&i.closest(".content")){t.preventDefault();const r=new tt("message:link:click",s(this,I),{cancelable:!0});i.dispatchEvent(r),r.defaultPrevented||window.open(i.href,"_blank");return}this.dispatchEvent(new tt("highlight:click",s(this,I)))}}set feed(t){n(this,F,t)}get feed(){return s(this,F)}get value(){return s(this,I)}static register(){bt.register(),customElements.get("g2ui-highlight-message")||customElements.define("g2ui-highlight-message",it)}};j=new WeakMap,F=new WeakMap,I=new WeakMap,Lt(st,"adopt",[new URL("/apps/framework/build/css/g2ui-highlight-message-vF4YS-iM.css",import.meta.url)]);let Dt=st;export{Dt 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.