helldots 0.3.0

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.
@@ -0,0 +1,1032 @@
1
+ var HellDots=(()=>{var ce=Object.defineProperty;var wt=Object.getOwnPropertyDescriptor;var Ot=Object.getOwnPropertyNames;var vt=Object.prototype.hasOwnProperty;var At=(t,e)=>{for(var o in e)ce(t,o,{get:e[o],enumerable:!0})},Nt=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Ot(e))!vt.call(t,r)&&r!==o&&ce(t,r,{get:()=>e[r],enumerable:!(n=wt(e,r))||n.enumerable});return t};var Rt=t=>Nt(ce({},"__esModule",{value:!0}),t);var Nn={};At(Nn,{CommentOverlay:()=>we,createCommentOverlay:()=>St,default:()=>An});var Be="[modern-screenshot]",I=typeof window<"u",It=I&&"Worker"in window,In=I&&"atob"in window,Ln=I&&"btoa"in window,pe=I?window.navigator?.userAgent:"",Pe=pe.includes("Chrome"),K=pe.includes("AppleWebKit")&&!Pe,ue=pe.includes("Firefox"),Lt=t=>t&&"__CONTEXT__"in t,Bt=t=>t.constructor.name==="CSSFontFaceRule",Pt=t=>t.constructor.name==="CSSImportRule",Mt=t=>t.constructor.name==="CSSLayerBlockRule",O=t=>t.nodeType===1,G=t=>typeof t.className=="object",Me=t=>t.tagName==="image",$t=t=>t.tagName==="use",X=t=>O(t)&&typeof t.style<"u"&&!G(t),Dt=t=>t.nodeType===8,kt=t=>t.nodeType===3,$=t=>t.tagName==="IMG",Z=t=>t.tagName==="VIDEO",Ht=t=>t.tagName==="CANVAS",Xt=t=>t.tagName==="TEXTAREA",Ut=t=>t.tagName==="INPUT",Ft=t=>t.tagName==="STYLE",Gt=t=>t.tagName==="SCRIPT",Vt=t=>t.tagName==="SELECT",zt=t=>t.tagName==="SLOT",Yt=t=>t.tagName==="IFRAME",Wt=(...t)=>console.warn(Be,...t);function jt(t){let e=t?.createElement?.("canvas");return e&&(e.height=e.width=1),!!e&&"toDataURL"in e&&!!e.toDataURL("image/webp").includes("image/webp")}var de=t=>t.startsWith("data:");function $e(t,e){if(t.match(/^[a-z]+:\/\//i))return t;if(I&&t.match(/^\/\//))return window.location.protocol+t;if(t.match(/^[a-z]+:/i)||!I)return t;let o=Q().implementation.createHTMLDocument(),n=o.createElement("base"),r=o.createElement("a");return o.head.appendChild(n),o.body.appendChild(r),e&&(n.href=e),r.href=t,r.href}function Q(t){return(t&&O(t)?t?.ownerDocument:t)??window.document}var J="http://www.w3.org/2000/svg";function qt(t,e,o){let n=Q(o).createElementNS(J,"svg");return n.setAttributeNS(null,"width",t.toString()),n.setAttributeNS(null,"height",e.toString()),n.setAttributeNS(null,"viewBox",`0 0 ${t} ${e}`),n}function Kt(t,e){let o=new XMLSerializer().serializeToString(t);return e&&(o=o.replace(/[\u0000-\u0008\v\f\u000E-\u001F\uD800-\uDFFF\uFFFE\uFFFF]/gu,"")),`data:image/svg+xml;charset=utf-8,${encodeURIComponent(o)}`}function Zt(t,e){return new Promise((o,n)=>{let r=new FileReader;r.onload=()=>o(r.result),r.onerror=()=>n(r.error),r.onabort=()=>n(new Error(`Failed read blob to ${e}`)),e==="dataUrl"?r.readAsDataURL(t):e==="arrayBuffer"&&r.readAsArrayBuffer(t)})}var Qt=t=>Zt(t,"dataUrl");function M(t,e){let o=Q(e).createElement("img");return o.decoding="sync",o.loading="eager",o.src=t,o}function U(t,e){return new Promise(o=>{let{timeout:n,ownerDocument:r,onError:i,onWarn:l}=e??{},a=typeof t=="string"?M(t,Q(r)):t,d=null,p=null;function c(){o(a),d&&clearTimeout(d),p?.()}if(n&&(d=setTimeout(c,n)),Z(a)){let m=a.currentSrc||a.src;if(!m)return a.poster?U(a.poster,e).then(o):c();if(a.readyState>=2)return c();let u=c,h=g=>{l?.("Failed video load",m,g),i?.(g),c()};p=()=>{a.removeEventListener("loadeddata",u),a.removeEventListener("error",h)},a.addEventListener("loadeddata",u,{once:!0}),a.addEventListener("error",h,{once:!0})}else{let m=Me(a)?a.href.baseVal:a.currentSrc||a.src;if(!m)return c();let u=async()=>{if($(a)&&"decode"in a)try{await a.decode()}catch(g){l?.("Failed to decode image, trying to render anyway",a.dataset.originalSrc||m,g)}c()},h=g=>{l?.("Failed image load",a.dataset.originalSrc||m,g),c()};if($(a)&&a.complete)return u();p=()=>{a.removeEventListener("load",u),a.removeEventListener("error",h)},a.addEventListener("load",u,{once:!0}),a.addEventListener("error",h,{once:!0})}})}async function Jt(t,e){X(t)&&($(t)||Z(t)?await U(t,e):await Promise.all(["img","video"].flatMap(o=>Array.from(t.querySelectorAll(o)).map(n=>U(n,e)))))}var De=(function(){let e=0,o=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${o()}${e}`)})();function ke(t){return t?.split(",").map(e=>e.trim().replace(/"|'/g,"").toLowerCase()).filter(Boolean)}var ve=0;function eo(t){let e=`${Be}[#${ve}]`;return ve++,{time:o=>t&&console.time(`${e} ${o}`),timeEnd:o=>t&&console.timeEnd(`${e} ${o}`),warn:(...o)=>t&&Wt(...o)}}function to(t){return{cache:t?"no-cache":"force-cache"}}async function He(t,e){return Lt(t)?t:oo(t,{...e,autoDestruct:!0})}async function oo(t,e){let{scale:o=1,workerUrl:n,workerNumber:r=1}=e||{},i=!!e?.debug,l=e?.features??!0,a=t.ownerDocument??(I?window.document:void 0),d=t.ownerDocument?.defaultView??(I?window:void 0),p=new Map,c={width:0,height:0,quality:1,type:"image/png",scale:o,backgroundColor:null,style:null,filter:null,maximumCanvasSize:0,timeout:3e4,progress:null,debug:i,fetch:{requestInit:to(e?.fetch?.bypassingCache),placeholderImage:"data:image/png;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",bypassingCache:!1,...e?.fetch},fetchFn:null,font:{},drawImageInterval:100,workerUrl:null,workerNumber:r,onCloneEachNode:null,onCloneNode:null,onEmbedNode:null,onCreateForeignObjectSvg:null,includeStyleProperties:null,autoDestruct:!1,...e,__CONTEXT__:!0,log:eo(i),node:t,ownerDocument:a,ownerWindow:d,dpi:o===1?null:96*o,svgStyleElement:Xe(a),svgDefsElement:a?.createElementNS(J,"defs"),svgStyles:new Map,defaultComputedStyles:new Map,workers:[...Array.from({length:It&&n&&r?r:0})].map(()=>{try{let h=new Worker(n);return h.onmessage=async g=>{let{url:f,result:E}=g.data;E?p.get(f)?.resolve?.(E):p.get(f)?.reject?.(new Error(`Error receiving message from worker: ${f}`))},h.onmessageerror=g=>{let{url:f}=g.data;p.get(f)?.reject?.(new Error(`Error receiving message from worker: ${f}`))},h}catch(h){return c.log.warn("Failed to new Worker",h),null}}).filter(Boolean),fontFamilies:new Map,fontCssTexts:new Map,acceptOfImage:`${[jt(a)&&"image/webp","image/svg+xml","image/*","*/*"].filter(Boolean).join(",")};q=0.8`,requests:p,drawImageCount:0,tasks:[],features:l,isEnable:h=>h==="restoreScrollPosition"?typeof l=="boolean"?!1:l[h]??!1:typeof l=="boolean"?l:l[h]??!0,shadowRoots:[]};c.log.time("wait until load"),await Jt(t,{timeout:c.timeout,onWarn:c.log.warn}),c.log.timeEnd("wait until load");let{width:m,height:u}=no(t,c);return c.width=m,c.height=u,c}function Xe(t){if(!t)return;let e=t.createElement("style"),o=e.ownerDocument.createTextNode(`
2
+ .______background-clip--text {
3
+ background-clip: text;
4
+ -webkit-background-clip: text;
5
+ }
6
+ `);return e.appendChild(o),e}function no(t,e){let{width:o,height:n}=e;if(O(t)&&(!o||!n)){let r=t.getBoundingClientRect();o=o||r.width||Number(t.getAttribute("width"))||0,n=n||r.height||Number(t.getAttribute("height"))||0}return{width:o,height:n}}async function ro(t,e){let{log:o,timeout:n,drawImageCount:r,drawImageInterval:i}=e;o.time("image to canvas");let l=await U(t,{timeout:n,onWarn:e.log.warn}),{canvas:a,context2d:d}=io(t.ownerDocument,e),p=()=>{try{d?.drawImage(l,0,0,a.width,a.height)}catch(c){e.log.warn("Failed to drawImage",c)}};if(p(),e.isEnable("fixSvgXmlDecode"))for(let c=0;c<r;c++)await new Promise(m=>{setTimeout(()=>{d?.clearRect(0,0,a.width,a.height),p(),m()},c+i)});return e.drawImageCount=0,o.timeEnd("image to canvas"),a}function io(t,e){let{width:o,height:n,scale:r,backgroundColor:i,maximumCanvasSize:l}=e,a=t.createElement("canvas");a.width=Math.floor(o*r),a.height=Math.floor(n*r),a.style.width=`${o}px`,a.style.height=`${n}px`,l&&(a.width>l||a.height>l)&&(a.width>l&&a.height>l?a.width>a.height?(a.height*=l/a.width,a.width=l):(a.width*=l/a.height,a.height=l):a.width>l?(a.height*=l/a.width,a.width=l):(a.width*=l/a.height,a.height=l));let d=a.getContext("2d");return d&&i&&(d.fillStyle=i,d.fillRect(0,0,a.width,a.height)),{canvas:a,context2d:d}}function Ue(t,e){if(t.ownerDocument)try{let i=t.toDataURL();if(i!=="data:,")return M(i,t.ownerDocument)}catch(i){e.log.warn("Failed to clone canvas",i)}let o=t.cloneNode(!1),n=t.getContext("2d"),r=o.getContext("2d");try{return n&&r&&r.putImageData(n.getImageData(0,0,t.width,t.height),0,0),o}catch(i){e.log.warn("Failed to clone canvas",i)}return o}function so(t,e){try{if(t?.contentDocument?.documentElement)return me(t.contentDocument.documentElement,e)}catch(o){e.log.warn("Failed to clone iframe",o)}return t.cloneNode(!1)}function ao(t){let e=t.cloneNode(!1);return t.currentSrc&&t.currentSrc!==t.src&&(e.src=t.currentSrc,e.srcset=""),e.loading==="lazy"&&(e.loading="eager"),e}async function lo(t,e){if(t.ownerDocument&&!t.currentSrc&&t.poster)return M(t.poster,t.ownerDocument);let o=t.cloneNode(!1);o.crossOrigin="anonymous",t.currentSrc&&t.currentSrc!==t.src&&(o.src=t.currentSrc);let n=o.ownerDocument;if(n){let r=!0;if(await U(o,{onError:()=>r=!1,onWarn:e.log.warn}),!r)return t.poster?M(t.poster,t.ownerDocument):o;o.currentTime=t.currentTime,await new Promise(l=>{o.addEventListener("seeked",l,{once:!0})});let i=n.createElement("canvas");i.width=t.offsetWidth,i.height=t.offsetHeight;try{let l=i.getContext("2d");l&&l.drawImage(o,0,0,i.width,i.height)}catch(l){return e.log.warn("Failed to clone video",l),t.poster?M(t.poster,t.ownerDocument):o}return Ue(i,e)}return o}function co(t,e){return Ht(t)?Ue(t,e):Yt(t)?so(t,e):$(t)?ao(t):Z(t)?lo(t,e):t.cloneNode(!1)}function ho(t){let e=t.sandbox;if(!e){let{ownerDocument:o}=t;try{o&&(e=o.createElement("iframe"),e.id=`__SANDBOX__${De()}`,e.width="0",e.height="0",e.style.visibility="hidden",e.style.position="fixed",o.body.appendChild(e),e.srcdoc='<!DOCTYPE html><meta charset="UTF-8"><title></title><body>',t.sandbox=e)}catch(n){t.log.warn("Failed to getSandBox",n)}}return e}var po=["width","height","-webkit-text-fill-color"],uo=["stroke","fill"];function Fe(t,e,o){let{defaultComputedStyles:n}=o,r=t.nodeName.toLowerCase(),i=G(t)&&r!=="svg",l=i?uo.map(f=>[f,t.getAttribute(f)]).filter(([,f])=>f!==null):[],a=[i&&"svg",r,l.map((f,E)=>`${f}=${E}`).join(","),e].filter(Boolean).join(":");if(n.has(a))return n.get(a);let p=ho(o)?.contentWindow;if(!p)return new Map;let c=p?.document,m,u;i?(m=c.createElementNS(J,"svg"),u=m.ownerDocument.createElementNS(m.namespaceURI,r),l.forEach(([f,E])=>{u.setAttributeNS(null,f,E)}),m.appendChild(u)):m=u=c.createElement(r),u.textContent=" ",c.body.appendChild(m);let h=p.getComputedStyle(u,e),g=new Map;for(let f=h.length,E=0;E<f;E++){let b=h.item(E);po.includes(b)||g.set(b,h.getPropertyValue(b))}return c.body.removeChild(m),n.set(a,g),g}function Ge(t,e,o){let n=new Map,r=[],i=new Map;if(o)for(let a of o)l(a);else for(let a=t.length,d=0;d<a;d++){let p=t.item(d);l(p)}for(let a=r.length,d=0;d<a;d++)i.get(r[d])?.forEach((p,c)=>n.set(c,p));function l(a){let d=t.getPropertyValue(a),p=t.getPropertyPriority(a),c=a.lastIndexOf("-"),m=c>-1?a.substring(0,c):void 0;if(m){let u=i.get(m);u||(u=new Map,i.set(m,u)),u.set(a,[d,p])}e.get(a)===d&&!p||(m?r.push(m):n.set(a,[d,p]))}return n}function mo(t,e,o,n){let{ownerWindow:r,includeStyleProperties:i,currentParentNodeStyle:l}=n,a=e.style,d=r.getComputedStyle(t),p=Fe(t,null,n);l?.forEach((m,u)=>{p.delete(u)});let c=Ge(d,p,i);c.delete("transition-property"),c.delete("all"),c.delete("d"),c.delete("content"),o&&(c.delete("position"),c.delete("margin-top"),c.delete("margin-right"),c.delete("margin-bottom"),c.delete("margin-left"),c.delete("margin-block-start"),c.delete("margin-block-end"),c.delete("margin-inline-start"),c.delete("margin-inline-end"),c.set("box-sizing",["border-box",""])),c.get("background-clip")?.[0]==="text"&&e.classList.add("______background-clip--text"),Pe&&(c.has("font-kerning")||c.set("font-kerning",["normal",""]),(c.get("overflow-x")?.[0]==="hidden"||c.get("overflow-y")?.[0]==="hidden")&&c.get("text-overflow")?.[0]==="ellipsis"&&t.scrollWidth===t.clientWidth&&c.set("text-overflow",["clip",""]));for(let m=a.length,u=0;u<m;u++)a.removeProperty(a.item(u));return c.forEach(([m,u],h)=>{a.setProperty(h,m,u)}),c}function go(t,e){(Xt(t)||Ut(t)||Vt(t))&&e.setAttribute("value",t.value)}var fo=["::before","::after"],Eo=["::-webkit-scrollbar","::-webkit-scrollbar-button","::-webkit-scrollbar-thumb","::-webkit-scrollbar-track","::-webkit-scrollbar-track-piece","::-webkit-scrollbar-corner","::-webkit-resizer"];function bo(t,e,o,n,r){let{ownerWindow:i,svgStyleElement:l,svgStyles:a,currentNodeStyle:d}=n;if(!l||!i)return;function p(c){let m=i.getComputedStyle(t,c),u=m.getPropertyValue("content");if(!u||u==="none")return;r?.(u),u=u.replace(/(')|(")|(counter\(.+\))/g,"");let h=[De()],g=Fe(t,c,n);d?.forEach((T,y)=>{g.delete(y)});let f=Ge(m,g,n.includeStyleProperties);f.delete("content"),f.delete("-webkit-locale"),f.get("background-clip")?.[0]==="text"&&e.classList.add("______background-clip--text");let E=[`content: '${u}';`];if(f.forEach(([T,y],_)=>{E.push(`${_}: ${T}${y?" !important":""};`)}),E.length===1)return;try{e.className=[e.className,...h].join(" ")}catch(T){n.log.warn("Failed to copyPseudoClass",T);return}let b=E.join(`
7
+ `),C=a.get(b);C||(C=[],a.set(b,C)),C.push(`.${h[0]}${c}`)}fo.forEach(p),o&&Eo.forEach(p)}var Ae=new Set(["symbol"]);async function Ne(t,e,o,n,r){if(O(o)&&(Ft(o)||Gt(o))||n.filter&&!n.filter(o))return;Ae.has(e.nodeName)||Ae.has(o.nodeName)?n.currentParentNodeStyle=void 0:n.currentParentNodeStyle=n.currentNodeStyle;let i=await me(o,n,!1,r);n.isEnable("restoreScrollPosition")&&Co(t,i),e.appendChild(i)}async function Re(t,e,o,n){let r=t.firstChild;O(t)&&t.shadowRoot&&(r=t.shadowRoot?.firstChild,o.shadowRoots.push(t.shadowRoot));for(let i=r;i;i=i.nextSibling)if(!Dt(i))if(O(i)&&zt(i)&&typeof i.assignedNodes=="function"){let l=i.assignedNodes();for(let a=0;a<l.length;a++)await Ne(t,e,l[a],o,n)}else await Ne(t,e,i,o,n)}function Co(t,e){if(!X(t)||!X(e))return;let{scrollTop:o,scrollLeft:n}=t;if(!o&&!n)return;let{transform:r}=e.style,i=new DOMMatrix(r),{a:l,b:a,c:d,d:p}=i;i.a=1,i.b=0,i.c=0,i.d=1,i.translateSelf(-n,-o),i.a=l,i.b=a,i.c=d,i.d=p,e.style.transform=i.toString()}function To(t,e){let{backgroundColor:o,width:n,height:r,style:i}=e,l=t.style;if(o&&l.setProperty("background-color",o,"important"),n&&l.setProperty("width",`${n}px`,"important"),r&&l.setProperty("height",`${r}px`,"important"),i)for(let a in i)l[a]=i[a]}var yo=/^[\w-:]+$/;async function me(t,e,o=!1,n){let{ownerDocument:r,ownerWindow:i,fontFamilies:l,onCloneEachNode:a}=e;if(r&&kt(t))return n&&/\S/.test(t.data)&&n(t.data),r.createTextNode(t.data);if(r&&i&&O(t)&&(X(t)||G(t))){let p=await co(t,e);if(e.isEnable("removeAbnormalAttributes")){let f=p.getAttributeNames();for(let E=f.length,b=0;b<E;b++){let C=f[b];yo.test(C)||p.removeAttribute(C)}}let c=e.currentNodeStyle=mo(t,p,o,e);o&&To(p,e);let m=!1;if(e.isEnable("copyScrollbar")){let f=[c.get("overflow-x")?.[0],c.get("overflow-y")?.[0]];m=f.includes("scroll")||(f.includes("auto")||f.includes("overlay"))&&(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth)}let u=c.get("text-transform")?.[0],h=ke(c.get("font-family")?.[0]),g=h?f=>{u==="uppercase"?f=f.toUpperCase():u==="lowercase"?f=f.toLowerCase():u==="capitalize"&&(f=f[0].toUpperCase()+f.substring(1)),h.forEach(E=>{let b=l.get(E);b||l.set(E,b=new Set),f.split("").forEach(C=>b.add(C))})}:void 0;return bo(t,p,m,e,g),go(t,p),Z(t)||await Re(t,p,e,g),await a?.(p),p}let d=t.cloneNode(!1);return await Re(t,d,e),await a?.(d),d}function xo(t){if(t.ownerDocument=void 0,t.ownerWindow=void 0,t.svgStyleElement=void 0,t.svgDefsElement=void 0,t.svgStyles.clear(),t.defaultComputedStyles.clear(),t.sandbox){try{t.sandbox.remove()}catch(e){t.log.warn("Failed to destroyContext",e)}t.sandbox=void 0}t.workers=[],t.fontFamilies.clear(),t.fontCssTexts.clear(),t.requests.clear(),t.tasks=[],t.shadowRoots=[]}function _o(t){let{url:e,timeout:o,responseType:n,...r}=t,i=new AbortController,l=o?setTimeout(()=>i.abort(),o):void 0;return fetch(e,{signal:i.signal,...r}).then(a=>{if(!a.ok)throw new Error("Failed fetch, not 2xx response",{cause:a});switch(n){case"arrayBuffer":return a.arrayBuffer();case"dataUrl":return a.blob().then(Qt);default:return a.text()}}).finally(()=>clearTimeout(l))}function F(t,e){let{url:o,requestType:n="text",responseType:r="text",imageDom:i}=e,l=o,{timeout:a,acceptOfImage:d,requests:p,fetchFn:c,fetch:{requestInit:m,bypassingCache:u,placeholderImage:h},font:g,workers:f,fontFamilies:E}=t;n==="image"&&(K||ue)&&t.drawImageCount++;let b=p.get(o);if(!b){u&&u instanceof RegExp&&u.test(l)&&(l+=(/\?/.test(l)?"&":"?")+new Date().getTime());let C=n.startsWith("font")&&g&&g.minify,T=new Set;C&&n.split(";")[1].split(",").forEach(q=>{E.has(q)&&E.get(q).forEach(Oe=>T.add(Oe))});let y=C&&T.size,_={url:l,timeout:a,responseType:y?"arrayBuffer":r,headers:n==="image"?{accept:d}:void 0,...m};b={type:n,resolve:void 0,reject:void 0,response:null},b.response=(async()=>{if(c&&n==="image"){let v=await c(o);if(v)return v}return!K&&o.startsWith("http")&&f.length?new Promise((v,q)=>{f[p.size&f.length-1].postMessage({rawUrl:o,..._}),b.resolve=v,b.reject=q}):_o(_)})().catch(v=>{if(p.delete(o),n==="image"&&h)return t.log.warn("Failed to fetch image base64, trying to use placeholder image",l),typeof h=="string"?h:h(i);throw v}),p.set(o,b)}return b.response}async function Ve(t,e,o,n){if(!ze(t))return t;for(let[r,i]of So(t,e))try{let l=await F(o,{url:i,requestType:n?"image":"text",responseType:"dataUrl"});t=t.replace(wo(r),`$1${l}$3`)}catch(l){o.log.warn("Failed to fetch css data url",r,l)}return t}function ze(t){return/url\((['"]?)([^'"]+?)\1\)/.test(t)}var Ye=/url\((['"]?)([^'"]+?)\1\)/g;function So(t,e){let o=[];return t.replace(Ye,(n,r,i)=>(o.push([i,$e(i,e)]),n)),o.filter(([n])=>!de(n))}function wo(t){let e=t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`,"g")}var Oo=["background-image","border-image-source","-webkit-border-image","-webkit-mask-image","list-style-image"];function vo(t,e){return Oo.map(o=>{let n=t.getPropertyValue(o);return!n||n==="none"?null:((K||ue)&&e.drawImageCount++,Ve(n,null,e,!0).then(r=>{!r||n===r||t.setProperty(o,r,t.getPropertyPriority(o))}))}).filter(Boolean)}function Ao(t,e){if($(t)){let o=t.currentSrc||t.src;if(!de(o))return[F(e,{url:o,imageDom:t,requestType:"image",responseType:"dataUrl"}).then(n=>{n&&(t.srcset="",t.dataset.originalSrc=o,t.src=n||"")})];(K||ue)&&e.drawImageCount++}else if(G(t)&&!de(t.href.baseVal)){let o=t.href.baseVal;return[F(e,{url:o,imageDom:t,requestType:"image",responseType:"dataUrl"}).then(n=>{n&&(t.dataset.originalSrc=o,t.href.baseVal=n||"")})]}return[]}function No(t,e){let{ownerDocument:o,svgDefsElement:n}=e,r=t.getAttribute("href")??t.getAttribute("xlink:href");if(!r)return[];let[i,l]=r.split("#");if(l){let a=`#${l}`,d=e.shadowRoots.reduce((p,c)=>p??c.querySelector(`svg ${a}`),o?.querySelector(`svg ${a}`));if(i&&t.setAttribute("href",a),n?.querySelector(a))return[];if(d)return n?.appendChild(d.cloneNode(!0)),[];if(i)return[F(e,{url:i,responseType:"text"}).then(p=>{n?.insertAdjacentHTML("beforeend",p)})]}return[]}function We(t,e){let{tasks:o}=e;O(t)&&(($(t)||Me(t))&&o.push(...Ao(t,e)),$t(t)&&o.push(...No(t,e))),X(t)&&o.push(...vo(t.style,e)),t.childNodes.forEach(n=>{We(n,e)})}async function Ro(t,e){let{ownerDocument:o,svgStyleElement:n,fontFamilies:r,fontCssTexts:i,tasks:l,font:a}=e;if(!(!o||!n||!r.size))if(a&&a.cssText){let d=Le(a.cssText,e);n.appendChild(o.createTextNode(`${d}
8
+ `))}else{let d=Array.from(o.styleSheets).filter(h=>{try{return"cssRules"in h&&!!h.cssRules.length}catch(g){return e.log.warn(`Error while reading CSS rules from ${h.href}`,g),!1}}),p=o.implementation.createHTMLDocument(""),c=p.createElement("style");p.head.appendChild(c);let m=c.sheet;await Promise.all(d.flatMap(h=>Array.from(h.cssRules).map(async g=>{if(Pt(g)){let f=g.href,E="";try{E=await F(e,{url:f,requestType:"text",responseType:"text"})}catch(C){e.log.warn(`Error fetch remote css import from ${f}`,C)}let b=E.replace(Ye,(C,T,y)=>C.replace(y,$e(y,f)));for(let C of Lo(b))try{m.insertRule(C,m.cssRules.length)}catch(T){e.log.warn("Error inserting rule from remote css import",{rule:C,error:T})}}}))),m.cssRules.length&&d.push(m);let u=[];d.forEach(h=>{he(h.cssRules,u)}),u.filter(h=>Bt(h)&&ze(h.style.getPropertyValue("src"))&&ke(h.style.getPropertyValue("font-family"))?.some(g=>r.has(g))).forEach(h=>{let g=h,f=i.get(g.cssText);f?n.appendChild(o.createTextNode(`${f}
9
+ `)):l.push(Ve(g.cssText,g.parentStyleSheet?g.parentStyleSheet.href:null,e).then(E=>{E=Le(E,e),i.set(g.cssText,E),n.appendChild(o.createTextNode(`${E}
10
+ `))}))})}}var Io=/(\/\*[\s\S]*?\*\/)/g,Ie=/((@.*?keyframes [\s\S]*?){([\s\S]*?}\s*?)})/gi;function Lo(t){if(t==null)return[];let e=[],o=t.replace(Io,"");for(;;){let i=Ie.exec(o);if(!i)break;e.push(i[0])}o=o.replace(Ie,"");let n=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,r=new RegExp("((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})","gi");for(;;){let i=n.exec(o);if(i)r.lastIndex=n.lastIndex;else if(i=r.exec(o),i)n.lastIndex=r.lastIndex;else break;e.push(i[0])}return e}var Bo=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Po=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function Le(t,e){let{font:o}=e,n=o?o?.preferredFormat:void 0;return n?t.replace(Po,r=>{for(;;){let[i,,l]=Bo.exec(r)||[];if(!l)return"";if(l===n)return`src: ${i};`}}):t}function he(t,e=[]){for(let o of Array.from(t))Mt(o)?e.push(...he(o.cssRules)):"cssRules"in o?he(o.cssRules,e):e.push(o);return e}var Mo=/\bx?link:?href\s*=\s*["'](?!data:)[^"']+["']/i;function $o(t){return Mo.test(t.innerHTML)}async function Do(t,e){let o=await He(t,e);if(O(o.node)&&G(o.node)&&!$o(o.node))return o.node;let{ownerDocument:n,log:r,tasks:i,svgStyleElement:l,svgDefsElement:a,svgStyles:d,font:p,progress:c,autoDestruct:m,onCloneNode:u,onEmbedNode:h,onCreateForeignObjectSvg:g}=o;r.time("clone node");let f=await me(o.node,o,!0);if(l&&n){let y="";d.forEach((_,v)=>{y+=`${_.join(`,
11
+ `)} {
12
+ ${v}
13
+ }
14
+ `}),l.appendChild(n.createTextNode(y))}r.timeEnd("clone node"),await u?.(f),p!==!1&&O(f)&&(r.time("embed web font"),await Ro(f,o),r.timeEnd("embed web font")),r.time("embed node"),We(f,o);let E=i.length,b=0,C=async()=>{for(;;){let y=i.pop();if(!y)break;try{await y}catch(_){o.log.warn("Failed to run task",_)}c?.(++b,E)}};c?.(b,E),await Promise.all([...Array.from({length:4})].map(C)),r.timeEnd("embed node"),await h?.(f);let T=ko(f,o);return a&&T.insertBefore(a,T.children[0]),l&&T.insertBefore(l,T.children[0]),m&&xo(o),await g?.(T),T}function ko(t,e){let{width:o,height:n}=e,r=qt(o,n,t.ownerDocument),i=r.ownerDocument.createElementNS(r.namespaceURI,"foreignObject");return i.setAttributeNS(null,"x","0%"),i.setAttributeNS(null,"y","0%"),i.setAttributeNS(null,"width","100%"),i.setAttributeNS(null,"height","100%"),i.append(t),r.appendChild(i),r}async function je(t,e){let o=await He(t,e),n=await Do(o),r=Kt(n,o.isEnable("removeControlCharacter"));o.autoDestruct||(o.svgStyleElement=Xe(o.ownerDocument),o.svgDefsElement=o.ownerDocument?.createElementNS(J,"defs"),o.svgStyles.clear());let i=M(r,n.ownerDocument);return await ro(i,o)}var L="helldots-root",Ho=()=>{customElements.get(L)||customElements.define(L,class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}})};function qe(){Ho();let t=document.querySelector(L);return t||(t=document.createElement(L),document.body.appendChild(t)),t.shadowRoot}var ee=.5,Xo=.7,Ke=t=>!t||t==="transparent"||t==="rgba(0, 0, 0, 0)",Uo=()=>{let t=getComputedStyle(document.documentElement).backgroundColor;if(!Ke(t))return t;let e=getComputedStyle(document.body).backgroundColor;return Ke(e)?"#ffffff":e};async function ge({scale:t=1}={}){return je(document.body,{scale:t,backgroundColor:Uo()})}async function fe(t){let e=document.querySelector(L),o=e?.style.display;e&&(e.style.display="none");try{return await t()}finally{e&&(e.style.display=o||"")}}function Ze(t,{left:e,top:o,width:n,height:r}){let i=document.createElement("canvas");i.width=n,i.height=r;let l=i.getContext("2d");return l?(l.drawImage(t,e+window.scrollX,o+window.scrollY,n,r,0,0,n,r),i.toDataURL("image/png")):null}function Ee(t,{sourceScale:e=1,outputScale:o=ee,quality:n=Xo}={}){let r=document.createElement("canvas");r.width=Math.round(window.innerWidth*o),r.height=Math.round(window.innerHeight*o);let i=r.getContext("2d");return i?(i.drawImage(t,window.scrollX*e,window.scrollY*e,window.innerWidth*e,window.innerHeight*e,0,0,r.width,r.height),r.toDataURL("image/jpeg",n)):null}var Fo=[{name:"Edge",re:/Edg\/([\d.]+)/},{name:"Chrome",re:/Chrome\/([\d.]+)/},{name:"Firefox",re:/Firefox\/([\d.]+)/},{name:"Safari",re:/Version\/([\d.]+).*Safari/}],Go=[{name:"iOS",re:/(?:iPhone|iPad).*OS ([\d_]+) like Mac OS X/},{name:"Android",re:/Android ([\d.]+)/},{name:"Windows",re:/Windows NT ([\d.]+)/},{name:"macOS",re:/Mac OS X ([\d_.]+)/},{name:"Linux",re:/Linux/}],Vo={name:"unknown",version:""},zo=t=>/not[\W_]*a[\W_]*brand/i.test(t),Qe=(t,e)=>{for(let{name:o,re:n}of t){let r=e.match(n);if(r)return{name:o,version:(r[1]||"").replace(/_/g,".")}}return{...Vo}};function Je(t=window){let e=t.navigator||{},o=e.userAgent||"",n=e.userAgentData,r=Qe(Fo,o),i=n?.brands?.find(a=>!zo(a.brand));i&&(r={name:i.brand,version:i.version||""});let l=Qe(Go,o);return n?.platform&&(l.name=n.platform),{version:1,url:t.location?.href||"",viewport:{width:t.innerWidth,height:t.innerHeight},screen:{width:t.screen?.width??0,height:t.screen?.height??0},devicePixelRatio:t.devicePixelRatio??1,userAgent:o,browser:r,os:l,language:e.language||""}}var s={CIRCLE:"comment-circle",CIRCLE_WRAPPER:"comment-circle-wrapper",TOOLTIP:"comment-tooltip",TOOLBAR_TEXT:"toolbar-text",SHORTCUT_HINT:"shortcut-hint",COMMENT_INPUT_AREA:"comment-input-area",CLOSE_TOOLTIP:"close-tooltip",ACTIVE:"active",COMMENT_CURSOR:"comment-cursor",COMMENT_OVERLAY:"comment-overlay",THREAD_POPOVER:"comment-thread-popover",THREAD_HEADER:"thread-header",THREAD_BODY:"thread-body",THREAD_REPLIES:"thread-replies",THREAD_REPLY:"thread-reply",THREAD_INPUT_AREA:"thread-input-area",THREAD_INPUT:"thread-input",THREAD_SUBMIT:"thread-submit",THREAD_META:"thread-meta",THREAD_AUTHOR:"thread-author",THREAD_TIME:"thread-time",PREVIEW_CIRCLE:"preview-circle",SELECTION_RECT:"selection-rect",SCREENSHOT_IMG:"screenshot-img",SCREENSHOT_REMOVE:"screenshot-remove",SCREENSHOTS_CONTAINER:"screenshots-container",SCREENSHOT_ITEM:"screenshot-item",LIGHTBOX:"helldots-lightbox",LIGHTBOX_IMG:"helldots-lightbox-img",LIGHTBOX_CLOSE:"helldots-lightbox-close",COMMENT_ACTIONS_BAR:"comment-actions-bar",ATTACH_IMAGE_BTN:"attach-image-btn",TOOLBAR_ACTIONS:"toolbar-actions",TOOLBAR_ACTION_BTN:"toolbar-action-btn",TOOLBAR_ACTION_WRAPPER:"toolbar-action-wrapper",TOOLBAR_ACTION_TOOLTIP:"toolbar-action-tooltip",TOOLBAR_COMMENT_BTN:"toolbar-comment-btn",TOOLBAR_MENU_BTN:"toolbar-menu-btn",INBOX_PANEL:"inbox-panel",INBOX_HEADER:"inbox-header",INBOX_FILTER:"inbox-filter",INBOX_FILTER_MENU:"inbox-filter-menu",INBOX_FILTER_OPTION:"inbox-filter-option",INBOX_FILTER_SECTION:"inbox-filter-section",INBOX_CLOSE:"inbox-close",INBOX_LIST:"inbox-list",INBOX_CARD:"inbox-card",INBOX_CARD_HEADER:"inbox-card-header",INBOX_CARD_ACTIONS:"inbox-card-actions",INBOX_CARD_TEXT:"inbox-card-text",INBOX_CARD_TAG:"inbox-card-tag",INBOX_CARD_REPLY_LINK:"inbox-card-reply-link",INBOX_ACTION_BTN:"inbox-action-btn",INBOX_ACTION_BTN_LABELED:"inbox-action-btn--labeled",INBOX_ACTION_LABEL:"inbox-action-label",INBOX_STATUS_DOT:"inbox-status-dot",INBOX_MENU:"inbox-menu",INBOX_MENU_ITEM:"inbox-menu-item",INBOX_DETAIL:"inbox-detail",INBOX_DETAIL_HEADER:"inbox-detail-header",INBOX_BACK:"inbox-back",INBOX_NAV_BTN:"inbox-nav-btn",INBOX_REPLIES:"inbox-replies",INBOX_EMPTY:"inbox-empty",CLASSIFY_ROW:"classify-row",TAGS_INPUT:"tags-input",TAG_CHIP:"tag-chip",TAG_CHIP_REMOVE:"tag-chip-remove",INBOX_BADGES:"inbox-badges",BADGE:"helldots-badge",BADGE_TYPE:"helldots-badge--type",BADGE_PRIORITY:"helldots-badge--priority",BADGE_TAG:"helldots-badge--tag",BADGE_DURATION:"helldots-badge--duration",CONTEXT_BLOCK:"inbox-context",CONTEXT_ROW:"inbox-context-row",CONTEXT_SCREENSHOT_CAPTION:"inbox-context-screenshot-caption",HIGHLIGHT:"helldots-highlight"},x={TOOLBAR:"comment-toolbar",COMMENT_BOX:"comment-box",COMMENT_INPUT:"comment-input",SUBMIT_COMMENT:"submit-comment",STYLES:"comment-overlay-styles",GLOBAL_STYLES:"comment-overlay-global-styles",ATTACH_IMAGE_INPUT:"attach-image-input"},V=["open","in_progress","resolved"],et={open:"#2E90FA",in_progress:"#FF9F0A",resolved:"#30D158"},A=["bug","suggestion","question","improvement"],D={bug:"#FF453A",suggestion:"#BF5AF2",question:"#64D2FF",improvement:"#5E5CE6"},N=["high","medium","low"],k={high:"#FF453A",medium:"#FF9F0A",low:"#8E8E93"},tt={CONTAINER:'section, div[class*="container"], div[class*="content"]'},S={CIRCLE:9997,TOOLTIP:1e4,TOOLBAR:9998,COMMENT_BOX:9999,LIGHTBOX:10001},ot='data:image/svg+xml;utf8,<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><g filter="url(%23filter0_d_4_97)"><path d="M6 8C6 6.89543 6.89543 6 8 6H20C27.732 6 34 12.268 34 20V20C34 27.732 27.732 34 20 34V34C12.268 34 6 27.732 6 20V8Z" fill="%232E90FA"/><path d="M8 7H20C27.1797 7 33 12.8203 33 20C33 27.1797 27.1797 33 20 33C12.8203 33 7 27.1797 7 20V8C7 7.44772 7.44772 7 8 7Z" stroke="white" stroke-width="2"/></g><filter id="filter0_d_4_97" x="0" y="0" width="48" height="48" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/><feOffset dx="4" dy="4"/><feGaussianBlur stdDeviation="5"/><feComposite in2="hardAlpha" operator="out"/><feColorMatrix type="matrix" values="0 0 0 0 0.180392 0 0 0 0 0.564706 0 0 0 0 0.980392 0 0 0 0.16 0"/><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_4_97"/><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_4_97" result="shape"/></filter></svg>';var nt=()=>`
15
+
16
+ :host {
17
+ all: initial;
18
+ display: block;
19
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
20
+ line-height: 1.5;
21
+ color-scheme: light;
22
+ }
23
+
24
+ :host *,
25
+ :host *::before,
26
+ :host *::after {
27
+ box-sizing: border-box;
28
+ font-family: inherit;
29
+ }
30
+
31
+ button {
32
+ padding: 0;
33
+ font: inherit;
34
+ color: inherit;
35
+ }
36
+
37
+ #${x.TOOLBAR} {
38
+ position: fixed;
39
+ bottom: 20px;
40
+ left: 50%;
41
+ transform: translateX(-50%);
42
+ z-index: ${S.TOOLBAR};
43
+ }
44
+
45
+ .${s.TOOLBAR_ACTION_WRAPPER} {
46
+ position: relative;
47
+ }
48
+
49
+ .${s.TOOLBAR_ACTION_TOOLTIP} {
50
+ position: absolute;
51
+ bottom: calc(100% + 10px);
52
+ left: 50%;
53
+ transform: translateX(-50%) translateY(4px);
54
+ display: flex;
55
+ align-items: center;
56
+ gap: 8px;
57
+ background: rgba(20, 20, 23, 0.95);
58
+ backdrop-filter: blur(16px);
59
+ -webkit-backdrop-filter: blur(16px);
60
+ padding: 8px 12px;
61
+ border-radius: 10px;
62
+ border: 1px solid rgba(255, 255, 255, 0.08);
63
+ box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
64
+ color: white;
65
+ white-space: nowrap;
66
+ opacity: 0;
67
+ pointer-events: none;
68
+ transition: opacity 0.15s ease, transform 0.15s ease;
69
+ }
70
+
71
+ .${s.TOOLBAR_ACTION_WRAPPER}:hover .${s.TOOLBAR_ACTION_TOOLTIP} {
72
+ opacity: 1;
73
+ pointer-events: auto;
74
+ transform: translateX(-50%) translateY(0);
75
+ }
76
+
77
+ .${s.TOOLBAR_TEXT} {
78
+ font-size: 13px;
79
+ font-weight: 500;
80
+ letter-spacing: -0.01em;
81
+ }
82
+
83
+ .${s.SHORTCUT_HINT} {
84
+ font-size: 11px;
85
+ font-weight: 500;
86
+ color: rgba(255, 255, 255, 0.5);
87
+ background: rgba(255, 255, 255, 0.06);
88
+ border: 1px solid rgba(255, 255, 255, 0.1);
89
+ padding: 2px 6px;
90
+ border-radius: 5px;
91
+ line-height: 1;
92
+ white-space: nowrap;
93
+ }
94
+
95
+ .${s.TOOLBAR_ACTIONS} {
96
+ display: flex;
97
+ flex-direction: row;
98
+ background: rgba(20, 20, 23, 0.95);
99
+ backdrop-filter: blur(16px);
100
+ -webkit-backdrop-filter: blur(16px);
101
+ border-radius: 12px;
102
+ box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
103
+ }
104
+
105
+ .${s.TOOLBAR_ACTION_BTN} {
106
+ width: 42px;
107
+ height: 42px;
108
+ display: flex;
109
+ align-items: center;
110
+ justify-content: center;
111
+ background: none;
112
+ border: none;
113
+ outline: none;
114
+ color: rgba(255, 255, 255, 0.65);
115
+ cursor: pointer;
116
+ transition: background 0.2s, color 0.2s;
117
+ padding: 0;
118
+ }
119
+
120
+ .${s.TOOLBAR_ACTION_WRAPPER}:first-child .${s.TOOLBAR_ACTION_BTN} {
121
+ border-radius: 12px 0 0 12px;
122
+ }
123
+
124
+ .${s.TOOLBAR_ACTION_WRAPPER}:last-child .${s.TOOLBAR_ACTION_BTN} {
125
+ border-radius: 0 12px 12px 0;
126
+ }
127
+
128
+ .${s.TOOLBAR_ACTION_BTN}:hover {
129
+ background: rgba(255, 255, 255, 0.08);
130
+ color: white;
131
+ }
132
+
133
+ .${s.TOOLBAR_COMMENT_BTN}.${s.ACTIVE} {
134
+ color: #2E90FA;
135
+ background: rgba(46, 144, 250, 0.1);
136
+ }
137
+
138
+
139
+ #${x.COMMENT_BOX} {
140
+ position: fixed;
141
+ background: #1C1C1E;
142
+ border-radius: 12px;
143
+ box-shadow: 0 4px 20px rgba(0,0,0,0.4);
144
+ padding: 16px;
145
+ z-index: ${S.COMMENT_BOX};
146
+ width: 400px;
147
+ display: none;
148
+ box-sizing: border-box;
149
+ }
150
+
151
+ #${x.COMMENT_BOX} .${s.COMMENT_INPUT_AREA} {
152
+ display: flex;
153
+ flex-direction: column;
154
+ gap: 0;
155
+ }
156
+
157
+ .${s.CLASSIFY_ROW} {
158
+ display: flex;
159
+ align-items: center;
160
+ flex-wrap: wrap;
161
+ gap: 6px;
162
+ padding: 8px 10px 0;
163
+ }
164
+ .${s.TAGS_INPUT} {
165
+ flex: 1 1 90px;
166
+ min-width: 90px;
167
+ background: transparent;
168
+ border: none;
169
+ outline: none;
170
+ color: inherit;
171
+ font-size: 12px;
172
+ padding: 2px 0;
173
+ }
174
+ .${s.TAG_CHIP} {
175
+ display: inline-flex;
176
+ align-items: center;
177
+ gap: 4px;
178
+ padding: 2px 6px;
179
+ border-radius: 10px;
180
+ background: rgba(255, 255, 255, 0.1);
181
+ font-size: 11px;
182
+ line-height: 1.4;
183
+ }
184
+ .${s.TAG_CHIP_REMOVE} {
185
+ background: none;
186
+ border: none;
187
+ color: inherit;
188
+ cursor: pointer;
189
+ padding: 0;
190
+ font-size: 13px;
191
+ line-height: 1;
192
+ opacity: 0.6;
193
+ }
194
+ .${s.TAG_CHIP_REMOVE}:hover {
195
+ opacity: 1;
196
+ }
197
+
198
+ #${x.COMMENT_INPUT} {
199
+ flex: 1;
200
+ min-height: 20px;
201
+ background: #1C1C1E;
202
+ border: none;
203
+ resize: none;
204
+ font-family: inherit;
205
+ color: white;
206
+ font-size: 14px;
207
+ line-height: 1.4;
208
+ box-sizing: border-box;
209
+ field-sizing: content;
210
+ padding-top: 4px;
211
+ padding-bottom: 8px;
212
+ }
213
+
214
+ #${x.COMMENT_INPUT}::placeholder {
215
+ color: rgba(255, 255, 255, 0.5);
216
+ }
217
+
218
+ #${x.COMMENT_INPUT}:focus {
219
+ outline: none;
220
+ box-shadow: none;
221
+ }
222
+
223
+ .${s.COMMENT_ACTIONS_BAR} {
224
+ display: flex;
225
+ align-items: center;
226
+ justify-content: space-between;
227
+ padding-top: 12px;
228
+ }
229
+
230
+ .${s.ATTACH_IMAGE_BTN} {
231
+ background: none;
232
+ border: none;
233
+ color: rgba(255, 255, 255, 0.5);
234
+ cursor: pointer;
235
+ display: flex;
236
+ align-items: center;
237
+ justify-content: center;
238
+ border-radius: 6px;
239
+ transition: background 0.2s, color 0.2s;
240
+ }
241
+
242
+ .${s.ATTACH_IMAGE_BTN}:hover {
243
+ background: rgba(255, 255, 255, 0.1);
244
+ color: rgba(255, 255, 255, 0.8);
245
+ }
246
+
247
+ .${s.CIRCLE} {
248
+ position: absolute;
249
+ width: 28px;
250
+ height: 28px;
251
+ background: #2E90FA;
252
+ border-radius: 0% 100% 100% 100%;
253
+ border: 2px solid #FFF;
254
+ cursor: pointer;
255
+ box-shadow: 0 1px 5px rgba(0,0,0,0.2);
256
+ transition: transform 0.2s, background 0.2s;
257
+ z-index: ${S.CIRCLE};
258
+ transform: translate(-50%, -50%);
259
+ }
260
+
261
+ .${s.CIRCLE}:hover {
262
+ transform: translate(-50%, -50%) scale(1.2) !important;
263
+ background: rgb(0, 123, 255);
264
+ }
265
+
266
+ .${s.CIRCLE}.${s.HIGHLIGHT} {
267
+ transform: translate(-50%, -50%) scale(1.2) !important;
268
+ background: rgb(0, 123, 255);
269
+ box-shadow: 0 0 0 4px rgba(46, 144, 250, 0.35), 0 1px 5px rgba(0,0,0,0.2);
270
+ }
271
+
272
+ .${s.CIRCLE_WRAPPER} {
273
+ position: absolute;
274
+ left: 0;
275
+ top: 0;
276
+ width: 100%;
277
+ height: 100%;
278
+ pointer-events: none;
279
+ z-index: ${S.CIRCLE};
280
+ }
281
+
282
+ .${s.TOOLTIP} {
283
+ position: fixed;
284
+ background: #1C1C1E;
285
+ border-radius: 12px;
286
+ padding: 16px;
287
+ box-shadow: 0 4px 20px rgba(0,0,0,0.4);
288
+ width: 400px;
289
+ z-index: ${S.TOOLTIP};
290
+ color: white;
291
+ font-size: 14px;
292
+ line-height: 1.5;
293
+ box-sizing: border-box;
294
+ }
295
+
296
+ .${s.TOOLTIP} .${s.THREAD_HEADER} {
297
+ padding: 0 0 0;
298
+ }
299
+
300
+ .${s.TOOLTIP} .${s.THREAD_BODY} {
301
+ padding: 8px 0;
302
+ }
303
+
304
+ .${s.THREAD_POPOVER} {
305
+ position: fixed;
306
+ background: #1C1C1E;
307
+ border-radius: 12px;
308
+ padding: 16px;
309
+ box-shadow: 0 4px 20px rgba(0,0,0,0.4);
310
+ width: 400px;
311
+ z-index: ${S.TOOLTIP};
312
+ color: white;
313
+ font-size: 14px;
314
+ line-height: 1.5;
315
+ box-sizing: border-box;
316
+ }
317
+
318
+ .${s.INBOX_PANEL} {
319
+ position: fixed;
320
+ top: 16px;
321
+ right: 16px;
322
+ bottom: 16px;
323
+ width: 380px;
324
+ display: flex;
325
+ flex-direction: column;
326
+ background: #1C1C1E;
327
+ border: 1px solid rgba(255,255,255,0.08);
328
+ border-radius: 14px;
329
+ box-shadow: 0 8px 32px rgba(0,0,0,0.5);
330
+ z-index: ${S.COMMENT_BOX};
331
+ color: white;
332
+ font-size: 14px;
333
+ line-height: 1.5;
334
+ box-sizing: border-box;
335
+ overflow: hidden;
336
+ }
337
+
338
+ @media (max-width: 420px) {
339
+ .${s.INBOX_PANEL} {
340
+ left: 16px;
341
+ width: auto;
342
+ }
343
+ }
344
+
345
+ .${s.INBOX_HEADER},
346
+ .${s.INBOX_DETAIL_HEADER} {
347
+ display: flex;
348
+ align-items: center;
349
+ justify-content: space-between;
350
+ gap: 8px;
351
+ padding: 12px 14px;
352
+ border-bottom: 1px solid rgba(255,255,255,0.08);
353
+ flex: none;
354
+ }
355
+
356
+ .${s.INBOX_FILTER}-wrapper {
357
+ position: relative;
358
+ }
359
+
360
+ .${s.INBOX_FILTER} {
361
+ display: flex;
362
+ align-items: center;
363
+ gap: 6px;
364
+ background: transparent;
365
+ border: none;
366
+ color: white;
367
+ font-size: 13px;
368
+ font-weight: 600;
369
+ cursor: pointer;
370
+ padding: 4px 6px;
371
+ border-radius: 6px;
372
+ }
373
+
374
+ .${s.INBOX_FILTER}:hover {
375
+ background: rgba(255,255,255,0.08);
376
+ }
377
+
378
+ .${s.INBOX_FILTER_MENU} {
379
+ position: absolute;
380
+ top: calc(100% + 4px);
381
+ left: 0;
382
+ background: #2C2C2E;
383
+ border: 1px solid rgba(255,255,255,0.1);
384
+ border-radius: 8px;
385
+ padding: 4px;
386
+ min-width: 190px;
387
+ z-index: 1;
388
+ box-shadow: 0 4px 16px rgba(0,0,0,0.4);
389
+ }
390
+
391
+ .${s.INBOX_FILTER_SECTION} {
392
+ padding: 8px 10px 4px;
393
+ font-size: 11px;
394
+ font-weight: 600;
395
+ color: rgba(255,255,255,0.45);
396
+ text-transform: none;
397
+ }
398
+
399
+ .${s.INBOX_FILTER_SECTION}:not(:first-child) {
400
+ margin-top: 4px;
401
+ border-top: 1px solid rgba(255,255,255,0.1);
402
+ padding-top: 10px;
403
+ }
404
+
405
+ .${s.INBOX_FILTER_OPTION} {
406
+ display: flex;
407
+ justify-content: space-between;
408
+ align-items: center;
409
+ gap: 12px;
410
+ }
411
+
412
+ .${s.INBOX_FILTER_OPTION},
413
+ .${s.INBOX_MENU_ITEM} {
414
+ display: block;
415
+ width: 100%;
416
+ text-align: left;
417
+ background: transparent;
418
+ border: none;
419
+ color: white;
420
+ font-size: 13px;
421
+ padding: 7px 10px;
422
+ border-radius: 6px;
423
+ cursor: pointer;
424
+ }
425
+
426
+ .${s.INBOX_FILTER_OPTION}:hover,
427
+ .${s.INBOX_MENU_ITEM}:hover {
428
+ background: rgba(255,255,255,0.08);
429
+ }
430
+
431
+ .${s.INBOX_CLOSE},
432
+ .${s.INBOX_NAV_BTN},
433
+ .${s.INBOX_BACK} {
434
+ display: flex;
435
+ align-items: center;
436
+ gap: 4px;
437
+ background: transparent;
438
+ border: none;
439
+ color: rgba(255,255,255,0.75);
440
+ cursor: pointer;
441
+ padding: 4px 6px;
442
+ border-radius: 6px;
443
+ font-size: 14px;
444
+ }
445
+
446
+ .${s.INBOX_CLOSE} {
447
+ font-size: 20px;
448
+ line-height: 1;
449
+ }
450
+
451
+ .${s.INBOX_CLOSE}:hover,
452
+ .${s.INBOX_NAV_BTN}:not(:disabled):hover,
453
+ .${s.INBOX_BACK}:hover {
454
+ background: rgba(255,255,255,0.08);
455
+ color: white;
456
+ }
457
+
458
+ .${s.INBOX_NAV_BTN}:disabled {
459
+ opacity: 0.35;
460
+ cursor: default;
461
+ }
462
+
463
+ .${s.INBOX_LIST},
464
+ .${s.INBOX_DETAIL} {
465
+ flex: 1;
466
+ overflow-y: auto;
467
+ padding: 12px;
468
+ display: flex;
469
+ flex-direction: column;
470
+ gap: 12px;
471
+ }
472
+
473
+ .${s.INBOX_CARD} {
474
+ border: 1px solid rgba(255,255,255,0.1);
475
+ border-radius: 10px;
476
+ padding: 12px;
477
+ display: flex;
478
+ flex-direction: column;
479
+ gap: 8px;
480
+ }
481
+
482
+ .${s.INBOX_LIST} .${s.INBOX_CARD} {
483
+ cursor: pointer;
484
+ }
485
+
486
+ .${s.INBOX_LIST} .${s.INBOX_CARD}:hover {
487
+ border-color: rgba(255,255,255,0.22);
488
+ }
489
+
490
+ .${s.INBOX_CARD}--resolved {
491
+ border-color: rgba(48, 209, 88, 0.4);
492
+ opacity: 0.75;
493
+ }
494
+
495
+ .${s.INBOX_LIST} .${s.INBOX_CARD}--resolved:hover {
496
+ border-color: rgba(48, 209, 88, 0.7);
497
+ opacity: 1;
498
+ }
499
+
500
+ .${s.INBOX_CARD_HEADER} {
501
+ display: flex;
502
+ align-items: center;
503
+ justify-content: space-between;
504
+ gap: 8px;
505
+ }
506
+
507
+ .${s.INBOX_CARD_ACTIONS} {
508
+ display: flex;
509
+ align-items: center;
510
+ gap: 6px;
511
+ }
512
+
513
+ .${s.INBOX_ACTION_BTN} {
514
+ display: flex;
515
+ align-items: center;
516
+ justify-content: center;
517
+ width: 24px;
518
+ height: 24px;
519
+ background: transparent;
520
+ border: none;
521
+ border-radius: 6px;
522
+ color: rgba(255,255,255,0.65);
523
+ cursor: pointer;
524
+ }
525
+
526
+ .${s.INBOX_ACTION_BTN}:hover {
527
+ background: rgba(255,255,255,0.08);
528
+ color: white;
529
+ }
530
+
531
+ /* Type/priority pickers show their current value as text next to the
532
+ dot (colour alone can't tell bug/high apart \u2014 same hex, and there's
533
+ no hover on touch). Grow from the square icon-button width but stay
534
+ bounded so the strip doesn't crowd out copy/status/\u22EF next to it. */
535
+ .${s.INBOX_ACTION_BTN_LABELED} {
536
+ width: auto;
537
+ max-width: 72px;
538
+ padding: 0 8px 0 6px;
539
+ gap: 5px;
540
+ justify-content: flex-start;
541
+ }
542
+
543
+ .${s.INBOX_ACTION_LABEL} {
544
+ font-size: 11px;
545
+ line-height: 1;
546
+ white-space: nowrap;
547
+ overflow: hidden;
548
+ text-overflow: ellipsis;
549
+ }
550
+
551
+ .${s.INBOX_STATUS_DOT} {
552
+ width: 12px;
553
+ height: 12px;
554
+ border-radius: 50%;
555
+ border: 1.5px solid rgba(255,255,255,0.45);
556
+ display: inline-block;
557
+ flex: none;
558
+ }
559
+
560
+ .${s.INBOX_MENU_ITEM} .${s.INBOX_STATUS_DOT} {
561
+ width: 9px;
562
+ height: 9px;
563
+ border: none;
564
+ margin-right: 8px;
565
+ vertical-align: baseline;
566
+ }
567
+
568
+ .${s.INBOX_MENU_ITEM}[aria-checked="true"] {
569
+ background: rgba(255,255,255,0.08);
570
+ }
571
+
572
+ .${s.THREAD_HEADER} .${s.INBOX_CARD_ACTIONS} {
573
+ margin-left: auto;
574
+ margin-right: 8px;
575
+ }
576
+
577
+ /* Generic hover tooltip, same look as .thread-time[data-full-date] */
578
+ [data-hd-tooltip] {
579
+ position: relative;
580
+ }
581
+
582
+ [data-hd-tooltip]::after {
583
+ content: attr(data-hd-tooltip);
584
+ position: absolute;
585
+ bottom: calc(100% + 6px);
586
+ left: 50%;
587
+ transform: translateX(-50%);
588
+ background: #000;
589
+ color: white;
590
+ padding: 4px 8px;
591
+ border-radius: 6px;
592
+ font-size: 11px;
593
+ white-space: nowrap;
594
+ opacity: 0;
595
+ pointer-events: none;
596
+ transition: opacity 0.12s ease;
597
+ z-index: 2;
598
+ }
599
+
600
+ [data-hd-tooltip]:hover::after {
601
+ opacity: 1;
602
+ }
603
+
604
+ .${s.INBOX_MENU} {
605
+ position: absolute;
606
+ top: calc(100% + 4px);
607
+ right: 0;
608
+ background: #2C2C2E;
609
+ border: 1px solid rgba(255,255,255,0.1);
610
+ border-radius: 8px;
611
+ padding: 4px;
612
+ min-width: 130px;
613
+ z-index: 1;
614
+ box-shadow: 0 4px 16px rgba(0,0,0,0.4);
615
+ }
616
+
617
+ .${s.INBOX_CARD_TEXT} {
618
+ white-space: pre-wrap;
619
+ word-break: break-word;
620
+ }
621
+
622
+ .${s.INBOX_CARD_TAG} {
623
+ align-self: flex-start;
624
+ padding: 1px 8px;
625
+ border-radius: 999px;
626
+ background: rgba(255, 159, 10, 0.2);
627
+ color: #FF9F0A;
628
+ font-size: 11px;
629
+ font-weight: 600;
630
+ }
631
+
632
+ .${s.INBOX_BADGES} {
633
+ display: flex;
634
+ flex-wrap: wrap;
635
+ gap: 4px;
636
+ }
637
+ /* Vertical separation from the card text above only applies to the
638
+ badge row on inbox cards -- inside the comment-box classify row,
639
+ .inbox-badges is one flex item among the type/priority pickers and
640
+ the tags input, and the classify row's own gap already spaces it
641
+ from its siblings, so an extra margin here would nudge it out of
642
+ alignment with them. */
643
+ .${s.INBOX_CARD} .${s.INBOX_BADGES} {
644
+ margin-top: 6px;
645
+ }
646
+ .${s.BADGE} {
647
+ display: inline-flex;
648
+ align-items: center;
649
+ padding: 1px 6px;
650
+ border: 1px solid rgba(255, 255, 255, 0.18);
651
+ border-radius: 10px;
652
+ font-size: 10px;
653
+ line-height: 1.6;
654
+ letter-spacing: 0.01em;
655
+ white-space: nowrap;
656
+ }
657
+ .${s.BADGE_TYPE},
658
+ .${s.BADGE_PRIORITY} {
659
+ font-weight: 600;
660
+ }
661
+ .${s.BADGE_TAG} {
662
+ opacity: 0.75;
663
+ }
664
+ .${s.BADGE_DURATION} {
665
+ opacity: 0.75;
666
+ border-style: dashed;
667
+ }
668
+
669
+ .${s.CONTEXT_BLOCK} {
670
+ display: flex;
671
+ flex-direction: column;
672
+ gap: 4px;
673
+ padding: 10px 12px;
674
+ border-top: 1px solid rgba(255, 255, 255, 0.08);
675
+ font-size: 11px;
676
+ }
677
+ .${s.CONTEXT_BLOCK} img {
678
+ width: 100%;
679
+ border-radius: 6px;
680
+ margin-bottom: 6px;
681
+ cursor: zoom-in;
682
+ }
683
+ .${s.CONTEXT_SCREENSHOT_CAPTION} {
684
+ opacity: 0.75;
685
+ }
686
+ .${s.CONTEXT_ROW} {
687
+ display: flex;
688
+ justify-content: space-between;
689
+ gap: 12px;
690
+ opacity: 0.75;
691
+ }
692
+ /* URLs and user agents have no spaces to break on, so the value column
693
+ would otherwise push the row wider than the panel. */
694
+ .${s.CONTEXT_ROW} span:last-child {
695
+ text-align: right;
696
+ word-break: break-all;
697
+ }
698
+
699
+ .${s.INBOX_CARD_REPLY_LINK} {
700
+ align-self: flex-start;
701
+ background: transparent;
702
+ border: none;
703
+ color: rgba(255,255,255,0.55);
704
+ font-size: 13px;
705
+ cursor: pointer;
706
+ padding: 0;
707
+ }
708
+
709
+ .${s.INBOX_CARD_REPLY_LINK}:hover {
710
+ color: white;
711
+ }
712
+
713
+ .${s.INBOX_REPLIES} {
714
+ display: flex;
715
+ flex-direction: column;
716
+ gap: 10px;
717
+ padding: 0 4px;
718
+ }
719
+
720
+ .${s.INBOX_EMPTY} {
721
+ padding: 24px 12px;
722
+ color: rgba(255,255,255,0.55);
723
+ text-align: center;
724
+ }
725
+
726
+ .${s.THREAD_HEADER} {
727
+ display: flex;
728
+ justify-content: space-between;
729
+ align-items: center;
730
+ padding: 0 0 0;
731
+ }
732
+
733
+ .${s.THREAD_META} {
734
+ display: flex;
735
+ align-items: center;
736
+ gap: 6px;
737
+ }
738
+
739
+ .${s.THREAD_AUTHOR} {
740
+ font-weight: 600;
741
+ font-size: 13px;
742
+ }
743
+
744
+ .${s.THREAD_TIME} {
745
+ font-size: 12px;
746
+ color: rgba(255,255,255,0.5);
747
+ cursor: default;
748
+ position: relative;
749
+ }
750
+
751
+ .${s.THREAD_TIME}::after {
752
+ content: attr(data-full-date);
753
+ position: absolute;
754
+ bottom: calc(100% + 6px);
755
+ left: 50%;
756
+ transform: translateX(-50%);
757
+ background: #000;
758
+ color: white;
759
+ padding: 4px 8px;
760
+ border-radius: 6px;
761
+ font-size: 11px;
762
+ white-space: nowrap;
763
+ opacity: 0;
764
+ pointer-events: none;
765
+ transition: opacity 0.15s ease;
766
+ z-index: 1;
767
+ }
768
+
769
+ .${s.THREAD_TIME}:hover::after {
770
+ opacity: 1;
771
+ }
772
+
773
+ .${s.THREAD_BODY} {
774
+ padding: 8px 0;
775
+ white-space: pre-wrap;
776
+ word-break: break-word;
777
+ }
778
+
779
+ .${s.THREAD_REPLIES} {
780
+ padding: 0;
781
+ }
782
+
783
+ .${s.THREAD_REPLIES}:empty {
784
+ display: none;
785
+ }
786
+
787
+ .${s.THREAD_REPLY} {
788
+ padding: 16px 0 0 0;
789
+ border-top: 1px solid rgba(255,255,255,0.1);
790
+ white-space: pre-wrap;
791
+ word-break: break-word;
792
+ font-size: 13px;
793
+ color: rgba(255,255,255,0.85);
794
+ }
795
+
796
+ .${s.THREAD_REPLY} .${s.THREAD_META} {
797
+ margin-bottom: 2px;
798
+ }
799
+
800
+ .${s.THREAD_REPLY} .${s.SCREENSHOT_IMG} {
801
+ width: 144px;
802
+ height: 100px;
803
+ object-fit: cover;
804
+ border-radius: 8px;
805
+ margin-top: 4px;
806
+ cursor: pointer;
807
+ display: block;
808
+ }
809
+
810
+ .${s.THREAD_INPUT_AREA} {
811
+ display: flex;
812
+ flex-direction: column;
813
+ gap: 0;
814
+ padding: 12px 0 0;
815
+ border-top: 1px solid rgba(255,255,255,0.1);
816
+ }
817
+
818
+ .${s.THREAD_INPUT} {
819
+ width: 100%;
820
+ background: transparent;
821
+ border: none;
822
+ padding: 0;
823
+ color: white;
824
+ font-size: 14px;
825
+ font-family: inherit;
826
+ outline: none;
827
+ box-sizing: border-box;
828
+ }
829
+
830
+ .${s.THREAD_INPUT}::placeholder {
831
+ color: rgba(255,255,255,0.5);
832
+ }
833
+
834
+ .${s.THREAD_INPUT}:focus {
835
+ outline: none;
836
+ box-shadow: none;
837
+ }
838
+
839
+ .${s.THREAD_SUBMIT} {
840
+ background: none;
841
+ border: none;
842
+ color: #2E90FA;
843
+ cursor: pointer;
844
+ display: flex;
845
+ align-items: center;
846
+ justify-content: center;
847
+ border-radius: 6px;
848
+ transition: background 0.2s;
849
+ }
850
+
851
+ .${s.THREAD_SUBMIT}:hover {
852
+ background: rgba(46, 144, 250, 0.15);
853
+ color: #1570D6;
854
+ }
855
+
856
+ .${s.CLOSE_TOOLTIP} {
857
+ background: none;
858
+ border: none;
859
+ font-size: 18px;
860
+ cursor: pointer;
861
+ color: rgba(255,255,255,0.5);
862
+ line-height: 1;
863
+ }
864
+
865
+ .${s.CLOSE_TOOLTIP}:hover {
866
+ color: white;
867
+ }
868
+
869
+ .${s.PREVIEW_CIRCLE} {
870
+ animation: helldots-pulse 1.5s ease-in-out infinite;
871
+ }
872
+
873
+ @keyframes helldots-pulse {
874
+ 0%, 100% { box-shadow: 0 0 0 0 rgba(46, 144, 250, 0.4), 0 1px 5px rgba(0,0,0,0.2); }
875
+ 50% { box-shadow: 0 0 0 8px rgba(46, 144, 250, 0), 0 1px 5px rgba(0,0,0,0.2); }
876
+ }
877
+
878
+ .${s.COMMENT_OVERLAY} {
879
+ position: fixed;
880
+ top: 0;
881
+ left: 0;
882
+ right: 0;
883
+ bottom: 0;
884
+ background: transparent;
885
+ pointer-events: none;
886
+ z-index: ${S.TOOLBAR-1};
887
+ }
888
+
889
+ .${s.COMMENT_OVERLAY}.${s.ACTIVE} {
890
+ pointer-events: auto;
891
+ background: rgba(0, 0, 0, 0.1);
892
+ }
893
+
894
+ .${s.SELECTION_RECT} {
895
+ position: fixed;
896
+ border: 2px solid #2E90FA;
897
+ background: rgba(46, 144, 250, 0.1);
898
+ pointer-events: none;
899
+ z-index: ${S.TOOLTIP};
900
+ box-sizing: border-box;
901
+ }
902
+
903
+ .${s.SCREENSHOTS_CONTAINER} {
904
+ display: none;
905
+ overflow-x: auto;
906
+ gap: 8px;
907
+ margin-top: 4px;
908
+ padding: 4px 0;
909
+ scrollbar-width: none;
910
+ -ms-overflow-style: none;
911
+ margin-bottom: 16px;
912
+ }
913
+
914
+ .${s.SCREENSHOTS_CONTAINER}::-webkit-scrollbar {
915
+ display: none;
916
+ }
917
+
918
+ .${s.SCREENSHOTS_CONTAINER}.${s.ACTIVE} {
919
+ display: flex;
920
+ }
921
+
922
+ .${s.SCREENSHOT_ITEM} {
923
+ position: relative;
924
+ flex-shrink: 0;
925
+ }
926
+
927
+ .${s.SCREENSHOT_ITEM} .${s.SCREENSHOT_IMG} {
928
+ width: 50px;
929
+ height: 50px;
930
+ object-fit: cover;
931
+ border-radius: 8px;
932
+ cursor: pointer;
933
+ display: block;
934
+ margin: 0;
935
+ }
936
+
937
+ .${s.SCREENSHOT_ITEM} .${s.SCREENSHOT_IMG}:hover {
938
+ opacity: 0.85;
939
+ }
940
+
941
+ .${s.SCREENSHOT_ITEM} .${s.SCREENSHOT_REMOVE} {
942
+ position: absolute;
943
+ top: -5px;
944
+ right: -5px;
945
+ width: 18px;
946
+ height: 18px;
947
+ background: rgba(0,0,0,0.7);
948
+ border: none;
949
+ border-radius: 50%;
950
+ color: white;
951
+ font-size: 12px;
952
+ line-height: 1;
953
+ cursor: pointer;
954
+ display: none;
955
+ align-items: center;
956
+ justify-content: center;
957
+ z-index: 1;
958
+ }
959
+
960
+ .${s.SCREENSHOT_ITEM}:hover .${s.SCREENSHOT_REMOVE} {
961
+ display: flex;
962
+ }
963
+
964
+ .${s.SCREENSHOT_ITEM} .${s.SCREENSHOT_REMOVE}:hover {
965
+ background: rgba(0,0,0,0.9);
966
+ }
967
+
968
+ .${s.TOOLTIP} > .${s.SCREENSHOTS_CONTAINER} .${s.SCREENSHOT_ITEM} .${s.SCREENSHOT_IMG},
969
+ .${s.THREAD_POPOVER} > .${s.SCREENSHOTS_CONTAINER} .${s.SCREENSHOT_ITEM} .${s.SCREENSHOT_IMG},
970
+ .${s.THREAD_REPLY} .${s.SCREENSHOT_ITEM} .${s.SCREENSHOT_IMG} {
971
+ width: 144px;
972
+ height: 100px;
973
+ }
974
+
975
+ .${s.LIGHTBOX} {
976
+ position: fixed;
977
+ top: 0;
978
+ left: 0;
979
+ right: 0;
980
+ bottom: 0;
981
+ background: rgba(0,0,0,0.92);
982
+ z-index: ${S.LIGHTBOX};
983
+ display: flex;
984
+ align-items: center;
985
+ justify-content: center;
986
+ animation: helldots-fade-in 0.2s ease;
987
+ }
988
+
989
+ @keyframes helldots-fade-in {
990
+ from { opacity: 0; }
991
+ to { opacity: 1; }
992
+ }
993
+
994
+ .${s.LIGHTBOX_IMG} {
995
+ max-width: 90vw;
996
+ max-height: 90vh;
997
+ object-fit: contain;
998
+ border-radius: 8px;
999
+ }
1000
+
1001
+ .${s.LIGHTBOX_CLOSE} {
1002
+ position: absolute;
1003
+ top: 16px;
1004
+ right: 16px;
1005
+ background: rgba(255,255,255,0.15);
1006
+ border: none;
1007
+ color: white;
1008
+ font-size: 24px;
1009
+ width: 40px;
1010
+ height: 40px;
1011
+ border-radius: 50%;
1012
+ cursor: pointer;
1013
+ display: flex;
1014
+ align-items: center;
1015
+ justify-content: center;
1016
+ transition: background 0.2s;
1017
+ }
1018
+
1019
+ .${s.LIGHTBOX_CLOSE}:hover {
1020
+ background: rgba(255,255,255,0.3);
1021
+ }
1022
+ `,rt=()=>`
1023
+ .${s.COMMENT_CURSOR},
1024
+ .${s.COMMENT_CURSOR} * {
1025
+ cursor: url('${ot}') 6 6, auto !important;
1026
+ }
1027
+ `;var R={commentAriaLabelPrefix:"Comment: ",anonymous:"Anonymous",justNow:"Just now",minutesAgoTemplate:"{n}m",hoursAgoTemplate:"{n}h",daysAgoTemplate:"{n}d",toolbarComment:"Comment",toolbarInbox:"Inbox",modifierAlt:"Alt",modifierCtrl:"Ctrl",commentBoxAriaLabel:"New comment",commentPlaceholder:"Type your comment...",attachImage:"Attach image",send:"Send",tooltipAriaLabel:"Comment preview",close:"Close",popoverAriaLabel:"Comment thread",replyPlaceholder:"Reply...",attachedScreenshot:"Attached screenshot",screenshotPreview:"Screenshot preview",removeScreenshot:"Remove screenshot",inboxAriaLabel:"Comments inbox",inboxEmpty:"No comments yet",orphanedBadge:"Unanchored",hiddenBadge:"Hidden",filterAll:"All comments",filterCurrentPage:"Current page",filterByPage:"Filter by Page",filterByStatus:"Filter by Status",filterStatusAll:"All",filterUnresolved:"Unresolved",filterResolved:"Resolved",back:"Back",deleteComment:"Delete",copyAgentContext:"Copy agent context",copied:"Copied",statusLabel:"Status",prevComment:"Previous comment",nextComment:"Next comment",replyLink:"Reply",commentOptions:"Comment options",moreOptions:"More",statusOpen:"Open",statusInProgress:"In progress",statusResolved:"Resolved",durationLessThanMinute:"<1m",resolvedInTemplate:"Resolved in {n}",typeLabel:"Type",priorityLabel:"Priority",unset:"Unset",typeBug:"Bug",typeSuggestion:"Suggestion",typeQuestion:"Question",typeImprovement:"Improvement",priorityHigh:"High",priorityMedium:"Medium",priorityLow:"Low",tagsPlaceholder:"Add tags...",removeTag:"Remove tag",filterByType:"Filter by Type",filterByPriority:"Filter by Priority",contextSection:"Context",autoScreenshotLabel:"Automatic context",contextUrl:"URL",contextViewport:"Viewport",contextScreen:"Screen",contextBrowser:"Browser",contextOs:"OS"};var it={commentAriaLabelPrefix:"Comentario: ",anonymous:"An\xF3nimo",justNow:"Justo ahora",minutesAgoTemplate:"{n}m",hoursAgoTemplate:"{n}h",daysAgoTemplate:"{n}d",toolbarComment:"Comentar",toolbarInbox:"Bandeja",modifierAlt:"Alt",modifierCtrl:"Ctrl",commentBoxAriaLabel:"Nuevo comentario",commentPlaceholder:"Escribe tu comentario...",attachImage:"Adjuntar imagen",send:"Enviar",tooltipAriaLabel:"Vista previa del comentario",close:"Cerrar",popoverAriaLabel:"Hilo de comentarios",replyPlaceholder:"Responder...",attachedScreenshot:"Captura de pantalla adjunta",screenshotPreview:"Vista previa de la captura",removeScreenshot:"Quitar captura de pantalla",inboxAriaLabel:"Bandeja de comentarios",inboxEmpty:"A\xFAn no hay comentarios",orphanedBadge:"Desanclado",hiddenBadge:"Oculto",filterAll:"Todos los comentarios",filterCurrentPage:"P\xE1gina actual",filterByPage:"Filtrar por p\xE1gina",filterByStatus:"Filtrar por estado",filterStatusAll:"Todos",filterUnresolved:"Sin resolver",filterResolved:"Resueltos",back:"Volver",deleteComment:"Eliminar",copyAgentContext:"Copiar contexto de agente",copied:"Copiado",statusLabel:"Estado",prevComment:"Comentario anterior",nextComment:"Comentario siguiente",replyLink:"Responder",commentOptions:"Opciones del comentario",moreOptions:"M\xE1s",statusOpen:"Abierto",statusInProgress:"En progreso",statusResolved:"Resuelto",durationLessThanMinute:"<1m",resolvedInTemplate:"Resuelto en {n}",typeLabel:"Tipo",priorityLabel:"Prioridad",unset:"Sin definir",typeBug:"Bug",typeSuggestion:"Sugerencia",typeQuestion:"Pregunta",typeImprovement:"Mejora",priorityHigh:"Alta",priorityMedium:"Media",priorityLow:"Baja",tagsPlaceholder:"A\xF1adir etiquetas...",removeTag:"Quitar etiqueta",filterByType:"Filtrar por tipo",filterByPriority:"Filtrar por prioridad",contextSection:"Contexto",autoScreenshotLabel:"Contexto autom\xE1tico",contextUrl:"URL",contextViewport:"Viewport",contextScreen:"Pantalla",contextBrowser:"Navegador",contextOs:"SO"};var be={en:R,es:it},Ce="en";function st(){let t=(navigator.language||Ce).slice(0,2).toLowerCase();return t in be?t:Ce}function at(t){return be[t]||be[Ce]}function w(t,e){return t.replace("{n}",String(e))}var Yo=6e4;function te(t,e){if(!Number.isFinite(t)||t<0)return"";let o=Math.floor(t/Yo);if(o<1)return e.durationLessThanMinute;if(o<60)return w(e.minutesAgoTemplate,o);let n=Math.floor(o/60);if(n<24){let a=o%60,d=w(e.hoursAgoTemplate,n);return a?`${d} ${w(e.minutesAgoTemplate,a)}`:d}let r=Math.floor(n/24),i=n%24,l=w(e.daysAgoTemplate,r);return i?`${l} ${w(e.hoursAgoTemplate,i)}`:l}var Wo=/^(css|sc|jsx|emotion)-/i,jo=/^data-(reactid|react-|v-|svelte-)/,qo=["id","name","role","aria-label"],Ko=["data-testid","name","aria-label"],Te=t=>typeof CSS<"u"&&CSS.escape?CSS.escape(t):String(t).replace(/[^a-zA-Z0-9_-]/g,"\\$&"),Zo=t=>String(t).replace(/["\\]/g,"\\$&"),z=(t,e)=>{try{return e.querySelectorAll(t).length===1}catch{return!1}},dt=t=>(t||"").replace(/\s+/g," ").trim().slice(0,64),Qo=t=>Wo.test(t)?!1:!t.split(/[-_]/).some(e=>e.length>=5&&/\d/.test(e)),Jo=t=>[...t.classList].filter(Qo),en=t=>{let e={};for(let{name:o,value:n}of t.attributes)(qo.includes(o)||o.startsWith("data-")&&!jo.test(o))&&n&&(e[o]=n.slice(0,64));return e},ye=t=>{let e=t.parentElement;if(!e)return{index:0,count:1};let o=[...e.children].filter(n=>n.tagName===t.tagName);return{index:o.indexOf(t),count:o.length}},tn=(t,e)=>{if(!t.id)return null;let o=`#${Te(t.id)}`;return z(o,e)?o:null},on=(t,e)=>{let o=t.tagName.toLowerCase();for(let n of Ko){let r=t.getAttribute(n);if(!r)continue;let i=`${o}[${n}="${Zo(r)}"]`;if(z(i,e))return i}return null},nn=(t,e)=>{let o=[],n=t;for(let r=0;r<3&&n;r++){let i=Jo(n),l=n.tagName.toLowerCase();if(o.unshift(i.length?`${l}.${i.map(Te).join(".")}`:l),r===0&&!i.length)return null;let a=o.join(" > ");if(z(a,e))return a;n=n.parentElement}return null},rn=(t,e)=>{if(t===e.body)return"body";let o=[],n=t;for(let i=0;i<5&&n;i++){if(n===e.body){o.unshift("body");break}if(n.id){let a=[`#${Te(n.id)}`,...o].join(" > ");if(z(a,e))return a}let{index:l}=ye(n);o.unshift(`${n.tagName.toLowerCase()}:nth-of-type(${l+1})`),n=n.parentElement}let r=o.join(" > ");return z(r,e)?r:null},ht=(t,e)=>tn(t,e)||on(t,e)||nn(t,e)||rn(t,e);function pt(t){return ht(t,t.ownerDocument)}function ut(t,e,o){let n=t.ownerDocument,{index:r,count:i}=ye(t);return{version:1,selector:ht(t,n),fingerprint:{tagName:t.tagName,textSnippet:dt(t.textContent),attributes:en(t),siblingIndex:r,siblingCount:i},relativeX:e,relativeY:o}}var sn=(t,e)=>{if(!t&&!e)return 1;if(!t||!e)return 0;if(t===e)return 1;if(t.startsWith(e)||e.startsWith(t))return .8;let o=new Set(t.split(" ")),n=new Set(e.split(" ")),r=0;for(let i of o)n.has(i)&&r++;return 2*r/(o.size+n.size)},an=(t,e)=>{let o=Object.keys(e);if(!o.length)return 1;let n=0;for(let r of o)(t.getAttribute(r)||"").slice(0,64)===e[r]&&n++;return n/o.length},lt=(t,e)=>{let{index:o,count:n}=ye(t),r=Math.abs(o-e.siblingIndex),i=Math.max(e.siblingCount,n,1);return Math.max(0,1-r/i)},ln=(t,e)=>{if(t.tagName!==e.tagName)return 0;let o=!!e.textSnippet,n=Object.keys(e.attributes||{}).length>0,r=.5,i=.3,l=.2;return n?o||(i+=r,r=0):(r+=i,i=0),!o&&!n?lt(t,e):r*sn(dt(t.textContent),e.textSnippet)+i*an(t,e.attributes||{})+l*lt(t,e)},ct=(t,e)=>{let o=null;for(let n of t){let r=ln(n,e);(!o||r>o.confidence)&&(o={element:n,confidence:r})}return o};function mt(t,e=document){let o=t?.fingerprint;if(!o||!o.tagName)return null;if(t.selector){let l=[];try{l=[...e.querySelectorAll(t.selector)]}catch{}let a=ct(l,o);if(a&&a.confidence>=.6)return a}if(!(!!o.textSnippet||Object.keys(o.attributes||{}).length>0))return null;let r;try{r=[...e.querySelectorAll(o.tagName)]}catch{return null}let i=ct(r,o);return i&&i.confidence>=.7?i:null}var ft="helldots-comments",oe="helldots-pending-detail";function ne(){try{let t=localStorage.getItem(ft);if(!t)return[];let e=JSON.parse(t);return Array.isArray(e)?e:[]}catch(t){return console.warn("HellDots: could not read stored comments",t),[]}}function gt(t){try{return localStorage.setItem(ft,JSON.stringify(t)),!0}catch{return!1}}function xe(t){if(gt(t))return!0;let e=t.map((r,i)=>({comment:r,index:i})).filter(({comment:r})=>r?.contextScreenshot).sort((r,i)=>{let l=Date.parse(r.comment.createdAt),a=Date.parse(i.comment.createdAt);return Number.isFinite(l)&&Number.isFinite(a)&&l!==a?l-a:r.index-i.index});if(e.length===0)return console.warn("HellDots: could not persist comments (storage quota exceeded, nothing left to shed)"),!1;let o=[...t],n=0;for(let{index:r}of e)if(o[r]={...o[r],contextScreenshot:null},n++,gt(o))return console.warn(`HellDots: localStorage quota exceeded \u2014 dropped the automatic context screenshot from the ${n} oldest comment(s) to keep all comments persisted. Comment text, replies and user-attached screenshots were not touched.`),!0;return console.warn(`HellDots: could not persist comments even after dropping all ${n} automatic context screenshot(s); storage quota exceeded`),!1}function _e(t,e,o){let n=new Set(e.map(i=>i.id));return[...t.filter(i=>!n.has(i.id)&&i.page!==o),...e]}var Et='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>',cn='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>',dn='<svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor"><circle cx="5" cy="12" r="1.6"/><circle cx="12" cy="12" r="1.6"/><circle cx="19" cy="12" r="1.6"/></svg>',re=t=>{if(navigator.clipboard?.writeText)return navigator.clipboard.writeText(t).catch(()=>{});let e=document.createElement("textarea");e.value=t,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select();try{document.execCommand("copy")}catch{}return e.remove(),Promise.resolve()},hn=(t,e)=>({open:e.statusOpen,in_progress:e.statusInProgress,resolved:e.statusResolved})[t]||e.statusOpen,B=(t,e)=>({bug:e.typeBug,suggestion:e.typeSuggestion,question:e.typeQuestion,improvement:e.typeImprovement})[t]||e.unset,P=(t,e)=>({high:e.priorityHigh,medium:e.priorityMedium,low:e.priorityLow})[t]||e.unset,H=({action:t,options:e,value:o,colorOf:n,labelOf:r,tooltipLabel:i,onSelect:l,showLabel:a=!1})=>{let d=document.createElement("div");d.style.position="relative";let p=document.createElement("button");p.type="button",p.className=s.INBOX_ACTION_BTN,a&&p.classList.add(s.INBOX_ACTION_BTN_LABELED),p.dataset.action=t,p.setAttribute("aria-haspopup","true");let c=document.createElement("span");c.className=s.INBOX_STATUS_DOT,p.appendChild(c);let m=null;a&&(m=document.createElement("span"),m.className=s.INBOX_ACTION_LABEL,p.appendChild(m));let u=document.createElement("div");u.className=s.INBOX_MENU,u.style.display="none",u.setAttribute("role","menu");let h=o,g=()=>{let f=`${i}: ${r(h)}`;c.style.backgroundColor=n(h),p.dataset.hdTooltip=f,p.setAttribute("aria-label",f),m&&(m.textContent=r(h)),u.querySelectorAll("[data-picker-option]").forEach(E=>{let b=E.dataset.pickerOption,C=b===""?null:b;E.setAttribute("aria-checked",String(C===h))})};for(let f of e){let E=document.createElement("button");E.type="button",E.className=s.INBOX_MENU_ITEM,E.dataset.pickerOption=f===null?"":f,E.setAttribute("role","menuitemradio");let b=document.createElement("span");b.className=s.INBOX_STATUS_DOT,b.style.backgroundColor=n(f),E.appendChild(b),E.appendChild(document.createTextNode(r(f))),E.addEventListener("click",C=>{C.stopPropagation(),u.style.display="none",f!==h&&(h=f,l(f),g())}),u.appendChild(E)}return p.addEventListener("click",f=>{f.stopPropagation(),u.style.display=u.style.display==="none"?"block":"none"}),d.appendChild(p),d.appendChild(u),g(),d},ie=(t,{strings:e,onCopy:o,onSetStatus:n,onSetType:r,onSetPriority:i,onDelete:l})=>{let a=document.createElement("div");a.className=s.INBOX_CARD_ACTIONS;let d=document.createElement("button");d.type="button",d.className=s.INBOX_ACTION_BTN,d.dataset.action="copy",d.dataset.hdTooltip=e.copyAgentContext,d.setAttribute("aria-label",e.copyAgentContext),d.innerHTML=Et,d.addEventListener("click",h=>{h.stopPropagation(),o(t),d.innerHTML=cn,d.dataset.hdTooltip=e.copied,setTimeout(()=>{d.innerHTML=Et,d.dataset.hdTooltip=e.copyAgentContext},1500)}),a.appendChild(d),a.appendChild(H({action:"status",options:V,value:t.status||"open",colorOf:h=>et[h]||"",labelOf:h=>hn(h,e),tooltipLabel:e.statusLabel,onSelect:h=>n(t,h)})),a.appendChild(H({action:"type",options:[null,...A],value:t.type||null,colorOf:h=>D[h]||"transparent",labelOf:h=>B(h,e),tooltipLabel:e.typeLabel,onSelect:h=>r?.(t,h),showLabel:!0})),a.appendChild(H({action:"priority",options:[null,...N],value:t.priority||null,colorOf:h=>k[h]||"transparent",labelOf:h=>P(h,e),tooltipLabel:e.priorityLabel,onSelect:h=>i?.(t,h),showLabel:!0}));let p=document.createElement("div");p.style.position="relative";let c=document.createElement("button");c.type="button",c.className=s.INBOX_ACTION_BTN,c.dataset.action="menu",c.dataset.hdTooltip=e.moreOptions,c.setAttribute("aria-label",e.commentOptions),c.innerHTML=dn;let m=document.createElement("div");m.className=s.INBOX_MENU,m.style.display="none";let u=document.createElement("button");return u.type="button",u.className=s.INBOX_MENU_ITEM,u.textContent=e.deleteComment,u.addEventListener("click",h=>{h.stopPropagation(),m.style.display="none",l(t)}),m.appendChild(u),c.addEventListener("click",h=>{h.stopPropagation(),m.style.display=m.style.display==="none"?"block":"none"}),p.appendChild(c),p.appendChild(m),a.appendChild(p),a};var pn=(t,e)=>{let o=Date.now()-new Date(t).getTime(),n=Math.floor(o/6e4),r=Math.floor(o/36e5),i=Math.floor(o/864e5);return n<1?e.justNow:n<60?w(e.minutesAgoTemplate,n):r<24?w(e.hoursAgoTemplate,r):w(e.daysAgoTemplate,i)},un=(t,e)=>new Intl.DateTimeFormat(e,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}).format(new Date(t)),Y=(t,e,o,n)=>{let r=document.createElement("div");r.className=s.THREAD_META;let i=document.createElement("span");i.className=s.THREAD_AUTHOR,i.textContent=t||o.anonymous;let l=document.createElement("span");return l.className=s.THREAD_TIME,l.textContent=pn(e,o),l.dataset.fullDate=un(e,n),r.appendChild(i),r.appendChild(l),r},mn=(t,e)=>{let o=/Mac|iPod|iPhone|iPad/.test(navigator.userAgent),n={alt:o?"\u2325":e.modifierAlt,ctrl:o?"\u2318":e.modifierCtrl,shift:"\u21E7"},r=n[t.shortcutModifier]||n.alt,i=t.shortcutKey?.toUpperCase()||"C";return`${r} + ${i}`},gn='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><circle cx="8.5" cy="8.5" r="1.5"/><polyline points="21 15 16 10 5 21"/></svg>',fn='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M22 2L11 13M22 2L15 22L11 13M11 13L2 9L22 2"/></svg>',En='<svg width="16" height="16" viewBox="0 0 16 16" stroke-linejoin="round" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M2.8914 10.4028L2.98327 10.6318C3.22909 11.2445 3.5 12.1045 3.5 13C3.5 13.3588 3.4564 13.7131 3.38773 14.0495C3.69637 13.9446 4.01409 13.8159 4.32918 13.6584C4.87888 13.3835 5.33961 13.0611 5.70994 12.7521L6.22471 12.3226L6.88809 12.4196C7.24851 12.4724 7.61994 12.5 8 12.5C11.7843 12.5 14.5 9.85569 14.5 7C14.5 4.14431 11.7843 1.5 8 1.5C4.21574 1.5 1.5 4.14431 1.5 7C1.5 8.18175 1.94229 9.29322 2.73103 10.2153L2.8914 10.4028ZM2.8135 15.7653C1.76096 16 1 16 1 16C1 16 1.43322 15.3097 1.72937 14.4367C1.88317 13.9834 2 13.4808 2 13C2 12.3826 1.80733 11.7292 1.59114 11.1903C0.591845 10.0221 0 8.57152 0 7C0 3.13401 3.58172 0 8 0C12.4183 0 16 3.13401 16 7C16 10.866 12.4183 14 8 14C7.54721 14 7.10321 13.9671 6.67094 13.9038C6.22579 14.2753 5.66881 14.6656 5 15C4.23366 15.3832 3.46733 15.6195 2.8135 15.7653Z"/></svg>',bn='<svg width="16" height="16" viewBox="0 0 16 16" stroke-linejoin="round" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M1.67705 7.5L3.92705 3H12.0729L14.3229 7.5H10H9.25V8.25C9.25 8.94036 8.69036 9.5 8 9.5C7.30964 9.5 6.75 8.94036 6.75 8.25V7.5H6H1.67705ZM1.5 9V12C1.5 12.5523 1.94772 13 2.5 13H13.5C14.0523 13 14.5 12.5523 14.5 12V9H10.6465C10.32 10.1543 9.25878 11 8 11C6.74122 11 5.67998 10.1543 5.35352 9H1.5ZM3 1.5H13L15.8944 7.28885C15.9639 7.42771 16 7.58082 16 7.73607V12C16 13.3807 14.8807 14.5 13.5 14.5H2.5C1.11929 14.5 0 13.3807 0 12V7.73607C0 7.58082 0.0361451 7.42771 0.105573 7.28885L3 1.5Z"/></svg>',se=({areaClassName:t,inputTag:e="textarea",inputClassName:o,inputId:n,inputPlaceholder:r,submitBtnId:i,fileInputId:l},a)=>{let d=document.createElement("div");d.className=t;let p=document.createElement(e);n&&(p.id=n),o&&(p.className=o),p.placeholder=r,p.setAttribute("aria-label",r),e==="input"&&(p.type="text");let c=document.createElement("div");c.className=s.SCREENSHOTS_CONTAINER;let m=document.createElement("div");m.className=s.COMMENT_ACTIONS_BAR;let u=document.createElement("button");u.className=s.ATTACH_IMAGE_BTN,u.type="button",u.setAttribute("aria-label",a.attachImage),u.innerHTML=gn;let h=document.createElement("input");h.type="file",l&&(h.id=l),h.accept="image/*",h.style.display="none";let g=document.createElement("button");return i&&(g.id=i),g.className=s.THREAD_SUBMIT,g.type="button",g.setAttribute("aria-label",a.send),g.innerHTML=fn,m.appendChild(u),m.appendChild(h),m.appendChild(g),d.appendChild(p),d.appendChild(c),d.appendChild(m),{container:d,inputEl:p,screenshotsContainer:c,attachBtn:u,fileInput:h,submitBtn:g}},bt=(t,e,o,n)=>{let r=document.createElement("div");r.className=s.TOOLBAR_ACTION_WRAPPER;let i=document.createElement("div");i.className=s.TOOLBAR_ACTION_TOOLTIP,o.forEach(a=>i.appendChild(a));let l=document.createElement("button");return l.type="button",l.className=`${s.TOOLBAR_ACTION_BTN} ${t}`,l.setAttribute("aria-label",n),l.innerHTML=e,r.appendChild(i),r.appendChild(l),r},Ct=(t={},e=R)=>{let o=document.createElement("div");o.id=x.TOOLBAR;let n=document.createElement("div");n.className=s.TOOLBAR_ACTIONS;let r=document.createElement("span");r.className=s.TOOLBAR_TEXT,r.textContent=e.toolbarComment;let i=document.createElement("span");i.className=s.SHORTCUT_HINT,i.textContent=mn(t,e);let l=bt(s.TOOLBAR_COMMENT_BTN,En,[r,i],e.toolbarComment);l.querySelector(`.${s.TOOLBAR_COMMENT_BTN}`)?.setAttribute("aria-pressed","false");let a=document.createElement("span");a.className=s.TOOLBAR_TEXT,a.textContent=e.toolbarInbox;let d=bt(s.TOOLBAR_MENU_BTN,bn,[a],e.toolbarInbox);return n.appendChild(l),n.appendChild(d),o.appendChild(n),o},Cn=t=>{let e=document.createElement("div");e.className=s.CLASSIFY_ROW;let o=null,n=null,r=[],i=document.createElement("div");i.className=s.INBOX_BADGES;let l=document.createElement("input");l.type="text",l.className=s.TAGS_INPUT,l.placeholder=t.tagsPlaceholder,l.setAttribute("aria-label",t.tagsPlaceholder);let a=()=>{i.innerHTML="",r.forEach((c,m)=>{let u=document.createElement("span");u.className=s.TAG_CHIP,u.appendChild(document.createTextNode(c));let h=document.createElement("button");h.type="button",h.className=s.TAG_CHIP_REMOVE,h.setAttribute("aria-label",`${t.removeTag}: ${c}`),h.innerHTML="&times;",h.addEventListener("click",g=>{g.stopPropagation(),r.splice(m,1),a()}),u.appendChild(h),i.appendChild(u)})},d=()=>{let c=l.value.trim().toLowerCase();c&&!r.includes(c)&&(r.push(c),a()),l.value=""};l.addEventListener("keydown",c=>{c.key!=="Enter"&&c.key!==","||(c.preventDefault(),d())});let p=()=>{e.replaceChildren(),e.appendChild(H({action:"type",options:[null,...A],value:null,colorOf:c=>D[c]||"transparent",labelOf:c=>B(c,t),tooltipLabel:t.typeLabel,onSelect:c=>o=c,showLabel:!0})),e.appendChild(H({action:"priority",options:[null,...N],value:null,colorOf:c=>k[c]||"transparent",labelOf:c=>P(c,t),tooltipLabel:t.priorityLabel,onSelect:c=>n=c,showLabel:!0})),e.appendChild(l),e.appendChild(i)};return p(),{container:e,getType:()=>o,getPriority:()=>n,getTags:()=>(d(),[...r]),reset:()=>{o=null,n=null,r.length=0,l.value="",a(),p()}}},Tt=(t=R)=>{let e=document.createElement("div");e.id=x.COMMENT_BOX,e.setAttribute("role","dialog"),e.setAttribute("aria-label",t.commentBoxAriaLabel);let{container:o}=se({areaClassName:s.COMMENT_INPUT_AREA,inputTag:"textarea",inputId:x.COMMENT_INPUT,inputPlaceholder:t.commentPlaceholder,submitBtnId:x.SUBMIT_COMMENT,fileInputId:x.ATTACH_IMAGE_INPUT},t),n=Cn(t);return e.appendChild(n.container),e.appendChild(o),e.style.display="none",e.classify=n,e},yt=(t,e=R)=>{let o=document.createElement("div");return o.className=s.CIRCLE,o.dataset.commentId=t.id,o.dataset.commentText=t.text,o.setAttribute("role","button"),o.setAttribute("tabindex","0"),o.setAttribute("aria-label",`${e.commentAriaLabelPrefix}${t.text}`),o.style.cssText=`
1028
+ position: absolute;
1029
+ pointer-events: auto;
1030
+ `,o},W=(t,e)=>{let o=document.createElement("div");return o.className=s.SCREENSHOTS_CONTAINER,o.classList.add(s.ACTIVE),t.forEach(n=>{let r=document.createElement("div");r.className=s.SCREENSHOT_ITEM;let i=document.createElement("img");i.className=s.SCREENSHOT_IMG,i.src=n,i.alt=e.attachedScreenshot,r.appendChild(i),o.appendChild(r)}),o},xt=(t,e=R,o)=>{let n=document.createElement("div");n.className=s.TOOLTIP,n.dataset.for=t.id,n.setAttribute("role","dialog"),n.setAttribute("aria-label",e.tooltipAriaLabel);let r=document.createElement("div");r.className=s.THREAD_HEADER;let i=Y(t.author,t.createdAt,e,o),l=document.createElement("button");l.type="button",l.className=s.CLOSE_TOOLTIP,l.setAttribute("aria-label",e.close),l.innerHTML="&times;",r.appendChild(i),r.appendChild(l);let a=document.createElement("div");a.className=s.THREAD_BODY,a.textContent=t.text,n.appendChild(r),n.appendChild(a);let d=t.screenshots||(t.screenshot?[t.screenshot]:[]);return d.length>0&&n.appendChild(W(d,e)),n},j=(t,e=R,o)=>{let n=document.createElement("div");n.className=s.THREAD_REPLY;let r=Y(t.author,t.timestamp,e,o),i=document.createElement("div");i.className=s.THREAD_BODY,i.textContent=t.text,n.appendChild(r),n.appendChild(i);let l=t.screenshots||(t.screenshot?[t.screenshot]:[]);return l.length>0&&n.appendChild(W(l,e)),n},_t=(t,e=R,o)=>{let n=document.createElement("div");n.className=s.THREAD_POPOVER,n.dataset.for=t.id,n.setAttribute("role","dialog"),n.setAttribute("aria-label",e.popoverAriaLabel);let r=document.createElement("div");r.className=s.THREAD_HEADER;let i=Y(t.author,t.createdAt,e,o),l=document.createElement("button");l.type="button",l.className=s.CLOSE_TOOLTIP,l.setAttribute("aria-label",e.close),l.innerHTML="&times;",r.appendChild(i),r.appendChild(l);let a=document.createElement("div");a.className=s.THREAD_BODY,a.textContent=t.text;let d=document.createElement("div");d.className=s.THREAD_REPLIES,t.replies&&t.replies.forEach(m=>{d.appendChild(j(m,e,o))});let{container:p}=se({areaClassName:s.THREAD_INPUT_AREA,inputTag:"input",inputClassName:s.THREAD_INPUT,inputPlaceholder:e.replyPlaceholder},e);n.appendChild(r),n.appendChild(a);let c=t.screenshots||(t.screenshot?[t.screenshot]:[]);return c.length>0&&n.appendChild(W(c,e)),n.appendChild(d),n.appendChild(p),n};var Tn=t=>{let e=[...t.attributes].map(({name:o,value:n})=>`${o}="${n}"`).join(" ");return`<${t.tagName.toLowerCase()}${e?` ${e}`:""}>`},yn=t=>{if(!t?.tagName)return"(unknown)";let e=Object.entries(t.attributes||{}).map(([o,n])=>`${o}="${n}"`).join(" ");return`<${t.tagName.toLowerCase()}${e?` ${e}`:""}>`},xn=t=>{let e=[],o=t;for(;o&&o!==document.documentElement;){let n=o.tagName.toLowerCase(),r=o.id?`#${o.id}`:"",i=[...o.classList].slice(0,2).map(l=>`.${l}`).join("");if(e.unshift(`${n}${r}${i}`),o===document.body)break;o=o.parentElement}return e.join(" > ")};function ae(t,{viewportWidth:e,viewportHeight:o,strings:n}){let r=t.anchor,i=r?.fingerprint,l=t.container?.isConnected?t.container:null,a=t.hidden?"hidden":t.anchorState,d=l?Tn(l):yn(i),p=l?xn(l):"(unavailable)",c=t.context?.viewport,m=c?.width??e,u=c?.height??o,h=[`Page: ${t.page}`,`Viewport: ${m}x${u}`,`Anchor state: ${a}`,`Status: ${t.status||"open"}`,`Selector: ${r?.selector||"(none)"}`,`Element: ${d}`,`DOM path: ${p}`,`Nearby text: "${i?.textSnippet??""}"`,`Comment by ${t.author} (${t.createdAt}):`,`"${t.text}"`];t.type&&h.push(`Type: ${t.type}`),t.priority&&h.push(`Priority: ${t.priority}`),t.tags?.length&&h.push(`Tags: ${t.tags.join(", ")}`);let g=t.context;if(g&&(g.url&&h.push(`URL: ${g.url}`),g.screen&&h.push(`Screen: ${g.screen.width}x${g.screen.height}`),g.browser?.name&&h.push(`Browser: ${`${g.browser.name} ${g.browser.version||""}`.trim()}`),g.os?.name&&h.push(`OS: ${`${g.os.name} ${g.os.version||""}`.trim()}`)),n&&t.status==="resolved"&&t.resolvedAt){let E=te(new Date(t.resolvedAt).getTime()-new Date(t.createdAt).getTime(),n);E&&h.push(`Resolution time: ${E}`)}let f=t.replies||[];if(f.length>0){h.push(`Replies (${f.length}):`);for(let E of f)h.push(`- ${E.author}: "${E.text}"`)}return h.join(`
1031
+ `)}var _n='<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>',Sn='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"/></svg>',wn='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="18 15 12 9 6 15"/></svg>',On='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>',le=class{constructor({shadowRoot:e,strings:o,locale:n,currentPage:r,getComments:i,callbacks:l}){this.shadowRoot=e,this.strings=o,this.locale=n,this.currentPage=r,this.getComments=i,this.callbacks=l,this.pageFilter="page",this.statusFilter="all",this.typeFilter="all",this.priorityFilter="all",this.detailId=null,this.el=null}isOpen(){return!!this.el}open(){this.el||(this.el=document.createElement("div"),this.el.className=s.INBOX_PANEL,this.el.setAttribute("role","dialog"),this.el.setAttribute("aria-label",this.strings.inboxAriaLabel),this.shadowRoot.appendChild(this.el),this.render())}close(){this._clearHighlight(),this.el?.remove(),this.el=null,this.detailId=null}refresh(){this.el&&this.render()}_highlight(e){if(this._clearHighlight(),e.anchorState!=="anchored"||e.hidden||e.status==="resolved")return;let o=this.shadowRoot.querySelector(`[data-comment-id="${e.id}"]`);o&&(o.classList.add(s.HIGHLIGHT),this._highlightedEl=o)}_clearHighlight(){this._highlightedEl?.classList.remove(s.HIGHLIGHT),this._highlightedEl=null}filteredComments(){let e=this.getComments();return this.pageFilter==="page"&&(e=e.filter(o=>o.page===this.currentPage)),this.statusFilter==="resolved"?e=e.filter(o=>o.status==="resolved"):this.statusFilter==="unresolved"&&(e=e.filter(o=>o.status!=="resolved")),this.typeFilter!=="all"&&(e=e.filter(o=>o.type===this.typeFilter)),this.priorityFilter!=="all"&&(e=e.filter(o=>o.priority===this.priorityFilter)),[...e.filter(o=>o.status!=="resolved"),...e.filter(o=>o.status==="resolved")]}render(){if(!this.el)return;this._clearHighlight(),this.el.innerHTML="";let e=this.filteredComments(),o=this.detailId!=null?e.find(n=>n.id===this.detailId):null;o?this._renderDetail(o,e):(this.detailId=null,this._renderList(e))}openDetail(e){this.el||this.open();let o=this.getComments().find(n=>n.id===e);o&&this._openDetail(o)}_openDetail(e){this.detailId=e.id,e.anchorState==="anchored"&&!e.hidden&&this.callbacks.onOpenDetailScroll(e),this.render()}_closeButton(){let e=document.createElement("button");return e.type="button",e.className=s.INBOX_CLOSE,e.setAttribute("aria-label",this.strings.close),e.innerHTML="&times;",e.addEventListener("click",()=>this.callbacks.onClose()),e}_renderList(e){let o=document.createElement("div");o.className=s.INBOX_HEADER,o.appendChild(this._buildFilter()),o.appendChild(this._closeButton()),this.el.appendChild(o);let n=document.createElement("div");if(n.className=s.INBOX_LIST,this.el.appendChild(n),e.length===0){let r=document.createElement("div");r.className=s.INBOX_EMPTY,r.textContent=this.strings.inboxEmpty,n.appendChild(r);return}for(let r of e)n.appendChild(this._buildCard(r,{interactive:!0}))}_pageFilterLabel(e){return e==="all"?this.strings.filterAll:this.strings.filterCurrentPage}_statusFilterLabel(e){return e==="unresolved"?this.strings.filterUnresolved:e==="resolved"?this.strings.filterResolved:this.strings.filterStatusAll}_filterSummaryLabel(){let e=[this._pageFilterLabel(this.pageFilter)];return this.statusFilter!=="all"&&e.push(this._statusFilterLabel(this.statusFilter)),this.typeFilter!=="all"&&e.push(B(this.typeFilter,this.strings)),this.priorityFilter!=="all"&&e.push(P(this.priorityFilter,this.strings)),e.join(" \xB7 ")}_buildFilter(){let e=document.createElement("div");e.className=s.INBOX_FILTER+"-wrapper";let o=this._filterSummaryLabel(),n=document.createElement("button");n.type="button",n.className=s.INBOX_FILTER,n.setAttribute("aria-haspopup","true"),n.setAttribute("aria-expanded","false"),n.innerHTML=`<span>${o}</span>${_n}`;let r=document.createElement("div");r.className=s.INBOX_FILTER_MENU,r.style.display="none";let i=a=>{let d=document.createElement("div");d.className=s.INBOX_FILTER_SECTION,d.textContent=a,r.appendChild(d)},l=(a,d,p,c,m)=>{let u=document.createElement("button");u.type="button",u.className=s.INBOX_FILTER_OPTION,u.dataset[p]=c,u.setAttribute("role","menuitemradio"),u.setAttribute("aria-checked",String(d)),u.innerHTML=`<span>${a}</span>${d?"\u2713":""}`,u.addEventListener("click",h=>{h.stopPropagation(),m(),this.render()}),r.appendChild(u)};i(this.strings.filterByPage);for(let a of["all","page"])l(this._pageFilterLabel(a),this.pageFilter===a,"filterPage",a,()=>this.pageFilter=a);i(this.strings.filterByStatus);for(let a of["all","unresolved","resolved"])l(this._statusFilterLabel(a),this.statusFilter===a,"filterStatus",a,()=>this.statusFilter=a);i(this.strings.filterByType);for(let a of["all",...A])l(a==="all"?this.strings.filterStatusAll:B(a,this.strings),this.typeFilter===a,"filterType",a,()=>this.typeFilter=a);i(this.strings.filterByPriority);for(let a of["all",...N])l(a==="all"?this.strings.filterStatusAll:P(a,this.strings),this.priorityFilter===a,"filterPriority",a,()=>this.priorityFilter=a);return n.addEventListener("click",a=>{a.stopPropagation();let d=r.style.display!=="none";r.style.display=d?"none":"block",n.setAttribute("aria-expanded",String(!d))}),e.appendChild(n),e.appendChild(r),e}_buildCard(e,{interactive:o}){let n=document.createElement("div");n.className=s.INBOX_CARD,e.status==="resolved"&&n.classList.add(`${s.INBOX_CARD}--resolved`),n.dataset.commentId=e.id;let r=document.createElement("div");r.className=s.INBOX_CARD_HEADER,r.appendChild(Y(e.author,e.createdAt,this.strings,this.locale)),r.appendChild(this._buildCardActions(e)),n.appendChild(r);let i=document.createElement("div");if(i.className=s.INBOX_CARD_TEXT,i.textContent=e.text,n.appendChild(i),e.screenshots?.length){let d=W(e.screenshots,this.strings);d.querySelectorAll(`.${s.SCREENSHOT_IMG}`).forEach(p=>{p.addEventListener("click",c=>{c.stopPropagation(),this.callbacks.onShowLightbox(p.src)})}),n.appendChild(d)}let l=this._buildBadges(e);l&&n.appendChild(l);let a=this._buildTag(e);if(a&&n.appendChild(a),o){n.setAttribute("role","button"),n.setAttribute("tabindex","0");let d=()=>e.anchorState==="inactive"?this.callbacks.onNavigateToPage(e):this._openDetail(e),p=document.createElement("button");p.type="button",p.className=s.INBOX_CARD_REPLY_LINK,p.textContent=this.strings.replyLink,p.addEventListener("click",c=>{c.stopPropagation(),d()}),n.appendChild(p),n.addEventListener("click",d),n.addEventListener("keydown",c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),d())}),n.addEventListener("mouseenter",()=>this._highlight(e)),n.addEventListener("mouseleave",()=>this._clearHighlight())}return n}_buildTag(e){let o=null;if(e.anchorState==="orphaned"?o=this.strings.orphanedBadge:e.hidden?o=this.strings.hiddenBadge:e.anchorState==="inactive"&&(o=e.page),!o)return null;let n=document.createElement("span");return n.className=s.INBOX_CARD_TAG,n.textContent=o,n}_buildBadges(e){let o=document.createElement("div");o.className=s.INBOX_BADGES;let n=(r,i,l)=>{let a=document.createElement("span");a.className=`${s.BADGE} ${i}`,a.textContent=r,l&&(a.style.borderColor=l),o.appendChild(a)};e.type&&n(B(e.type,this.strings),s.BADGE_TYPE,D[e.type]),e.priority&&n(P(e.priority,this.strings),s.BADGE_PRIORITY,k[e.priority]);for(let r of e.tags||[])n(r,s.BADGE_TAG,null);if(e.status==="resolved"){let r=e.resolvedAt?te(new Date(e.resolvedAt).getTime()-new Date(e.createdAt).getTime(),this.strings):"";n(w(this.strings.resolvedInTemplate,r||"\u2014"),s.BADGE_DURATION,null)}return o.children.length?o:null}_buildContextBlock(e){let{context:o,contextScreenshot:n}=e;if(!o&&!n)return null;let r=document.createElement("div");r.className=s.CONTEXT_BLOCK;let i=document.createElement("div");if(i.className=s.INBOX_FILTER_SECTION,i.textContent=this.strings.contextSection,r.appendChild(i),n){let l=document.createElement("div");l.className=s.CONTEXT_SCREENSHOT_CAPTION,l.textContent=this.strings.autoScreenshotLabel,r.appendChild(l);let a=document.createElement("img");a.className=s.SCREENSHOT_IMG,a.src=n,a.alt=this.strings.autoScreenshotLabel,a.addEventListener("click",d=>{d.stopPropagation(),this.callbacks.onShowLightbox(n)}),r.appendChild(a)}if(o){let l=(p,c)=>{if(!c)return;let m=document.createElement("div");m.className=s.CONTEXT_ROW;let u=document.createElement("span");u.textContent=p;let h=document.createElement("span");h.textContent=c,m.appendChild(u),m.appendChild(h),r.appendChild(m)},a=p=>p?`${p.width}\xD7${p.height}`:"",d=p=>p?.name?`${p.name} ${p.version||""}`.trim():"";l(this.strings.contextUrl,o.url),l(this.strings.contextViewport,a(o.viewport)),l(this.strings.contextScreen,a(o.screen)),l(this.strings.contextBrowser,d(o.browser)),l(this.strings.contextOs,d(o.os))}return r}_buildCardActions(e){return ie(e,{strings:this.strings,onCopy:o=>re(ae(o,{viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,strings:this.strings})),onSetStatus:(o,n)=>this.callbacks.onSetStatus(o.id,n),onSetType:(o,n)=>this.callbacks.onSetType(o.id,n),onSetPriority:(o,n)=>this.callbacks.onSetPriority(o.id,n),onDelete:o=>{this.detailId===o.id&&(this.detailId=null),this.callbacks.onDelete(o.id),this.render()}})}_renderDetail(e,o){let n=o.indexOf(e),r=document.createElement("div");r.className=s.INBOX_DETAIL_HEADER;let i=document.createElement("button");i.type="button",i.className=s.INBOX_BACK,i.innerHTML=`${Sn}<span>${this.strings.back}</span>`,i.addEventListener("click",()=>{this.detailId=null,this.render()}),r.appendChild(i);let l=document.createElement("div");l.className=s.INBOX_CARD_ACTIONS;let a=(m,u,h)=>{let g=document.createElement("button");g.type="button",g.className=s.INBOX_NAV_BTN,g.setAttribute("aria-label",u),g.title=u,g.innerHTML=m;let f=o[h];return g.disabled=!f,f&&g.addEventListener("click",()=>this._openDetail(f)),g};l.appendChild(a(wn,this.strings.prevComment,n-1)),l.appendChild(a(On,this.strings.nextComment,n+1)),l.appendChild(this._closeButton()),r.appendChild(l),this.el.appendChild(r);let d=document.createElement("div");d.className=s.INBOX_DETAIL,d.appendChild(this._buildCard(e,{interactive:!1}));let p=this._buildContextBlock(e);p&&d.appendChild(p);let c=document.createElement("div");c.className=s.INBOX_REPLIES;for(let m of e.replies||[]){let u=j(m,this.strings,this.locale);u.querySelectorAll(`.${s.SCREENSHOT_IMG}`).forEach(h=>{h.addEventListener("click",g=>{g.stopPropagation(),this.callbacks.onShowLightbox(h.src)})}),c.appendChild(u)}d.appendChild(c),d.appendChild(this._buildReplyInput(e)),this.el.appendChild(d)}_buildReplyInput(e){let{container:o,inputEl:n,screenshotsContainer:r,attachBtn:i,fileInput:l,submitBtn:a}=se({areaClassName:s.THREAD_INPUT_AREA,inputTag:"input",inputClassName:s.THREAD_INPUT,inputPlaceholder:this.strings.replyPlaceholder},this.strings),d=[],p=()=>{r.innerHTML="",r.classList.toggle(s.ACTIVE,d.length>0),d.forEach((m,u)=>{let h=document.createElement("div");h.className=s.SCREENSHOT_ITEM;let g=document.createElement("img");g.className=s.SCREENSHOT_IMG,g.src=m,g.alt=this.strings.attachedScreenshot,g.onclick=()=>this.callbacks.onShowLightbox(m);let f=document.createElement("button");f.type="button",f.className=s.SCREENSHOT_REMOVE,f.setAttribute("aria-label",this.strings.removeScreenshot),f.innerHTML="&times;",f.onclick=E=>{E.stopPropagation(),d.splice(u,1),p()},h.appendChild(g),h.appendChild(f),r.appendChild(h)})};i.addEventListener("click",()=>l.click()),l.addEventListener("change",m=>{let u=m.target.files[0];if(!u||d.length>=5)return;let h=new FileReader;h.onload=g=>{d.push(g.target.result),p()},h.readAsDataURL(u),l.value=""});let c=()=>{let m=n.value.trim();!m&&d.length===0||(this.callbacks.onReply(e,m,[...d]),d=[],this.render())};return a.addEventListener("click",c),n.addEventListener("keydown",m=>{m.key==="Enter"&&!m.shiftKey&&(m.preventDefault(),c())}),o}};var vn=t=>{let e=new Set;for(let o of t){let n=String(o).trim().toLowerCase();n&&e.add(n)}return[...e]},Se=class{constructor(e={}){this.comments=[],this.commentMode=!1,this.isMac=/Mac|iPod|iPhone|iPad/.test(navigator.userAgent),this.options={shortcutKey:e.shortcutKey||(this.isMac?"c":"C"),shortcutModifier:e.shortcutModifier||"alt",autoScreenshot:e.autoScreenshot!==!1,...e},this.locale=this.options.locale||st(),this.strings=at(this.locale),this.resizeObservers=new Map,this.mutationObservers=new Map,this.positionValidationEnabled=!0,this._pendingRaf=null,this._pendingContextScreenshot=null,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>this.initOverlay()):this.initOverlay()}initOverlay(){this.shadowRoot=qe(),this.toolbar=Ct(this.options,this.strings),this.commentBox=Tt(this.strings),this.overlay=document.createElement("div"),this.overlay.className=s.COMMENT_OVERLAY,this.shadowRoot.appendChild(this.overlay),this.shadowRoot.appendChild(this.toolbar),this.shadowRoot.appendChild(this.commentBox),this.commentBtn=this.toolbar.querySelector(`.${s.TOOLBAR_COMMENT_BTN}`),this.inboxBtn=this.toolbar.querySelector(`.${s.TOOLBAR_MENU_BTN}`),this.submitButton=this.shadowRoot.getElementById(x.SUBMIT_COMMENT),this.commentInput=this.shadowRoot.getElementById(x.COMMENT_INPUT),this.attachImageBtn=this.commentBox.querySelector(`.${s.ATTACH_IMAGE_BTN}`),this.attachImageInput=this.shadowRoot.getElementById(x.ATTACH_IMAGE_INPUT),this.bindEventListeners(),this.setupKeyboardShortcut(),this.setupResizeHandlers(),this.injectStyles(),this.options.persistence==="localStorage"&&(this.loadComments(ne()),this._openPendingDetail())}_navigateTo(e){location.assign(e)}_openPendingDetail(){let e=null;try{e=sessionStorage.getItem(oe),e!=null&&sessionStorage.removeItem(oe)}catch{return}if(!e)return;let o=this.comments.find(n=>String(n.id)===e);o&&(this.showInbox(),this.inboxView.openDetail(o.id))}_syncStorage(){this.options.persistence==="localStorage"&&xe(_e(ne(),this.serializeComments(),location.pathname))}bindEventListeners(){this.commentBtn.addEventListener("click",()=>this.toggleCommentMode()),this.inboxBtn.addEventListener("click",()=>this.toggleInbox()),this.submitButton.addEventListener("click",()=>this.saveComment()),this.commentInput.addEventListener("keydown",e=>{e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),this.saveComment())}),this.attachImageBtn.addEventListener("click",()=>{this.attachImageInput.click()}),this.attachImageInput.addEventListener("change",e=>{let o=e.target.files[0];if(!o||(this._pendingScreenshots||(this._pendingScreenshots=[]),this._pendingScreenshots.length>=5))return;let n=new FileReader;n.onload=r=>{this._pendingScreenshots.push(r.target.result),this._updateScreenshotsPreview()},n.readAsDataURL(o),this.attachImageInput.value=""}),this._handleDocumentClickBound=e=>this.handleDocumentClick(e),document.addEventListener("mousedown",this._handleDocumentClickBound)}setupKeyboardShortcut(){this.keydownHandler&&document.removeEventListener("keydown",this.keydownHandler),this.keydownHandler=e=>{if(e.key==="Escape"){this._activeLightbox?this.closeLightbox():this.activeThreadPopover?this.closeThreadPopover():this.inboxView?.isOpen()?this.closeInbox():this.commentBox.style.display!=="none"?(this.hideCommentBox(),this.toggleCommentMode()):this.commentMode&&this.toggleCommentMode();return}let o=this.isMac&&e.altKey&&(e.key==="\xE7"||e.key==="\xC7"),n=!this.isMac&&e.altKey&&e.key.toLowerCase()==="c",r=e.key.toLowerCase()===this.options.shortcutKey.toLowerCase()&&(this.options.shortcutModifier==="alt"&&e.altKey||this.options.shortcutModifier==="ctrl"&&(e.ctrlKey||e.metaKey)||this.options.shortcutModifier==="shift"&&e.shiftKey);if(o||n||r)return e.preventDefault(),e.stopPropagation(),this.toggleCommentMode(),!1},document.addEventListener("keydown",this.keydownHandler)}handleDocumentClick(e){if(!this.commentMode)return;let o=e.composedPath()[0]||e.target;if(!(this.toolbar.contains(o)||o?.closest?.(`.${s.CIRCLE}`)||o?.closest?.(`.${s.TOOLTIP}`)||o?.closest?.(`.${s.THREAD_POPOVER}`)||o?.closest?.(`.${s.INBOX_PANEL}`)||o?.closest?.(`.${s.LIGHTBOX}`))&&!this.commentBox.contains(o)){if(this.commentBox.style.display!=="none"){this.hideCommentBox(),this.toggleCommentMode();return}e.button===0&&(e.preventDefault(),this._dragStart={x:e.clientX,y:e.clientY},this._isDragging=!1,this._boundDragMove=n=>this._onDragMove(n),this._boundDragEnd=n=>this._onDragEnd(n),document.addEventListener("mousemove",this._boundDragMove),document.addEventListener("mouseup",this._boundDragEnd))}}_onDragMove(e){let o=e.clientX-this._dragStart.x,n=e.clientY-this._dragStart.y;if(!this._isDragging&&Math.hypot(o,n)<5)return;this._isDragging=!0;let r=Math.min(this._dragStart.x,e.clientX),i=Math.min(this._dragStart.y,e.clientY),l=Math.abs(o),a=Math.abs(n);this._selectionRect||(this._selectionRect=document.createElement("div"),this._selectionRect.className=s.SELECTION_RECT,this.shadowRoot.appendChild(this._selectionRect)),this._selectionRect.style.left=`${r}px`,this._selectionRect.style.top=`${i}px`,this._selectionRect.style.width=`${l}px`,this._selectionRect.style.height=`${a}px`}async _onDragEnd(e){if(document.removeEventListener("mousemove",this._boundDragMove),document.removeEventListener("mouseup",this._boundDragEnd),this._isDragging){let o=Math.min(this._dragStart.x,e.clientX),n=Math.min(this._dragStart.y,e.clientY),r=Math.abs(e.clientX-this._dragStart.x),i=Math.abs(e.clientY-this._dragStart.y);if(this._selectionRect?.remove(),this._selectionRect=null,r>10&&i>10)try{this._pendingScreenshots||(this._pendingScreenshots=[]);let l=await fe(()=>ge({scale:1})),a=Ze(l,{left:o,top:n,width:r,height:i});a&&this._pendingScreenshots.length<5&&this._pendingScreenshots.push(a),this.options.autoScreenshot&&(this._pendingContextScreenshot=Ee(l,{sourceScale:1}))}catch(l){console.warn("Screenshot capture failed:",l)}await this._placeCommentAtPoint(e.clientX,e.clientY)}else await this._placeCommentAtPoint(this._dragStart.x,this._dragStart.y);this._isDragging=!1,this._dragStart=null}async _placeCommentAtPoint(e,o){if(this.options.autoScreenshot&&!this._pendingContextScreenshot)try{let c=await fe(()=>ge({scale:ee}));this._pendingContextScreenshot=Ee(c,{sourceScale:ee})}catch(c){console.warn("HellDots: automatic screenshot failed",c),this._pendingContextScreenshot=null}let n=this.overlay.style.pointerEvents;this.overlay.style.pointerEvents="none";let r=document.elementFromPoint(e,o);this.overlay.style.pointerEvents=n||"";let i=r?.closest?.(tt.CONTAINER)||document.body,l=i.getBoundingClientRect(),a=l.width>0?(e-l.left)/l.width:0,d=l.height>0?(o-l.top)/l.height:0,p=ut(i,a,d);p.targetSelector=r&&r!==i?pt(r):null,this.currentPosition={container:i,relativeX:a,relativeY:d,anchor:p,target:r||i},this.createPreviewCircle(e,o),document.body.classList.remove(s.COMMENT_CURSOR),this._pendingScreenshots&&this._pendingScreenshots.length>0&&this._updateScreenshotsPreview(),this.showCommentBox(e,o)}_updateScreenshotsPreview(){let e=this.commentBox.querySelector(`.${s.SCREENSHOTS_CONTAINER}`);if(e){if(e.innerHTML="",!this._pendingScreenshots||this._pendingScreenshots.length===0){e.classList.remove(s.ACTIVE);return}e.classList.add(s.ACTIVE),this._pendingScreenshots.forEach((o,n)=>{let r=document.createElement("div");r.className=s.SCREENSHOT_ITEM;let i=document.createElement("img");i.className=s.SCREENSHOT_IMG,i.src=o,i.alt=this.strings.attachedScreenshot,i.onclick=()=>this.showLightbox(o);let l=document.createElement("button");l.type="button",l.className=s.SCREENSHOT_REMOVE,l.setAttribute("aria-label",this.strings.removeScreenshot),l.innerHTML="&times;",l.onclick=a=>{a.stopPropagation(),this._pendingScreenshots.splice(n,1),this._updateScreenshotsPreview()},r.appendChild(i),r.appendChild(l),e.appendChild(r)})}}_clearScreenshotPreview(){this._pendingScreenshots=[];let e=this.commentBox.querySelector(`.${s.SCREENSHOTS_CONTAINER}`);e&&(e.innerHTML="",e.classList.remove(s.ACTIVE))}showCommentBox(e,o){this.commentBox.style.display="block";let n=300,i=28/2,l=i+10,a=window.innerWidth,d=window.innerHeight,p=e+i,c=o+i,m=p+l,u=c-i;m+n>a&&(m=p-l-n),m=Math.max(10,m);let h=this.commentBox.getBoundingClientRect();u+h.height>d&&(u=d-h.height-10),u=Math.max(10,u),this.commentBox.style.left=`${m}px`,this.commentBox.style.top=`${u}px`,this.commentInput.value="",setTimeout(()=>this.commentInput.focus(),50)}hideCommentBox(){this.commentBox.style.display="none",this.commentInput.style.height="auto",this.currentPosition=null,this.removePreviewCircle(),this._clearScreenshotPreview(),this._pendingContextScreenshot=null,this.commentBox.classify?.reset(),this.commentMode&&document.body.classList.add(s.COMMENT_CURSOR)}toggleCommentMode(){this.commentMode=!this.commentMode,this.commentBtn?.classList.toggle(s.ACTIVE,this.commentMode),this.commentBtn?.setAttribute("aria-pressed",String(this.commentMode)),this.overlay.classList.toggle(s.ACTIVE,this.commentMode),document.body.classList.toggle(s.COMMENT_CURSOR,this.commentMode),this.commentMode||this.hideCommentBox()}saveComment(){if(!this.commentInput.value.trim()||!this.currentPosition)return;let e={text:this.commentInput.value,container:this.currentPosition.container,relativeX:this.currentPosition.relativeX,relativeY:this.currentPosition.relativeY,anchor:this.currentPosition.anchor,anchorState:"anchored",target:this.currentPosition.target,hidden:!1,status:"open",page:location.pathname,id:Date.now(),replies:[],author:this.options.user?.name||this.strings.anonymous,createdAt:new Date().toISOString(),screenshots:this._pendingScreenshots?[...this._pendingScreenshots]:[],type:this.commentBox.classify?.getType()??null,priority:this.commentBox.classify?.getPriority()??null,tags:this.commentBox.classify?.getTags()??[],resolvedAt:null,context:Je(),contextScreenshot:this._pendingContextScreenshot};this.comments.push(e),this._syncStorage(),this.options.onCommentCreated?.(this._serializeComment(e)),this.renderCommentCircle(e),this.hideCommentBox(),this.toggleCommentMode();let o=this.shadowRoot.querySelector(`[data-comment-id="${e.id}"]`);o&&this.showThreadPopover(o,e)}renderCommentCircle(e){let o=yt(e,this.strings);o.addEventListener("mouseenter",()=>this.showCommentTooltip(o,e)),o.addEventListener("mouseleave",()=>{setTimeout(()=>{let n=this.shadowRoot.querySelector(`.${s.TOOLTIP}[data-for="${e.id}"]`);n&&!n.matches(":hover")&&n.remove()},250)}),o.addEventListener("click",n=>{n.stopPropagation();let r=this.shadowRoot.querySelector(`.${s.TOOLTIP}[data-for="${e.id}"]`);r&&r.remove(),this.showThreadPopover(o,e)}),o.addEventListener("keydown",n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),o.click())}),this.overlay.appendChild(o),this.updateCommentPosition(e,o),this.createResizeObserver(e,o),this.createMutationObserver(e)}showCommentTooltip(e,o){if(this.shadowRoot.querySelector(`.${s.THREAD_POPOVER}[data-for="${o.id}"]`)||this.shadowRoot.querySelector(`.${s.TOOLTIP}[data-for="${o.id}"]`))return;let i=xt(o,this.strings,this.locale);this.shadowRoot.appendChild(i),i.querySelectorAll(`.${s.SCREENSHOT_IMG}`).forEach(l=>{l.addEventListener("click",a=>{a.stopPropagation(),this.showLightbox(l.src)})}),setTimeout(()=>{this.positionPopoverAtCircle(i,e)},10),i.querySelector(`.${s.CLOSE_TOOLTIP}`).addEventListener("click",l=>{l.stopPropagation(),i.remove()}),i.addEventListener("mouseleave",()=>i.remove())}toggleInbox(){this.inboxView?.isOpen()?this.closeInbox():this.showInbox()}showInbox(){this.closeThreadPopover(),this.inboxView||(this.inboxView=new le({shadowRoot:this.shadowRoot,strings:this.strings,locale:this.locale,currentPage:location.pathname,getComments:()=>this.comments,callbacks:{onOpenDetailScroll:e=>e.container?.scrollIntoView?.({block:"center"}),onReply:(e,o,n)=>this.addReply(e,o,n),onDelete:e=>this.deleteComment(e),onSetStatus:(e,o)=>this.setCommentStatus(e,o),onSetType:(e,o)=>this.setCommentType(e,o),onSetPriority:(e,o)=>this.setCommentPriority(e,o),onNavigateToPage:e=>{try{sessionStorage.setItem(oe,String(e.id))}catch{}this._navigateTo(e.page)},onShowLightbox:e=>this.showLightbox(e),onClose:()=>this.closeInbox()}})),this.inboxView.open(),setTimeout(()=>{this._inboxClickHandler=e=>{let o=e.composedPath()[0]||e.target;!this.inboxView.el?.contains(o)&&!this.inboxBtn.contains(o)&&this.closeInbox()},document.addEventListener("mousedown",this._inboxClickHandler)},0)}closeInbox(){this.inboxView?.close(),this._inboxClickHandler&&(document.removeEventListener("mousedown",this._inboxClickHandler),this._inboxClickHandler=null)}showThreadPopover(e,o){this.closeThreadPopover();let n=this.shadowRoot.querySelector(`.${s.TOOLTIP}[data-for="${o.id}"]`);n&&n.remove();let r=_t(o,this.strings,this.locale);this.shadowRoot.appendChild(r);let i=r.querySelector(`.${s.THREAD_HEADER}`),l=ie(o,{strings:this.strings,onCopy:E=>re(ae(E,{viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,strings:this.strings})),onSetStatus:(E,b)=>this.setCommentStatus(E.id,b),onSetType:(E,b)=>this.setCommentType(E.id,b),onSetPriority:(E,b)=>this.setCommentPriority(E.id,b),onDelete:E=>{this.closeThreadPopover(),this.deleteComment(E.id),this.inboxView?.isOpen()&&this.inboxView.refresh()}});i.insertBefore(l,i.querySelector(`.${s.CLOSE_TOOLTIP}`));let a=Array.from(r.children).find(E=>E.classList.contains(s.SCREENSHOTS_CONTAINER));a&&a.querySelectorAll(`.${s.SCREENSHOT_IMG}`).forEach(E=>{E.addEventListener("click",b=>{b.stopPropagation(),this.showLightbox(E.src)})}),setTimeout(()=>{e?this.positionPopoverAtCircle(r,e):this.centerPopover(r)},10),r.querySelector(`.${s.CLOSE_TOOLTIP}`).addEventListener("click",E=>{E.stopPropagation(),this.closeThreadPopover()});let d=r.querySelector(`.${s.THREAD_INPUT}`),p=r.querySelector(`.${s.THREAD_SUBMIT}`),c=r.querySelector(`.${s.THREAD_INPUT_AREA} .${s.ATTACH_IMAGE_BTN}`),m=r.querySelector(`.${s.THREAD_INPUT_AREA} input[type="file"]`),u=r.querySelector(`.${s.THREAD_INPUT_AREA} .${s.SCREENSHOTS_CONTAINER}`),h=[],g=()=>{if(u.innerHTML="",h.length===0){u.classList.remove(s.ACTIVE);return}u.classList.add(s.ACTIVE),h.forEach((E,b)=>{let C=document.createElement("div");C.className=s.SCREENSHOT_ITEM;let T=document.createElement("img");T.className=s.SCREENSHOT_IMG,T.src=E,T.alt=this.strings.attachedScreenshot,T.onclick=()=>this.showLightbox(E);let y=document.createElement("button");y.className=s.SCREENSHOT_REMOVE,y.innerHTML="&times;",y.onclick=_=>{_.stopPropagation(),h.splice(b,1),g()},C.appendChild(T),C.appendChild(y),u.appendChild(C)})};c.addEventListener("click",()=>{m.click()}),m.addEventListener("change",E=>{let b=E.target.files[0];if(!b||h.length>=5)return;let C=new FileReader;C.onload=T=>{h.push(T.target.result),g()},C.readAsDataURL(b),m.value=""});let f=()=>{let E=d.value.trim();if(!E&&h.length===0)return;let b=this.addReply(o,E,h.length>0?[...h]:[]),C=r.querySelector(`.${s.THREAD_REPLIES}`),T=j(b,this.strings,this.locale);C.appendChild(T),T.querySelectorAll(`.${s.SCREENSHOT_IMG}`).forEach(y=>{y.addEventListener("click",_=>{_.stopPropagation(),this.showLightbox(y.src)})}),d.value="",h=[],g(),d.focus()};p.addEventListener("click",f),d.addEventListener("keydown",E=>{E.key==="Enter"&&!E.shiftKey&&(E.preventDefault(),f())}),this.activeThreadPopover=r,setTimeout(()=>d.focus(),50),setTimeout(()=>{this._threadClickHandler=E=>{let b=E.composedPath()[0]||E.target;!r.contains(b)&&!e?.contains(b)&&this.closeThreadPopover()},document.addEventListener("mousedown",this._threadClickHandler)},0)}closeThreadPopover(){this.activeThreadPopover&&(this.activeThreadPopover.remove(),this.activeThreadPopover=null),this._threadClickHandler&&(document.removeEventListener("mousedown",this._threadClickHandler),this._threadClickHandler=null)}showLightbox(e){this.closeLightbox();let o=document.createElement("div");o.className=s.LIGHTBOX;let n=document.createElement("img");n.className=s.LIGHTBOX_IMG,n.src=e,n.alt=this.strings.screenshotPreview;let r=document.createElement("button");r.type="button",r.className=s.LIGHTBOX_CLOSE,r.setAttribute("aria-label",this.strings.close),r.innerHTML="&times;",r.addEventListener("click",()=>this.closeLightbox()),o.appendChild(n),o.appendChild(r),o.addEventListener("click",i=>{i.target===o&&this.closeLightbox()}),this.shadowRoot.appendChild(o),this._activeLightbox=o}closeLightbox(){this._activeLightbox?.remove(),this._activeLightbox=null}addReply(e,o,n=[]){e.replies||(e.replies=[]);let r={id:Date.now(),text:o,author:this.options.user?.name||this.strings.anonymous,timestamp:new Date().toISOString(),screenshots:n};return e.replies.push(r),this._syncStorage(),this.options.onReplyAdded?.(this._serializeComment(e),this._serializeReply(r)),r}_serializeReply({id:e,text:o,author:n,timestamp:r,screenshots:i}){return{id:e,text:o,author:n,timestamp:r,screenshots:i||[]}}_serializeComment(e){return{id:e.id,text:e.text,anchor:e.anchor||null,page:e.page||location.pathname,replies:(e.replies||[]).map(o=>this._serializeReply(o)),author:e.author,createdAt:e.createdAt,screenshots:e.screenshots||[],status:e.status||"open",type:e.type||null,priority:e.priority||null,tags:e.tags?[...e.tags]:[],resolvedAt:e.resolvedAt||null,context:e.context?{...e.context}:null,contextScreenshot:e.contextScreenshot||null}}setCommentStatus(e,o){if(!V.includes(o))return!1;let n=this.comments.find(i=>i.id===e);if(!n)return!1;if(n.status===o)return!0;n.status=o,n.resolvedAt=o==="resolved"?new Date().toISOString():null;let r=this.shadowRoot?.querySelector(`[data-comment-id="${e}"]`);return r&&this.updateCommentPosition(n,r),this._syncStorage(),this.inboxView?.isOpen()&&this.inboxView.refresh(),this.options.onCommentStatusChanged?.(this._serializeComment(n)),!0}_commitUpdate(e){return this._syncStorage(),this.inboxView?.isOpen()&&this.inboxView.refresh(),this.options.onCommentUpdated?.(this._serializeComment(e)),!0}setCommentType(e,o){if(o!==null&&!A.includes(o))return!1;let n=this.comments.find(r=>r.id===e);return n?(n.type=o,this._commitUpdate(n)):!1}setCommentPriority(e,o){if(o!==null&&!N.includes(o))return!1;let n=this.comments.find(r=>r.id===e);return n?(n.priority=o,this._commitUpdate(n)):!1}setCommentTags(e,o){if(!Array.isArray(o))return!1;let n=this.comments.find(r=>r.id===e);return n?(n.tags=vn(o),this._commitUpdate(n)):!1}serializeComments(){return this.comments.map(e=>this._serializeComment(e))}deleteComment(e){return this.comments.some(o=>o.id===e)?(this._removeComment(e),this.options.persistence==="localStorage"&&xe(_e(ne().filter(o=>o.id!==e),this.serializeComments(),location.pathname)),this.options.onCommentDeleted?.(e),!0):!1}_removeComment(e){if(this.cleanupResizeObserver(e),this.mutationObservers.has(e)){try{this.mutationObservers.get(e).disconnect()}catch{}this.mutationObservers.delete(e)}this.shadowRoot.querySelector(`[data-comment-id="${e}"]`)?.remove(),this.comments=this.comments.filter(o=>o.id!==e)}loadComments(e){let o=0,n=0,r=0;if(!Array.isArray(e))return{anchored:o,orphaned:n,inactive:r};for(let i of e){if(!i||i.id==null||typeof i.text!="string"){console.warn("HellDots: skipping malformed serialized comment",i);continue}this._removeComment(i.id);let l={id:i.id,text:i.text,anchor:i.anchor||null,anchorState:"orphaned",target:null,hidden:!1,page:i.page||location.pathname,container:null,relativeX:0,relativeY:0,replies:Array.isArray(i.replies)?[...i.replies]:[],author:i.author||this.strings.anonymous,createdAt:i.createdAt||new Date().toISOString(),screenshots:Array.isArray(i.screenshots)?[...i.screenshots]:[],status:i.status==="closed"?"resolved":V.includes(i.status)?i.status:"open",type:A.includes(i.type)?i.type:null,priority:N.includes(i.priority)?i.priority:null,tags:Array.isArray(i.tags)?[...i.tags]:[],resolvedAt:i.resolvedAt||null,context:i.context||null,contextScreenshot:i.contextScreenshot||null};if(i.page&&i.page!==location.pathname){l.anchorState="inactive",this.comments.push(l),r++;continue}let a=i.anchor?mt(i.anchor):null;a?(l.container=a.element,l.relativeX=i.anchor.relativeX,l.relativeY=i.anchor.relativeY,l.anchorState="anchored",this.comments.push(l),this.renderCommentCircle(l),o++):(this.comments.push(l),n++,this.options.onAnchorLost?.(this._serializeComment(l)))}return{anchored:o,orphaned:n,inactive:r}}centerPopover(e){let o=e.getBoundingClientRect(),n=Math.max(10,(window.innerWidth-(o.width||400))/2),r=Math.max(10,(window.innerHeight-o.height)/2);e.style.left=`${n}px`,e.style.top=`${r}px`}positionPopoverAtCircle(e,o){let n=o.getBoundingClientRect(),r=n.left+n.width/2,i=n.top+n.height/2,l=28,a=l/2+10,d=r+a,p=i-l/2;d+400>window.innerWidth&&(d=r-a-400),d=Math.max(10,d);let c=e.getBoundingClientRect();p+c.height>window.innerHeight&&(p=window.innerHeight-c.height-10),p=Math.max(10,p),e.style.left=`${d}px`,e.style.top=`${p}px`}createPreviewCircle(e,o){this.removePreviewCircle();let n=document.createElement("div");n.className=`${s.CIRCLE} ${s.PREVIEW_CIRCLE}`,n.style.position="absolute";let r=14;n.style.left=`${e+r}px`,n.style.top=`${o+r}px`,n.style.transform="translate(-50%, -50%)",n.style.pointerEvents="none",this.overlay.appendChild(n),this.previewCircle=n}removePreviewCircle(){this.previewCircle?.remove(),this.previewCircle=null}cleanupResizeObserver(e){if(this.resizeObservers&&this.resizeObservers.has(e)){let{circle:o,observer:n}=this.resizeObservers.get(e);n&&n.disconnect(),o&&o.parentNode&&o.parentNode.removeChild(o),this.resizeObservers.delete(e)}}validateAndCalculatePosition(e,o){if(!e.container||!o)return null;let n=e.container.getBoundingClientRect(),r=n.width,i=n.height;if(r<=0||i<=0)return null;let l=e.relativeX*r,a=e.relativeY*i,d=28,p=Math.max(0,Math.min(l,r-d)),c=Math.max(0,Math.min(a,i-d)),m=p/r,u=c/i;return{absoluteX:p,absoluteY:c,relativeX:m,relativeY:u,containerWidth:r,containerHeight:i,containerLeft:n.left,containerTop:n.top}}_isAnchorTargetVisible(e){let o=e.target;if((!o||!o.isConnected)&&e.anchor?.targetSelector){try{o=document.querySelector(e.anchor.targetSelector)}catch{o=null}e.target=o||null}if(!o||!o.isConnected)return!0;let n=o.getBoundingClientRect();return n.width>0&&n.height>0}_isMarkerOccluded(e,o,n){if(typeof document.elementsFromPoint!="function"||o<0||n<0||o>=window.innerWidth||n>=window.innerHeight)return!1;let i=document.elementsFromPoint(o,n).find(d=>d.tagName.toLowerCase()!==L.toLowerCase());if(!i)return!1;let l=e.target?.isConnected?e.target:null;if(l&&(l.contains(i)||i.contains(l)))return!1;let a=e.container;if(!a?.isConnected)return!1;if(!a.contains(i)&&!i.contains(a))return!0;if(a.contains(i)&&i!==a){for(let d=i;d&&d!==a;d=d.parentElement)if(this._looksLikeModalLayer(d,l))return!0}return!1}_looksLikeModalLayer(e,o){if(o&&e.contains(o))return!1;if(e.matches?.('dialog, [aria-modal="true"], [role="dialog"]'))return!0;if(getComputedStyle(e).position!=="fixed")return!1;let n=e.getBoundingClientRect();return n.width>=window.innerWidth*.5&&n.height>=window.innerHeight*.5}_dismissMarkerUi(e){this.shadowRoot.querySelector(`.${s.TOOLTIP}[data-for="${e.id}"]`)?.remove(),this.activeThreadPopover?.dataset.for===String(e.id)&&this.closeThreadPopover()}updateCommentPosition(e,o){if(e.status==="resolved"){o&&(o.style.display="none");return}let n=this.validateAndCalculatePosition(e,o);n&&!this._isAnchorTargetVisible(e)&&(n=null);let r=e.hidden===!0;if(!n){o&&e.container&&(e.hidden=!0,o.style.display="none",this._dismissMarkerUi(e),!r&&this.inboxView?.isOpen()&&this.inboxView.refresh());return}let i=14,l=n.containerLeft+n.absoluteX+i,a=n.containerTop+n.absoluteY+i;if(this._isMarkerOccluded(e,l,a)){e.hidden=!0,o.style.display="none",this._dismissMarkerUi(e),!r&&this.inboxView?.isOpen()&&this.inboxView.refresh();return}e.hidden=!1,o.style.display="",r&&this.inboxView?.isOpen()&&this.inboxView.refresh(),o.style.left=`${l}px`,o.style.top=`${a}px`,o.style.transform="translate(-50%, -50%)",o.style.position="absolute",e.relativeX=n.relativeX,e.relativeY=n.relativeY}setupResizeHandlers(){this.scheduleUpdatePositions=()=>{this._pendingRaf||(this._pendingRaf=requestAnimationFrame(()=>{this._pendingRaf=null,this.positionValidationEnabled&&this.comments.forEach(e=>{let o=this.shadowRoot.querySelector(`[data-comment-id="${e.id}"]`);o&&this.updateCommentPosition(e,o)})}))},this.windowResizeHandler=()=>{this.scheduleUpdatePositions()},window.addEventListener("resize",this.windowResizeHandler,{passive:!0}),this.scrollHandler=()=>{this.scheduleUpdatePositions()},window.addEventListener("scroll",this.scrollHandler,{capture:!0,passive:!0}),this.loadHandler=()=>{this.scheduleUpdatePositions()},window.addEventListener("load",this.loadHandler),window.MutationObserver&&(this._globalMutationObserver=new MutationObserver(()=>{this.scheduleUpdatePositions()}),this._globalMutationObserver.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class","hidden","open"]}))}debugPosition(e,o){if(!e||!o)return;let n=e.container.getBoundingClientRect(),r=o.getBoundingClientRect(),i=e.relativeX*n.width,l=e.relativeY*n.height;console.log("Position Debug:",{commentId:e.id,relativePosition:{x:e.relativeX,y:e.relativeY},containerRect:{left:n.left,top:n.top,width:n.width,height:n.height},circlePosition:{left:r.left,top:r.top,centerX:r.left+r.width/2,centerY:r.top+r.height/2},expectedPosition:{x:i,y:l},offset:{x:r.left+r.width/2-(n.left+i),y:r.top+r.height/2-(n.top+l)}})}createResizeObserver(e,o){if(!window.ResizeObserver){console.warn("ResizeObserver not supported, position validation will be limited");return}let n=new ResizeObserver(r=>{if(this.positionValidationEnabled)for(let i of r)i.target===e.container&&this.updateCommentPosition(e,o)});n.observe(e.container),this.resizeObservers.set(e.id,{circle:o,observer:n,container:e.container})}createMutationObserver(e){if(!window.MutationObserver)return;if(this.mutationObservers.has(e.id)){try{this.mutationObservers.get(e.id).disconnect()}catch{}this.mutationObservers.delete(e.id)}let o=new MutationObserver(()=>{this.scheduleUpdatePositions()});o.observe(e.container,{attributes:!0,attributeFilter:void 0,childList:!0,subtree:!0}),this.mutationObservers.set(e.id,o)}cleanup(){this.closeThreadPopover(),this.closeInbox(),this.closeLightbox(),this.removePreviewCircle(),this._selectionRect?.remove(),this._pendingScreenshots=[],this._handleDocumentClickBound&&document.removeEventListener("mousedown",this._handleDocumentClickBound),this.windowResizeHandler&&window.removeEventListener("resize",this.windowResizeHandler),this.scrollHandler&&window.removeEventListener("scroll",this.scrollHandler,{capture:!0}),this.loadHandler&&window.removeEventListener("load",this.loadHandler),this._globalMutationObserver&&(this._globalMutationObserver.disconnect(),this._globalMutationObserver=null),this.resizeObservers&&(this.resizeObservers.forEach(({observer:e})=>{e&&e.disconnect()}),this.resizeObservers.clear()),this.mutationObservers&&(this.mutationObservers.forEach(e=>{try{e.disconnect()}catch{}}),this.mutationObservers.clear()),this.keydownHandler&&document.removeEventListener("keydown",this.keydownHandler),this.toolbar&&this.toolbar.parentNode&&this.toolbar.parentNode.removeChild(this.toolbar),this.commentBox&&this.commentBox.parentNode&&this.commentBox.parentNode.removeChild(this.commentBox),this.overlay&&this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay),document.body.classList.remove(s.COMMENT_CURSOR),document.getElementById(x.GLOBAL_STYLES)?.remove(),this.comments.forEach(e=>{let o=this.shadowRoot.querySelector(`[data-comment-id="${e.id}"]`);o&&o.parentNode&&o.parentNode.removeChild(o)})}injectStyles(){let e=this.shadowRoot.getElementById(x.STYLES);e&&e.remove();let o=document.createElement("style");o.id=x.STYLES,o.textContent=nt(),this.shadowRoot.appendChild(o);let n=document.getElementById(x.GLOBAL_STYLES);n&&n.remove();let r=document.createElement("style");r.id=x.GLOBAL_STYLES,r.textContent=rt(),document.head.appendChild(r)}},we=Se;function St(t={}){let{autoInit:e=!0,...o}=t,n=()=>new we(o);return e?n():n}var An=St;return Rt(Nn);})();
1032
+ if (typeof module !== 'undefined' && module.exports) { module.exports = HellDots.default; }