@siteping/widget 0.9.12 → 0.9.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- function c(t){let s=document.createRange().createContextualFragment(t).firstElementChild;if(!s||s.nodeName.toLowerCase()!=="svg")throw new Error("[siteping] Invalid SVG string");for(let r of [...s.attributes])r.name.startsWith("on")&&s.removeAttribute(r.name);for(let r of s.querySelectorAll("*"))for(let i of [...r.attributes])i.name.startsWith("on")&&r.removeAttribute(i.name);return s}function o(t,e){let n=document.createElement(t);if(e)for(let[s,r]of Object.entries(e))s==="class"?n.className=r:s==="style"?n.style.cssText=r:n.setAttribute(s,r);return n}function a(t,e){t.textContent=e;}function R(t){let e=Array.from(t.childNodes).map(n=>n.cloneNode(true));return t.disabled=true,t.replaceChildren(o("div",{class:"sp-spinner sp-spinner--sm"})),()=>{t.replaceChildren(...e),t.disabled=false;}}function $e(t,e="en"){let n=Date.now()-new Date(t).getTime(),s=Math.floor(n/1e3);if(s<60)return new Intl.RelativeTimeFormat(e,{numeric:"auto"}).format(0,"second");let r=new Intl.RelativeTimeFormat(e,{numeric:"always",style:"narrow"}),i=Math.floor(s/60);if(i<60)return r.format(-i,"minute");let l=Math.floor(i/60);if(l<24)return r.format(-l,"hour");let d=Math.floor(l/24);return d<7?r.format(-d,"day"):new Date(t).toLocaleDateString(e)}var ze='<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>',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"/></svg>',Ve='<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>',Ye='<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>',Ge='<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>',qe='<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>',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="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>',Xe='<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>',Qe='<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>',Je='<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>',Ze='<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>',et='<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>',tt='<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>',st='<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>',nt='<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>',rt='<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>',ot='<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 j="#0066ff",oe=/^#[0-9a-fA-F]{6}$/,I=/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/,ie=/^#[0-9a-fA-F]{8}$/;function ae(t){if(oe.test(t))return t;let e=I.test(t)?t.match(I):null;return e?`#${e[1]}${e[1]}${e[2]}${e[2]}${e[3]}${e[3]}`:ie.test(t)?t.slice(0,7):(console.warn(`[siteping] Invalid accentColor "${t}" \u2014 only hex colors (#RGB, #RRGGBB, #RRGGBBAA) are supported. Using default.`),j)}function le(t,e){let n=Math.max(0,Math.round(parseInt(t.slice(1,3),16)*(1-e))),s=Math.max(0,Math.round(parseInt(t.slice(3,5),16)*(1-e))),r=Math.max(0,Math.round(parseInt(t.slice(5,7),16)*(1-e)));return `#${n.toString(16).padStart(2,"0")}${s.toString(16).padStart(2,"0")}${r.toString(16).padStart(2,"0")}`}function pe(){return typeof window>"u"?false:window.matchMedia("(prefers-color-scheme: dark)").matches}function de(t){return t==="dark"||t==="auto"&&pe()?"dark":"light"}function at(t=j,e){let n=ae(t),s=le(n,.15);return de(e)==="dark"?{accent:n,accentLight:n+"22",accentDark:s,accentGlow:n+"44",accentGradient:`linear-gradient(135deg, ${n}, ${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:n,accentLight:n+"14",accentDark:s,accentGlow:n+"33",accentGradient:`linear-gradient(135deg, ${n}, ${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(t,e){switch(t){case "question":return e.typeQuestion;case "change":return e.typeChange;case "bug":return e.typeBug;default:return e.typeOther}}function _(t,e){switch(t){case "question":return e.typeQuestionBg;case "change":return e.typeChangeBg;case "bug":return e.typeBugBg;default:return e.typeOtherBg}}function lt(t){return `
1
+ function c(t){let s=document.createRange().createContextualFragment(t).firstElementChild;if(!s||s.nodeName.toLowerCase()!=="svg")throw new Error("[siteping] Invalid SVG string");for(let r of [...s.attributes])r.name.startsWith("on")&&s.removeAttribute(r.name);for(let r of s.querySelectorAll("*"))for(let i of [...r.attributes])i.name.startsWith("on")&&r.removeAttribute(i.name);return s}function o(t,e){let n=document.createElement(t);if(e)for(let[s,r]of Object.entries(e))s==="class"?n.className=r:s==="style"?n.style.cssText=r:n.setAttribute(s,r);return n}function a(t,e){t.textContent=e;}function R(t){let e=Array.from(t.childNodes).map(n=>n.cloneNode(true));return t.disabled=true,t.replaceChildren(o("div",{class:"sp-spinner sp-spinner--sm"})),()=>{t.replaceChildren(...e),t.disabled=false;}}function $e(t,e="en"){let n=Date.now()-new Date(t).getTime(),s=Math.floor(n/1e3);if(s<60)return new Intl.RelativeTimeFormat(e,{numeric:"auto"}).format(0,"second");let r=new Intl.RelativeTimeFormat(e,{numeric:"always",style:"narrow"}),i=Math.floor(s/60);if(i<60)return r.format(-i,"minute");let l=Math.floor(i/60);if(l<24)return r.format(-l,"hour");let d=Math.floor(l/24);return d<7?r.format(-d,"day"):new Date(t).toLocaleDateString(e)}var 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="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>';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="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>',Ve='<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>',Ye='<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>',Ge='<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>',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="20 6 9 17 4 12"/></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="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>',Xe='<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>',Qe='<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>',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="12" cy="12" r="1"/><circle cx="19" cy="12" r="1"/><circle cx="5" cy="12" r="1"/></svg>',Ze='<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>',et='<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>',tt='<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>',st='<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>',nt='<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>',rt='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><line x1="8" y1="6" x2="21" y2="6"/><line x1="8" y1="12" x2="21" y2="12"/><line x1="8" y1="18" x2="21" y2="18"/><line x1="3" y1="6" x2="3.01" y2="6"/><line x1="3" y1="12" x2="3.01" y2="12"/><line x1="3" y1="18" x2="3.01" y2="18"/></svg>',ot='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 20h9"/><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5z"/></svg>';var j="#0066ff",oe=/^#[0-9a-fA-F]{6}$/,I=/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/,ie=/^#[0-9a-fA-F]{8}$/;function ae(t){if(oe.test(t))return t;let e=I.test(t)?t.match(I):null;return e?`#${e[1]}${e[1]}${e[2]}${e[2]}${e[3]}${e[3]}`:ie.test(t)?t.slice(0,7):(console.warn(`[siteping] Invalid accentColor "${t}" \u2014 only hex colors (#RGB, #RRGGBB, #RRGGBBAA) are supported. Using default.`),j)}function le(t,e){let n=Math.max(0,Math.round(parseInt(t.slice(1,3),16)*(1-e))),s=Math.max(0,Math.round(parseInt(t.slice(3,5),16)*(1-e))),r=Math.max(0,Math.round(parseInt(t.slice(5,7),16)*(1-e)));return `#${n.toString(16).padStart(2,"0")}${s.toString(16).padStart(2,"0")}${r.toString(16).padStart(2,"0")}`}function pe(){return typeof window>"u"?false:window.matchMedia("(prefers-color-scheme: dark)").matches}function de(t){return t==="dark"||t==="auto"&&pe()?"dark":"light"}function at(t=j,e){let n=ae(t),s=le(n,.15);return de(e)==="dark"?{accent:n,accentLight:n+"22",accentDark:s,accentGlow:n+"44",accentGradient:`linear-gradient(135deg, ${n}, ${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:n,accentLight:n+"14",accentDark:s,accentGlow:n+"33",accentGradient:`linear-gradient(135deg, ${n}, ${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(t,e){switch(t){case "question":return e.typeQuestion;case "change":return e.typeChange;case "bug":return e.typeBug;default:return e.typeOther}}function _(t,e){switch(t){case "question":return e.typeQuestionBg;case "change":return e.typeChangeBg;case "bug":return e.typeBugBg;default:return e.typeOtherBg}}function lt(t){return `
2
2
  --sp-accent: ${t.accent};
