@siteping/widget 0.9.4 → 0.9.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,28 +1,28 @@
1
- var M,ce,Fe;function Le(t,e){if(Fe=new Date,t.nodeType!==Node.ELEMENT_NODE)throw new Error("Can't generate CSS selector for non-element node type.");if(t.tagName.toLowerCase()==="html")return"html";let n={root:document.body,idName:s=>!0,className:s=>!0,tagName:s=>!0,attr:(s,o)=>!1,seedMinLength:1,optimizedMinLength:2,threshold:1e3,maxNumberOfTries:1e4,timeoutMs:void 0};M={...n,...e},ce=ut(M.root,n);let i=K(t,"all",()=>K(t,"two",()=>K(t,"one",()=>K(t,"none"))));if(i){let s=Re(Pe(i,t));return s.length>0&&(i=s[0]),q(i)}else throw new Error("Selector was not found.")}function ut(t,e){return t.nodeType===Node.DOCUMENT_NODE?t:t===e.root?t.ownerDocument:t}function K(t,e,n){let i=null,s=[],o=t,r=0;for(;o;){let a=new Date().getTime()-Fe.getTime();if(M.timeoutMs!==void 0&&a>M.timeoutMs)throw new Error(`Timeout: Can't find a unique selector after ${a}ms`);let l=W(ht(o))||W(...ft(o))||W(...mt(o))||W(gt(o))||[Ae()],c=bt(o);if(e=="all")c&&(l=l.concat(l.filter(le).map(d=>Y(d,c))));else if(e=="two")l=l.slice(0,1),c&&(l=l.concat(l.filter(le).map(d=>Y(d,c))));else if(e=="one"){let[d]=l=l.slice(0,1);c&&le(d)&&(l=[Y(d,c)])}else e=="none"&&(l=[Ae()],c&&(l=[Y(l[0],c)]));for(let d of l)d.level=r;if(s.push(l),s.length>=M.seedMinLength&&(i=Te(s,n),i))break;o=o.parentElement,r++}return i||(i=Te(s,n)),!i&&n?n():i}function Te(t,e){let n=Re(Ie(t));if(n.length>M.threshold)return e?e():null;for(let i of n)if(Me(i))return i;return null}function q(t){let e=t[0],n=e.name;for(let i=1;i<t.length;i++){let s=t[i].level||0;e.level===s-1?n=`${t[i].name} > ${n}`:n=`${t[i].name} ${n}`,e=t[i]}return n}function Se(t){return t.map(e=>e.penalty).reduce((e,n)=>e+n,0)}function Me(t){let e=q(t);switch(ce.querySelectorAll(e).length){case 0:throw new Error(`Can't select any node with this selector: ${e}`);case 1:return!0;default:return!1}}function ht(t){let e=t.getAttribute("id");return e&&M.idName(e)?{name:"#"+CSS.escape(e),penalty:0}:null}function ft(t){return Array.from(t.attributes).filter(n=>M.attr(n.name,n.value)).map(n=>({name:`[${CSS.escape(n.name)}="${CSS.escape(n.value)}"]`,penalty:.5}))}function mt(t){return Array.from(t.classList).filter(M.className).map(n=>({name:"."+CSS.escape(n),penalty:1}))}function gt(t){let e=t.tagName.toLowerCase();return M.tagName(e)?{name:e,penalty:2}:null}function Ae(){return{name:"*",penalty:3}}function bt(t){let e=t.parentNode;if(!e)return null;let n=e.firstChild;if(!n)return null;let i=0;for(;n&&(n.nodeType===Node.ELEMENT_NODE&&i++,n!==t);)n=n.nextSibling;return i}function Y(t,e){return{name:t.name+`:nth-child(${e})`,penalty:t.penalty+1}}function le(t){return t.name!=="html"&&!t.name.startsWith("#")}function W(...t){let e=t.filter(yt);return e.length>0?e:null}function yt(t){return t!=null}function*Ie(t,e=[]){if(t.length>0)for(let n of t[0])yield*Ie(t.slice(1,t.length),e.concat(n));else yield e}function Re(t){return[...t].sort((e,n)=>Se(e)-Se(n))}function*Pe(t,e,n={counter:0,visited:new Map}){if(t.length>2&&t.length>M.optimizedMinLength)for(let i=1;i<t.length-1;i++){if(n.counter>M.maxNumberOfTries)return;n.counter+=1;let s=[...t];s.splice(i,1);let o=q(s);if(n.visited.has(o))return;Me(s)&&vt(s,e)&&(yield s,n.visited.set(o,!0),yield*Pe(s,e,n))}}function vt(t,e){return ce.querySelector(q(t))===e}var xt=["role","aria-label","type","name","href","src","data-testid","data-id"];function kt(t){let e=5381;for(let n=0;n<t.length;n++)e=(e<<5)+e+t.charCodeAt(n)|0;return(e>>>0).toString(36)}function de(t){let e=t.children.length,n=0,i=t.parentElement;if(i)for(let r of i.children){if(r===t)break;r.tagName===t.tagName&&n++}let s=[];for(let r of xt){let a=t.getAttribute(r);a&&s.push(`${r}=${a}`)}let o=s.length>0?kt(s.join(",")):"0";return`${e}:${n}:${o}`}function Be(t,e){let n=e.split(":");if(n.length!==3)return 0;let[i,s,o]=n,r=Number(i),a=Number(s);if(Number.isNaN(r)||Number.isNaN(a))return 0;let l=de(t),[c,d,p]=l.split(":"),f=0,m=Math.abs(Number(c)-r);m===0?f+=.2:m<=2?f+=.1:m<=5&&(f+=.03);let y=Math.abs(Number(d)-a);return y===0?f+=.4:y===1?f+=.2:y<=3&&(f+=.08),p===o&&(f+=.4),f}function N(t,e){let n=e==="before"?"previousElementSibling":"nextElementSibling",i=t[n],s=3;for(;i&&s>0;){let o=i.textContent?.trim();if(o)return e==="before"?o.slice(-32):o.slice(0,32);i=i[n],s--}return""}function U(t){let e=t.previousElementSibling?.textContent?.trim().slice(0,40)??"",n=t.nextElementSibling?.textContent?.trim().slice(0,40)??"";return[e,n].filter(Boolean).join(" | ")}function Ne(t){if(t.id){let i=t.id.includes("'")?`concat('${t.id.replace(/'/g,`',"'",'`)}')`:`'${t.id}'`;return`//${t.localName}[@id=${i}]`}let e=[],n=t;for(;n&&n!==document.body&&e.length<6;){let i=n.localName,s=n.parentElement;if(n.id){let r=n.id.includes("'")?`concat('${n.id.replace(/'/g,`',"'",'`)}')`:`'${n.id}'`;return e.unshift(`/${i}[@id=${r}]`),"/"+e.join("")}let o=1;if(s)for(let r of s.children){if(r===n)break;r.localName===i&&o++}e.unshift(`/${i}[${o}]`),n=s}return"/html/body"+e.join("")}function pe(t){let e=Le(t,{className:c=>!/^(css|sc|emotion|styled)-/.test(c)&&!/^[a-z]{1,3}[A-Za-z0-9]{4,8}$/.test(c),attr:c=>["data-testid","data-id","role","aria-label"].includes(c),idName:c=>!c.startsWith("radix-")&&!/^:r[0-9]+:$/.test(c),seedMinLength:3,optimizedMinLength:2}),n=Ne(t),s=(t.textContent?.trim()??"").slice(0,120),o=N(t,"before"),r=N(t,"after"),a=de(t),l=U(t);return{cssSelector:e,xpath:n,textSnippet:s,textPrefix:o,textSuffix:r,fingerprint:a,neighborText:l,elementTag:t.tagName,elementId:t.id||void 0}}function $e(t,e=document.documentElement){let n=t.x+t.width/2,i=t.y+t.height/2,s=document.elementFromPoint(n,i);if(!s||s===e)return document.body;let o=s,r=s;for(;r&&r!==document.body;){let a=r.getBoundingClientRect();if(a.left<=t.x&&a.top<=t.y&&a.right>=t.x+t.width&&a.bottom>=t.y+t.height){o=r;break}r=r.parentElement}return o}function De(t,e){return e.width<=0||e.height<=0?{xPct:0,yPct:0,wPct:1,hPct:1}:{xPct:(t.x-e.x)/e.width,yPct:(t.y-e.y)/e.height,wPct:t.width/e.width,hPct:t.height/e.height}}function F(t){let i=document.createRange().createContextualFragment(t).firstElementChild;if(!i||i.nodeName.toLowerCase()!=="svg")throw new Error("[siteping] Invalid SVG string");for(let s of[...i.attributes])s.name.startsWith("on")&&i.removeAttribute(s.name);for(let s of i.querySelectorAll("*"))for(let o of[...s.attributes])o.name.startsWith("on")&&s.removeAttribute(o.name);return i}function h(t,e){let n=document.createElement(t);if(e)for(let[i,s]of Object.entries(e))i==="class"?n.className=s:i==="style"?n.style.cssText=s:n.setAttribute(i,s);return n}function b(t,e){t.textContent=e}function X(t,e="fr"){let n=Date.now()-new Date(t).getTime(),i=Math.floor(n/1e3);if(i<60)return new Intl.RelativeTimeFormat(e,{numeric:"auto"}).format(0,"second");let s=new Intl.RelativeTimeFormat(e,{numeric:"always",style:"narrow"}),o=Math.floor(i/60);if(o<60)return s.format(-o,"minute");let r=Math.floor(o/60);if(r<24)return s.format(-r,"hour");let a=Math.floor(r/24);return a<7?s.format(-a,"day"):new Date(t).toLocaleDateString(e)}var ue='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/><circle cx="12" cy="10" r="1" fill="currentColor" stroke="none"/><circle cx="8" cy="10" r="1" fill="currentColor" stroke="none"/><circle cx="16" cy="10" r="1" fill="currentColor" stroke="none"/></svg>',He='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg>',Oe='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="3" width="18" height="18" rx="2"/><path d="M3 9h18"/><path d="M9 3v18"/></svg>',he='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></svg>',fe='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94"/><path d="M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19"/><line x1="1" y1="1" x2="23" y2="23"/></svg>',G='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>',je='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>',ze='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="20 6 9 17 4 12"/></svg>',_e='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="10"/><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/><line x1="12" y1="17" x2="12.01" y2="17"/></svg>',Ke='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"/></svg>',Ye='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="8" y="6" width="8" height="14" rx="4"/><path d="M19 9h2"/><path d="M3 9h2"/><path d="M19 13h2"/><path d="M3 13h2"/><path d="M19 17h2"/><path d="M3 17h2"/><path d="M10 2h4"/></svg>',We='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="1"/><circle cx="19" cy="12" r="1"/><circle cx="5" cy="12" r="1"/></svg>',qe='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="1 4 1 10 7 10"/><path d="M3.51 15a9 9 0 1 0 2.13-9.36L1 10"/></svg>',me='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="3 6 5 6 21 6"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/><line x1="10" y1="11" x2="10" y2="17"/><line x1="14" y1="11" x2="14" y2="17"/></svg>';var Xe="#0066ff",wt=/^#[0-9a-fA-F]{6}$/,Ue=/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/,Et=/^#[0-9a-fA-F]{8}$/;function Ct(t){if(wt.test(t))return t;let e=Ue.test(t)?t.match(Ue):null;return e?`#${e[1]}${e[1]}${e[2]}${e[2]}${e[3]}${e[3]}`:Et.test(t)?t.slice(0,7):(console.warn(`[siteping] Invalid accentColor "${t}" \u2014 only hex colors (#RGB, #RRGGBB, #RRGGBBAA) are supported. Using default.`),Xe)}function Tt(t,e){let n=Math.max(0,Math.round(parseInt(t.slice(1,3),16)*(1-e))),i=Math.max(0,Math.round(parseInt(t.slice(3,5),16)*(1-e))),s=Math.max(0,Math.round(parseInt(t.slice(5,7),16)*(1-e)));return`#${n.toString(16).padStart(2,"0")}${i.toString(16).padStart(2,"0")}${s.toString(16).padStart(2,"0")}`}function St(){return typeof window>"u"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function At(t){return t==="dark"||t==="auto"&&St()?"dark":"light"}function Ge(t=Xe,e){let n=Ct(t),i=Tt(n,.15);return At(e)==="dark"?{accent:n,accentLight:n+"22",accentDark:i,accentGlow:n+"44",accentGradient:`linear-gradient(135deg, ${n}, ${i})`,bg:"#0f172a",bgHover:"#1e293b",text:"#f1f5f9",textSecondary:"#94a3b8",textTertiary:"#64748b",border:"#334155",shadow:"rgba(0, 0, 0, 0.3)",glassBg:"rgba(15, 23, 42, 0.78)",glassBgHeavy:"rgba(15, 23, 42, 0.88)",glassBorder:"rgba(51, 65, 85, 0.5)",glassBorderSubtle:"rgba(51, 65, 85, 0.3)",typeQuestion:"#60a5fa",typeChange:"#fbbf24",typeBug:"#f87171",typeOther:"#94a3b8",typeQuestionBg:"rgba(59, 130, 246, 0.15)",typeChangeBg:"rgba(245, 158, 11, 0.15)",typeBugBg:"rgba(239, 68, 68, 0.15)",typeOtherBg:"rgba(100, 116, 139, 0.15)"}:{accent:n,accentLight:n+"14",accentDark:i,accentGlow:n+"33",accentGradient:`linear-gradient(135deg, ${n}, ${i})`,bg:"#ffffff",bgHover:"#f8f9fb",text:"#0f172a",textSecondary:"#475569",textTertiary:"#64748b",border:"#e2e8f0",shadow:"rgba(0, 0, 0, 0.06)",glassBg:"rgba(255, 255, 255, 0.72)",glassBgHeavy:"rgba(255, 255, 255, 0.85)",glassBorder:"rgba(255, 255, 255, 0.35)",glassBorderSubtle:"rgba(255, 255, 255, 0.18)",typeQuestion:"#3b82f6",typeChange:"#b45309",typeBug:"#ef4444",typeOther:"#64748b",typeQuestionBg:"#eff6ff",typeChangeBg:"#fffbeb",typeBugBg:"#fef2f2",typeOtherBg:"#f8fafc"}}function I(t,e){switch(t){case"question":return e.typeQuestion;case"change":return e.typeChange;case"bug":return e.typeBug;default:return e.typeOther}}function P(t,e){switch(t){case"question":return e.typeQuestionBg;case"change":return e.typeChangeBg;case"bug":return e.typeBugBg;default:return e.typeOtherBg}}function Ve(t){return`
2
- --sp-accent: ${t.accent};
3
- --sp-accent-light: ${t.accentLight};
4
- --sp-accent-dark: ${t.accentDark};
5
- --sp-accent-glow: ${t.accentGlow};
6
- --sp-accent-gradient: ${t.accentGradient};
7
- --sp-bg: ${t.bg};
8
- --sp-bg-hover: ${t.bgHover};
9
- --sp-text: ${t.text};
10
- --sp-text-secondary: ${t.textSecondary};
11
- --sp-text-tertiary: ${t.textTertiary};
12
- --sp-border: ${t.border};
13
- --sp-shadow: ${t.shadow};
14
- --sp-glass-bg: ${t.glassBg};
15
- --sp-glass-bg-heavy: ${t.glassBgHeavy};
16
- --sp-glass-border: ${t.glassBorder};
17
- --sp-glass-border-subtle: ${t.glassBorderSubtle};
18
- --sp-type-question: ${t.typeQuestion};
19
- --sp-type-change: ${t.typeChange};
20
- --sp-type-bug: ${t.typeBug};
21
- --sp-type-other: ${t.typeOther};
22
- --sp-type-question-bg: ${t.typeQuestionBg};
23
- --sp-type-change-bg: ${t.typeChangeBg};
24
- --sp-type-bug-bg: ${t.typeBugBg};
25
- --sp-type-other-bg: ${t.typeOtherBg};
1
+ var F,we,Ge;function Qe(n,e){if(Ge=new Date,n.nodeType!==Node.ELEMENT_NODE)throw new Error("Can't generate CSS selector for non-element node type.");if(n.tagName.toLowerCase()==="html")return"html";let t={root:document.body,idName:o=>!0,className:o=>!0,tagName:o=>!0,attr:(o,i)=>!1,seedMinLength:1,optimizedMinLength:2,threshold:1e3,maxNumberOfTries:1e4,timeoutMs:void 0};F={...t,...e},we=is(F.root,t);let s=Y(n,"all",()=>Y(n,"two",()=>Y(n,"one",()=>Y(n,"none"))));if(s){let o=et(tt(s,n));return o.length>0&&(s=o[0]),W(s)}else throw new Error("Selector was not found.")}function is(n,e){return n.nodeType===Node.DOCUMENT_NODE?n:n===e.root?n.ownerDocument:n}function Y(n,e,t){let s=null,o=[],i=n,r=0;for(;i;){let a=new Date().getTime()-Ge.getTime();if(F.timeoutMs!==void 0&&a>F.timeoutMs)throw new Error(`Timeout: Can't find a unique selector after ${a}ms`);let p=U(rs(i))||U(...as(i))||U(...ls(i))||U(ps(i))||[Ve()],d=ds(i);if(e=="all")d&&(p=p.concat(p.filter(ke).map(u=>q(u,d))));else if(e=="two")p=p.slice(0,1),d&&(p=p.concat(p.filter(ke).map(u=>q(u,d))));else if(e=="one"){let[u]=p=p.slice(0,1);d&&ke(u)&&(p=[q(u,d)])}else e=="none"&&(p=[Ve()],d&&(p=[q(p[0],d)]));for(let u of p)u.level=r;if(o.push(p),o.length>=F.seedMinLength&&(s=We(o,t),s))break;i=i.parentElement,r++}return s||(s=We(o,t)),!s&&t?t():s}function We(n,e){let t=et(Ze(n));if(t.length>F.threshold)return e?e():null;for(let s of t)if(Je(s))return s;return null}function W(n){let e=n[0],t=e.name;for(let s=1;s<n.length;s++){let o=n[s].level||0;e.level===o-1?t=`${n[s].name} > ${t}`:t=`${n[s].name} ${t}`,e=n[s]}return t}function Xe(n){return n.map(e=>e.penalty).reduce((e,t)=>e+t,0)}function Je(n){let e=W(n);switch(we.querySelectorAll(e).length){case 0:throw new Error(`Can't select any node with this selector: ${e}`);case 1:return!0;default:return!1}}function rs(n){let e=n.getAttribute("id");return e&&F.idName(e)?{name:"#"+CSS.escape(e),penalty:0}:null}function as(n){return Array.from(n.attributes).filter(t=>F.attr(t.name,t.value)).map(t=>({name:`[${CSS.escape(t.name)}="${CSS.escape(t.value)}"]`,penalty:.5}))}function ls(n){return Array.from(n.classList).filter(F.className).map(t=>({name:"."+CSS.escape(t),penalty:1}))}function ps(n){let e=n.tagName.toLowerCase();return F.tagName(e)?{name:e,penalty:2}:null}function Ve(){return{name:"*",penalty:3}}function ds(n){let e=n.parentNode;if(!e)return null;let t=e.firstChild;if(!t)return null;let s=0;for(;t&&(t.nodeType===Node.ELEMENT_NODE&&s++,t!==n);)t=t.nextSibling;return s}function q(n,e){return{name:n.name+`:nth-child(${e})`,penalty:n.penalty+1}}function ke(n){return n.name!=="html"&&!n.name.startsWith("#")}function U(...n){let e=n.filter(cs);return e.length>0?e:null}function cs(n){return n!=null}function*Ze(n,e=[]){if(n.length>0)for(let t of n[0])yield*Ze(n.slice(1,n.length),e.concat(t));else yield e}function et(n){return[...n].sort((e,t)=>Xe(e)-Xe(t))}function*tt(n,e,t={counter:0,visited:new Map}){if(n.length>2&&n.length>F.optimizedMinLength)for(let s=1;s<n.length-1;s++){if(t.counter>F.maxNumberOfTries)return;t.counter+=1;let o=[...n];o.splice(s,1);let i=W(o);if(t.visited.has(i))return;Je(o)&&us(o,e)&&(yield o,t.visited.set(i,!0),yield*tt(o,e,t))}}function us(n,e){return we.querySelector(W(n))===e}var hs=["role","aria-label","type","name","href","src","data-testid","data-id"];function bs(n){let e=5381;for(let t=0;t<n.length;t++)e=(e<<5)+e+n.charCodeAt(t)|0;return(e>>>0).toString(36)}function Ce(n){let e=n.children.length,t=0,s=n.parentElement;if(s)for(let r of s.children){if(r===n)break;r.tagName===n.tagName&&t++}let o=[];for(let r of hs){let a=n.getAttribute(r);a&&o.push(`${r}=${a}`)}let i=o.length>0?bs(o.join(",")):"0";return`${e}:${t}:${i}`}function st(n,e){let t=e.split(":");if(t.length!==3)return 0;let[s,o,i]=t,r=Number(s),a=Number(o);if(Number.isNaN(r)||Number.isNaN(a))return 0;let p=Ce(n),[d,u,h]=p.split(":"),b=0,f=Math.abs(Number(d)-r);f===0?b+=.2:f<=2?b+=.1:f<=5&&(b+=.03);let k=Math.abs(Number(u)-a);return k===0?b+=.4:k===1?b+=.2:k<=3&&(b+=.08),h===i&&(b+=.4),b}function D(n,e){let t=e==="before"?"previousElementSibling":"nextElementSibling",s=n[t],o=3;for(;s&&o>0;){let i=s.textContent?.trim();if(i)return e==="before"?i.slice(-32):i.slice(0,32);s=s[t],o--}return""}function X(n){let e=n.previousElementSibling?.textContent?.trim().slice(0,40)??"",t=n.nextElementSibling?.textContent?.trim().slice(0,40)??"";return[e,t].filter(Boolean).join(" | ")}function nt(n){if(n.id){let s=n.id.includes("'")?`concat('${n.id.replace(/'/g,`',"'",'`)}')`:`'${n.id}'`;return`//${n.localName}[@id=${s}]`}let e=[],t=n;for(;t&&t!==document.body&&e.length<6;){let s=t.localName,o=t.parentElement;if(t.id){let r=t.id.includes("'")?`concat('${t.id.replace(/'/g,`',"'",'`)}')`:`'${t.id}'`;return e.unshift(`/${s}[@id=${r}]`),"/"+e.join("")}let i=1;if(o)for(let r of o.children){if(r===t)break;r.localName===s&&i++}e.unshift(`/${s}[${i}]`),t=o}return"/html/body"+e.join("")}function Ee(n){let e=Qe(n,{className:d=>!/^(css|sc|emotion|styled)-/.test(d)&&!/^[a-z]{1,3}[A-Za-z0-9]{4,8}$/.test(d),attr:d=>["data-testid","data-id","role","aria-label"].includes(d),idName:d=>!d.startsWith("radix-")&&!/^:r[0-9]+:$/.test(d),seedMinLength:3,optimizedMinLength:2}),t=nt(n),o=(n.textContent?.trim()??"").slice(0,120),i=D(n,"before"),r=D(n,"after"),a=Ce(n),p=X(n);return{cssSelector:e,xpath:t,textSnippet:o,textPrefix:i,textSuffix:r,fingerprint:a,neighborText:p,elementTag:n.tagName,elementId:n.id||void 0}}function ot(n,e=document.documentElement){let t=n.x+n.width/2,s=n.y+n.height/2,o=document.elementFromPoint(t,s);if(!o||o===e)return document.body;let i=o;for(;i&&i!==document.body;){let r=i.getBoundingClientRect();if(r.left<=n.x&&r.top<=n.y&&r.right>=n.x+n.width&&r.bottom>=n.y+n.height)return i;i=i.parentElement}return document.body}function it(n,e){return e.width<=0||e.height<=0?{xPct:0,yPct:0,wPct:1,hPct:1}:{xPct:(n.x-e.x)/e.width,yPct:(n.y-e.y)/e.height,wPct:n.width/e.width,hPct:n.height/e.height}}function v(n){let s=document.createRange().createContextualFragment(n).firstElementChild;if(!s||s.nodeName.toLowerCase()!=="svg")throw new Error("[siteping] Invalid SVG string");for(let o of[...s.attributes])o.name.startsWith("on")&&s.removeAttribute(o.name);for(let o of s.querySelectorAll("*"))for(let i of[...o.attributes])i.name.startsWith("on")&&o.removeAttribute(i.name);return s}function l(n,e){let t=document.createElement(n);if(e)for(let[s,o]of Object.entries(e))s==="class"?t.className=o:s==="style"?t.style.cssText=o:t.setAttribute(s,o);return t}function c(n,e){n.textContent=e}function V(n,e="en"){let t=Date.now()-new Date(n).getTime(),s=Math.floor(t/1e3);if(s<60)return new Intl.RelativeTimeFormat(e,{numeric:"auto"}).format(0,"second");let o=new Intl.RelativeTimeFormat(e,{numeric:"always",style:"narrow"}),i=Math.floor(s/60);if(i<60)return o.format(-i,"minute");let r=Math.floor(i/60);if(r<24)return o.format(-r,"hour");let a=Math.floor(r/24);return a<7?o.format(-a,"day"):new Date(n).toLocaleDateString(e)}var Te='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/><circle cx="12" cy="10" r="1" fill="currentColor" stroke="none"/><circle cx="8" cy="10" r="1" fill="currentColor" stroke="none"/><circle cx="16" cy="10" r="1" fill="currentColor" stroke="none"/></svg>',rt='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg>',at='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="3" width="18" height="18" rx="2"/><path d="M3 9h18"/><path d="M9 3v18"/></svg>',Se='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></svg>',Ae='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94"/><path d="M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19"/><line x1="1" y1="1" x2="23" y2="23"/></svg>',G='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>',lt='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>',Q='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="20 6 9 17 4 12"/></svg>',J='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="10"/><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/><line x1="12" y1="17" x2="12.01" y2="17"/></svg>',Z='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"/></svg>',ee='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="8" y="6" width="8" height="14" rx="4"/><path d="M19 9h2"/><path d="M3 9h2"/><path d="M19 13h2"/><path d="M3 13h2"/><path d="M19 17h2"/><path d="M3 17h2"/><path d="M10 2h4"/></svg>',te='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="1"/><circle cx="19" cy="12" r="1"/><circle cx="5" cy="12" r="1"/></svg>',Le='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polygon points="12 2 2 7 12 12 22 7 12 2"/><polyline points="2 17 12 22 22 17"/><polyline points="2 12 12 17 22 12"/></svg>',pt='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="9"/><circle cx="12" cy="12" r="3" fill="currentColor" stroke="none"/></svg>',dt='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="6 9 12 15 18 9"/></svg>',ct='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="1 4 1 10 7 10"/><path d="M3.51 15a9 9 0 1 0 2.13-9.36L1 10"/></svg>',Me='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="3 6 5 6 21 6"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/><line x1="10" y1="11" x2="10" y2="17"/><line x1="14" y1="11" x2="14" y2="17"/></svg>';var ht="#0066ff",gs=/^#[0-9a-fA-F]{6}$/,ut=/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/,ms=/^#[0-9a-fA-F]{8}$/;function fs(n){if(gs.test(n))return n;let e=ut.test(n)?n.match(ut):null;return e?`#${e[1]}${e[1]}${e[2]}${e[2]}${e[3]}${e[3]}`:ms.test(n)?n.slice(0,7):(console.warn(`[siteping] Invalid accentColor "${n}" \u2014 only hex colors (#RGB, #RRGGBB, #RRGGBBAA) are supported. Using default.`),ht)}function vs(n,e){let t=Math.max(0,Math.round(parseInt(n.slice(1,3),16)*(1-e))),s=Math.max(0,Math.round(parseInt(n.slice(3,5),16)*(1-e))),o=Math.max(0,Math.round(parseInt(n.slice(5,7),16)*(1-e)));return`#${t.toString(16).padStart(2,"0")}${s.toString(16).padStart(2,"0")}${o.toString(16).padStart(2,"0")}`}function ys(){return typeof window>"u"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function xs(n){return n==="dark"||n==="auto"&&ys()?"dark":"light"}function bt(n=ht,e){let t=fs(n),s=vs(t,.15);return xs(e)==="dark"?{accent:t,accentLight:t+"22",accentDark:s,accentGlow:t+"44",accentGradient:`linear-gradient(135deg, ${t}, ${s})`,bg:"#0f172a",bgHover:"#1e293b",text:"#f1f5f9",textSecondary:"#94a3b8",textTertiary:"#64748b",border:"#334155",shadow:"rgba(0, 0, 0, 0.3)",glassBg:"rgba(15, 23, 42, 0.78)",glassBgHeavy:"rgba(15, 23, 42, 0.88)",glassBorder:"rgba(51, 65, 85, 0.5)",glassBorderSubtle:"rgba(51, 65, 85, 0.3)",typeQuestion:"#60a5fa",typeChange:"#fbbf24",typeBug:"#f87171",typeOther:"#94a3b8",typeQuestionBg:"rgba(59, 130, 246, 0.15)",typeChangeBg:"rgba(245, 158, 11, 0.15)",typeBugBg:"rgba(239, 68, 68, 0.15)",typeOtherBg:"rgba(100, 116, 139, 0.15)",statusOpen:"#4ade80",statusOpenBg:"rgba(74, 222, 128, 0.15)",statusResolved:"#94a3b8",statusResolvedBg:"rgba(148, 163, 184, 0.15)"}:{accent:t,accentLight:t+"14",accentDark:s,accentGlow:t+"33",accentGradient:`linear-gradient(135deg, ${t}, ${s})`,bg:"#ffffff",bgHover:"#f8f9fb",text:"#0f172a",textSecondary:"#475569",textTertiary:"#64748b",border:"#e2e8f0",shadow:"rgba(0, 0, 0, 0.06)",glassBg:"rgba(255, 255, 255, 0.72)",glassBgHeavy:"rgba(255, 255, 255, 0.85)",glassBorder:"rgba(255, 255, 255, 0.35)",glassBorderSubtle:"rgba(255, 255, 255, 0.18)",typeQuestion:"#3b82f6",typeChange:"#b45309",typeBug:"#ef4444",typeOther:"#64748b",typeQuestionBg:"#eff6ff",typeChangeBg:"#fffbeb",typeBugBg:"#fef2f2",typeOtherBg:"#f8fafc",statusOpen:"#16a34a",statusOpenBg:"#f0fdf4",statusResolved:"#64748b",statusResolvedBg:"#f1f5f9"}}function M(n,e){switch(n){case"question":return e.typeQuestion;case"change":return e.typeChange;case"bug":return e.typeBug;default:return e.typeOther}}function P(n,e){switch(n){case"question":return e.typeQuestionBg;case"change":return e.typeChangeBg;case"bug":return e.typeBugBg;default:return e.typeOtherBg}}function gt(n){return`
2
+ --sp-accent: ${n.accent};
3
+ --sp-accent-light: ${n.accentLight};
4
+ --sp-accent-dark: ${n.accentDark};
5
+ --sp-accent-glow: ${n.accentGlow};
6
+ --sp-accent-gradient: ${n.accentGradient};
7
+ --sp-bg: ${n.bg};
8
+ --sp-bg-hover: ${n.bgHover};
9
+ --sp-text: ${n.text};
10
+ --sp-text-secondary: ${n.textSecondary};
11
+ --sp-text-tertiary: ${n.textTertiary};
12
+ --sp-border: ${n.border};
13
+ --sp-shadow: ${n.shadow};
14
+ --sp-glass-bg: ${n.glassBg};
15
+ --sp-glass-bg-heavy: ${n.glassBgHeavy};
16
+ --sp-glass-border: ${n.glassBorder};
17
+ --sp-glass-border-subtle: ${n.glassBorderSubtle};
18
+ --sp-type-question: ${n.typeQuestion};
19
+ --sp-type-change: ${n.typeChange};
20
+ --sp-type-bug: ${n.typeBug};
21
+ --sp-type-other: ${n.typeOther};
22
+ --sp-type-question-bg: ${n.typeQuestionBg};
23
+ --sp-type-change-bg: ${n.typeChangeBg};
24
+ --sp-type-bug-bg: ${n.typeBugBg};
25
+ --sp-type-other-bg: ${n.typeOtherBg};
26
26
  --sp-radius: 12px;
27
27
  --sp-radius-lg: 16px;
28
28
  --sp-radius-xl: 20px;
@@ -35,9 +35,9 @@ var M,ce,Fe;function Le(t,e){if(Fe=new Date,t.nodeType!==Node.ELEMENT_NODE)throw
35
35
  --sp-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.04);
36
36
  --sp-shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.12), 0 8px 16px rgba(0, 0, 0, 0.06);
37
37
  --sp-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
38
- `}var V=class{constructor(e,n){this.colors=e;this.t=n;this.root=h("div",{style:`
38
+ `}var se=class{constructor(e,t){this.colors=e;this.t=t;this.root=l("div",{style:`
39
39
  position:fixed;
40
- z-index:2147483647;
40
+ z-index:${2147483647};
41
41
  width:300px;
42
42
  padding:16px;
43
43
  border-radius:16px;
@@ -52,7 +52,7 @@ var M,ce,Fe;function Le(t,e){if(Fe=new Date,t.nodeType!==Node.ELEMENT_NODE)throw
52
52
  transition:opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1),transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
53
53
  display:none;
54
54
  -webkit-font-smoothing:antialiased;
55
- `}),this.root.setAttribute("role","dialog"),this.root.setAttribute("aria-modal","true"),this.root.setAttribute("aria-label",this.t("popup.ariaLabel"));let i=[{type:"question",label:this.t("type.question"),icon:_e},{type:"change",label:this.t("type.change"),icon:Ke},{type:"bug",label:this.t("type.bug"),icon:Ye},{type:"other",label:this.t("type.other"),icon:We}],s=h("div",{style:"display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-bottom:12px;"});for(let d of i){let p=document.createElement("button");p.style.cssText=`
55
+ `}),this.root.setAttribute("role","dialog"),this.root.setAttribute("aria-modal","true"),this.root.setAttribute("aria-label",this.t("popup.ariaLabel"));let s=[{type:"question",label:this.t("type.question"),icon:J},{type:"change",label:this.t("type.change"),icon:Z},{type:"bug",label:this.t("type.bug"),icon:ee},{type:"other",label:this.t("type.other"),icon:te}],o=l("div",{style:"display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-bottom:12px;"});for(let u of s){let h=document.createElement("button");h.style.cssText=`
56
56
  height:44px;
57
57
  border-radius:9999px;border:1px solid ${this.colors.border};
58
58
  background:${this.colors.glassBg};cursor:pointer;
@@ -61,7 +61,7 @@ var M,ce,Fe;function Le(t,e){if(Fe=new Date,t.nodeType!==Node.ELEMENT_NODE)throw
61
61
  font-size:13px;font-weight:500;color:${this.colors.textTertiary};
62
62
  transition:all 0.2s ease;
63
63
  padding:0 12px;
64
- `;let f=F(d.icon);f.setAttribute("style","width:13px;height:13px;flex-shrink:0;"),p.appendChild(f);let m=document.createElement("span");b(m,d.label),p.appendChild(m),p.dataset.type=d.type,p.setAttribute("aria-pressed","false"),p.addEventListener("click",()=>{this.selectType(d.type,s)}),p.addEventListener("mouseenter",()=>{if(p.dataset.type!==this.selectedType){let y=P(p.dataset.type??"",this.colors);p.style.background=y,p.style.borderColor=I(p.dataset.type??"",this.colors)+"40"}}),p.addEventListener("mouseleave",()=>{p.dataset.type!==this.selectedType&&(p.style.background=this.colors.glassBg,p.style.borderColor=this.colors.border)}),s.appendChild(p)}this.textarea=document.createElement("textarea"),this.textarea.style.cssText=`
64
+ `;let b=v(u.icon);b.setAttribute("style","width:13px;height:13px;flex-shrink:0;"),h.appendChild(b);let f=document.createElement("span");c(f,u.label),h.appendChild(f),h.dataset.type=u.type,h.setAttribute("aria-pressed","false"),h.addEventListener("click",()=>{this.selectType(u.type,o)}),h.addEventListener("mouseenter",()=>{if(h.dataset.type!==this.selectedType){let k=P(h.dataset.type??"",this.colors);h.style.background=k,h.style.borderColor=M(h.dataset.type??"",this.colors)+"40"}}),h.addEventListener("mouseleave",()=>{h.dataset.type!==this.selectedType&&(h.style.background=this.colors.glassBg,h.style.borderColor=this.colors.border)}),o.appendChild(h)}this.textarea=document.createElement("textarea"),this.textarea.style.cssText=`
65
65
  width:100%;min-height:72px;max-height:152px;
66
66
  padding:10px 12px;border-radius:12px;
67
67
  border:1px solid ${this.colors.border};
@@ -70,19 +70,19 @@ var M,ce,Fe;function Le(t,e){if(Fe=new Date,t.nodeType!==Node.ELEMENT_NODE)throw
70
70
  font-size:13px;line-height:1.5;resize:vertical;
71
71
  outline:none;transition:all 0.2s ease;
72
72
  box-sizing:border-box;
73
- `,this.textarea.placeholder=this.t("popup.placeholder"),this.textarea.maxLength=5e3,this.textarea.setAttribute("aria-label",this.t("popup.textareaAria"));let o=h("div",{style:`
73
+ `,this.textarea.placeholder=this.t("popup.placeholder"),this.textarea.maxLength=5e3,this.textarea.setAttribute("aria-label",this.t("popup.textareaAria"));let i=l("div",{style:`
74
74
  font-size:11px;color:${this.colors.textTertiary};
75
75
  text-align:right;margin-top:4px;
76
76
  font-family:"Inter",system-ui,-apple-system,sans-serif;
77
77
  letter-spacing:0.01em;
78
- `}),r=navigator.userAgentData,a=r?r.platform==="macOS":navigator.platform?.includes("Mac")??/Macintosh|Mac OS X/i.test(navigator.userAgent);b(o,a?this.t("popup.submitHintMac"):this.t("popup.submitHintOther")),this.textarea.addEventListener("focus",()=>{this.textarea.style.borderColor=this.colors.accent,this.textarea.style.boxShadow=`0 0 0 3px ${this.colors.accent}14`,this.textarea.style.background=this.colors.bg}),this.textarea.addEventListener("blur",()=>{this.textarea.style.borderColor=this.colors.border,this.textarea.style.boxShadow="none",this.textarea.style.background=this.colors.glassBgHeavy}),this.textarea.addEventListener("input",()=>{this.updateSubmitState()}),this.textarea.addEventListener("keydown",d=>{d.key==="Enter"&&(d.ctrlKey||d.metaKey)&&(d.preventDefault(),this.submit()),d.key==="Escape"&&this.cancel()});let l=h("div",{style:"display:flex;justify-content:flex-end;gap:8px;margin-top:12px;"}),c=document.createElement("button");c.style.cssText=`
78
+ `}),r=navigator.userAgentData,a=r?r.platform==="macOS":navigator.platform?.includes("Mac")??/Macintosh|Mac OS X/i.test(navigator.userAgent);c(i,a?this.t("popup.submitHintMac"):this.t("popup.submitHintOther")),this.textarea.addEventListener("focus",()=>{this.textarea.style.borderColor=this.colors.accent,this.textarea.style.boxShadow=`0 0 0 3px ${this.colors.accent}14`,this.textarea.style.background=this.colors.bg}),this.textarea.addEventListener("blur",()=>{this.textarea.style.borderColor=this.colors.border,this.textarea.style.boxShadow="none",this.textarea.style.background=this.colors.glassBgHeavy}),this.textarea.addEventListener("input",()=>{this.updateSubmitState()}),this.textarea.addEventListener("keydown",u=>{u.key==="Enter"&&(u.ctrlKey||u.metaKey)&&(u.preventDefault(),this.submit()),u.key==="Escape"&&this.cancel()});let p=l("div",{style:"display:flex;justify-content:flex-end;gap:8px;margin-top:12px;"}),d=document.createElement("button");d.style.cssText=`
79
79
  height:34px;padding:0 16px;border-radius:9999px;
80
80
  border:1px solid ${this.colors.border};
81
81
  background:${this.colors.glassBg};
82
82
  color:${this.colors.textTertiary};font-family:"Inter",system-ui,-apple-system,sans-serif;
83
83
  font-size:13px;font-weight:500;cursor:pointer;
84
84
  transition:all 0.2s ease;
85
- `,b(c,this.t("popup.cancel")),c.addEventListener("click",()=>this.cancel()),c.addEventListener("mouseenter",()=>{c.style.borderColor=this.colors.accent,c.style.color=this.colors.accent}),c.addEventListener("mouseleave",()=>{c.style.borderColor=this.colors.border,c.style.color=this.colors.textTertiary}),this.submitBtn=document.createElement("button"),this.submitBtn.style.cssText=`
85
+ `,c(d,this.t("popup.cancel")),d.addEventListener("click",()=>this.cancel()),d.addEventListener("mouseenter",()=>{d.style.borderColor=this.colors.accent,d.style.color=this.colors.accent}),d.addEventListener("mouseleave",()=>{d.style.borderColor=this.colors.border,d.style.color=this.colors.textTertiary}),this.submitBtn=document.createElement("button"),this.submitBtn.style.cssText=`
86
86
  height:34px;padding:0 18px;border-radius:9999px;
87
87
  border:none;background:${this.colors.accentGradient};
88
88
  color:#fff;font-family:"Inter",system-ui,-apple-system,sans-serif;
@@ -90,14 +90,14 @@ var M,ce,Fe;function Le(t,e){if(Fe=new Date,t.nodeType!==Node.ELEMENT_NODE)throw
90
90
  opacity:0.35;pointer-events:none;
91
91
  transition:all 0.2s ease;
92
92
  box-shadow:0 2px 8px ${this.colors.accentGlow};
93
- `,b(this.submitBtn,this.t("popup.submit")),this.submitBtn.addEventListener("click",()=>this.submit()),l.appendChild(c),l.appendChild(this.submitBtn),this.root.appendChild(s),this.root.appendChild(this.textarea),this.root.appendChild(o),this.root.appendChild(l),document.body.appendChild(this.root)}colors;t;root;selectedType=null;textarea;submitBtn;resolve=null;previouslyFocused=null;onKeydownTrap=null;show(e){return new Promise(n=>{this.resolve=n,this.selectedType=null,this.textarea.value="",this.updateSubmitState(),this.resetTypeButtons(),this.previouslyFocused=document.activeElement;let i=e.bottom+8,s=e.left;i+220>window.innerHeight&&(i=e.top-220-8),s+300>window.innerWidth&&(s=e.right-300),s=Math.max(8,s),i=Math.max(8,i),this.root.style.top=`${i}px`,this.root.style.left=`${s}px`,this.root.style.display="block",this.onKeydownTrap=r=>{if(r.key==="Tab"){let a=Array.from(this.root.querySelectorAll('button:not([disabled]), textarea, input, [tabindex]:not([tabindex="-1"])'));if(a.length===0)return;let l=a[0],c=a[a.length-1];if(!l||!c)return;r.shiftKey?(document.activeElement===l||!this.root.contains(document.activeElement))&&(r.preventDefault(),c.focus()):(document.activeElement===c||!this.root.contains(document.activeElement))&&(r.preventDefault(),l.focus())}},this.root.addEventListener("keydown",this.onKeydownTrap);let o=typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;this.root.style.transition=o?"none":"",requestAnimationFrame(()=>{this.root.style.opacity="1",this.root.style.transform="translateY(0) scale(1)",this.textarea.focus()})})}selectType(e,n){this.selectedType=e;let i=n.querySelectorAll("button");for(let s of i){let o=s.dataset.type===e,r=I(s.dataset.type??"",this.colors),a=P(s.dataset.type??"",this.colors);s.style.background=o?a:this.colors.glassBg,s.style.borderColor=o?r+"60":this.colors.border,s.style.color=o?r:this.colors.textTertiary,s.style.fontWeight=o?"600":"500",s.setAttribute("aria-pressed",String(o))}this.updateSubmitState()}resetTypeButtons(){let e=this.root.querySelectorAll("button[data-type]");for(let n of e)n.setAttribute("aria-pressed","false"),n.style.background=this.colors.glassBg,n.style.borderColor=this.colors.border,n.style.color=this.colors.textTertiary,n.style.fontWeight="500"}updateSubmitState(){let e=this.selectedType!==null&&this.textarea.value.trim().length>0;this.submitBtn.disabled=!e,this.submitBtn.style.opacity=e?"1":"0.35",this.submitBtn.style.pointerEvents=e?"auto":"none"}submit(){!this.selectedType||!this.textarea.value.trim()||(this.resolve?.({type:this.selectedType,message:this.textarea.value.trim()}),this.resolve=null,this.hideElement())}cancel(){this.resolve?.(null),this.resolve=null,this.hideElement()}hideElement(){this.onKeydownTrap&&(this.root.removeEventListener("keydown",this.onKeydownTrap),this.onKeydownTrap=null),this.root.style.opacity="0",this.root.style.transform="translateY(8px) scale(0.98)",this.previouslyFocused?.focus(),this.previouslyFocused=null,setTimeout(()=>{this.root.style.display="none"},250)}destroy(){this.root.remove()}};var Q=class{constructor(e,n,i){this.colors=e;this.bus=n;this.t=i;this.popup=new V(e,i),this.bus.on("annotation:start",()=>this.activate())}colors;bus;t;overlay=null;toolbar=null;drawingRect=null;startX=0;startY=0;isDrawing=!1;isActive=!1;popup;savedOverflow="";preActiveFocusElement=null;rafId=null;pendingMoveEvent=null;activate(){if(this.isActive)return;this.isActive=!0,this.preActiveFocusElement=document.activeElement,this.savedOverflow=document.body.style.overflow,document.body.style.overflow="hidden",this.overlay=h("div",{style:`
93
+ `,c(this.submitBtn,this.t("popup.submit")),this.submitBtn.addEventListener("click",()=>this.submit()),p.appendChild(d),p.appendChild(this.submitBtn),this.root.appendChild(o),this.root.appendChild(this.textarea),this.root.appendChild(i),this.root.appendChild(p),document.body.appendChild(this.root)}colors;t;root;selectedType=null;textarea;submitBtn;resolve=null;previouslyFocused=null;onKeydownTrap=null;show(e){return new Promise(t=>{this.resolve=t,this.selectedType=null,this.textarea.value="",this.updateSubmitState(),this.resetTypeButtons(),this.previouslyFocused=document.activeElement;let s=e.bottom+8,o=e.left;s+220>window.innerHeight&&(s=e.top-220-8),o+300>window.innerWidth&&(o=e.right-300),o=Math.max(8,o),s=Math.max(8,s),this.root.style.top=`${s}px`,this.root.style.left=`${o}px`,this.root.style.display="block",this.onKeydownTrap=r=>{if(r.key==="Tab"){let a=Array.from(this.root.querySelectorAll('button:not([disabled]), textarea, input, [tabindex]:not([tabindex="-1"])'));if(a.length===0)return;let p=a[0],d=a[a.length-1];if(!p||!d)return;r.shiftKey?(document.activeElement===p||!this.root.contains(document.activeElement))&&(r.preventDefault(),d.focus()):(document.activeElement===d||!this.root.contains(document.activeElement))&&(r.preventDefault(),p.focus())}},this.root.addEventListener("keydown",this.onKeydownTrap);let i=typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;this.root.style.transition=i?"none":"",requestAnimationFrame(()=>{this.root.style.opacity="1",this.root.style.transform="translateY(0) scale(1)",this.textarea.focus()})})}selectType(e,t){this.selectedType=e;let s=t.querySelectorAll("button");for(let o of s){let i=o.dataset.type===e,r=M(o.dataset.type??"",this.colors),a=P(o.dataset.type??"",this.colors);o.style.background=i?a:this.colors.glassBg,o.style.borderColor=i?r+"60":this.colors.border,o.style.color=i?r:this.colors.textTertiary,o.style.fontWeight=i?"600":"500",o.setAttribute("aria-pressed",String(i))}this.updateSubmitState()}resetTypeButtons(){let e=this.root.querySelectorAll("button[data-type]");for(let t of e)t.setAttribute("aria-pressed","false"),t.style.background=this.colors.glassBg,t.style.borderColor=this.colors.border,t.style.color=this.colors.textTertiary,t.style.fontWeight="500"}updateSubmitState(){let e=this.selectedType!==null&&this.textarea.value.trim().length>0;this.submitBtn.disabled=!e,this.submitBtn.style.opacity=e?"1":"0.35",this.submitBtn.style.pointerEvents=e?"auto":"none"}submit(){!this.selectedType||!this.textarea.value.trim()||(this.resolve?.({type:this.selectedType,message:this.textarea.value.trim()}),this.resolve=null,this.hideElement())}cancel(){this.resolve?.(null),this.resolve=null,this.hideElement()}hideElement(){this.onKeydownTrap&&(this.root.removeEventListener("keydown",this.onKeydownTrap),this.onKeydownTrap=null),this.root.style.opacity="0",this.root.style.transform="translateY(8px) scale(0.98)",this.previouslyFocused?.focus(),this.previouslyFocused=null,setTimeout(()=>{this.root.style.display="none"},250)}destroy(){this.root.remove()}};var ne=class{constructor(e,t,s){this.colors=e;this.bus=t;this.t=s;this.popup=new se(e,s),this.bus.on("annotation:start",()=>this.activate())}colors;bus;t;overlay=null;toolbar=null;drawingRect=null;startX=0;startY=0;isDrawing=!1;isActive=!1;popup;savedOverflow="";preActiveFocusElement=null;rafId=null;pendingMoveEvent=null;activate(){if(this.isActive)return;this.isActive=!0,this.preActiveFocusElement=document.activeElement,this.savedOverflow=document.body.style.overflow,document.body.style.overflow="hidden",this.overlay=l("div",{style:`
94
94
  position:fixed;inset:0;
95
- z-index:2147483646;
95
+ z-index:${2147483646};
96
96
  background:rgba(15, 23, 42, 0.04);
97
97
  cursor:crosshair;
98
- `}),this.overlay.setAttribute("aria-hidden","true"),this.toolbar=h("div",{style:`
98
+ `}),this.overlay.setAttribute("aria-hidden","true"),this.toolbar=l("div",{style:`
99
99
  position:fixed;top:0;left:0;right:0;
100
- z-index:2147483647;
100
+ z-index:${2147483647};
101
101
  height:52px;
102
102
  background:${this.colors.glassBg};
103
103
  backdrop-filter:blur(24px);
@@ -108,19 +108,19 @@ var M,ce,Fe;function Le(t,e){if(Fe=new Date,t.nodeType!==Node.ELEMENT_NODE)throw
108
108
  font-size:14px;color:${this.colors.text};
109
109
  box-shadow:0 4px 16px ${this.colors.shadow};
110
110
  -webkit-font-smoothing:antialiased;
111
- `});let e=h("span",{style:`
111
+ `});let e=l("span",{style:`
112
112
  width:8px;height:8px;border-radius:50%;
113
113
  background:${this.colors.accent};
114
114
  box-shadow:0 0 8px ${this.colors.accentGlow};
115
115
  animation:pulse 1.5s ease-in-out infinite;
116
- `}),n=document.createElement("style");n.textContent=["@keyframes pulse{0%,100%{opacity:1}50%{opacity:0.4}}","@media(prefers-reduced-motion:reduce){@keyframes pulse{from,to{opacity:1}}}"].join(""),this.toolbar.appendChild(n);let i=h("span",{style:"font-weight:500;letter-spacing:-0.01em;"});b(i,this.t("annotator.instruction"));let s=document.createElement("button");s.style.cssText=`
116
+ `}),t=document.createElement("style");t.textContent=["@keyframes pulse{0%,100%{opacity:1}50%{opacity:0.4}}","@media(prefers-reduced-motion:reduce){@keyframes pulse{from,to{opacity:1}}}"].join(""),this.toolbar.appendChild(t);let s=l("span",{style:"font-weight:500;letter-spacing:-0.01em;"});c(s,this.t("annotator.instruction"));let o=document.createElement("button");o.style.cssText=`
117
117
  height:34px;padding:0 18px;border-radius:9999px;
118
118
  border:1px solid ${this.colors.border};
119
119
  background:${this.colors.glassBg};
120
120
  color:${this.colors.textTertiary};font-family:"Inter",system-ui,-apple-system,sans-serif;
121
121
  font-size:13px;font-weight:500;cursor:pointer;
122
122
  transition:all 0.2s ease;
123
- `,b(s,this.t("annotator.cancel")),s.addEventListener("click",()=>this.deactivate()),s.addEventListener("mouseenter",()=>{s.style.borderColor=this.colors.typeBug,s.style.color=this.colors.typeBug,s.style.background=this.colors.typeBugBg}),s.addEventListener("mouseleave",()=>{s.style.borderColor=this.colors.border,s.style.color=this.colors.textTertiary,s.style.background=this.colors.glassBg}),this.toolbar.appendChild(e),this.toolbar.appendChild(i),this.toolbar.appendChild(s),this.overlay.addEventListener("mousedown",this.onMouseDown),this.overlay.addEventListener("mousemove",this.onMouseMove),this.overlay.addEventListener("mouseup",this.onMouseUp),this.overlay.addEventListener("touchstart",this.onTouchStart,{passive:!1}),this.overlay.addEventListener("touchmove",this.onTouchMove,{passive:!1}),this.overlay.addEventListener("touchend",this.onTouchEnd),this.overlay.addEventListener("keydown",this.onOverlayKeyDown),this.overlay.setAttribute("tabindex","0"),document.addEventListener("keydown",this.onKeyDown),document.body.appendChild(this.overlay),document.body.appendChild(this.toolbar)}deactivate(){this.isActive&&(this.isActive=!1,this.isDrawing=!1,this.preActiveFocusElement=null,this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.pendingMoveEvent=null,document.body.style.overflow=this.savedOverflow,document.removeEventListener("keydown",this.onKeyDown),this.overlay?.remove(),this.toolbar?.remove(),this.drawingRect?.remove(),this.overlay=null,this.toolbar=null,this.drawingRect=null,this.bus.emit("annotation:end"))}onKeyDown=e=>{e.key==="Escape"&&this.deactivate()};onOverlayKeyDown=async e=>{if(e.key!=="Enter")return;e.preventDefault();let n=this.preActiveFocusElement;if(!n||!(n instanceof HTMLElement))return;let i=n.getBoundingClientRect();if(i.width<=0||i.height<=0)return;let s=new DOMRect(i.x,i.y,i.width,i.height),o=await this.popup.show(s);if(!o)return;let a={anchor:pe(n),rect:{xPct:0,yPct:0,wPct:1,hPct:1},scrollX:window.scrollX,scrollY:window.scrollY,viewportW:window.innerWidth,viewportH:window.innerHeight,devicePixelRatio:window.devicePixelRatio};this.deactivate(),this.bus.emit("annotation:complete",{annotation:a,type:o.type,message:o.message})};onMouseDown=e=>{this.startDrawing(e.clientX,e.clientY)};onTouchStart=e=>{e.preventDefault();let n=e.touches[0];n&&this.startDrawing(n.clientX,n.clientY)};startDrawing(e,n){this.isDrawing=!0,this.startX=e,this.startY=n,this.drawingRect?.remove(),this.drawingRect=h("div",{style:`
123
+ `,c(o,this.t("annotator.cancel")),o.addEventListener("click",()=>this.deactivate()),o.addEventListener("mouseenter",()=>{o.style.borderColor=this.colors.typeBug,o.style.color=this.colors.typeBug,o.style.background=this.colors.typeBugBg}),o.addEventListener("mouseleave",()=>{o.style.borderColor=this.colors.border,o.style.color=this.colors.textTertiary,o.style.background=this.colors.glassBg}),this.toolbar.appendChild(e),this.toolbar.appendChild(s),this.toolbar.appendChild(o),this.overlay.addEventListener("mousedown",this.onMouseDown),this.overlay.addEventListener("mousemove",this.onMouseMove),this.overlay.addEventListener("mouseup",this.onMouseUp),this.overlay.addEventListener("touchstart",this.onTouchStart,{passive:!1}),this.overlay.addEventListener("touchmove",this.onTouchMove,{passive:!1}),this.overlay.addEventListener("touchend",this.onTouchEnd),this.overlay.addEventListener("keydown",this.onOverlayKeyDown),this.overlay.setAttribute("tabindex","0"),document.addEventListener("keydown",this.onKeyDown),document.body.appendChild(this.overlay),document.body.appendChild(this.toolbar)}deactivate(){this.isActive&&(this.isActive=!1,this.isDrawing=!1,this.preActiveFocusElement=null,this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.pendingMoveEvent=null,document.body.style.overflow=this.savedOverflow,document.removeEventListener("keydown",this.onKeyDown),this.overlay?.remove(),this.toolbar?.remove(),this.drawingRect?.remove(),this.overlay=null,this.toolbar=null,this.drawingRect=null,this.bus.emit("annotation:end"))}onKeyDown=e=>{e.key==="Escape"&&this.deactivate()};onOverlayKeyDown=async e=>{if(e.key!=="Enter")return;e.preventDefault();let t=this.preActiveFocusElement;if(!t||!(t instanceof HTMLElement))return;let s=t.getBoundingClientRect();if(s.width<=0||s.height<=0)return;let o=new DOMRect(s.x,s.y,s.width,s.height),i=await this.popup.show(o);if(!i)return;let a={anchor:Ee(t),rect:{xPct:0,yPct:0,wPct:1,hPct:1},scrollX:window.scrollX,scrollY:window.scrollY,viewportW:window.innerWidth,viewportH:window.innerHeight,devicePixelRatio:window.devicePixelRatio};this.deactivate(),this.bus.emit("annotation:complete",{annotation:a,type:i.type,message:i.message})};onMouseDown=e=>{this.startDrawing(e.clientX,e.clientY)};onTouchStart=e=>{e.preventDefault();let t=e.touches[0];t&&this.startDrawing(t.clientX,t.clientY)};startDrawing(e,t){this.isDrawing=!0,this.startX=e,this.startY=t,this.drawingRect?.remove(),this.drawingRect=l("div",{style:`
124
124
  position:fixed;
125
125
  border:2px solid ${this.colors.accent};
126
126
  background:${this.colors.accent}12;
@@ -128,7 +128,7 @@ var M,ce,Fe;function Le(t,e){if(Fe=new Date,t.nodeType!==Node.ELEMENT_NODE)throw
128
128
  border-radius:8px;
129
129
  box-shadow:0 0 16px ${this.colors.accentGlow};
130
130
  transition:box-shadow 0.15s ease;
131
- `}),this.overlay?.appendChild(this.drawingRect)}onMouseMove=e=>{this.scheduleRectUpdate(e)};onTouchMove=e=>{e.preventDefault(),e.touches[0]&&this.scheduleRectUpdate(e.touches[0])};scheduleRectUpdate(e){!this.isDrawing||!this.drawingRect||(this.pendingMoveEvent=e,this.rafId===null&&(this.rafId=requestAnimationFrame(()=>{this.rafId=null;let n=this.pendingMoveEvent;if(!n||!this.drawingRect)return;let i=Math.min(n.clientX,this.startX),s=Math.min(n.clientY,this.startY),o=Math.abs(n.clientX-this.startX),r=Math.abs(n.clientY-this.startY);this.drawingRect.style.left=`${i}px`,this.drawingRect.style.top=`${s}px`,this.drawingRect.style.width=`${o}px`,this.drawingRect.style.height=`${r}px`})))}onTouchEnd=async e=>{let n=e.changedTouches[0];n&&await this.finishDrawing(n.clientX,n.clientY)};onMouseUp=async e=>{await this.finishDrawing(e.clientX,e.clientY)};finishDrawing=async(e,n)=>{if(!this.isDrawing||!this.drawingRect)return;this.isDrawing=!1;let i=Math.min(e,this.startX),s=Math.min(n,this.startY),o=Math.abs(e-this.startX),r=Math.abs(n-this.startY);if(o<10||r<10){this.drawingRect.remove(),this.drawingRect=null;return}let a=new DOMRect(i,s,o,r),l=await this.popup.show(a);if(!l){this.drawingRect?.remove(),this.drawingRect=null;return}let c=this.buildAnnotation(a);this.drawingRect?.remove(),this.drawingRect=null,this.deactivate(),this.bus.emit("annotation:complete",{annotation:c,type:l.type,message:l.message})};buildAnnotation(e){this.overlay&&(this.overlay.style.pointerEvents="none");let n=$e(e);this.overlay&&(this.overlay.style.pointerEvents="auto");let i=pe(n),s=n.getBoundingClientRect(),o=De(e,s);return{anchor:i,rect:o,scrollX:window.scrollX,scrollY:window.scrollY,viewportW:window.innerWidth,viewportH:window.innerHeight,devicePixelRatio:window.devicePixelRatio}}destroy(){this.deactivate(),this.popup.destroy()}};var H="siteping_retry_queue";async function D(t,e,n=3){for(let i=0;i<=n;i++){let s=new AbortController,o=setTimeout(()=>s.abort(),1e4);try{let l=await fetch(t,{...e,signal:s.signal});if(clearTimeout(o),l.ok||l.status>=400&&l.status<500||i===n)return l}catch(l){if(clearTimeout(o),i===n)throw l}let r=1e3*2**i,a=Math.random()*1e3-500;await new Promise(l=>setTimeout(l,r+a))}throw new Error("Max retries exceeded")}function Ft(t,e){try{let n=localStorage.getItem(H),i=n?JSON.parse(n):[],s=Array.isArray(i)?i:[];s.length>=20&&s.shift(),s.push({endpoint:t,payload:e}),localStorage.setItem(H,JSON.stringify(s))}catch{}}async function Qe(t){try{let e=localStorage.getItem(H);if(!e)return;let n=JSON.parse(e),i=Array.isArray(n)?n:[],s=i.filter(a=>a.endpoint===t);if(s.length===0)return;let o=[];for(let a of s)try{(await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a.payload)})).ok||o.push(a)}catch{o.push(a)}let r=i.filter(a=>a.endpoint!==t).concat(o);r.length>0?localStorage.setItem(H,JSON.stringify(r)):localStorage.removeItem(H)}catch{}}var J=class{constructor(e,n){this.endpoint=e;this.projectName=n}endpoint;projectName;async sendFeedback(e){try{let n=await D(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!n.ok){let i=await n.text().catch(()=>"Unknown error");throw new Error(`Failed to send feedback: ${n.status} ${i}`)}return await n.json()}catch(n){throw Ft(this.endpoint,e),n}}async getFeedbacks(e,n){let i=new URLSearchParams({projectName:e});n?.page&&i.set("page",String(n.page)),n?.limit&&i.set("limit",String(n.limit)),n?.type&&i.set("type",n.type),n?.status&&i.set("status",n.status),n?.search&&i.set("search",n.search);let s=await D(`${this.endpoint}?${i.toString()}`,{method:"GET"});if(!s.ok)throw new Error(`Failed to fetch feedbacks: ${s.status}`);return await s.json()}async resolveFeedback(e,n){let i=await D(this.endpoint,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,projectName:this.projectName,status:n?"resolved":"open"})});if(!i.ok)throw new Error(`Failed to update feedback: ${i.status}`);return await i.json()}async deleteFeedback(e){let n=await D(this.endpoint,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,projectName:this.projectName})});if(!n.ok)throw new Error(`Failed to delete feedback: ${n.status}`)}async deleteAllFeedbacks(e){let n=await D(this.endpoint,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectName:e,deleteAll:!0})});if(!n.ok)throw new Error(`Failed to delete all feedbacks: ${n.status}`)}};var O=class{listeners=new Map;on(e,n){this.listeners.has(e)||this.listeners.set(e,new Set);let i=this.listeners.get(e);return i.add(n),()=>{i.delete(n)}}off(e,n){let i=this.listeners.get(e);i&&i.delete(n)}emit(e,...n){let i=this.listeners.get(e);if(i)for(let s of i)try{s(...n)}catch(o){console.error(`[siteping] Error in event listener for "${String(e)}":`,o)}}removeAll(){this.listeners.clear()}};var Lt=54,Z=class{constructor(e,n,i,s){this.bus=i;this.t=s;let o=n.position??"bottom-right",r=o==="bottom-right";this.items=[{id:"chat",icon:He,label:s("fab.messages")},{id:"annotate",icon:Oe,label:s("fab.annotate")},{id:"toggle-annotations",icon:he,iconAlt:fe,label:s("fab.annotations")}],this.fab=document.createElement("button"),this.fab.className=`sp-fab sp-fab--${o} sp-anim-fab-in`,this.fab.style.position="fixed",this.fab.appendChild(F(ue)),this.fab.setAttribute("aria-label",s("fab.aria")),this.fab.setAttribute("aria-expanded","false"),this.fab.addEventListener("click",()=>this.toggle()),this.radialContainer=document.createElement("div"),this.radialContainer.className=`sp-radial sp-radial--${o}`,this.radialContainer.setAttribute("role","menu");for(let c=0;c<this.items.length;c++){let d=this.items[c];if(!d)continue;let p=document.createElement("button");p.className="sp-radial-item",p.style.setProperty("--sp-i",String(c)),p.appendChild(F(d.icon)),p.setAttribute("role","menuitem"),p.setAttribute("aria-label",d.label),p.dataset.itemId=d.id,p.addEventListener("click",m=>{m.stopPropagation(),this.handleItemClick(d.id)});let f=document.createElement("span");f.className="sp-radial-label",f.textContent=d.label,f.style.cssText=r?"position:absolute; right:54px; top:50%; transform:translateY(-50%); white-space:nowrap;":"position:absolute; left:54px; top:50%; transform:translateY(-50%); white-space:nowrap;",p.appendChild(f),this.radialContainer.appendChild(p)}this.root=document.createElement("div"),this.root.appendChild(this.radialContainer),this.root.appendChild(this.fab),e.appendChild(this.root);let a=e.host;this.onDocumentClick=c=>{this.isOpen&&!c.composedPath().includes(a)&&this.close()},document.addEventListener("click",this.onDocumentClick);let l=c=>{c.key==="Escape"&&this.isOpen&&(c.stopPropagation(),this.close())};this.fab.addEventListener("keydown",l),this.radialContainer.addEventListener("keydown",l),this.radialContainer.addEventListener("keydown",c=>{let d=Array.from(this.radialContainer.querySelectorAll(".sp-radial-item"));if(d.length===0||!this.isOpen)return;let p=e.activeElement??document.activeElement,f=d.indexOf(p);switch(c.key){case"ArrowUp":{c.preventDefault();let m=f<=0?d.length-1:f-1;d[m]?.focus();break}case"ArrowDown":{c.preventDefault();let m=f>=d.length-1?0:f+1;d[m]?.focus();break}case"Home":{c.preventDefault(),d[0]?.focus();break}case"End":{c.preventDefault(),d[d.length-1]?.focus();break}}})}bus;t;root;fab;radialContainer;badgeEl=null;isOpen=!1;annotationsVisible=!0;items;onDocumentClick;updateBadge(e){if(e<=0){this.badgeEl?.remove(),this.badgeEl=null;return}this.badgeEl||(this.badgeEl=document.createElement("span"),this.badgeEl.className="sp-fab-badge",this.badgeEl.setAttribute("role","status"),this.badgeEl.setAttribute("aria-live","polite"),this.fab.appendChild(this.badgeEl));let n=e>99?"99+":String(e);b(this.badgeEl,n),this.badgeEl.setAttribute("aria-label",this.t("fab.badge").replace("{count}",String(e)))}toggle(){this.isOpen?this.close():this.open()}open(){this.isOpen=!0,this.setFabIcon(G),this.fab.setAttribute("aria-expanded","true"),this.radialContainer.querySelectorAll(".sp-radial-item").forEach((n,i)=>{let s=-(16+Lt*(i+1));n.style.transform=`translate(0px, ${s}px) scale(1)`,n.classList.add("sp-radial-item--open")}),requestAnimationFrame(()=>{this.radialContainer.querySelector(".sp-radial-item")?.focus()})}close(){this.isOpen=!1,this.setFabIcon(ue),this.fab.setAttribute("aria-expanded","false"),this.radialContainer.querySelectorAll(".sp-radial-item").forEach(n=>{n.style.transform="translate(0, 0) scale(0.8)",n.classList.remove("sp-radial-item--open")}),this.fab.focus()}setFabIcon(e){let n=this.badgeEl;this.fab.replaceChildren(F(e)),n&&this.fab.appendChild(n)}handleItemClick(e){switch(this.close(),e){case"chat":this.bus.emit("panel:toggle",!0);break;case"annotate":this.bus.emit("annotation:start");break;case"toggle-annotations":{this.annotationsVisible=!this.annotationsVisible,this.bus.emit("annotations:toggle",this.annotationsVisible);let n=this.radialContainer.querySelector('[data-item-id="toggle-annotations"]');n&&n.replaceChildren(F(this.annotationsVisible?he:fe));break}}}destroy(){document.removeEventListener("click",this.onDocumentClick),this.root.remove()}};var Je={"panel.title":"Feedbacks","panel.ariaLabel":"Siteping feedback panel","panel.feedbackList":"Feedback list","panel.loading":"Loading feedbacks","panel.close":"Close panel","panel.deleteAll":"Delete all","panel.deleteAllConfirmTitle":"Delete all","panel.deleteAllConfirmMessage":"Delete all feedbacks for this project? This action cannot be undone.","panel.search":"Search...","panel.searchAria":"Search feedbacks","panel.filterAll":"All","panel.loadError":"Failed to load","panel.retry":"Retry","panel.empty":"No feedback yet","panel.showMore":"Show more","panel.showLess":"Show less","panel.resolve":"Resolve","panel.reopen":"Reopen","panel.delete":"Delete","panel.cancel":"Cancel","panel.confirmDelete":"Delete","type.question":"Question","type.change":"Change","type.bug":"Bug","type.other":"Other","fab.aria":"Siteping \u2014 Feedback menu","fab.messages":"Messages","fab.annotate":"Annotate","fab.annotations":"Annotations","annotator.instruction":"Draw a rectangle on the area to comment","annotator.cancel":"Cancel","popup.ariaLabel":"Feedback form","popup.placeholder":"Describe your feedback...","popup.textareaAria":"Feedback message","popup.submitHintMac":"\u2318+Enter to send","popup.submitHintOther":"Ctrl+Enter to send","popup.cancel":"Cancel","popup.submit":"Send","identity.title":"Identify yourself","identity.nameLabel":"Name","identity.namePlaceholder":"Your name","identity.emailLabel":"Email","identity.emailPlaceholder":"your@email.com","identity.cancel":"Cancel","identity.submit":"Continue","marker.approximate":"Approximate position (confidence: {confidence}%)","marker.aria":"Feedback #{number}: {type} \u2014 {message}","fab.badge":"{count} unresolved feedbacks","feedback.sent.confirmation":"Feedback sent successfully","feedback.error.message":"Failed to send feedback","feedback.deleted.confirmation":"Feedback deleted","badge.count":"{count} unresolved feedbacks"};var Ze={"panel.title":"Feedbacks","panel.ariaLabel":"Panneau de feedback Siteping","panel.feedbackList":"Liste des feedbacks","panel.loading":"Chargement des feedbacks","panel.close":"Fermer le panneau","panel.deleteAll":"Tout supprimer","panel.deleteAllConfirmTitle":"Tout supprimer","panel.deleteAllConfirmMessage":"Supprimer tous les feedbacks de ce projet ? Cette action est irr\xE9versible.","panel.search":"Rechercher...","panel.searchAria":"Rechercher dans les feedbacks","panel.filterAll":"Tous","panel.loadError":"Erreur de chargement","panel.retry":"R\xE9essayer","panel.empty":"Aucun feedback pour le moment","panel.showMore":"Voir plus","panel.showLess":"Voir moins","panel.resolve":"R\xE9soudre","panel.reopen":"Rouvrir","panel.delete":"Supprimer","panel.cancel":"Annuler","panel.confirmDelete":"Supprimer","type.question":"Question","type.change":"Changement","type.bug":"Bug","type.other":"Autre","fab.aria":"Siteping \u2014 Menu feedback","fab.messages":"Messages","fab.annotate":"Annoter","fab.annotations":"Annotations","annotator.instruction":"Tracez un rectangle sur la zone \xE0 commenter","annotator.cancel":"Annuler","popup.ariaLabel":"Formulaire de feedback","popup.placeholder":"D\xE9crivez votre retour...","popup.textareaAria":"Message de feedback","popup.submitHintMac":"\u2318+Entr\xE9e pour envoyer","popup.submitHintOther":"Ctrl+Entr\xE9e pour envoyer","popup.cancel":"Annuler","popup.submit":"Envoyer","identity.title":"Identifiez-vous","identity.nameLabel":"Nom","identity.namePlaceholder":"Votre nom","identity.emailLabel":"Email","identity.emailPlaceholder":"votre@email.com","identity.cancel":"Annuler","identity.submit":"Continuer","marker.approximate":"Position approximative (confiance : {confidence}%)","marker.aria":"Feedback n\xB0{number} : {type} \u2014 {message}","fab.badge":"{count} feedbacks non r\xE9solus","feedback.sent.confirmation":"Feedback envoy\xE9 avec succ\xE8s","feedback.error.message":"\xC9chec de l'envoi du feedback","feedback.deleted.confirmation":"Feedback supprim\xE9","badge.count":"{count} feedbacks non r\xE9solus"};var ge={fr:Ze,en:Je};function ee(t){let e=(t.split("-")[0]??t).toLowerCase();ge[e]||console.warn(`[siteping] Unknown locale "${t}", falling back to "en"`);let n=ge[e]??ge.en??{};return i=>n[i]??i}function B(t,e){switch(t){case"question":return e("type.question");case"change":return e("type.change");case"bug":return e("type.bug");case"other":return e("type.other");default:return t}}var et="siteping_identity";function tt(){try{let t=localStorage.getItem(et);if(!t)return null;let e=JSON.parse(t);if(typeof e=="object"&&e!==null&&"name"in e&&typeof e.name=="string"&&"email"in e&&typeof e.email=="string"){let n=e;if(n.name&&n.email)return n}return null}catch{return null}}function nt(t){try{localStorage.setItem(et,JSON.stringify(t))}catch{}}function Mt(t,e){if(t===e)return 0;if(t.length===0)return e.length;if(e.length===0)return t.length;if(t.length>e.length){let r=t;t=e,e=r}let n=t.length,i=e.length,s=new Array(n+1);for(let r=0;r<=n;r++)s[r]=r;let o=new Array(n+1);for(let r=1;r<=i;r++){o[0]=r;for(let l=1;l<=n;l++){let c=s[l-1]??0;o[l]=t[l-1]===e[r-1]?c:1+Math.min(c,s[l]??0,o[l-1]??0)}let a=s;s=o,o=a}return s[n]??0}function $(t,e){if(t===e)return 1;let n=Math.max(t.length,e.length);return n===0?1:1-Mt(t,e)/n}function be(t,e,n=.6){if(!e||!t)return 0;if(t.includes(e))return 1;let i=e.length;if(i>t.length){let a=$(t,e);return a>=n?a:0}let s=0,o=t.length>500?t.slice(0,500):t,r=o.length-i;for(let a=0;a<=r;a++){let l=o.slice(a,a+i),c=$(l,e);if(c>s&&(s=c),s>=.95)break}return s>=n?s:0}var It=300,Rt=.3;function ye(t,e){if(!e.textSnippet)return!0;let n=(t.textContent?.trim()??"").slice(0,500);return be(n,e.textSnippet,.5)>Rt}function Pt(t){if(t.elementId){let e=document.getElementById(t.elementId);if(e&&e.tagName===t.elementTag&&ye(e,t))return{element:e,confidence:1,strategy:"id"}}try{let e=document.querySelector(t.cssSelector);if(e&&e.tagName===t.elementTag&&ye(e,t))return{element:e,confidence:.95,strategy:"css"}}catch{}try{let n=document.evaluate(t.xpath,document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;if(n instanceof Element&&n.tagName===t.elementTag&&ye(n,t))return{element:n,confidence:.9,strategy:"xpath"}}catch{}return Bt(t)}function Bt(t){let e=t.elementTag.toLowerCase(),n=document.querySelectorAll(e);if(n.length===0)return null;let i=null,s=0,o=Math.min(n.length,It);for(let r=0;r<o;r++){let a=n[r];if(!a)continue;let l=Nt(a,t);if(l>s&&(s=l,i=a,s>=.85))break}return!i||s<.4?null:{element:i,confidence:Math.min(s,.85),strategy:"scan"}}function Nt(t,e){let n=0,i=0,s=(t.textContent?.trim()??"").slice(0,500);if(e.textSnippet&&(i+=40,n+=be(s,e.textSnippet,.5)*40),e.fingerprint&&(i+=20,n+=Be(t,e.fingerprint)*20),e.textPrefix||e.textSuffix){i+=20;let o=0,r=0;if(e.textPrefix){let a=N(t,"before");o+=a?$(a,e.textPrefix):0,r++}if(e.textSuffix){let a=N(t,"after");o+=a?$(a,e.textSuffix):0,r++}r>0&&(n+=o/r*20)}if(e.neighborText){i+=20;let o=U(t);n+=o?$(o,e.neighborText)*20:0}return i>0?n/i:0}function te(t,e){let n=Pt(t);if(!n)return null;let i=n.element.getBoundingClientRect(),s=new DOMRect(i.x+e.xPct*i.width,i.y+e.yPct*i.height,e.wPct*i.width,e.hPct*i.height);return{element:n.element,rect:s,confidence:n.confidence,strategy:n.strategy}}function ve(t){return{cssSelector:t.cssSelector,xpath:t.xpath,textSnippet:t.textSnippet,elementTag:t.elementTag,elementId:t.elementId??void 0,textPrefix:t.textPrefix,textSuffix:t.textSuffix,fingerprint:t.fingerprint,neighborText:t.neighborText}}function ne(t){return{xPct:t.xPct,yPct:t.yPct,wPct:t.wPct,hPct:t.hPct}}var it=13;function st(t){return{top:t.top+window.scrollY-it,left:t.right+window.scrollX-it}}function j(t,e){let n=t.entries[e],i=t.elementIndices[e];if(!(!n||i===void 0))return n.elements[i]}var ot=300,rt=200,$t=.7,Dt=28,at=32,ie=class{constructor(e,n,i,s){this.colors=e;this.tooltip=n;this.bus=i;this.t=s;this.container=h("div",{style:"position:absolute;top:0;left:0;pointer-events:none;z-index:2147483646;"}),this.container.id="siteping-markers",document.body.appendChild(this.container),this.bus.on("annotations:toggle",o=>{this.container.style.display=o?"block":"none"}),this.resizeHandler=()=>this.scheduleReposition(),window.addEventListener("resize",this.resizeHandler,{passive:!0}),this.scrollHandler=()=>this.scheduleReposition(),window.addEventListener("scroll",this.scrollHandler,{passive:!0,capture:!0}),this.mutationObserver=new MutationObserver(o=>{if(o.length>20){this.scheduleReposition();return}let r=!1;for(let a of o)if(!(this.container.contains(a.target)||this.tooltip.contains(a.target))){r=!0;break}r&&this.scheduleReposition()}),this.mutationObserver.observe(document.body,{childList:!0,subtree:!0,attributes:!1,characterData:!1}),this.onDocumentClickForClusters=o=>{this.container.contains(o.target)||this.collapseAllClusters()},document.addEventListener("click",this.onDocumentClickForClusters)}colors;tooltip;bus;t;container;entries=[];highlightElements=[];pinnedFeedback=null;onDocumentClick=null;repositionTimer=null;mutationObserver=null;scrollHandler=null;resizeHandler=null;anchorCache=new Map;clusters=[];onDocumentClickForClusters=null;get count(){return this.entries.length}scheduleReposition(){this.repositionTimer||("requestIdleCallback"in window?this.repositionTimer=window.requestIdleCallback(()=>{this.repositionTimer=null,this.repositionAll()},{timeout:rt+100}):this.repositionTimer=+setTimeout(()=>{this.repositionTimer=null,this.repositionAll()},rt))}repositionAll(){for(let e of this.entries)for(let n=0;n<e.feedback.annotations.length;n++){let i=e.elements[n];if(!i)continue;let s=e.feedback.annotations[n];if(!s)continue;let o=`${e.feedback.id}:${n}`,a=this.anchorCache.get(o)?.deref(),l;if(a?.isConnected){let d=a.getBoundingClientRect(),p=ne(s);l={element:a,rect:new DOMRect(d.left+p.xPct*d.width,d.top+p.yPct*d.height,p.wPct*d.width,p.hPct*d.height),confidence:1,strategy:"css"}}else l=te(ve(s),ne(s)),l?.element&&this.anchorCache.set(o,new WeakRef(l.element));if(!l){i.style.display="none";continue}let c=st(l.rect);e.baseTop=c.top,e.baseLeft=c.left,i.style.display="flex",this.applyConfidenceStyle(i,l.confidence,e.feedback)}this.applyClusterPositions()}applyClusterPositions(){for(let e of this.clusters)e.expanded?this.applyFanPositions(e):this.applyStackPositions(e)}render(e){this.clear(),e.forEach((n,i)=>{let s=this.buildEntry(n,i+1);this.entries.push(s)}),this.buildClusters()}addFeedback(e,n){let i=this.buildEntry(e,n);for(let s of i.elements)s.style.animation="sp-marker-in 0.35s cubic-bezier(0.34,1.56,0.64,1) both";this.entries.push(i),this.buildClusters()}buildEntry(e,n){let i={feedback:e,elements:[],baseTop:0,baseLeft:0};for(let s of e.annotations){let o=te(ve(s),ne(s));if(!o)continue;let r=st(o.rect);i.baseTop=r.top,i.baseLeft=r.left;let a=this.createMarker(n,e,r);this.applyConfidenceStyle(a,o.confidence,e),this.container.appendChild(a),i.elements.push(a)}return i}buildClusters(){for(let i of this.container.querySelectorAll(".sp-cluster-badge"))i.remove();let e=[];for(let i of this.entries)for(let s=0;s<i.elements.length;s++)e.push({entry:i,elIdx:s});let n=new Set;this.clusters=[];for(let i=0;i<e.length;i++){if(n.has(i))continue;let s=e[i];if(!s)continue;let o={entries:[s.entry],elementIndices:[s.elIdx],expanded:!1};n.add(i);for(let r=i+1;r<e.length;r++){if(n.has(r))continue;let a=s.entry,l=e[r];if(!l)continue;let c=l.entry;Math.sqrt((a.baseLeft-c.baseLeft)**2+(a.baseTop-c.baseTop)**2)<Dt&&(o.entries.push(c),o.elementIndices.push(l.elIdx),n.add(r))}this.clusters.push(o)}for(let i of this.clusters)i.entries.length<=1||(this.applyStackPositions(i),this.addClusterBadge(i))}applyStackPositions(e){let n=e.entries[0];if(!n)return;let{baseTop:i,baseLeft:s}=n,o=e.entries.length<=1;for(let r=0;r<e.entries.length;r++){let a=j(e,r);a&&(a.style.top=`${i+(o?0:r*3)}px`,a.style.left=`${s+(o?0:r*3)}px`,a.style.zIndex=String(r+1))}}applyFanPositions(e){let n=e.entries[0];if(!n)return;let{baseTop:i,baseLeft:s}=n,o=e.entries.length,r=(o-1)*at,a=s-r/2;for(let l=0;l<o;l++){let c=j(e,l);c&&(c.style.top=`${i}px`,c.style.left=`${a+l*at}px`,c.style.zIndex=String(10+l))}}addClusterBadge(e){let n=j(e,e.entries.length-1);if(!n)return;let i=h("div",{class:"sp-cluster-badge",style:`
131
+ `}),this.overlay?.appendChild(this.drawingRect)}onMouseMove=e=>{this.scheduleRectUpdate(e)};onTouchMove=e=>{e.preventDefault(),e.touches[0]&&this.scheduleRectUpdate(e.touches[0])};scheduleRectUpdate(e){!this.isDrawing||!this.drawingRect||(this.pendingMoveEvent=e,this.rafId===null&&(this.rafId=requestAnimationFrame(()=>{this.rafId=null;let t=this.pendingMoveEvent;if(!t||!this.drawingRect)return;let s=Math.min(t.clientX,this.startX),o=Math.min(t.clientY,this.startY),i=Math.abs(t.clientX-this.startX),r=Math.abs(t.clientY-this.startY);this.drawingRect.style.left=`${s}px`,this.drawingRect.style.top=`${o}px`,this.drawingRect.style.width=`${i}px`,this.drawingRect.style.height=`${r}px`})))}onTouchEnd=async e=>{let t=e.changedTouches[0];t&&await this.finishDrawing(t.clientX,t.clientY)};onMouseUp=async e=>{await this.finishDrawing(e.clientX,e.clientY)};finishDrawing=async(e,t)=>{if(!this.isDrawing||!this.drawingRect)return;this.isDrawing=!1;let s=Math.min(e,this.startX),o=Math.min(t,this.startY),i=Math.abs(e-this.startX),r=Math.abs(t-this.startY);if(i<10||r<10){this.drawingRect.remove(),this.drawingRect=null;return}let a=new DOMRect(s,o,i,r),p=await this.popup.show(a);if(!p){this.drawingRect?.remove(),this.drawingRect=null;return}let d=this.buildAnnotation(a);this.drawingRect?.remove(),this.drawingRect=null,this.deactivate(),this.bus.emit("annotation:complete",{annotation:d,type:p.type,message:p.message})};buildAnnotation(e){this.overlay&&(this.overlay.style.pointerEvents="none");let t=ot(e);this.overlay&&(this.overlay.style.pointerEvents="auto");let s=Ee(t),o=t.getBoundingClientRect(),i=it(e,o);return{anchor:s,rect:i,scrollX:window.scrollX,scrollY:window.scrollY,viewportW:window.innerWidth,viewportH:window.innerHeight,devicePixelRatio:window.devicePixelRatio}}destroy(){this.deactivate(),this.popup.destroy()}};var H="siteping_retry_queue";async function O(n,e,t=3){for(let s=0;s<=t;s++){let o=new AbortController,i=setTimeout(()=>o.abort(),1e4);try{let p=await fetch(n,{...e,signal:o.signal});if(clearTimeout(i),p.ok||p.status>=400&&p.status<500||s===t)return p}catch(p){if(clearTimeout(i),s===t)throw p}let r=1e3*2**s,a=Math.random()*1e3-500;await new Promise(p=>setTimeout(p,r+a))}throw new Error("Max retries exceeded")}var ks="siteping_retry_queue";async function mt(n){return typeof navigator<"u"&&navigator.locks?navigator.locks.request(ks,()=>n()):n()}function ws(n,e){mt(()=>{try{let t=localStorage.getItem(H),s=t?JSON.parse(t):[],o=Array.isArray(s)?s:[];o.length>=20&&o.shift(),o.push({endpoint:n,payload:e}),localStorage.setItem(H,JSON.stringify(o))}catch{}})}async function ft(n){await mt(async()=>{try{let e=localStorage.getItem(H);if(!e)return;let t=JSON.parse(e),s=Array.isArray(t)?t:[],o=s.filter(a=>a.endpoint===n);if(o.length===0)return;let i=[];for(let a of o)try{(await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a.payload)})).ok||i.push(a)}catch{i.push(a)}let r=s.filter(a=>a.endpoint!==n).concat(i);r.length>0?localStorage.setItem(H,JSON.stringify(r)):localStorage.removeItem(H)}catch{}})}var oe=class{constructor(e,t){this.endpoint=e;this.projectName=t}endpoint;projectName;async sendFeedback(e){try{let t=await O(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){let s=await t.text().catch(()=>"Unknown error");throw new Error(`Failed to send feedback: ${t.status} ${s}`)}return await t.json()}catch(t){throw ws(this.endpoint,e),t}}async getFeedbacks(e,t){let s=new URLSearchParams({projectName:e});t?.page&&s.set("page",String(t.page)),t?.limit&&s.set("limit",String(t.limit)),t?.type&&s.set("type",t.type),t?.status&&s.set("status",t.status),t?.search&&s.set("search",t.search);let o=await O(`${this.endpoint}?${s.toString()}`,{method:"GET",cache:"no-store"});if(!o.ok)throw new Error(`Failed to fetch feedbacks: ${o.status}`);return await o.json()}async resolveFeedback(e,t){let s=await O(this.endpoint,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,projectName:this.projectName,status:t?"resolved":"open"})});if(!s.ok)throw new Error(`Failed to update feedback: ${s.status}`);return await s.json()}async deleteFeedback(e){let t=await O(this.endpoint,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,projectName:this.projectName})});if(!t.ok)throw new Error(`Failed to delete feedback: ${t.status}`)}async deleteAllFeedbacks(e){let t=await O(this.endpoint,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectName:e,deleteAll:!0})});if(!t.ok)throw new Error(`Failed to delete all feedbacks: ${t.status}`)}};var $=class{listeners=new Map;on(e,t){this.listeners.has(e)||this.listeners.set(e,new Set);let s=this.listeners.get(e);return s.add(t),()=>{s.delete(t)}}off(e,t){let s=this.listeners.get(e);s&&s.delete(t)}emit(e,...t){let s=this.listeners.get(e);if(s)for(let o of s)try{o(...t)}catch(i){console.error(`[siteping] Error in event listener for "${String(e)}":`,i)}}removeAll(){this.listeners.clear()}};var Cs=54,ie=class{constructor(e,t,s,o){this.bus=s;this.t=o;let i=t.position??"bottom-right",r=i==="bottom-right";this.items=[{id:"chat",icon:rt,label:o("fab.messages")},{id:"annotate",icon:at,label:o("fab.annotate")},{id:"toggle-annotations",icon:Se,iconAlt:Ae,label:o("fab.annotations")}],this.fab=document.createElement("button"),this.fab.className=`sp-fab sp-fab--${i} sp-anim-fab-in`,this.fab.style.position="fixed",this.fab.appendChild(v(Te)),this.fab.setAttribute("aria-label",o("fab.aria")),this.fab.setAttribute("aria-expanded","false"),this.fab.addEventListener("click",()=>this.toggle()),this.radialContainer=document.createElement("div"),this.radialContainer.className=`sp-radial sp-radial--${i}`,this.radialContainer.setAttribute("role","menu");for(let d=0;d<this.items.length;d++){let u=this.items[d];if(!u)continue;let h=document.createElement("button");h.className="sp-radial-item",h.style.setProperty("--sp-i",String(d)),h.appendChild(v(u.icon)),h.setAttribute("role","menuitem"),h.setAttribute("aria-label",u.label),h.dataset.itemId=u.id,h.addEventListener("click",f=>{f.stopPropagation(),this.handleItemClick(u.id)});let b=document.createElement("span");b.className="sp-radial-label",b.textContent=u.label,b.style.cssText=r?"position:absolute; right:54px; top:50%; transform:translateY(-50%); white-space:nowrap;":"position:absolute; left:54px; top:50%; transform:translateY(-50%); white-space:nowrap;",h.appendChild(b),this.radialContainer.appendChild(h)}this.root=document.createElement("div"),this.root.appendChild(this.radialContainer),this.root.appendChild(this.fab),e.appendChild(this.root);let a=e.host;this.onDocumentClick=d=>{this.isOpen&&!d.composedPath().includes(a)&&this.close()},document.addEventListener("click",this.onDocumentClick);let p=d=>{d.key==="Escape"&&this.isOpen&&(d.stopPropagation(),this.close())};this.fab.addEventListener("keydown",p),this.radialContainer.addEventListener("keydown",p),this.radialContainer.addEventListener("keydown",d=>{let u=Array.from(this.radialContainer.querySelectorAll(".sp-radial-item"));if(u.length===0||!this.isOpen)return;let h=e.activeElement??document.activeElement,b=u.indexOf(h);switch(d.key){case"ArrowUp":{d.preventDefault();let f=b<=0?u.length-1:b-1;u[f]?.focus();break}case"ArrowDown":{d.preventDefault();let f=b>=u.length-1?0:b+1;u[f]?.focus();break}case"Home":{d.preventDefault(),u[0]?.focus();break}case"End":{d.preventDefault(),u[u.length-1]?.focus();break}}})}bus;t;root;fab;radialContainer;badgeEl=null;isOpen=!1;annotationsVisible=!0;items;onDocumentClick;updateBadge(e){if(e<=0){this.badgeEl?.remove(),this.badgeEl=null;return}this.badgeEl||(this.badgeEl=document.createElement("span"),this.badgeEl.className="sp-fab-badge",this.badgeEl.setAttribute("role","status"),this.badgeEl.setAttribute("aria-live","polite"),this.fab.appendChild(this.badgeEl));let t=e>99?"99+":String(e);c(this.badgeEl,t),this.badgeEl.setAttribute("aria-label",this.t("fab.badge").replace("{count}",String(e)))}toggle(){this.isOpen?this.close():this.open()}open(){this.isOpen=!0,this.setFabIcon(G),this.fab.setAttribute("aria-expanded","true"),this.radialContainer.querySelectorAll(".sp-radial-item").forEach((t,s)=>{let o=-(16+Cs*(s+1));t.style.transform=`translate(0px, ${o}px) scale(1)`,t.classList.add("sp-radial-item--open")}),requestAnimationFrame(()=>{this.radialContainer.querySelector(".sp-radial-item")?.focus()})}close(){this.isOpen=!1,this.setFabIcon(Te),this.fab.setAttribute("aria-expanded","false"),this.radialContainer.querySelectorAll(".sp-radial-item").forEach(t=>{t.style.transform="translate(0, 0) scale(0.8)",t.classList.remove("sp-radial-item--open")}),this.fab.focus()}setFabIcon(e){let t=this.badgeEl;this.fab.replaceChildren(v(e)),t&&this.fab.appendChild(t)}handleItemClick(e){switch(this.close(),e){case"chat":this.bus.emit("panel:toggle",!0);break;case"annotate":this.bus.emit("annotation:start");break;case"toggle-annotations":{this.annotationsVisible=!this.annotationsVisible,this.bus.emit("annotations:toggle",this.annotationsVisible);let t=this.radialContainer.querySelector('[data-item-id="toggle-annotations"]');t&&t.replaceChildren(v(this.annotationsVisible?Se:Ae));break}}}destroy(){document.removeEventListener("click",this.onDocumentClick),this.root.remove()}};var vt={"panel.title":"Feedbacks","panel.ariaLabel":"Siteping-Feedback-Panel","panel.feedbackList":"Feedbackliste","panel.loading":"Feedbacks werden geladen","panel.close":"Panel schlie\xDFen","panel.deleteAll":"Alle l\xF6schen","panel.deleteAllConfirmTitle":"Alle l\xF6schen","panel.deleteAllConfirmMessage":"Alle Feedbacks f\xFCr dieses Projekt l\xF6schen? Diese Aktion kann nicht r\xFCckg\xE4ngig gemacht werden.","panel.search":"Suchen...","panel.searchAria":"Feedbacks suchen","panel.filterAll":"Alle","panel.loadError":"Laden fehlgeschlagen","panel.retry":"Erneut versuchen","panel.empty":"Noch kein Feedback","panel.showMore":"Mehr anzeigen","panel.showLess":"Weniger anzeigen","panel.resolve":"Erledigen","panel.reopen":"Wieder \xF6ffnen","panel.delete":"L\xF6schen","panel.cancel":"Abbrechen","panel.confirmDelete":"L\xF6schen","panel.loadMore":"Mehr laden ({remaining} verbleibend)","panel.statusAll":"Alle","panel.statusOpen":"Offen","panel.statusResolved":"Erledigt","type.label":"Typ","type.question":"Frage","type.change":"\xC4nderung","type.bug":"Fehler","type.other":"Sonstiges","status.label":"Status","fab.aria":"Siteping \u2014 Feedback-Men\xFC","fab.messages":"Nachrichten","fab.annotate":"Kommentieren","fab.annotations":"Anmerkungen","annotator.instruction":"Zeichne ein Rechteck um den Bereich, den du kommentieren m\xF6chtest","annotator.cancel":"Abbrechen","popup.ariaLabel":"Feedbackformular","popup.placeholder":"Beschreibe dein Feedback...","popup.textareaAria":"Feedbacknachricht","popup.submitHintMac":"\u2318+Enter zum Senden","popup.submitHintOther":"Strg+Enter zum Senden","popup.cancel":"Abbrechen","popup.submit":"Senden","identity.title":"Identifiziere dich","identity.nameLabel":"Name","identity.namePlaceholder":"Dein Name","identity.emailLabel":"E-Mail","identity.emailPlaceholder":"deine@email.de","identity.cancel":"Abbrechen","identity.submit":"Fortfahren","marker.approximate":"Ungef\xE4hre Position (Konfidenz: {confidence}%)","marker.aria":"Feedback #{number}: {type} \u2014 {message}","fab.badge":"{count} unerledigte Feedbacks","feedback.sent.confirmation":"Feedback erfolgreich gesendet","feedback.error.message":"Feedback konnte nicht gesendet werden","feedback.deleted.confirmation":"Feedback gel\xF6scht","badge.count":"{count} unerledigte Feedbacks"};var yt={"panel.title":"Feedbacks","panel.ariaLabel":"Siteping feedback panel","panel.feedbackList":"Feedback list","panel.loading":"Loading feedbacks","panel.close":"Close panel","panel.deleteAll":"Delete all","panel.deleteAllConfirmTitle":"Delete all","panel.deleteAllConfirmMessage":"Delete all feedbacks for this project? This action cannot be undone.","panel.search":"Search...","panel.searchAria":"Search feedbacks","panel.filterAll":"All","panel.loadError":"Failed to load","panel.retry":"Retry","panel.empty":"No feedback yet","panel.showMore":"Show more","panel.showLess":"Show less","panel.resolve":"Resolve","panel.reopen":"Reopen","panel.delete":"Delete","panel.cancel":"Cancel","panel.confirmDelete":"Delete","panel.loadMore":"Load more ({remaining} remaining)","panel.statusAll":"All","panel.statusOpen":"Open","panel.statusResolved":"Resolved","type.label":"Type","type.question":"Question","type.change":"Change","type.bug":"Bug","type.other":"Other","status.label":"Status","fab.aria":"Siteping \u2014 Feedback menu","fab.messages":"Messages","fab.annotate":"Annotate","fab.annotations":"Annotations","annotator.instruction":"Draw a rectangle on the area to comment","annotator.cancel":"Cancel","popup.ariaLabel":"Feedback form","popup.placeholder":"Describe your feedback...","popup.textareaAria":"Feedback message","popup.submitHintMac":"\u2318+Enter to send","popup.submitHintOther":"Ctrl+Enter to send","popup.cancel":"Cancel","popup.submit":"Send","identity.title":"Identify yourself","identity.nameLabel":"Name","identity.namePlaceholder":"Your name","identity.emailLabel":"Email","identity.emailPlaceholder":"your@email.com","identity.cancel":"Cancel","identity.submit":"Continue","marker.approximate":"Approximate position (confidence: {confidence}%)","marker.aria":"Feedback #{number}: {type} \u2014 {message}","fab.badge":"{count} unresolved feedbacks","feedback.sent.confirmation":"Feedback sent successfully","feedback.error.message":"Failed to send feedback","feedback.deleted.confirmation":"Feedback deleted","badge.count":"{count} unresolved feedbacks"};var xt={"panel.title":"Comentarios","panel.ariaLabel":"Panel de comentarios de Siteping","panel.feedbackList":"Lista de comentarios","panel.loading":"Cargando comentarios","panel.close":"Cerrar panel","panel.deleteAll":"Eliminar todo","panel.deleteAllConfirmTitle":"Eliminar todo","panel.deleteAllConfirmMessage":"\xBFEliminar todos los comentarios de este proyecto? Esta acci\xF3n no se puede deshacer.","panel.search":"Buscar...","panel.searchAria":"Buscar comentarios","panel.filterAll":"Todos","panel.loadError":"No se pudo cargar","panel.retry":"Reintentar","panel.empty":"A\xFAn no hay comentarios","panel.showMore":"Mostrar m\xE1s","panel.showLess":"Mostrar menos","panel.resolve":"Resolver","panel.reopen":"Reabrir","panel.delete":"Eliminar","panel.cancel":"Cancelar","panel.confirmDelete":"Eliminar","panel.loadMore":"Cargar m\xE1s ({remaining} restantes)","panel.statusAll":"Todos","panel.statusOpen":"Abiertos","panel.statusResolved":"Resueltos","type.label":"Tipo","type.question":"Pregunta","type.change":"Cambio","type.bug":"Error","type.other":"Otro","status.label":"Estado","fab.aria":"Siteping \u2014 Men\xFA de comentarios","fab.messages":"Mensajes","fab.annotate":"Anotar","fab.annotations":"Anotaciones","annotator.instruction":"Dibuja un rect\xE1ngulo sobre el \xE1rea que quieres comentar","annotator.cancel":"Cancelar","popup.ariaLabel":"Formulario de comentarios","popup.placeholder":"Describe tu comentario...","popup.textareaAria":"Mensaje de comentario","popup.submitHintMac":"\u2318+Enter para enviar","popup.submitHintOther":"Ctrl+Enter para enviar","popup.cancel":"Cancelar","popup.submit":"Enviar","identity.title":"Identif\xEDcate","identity.nameLabel":"Nombre","identity.namePlaceholder":"Tu nombre","identity.emailLabel":"Correo electr\xF3nico","identity.emailPlaceholder":"tu@email.com","identity.cancel":"Cancelar","identity.submit":"Continuar","marker.approximate":"Posici\xF3n aproximada (confianza: {confidence}%)","marker.aria":"Comentario #{number}: {type} \u2014 {message}","fab.badge":"{count} comentarios sin resolver","feedback.sent.confirmation":"Comentario enviado correctamente","feedback.error.message":"No se pudo enviar el comentario","feedback.deleted.confirmation":"Comentario eliminado","badge.count":"{count} comentarios sin resolver"};var kt={"panel.title":"Feedbacks","panel.ariaLabel":"Panneau de feedback Siteping","panel.feedbackList":"Liste des feedbacks","panel.loading":"Chargement des feedbacks","panel.close":"Fermer le panneau","panel.deleteAll":"Tout supprimer","panel.deleteAllConfirmTitle":"Tout supprimer","panel.deleteAllConfirmMessage":"Supprimer tous les feedbacks de ce projet ? Cette action est irr\xE9versible.","panel.search":"Rechercher...","panel.searchAria":"Rechercher dans les feedbacks","panel.filterAll":"Tous","panel.loadError":"Erreur de chargement","panel.retry":"R\xE9essayer","panel.empty":"Aucun feedback pour le moment","panel.showMore":"Voir plus","panel.showLess":"Voir moins","panel.resolve":"R\xE9soudre","panel.reopen":"Rouvrir","panel.delete":"Supprimer","panel.cancel":"Annuler","panel.confirmDelete":"Supprimer","panel.loadMore":"Voir plus ({remaining} restants)","panel.statusAll":"Tous","panel.statusOpen":"Ouvert","panel.statusResolved":"R\xE9solu","type.label":"Type","type.question":"Question","type.change":"Changement","type.bug":"Bug","type.other":"Autre","status.label":"Statut","fab.aria":"Siteping \u2014 Menu feedback","fab.messages":"Messages","fab.annotate":"Annoter","fab.annotations":"Annotations","annotator.instruction":"Tracez un rectangle sur la zone \xE0 commenter","annotator.cancel":"Annuler","popup.ariaLabel":"Formulaire de feedback","popup.placeholder":"D\xE9crivez votre retour...","popup.textareaAria":"Message de feedback","popup.submitHintMac":"\u2318+Entr\xE9e pour envoyer","popup.submitHintOther":"Ctrl+Entr\xE9e pour envoyer","popup.cancel":"Annuler","popup.submit":"Envoyer","identity.title":"Identifiez-vous","identity.nameLabel":"Nom","identity.namePlaceholder":"Votre nom","identity.emailLabel":"Email","identity.emailPlaceholder":"votre@email.com","identity.cancel":"Annuler","identity.submit":"Continuer","marker.approximate":"Position approximative (confiance : {confidence}%)","marker.aria":"Feedback n\xB0{number} : {type} \u2014 {message}","fab.badge":"{count} feedbacks non r\xE9solus","feedback.sent.confirmation":"Feedback envoy\xE9 avec succ\xE8s","feedback.error.message":"\xC9chec de l'envoi du feedback","feedback.deleted.confirmation":"Feedback supprim\xE9","badge.count":"{count} feedbacks non r\xE9solus"};var wt={"panel.title":"Feedback","panel.ariaLabel":"Pannello feedback di Siteping","panel.feedbackList":"Elenco feedback","panel.loading":"Caricamento feedback","panel.close":"Chiudi pannello","panel.deleteAll":"Elimina tutto","panel.deleteAllConfirmTitle":"Elimina tutto","panel.deleteAllConfirmMessage":"Eliminare tutti i feedback per questo progetto? Questa azione non pu\xF2 essere annullata.","panel.search":"Cerca...","panel.searchAria":"Cerca feedback","panel.filterAll":"Tutti","panel.loadError":"Caricamento non riuscito","panel.retry":"Riprova","panel.empty":"Nessun feedback ancora","panel.showMore":"Mostra di pi\xF9","panel.showLess":"Mostra meno","panel.resolve":"Risolvi","panel.reopen":"Riapri","panel.delete":"Elimina","panel.cancel":"Annulla","panel.confirmDelete":"Elimina","panel.loadMore":"Carica altro ({remaining} rimanenti)","panel.statusAll":"Tutti","panel.statusOpen":"Aperti","panel.statusResolved":"Risolti","type.label":"Tipo","type.question":"Domanda","type.change":"Modifica","type.bug":"Bug","type.other":"Altro","status.label":"Stato","fab.aria":"Siteping \u2014 Menu feedback","fab.messages":"Messaggi","fab.annotate":"Annota","fab.annotations":"Annotazioni","annotator.instruction":"Disegna un rettangolo sull'area da commentare","annotator.cancel":"Annulla","popup.ariaLabel":"Modulo feedback","popup.placeholder":"Descrivi il tuo feedback...","popup.textareaAria":"Messaggio di feedback","popup.submitHintMac":"\u2318+Invio per inviare","popup.submitHintOther":"Ctrl+Invio per inviare","popup.cancel":"Annulla","popup.submit":"Invia","identity.title":"Identificati","identity.nameLabel":"Nome","identity.namePlaceholder":"Il tuo nome","identity.emailLabel":"Email","identity.emailPlaceholder":"tua@email.com","identity.cancel":"Annulla","identity.submit":"Continua","marker.approximate":"Posizione approssimativa (confidenza: {confidence}%)","marker.aria":"Feedback #{number}: {type} \u2014 {message}","fab.badge":"{count} feedback non risolti","feedback.sent.confirmation":"Feedback inviato con successo","feedback.error.message":"Invio del feedback non riuscito","feedback.deleted.confirmation":"Feedback eliminato","badge.count":"{count} feedback non risolti"};var Ct={"panel.title":"Feedbacks","panel.ariaLabel":"Painel de feedback do Siteping","panel.feedbackList":"Lista de feedbacks","panel.loading":"Carregando feedbacks","panel.close":"Fechar painel","panel.deleteAll":"Excluir tudo","panel.deleteAllConfirmTitle":"Excluir tudo","panel.deleteAllConfirmMessage":"Excluir todos os feedbacks deste projeto? Esta a\xE7\xE3o n\xE3o pode ser desfeita.","panel.search":"Pesquisar...","panel.searchAria":"Pesquisar feedbacks","panel.filterAll":"Todos","panel.loadError":"Falha ao carregar","panel.retry":"Tentar novamente","panel.empty":"Nenhum feedback ainda","panel.showMore":"Mostrar mais","panel.showLess":"Mostrar menos","panel.resolve":"Resolver","panel.reopen":"Reabrir","panel.delete":"Excluir","panel.cancel":"Cancelar","panel.confirmDelete":"Excluir","panel.loadMore":"Carregar mais ({remaining} restantes)","panel.statusAll":"Todos","panel.statusOpen":"Abertos","panel.statusResolved":"Resolvidos","type.label":"Tipo","type.question":"Pergunta","type.change":"Altera\xE7\xE3o","type.bug":"Bug","type.other":"Outro","status.label":"Status","fab.aria":"Siteping \u2014 Menu de feedback","fab.messages":"Mensagens","fab.annotate":"Anotar","fab.annotations":"Anota\xE7\xF5es","annotator.instruction":"Desenhe um ret\xE2ngulo na \xE1rea que deseja comentar","annotator.cancel":"Cancelar","popup.ariaLabel":"Formul\xE1rio de feedback","popup.placeholder":"Descreva seu feedback...","popup.textareaAria":"Mensagem de feedback","popup.submitHintMac":"\u2318+Enter para enviar","popup.submitHintOther":"Ctrl+Enter para enviar","popup.cancel":"Cancelar","popup.submit":"Enviar","identity.title":"Identifique-se","identity.nameLabel":"Nome","identity.namePlaceholder":"Seu nome","identity.emailLabel":"E-mail","identity.emailPlaceholder":"seu@email.com","identity.cancel":"Cancelar","identity.submit":"Continuar","marker.approximate":"Posi\xE7\xE3o aproximada (confian\xE7a: {confidence}%)","marker.aria":"Feedback #{number}: {type} \u2014 {message}","fab.badge":"{count} feedbacks n\xE3o resolvidos","feedback.sent.confirmation":"Feedback enviado com sucesso","feedback.error.message":"Falha ao enviar feedback","feedback.deleted.confirmation":"Feedback exclu\xEDdo","badge.count":"{count} feedbacks n\xE3o resolvidos"};var Et={"panel.title":"\u041E\u0431\u0440\u0430\u0442\u043D\u0430\u044F \u0441\u0432\u044F\u0437\u044C","panel.ariaLabel":"\u041F\u0430\u043D\u0435\u043B\u044C \u043E\u0431\u0440\u0430\u0442\u043D\u043E\u0439 \u0441\u0432\u044F\u0437\u0438 Siteping","panel.feedbackList":"\u0421\u043F\u0438\u0441\u043E\u043A \u043E\u0442\u0437\u044B\u0432\u043E\u0432","panel.loading":"\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430 \u043E\u0442\u0437\u044B\u0432\u043E\u0432","panel.close":"\u0417\u0430\u043A\u0440\u044B\u0442\u044C \u043F\u0430\u043D\u0435\u043B\u044C","panel.deleteAll":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u0441\u0451","panel.deleteAllConfirmTitle":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u0441\u0451","panel.deleteAllConfirmMessage":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u0441\u0435 \u043E\u0442\u0437\u044B\u0432\u044B \u044D\u0442\u043E\u0433\u043E \u043F\u0440\u043E\u0435\u043A\u0442\u0430? \u042D\u0442\u043E \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043D\u0435\u043E\u0431\u0440\u0430\u0442\u0438\u043C\u043E.","panel.search":"\u041F\u043E\u0438\u0441\u043A...","panel.searchAria":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u043E\u0442\u0437\u044B\u0432\u0430\u043C","panel.filterAll":"\u0412\u0441\u0435","panel.loadError":"\u041E\u0448\u0438\u0431\u043A\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0438","panel.retry":"\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C","panel.empty":"\u041F\u043E\u043A\u0430 \u043D\u0435\u0442 \u043E\u0442\u0437\u044B\u0432\u043E\u0432","panel.showMore":"\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0431\u043E\u043B\u044C\u0448\u0435","panel.showLess":"\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u043C\u0435\u043D\u044C\u0448\u0435","panel.resolve":"\u0420\u0435\u0448\u0435\u043D\u043E","panel.reopen":"\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0437\u0430\u043D\u043E\u0432\u043E","panel.delete":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C","panel.cancel":"\u041E\u0442\u043C\u0435\u043D\u0430","panel.confirmDelete":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C","panel.loadMore":"\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0435\u0449\u0451 ({remaining} \u043E\u0441\u0442\u0430\u043B\u043E\u0441\u044C)","panel.statusAll":"\u0412\u0441\u0435","panel.statusOpen":"\u041E\u0442\u043A\u0440\u044B\u0442\u044B\u0435","panel.statusResolved":"\u0420\u0435\u0448\u0451\u043D\u043D\u044B\u0435","type.label":"\u0422\u0438\u043F","type.question":"\u0412\u043E\u043F\u0440\u043E\u0441","type.change":"\u0423\u043B\u0443\u0447\u0448\u0435\u043D\u0438\u0435","type.bug":"\u0411\u0430\u0433","type.other":"\u0414\u0440\u0443\u0433\u043E\u0435","status.label":"\u0421\u0442\u0430\u0442\u0443\u0441","fab.aria":"Siteping \u2014 \u041C\u0435\u043D\u044E \u043E\u0431\u0440\u0430\u0442\u043D\u043E\u0439 \u0441\u0432\u044F\u0437\u0438","fab.messages":"\u0421\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F","fab.annotate":"\u0410\u043D\u043D\u043E\u0442\u0430\u0446\u0438\u044F","fab.annotations":"\u0410\u043D\u043D\u043E\u0442\u0430\u0446\u0438\u0438","annotator.instruction":"\u0412\u044B\u0434\u0435\u043B\u0438\u0442\u0435 \u043E\u0431\u043B\u0430\u0441\u0442\u044C \u0434\u043B\u044F \u043A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u044F","annotator.cancel":"\u041E\u0442\u043C\u0435\u043D\u0430","popup.ariaLabel":"\u0424\u043E\u0440\u043C\u0430 \u043E\u0431\u0440\u0430\u0442\u043D\u043E\u0439 \u0441\u0432\u044F\u0437\u0438","popup.placeholder":"\u041E\u043F\u0438\u0448\u0438\u0442\u0435 \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u0443 \u0438\u043B\u0438 \u043F\u0440\u0435\u0434\u043B\u043E\u0436\u0435\u043D\u0438\u0435...","popup.textareaAria":"\u0421\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435","popup.submitHintMac":"\u2318+Enter \u2014 \u043E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C","popup.submitHintOther":"Ctrl+Enter \u2014 \u043E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C","popup.cancel":"\u041E\u0442\u043C\u0435\u043D\u0430","popup.submit":"\u041E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C","identity.title":"\u041F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044C\u0442\u0435\u0441\u044C","identity.nameLabel":"\u0418\u043C\u044F","identity.namePlaceholder":"\u0412\u0430\u0448\u0435 \u0438\u043C\u044F","identity.emailLabel":"Email","identity.emailPlaceholder":"\u0432\u0430\u0448@email.com","identity.cancel":"\u041E\u0442\u043C\u0435\u043D\u0430","identity.submit":"\u041F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C","marker.approximate":"\u041F\u0440\u0438\u0431\u043B\u0438\u0437\u0438\u0442\u0435\u043B\u044C\u043D\u0430\u044F \u043F\u043E\u0437\u0438\u0446\u0438\u044F (\u0442\u043E\u0447\u043D\u043E\u0441\u0442\u044C: {confidence}%)","marker.aria":"\u041E\u0442\u0437\u044B\u0432 #{number}: {type} \u2014 {message}","fab.badge":"\u041D\u0435\u0440\u0435\u0448\u0451\u043D\u043D\u044B\u0445 \u043E\u0442\u0437\u044B\u0432\u043E\u0432: {count}","feedback.sent.confirmation":"\u041E\u0442\u0437\u044B\u0432 \u0443\u0441\u043F\u0435\u0448\u043D\u043E \u043E\u0442\u043F\u0440\u0430\u0432\u043B\u0435\u043D","feedback.error.message":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C \u043E\u0442\u0437\u044B\u0432","feedback.deleted.confirmation":"\u041E\u0442\u0437\u044B\u0432 \u0443\u0434\u0430\u043B\u0451\u043D","badge.count":"\u041D\u0435\u0440\u0435\u0448\u0451\u043D\u043D\u044B\u0445 \u043E\u0442\u0437\u044B\u0432\u043E\u0432: {count}"};var Be={de:vt,en:yt,es:xt,fr:kt,it:wt,pt:Ct,ru:Et};function re(n){let e=(n.split("-")[0]??n).toLowerCase();Be[e]||console.warn(`[siteping] Unknown locale "${n}", falling back to "en"`);let t=Be[e]??Be.en??{};return s=>t[s]??s}function N(n,e){switch(n){case"question":return e("type.question");case"change":return e("type.change");case"bug":return e("type.bug");case"other":return e("type.other");default:return n}}var Tt="siteping_identity";function St(){try{let n=localStorage.getItem(Tt);if(!n)return null;let e=JSON.parse(n);if(typeof e=="object"&&e!==null&&"name"in e&&typeof e.name=="string"&&"email"in e&&typeof e.email=="string"){let t=e;if(t.name&&t.email)return t}return null}catch{return null}}function At(n){try{localStorage.setItem(Tt,JSON.stringify(n))}catch{}}function Es(n,e){if(n===e)return 0;if(n.length===0)return e.length;if(e.length===0)return n.length;if(n.length>e.length){let r=n;n=e,e=r}let t=n.length,s=e.length,o=new Array(t+1);for(let r=0;r<=t;r++)o[r]=r;let i=new Array(t+1);for(let r=1;r<=s;r++){i[0]=r;for(let p=1;p<=t;p++){let d=o[p-1]??0;i[p]=n[p-1]===e[r-1]?d:1+Math.min(d,o[p]??0,i[p-1]??0)}let a=o;o=i,i=a}return o[t]??0}function _(n,e){if(n===e)return 1;let t=Math.max(n.length,e.length);return t===0?1:1-Es(n,e)/t}function Fe(n,e,t=.6){if(!e||!n)return 0;if(n.includes(e))return 1;let s=e.length;if(s>n.length){let a=_(n,e);return a>=t?a:0}let o=0,i=n.length>500?n.slice(0,500):n,r=i.length-s;for(let a=0;a<=r;a++){let p=i.slice(a,a+s),d=_(p,e);if(d>o&&(o=d),o>=.95)break}return o>=t?o:0}var Ts=300,Ss=.3;function Re(n,e){if(!e.textSnippet)return!0;let t=(n.textContent?.trim()??"").slice(0,500);return Fe(t,e.textSnippet,.5)>Ss}function As(n){if(n.elementId){let e=document.getElementById(n.elementId);if(e&&e.tagName===n.elementTag&&Re(e,n))return{element:e,confidence:1,strategy:"id"}}try{let e=document.querySelector(n.cssSelector);if(e&&e.tagName===n.elementTag&&Re(e,n))return{element:e,confidence:.95,strategy:"css"}}catch{}try{let t=document.evaluate(n.xpath,document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;if(t instanceof Element&&t.tagName===n.elementTag&&Re(t,n))return{element:t,confidence:.9,strategy:"xpath"}}catch{}return Ls(n)}function Ls(n){let e=n.elementTag.toLowerCase(),t=document.querySelectorAll(e);if(t.length===0)return null;let s=null,o=0,i=Math.min(t.length,Ts);for(let r=0;r<i;r++){let a=t[r];if(!a)continue;let p=Ms(a,n);if(p>o&&(o=p,s=a,o>=.85))break}return!s||o<.4?null:{element:s,confidence:Math.min(o,.85),strategy:"scan"}}function Ms(n,e){let t=0,s=0,o=(n.textContent?.trim()??"").slice(0,500);if(e.textSnippet&&(s+=40,t+=Fe(o,e.textSnippet,.5)*40),e.fingerprint&&(s+=20,t+=st(n,e.fingerprint)*20),e.textPrefix||e.textSuffix){s+=20;let i=0,r=0;if(e.textPrefix){let a=D(n,"before");i+=a?_(a,e.textPrefix):0,r++}if(e.textSuffix){let a=D(n,"after");i+=a?_(a,e.textSuffix):0,r++}r>0&&(t+=i/r*20)}if(e.neighborText){s+=20;let i=X(n);t+=i?_(i,e.neighborText)*20:0}return s>0?t/s:0}function ae(n,e){let t=As(n);if(!t)return null;let s=t.element.getBoundingClientRect(),o=new DOMRect(s.x+e.xPct*s.width,s.y+e.yPct*s.height,e.wPct*s.width,e.hPct*s.height);return{element:t.element,rect:o,confidence:t.confidence,strategy:t.strategy}}function Pe(n){return{cssSelector:n.cssSelector,xpath:n.xpath,textSnippet:n.textSnippet,elementTag:n.elementTag,elementId:n.elementId??void 0,textPrefix:n.textPrefix,textSuffix:n.textSuffix,fingerprint:n.fingerprint,neighborText:n.neighborText}}function le(n){return{xPct:n.xPct,yPct:n.yPct,wPct:n.wPct,hPct:n.hPct}}var Lt=13;function Mt(n){return{top:n.top+window.scrollY-Lt,left:n.right+window.scrollX-Lt}}function j(n,e){let t=n.entries[e],s=n.elementIndices[e];if(!(!t||s===void 0))return t.elements[s]}var Bt=300,Ft=200,Bs=.7,Fs=28,Rt=32,pe=class{constructor(e,t,s,o){this.colors=e;this.tooltip=t;this.bus=s;this.t=o;this.container=l("div",{style:`position:absolute;top:0;left:0;pointer-events:none;z-index:${2147483646};`}),this.container.id="siteping-markers",document.body.appendChild(this.container),this.bus.on("annotations:toggle",i=>{this.container.style.display=i?"block":"none"}),this.resizeHandler=()=>this.scheduleReposition(),window.addEventListener("resize",this.resizeHandler,{passive:!0}),this.scrollHandler=()=>this.scheduleReposition(),window.addEventListener("scroll",this.scrollHandler,{passive:!0,capture:!0}),this.mutationObserver=new MutationObserver(i=>{if(i.length>20){this.scheduleReposition();return}let r=!1;for(let a of i)if(!(this.container.contains(a.target)||this.tooltip.contains(a.target))){r=!0;break}r&&this.scheduleReposition()}),this.mutationObserver.observe(document.body,{childList:!0,subtree:!0,attributes:!1,characterData:!1}),this.onDocumentClickForClusters=i=>{this.container.contains(i.target)||this.collapseAllClusters()},document.addEventListener("click",this.onDocumentClickForClusters)}colors;tooltip;bus;t;container;entries=[];highlightElements=[];pinnedFeedback=null;onDocumentClick=null;repositionTimer=null;mutationObserver=null;scrollHandler=null;resizeHandler=null;anchorCache=new Map;clusters=[];onDocumentClickForClusters=null;get count(){return this.entries.length}scheduleReposition(){this.repositionTimer||("requestIdleCallback"in window?this.repositionTimer=window.requestIdleCallback(()=>{this.repositionTimer=null,this.repositionAll()},{timeout:Ft+100}):this.repositionTimer=+setTimeout(()=>{this.repositionTimer=null,this.repositionAll()},Ft))}repositionAll(){let e=new Set;for(let t of this.entries)for(let s=0;s<t.feedback.annotations.length;s++){let o=t.elements[s];if(!o)continue;let i=t.feedback.annotations[s];if(!i)continue;let r=`${t.feedback.id}:${s}`;e.add(r);let p=this.anchorCache.get(r)?.deref(),d;if(p?.isConnected){let h=p.getBoundingClientRect(),b=le(i);d={element:p,rect:new DOMRect(h.left+b.xPct*h.width,h.top+b.yPct*h.height,b.wPct*h.width,b.hPct*h.height),confidence:1,strategy:"css"}}else d=ae(Pe(i),le(i)),d?.element&&this.anchorCache.set(r,new WeakRef(d.element));if(!d){o.style.display="none";continue}let u=Mt(d.rect);t.baseTop=u.top,t.baseLeft=u.left,o.style.display="flex",this.applyConfidenceStyle(o,d.confidence,t.feedback)}for(let t of this.anchorCache.keys())e.has(t)||this.anchorCache.delete(t);this.applyClusterPositions()}applyClusterPositions(){for(let e of this.clusters)e.expanded?this.applyFanPositions(e):this.applyStackPositions(e)}render(e){this.clear(),e.forEach((t,s)=>{let o=this.buildEntry(t,s+1);this.entries.push(o)}),this.buildClusters()}addFeedback(e,t){let s=this.buildEntry(e,t);for(let o of s.elements)o.style.animation="sp-marker-in 0.35s cubic-bezier(0.34,1.56,0.64,1) both";this.entries.push(s),this.buildClusters()}buildEntry(e,t){let s={feedback:e,elements:[],baseTop:0,baseLeft:0};for(let o of e.annotations){let i=ae(Pe(o),le(o));if(!i)continue;let r=Mt(i.rect);s.baseTop=r.top,s.baseLeft=r.left;let a=this.createMarker(t,e,r);this.applyConfidenceStyle(a,i.confidence,e),this.container.appendChild(a),s.elements.push(a)}return s}buildClusters(){for(let s of this.container.querySelectorAll(".sp-cluster-badge"))s.remove();let e=[];for(let s of this.entries)for(let o=0;o<s.elements.length;o++)e.push({entry:s,elIdx:o});let t=new Set;this.clusters=[];for(let s=0;s<e.length;s++){if(t.has(s))continue;let o=e[s];if(!o)continue;let i={entries:[o.entry],elementIndices:[o.elIdx],expanded:!1};t.add(s);for(let r=s+1;r<e.length;r++){if(t.has(r))continue;let a=o.entry,p=e[r];if(!p)continue;let d=p.entry;Math.sqrt((a.baseLeft-d.baseLeft)**2+(a.baseTop-d.baseTop)**2)<Fs&&(i.entries.push(d),i.elementIndices.push(p.elIdx),t.add(r))}this.clusters.push(i)}for(let s of this.clusters)s.entries.length<=1||(this.applyStackPositions(s),this.addClusterBadge(s))}applyStackPositions(e){let t=e.entries[0];if(!t)return;let{baseTop:s,baseLeft:o}=t,i=e.entries.length<=1;for(let r=0;r<e.entries.length;r++){let a=j(e,r);a&&(a.style.top=`${s+(i?0:r*3)}px`,a.style.left=`${o+(i?0:r*3)}px`,a.style.zIndex=String(r+1))}}applyFanPositions(e){let t=e.entries[0];if(!t)return;let{baseTop:s,baseLeft:o}=t,i=e.entries.length,r=(i-1)*Rt,a=o-r/2;for(let p=0;p<i;p++){let d=j(e,p);d&&(d.style.top=`${s}px`,d.style.left=`${a+p*Rt}px`,d.style.zIndex=String(10+p))}}addClusterBadge(e){let t=j(e,e.entries.length-1);if(!t)return;let s=l("div",{class:"sp-cluster-badge",style:`
132
132
  position:absolute;top:-6px;right:-6px;
133
133
  min-width:16px;height:16px;padding:0 4px;
134
134
  border-radius:9999px;
@@ -139,36 +139,1561 @@ var M,ce,Fe;function Le(t,e){if(Fe=new Date,t.nodeType!==Node.ELEMENT_NODE)throw
139
139
  pointer-events:none;
140
140
  font-family:"Inter",system-ui,-apple-system,sans-serif;
141
141
  line-height:1;
142
- `});b(i,String(e.entries.length)),n.appendChild(i)}setBadgesVisible(e,n){for(let i=0;i<e.entries.length;i++){let s=j(e,i)?.querySelector(".sp-cluster-badge");s&&(s.style.display=n?"flex":"none")}}findCluster(e){for(let n of this.clusters)if(!(n.entries.length<=1)){for(let i=0;i<n.entries.length;i++)if(j(n,i)===e)return n}return null}handleClusterClick(e,n){let i=this.findCluster(e);return i?i.expanded?!1:(n.stopPropagation(),this.collapseAllClusters(),i.expanded=!0,this.applyFanPositions(i),this.setBadgesVisible(i,!1),!0):!1}collapseCluster(e){e.expanded&&(e.expanded=!1,this.applyStackPositions(e),this.setBadgesVisible(e,!0))}collapseAllClusters(){for(let e of this.clusters)this.collapseCluster(e)}applyConfidenceStyle(e,n,i){let s=i.status==="resolved";n<$t&&!s?(e.style.borderStyle="dashed",e.style.opacity="0.7",e.title=this.t("marker.approximate").replace("{confidence}",String(Math.round(n*100)))):(e.style.borderStyle="solid",e.style.opacity="1",e.title="")}createMarker(e,n,i){let s=I(n.type,this.colors),o=n.status==="resolved",r=h("div",{style:`
142
+ `});c(s,String(e.entries.length)),t.appendChild(s)}setBadgesVisible(e,t){for(let s=0;s<e.entries.length;s++){let o=j(e,s)?.querySelector(".sp-cluster-badge");o&&(o.style.display=t?"flex":"none")}}findCluster(e){for(let t of this.clusters)if(!(t.entries.length<=1)){for(let s=0;s<t.entries.length;s++)if(j(t,s)===e)return t}return null}handleClusterClick(e,t){let s=this.findCluster(e);return s?s.expanded?!1:(t.stopPropagation(),this.collapseAllClusters(),s.expanded=!0,this.applyFanPositions(s),this.setBadgesVisible(s,!1),!0):!1}collapseCluster(e){e.expanded&&(e.expanded=!1,this.applyStackPositions(e),this.setBadgesVisible(e,!0))}collapseAllClusters(){for(let e of this.clusters)this.collapseCluster(e)}applyConfidenceStyle(e,t,s){let o=s.status==="resolved";t<Bs&&!o?(e.style.borderStyle="dashed",e.style.opacity="0.7",e.title=this.t("marker.approximate").replace("{confidence}",String(Math.round(t*100)))):(e.style.borderStyle="solid",e.style.opacity="1",e.title="")}createMarker(e,t,s){let o=M(t.type,this.colors),i=t.status==="resolved",r=l("div",{style:`
143
143
  position:absolute;
144
- top:${i.top}px;
145
- left:${i.left}px;
144
+ top:${s.top}px;
145
+ left:${s.left}px;
146
146
  width:26px;height:26px;
147
147
  border-radius:50%;
148
- background:${o?"rgba(241,245,249,0.9)":"rgba(255,255,255,0.92)"};
149
- border:2px solid ${o?"#cbd5e1":s};
148
+ background:${i?"rgba(241,245,249,0.9)":"rgba(255,255,255,0.92)"};
149
+ border:2px solid ${i?"#cbd5e1":o};
150
150
  display:flex;align-items:center;justify-content:center;
151
151
  font-family:"Inter",system-ui,-apple-system,sans-serif;
152
152
  font-size:11px;font-weight:700;
153
- color:${o?"#94a3b8":s};
153
+ color:${i?"#94a3b8":o};
154
154
  cursor:pointer;pointer-events:auto;
155
- box-shadow:${o?"0 2px 8px rgba(0,0,0,0.06)":`0 2px 12px ${s}25, 0 2px 6px rgba(0,0,0,0.06)`};
155
+ box-shadow:${i?"0 2px 8px rgba(0,0,0,0.06)":`0 2px 12px ${o}25, 0 2px 6px rgba(0,0,0,0.06)`};
156
156
  transition:top 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), left 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.15s ease, box-shadow 0.15s ease;
157
157
  user-select:none;
158
158
  -webkit-font-smoothing:antialiased;
159
- `});r.dataset.feedbackId=n.id,r.setAttribute("tabindex","0"),r.setAttribute("role","button");let a=n.message.length>60?`${n.message.slice(0,60)}...`:n.message,l=this.t("marker.aria").replace("{number}",String(e)).replace("{type}",B(n.type,this.t)).replace("{message}",a);r.setAttribute("aria-label",l),r.setAttribute("aria-describedby",this.tooltip.tooltipId),b(r,o?"\u2713":String(e)),r.addEventListener("mouseenter",()=>{r.style.transform="scale(1.2)",r.style.boxShadow=o?"0 4px 16px rgba(0,0,0,0.1)":`0 4px 20px ${s}35, 0 4px 12px rgba(0,0,0,0.08)`,this.tooltip.show(n,r.getBoundingClientRect()),this.pinnedFeedback||this.showHighlight(n)}),r.addEventListener("mouseleave",()=>{r.style.transform="scale(1)",r.style.boxShadow=o?"0 2px 8px rgba(0,0,0,0.06)":`0 2px 12px ${s}25, 0 2px 6px rgba(0,0,0,0.06)`,this.tooltip.scheduleHide(),this.pinnedFeedback||this.clearHighlight()});let c=d=>{d instanceof MouseEvent&&this.handleClusterClick(r,d)||(this.pinHighlight(n),this.bus.emit("panel:toggle",!0),r.dispatchEvent(new CustomEvent("sp-marker-click",{detail:{feedbackId:n.id},bubbles:!0})))};return r.addEventListener("click",d=>c(d)),r.addEventListener("keydown",d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),c(d))}),r}highlight(e){for(let n of this.entries)if(n.feedback.id===e)for(let i of n.elements)i.style.animation="sp-pulse-ring 0.7s ease-out",i.addEventListener("animationend",()=>{i.style.animation=""},{once:!0})}showHighlight(e){this.removeHighlightElements();for(let n of e.annotations){let i=te(ve(n),ne(n));if(!i)continue;let s=I(e.type,this.colors),o=i.rect,r=h("div",{style:`
159
+ `});r.dataset.feedbackId=t.id,r.setAttribute("tabindex","0"),r.setAttribute("role","button");let a=t.message.length>60?`${t.message.slice(0,60)}...`:t.message,p=this.t("marker.aria").replace("{number}",String(e)).replace("{type}",N(t.type,this.t)).replace("{message}",a);r.setAttribute("aria-label",p),r.setAttribute("aria-describedby",this.tooltip.tooltipId),c(r,i?"\u2713":String(e)),r.addEventListener("mouseenter",()=>{r.style.transform="scale(1.2)",r.style.boxShadow=i?"0 4px 16px rgba(0,0,0,0.1)":`0 4px 20px ${o}35, 0 4px 12px rgba(0,0,0,0.08)`,this.tooltip.show(t,r.getBoundingClientRect()),this.pinnedFeedback||this.showHighlight(t)}),r.addEventListener("mouseleave",()=>{r.style.transform="scale(1)",r.style.boxShadow=i?"0 2px 8px rgba(0,0,0,0.06)":`0 2px 12px ${o}25, 0 2px 6px rgba(0,0,0,0.06)`,this.tooltip.scheduleHide(),this.pinnedFeedback||this.clearHighlight()});let d=u=>{u instanceof MouseEvent&&this.handleClusterClick(r,u)||(this.pinHighlight(t),this.bus.emit("panel:toggle",!0),r.dispatchEvent(new CustomEvent("sp-marker-click",{detail:{feedbackId:t.id},bubbles:!0})))};return r.addEventListener("click",u=>d(u)),r.addEventListener("keydown",u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),d(u))}),r}highlight(e){for(let t of this.entries)if(t.feedback.id===e)for(let s of t.elements)s.style.animation="sp-pulse-ring 0.7s ease-out",s.addEventListener("animationend",()=>{s.style.animation=""},{once:!0})}showHighlight(e){this.removeHighlightElements();for(let t of e.annotations){let s=ae(Pe(t),le(t));if(!s)continue;let o=M(e.type,this.colors),i=s.rect,r=l("div",{style:`
160
160
  position:absolute;
161
- top:${o.top+window.scrollY}px;
162
- left:${o.left+window.scrollX}px;
163
- width:${o.width}px;height:${o.height}px;
164
- border:2px solid ${s};
165
- background:${s}0c;
161
+ top:${i.top+window.scrollY}px;
162
+ left:${i.left+window.scrollX}px;
163
+ width:${i.width}px;height:${i.height}px;
164
+ border:2px solid ${o};
165
+ background:${o}0c;
166
166
  border-radius:8px;
167
167
  pointer-events:none;z-index:-1;
168
168
  opacity:0;
169
- box-shadow:0 0 16px ${s}20;
170
- transition:opacity ${ot}ms ease;
171
- `});this.container.appendChild(r),this.highlightElements.push(r),r.offsetHeight,r.style.opacity="1"}}pinHighlight(e){this.unpinHighlight(),this.showHighlight(e),this.pinnedFeedback=e,this.onDocumentClick=n=>{this.container.contains(n.target)||this.unpinHighlight()},document.addEventListener("click",this.onDocumentClick,{capture:!0})}unpinHighlight(){this.onDocumentClick&&(document.removeEventListener("click",this.onDocumentClick,{capture:!0}),this.onDocumentClick=null),this.pinnedFeedback=null,this.clearHighlight()}clearHighlight(){for(let e of this.highlightElements)e.style.opacity="0",setTimeout(()=>e.remove(),ot);this.highlightElements=[]}removeHighlightElements(){for(let e of this.highlightElements)e.remove();this.highlightElements=[]}clear(){this.unpinHighlight(),this.container.replaceChildren(),this.entries=[],this.clusters=[],this.anchorCache.clear()}destroy(){this.unpinHighlight(),this.repositionTimer&&("cancelIdleCallback"in window&&window.cancelIdleCallback(this.repositionTimer),clearTimeout(this.repositionTimer)),this.resizeHandler&&window.removeEventListener("resize",this.resizeHandler),this.scrollHandler&&window.removeEventListener("scroll",this.scrollHandler,{capture:!0}),this.onDocumentClickForClusters&&document.removeEventListener("click",this.onDocumentClickForClusters),this.mutationObserver?.disconnect(),this.container.remove()}};var se=class{constructor(e,n,i,s,o,r,a,l){this.colors=n;this.bus=i;this.client=s;this.projectName=o;this.markers=r;this.t=a;this.locale=l;this.root=h("div",{class:"sp-panel"}),this.root.setAttribute("role","complementary"),this.root.setAttribute("aria-label",this.t("panel.ariaLabel")),this.root.setAttribute("aria-hidden","true");let c=h("div",{class:"sp-panel-header"}),d=h("span",{class:"sp-panel-title"});b(d,this.t("panel.title")),this.closeBtn=document.createElement("button"),this.closeBtn.className="sp-panel-close",this.closeBtn.setAttribute("aria-label",this.t("panel.close")),this.closeBtn.appendChild(F(G)),this.closeBtn.addEventListener("click",()=>this.close()),this.deleteAllBtn=document.createElement("button"),this.deleteAllBtn.className="sp-btn-delete-all",this.deleteAllBtn.setAttribute("aria-label",this.t("panel.deleteAll")),this.deleteAllBtn.appendChild(F(me));let p=document.createElement("span");b(p,` ${this.t("panel.deleteAll")}`),this.deleteAllBtn.appendChild(p),this.deleteAllBtn.addEventListener("click",()=>this.confirmDeleteAll());let f=h("div",{class:"sp-panel-header-right"});f.appendChild(this.deleteAllBtn),f.appendChild(this.closeBtn),c.appendChild(d),c.appendChild(f);let m=h("div",{class:"sp-filters"}),y=h("div",{class:"sp-search-wrap"}),T=F(je);T.setAttribute("class","sp-search-icon"),this.searchInput=document.createElement("input"),this.searchInput.type="text",this.searchInput.className="sp-search",this.searchInput.placeholder=this.t("panel.search"),this.searchInput.setAttribute("aria-label",this.t("panel.searchAria")),this.searchInput.addEventListener("input",()=>{this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(()=>this.loadFeedbacks().catch(()=>{}),200)}),y.appendChild(T),y.appendChild(this.searchInput);let k=h("div",{class:"sp-chips"}),C=[{value:"all",label:this.t("panel.filterAll")},{value:"question",label:this.t("type.question")},{value:"change",label:this.t("type.change")},{value:"bug",label:this.t("type.bug")},{value:"other",label:this.t("type.other")}];for(let v of C){let g=document.createElement("button");g.className=`sp-chip ${v.value==="all"?"sp-chip--active":""}`,v.value!=="all"&&(g.style.borderColor=I(v.value,this.colors)),b(g,v.label),g.dataset.filter=v.value,g.setAttribute("aria-pressed",v.value==="all"?"true":"false"),g.addEventListener("click",()=>this.toggleFilter(v.value,k)),k.appendChild(g)}m.appendChild(y),m.appendChild(k),this.listContainer=h("div",{class:"sp-list"}),this.listContainer.setAttribute("role","list"),this.listContainer.setAttribute("aria-label",this.t("panel.feedbackList")),this.root.appendChild(c),this.root.appendChild(m),this.root.appendChild(this.listContainer),e.appendChild(this.root),this.onListClick=v=>{let g=v.target,x=g.closest("[data-action]");if(x){v.stopPropagation();let w=x.closest(".sp-card");if(!w)return;let S=w.dataset.feedbackId,E=this.feedbacks.find(L=>L.id===S);if(!E)return;let A=x.dataset.action;if(A==="expand"){let L=w.querySelector(".sp-card-message");if(!L)return;let _=L.classList.toggle("sp-card-message--expanded");b(x,_?this.t("panel.showLess"):this.t("panel.showMore")),x.setAttribute("aria-expanded",String(_))}else if(A==="resolve"){if(this.pendingMutations.has(E.id))return;let L=x;this.toggleResolve(E,L).catch(()=>{})}else if(A==="delete"){if(this.pendingMutations.has(E.id))return;let L=x;this.deleteFeedback(E,L).catch(()=>{})}return}let u=g.closest(".sp-card");if(u){let w=u.dataset.feedbackId,S=this.feedbacks.find(E=>E.id===w);if(S&&S.annotations.length>0){let E=S.annotations[0];if(!E)return;window.scrollTo({left:E.scrollX,top:E.scrollY,behavior:"smooth"}),this.markers.pinHighlight(S)}}},this.listContainer.addEventListener("click",this.onListClick),this.onListKeydown=v=>{let g=v;if(g.key!=="Enter"&&g.key!==" ")return;let x=g.target,u=x.closest(".sp-card");if(!u||x!==u)return;g.preventDefault();let w=u.dataset.feedbackId,S=this.feedbacks.find(E=>E.id===w);if(S&&S.annotations.length>0){let E=S.annotations[0];if(!E)return;window.scrollTo({left:E.scrollX,top:E.scrollY,behavior:"smooth"}),this.markers.pinHighlight(S)}},this.listContainer.addEventListener("keydown",this.onListKeydown),this.onListMouseover=v=>{let x=v.target.closest(".sp-card");if(!x)return;let u=x.dataset.feedbackId;u&&this.markers.highlight(u)},this.listContainer.addEventListener("mouseover",this.onListMouseover),this.onListMouseout=v=>{let g=v.relatedTarget;g&&this.listContainer.contains(g)||this.markers.highlight("")},this.listContainer.addEventListener("mouseout",this.onListMouseout),this.bus.on("panel:toggle",v=>{v?this.open():this.close()}),e.addEventListener("keydown",v=>{let g=v;if(g.key==="Escape"&&this.isOpen){this.close();return}if(g.key==="Tab"&&this.isOpen){let x=this.root.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(x.length===0)return;let u=x[0],w=x[x.length-1];if(!u||!w)return;let S=e.activeElement;g.shiftKey&&S===u?(g.preventDefault(),w.focus()):!g.shiftKey&&S===w&&(g.preventDefault(),u.focus())}}),this.onMarkerClick=(v=>{this.scrollToFeedback(v.detail.feedbackId)}),document.addEventListener("sp-marker-click",this.onMarkerClick)}colors;bus;client;projectName;markers;t;locale;root;listContainer;searchInput;closeBtn;deleteAllBtn;activeFilters=new Set(["all"]);feedbacks=[];isOpen=!1;searchTimeout=null;loadController=null;pendingMutations=new Set;onMarkerClick;onListClick;onListKeydown;onListMouseover;onListMouseout;async open(){this.isOpen||(this.isOpen=!0,this.root.classList.add("sp-panel--open"),this.root.setAttribute("aria-hidden","false"),this.bus.emit("open"),await this.loadFeedbacks(),requestAnimationFrame(()=>{this.searchInput?this.searchInput.focus():this.closeBtn.focus()}))}close(){if(!this.isOpen)return;this.isOpen=!1,this.root.classList.remove("sp-panel--open"),this.root.setAttribute("aria-hidden","true"),this.bus.emit("close"),this.root.getRootNode().querySelector(".sp-fab")?.focus()}showLoading(){this.listContainer.replaceChildren();let e=h("div",{class:"sp-loading"});e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),e.setAttribute("aria-label",this.t("panel.loading"));let n=h("div",{class:"sp-spinner"});e.appendChild(n),this.listContainer.appendChild(e)}showError(){this.listContainer.replaceChildren();let e=h("div",{class:"sp-empty"});e.setAttribute("role","status"),e.setAttribute("aria-live","polite");let n=h("div",{class:"sp-empty-text"});b(n,this.t("panel.loadError"));let i=document.createElement("button");i.className="sp-btn-ghost",i.style.marginTop="8px",b(i,this.t("panel.retry")),i.addEventListener("click",()=>this.loadFeedbacks().catch(()=>{})),e.appendChild(n),e.appendChild(i),this.listContainer.appendChild(e)}async loadFeedbacks(){this.loadController?.abort(),this.loadController=new AbortController;let{signal:e}=this.loadController,n=this.searchInput.value.trim()||void 0,i=this.activeFilters.has("all")?void 0:Array.from(this.activeFilters)[0],s={limit:50};i&&(s.type=i),n&&(s.search=n);let o=this.feedbacks.length>0;o||this.showLoading();try{let{feedbacks:r}=await this.client.getFeedbacks(this.projectName,s);if(e.aborted)return;this.feedbacks=r,this.renderList(),this.markers.render(r)}catch(r){if(e.aborted)return;o||this.showError(),this.bus.emit("feedback:error",r instanceof Error?r:new Error(String(r)))}}renderList(){if(this.listContainer.replaceChildren(),this.feedbacks.length===0){let e=h("div",{class:"sp-empty"});e.setAttribute("role","status"),e.setAttribute("aria-live","polite");let n=h("div",{class:"sp-empty-text"});b(n,this.t("panel.empty")),e.appendChild(n),this.listContainer.appendChild(e);return}this.feedbacks.forEach((e,n)=>{let i=this.createCard(e,n+1);i.style.setProperty("--sp-card-i",String(n)),this.listContainer.appendChild(i)})}createCard(e,n){let i=e.status==="resolved",s=I(e.type,this.colors),o=h("div",{class:`sp-card ${i?"sp-card--resolved":""}`});o.setAttribute("role","listitem"),o.setAttribute("tabindex","0"),o.setAttribute("aria-label",`Feedback #${n}: ${B(e.type,this.t)} \u2014 ${e.message.slice(0,80)}`),o.dataset.feedbackId=e.id;let r=h("div",{class:"sp-card-bar"});r.style.background=i?"#9ca3af":s;let a=h("div",{class:"sp-card-body"}),l=h("div",{class:"sp-card-header"}),c=h("span",{class:"sp-card-number"});b(c,`#${n}`);let d=h("span",{class:"sp-badge"}),p=P(e.type,this.colors);d.style.background=p,d.style.color=s,b(d,B(e.type,this.t));let f=h("span",{class:"sp-card-date"});b(f,X(e.createdAt,this.locale)),l.appendChild(c),l.appendChild(d),l.appendChild(f);let m=h("div",{class:"sp-card-message"});b(m,e.message);let y=document.createElement("button");y.className="sp-card-expand",y.dataset.action="expand",b(y,this.t("panel.showMore")),y.style.display="none",y.setAttribute("aria-expanded","false"),requestAnimationFrame(()=>{m.scrollHeight>m.clientHeight&&(y.style.display="block")});let T=h("div",{class:"sp-card-footer"}),k=document.createElement("button");if(k.className="sp-btn-resolve",k.dataset.action="resolve",i){k.appendChild(F(qe));let g=document.createElement("span");b(g,` ${this.t("panel.reopen")}`),k.appendChild(g)}else{k.appendChild(F(ze));let g=document.createElement("span");b(g,` ${this.t("panel.resolve")}`),k.appendChild(g)}let C=document.createElement("button");C.className="sp-btn-delete",C.dataset.action="delete",C.appendChild(F(me));let v=document.createElement("span");return b(v,` ${this.t("panel.delete")}`),C.appendChild(v),T.appendChild(k),T.appendChild(C),a.appendChild(l),a.appendChild(m),a.appendChild(y),a.appendChild(T),o.appendChild(r),o.appendChild(a),o}async deleteFeedback(e,n){this.pendingMutations.add(e.id),n.disabled=!0;try{await this.client.deleteFeedback(e.id),this.bus.emit("feedback:deleted",e.id),await this.loadFeedbacks()}catch(i){this.pendingMutations.delete(e.id),n.disabled=!1,this.bus.emit("feedback:error",i instanceof Error?i:new Error(String(i)))}finally{this.pendingMutations.has(e.id)&&setTimeout(()=>this.pendingMutations.delete(e.id),300)}}async confirmDeleteAll(){if(await this.showConfirmDialog(this.t("panel.deleteAllConfirmTitle"),this.t("panel.deleteAllConfirmMessage"))){this.deleteAllBtn.disabled=!0;try{await this.client.deleteAllFeedbacks(this.projectName),this.bus.emit("feedback:all-deleted"),await this.loadFeedbacks()}catch(n){this.bus.emit("feedback:error",n instanceof Error?n:new Error(String(n)))}finally{this.deleteAllBtn.disabled=!1}}}showConfirmDialog(e,n){return new Promise(i=>{let s=h("div",{class:"sp-confirm-backdrop"}),o=`sp-confirm-title-${Date.now()}`,r=`sp-confirm-msg-${Date.now()}`,a=h("div",{class:"sp-confirm-dialog"});a.setAttribute("role","alertdialog"),a.setAttribute("aria-modal","true"),a.setAttribute("aria-labelledby",o),a.setAttribute("aria-describedby",r);let l=h("div",{class:"sp-confirm-title"});l.id=o,b(l,e);let c=h("div",{class:"sp-confirm-message"});c.id=r,b(c,n);let d=h("div",{class:"sp-confirm-actions"}),p=document.createElement("button");p.type="button",p.className="sp-btn-ghost",b(p,this.t("panel.cancel"));let f=document.createElement("button");f.type="button",f.className="sp-btn-danger",b(f,this.t("panel.confirmDelete"));let m=!1,y=k=>{m||(m=!0,s.removeEventListener("keydown",T),s.style.opacity="0",a.style.transform="translateY(8px) scale(0.97)",setTimeout(()=>{s.remove(),i(k)},200))},T=k=>{let C=k;if(C.key==="Escape"){y(!1);return}C.key==="Tab"&&(C.preventDefault(),s.getRootNode().activeElement===p?f.focus():p.focus())};s.addEventListener("keydown",T),p.addEventListener("click",()=>y(!1)),f.addEventListener("click",()=>y(!0)),s.addEventListener("click",k=>{k.target===s&&y(!1)}),d.appendChild(p),d.appendChild(f),a.appendChild(l),a.appendChild(c),a.appendChild(d),s.appendChild(a),this.root.getRootNode()instanceof ShadowRoot?this.root.getRootNode().appendChild(s):this.root.appendChild(s),requestAnimationFrame(()=>{s.style.opacity="1",a.style.transform="translateY(0) scale(1)",p.focus()})})}async toggleResolve(e,n){this.pendingMutations.add(e.id),n.disabled=!0;try{let i=e.status!=="resolved";await this.client.resolveFeedback(e.id,i),await this.loadFeedbacks()}catch(i){this.pendingMutations.delete(e.id),n.disabled=!1,this.bus.emit("feedback:error",i instanceof Error?i:new Error(String(i)))}finally{this.pendingMutations.has(e.id)&&setTimeout(()=>this.pendingMutations.delete(e.id),300)}}toggleFilter(e,n){this.activeFilters.clear(),this.activeFilters.add(e);let i=n.querySelectorAll(".sp-chip");for(let s of i){let o=this.activeFilters.has(s.dataset.filter??"");s.classList.toggle("sp-chip--active",o),s.setAttribute("aria-pressed",String(o))}this.loadFeedbacks().catch(()=>{})}scrollToFeedback(e){let n=CSS.escape(e),i=this.listContainer.querySelector(`[data-feedback-id="${n}"]`);i&&(i.scrollIntoView({behavior:"smooth",block:"center"}),i.classList.add("sp-anim-flash"),i.addEventListener("animationend",()=>{i.classList.remove("sp-anim-flash")},{once:!0}))}async refresh(){this.isOpen&&await this.loadFeedbacks()}destroy(){this.loadController?.abort(),this.searchTimeout&&clearTimeout(this.searchTimeout),this.listContainer.removeEventListener("click",this.onListClick),this.listContainer.removeEventListener("keydown",this.onListKeydown),this.listContainer.removeEventListener("mouseover",this.onListMouseover),this.listContainer.removeEventListener("mouseout",this.onListMouseout),document.removeEventListener("sp-marker-click",this.onMarkerClick),this.root.remove()}};function xe(t){return{cssSelector:t.anchor.cssSelector,xpath:t.anchor.xpath,textSnippet:t.anchor.textSnippet,elementTag:t.anchor.elementTag,elementId:t.anchor.elementId,textPrefix:t.anchor.textPrefix,textSuffix:t.anchor.textSuffix,fingerprint:t.anchor.fingerprint,neighborText:t.anchor.neighborText,xPct:t.rect.xPct,yPct:t.rect.yPct,wPct:t.rect.wPct,hPct:t.rect.hPct,scrollX:t.scrollX,scrollY:t.scrollY,viewportW:t.viewportW,viewportH:t.viewportH,devicePixelRatio:t.devicePixelRatio}}var oe=class{constructor(e,n){this.store=e;this.projectName=n}store;projectName;async sendFeedback(e){let n=await this.store.createFeedback({projectName:e.projectName,type:e.type,message:e.message,status:"open",url:e.url,viewport:e.viewport,userAgent:e.userAgent,authorName:e.authorName,authorEmail:e.authorEmail,clientId:e.clientId,annotations:e.annotations.map(xe)});return ke(n)}async getFeedbacks(e,n){let{feedbacks:i,total:s}=await this.store.getFeedbacks({projectName:e,page:n?.page,limit:n?.limit,type:n?.type,status:n?.status,search:n?.search});return{feedbacks:i.map(ke),total:s}}async resolveFeedback(e,n){let i=await this.store.updateFeedback(e,{status:n?"resolved":"open",resolvedAt:n?new Date:null});return ke(i)}async deleteFeedback(e){await this.store.deleteFeedback(e)}async deleteAllFeedbacks(e){await this.store.deleteAllFeedbacks(e)}};function ke(t){return{id:t.id,projectName:t.projectName,type:t.type,message:t.message,status:t.status,url:t.url,viewport:t.viewport,userAgent:t.userAgent,authorName:t.authorName,authorEmail:t.authorEmail,resolvedAt:t.resolvedAt?.toISOString()??null,createdAt:t.createdAt.toISOString(),updatedAt:t.updatedAt.toISOString(),annotations:t.annotations.map(Ht)}}function Ht(t){return{id:t.id,feedbackId:t.feedbackId,cssSelector:t.cssSelector,xpath:t.xpath,textSnippet:t.textSnippet,elementTag:t.elementTag,elementId:t.elementId,textPrefix:t.textPrefix,textSuffix:t.textSuffix,fingerprint:t.fingerprint,neighborText:t.neighborText,xPct:t.xPct,yPct:t.yPct,wPct:t.wPct,hPct:t.hPct,scrollX:t.scrollX,scrollY:t.scrollY,viewportW:t.viewportW,viewportH:t.viewportH,devicePixelRatio:t.devicePixelRatio,createdAt:t.createdAt.toISOString()}}var Ot="linear(0, 0.006, 0.025, 0.06, 0.11, 0.17, 0.25, 0.34, 0.45, 0.56, 0.67, 0.78, 0.88, 0.95, 1.01, 1.04, 1.05, 1.04, 1.02, 1, 0.99, 1)",we="cubic-bezier(0.16, 1, 0.3, 1)",Ee="cubic-bezier(0.34, 1.56, 0.64, 1)",jt="cubic-bezier(0.25, 1, 0.5, 1)",lt=`
169
+ box-shadow:0 0 16px ${o}20;
170
+ transition:opacity ${Bt}ms ease;
171
+ `});this.container.appendChild(r),this.highlightElements.push(r),r.offsetHeight,r.style.opacity="1"}}pinHighlight(e){this.unpinHighlight(),this.showHighlight(e),this.pinnedFeedback=e,this.onDocumentClick=t=>{this.container.contains(t.target)||this.unpinHighlight()},document.addEventListener("click",this.onDocumentClick,{capture:!0})}unpinHighlight(){this.onDocumentClick&&(document.removeEventListener("click",this.onDocumentClick,{capture:!0}),this.onDocumentClick=null),this.pinnedFeedback=null,this.clearHighlight()}clearHighlight(){for(let e of this.highlightElements)e.style.opacity="0",setTimeout(()=>e.remove(),Bt);this.highlightElements=[]}removeHighlightElements(){for(let e of this.highlightElements)e.remove();this.highlightElements=[]}clear(){this.unpinHighlight(),this.container.replaceChildren(),this.entries=[],this.clusters=[],this.anchorCache.clear()}destroy(){this.unpinHighlight(),this.repositionTimer&&("cancelIdleCallback"in window&&window.cancelIdleCallback(this.repositionTimer),clearTimeout(this.repositionTimer)),this.resizeHandler&&window.removeEventListener("resize",this.resizeHandler),this.scrollHandler&&window.removeEventListener("scroll",this.scrollHandler,{capture:!0}),this.onDocumentClickForClusters&&document.removeEventListener("click",this.onDocumentClickForClusters),this.mutationObserver?.disconnect(),this.container.remove()}};var Rs='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>',Ps='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="3" width="18" height="18" rx="2"/><line x1="3" y1="9" x2="21" y2="9"/><line x1="3" y1="15" x2="21" y2="15"/><line x1="9" y1="3" x2="9" y2="21"/><line x1="15" y1="3" x2="15" y2="21"/></svg>',Is='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 3H6a2 2 0 0 0-2 2v4a2 2 0 0 1-2 2 2 2 0 0 1 2 2v4a2 2 0 0 0 2 2h2"/><path d="M16 3h2a2 2 0 0 1 2 2v4a2 2 0 0 0 2 2 2 2 0 0 0-2 2v4a2 2 0 0 1-2 2h-2"/></svg>',Ie={"export.label":"Export","export.csv":"Export CSV","export.json":"Export JSON"},Nt={"export.label":"Exporter","export.csv":"Exporter CSV","export.json":"Exporter JSON"},Dt=`
172
+ /* ============================
173
+ Export Button & Menu
174
+ ============================ */
175
+
176
+ .sp-export-btn {
177
+ padding: 5px 12px;
178
+ border-radius: var(--sp-radius-full);
179
+ border: 1px solid var(--sp-border);
180
+ background: transparent;
181
+ color: var(--sp-text-tertiary);
182
+ font-family: var(--sp-font);
183
+ font-size: 11px;
184
+ font-weight: 500;
185
+ cursor: pointer;
186
+ display: flex;
187
+ align-items: center;
188
+ gap: 4px;
189
+ transition: all 0.2s ease;
190
+ position: relative;
191
+ }
192
+
193
+ .sp-export-btn svg {
194
+ width: 13px;
195
+ height: 13px;
196
+ }
197
+
198
+ .sp-export-btn:hover {
199
+ border-color: var(--sp-accent);
200
+ color: var(--sp-accent);
201
+ background: var(--sp-accent-light);
202
+ }
203
+
204
+ .sp-export-btn:disabled {
205
+ opacity: 0.5;
206
+ cursor: not-allowed;
207
+ pointer-events: none;
208
+ }
209
+
210
+ .sp-export-menu {
211
+ position: absolute;
212
+ top: calc(100% + 6px);
213
+ right: 0;
214
+ min-width: 180px;
215
+ padding: 4px;
216
+ border-radius: var(--sp-radius);
217
+ background: var(--sp-glass-bg-heavy);
218
+ backdrop-filter: blur(var(--sp-blur));
219
+ -webkit-backdrop-filter: blur(var(--sp-blur));
220
+ border: 1px solid var(--sp-glass-border);
221
+ box-shadow: var(--sp-shadow-lg);
222
+ z-index: 10;
223
+ opacity: 0;
224
+ transform: translateY(-4px) scale(0.97);
225
+ transition: opacity 0.15s ease, transform 0.15s ease;
226
+ pointer-events: none;
227
+ }
228
+
229
+ .sp-export-menu--open {
230
+ opacity: 1;
231
+ transform: translateY(0) scale(1);
232
+ pointer-events: auto;
233
+ }
234
+
235
+ .sp-export-option {
236
+ display: flex;
237
+ align-items: center;
238
+ gap: 10px;
239
+ width: 100%;
240
+ padding: 8px 16px;
241
+ border: none;
242
+ border-radius: 8px;
243
+ background: transparent;
244
+ color: var(--sp-text-secondary);
245
+ font-family: var(--sp-font);
246
+ font-size: 13px;
247
+ font-weight: 500;
248
+ cursor: pointer;
249
+ transition: all 0.15s ease;
250
+ text-align: left;
251
+ }
252
+
253
+ .sp-export-option:hover,
254
+ .sp-export-option:focus-visible {
255
+ background: var(--sp-accent-light);
256
+ color: var(--sp-accent);
257
+ }
258
+
259
+ .sp-export-option-icon {
260
+ display: flex;
261
+ align-items: center;
262
+ justify-content: center;
263
+ flex-shrink: 0;
264
+ }
265
+
266
+ .sp-export-option-icon svg {
267
+ width: 16px;
268
+ height: 16px;
269
+ }
270
+
271
+ .sp-export-option-label {
272
+ flex: 1;
273
+ }
274
+
275
+ @media (forced-colors: active) {
276
+ .sp-export-btn,
277
+ .sp-export-option,
278
+ .sp-export-menu {
279
+ border: 2px solid ButtonText !important;
280
+ background: Canvas !important;
281
+ color: ButtonText !important;
282
+ }
283
+
284
+ .sp-export-btn:focus-visible,
285
+ .sp-export-option:focus-visible {
286
+ outline: 3px solid Highlight !important;
287
+ }
288
+ }
289
+ `,Pt=["id","type","status","message","url","authorName","authorEmail","createdAt","resolvedAt","viewport"];function Ns(n){return n.includes('"')||n.includes(",")||n.includes(`
290
+ `)||n.includes("\r")?`"${n.replace(/"/g,'""')}"`:n}function Ds(n){let e=Pt.join(","),t=n.map(s=>Pt.map(o=>{let i=s[o];return Ns(i==null?"":String(i))}).join(","));return[e,...t].join(`
291
+ `)}function _s(n){return JSON.stringify(n,null,2)}function It(n,e,t){let s=new Blob([n],{type:t}),o=URL.createObjectURL(s),i=document.createElement("a");i.href=o,i.download=e,i.style.display="none",document.body.appendChild(i),i.click(),requestAnimationFrame(()=>{URL.revokeObjectURL(o),i.remove()})}var de=class{constructor(e,t){this.getFeedbacks=t;this.element=l("div",{style:"position: relative; display: inline-flex;"});let s=document.createElement("button");s.className="sp-export-btn",s.setAttribute("aria-haspopup","true"),s.setAttribute("aria-expanded","false"),s.appendChild(v(Rs));let o=document.createElement("span");c(o,Ie["export.label"]),s.appendChild(o),s.addEventListener("click",a=>{a.stopPropagation(),this.toggle()}),this.menu=l("div",{class:"sp-export-menu"}),this.menu.setAttribute("role","menu");let i=this.createOption(Ps,Ie["export.csv"],()=>{this.exportAs("csv")}),r=this.createOption(Is,Ie["export.json"],()=>{this.exportAs("json")});this.menu.appendChild(i),this.menu.appendChild(r),this.element.appendChild(s),this.element.appendChild(this.menu),this.onDocumentClick=a=>{this.isOpen&&!this.element.contains(a.target)&&this.close()},document.addEventListener("click",this.onDocumentClick,!0)}getFeedbacks;element;menu;isOpen=!1;onDocumentClick;setLabels(e){let t=this.element.querySelector(".sp-export-btn");if(t){let o=t.querySelector("span");o&&c(o,e["export.label"])}let s=this.menu.querySelectorAll(".sp-export-option-label");s[0]&&c(s[0],e["export.csv"]),s[1]&&c(s[1],e["export.json"])}createOption(e,t,s){let o=document.createElement("button");o.className="sp-export-option",o.setAttribute("role","menuitem");let i=l("span",{class:"sp-export-option-icon"});i.appendChild(v(e));let r=l("span",{class:"sp-export-option-label"});return c(r,t),o.appendChild(i),o.appendChild(r),o.addEventListener("click",a=>{a.stopPropagation(),s(),this.close()}),o}toggle(){this.isOpen?this.close():this.open()}open(){this.isOpen=!0,this.menu.classList.add("sp-export-menu--open"),this.element.querySelector(".sp-export-btn")?.setAttribute("aria-expanded","true")}close(){this.isOpen=!1,this.menu.classList.remove("sp-export-menu--open"),this.element.querySelector(".sp-export-btn")?.setAttribute("aria-expanded","false")}exportAs(e){let t=this.getFeedbacks();if(t.length===0)return;let s=t[0]?.projectName??"feedbacks",o=new Date().toISOString().slice(0,10),i=s.replace(/[^a-zA-Z0-9_-]/g,"_");if(e==="csv"){let r=Ds(t);It(r,`feedbacks-${i}-${o}.csv`,"text/csv;charset=utf-8")}else{let r=_s(t);It(r,`feedbacks-${i}-${o}.json`,"application/json;charset=utf-8")}}destroy(){document.removeEventListener("click",this.onDocumentClick,!0),this.element.remove()}};var ce='<svg viewBox="0 0 18 18" fill="none" aria-hidden="true"><rect x="1" y="1" width="16" height="16" rx="4" stroke="currentColor" stroke-width="2"/></svg>',_t='<svg viewBox="0 0 18 18" fill="none" aria-hidden="true"><rect x="1" y="1" width="16" height="16" rx="4" fill="url(#sp-cb-grad)" stroke="none"/><polyline points="5 9 8 12 13 6" fill="none" stroke="#fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><defs><linearGradient id="sp-cb-grad" x1="0" y1="0" x2="18" y2="18" gradientUnits="userSpaceOnUse"><stop offset="0%" stop-color="var(--sp-accent)"/><stop offset="100%" stop-color="var(--sp-accent-dark)"/></linearGradient></defs></svg>',Ne={"bulk.selectAll":"Select all","bulk.selected":"{count} selected","bulk.resolve":"Resolve","bulk.delete":"Delete","bulk.deselect":"Deselect"},De={"bulk.selectAll":"Tout s\xE9lectionner","bulk.selected":"{count} s\xE9lectionn\xE9(s)","bulk.resolve":"R\xE9soudre","bulk.delete":"Supprimer","bulk.deselect":"D\xE9s\xE9lectionner"},Ot=`
292
+ /* ============================
293
+ Bulk Checkbox
294
+ ============================ */
295
+
296
+ .sp-bulk-checkbox {
297
+ position: relative;
298
+ width: 16px;
299
+ height: 16px;
300
+ flex-shrink: 0;
301
+ cursor: pointer;
302
+ border-radius: 4px;
303
+ color: var(--sp-border);
304
+ opacity: 0;
305
+ transition: opacity 0.15s ease, color 0.15s ease, transform 0.15s ease;
306
+ display: inline-flex;
307
+ align-items: center;
308
+ justify-content: center;
309
+ }
310
+
311
+ .sp-bulk-checkbox svg {
312
+ width: 16px;
313
+ height: 16px;
314
+ display: block;
315
+ }
316
+
317
+ .sp-bulk-checkbox:hover {
318
+ color: var(--sp-accent);
319
+ transform: scale(1.1);
320
+ }
321
+
322
+ .sp-bulk-checkbox--checked {
323
+ color: var(--sp-accent);
324
+ opacity: 1 !important;
325
+ filter: drop-shadow(0 0 4px var(--sp-accent-glow));
326
+ }
327
+
328
+ /* Show checkboxes when hovering a card */
329
+ .sp-card:hover .sp-bulk-checkbox {
330
+ opacity: 1;
331
+ }
332
+
333
+ /* When any card has selection, show ALL checkboxes */
334
+ .sp-list--has-selection .sp-bulk-checkbox {
335
+ opacity: 1;
336
+ }
337
+
338
+ /* ============================
339
+ Card Selected State
340
+ ============================ */
341
+
342
+ .sp-card--selected {
343
+ border-left: 3px solid var(--sp-accent) !important;
344
+ background: var(--sp-accent-light) !important;
345
+ }
346
+
347
+ .sp-card--selected:hover {
348
+ background: var(--sp-accent-light) !important;
349
+ }
350
+
351
+ /* ============================
352
+ Select All Bar
353
+ ============================ */
354
+
355
+ .sp-bulk-select-all {
356
+ display: flex;
357
+ align-items: center;
358
+ gap: 8px;
359
+ padding: 8px 12px;
360
+ margin-bottom: 4px;
361
+ border-radius: var(--sp-radius);
362
+ background: transparent;
363
+ cursor: pointer;
364
+ opacity: 0;
365
+ transition: opacity 0.2s ease, background 0.2s ease;
366
+ user-select: none;
367
+ font-family: var(--sp-font);
368
+ font-size: 12px;
369
+ font-weight: 500;
370
+ color: var(--sp-text-secondary);
371
+ }
372
+
373
+ .sp-bulk-select-all:hover {
374
+ background: var(--sp-bg-hover);
375
+ }
376
+
377
+ /* Show select-all on list hover or when selections exist */
378
+ .sp-list:hover .sp-bulk-select-all,
379
+ .sp-list--has-selection .sp-bulk-select-all {
380
+ opacity: 1;
381
+ }
382
+
383
+ .sp-bulk-select-all .sp-bulk-checkbox {
384
+ opacity: 1;
385
+ }
386
+
387
+ /* ============================
388
+ Floating Action Bar
389
+ ============================ */
390
+
391
+ @keyframes sp-bulk-bar-in {
392
+ from {
393
+ transform: translateY(100%) scale(0.95);
394
+ opacity: 0;
395
+ }
396
+ to {
397
+ transform: translateY(0) scale(1);
398
+ opacity: 1;
399
+ }
400
+ }
401
+
402
+ @keyframes sp-bulk-bar-out {
403
+ from {
404
+ transform: translateY(0) scale(1);
405
+ opacity: 1;
406
+ }
407
+ to {
408
+ transform: translateY(100%) scale(0.95);
409
+ opacity: 0;
410
+ }
411
+ }
412
+
413
+ .sp-bulk-bar {
414
+ position: absolute;
415
+ bottom: 16px;
416
+ left: 16px;
417
+ right: 16px;
418
+ display: flex;
419
+ align-items: center;
420
+ justify-content: space-between;
421
+ gap: 12px;
422
+ padding: 12px 16px;
423
+ border-radius: 16px;
424
+ background: var(--sp-glass-bg-heavy);
425
+ backdrop-filter: blur(var(--sp-blur-heavy));
426
+ -webkit-backdrop-filter: blur(var(--sp-blur-heavy));
427
+ border: 1px solid var(--sp-glass-border);
428
+ box-shadow: var(--sp-shadow-xl);
429
+ z-index: 10;
430
+ pointer-events: none;
431
+ opacity: 0;
432
+ transform: translateY(100%) scale(0.95);
433
+ transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
434
+ opacity 0.25s ease;
435
+ font-family: var(--sp-font);
436
+ }
437
+
438
+ .sp-bulk-bar--visible {
439
+ pointer-events: auto;
440
+ opacity: 1;
441
+ transform: translateY(0) scale(1);
442
+ }
443
+
444
+ .sp-bulk-bar-count {
445
+ font-size: 13px;
446
+ font-weight: 600;
447
+ color: var(--sp-text);
448
+ white-space: nowrap;
449
+ letter-spacing: -0.01em;
450
+ }
451
+
452
+ .sp-bulk-bar-actions {
453
+ display: flex;
454
+ align-items: center;
455
+ gap: 6px;
456
+ }
457
+
458
+ .sp-bulk-btn-resolve,
459
+ .sp-bulk-btn-delete {
460
+ padding: 7px 14px;
461
+ border-radius: var(--sp-radius-full);
462
+ border: 1.5px solid transparent;
463
+ background: transparent;
464
+ font-family: var(--sp-font);
465
+ font-size: 12px;
466
+ font-weight: 600;
467
+ cursor: pointer;
468
+ display: flex;
469
+ align-items: center;
470
+ gap: 5px;
471
+ transition: all 0.2s ease;
472
+ white-space: nowrap;
473
+ }
474
+
475
+ .sp-bulk-btn-resolve {
476
+ color: #22c55e;
477
+ border-color: #22c55e;
478
+ }
479
+
480
+ .sp-bulk-btn-resolve:hover {
481
+ background: rgba(34, 197, 94, 0.1);
482
+ box-shadow: 0 0 12px rgba(34, 197, 94, 0.15);
483
+ }
484
+
485
+ .sp-bulk-btn-resolve:active {
486
+ transform: scale(0.96);
487
+ transition-duration: 0.1s;
488
+ }
489
+
490
+ .sp-bulk-btn-delete {
491
+ color: #ef4444;
492
+ border-color: #ef4444;
493
+ }
494
+
495
+ .sp-bulk-btn-delete:hover {
496
+ background: rgba(239, 68, 68, 0.1);
497
+ box-shadow: 0 0 12px rgba(239, 68, 68, 0.15);
498
+ }
499
+
500
+ .sp-bulk-btn-delete:active {
501
+ transform: scale(0.96);
502
+ transition-duration: 0.1s;
503
+ }
504
+
505
+ .sp-bulk-btn-resolve:disabled,
506
+ .sp-bulk-btn-delete:disabled {
507
+ opacity: 0.5;
508
+ cursor: not-allowed;
509
+ pointer-events: none;
510
+ }
511
+
512
+ .sp-bulk-btn-deselect {
513
+ width: 28px;
514
+ height: 28px;
515
+ border-radius: var(--sp-radius-full);
516
+ border: 1px solid var(--sp-border);
517
+ background: transparent;
518
+ color: var(--sp-text-tertiary);
519
+ cursor: pointer;
520
+ display: flex;
521
+ align-items: center;
522
+ justify-content: center;
523
+ transition: all 0.2s ease;
524
+ flex-shrink: 0;
525
+ padding: 0;
526
+ }
527
+
528
+ .sp-bulk-btn-deselect:hover {
529
+ background: var(--sp-bg-hover);
530
+ color: var(--sp-text);
531
+ border-color: var(--sp-text-tertiary);
532
+ }
533
+
534
+ .sp-bulk-btn-deselect:active {
535
+ transform: scale(0.92);
536
+ transition-duration: 0.1s;
537
+ }
538
+
539
+ .sp-bulk-btn-deselect svg {
540
+ width: 12px;
541
+ height: 12px;
542
+ }
543
+
544
+ /* Spinner inside bulk bar buttons */
545
+ .sp-bulk-btn-resolve .sp-spinner,
546
+ .sp-bulk-btn-delete .sp-spinner {
547
+ width: 14px;
548
+ height: 14px;
549
+ }
550
+
551
+ /* ============================
552
+ Forced Colors / High Contrast
553
+ ============================ */
554
+
555
+ @media (forced-colors: active) {
556
+ .sp-bulk-checkbox,
557
+ .sp-bulk-btn-resolve,
558
+ .sp-bulk-btn-delete,
559
+ .sp-bulk-btn-deselect,
560
+ .sp-bulk-bar {
561
+ border: 2px solid ButtonText !important;
562
+ background: Canvas !important;
563
+ color: ButtonText !important;
564
+ }
565
+
566
+ .sp-bulk-checkbox--checked {
567
+ background: Highlight !important;
568
+ color: HighlightText !important;
569
+ }
570
+
571
+ .sp-card--selected {
572
+ border-left: 4px solid Highlight !important;
573
+ }
574
+ }
575
+
576
+ /* ============================
577
+ Reduced Motion
578
+ ============================ */
579
+
580
+ @media (prefers-reduced-motion: reduce) {
581
+ .sp-bulk-bar {
582
+ transition-duration: 0.01ms !important;
583
+ }
584
+
585
+ .sp-bulk-checkbox {
586
+ transition-duration: 0.01ms !important;
587
+ }
588
+ }
589
+ `,ue=class{constructor(e,t,s){this.callbacks=t;this.i18n=s==="fr"?De:Ne,this.barElement=l("div",{class:"sp-bulk-bar"}),this.barElement.setAttribute("role","toolbar"),this.barElement.setAttribute("aria-label","Bulk actions"),this.countLabel=l("span",{class:"sp-bulk-bar-count"}),c(this.countLabel,this.i18n["bulk.selected"].replace("{count}","0"));let o=l("div",{class:"sp-bulk-bar-actions"});this.resolveBtn=document.createElement("button"),this.resolveBtn.className="sp-bulk-btn-resolve",this.resolveBtn.type="button",this.resolveBtn.addEventListener("click",()=>this.handleResolve()),this.deleteBtn=document.createElement("button"),this.deleteBtn.className="sp-bulk-btn-delete",this.deleteBtn.type="button",this.deleteBtn.addEventListener("click",()=>this.handleDelete());let i=document.createElement("button");i.className="sp-bulk-btn-deselect",i.type="button",i.setAttribute("aria-label",this.i18n["bulk.deselect"]),i.appendChild(v('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>')),i.addEventListener("click",()=>this.deselectAll()),o.appendChild(this.resolveBtn),o.appendChild(this.deleteBtn),o.appendChild(i),this.barElement.appendChild(this.countLabel),this.barElement.appendChild(o),this.updateButtonLabels()}callbacks;barElement;selected=new Set;checkboxMap=new Map;countLabel;resolveBtn;deleteBtn;selectAllCheckbox=null;listContainer=null;isProcessing=!1;i18n;createCheckbox(e){let t=l("div",{class:"sp-bulk-checkbox"});return t.setAttribute("role","checkbox"),t.setAttribute("aria-checked","false"),t.setAttribute("tabindex","0"),t.setAttribute("aria-label",`Select feedback ${e}`),t.appendChild(v(ce)),t.addEventListener("click",s=>{s.stopPropagation(),this.toggle(e)}),t.addEventListener("keydown",s=>{(s.key===" "||s.key==="Enter")&&(s.preventDefault(),s.stopPropagation(),this.toggle(e))}),this.checkboxMap.set(e,t),t}createSelectAllBar(e,t){let s=l("div",{class:"sp-bulk-select-all"}),o=l("div",{class:"sp-bulk-checkbox"});o.appendChild(v(ce)),this.selectAllCheckbox=o;let i=l("span");return c(i,t),s.appendChild(o),s.appendChild(i),s.addEventListener("click",()=>{this.selected.size===e.length&&e.length>0?this.deselectAll():this.selectAll(e)}),s}setListContainer(e){this.listContainer=e}toggle(e){this.isProcessing||(this.selected.has(e)?this.selected.delete(e):this.selected.add(e),this.updateCheckbox(e),this.updateBar(),this.updateSelectAllCheckbox(),this.updateListSelectionClass(),this.updateCardSelectedState(e))}selectAll(e){if(!this.isProcessing){for(let t of e)this.selected.add(t),this.updateCheckbox(t),this.updateCardSelectedState(t);this.updateBar(),this.updateSelectAllCheckbox(),this.updateListSelectionClass()}}deselectAll(){let e=[...this.selected];this.selected.clear();for(let t of e)this.updateCheckbox(t),this.updateCardSelectedState(t);this.updateBar(),this.updateSelectAllCheckbox(),this.updateListSelectionClass()}get selectedIds(){return[...this.selected]}get count(){return this.selected.size}get hasSelection(){return this.selected.size>0}reset(){this.selected.clear(),this.checkboxMap.clear(),this.selectAllCheckbox=null,this.isProcessing=!1,this.updateBar(),this.updateListSelectionClass()}destroy(){this.selected.clear(),this.checkboxMap.clear(),this.selectAllCheckbox=null,this.listContainer=null,this.barElement.remove()}updateBar(){let e=this.selected.size,t=e>0;this.barElement.classList.toggle("sp-bulk-bar--visible",t),c(this.countLabel,this.i18n["bulk.selected"].replace("{count}",String(e))),this.updateButtonLabels()}updateButtonLabels(){let e=this.selected.size;this.resolveBtn.replaceChildren();let t=document.createElement("span");c(t,e>0?`${this.i18n["bulk.resolve"]} ${e}`:this.i18n["bulk.resolve"]),this.resolveBtn.appendChild(t),this.deleteBtn.replaceChildren();let s=document.createElement("span");c(s,e>0?`${this.i18n["bulk.delete"]} ${e}`:this.i18n["bulk.delete"]),this.deleteBtn.appendChild(s)}updateCheckbox(e){let t=this.checkboxMap.get(e);if(!t)return;let s=this.selected.has(e);t.classList.toggle("sp-bulk-checkbox--checked",s),t.setAttribute("aria-checked",String(s)),t.replaceChildren(),t.appendChild(v(s?_t:ce))}updateSelectAllCheckbox(){if(!this.selectAllCheckbox)return;let e=this.selected.size>0&&this.selected.size===this.checkboxMap.size;this.selectAllCheckbox.classList.toggle("sp-bulk-checkbox--checked",e),this.selectAllCheckbox.setAttribute("aria-checked",String(e)),this.selectAllCheckbox.replaceChildren(),this.selectAllCheckbox.appendChild(v(e?_t:ce))}updateListSelectionClass(){this.listContainer&&this.listContainer.classList.toggle("sp-list--has-selection",this.selected.size>0)}updateCardSelectedState(e){if(!this.listContainer)return;let t=CSS.escape(e),s=this.listContainer.querySelector(`[data-feedback-id="${t}"]`);s&&s.classList.toggle("sp-card--selected",this.selected.has(e))}setButtonLoading(e){let t=Array.from(e.childNodes).map(s=>s.cloneNode(!0));return e.disabled=!0,e.replaceChildren(l("div",{class:"sp-spinner sp-spinner--sm"})),()=>{e.replaceChildren(...t),e.disabled=!1}}async handleResolve(){if(this.isProcessing||this.selected.size===0)return;this.isProcessing=!0;let e=[...this.selected],t=this.setButtonLoading(this.resolveBtn);this.deleteBtn.disabled=!0;try{await this.callbacks.onResolve(e),this.reset()}catch{t(),this.deleteBtn.disabled=!1}finally{this.isProcessing=!1}}async handleDelete(){if(this.isProcessing||this.selected.size===0)return;this.isProcessing=!0;let e=[...this.selected],t=this.setButtonLoading(this.deleteBtn);this.resolveBtn.disabled=!0;try{await this.callbacks.onDelete(e),this.reset()}catch{t(),this.resolveBtn.disabled=!1}finally{this.isProcessing=!1}}};var Os='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><line x1="19" y1="12" x2="5" y2="12"/><polyline points="12 19 5 12 12 5"/></svg>',_e='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"/><circle cx="12" cy="10" r="3"/></svg>',Hs='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg>',$s='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>',js='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg>',zs='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="2" y="3" width="20" height="14" rx="2" ry="2"/><line x1="8" y1="21" x2="16" y2="21"/><line x1="12" y1="17" x2="12" y2="21"/></svg>',Oe='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="20 6 9 17 4 12"/></svg>',Ht='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="1 4 1 10 7 10"/><path d="M3.51 15a9 9 0 1 0 2.13-9.36L1 10"/></svg>',$t='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="3 6 5 6 21 6"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/><line x1="10" y1="11" x2="10" y2="17"/><line x1="14" y1="11" x2="14" y2="17"/></svg>',Ks='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/></svg>',Ys='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="10"/><line x1="22" y1="12" x2="18" y2="12"/><line x1="6" y1="12" x2="2" y2="12"/><line x1="12" y1="6" x2="12" y2="2"/><line x1="12" y1="22" x2="12" y2="18"/></svg>',qs={"detail.back":"Back","detail.title":"Feedback #{number}","detail.status":"Status","detail.message":"Message","detail.metadata":"Details","detail.annotation":"Annotation","detail.page":"Page","detail.author":"Author","detail.date":"Created","detail.viewport":"Viewport","detail.browser":"Browser","detail.resolvedAt":"Resolved at","detail.goToAnnotation":"Go to annotation","detail.element":"Element","detail.selector":"Selector","detail.position":"Position","detail.resolve":"Resolve","detail.reopen":"Reopen","detail.delete":"Delete"},He={"detail.back":"Retour","detail.title":"Feedback n\xB0{number}","detail.status":"Statut","detail.message":"Message","detail.metadata":"D\xE9tails","detail.annotation":"Annotation","detail.page":"Page","detail.author":"Auteur","detail.date":"Cr\xE9\xE9 le","detail.viewport":"Viewport","detail.browser":"Navigateur","detail.resolvedAt":"R\xE9solu le","detail.goToAnnotation":"Aller \xE0 l'annotation","detail.element":"\xC9l\xE9ment","detail.selector":"S\xE9lecteur","detail.position":"Position","detail.resolve":"R\xE9soudre","detail.reopen":"Rouvrir","detail.delete":"Supprimer"},Kt=`
590
+ /* ============================
591
+ Detail View \u2014 Panel-in-Panel
592
+ ============================ */
593
+
594
+ .sp-detail {
595
+ position: absolute;
596
+ inset: 0;
597
+ display: flex;
598
+ flex-direction: column;
599
+ background: var(--sp-glass-bg);
600
+ backdrop-filter: blur(var(--sp-blur-heavy));
601
+ -webkit-backdrop-filter: blur(var(--sp-blur-heavy));
602
+ z-index: 20;
603
+ transform: translateX(100%);
604
+ transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
605
+ will-change: transform;
606
+ overflow: hidden;
607
+ }
608
+
609
+ .sp-detail--visible {
610
+ transform: translateX(0);
611
+ }
612
+
613
+ /* ---- Header ---- */
614
+
615
+ .sp-detail-header {
616
+ display: flex;
617
+ align-items: center;
618
+ gap: 12px;
619
+ padding: 16px 20px;
620
+ border-bottom: 1px solid var(--sp-border);
621
+ background: var(--sp-glass-bg-heavy);
622
+ backdrop-filter: blur(var(--sp-blur));
623
+ -webkit-backdrop-filter: blur(var(--sp-blur));
624
+ flex-shrink: 0;
625
+ min-height: 64px;
626
+ }
627
+
628
+ .sp-detail-back {
629
+ width: 40px;
630
+ height: 40px;
631
+ border-radius: var(--sp-radius);
632
+ border: none;
633
+ background: transparent;
634
+ cursor: pointer;
635
+ display: flex;
636
+ align-items: center;
637
+ justify-content: center;
638
+ color: var(--sp-text-tertiary);
639
+ transition: all 0.2s ease;
640
+ flex-shrink: 0;
641
+ padding: 0;
642
+ }
643
+
644
+ .sp-detail-back:hover {
645
+ background: var(--sp-bg-hover);
646
+ color: var(--sp-text);
647
+ }
648
+
649
+ .sp-detail-back:active {
650
+ transform: scale(0.92);
651
+ transition-duration: 0.1s;
652
+ }
653
+
654
+ .sp-detail-back svg {
655
+ width: 18px;
656
+ height: 18px;
657
+ }
658
+
659
+ .sp-detail-title {
660
+ font-size: 16px;
661
+ font-weight: 700;
662
+ color: var(--sp-text);
663
+ letter-spacing: -0.02em;
664
+ flex: 1;
665
+ min-width: 0;
666
+ overflow: hidden;
667
+ text-overflow: ellipsis;
668
+ white-space: nowrap;
669
+ }
670
+
671
+ .sp-detail-header .sp-badge {
672
+ flex-shrink: 0;
673
+ }
674
+
675
+ /* ---- Content ---- */
676
+
677
+ .sp-detail-content {
678
+ flex: 1;
679
+ overflow-y: auto;
680
+ overflow-x: hidden;
681
+ padding: 0;
682
+ }
683
+
684
+ .sp-detail-content::-webkit-scrollbar {
685
+ width: 6px;
686
+ }
687
+
688
+ .sp-detail-content::-webkit-scrollbar-track {
689
+ background: transparent;
690
+ }
691
+
692
+ .sp-detail-content::-webkit-scrollbar-thumb {
693
+ background: var(--sp-border);
694
+ border-radius: var(--sp-radius-full);
695
+ }
696
+
697
+ .sp-detail-content::-webkit-scrollbar-thumb:hover {
698
+ background: var(--sp-text-tertiary);
699
+ }
700
+
701
+ /* ---- Section ---- */
702
+
703
+ .sp-detail-section {
704
+ padding: 20px 24px;
705
+ border-bottom: 1px solid var(--sp-border);
706
+ opacity: 0;
707
+ transform: translateY(8px);
708
+ animation: sp-detail-section-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
709
+ }
710
+
711
+ @keyframes sp-detail-section-in {
712
+ to {
713
+ opacity: 1;
714
+ transform: translateY(0);
715
+ }
716
+ }
717
+
718
+ .sp-detail-section:last-child {
719
+ border-bottom: none;
720
+ }
721
+
722
+ .sp-detail-section-title {
723
+ font-size: 11px;
724
+ font-weight: 600;
725
+ color: var(--sp-text-tertiary);
726
+ text-transform: uppercase;
727
+ letter-spacing: 0.06em;
728
+ margin-bottom: 14px;
729
+ display: flex;
730
+ align-items: center;
731
+ gap: 6px;
732
+ }
733
+
734
+ .sp-detail-section-title svg {
735
+ width: 14px;
736
+ height: 14px;
737
+ opacity: 0.6;
738
+ }
739
+
740
+ /* ---- Status + Actions Section ---- */
741
+
742
+ .sp-detail-status {
743
+ display: flex;
744
+ align-items: center;
745
+ gap: 10px;
746
+ margin-bottom: 16px;
747
+ }
748
+
749
+ .sp-detail-status-pill {
750
+ display: inline-flex;
751
+ align-items: center;
752
+ gap: 6px;
753
+ padding: 5px 14px;
754
+ border-radius: var(--sp-radius-full);
755
+ font-size: 12px;
756
+ font-weight: 600;
757
+ letter-spacing: 0.02em;
758
+ }
759
+
760
+ .sp-detail-status-pill--open {
761
+ background: rgba(34, 197, 94, 0.1);
762
+ color: #22c55e;
763
+ border: 1px solid rgba(34, 197, 94, 0.2);
764
+ }
765
+
766
+ .sp-detail-status-pill--resolved {
767
+ background: rgba(156, 163, 175, 0.1);
768
+ color: #9ca3af;
769
+ border: 1px solid rgba(156, 163, 175, 0.2);
770
+ }
771
+
772
+ .sp-detail-status-dot {
773
+ width: 6px;
774
+ height: 6px;
775
+ border-radius: 50%;
776
+ flex-shrink: 0;
777
+ }
778
+
779
+ .sp-detail-actions {
780
+ display: flex;
781
+ gap: 8px;
782
+ }
783
+
784
+ .sp-detail-actions button {
785
+ flex: 1;
786
+ height: 40px;
787
+ padding: 0 16px;
788
+ border-radius: var(--sp-radius);
789
+ font-family: var(--sp-font);
790
+ font-size: 13px;
791
+ font-weight: 600;
792
+ cursor: pointer;
793
+ display: flex;
794
+ align-items: center;
795
+ justify-content: center;
796
+ gap: 6px;
797
+ transition: all 0.2s ease;
798
+ }
799
+
800
+ .sp-detail-actions button svg {
801
+ width: 15px;
802
+ height: 15px;
803
+ }
804
+
805
+ .sp-detail-btn-resolve {
806
+ border: 1.5px solid #22c55e;
807
+ background: rgba(34, 197, 94, 0.06);
808
+ color: #22c55e;
809
+ }
810
+
811
+ .sp-detail-btn-resolve:hover {
812
+ background: rgba(34, 197, 94, 0.14);
813
+ box-shadow: 0 0 16px rgba(34, 197, 94, 0.12);
814
+ transform: translateY(-1px);
815
+ }
816
+
817
+ .sp-detail-btn-resolve:active {
818
+ transform: translateY(0) scale(0.98);
819
+ transition-duration: 0.1s;
820
+ }
821
+
822
+ .sp-detail-btn-reopen {
823
+ border: 1.5px solid var(--sp-accent);
824
+ background: var(--sp-accent-light);
825
+ color: var(--sp-accent);
826
+ }
827
+
828
+ .sp-detail-btn-reopen:hover {
829
+ background: rgba(var(--sp-accent), 0.14);
830
+ box-shadow: 0 0 16px var(--sp-accent-glow);
831
+ transform: translateY(-1px);
832
+ }
833
+
834
+ .sp-detail-btn-reopen:active {
835
+ transform: translateY(0) scale(0.98);
836
+ transition-duration: 0.1s;
837
+ }
838
+
839
+ .sp-detail-btn-delete {
840
+ border: 1.5px solid #ef4444;
841
+ background: rgba(239, 68, 68, 0.06);
842
+ color: #ef4444;
843
+ }
844
+
845
+ .sp-detail-btn-delete:hover {
846
+ background: rgba(239, 68, 68, 0.14);
847
+ box-shadow: 0 0 16px rgba(239, 68, 68, 0.12);
848
+ transform: translateY(-1px);
849
+ }
850
+
851
+ .sp-detail-btn-delete:active {
852
+ transform: translateY(0) scale(0.98);
853
+ transition-duration: 0.1s;
854
+ }
855
+
856
+ .sp-detail-actions button:disabled {
857
+ opacity: 0.5;
858
+ cursor: not-allowed;
859
+ pointer-events: none;
860
+ transform: none;
861
+ box-shadow: none;
862
+ }
863
+
864
+ /* ---- Message Section ---- */
865
+
866
+ .sp-detail-message {
867
+ font-size: 14px;
868
+ line-height: 1.65;
869
+ color: var(--sp-text);
870
+ padding: 14px 16px;
871
+ border-left: 3px solid var(--sp-accent);
872
+ border-radius: 0 var(--sp-radius) var(--sp-radius) 0;
873
+ background: var(--sp-glass-bg-heavy);
874
+ white-space: pre-wrap;
875
+ word-break: break-word;
876
+ }
877
+
878
+ /* ---- Metadata Section ---- */
879
+
880
+ .sp-detail-meta {
881
+ display: flex;
882
+ flex-direction: column;
883
+ gap: 14px;
884
+ }
885
+
886
+ .sp-detail-meta-row {
887
+ display: flex;
888
+ align-items: flex-start;
889
+ gap: 12px;
890
+ }
891
+
892
+ .sp-detail-meta-row svg {
893
+ width: 14px;
894
+ height: 14px;
895
+ color: var(--sp-text-tertiary);
896
+ flex-shrink: 0;
897
+ margin-top: 1px;
898
+ }
899
+
900
+ .sp-detail-meta-content {
901
+ flex: 1;
902
+ min-width: 0;
903
+ }
904
+
905
+ .sp-detail-meta-label {
906
+ font-size: 10px;
907
+ font-weight: 600;
908
+ color: var(--sp-text-tertiary);
909
+ text-transform: uppercase;
910
+ letter-spacing: 0.06em;
911
+ line-height: 1;
912
+ margin-bottom: 4px;
913
+ }
914
+
915
+ .sp-detail-meta-value {
916
+ font-size: 13px;
917
+ line-height: 1.4;
918
+ color: var(--sp-text);
919
+ word-break: break-all;
920
+ }
921
+
922
+ .sp-detail-meta-value--mono {
923
+ font-family: "SF Mono", "Cascadia Code", "Fira Code", "Consolas", monospace;
924
+ font-size: 12px;
925
+ background: var(--sp-glass-bg-heavy);
926
+ padding: 2px 6px;
927
+ border-radius: 4px;
928
+ border: 1px solid var(--sp-glass-border-subtle);
929
+ }
930
+
931
+ .sp-detail-meta-value--secondary {
932
+ color: var(--sp-text-secondary);
933
+ font-size: 12px;
934
+ }
935
+
936
+ /* ---- Annotation Section ---- */
937
+
938
+ .sp-detail-annotation {
939
+ display: flex;
940
+ flex-direction: column;
941
+ gap: 12px;
942
+ }
943
+
944
+ .sp-detail-annotation-info {
945
+ display: flex;
946
+ flex-direction: column;
947
+ gap: 10px;
948
+ padding: 14px;
949
+ border-radius: var(--sp-radius);
950
+ background: var(--sp-glass-bg-heavy);
951
+ border: 1px solid var(--sp-glass-border-subtle);
952
+ }
953
+
954
+ .sp-detail-annotation-row {
955
+ display: flex;
956
+ align-items: flex-start;
957
+ gap: 10px;
958
+ }
959
+
960
+ .sp-detail-annotation-row svg {
961
+ width: 13px;
962
+ height: 13px;
963
+ color: var(--sp-text-tertiary);
964
+ flex-shrink: 0;
965
+ margin-top: 2px;
966
+ }
967
+
968
+ .sp-detail-annotation-label {
969
+ font-size: 10px;
970
+ font-weight: 600;
971
+ color: var(--sp-text-tertiary);
972
+ text-transform: uppercase;
973
+ letter-spacing: 0.06em;
974
+ line-height: 1;
975
+ margin-bottom: 3px;
976
+ }
977
+
978
+ .sp-detail-annotation-value {
979
+ font-size: 12px;
980
+ line-height: 1.4;
981
+ color: var(--sp-text);
982
+ word-break: break-all;
983
+ }
984
+
985
+ .sp-detail-annotation-value--mono {
986
+ font-family: "SF Mono", "Cascadia Code", "Fira Code", "Consolas", monospace;
987
+ font-size: 11px;
988
+ background: var(--sp-bg-hover);
989
+ padding: 2px 6px;
990
+ border-radius: 4px;
991
+ display: inline-block;
992
+ max-width: 100%;
993
+ overflow: hidden;
994
+ text-overflow: ellipsis;
995
+ white-space: nowrap;
996
+ }
997
+
998
+ .sp-detail-btn-goto {
999
+ width: 100%;
1000
+ height: 44px;
1001
+ padding: 0 20px;
1002
+ border-radius: var(--sp-radius);
1003
+ border: none;
1004
+ background: var(--sp-accent-gradient);
1005
+ color: #fff;
1006
+ font-family: var(--sp-font);
1007
+ font-size: 14px;
1008
+ font-weight: 600;
1009
+ cursor: pointer;
1010
+ display: flex;
1011
+ align-items: center;
1012
+ justify-content: center;
1013
+ gap: 8px;
1014
+ transition: all 0.25s ease;
1015
+ box-shadow: 0 2px 12px var(--sp-accent-glow);
1016
+ }
1017
+
1018
+ .sp-detail-btn-goto svg {
1019
+ width: 16px;
1020
+ height: 16px;
1021
+ }
1022
+
1023
+ .sp-detail-btn-goto:hover {
1024
+ box-shadow: 0 4px 20px var(--sp-accent-glow);
1025
+ transform: translateY(-2px);
1026
+ }
1027
+
1028
+ .sp-detail-btn-goto:active {
1029
+ transform: translateY(0) scale(0.98);
1030
+ transition-duration: 0.1s;
1031
+ }
1032
+
1033
+ /* ---- Forced Colors / High Contrast ---- */
1034
+
1035
+ @media (forced-colors: active) {
1036
+ .sp-detail {
1037
+ border: 2px solid ButtonText !important;
1038
+ background: Canvas !important;
1039
+ }
1040
+
1041
+ .sp-detail-back,
1042
+ .sp-detail-btn-goto,
1043
+ .sp-detail-btn-resolve,
1044
+ .sp-detail-btn-reopen,
1045
+ .sp-detail-btn-delete {
1046
+ border: 2px solid ButtonText !important;
1047
+ background: Canvas !important;
1048
+ color: ButtonText !important;
1049
+ }
1050
+
1051
+ .sp-detail-back:focus-visible,
1052
+ .sp-detail-btn-goto:focus-visible,
1053
+ .sp-detail-btn-resolve:focus-visible,
1054
+ .sp-detail-btn-reopen:focus-visible,
1055
+ .sp-detail-btn-delete:focus-visible {
1056
+ outline: 3px solid Highlight !important;
1057
+ }
1058
+
1059
+ .sp-detail-status-pill {
1060
+ border: 2px solid ButtonText !important;
1061
+ background: Canvas !important;
1062
+ color: ButtonText !important;
1063
+ }
1064
+
1065
+ .sp-detail-message {
1066
+ border-left: 3px solid ButtonText !important;
1067
+ }
1068
+ }
1069
+
1070
+ /* ---- Reduced Motion ---- */
1071
+
1072
+ @media (prefers-reduced-motion: reduce) {
1073
+ .sp-detail {
1074
+ transition-duration: 0.01ms !important;
1075
+ }
1076
+
1077
+ .sp-detail-section {
1078
+ animation-duration: 0.01ms !important;
1079
+ }
1080
+ }
1081
+ `;function Us(n){if(/Edg\//i.test(n)){let e=n.match(/Edg\/([\d.]+)/);return e?`Edge ${e[1]}`:"Edge"}if(/OPR\//i.test(n)||/Opera/i.test(n)){let e=n.match(/OPR\/([\d.]+)/);return e?`Opera ${e[1]}`:"Opera"}if(/Firefox\//i.test(n)){let e=n.match(/Firefox\/([\d.]+)/);return e?`Firefox ${e[1]}`:"Firefox"}if(/Chrome\//i.test(n)&&!/Chromium/i.test(n)){let e=n.match(/Chrome\/([\d.]+)/);return e?`Chrome ${e[1]}`:"Chrome"}if(/Safari\//i.test(n)&&!/Chrome/i.test(n)){let e=n.match(/Version\/([\d.]+)/);return e?`Safari ${e[1]}`:"Safari"}return"Unknown"}function jt(n,e){try{return new Date(n).toLocaleString(e,{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return n}}function Ws(n){try{return new URL(n).pathname}catch{return n}}function zt(n,e){return n.length<=e?n:n.slice(0,e-1)+"\u2026"}var he=class{constructor(e,t,s){this.colors=e;this.callbacks=t;this.i18n=s.startsWith("fr")?He:qs,this.element=l("div",{class:"sp-detail"}),this.element.setAttribute("role","dialog"),this.element.setAttribute("aria-label","Feedback detail"),this.element.setAttribute("aria-hidden","true");let o=l("div",{class:"sp-detail-header"}),i=document.createElement("button");i.type="button",i.className="sp-detail-back",i.setAttribute("aria-label",this.i18n["detail.back"]),i.appendChild(v(Os)),i.addEventListener("click",()=>{this.hide(),this.callbacks.onBack()}),this.element.appendChild(o),o.appendChild(i),this.content=l("div",{class:"sp-detail-content"}),this.element.appendChild(this.content)}colors;callbacks;element;_isVisible=!1;currentFeedback=null;content;i18n;resolveBtn=null;deleteBtn=null;isProcessing=!1;show(e,t){this.currentFeedback=e,this.isProcessing=!1;let s=this.element.querySelector(".sp-detail-header");if(!s)return;let o=s.querySelector(".sp-detail-back");if(!o)return;s.replaceChildren(o);let i=l("span",{class:"sp-detail-title"});c(i,this.i18n["detail.title"].replace("{number}",String(t))),s.appendChild(i);let r=l("span",{class:"sp-badge"});r.style.background=P(e.type,this.colors),r.style.color=M(e.type,this.colors),c(r,e.type),s.appendChild(r),this.content.replaceChildren();let a=0,p=this.buildSection(a++);this.buildStatusActions(p,e),this.content.appendChild(p);let d=this.buildSection(a++),u=l("div",{class:"sp-detail-section-title"});c(u,this.i18n["detail.message"]),d.appendChild(u);let h=l("div",{class:"sp-detail-message"});h.style.borderLeftColor=M(e.type,this.colors),c(h,e.message),d.appendChild(h),this.content.appendChild(d);let b=this.buildSection(a++),f=l("div",{class:"sp-detail-section-title"});if(c(f,this.i18n["detail.metadata"]),b.appendChild(f),this.buildMetadata(b,e),this.content.appendChild(b),e.annotations.length>0){let k=this.buildSection(a++),w=l("div",{class:"sp-detail-section-title"});w.appendChild(v(_e));let E=l("span");c(E,this.i18n["detail.annotation"]),w.appendChild(E),k.appendChild(w),this.buildAnnotation(k,e),this.content.appendChild(k)}this._isVisible=!0,this.element.setAttribute("aria-hidden","false"),this.element.offsetHeight,this.element.classList.add("sp-detail--visible"),requestAnimationFrame(()=>{o.focus()})}hide(){this._isVisible&&(this._isVisible=!1,this.element.classList.remove("sp-detail--visible"),this.element.setAttribute("aria-hidden","true"),this.currentFeedback=null,this.resolveBtn=null,this.deleteBtn=null)}get isVisible(){return this._isVisible}destroy(){this.hide(),this.element.remove()}buildSection(e){let t=l("div",{class:"sp-detail-section"});return t.style.animationDelay=`${e*40}ms`,t}buildStatusActions(e,t){let s=t.status==="resolved",o=l("div",{class:"sp-detail-section-title"});c(o,this.i18n["detail.status"]),e.appendChild(o);let i=l("div",{class:"sp-detail-status"}),r=l("span",{class:`sp-detail-status-pill ${s?"sp-detail-status-pill--resolved":"sp-detail-status-pill--open"}`}),a=l("span",{class:"sp-detail-status-dot"});a.style.background=s?"#9ca3af":"#22c55e",r.appendChild(a);let p=l("span");c(p,s?this.i18n["detail.reopen"]:this.i18n["detail.resolve"]),c(p,s?"Resolved":"Open"),r.appendChild(p),i.appendChild(r),e.appendChild(i);let d=l("div",{class:"sp-detail-actions"});if(this.resolveBtn=document.createElement("button"),this.resolveBtn.type="button",s){this.resolveBtn.className="sp-detail-btn-reopen",this.resolveBtn.appendChild(v(Ht));let h=document.createElement("span");c(h,this.i18n["detail.reopen"]),this.resolveBtn.appendChild(h)}else{this.resolveBtn.className="sp-detail-btn-resolve",this.resolveBtn.appendChild(v(Oe));let h=document.createElement("span");c(h,this.i18n["detail.resolve"]),this.resolveBtn.appendChild(h)}this.resolveBtn.addEventListener("click",()=>this.handleResolve()),this.deleteBtn=document.createElement("button"),this.deleteBtn.type="button",this.deleteBtn.className="sp-detail-btn-delete",this.deleteBtn.appendChild(v($t));let u=document.createElement("span");c(u,this.i18n["detail.delete"]),this.deleteBtn.appendChild(u),this.deleteBtn.addEventListener("click",()=>this.handleDelete()),d.appendChild(this.resolveBtn),d.appendChild(this.deleteBtn),e.appendChild(d)}buildMetadata(e,t){let s=l("div",{class:"sp-detail-meta"});if(this.addMetaRow(s,Hs,this.i18n["detail.page"],()=>{let o=l("div",{class:"sp-detail-meta-value"}),i=Ws(t.url);return c(o,zt(i,60)),o.title=t.url,o}),this.addMetaRow(s,$s,this.i18n["detail.author"],()=>{let o=l("div",{class:"sp-detail-meta-value"}),i=t.authorName||"Anonymous",r=t.authorEmail;return c(o,r?`${i} (${r})`:i),o}),this.addMetaRow(s,js,this.i18n["detail.date"],()=>{let o=l("div",{class:"sp-detail-meta-value"});return c(o,jt(t.createdAt,this.i18n===He?"fr":"en")),o}),this.addMetaRow(s,zs,this.i18n["detail.viewport"],()=>{let o=l("div",{class:"sp-detail-meta-value sp-detail-meta-value--mono"});return c(o,t.viewport||"Unknown"),o}),this.addMetaRow(s,'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="10"/><line x1="2" y1="12" x2="22" y2="12"/><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/></svg>',this.i18n["detail.browser"],()=>{let o=l("div",{class:"sp-detail-meta-value"});return c(o,Us(t.userAgent)),o}),t.resolvedAt){let o=t.resolvedAt;this.addMetaRow(s,Oe,this.i18n["detail.resolvedAt"],()=>{let i=l("div",{class:"sp-detail-meta-value sp-detail-meta-value--secondary"});return c(i,jt(o,this.i18n===He?"fr":"en")),i})}e.appendChild(s)}addMetaRow(e,t,s,o){let i=l("div",{class:"sp-detail-meta-row"});i.appendChild(v(t));let r=l("div",{class:"sp-detail-meta-content"}),a=l("div",{class:"sp-detail-meta-label"});c(a,s),r.appendChild(a),r.appendChild(o()),i.appendChild(r),e.appendChild(i)}buildAnnotation(e,t){let s=t.annotations[0];if(!s)return;let o=l("div",{class:"sp-detail-annotation"}),i=l("div",{class:"sp-detail-annotation-info"});this.addAnnotationRow(i,Ks,this.i18n["detail.element"],()=>{let p=l("span",{class:"sp-detail-annotation-value sp-detail-annotation-value--mono"}),d=s.elementId?`<${s.elementTag}#${s.elementId}>`:`<${s.elementTag}>`;return c(p,d),p}),this.addAnnotationRow(i,Ys,this.i18n["detail.selector"],()=>{let p=l("span",{class:"sp-detail-annotation-value sp-detail-annotation-value--mono"});return c(p,zt(s.cssSelector,60)),p.title=s.cssSelector,p}),this.addAnnotationRow(i,_e,this.i18n["detail.position"],()=>{let p=l("span",{class:"sp-detail-annotation-value"});return c(p,`${s.xPct.toFixed(1)}%, ${s.yPct.toFixed(1)}%`+(s.wPct>0||s.hPct>0?` (${s.wPct.toFixed(1)}% \xD7 ${s.hPct.toFixed(1)}%)`:"")),p}),o.appendChild(i);let r=document.createElement("button");r.type="button",r.className="sp-detail-btn-goto",r.appendChild(v(_e));let a=document.createElement("span");c(a,this.i18n["detail.goToAnnotation"]),r.appendChild(a),r.addEventListener("click",()=>{this.currentFeedback&&this.callbacks.onGoToAnnotation(this.currentFeedback)}),o.appendChild(r),e.appendChild(o)}addAnnotationRow(e,t,s,o){let i=l("div",{class:"sp-detail-annotation-row"});i.appendChild(v(t));let r=l("div",{class:"sp-detail-meta-content"}),a=l("div",{class:"sp-detail-annotation-label"});c(a,s),r.appendChild(a),r.appendChild(o()),i.appendChild(r),e.appendChild(i)}async handleResolve(){if(!(this.isProcessing||!this.currentFeedback)){this.isProcessing=!0,this.resolveBtn&&this.setButtonLoading(this.resolveBtn),this.deleteBtn&&(this.deleteBtn.disabled=!0);try{await this.callbacks.onResolve(this.currentFeedback)}catch{this.isProcessing=!1,this.resolveBtn&&this.restoreResolveBtn(this.currentFeedback),this.deleteBtn&&(this.deleteBtn.disabled=!1)}}}async handleDelete(){if(!(this.isProcessing||!this.currentFeedback)){this.isProcessing=!0,this.deleteBtn&&this.setButtonLoading(this.deleteBtn),this.resolveBtn&&(this.resolveBtn.disabled=!0);try{await this.callbacks.onDelete(this.currentFeedback)}catch{this.isProcessing=!1,this.deleteBtn&&this.restoreDeleteBtn(),this.resolveBtn&&(this.resolveBtn.disabled=!1)}}}setButtonLoading(e){e.disabled=!0,e.replaceChildren(l("div",{class:"sp-spinner sp-spinner--sm"}))}restoreResolveBtn(e){if(!this.resolveBtn)return;this.resolveBtn.disabled=!1,this.resolveBtn.replaceChildren();let t=e.status==="resolved";this.resolveBtn.appendChild(v(t?Ht:Oe));let s=document.createElement("span");c(s,t?this.i18n["detail.reopen"]:this.i18n["detail.resolve"]),this.resolveBtn.appendChild(s)}restoreDeleteBtn(){if(!this.deleteBtn)return;this.deleteBtn.disabled=!1,this.deleteBtn.replaceChildren(),this.deleteBtn.appendChild(v($t));let e=document.createElement("span");c(e,this.i18n["detail.delete"]),this.deleteBtn.appendChild(e)}};var Xs='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M11 5h10"/><path d="M11 9h7"/><path d="M11 13h4"/><path d="M3 17l3 3 3-3"/><path d="M6 18V4"/></svg>',qt='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/><polyline points="10 9 9 9 8 9"/></svg>',Vs='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="9 18 15 12 9 6"/></svg>',Gs={"sort.newest":"Newest first","sort.oldest":"Oldest first","sort.byType":"By type","sort.openFirst":"Open first","sort.label":"Sort","group.byPage":"By page","group.feedbacks":"{count} feedbacks"},Qs={"sort.newest":"Plus r\xE9cents","sort.oldest":"Plus anciens","sort.byType":"Par type","sort.openFirst":"Ouverts d'abord","sort.label":"Trier","group.byPage":"Par page","group.feedbacks":"{count} feedbacks"},Yt={question:0,change:1,bug:2,other:3};function Ut(n,e){let t=[...n];switch(e){case"newest":t.sort((s,o)=>new Date(o.createdAt).getTime()-new Date(s.createdAt).getTime());break;case"oldest":t.sort((s,o)=>new Date(s.createdAt).getTime()-new Date(o.createdAt).getTime());break;case"by-type":t.sort((s,o)=>{let i=Yt[s.type]??99,r=Yt[o.type]??99;return i!==r?i-r:new Date(o.createdAt).getTime()-new Date(s.createdAt).getTime()});break;case"open-first":t.sort((s,o)=>{let i=s.status==="open"?0:1,r=o.status==="open"?0:1;return i!==r?i-r:new Date(o.createdAt).getTime()-new Date(s.createdAt).getTime()});break}return t}function Js(n){try{return new URL(n).pathname}catch{return n}}function Zs(n,e){if(n.length<=e)return n;let t="\u2026",s=Math.floor((e-1)/2);return n.slice(0,s)+t+n.slice(-s)}function Wt(n){let e=new Map;for(let s of n){let o=Js(s.url),i=e.get(o);i?i.push(s):e.set(o,[s])}return new Map([...e.entries()].sort((s,o)=>o[1].length-s[1].length))}function Xt(n,e,t){let s=l("div",{class:"sp-group-header"});s.setAttribute("role","button"),s.setAttribute("tabindex","0"),s.setAttribute("aria-expanded","true"),s.style.borderBottomColor=t.border;let o=l("span",{class:"sp-group-header-chevron"});o.appendChild(v(Vs)),s.appendChild(o);let i=l("span",{class:"sp-group-header-icon"});i.appendChild(v(qt)),s.appendChild(i);let r=l("span",{class:"sp-group-header-path"}),a=Zs(n,40);c(r,a),n.length>40&&(r.title=n),s.appendChild(r);let p=l("span",{class:"sp-group-header-count"});p.style.background=t.accentLight,p.style.color=t.accent,c(p,String(e)),s.appendChild(p);let d=()=>{let u=s.getAttribute("aria-expanded")==="true";s.setAttribute("aria-expanded",String(!u)),s.classList.toggle("sp-group-header--collapsed",u);let h=s.nextElementSibling;h?.classList.contains("sp-group-content")&&h.classList.toggle("sp-group-content--collapsed",u)};return s.addEventListener("click",d),s.addEventListener("keydown",u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),d())}),s}var be=class{element;_sortMode="newest";_groupByPage=!1;menuEl=null;sortBtn;groupToggle;i18n;colors;onChange;outsideClickHandler=null;constructor(e,t,s){this.colors=e,this.onChange=t,this.i18n=s==="fr"?Qs:Gs,this.element=l("div",{class:"sp-sort-controls"}),this.sortBtn=document.createElement("button"),this.sortBtn.className="sp-sort-btn",this.sortBtn.setAttribute("aria-haspopup","listbox"),this.sortBtn.setAttribute("aria-expanded","false"),this.sortBtn.setAttribute("aria-label",this.i18n["sort.label"]);let o=v(Xs);this.sortBtn.appendChild(o);let i=l("span",{class:"sp-sort-btn-label"});c(i,this.i18n["sort.newest"]),this.sortBtn.appendChild(i),this.sortBtn.addEventListener("click",p=>{p.stopPropagation(),this.toggleMenu()}),this.groupToggle=document.createElement("button"),this.groupToggle.className="sp-group-toggle",this.groupToggle.setAttribute("aria-pressed","false");let r=v(qt);this.groupToggle.appendChild(r);let a=l("span",{class:"sp-group-toggle-label"});c(a,this.i18n["group.byPage"]),this.groupToggle.appendChild(a),this.groupToggle.addEventListener("click",()=>{this._groupByPage=!this._groupByPage,this.groupToggle.classList.toggle("sp-group-toggle--active",this._groupByPage),this.groupToggle.setAttribute("aria-pressed",String(this._groupByPage)),this.onChange()}),this.element.appendChild(this.sortBtn),this.element.appendChild(this.groupToggle)}get sortMode(){return this._sortMode}get groupByPage(){return this._groupByPage}toggleMenu(){if(this.menuEl){this.closeMenu();return}this.openMenu()}openMenu(){this.menuEl=l("div",{class:"sp-sort-menu"}),this.menuEl.setAttribute("role","listbox"),this.menuEl.setAttribute("aria-label",this.i18n["sort.label"]),this.sortBtn.setAttribute("aria-expanded","true");let e=[{mode:"newest",label:this.i18n["sort.newest"]},{mode:"oldest",label:this.i18n["sort.oldest"]},{mode:"by-type",label:this.i18n["sort.byType"]},{mode:"open-first",label:this.i18n["sort.openFirst"]}];for(let t of e){let s=document.createElement("button");s.className=`sp-sort-option${t.mode===this._sortMode?" sp-sort-option--active":""}`,s.setAttribute("role","option"),s.setAttribute("aria-selected",String(t.mode===this._sortMode)),t.mode===this._sortMode&&(s.style.background=this.colors.accentLight,s.style.color=this.colors.accent),c(s,t.label),s.addEventListener("click",o=>{o.stopPropagation(),this._sortMode=t.mode,this.updateSortLabel(),this.closeMenu(),this.onChange()}),this.menuEl.appendChild(s)}this.element.appendChild(this.menuEl),requestAnimationFrame(()=>{this.outsideClickHandler=t=>{this.menuEl&&!this.element.contains(t.target)&&this.closeMenu()},document.addEventListener("click",this.outsideClickHandler,!0)}),this.menuEl.addEventListener("keydown",t=>{t.key==="Escape"&&(this.closeMenu(),this.sortBtn.focus())})}closeMenu(){this.menuEl&&(this.menuEl.remove(),this.menuEl=null),this.sortBtn.setAttribute("aria-expanded","false"),this.outsideClickHandler&&(document.removeEventListener("click",this.outsideClickHandler,!0),this.outsideClickHandler=null)}updateSortLabel(){let e={newest:this.i18n["sort.newest"],oldest:this.i18n["sort.oldest"],"by-type":this.i18n["sort.byType"],"open-first":this.i18n["sort.openFirst"]},t=this.sortBtn.querySelector(".sp-sort-btn-label");t&&c(t,e[this._sortMode])}destroy(){this.closeMenu()}},Vt=`
1082
+ /* ============================
1083
+ Sort Controls Container
1084
+ ============================ */
1085
+
1086
+ .sp-sort-controls {
1087
+ display: flex;
1088
+ align-items: center;
1089
+ gap: 6px;
1090
+ margin-top: 4px;
1091
+ padding-top: 8px;
1092
+ border-top: 1px solid var(--sp-border);
1093
+ }
1094
+
1095
+ /* ============================
1096
+ Sort Dropdown Button
1097
+ ============================ */
1098
+
1099
+ .sp-sort-btn {
1100
+ display: inline-flex;
1101
+ align-items: center;
1102
+ gap: 5px;
1103
+ padding: 5px 12px;
1104
+ border-radius: var(--sp-radius-full);
1105
+ border: 1px solid var(--sp-border);
1106
+ background: var(--sp-glass-bg-heavy);
1107
+ color: var(--sp-text-secondary);
1108
+ font-family: var(--sp-font);
1109
+ font-size: 12px;
1110
+ font-weight: 500;
1111
+ cursor: pointer;
1112
+ white-space: nowrap;
1113
+ transition: all 0.2s ease;
1114
+ position: relative;
1115
+ }
1116
+
1117
+ .sp-sort-btn svg {
1118
+ width: 14px;
1119
+ height: 14px;
1120
+ flex-shrink: 0;
1121
+ }
1122
+
1123
+ .sp-sort-btn:hover {
1124
+ border-color: var(--sp-accent);
1125
+ color: var(--sp-accent);
1126
+ background: var(--sp-accent-light);
1127
+ }
1128
+
1129
+ .sp-sort-btn[aria-expanded="true"] {
1130
+ border-color: var(--sp-accent);
1131
+ color: var(--sp-accent);
1132
+ background: var(--sp-accent-light);
1133
+ }
1134
+
1135
+ /* ============================
1136
+ Sort Floating Menu
1137
+ ============================ */
1138
+
1139
+ .sp-sort-menu {
1140
+ position: absolute;
1141
+ top: calc(100% + 6px);
1142
+ left: 0;
1143
+ min-width: 170px;
1144
+ padding: 4px;
1145
+ border-radius: var(--sp-radius);
1146
+ background: var(--sp-glass-bg-heavy);
1147
+ backdrop-filter: blur(var(--sp-blur-heavy));
1148
+ -webkit-backdrop-filter: blur(var(--sp-blur-heavy));
1149
+ border: 1px solid var(--sp-glass-border);
1150
+ box-shadow: var(--sp-shadow-md);
1151
+ z-index: 10;
1152
+ animation: sp-sort-menu-in 0.15s ease-out both;
1153
+ }
1154
+
1155
+ @keyframes sp-sort-menu-in {
1156
+ from {
1157
+ opacity: 0;
1158
+ transform: translateY(-4px) scale(0.97);
1159
+ }
1160
+ to {
1161
+ opacity: 1;
1162
+ transform: translateY(0) scale(1);
1163
+ }
1164
+ }
1165
+
1166
+ /* ============================
1167
+ Sort Menu Option
1168
+ ============================ */
1169
+
1170
+ .sp-sort-option {
1171
+ display: block;
1172
+ width: 100%;
1173
+ padding: 8px 12px;
1174
+ border: none;
1175
+ border-radius: 8px;
1176
+ background: transparent;
1177
+ color: var(--sp-text-secondary);
1178
+ font-family: var(--sp-font);
1179
+ font-size: 12px;
1180
+ font-weight: 500;
1181
+ cursor: pointer;
1182
+ text-align: left;
1183
+ transition: all 0.15s ease;
1184
+ }
1185
+
1186
+ .sp-sort-option:hover {
1187
+ background: var(--sp-bg-hover);
1188
+ color: var(--sp-text);
1189
+ }
1190
+
1191
+ .sp-sort-option--active {
1192
+ font-weight: 600;
1193
+ }
1194
+
1195
+ .sp-sort-option--active:hover {
1196
+ background: var(--sp-accent-light);
1197
+ color: var(--sp-accent);
1198
+ }
1199
+
1200
+ /* ============================
1201
+ Group by Page Toggle
1202
+ ============================ */
1203
+
1204
+ .sp-group-toggle {
1205
+ display: inline-flex;
1206
+ align-items: center;
1207
+ gap: 5px;
1208
+ padding: 5px 12px;
1209
+ border-radius: var(--sp-radius-full);
1210
+ border: 1px solid var(--sp-border);
1211
+ background: var(--sp-glass-bg-heavy);
1212
+ color: var(--sp-text-secondary);
1213
+ font-family: var(--sp-font);
1214
+ font-size: 12px;
1215
+ font-weight: 500;
1216
+ cursor: pointer;
1217
+ white-space: nowrap;
1218
+ transition: all 0.2s ease;
1219
+ }
1220
+
1221
+ .sp-group-toggle svg {
1222
+ width: 13px;
1223
+ height: 13px;
1224
+ flex-shrink: 0;
1225
+ }
1226
+
1227
+ .sp-group-toggle:hover {
1228
+ border-color: var(--sp-accent);
1229
+ color: var(--sp-accent);
1230
+ background: var(--sp-accent-light);
1231
+ }
1232
+
1233
+ .sp-group-toggle--active {
1234
+ background: var(--sp-accent-gradient);
1235
+ border-color: transparent;
1236
+ color: #fff;
1237
+ box-shadow: 0 2px 8px var(--sp-accent-glow);
1238
+ }
1239
+
1240
+ .sp-group-toggle--active:hover {
1241
+ background: var(--sp-accent-gradient);
1242
+ border-color: transparent;
1243
+ color: #fff;
1244
+ }
1245
+
1246
+ /* ============================
1247
+ Page Group Header
1248
+ ============================ */
1249
+
1250
+ .sp-group-header {
1251
+ display: flex;
1252
+ align-items: center;
1253
+ gap: 8px;
1254
+ padding: 8px 12px;
1255
+ background: var(--sp-accent-light);
1256
+ border-bottom: 1px solid var(--sp-border);
1257
+ cursor: pointer;
1258
+ user-select: none;
1259
+ position: sticky;
1260
+ top: 0;
1261
+ z-index: 2;
1262
+ transition: background 0.2s ease;
1263
+ }
1264
+
1265
+ .sp-group-header:hover {
1266
+ background: var(--sp-bg-hover);
1267
+ }
1268
+
1269
+ .sp-group-header:focus-visible {
1270
+ outline: 2px solid var(--sp-accent);
1271
+ outline-offset: -2px;
1272
+ }
1273
+
1274
+ .sp-group-header-chevron {
1275
+ display: flex;
1276
+ align-items: center;
1277
+ justify-content: center;
1278
+ width: 16px;
1279
+ height: 16px;
1280
+ flex-shrink: 0;
1281
+ transition: transform 0.2s ease;
1282
+ transform: rotate(90deg);
1283
+ }
1284
+
1285
+ .sp-group-header-chevron svg {
1286
+ width: 12px;
1287
+ height: 12px;
1288
+ color: var(--sp-text-tertiary);
1289
+ }
1290
+
1291
+ .sp-group-header--collapsed .sp-group-header-chevron {
1292
+ transform: rotate(0deg);
1293
+ }
1294
+
1295
+ .sp-group-header-icon {
1296
+ display: flex;
1297
+ align-items: center;
1298
+ flex-shrink: 0;
1299
+ }
1300
+
1301
+ .sp-group-header-icon svg {
1302
+ width: 14px;
1303
+ height: 14px;
1304
+ color: var(--sp-text-tertiary);
1305
+ }
1306
+
1307
+ .sp-group-header-path {
1308
+ font-size: 12px;
1309
+ font-weight: 600;
1310
+ color: var(--sp-text-secondary);
1311
+ flex: 1;
1312
+ min-width: 0;
1313
+ overflow: hidden;
1314
+ text-overflow: ellipsis;
1315
+ white-space: nowrap;
1316
+ }
1317
+
1318
+ .sp-group-header-count {
1319
+ font-size: 11px;
1320
+ font-weight: 700;
1321
+ padding: 1px 8px;
1322
+ border-radius: var(--sp-radius-full);
1323
+ flex-shrink: 0;
1324
+ font-variant-numeric: tabular-nums;
1325
+ }
1326
+
1327
+ /* ============================
1328
+ Page Group Content
1329
+ ============================ */
1330
+
1331
+ .sp-group-content {
1332
+ overflow: hidden;
1333
+ transition: max-height 0.25s ease, opacity 0.2s ease;
1334
+ max-height: 5000px;
1335
+ opacity: 1;
1336
+ }
1337
+
1338
+ .sp-group-content--collapsed {
1339
+ max-height: 0;
1340
+ opacity: 0;
1341
+ pointer-events: none;
1342
+ }
1343
+
1344
+ /* ============================
1345
+ Forced Colors / High Contrast
1346
+ ============================ */
1347
+
1348
+ @media (forced-colors: active) {
1349
+ .sp-sort-btn,
1350
+ .sp-group-toggle,
1351
+ .sp-sort-option,
1352
+ .sp-group-header {
1353
+ border: 2px solid ButtonText !important;
1354
+ background: Canvas !important;
1355
+ color: ButtonText !important;
1356
+ }
1357
+
1358
+ .sp-sort-btn:focus-visible,
1359
+ .sp-group-toggle:focus-visible,
1360
+ .sp-sort-option:focus-visible,
1361
+ .sp-group-header:focus-visible {
1362
+ outline: 3px solid Highlight !important;
1363
+ }
1364
+
1365
+ .sp-sort-menu {
1366
+ border: 2px solid ButtonText !important;
1367
+ background: Canvas !important;
1368
+ }
1369
+ }
1370
+
1371
+ /* ============================
1372
+ Reduced Motion
1373
+ ============================ */
1374
+
1375
+ @media (prefers-reduced-motion: reduce) {
1376
+ .sp-sort-menu {
1377
+ animation: none;
1378
+ }
1379
+ .sp-group-header-chevron {
1380
+ transition: none;
1381
+ }
1382
+ .sp-group-content {
1383
+ transition: none;
1384
+ }
1385
+ }
1386
+ `;var en={"stats.open":"Open","stats.resolved":"Resolved","stats.bugs":"Bugs","stats.progress":"{percent}% resolved"},tn={"stats.open":"Ouverts","stats.resolved":"R\xE9solus","stats.bugs":"Bugs","stats.progress":"{percent}% r\xE9solus"},Gt=`
1387
+ .sp-stats-bar {
1388
+ display: flex;
1389
+ flex-direction: column;
1390
+ gap: 8px;
1391
+ padding: 12px 24px;
1392
+ border-bottom: 1px solid var(--sp-border);
1393
+ user-select: none;
1394
+ }
1395
+
1396
+ .sp-stats-bar[hidden] {
1397
+ display: none;
1398
+ }
1399
+
1400
+ .sp-stats-row {
1401
+ display: flex;
1402
+ align-items: center;
1403
+ gap: 16px;
1404
+ }
1405
+
1406
+ .sp-stats-item {
1407
+ display: flex;
1408
+ align-items: center;
1409
+ gap: 6px;
1410
+ }
1411
+
1412
+ .sp-stats-dot {
1413
+ width: 6px;
1414
+ height: 6px;
1415
+ border-radius: 50%;
1416
+ flex-shrink: 0;
1417
+ }
1418
+
1419
+ .sp-stats-value {
1420
+ font-size: 16px;
1421
+ font-weight: 600;
1422
+ line-height: 1;
1423
+ color: var(--sp-text);
1424
+ font-variant-numeric: tabular-nums;
1425
+ font-feature-settings: "tnum";
1426
+ transition: opacity 0.3s ease;
1427
+ }
1428
+
1429
+ .sp-stats-label {
1430
+ font-size: 11px;
1431
+ line-height: 1;
1432
+ color: var(--sp-text-tertiary);
1433
+ text-transform: uppercase;
1434
+ letter-spacing: 0.04em;
1435
+ }
1436
+
1437
+ .sp-stats-progress {
1438
+ display: flex;
1439
+ align-items: center;
1440
+ gap: 8px;
1441
+ }
1442
+
1443
+ .sp-stats-progress-track {
1444
+ flex: 1;
1445
+ height: 4px;
1446
+ border-radius: 2px;
1447
+ background: var(--sp-border);
1448
+ overflow: hidden;
1449
+ }
1450
+
1451
+ .sp-stats-progress-fill {
1452
+ height: 100%;
1453
+ border-radius: 2px;
1454
+ background: linear-gradient(90deg, var(--sp-accent), #22c55e);
1455
+ width: 0%;
1456
+ transition: width 0.5s ease;
1457
+ }
1458
+
1459
+ .sp-stats-progress-label {
1460
+ font-size: 10px;
1461
+ line-height: 1;
1462
+ color: var(--sp-text-tertiary);
1463
+ white-space: nowrap;
1464
+ font-variant-numeric: tabular-nums;
1465
+ font-feature-settings: "tnum";
1466
+ min-width: 64px;
1467
+ text-align: right;
1468
+ }
1469
+ `,ge=class{constructor(e,t){this.colors=e;this.i18n=t==="fr"?tn:en,this.element=l("div",{class:"sp-stats-bar"}),this.element.setAttribute("aria-label","Feedback statistics"),this.element.hidden=!0;let s=l("div",{class:"sp-stats-row"}),o=l("div",{class:"sp-stats-item"}),i=l("span",{class:"sp-stats-dot"});i.style.background="#22c55e",this.valueOpen=l("span",{class:"sp-stats-value"}),c(this.valueOpen,"0");let r=l("span",{class:"sp-stats-label"});c(r,this.i18n["stats.open"]),o.appendChild(i),o.appendChild(this.valueOpen),o.appendChild(r);let a=l("div",{class:"sp-stats-item"}),p=l("span",{class:"sp-stats-dot"});p.style.background="#9ca3af",this.valueResolved=l("span",{class:"sp-stats-value"}),c(this.valueResolved,"0");let d=l("span",{class:"sp-stats-label"});c(d,this.i18n["stats.resolved"]),a.appendChild(p),a.appendChild(this.valueResolved),a.appendChild(d);let u=l("div",{class:"sp-stats-item"}),h=l("span",{class:"sp-stats-dot"});h.style.background=this.colors.typeBug,this.valueBugs=l("span",{class:"sp-stats-value"}),c(this.valueBugs,"0");let b=l("span",{class:"sp-stats-label"});c(b,this.i18n["stats.bugs"]),u.appendChild(h),u.appendChild(this.valueBugs),u.appendChild(b),s.appendChild(o),s.appendChild(a),s.appendChild(u);let f=l("div",{class:"sp-stats-progress"}),k=l("div",{class:"sp-stats-progress-track"});this.progressFill=l("div",{class:"sp-stats-progress-fill"}),k.appendChild(this.progressFill),this.progressLabel=l("span",{class:"sp-stats-progress-label"}),c(this.progressLabel,""),f.appendChild(k),f.appendChild(this.progressLabel),this.element.appendChild(s),this.element.appendChild(f)}colors;element;valueOpen;valueResolved;valueBugs;progressFill;progressLabel;i18n;update(e,t){if(t===0){this.element.hidden=!0;return}this.element.hidden=!1;let s=0,o=0,i=0;for(let d of e)d.status==="open"&&s++,d.status==="resolved"&&o++,d.type==="bug"&&i++;c(this.valueOpen,String(s)),c(this.valueResolved,String(o)),c(this.valueBugs,String(i));let r=e.length,a=r>0?Math.round(o/r*100):0;requestAnimationFrame(()=>{this.progressFill.style.width=`${a}%`});let p=this.i18n["stats.progress"].replace("{percent}",String(a));c(this.progressLabel,p)}};var sn='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="2" y="4" width="20" height="16" rx="2"/><path d="M6 8h.01"/><path d="M10 8h.01"/><path d="M14 8h.01"/><path d="M18 8h.01"/><path d="M6 12h.01"/><path d="M18 12h.01"/><path d="M8 16h8"/></svg>',$e={"shortcuts.title":"Keyboard shortcuts","shortcuts.navigate":"Navigate feedbacks","shortcuts.resolve":"Resolve / Reopen","shortcuts.delete":"Delete","shortcuts.search":"Focus search","shortcuts.select":"Toggle selection","shortcuts.help":"Show shortcuts","shortcuts.close":"Close","shortcuts.hint":"Keyboard shortcuts"},Qt={"shortcuts.title":"Raccourcis clavier","shortcuts.navigate":"Naviguer les feedbacks","shortcuts.resolve":"R\xE9soudre / Rouvrir","shortcuts.delete":"Supprimer","shortcuts.search":"Rechercher","shortcuts.select":"S\xE9lectionner","shortcuts.help":"Raccourcis","shortcuts.close":"Fermer","shortcuts.hint":"Raccourcis clavier"};function je(n){let e=n.querySelectorAll(".sp-card");for(let t=0;t<e.length;t++)if(e[t]?.classList.contains("sp-card--focused"))return t;return-1}function Jt(n,e){let t=n.querySelectorAll(".sp-card");if(t.length===0)return;for(let i of t)i.classList.remove("sp-card--focused");let s=Math.max(0,Math.min(e,t.length-1)),o=t[s];o&&(o.classList.add("sp-card--focused"),o.scrollIntoView({block:"nearest",behavior:"smooth"}),o.focus({preventScroll:!0}))}var nn=[{keys:["J","K"],label:"shortcuts.navigate"},{keys:["R"],label:"shortcuts.resolve"},{keys:["D"],label:"shortcuts.delete"},{keys:["F","/"],label:"shortcuts.search"},{keys:["X"],label:"shortcuts.select"},{keys:["?"],label:"shortcuts.help"},{keys:["Esc"],label:"shortcuts.close"}],Zt=`
1470
+ /* ---- Help overlay backdrop ---- */
1471
+
1472
+ .sp-shortcuts-overlay {
1473
+ position: fixed;
1474
+ inset: 0;
1475
+ background: var(--sp-backdrop, rgba(15, 23, 42, 0.2));
1476
+ backdrop-filter: blur(var(--sp-blur));
1477
+ -webkit-backdrop-filter: blur(var(--sp-blur));
1478
+ display: flex;
1479
+ align-items: center;
1480
+ justify-content: center;
1481
+ z-index: 10;
1482
+ opacity: 0;
1483
+ pointer-events: none;
1484
+ transition: opacity 0.2s ease;
1485
+ }
1486
+
1487
+ .sp-shortcuts-overlay--visible {
1488
+ opacity: 1;
1489
+ pointer-events: auto;
1490
+ }
1491
+
1492
+ /* ---- Glassmorphism card ---- */
1493
+
1494
+ .sp-shortcuts-card {
1495
+ width: 380px;
1496
+ max-width: calc(100vw - 32px);
1497
+ padding: 24px 28px 20px;
1498
+ border-radius: 20px;
1499
+ background: var(--sp-glass-bg-heavy);
1500
+ backdrop-filter: blur(var(--sp-blur-heavy));
1501
+ -webkit-backdrop-filter: blur(var(--sp-blur-heavy));
1502
+ border: 1px solid var(--sp-glass-border);
1503
+ box-shadow: var(--sp-shadow-xl);
1504
+ font-family: var(--sp-font);
1505
+ position: relative;
1506
+ transform: scale(0.92) translateY(8px);
1507
+ transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
1508
+ }
1509
+
1510
+ .sp-shortcuts-overlay--visible .sp-shortcuts-card {
1511
+ transform: scale(1) translateY(0);
1512
+ }
1513
+
1514
+ /* ---- Title row ---- */
1515
+
1516
+ .sp-shortcuts-title {
1517
+ display: flex;
1518
+ align-items: center;
1519
+ gap: 8px;
1520
+ font-size: 16px;
1521
+ font-weight: 700;
1522
+ color: var(--sp-text);
1523
+ margin-bottom: 18px;
1524
+ }
1525
+
1526
+ .sp-shortcuts-title svg {
1527
+ width: 18px;
1528
+ height: 18px;
1529
+ color: var(--sp-text-secondary);
1530
+ flex-shrink: 0;
1531
+ }
1532
+
1533
+ /* ---- Close button ---- */
1534
+
1535
+ .sp-shortcuts-close {
1536
+ position: absolute;
1537
+ top: 16px;
1538
+ right: 16px;
1539
+ width: 28px;
1540
+ height: 28px;
1541
+ border-radius: 8px;
1542
+ border: none;
1543
+ background: transparent;
1544
+ color: var(--sp-text-tertiary);
1545
+ cursor: pointer;
1546
+ display: flex;
1547
+ align-items: center;
1548
+ justify-content: center;
1549
+ transition: background 0.15s ease, color 0.15s ease;
1550
+ }
1551
+
1552
+ .sp-shortcuts-close:hover {
1553
+ background: var(--sp-bg-hover);
1554
+ color: var(--sp-text);
1555
+ }
1556
+
1557
+ .sp-shortcuts-close svg {
1558
+ width: 14px;
1559
+ height: 14px;
1560
+ }
1561
+
1562
+ /* ---- Two-column grid ---- */
1563
+
1564
+ .sp-shortcuts-grid {
1565
+ display: flex;
1566
+ flex-direction: column;
1567
+ gap: 10px;
1568
+ }
1569
+
1570
+ .sp-shortcuts-row {
1571
+ display: flex;
1572
+ align-items: center;
1573
+ gap: 12px;
1574
+ }
1575
+
1576
+ .sp-shortcuts-keys {
1577
+ display: flex;
1578
+ align-items: center;
1579
+ gap: 4px;
1580
+ min-width: 80px;
1581
+ justify-content: flex-end;
1582
+ }
1583
+
1584
+ .sp-shortcuts-separator {
1585
+ font-size: 11px;
1586
+ color: var(--sp-text-tertiary);
1587
+ user-select: none;
1588
+ }
1589
+
1590
+ /* ---- Key badge (<kbd> styling) ---- */
1591
+
1592
+ .sp-kbd {
1593
+ display: inline-flex;
1594
+ align-items: center;
1595
+ justify-content: center;
1596
+ min-width: 28px;
1597
+ height: 26px;
1598
+ padding: 0 7px;
1599
+ border-radius: 6px;
1600
+ background: var(--sp-bg-hover);
1601
+ border: 1px solid var(--sp-border);
1602
+ box-shadow:
1603
+ inset 0 -1px 0 rgba(0, 0, 0, 0.08),
1604
+ 0 1px 2px rgba(0, 0, 0, 0.04);
1605
+ font-family: ui-monospace, "SF Mono", "Cascadia Code", "Segoe UI Mono", Menlo, monospace;
1606
+ font-size: 12px;
1607
+ font-weight: 600;
1608
+ color: var(--sp-text);
1609
+ text-align: center;
1610
+ line-height: 1;
1611
+ user-select: none;
1612
+ }
1613
+
1614
+ /* ---- Description text ---- */
1615
+
1616
+ .sp-shortcuts-desc {
1617
+ font-size: 13px;
1618
+ color: var(--sp-text-secondary);
1619
+ line-height: 1.3;
1620
+ }
1621
+
1622
+ /* ---- Hint button (bottom-right of panel) ---- */
1623
+
1624
+ .sp-shortcuts-hint {
1625
+ width: 24px;
1626
+ height: 24px;
1627
+ border-radius: var(--sp-radius-full);
1628
+ border: 1px solid var(--sp-border);
1629
+ background: var(--sp-bg-hover);
1630
+ color: var(--sp-text-tertiary);
1631
+ font-family: ui-monospace, "SF Mono", "Cascadia Code", "Segoe UI Mono", Menlo, monospace;
1632
+ font-size: 12px;
1633
+ font-weight: 700;
1634
+ line-height: 1;
1635
+ cursor: pointer;
1636
+ display: flex;
1637
+ align-items: center;
1638
+ justify-content: center;
1639
+ transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
1640
+ position: absolute;
1641
+ bottom: 12px;
1642
+ right: 12px;
1643
+ }
1644
+
1645
+ .sp-shortcuts-hint:hover {
1646
+ background: var(--sp-accent-light);
1647
+ color: var(--sp-accent);
1648
+ border-color: var(--sp-accent);
1649
+ }
1650
+
1651
+ .sp-shortcuts-hint::after {
1652
+ content: attr(aria-label);
1653
+ position: absolute;
1654
+ bottom: calc(100% + 6px);
1655
+ right: 0;
1656
+ padding: 4px 8px;
1657
+ border-radius: 6px;
1658
+ background: var(--sp-glass-bg-heavy);
1659
+ border: 1px solid var(--sp-glass-border);
1660
+ box-shadow: var(--sp-shadow-sm);
1661
+ font-family: var(--sp-font);
1662
+ font-size: 11px;
1663
+ font-weight: 500;
1664
+ color: var(--sp-text-secondary);
1665
+ white-space: nowrap;
1666
+ opacity: 0;
1667
+ pointer-events: none;
1668
+ transform: translateY(4px);
1669
+ transition: opacity 0.15s ease, transform 0.15s ease;
1670
+ }
1671
+
1672
+ .sp-shortcuts-hint:hover::after {
1673
+ opacity: 1;
1674
+ transform: translateY(0);
1675
+ }
1676
+
1677
+ /* ---- Card focus highlight (navigation) ---- */
1678
+
1679
+ .sp-card--focused {
1680
+ outline: 2px solid var(--sp-accent);
1681
+ outline-offset: -2px;
1682
+ border-radius: inherit;
1683
+ }
1684
+
1685
+ /* ---- Reduced motion ---- */
1686
+
1687
+ @media (prefers-reduced-motion: reduce) {
1688
+ .sp-shortcuts-overlay,
1689
+ .sp-shortcuts-card,
1690
+ .sp-shortcuts-close,
1691
+ .sp-shortcuts-hint,
1692
+ .sp-shortcuts-hint::after {
1693
+ transition-duration: 0.01ms !important;
1694
+ }
1695
+ }
1696
+ `,on='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>',me=class{constructor(e,t,s=$e){this.i18n=s;this.keyMap=new Map([["j",()=>t.onNavigate("down")],["k",()=>t.onNavigate("up")],["r",()=>t.onResolve()],["d",()=>t.onDelete()],["f",()=>t.onFocusSearch()],["/",()=>t.onFocusSearch()],["x",()=>t.onToggleSelect()],["?",()=>this.toggleHelp()]]),this.helpOverlay=this.buildOverlay(),this.hintButton=this.buildHintButton(),this.boundHandler=o=>this.handleKeydown(o)}i18n;helpOverlay;hintButton;keyMap;boundHandler;shadowRoot=null;enabled=!1;helpVisible=!1;destroyed=!1;enable(e){if(this.destroyed||this.enabled)return;e&&(this.shadowRoot=e),(this.shadowRoot??document).addEventListener("keydown",this.boundHandler),this.enabled=!0}disable(){if(!this.enabled)return;(this.shadowRoot??document).removeEventListener("keydown",this.boundHandler),this.enabled=!1,this.helpVisible&&this.hideHelp()}toggleHelp(){this.helpVisible?this.hideHelp():this.showHelp()}destroy(){this.destroyed||(this.disable(),this.helpOverlay.remove(),this.hintButton.remove(),this.destroyed=!0)}handleKeydown(e){if(e.key==="Escape"){this.helpVisible&&(e.preventDefault(),e.stopPropagation(),this.hideHelp());return}if(this.helpVisible)return;let t=e.composedPath()[0];if(t){let o=t.tagName?.toLowerCase();if(o==="input"||o==="textarea"||o==="select"||t.isContentEditable)return}if(e.ctrlKey||e.altKey||e.metaKey)return;let s=this.keyMap.get(e.key);s&&(e.preventDefault(),e.stopPropagation(),s())}showHelp(){this.helpVisible=!0,this.helpOverlay.classList.add("sp-shortcuts-overlay--visible"),this.helpOverlay.querySelector(".sp-shortcuts-close")?.focus()}hideHelp(){this.helpVisible=!1,this.helpOverlay.classList.remove("sp-shortcuts-overlay--visible")}buildOverlay(){let e=l("div",{class:"sp-shortcuts-overlay"});e.setAttribute("role","dialog"),e.setAttribute("aria-modal","true"),e.setAttribute("aria-label",this.i18n["shortcuts.title"]),e.addEventListener("click",a=>{a.target===e&&this.hideHelp()});let t=l("div",{class:"sp-shortcuts-card"}),s=l("div",{class:"sp-shortcuts-title"});s.appendChild(v(sn));let o=l("span");c(o,this.i18n["shortcuts.title"]),s.appendChild(o),t.appendChild(s);let i=document.createElement("button");i.className="sp-shortcuts-close",i.setAttribute("aria-label",this.i18n["shortcuts.close"]),i.appendChild(v(on)),i.addEventListener("click",()=>this.hideHelp()),t.appendChild(i);let r=l("div",{class:"sp-shortcuts-grid"});for(let a of nn){let p=l("div",{class:"sp-shortcuts-row"}),d=l("div",{class:"sp-shortcuts-keys"});a.keys.forEach((h,b)=>{if(b>0){let k=l("span",{class:"sp-shortcuts-separator"});c(k,"/"),d.appendChild(k)}let f=l("span",{class:"sp-kbd"});c(f,h),d.appendChild(f)});let u=l("span",{class:"sp-shortcuts-desc"});c(u,this.i18n[a.label]),p.appendChild(d),p.appendChild(u),r.appendChild(p)}return t.appendChild(r),e.appendChild(t),e}buildHintButton(){let e=document.createElement("button");return e.className="sp-shortcuts-hint",e.setAttribute("aria-label",this.i18n["shortcuts.hint"]),c(e,"?"),e.addEventListener("click",t=>{t.stopPropagation(),this.toggleHelp()}),e}};var fe=class{constructor(e,t,s,o,i,r,a,p){this.colors=t;this.bus=s;this.client=o;this.projectName=i;this.markers=r;this.t=a;this.locale=p;this.shadowRoot=e,this.bulkI18n=p==="fr"?De:Ne,this.root=l("div",{class:"sp-panel"}),this.root.setAttribute("role","complementary"),this.root.setAttribute("aria-label",this.t("panel.ariaLabel")),this.root.setAttribute("aria-hidden","true");let d=l("div",{class:"sp-panel-header"}),u=l("span",{class:"sp-panel-title"});c(u,this.t("panel.title")),this.closeBtn=document.createElement("button"),this.closeBtn.className="sp-panel-close",this.closeBtn.setAttribute("aria-label",this.t("panel.close")),this.closeBtn.appendChild(v(G)),this.closeBtn.addEventListener("click",()=>this.close()),this.deleteAllBtn=document.createElement("button"),this.deleteAllBtn.className="sp-btn-delete-all",this.deleteAllBtn.setAttribute("aria-label",this.t("panel.deleteAll")),this.deleteAllBtn.appendChild(v(Me));let h=document.createElement("span");c(h,` ${this.t("panel.deleteAll")}`),this.deleteAllBtn.appendChild(h),this.deleteAllBtn.addEventListener("click",()=>this.confirmDeleteAll()),this.exportBtn=new de(t,()=>this.feedbacks),p==="fr"&&this.exportBtn.setLabels(Nt);let b=l("div",{class:"sp-panel-header-right"});b.appendChild(this.exportBtn.element),b.appendChild(this.deleteAllBtn),b.appendChild(this.closeBtn),d.appendChild(u),d.appendChild(b),this.stats=new ge(t,p);let f=l("div",{class:"sp-filters"}),k=l("div",{class:"sp-search-wrap"}),w=v(lt);w.setAttribute("class","sp-search-icon"),this.searchInput=document.createElement("input"),this.searchInput.type="text",this.searchInput.className="sp-search",this.searchInput.placeholder=this.t("panel.search"),this.searchInput.setAttribute("aria-label",this.t("panel.searchAria")),this.searchInput.addEventListener("input",()=>{this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(()=>this.loadFeedbacks().catch(()=>{}),200)}),k.appendChild(w),k.appendChild(this.searchInput);let E=l("div",{class:"sp-filter-bar"});E.appendChild(this.buildTypeDropdown()),E.appendChild(this.buildStatusSegmented()),this.sortControls=new be(t,()=>this.renderList(),p),f.appendChild(k),f.appendChild(E),f.appendChild(this.sortControls.element),this.listContainer=l("div",{class:"sp-list"}),this.listContainer.setAttribute("role","list"),this.listContainer.setAttribute("aria-label",this.t("panel.feedbackList")),this.bulk=new ue(t,{onResolve:g=>this.bulkResolve(g),onDelete:g=>this.bulkDelete(g)},p),this.bulk.setListContainer(this.listContainer),this.detail=new he(t,{onBack:()=>this.detail.hide(),onResolve:async g=>{let x=g.status!=="resolved";await this.client.resolveFeedback(g.id,x),await this.loadFeedbacks(),this.detail.hide()},onDelete:async g=>{await this.client.deleteFeedback(g.id),this.bus.emit("feedback:deleted",g.id),await this.loadFeedbacks(),this.detail.hide()},onGoToAnnotation:g=>{if(g.annotations.length>0){let x=g.annotations[0];if(!x)return;window.scrollTo({left:x.scrollX,top:x.scrollY,behavior:"smooth"}),this.markers.pinHighlight(g)}}},p);let C=p==="fr"?Qt:$e;this.shortcuts=new me(t,{onNavigate:g=>{let x=je(this.listContainer);Jt(this.listContainer,g==="down"?x+1:x-1)},onResolve:()=>{let g=this.getFocusedFeedback();if(g&&!this.pendingMutations.has(g.id)){let y=this.listContainer.querySelector(`[data-feedback-id="${CSS.escape(g.id)}"]`)?.querySelector('[data-action="resolve"]');y&&this.toggleResolve(g,y).catch(()=>{})}},onDelete:()=>{let g=this.getFocusedFeedback();if(g&&!this.pendingMutations.has(g.id)){let y=this.listContainer.querySelector(`[data-feedback-id="${CSS.escape(g.id)}"]`)?.querySelector('[data-action="delete"]');y&&this.deleteFeedback(g,y).catch(()=>{})}},onFocusSearch:()=>this.searchInput.focus(),onToggleSelect:()=>{let g=this.getFocusedFeedback();g&&this.bulk.toggle(g.id)}},C),this.root.appendChild(d),this.root.appendChild(this.stats.element),this.root.appendChild(f),this.root.appendChild(this.listContainer),this.root.appendChild(this.bulk.barElement),this.root.appendChild(this.detail.element),this.root.appendChild(this.shortcuts.helpOverlay),this.root.appendChild(this.shortcuts.hintButton),e.appendChild(this.root),this.onListClick=g=>{let x=g.target;if(x.closest(".sp-bulk-checkbox"))return;let y=x.closest("[data-action]");if(y){g.stopPropagation();let T=y.closest(".sp-card");if(!T)return;let A=T.dataset.feedbackId,S=this.feedbacks.find(B=>B.id===A);if(!S)return;let L=y.dataset.action;if(L==="expand"){let B=T.querySelector(".sp-card-message");if(!B)return;let K=B.classList.toggle("sp-card-message--expanded");c(y,K?this.t("panel.showLess"):this.t("panel.showMore")),y.setAttribute("aria-expanded",String(K))}else if(L==="resolve"){if(this.pendingMutations.has(S.id))return;let B=y;this.toggleResolve(S,B).catch(()=>{})}else if(L==="delete"){if(this.pendingMutations.has(S.id))return;let B=y;this.deleteFeedback(S,B).catch(()=>{})}return}let m=x.closest(".sp-card");if(m){let T=m.dataset.feedbackId,A=this.feedbacks.find(S=>S.id===T);if(A){let S=this.feedbacks.indexOf(A)+1;this.detail.show(A,S)}}},this.listContainer.addEventListener("click",this.onListClick),this.onListKeydown=g=>{let x=g;if(x.key!=="Enter"&&x.key!==" ")return;let y=x.target,m=y.closest(".sp-card");if(!m||y!==m)return;x.preventDefault();let T=m.dataset.feedbackId,A=this.feedbacks.find(S=>S.id===T);if(A){let S=this.feedbacks.indexOf(A)+1;this.detail.show(A,S)}},this.listContainer.addEventListener("keydown",this.onListKeydown),this.onListMouseover=g=>{let y=g.target.closest(".sp-card");if(!y)return;let m=y.dataset.feedbackId;m&&this.markers.highlight(m)},this.listContainer.addEventListener("mouseover",this.onListMouseover),this.onListMouseout=g=>{let x=g.relatedTarget;x&&this.listContainer.contains(x)||this.markers.highlight("")},this.listContainer.addEventListener("mouseout",this.onListMouseout),this.bus.on("panel:toggle",g=>{g?this.open():this.close()}),e.addEventListener("keydown",g=>{let x=g;if(x.key==="Escape"&&this.isOpen){if(this.detail.isVisible){this.detail.hide();return}this.close();return}if(x.key==="Tab"&&this.isOpen){let y=this.root.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(y.length===0)return;let m=y[0],T=y[y.length-1];if(!m||!T)return;let A=e.activeElement;x.shiftKey&&A===m?(x.preventDefault(),T.focus()):!x.shiftKey&&A===T&&(x.preventDefault(),m.focus())}}),this.onMarkerClick=(g=>{this.scrollToFeedback(g.detail.feedbackId)}),document.addEventListener("sp-marker-click",this.onMarkerClick)}colors;bus;client;projectName;markers;t;locale;root;listContainer;searchInput;closeBtn;deleteAllBtn;activeFilters=new Set(["all"]);activeStatusFilter="all";typeDropdownBtn;typeDropdownContainer;typeDropdownMenu=null;typeDropdownOutsideHandler=null;statusSegmented;typeOptions;statusOptions;feedbacks=[];currentPage=1;totalFeedbacks=0;isLoadingMore=!1;isOpen=!1;searchTimeout=null;loadController=null;pendingMutations=new Set;stats;sortControls;bulk;exportBtn;shortcuts;detail;shadowRoot;bulkI18n;onMarkerClick;onListClick;onListKeydown;onListMouseover;onListMouseout;async open(){this.isOpen||(this.isOpen=!0,this.root.classList.add("sp-panel--open"),this.root.setAttribute("aria-hidden","false"),this.bus.emit("open"),this.shortcuts.enable(this.shadowRoot),await this.loadFeedbacks(),requestAnimationFrame(()=>{this.searchInput?this.searchInput.focus():this.closeBtn.focus()}))}close(){if(!this.isOpen)return;this.isOpen=!1,this.root.classList.remove("sp-panel--open"),this.root.setAttribute("aria-hidden","true"),this.bus.emit("close"),this.shortcuts.disable(),this.detail.hide(),this.root.getRootNode().querySelector(".sp-fab")?.focus()}showLoading(){this.listContainer.replaceChildren();let e=l("div",{class:"sp-loading"});e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),e.setAttribute("aria-label",this.t("panel.loading"));let t=l("div",{class:"sp-spinner"});e.appendChild(t),this.listContainer.appendChild(e)}showError(){this.listContainer.replaceChildren();let e=l("div",{class:"sp-empty"});e.setAttribute("role","status"),e.setAttribute("aria-live","polite");let t=l("div",{class:"sp-empty-text"});c(t,this.t("panel.loadError"));let s=document.createElement("button");s.className="sp-btn-ghost",s.style.marginTop="8px",c(s,this.t("panel.retry")),s.addEventListener("click",()=>this.loadFeedbacks().catch(()=>{})),e.appendChild(t),e.appendChild(s),this.listContainer.appendChild(e)}async loadFeedbacks(){this.loadController?.abort(),this.loadController=new AbortController;let{signal:e}=this.loadController;this.currentPage=1;let t=this.searchInput.value.trim()||void 0,s=this.activeFilters.has("all")?void 0:Array.from(this.activeFilters)[0],o=this.activeStatusFilter==="all"?void 0:this.activeStatusFilter,i={page:1,limit:20};s&&(i.type=s),o&&(i.status=o),t&&(i.search=t);let r=this.feedbacks.length>0;r||this.showLoading();try{let{feedbacks:a,total:p}=await this.client.getFeedbacks(this.projectName,i);if(e.aborted)return;this.feedbacks=a,this.totalFeedbacks=p,this.stats.update(a,p),this.bulk.reset(),this.renderList(),this.markers.render(a)}catch(a){if(e.aborted)return;r||this.showError(),this.bus.emit("feedback:error",a instanceof Error?a:new Error(String(a)))}}async loadMoreFeedbacks(){if(this.isLoadingMore)return;this.isLoadingMore=!0;let e=this.loadController,t=this.currentPage+1,s=this.searchInput.value.trim()||void 0,o=this.activeFilters.has("all")?void 0:Array.from(this.activeFilters)[0],i=this.activeStatusFilter==="all"?void 0:this.activeStatusFilter,r={page:t,limit:20};o&&(r.type=o),i&&(r.status=i),s&&(r.search=s);let a=this.listContainer.querySelector(".sp-btn-load-more"),p;a&&(p=this.setButtonLoading(a));try{let{feedbacks:d,total:u}=await this.client.getFeedbacks(this.projectName,r);if(e!==this.loadController)return;this.currentPage=t,this.totalFeedbacks=u,this.feedbacks=[...this.feedbacks,...d],this.stats.update(this.feedbacks,u),this.renderList(),this.markers.render(this.feedbacks)}catch(d){p&&p(),this.bus.emit("feedback:error",d instanceof Error?d:new Error(String(d)))}finally{this.isLoadingMore=!1}}renderList(){if(this.listContainer.replaceChildren(),this.feedbacks.length===0){let i=l("div",{class:"sp-empty"});i.setAttribute("role","status"),i.setAttribute("aria-live","polite");let r=l("div",{class:"sp-empty-text"});c(r,this.t("panel.empty")),i.appendChild(r),this.listContainer.appendChild(i);return}let e=Ut(this.feedbacks,this.sortControls.sortMode),t=e.map(i=>i.id),s=this.bulk.createSelectAllBar(t,this.bulkI18n["bulk.selectAll"]);if(this.listContainer.appendChild(s),this.sortControls.groupByPage){let i=Wt(e),r=0;for(let[a,p]of i){let d=Xt(a,p.length,this.colors);this.listContainer.appendChild(d);let u=l("div",{class:"sp-group-content"});for(let h of p){let b=this.createCard(h,r+1);b.style.setProperty("--sp-card-i",String(r)),u.appendChild(b),r++}this.listContainer.appendChild(u)}}else e.forEach((i,r)=>{let a=this.createCard(i,r+1);a.style.setProperty("--sp-card-i",String(r)),this.listContainer.appendChild(a)});let o=this.totalFeedbacks-this.feedbacks.length;if(o>0){let i=l("div",{class:"sp-load-more-wrap"}),r=document.createElement("button");r.className="sp-btn-ghost sp-btn-load-more",c(r,this.t("panel.loadMore").replace("{remaining}",String(o))),r.addEventListener("click",()=>this.loadMoreFeedbacks().catch(()=>{})),i.appendChild(r),this.listContainer.appendChild(i)}}createCard(e,t){let s=e.status==="resolved",o=M(e.type,this.colors),i=l("div",{class:`sp-card ${s?"sp-card--resolved":""}`});i.setAttribute("role","listitem"),i.setAttribute("tabindex","0"),i.setAttribute("aria-label",`Feedback #${t}: ${N(e.type,this.t)} \u2014 ${e.message.slice(0,80)}`),i.dataset.feedbackId=e.id;let r=l("div",{class:"sp-card-bar"});r.style.background=s?"#9ca3af":o;let a=l("div",{class:"sp-card-body"}),p=l("div",{class:"sp-card-header"}),d=this.bulk.createCheckbox(e.id);p.appendChild(d);let u=l("span",{class:"sp-card-number"});c(u,`#${t}`);let h=l("span",{class:"sp-badge"}),b=P(e.type,this.colors);h.style.background=b,h.style.color=o,c(h,N(e.type,this.t));let f=l("span",{class:"sp-card-date"});c(f,V(e.createdAt,this.locale)),p.appendChild(u),p.appendChild(h),p.appendChild(f);let k=l("div",{class:"sp-card-message"});c(k,e.message);let w=document.createElement("button");w.className="sp-card-expand",w.dataset.action="expand",c(w,this.t("panel.showMore")),w.style.display="none",w.setAttribute("aria-expanded","false"),requestAnimationFrame(()=>{k.scrollHeight>k.clientHeight&&(w.style.display="block")});let E=l("div",{class:"sp-card-footer"}),C=document.createElement("button");if(C.className="sp-btn-resolve",C.dataset.action="resolve",s){C.appendChild(v(ct));let y=document.createElement("span");c(y,` ${this.t("panel.reopen")}`),C.appendChild(y)}else{C.appendChild(v(Q));let y=document.createElement("span");c(y,` ${this.t("panel.resolve")}`),C.appendChild(y)}let g=document.createElement("button");g.className="sp-btn-delete",g.dataset.action="delete",g.appendChild(v(Me));let x=document.createElement("span");return c(x,` ${this.t("panel.delete")}`),g.appendChild(x),E.appendChild(C),E.appendChild(g),a.appendChild(p),a.appendChild(k),a.appendChild(w),a.appendChild(E),i.appendChild(r),i.appendChild(a),i}async bulkResolve(e){try{await Promise.all(e.map(t=>this.client.resolveFeedback(t,!0))),await this.loadFeedbacks()}catch(t){throw this.bus.emit("feedback:error",t instanceof Error?t:new Error(String(t))),t}}async bulkDelete(e){try{await Promise.all(e.map(t=>this.client.deleteFeedback(t)));for(let t of e)this.bus.emit("feedback:deleted",t);await this.loadFeedbacks()}catch(t){throw this.bus.emit("feedback:error",t instanceof Error?t:new Error(String(t))),t}}async confirmDeleteAll(){if(await this.showConfirmDialog(this.t("panel.deleteAllConfirmTitle"),this.t("panel.deleteAllConfirmMessage"))){this.deleteAllBtn.disabled=!0;try{await this.client.deleteAllFeedbacks(this.projectName),this.bus.emit("feedback:all-deleted"),await this.loadFeedbacks()}catch(t){this.bus.emit("feedback:error",t instanceof Error?t:new Error(String(t)))}finally{this.deleteAllBtn.disabled=!1}}}showConfirmDialog(e,t){return new Promise(s=>{let o=l("div",{class:"sp-confirm-backdrop"}),i=`sp-confirm-title-${Date.now()}`,r=`sp-confirm-msg-${Date.now()}`,a=l("div",{class:"sp-confirm-dialog"});a.setAttribute("role","alertdialog"),a.setAttribute("aria-modal","true"),a.setAttribute("aria-labelledby",i),a.setAttribute("aria-describedby",r);let p=l("div",{class:"sp-confirm-title"});p.id=i,c(p,e);let d=l("div",{class:"sp-confirm-message"});d.id=r,c(d,t);let u=l("div",{class:"sp-confirm-actions"}),h=document.createElement("button");h.type="button",h.className="sp-btn-ghost",c(h,this.t("panel.cancel"));let b=document.createElement("button");b.type="button",b.className="sp-btn-danger",c(b,this.t("panel.confirmDelete"));let f=!1,k=E=>{f||(f=!0,o.removeEventListener("keydown",w),o.style.opacity="0",a.style.transform="translateY(8px) scale(0.97)",setTimeout(()=>{o.remove(),s(E)},200))},w=E=>{let C=E;if(C.key==="Escape"){k(!1);return}C.key==="Tab"&&(C.preventDefault(),o.getRootNode().activeElement===h?b.focus():h.focus())};o.addEventListener("keydown",w),h.addEventListener("click",()=>k(!1)),b.addEventListener("click",()=>k(!0)),o.addEventListener("click",E=>{E.target===o&&k(!1)}),u.appendChild(h),u.appendChild(b),a.appendChild(p),a.appendChild(d),a.appendChild(u),o.appendChild(a),this.root.getRootNode()instanceof ShadowRoot?this.root.getRootNode().appendChild(o):this.root.appendChild(o),requestAnimationFrame(()=>{o.style.opacity="1",a.style.transform="translateY(0) scale(1)",h.focus()})})}setButtonLoading(e){let t=Array.from(e.childNodes).map(s=>s.cloneNode(!0));return e.disabled=!0,e.replaceChildren(l("div",{class:"sp-spinner sp-spinner--sm"})),()=>{e.replaceChildren(...t),e.disabled=!1}}async deleteFeedback(e,t){this.pendingMutations.add(e.id);let s=this.setButtonLoading(t);try{await this.client.deleteFeedback(e.id),this.bus.emit("feedback:deleted",e.id),await this.loadFeedbacks()}catch(o){s(),this.bus.emit("feedback:error",o instanceof Error?o:new Error(String(o)))}finally{this.pendingMutations.delete(e.id)}}async toggleResolve(e,t){this.pendingMutations.add(e.id);let s=this.setButtonLoading(t);try{let o=e.status!=="resolved";await this.client.resolveFeedback(e.id,o),await this.loadFeedbacks()}catch(o){s(),this.bus.emit("feedback:error",o instanceof Error?o:new Error(String(o)))}finally{this.pendingMutations.delete(e.id)}}buildTypeDropdown(){return this.typeOptions=[{value:"all",label:this.t("panel.filterAll"),icon:Le,color:this.colors.accent,bg:this.colors.accentLight},{value:"question",label:this.t("type.question"),icon:J,color:this.colors.typeQuestion,bg:this.colors.typeQuestionBg},{value:"change",label:this.t("type.change"),icon:Z,color:this.colors.typeChange,bg:this.colors.typeChangeBg},{value:"bug",label:this.t("type.bug"),icon:ee,color:this.colors.typeBug,bg:this.colors.typeBugBg},{value:"other",label:this.t("type.other"),icon:te,color:this.colors.typeOther,bg:this.colors.typeOtherBg}],this.typeDropdownContainer=l("div",{class:"sp-filter-dropdown"}),this.typeDropdownBtn=document.createElement("button"),this.typeDropdownBtn.type="button",this.typeDropdownBtn.className="sp-filter-dropdown-btn",this.typeDropdownBtn.setAttribute("aria-haspopup","listbox"),this.typeDropdownBtn.setAttribute("aria-expanded","false"),this.renderTypeDropdownTrigger(),this.typeDropdownBtn.addEventListener("click",e=>{e.stopPropagation(),this.typeDropdownMenu?this.closeTypeDropdown():this.openTypeDropdown()}),this.typeDropdownContainer.appendChild(this.typeDropdownBtn),this.typeDropdownContainer}renderTypeDropdownTrigger(){let e=this.typeOptions.find(a=>this.activeFilters.has(a.value))??this.typeOptions[0];if(!e)return;this.typeDropdownBtn.replaceChildren(),this.typeDropdownBtn.style.setProperty("--sp-chip-color",e.color),this.typeDropdownBtn.style.setProperty("--sp-chip-bg",e.bg),this.typeDropdownBtn.dataset.filter=e.value,this.typeDropdownBtn.classList.toggle("sp-filter-dropdown-btn--filtered",e.value!=="all"),this.typeDropdownBtn.setAttribute("aria-label",`${this.t("type.label")}: ${e.label}`);let t=l("span",{class:"sp-filter-dropdown-btn__icon"});t.appendChild(v(e.icon)),this.typeDropdownBtn.appendChild(t);let s=l("span",{class:"sp-filter-dropdown-btn__label"}),o=l("span",{class:"sp-filter-dropdown-btn__prefix"});c(o,this.t("type.label"));let i=l("span",{class:"sp-filter-dropdown-btn__value"});c(i,e.label),s.appendChild(o),s.appendChild(i),this.typeDropdownBtn.appendChild(s);let r=l("span",{class:"sp-filter-dropdown-btn__chevron"});r.appendChild(v(dt)),this.typeDropdownBtn.appendChild(r)}openTypeDropdown(){this.typeDropdownMenu=l("div",{class:"sp-filter-dropdown-menu"}),this.typeDropdownMenu.setAttribute("role","listbox"),this.typeDropdownMenu.setAttribute("aria-label",this.t("type.label")),this.typeDropdownBtn.setAttribute("aria-expanded","true");for(let e of this.typeOptions){let t=document.createElement("button");t.type="button";let s=this.activeFilters.has(e.value);t.className=`sp-filter-dropdown-option${s?" sp-filter-dropdown-option--active":""}`,t.style.setProperty("--sp-chip-color",e.color),t.style.setProperty("--sp-chip-bg",e.bg),t.dataset.filter=e.value,t.setAttribute("role","option"),t.setAttribute("aria-selected",String(s));let o=l("span",{class:"sp-filter-dropdown-option__icon"});o.appendChild(v(e.icon)),t.appendChild(o);let i=l("span",{class:"sp-filter-dropdown-option__label"});if(c(i,e.label),t.appendChild(i),s){let r=l("span",{class:"sp-filter-dropdown-option__check"});r.appendChild(v(Q)),t.appendChild(r)}t.addEventListener("click",r=>{r.stopPropagation(),this.selectTypeFilter(e.value)}),this.typeDropdownMenu.appendChild(t)}this.typeDropdownContainer.appendChild(this.typeDropdownMenu),requestAnimationFrame(()=>{this.typeDropdownOutsideHandler=e=>{this.typeDropdownMenu&&!this.typeDropdownContainer.contains(e.target)&&this.closeTypeDropdown()},document.addEventListener("click",this.typeDropdownOutsideHandler,!0)}),this.typeDropdownMenu.addEventListener("keydown",e=>{e.key==="Escape"&&(this.closeTypeDropdown(),this.typeDropdownBtn.focus())})}closeTypeDropdown(){this.typeDropdownMenu&&(this.typeDropdownMenu.remove(),this.typeDropdownMenu=null),this.typeDropdownBtn.setAttribute("aria-expanded","false"),this.typeDropdownOutsideHandler&&(document.removeEventListener("click",this.typeDropdownOutsideHandler,!0),this.typeDropdownOutsideHandler=null)}selectTypeFilter(e){this.activeFilters.clear(),this.activeFilters.add(e),this.renderTypeDropdownTrigger(),this.closeTypeDropdown(),this.loadFeedbacks().catch(()=>{})}buildStatusSegmented(){this.statusOptions=[{value:"all",label:this.t("panel.statusAll"),icon:Le,color:this.colors.accent,bg:this.colors.accentLight},{value:"open",label:this.t("panel.statusOpen"),icon:pt,color:this.colors.statusOpen,bg:this.colors.statusOpenBg},{value:"resolved",label:this.t("panel.statusResolved"),icon:Q,color:this.colors.statusResolved,bg:this.colors.statusResolvedBg}],this.statusSegmented=l("div",{class:"sp-segmented",role:"radiogroup"}),this.statusSegmented.setAttribute("aria-label",this.t("status.label"));for(let e of this.statusOptions){let t=document.createElement("button");t.type="button",t.className=`sp-segmented__btn sp-segmented__btn--${e.value}`,t.dataset.statusFilter=e.value,t.setAttribute("role","radio");let s=this.activeStatusFilter===e.value;t.setAttribute("aria-checked",String(s)),t.tabIndex=s?0:-1,s&&t.classList.add("sp-segmented__btn--active"),t.style.setProperty("--sp-chip-color",e.color),t.style.setProperty("--sp-chip-bg",e.bg);let o=l("span",{class:"sp-segmented__icon"});o.appendChild(v(e.icon)),t.appendChild(o);let i=l("span",{class:"sp-segmented__label"});c(i,e.label),t.appendChild(i),t.addEventListener("click",()=>this.selectStatusFilter(e.value)),t.addEventListener("keydown",r=>this.handleSegmentedKey(r,e.value)),this.statusSegmented.appendChild(t)}return this.statusSegmented}handleSegmentedKey(e,t){let s=this.statusOptions.map(p=>p.value),o=s.indexOf(t),i;switch(e.key){case"ArrowLeft":i=(o-1+s.length)%s.length;break;case"ArrowRight":i=(o+1)%s.length;break;case"Home":i=0;break;case"End":i=s.length-1;break;default:return}e.preventDefault();let r=s[i];if(!r)return;this.selectStatusFilter(r),this.statusSegmented.querySelector(`[data-status-filter="${r}"]`)?.focus()}selectStatusFilter(e){this.activeStatusFilter=e;let t=this.statusSegmented.querySelectorAll(".sp-segmented__btn");for(let s of t){let o=s.dataset.statusFilter===e;s.classList.toggle("sp-segmented__btn--active",o),s.setAttribute("aria-checked",String(o)),s.tabIndex=o?0:-1}this.loadFeedbacks().catch(()=>{})}getFocusedFeedback(){let e=je(this.listContainer);if(e<0)return;let t=this.listContainer.querySelectorAll(".sp-card")[e];if(t)return this.feedbacks.find(s=>s.id===t.dataset.feedbackId)}scrollToFeedback(e){let t=CSS.escape(e),s=this.listContainer.querySelector(`[data-feedback-id="${t}"]`);s&&(s.scrollIntoView({behavior:"smooth",block:"center"}),s.classList.add("sp-anim-flash"),s.addEventListener("animationend",()=>{s.classList.remove("sp-anim-flash")},{once:!0}))}async refresh(){this.isOpen&&await this.loadFeedbacks()}destroy(){this.loadController?.abort(),this.searchTimeout&&clearTimeout(this.searchTimeout),this.listContainer.removeEventListener("click",this.onListClick),this.listContainer.removeEventListener("keydown",this.onListKeydown),this.listContainer.removeEventListener("mouseover",this.onListMouseover),this.listContainer.removeEventListener("mouseout",this.onListMouseout),document.removeEventListener("sp-marker-click",this.onMarkerClick),this.closeTypeDropdown(),this.sortControls.destroy(),this.bulk.destroy(),this.exportBtn.destroy(),this.shortcuts.destroy(),this.detail.destroy(),this.root.remove()}};function ze(n){return{cssSelector:n.anchor.cssSelector,xpath:n.anchor.xpath,textSnippet:n.anchor.textSnippet,elementTag:n.anchor.elementTag,elementId:n.anchor.elementId,textPrefix:n.anchor.textPrefix,textSuffix:n.anchor.textSuffix,fingerprint:n.anchor.fingerprint,neighborText:n.anchor.neighborText,xPct:n.rect.xPct,yPct:n.rect.yPct,wPct:n.rect.wPct,hPct:n.rect.hPct,scrollX:n.scrollX,scrollY:n.scrollY,viewportW:n.viewportW,viewportH:n.viewportH,devicePixelRatio:n.devicePixelRatio}}var ve=class{constructor(e,t){this.store=e;this.projectName=t}store;projectName;async sendFeedback(e){let t=await this.store.createFeedback({projectName:e.projectName,type:e.type,message:e.message,status:"open",url:e.url,viewport:e.viewport,userAgent:e.userAgent,authorName:e.authorName,authorEmail:e.authorEmail,clientId:e.clientId,annotations:e.annotations.map(ze)});return Ke(t)}async getFeedbacks(e,t){let{feedbacks:s,total:o}=await this.store.getFeedbacks({projectName:e,page:t?.page,limit:t?.limit,type:t?.type,status:t?.status,search:t?.search});return{feedbacks:s.map(Ke),total:o}}async resolveFeedback(e,t){let s=await this.store.updateFeedback(e,{status:t?"resolved":"open",resolvedAt:t?new Date:null});return Ke(s)}async deleteFeedback(e){await this.store.deleteFeedback(e)}async deleteAllFeedbacks(e){await this.store.deleteAllFeedbacks(e)}};function Ke(n){return{id:n.id,projectName:n.projectName,type:n.type,message:n.message,status:n.status,url:n.url,viewport:n.viewport,userAgent:n.userAgent,authorName:n.authorName,authorEmail:n.authorEmail,resolvedAt:n.resolvedAt?.toISOString()??null,createdAt:n.createdAt.toISOString(),updatedAt:n.updatedAt.toISOString(),annotations:n.annotations.map(rn)}}function rn(n){return{id:n.id,feedbackId:n.feedbackId,cssSelector:n.cssSelector,xpath:n.xpath,textSnippet:n.textSnippet,elementTag:n.elementTag,elementId:n.elementId,textPrefix:n.textPrefix,textSuffix:n.textSuffix,fingerprint:n.fingerprint,neighborText:n.neighborText,xPct:n.xPct,yPct:n.yPct,wPct:n.wPct,hPct:n.hPct,scrollX:n.scrollX,scrollY:n.scrollY,viewportW:n.viewportW,viewportH:n.viewportH,devicePixelRatio:n.devicePixelRatio,createdAt:n.createdAt.toISOString()}}var an="linear(0, 0.006, 0.025, 0.06, 0.11, 0.17, 0.25, 0.34, 0.45, 0.56, 0.67, 0.78, 0.88, 0.95, 1.01, 1.04, 1.05, 1.04, 1.02, 1, 0.99, 1)",Ye="cubic-bezier(0.16, 1, 0.3, 1)",qe="cubic-bezier(0.34, 1.56, 0.64, 1)",ln="cubic-bezier(0.25, 1, 0.5, 1)",ts=`
172
1697
  /* ---- Keyframes ---- */
173
1698
 
174
1699
  @keyframes sp-fab-in {
@@ -242,11 +1767,11 @@ var M,ce,Fe;function Le(t,e){if(Fe=new Date,t.nodeType!==Node.ELEMENT_NODE)throw
242
1767
  /* ---- Animation classes ---- */
243
1768
 
244
1769
  .sp-anim-fab-in {
245
- animation: sp-fab-in 0.5s ${Ot} both;
1770
+ animation: sp-fab-in 0.5s ${an} both;
246
1771
  }
247
1772
 
248
1773
  .sp-anim-marker-in {
249
- animation: sp-marker-in 0.35s ${Ee} both;
1774
+ animation: sp-marker-in 0.35s ${qe} both;
250
1775
  }
251
1776
 
252
1777
  .sp-anim-pulse {
@@ -254,11 +1779,11 @@ var M,ce,Fe;function Le(t,e){if(Fe=new Date,t.nodeType!==Node.ELEMENT_NODE)throw
254
1779
  }
255
1780
 
256
1781
  .sp-anim-flash {
257
- animation: sp-flash-bg 0.5s ${jt};
1782
+ animation: sp-flash-bg 0.5s ${ln};
258
1783
  }
259
1784
 
260
1785
  .sp-anim-slide-up {
261
- animation: sp-slide-up 0.3s ${we} both;
1786
+ animation: sp-slide-up 0.3s ${Ye} both;
262
1787
  }
263
1788
 
264
1789
  .sp-anim-fade-in {
@@ -269,7 +1794,7 @@ var M,ce,Fe;function Le(t,e){if(Fe=new Date,t.nodeType!==Node.ELEMENT_NODE)throw
269
1794
 
270
1795
  .sp-panel {
271
1796
  transform: translateX(110%);
272
- transition: transform 0.4s ${we};
1797
+ transition: transform 0.4s ${Ye};
273
1798
  }
274
1799
 
275
1800
  .sp-panel.sp-panel--open {
@@ -281,7 +1806,7 @@ var M,ce,Fe;function Le(t,e){if(Fe=new Date,t.nodeType!==Node.ELEMENT_NODE)throw
281
1806
  pointer-events: none;
282
1807
  transform: translate(0, 0) scale(0.8);
283
1808
  transition:
284
- transform 0.35s ${Ee},
1809
+ transform 0.35s ${qe},
285
1810
  opacity 0.2s ease,
286
1811
  background 0.2s ease,
287
1812
  border-color 0.2s ease,
@@ -312,7 +1837,7 @@ var M,ce,Fe;function Le(t,e){if(Fe=new Date,t.nodeType!==Node.ELEMENT_NODE)throw
312
1837
  }
313
1838
 
314
1839
  .sp-card {
315
- animation: sp-card-in 0.35s ${we} both;
1840
+ animation: sp-card-in 0.35s ${Ye} both;
316
1841
  animation-delay: calc(var(--sp-card-i, 0) * 40ms);
317
1842
  }
318
1843
 
@@ -340,7 +1865,7 @@ var M,ce,Fe;function Le(t,e){if(Fe=new Date,t.nodeType!==Node.ELEMENT_NODE)throw
340
1865
  }
341
1866
 
342
1867
  .sp-fab-badge {
343
- animation: sp-badge-in 0.4s ${Ee} both;
1868
+ animation: sp-badge-in 0.4s ${qe} both;
344
1869
  }
345
1870
 
346
1871
  /* ---- Reduced motion ---- */
@@ -353,22 +1878,22 @@ var M,ce,Fe;function Le(t,e){if(Fe=new Date,t.nodeType!==Node.ELEMENT_NODE)throw
353
1878
  }
354
1879
  }
355
1880
 
356
- `;function Ce(t){return`
1881
+ `;function Ue(n){return`
357
1882
  :host {
358
1883
  all: initial;
359
1884
  position: fixed;
360
- z-index: 2147483647;
1885
+ z-index: ${2147483647};
361
1886
  font-family: var(--sp-font);
362
1887
  font-size: 14px;
363
1888
  line-height: 1.5;
364
1889
  color: var(--sp-text);
365
1890
  -webkit-font-smoothing: antialiased;
366
1891
  -moz-osx-font-smoothing: grayscale;
367
- ${Ve(t)}
1892
+ ${gt(n)}
368
1893
 
369
1894
  /* Identity modal \u2014 theme-aware backdrop + panel */
370
- --sp-identity-bg: ${t.glassBgHeavy};
371
- --sp-identity-overlay: ${t.bg==="#ffffff"?"rgba(15, 23, 42, 0.2)":"rgba(0, 0, 0, 0.4)"};
1895
+ --sp-identity-bg: ${n.glassBgHeavy};
1896
+ --sp-identity-overlay: ${n.bg==="#ffffff"?"rgba(15, 23, 42, 0.2)":"rgba(0, 0, 0, 0.4)"};
372
1897
  }
373
1898
 
374
1899
  *, *::before, *::after {
@@ -591,6 +2116,8 @@ var M,ce,Fe;function Le(t,e){if(Fe=new Date,t.nodeType!==Node.ELEMENT_NODE)throw
591
2116
  background: var(--sp-glass-bg-heavy);
592
2117
  backdrop-filter: blur(var(--sp-blur));
593
2118
  -webkit-backdrop-filter: blur(var(--sp-blur));
2119
+ position: relative;
2120
+ z-index: 2;
594
2121
  }
595
2122
 
596
2123
  .sp-panel-title {
@@ -684,44 +2211,314 @@ var M,ce,Fe;function Le(t,e){if(Fe=new Date,t.nodeType!==Node.ELEMENT_NODE)throw
684
2211
  color: var(--sp-accent);
685
2212
  }
686
2213
 
687
- .sp-chips {
2214
+ /* ============================
2215
+ Filter bar (type dropdown + status segmented)
2216
+ ============================ */
2217
+
2218
+ .sp-filter-bar {
688
2219
  display: flex;
689
- gap: 6px;
2220
+ align-items: center;
2221
+ gap: 8px;
2222
+ margin-bottom: 8px;
690
2223
  flex-wrap: wrap;
691
2224
  }
692
2225
 
693
- .sp-chip {
694
- padding: 5px 14px;
2226
+ /* ============================
2227
+ Type filter dropdown
2228
+ ============================ */
2229
+
2230
+ .sp-filter-dropdown {
2231
+ position: relative;
2232
+ flex: 1 1 auto;
2233
+ min-width: 0;
2234
+ }
2235
+
2236
+ .sp-filter-dropdown-btn {
2237
+ --sp-chip-color: var(--sp-text-secondary);
2238
+ --sp-chip-bg: var(--sp-glass-bg-heavy);
2239
+
2240
+ display: inline-flex;
2241
+ align-items: center;
2242
+ gap: 8px;
2243
+ width: 100%;
2244
+ height: 32px;
2245
+ padding: 0 8px 0 10px;
2246
+ border-radius: var(--sp-radius-full);
2247
+ border: 1px solid var(--sp-border);
2248
+ background: var(--sp-glass-bg-heavy);
2249
+ color: var(--sp-text);
2250
+ font-family: var(--sp-font);
2251
+ font-size: 12px;
2252
+ font-weight: 500;
2253
+ cursor: pointer;
2254
+ white-space: nowrap;
2255
+ transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
2256
+ }
2257
+
2258
+ .sp-filter-dropdown-btn:hover {
2259
+ border-color: var(--sp-chip-color);
2260
+ background: var(--sp-chip-bg);
2261
+ }
2262
+
2263
+ .sp-filter-dropdown-btn[aria-expanded="true"] {
2264
+ border-color: var(--sp-chip-color);
2265
+ background: var(--sp-chip-bg);
2266
+ box-shadow: 0 0 0 3px color-mix(in srgb, var(--sp-chip-color) 14%, transparent);
2267
+ }
2268
+
2269
+ .sp-filter-dropdown-btn--filtered {
2270
+ border-color: var(--sp-chip-color);
2271
+ background: var(--sp-chip-bg);
2272
+ }
2273
+
2274
+ .sp-filter-dropdown-btn__icon {
2275
+ display: inline-flex;
2276
+ align-items: center;
2277
+ justify-content: center;
2278
+ width: 18px;
2279
+ height: 18px;
2280
+ flex-shrink: 0;
2281
+ color: var(--sp-chip-color);
2282
+ }
2283
+
2284
+ .sp-filter-dropdown-btn__icon svg {
2285
+ width: 14px;
2286
+ height: 14px;
2287
+ }
2288
+
2289
+ .sp-filter-dropdown-btn__label {
2290
+ display: inline-flex;
2291
+ align-items: baseline;
2292
+ gap: 6px;
2293
+ flex: 1;
2294
+ min-width: 0;
2295
+ overflow: hidden;
2296
+ }
2297
+
2298
+ .sp-filter-dropdown-btn__prefix {
2299
+ color: var(--sp-text-tertiary);
2300
+ font-weight: 500;
2301
+ font-size: 11px;
2302
+ text-transform: uppercase;
2303
+ letter-spacing: 0.06em;
2304
+ }
2305
+
2306
+ .sp-filter-dropdown-btn__value {
2307
+ color: var(--sp-chip-color);
2308
+ font-weight: 600;
2309
+ overflow: hidden;
2310
+ text-overflow: ellipsis;
2311
+ }
2312
+
2313
+ .sp-filter-dropdown-btn__chevron {
2314
+ display: inline-flex;
2315
+ align-items: center;
2316
+ justify-content: center;
2317
+ width: 14px;
2318
+ height: 14px;
2319
+ flex-shrink: 0;
2320
+ color: var(--sp-text-tertiary);
2321
+ transition: transform 0.18s ease, color 0.18s ease;
2322
+ }
2323
+
2324
+ .sp-filter-dropdown-btn__chevron svg {
2325
+ width: 12px;
2326
+ height: 12px;
2327
+ }
2328
+
2329
+ .sp-filter-dropdown-btn[aria-expanded="true"] .sp-filter-dropdown-btn__chevron {
2330
+ transform: rotate(180deg);
2331
+ color: var(--sp-chip-color);
2332
+ }
2333
+
2334
+ .sp-filter-dropdown-menu {
2335
+ position: absolute;
2336
+ top: calc(100% + 6px);
2337
+ left: 0;
2338
+ right: 0;
2339
+ min-width: 180px;
2340
+ padding: 4px;
2341
+ border-radius: var(--sp-radius);
2342
+ background: var(--sp-glass-bg-heavy);
2343
+ backdrop-filter: blur(var(--sp-blur-heavy));
2344
+ -webkit-backdrop-filter: blur(var(--sp-blur-heavy));
2345
+ border: 1px solid var(--sp-glass-border);
2346
+ box-shadow: var(--sp-shadow-md);
2347
+ z-index: 10;
2348
+ animation: sp-filter-menu-in 0.15s ease-out both;
2349
+ }
2350
+
2351
+ @keyframes sp-filter-menu-in {
2352
+ from { opacity: 0; transform: translateY(-4px) scale(0.98); }
2353
+ to { opacity: 1; transform: translateY(0) scale(1); }
2354
+ }
2355
+
2356
+ .sp-filter-dropdown-option {
2357
+ --sp-chip-color: var(--sp-text-secondary);
2358
+ --sp-chip-bg: transparent;
2359
+
2360
+ display: flex;
2361
+ align-items: center;
2362
+ gap: 10px;
2363
+ width: 100%;
2364
+ padding: 8px 10px;
2365
+ border: none;
2366
+ border-radius: 8px;
2367
+ background: transparent;
2368
+ color: var(--sp-text);
2369
+ font-family: var(--sp-font);
2370
+ font-size: 12px;
2371
+ font-weight: 500;
2372
+ cursor: pointer;
2373
+ text-align: left;
2374
+ transition: background 0.12s ease, color 0.12s ease;
2375
+ }
2376
+
2377
+ .sp-filter-dropdown-option__icon {
2378
+ display: inline-flex;
2379
+ align-items: center;
2380
+ justify-content: center;
2381
+ width: 22px;
2382
+ height: 22px;
2383
+ flex-shrink: 0;
2384
+ border-radius: 6px;
2385
+ background: var(--sp-chip-bg);
2386
+ color: var(--sp-chip-color);
2387
+ }
2388
+
2389
+ .sp-filter-dropdown-option__icon svg {
2390
+ width: 13px;
2391
+ height: 13px;
2392
+ }
2393
+
2394
+ .sp-filter-dropdown-option__label {
2395
+ flex: 1;
2396
+ min-width: 0;
2397
+ }
2398
+
2399
+ .sp-filter-dropdown-option__check {
2400
+ display: inline-flex;
2401
+ align-items: center;
2402
+ justify-content: center;
2403
+ width: 14px;
2404
+ height: 14px;
2405
+ flex-shrink: 0;
2406
+ color: var(--sp-chip-color);
2407
+ }
2408
+
2409
+ .sp-filter-dropdown-option__check svg {
2410
+ width: 13px;
2411
+ height: 13px;
2412
+ }
2413
+
2414
+ .sp-filter-dropdown-option:hover {
2415
+ background: var(--sp-bg-hover);
2416
+ }
2417
+
2418
+ .sp-filter-dropdown-option--active {
2419
+ color: var(--sp-chip-color);
2420
+ font-weight: 600;
2421
+ }
2422
+
2423
+ .sp-filter-dropdown-option--active:hover {
2424
+ background: var(--sp-chip-bg);
2425
+ }
2426
+
2427
+ /* ============================
2428
+ Status segmented control
2429
+ ============================ */
2430
+
2431
+ .sp-segmented {
2432
+ display: inline-flex;
2433
+ align-items: stretch;
2434
+ padding: 2px;
695
2435
  border-radius: var(--sp-radius-full);
696
2436
  border: 1px solid var(--sp-border);
697
2437
  background: var(--sp-glass-bg-heavy);
2438
+ flex-shrink: 0;
2439
+ }
2440
+
2441
+ .sp-segmented__btn {
2442
+ --sp-chip-color: var(--sp-text-tertiary);
2443
+ --sp-chip-bg: transparent;
2444
+
2445
+ display: inline-flex;
2446
+ align-items: center;
2447
+ gap: 5px;
2448
+ height: 26px;
2449
+ padding: 0 10px;
2450
+ border: none;
2451
+ border-radius: var(--sp-radius-full);
2452
+ background: transparent;
698
2453
  color: var(--sp-text-secondary);
699
2454
  font-family: var(--sp-font);
700
2455
  font-size: 12px;
701
2456
  font-weight: 500;
702
2457
  cursor: pointer;
703
- transition: all 0.2s ease;
704
2458
  white-space: nowrap;
705
- letter-spacing: 0.01em;
2459
+ transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
706
2460
  }
707
2461
 
708
- .sp-chip:hover {
709
- border-color: var(--sp-accent);
710
- color: var(--sp-accent);
711
- background: var(--sp-accent-light);
2462
+ .sp-segmented__icon {
2463
+ display: inline-flex;
2464
+ align-items: center;
2465
+ justify-content: center;
2466
+ width: 13px;
2467
+ height: 13px;
2468
+ flex-shrink: 0;
2469
+ color: var(--sp-chip-color);
2470
+ transition: color 0.18s ease, transform 0.18s ease;
712
2471
  }
713
2472
 
714
- .sp-chip--active {
715
- background: var(--sp-accent-gradient);
716
- border-color: transparent;
717
- color: #fff;
718
- box-shadow: 0 2px 8px var(--sp-accent-glow);
2473
+ .sp-segmented__icon svg {
2474
+ width: 13px;
2475
+ height: 13px;
719
2476
  }
720
2477
 
721
- .sp-chip--active:hover {
722
- background: var(--sp-accent-gradient);
723
- border-color: transparent;
724
- color: #fff;
2478
+ .sp-segmented__btn:hover {
2479
+ color: var(--sp-chip-color);
2480
+ }
2481
+
2482
+ .sp-segmented__btn:hover .sp-segmented__icon {
2483
+ color: var(--sp-chip-color);
2484
+ }
2485
+
2486
+ .sp-segmented__btn--active {
2487
+ background: var(--sp-chip-bg);
2488
+ color: var(--sp-chip-color);
2489
+ font-weight: 600;
2490
+ box-shadow:
2491
+ inset 0 0 0 1px color-mix(in srgb, var(--sp-chip-color) 35%, transparent),
2492
+ 0 1px 2px rgba(0, 0, 0, 0.04);
2493
+ }
2494
+
2495
+ .sp-segmented__btn--active .sp-segmented__icon {
2496
+ color: var(--sp-chip-color);
2497
+ }
2498
+
2499
+ .sp-segmented__btn--open.sp-segmented__btn--active .sp-segmented__icon {
2500
+ animation: sp-segmented-pulse 2.4s ease-in-out infinite;
2501
+ }
2502
+
2503
+ @keyframes sp-segmented-pulse {
2504
+ 0%, 100% { transform: scale(1); }
2505
+ 50% { transform: scale(0.85); }
2506
+ }
2507
+
2508
+ @media (prefers-reduced-motion: reduce) {
2509
+ .sp-filter-dropdown-btn,
2510
+ .sp-filter-dropdown-btn__chevron,
2511
+ .sp-filter-dropdown-option,
2512
+ .sp-segmented__btn,
2513
+ .sp-segmented__icon {
2514
+ transition: none;
2515
+ }
2516
+ .sp-filter-dropdown-menu {
2517
+ animation: none;
2518
+ }
2519
+ .sp-segmented__btn--open.sp-segmented__btn--active .sp-segmented__icon {
2520
+ animation: none;
2521
+ }
725
2522
  }
726
2523
 
727
2524
  /* ============================
@@ -759,6 +2556,7 @@ var M,ce,Fe;function Le(t,e){if(Fe=new Date,t.nodeType!==Node.ELEMENT_NODE)throw
759
2556
  border-radius: var(--sp-radius);
760
2557
  background: var(--sp-glass-bg-heavy);
761
2558
  border: 1px solid var(--sp-glass-border);
2559
+ box-shadow: var(--sp-shadow-xs);
762
2560
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
763
2561
  }
764
2562
 
@@ -894,6 +2692,11 @@ var M,ce,Fe;function Le(t,e){if(Fe=new Date,t.nodeType!==Node.ELEMENT_NODE)throw
894
2692
  pointer-events: none;
895
2693
  }
896
2694
 
2695
+ .sp-spinner--sm {
2696
+ width: 14px;
2697
+ height: 14px;
2698
+ }
2699
+
897
2700
  /* ---- Delete All (header) ---- */
898
2701
 
899
2702
  .sp-panel-header-right {
@@ -946,7 +2749,7 @@ var M,ce,Fe;function Le(t,e){if(Fe=new Date,t.nodeType!==Node.ELEMENT_NODE)throw
946
2749
  display: flex;
947
2750
  align-items: center;
948
2751
  justify-content: center;
949
- z-index: 2147483647;
2752
+ z-index: ${2147483647};
950
2753
  opacity: 0;
951
2754
  transition: opacity 0.2s ease;
952
2755
  }
@@ -1152,6 +2955,20 @@ var M,ce,Fe;function Le(t,e){if(Fe=new Date,t.nodeType!==Node.ELEMENT_NODE)throw
1152
2955
  font-weight: 500;
1153
2956
  }
1154
2957
 
2958
+ /* ============================
2959
+ Load More
2960
+ ============================ */
2961
+
2962
+ .sp-load-more-wrap {
2963
+ display: flex;
2964
+ justify-content: center;
2965
+ padding: 12px 0 4px;
2966
+ }
2967
+
2968
+ .sp-btn-load-more {
2969
+ width: 100%;
2970
+ }
2971
+
1155
2972
  /* ============================
1156
2973
  Forced Colors / High Contrast
1157
2974
  ============================ */
@@ -1159,7 +2976,9 @@ var M,ce,Fe;function Le(t,e){if(Fe=new Date,t.nodeType!==Node.ELEMENT_NODE)throw
1159
2976
  @media (forced-colors: active) {
1160
2977
  .sp-fab,
1161
2978
  .sp-radial-item,
1162
- .sp-chip,
2979
+ .sp-filter-dropdown-btn,
2980
+ .sp-segmented,
2981
+ .sp-segmented__btn,
1163
2982
  .sp-card,
1164
2983
  .sp-panel-close,
1165
2984
  .sp-search,
@@ -1177,9 +2996,26 @@ var M,ce,Fe;function Le(t,e){if(Fe=new Date,t.nodeType!==Node.ELEMENT_NODE)throw
1177
2996
  color: ButtonText !important;
1178
2997
  }
1179
2998
 
2999
+ .sp-segmented__btn--active {
3000
+ background: Highlight !important;
3001
+ color: HighlightText !important;
3002
+ }
3003
+
3004
+ .sp-filter-dropdown-menu {
3005
+ border: 2px solid ButtonText !important;
3006
+ background: Canvas !important;
3007
+ }
3008
+
3009
+ .sp-filter-dropdown-option--active {
3010
+ background: Highlight !important;
3011
+ color: HighlightText !important;
3012
+ }
3013
+
1180
3014
  .sp-fab:focus-visible,
1181
3015
  .sp-radial-item:focus-visible,
1182
- .sp-chip:focus-visible,
3016
+ .sp-filter-dropdown-btn:focus-visible,
3017
+ .sp-segmented__btn:focus-visible,
3018
+ .sp-filter-dropdown-option:focus-visible,
1183
3019
  .sp-panel-close:focus-visible,
1184
3020
  .sp-btn-resolve:focus-visible,
1185
3021
  .sp-btn-delete:focus-visible,
@@ -1208,10 +3044,16 @@ var M,ce,Fe;function Le(t,e){if(Fe=new Date,t.nodeType!==Node.ELEMENT_NODE)throw
1208
3044
  }
1209
3045
  }
1210
3046
 
1211
- ${lt}
1212
- `}var zt=120,_t=80,re=class{constructor(e,n="fr"){this.colors=e;this.locale=n;this.root=h("div",{style:`
3047
+ ${ts}
3048
+ ${Gt}
3049
+ ${Vt}
3050
+ ${Ot}
3051
+ ${Dt}
3052
+ ${Zt}
3053
+ ${Kt}
3054
+ `}var pn=120,dn=80,ye=class{constructor(e,t="en"){this.colors=e;this.locale=t;this.root=l("div",{style:`
1213
3055
  position: fixed;
1214
- z-index: 2147483647;
3056
+ z-index: ${2147483647};
1215
3057
  max-width: 280px;
1216
3058
  padding: 12px 14px;
1217
3059
  border-radius: 14px;
@@ -1227,7 +3069,7 @@ var M,ce,Fe;function Le(t,e){if(Fe=new Date,t.nodeType!==Node.ELEMENT_NODE)throw
1227
3069
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
1228
3070
  visibility: hidden;
1229
3071
  -webkit-font-smoothing: antialiased;
1230
- `}),this.root.setAttribute("role","tooltip"),this.root.id=this.tooltipId,this.arrow=h("div",{style:`
3072
+ `}),this.root.setAttribute("role","tooltip"),this.root.id=this.tooltipId,this.arrow=l("div",{style:`
1231
3073
  position: absolute;
1232
3074
  width: 12px;
1233
3075
  height: 12px;
@@ -1235,12 +3077,12 @@ var M,ce,Fe;function Le(t,e){if(Fe=new Date,t.nodeType!==Node.ELEMENT_NODE)throw
1235
3077
  border: 1px solid ${this.colors.glassBorder};
1236
3078
  transform: rotate(45deg);
1237
3079
  pointer-events: none;
1238
- `}),this.root.appendChild(this.arrow),this.root.addEventListener("mouseenter",()=>this.cancelHide()),this.root.addEventListener("mouseleave",()=>this.scheduleHide()),document.body.appendChild(this.root)}colors;locale;root;arrow;showTimer=null;hideTimer=null;currentFeedbackId=null;tooltipId="sp-tooltip";show(e,n){this.currentFeedbackId!==e.id&&(this.cancelHide(),this.cancelShow(),this.showTimer=setTimeout(()=>{this.currentFeedbackId=e.id,this.render(e),this.position(n);let i=typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;this.root.style.transition=i?"none":"",this.root.style.visibility="visible",this.root.style.opacity="1",this.root.style.transform="translateY(0) scale(1)"},zt))}scheduleHide(){this.cancelHide(),this.hideTimer=setTimeout(()=>this.hide(),_t)}hide(){this.cancelShow(),this.currentFeedbackId=null,this.root.style.opacity="0",this.root.style.transform="translateY(6px) scale(0.97)",setTimeout(()=>{this.currentFeedbackId||(this.root.style.visibility="hidden")},200)}cancelShow(){this.showTimer&&(clearTimeout(this.showTimer),this.showTimer=null)}cancelHide(){this.hideTimer&&(clearTimeout(this.hideTimer),this.hideTimer=null)}render(e){let n=Array.from(this.root.children);for(let p of n)p!==this.arrow&&p.remove();let i=I(e.type,this.colors),s=P(e.type,this.colors),o=ee(this.locale),r=B(e.type,o),a=h("div",{style:"display:flex;align-items:center;gap:8px;margin-bottom:8px;"}),l=h("span",{style:`
3080
+ `}),this.root.appendChild(this.arrow),this.root.addEventListener("mouseenter",()=>this.cancelHide()),this.root.addEventListener("mouseleave",()=>this.scheduleHide()),document.body.appendChild(this.root)}colors;locale;root;arrow;showTimer=null;hideTimer=null;currentFeedbackId=null;tooltipId="sp-tooltip";show(e,t){this.currentFeedbackId!==e.id&&(this.cancelHide(),this.cancelShow(),this.showTimer=setTimeout(()=>{this.currentFeedbackId=e.id,this.render(e),this.position(t);let s=typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;this.root.style.transition=s?"none":"",this.root.style.visibility="visible",this.root.style.opacity="1",this.root.style.transform="translateY(0) scale(1)"},pn))}scheduleHide(){this.cancelHide(),this.hideTimer=setTimeout(()=>this.hide(),dn)}hide(){this.cancelShow(),this.currentFeedbackId=null,this.root.style.opacity="0",this.root.style.transform="translateY(6px) scale(0.97)",setTimeout(()=>{this.currentFeedbackId||(this.root.style.visibility="hidden")},200)}cancelShow(){this.showTimer&&(clearTimeout(this.showTimer),this.showTimer=null)}cancelHide(){this.hideTimer&&(clearTimeout(this.hideTimer),this.hideTimer=null)}render(e){let t=Array.from(this.root.children);for(let h of t)h!==this.arrow&&h.remove();let s=M(e.type,this.colors),o=P(e.type,this.colors),i=re(this.locale),r=N(e.type,i),a=l("div",{style:"display:flex;align-items:center;gap:8px;margin-bottom:8px;"}),p=l("span",{style:`
1239
3081
  padding:3px 10px;border-radius:9999px;
1240
3082
  font-size:11px;font-weight:600;
1241
- color:${i};background:${s};
3083
+ color:${s};background:${o};
1242
3084
  letter-spacing:0.02em;
1243
- `});b(l,r);let c=h("span",{style:`font-size:11px;color:${this.colors.textSecondary};margin-left:auto;`});b(c,X(e.createdAt,this.locale)),a.appendChild(l),a.appendChild(c);let d=h("div",{style:`font-size:13px;line-height:1.55;color:${this.colors.text};display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;`});b(d,e.message),this.root.insertBefore(a,this.arrow),this.root.insertBefore(d,this.arrow)}position(e){let n=this.root.getBoundingClientRect(),i=10,s=e.top-n.height-i,o=e.left+e.width/2-n.width/2,r=!0;s<8&&(s=e.bottom+i,r=!1),o=Math.max(8,Math.min(o,window.innerWidth-n.width-8)),this.root.style.top=`${s}px`,this.root.style.left=`${o}px`;let a=Math.max(16,Math.min(e.left+e.width/2-o-6,n.width-22));r?this.arrow.style.cssText=`
3085
+ `});c(p,r);let d=l("span",{style:`font-size:11px;color:${this.colors.textSecondary};margin-left:auto;`});c(d,V(e.createdAt,this.locale)),a.appendChild(p),a.appendChild(d);let u=l("div",{style:`font-size:13px;line-height:1.55;color:${this.colors.text};display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;`});c(u,e.message),this.root.insertBefore(a,this.arrow),this.root.insertBefore(u,this.arrow)}position(e){let t=this.root.getBoundingClientRect(),s=10,o=e.top-t.height-s,i=e.left+e.width/2-t.width/2,r=!0;o<8&&(o=e.bottom+s,r=!1),i=Math.max(8,Math.min(i,window.innerWidth-t.width-8)),this.root.style.top=`${o}px`,this.root.style.left=`${i}px`;let a=Math.max(16,Math.min(e.left+e.width/2-i-6,t.width-22));r?this.arrow.style.cssText=`
1244
3086
  position:absolute;
1245
3087
  width:12px;height:12px;
1246
3088
  background:${this.colors.glassBgHeavy};
@@ -1260,15 +3102,15 @@ var M,ce,Fe;function Le(t,e){if(Fe=new Date,t.nodeType!==Node.ELEMENT_NODE)throw
1260
3102
  pointer-events:none;
1261
3103
  top:-6px;
1262
3104
  left:${a}px;
1263
- `}contains(e){return this.root.contains(e)}destroy(){this.cancelShow(),this.cancelHide(),this.root.remove()}};var z=null;function ae(){let t=()=>{};return{destroy:t,open:t,close:t,refresh:t,on:()=>t,off:t}}function ct(t){let e=t.debug?(...u)=>console.debug("[siteping]",...u):()=>{};if(z)return e("initSiteping() called more than once \u2014 returning existing instance"),z;if(!t.forceShow)try{if(typeof process<"u"){let u="production";return console.info("[siteping] Widget not loaded: production mode detected. Use forceShow: true to override."),t.onSkip?.(u),ae()}}catch{}if(window.innerWidth<768){let u="mobile";return console.info("[siteping] Widget not loaded: viewport width < 768px (mobile not supported)."),t.onSkip?.(u),ae()}if(!t.store&&(!t.endpoint||typeof t.endpoint!="string"))return console.error("[siteping] Missing 'endpoint' or 'store' in config. Provide an endpoint like '/api/siteping' or a SitepingStore instance."),ae();if(!t.projectName||typeof t.projectName!="string")return console.error("[siteping] Missing or invalid 'projectName' in config. Expected a non-empty string."),ae();let n=t.locale??"en",i=ee(n);e("Initializing widget",{projectName:t.projectName,theme:t.theme??"light",locale:n});let s=Ge(t.accentColor,t.theme),o=new O,r=new O,a=t.store?new oe(t.store,t.projectName):new J(t.endpoint,t.projectName);t.onOpen&&o.on("open",t.onOpen),t.onClose&&o.on("close",t.onClose),t.onFeedbackSent&&o.on("feedback:sent",t.onFeedbackSent),t.onError&&o.on("feedback:error",t.onError),t.onAnnotationStart&&o.on("annotation:start",t.onAnnotationStart),t.onAnnotationEnd&&o.on("annotation:end",t.onAnnotationEnd),o.on("feedback:sent",u=>r.emit("feedback:sent",u)),o.on("feedback:deleted",u=>r.emit("feedback:deleted",u)),o.on("open",()=>r.emit("panel:open")),o.on("close",()=>r.emit("panel:close")),o.on("open",()=>e("Panel opened")),o.on("close",()=>e("Panel closed")),o.on("feedback:sent",u=>e("Feedback sent",u.id)),o.on("feedback:error",u=>e("Feedback failed",u.message)),o.on("annotation:start",()=>e("Annotation started")),o.on("annotation:end",()=>e("Annotation ended"));let l=document.createElement("siteping-widget");l.style.cssText="position:fixed;z-index:2147483647;";let c=!1;try{typeof process<"u"&&process.env?.["NODE_ENV"]==="test"&&(c=!0)}catch{}let d=c?"open":"closed",p=l.attachShadow({mode:d});if("adoptedStyleSheets"in ShadowRoot.prototype){let u=new CSSStyleSheet;u.replaceSync(Ce(s)),p.adoptedStyleSheets=[u]}else{let u=document.createElement("style");u.textContent=Ce(s),p.appendChild(u)}document.body.appendChild(l);let m=document.createElement("div");m.setAttribute("role","status"),m.setAttribute("aria-live","polite"),m.setAttribute("aria-atomic","true"),m.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;",document.body.appendChild(m);let y=new re(s,n),T=new ie(s,y,o,i),k=new Z(p,t,o,i),C=new se(p,s,o,a,t.projectName,T,i,n),v=new Q(s,o,i),g=!1,x=o.on("annotation:complete",async u=>{if(!g){g=!0;try{let{annotation:w,type:S,message:E}=u,A=tt();if(!A){if(A=await Kt(p,i),!A)return;nt(A)}let L=new URL(window.location.href);for(let R of[...L.searchParams.keys()])/token|key|secret|auth|session|password|code/i.test(R)&&L.searchParams.delete(R);let _=L.toString(),dt=(()=>{try{return crypto.randomUUID()}catch{return`${Date.now()}-${Math.random().toString(36).slice(2)}`}})(),pt={projectName:t.projectName,type:S,message:E,url:_,viewport:`${window.innerWidth}x${window.innerHeight}`,userAgent:navigator.userAgent,authorName:A.name,authorEmail:A.email,annotations:[w],clientId:dt};try{let R=await a.sendFeedback(pt);o.emit("feedback:sent",R),T.addFeedback(R,T.count+1),m.textContent=i("feedback.sent.confirmation"),await C.refresh()}catch(R){o.emit("feedback:error",R instanceof Error?R:new Error(String(R))),m.textContent=i("feedback.error.message")}}finally{g=!1}}});return a.getFeedbacks(t.projectName,{limit:50}).then(({feedbacks:u})=>{T.render(u)}).catch(u=>{e("Failed to load initial markers:",u)}),t.endpoint&&Qe(t.endpoint).then(()=>e("Retry queue flushed")).catch(()=>{}),z={destroy:()=>{e("Destroying widget"),x(),k.destroy(),C.destroy(),v.destroy(),T.destroy(),y.destroy(),o.removeAll(),r.removeAll(),m.remove(),l.remove(),z=null},open:()=>{C.open()},close:()=>{C.close()},refresh:()=>{C.refresh()},on:(u,w)=>r.on(u,w),off:(u,w)=>{r.off(u,w)}},z}function Kt(t,e){return new Promise(n=>{let i=t.activeElement??document.activeElement,s=document.createElement("div");s.style.cssText=`
3105
+ `}contains(e){return this.root.contains(e)}destroy(){this.cancelShow(),this.cancelHide(),this.root.remove()}};var z=null;function xe(){let n=()=>{};return{destroy:n,open:n,close:n,refresh:n,on:()=>n,off:n}}function ss(n){let e=n.debug?(...m)=>console.debug("[siteping]",...m):()=>{};if(z)return e("initSiteping() called more than once \u2014 returning existing instance"),z;if(!n.forceShow)try{if(typeof process<"u"){let m="production";return console.info("[siteping] Widget not loaded: production mode detected. Use forceShow: true to override."),n.onSkip?.(m),xe()}}catch{}if(window.innerWidth<768){let m="mobile";return console.info(`[siteping] Widget not loaded: viewport width < ${768}px (mobile not supported).`),n.onSkip?.(m),xe()}if(!n.store&&(!n.endpoint||typeof n.endpoint!="string"))return console.error("[siteping] Missing 'endpoint' or 'store' in config. Provide an endpoint like '/api/siteping' or a SitepingStore instance."),xe();if(!n.projectName||typeof n.projectName!="string")return console.error("[siteping] Missing or invalid 'projectName' in config. Expected a non-empty string."),xe();let t=n.locale??"en",s=re(t);e("Initializing widget",{projectName:n.projectName,theme:n.theme??"light",locale:t});let o=bt(n.accentColor,n.theme),i=new $,r=new $,a=n.store?new ve(n.store,n.projectName):new oe(n.endpoint,n.projectName);n.onOpen&&i.on("open",n.onOpen),n.onClose&&i.on("close",n.onClose),n.onFeedbackSent&&i.on("feedback:sent",n.onFeedbackSent),n.onError&&i.on("feedback:error",n.onError),n.onAnnotationStart&&i.on("annotation:start",n.onAnnotationStart),n.onAnnotationEnd&&i.on("annotation:end",n.onAnnotationEnd),i.on("feedback:sent",m=>r.emit("feedback:sent",m)),i.on("feedback:deleted",m=>r.emit("feedback:deleted",m)),i.on("open",()=>r.emit("panel:open")),i.on("close",()=>r.emit("panel:close")),i.on("open",()=>e("Panel opened")),i.on("close",()=>e("Panel closed")),i.on("feedback:sent",m=>e("Feedback sent",m.id)),i.on("feedback:error",m=>e("Feedback failed",m.message)),i.on("annotation:start",()=>e("Annotation started")),i.on("annotation:end",()=>e("Annotation ended"));let p=document.createElement("siteping-widget");p.style.cssText=`position:fixed;z-index:${2147483647};`;let d=!1;try{typeof process<"u"&&process.env?.["NODE_ENV"]==="test"&&(d=!0)}catch{}let u=d?"open":"closed",h=p.attachShadow({mode:u});if("adoptedStyleSheets"in ShadowRoot.prototype){let m=new CSSStyleSheet;m.replaceSync(Ue(o)),h.adoptedStyleSheets=[m]}else{let m=document.createElement("style");m.textContent=Ue(o),h.appendChild(m)}document.body.appendChild(p);let f=document.createElement("div");f.setAttribute("role","status"),f.setAttribute("aria-live","polite"),f.setAttribute("aria-atomic","true"),f.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;",document.body.appendChild(f);let k=new ye(o,t),w=new pe(o,k,i,s),E=new ie(h,n,i,s),C=new fe(h,o,i,a,n.projectName,w,s,t),g=new ne(o,i,s),x=!1,y=i.on("annotation:complete",async m=>{if(!x){x=!0;try{let{annotation:T,type:A,message:S}=m,L=St();if(!L){if(L=await un(h,s),!L)return;At(L)}let B=new URL(window.location.href);for(let R of[...B.searchParams.keys()])/token|key|secret|auth|session|password|code/i.test(R)&&B.searchParams.delete(R);let K=B.toString(),ns=(()=>{try{return crypto.randomUUID()}catch{return`${Date.now()}-${Math.random().toString(36).slice(2)}`}})(),os={projectName:n.projectName,type:A,message:S,url:K,viewport:`${window.innerWidth}x${window.innerHeight}`,userAgent:navigator.userAgent,authorName:L.name,authorEmail:L.email,annotations:[T],clientId:ns};try{let R=await a.sendFeedback(os);i.emit("feedback:sent",R),w.addFeedback(R,w.count+1),f.textContent=s("feedback.sent.confirmation"),await C.refresh()}catch(R){i.emit("feedback:error",R instanceof Error?R:new Error(String(R))),f.textContent=s("feedback.error.message")}}finally{x=!1}}});return a.getFeedbacks(n.projectName,{limit:20}).then(({feedbacks:m})=>{w.render(m)}).catch(m=>{e("Failed to load initial markers:",m)}),n.endpoint&&ft(n.endpoint).then(()=>e("Retry queue flushed")).catch(()=>{}),z={destroy:()=>{e("Destroying widget"),y(),E.destroy(),C.destroy(),g.destroy(),w.destroy(),k.destroy(),i.removeAll(),r.removeAll(),f.remove(),p.remove(),z=null},open:()=>{C.open()},close:()=>{C.close()},refresh:()=>{C.refresh()},on:(m,T)=>r.on(m,T),off:(m,T)=>{r.off(m,T)}},z}function un(n,e){return new Promise(t=>{let s=n.activeElement??document.activeElement,o=document.createElement("div");o.style.cssText=`
1264
3106
  position:fixed;inset:0;
1265
3107
  background:var(--sp-identity-overlay);
1266
3108
  backdrop-filter:blur(8px);
1267
3109
  -webkit-backdrop-filter:blur(8px);
1268
3110
  display:flex;align-items:center;justify-content:center;
1269
- z-index:2147483647;
3111
+ z-index:${2147483647};
1270
3112
  opacity:0;transition:opacity 0.25s ease;
1271
- `;let o=document.createElement("div");o.style.cssText=`
3113
+ `;let i=document.createElement("div");i.style.cssText=`
1272
3114
  width:340px;padding:28px;border-radius:var(--sp-radius-xl);
1273
3115
  background:var(--sp-identity-bg);
1274
3116
  backdrop-filter:blur(var(--sp-blur-heavy));
@@ -1280,5 +3122,5 @@ var M,ce,Fe;function Le(t,e){if(Fe=new Date,t.nodeType!==Node.ELEMENT_NODE)throw
1280
3122
  transform:translateY(12px) scale(0.97);
1281
3123
  transition:transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
1282
3124
  -webkit-font-smoothing:antialiased;
1283
- `;let r=`sp-identity-title-${Date.now()}`;o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true"),o.setAttribute("aria-labelledby",r);let a=document.createElement("div");a.className="sp-identity-title",a.id=r,a.textContent=e("identity.title"),a.style.marginBottom="20px";let l=`sp-identity-name-${Date.now()}`,c=`sp-identity-email-${Date.now()}`,d=document.createElement("label");d.className="sp-input-label",d.textContent=e("identity.nameLabel"),d.setAttribute("for",l);let p=document.createElement("input");p.className="sp-input",p.id=l,p.type="text",p.placeholder=e("identity.namePlaceholder"),p.style.marginBottom="14px";let f=document.createElement("label");f.className="sp-input-label",f.textContent=e("identity.emailLabel"),f.setAttribute("for",c);let m=document.createElement("input");m.className="sp-input",m.id=c,m.type="email",m.placeholder=e("identity.emailPlaceholder");let y=document.createElement("div");y.style.cssText="display:flex;gap:8px;justify-content:flex-end;margin-top:20px;";let T=x=>{s.removeEventListener("keydown",g),s.style.opacity="0",o.style.transform="translateY(12px) scale(0.97)",setTimeout(()=>{s.remove(),i?.focus(),n(x)},250)},k=document.createElement("button");k.className="sp-btn-ghost",k.textContent=e("identity.cancel"),k.addEventListener("click",()=>T(null));let C=document.createElement("button");C.className="sp-btn-primary",C.textContent=e("identity.submit"),C.addEventListener("click",()=>{let x=p.value.trim(),u=m.value.trim();if(!x||!u)return;if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(u)){m.style.borderColor="var(--sp-type-bug, #ef4444)";return}T({name:x,email:u})});let v='input, button, [tabindex]:not([tabindex="-1"])',g=x=>{let u=x;if(u.key==="Escape"){T(null);return}if(u.key==="Tab"){let w=Array.from(o.querySelectorAll(v));if(w.length===0)return;let S=w[0],E=w[w.length-1];if(!S||!E)return;let A=t.activeElement;u.shiftKey?(A===S||!o.contains(A))&&(u.preventDefault(),E.focus()):(A===E||!o.contains(A))&&(u.preventDefault(),S.focus())}};s.addEventListener("keydown",g),s.addEventListener("click",x=>{x.target===s&&T(null)}),y.appendChild(k),y.appendChild(C),o.appendChild(a),o.appendChild(d),o.appendChild(p),o.appendChild(f),o.appendChild(m),o.appendChild(y),s.appendChild(o),t.appendChild(s),requestAnimationFrame(()=>{s.style.opacity="1",o.style.transform="translateY(0) scale(1)",p.focus()})})}function gi(t){return ct(t)}export{gi as initSiteping};
3125
+ `;let r=`sp-identity-title-${Date.now()}`;i.setAttribute("role","dialog"),i.setAttribute("aria-modal","true"),i.setAttribute("aria-labelledby",r);let a=document.createElement("div");a.className="sp-identity-title",a.id=r,a.textContent=e("identity.title"),a.style.marginBottom="20px";let p=`sp-identity-name-${Date.now()}`,d=`sp-identity-email-${Date.now()}`,u=document.createElement("label");u.className="sp-input-label",u.textContent=e("identity.nameLabel"),u.setAttribute("for",p);let h=document.createElement("input");h.className="sp-input",h.id=p,h.type="text",h.placeholder=e("identity.namePlaceholder"),h.style.marginBottom="14px";let b=document.createElement("label");b.className="sp-input-label",b.textContent=e("identity.emailLabel"),b.setAttribute("for",d);let f=document.createElement("input");f.className="sp-input",f.id=d,f.type="email",f.placeholder=e("identity.emailPlaceholder");let k=document.createElement("div");k.style.cssText="display:flex;gap:8px;justify-content:flex-end;margin-top:20px;";let w=y=>{o.removeEventListener("keydown",x),o.style.opacity="0",i.style.transform="translateY(12px) scale(0.97)",setTimeout(()=>{o.remove(),s?.focus(),t(y)},250)},E=document.createElement("button");E.className="sp-btn-ghost",E.textContent=e("identity.cancel"),E.addEventListener("click",()=>w(null));let C=document.createElement("button");C.className="sp-btn-primary",C.textContent=e("identity.submit"),C.addEventListener("click",()=>{let y=h.value.trim(),m=f.value.trim();if(!y||!m)return;if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(m)){f.style.borderColor="var(--sp-type-bug, #ef4444)";return}w({name:y,email:m})});let g='input, button, [tabindex]:not([tabindex="-1"])',x=y=>{let m=y;if(m.key==="Escape"){w(null);return}if(m.key==="Tab"){let T=Array.from(i.querySelectorAll(g));if(T.length===0)return;let A=T[0],S=T[T.length-1];if(!A||!S)return;let L=n.activeElement;m.shiftKey?(L===A||!i.contains(L))&&(m.preventDefault(),S.focus()):(L===S||!i.contains(L))&&(m.preventDefault(),A.focus())}};o.addEventListener("keydown",x),o.addEventListener("click",y=>{y.target===o&&w(null)}),k.appendChild(E),k.appendChild(C),i.appendChild(a),i.appendChild(u),i.appendChild(h),i.appendChild(b),i.appendChild(f),i.appendChild(k),o.appendChild(i),n.appendChild(o),requestAnimationFrame(()=>{o.style.opacity="1",i.style.transform="translateY(0) scale(1)",h.focus()})})}function xi(n){return ss(n)}export{xi as initSiteping};
1284
3126
  //# sourceMappingURL=index.js.map