helldots 0.3.0 → 0.5.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.
@@ -1,1032 +1,22 @@
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(`
1
+ /*! HellDots MIT. Bundles nanoid (MIT) © 2017 Andrey Sitnik <andrey@sitnik.es> https://github.com/ai/nanoid */
2
+ /*! Bundles modern-screenshot (MIT) © 2021-present wxm — https://github.com/qq15725/modern-screenshot */
3
+ var HellDots=(()=>{var Fe=Object.defineProperty;var An=Object.getOwnPropertyDescriptor;var vn=Object.getOwnPropertyNames;var Nn=Object.prototype.hasOwnProperty;var Rn=(n,e)=>{for(var t in e)Fe(n,t,{get:e[t],enumerable:!0})},In=(n,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of vn(e))!Nn.call(n,r)&&r!==t&&Fe(n,r,{get:()=>e[r],enumerable:!(o=An(e,r))||o.enumerable});return n};var Ln=n=>In(Fe({},"__esModule",{value:!0}),n);var Xi={};Rn(Xi,{CommentOverlay:()=>pt,createCommentOverlay:()=>wn,default:()=>Fi});var Ct="[modern-screenshot]",k=typeof window<"u",Bn=k&&"Worker"in window,Vi=k&&"atob"in window,zi=k&&"btoa"in window,Ve=k?window.navigator?.userAgent:"",_t=Ve.includes("Chrome"),pe=Ve.includes("AppleWebKit")&&!_t,ze=Ve.includes("Firefox"),Dn=n=>n&&"__CONTEXT__"in n,kn=n=>n.constructor.name==="CSSFontFaceRule",Mn=n=>n.constructor.name==="CSSImportRule",Pn=n=>n.constructor.name==="CSSLayerBlockRule",N=n=>n.nodeType===1,ne=n=>typeof n.className=="object",Tt=n=>n.tagName==="image",$n=n=>n.tagName==="use",Q=n=>N(n)&&typeof n.style<"u"&&!ne(n),Hn=n=>n.nodeType===8,Fn=n=>n.nodeType===3,U=n=>n.tagName==="IMG",ue=n=>n.tagName==="VIDEO",Xn=n=>n.tagName==="CANVAS",Un=n=>n.tagName==="TEXTAREA",Vn=n=>n.tagName==="INPUT",zn=n=>n.tagName==="STYLE",Gn=n=>n.tagName==="SCRIPT",Yn=n=>n.tagName==="SELECT",Wn=n=>n.tagName==="SLOT",jn=n=>n.tagName==="IFRAME",qn=(...n)=>console.warn(Ct,...n);function Kn(n){let e=n?.createElement?.("canvas");return e&&(e.height=e.width=1),!!e&&"toDataURL"in e&&!!e.toDataURL("image/webp").includes("image/webp")}var Xe=n=>n.startsWith("data:");function xt(n,e){if(n.match(/^[a-z]+:\/\//i))return n;if(k&&n.match(/^\/\//))return window.location.protocol+n;if(n.match(/^[a-z]+:/i)||!k)return n;let t=me().implementation.createHTMLDocument(),o=t.createElement("base"),r=t.createElement("a");return t.head.appendChild(o),t.body.appendChild(r),e&&(o.href=e),r.href=n,r.href}function me(n){return(n&&N(n)?n?.ownerDocument:n)??window.document}var fe="http://www.w3.org/2000/svg";function Zn(n,e,t){let o=me(t).createElementNS(fe,"svg");return o.setAttributeNS(null,"width",n.toString()),o.setAttributeNS(null,"height",e.toString()),o.setAttributeNS(null,"viewBox",`0 0 ${n} ${e}`),o}function Jn(n,e){let t=new XMLSerializer().serializeToString(n);return e&&(t=t.replace(/[\u0000-\u0008\v\f\u000E-\u001F\uD800-\uDFFF\uFFFE\uFFFF]/gu,"")),`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`}function Qn(n,e){return new Promise((t,o)=>{let r=new FileReader;r.onload=()=>t(r.result),r.onerror=()=>o(r.error),r.onabort=()=>o(new Error(`Failed read blob to ${e}`)),e==="dataUrl"?r.readAsDataURL(n):e==="arrayBuffer"&&r.readAsArrayBuffer(n)})}var eo=n=>Qn(n,"dataUrl");function X(n,e){let t=me(e).createElement("img");return t.decoding="sync",t.loading="eager",t.src=n,t}function ee(n,e){return new Promise(t=>{let{timeout:o,ownerDocument:r,onError:i,onWarn:a}=e??{},l=typeof n=="string"?X(n,me(r)):n,c=null,d=null;function h(){t(l),c&&clearTimeout(c),d?.()}if(o&&(c=setTimeout(h,o)),ue(l)){let p=l.currentSrc||l.src;if(!p)return l.poster?ee(l.poster,e).then(t):h();if(l.readyState>=2)return h();let m=h,u=f=>{a?.("Failed video load",p,f),i?.(f),h()};d=()=>{l.removeEventListener("loadeddata",m),l.removeEventListener("error",u)},l.addEventListener("loadeddata",m,{once:!0}),l.addEventListener("error",u,{once:!0})}else{let p=Tt(l)?l.href.baseVal:l.currentSrc||l.src;if(!p)return h();let m=async()=>{if(U(l)&&"decode"in l)try{await l.decode()}catch(f){a?.("Failed to decode image, trying to render anyway",l.dataset.originalSrc||p,f)}h()},u=f=>{a?.("Failed image load",l.dataset.originalSrc||p,f),h()};if(U(l)&&l.complete)return m();d=()=>{l.removeEventListener("load",m),l.removeEventListener("error",u)},l.addEventListener("load",m,{once:!0}),l.addEventListener("error",u,{once:!0})}})}async function to(n,e){Q(n)&&(U(n)||ue(n)?await ee(n,e):await Promise.all(["img","video"].flatMap(t=>Array.from(n.querySelectorAll(t)).map(o=>ee(o,e)))))}var yt=(function(){let e=0,t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function St(n){return n?.split(",").map(e=>e.trim().replace(/"|'/g,"").toLowerCase()).filter(Boolean)}var ut=0;function no(n){let e=`${Ct}[#${ut}]`;return ut++,{time:t=>n&&console.time(`${e} ${t}`),timeEnd:t=>n&&console.timeEnd(`${e} ${t}`),warn:(...t)=>n&&qn(...t)}}function oo(n){return{cache:n?"no-cache":"force-cache"}}async function wt(n,e){return Dn(n)?n:io(n,{...e,autoDestruct:!0})}async function io(n,e){let{scale:t=1,workerUrl:o,workerNumber:r=1}=e||{},i=!!e?.debug,a=e?.features??!0,l=n.ownerDocument??(k?window.document:void 0),c=n.ownerDocument?.defaultView??(k?window:void 0),d=new Map,h={width:0,height:0,quality:1,type:"image/png",scale:t,backgroundColor:null,style:null,filter:null,maximumCanvasSize:0,timeout:3e4,progress:null,debug:i,fetch:{requestInit:oo(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:no(i),node:n,ownerDocument:l,ownerWindow:c,dpi:t===1?null:96*t,svgStyleElement:Ot(l),svgDefsElement:l?.createElementNS(fe,"defs"),svgStyles:new Map,defaultComputedStyles:new Map,workers:[...Array.from({length:Bn&&o&&r?r:0})].map(()=>{try{let u=new Worker(o);return u.onmessage=async f=>{let{url:g,result:E}=f.data;E?d.get(g)?.resolve?.(E):d.get(g)?.reject?.(new Error(`Error receiving message from worker: ${g}`))},u.onmessageerror=f=>{let{url:g}=f.data;d.get(g)?.reject?.(new Error(`Error receiving message from worker: ${g}`))},u}catch(u){return h.log.warn("Failed to new Worker",u),null}}).filter(Boolean),fontFamilies:new Map,fontCssTexts:new Map,acceptOfImage:`${[Kn(l)&&"image/webp","image/svg+xml","image/*","*/*"].filter(Boolean).join(",")};q=0.8`,requests:d,drawImageCount:0,tasks:[],features:a,isEnable:u=>u==="restoreScrollPosition"?typeof a=="boolean"?!1:a[u]??!1:typeof a=="boolean"?a:a[u]??!0,shadowRoots:[]};h.log.time("wait until load"),await to(n,{timeout:h.timeout,onWarn:h.log.warn}),h.log.timeEnd("wait until load");let{width:p,height:m}=ro(n,h);return h.width=p,h.height=m,h}function Ot(n){if(!n)return;let e=n.createElement("style"),t=e.ownerDocument.createTextNode(`
2
4
  .______background-clip--text {
3
5
  background-clip: text;
4
6
  -webkit-background-clip: text;
5
7
  }
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(`,
8
+ `);return e.appendChild(t),e}function ro(n,e){let{width:t,height:o}=e;if(N(n)&&(!t||!o)){let r=n.getBoundingClientRect();t=t||r.width||Number(n.getAttribute("width"))||0,o=o||r.height||Number(n.getAttribute("height"))||0}return{width:t,height:o}}async function so(n,e){let{log:t,timeout:o,drawImageCount:r,drawImageInterval:i}=e;t.time("image to canvas");let a=await ee(n,{timeout:o,onWarn:e.log.warn}),{canvas:l,context2d:c}=ao(n.ownerDocument,e),d=()=>{try{c?.drawImage(a,0,0,l.width,l.height)}catch(h){e.log.warn("Failed to drawImage",h)}};if(d(),e.isEnable("fixSvgXmlDecode"))for(let h=0;h<r;h++)await new Promise(p=>{setTimeout(()=>{c?.clearRect(0,0,l.width,l.height),d(),p()},h+i)});return e.drawImageCount=0,t.timeEnd("image to canvas"),l}function ao(n,e){let{width:t,height:o,scale:r,backgroundColor:i,maximumCanvasSize:a}=e,l=n.createElement("canvas");l.width=Math.floor(t*r),l.height=Math.floor(o*r),l.style.width=`${t}px`,l.style.height=`${o}px`,a&&(l.width>a||l.height>a)&&(l.width>a&&l.height>a?l.width>l.height?(l.height*=a/l.width,l.width=a):(l.width*=a/l.height,l.height=a):l.width>a?(l.height*=a/l.width,l.width=a):(l.width*=a/l.height,l.height=a));let c=l.getContext("2d");return c&&i&&(c.fillStyle=i,c.fillRect(0,0,l.width,l.height)),{canvas:l,context2d:c}}function At(n,e){if(n.ownerDocument)try{let i=n.toDataURL();if(i!=="data:,")return X(i,n.ownerDocument)}catch(i){e.log.warn("Failed to clone canvas",i)}let t=n.cloneNode(!1),o=n.getContext("2d"),r=t.getContext("2d");try{return o&&r&&r.putImageData(o.getImageData(0,0,n.width,n.height),0,0),t}catch(i){e.log.warn("Failed to clone canvas",i)}return t}function lo(n,e){try{if(n?.contentDocument?.documentElement)return Ge(n.contentDocument.documentElement,e)}catch(t){e.log.warn("Failed to clone iframe",t)}return n.cloneNode(!1)}function co(n){let e=n.cloneNode(!1);return n.currentSrc&&n.currentSrc!==n.src&&(e.src=n.currentSrc,e.srcset=""),e.loading==="lazy"&&(e.loading="eager"),e}async function ho(n,e){if(n.ownerDocument&&!n.currentSrc&&n.poster)return X(n.poster,n.ownerDocument);let t=n.cloneNode(!1);t.crossOrigin="anonymous",n.currentSrc&&n.currentSrc!==n.src&&(t.src=n.currentSrc);let o=t.ownerDocument;if(o){let r=!0;if(await ee(t,{onError:()=>r=!1,onWarn:e.log.warn}),!r)return n.poster?X(n.poster,n.ownerDocument):t;t.currentTime=n.currentTime,await new Promise(a=>{t.addEventListener("seeked",a,{once:!0})});let i=o.createElement("canvas");i.width=n.offsetWidth,i.height=n.offsetHeight;try{let a=i.getContext("2d");a&&a.drawImage(t,0,0,i.width,i.height)}catch(a){return e.log.warn("Failed to clone video",a),n.poster?X(n.poster,n.ownerDocument):t}return At(i,e)}return t}function po(n,e){return Xn(n)?At(n,e):jn(n)?lo(n,e):U(n)?co(n):ue(n)?ho(n,e):n.cloneNode(!1)}function uo(n){let e=n.sandbox;if(!e){let{ownerDocument:t}=n;try{t&&(e=t.createElement("iframe"),e.id=`__SANDBOX__${yt()}`,e.width="0",e.height="0",e.style.visibility="hidden",e.style.position="fixed",t.body.appendChild(e),e.srcdoc='<!DOCTYPE html><meta charset="UTF-8"><title></title><body>',n.sandbox=e)}catch(o){n.log.warn("Failed to getSandBox",o)}}return e}var mo=["width","height","-webkit-text-fill-color"],fo=["stroke","fill"];function vt(n,e,t){let{defaultComputedStyles:o}=t,r=n.nodeName.toLowerCase(),i=ne(n)&&r!=="svg",a=i?fo.map(g=>[g,n.getAttribute(g)]).filter(([,g])=>g!==null):[],l=[i&&"svg",r,a.map((g,E)=>`${g}=${E}`).join(","),e].filter(Boolean).join(":");if(o.has(l))return o.get(l);let d=uo(t)?.contentWindow;if(!d)return new Map;let h=d?.document,p,m;i?(p=h.createElementNS(fe,"svg"),m=p.ownerDocument.createElementNS(p.namespaceURI,r),a.forEach(([g,E])=>{m.setAttributeNS(null,g,E)}),p.appendChild(m)):p=m=h.createElement(r),m.textContent=" ",h.body.appendChild(p);let u=d.getComputedStyle(m,e),f=new Map;for(let g=u.length,E=0;E<g;E++){let b=u.item(E);mo.includes(b)||f.set(b,u.getPropertyValue(b))}return h.body.removeChild(p),o.set(l,f),f}function Nt(n,e,t){let o=new Map,r=[],i=new Map;if(t)for(let l of t)a(l);else for(let l=n.length,c=0;c<l;c++){let d=n.item(c);a(d)}for(let l=r.length,c=0;c<l;c++)i.get(r[c])?.forEach((d,h)=>o.set(h,d));function a(l){let c=n.getPropertyValue(l),d=n.getPropertyPriority(l),h=l.lastIndexOf("-"),p=h>-1?l.substring(0,h):void 0;if(p){let m=i.get(p);m||(m=new Map,i.set(p,m)),m.set(l,[c,d])}e.get(l)===c&&!d||(p?r.push(p):o.set(l,[c,d]))}return o}function go(n,e,t,o){let{ownerWindow:r,includeStyleProperties:i,currentParentNodeStyle:a}=o,l=e.style,c=r.getComputedStyle(n),d=vt(n,null,o);a?.forEach((p,m)=>{d.delete(m)});let h=Nt(c,d,i);h.delete("transition-property"),h.delete("all"),h.delete("d"),h.delete("content"),t&&(h.delete("position"),h.delete("margin-top"),h.delete("margin-right"),h.delete("margin-bottom"),h.delete("margin-left"),h.delete("margin-block-start"),h.delete("margin-block-end"),h.delete("margin-inline-start"),h.delete("margin-inline-end"),h.set("box-sizing",["border-box",""])),h.get("background-clip")?.[0]==="text"&&e.classList.add("______background-clip--text"),_t&&(h.has("font-kerning")||h.set("font-kerning",["normal",""]),(h.get("overflow-x")?.[0]==="hidden"||h.get("overflow-y")?.[0]==="hidden")&&h.get("text-overflow")?.[0]==="ellipsis"&&n.scrollWidth===n.clientWidth&&h.set("text-overflow",["clip",""]));for(let p=l.length,m=0;m<p;m++)l.removeProperty(l.item(m));return h.forEach(([p,m],u)=>{l.setProperty(u,p,m)}),h}function Eo(n,e){(Un(n)||Vn(n)||Yn(n))&&e.setAttribute("value",n.value)}var bo=["::before","::after"],Co=["::-webkit-scrollbar","::-webkit-scrollbar-button","::-webkit-scrollbar-thumb","::-webkit-scrollbar-track","::-webkit-scrollbar-track-piece","::-webkit-scrollbar-corner","::-webkit-resizer"];function _o(n,e,t,o,r){let{ownerWindow:i,svgStyleElement:a,svgStyles:l,currentNodeStyle:c}=o;if(!a||!i)return;function d(h){let p=i.getComputedStyle(n,h),m=p.getPropertyValue("content");if(!m||m==="none")return;r?.(m),m=m.replace(/(')|(")|(counter\(.+\))/g,"");let u=[yt()],f=vt(n,h,o);c?.forEach((_,y)=>{f.delete(y)});let g=Nt(p,f,o.includeStyleProperties);g.delete("content"),g.delete("-webkit-locale"),g.get("background-clip")?.[0]==="text"&&e.classList.add("______background-clip--text");let E=[`content: '${m}';`];if(g.forEach(([_,y],C)=>{E.push(`${C}: ${_}${y?" !important":""};`)}),E.length===1)return;try{e.className=[e.className,...u].join(" ")}catch(_){o.log.warn("Failed to copyPseudoClass",_);return}let b=E.join(`
9
+ `),T=l.get(b);T||(T=[],l.set(b,T)),T.push(`.${u[0]}${h}`)}bo.forEach(d),t&&Co.forEach(d)}var mt=new Set(["symbol"]);async function ft(n,e,t,o,r){if(N(t)&&(zn(t)||Gn(t))||o.filter&&!o.filter(t))return;mt.has(e.nodeName)||mt.has(t.nodeName)?o.currentParentNodeStyle=void 0:o.currentParentNodeStyle=o.currentNodeStyle;let i=await Ge(t,o,!1,r);o.isEnable("restoreScrollPosition")&&To(n,i),e.appendChild(i)}async function gt(n,e,t,o){let r=n.firstChild;N(n)&&n.shadowRoot&&(r=n.shadowRoot?.firstChild,t.shadowRoots.push(n.shadowRoot));for(let i=r;i;i=i.nextSibling)if(!Hn(i))if(N(i)&&Wn(i)&&typeof i.assignedNodes=="function"){let a=i.assignedNodes();for(let l=0;l<a.length;l++)await ft(n,e,a[l],t,o)}else await ft(n,e,i,t,o)}function To(n,e){if(!Q(n)||!Q(e))return;let{scrollTop:t,scrollLeft:o}=n;if(!t&&!o)return;let{transform:r}=e.style,i=new DOMMatrix(r),{a,b:l,c,d}=i;i.a=1,i.b=0,i.c=0,i.d=1,i.translateSelf(-o,-t),i.a=a,i.b=l,i.c=c,i.d=d,e.style.transform=i.toString()}function xo(n,e){let{backgroundColor:t,width:o,height:r,style:i}=e,a=n.style;if(t&&a.setProperty("background-color",t,"important"),o&&a.setProperty("width",`${o}px`,"important"),r&&a.setProperty("height",`${r}px`,"important"),i)for(let l in i)a[l]=i[l]}var yo=/^[\w-:]+$/;async function Ge(n,e,t=!1,o){let{ownerDocument:r,ownerWindow:i,fontFamilies:a,onCloneEachNode:l}=e;if(r&&Fn(n))return o&&/\S/.test(n.data)&&o(n.data),r.createTextNode(n.data);if(r&&i&&N(n)&&(Q(n)||ne(n))){let d=await po(n,e);if(e.isEnable("removeAbnormalAttributes")){let g=d.getAttributeNames();for(let E=g.length,b=0;b<E;b++){let T=g[b];yo.test(T)||d.removeAttribute(T)}}let h=e.currentNodeStyle=go(n,d,t,e);t&&xo(d,e);let p=!1;if(e.isEnable("copyScrollbar")){let g=[h.get("overflow-x")?.[0],h.get("overflow-y")?.[0]];p=g.includes("scroll")||(g.includes("auto")||g.includes("overlay"))&&(n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)}let m=h.get("text-transform")?.[0],u=St(h.get("font-family")?.[0]),f=u?g=>{m==="uppercase"?g=g.toUpperCase():m==="lowercase"?g=g.toLowerCase():m==="capitalize"&&(g=g[0].toUpperCase()+g.substring(1)),u.forEach(E=>{let b=a.get(E);b||a.set(E,b=new Set),g.split("").forEach(T=>b.add(T))})}:void 0;return _o(n,d,p,e,f),Eo(n,d),ue(n)||await gt(n,d,e,f),await l?.(d),d}let c=n.cloneNode(!1);return await gt(n,c,e),await l?.(c),c}function So(n){if(n.ownerDocument=void 0,n.ownerWindow=void 0,n.svgStyleElement=void 0,n.svgDefsElement=void 0,n.svgStyles.clear(),n.defaultComputedStyles.clear(),n.sandbox){try{n.sandbox.remove()}catch(e){n.log.warn("Failed to destroyContext",e)}n.sandbox=void 0}n.workers=[],n.fontFamilies.clear(),n.fontCssTexts.clear(),n.requests.clear(),n.tasks=[],n.shadowRoots=[]}function wo(n){let{url:e,timeout:t,responseType:o,...r}=n,i=new AbortController,a=t?setTimeout(()=>i.abort(),t):void 0;return fetch(e,{signal:i.signal,...r}).then(l=>{if(!l.ok)throw new Error("Failed fetch, not 2xx response",{cause:l});switch(o){case"arrayBuffer":return l.arrayBuffer();case"dataUrl":return l.blob().then(eo);default:return l.text()}}).finally(()=>clearTimeout(a))}function te(n,e){let{url:t,requestType:o="text",responseType:r="text",imageDom:i}=e,a=t,{timeout:l,acceptOfImage:c,requests:d,fetchFn:h,fetch:{requestInit:p,bypassingCache:m,placeholderImage:u},font:f,workers:g,fontFamilies:E}=n;o==="image"&&(pe||ze)&&n.drawImageCount++;let b=d.get(t);if(!b){m&&m instanceof RegExp&&m.test(a)&&(a+=(/\?/.test(a)?"&":"?")+new Date().getTime());let T=o.startsWith("font")&&f&&f.minify,_=new Set;T&&o.split(";")[1].split(",").forEach(M=>{E.has(M)&&E.get(M).forEach(J=>_.add(J))});let y=T&&_.size,C={url:a,timeout:l,responseType:y?"arrayBuffer":r,headers:o==="image"?{accept:c}:void 0,...p};b={type:o,resolve:void 0,reject:void 0,response:null},b.response=(async()=>{if(h&&o==="image"){let x=await h(t);if(x)return x}return!pe&&t.startsWith("http")&&g.length?new Promise((x,M)=>{g[d.size&g.length-1].postMessage({rawUrl:t,...C}),b.resolve=x,b.reject=M}):wo(C)})().catch(x=>{if(d.delete(t),o==="image"&&u)return n.log.warn("Failed to fetch image base64, trying to use placeholder image",a),typeof u=="string"?u:u(i);throw x}),d.set(t,b)}return b.response}async function Rt(n,e,t,o){if(!It(n))return n;for(let[r,i]of Oo(n,e))try{let a=await te(t,{url:i,requestType:o?"image":"text",responseType:"dataUrl"});n=n.replace(Ao(r),`$1${a}$3`)}catch(a){t.log.warn("Failed to fetch css data url",r,a)}return n}function It(n){return/url\((['"]?)([^'"]+?)\1\)/.test(n)}var Lt=/url\((['"]?)([^'"]+?)\1\)/g;function Oo(n,e){let t=[];return n.replace(Lt,(o,r,i)=>(t.push([i,xt(i,e)]),o)),t.filter(([o])=>!Xe(o))}function Ao(n){let e=n.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`,"g")}var vo=["background-image","border-image-source","-webkit-border-image","-webkit-mask-image","list-style-image"];function No(n,e){return vo.map(t=>{let o=n.getPropertyValue(t);return!o||o==="none"?null:((pe||ze)&&e.drawImageCount++,Rt(o,null,e,!0).then(r=>{!r||o===r||n.setProperty(t,r,n.getPropertyPriority(t))}))}).filter(Boolean)}function Ro(n,e){if(U(n)){let t=n.currentSrc||n.src;if(!Xe(t))return[te(e,{url:t,imageDom:n,requestType:"image",responseType:"dataUrl"}).then(o=>{o&&(n.srcset="",n.dataset.originalSrc=t,n.src=o||"")})];(pe||ze)&&e.drawImageCount++}else if(ne(n)&&!Xe(n.href.baseVal)){let t=n.href.baseVal;return[te(e,{url:t,imageDom:n,requestType:"image",responseType:"dataUrl"}).then(o=>{o&&(n.dataset.originalSrc=t,n.href.baseVal=o||"")})]}return[]}function Io(n,e){let{ownerDocument:t,svgDefsElement:o}=e,r=n.getAttribute("href")??n.getAttribute("xlink:href");if(!r)return[];let[i,a]=r.split("#");if(a){let l=`#${a}`,c=e.shadowRoots.reduce((d,h)=>d??h.querySelector(`svg ${l}`),t?.querySelector(`svg ${l}`));if(i&&n.setAttribute("href",l),o?.querySelector(l))return[];if(c)return o?.appendChild(c.cloneNode(!0)),[];if(i)return[te(e,{url:i,responseType:"text"}).then(d=>{o?.insertAdjacentHTML("beforeend",d)})]}return[]}function Bt(n,e){let{tasks:t}=e;N(n)&&((U(n)||Tt(n))&&t.push(...Ro(n,e)),$n(n)&&t.push(...Io(n,e))),Q(n)&&t.push(...No(n.style,e)),n.childNodes.forEach(o=>{Bt(o,e)})}async function Lo(n,e){let{ownerDocument:t,svgStyleElement:o,fontFamilies:r,fontCssTexts:i,tasks:a,font:l}=e;if(!(!t||!o||!r.size))if(l&&l.cssText){let c=bt(l.cssText,e);o.appendChild(t.createTextNode(`${c}
10
+ `))}else{let c=Array.from(t.styleSheets).filter(u=>{try{return"cssRules"in u&&!!u.cssRules.length}catch(f){return e.log.warn(`Error while reading CSS rules from ${u.href}`,f),!1}}),d=t.implementation.createHTMLDocument(""),h=d.createElement("style");d.head.appendChild(h);let p=h.sheet;await Promise.all(c.flatMap(u=>Array.from(u.cssRules).map(async f=>{if(Mn(f)){let g=f.href,E="";try{E=await te(e,{url:g,requestType:"text",responseType:"text"})}catch(T){e.log.warn(`Error fetch remote css import from ${g}`,T)}let b=E.replace(Lt,(T,_,y)=>T.replace(y,xt(y,g)));for(let T of Do(b))try{p.insertRule(T,p.cssRules.length)}catch(_){e.log.warn("Error inserting rule from remote css import",{rule:T,error:_})}}}))),p.cssRules.length&&c.push(p);let m=[];c.forEach(u=>{Ue(u.cssRules,m)}),m.filter(u=>kn(u)&&It(u.style.getPropertyValue("src"))&&St(u.style.getPropertyValue("font-family"))?.some(f=>r.has(f))).forEach(u=>{let f=u,g=i.get(f.cssText);g?o.appendChild(t.createTextNode(`${g}
11
+ `)):a.push(Rt(f.cssText,f.parentStyleSheet?f.parentStyleSheet.href:null,e).then(E=>{E=bt(E,e),i.set(f.cssText,E),o.appendChild(t.createTextNode(`${E}
12
+ `))}))})}}var Bo=/(\/\*[\s\S]*?\*\/)/g,Et=/((@.*?keyframes [\s\S]*?){([\s\S]*?}\s*?)})/gi;function Do(n){if(n==null)return[];let e=[],t=n.replace(Bo,"");for(;;){let i=Et.exec(t);if(!i)break;e.push(i[0])}t=t.replace(Et,"");let o=/@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=o.exec(t);if(i)r.lastIndex=o.lastIndex;else if(i=r.exec(t),i)o.lastIndex=r.lastIndex;else break;e.push(i[0])}return e}var ko=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Mo=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function bt(n,e){let{font:t}=e,o=t?t?.preferredFormat:void 0;return o?n.replace(Mo,r=>{for(;;){let[i,,a]=ko.exec(r)||[];if(!a)return"";if(a===o)return`src: ${i};`}}):n}function Ue(n,e=[]){for(let t of Array.from(n))Pn(t)?e.push(...Ue(t.cssRules)):"cssRules"in t?Ue(t.cssRules,e):e.push(t);return e}var Po=/\bx?link:?href\s*=\s*["'](?!data:)[^"']+["']/i;function $o(n){return Po.test(n.innerHTML)}async function Ho(n,e){let t=await wt(n,e);if(N(t.node)&&ne(t.node)&&!$o(t.node))return t.node;let{ownerDocument:o,log:r,tasks:i,svgStyleElement:a,svgDefsElement:l,svgStyles:c,font:d,progress:h,autoDestruct:p,onCloneNode:m,onEmbedNode:u,onCreateForeignObjectSvg:f}=t;r.time("clone node");let g=await Ge(t.node,t,!0);if(a&&o){let y="";c.forEach((C,x)=>{y+=`${C.join(`,
11
13
  `)} {
12
- ${v}
14
+ ${x}
13
15
  }
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} {
16
+ `}),a.appendChild(o.createTextNode(y))}r.timeEnd("clone node"),await m?.(g),d!==!1&&N(g)&&(r.time("embed web font"),await Lo(g,t),r.timeEnd("embed web font")),r.time("embed node"),Bt(g,t);let E=i.length,b=0,T=async()=>{for(;;){let y=i.pop();if(!y)break;try{await y}catch(C){t.log.warn("Failed to run task",C)}h?.(++b,E)}};h?.(b,E),await Promise.all([...Array.from({length:4})].map(T)),r.timeEnd("embed node"),await u?.(g);let _=Fo(g,t);return l&&_.insertBefore(l,_.children[0]),a&&_.insertBefore(a,_.children[0]),p&&So(t),await f?.(_),_}function Fo(n,e){let{width:t,height:o}=e,r=Zn(t,o,n.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(n),r.appendChild(i),r}async function Dt(n,e){let t=await wt(n,e),o=await Ho(t),r=Jn(o,t.isEnable("removeControlCharacter"));t.autoDestruct||(t.svgStyleElement=Ot(t.ownerDocument),t.svgDefsElement=t.ownerDocument?.createElementNS(fe,"defs"),t.svgStyles.clear());let i=X(r,o.ownerDocument);return await so(i,t)}var R="helldots-root",Xo=()=>{customElements.get(R)||customElements.define(R,class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}})};function kt(){Xo();let n=document.querySelector(R);return n||(n=document.createElement(R),document.body.appendChild(n)),n.shadowRoot}var ge=.5,Uo=.7,Mt=n=>!n||n==="transparent"||n==="rgba(0, 0, 0, 0)",Pt=()=>{let n=getComputedStyle(document.documentElement).backgroundColor;if(!Mt(n))return n;let e=getComputedStyle(document.body).backgroundColor;return Mt(e)?"#ffffff":e},$t=()=>{try{let n=document.implementation.createHTMLDocument(""),e=n.createElement("style");return n.head.appendChild(e),e.sheet!==null}catch{return!1}},Vo=n=>{let e=[],t=n.indexOf("@font-face");for(;t!==-1;){let o=n.indexOf("{",t),r=o===-1?-1:n.indexOf("}",o);if(r===-1)break;e.push(n.slice(t,r+1)),t=n.indexOf("@font-face",r)}return e.join(`
17
+ `)},Ye=new Map,zo=n=>(Ye.has(n)||Ye.set(n,fetch(n,{mode:"cors",credentials:"omit"}).then(e=>e.ok?e.text():"").then(Vo).catch(()=>"")),Ye.get(n)),Go=n=>{try{return!!n.cssRules}catch{return!1}},Yo=async n=>{let e=()=>{};if(!n||!$t())return e;let t=Array.from(document.styleSheets).filter(i=>i.href&&!Go(i)).map(i=>i.href);if(!t.length)return e;let o=(await Promise.all(t.map(zo))).filter(Boolean).join(`
18
+ `);if(!o)return e;let r=document.createElement("style");return r.textContent=o,document.head.appendChild(r),()=>r.remove()};async function We({scale:n=1,embedCrossOriginFonts:e=!1}={}){let t=await Yo(e);try{return await Dt(document.documentElement,{scale:n,backgroundColor:Pt(),...$t()?{}:{font:!1},filter:o=>o.nodeName?.toLowerCase()!==R})}finally{t()}}var Ht=(n,e,t)=>{n.fillStyle=Pt(),n.fillRect(0,0,e,t)};function Ft(n,{left:e,top:t,width:o,height:r}){let i=document.createElement("canvas");i.width=o,i.height=r;let a=i.getContext("2d");return a?(Ht(a,o,r),a.drawImage(n,e+window.scrollX,t+window.scrollY,o,r,0,0,o,r),i.toDataURL("image/png")):null}function je(n,{sourceScale:e=1,outputScale:t=ge,quality:o=Uo}={}){let r=document.createElement("canvas");r.width=Math.round(window.innerWidth*t),r.height=Math.round(window.innerHeight*t);let i=r.getContext("2d");return i?(Ht(i,r.width,r.height),i.drawImage(n,window.scrollX*e,window.scrollY*e,window.innerWidth*e,window.innerHeight*e,0,0,r.width,r.height),r.toDataURL("image/jpeg",o)):null}var s={CIRCLE:"comment-circle",CIRCLE_ACTIVE:"comment-circle--active",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_REPLY_ACTIONS:"thread-reply-actions",THREAD_INPUT_AREA:"thread-input-area",THREAD_INPUT:"thread-input",THREAD_SUBMIT:"thread-submit",THREAD_ACTIONS_ROW:"thread-actions-row",THREAD_SCROLL:"thread-scroll",THREAD_META:"thread-meta",THREAD_AUTHOR:"thread-author",THREAD_TIME:"thread-time",THREAD_EDITED:"thread-edited",EDITOR:"helldots-editor",EDITOR_INPUT:"helldots-editor-input",EDITOR_ACTIONS:"helldots-editor-actions",EDITOR_SAVE:"helldots-editor-save",EDITOR_CANCEL:"helldots-editor-cancel",INBOX_NOTICE:"inbox-notice",PREVIEW_CIRCLE:"preview-circle",SELECTION_RECT:"selection-rect",SCREENSHOT_IMG:"screenshot-img",SCREENSHOT_REMOVE:"screenshot-remove",SCREENSHOTS_CONTAINER:"screenshots-container",SCREENSHOT_ITEM:"screenshot-item",CONFIRM:"helldots-confirm",CONFIRM_PANEL:"helldots-confirm-panel",CONFIRM_TITLE:"helldots-confirm-title",CONFIRM_MESSAGE:"helldots-confirm-message",CONFIRM_ACTIONS:"helldots-confirm-actions",CONFIRM_CANCEL:"helldots-confirm-cancel",CONFIRM_ACCEPT:"helldots-confirm-accept",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_MENU_HEADER:"inbox-filter-menu-header",INBOX_FILTER_CLEAR:"inbox-filter-clear",INBOX_FILTER_GROUP:"inbox-filter-group",INBOX_FILTER_CHIPS:"inbox-filter-chips",INBOX_FILTER_CHIP:"inbox-filter-chip",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_UP:"inbox-menu--up",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",TOOLTIP_REPLY_COUNT:"comment-tooltip-reply-count",INBOX_EMPTY:"inbox-empty",INBOX_EMPTY_ICON:"inbox-empty-icon",INBOX_EMPTY_TITLE:"inbox-empty-title",INBOX_EMPTY_TEXT:"inbox-empty-text",INBOX_EMPTY_KBD:"inbox-empty-kbd",INBOX_EMPTY_ACTION:"inbox-empty-action",CLASSIFY_ROW:"classify-row",INBOX_BADGES:"inbox-badges",BADGE:"helldots-badge",BADGE_STATUS:"helldots-badge--status",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_TITLE:"inbox-context-title",CONTEXT_BODY:"inbox-context-body",CONTEXT_ROW:"inbox-context-row",CONTEXT_SCREENSHOT_CAPTION:"inbox-context-screenshot-caption",CONTEXT_TOGGLE:"inbox-context-toggle",HIGHLIGHT:"helldots-highlight"},Xt=[s.COMMENT_CURSOR],S={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"},A=28,Ee=5,P=["open","in_progress","resolved"],be={open:"#2E90FA",in_progress:"#FF9F0A",resolved:"#30D158"},L=["bug","suggestion","question","improvement"],oe={bug:"#FF453A",suggestion:"#BF5AF2",question:"#64D2FF",improvement:"#5E5CE6"},B=["high","medium","low"],ie={high:"#FF453A",medium:"#FF9F0A",low:"#8E8E93"},Ut={CONTAINER:'section, div[class*="container"], div[class*="content"]'},O={CIRCLE:9997,TOOLTIP:1e4,TOOLBAR:9998,COMMENT_BOX:9999,LIGHTBOX:10001,CONFIRM:10002},Vt='data:image/svg+xml;utf8,<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"><g transform="translate(-4,-4)"><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></svg>',zt="2 2";var Ce=class{constructor({host:e,autoScreenshot:t,embedCrossOriginFonts:o=!1,onRegionCaptured:r,onPlace:i}){this.host=e,this.autoScreenshot=t,this.embedCrossOriginFonts=o,this.onRegionCaptured=r,this.onPlace=i,this.pendingCapture=null,this._dragStart=null,this._isDragging=!1,this._selectionRect=null,this._boundDragMove=a=>this.onDragMove(a),this._boundDragEnd=a=>this.onDragEnd(a)}beginDrag(e){this._dragStart={x:e.clientX,y:e.clientY},this._isDragging=!1,document.addEventListener("mousemove",this._boundDragMove),document.addEventListener("mouseup",this._boundDragEnd)}onDragMove(e){let t=e.clientX-this._dragStart.x,o=e.clientY-this._dragStart.y;if(!this._isDragging&&Math.hypot(t,o)<5)return;this._isDragging=!0;let r=Math.min(this._dragStart.x,e.clientX),i=Math.min(this._dragStart.y,e.clientY),a=Math.abs(t),l=Math.abs(o);this._selectionRect||(this._selectionRect=document.createElement("div"),this._selectionRect.className=s.SELECTION_RECT,this.host.appendChild(this._selectionRect)),this._selectionRect.style.left=`${r}px`,this._selectionRect.style.top=`${i}px`,this._selectionRect.style.width=`${a}px`,this._selectionRect.style.height=`${l}px`}async onDragEnd(e){if(document.removeEventListener("mousemove",this._boundDragMove),document.removeEventListener("mouseup",this._boundDragEnd),this._isDragging){let t=Math.min(this._dragStart.x,e.clientX),o=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{let a=await We({scale:1,embedCrossOriginFonts:this.embedCrossOriginFonts}),l=Ft(a,{left:t,top:o,width:r,height:i});l&&this.onRegionCaptured(l),this.autoScreenshot&&(this.pendingCapture=Promise.resolve(je(a,{sourceScale:1})))}catch(a){console.warn("HellDots: screenshot capture failed:",a)}await this.onPlace(e.clientX,e.clientY)}else await this.onPlace(this._dragStart.x,this._dragStart.y);this._isDragging=!1,this._dragStart=null}armClickCapture(){!this.autoScreenshot||this.pendingCapture||(this.pendingCapture=We({scale:ge,embedCrossOriginFonts:this.embedCrossOriginFonts}).then(e=>je(e,{sourceScale:ge})).catch(e=>(console.warn("HellDots: automatic screenshot failed",e),null)))}async consumePending(){return this.pendingCapture?await this.pendingCapture:null}clearPending(){this.pendingCapture=null}destroy(){document.removeEventListener("mousemove",this._boundDragMove),document.removeEventListener("mouseup",this._boundDragEnd),this._selectionRect?.remove(),this._selectionRect=null,this.pendingCapture=null,this._dragStart=null,this._isDragging=!1}};var Wo=[{name:"Edge",re:/Edg\/([\d.]+)/},{name:"Chrome",re:/Chrome\/([\d.]+)/},{name:"Firefox",re:/Firefox\/([\d.]+)/},{name:"Safari",re:/Version\/([\d.]+).*Safari/}],jo=[{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/}],qo={name:"unknown",version:""},Ko=n=>/not[\W_]*a[\W_]*brand/i.test(n),Gt=(n,e)=>{for(let{name:t,re:o}of n){let r=e.match(o);if(r)return{name:t,version:(r[1]||"").replace(/_/g,".")}}return{...qo}};function Yt(n=window){let e=n.navigator||{},t=e.userAgent||"",o=e.userAgentData,r=Gt(Wo,t),i=o?.brands?.find(l=>!Ko(l.brand));i&&(r={name:i.brand,version:i.version||""});let a=Gt(jo,t);return o?.platform&&(a.name=o.platform),{version:1,url:n.location?.href||"",viewport:{width:n.innerWidth,height:n.innerHeight},screen:{width:n.screen?.width??0,height:n.screen?.height??0},devicePixelRatio:n.devicePixelRatio??1,userAgent:t,browser:r,os:a,language:e.language||""}}var _e=" scrollbar-width:thin;scrollbar-color:rgba(255,255,255,0.22) transparent;",Zo=(...n)=>n.map(e=>` ${e}::-webkit-scrollbar{width:8px;height:8px;}${e}::-webkit-scrollbar-track{background:transparent;}${e}::-webkit-scrollbar-thumb{background:rgba(255,255,255,0.22);border-radius:4px;}${e}::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,0.35);}`).join(""),Wt=()=>` :host{all:initial;display:block;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;line-height:1.5;color-scheme:light;}:host *,:host *::before,:host *::after{box-sizing:border-box;font-family:inherit;}button{padding:0;font:inherit;color:inherit;}#${S.TOOLBAR}{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);z-index:${O.TOOLBAR};}.${s.TOOLBAR_ACTION_WRAPPER}{position:relative;}.${s.TOOLBAR_ACTION_TOOLTIP}{position:absolute;bottom:calc(100% + 10px);left:50%;transform:translateX(-50%) translateY(4px);display:flex;align-items:center;gap:8px;background:rgba(20,20,23,0.95);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);padding:8px 12px;border-radius:10px;border:1px solid rgba(255,255,255,0.08);box-shadow:0 4px 24px rgba(0,0,0,0.35);color:white;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity 0.15s ease,transform 0.15s ease;}.${s.TOOLBAR_ACTION_WRAPPER}:hover .${s.TOOLBAR_ACTION_TOOLTIP}{opacity:1;pointer-events:auto;transform:translateX(-50%) translateY(0);}.${s.TOOLBAR_TEXT}{font-size:13px;font-weight:500;letter-spacing:-0.01em;}.${s.SHORTCUT_HINT}{font-size:11px;font-weight:500;color:rgba(255,255,255,0.5);background:rgba(255,255,255,0.06);border:1px solid rgba(255,255,255,0.1);padding:2px 6px;border-radius:5px;line-height:1;white-space:nowrap;}.${s.TOOLBAR_ACTIONS}{display:flex;flex-direction:row;background:rgba(20,20,23,0.95);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);border-radius:12px;box-shadow:0 4px 24px rgba(0,0,0,0.35);}.${s.TOOLBAR_ACTION_BTN}{width:42px;height:42px;display:flex;align-items:center;justify-content:center;background:none;border:none;outline:none;color:rgba(255,255,255,0.65);cursor:pointer;transition:background 0.2s,color 0.2s;padding:0;}.${s.TOOLBAR_ACTION_WRAPPER}:first-child .${s.TOOLBAR_ACTION_BTN}{border-radius:12px 0 0 12px;}.${s.TOOLBAR_ACTION_WRAPPER}:last-child .${s.TOOLBAR_ACTION_BTN}{border-radius:0 12px 12px 0;}.${s.TOOLBAR_ACTION_BTN}:hover{background:rgba(255,255,255,0.08);color:white;}.${s.TOOLBAR_COMMENT_BTN}.${s.ACTIVE}{color:#2E90FA;background:rgba(46,144,250,0.1);}#${S.COMMENT_BOX}{position:fixed;background:#1C1C1E;border-radius:12px;box-shadow:0 4px 20px rgba(0,0,0,0.4);padding:16px;z-index:${O.COMMENT_BOX};width:min(400px,calc(100vw - 24px));display:none;box-sizing:border-box;}#${S.COMMENT_BOX} .${s.COMMENT_INPUT_AREA}{display:flex;flex-direction:column;gap:0;}.${s.CLASSIFY_ROW}{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:0 0 10px;border-bottom:1px solid rgba(255,255,255,0.08);}.${s.CLASSIFY_ROW} .${s.INBOX_ACTION_BTN}{height:26px;border:1px solid rgba(255,255,255,0.12);border-radius:8px;}.${s.CLASSIFY_ROW} .${s.INBOX_ACTION_BTN}:hover{border-color:rgba(255,255,255,0.28);}#${S.COMMENT_INPUT}{flex:1;min-height:20px;background:#1C1C1E;border:none;resize:none;font-family:inherit;color:white;font-size:14px;line-height:1.4;box-sizing:border-box;field-sizing:content;padding:8px 0;}#${S.COMMENT_INPUT}::placeholder{color:rgba(255,255,255,0.5);}#${S.COMMENT_INPUT}:focus{outline:none;box-shadow:none;}.${s.COMMENT_ACTIONS_BAR}{display:flex;align-items:center;justify-content:space-between;padding-top:12px;}.${s.ATTACH_IMAGE_BTN}{background:none;border:none;color:rgba(255,255,255,0.5);cursor:pointer;display:flex;align-items:center;justify-content:center;border-radius:6px;transition:background 0.2s,color 0.2s;}.${s.ATTACH_IMAGE_BTN}:hover{background:rgba(255,255,255,0.1);color:rgba(255,255,255,0.8);}.${s.CIRCLE}{position:absolute;width:${A}px;height:${A}px;background:#2E90FA;border-radius:0% 100% 100% 100%;border:2px solid #FFF;cursor:pointer;box-shadow:0 1px 5px rgba(0,0,0,0.2);transition:transform 0.2s,background 0.2s;z-index:${O.CIRCLE};transform:translate(-50%,-50%);}.${s.CIRCLE}:hover{transform:translate(-50%,-50%) scale(1.2) !important;background:rgb(0,123,255);}.${s.CIRCLE}.${s.HIGHLIGHT}{transform:translate(-50%,-50%) scale(1.2) !important;background:rgb(0,123,255);box-shadow:0 0 0 4px rgba(46,144,250,0.35),0 1px 5px rgba(0,0,0,0.2);}.${s.CIRCLE}.${s.CIRCLE_ACTIVE}{transform:translate(-50%,-50%) scale(1.2) !important;background:rgb(0,123,255);box-shadow:0 0 0 5px rgba(46,144,250,0.5),0 1px 5px rgba(0,0,0,0.2);}.${s.TOOLTIP}{position:fixed;background:#1C1C1E;border-radius:12px;padding:16px;box-shadow:0 4px 20px rgba(0,0,0,0.4);width:min(400px,calc(100vw - 24px));max-height:calc(100vh - 20px);overflow-y:auto;overscroll-behavior:contain;${_e} z-index:${O.TOOLTIP};color:white;font-size:14px;line-height:1.5;box-sizing:border-box;}.${s.TOOLTIP} .${s.THREAD_BODY}{padding:8px 0;}.${s.THREAD_POPOVER}{position:fixed;background:#1C1C1E;border-radius:12px;padding:16px;box-shadow:0 4px 20px rgba(0,0,0,0.4);width:min(400px,calc(100vw - 24px));max-height:calc(100vh - 20px);display:flex;flex-direction:column;z-index:${O.TOOLTIP};color:white;font-size:14px;line-height:1.5;box-sizing:border-box;}.${s.THREAD_POPOVER}>.${s.THREAD_HEADER},.${s.THREAD_POPOVER}>.${s.THREAD_ACTIONS_ROW},.${s.THREAD_POPOVER}>.${s.THREAD_INPUT_AREA}{flex:none;}.${s.THREAD_SCROLL}{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;${_e}}${Zo(`.${s.THREAD_SCROLL}`,`.${s.TOOLTIP}`,`.${s.INBOX_LIST}`,`.${s.INBOX_DETAIL}`,`.${s.EDITOR_INPUT}`)} .${s.INBOX_PANEL}{position:fixed;top:16px;right:16px;bottom:16px;width:380px;display:flex;flex-direction:column;background:#1C1C1E;border:1px solid rgba(255,255,255,0.08);border-radius:14px;box-shadow:0 8px 32px rgba(0,0,0,0.5);z-index:${O.COMMENT_BOX};color:white;font-size:14px;line-height:1.5;box-sizing:border-box;overflow:hidden;}@media (max-width:480px){.${s.INBOX_PANEL}{left:16px;width:auto;}}.${s.INBOX_HEADER},.${s.INBOX_DETAIL_HEADER}{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:12px 14px;border-bottom:1px solid rgba(255,255,255,0.08);flex:none;}.${s.INBOX_FILTER}-wrapper{position:relative;}.${s.INBOX_FILTER}{display:flex;align-items:center;gap:6px;background:transparent;border:none;color:white;font-size:13px;font-weight:600;cursor:pointer;padding:4px 6px;border-radius:6px;}.${s.INBOX_FILTER}:hover{background:rgba(255,255,255,0.08);}.${s.INBOX_FILTER_MENU}{position:absolute;top:calc(100% + 6px);left:0;background:#2C2C2E;border:1px solid rgba(255,255,255,0.1);border-radius:12px;padding:14px;width:300px;max-width:calc(100vw - 40px);z-index:1;box-shadow:0 8px 28px rgba(0,0,0,0.5);}.${s.INBOX_FILTER_MENU_HEADER}{display:flex;align-items:baseline;justify-content:space-between;gap:12px;font-size:13px;font-weight:600;margin-bottom:12px;}.${s.INBOX_FILTER_CLEAR}{background:transparent;border:none;color:rgba(255,255,255,0.55);font-size:12px;font-weight:500;cursor:pointer;padding:0;}.${s.INBOX_FILTER_CLEAR}:hover:not(:disabled){color:white;}.${s.INBOX_FILTER_CLEAR}:disabled{opacity:0.35;cursor:default;}.${s.INBOX_FILTER_GROUP} + .${s.INBOX_FILTER_GROUP}{margin-top:14px;}.${s.INBOX_FILTER_SECTION}{font-size:11px;font-weight:600;color:rgba(255,255,255,0.45);margin-bottom:8px;}.${s.INBOX_FILTER_CHIPS}{display:flex;flex-wrap:wrap;gap:6px;}.${s.INBOX_FILTER_CHIP}{background:transparent;border:1px solid rgba(255,255,255,0.18);border-radius:999px;color:rgba(255,255,255,0.75);font-size:12px;line-height:1;padding:7px 12px;cursor:pointer;transition:background 0.15s,border-color 0.15s,color 0.15s;}.${s.INBOX_FILTER_CHIP}:hover{border-color:rgba(255,255,255,0.4);color:white;}.${s.INBOX_FILTER_CHIP}[aria-checked="true"]{background:rgba(255,255,255,0.92);border-color:rgba(255,255,255,0.92);color:#1C1C1E;font-weight:600;}.${s.INBOX_MENU_ITEM}{display:block;width:100%;text-align:left;background:transparent;border:none;color:white;font-size:13px;padding:7px 10px;border-radius:6px;cursor:pointer;}.${s.INBOX_MENU_ITEM}:hover{background:rgba(255,255,255,0.08);}.${s.INBOX_CLOSE},.${s.INBOX_NAV_BTN},.${s.INBOX_BACK}{display:flex;align-items:center;gap:4px;background:transparent;border:none;color:rgba(255,255,255,0.75);cursor:pointer;padding:4px 6px;border-radius:6px;font-size:14px;}.${s.INBOX_CLOSE}{font-size:20px;line-height:1;}.${s.INBOX_CLOSE}:hover,.${s.INBOX_NAV_BTN}:not(:disabled):hover,.${s.INBOX_BACK}:hover{background:rgba(255,255,255,0.08);color:white;}.${s.INBOX_NAV_BTN}:disabled{opacity:0.35;cursor:default;}.${s.INBOX_LIST},.${s.INBOX_DETAIL}{flex:1;overflow-y:auto;${_e} padding:12px;display:flex;flex-direction:column;gap:12px;}.${s.INBOX_CARD}{border:1px solid rgba(255,255,255,0.1);border-radius:10px;padding:12px;display:flex;flex-direction:column;gap:8px;}.${s.INBOX_LIST} .${s.INBOX_CARD}{cursor:pointer;}.${s.INBOX_LIST} .${s.INBOX_CARD}:hover{border-color:rgba(255,255,255,0.22);}.${s.INBOX_CARD}--resolved{border-color:rgba(48,209,88,0.4);opacity:0.75;}.${s.INBOX_LIST} .${s.INBOX_CARD}--resolved:hover{border-color:rgba(48,209,88,0.7);opacity:1;}.${s.INBOX_CARD_HEADER}{display:flex;align-items:center;justify-content:space-between;gap:8px;}.${s.INBOX_CARD_ACTIONS}{display:flex;align-items:center;flex-wrap:wrap;justify-content:flex-end;gap:6px;}.${s.INBOX_ACTION_BTN}{display:flex;align-items:center;justify-content:center;width:24px;height:24px;background:transparent;border:none;border-radius:6px;color:rgba(255,255,255,0.65);cursor:pointer;}.${s.INBOX_ACTION_BTN}:hover{background:rgba(255,255,255,0.08);color:white;}.${s.INBOX_ACTION_BTN_LABELED}{width:auto;padding:0 8px 0 6px;gap:5px;justify-content:flex-start;flex:none;}.${s.INBOX_ACTION_LABEL}{font-size:11px;line-height:1;white-space:nowrap;}.${s.INBOX_STATUS_DOT}{width:12px;height:12px;border-radius:50%;border:1.5px solid rgba(255,255,255,0.45);display:inline-block;flex:none;}.${s.INBOX_MENU_ITEM} .${s.INBOX_STATUS_DOT}{width:9px;height:9px;border:none;margin-right:8px;vertical-align:baseline;}.${s.INBOX_MENU_ITEM}[aria-checked="true"]{background:rgba(255,255,255,0.08);}.${s.THREAD_ACTIONS_ROW}{display:flex;justify-content:flex-end;}.${s.THREAD_POPOVER}>.${s.THREAD_ACTIONS_ROW}{padding-top:8px;}[data-hd-tooltip]{position:relative;}[data-hd-tooltip]::after{content:attr(data-hd-tooltip);position:absolute;bottom:calc(100% + 6px);left:50%;transform:translateX(-50%);background:#000;color:white;padding:4px 8px;border-radius:6px;font-size:11px;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity 0.12s ease;z-index:2;}[data-hd-tooltip]:hover::after{opacity:1;}.${s.INBOX_MENU}{position:absolute;top:calc(100% + 4px);right:0;background:#2C2C2E;border:1px solid rgba(255,255,255,0.1);border-radius:8px;padding:4px;min-width:130px;z-index:1;box-shadow:0 4px 16px rgba(0,0,0,0.4);}.${s.INBOX_MENU}.${s.INBOX_MENU_UP}{top:auto;bottom:calc(100% + 4px);}.${s.INBOX_CARD_TEXT}{white-space:pre-wrap;word-break:break-word;}.${s.INBOX_CARD_TAG}{align-self:flex-start;padding:1px 8px;border-radius:999px;background:rgba(255,159,10,0.2);color:#FF9F0A;font-size:11px;font-weight:600;}.${s.INBOX_BADGES}{display:flex;flex-wrap:wrap;gap:4px;}.${s.INBOX_CARD} .${s.INBOX_BADGES}{margin-top:6px;}.${s.TOOLTIP} .${s.INBOX_BADGES}{margin-bottom:4px;}.${s.BADGE}{display:inline-flex;align-items:center;padding:1px 6px;border:1px solid rgba(255,255,255,0.18);border-radius:10px;font-size:10px;line-height:1.6;letter-spacing:0.01em;white-space:nowrap;}.${s.BADGE_STATUS},.${s.BADGE_TYPE},.${s.BADGE_PRIORITY}{font-weight:600;}.${s.BADGE_TAG}{opacity:0.75;}.${s.BADGE_DURATION}{opacity:0.75;border-style:dashed;}.${s.CONTEXT_BLOCK}{display:flex;flex-direction:column;padding:10px 12px;border-top:1px solid rgba(255,255,255,0.08);font-size:11px;}.${s.CONTEXT_BODY}{display:flex;flex-direction:column;gap:4px;}.${s.CONTEXT_TITLE}{font-size:11px;font-weight:600;color:rgba(255,255,255,0.45);padding-bottom:4px;}.${s.CONTEXT_TOGGLE}{display:flex;align-items:center;justify-content:space-between;width:100%;background:transparent;border:none;color:rgba(255,255,255,0.45);font-size:11px;font-weight:600;cursor:pointer;padding:2px 0;}.${s.CONTEXT_TOGGLE}:hover{color:rgba(255,255,255,0.75);}.${s.CONTEXT_TOGGLE} svg{flex:none;transition:transform 0.15s ease;}.${s.CONTEXT_TOGGLE}[aria-expanded="true"] svg{transform:rotate(180deg);}.${s.CONTEXT_TOGGLE}[aria-expanded="true"] + .${s.CONTEXT_BODY}{padding-top:8px;}.${s.CONTEXT_BLOCK} img{width:100%;border-radius:6px;margin-bottom:6px;cursor:zoom-in;}.${s.CONTEXT_SCREENSHOT_CAPTION}{opacity:0.75;}.${s.CONTEXT_ROW}{display:flex;justify-content:space-between;gap:12px;opacity:0.75;}.${s.CONTEXT_ROW} span:last-child{text-align:right;word-break:break-all;}.${s.INBOX_CARD_REPLY_LINK}{align-self:flex-start;background:transparent;border:none;color:rgba(255,255,255,0.55);font-size:13px;cursor:pointer;padding:0;}.${s.INBOX_CARD_REPLY_LINK}:hover{color:white;}.${s.INBOX_REPLIES}{display:flex;flex-direction:column;gap:10px;padding:0 4px;}.${s.TOOLTIP_REPLY_COUNT}{font-size:12px;color:rgba(255,255,255,0.45);padding-top:4px;}.${s.INBOX_EMPTY}{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:32px 24px;color:rgba(255,255,255,0.55);text-align:center;}.${s.INBOX_EMPTY_ICON}{width:44px;height:44px;margin-bottom:6px;border:2px dashed rgba(255,255,255,0.25);border-radius:0% 100% 100% 100%;flex:none;}.${s.INBOX_EMPTY_TITLE}{color:white;font-size:14px;font-weight:600;}.${s.INBOX_EMPTY_TEXT}{font-size:13px;line-height:1.5;max-width:30ch;}.${s.INBOX_EMPTY_KBD}{font-family:inherit;font-size:12px;font-weight:500;color:rgba(255,255,255,0.8);background:rgba(255,255,255,0.08);border:1px solid rgba(255,255,255,0.14);border-radius:5px;padding:1px 5px;white-space:nowrap;}.${s.INBOX_EMPTY_ACTION}{margin-top:6px;background:transparent;border:1px solid rgba(255,255,255,0.2);border-radius:8px;color:white;font-size:13px;font-weight:500;padding:8px 16px;cursor:pointer;transition:background 0.15s,border-color 0.15s;}.${s.INBOX_EMPTY_ACTION}:hover{background:rgba(255,255,255,0.08);border-color:rgba(255,255,255,0.35);}.${s.THREAD_HEADER}{display:flex;justify-content:space-between;align-items:center;padding:0;}.${s.THREAD_META}{display:flex;align-items:center;gap:6px;flex:1;min-width:0;}.${s.THREAD_AUTHOR}{font-weight:600;font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.${s.THREAD_TIME}{font-size:12px;color:rgba(255,255,255,0.5);cursor:default;position:relative;flex:none;}.${s.THREAD_TIME}::after{content:attr(data-full-date);position:absolute;bottom:calc(100% + 6px);left:50%;transform:translateX(-50%);background:#000;color:white;padding:4px 8px;border-radius:6px;font-size:11px;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity 0.15s ease;z-index:1;}.${s.THREAD_TIME}:hover::after{opacity:1;}.${s.THREAD_BODY}{padding:8px 0;white-space:pre-wrap;word-break:break-word;}.${s.THREAD_REPLIES}{padding:0;}.${s.THREAD_REPLIES}:empty{display:none;}.${s.THREAD_REPLY}{padding:16px 0 0 0;border-top:1px solid rgba(255,255,255,0.1);white-space:pre-wrap;word-break:break-word;font-size:13px;color:rgba(255,255,255,0.85);}.${s.THREAD_REPLY} .${s.THREAD_META}{margin-bottom:2px;}.${s.THREAD_REPLY_ACTIONS}{margin-left:auto;flex:none;}.${s.THREAD_REPLY} .${s.SCREENSHOT_IMG}{width:144px;height:100px;object-fit:cover;border-radius:8px;margin-top:4px;cursor:pointer;display:block;}.${s.THREAD_INPUT_AREA}{display:flex;flex-direction:column;gap:0;padding:12px 0 0;border-top:1px solid rgba(255,255,255,0.1);}.${s.THREAD_INPUT}{width:100%;background:transparent;border:none;padding:0;color:white;font-size:14px;font-family:inherit;outline:none;box-sizing:border-box;}.${s.THREAD_INPUT}::placeholder{color:rgba(255,255,255,0.5);}.${s.THREAD_INPUT}:focus{outline:none;box-shadow:none;}.${s.THREAD_SUBMIT}{background:none;border:none;color:#2E90FA;cursor:pointer;display:flex;align-items:center;justify-content:center;border-radius:6px;transition:background 0.2s;}.${s.THREAD_SUBMIT}:hover{background:rgba(46,144,250,0.15);color:#1570D6;}.${s.CLOSE_TOOLTIP}{background:none;border:none;font-size:18px;cursor:pointer;color:rgba(255,255,255,0.5);line-height:1;}.${s.CLOSE_TOOLTIP}:hover{color:white;}.${s.PREVIEW_CIRCLE}{animation:helldots-pulse 1.5s ease-in-out infinite;}@keyframes helldots-pulse{0%,100%{box-shadow:0 0 0 0 rgba(46,144,250,0.4),0 1px 5px rgba(0,0,0,0.2);}50%{box-shadow:0 0 0 8px rgba(46,144,250,0),0 1px 5px rgba(0,0,0,0.2);}}.${s.COMMENT_OVERLAY}{position:fixed;top:0;left:0;right:0;bottom:0;background:transparent;pointer-events:none;z-index:${O.TOOLBAR-1};}.${s.COMMENT_OVERLAY}.${s.ACTIVE}{pointer-events:auto;background:rgba(0,0,0,0.1);}.${s.SELECTION_RECT}{position:fixed;border:2px solid #2E90FA;background:rgba(46,144,250,0.1);pointer-events:none;z-index:${O.TOOLTIP};box-sizing:border-box;}.${s.SCREENSHOTS_CONTAINER}{display:none;overflow-x:auto;gap:8px;margin-top:4px;padding:4px 0;scrollbar-width:none;-ms-overflow-style:none;margin-bottom:8px;}.${s.SCREENSHOTS_CONTAINER}::-webkit-scrollbar{display:none;}.${s.SCREENSHOTS_CONTAINER}.${s.ACTIVE}{display:flex;}.${s.SCREENSHOT_ITEM}{position:relative;flex-shrink:0;}.${s.SCREENSHOT_ITEM} .${s.SCREENSHOT_IMG}{width:50px;height:50px;object-fit:cover;border-radius:8px;cursor:pointer;display:block;margin:0;}.${s.SCREENSHOT_ITEM} .${s.SCREENSHOT_IMG}:hover{opacity:0.85;}.${s.SCREENSHOT_ITEM} .${s.SCREENSHOT_REMOVE}{position:absolute;top:-5px;right:-5px;width:18px;height:18px;background:rgba(0,0,0,0.7);border:none;border-radius:50%;color:white;font-size:12px;line-height:1;cursor:pointer;display:none;align-items:center;justify-content:center;z-index:1;}.${s.SCREENSHOT_ITEM}:hover .${s.SCREENSHOT_REMOVE}{display:flex;}.${s.SCREENSHOT_ITEM} .${s.SCREENSHOT_REMOVE}:hover{background:rgba(0,0,0,0.9);}.${s.TOOLTIP}>.${s.SCREENSHOTS_CONTAINER} .${s.SCREENSHOT_ITEM} .${s.SCREENSHOT_IMG},.${s.THREAD_SCROLL}>.${s.SCREENSHOTS_CONTAINER} .${s.SCREENSHOT_ITEM} .${s.SCREENSHOT_IMG},.${s.THREAD_REPLY} .${s.SCREENSHOT_ITEM} .${s.SCREENSHOT_IMG}{width:144px;height:100px;}.${s.CONFIRM}{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.6);display:flex;align-items:center;justify-content:center;padding:16px;animation:helldots-fade-in 0.15s ease;}.${s.CONFIRM_PANEL}{width:min(360px,100%);background:#1C1C1E;border:1px solid rgba(255,255,255,0.1);border-radius:14px;box-shadow:0 8px 32px rgba(0,0,0,0.5);padding:20px;color:white;font-size:14px;line-height:1.5;box-sizing:border-box;}.${s.CONFIRM_TITLE}{margin:0 0 8px;font-size:15px;font-weight:600;}.${s.CONFIRM_MESSAGE}{margin:0 0 20px;font-size:13px;color:rgba(255,255,255,0.65);}.${s.CONFIRM_ACTIONS}{display:flex;justify-content:flex-end;gap:8px;}.${s.CONFIRM_CANCEL},.${s.CONFIRM_ACCEPT}{padding:7px 14px;border:1px solid transparent;border-radius:8px;font-size:13px;font-weight:600;cursor:pointer;}.${s.CONFIRM_CANCEL}:focus-visible,.${s.CONFIRM_ACCEPT}:focus-visible{outline:2px solid #2E90FA;outline-offset:2px;}.${s.CONFIRM_CANCEL}{background:rgba(255,255,255,0.08);border-color:rgba(255,255,255,0.12);color:white;}.${s.CONFIRM_CANCEL}:hover{background:rgba(255,255,255,0.14);}.${s.CONFIRM_ACCEPT}{background:#FF453A;color:white;}.${s.CONFIRM_ACCEPT}:hover{background:#FF6961;}.${s.LIGHTBOX}{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.92);z-index:${O.LIGHTBOX};display:flex;align-items:center;justify-content:center;animation:helldots-fade-in 0.2s ease;}@keyframes helldots-fade-in{from{opacity:0;}to{opacity:1;}}.${s.LIGHTBOX_IMG}{max-width:90vw;max-height:90vh;object-fit:contain;border-radius:8px;}.${s.LIGHTBOX_CLOSE}{position:absolute;top:16px;right:16px;background:rgba(255,255,255,0.15);border:none;color:white;font-size:24px;width:40px;height:40px;border-radius:50%;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background 0.2s;}.${s.LIGHTBOX_CLOSE}:hover{background:rgba(255,255,255,0.3);}.${s.EDITOR}{display:flex;flex-direction:column;gap:8px;margin:4px 0 2px;}.${s.EDITOR_INPUT}{width:100%;box-sizing:border-box;resize:vertical;min-height:60px;background:rgba(255,255,255,0.06);border:1px solid rgba(255,255,255,0.14);border-radius:8px;padding:8px 10px;color:white;font-size:14px;font-family:inherit;line-height:1.45;outline:none;${_e}}.${s.EDITOR_INPUT}:focus{border-color:rgba(46,144,250,0.7);}.${s.EDITOR_ACTIONS}{display:flex;justify-content:flex-end;gap:8px;}.${s.EDITOR_CANCEL},.${s.EDITOR_SAVE}{padding:5px 12px;border:1px solid transparent;border-radius:7px;font-size:13px;font-weight:600;font-family:inherit;cursor:pointer;}.${s.EDITOR_CANCEL}{background:rgba(255,255,255,0.08);border-color:rgba(255,255,255,0.12);color:white;}.${s.EDITOR_CANCEL}:hover{background:rgba(255,255,255,0.14);}.${s.EDITOR_SAVE}{background:#2E90FA;color:white;}.${s.EDITOR_SAVE}:hover:not(:disabled){background:#57A6FB;}.${s.EDITOR_SAVE}:disabled{background:rgba(255,255,255,0.10);color:rgba(255,255,255,0.4);cursor:not-allowed;}.${s.THREAD_EDITED}{font-size:12px;color:rgba(255,255,255,0.4);cursor:default;position:relative;flex:none;}.${s.THREAD_EDITED}::before{content:"\xB7";margin-right:4px;}.${s.THREAD_EDITED}::after{content:attr(data-full-date);position:absolute;bottom:calc(100% + 6px);left:50%;transform:translateX(-50%);background:#000;color:white;padding:4px 8px;border-radius:6px;font-size:11px;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity 0.15s ease;}.${s.THREAD_EDITED}:hover::after{opacity:1;}.${s.INBOX_NOTICE}{margin:0 0 10px;padding:9px 11px;border-radius:8px;background:rgba(255,255,255,0.06);border:1px solid rgba(255,255,255,0.12);color:rgba(255,255,255,0.75);font-size:13px;line-height:1.4;}`,jt=()=>` .${s.COMMENT_CURSOR},.${s.COMMENT_CURSOR} *{cursor:url('${Vt}') ${zt},auto !important;}`;function qe(n,e,t){let o=Jo(e,n);if(o)return n.adoptedStyleSheets=[...n.adoptedStyleSheets??[],o],()=>{n.adoptedStyleSheets=(n.adoptedStyleSheets??[]).filter(a=>a!==o)};let r=n.head??n;r.querySelector?.(`#${t}`)?.remove();let i=document.createElement("style");return i.id=t,i.textContent=e,r.appendChild(i),()=>i.remove()}function Jo(n,e){if(typeof CSSStyleSheet!="function"||!("adoptedStyleSheets"in e))return null;try{let t=new CSSStyleSheet;return t.replaceSync(n),t}catch{return null}}var D={commentAriaLabelPrefix:"Comment: ",anonymous:"Anonymous",justNow:"Just now",minutesAgoTemplate:"{n}m",hoursAgoTemplate:"{n}h",daysAgoTemplate:"{n}d",toolbarComment:"Comment",toolbarInbox:"Inbox",modifierAlt:"Alt",modifierCtrl:"Ctrl",modifierShift:"Shift",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",inboxEmptyTitle:"No comments yet",inboxEmptyHintTemplate:"Press {n} and click anywhere on the page to start.",inboxEmptyAction:"Turn on comment mode",inboxNoMatches:"No comments match these filters",orphanedBadge:"Unanchored",hiddenBadge:"Hidden",filterAll:"All pages",filterCurrentPage:"Current page",filterTitle:"Filter",filterClear:"Clear",filterByPage:"Page",filterByStatus:"Status",back:"Back",deleteComment:"Delete",deleteReply:"Delete reply",replyOptions:"Reply options",editComment:"Edit",editReply:"Edit reply",copyLink:"Copy link",linkCopied:"Link copied",editorAriaLabel:"Edit text",editSave:"Save",editCancel:"Cancel",editedMark:"edited",editedAtPrefix:"Edited ",confirmDiscardTitle:"Discard changes?",confirmDiscardMessage:"The changes you made to this text have not been saved and will be lost.",confirmDiscard:"Discard",confirmKeepEditing:"Keep editing",commentNotFound:"That comment is not on this page.",confirmDelete:"Delete",confirmCancel:"Cancel",confirmDeleteCommentTitle:"Delete this comment?",confirmDeleteCommentMessage:"This comment will be permanently deleted. This action cannot be undone.",confirmDeleteThreadMessage:"This comment and all of its replies will be permanently deleted. This action cannot be undone.",confirmDeleteReplyTitle:"Delete this reply?",confirmDeleteReplyMessage:"This reply will be permanently deleted. This action cannot be undone.",copyAgentContext:"Copy agent context",copied:"Copied",statusLabel:"Status",prevComment:"Previous comment",nextComment:"Next comment",replyLink:"Reply",replyCountOne:"1 reply",replyCountTemplate:"{n} replies",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",filterByType:"Type",filterByPriority:"Priority",contextSection:"Context",autoScreenshotLabel:"Automatic context",contextUrl:"URL",contextViewport:"Viewport",contextScreen:"Screen",contextBrowser:"Browser",contextOs:"OS"};var qt={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",modifierShift:"May\xFAs",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",inboxEmptyTitle:"Todav\xEDa no hay comentarios",inboxEmptyHintTemplate:"Pulsa {n} y haz clic en cualquier parte de la p\xE1gina para empezar.",inboxEmptyAction:"Activar modo",inboxNoMatches:"Ning\xFAn comentario coincide con estos filtros",orphanedBadge:"Desanclado",hiddenBadge:"Oculto",filterAll:"Todas las p\xE1ginas",filterCurrentPage:"P\xE1gina actual",filterTitle:"Filtrar",filterClear:"Limpiar",filterByPage:"P\xE1gina",filterByStatus:"Estado",back:"Volver",deleteComment:"Eliminar",deleteReply:"Eliminar respuesta",replyOptions:"Opciones de la respuesta",editComment:"Editar",editReply:"Editar respuesta",copyLink:"Copiar enlace",linkCopied:"Enlace copiado",editorAriaLabel:"Editar texto",editSave:"Guardar",editCancel:"Cancelar",editedMark:"editado",editedAtPrefix:"Editado el ",confirmDiscardTitle:"\xBFDescartar los cambios?",confirmDiscardMessage:"Los cambios que hiciste en este texto no se han guardado y se perder\xE1n.",confirmDiscard:"Descartar",confirmKeepEditing:"Seguir editando",commentNotFound:"Ese comentario no est\xE1 en esta p\xE1gina.",confirmDelete:"Eliminar",confirmCancel:"Cancelar",confirmDeleteCommentTitle:"\xBFEliminar comentario?",confirmDeleteCommentMessage:"Este comentario se eliminar\xE1 de forma permanente. Esta acci\xF3n no se puede deshacer.",confirmDeleteThreadMessage:"Este comentario y todas sus respuestas se eliminar\xE1n de forma permanente. Esta acci\xF3n no se puede deshacer.",confirmDeleteReplyTitle:"\xBFEliminar respuesta?",confirmDeleteReplyMessage:"Esta respuesta se eliminar\xE1 de forma permanente. Esta acci\xF3n no se puede deshacer.",copyAgentContext:"Copiar contexto de agente",copied:"Copiado",statusLabel:"Estado",prevComment:"Comentario anterior",nextComment:"Comentario siguiente",replyLink:"Responder",replyCountOne:"1 respuesta",replyCountTemplate:"{n} respuestas",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",filterByType:"Tipo",filterByPriority:"Prioridad",contextSection:"Contexto",autoScreenshotLabel:"Contexto autom\xE1tico",contextUrl:"URL",contextViewport:"Viewport",contextScreen:"Pantalla",contextBrowser:"Navegador",contextOs:"SO"};var Te={en:D,es:qt},re="en";function Kt(){let n=(navigator.language||re).slice(0,2).toLowerCase();return n in Te?n:re}function Zt(n){let e=Te[n];return!e||n===re?Te[re]:{...Te[re],...e}}function v(n,e){return n.replace("{n}",String(e))}var Qo=6e4;function xe(n,e){if(!Number.isFinite(n)||n<0)return"";let t=Math.floor(n/Qo);if(t<1)return e.durationLessThanMinute;if(t<60)return v(e.minutesAgoTemplate,t);let o=Math.floor(t/60);if(o<24){let l=t%60,c=v(e.hoursAgoTemplate,o);return l?`${c} ${v(e.minutesAgoTemplate,l)}`:c}let r=Math.floor(o/24),i=o%24,a=v(e.daysAgoTemplate,r);return i?`${a} ${v(e.hoursAgoTemplate,i)}`:a}var Ke=64,ei=3,ti=5,ni=.6,oi=.7,ii=/^(css|sc|jsx|emotion)-/i,ri=/^data-(reactid|react-|v-|svelte-)/,si=["id","name","role","aria-label"],ai=["data-testid","name","aria-label"],Ze=n=>typeof CSS<"u"&&CSS.escape?CSS.escape(n):String(n).replace(/[^a-zA-Z0-9_-]/g,"\\$&"),li=n=>String(n).replace(/["\\]/g,"\\$&"),se=(n,e)=>{try{return e.querySelectorAll(n).length===1}catch{return!1}},en=n=>(n||"").replace(/\s+/g," ").trim().slice(0,Ke),ci=n=>Xt.includes(n)||ii.test(n)?!1:!n.split(/[-_]/).some(e=>e.length>=5&&/\d/.test(e)),di=n=>[...n.classList].filter(ci),hi=n=>{let e={};for(let{name:t,value:o}of n.attributes)(si.includes(t)||t.startsWith("data-")&&!ri.test(t))&&o&&(e[t]=o.slice(0,Ke));return e},Je=n=>{let e=n.parentElement;if(!e)return{index:0,count:1};let t=[...e.children].filter(o=>o.tagName===n.tagName);return{index:t.indexOf(n),count:t.length}},pi=(n,e)=>{if(!n.id)return null;let t=`#${Ze(n.id)}`;return se(t,e)?t:null},ui=(n,e)=>{let t=n.tagName.toLowerCase();for(let o of ai){let r=n.getAttribute(o);if(!r)continue;let i=`${t}[${o}="${li(r)}"]`;if(se(i,e))return i}return null},mi=(n,e)=>{let t=[],o=n;for(let r=0;r<ei&&o;r++){let i=di(o),a=o.tagName.toLowerCase();if(t.unshift(i.length?`${a}.${i.map(Ze).join(".")}`:a),r===0&&!i.length)return null;let l=t.join(" > ");if(se(l,e))return l;o=o.parentElement}return null},fi=(n,e)=>{if(n===e.body)return"body";let t=[],o=n;for(let i=0;i<ti&&o;i++){if(o===e.body){t.unshift("body");break}if(o.id){let l=[`#${Ze(o.id)}`,...t].join(" > ");if(se(l,e))return l}let{index:a}=Je(o);t.unshift(`${o.tagName.toLowerCase()}:nth-of-type(${a+1})`),o=o.parentElement}let r=t.join(" > ");return se(r,e)?r:null},tn=(n,e)=>pi(n,e)||ui(n,e)||mi(n,e)||fi(n,e);function nn(n){return tn(n,n.ownerDocument)}function on(n,e,t){let o=n.ownerDocument,{index:r,count:i}=Je(n);return{version:1,selector:tn(n,o),fingerprint:{tagName:n.tagName,textSnippet:en(n.textContent),attributes:hi(n),siblingIndex:r,siblingCount:i},relativeX:e,relativeY:t}}var gi=(n,e)=>{if(!n&&!e)return 1;if(!n||!e)return 0;if(n===e)return 1;if(n.startsWith(e)||e.startsWith(n))return .8;let t=new Set(n.split(" ")),o=new Set(e.split(" ")),r=0;for(let i of t)o.has(i)&&r++;return 2*r/(t.size+o.size)},Ei=(n,e)=>{let t=Object.keys(e);if(!t.length)return 1;let o=0;for(let r of t)(n.getAttribute(r)||"").slice(0,Ke)===e[r]&&o++;return o/t.length},Jt=(n,e)=>{let{index:t,count:o}=Je(n),r=Math.abs(t-e.siblingIndex),i=Math.max(e.siblingCount,o,1);return Math.max(0,1-r/i)},bi=(n,e)=>{if(n.tagName!==e.tagName)return 0;let t=!!e.textSnippet,o=Object.keys(e.attributes||{}).length>0,r=.5,i=.3,a=.2;return o?t||(i+=r,r=0):(r+=i,i=0),!t&&!o?Jt(n,e):r*gi(en(n.textContent),e.textSnippet)+i*Ei(n,e.attributes||{})+a*Jt(n,e)},Qt=(n,e)=>{let t=null;for(let o of n){let r=bi(o,e);(!t||r>t.confidence)&&(t={element:o,confidence:r})}return t};function Qe(n,e=document){if(n?.version!=null&&n.version>1)return null;let t=n?.fingerprint;if(!t||!t.tagName)return null;if(n.selector){let a=[];try{a=[...e.querySelectorAll(n.selector)]}catch{}let l=Qt(a,t);if(l&&l.confidence>=ni)return l}if(!(!!t.textSnippet||Object.keys(t.attributes||{}).length>0))return null;let r;try{r=[...e.querySelectorAll(t.tagName)]}catch{return null}let i=Qt(r,t);return i&&i.confidence>=oi?i:null}var ye="helldots-comments",Se="helldots-pending-detail";function et(){try{let n=localStorage.getItem(ye);if(!n)return[];let e=JSON.parse(n);return Array.isArray(e)?e:[]}catch(n){return console.warn("HellDots: could not read stored comments",n),[]}}function rn(n){try{return localStorage.setItem(ye,JSON.stringify(n)),!0}catch{return!1}}function we(n){if(rn(n))return!0;let e=n.map((r,i)=>({comment:r,index:i})).filter(({comment:r})=>r?.contextScreenshot).sort((r,i)=>{let a=Date.parse(r.comment.createdAt),l=Date.parse(i.comment.createdAt);return Number.isFinite(a)&&Number.isFinite(l)&&a!==l?a-l: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 t=[...n],o=0;for(let{index:r}of e)if(t[r]={...t[r],contextScreenshot:null},o++,rn(t))return console.warn(`HellDots: localStorage quota exceeded \u2014 dropped the automatic context screenshot from the ${o} 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 ${o} automatic context screenshot(s); storage quota exceeded`),!1}function tt(n,e,t){let o=new Set(e.map(i=>String(i.id)));return[...n.filter(i=>!o.has(String(i.id))&&i.page!==t),...e]}var sn="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var an=(n=21)=>{let e="",t=crypto.getRandomValues(new Uint8Array(n|=0));for(;n--;)e+=sn[t[n]&63];return e};var nt=()=>an(),w=(n,e)=>String(n)===String(e);var Oe="helldotsComment",V=(n,e=Oe,t=location.href)=>{let o=new URL(t),r=n.page||o.pathname,i=r===o.pathname?o:new URL(r,o);return i.searchParams.set(e,String(n.id)),i.href},ln=(n=Oe,e=location.href)=>{try{return new URL(e).searchParams.get(n)}catch{return null}};var z=new Set,G=null,Ae=null,Ci=n=>[...n.querySelectorAll('[role="menuitem"], [role="menuitemradio"]')],cn=4,_i=n=>{for(let e=n.parentElement;e;e=e.parentElement){let{overflowX:t,overflowY:o}=getComputedStyle(e);if(t!=="visible"||o!=="visible")return e.getBoundingClientRect()}return null},Ti=(n,e)=>{e.classList.remove(s.INBOX_MENU_UP);let t=_i(e),o=Math.min(t?.bottom??1/0,window.innerHeight),r=Math.max(t?.top??0,0),{height:i}=e.getBoundingClientRect(),a=n.getBoundingClientRect(),l=a.bottom+cn+i,c=a.top-cn-i;l>o&&c>=r&&e.classList.add(s.INBOX_MENU_UP)},dn=(n,e)=>(typeof e.composedPath=="function"?e.composedPath():[]).includes(n)||n.contains(e.target),xi=()=>{G||(G=n=>{for(let e of[...z])dn(e.menu,n)||dn(e.button,n)||e.close()},document.addEventListener("mousedown",G,!0),Ae=n=>{let e=[...z].pop();if(e){if(n.key==="Escape"){n.preventDefault(),n.stopPropagation(),e.close(),e.button.focus();return}if(["ArrowDown","ArrowUp","Home","End"].includes(n.key)){let t=Ci(e.menu);if(t.length===0)return;n.preventDefault(),n.stopPropagation();let o=e.menu.getRootNode(),r=t.indexOf(o.activeElement),i;if(n.key==="Home")i=0;else if(n.key==="End")i=t.length-1;else if(r===-1)i=n.key==="ArrowDown"?0:t.length-1;else{let a=n.key==="ArrowDown"?1:-1;i=(r+a+t.length)%t.length}t[i].focus()}}},document.addEventListener("keydown",Ae,!0))},yi=()=>{G&&(document.removeEventListener("mousedown",G,!0),G=null,document.removeEventListener("keydown",Ae,!0),Ae=null)},ve=()=>{for(let n of[...z])n.close()},ae=(n,e)=>{let t={button:n,menu:e,close:()=>{e.style.display="none",n.setAttribute("aria-expanded","false"),z.delete(t),z.size===0&&yi()}},o=()=>{ve(),e.style.display="block",Ti(n,e),n.setAttribute("aria-expanded","true"),z.add(t),xi()},r=()=>e.style.display!=="none";return e.style.display="none",n.setAttribute("aria-expanded","false"),n.addEventListener("click",i=>{i.stopPropagation();let a=r();ve(),a||o()}),{open:o,close:t.close,isOpen:r}};var ot=new Set,hn=()=>{for(let n of[...ot])n(!1)},Ne=(n,{title:e,message:t,confirmLabel:o,cancelLabel:r})=>new Promise(i=>{let a=document.createElement("div");a.className=s.CONFIRM,a.style.zIndex=String(O.CONFIRM);let l=document.createElement("div");l.className=s.CONFIRM_PANEL,l.setAttribute("role","alertdialog"),l.setAttribute("aria-modal","true");let c=document.createElement("h2");c.className=s.CONFIRM_TITLE,c.textContent=e,c.id=`hd-confirm-title-${Math.random().toString(36).slice(2,9)}`,l.setAttribute("aria-labelledby",c.id);let d=document.createElement("p");d.className=s.CONFIRM_MESSAGE,d.textContent=t,d.id=`hd-confirm-message-${Math.random().toString(36).slice(2,9)}`,l.setAttribute("aria-describedby",d.id);let h=document.createElement("div");h.className=s.CONFIRM_ACTIONS;let p=document.createElement("button");p.type="button",p.className=s.CONFIRM_CANCEL,p.textContent=r;let m=document.createElement("button");m.type="button",m.className=s.CONFIRM_ACCEPT,m.textContent=o,h.appendChild(p),h.appendChild(m),l.appendChild(c),l.appendChild(d),l.appendChild(h),a.appendChild(l);let u=n.activeElement||document.activeElement,f=!1,g=_=>{f||(f=!0,ot.delete(g),document.removeEventListener("keydown",E,!0),a.remove(),u?.focus?.(),i(_))},E=_=>{if(_.key==="Escape"){_.stopPropagation(),_.preventDefault(),g(!1);return}if(_.key!=="Tab")return;let y=[p,m],C=n.activeElement||document.activeElement,x=y.indexOf(C);_.preventDefault(),(_.shiftKey?y[(x<=0?y.length:x)-1]:y[(x+1)%y.length]).focus()};p.addEventListener("click",()=>g(!1)),m.addEventListener("click",()=>g(!0));let b=!1;a.addEventListener("mousedown",_=>{b=_.target===a,_.stopPropagation()}),a.addEventListener("click",_=>{_.target===a&&b&&g(!1),b=!1}),ot.add(g),document.addEventListener("keydown",E,!0),(n.body||n).appendChild(a),p.focus()});var pn='<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>',Si='<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>',wi='<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>',W=n=>{if(navigator.clipboard?.writeText)return navigator.clipboard.writeText(n).catch(()=>{});let e=document.createElement("textarea");e.value=n,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select();try{document.execCommand("copy")}catch{}return e.remove(),Promise.resolve()},j=(n,e)=>({open:e.statusOpen,in_progress:e.statusInProgress,resolved:e.statusResolved})[n]||e.statusOpen,$=(n,e)=>({bug:e.typeBug,suggestion:e.typeSuggestion,question:e.typeQuestion,improvement:e.typeImprovement})[n]||e.unset,H=(n,e)=>({high:e.priorityHigh,medium:e.priorityMedium,low:e.priorityLow})[n]||e.unset,Y=({action:n,options:e,value:t,colorOf:o,labelOf:r,tooltipLabel:i,onSelect:a,showLabel:l=!1})=>{let c=document.createElement("div");c.style.position="relative";let d=document.createElement("button");d.type="button",d.className=s.INBOX_ACTION_BTN,l&&d.classList.add(s.INBOX_ACTION_BTN_LABELED),d.dataset.action=n,d.setAttribute("aria-haspopup","true");let h=document.createElement("span");h.className=s.INBOX_STATUS_DOT,d.appendChild(h);let p=null;l&&(p=document.createElement("span"),p.className=s.INBOX_ACTION_LABEL,d.appendChild(p));let m=document.createElement("div");m.className=s.INBOX_MENU,m.setAttribute("role","menu");let u=ae(d,m),f=t,g=()=>{let E=`${i}: ${r(f)}`;h.style.backgroundColor=o(f),d.dataset.hdTooltip=E,d.setAttribute("aria-label",E),p&&(p.textContent=r(f)),m.querySelectorAll("[data-picker-option]").forEach(b=>{let T=b.dataset.pickerOption,_=T===""?null:T;b.setAttribute("aria-checked",String(_===f))})};for(let E of e){let b=document.createElement("button");b.type="button",b.className=s.INBOX_MENU_ITEM,b.dataset.pickerOption=E===null?"":E,b.setAttribute("role","menuitemradio");let T=document.createElement("span");T.className=s.INBOX_STATUS_DOT,T.style.backgroundColor=o(E),b.appendChild(T),b.appendChild(document.createTextNode(r(E))),b.addEventListener("click",_=>{_.stopPropagation(),u.close(),E!==f&&(f=E,a(E),g())}),m.appendChild(b)}return c.appendChild(d),c.appendChild(m),g(),c},it=({label:n,tooltip:e,items:t})=>{let o=document.createElement("div");o.style.position="relative";let r=document.createElement("button");r.type="button",r.className=s.INBOX_ACTION_BTN,r.dataset.action="menu",e&&(r.dataset.hdTooltip=e),r.setAttribute("aria-label",n),r.innerHTML=wi;let i=document.createElement("div");i.className=s.INBOX_MENU,i.setAttribute("role","menu");let a=ae(r,i);for(let l of t){let c=document.createElement("button");c.type="button",c.className=s.INBOX_MENU_ITEM,c.setAttribute("role","menuitem"),c.textContent=l.label,c.addEventListener("click",async d=>{if(d.stopPropagation(),l.feedbackLabel){l.onSelect(),c.textContent=l.feedbackLabel,setTimeout(()=>{c.textContent=l.label,a.close()},1200);return}if(a.close(),l.confirm){let h=c.getRootNode();if(!await Ne(h,l.confirm()))return}l.onSelect()}),i.appendChild(c)}return o.appendChild(r),o.appendChild(i),o},Re=(n,{strings:e,onCopy:t,onCopyLink:o,onEdit:r,onSetStatus:i,onSetType:a,onSetPriority:l,onDelete:c})=>{let d=document.createElement("div");d.className=s.INBOX_CARD_ACTIONS;let h=document.createElement("button");return h.type="button",h.className=s.INBOX_ACTION_BTN,h.dataset.action="copy",h.dataset.hdTooltip=e.copyAgentContext,h.setAttribute("aria-label",e.copyAgentContext),h.innerHTML=pn,h.addEventListener("click",p=>{p.stopPropagation(),t(n),h.innerHTML=Si,h.dataset.hdTooltip=e.copied,setTimeout(()=>{h.innerHTML=pn,h.dataset.hdTooltip=e.copyAgentContext},1500)}),d.appendChild(h),d.appendChild(Y({action:"status",options:P,value:n.status||"open",colorOf:p=>be[p]||"",labelOf:p=>j(p,e),tooltipLabel:e.statusLabel,onSelect:p=>i(n,p),showLabel:!0})),d.appendChild(Y({action:"type",options:[null,...L],value:n.type||null,colorOf:p=>oe[p]||"transparent",labelOf:p=>$(p,e),tooltipLabel:e.typeLabel,onSelect:p=>a?.(n,p),showLabel:!0})),d.appendChild(Y({action:"priority",options:[null,...B],value:n.priority||null,colorOf:p=>ie[p]||"transparent",labelOf:p=>H(p,e),tooltipLabel:e.priorityLabel,onSelect:p=>l?.(n,p),showLabel:!0})),d.appendChild(it({label:e.commentOptions,tooltip:e.moreOptions,items:[{label:e.copyLink,feedbackLabel:e.linkCopied,onSelect:()=>o?.(n)},{label:e.editComment,onSelect:()=>r?.(n)},{label:e.deleteComment,onSelect:()=>c(n),confirm:()=>({title:e.confirmDeleteCommentTitle,message:n.replies?.length?e.confirmDeleteThreadMessage:e.confirmDeleteCommentMessage,confirmLabel:e.confirmDelete,cancelLabel:e.confirmCancel})}]})),d};var q=({value:n,strings:e,onInput:t,onSave:o,onCancel:r})=>{let i=document.createElement("div");i.className=s.EDITOR;let a=document.createElement("textarea");a.className=s.EDITOR_INPUT,a.value=n,a.rows=3,a.setAttribute("aria-label",e.editorAriaLabel);let l=document.createElement("div");l.className=s.EDITOR_ACTIONS;let c=document.createElement("button");c.type="button",c.className=s.EDITOR_CANCEL,c.textContent=e.editCancel;let d=document.createElement("button");d.type="button",d.className=s.EDITOR_SAVE,d.textContent=e.editSave;let h=()=>{d.disabled=a.value.trim().length===0};return h(),a.addEventListener("input",()=>{h(),t(a.value)}),a.addEventListener("keydown",p=>{if(p.key==="Escape"){p.stopPropagation(),p.preventDefault(),r();return}p.key==="Enter"&&(p.metaKey||p.ctrlKey)&&!d.disabled&&(p.preventDefault(),o(a.value))}),c.addEventListener("click",p=>{p.stopPropagation(),r()}),d.addEventListener("click",p=>{p.stopPropagation(),d.disabled||o(a.value)}),l.appendChild(c),l.appendChild(d),i.appendChild(a),i.appendChild(l),queueMicrotask(()=>{a.focus(),a.setSelectionRange(a.value.length,a.value.length)}),i},Ie=(n,e)=>Ne(n,{title:e.confirmDiscardTitle,message:e.confirmDiscardMessage,confirmLabel:e.confirmDiscard,cancelLabel:e.confirmKeepEditing});var Oi=(n,e)=>{let t=Date.now()-new Date(n).getTime(),o=Math.floor(t/6e4),r=Math.floor(t/36e5),i=Math.floor(t/864e5);return o<1?e.justNow:o<60?v(e.minutesAgoTemplate,o):r<24?v(e.hoursAgoTemplate,r):v(e.daysAgoTemplate,i)},mn=(n,e)=>new Intl.DateTimeFormat(e,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}).format(new Date(n)),le=(n,e,t,o,r=null)=>{let i=document.createElement("div");i.className=s.THREAD_META;let a=document.createElement("span");a.className=s.THREAD_AUTHOR,a.textContent=n||t.anonymous;let l=document.createElement("span");return l.className=s.THREAD_TIME,l.textContent=Oi(e,t),l.dataset.fullDate=mn(e,o),i.appendChild(a),i.appendChild(l),r&&i.appendChild(rt(r,t,o)),i},rt=(n,e,t)=>{let o=document.createElement("span");return o.className=s.THREAD_EDITED,o.textContent=e.editedMark,o.dataset.fullDate=e.editedAtPrefix+mn(n,t),o},st=()=>/Mac|iPod|iPhone|iPad/.test(navigator.userAgent),at=(n,e)=>{let t=st(),o={alt:t?"\u2325":e.modifierAlt,ctrl:t?"\u2318":e.modifierCtrl,shift:t?"\u21E7":e.modifierShift},r=o[n.shortcutModifier]||o.alt,i=n.shortcutKey?.toUpperCase()||"C";return`${r} + ${i}`},Le='<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>',Ai='<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>',vi='<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>',Ni='<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>',Ri='<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>',Be=({areaClassName:n,inputTag:e="textarea",inputClassName:t,inputId:o,inputPlaceholder:r,submitBtnId:i,fileInputId:a},l)=>{let c=document.createElement("div");c.className=n;let d=document.createElement(e);o&&(d.id=o),t&&(d.className=t),d.placeholder=r,d.setAttribute("aria-label",r),e==="input"&&(d.type="text");let h=document.createElement("div");h.className=s.SCREENSHOTS_CONTAINER;let p=document.createElement("div");p.className=s.COMMENT_ACTIONS_BAR;let m=document.createElement("button");m.className=s.ATTACH_IMAGE_BTN,m.type="button",m.setAttribute("aria-label",l.attachImage),m.innerHTML=Ai;let u=document.createElement("input");u.type="file",a&&(u.id=a),u.accept="image/*",u.style.display="none";let f=document.createElement("button");return i&&(f.id=i),f.className=s.THREAD_SUBMIT,f.type="button",f.setAttribute("aria-label",l.send),f.innerHTML=vi,p.appendChild(m),p.appendChild(u),p.appendChild(f),c.appendChild(d),c.appendChild(h),c.appendChild(p),{container:c,inputEl:d,screenshotsContainer:h,attachBtn:m,fileInput:u,submitBtn:f}},un=(n,e,t,o)=>{let r=document.createElement("div");r.className=s.TOOLBAR_ACTION_WRAPPER;let i=document.createElement("div");i.className=s.TOOLBAR_ACTION_TOOLTIP,t.forEach(l=>i.appendChild(l));let a=document.createElement("button");return a.type="button",a.className=`${s.TOOLBAR_ACTION_BTN} ${n}`,a.setAttribute("aria-label",o),a.innerHTML=e,r.appendChild(i),r.appendChild(a),r},fn=(n={},e=D)=>{let t=document.createElement("div");t.id=S.TOOLBAR;let o=document.createElement("div");o.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=at(n,e);let a=un(s.TOOLBAR_COMMENT_BTN,Ni,[r,i],e.toolbarComment);a.querySelector(`.${s.TOOLBAR_COMMENT_BTN}`)?.setAttribute("aria-pressed","false");let l=document.createElement("span");l.className=s.TOOLBAR_TEXT,l.textContent=e.toolbarInbox;let c=un(s.TOOLBAR_MENU_BTN,Ri,[l],e.toolbarInbox);return o.appendChild(a),o.appendChild(c),t.appendChild(o),t},lt=(n,e,{includeStatus:t=!1,includeClassification:o=!0}={})=>{let r=document.createElement("div");r.className=s.INBOX_BADGES;let i=(a,l,c)=>{let d=document.createElement("span");d.className=`${s.BADGE} ${l}`,d.textContent=a,c&&(d.style.borderColor=c),r.appendChild(d)};if(t){let a=n.status||"open";i(j(a,e),s.BADGE_STATUS,be[a])}o&&n.type&&i($(n.type,e),s.BADGE_TYPE,oe[n.type]),o&&n.priority&&i(H(n.priority,e),s.BADGE_PRIORITY,ie[n.priority]);for(let a of n.tags||[])i(a,s.BADGE_TAG,null);if(n.status==="resolved"){let a=n.resolvedAt?xe(new Date(n.resolvedAt).getTime()-new Date(n.createdAt).getTime(),e):"";i(v(e.resolvedInTemplate,a||"\u2014"),s.BADGE_DURATION,null)}return r.children.length?r:null},Ii=n=>{let e=document.createElement("div");e.className=s.CLASSIFY_ROW;let t=null,o=null,r=()=>{e.replaceChildren(),e.appendChild(Y({action:"type",options:[null,...L],value:null,colorOf:i=>oe[i]||"transparent",labelOf:i=>$(i,n),tooltipLabel:n.typeLabel,onSelect:i=>t=i,showLabel:!0})),e.appendChild(Y({action:"priority",options:[null,...B],value:null,colorOf:i=>ie[i]||"transparent",labelOf:i=>H(i,n),tooltipLabel:n.priorityLabel,onSelect:i=>o=i,showLabel:!0}))};return r(),{container:e,getType:()=>t,getPriority:()=>o,reset:()=>{t=null,o=null,r()}}},gn=(n=D)=>{let e=document.createElement("div");e.id=S.COMMENT_BOX,e.setAttribute("role","dialog"),e.setAttribute("aria-label",n.commentBoxAriaLabel);let{container:t}=Be({areaClassName:s.COMMENT_INPUT_AREA,inputTag:"textarea",inputId:S.COMMENT_INPUT,inputPlaceholder:n.commentPlaceholder,submitBtnId:S.SUBMIT_COMMENT,fileInputId:S.ATTACH_IMAGE_INPUT},n),o=Ii(n);return e.appendChild(o.container),e.appendChild(t),e.style.display="none",e.classify=o,e},F=n=>String(n).replace(/[\\"]/g,"\\$&"),En=n=>`[data-comment-id="${F(n)}"]`,ct=n=>n.screenshots||(n.screenshot?[n.screenshot]:[]),K=(n,e,{strings:t,onShow:o,rerender:r})=>{n.innerHTML="",n.classList.toggle(s.ACTIVE,e.length>0),e.forEach((i,a)=>{let l=document.createElement("div");l.className=s.SCREENSHOT_ITEM;let c=document.createElement("img");c.className=s.SCREENSHOT_IMG,c.src=i,c.alt=t.attachedScreenshot,bn(c,()=>o(i));let d=document.createElement("button");d.type="button",d.className=s.SCREENSHOT_REMOVE,d.setAttribute("aria-label",t.removeScreenshot),d.innerHTML="&times;",d.onclick=h=>{h.stopPropagation(),e.splice(a,1),r()},l.appendChild(c),l.appendChild(d),n.appendChild(l)})},Z=(n,e,t)=>{n.addEventListener("change",o=>{let r=o.target.files[0];if(!r||r.type&&!r.type.startsWith("image/"))return;let i=e();if(i.length>=Ee)return;let a=new FileReader;a.onload=l=>{i.push(l.target.result),t()},a.readAsDataURL(r),n.value=""})},I=(n,e)=>{n.querySelectorAll(`.${s.SCREENSHOT_IMG}`).forEach(t=>{bn(t,()=>e(t.src))})},bn=(n,e)=>{n.setAttribute("role","button"),n.setAttribute("tabindex","0"),n.addEventListener("click",t=>{t.stopPropagation(),e()}),n.addEventListener("keydown",t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),e())})},Cn=(n,e=D)=>{let t=document.createElement("div");return t.className=s.CIRCLE,t.dataset.commentId=n.id,t.setAttribute("role","button"),t.setAttribute("tabindex","0"),t.setAttribute("aria-label",`${e.commentAriaLabelPrefix}${n.text}`),t.style.cssText=`
50
19
  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
20
  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; }
21
+ `,t},ce=(n,e)=>{let t=document.createElement("div");return t.className=s.SCREENSHOTS_CONTAINER,t.classList.add(s.ACTIVE),n.forEach(o=>{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=e.attachedScreenshot,r.appendChild(i),t.appendChild(r)}),t},_n=(n,e=D,t)=>{let o=document.createElement("div");o.className=s.TOOLTIP,o.dataset.for=n.id,o.setAttribute("role","dialog"),o.setAttribute("aria-label",e.tooltipAriaLabel);let r=document.createElement("div");r.className=s.THREAD_HEADER;let i=le(n.author,n.createdAt,e,t,n.editedAt),a=document.createElement("button");a.type="button",a.className=s.CLOSE_TOOLTIP,a.setAttribute("aria-label",e.close),a.innerHTML="&times;",r.appendChild(i),r.appendChild(a);let l=document.createElement("div");l.className=s.THREAD_BODY,l.textContent=n.text,o.appendChild(r),o.appendChild(l);let c=lt(n,e,{includeStatus:!0});c&&o.appendChild(c);let d=ct(n);d.length>0&&o.appendChild(ce(d,e));let h=n.replies?.length||0;if(h>0){let p=document.createElement("div");p.className=s.TOOLTIP_REPLY_COUNT,p.textContent=h===1?e.replyCountOne:v(e.replyCountTemplate,h),o.appendChild(p)}return o},de=(n,e=D,t,{onDelete:o,onEdit:r,editing:i=null}={})=>{let a=document.createElement("div");a.className=s.THREAD_REPLY,a.dataset.replyId=String(n.id);let l=le(n.author,n.timestamp,e,t,n.editedAt),c=[];if(r&&c.push({label:e.editReply,onSelect:()=>r(n)}),o&&c.push({label:e.deleteReply,onSelect:()=>o(n,a),confirm:()=>({title:e.confirmDeleteReplyTitle,message:e.confirmDeleteReplyMessage,confirmLabel:e.confirmDelete,cancelLabel:e.confirmCancel})}),c.length>0){let p=it({label:e.replyOptions,items:c});p.classList.add(s.THREAD_REPLY_ACTIONS),l.appendChild(p)}let d;i?d=q({value:i.draft,strings:e,onInput:i.onInput,onSave:i.onSave,onCancel:i.onCancel}):(d=document.createElement("div"),d.className=s.THREAD_BODY,d.textContent=n.text),a.appendChild(l),a.appendChild(d);let h=ct(n);return h.length>0&&a.appendChild(ce(h,e)),a},Tn=(n,e=D,t,{onDeleteReply:o,onEditReply:r}={})=>{let i=document.createElement("div");i.className=s.THREAD_POPOVER,i.dataset.for=n.id,i.setAttribute("role","dialog"),i.setAttribute("aria-label",e.popoverAriaLabel);let a=document.createElement("div");a.className=s.THREAD_HEADER;let l=le(n.author,n.createdAt,e,t,n.editedAt),c=document.createElement("button");c.type="button",c.className=s.CLOSE_TOOLTIP,c.setAttribute("aria-label",e.close),c.innerHTML="&times;",a.appendChild(l),a.appendChild(c);let d=document.createElement("div");d.className=s.THREAD_BODY,d.textContent=n.text;let h=document.createElement("div");h.className=s.THREAD_REPLIES,n.replies&&n.replies.forEach(f=>{h.appendChild(de(f,e,t,{onDelete:o,onEdit:r}))});let{container:p}=Be({areaClassName:s.THREAD_INPUT_AREA,inputTag:"input",inputClassName:s.THREAD_INPUT,inputPlaceholder:e.replyPlaceholder},e),m=document.createElement("div");m.className=s.THREAD_SCROLL,i.appendChild(a),m.appendChild(d);let u=ct(n);return u.length>0&&m.appendChild(ce(u,e)),m.appendChild(h),i.appendChild(m),i.appendChild(p),i};var De=(n,{strings:e,onShowLightbox:t,collapsible:o=!1,expanded:r=!1,onToggle:i})=>{let{context:a,contextScreenshot:l}=n;if(!a&&!l)return null;let c=document.createElement("div");c.className=s.CONTEXT_BLOCK;let d=document.createElement("div");if(d.className=s.CONTEXT_BODY,o){let h=document.createElement("button");h.type="button",h.className=s.CONTEXT_TOGGLE,h.setAttribute("aria-expanded",String(r)),h.innerHTML=`<span>${e.contextSection}</span>${Le}`,d.style.display=r?"":"none",h.addEventListener("click",p=>{p.stopPropagation();let m=h.getAttribute("aria-expanded")==="true";h.setAttribute("aria-expanded",String(!m)),d.style.display=m?"none":"",i?.(!m)}),c.appendChild(h)}else{let h=document.createElement("div");h.className=s.CONTEXT_TITLE,h.textContent=e.contextSection,c.appendChild(h)}if(l){let h=document.createElement("div");h.className=s.CONTEXT_SCREENSHOT_CAPTION,h.textContent=e.autoScreenshotLabel,d.appendChild(h);let p=document.createElement("img");p.className=s.SCREENSHOT_IMG,p.src=l,p.alt=e.autoScreenshotLabel,d.appendChild(p),I(d,t)}if(a){let h=(u,f)=>{if(!f)return;let g=document.createElement("div");g.className=s.CONTEXT_ROW;let E=document.createElement("span");E.textContent=u;let b=document.createElement("span");b.textContent=f,g.appendChild(E),g.appendChild(b),d.appendChild(g)},p=u=>u?`${u.width}\xD7${u.height}`:"",m=u=>u?.name?`${u.name} ${u.version||""}`.trim():"";h(e.contextUrl,a.url),h(e.contextViewport,p(a.viewport)),h(e.contextScreen,p(a.screen)),h(e.contextBrowser,m(a.browser)),h(e.contextOs,m(a.os))}return c.appendChild(d),c};var Li=n=>{let e=[...n.attributes].map(({name:t,value:o})=>`${t}="${o}"`).join(" ");return`<${n.tagName.toLowerCase()}${e?` ${e}`:""}>`},Bi=n=>{if(!n?.tagName)return"(unknown)";let e=Object.entries(n.attributes||{}).map(([t,o])=>`${t}="${o}"`).join(" ");return`<${n.tagName.toLowerCase()}${e?` ${e}`:""}>`},Di=n=>{let e=[],t=n;for(;t&&t!==document.documentElement;){let o=t.tagName.toLowerCase(),r=t.id?`#${t.id}`:"",i=[...t.classList].slice(0,2).map(a=>`.${a}`).join("");if(e.unshift(`${o}${r}${i}`),t===document.body)break;t=t.parentElement}return e.join(" > ")};function ke(n,{viewportWidth:e,viewportHeight:t,strings:o}){let r=n.anchor,i=r?.fingerprint,a=n.container?.isConnected?n.container:null,l=n.hidden?"hidden":n.anchorState,c=a?Li(a):Bi(i),d=a?Di(a):"(unavailable)",h=n.context?.viewport,p=h?.width??e,m=h?.height??t,u=[`Page: ${n.page}`,`Viewport: ${p}x${m}`,`Anchor state: ${l}`,`Status: ${n.status||"open"}`,`Selector: ${r?.selector||"(none)"}`,`Element: ${c}`,`DOM path: ${d}`,`Nearby text: "${i?.textSnippet??""}"`,`Comment by ${n.author} (${n.createdAt}):`,`"${n.text}"`];n.type&&u.push(`Type: ${n.type}`),n.priority&&u.push(`Priority: ${n.priority}`),n.tags?.length&&u.push(`Tags: ${n.tags.join(", ")}`);let f=n.context;if(f&&(f.url&&u.push(`URL: ${f.url}`),f.screen&&u.push(`Screen: ${f.screen.width}x${f.screen.height}`),f.browser?.name&&u.push(`Browser: ${`${f.browser.name} ${f.browser.version||""}`.trim()}`),f.os?.name&&u.push(`OS: ${`${f.os.name} ${f.os.version||""}`.trim()}`)),o&&n.status==="resolved"&&n.resolvedAt){let E=xe(new Date(n.resolvedAt).getTime()-new Date(n.createdAt).getTime(),o);E&&u.push(`Resolution time: ${E}`)}let g=n.replies||[];if(g.length>0){u.push(`Replies (${g.length}):`);for(let E of g)u.push(`- ${E.author}: "${E.text}"`)}return u.join(`
22
+ `)}var he=(n,e)=>{let t=e.getBoundingClientRect(),o=t.left+t.width/2,r=t.top+t.height/2,i=A,a=i/2+10,l=n.getBoundingClientRect(),c=l.width||400,d=o+a;d+c>window.innerWidth&&(d=o-a-c),d=Math.min(d,window.innerWidth-c-10),d=Math.max(10,d),n.style.left=`${d}px`;let h=10,p=r-i/2,m=window.innerHeight-h-p;l.height>m?(n.style.top="auto",n.style.bottom=`${h}px`):(n.style.bottom="auto",n.style.top=`${Math.max(h,p)}px`)},xn=n=>{let e=n.getBoundingClientRect(),t=Math.max(10,(window.innerWidth-(e.width||400))/2),o=Math.max(10,(window.innerHeight-e.height)/2);n.style.left=`${t}px`,n.style.bottom="auto",n.style.top=`${o}px`},Me=class{constructor(e){this.deps=e,this.active=null,this._activeCircle=null,this.editing=null,this._resizeObserver=null,this._clickHandler=null,this._armClickTimer=null}_bodyEl(e=null){let t=this.active;return t?e==null?t.querySelector(`.${s.THREAD_SCROLL} > .${s.THREAD_BODY}, .${s.THREAD_SCROLL} > .${s.EDITOR}`):t.querySelector(`.${s.THREAD_REPLY}[data-reply-id="${F(e)}"]`)?.querySelector(`.${s.THREAD_BODY}, .${s.EDITOR}`)||null:null}refreshCommentViews(e,t=null){if(this.active?.dataset.for!==String(e))return;let o=this.deps.findComment(e);if(!o)return;let r=t==null?o:(o.replies||[]).find(l=>w(l.id,t));if(!r)return;let i=document.createElement("div");i.className=s.THREAD_BODY,i.textContent=r.text,this._bodyEl(t)?.replaceWith(i);let a=t==null?this.active.querySelector(`.${s.THREAD_META}`):this.active.querySelector(`.${s.THREAD_REPLY}[data-reply-id="${F(t)}"]`)?.querySelector(`.${s.THREAD_META}`);if(a&&r.editedAt&&!a.querySelector(`.${s.THREAD_EDITED}`)){let l=rt(r.editedAt,this.deps.strings,this.deps.locale),c=a.querySelector(`.${s.THREAD_REPLY_ACTIONS}`);c?a.insertBefore(l,c):a.appendChild(l)}}isEditing(){return this.editing!=null}editorDirty(){if(!this.editing)return!1;let{commentId:e,replyId:t,draft:o}=this.editing,r=this.deps.findComment(e),i=t==null?r:(r?.replies||[]).find(a=>w(a.id,t));return o.trim()!==String(i?.text||"").trim()}async releaseEditor(){if(!this.editing)return!0;if(this.editorDirty()){let t=this.deps.shadowRoot;if(!await Ie(t,this.deps.strings))return!1}let{replyId:e}=this.editing;return this.editing=null,this._restoreBody(e),!0}_restoreBody(e){let t=this.deps.findComment(this.active?.dataset.for);if(!t)return;let o=e==null?t:(t.replies||[]).find(i=>w(i.id,e));if(!o)return;let r=document.createElement("div");r.className=s.THREAD_BODY,r.textContent=o.text,this._bodyEl(e)?.replaceWith(r)}async startEditing(e,t=null){if(!await this.releaseEditor())return;let o=this.deps.findComment(e),r=t==null?o:(o?.replies||[]).find(a=>w(a.id,t));if(!r)return;this.editing={commentId:e,replyId:t,draft:r.text};let i=q({value:r.text,strings:this.deps.strings,onInput:a=>{this.editing.draft=a},onSave:a=>{let l=t==null?this.deps.actions.editComment(e,a):this.deps.actions.editReply(e,t,a);this.editing=null,l?(this.refreshCommentViews(e,t),this.deps.refreshInbox()):this._restoreBody(t)},onCancel:()=>{this.releaseEditor()}});this._bodyEl(t)?.replaceWith(i)}show(e,t){this.close();let{strings:o,locale:r}=this.deps;this.deps.removeTooltip(t.id),e?.classList.add(s.CIRCLE_ACTIVE),this._activeCircle=e||null;let i=(C,x)=>{this.deps.actions.deleteReply(t.id,C.id)&&(x.remove(),this.deps.refreshInbox())},a=C=>this.startEditing(t.id,C.id),l=Tn(t,o,r,{onDeleteReply:i,onEditReply:a});this.deps.shadowRoot.appendChild(l);let c=l.querySelector(`.${s.THREAD_HEADER}`),d=Re(t,{strings:o,onCopy:C=>W(ke(C,{viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,strings:o})),onCopyLink:C=>W(V(C,this.deps.linkParam())),onEdit:C=>this.startEditing(C.id),onSetStatus:(C,x)=>this.deps.actions.setStatus(C.id,x),onSetType:(C,x)=>this.deps.actions.setType(C.id,x),onSetPriority:(C,x)=>this.deps.actions.setPriority(C.id,x),onDelete:C=>{this.close(),this.deps.actions.deleteComment(C.id),this.deps.refreshInbox()}}),h=document.createElement("div");h.className=s.THREAD_ACTIONS_ROW,h.appendChild(d),c.insertAdjacentElement("afterend",h);let p=l.querySelector(`.${s.THREAD_SCROLL} > .${s.SCREENSHOTS_CONTAINER}`);p&&I(p,C=>this.deps.onShowLightbox(C));let m=De(t,{strings:o,onShowLightbox:C=>this.deps.onShowLightbox(C),collapsible:!0});m&&l.querySelector(`.${s.THREAD_REPLIES}`).before(m),setTimeout(()=>{e?he(l,e):xn(l)},10),l.querySelector(`.${s.CLOSE_TOOLTIP}`).addEventListener("click",async C=>{C.stopPropagation(),!(this.editing&&!await this.releaseEditor())&&this.close()});let u=l.querySelector(`.${s.THREAD_INPUT}`),f=l.querySelector(`.${s.THREAD_SUBMIT}`),g=l.querySelector(`.${s.THREAD_INPUT_AREA} .${s.ATTACH_IMAGE_BTN}`),E=l.querySelector(`.${s.THREAD_INPUT_AREA} input[type="file"]`),b=l.querySelector(`.${s.THREAD_INPUT_AREA} .${s.SCREENSHOTS_CONTAINER}`),T=[],_=()=>{K(b,T,{strings:o,onShow:C=>this.deps.onShowLightbox(C),rerender:()=>_()})};g.addEventListener("click",()=>{E.click()}),Z(E,()=>T,_);let y=()=>{let C=u.value.trim();if(!C&&T.length===0)return;let x=this.deps.actions.addReply(t,C,T.length>0?[...T]:[]),M=l.querySelector(`.${s.THREAD_REPLIES}`),J=de(x,o,r,{onDelete:i,onEdit:a});M.appendChild(J),I(J,On=>this.deps.onShowLightbox(On));let He=l.querySelector(`.${s.THREAD_SCROLL}`);He&&(He.scrollTop=He.scrollHeight),u.value="",T=[],_(),u.focus()};f.addEventListener("click",y),u.addEventListener("keydown",C=>{C.key==="Enter"&&!C.shiftKey&&(C.preventDefault(),y())}),this.active=l,typeof ResizeObserver<"u"&&(this._resizeObserver=new ResizeObserver(()=>this.reposition()),this._resizeObserver.observe(l)),setTimeout(()=>u.focus(),50),this._armClickTimer=setTimeout(()=>{this._armClickTimer=null,this._clickHandler=C=>{let x=C.composedPath()[0]||C.target;if(!l.contains(x)&&!e?.contains(x)&&!this.deps.isInsideLightbox(x)){if(this.editorDirty())return;this.close()}},document.addEventListener("mousedown",this._clickHandler)},0)}close(){this.deps.shadowRoot?.querySelectorAll(`.${s.CIRCLE_ACTIVE}`).forEach(e=>e.classList.remove(s.CIRCLE_ACTIVE)),this._resizeObserver?.disconnect(),this._resizeObserver=null,this.editing=null,this.active&&(this.active.remove(),this.active=null),this._activeCircle=null,this._armClickTimer&&(clearTimeout(this._armClickTimer),this._armClickTimer=null),this._clickHandler&&(document.removeEventListener("mousedown",this._clickHandler),this._clickHandler=null)}reposition(){let e=this.active;!e||e.style.display==="none"||(this._activeCircle?he(e,this._activeCircle):xn(e))}syncToMarker(){let e=this.active,t=this._activeCircle;if(!e||!t)return;let o=t.getBoundingClientRect();if(!(t.isConnected&&t.style.display!=="none"&&o.bottom>0&&o.right>0&&o.top<window.innerHeight&&o.left<window.innerWidth)){e.style.display="none";return}e.style.display="",he(e,t)}};var yn=150,dt=(n,e)=>Math.max(0,Math.min(n,e)),Pe=class{constructor(e){this.deps=e,this.circles=new Map,this.resizeObservers=new Map,this.enabled=!0,this._lastOcclusionPass=0,this._occlusionTrailingTimer=null,this._pendingRaf=null,this._globalMutationObserver=null,this._resizeHandler=null,this._scrollHandler=null,this._loadHandler=null}start(){this._resizeHandler=()=>this.scheduleUpdate(),window.addEventListener("resize",this._resizeHandler,{passive:!0}),this._scrollHandler=()=>this.scheduleUpdate(),window.addEventListener("scroll",this._scrollHandler,{capture:!0,passive:!0}),this._loadHandler=()=>this.scheduleUpdate(),window.addEventListener("load",this._loadHandler),window.MutationObserver&&(this._globalMutationObserver=new MutationObserver(()=>{this.scheduleUpdate()}),this._globalMutationObserver.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class","hidden","open"]}))}render(e){let t=Cn(e,this.deps.strings);this.deps.wireMarker(t,e),this.deps.container.appendChild(t),this.circles.set(String(e.id),t),this.updatePosition(e,t),this.createResizeObserver(e,t)}circleOf(e){return this.circles.get(String(e))??null}remove(e){this.cleanupResizeObserver(e),this.circles.get(String(e))?.remove(),this.circles.delete(String(e))}clear(){this.resizeObservers.forEach(({observer:e})=>e?.disconnect()),this.resizeObservers.clear(),this.circles.forEach(e=>e.remove()),this.circles.clear()}validateAndCalculatePosition(e,t){if(!e.container||!t)return null;let o=e.container.getBoundingClientRect(),r=o.width,i=o.height;if(r<=0||i<=0)return null;let a=e.relativeX*r,l=e.relativeY*i,c=dt(a,r),d=dt(l,i),h=c/r,p=d/i;return{absoluteX:c,absoluteY:d,relativeX:h,relativeY:p,containerWidth:r,containerHeight:i,containerLeft:o.left,containerTop:o.top}}_isAnchorTargetVisible(e){let t=e.target;if((!t||!t.isConnected)&&e.anchor?.targetSelector){try{t=document.querySelector(e.anchor.targetSelector)}catch{t=null}e.target=t||null}if(!t||!t.isConnected)return!0;let o=t.getBoundingClientRect();return o.width>0&&o.height>0}_isMarkerOccluded(e,t,o){if(typeof document.elementsFromPoint!="function"||t<0||o<0||t>=window.innerWidth||o>=window.innerHeight)return!1;let i=document.elementsFromPoint(t,o).find(c=>c.tagName.toLowerCase()!==R.toLowerCase());if(!i)return!1;let a=e.target?.isConnected?e.target:null;if(a&&(a.contains(i)||i.contains(a)))return!1;let l=e.container;if(!l?.isConnected)return!1;if(!l.contains(i)&&!i.contains(l))return!0;if(l.contains(i)&&i!==l){for(let c=i;c&&c!==l;c=c.parentElement)if(this._looksLikeModalLayer(c,a))return!0}return!1}_looksLikeModalLayer(e,t){if(t&&e.contains(t))return!1;if(e.matches?.('dialog, [aria-modal="true"], [role="dialog"]'))return!0;if(getComputedStyle(e).position!=="fixed")return!1;let o=e.getBoundingClientRect();return o.width>=window.innerWidth*.5&&o.height>=window.innerHeight*.5}_computeMarkerState(e,t,{checkOcclusion:o=!0}={}){if(e.status==="resolved")return{kind:"resolved"};let r=this.validateAndCalculatePosition(e,t);if(r&&!this._isAnchorTargetVisible(e)&&(r=null),!r)return e.container?{kind:"hidden"}:{kind:"noop"};let i=A/2,a=r.containerLeft+r.absoluteX+i,l=r.containerTop+r.absoluteY+i;return o&&(e._occluded=this._isMarkerOccluded(e,a,l)),e._occluded?{kind:"hidden"}:{kind:"visible",viewportX:a,viewportY:l,relativeX:r.relativeX,relativeY:r.relativeY}}_applyMarkerState(e,t,o){if(o.kind==="resolved")return t&&(t.style.display="none"),!1;if(o.kind==="noop")return!1;let r=e.hidden===!0;return o.kind==="hidden"?(e.hidden=!0,t.style.display="none",this.deps.onMarkerHidden(e),!r):(e.hidden=!1,t.style.display="",t.style.left=`${o.viewportX}px`,t.style.top=`${o.viewportY}px`,t.style.transform="translate(-50%, -50%)",t.style.position="absolute",e.relativeX=o.relativeX,e.relativeY=o.relativeY,r)}updatePosition(e,t=this.circles.get(String(e.id))){if(!t)return;let o=this._computeMarkerState(e,t);this._applyMarkerState(e,t,o)&&this.deps.onVisibilityFlip()}_updateAllPositions(){let e=Date.now(),t=e-this._lastOcclusionPass>=yn;t?this._lastOcclusionPass=e:this._armOcclusionTrailingPass();let o=[];for(let i of this.deps.getComments()){let a=this.circles.get(String(i.id));a&&o.push([i,a,this._computeMarkerState(i,a,{checkOcclusion:t})])}let r=!1;for(let[i,a,l]of o)this._applyMarkerState(i,a,l)&&(r=!0);r&&this.deps.onVisibilityFlip()}_armOcclusionTrailingPass(){this._occlusionTrailingTimer&&clearTimeout(this._occlusionTrailingTimer),this._occlusionTrailingTimer=setTimeout(()=>{this._occlusionTrailingTimer=null,this.scheduleUpdate()},yn)}scheduleUpdate(){this._pendingRaf||(this._pendingRaf=requestAnimationFrame(()=>{this._pendingRaf=null,this.enabled&&this._updateAllPositions(),this.deps.onAfterPass()}))}createResizeObserver(e,t){if(!window.ResizeObserver){console.warn("ResizeObserver not supported, position validation will be limited");return}let o=new ResizeObserver(r=>{if(this.enabled)for(let i of r)i.target===e.container&&this.updatePosition(e,t)});o.observe(e.container),this.resizeObservers.set(String(e.id),{circle:t,observer:o,container:e.container})}cleanupResizeObserver(e){let t=String(e);if(this.resizeObservers.has(t)){let{circle:o,observer:r}=this.resizeObservers.get(t);r&&r.disconnect(),o&&o.parentNode&&o.parentNode.removeChild(o),this.resizeObservers.delete(t)}}scrollMarkerIntoView(e){let t=this._markerViewportY(e);t!=null&&window.scrollTo({top:Math.max(0,window.scrollY+t-window.innerHeight/2)})}_markerViewportY(e){let t=e.container;if(!t?.isConnected)return null;let o=t.getBoundingClientRect();if(o.height<=0)return null;let r=dt(e.relativeY*o.height,o.height);return o.top+r+A/2}destroy(){this._pendingRaf&&(cancelAnimationFrame(this._pendingRaf),this._pendingRaf=null),this._occlusionTrailingTimer&&(clearTimeout(this._occlusionTrailingTimer),this._occlusionTrailingTimer=null),this._resizeHandler&&(window.removeEventListener("resize",this._resizeHandler),this._resizeHandler=null),this._scrollHandler&&(window.removeEventListener("scroll",this._scrollHandler,{capture:!0}),this._scrollHandler=null),this._loadHandler&&(window.removeEventListener("load",this._loadHandler),this._loadHandler=null),this._globalMutationObserver&&(this._globalMutationObserver.disconnect(),this._globalMutationObserver=null),this.clear()}};var ki='<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>',Mi='<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>',Pi='<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>',$e=class{constructor({shadowRoot:e,strings:t,locale:o,currentPage:r,getComments:i,callbacks:a,options:l={}}){this.shadowRoot=e,this.strings=t,this.locale=o,this.currentPage=r,this.getComments=i,this.callbacks=a,this.options=l,this.pageFilter="page",this.statusFilter="all",this.typeFilter="all",this.priorityFilter="all",this.detailId=null,this.contextExpanded=!0,this.editing=null,this.notice=null,this._cardBindings=new Map,this.el=null,this._highlightedEl=null,this._activeMarkerEl=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.el.setAttribute("tabindex","-1"),this.shadowRoot.appendChild(this.el),this.render(),this.el.focus())}close(){this._clearHighlight(),this._setActiveMarker(null),this.el?.remove(),this.el=null,this._cardBindings.clear(),this.detailId=null,this.editing=null,this.notice=null}refresh(){this.el&&this.render()}_resetFilters(){this.pageFilter="page",this.statusFilter="all",this.typeFilter="all",this.priorityFilter="all",this.render()}showNotice(e){this.notice=e,this.refresh()}clearNotice(){this.notice&&(this.notice=null,this.refresh())}isDirty(){return this.editing?this.editing.draft.trim()!==this._editingOriginalText().trim():!1}_editingOriginalText(){if(!this.editing)return"";let e=this.getComments().find(o=>w(o.id,this.editing.commentId));return e?this.editing.replyId==null?e.text||"":(e.replies||[]).find(o=>w(o.id,this.editing.replyId))?.text||"":""}async releaseEditor(){if(!this.editing)return!0;if(this.isDirty()){let e=this.el||this.shadowRoot;if(!await Ie(e,this.strings))return!1}return this.editing=null,!0}_editorHandlers(){return{draft:this.editing.draft,onInput:e=>{this.editing.draft=e},onSave:e=>{let{commentId:t,replyId:o}=this.editing;o==null?this.callbacks.onEditComment(t,e):this.callbacks.onEditReply(t,o,e),this.editing=null,this.render()},onCancel:async()=>{await this.releaseEditor()&&this.render()}}}_buildEditor(){let e=this._editorHandlers();return q({value:e.draft,strings:this.strings,onInput:e.onInput,onSave:e.onSave,onCancel:e.onCancel})}async startEditing(e,t=null){await this.releaseEditor()&&(this.detailId=e,this.editing={commentId:e,replyId:t,draft:""},this.editing.draft=this._editingOriginalText(),this.render())}_markerFor(e){return e.anchorState!=="anchored"||e.hidden||e.status==="resolved"?null:this.shadowRoot.querySelector(En(e.id))}_highlight(e){this._clearHighlight();let t=this._markerFor(e);t&&(t.classList.add(s.HIGHLIGHT),this._highlightedEl=t)}_clearHighlight(){this._highlightedEl?.classList.remove(s.HIGHLIGHT),this._highlightedEl=null}_setActiveMarker(e){if(this._activeMarkerEl?.classList.remove(s.CIRCLE_ACTIVE),this._activeMarkerEl=null,!e)return;let t=this._markerFor(e);t&&(t.classList.add(s.CIRCLE_ACTIVE),this._activeMarkerEl=t)}filteredComments(){let e=this.getComments();return this.pageFilter==="page"&&(e=e.filter(t=>t.page===this.currentPage)),this.statusFilter!=="all"&&(e=e.filter(t=>(t.status||"open")===this.statusFilter)),this.typeFilter!=="all"&&(e=e.filter(t=>t.type===this.typeFilter)),this.priorityFilter!=="all"&&(e=e.filter(t=>t.priority===this.priorityFilter)),[...e.filter(t=>t.status!=="resolved"),...e.filter(t=>t.status==="resolved")]}render(){if(!this.el)return;this._clearHighlight();let e=this.filteredComments(),t=this.detailId!=null?e.find(o=>w(o.id,this.detailId)):null;this._setActiveMarker(t),t?(this._cardBindings.clear(),this.el.innerHTML="",this._renderDetail(t,e)):(this.detailId=null,this._renderList(e))}openDetail(e){this.el||this.open();let t=this.getComments().find(o=>w(o.id,e));t&&this._openDetail(t)}_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",async()=>{this.editing&&!await this.releaseEditor()||this.callbacks.onClose()}),e}_renderList(e){let t=[...this.el.children].find(r=>r.classList.contains(s.INBOX_LIST));if(!t){this.el.innerHTML="",this._cardBindings.clear();let r=document.createElement("div");r.className=s.INBOX_HEADER,this.el.appendChild(r),t=document.createElement("div"),t.className=s.INBOX_LIST,this.el.appendChild(t)}[...this.el.children].find(r=>r.classList.contains(s.INBOX_HEADER)).replaceChildren(this._buildFilter(),this._closeButton()),this._reconcileCards(t,e)}_cardFingerprint(e){return JSON.stringify([e.text,e.editedAt??null,e.status??"open",e.type??null,e.priority??null,e.tags??[],e.resolvedAt??null,e.anchorState,e.hidden===!0,e.page,e.screenshots?.length??0])}_reconcileCards(e,t){for(let i of[...e.children])(i.classList.contains(s.INBOX_NOTICE)||i.classList.contains(s.INBOX_EMPTY))&&i.remove();let o=[];if(this.notice){let i=document.createElement("div");i.className=s.INBOX_NOTICE,i.setAttribute("role","status"),i.textContent=this.notice,o.push(i)}let r=new Set;if(t.length===0)o.push(this._buildEmptyState());else for(let i of t){let a=String(i.id),l=this._cardFingerprint(i),c=this._cardBindings.get(a),d;c&&c.comment===i&&c.fingerprint===l?d=c.card:(d=this._buildCard(i,{interactive:!0}),this._cardBindings.set(a,{comment:i,fingerprint:l,card:d})),r.add(a),o.push(d)}for(let i of[...this._cardBindings.keys()])r.has(i)||this._cardBindings.delete(i);for(o.forEach((i,a)=>{e.children[a]!==i&&e.insertBefore(i,e.children[a]??null)});e.children.length>o.length;)e.lastElementChild.remove()}_buildEmptyState(){let e=document.createElement("div");e.className=s.INBOX_EMPTY;let t=document.createElement("div");t.className=s.INBOX_EMPTY_ICON,t.setAttribute("aria-hidden","true"),e.appendChild(t);let o=this.getComments().length>0,r=document.createElement("div");if(r.className=s.INBOX_EMPTY_TITLE,r.textContent=o?this.strings.inboxNoMatches:this.strings.inboxEmptyTitle,e.appendChild(r),o){let h=document.createElement("button");return h.type="button",h.className=s.INBOX_EMPTY_ACTION,h.textContent=this.strings.filterClear,h.addEventListener("click",()=>{this._resetFilters()}),e.appendChild(h),e}let i=document.createElement("div");i.className=s.INBOX_EMPTY_TEXT;let[a,l]=String(this.strings.inboxEmptyHintTemplate).split("{n}"),c=document.createElement("kbd");c.className=s.INBOX_EMPTY_KBD,c.textContent=at(this.options,this.strings),i.appendChild(document.createTextNode(a??"")),i.appendChild(c),i.appendChild(document.createTextNode(l??"")),e.appendChild(i);let d=document.createElement("button");return d.type="button",d.className=s.INBOX_EMPTY_ACTION,d.textContent=this.strings.inboxEmptyAction,d.addEventListener("click",()=>this.callbacks.onActivateCommentMode()),e.appendChild(d),e}_pageFilterLabel(e){return e==="all"?this.strings.filterAll:this.strings.filterCurrentPage}_filterSummaryLabel(){let e=[this._pageFilterLabel(this.pageFilter)];return this.statusFilter!=="all"&&e.push(j(this.statusFilter,this.strings)),this.typeFilter!=="all"&&e.push($(this.typeFilter,this.strings)),this.priorityFilter!=="all"&&e.push(H(this.priorityFilter,this.strings)),e.join(" \xB7 ")}_isFilterActive(){return this.pageFilter!=="page"||this.statusFilter!=="all"||this.typeFilter!=="all"||this.priorityFilter!=="all"}_buildFilterGroup({title:e,dataAttr:t,values:o,labelOf:r,selected:i,toggles:a=!0,onSelect:l}){let c=document.createElement("div");c.className=s.INBOX_FILTER_GROUP;let d=document.createElement("div");d.className=s.INBOX_FILTER_SECTION,d.textContent=e,c.appendChild(d);let h=document.createElement("div");h.className=s.INBOX_FILTER_CHIPS,h.setAttribute("role",a?"group":"radiogroup"),h.setAttribute("aria-label",e);for(let p of o){let m=i===p,u=document.createElement("button");u.type="button",u.className=s.INBOX_FILTER_CHIP,u.dataset[t]=p,u.setAttribute("role",a?"switch":"radio"),u.setAttribute("aria-checked",String(m)),u.textContent=r(p),u.addEventListener("click",f=>{f.stopPropagation(),l(a&&m?"all":p),this.render()}),h.appendChild(u)}return c.appendChild(h),c}_buildFilter(){let e=document.createElement("div");e.className=s.INBOX_FILTER+"-wrapper";let t=document.createElement("button");t.type="button",t.className=s.INBOX_FILTER,t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-expanded","false"),t.innerHTML=`<span>${this._filterSummaryLabel()}</span>${Le}`;let o=document.createElement("div");o.className=s.INBOX_FILTER_MENU,o.setAttribute("role","group"),o.setAttribute("aria-label",this.strings.filterTitle),ae(t,o);let r=document.createElement("div");r.className=s.INBOX_FILTER_MENU_HEADER;let i=document.createElement("span");i.textContent=this.strings.filterTitle,r.appendChild(i);let a=document.createElement("button");return a.type="button",a.className=s.INBOX_FILTER_CLEAR,a.textContent=this.strings.filterClear,a.disabled=!this._isFilterActive(),a.addEventListener("click",l=>{l.stopPropagation(),this._resetFilters()}),r.appendChild(a),o.appendChild(r),o.appendChild(this._buildFilterGroup({title:this.strings.filterByPage,dataAttr:"filterPage",values:["page","all"],labelOf:l=>this._pageFilterLabel(l),selected:this.pageFilter,toggles:!1,onSelect:l=>this.pageFilter=l})),o.appendChild(this._buildFilterGroup({title:this.strings.filterByStatus,dataAttr:"filterStatus",values:[...P],labelOf:l=>j(l,this.strings),selected:this.statusFilter,onSelect:l=>this.statusFilter=l})),o.appendChild(this._buildFilterGroup({title:this.strings.filterByType,dataAttr:"filterType",values:[...L],labelOf:l=>$(l,this.strings),selected:this.typeFilter,onSelect:l=>this.typeFilter=l})),o.appendChild(this._buildFilterGroup({title:this.strings.filterByPriority,dataAttr:"filterPriority",values:[...B],labelOf:l=>H(l,this.strings),selected:this.priorityFilter,onSelect:l=>this.priorityFilter=l})),e.appendChild(t),e.appendChild(o),e}_buildCard(e,{interactive:t}){let o=document.createElement("div");o.className=s.INBOX_CARD,e.status==="resolved"&&o.classList.add(`${s.INBOX_CARD}--resolved`),o.dataset.commentId=e.id;let r=document.createElement("div");r.className=s.INBOX_CARD_HEADER,r.appendChild(le(e.author,e.createdAt,this.strings,this.locale,e.editedAt)),o.appendChild(r);let i=document.createElement("div");if(i.className=s.THREAD_ACTIONS_ROW,i.appendChild(this._buildCardActions(e)),o.appendChild(i),!t&&this.editing&&this.editing.replyId==null&&String(this.editing.commentId)===String(e.id))o.appendChild(this._buildEditor());else{let d=document.createElement("div");d.className=s.INBOX_CARD_TEXT,d.textContent=e.text,o.appendChild(d)}if(e.screenshots?.length){let d=ce(e.screenshots,this.strings);I(d,h=>this.callbacks.onShowLightbox(h)),o.appendChild(d)}let l=lt(e,this.strings,{includeClassification:!1});l&&o.appendChild(l);let c=this._buildTag(e);if(c&&o.appendChild(c),t){o.setAttribute("role","button"),o.setAttribute("tabindex","0");let d=()=>e.anchorState==="inactive"?this.callbacks.onNavigateToPage(e):this._openDetail(e),h=document.createElement("button");h.type="button",h.className=s.INBOX_CARD_REPLY_LINK,h.textContent=this.strings.replyLink,h.addEventListener("click",p=>{p.stopPropagation(),d()}),o.appendChild(h),o.addEventListener("click",d),o.addEventListener("keydown",p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),d())}),o.addEventListener("mouseenter",()=>this._highlight(e)),o.addEventListener("mouseleave",()=>this._clearHighlight())}return o}_buildTag(e){let t=null;if(e.anchorState==="orphaned"?t=this.strings.orphanedBadge:e.hidden?t=this.strings.hiddenBadge:e.anchorState==="inactive"&&(t=e.page),!t)return null;let o=document.createElement("span");return o.className=s.INBOX_CARD_TAG,o.textContent=t,o}_buildCardActions(e){return Re(e,{strings:this.strings,onCopy:t=>W(ke(t,{viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,strings:this.strings})),onCopyLink:t=>W(V(t,this.options.linkParam)),onEdit:t=>this.startEditing(t.id),onSetStatus:(t,o)=>this.callbacks.onSetStatus(t.id,o),onSetType:(t,o)=>this.callbacks.onSetType(t.id,o),onSetPriority:(t,o)=>this.callbacks.onSetPriority(t.id,o),onDelete:t=>{this.detailId!=null&&w(this.detailId,t.id)&&(this.detailId=null),this.callbacks.onDelete(t.id),this.render()}})}_renderDetail(e,t){let o=t.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=`${ki}<span>${this.strings.back}</span>`,i.addEventListener("click",async()=>{this.editing&&!await this.releaseEditor()||(this.detailId=null,this.render())}),r.appendChild(i);let a=document.createElement("div");a.className=s.INBOX_CARD_ACTIONS;let l=(p,m,u)=>{let f=document.createElement("button");f.type="button",f.className=s.INBOX_NAV_BTN,f.setAttribute("aria-label",m),f.title=m,f.innerHTML=p;let g=t[u];return f.disabled=!g,g&&f.addEventListener("click",async()=>{this.editing&&!await this.releaseEditor()||this._openDetail(g)}),f};a.appendChild(l(Mi,this.strings.prevComment,o-1)),a.appendChild(l(Pi,this.strings.nextComment,o+1)),a.appendChild(this._closeButton()),r.appendChild(a),this.el.appendChild(r);let c=document.createElement("div");c.className=s.INBOX_DETAIL,c.appendChild(this._buildCard(e,{interactive:!1}));let d=De(e,{strings:this.strings,onShowLightbox:p=>this.callbacks.onShowLightbox(p),collapsible:!0,expanded:this.contextExpanded,onToggle:p=>{this.contextExpanded=p}});d&&c.appendChild(d);let h=document.createElement("div");h.className=s.INBOX_REPLIES;for(let p of e.replies||[]){let m=this.editing&&String(this.editing.commentId)===String(e.id)&&String(this.editing.replyId)===String(p.id),u=de(p,this.strings,this.locale,{onDelete:(f,g)=>{this.callbacks.onDeleteReply(e.id,f.id)&&g.remove()},onEdit:f=>this.startEditing(e.id,f.id),editing:m?this._editorHandlers():null});I(u,f=>this.callbacks.onShowLightbox(f)),h.appendChild(u)}c.appendChild(h),c.appendChild(this._buildReplyInput(e)),this.el.appendChild(c)}_buildReplyInput(e){let{container:t,inputEl:o,screenshotsContainer:r,attachBtn:i,fileInput:a,submitBtn:l}=Be({areaClassName:s.THREAD_INPUT_AREA,inputTag:"input",inputClassName:s.THREAD_INPUT,inputPlaceholder:this.strings.replyPlaceholder},this.strings),c=[],d=()=>{K(r,c,{strings:this.strings,onShow:p=>this.callbacks.onShowLightbox(p),rerender:()=>d()})};i.addEventListener("click",()=>a.click()),Z(a,()=>c,d);let h=()=>{let p=o.value.trim();!p&&c.length===0||(this.callbacks.onReply(e,p,[...c]),c=[],this.render())};return l.addEventListener("click",h),o.addEventListener("keydown",p=>{p.key==="Enter"&&!p.shiftKey&&(p.preventDefault(),h())}),t}};var $i=n=>{let e=new Set;for(let t of n){let o=String(t).trim().toLowerCase();o&&e.add(o)}return[...e]},Sn=n=>n.filter(e=>typeof e=="string"),Hi={"comment:created":"onCommentCreated","comment:edited":"onCommentEdited","comment:deleted":"onCommentDeleted","comment:status-changed":"onCommentStatusChanged","comment:updated":"onCommentUpdated","comment:anchor-lost":"onAnchorLost","reply:added":"onReplyAdded","reply:deleted":"onReplyDeleted","reply:edited":"onReplyEdited"},ht=class{constructor(e={}){this.comments=[],this.commentMode=!1,this.isMac=st(),this.options={shortcutKey:e.shortcutKey||(this.isMac?"c":"C"),shortcutModifier:e.shortcutModifier||"alt",autoScreenshot:e.autoScreenshot!==!1,embedCrossOriginFonts:e.embedCrossOriginFonts===!0,...e},this.locale=this.options.locale||Kt(),this.strings=Zt(this.locale),this.markers=null,this._captureFlow=null,this._storedCache=null,this._popover=null,this._pendingDetailId=null,document.readyState==="loading"?(this._onDomReady=()=>this.initOverlay(),document.addEventListener("DOMContentLoaded",this._onDomReady)):this.initOverlay()}initOverlay(){this.shadowRoot=kt(),this.toolbar=fn(this.options,this.strings),this.commentBox=gn(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(S.SUBMIT_COMMENT),this.commentInput=this.shadowRoot.getElementById(S.COMMENT_INPUT),this.attachImageBtn=this.commentBox.querySelector(`.${s.ATTACH_IMAGE_BTN}`),this.attachImageInput=this.shadowRoot.getElementById(S.ATTACH_IMAGE_INPUT),this._captureFlow=new Ce({host:this.shadowRoot,autoScreenshot:this.options.autoScreenshot,embedCrossOriginFonts:this.options.embedCrossOriginFonts,onRegionCaptured:e=>{this._pendingScreenshots||(this._pendingScreenshots=[]),this._pendingScreenshots.length<Ee&&this._pendingScreenshots.push(e)},onPlace:(e,t)=>this._placeCommentAtPoint(e,t)}),this._popover=new Me({shadowRoot:this.shadowRoot,strings:this.strings,locale:this.locale,findComment:e=>this._findComment(e),removeTooltip:e=>this._tooltipEl(e)?.remove(),onShowLightbox:e=>this.showLightbox(e),isInsideLightbox:e=>this._isInsideLightbox(e),linkParam:()=>this._linkParam(),refreshInbox:()=>{this.inboxView?.isOpen()&&this.inboxView.refresh()},actions:{addReply:(e,t,o)=>this.addReply(e,t,o),deleteReply:(e,t)=>this.deleteReply(e,t),editComment:(e,t)=>this.editComment(e,t),editReply:(e,t,o)=>this.editReply(e,t,o),setStatus:(e,t)=>this.setCommentStatus(e,t),setType:(e,t)=>this.setCommentType(e,t),setPriority:(e,t)=>this.setCommentPriority(e,t),deleteComment:e=>this.deleteComment(e)}}),this.markers=new Pe({container:this.overlay,strings:this.strings,getComments:()=>this.comments,wireMarker:(e,t)=>this._wireMarker(e,t),onMarkerHidden:e=>this._dismissMarkerUi(e),onVisibilityFlip:()=>{this.inboxView?.isOpen()&&this.inboxView.refresh()},onAfterPass:()=>this.syncThreadPopoverToMarker()}),this.markers.start(),this.bindEventListeners(),this.setupKeyboardShortcut(),this.injectStyles(),this._pendingDetailId=this._readPendingDetailId(),this.options.persistence==="localStorage"&&(this._storedCache=et(),this.loadComments(this._storedCache),this._storageHandler=e=>{(e.key===ye||e.key===null)&&(this._storedCache=null)},window.addEventListener("storage",this._storageHandler)),this._openPendingDetail(),this.options.autoDetectNavigation&&(this._popstateHandler=()=>this.notifyNavigation(),window.addEventListener("popstate",this._popstateHandler))}_navigateTo(e){if(typeof this.options.navigate=="function"){this.options.navigate(e);return}location.assign(e)}_readPendingDetailId(){let e=ln(this._linkParam()),t=null;try{t=sessionStorage.getItem(Se),t!=null&&sessionStorage.removeItem(Se)}catch{}return e??t}_linkParam(){return this.options.linkParam||Oe}_openPendingDetail(){let e=this._pendingDetailId;if(!e)return;let t=this._findComment(e);if(!t){this.showInbox(),this.inboxView?.showNotice(this.strings.commentNotFound);return}this._pendingDetailId=null,this.showInbox(),this.inboxView.clearNotice(),this.inboxView.openDetail(t.id)}_emit(e,t,o){let r=Hi[e],i=this.options[r];if(typeof i=="function")try{i(...t)}catch(a){console.warn(`HellDots: ${r} handler threw`,a)}if(typeof this.options.onChange=="function")try{this.options.onChange({type:e,...o})}catch(a){console.warn("HellDots: onChange handler threw",a)}}commentLink(e){let t=this._findComment(e);return t?V(t,this._linkParam()):null}_readStoredCached(){return this._storedCache||(this._storedCache=et()),this._storedCache}_syncStorage(){if(this.options.persistence!=="localStorage")return;let e=tt(this._readStoredCached(),this.serializeComments(),location.pathname);we(e),this._storedCache=e}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()}),Z(this.attachImageInput,()=>(this._pendingScreenshots||(this._pendingScreenshots=[]),this._pendingScreenshots),()=>this._updateScreenshotsPreview()),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._popover.isEditing()?this._popover.releaseEditor():this.closeThreadPopover():this.inboxView?.isOpen()?this.inboxView.editing?this.inboxView.releaseEditor().then(i=>i&&this.inboxView?.refresh()):this.closeInbox():this.commentBox.style.display!=="none"?(this.hideCommentBox(),this.toggleCommentMode()):this.commentMode&&this.toggleCommentMode();return}let t=this.options.shortcutKey.toLowerCase(),o=e.key.toLowerCase()===t||e.altKey&&/^[a-z]$/.test(t)&&e.code===`Key${t.toUpperCase()}`,r=this.options.shortcutModifier==="alt"&&e.altKey||this.options.shortcutModifier==="ctrl"&&(e.ctrlKey||e.metaKey)||this.options.shortcutModifier==="shift"&&e.shiftKey;o&&r&&(e.preventDefault(),e.stopPropagation(),this.toggleCommentMode())},document.addEventListener("keydown",this.keydownHandler)}handleDocumentClick(e){if(!this.commentMode)return;let t=e.composedPath()[0]||e.target;if(!(this.toolbar.contains(t)||t?.closest?.(`.${s.CIRCLE}`)||t?.closest?.(`.${s.TOOLTIP}`)||t?.closest?.(`.${s.THREAD_POPOVER}`)||t?.closest?.(`.${s.INBOX_PANEL}`)||t?.closest?.(`.${s.LIGHTBOX}`))&&!this.commentBox.contains(t)){if(this.commentBox.style.display!=="none"){this.hideCommentBox(),this.toggleCommentMode();return}e.button===0&&(e.preventDefault(),this._captureFlow.beginDrag(e))}}async _placeCommentAtPoint(e,t){this._captureFlow.armClickCapture();let o=this.overlay.style.pointerEvents;this.overlay.style.pointerEvents="none";let r=document.elementFromPoint(e,t);this.overlay.style.pointerEvents=o||"";let i=r?.closest?.(Ut.CONTAINER)||document.body,a=i.getBoundingClientRect(),l=a.width>0?(e-a.left)/a.width:0,c=a.height>0?(t-a.top)/a.height:0,d=on(i,l,c);d.targetSelector=r&&r!==i?nn(r):null,this.currentPosition={container:i,relativeX:l,relativeY:c,anchor:d,target:r||i},this.createPreviewCircle(e,t),document.body.classList.remove(s.COMMENT_CURSOR),this._pendingScreenshots&&this._pendingScreenshots.length>0&&this._updateScreenshotsPreview(),this.showCommentBox(e,t)}_updateScreenshotsPreview(){let e=this.commentBox.querySelector(`.${s.SCREENSHOTS_CONTAINER}`);e&&K(e,this._pendingScreenshots||[],{strings:this.strings,onShow:t=>this.showLightbox(t),rerender:()=>this._updateScreenshotsPreview()})}_clearScreenshotPreview(){this._pendingScreenshots=[];let e=this.commentBox.querySelector(`.${s.SCREENSHOTS_CONTAINER}`);e&&(e.innerHTML="",e.classList.remove(s.ACTIVE))}showCommentBox(e,t){this.commentBox.style.display="block";let r=A/2,i=r+10,a=window.innerWidth,l=window.innerHeight,c=this.commentBox.getBoundingClientRect(),d=c.width||400,h=e+r,p=t+r,m=h+i,u=p-r;m+d>a&&(m=h-i-d),m=Math.min(m,a-d-10),m=Math.max(10,m),u+c.height>l&&(u=l-c.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._captureFlow?.clearPending(),this.commentBox.classify?.reset(),this.commentMode&&document.body.classList.add(s.COMMENT_CURSOR)}toggleCommentMode(){this.commentMode=!this.commentMode,this.commentMode&&this.closeInbox(),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()}async saveComment(){if(!this._saving&&!(!this.commentInput.value.trim()||!this.currentPosition)){this._saving=!0;try{await this._saveCommentNow()}finally{this._saving=!1}}}async _saveCommentNow(){let e=await this._captureFlow.consumePending();if(!this.currentPosition)return;let t={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:nt(),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:[],resolvedAt:null,context:Yt(),contextScreenshot:e};this.comments.push(t),this._syncStorage();let o=this._serializeComment(t);this._emit("comment:created",[o],{comment:o}),this.renderCommentCircle(t),this.hideCommentBox(),this.toggleCommentMode();let r=this._circles.get(String(t.id));r&&this.showThreadPopover(r,t)}renderCommentCircle(e){this.markers.render(e)}_wireMarker(e,t){e.addEventListener("mouseenter",()=>this.showCommentTooltip(e,t)),e.addEventListener("mouseleave",()=>{setTimeout(()=>{let o=this._tooltipEl(t.id);o&&!o.matches(":hover")&&o.remove()},250)}),e.addEventListener("click",o=>{if(o.stopPropagation(),this._tooltipEl(t.id)?.remove(),this.activeThreadPopover?.dataset.for===String(t.id)){this.closeThreadPopover();return}this.showThreadPopover(e,t)}),e.addEventListener("keydown",o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),e.click())})}showCommentTooltip(e,t){if(this.shadowRoot.querySelector(`.${s.THREAD_POPOVER}[data-for="${F(t.id)}"]`)||this._tooltipEl(t.id))return;let r=_n(t,this.strings,this.locale);this.shadowRoot.appendChild(r),I(r,i=>this.showLightbox(i)),setTimeout(()=>{he(r,e)},10),r.querySelector(`.${s.CLOSE_TOOLTIP}`).addEventListener("click",i=>{i.stopPropagation(),r.remove()}),r.addEventListener("mouseleave",()=>r.remove())}toggleInbox(){this.inboxView?.isOpen()?this.closeInbox():this.showInbox()}showInbox(){this.closeThreadPopover(),this.inboxView||(this.inboxView=new $e({shadowRoot:this.shadowRoot,strings:this.strings,locale:this.locale,currentPage:location.pathname,getComments:()=>this.comments,options:this.options,callbacks:{onActivateCommentMode:()=>{this.closeInbox(),this.commentMode||this.toggleCommentMode()},onOpenDetailScroll:e=>this.scrollMarkerIntoView(e),onReply:(e,t,o)=>this.addReply(e,t,o),onDelete:e=>this.deleteComment(e),onDeleteReply:(e,t)=>this.deleteReply(e,t),onEditComment:(e,t)=>{this.editComment(e,t)&&this._popover.refreshCommentViews(e)},onEditReply:(e,t,o)=>{this.editReply(e,t,o)&&this._popover.refreshCommentViews(e)},onSetStatus:(e,t)=>this.setCommentStatus(e,t),onSetType:(e,t)=>this.setCommentType(e,t),onSetPriority:(e,t)=>this.setCommentPriority(e,t),onNavigateToPage:e=>{try{sessionStorage.setItem(Se,String(e.id))}catch{}this._navigateTo(e.page)},onShowLightbox:e=>this.showLightbox(e),onClose:()=>this.closeInbox()}})),this.inboxView.open(),this._disarmInboxOutsideClick(),this._inboxClickTimer=setTimeout(()=>{this._inboxClickTimer=null,this._inboxClickHandler=e=>{let t=e.composedPath()[0]||e.target;if(!this.inboxView.el?.contains(t)&&!this.inboxBtn.contains(t)&&!this._isInsideLightbox(t)){if(this.inboxView.isDirty())return;this.closeInbox()}},document.addEventListener("mousedown",this._inboxClickHandler)},0)}closeInbox(){this.inboxView?.close(),this._disarmInboxOutsideClick()}_disarmInboxOutsideClick(){this._inboxClickTimer&&(clearTimeout(this._inboxClickTimer),this._inboxClickTimer=null),this._inboxClickHandler&&(document.removeEventListener("mousedown",this._inboxClickHandler),this._inboxClickHandler=null)}get activeThreadPopover(){return this._popover?.active??null}showThreadPopover(e,t){this._popover.show(e,t)}closeThreadPopover(){this._popover?.close()}syncThreadPopoverToMarker(){this._popover?.syncToMarker()}showLightbox(e){this.closeLightbox(),this._lightboxReturnFocus=this.shadowRoot.activeElement||document.activeElement;let t=document.createElement("div");t.className=s.LIGHTBOX,t.setAttribute("role","dialog"),t.setAttribute("aria-modal","true"),t.setAttribute("aria-label",this.strings.screenshotPreview);let o=document.createElement("img");o.className=s.LIGHTBOX_IMG,o.src=e,o.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()),t.appendChild(o),t.appendChild(r),t.addEventListener("click",i=>{i.target===t&&this.closeLightbox()}),this.shadowRoot.appendChild(t),this._activeLightbox=t,this._lightboxKeydownHandler=i=>{i.key==="Tab"&&(i.preventDefault(),r.focus())},document.addEventListener("keydown",this._lightboxKeydownHandler,!0),r.focus()}closeLightbox(){if(!this._activeLightbox)return;this._lightboxKeydownHandler&&(document.removeEventListener("keydown",this._lightboxKeydownHandler,!0),this._lightboxKeydownHandler=null),this._activeLightbox.remove(),this._activeLightbox=null;let e=this._lightboxReturnFocus;this._lightboxReturnFocus=null,e?.isConnected&&e.focus?.()}_isInsideLightbox(e){return!!e?.closest?.(`.${s.LIGHTBOX}`)}_findComment(e){return this.comments.find(t=>w(t.id,e))}_tooltipEl(e){return this.shadowRoot?.querySelector(`.${s.TOOLTIP}[data-for="${F(e)}"]`)??null}addReply(e,t,o=[]){let r=typeof e=="object"&&e!==null?e:this._findComment(e);if(!r)return null;r.replies||(r.replies=[]);let i={id:nt(),editedAt:null,text:t,author:this.options.user?.name||this.strings.anonymous,timestamp:new Date().toISOString(),screenshots:o};r.replies.push(i),this._syncStorage();let a=this._serializeComment(r),l=this._serializeReply(i);return this._emit("reply:added",[a,l],{comment:a,reply:l}),i}deleteReply(e,t){let o=this._findComment(e),r=o?.replies?.findIndex(c=>w(c.id,t))??-1;if(r<0)return!1;let[i]=o.replies.splice(r,1);this._syncStorage();let a=this._serializeComment(o),l=this._serializeReply(i);return this._emit("reply:deleted",[a,l],{comment:a,reply:l}),!0}editComment(e,t){let o=this._findComment(e),r=String(t??"").trim();if(!o||!r||r===o.text)return!1;o.text=r,o.editedAt=new Date().toISOString(),this._circles.get(String(o.id))?.setAttribute("aria-label",`${this.strings.commentAriaLabelPrefix}${o.text}`),this._syncStorage();let i=this._serializeComment(o);return this._emit("comment:edited",[i],{comment:i}),!0}editReply(e,t,o){let r=this._findComment(e),i=r?.replies?.find(d=>w(d.id,t)),a=String(o??"").trim();if(!i||!a||a===i.text)return!1;i.text=a,i.editedAt=new Date().toISOString(),this._syncStorage();let l=this._serializeComment(r),c=this._serializeReply(i);return this._emit("reply:edited",[l,c],{comment:l,reply:c}),!0}_serializeReply({id:e,text:t,author:o,timestamp:r,screenshots:i,editedAt:a}){return{id:e,text:t,author:o,timestamp:r,screenshots:i||[],editedAt:a||null}}_serializeComment(e){return{schemaVersion:1,id:e.id,text:e.text,editedAt:e.editedAt||null,anchor:e.anchor||null,page:e.page||location.pathname,replies:(e.replies||[]).map(t=>this._serializeReply(t)),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,t){if(!P.includes(t))return!1;let o=this._findComment(e);if(!o)return!1;if(o.status===t)return!0;o.status=t,o.resolvedAt=t==="resolved"?new Date().toISOString():null;let r=this._circles.get(String(o.id));r&&this.updateCommentPosition(o,r),this._syncStorage(),this.inboxView?.isOpen()&&this.inboxView.refresh();let i=this._serializeComment(o);return this._emit("comment:status-changed",[i],{comment:i}),!0}_commitUpdate(e){this._syncStorage(),this.inboxView?.isOpen()&&this.inboxView.refresh();let t=this._serializeComment(e);return this._emit("comment:updated",[t],{comment:t}),!0}setCommentType(e,t){if(t!==null&&!L.includes(t))return!1;let o=this._findComment(e);return o?(o.type=t,this._commitUpdate(o)):!1}setCommentPriority(e,t){if(t!==null&&!B.includes(t))return!1;let o=this._findComment(e);return o?(o.priority=t,this._commitUpdate(o)):!1}setCommentTags(e,t){if(!Array.isArray(t))return!1;let o=this._findComment(e);return o?(o.tags=$i(t),this._commitUpdate(o)):!1}serializeComments(){return this.comments.map(e=>this._serializeComment(e))}deleteComment(e){if(!this._findComment(e))return!1;if(this._removeComment(e),this.options.persistence==="localStorage"){let t=tt(this._readStoredCached().filter(o=>!w(o.id,e)),this.serializeComments(),location.pathname);we(t),this._storedCache=t}return this._emit("comment:deleted",[e],{id:e}),!0}_removeComment(e){this.markers.remove(e),this.comments=this.comments.filter(t=>!w(t.id,e))}clearComments(){this.closeThreadPopover();let e=this.comments;if(this.markers.clear(),this.comments=[],this.options.persistence==="localStorage"&&e.length>0){let t=new Set(e.map(r=>String(r.id))),o=this._readStoredCached().filter(r=>!t.has(String(r.id)));we(o),this._storedCache=o}this.inboxView?.isOpen()&&this.inboxView.refresh()}loadComments(e){let t=0,o=0,r=0;if(!Array.isArray(e))return{anchored:t,orphaned:o,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 a={id:i.id,text:i.text,editedAt:i.editedAt||null,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.filter(c=>c&&typeof c=="object"&&c.id!=null&&typeof c.text=="string").map(c=>Array.isArray(c.screenshots)?{...c,screenshots:Sn(c.screenshots)}:c):[],author:i.author||this.strings.anonymous,createdAt:i.createdAt||new Date().toISOString(),screenshots:Array.isArray(i.screenshots)?Sn(i.screenshots):[],status:i.status==="closed"?"resolved":P.includes(i.status)?i.status:"open",type:L.includes(i.type)?i.type:null,priority:B.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){a.anchorState="inactive",this.comments.push(a),r++;continue}let l=i.anchor?Qe(i.anchor):null;if(l)a.container=l.element,a.relativeX=i.anchor.relativeX,a.relativeY=i.anchor.relativeY,a.anchorState="anchored",this.comments.push(a),this.renderCommentCircle(a),t++;else{this.comments.push(a),o++;let c=this._serializeComment(a);this._emit("comment:anchor-lost",[c],{comment:c})}}return this._openPendingDetail(),{anchored:t,orphaned:o,inactive:r}}notifyNavigation(){let e=location.pathname,t=0,o=0,r=0;this.closeThreadPopover(),this.hideCommentBox(),this.inboxView&&(this.inboxView.currentPage=e);for(let i of this.comments){if(this.markers.remove(i.id),i.hidden=!1,i.target=null,i._occluded=!1,i.page&&i.page!==e){i.anchorState="inactive",i.container=null,r++;continue}let a=i.anchor?Qe(i.anchor):null;if(a)i.container=a.element,i.relativeX=i.anchor.relativeX,i.relativeY=i.anchor.relativeY,i.anchorState="anchored",this.renderCommentCircle(i),t++;else{i.container=null,i.anchorState="orphaned",o++;let l=this._serializeComment(i);this._emit("comment:anchor-lost",[l],{comment:l})}}return this._pendingDetailId=this._readPendingDetailId(),this.inboxView?.isOpen()&&this.inboxView.refresh(),this._openPendingDetail(),{anchored:t,orphaned:o,inactive:r}}scrollMarkerIntoView(e){this.markers.scrollMarkerIntoView(e)}createPreviewCircle(e,t){this.removePreviewCircle();let o=document.createElement("div");o.className=`${s.CIRCLE} ${s.PREVIEW_CIRCLE}`,o.style.position="absolute";let r=A/2;o.style.left=`${e+r}px`,o.style.top=`${t+r}px`,o.style.transform="translate(-50%, -50%)",o.style.pointerEvents="none",this.overlay.appendChild(o),this.previewCircle=o}removePreviewCircle(){this.previewCircle?.remove(),this.previewCircle=null}cleanupResizeObserver(e){this.markers.cleanupResizeObserver(e)}validateAndCalculatePosition(e,t){return this.markers.validateAndCalculatePosition(e,t)}updateCommentPosition(e,t){this.markers.updatePosition(e,t)}scheduleUpdatePositions(){this.markers.scheduleUpdate()}get _circles(){return this.markers?.circles}get resizeObservers(){return this.markers?.resizeObservers}get positionValidationEnabled(){return this.markers?.enabled??!0}set positionValidationEnabled(e){this.markers&&(this.markers.enabled=e)}get _globalMutationObserver(){return this.markers?._globalMutationObserver??null}_dismissMarkerUi(e){this._tooltipEl(e.id)?.remove(),this.activeThreadPopover?.dataset.for===String(e.id)&&this.closeThreadPopover()}cleanup(){this._onDomReady&&(document.removeEventListener("DOMContentLoaded",this._onDomReady),this._onDomReady=null),this.markers?.destroy(),this._storageHandler&&(window.removeEventListener("storage",this._storageHandler),this._storageHandler=null),this._popstateHandler&&(window.removeEventListener("popstate",this._popstateHandler),this._popstateHandler=null),this._storedCache=null,ve(),hn(),this.closeThreadPopover(),this.closeInbox(),this.closeLightbox(),this.removePreviewCircle(),this._captureFlow?.destroy(),this._pendingScreenshots=[],this._handleDocumentClickBound&&document.removeEventListener("mousedown",this._handleDocumentClickBound),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),this._detachStyles(),document.querySelector(R)?.remove()}injectStyles(){this._detachStyles(),this._styleDetachers=[qe(this.shadowRoot,Wt(),S.STYLES),qe(document,jt(),S.GLOBAL_STYLES)]}_detachStyles(){for(let e of this._styleDetachers??[])e();this._styleDetachers=[]}},pt=ht;function wn(n={}){let{autoInit:e=!0,...t}=n,o=()=>new pt(t);return e?o():o}var Fi=wn;return Ln(Xi);})();