3
3
  --sp-accent-light: ${t.accentLight};
4
4
  --sp-accent-dark: ${t.accentDark};
@@ -35,7 +35,7 @@ function c(t){let s=document.createRange().createContextualFragment(t).firstElem
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 S=class extends Error{code;retryable;constructor(e,n,s){super(e),this.code=n,this.retryable=s,this.name="SitepingError";}},F=class extends S{constructor(e){super(e,"NETWORK",true),this.name="SitepingNetworkError";}},P=class extends S{constructor(e){super(e,"VALIDATION",false),this.name="SitepingValidationError";}},O=class extends S{constructor(e){super(e,"AUTH",false),this.name="SitepingAuthError";}};function $(t){return typeof t=="object"&&t!==null}function ce(t,e){return $(t)&&e in t}var N=["en","fr","de","es","it","pt","ru"];function ue(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,anchorKey:t.anchor.anchorKey??null,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 K={"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","scope.label":"Scope","scope.thisPage":"This page","scope.thisType":"This type","scope.all":"All pages","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}","marker.count":"{count} feedback markers displayed","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","bulk.selectAll":"Select all","bulk.selected":"{count} selected","bulk.resolve":"Resolve","bulk.delete":"Delete","bulk.deselect":"Deselect","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","stats.open":"Open","stats.resolved":"Resolved","stats.bugs":"Bugs","stats.progress":"{percent}% resolved","detail.back":"Back","detail.title":"Feedback #{number}","detail.status":"Status","detail.message":"Message","detail.screenshot":"Screenshot","detail.screenshotAlt":"Screenshot of the annotated area","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","detail.diagnostics":"Diagnostics","detail.diagnostics.console":"Console","detail.diagnostics.network":"Failed network","detail.diagnostics.expand":"Show diagnostics","detail.diagnostics.collapse":"Hide diagnostics","detail.diagnostics.noEntries":"No entries","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","export.label":"Export","export.csv":"Export CSV","export.json":"Export JSON"};var E={en:K},he=new Set(N.filter(t=>t!=="en"));function z(t){return he.has(t)}function U(t){return (t.split("-")[0]??t).toLowerCase()}async function Tt(t){let e=U(t),n=E[e];if(n)return n;if(!z(e))return null;let s;switch(e){case "de":s=await import('./de-32TXJQIE.js');break;case "es":s=await import('./es-GFAPKPTK.js');break;case "fr":s=await import('./fr-W2JZ3EUC.js');break;case "it":s=await import('./it-GASU527B.js');break;case "pt":s=await import('./pt-AYXM6FG4.js');break;case "ru":s=await import('./ru-5DW2JCKR.js');break;default:return null}let r=s[e];return r?(E[e]=r,r):null}function Bt(t){let e=U(t);return e!=="en"&&!E[e]&&!z(e)&&console.warn(`[siteping] Unknown locale "${t}", falling back to "en"`),n=>(E[e]??E.en)?.[n]??E.en?.[n]??n}function At(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 ge='<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>',be='<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>',ve='<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>',Mt=`
38
+ `}var S=class extends Error{code;retryable;constructor(e,n,s){super(e),this.code=n,this.retryable=s,this.name="SitepingError";}},F=class extends S{constructor(e){super(e,"NETWORK",true),this.name="SitepingNetworkError";}},P=class extends S{constructor(e){super(e,"VALIDATION",false),this.name="SitepingValidationError";}},O=class extends S{constructor(e){super(e,"AUTH",false),this.name="SitepingAuthError";}};function $(t){return typeof t=="object"&&t!==null}function ce(t,e){return $(t)&&e in t}var N=["en","fr","de","es","it","pt","ru"];function ue(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,anchorKey:t.anchor.anchorKey??null,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 z={"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","scope.label":"Scope","scope.thisPage":"This page","scope.thisType":"This type","scope.all":"All pages","fab.aria":"Siteping \u2014 Feedback menu","fab.messages":"Show sidebar","fab.annotate":"Create new annotation","fab.annotations":"Show or hide markers","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}","marker.count":"{count} feedback markers displayed","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","bulk.selectAll":"Select all","bulk.selected":"{count} selected","bulk.resolve":"Resolve","bulk.delete":"Delete","bulk.deselect":"Deselect","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","stats.open":"Open","stats.resolved":"Resolved","stats.bugs":"Bugs","stats.progress":"{percent}% resolved","detail.back":"Back","detail.title":"Feedback #{number}","detail.status":"Status","detail.message":"Message","detail.screenshot":"Screenshot","detail.screenshotAlt":"Screenshot of the annotated area","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","detail.diagnostics":"Diagnostics","detail.diagnostics.console":"Console","detail.diagnostics.network":"Failed network","detail.diagnostics.expand":"Show diagnostics","detail.diagnostics.collapse":"Hide diagnostics","detail.diagnostics.noEntries":"No entries","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","export.label":"Export","export.csv":"Export CSV","export.json":"Export JSON"};var E={en:z},he=new Set(N.filter(t=>t!=="en"));function K(t){return he.has(t)}function U(t){return (t.split("-")[0]??t).toLowerCase()}async function Tt(t){let e=U(t),n=E[e];if(n)return n;if(!K(e))return null;let s;switch(e){case "de":s=await import('./de-CO2K72R2.js');break;case "es":s=await import('./es-2QYDBGOD.js');break;case "fr":s=await import('./fr-7YJBFS2W.js');break;case "it":s=await import('./it-44RM76KH.js');break;case "pt":s=await import('./pt-DRKIF4UZ.js');break;case "ru":s=await import('./ru-EAKBDL3X.js');break;default:return null}let r=s[e];return r?(E[e]=r,r):null}function Bt(t){let e=U(t);return e!=="en"&&!E[e]&&!K(e)&&console.warn(`[siteping] Unknown locale "${t}", falling back to "en"`),n=>(E[e]??E.en)?.[n]??E.en?.[n]??n}function At(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 ge='<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>',be='<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>',ve='<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>',Mt=`
39
39
  /* ============================
40
40
  Export Button & Menu
41
41
  ============================ */
@@ -1165,7 +1165,7 @@ function c(t){let s=document.createRange().createContextualFragment(t).firstElem
1165
1165
  animation-duration: 0.01ms !important;
1166
1166
  }
1167
1167
  }
1168
- `;function Le(t){if(/Edg\//i.test(t)){let e=t.match(/Edg\/([\d.]+)/);return e?`Edge ${e[1]}`:"Edge"}if(/OPR\//i.test(t)||/Opera/i.test(t)){let e=t.match(/OPR\/([\d.]+)/);return e?`Opera ${e[1]}`:"Opera"}if(/Firefox\//i.test(t)){let e=t.match(/Firefox\/([\d.]+)/);return e?`Firefox ${e[1]}`:"Firefox"}if(/Chrome\//i.test(t)&&!/Chromium/i.test(t)){let e=t.match(/Chrome\/([\d.]+)/);return e?`Chrome ${e[1]}`:"Chrome"}if(/Safari\//i.test(t)&&!/Chrome/i.test(t)){let e=t.match(/Version\/([\d.]+)/);return e?`Safari ${e[1]}`:"Safari"}return "Unknown"}function J(t,e){try{return new Date(t).toLocaleString(e,{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return t}}function Re(t){try{return new URL(t).pathname}catch{return t}}function Me(t){return !!(/^data:image\/(jpeg|png|webp);/i.test(t)||/^https:\/\//i.test(t))}function A(t,e){return t.length<=e?t:t.slice(0,e-1)+"\u2026"}function Fe(t){if(!t)return false;let e=Array.isArray(t.console)?t.console.length:0,n=Array.isArray(t.network)?t.network.length:0;return e>0||n>0}function Pe(t){return !Number.isFinite(t)||t<0?"\u2014":t<1e3?`${Math.round(t)} ms`:`${(t/1e3).toFixed(1)} s`}var Z=class{constructor(e,n,s,r){this.colors=e;this.callbacks=n;this.t=s,this.locale=r,this.element=o("div",{class:"sp-detail"}),this.element.setAttribute("role","dialog"),this.element.setAttribute("aria-label","Feedback detail"),this.element.setAttribute("aria-hidden","true");let i=o("div",{class:"sp-detail-header"}),l=document.createElement("button");l.type="button",l.className="sp-detail-back",l.setAttribute("aria-label",this.t("detail.back")),l.appendChild(c(ye)),l.addEventListener("click",()=>{this.hide(),this.callbacks.onBack();}),this.element.appendChild(i),i.appendChild(l),this.content=o("div",{class:"sp-detail-content"}),this.element.appendChild(this.content);}colors;callbacks;element;_isVisible=false;currentFeedback=null;content;t;locale;resolveBtn=null;deleteBtn=null;isProcessing=false;show(e,n){this.currentFeedback=e,this.isProcessing=false;let s=this.element.querySelector(".sp-detail-header");if(!s)return;let r=s.querySelector(".sp-detail-back");if(!r)return;s.replaceChildren(r);let i=o("span",{class:"sp-detail-title"});a(i,this.t("detail.title").replace("{number}",String(n))),s.appendChild(i);let l=o("span",{class:"sp-badge"});l.style.background=_(e.type,this.colors),l.style.color=M(e.type,this.colors),a(l,e.type),s.appendChild(l),this.content.replaceChildren();let d=0,p=this.buildSection(d++);this.buildStatusActions(p,e),this.content.appendChild(p);let h=this.buildSection(d++),u=o("div",{class:"sp-detail-section-title"});a(u,this.t("detail.message")),h.appendChild(u);let v=o("div",{class:"sp-detail-message"});if(v.style.borderLeftColor=M(e.type,this.colors),a(v,e.message),h.appendChild(v),this.content.appendChild(h),e.screenshotUrl&&Me(e.screenshotUrl)){let g=this.buildSection(d++),x=o("div",{class:"sp-detail-section-title"});a(x,this.t("detail.screenshot")),g.appendChild(x);let b=document.createElement("img");b.className="sp-detail-screenshot",b.src=e.screenshotUrl,b.alt=this.t("detail.screenshotAlt"),b.loading="lazy",b.referrerPolicy="no-referrer",g.appendChild(b),this.content.appendChild(g);}let m=this.buildSection(d++),f=o("div",{class:"sp-detail-section-title"});if(a(f,this.t("detail.metadata")),m.appendChild(f),this.buildMetadata(m,e),this.content.appendChild(m),e.annotations.length>0){let g=this.buildSection(d++),x=o("div",{class:"sp-detail-section-title"});x.appendChild(c(D));let b=o("span");a(b,this.t("detail.annotation")),x.appendChild(b),g.appendChild(x),this.buildAnnotation(g,e),this.content.appendChild(g);}if(Fe(e.diagnostics)){let g=this.buildSection(d++),x=o("div",{class:"sp-detail-section-title"});x.appendChild(c(Ae));let b=o("span");a(b,this.t("detail.diagnostics")),x.appendChild(b),g.appendChild(x),this.buildDiagnostics(g,e),this.content.appendChild(g);}this._isVisible=true,this.element.setAttribute("aria-hidden","false"),this.element.offsetHeight,this.element.classList.add("sp-detail--visible"),requestAnimationFrame(()=>{r.focus();});}hide(){this._isVisible&&(this._isVisible=false,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 n=o("div",{class:"sp-detail-section"});return n.style.animationDelay=`${e*40}ms`,n}buildStatusActions(e,n){let s=n.status==="resolved",r=o("div",{class:"sp-detail-section-title"});a(r,this.t("detail.status")),e.appendChild(r);let i=o("div",{class:"sp-detail-status"}),l=o("span",{class:`sp-detail-status-pill ${s?"sp-detail-status-pill--resolved":"sp-detail-status-pill--open"}`}),d=o("span",{class:"sp-detail-status-dot"});d.style.background=s?"#9ca3af":"#22c55e",l.appendChild(d);let p=o("span");a(p,s?this.t("detail.reopen"):this.t("detail.resolve")),a(p,s?"Resolved":"Open"),l.appendChild(p),i.appendChild(l),e.appendChild(i);let h=o("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(c(X));let v=document.createElement("span");a(v,this.t("detail.reopen")),this.resolveBtn.appendChild(v);}else {this.resolveBtn.className="sp-detail-btn-resolve",this.resolveBtn.appendChild(c(H));let v=document.createElement("span");a(v,this.t("detail.resolve")),this.resolveBtn.appendChild(v);}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(c(Q));let u=document.createElement("span");a(u,this.t("detail.delete")),this.deleteBtn.appendChild(u),this.deleteBtn.addEventListener("click",()=>this.handleDelete()),h.appendChild(this.resolveBtn),h.appendChild(this.deleteBtn),e.appendChild(h);}buildMetadata(e,n){let s=o("div",{class:"sp-detail-meta"});if(this.addMetaRow(s,ke,this.t("detail.page"),()=>{let r=o("div",{class:"sp-detail-meta-value"}),i=Re(n.url);return a(r,A(i,60)),r.title=n.url,r}),this.addMetaRow(s,Ce,this.t("detail.author"),()=>{let r=o("div",{class:"sp-detail-meta-value"}),i=n.authorName||"Anonymous",l=n.authorEmail;return a(r,l?`${i} (${l})`:i),r}),this.addMetaRow(s,we,this.t("detail.date"),()=>{let r=o("div",{class:"sp-detail-meta-value"});return a(r,J(n.createdAt,this.locale.startsWith("fr")?"fr":"en")),r}),this.addMetaRow(s,Se,this.t("detail.viewport"),()=>{let r=o("div",{class:"sp-detail-meta-value sp-detail-meta-value--mono"});return a(r,n.viewport||"Unknown"),r}),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.t("detail.browser"),()=>{let r=o("div",{class:"sp-detail-meta-value"});return a(r,Le(n.userAgent)),r}),n.resolvedAt){let r=n.resolvedAt;this.addMetaRow(s,H,this.t("detail.resolvedAt"),()=>{let i=o("div",{class:"sp-detail-meta-value sp-detail-meta-value--secondary"});return a(i,J(r,this.locale.startsWith("fr")?"fr":"en")),i});}e.appendChild(s);}addMetaRow(e,n,s,r){let i=o("div",{class:"sp-detail-meta-row"});i.appendChild(c(n));let l=o("div",{class:"sp-detail-meta-content"}),d=o("div",{class:"sp-detail-meta-label"});a(d,s),l.appendChild(d),l.appendChild(r()),i.appendChild(l),e.appendChild(i);}buildAnnotation(e,n){let s=n.annotations[0];if(!s)return;let r=o("div",{class:"sp-detail-annotation"}),i=o("div",{class:"sp-detail-annotation-info"});this.addAnnotationRow(i,Ee,this.t("detail.element"),()=>{let p=o("span",{class:"sp-detail-annotation-value sp-detail-annotation-value--mono"}),h=s.elementId?`<${s.elementTag}#${s.elementId}>`:`<${s.elementTag}>`;return a(p,h),p}),this.addAnnotationRow(i,Te,this.t("detail.selector"),()=>{let p=o("span",{class:"sp-detail-annotation-value sp-detail-annotation-value--mono"});return a(p,A(s.cssSelector,60)),p.title=s.cssSelector,p}),this.addAnnotationRow(i,D,this.t("detail.position"),()=>{let p=o("span",{class:"sp-detail-annotation-value"});return a(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}),r.appendChild(i);let l=document.createElement("button");l.type="button",l.className="sp-detail-btn-goto",l.appendChild(c(D));let d=document.createElement("span");a(d,this.t("detail.goToAnnotation")),l.appendChild(d),l.addEventListener("click",()=>{this.currentFeedback&&this.callbacks.onGoToAnnotation(this.currentFeedback);}),r.appendChild(l),e.appendChild(r);}buildDiagnostics(e,n){let s=n.diagnostics;if(!s)return;let r=Array.isArray(s.console)?s.console:[],i=Array.isArray(s.network)?s.network:[],l=r.filter(x=>x.level==="error").length,d=o("div",{class:"sp-detail-diag"}),p=document.createElement("button");p.type="button",p.className="sp-detail-diag-toggle",p.setAttribute("aria-expanded","false"),p.setAttribute("aria-label",this.t("detail.diagnostics.expand"));let h=document.createElement("span"),u=document.createElement("span");u.style.display="inline-flex",u.style.alignItems="center",u.style.gap="8px",u.appendChild(c(Be)),a(h,this.t("detail.diagnostics")),u.appendChild(h),p.appendChild(u);let v=o("span",{class:"sp-detail-diag-counts"}),m=o("span",{class:`sp-detail-diag-count${l>0?" sp-detail-diag-count--errors":""}`});a(m,`${r.length} console`);let f=o("span",{class:`sp-detail-diag-count${i.length>0?" sp-detail-diag-count--errors":""}`});a(f,`${i.length} net`),v.appendChild(m),v.appendChild(f),p.appendChild(v);let g=o("div",{class:"sp-detail-diag-body"});if(r.length>0){let x=document.createElement("div"),b=o("div",{class:"sp-detail-diag-group-title"});a(b,this.t("detail.diagnostics.console")),x.appendChild(b);let C=document.createElement("ul");C.className="sp-detail-diag-list";for(let y of r){let k=document.createElement("li"),T=o("span",{class:`sp-detail-diag-level sp-detail-diag-level--${y.level}`});a(T,y.level);let w=o("span",{class:"sp-detail-diag-message"});a(w,A(y.message,240)),w.title=y.message,k.appendChild(T),k.appendChild(w),C.appendChild(k);}x.appendChild(C),g.appendChild(x);}if(i.length>0){let x=document.createElement("div"),b=o("div",{class:"sp-detail-diag-group-title"});a(b,this.t("detail.diagnostics.network")),x.appendChild(b);let C=document.createElement("ul");C.className="sp-detail-diag-list";for(let y of i){let k=document.createElement("li");k.classList.add("sp-detail-diag-net");let T=o("span",{class:"sp-detail-diag-net-status"});a(T,y.status===0?"ERR":String(y.status));let w=o("span",{class:"sp-detail-diag-net-method"});a(w,y.method);let L=o("span",{class:"sp-detail-diag-net-url"});a(L,A(y.url,120)),L.title=`${y.url} \u2014 ${Pe(y.durationMs)}`,k.appendChild(T),k.appendChild(w),k.appendChild(L),C.appendChild(k);}x.appendChild(C),g.appendChild(x);}p.addEventListener("click",()=>{let b=!(p.getAttribute("aria-expanded")==="true");p.setAttribute("aria-expanded",String(b)),p.setAttribute("aria-label",b?this.t("detail.diagnostics.collapse"):this.t("detail.diagnostics.expand")),g.classList.toggle("sp-detail-diag-body--open",b);}),d.appendChild(p),d.appendChild(g),e.appendChild(d);}addAnnotationRow(e,n,s,r){let i=o("div",{class:"sp-detail-annotation-row"});i.appendChild(c(n));let l=o("div",{class:"sp-detail-meta-content"}),d=o("div",{class:"sp-detail-annotation-label"});a(d,s),l.appendChild(d),l.appendChild(r()),i.appendChild(l),e.appendChild(i);}async handleResolve(){if(!(this.isProcessing||!this.currentFeedback)){this.isProcessing=true,this.resolveBtn&&this.setButtonLoading(this.resolveBtn),this.deleteBtn&&(this.deleteBtn.disabled=true);try{await this.callbacks.onResolve(this.currentFeedback);}catch{this.isProcessing=false,this.resolveBtn&&this.restoreResolveBtn(this.currentFeedback),this.deleteBtn&&(this.deleteBtn.disabled=false);}}}async handleDelete(){if(!(this.isProcessing||!this.currentFeedback)){this.isProcessing=true,this.deleteBtn&&this.setButtonLoading(this.deleteBtn),this.resolveBtn&&(this.resolveBtn.disabled=true);try{await this.callbacks.onDelete(this.currentFeedback);}catch{this.isProcessing=false,this.deleteBtn&&this.restoreDeleteBtn(),this.resolveBtn&&(this.resolveBtn.disabled=false);}}}setButtonLoading(e){e.disabled=true,e.replaceChildren(o("div",{class:"sp-spinner sp-spinner--sm"}));}restoreResolveBtn(e){if(!this.resolveBtn)return;this.resolveBtn.disabled=false,this.resolveBtn.replaceChildren();let n=e.status==="resolved";this.resolveBtn.appendChild(c(n?X:H));let s=document.createElement("span");a(s,n?this.t("detail.reopen"):this.t("detail.resolve")),this.resolveBtn.appendChild(s);}restoreDeleteBtn(){if(!this.deleteBtn)return;this.deleteBtn.disabled=false,this.deleteBtn.replaceChildren(),this.deleteBtn.appendChild(c(Q));let e=document.createElement("span");a(e,this.t("detail.delete")),this.deleteBtn.appendChild(e);}};var Oe='<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>',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="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>',Ne='<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>',ee={question:0,change:1,bug:2,other:3};function $t(t,e){let n=[...t];switch(e){case "newest":n.sort((s,r)=>new Date(r.createdAt).getTime()-new Date(s.createdAt).getTime());break;case "oldest":n.sort((s,r)=>new Date(s.createdAt).getTime()-new Date(r.createdAt).getTime());break;case "by-type":n.sort((s,r)=>{let i=ee[s.type]??99,l=ee[r.type]??99;return i!==l?i-l:new Date(r.createdAt).getTime()-new Date(s.createdAt).getTime()});break;case "open-first":n.sort((s,r)=>{let i=s.status==="open"?0:1,l=r.status==="open"?0:1;return i!==l?i-l:new Date(r.createdAt).getTime()-new Date(s.createdAt).getTime()});break}return n}function De(t){try{return new URL(t).pathname}catch{return t}}function He(t,e){if(t.length<=e)return t;let n="\u2026",s=Math.floor((e-1)/2);return t.slice(0,s)+n+t.slice(-s)}function Kt(t){let e=new Map;for(let s of t){let r=De(s.url),i=e.get(r);i?i.push(s):e.set(r,[s]);}return new Map([...e.entries()].sort((s,r)=>r[1].length-s[1].length))}function zt(t,e,n){let s=o("div",{class:"sp-group-header"});s.setAttribute("role","button"),s.setAttribute("tabindex","0"),s.setAttribute("aria-expanded","true"),s.style.borderBottomColor=n.border;let r=o("span",{class:"sp-group-header-chevron"});r.appendChild(c(Ne)),s.appendChild(r);let i=o("span",{class:"sp-group-header-icon"});i.appendChild(c(se)),s.appendChild(i);let l=o("span",{class:"sp-group-header-path"}),d=He(t,40);a(l,d),t.length>40&&(l.title=t),s.appendChild(l);let p=o("span",{class:"sp-group-header-count"});p.style.background=n.accentLight,p.style.color=n.accent,a(p,String(e)),s.appendChild(p);let h=()=>{let u=s.getAttribute("aria-expanded")==="true";s.setAttribute("aria-expanded",String(!u)),s.classList.toggle("sp-group-header--collapsed",u);let v=s.nextElementSibling;v?.classList.contains("sp-group-content")&&v.classList.toggle("sp-group-content--collapsed",u);};return s.addEventListener("click",h),s.addEventListener("keydown",u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),h());}),s}var te=class{element;_sortMode="newest";_groupByPage=false;menuEl=null;sortBtn;groupToggle;t;colors;onChange;outsideClickHandler=null;constructor(e,n,s){this.colors=e,this.onChange=n,this.t=s,this.element=o("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.t("sort.label"));let r=c(Oe);this.sortBtn.appendChild(r);let i=o("span",{class:"sp-sort-btn-label"});a(i,this.t("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 l=c(se);this.groupToggle.appendChild(l);let d=o("span",{class:"sp-group-toggle-label"});a(d,this.t("group.byPage")),this.groupToggle.appendChild(d),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=o("div",{class:"sp-sort-menu"}),this.menuEl.setAttribute("role","listbox"),this.menuEl.setAttribute("aria-label",this.t("sort.label")),this.sortBtn.setAttribute("aria-expanded","true");let e=[{mode:"newest",label:this.t("sort.newest")},{mode:"oldest",label:this.t("sort.oldest")},{mode:"by-type",label:this.t("sort.byType")},{mode:"open-first",label:this.t("sort.openFirst")}];for(let n of e){let s=document.createElement("button");s.className=`sp-sort-option${n.mode===this._sortMode?" sp-sort-option--active":""}`,s.setAttribute("role","option"),s.setAttribute("aria-selected",String(n.mode===this._sortMode)),n.mode===this._sortMode&&(s.style.background=this.colors.accentLight,s.style.color=this.colors.accent),a(s,n.label),s.addEventListener("click",r=>{r.stopPropagation(),this._sortMode=n.mode,this.updateSortLabel(),this.closeMenu(),this.onChange();}),this.menuEl.appendChild(s);}this.element.appendChild(this.menuEl),requestAnimationFrame(()=>{this.outsideClickHandler=n=>{this.menuEl&&!this.element.contains(n.target)&&this.closeMenu();},document.addEventListener("click",this.outsideClickHandler,true);}),this.menuEl.addEventListener("keydown",n=>{n.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,true),this.outsideClickHandler=null);}updateSortLabel(){let e={newest:this.t("sort.newest"),oldest:this.t("sort.oldest"),"by-type":this.t("sort.byType"),"open-first":this.t("sort.openFirst")},n=this.sortBtn.querySelector(".sp-sort-btn-label");n&&a(n,e[this._sortMode]);}destroy(){this.closeMenu();}},Ut=`
1168
+ `;function Le(t){if(/Edg\//i.test(t)){let e=t.match(/Edg\/([\d.]+)/);return e?`Edge ${e[1]}`:"Edge"}if(/OPR\//i.test(t)||/Opera/i.test(t)){let e=t.match(/OPR\/([\d.]+)/);return e?`Opera ${e[1]}`:"Opera"}if(/Firefox\//i.test(t)){let e=t.match(/Firefox\/([\d.]+)/);return e?`Firefox ${e[1]}`:"Firefox"}if(/Chrome\//i.test(t)&&!/Chromium/i.test(t)){let e=t.match(/Chrome\/([\d.]+)/);return e?`Chrome ${e[1]}`:"Chrome"}if(/Safari\//i.test(t)&&!/Chrome/i.test(t)){let e=t.match(/Version\/([\d.]+)/);return e?`Safari ${e[1]}`:"Safari"}return "Unknown"}function J(t,e){try{return new Date(t).toLocaleString(e,{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return t}}function Re(t){try{return new URL(t).pathname}catch{return t}}function Me(t){return !!(/^data:image\/(jpeg|png|webp);/i.test(t)||/^https:\/\//i.test(t))}function A(t,e){return t.length<=e?t:t.slice(0,e-1)+"\u2026"}function Fe(t){if(!t)return false;let e=Array.isArray(t.console)?t.console.length:0,n=Array.isArray(t.network)?t.network.length:0;return e>0||n>0}function Pe(t){return !Number.isFinite(t)||t<0?"\u2014":t<1e3?`${Math.round(t)} ms`:`${(t/1e3).toFixed(1)} s`}var Z=class{constructor(e,n,s,r){this.colors=e;this.callbacks=n;this.t=s,this.locale=r,this.element=o("div",{class:"sp-detail"}),this.element.setAttribute("role","dialog"),this.element.setAttribute("aria-label","Feedback detail"),this.element.setAttribute("aria-hidden","true");let i=o("div",{class:"sp-detail-header"}),l=document.createElement("button");l.type="button",l.className="sp-detail-back",l.setAttribute("aria-label",this.t("detail.back")),l.appendChild(c(ye)),l.addEventListener("click",()=>{this.hide(),this.callbacks.onBack();}),this.element.appendChild(i),i.appendChild(l),this.content=o("div",{class:"sp-detail-content"}),this.element.appendChild(this.content);}colors;callbacks;element;_isVisible=false;currentFeedback=null;content;t;locale;resolveBtn=null;deleteBtn=null;isProcessing=false;show(e,n){this.currentFeedback=e,this.isProcessing=false;let s=this.element.querySelector(".sp-detail-header");if(!s)return;let r=s.querySelector(".sp-detail-back");if(!r)return;s.replaceChildren(r);let i=o("span",{class:"sp-detail-title"});a(i,this.t("detail.title").replace("{number}",String(n))),s.appendChild(i);let l=o("span",{class:"sp-badge"});l.style.background=_(e.type,this.colors),l.style.color=M(e.type,this.colors),a(l,e.type),s.appendChild(l),this.content.replaceChildren();let d=0,p=this.buildSection(d++);this.buildStatusActions(p,e),this.content.appendChild(p);let h=this.buildSection(d++),u=o("div",{class:"sp-detail-section-title"});a(u,this.t("detail.message")),h.appendChild(u);let v=o("div",{class:"sp-detail-message"});if(v.style.borderLeftColor=M(e.type,this.colors),a(v,e.message),h.appendChild(v),this.content.appendChild(h),e.screenshotUrl&&Me(e.screenshotUrl)){let g=this.buildSection(d++),x=o("div",{class:"sp-detail-section-title"});a(x,this.t("detail.screenshot")),g.appendChild(x);let b=document.createElement("img");b.className="sp-detail-screenshot",b.src=e.screenshotUrl,b.alt=this.t("detail.screenshotAlt"),b.loading="lazy",b.referrerPolicy="no-referrer",g.appendChild(b),this.content.appendChild(g);}let m=this.buildSection(d++),f=o("div",{class:"sp-detail-section-title"});if(a(f,this.t("detail.metadata")),m.appendChild(f),this.buildMetadata(m,e),this.content.appendChild(m),e.annotations.length>0){let g=this.buildSection(d++),x=o("div",{class:"sp-detail-section-title"});x.appendChild(c(D));let b=o("span");a(b,this.t("detail.annotation")),x.appendChild(b),g.appendChild(x),this.buildAnnotation(g,e),this.content.appendChild(g);}if(Fe(e.diagnostics)){let g=this.buildSection(d++),x=o("div",{class:"sp-detail-section-title"});x.appendChild(c(Ae));let b=o("span");a(b,this.t("detail.diagnostics")),x.appendChild(b),g.appendChild(x),this.buildDiagnostics(g,e),this.content.appendChild(g);}this._isVisible=true,this.element.setAttribute("aria-hidden","false"),this.element.offsetHeight,this.element.classList.add("sp-detail--visible"),requestAnimationFrame(()=>{r.focus();});}hide(){this._isVisible&&(this._isVisible=false,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 n=o("div",{class:"sp-detail-section"});return n.style.animationDelay=`${e*40}ms`,n}buildStatusActions(e,n){let s=n.status==="resolved",r=o("div",{class:"sp-detail-section-title"});a(r,this.t("detail.status")),e.appendChild(r);let i=o("div",{class:"sp-detail-status"}),l=o("span",{class:`sp-detail-status-pill ${s?"sp-detail-status-pill--resolved":"sp-detail-status-pill--open"}`}),d=o("span",{class:"sp-detail-status-dot"});d.style.background=s?"#9ca3af":"#22c55e",l.appendChild(d);let p=o("span");a(p,s?this.t("detail.reopen"):this.t("detail.resolve")),a(p,s?"Resolved":"Open"),l.appendChild(p),i.appendChild(l),e.appendChild(i);let h=o("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(c(X));let v=document.createElement("span");a(v,this.t("detail.reopen")),this.resolveBtn.appendChild(v);}else {this.resolveBtn.className="sp-detail-btn-resolve",this.resolveBtn.appendChild(c(H));let v=document.createElement("span");a(v,this.t("detail.resolve")),this.resolveBtn.appendChild(v);}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(c(Q));let u=document.createElement("span");a(u,this.t("detail.delete")),this.deleteBtn.appendChild(u),this.deleteBtn.addEventListener("click",()=>this.handleDelete()),h.appendChild(this.resolveBtn),h.appendChild(this.deleteBtn),e.appendChild(h);}buildMetadata(e,n){let s=o("div",{class:"sp-detail-meta"});if(this.addMetaRow(s,ke,this.t("detail.page"),()=>{let r=o("div",{class:"sp-detail-meta-value"}),i=Re(n.url);return a(r,A(i,60)),r.title=n.url,r}),this.addMetaRow(s,Ce,this.t("detail.author"),()=>{let r=o("div",{class:"sp-detail-meta-value"}),i=n.authorName||"Anonymous",l=n.authorEmail;return a(r,l?`${i} (${l})`:i),r}),this.addMetaRow(s,we,this.t("detail.date"),()=>{let r=o("div",{class:"sp-detail-meta-value"});return a(r,J(n.createdAt,this.locale.startsWith("fr")?"fr":"en")),r}),this.addMetaRow(s,Se,this.t("detail.viewport"),()=>{let r=o("div",{class:"sp-detail-meta-value sp-detail-meta-value--mono"});return a(r,n.viewport||"Unknown"),r}),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.t("detail.browser"),()=>{let r=o("div",{class:"sp-detail-meta-value"});return a(r,Le(n.userAgent)),r}),n.resolvedAt){let r=n.resolvedAt;this.addMetaRow(s,H,this.t("detail.resolvedAt"),()=>{let i=o("div",{class:"sp-detail-meta-value sp-detail-meta-value--secondary"});return a(i,J(r,this.locale.startsWith("fr")?"fr":"en")),i});}e.appendChild(s);}addMetaRow(e,n,s,r){let i=o("div",{class:"sp-detail-meta-row"});i.appendChild(c(n));let l=o("div",{class:"sp-detail-meta-content"}),d=o("div",{class:"sp-detail-meta-label"});a(d,s),l.appendChild(d),l.appendChild(r()),i.appendChild(l),e.appendChild(i);}buildAnnotation(e,n){let s=n.annotations[0];if(!s)return;let r=o("div",{class:"sp-detail-annotation"}),i=o("div",{class:"sp-detail-annotation-info"});this.addAnnotationRow(i,Ee,this.t("detail.element"),()=>{let p=o("span",{class:"sp-detail-annotation-value sp-detail-annotation-value--mono"}),h=s.elementId?`<${s.elementTag}#${s.elementId}>`:`<${s.elementTag}>`;return a(p,h),p}),this.addAnnotationRow(i,Te,this.t("detail.selector"),()=>{let p=o("span",{class:"sp-detail-annotation-value sp-detail-annotation-value--mono"});return a(p,A(s.cssSelector,60)),p.title=s.cssSelector,p}),this.addAnnotationRow(i,D,this.t("detail.position"),()=>{let p=o("span",{class:"sp-detail-annotation-value"});return a(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}),r.appendChild(i);let l=document.createElement("button");l.type="button",l.className="sp-detail-btn-goto",l.appendChild(c(D));let d=document.createElement("span");a(d,this.t("detail.goToAnnotation")),l.appendChild(d),l.addEventListener("click",()=>{this.currentFeedback&&this.callbacks.onGoToAnnotation(this.currentFeedback);}),r.appendChild(l),e.appendChild(r);}buildDiagnostics(e,n){let s=n.diagnostics;if(!s)return;let r=Array.isArray(s.console)?s.console:[],i=Array.isArray(s.network)?s.network:[],l=r.filter(x=>x.level==="error").length,d=o("div",{class:"sp-detail-diag"}),p=document.createElement("button");p.type="button",p.className="sp-detail-diag-toggle",p.setAttribute("aria-expanded","false"),p.setAttribute("aria-label",this.t("detail.diagnostics.expand"));let h=document.createElement("span"),u=document.createElement("span");u.style.display="inline-flex",u.style.alignItems="center",u.style.gap="8px",u.appendChild(c(Be)),a(h,this.t("detail.diagnostics")),u.appendChild(h),p.appendChild(u);let v=o("span",{class:"sp-detail-diag-counts"}),m=o("span",{class:`sp-detail-diag-count${l>0?" sp-detail-diag-count--errors":""}`});a(m,`${r.length} console`);let f=o("span",{class:`sp-detail-diag-count${i.length>0?" sp-detail-diag-count--errors":""}`});a(f,`${i.length} net`),v.appendChild(m),v.appendChild(f),p.appendChild(v);let g=o("div",{class:"sp-detail-diag-body"});if(r.length>0){let x=document.createElement("div"),b=o("div",{class:"sp-detail-diag-group-title"});a(b,this.t("detail.diagnostics.console")),x.appendChild(b);let C=document.createElement("ul");C.className="sp-detail-diag-list";for(let y of r){let k=document.createElement("li"),T=o("span",{class:`sp-detail-diag-level sp-detail-diag-level--${y.level}`});a(T,y.level);let w=o("span",{class:"sp-detail-diag-message"});a(w,A(y.message,240)),w.title=y.message,k.appendChild(T),k.appendChild(w),C.appendChild(k);}x.appendChild(C),g.appendChild(x);}if(i.length>0){let x=document.createElement("div"),b=o("div",{class:"sp-detail-diag-group-title"});a(b,this.t("detail.diagnostics.network")),x.appendChild(b);let C=document.createElement("ul");C.className="sp-detail-diag-list";for(let y of i){let k=document.createElement("li");k.classList.add("sp-detail-diag-net");let T=o("span",{class:"sp-detail-diag-net-status"});a(T,y.status===0?"ERR":String(y.status));let w=o("span",{class:"sp-detail-diag-net-method"});a(w,y.method);let L=o("span",{class:"sp-detail-diag-net-url"});a(L,A(y.url,120)),L.title=`${y.url} \u2014 ${Pe(y.durationMs)}`,k.appendChild(T),k.appendChild(w),k.appendChild(L),C.appendChild(k);}x.appendChild(C),g.appendChild(x);}p.addEventListener("click",()=>{let b=!(p.getAttribute("aria-expanded")==="true");p.setAttribute("aria-expanded",String(b)),p.setAttribute("aria-label",b?this.t("detail.diagnostics.collapse"):this.t("detail.diagnostics.expand")),g.classList.toggle("sp-detail-diag-body--open",b);}),d.appendChild(p),d.appendChild(g),e.appendChild(d);}addAnnotationRow(e,n,s,r){let i=o("div",{class:"sp-detail-annotation-row"});i.appendChild(c(n));let l=o("div",{class:"sp-detail-meta-content"}),d=o("div",{class:"sp-detail-annotation-label"});a(d,s),l.appendChild(d),l.appendChild(r()),i.appendChild(l),e.appendChild(i);}async handleResolve(){if(!(this.isProcessing||!this.currentFeedback)){this.isProcessing=true,this.resolveBtn&&this.setButtonLoading(this.resolveBtn),this.deleteBtn&&(this.deleteBtn.disabled=true);try{await this.callbacks.onResolve(this.currentFeedback);}catch{this.isProcessing=false,this.resolveBtn&&this.restoreResolveBtn(this.currentFeedback),this.deleteBtn&&(this.deleteBtn.disabled=false);}}}async handleDelete(){if(!(this.isProcessing||!this.currentFeedback)){this.isProcessing=true,this.deleteBtn&&this.setButtonLoading(this.deleteBtn),this.resolveBtn&&(this.resolveBtn.disabled=true);try{await this.callbacks.onDelete(this.currentFeedback);}catch{this.isProcessing=false,this.deleteBtn&&this.restoreDeleteBtn(),this.resolveBtn&&(this.resolveBtn.disabled=false);}}}setButtonLoading(e){e.disabled=true,e.replaceChildren(o("div",{class:"sp-spinner sp-spinner--sm"}));}restoreResolveBtn(e){if(!this.resolveBtn)return;this.resolveBtn.disabled=false,this.resolveBtn.replaceChildren();let n=e.status==="resolved";this.resolveBtn.appendChild(c(n?X:H));let s=document.createElement("span");a(s,n?this.t("detail.reopen"):this.t("detail.resolve")),this.resolveBtn.appendChild(s);}restoreDeleteBtn(){if(!this.deleteBtn)return;this.deleteBtn.disabled=false,this.deleteBtn.replaceChildren(),this.deleteBtn.appendChild(c(Q));let e=document.createElement("span");a(e,this.t("detail.delete")),this.deleteBtn.appendChild(e);}};var Oe='<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>',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="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>',Ne='<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>',ee={question:0,change:1,bug:2,other:3};function $t(t,e){let n=[...t];switch(e){case "newest":n.sort((s,r)=>new Date(r.createdAt).getTime()-new Date(s.createdAt).getTime());break;case "oldest":n.sort((s,r)=>new Date(s.createdAt).getTime()-new Date(r.createdAt).getTime());break;case "by-type":n.sort((s,r)=>{let i=ee[s.type]??99,l=ee[r.type]??99;return i!==l?i-l:new Date(r.createdAt).getTime()-new Date(s.createdAt).getTime()});break;case "open-first":n.sort((s,r)=>{let i=s.status==="open"?0:1,l=r.status==="open"?0:1;return i!==l?i-l:new Date(r.createdAt).getTime()-new Date(s.createdAt).getTime()});break}return n}function De(t){try{return new URL(t).pathname}catch{return t}}function He(t,e){if(t.length<=e)return t;let n="\u2026",s=Math.floor((e-1)/2);return t.slice(0,s)+n+t.slice(-s)}function zt(t){let e=new Map;for(let s of t){let r=De(s.url),i=e.get(r);i?i.push(s):e.set(r,[s]);}return new Map([...e.entries()].sort((s,r)=>r[1].length-s[1].length))}function Kt(t,e,n){let s=o("div",{class:"sp-group-header"});s.setAttribute("role","button"),s.setAttribute("tabindex","0"),s.setAttribute("aria-expanded","true"),s.style.borderBottomColor=n.border;let r=o("span",{class:"sp-group-header-chevron"});r.appendChild(c(Ne)),s.appendChild(r);let i=o("span",{class:"sp-group-header-icon"});i.appendChild(c(se)),s.appendChild(i);let l=o("span",{class:"sp-group-header-path"}),d=He(t,40);a(l,d),t.length>40&&(l.title=t),s.appendChild(l);let p=o("span",{class:"sp-group-header-count"});p.style.background=n.accentLight,p.style.color=n.accent,a(p,String(e)),s.appendChild(p);let h=()=>{let u=s.getAttribute("aria-expanded")==="true";s.setAttribute("aria-expanded",String(!u)),s.classList.toggle("sp-group-header--collapsed",u);let v=s.nextElementSibling;v?.classList.contains("sp-group-content")&&v.classList.toggle("sp-group-content--collapsed",u);};return s.addEventListener("click",h),s.addEventListener("keydown",u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),h());}),s}var te=class{element;_sortMode="newest";_groupByPage=false;menuEl=null;sortBtn;groupToggle;t;colors;onChange;outsideClickHandler=null;constructor(e,n,s){this.colors=e,this.onChange=n,this.t=s,this.element=o("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.t("sort.label"));let r=c(Oe);this.sortBtn.appendChild(r);let i=o("span",{class:"sp-sort-btn-label"});a(i,this.t("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 l=c(se);this.groupToggle.appendChild(l);let d=o("span",{class:"sp-group-toggle-label"});a(d,this.t("group.byPage")),this.groupToggle.appendChild(d),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=o("div",{class:"sp-sort-menu"}),this.menuEl.setAttribute("role","listbox"),this.menuEl.setAttribute("aria-label",this.t("sort.label")),this.sortBtn.setAttribute("aria-expanded","true");let e=[{mode:"newest",label:this.t("sort.newest")},{mode:"oldest",label:this.t("sort.oldest")},{mode:"by-type",label:this.t("sort.byType")},{mode:"open-first",label:this.t("sort.openFirst")}];for(let n of e){let s=document.createElement("button");s.className=`sp-sort-option${n.mode===this._sortMode?" sp-sort-option--active":""}`,s.setAttribute("role","option"),s.setAttribute("aria-selected",String(n.mode===this._sortMode)),n.mode===this._sortMode&&(s.style.background=this.colors.accentLight,s.style.color=this.colors.accent),a(s,n.label),s.addEventListener("click",r=>{r.stopPropagation(),this._sortMode=n.mode,this.updateSortLabel(),this.closeMenu(),this.onChange();}),this.menuEl.appendChild(s);}this.element.appendChild(this.menuEl),requestAnimationFrame(()=>{this.outsideClickHandler=n=>{this.menuEl&&!this.element.contains(n.target)&&this.closeMenu();},document.addEventListener("click",this.outsideClickHandler,true);}),this.menuEl.addEventListener("keydown",n=>{n.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,true),this.outsideClickHandler=null);}updateSortLabel(){let e={newest:this.t("sort.newest"),oldest:this.t("sort.oldest"),"by-type":this.t("sort.byType"),"open-first":this.t("sort.openFirst")},n=this.sortBtn.querySelector(".sp-sort-btn-label");n&&a(n,e[this._sortMode]);}destroy(){this.closeMenu();}},Ut=`
1169
1169
  /* ============================
1170
1170
  Sort Controls Container
1171
1171
  ============================ */
@@ -1780,5 +1780,5 @@ function c(t){let s=document.createRange().createContextualFragment(t).firstElem
1780
1780
  transition-duration: 0.01ms !important;
1781
1781
  }
1782
1782
  }
1783
- `,_e='<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>',re=class{constructor(e,n,s){this.t=s;this.keyMap=new Map([["j",()=>n.onNavigate("down")],["k",()=>n.onNavigate("up")],["r",()=>n.onResolve()],["d",()=>n.onDelete()],["f",()=>n.onFocusSearch()],["/",()=>n.onFocusSearch()],["x",()=>n.onToggleSelect()],["?",()=>this.toggleHelp()]]),this.helpOverlay=this.buildOverlay(),this.hintButton=this.buildHintButton(),this.boundHandler=r=>this.handleKeydown(r);}t;helpOverlay;hintButton;keyMap;boundHandler;shadowRoot=null;enabled=false;helpVisible=false;destroyed=false;enable(e){if(this.destroyed||this.enabled)return;e&&(this.shadowRoot=e),(this.shadowRoot??document).addEventListener("keydown",this.boundHandler),this.enabled=true;}disable(){if(!this.enabled)return;(this.shadowRoot??document).removeEventListener("keydown",this.boundHandler),this.enabled=false,this.helpVisible&&this.hideHelp();}toggleHelp(){this.helpVisible?this.hideHelp():this.showHelp();}destroy(){this.destroyed||(this.disable(),this.helpOverlay.remove(),this.hintButton.remove(),this.destroyed=true);}handleKeydown(e){if(e.key==="Escape"){this.helpVisible&&(e.preventDefault(),e.stopPropagation(),this.hideHelp());return}if(this.helpVisible)return;let n=e.composedPath()[0];if(n){let r=n.tagName?.toLowerCase();if(r==="input"||r==="textarea"||r==="select"||n.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=true,this.helpOverlay.classList.add("sp-shortcuts-overlay--visible"),this.helpOverlay.querySelector(".sp-shortcuts-close")?.focus();}hideHelp(){this.helpVisible=false,this.helpOverlay.classList.remove("sp-shortcuts-overlay--visible");}buildOverlay(){let e=o("div",{class:"sp-shortcuts-overlay"});e.setAttribute("role","dialog"),e.setAttribute("aria-modal","true"),e.setAttribute("aria-label",this.t("shortcuts.title")),e.addEventListener("click",d=>{d.target===e&&this.hideHelp();});let n=o("div",{class:"sp-shortcuts-card"}),s=o("div",{class:"sp-shortcuts-title"});s.appendChild(c(Ie));let r=o("span");a(r,this.t("shortcuts.title")),s.appendChild(r),n.appendChild(s);let i=document.createElement("button");i.className="sp-shortcuts-close",i.setAttribute("aria-label",this.t("shortcuts.close")),i.appendChild(c(_e)),i.addEventListener("click",()=>this.hideHelp()),n.appendChild(i);let l=o("div",{class:"sp-shortcuts-grid"});for(let d of je){let p=o("div",{class:"sp-shortcuts-row"}),h=o("div",{class:"sp-shortcuts-keys"});d.keys.forEach((v,m)=>{if(m>0){let g=o("span",{class:"sp-shortcuts-separator"});a(g,"/"),h.appendChild(g);}let f=o("span",{class:"sp-kbd"});a(f,v),h.appendChild(f);});let u=o("span",{class:"sp-shortcuts-desc"});a(u,this.t(d.label)),p.appendChild(h),p.appendChild(u),l.appendChild(p);}return n.appendChild(l),e.appendChild(n),e}buildHintButton(){let e=document.createElement("button");return e.className="sp-shortcuts-hint",e.setAttribute("aria-label",this.t("shortcuts.hint")),a(e,"?"),e.addEventListener("click",n=>{n.stopPropagation(),this.toggleHelp();}),e}};export{S as A,F as B,P as C,O as D,ce as E,ue as F,Tt as G,Bt as H,At as I,Mt as J,G as K,Ot as L,W as M,It as N,Z as O,$t as P,Kt as Q,zt as R,te as S,Ut as T,Gt as U,ne as V,Xt as W,Qt as X,Jt as Y,re as Z,c as a,o as b,a as c,R as d,$e as e,ze as f,Ue as g,Ve as h,Ye as i,Ge as j,qe as k,We as l,Xe as m,Qe as n,Je as o,Ze as p,et as q,tt as r,st as s,nt as t,rt as u,ot as v,at as w,M as x,_ as y,lt as z};//# sourceMappingURL=chunk-EF2HNCBX.js.map
1784
- //# sourceMappingURL=chunk-EF2HNCBX.js.map
1783
+ `,_e='<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>',re=class{constructor(e,n,s){this.t=s;this.keyMap=new Map([["j",()=>n.onNavigate("down")],["k",()=>n.onNavigate("up")],["r",()=>n.onResolve()],["d",()=>n.onDelete()],["f",()=>n.onFocusSearch()],["/",()=>n.onFocusSearch()],["x",()=>n.onToggleSelect()],["?",()=>this.toggleHelp()]]),this.helpOverlay=this.buildOverlay(),this.hintButton=this.buildHintButton(),this.boundHandler=r=>this.handleKeydown(r);}t;helpOverlay;hintButton;keyMap;boundHandler;shadowRoot=null;enabled=false;helpVisible=false;destroyed=false;enable(e){if(this.destroyed||this.enabled)return;e&&(this.shadowRoot=e),(this.shadowRoot??document).addEventListener("keydown",this.boundHandler),this.enabled=true;}disable(){if(!this.enabled)return;(this.shadowRoot??document).removeEventListener("keydown",this.boundHandler),this.enabled=false,this.helpVisible&&this.hideHelp();}toggleHelp(){this.helpVisible?this.hideHelp():this.showHelp();}destroy(){this.destroyed||(this.disable(),this.helpOverlay.remove(),this.hintButton.remove(),this.destroyed=true);}handleKeydown(e){if(e.key==="Escape"){this.helpVisible&&(e.preventDefault(),e.stopPropagation(),this.hideHelp());return}if(this.helpVisible)return;let n=e.composedPath()[0];if(n){let r=n.tagName?.toLowerCase();if(r==="input"||r==="textarea"||r==="select"||n.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=true,this.helpOverlay.classList.add("sp-shortcuts-overlay--visible"),this.helpOverlay.querySelector(".sp-shortcuts-close")?.focus();}hideHelp(){this.helpVisible=false,this.helpOverlay.classList.remove("sp-shortcuts-overlay--visible");}buildOverlay(){let e=o("div",{class:"sp-shortcuts-overlay"});e.setAttribute("role","dialog"),e.setAttribute("aria-modal","true"),e.setAttribute("aria-label",this.t("shortcuts.title")),e.addEventListener("click",d=>{d.target===e&&this.hideHelp();});let n=o("div",{class:"sp-shortcuts-card"}),s=o("div",{class:"sp-shortcuts-title"});s.appendChild(c(Ie));let r=o("span");a(r,this.t("shortcuts.title")),s.appendChild(r),n.appendChild(s);let i=document.createElement("button");i.className="sp-shortcuts-close",i.setAttribute("aria-label",this.t("shortcuts.close")),i.appendChild(c(_e)),i.addEventListener("click",()=>this.hideHelp()),n.appendChild(i);let l=o("div",{class:"sp-shortcuts-grid"});for(let d of je){let p=o("div",{class:"sp-shortcuts-row"}),h=o("div",{class:"sp-shortcuts-keys"});d.keys.forEach((v,m)=>{if(m>0){let g=o("span",{class:"sp-shortcuts-separator"});a(g,"/"),h.appendChild(g);}let f=o("span",{class:"sp-kbd"});a(f,v),h.appendChild(f);});let u=o("span",{class:"sp-shortcuts-desc"});a(u,this.t(d.label)),p.appendChild(h),p.appendChild(u),l.appendChild(p);}return n.appendChild(l),e.appendChild(n),e}buildHintButton(){let e=document.createElement("button");return e.className="sp-shortcuts-hint",e.setAttribute("aria-label",this.t("shortcuts.hint")),a(e,"?"),e.addEventListener("click",n=>{n.stopPropagation(),this.toggleHelp();}),e}};export{S as A,F as B,P as C,O as D,ce as E,ue as F,Tt as G,Bt as H,At as I,Mt as J,G as K,Ot as L,W as M,It as N,Z as O,$t as P,zt as Q,Kt as R,te as S,Ut as T,Gt as U,ne as V,Xt as W,Qt as X,Jt as Y,re as Z,c as a,o as b,a as c,R as d,$e as e,Ke as f,Ue as g,Ve as h,Ye as i,Ge as j,qe as k,We as l,Xe as m,Qe as n,Je as o,Ze as p,et as q,tt as r,st as s,nt as t,rt as u,ot as v,at as w,M as x,_ as y,lt as z};//# sourceMappingURL=chunk-VC52F5JZ.js.map
1784
+ //# sourceMappingURL=chunk-VC52F5JZ.js.map