@siteping/widget 0.10.7 → 0.10.8
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/{chunk-7ZBKJ6NW.js → chunk-4CK3N4YE.js} +11 -11
- package/dist/chunk-4CK3N4YE.js.map +1 -0
- package/dist/{chunk-GKRKCSID.cjs → chunk-BJFC7TVL.cjs} +11 -11
- package/dist/chunk-BJFC7TVL.cjs.map +1 -0
- package/dist/{chunk-NVNA5AI2.cjs → chunk-EYISG4OI.js} +11 -11
- package/dist/chunk-EYISG4OI.js.map +1 -0
- package/dist/{chunk-FDQWFGRR.js → chunk-OK2KX3KN.cjs} +11 -11
- package/dist/chunk-OK2KX3KN.cjs.map +1 -0
- package/dist/email.d.cts +19 -0
- package/dist/email.d.ts +19 -0
- package/dist/filters.d.cts +29 -4
- package/dist/filters.d.ts +29 -4
- package/dist/index.cjs +50 -50
- package/dist/index.cjs.map +1 -1
- package/dist/index.global.js +46 -46
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +51 -51
- package/dist/index.js.map +1 -1
- package/dist/panel-KCYUMYAI.cjs +2 -0
- package/dist/{panel-M2QKMFYO.cjs.map → panel-KCYUMYAI.cjs.map} +1 -1
- package/dist/panel-KV2AQHC2.js +2 -0
- package/dist/{panel-FUPBUN6F.js.map → panel-KV2AQHC2.js.map} +1 -1
- package/dist/panel-LYS3425X.cjs +2 -0
- package/dist/{panel-XUTDVTAR.cjs.map → panel-LYS3425X.cjs.map} +1 -1
- package/dist/panel-W2LHYGFS.js +2 -0
- package/dist/{panel-7URHNKQH.js.map → panel-W2LHYGFS.js.map} +1 -1
- package/dist/react.cjs +42 -42
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +46 -46
- package/dist/react.js.map +1 -1
- package/dist/siteping-core.d.cts +3 -2
- package/dist/siteping-core.d.ts +3 -2
- package/dist/store-helpers.d.cts +13 -4
- package/dist/store-helpers.d.ts +13 -4
- package/dist/types.d.cts +2 -2
- package/dist/types.d.ts +2 -2
- package/package.json +4 -4
- package/dist/chunk-7ZBKJ6NW.js.map +0 -1
- package/dist/chunk-FDQWFGRR.js.map +0 -1
- package/dist/chunk-GKRKCSID.cjs.map +0 -1
- package/dist/chunk-NVNA5AI2.cjs.map +0 -1
- package/dist/panel-7URHNKQH.js +0 -2
- package/dist/panel-FUPBUN6F.js +0 -2
- package/dist/panel-M2QKMFYO.cjs +0 -2
- package/dist/panel-XUTDVTAR.cjs +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function c(t){let n=document.createRange().createContextualFragment(t).firstElementChild;if(n?.nodeName.toLowerCase()!=="svg")throw new Error("[siteping] Invalid SVG string");for(let r of [...n.attributes])r.name.startsWith("on")&&n.removeAttribute(r.name);for(let r of n.querySelectorAll("*"))for(let o of [...r.attributes])o.name.startsWith("on")&&r.removeAttribute(o.name);return n}function i(t,e){let s=document.createElement(t);if(e)for(let[n,r]of Object.entries(e))n==="class"?s.className=r:n==="style"?s.style.cssText=r:s.setAttribute(n,r);return s}function l(t,e){t.textContent=e;}function O(t){let e=Array.from(t.childNodes).map(s=>s.cloneNode(true));return t.disabled=true,t.replaceChildren(i("div",{class:"sp-spinner sp-spinner--sm"})),()=>{t.replaceChildren(...e),t.disabled=false;}}function Xe(t,e="en"){let s=Date.now()-new Date(t).getTime(),n=Math.floor(s/1e3);if(n<60)return new Intl.RelativeTimeFormat(e,{numeric:"auto"}).format(0,"second");let r=new Intl.RelativeTimeFormat(e,{numeric:"always",style:"narrow"}),o=Math.floor(n/60);if(o<60)return r.format(-o,"minute");let a=Math.floor(o/60);if(a<24)return r.format(-a,"hour");let p=Math.floor(a/24);return p<7?r.format(-p,"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>',et='<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>',tt='<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>',st='<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>',nt='<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>',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="20 6 9 17 4 12"/></svg>',ot='<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>',it='<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>',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="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>',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="12" cy="12" r="1"/><circle cx="19" cy="12" r="1"/><circle cx="5" cy="12" r="1"/></svg>',pt='<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>',dt='<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>',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="6 9 12 15 18 9"/></svg>',ut='<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>',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="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>',gt='<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>',bt='<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 V="#0066ff",ce=/^#[0-9a-fA-F]{6}$/,U=/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/,ue=/^#[0-9a-fA-F]{8}$/;function he(t){if(ce.test(t))return t;let e=U.test(t)?t.match(U):null;return e?`#${e[1]}${e[1]}${e[2]}${e[2]}${e[3]}${e[3]}`:ue.test(t)?t.slice(0,7):(console.warn(`[siteping] Invalid accentColor "${t}" \u2014 only hex colors (#RGB, #RRGGBB, #RRGGBBAA) are supported. Using default.`),V)}function ge(t,e){let s=Math.max(0,Math.round(parseInt(t.slice(1,3),16)*(1-e))),n=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 `#${s.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}${r.toString(16).padStart(2,"0")}`}function be(){return typeof window>"u"?false:window.matchMedia("(prefers-color-scheme: dark)").matches}function xe(t){return t==="dark"||t==="auto"&&be()?"dark":"light"}function ft(t=V,e){let s=he(t),n=ge(s,.15);return xe(e)==="dark"?{accent:s,accentLight:s+"22",accentDark:n,accentGlow:s+"44",accentGradient:`linear-gradient(135deg, ${s}, ${n})`,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)",statusInProgress:"#fbbf24",statusInProgressBg:"rgba(245, 158, 11, 0.15)",statusWontFix:"#94a3b8",statusWontFixBg:"rgba(148, 163, 184, 0.15)"}:{accent:s,accentLight:s+"14",accentDark:n,accentGlow:s+"33",accentGradient:`linear-gradient(135deg, ${s}, ${n})`,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",statusInProgress:"#d97706",statusInProgressBg:"#fffbeb",statusWontFix:"#64748b",statusWontFixBg:"#f1f5f9"}}function D(t,e){switch(t){case "question":return e.typeQuestion;case "change":return e.typeChange;case "bug":return e.typeBug;default:return e.typeOther}}function vt(t,e){switch(t){case "in_progress":return e.statusInProgress;case "resolved":return e.statusResolved;case "wont_fix":return e.statusWontFix;default:return e.statusOpen}}function mt(t,e){switch(t){case "in_progress":return e.statusInProgressBg;case "resolved":return e.statusResolvedBg;case "wont_fix":return e.statusWontFixBg;default:return e.statusOpenBg}}function Y(t,e){switch(t){case "question":return e.typeQuestionBg;case "change":return e.typeChangeBg;case "bug":return e.typeBugBg;default:return e.typeOtherBg}}function yt(t){return `
|
|
1
|
+
function U(t){return typeof t=="object"&&t!==null}function ue(t,e){return U(t)&&e in t}var O=["en","fr","de","es","it","pt","ru"];var he=["open","in_progress","resolved","wont_fix"],V=["resolved","wont_fix"];function k(t){return V.includes(t)}function ge(t,e=new Date){return k(t)?{status:t,resolvedAt:e}:{status:t,resolvedAt:null}}function be(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 Y=/^(?!\.)(?!.*\.\.)[\p{L}\p{N}!#$%&'*+/=?^_`{|}~.-]{0,63}[\p{L}\p{N}!#$%&'*+/=?^_`{|}~-]@(?:[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,61}[\p{L}\p{N}])?\.)+[\p{L}\p{N}-]{2,63}$/u;function xe(t){return Y.test(t)}var w=class extends Error{code;retryable;constructor(e,s,n){super(e),this.code=s,this.retryable=n,this.name="SitepingError";}},B=class extends w{constructor(e){super(e,"NETWORK",true),this.name="SitepingNetworkError";}},A=class extends w{constructor(e){super(e,"VALIDATION",false),this.name="SitepingValidationError";}},F=class extends w{constructor(e){super(e,"AUTH",false),this.name="SitepingAuthError";}};function N(t){return (t.split("-")[0]??t).toLowerCase()}function D(t,e){let s={en:t};function n(r){return r!=="en"&&O.includes(r)}return {registerLocale(r,o){s[N(r)]=o;},async loadLocale(r){let o=N(r),a=s[o];if(a)return a;if(!n(o))return null;let p=await e[o]();return s[o]=p,p},createT(r){let o=N(r);return o!=="en"&&!s[o]&&!n(o)&&console.warn(`[siteping] Unknown locale "${r}", falling back to "en"`),a=>s[o]?.[a]??t[a]??a}}}function I(t,e){return t.replace(/\{(\w+)\}/g,(s,n)=>{let r=e[n];return r===void 0?s:String(r)})}function H(t,e,s){return I(t(e),s)}function fe(t){let e=new URLSearchParams({projectName:t.projectName});return t.page&&e.set("page",String(t.page)),t.limit&&e.set("limit",String(t.limit)),t.type&&e.set("type",t.type),t.status&&e.set("status",t.status),t.statuses?.length&&e.set("statuses",t.statuses.join(",")),t.search&&e.set("search",t.search),t.url&&e.set("url",t.url),t.urlPattern&&e.set("urlPattern",t.urlPattern),e}async function ve(t,e){let s=await t.text().catch(()=>"Unknown error"),n=s?`${t.status} ${s}`:`${t.status}`,r=`${e}: ${n}`;return t.status===401||t.status===403?new F(r):t.status>=400&&t.status<500?new A(r):new w(r,"SERVER",false)}function me(t,e){if(t instanceof B)return t;let s=t instanceof Error?t.message:String(t);return new B(`${e}: ${s}`)}function c(t){let n=document.createRange().createContextualFragment(t).firstElementChild;if(n?.nodeName.toLowerCase()!=="svg")throw new Error("[siteping] Invalid SVG string");for(let r of [...n.attributes])r.name.startsWith("on")&&n.removeAttribute(r.name);for(let r of n.querySelectorAll("*"))for(let o of [...r.attributes])o.name.startsWith("on")&&r.removeAttribute(o.name);return n}function i(t,e){let s=document.createElement(t);if(e)for(let[n,r]of Object.entries(e))n==="class"?s.className=r:n==="style"?s.style.cssText=r:s.setAttribute(n,r);return s}function l(t,e){t.textContent=e;}function _(t){let e=Array.from(t.childNodes).map(s=>s.cloneNode(true));return t.disabled=true,t.replaceChildren(i("div",{class:"sp-spinner sp-spinner--sm"})),()=>{t.replaceChildren(...e),t.disabled=false;}}function wt(t,e="en"){let s=Date.now()-new Date(t).getTime(),n=Math.floor(s/1e3);if(n<60)return new Intl.RelativeTimeFormat(e,{numeric:"auto"}).format(0,"second");let r=new Intl.RelativeTimeFormat(e,{numeric:"always",style:"narrow"}),o=Math.floor(n/60);if(o<60)return r.format(-o,"minute");let a=Math.floor(o/60);if(a<24)return r.format(-a,"hour");let p=Math.floor(a/24);return p<7?r.format(-p,"day"):new Date(t).toLocaleDateString(e)}var Et='<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>',Tt='<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>',Bt='<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>',Lt='<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>',At='<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>',Ft='<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>',Rt='<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>',Pt='<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>',Mt='<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>',Ot='<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>',Nt='<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>',Dt='<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>',It='<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>',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>',jt='<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>',$t='<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 W="#0066ff",ye=/^#[0-9a-fA-F]{6}$/,G=/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/,ke=/^#[0-9a-fA-F]{8}$/;function Ce(t){if(ye.test(t))return t;let e=G.test(t)?t.match(G):null;return e?`#${e[1]}${e[1]}${e[2]}${e[2]}${e[3]}${e[3]}`:ke.test(t)?t.slice(0,7):(console.warn(`[siteping] Invalid accentColor "${t}" \u2014 only hex colors (#RGB, #RRGGBB, #RRGGBBAA) are supported. Using default.`),W)}function we(t,e){let s=Math.max(0,Math.round(parseInt(t.slice(1,3),16)*(1-e))),n=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 `#${s.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}${r.toString(16).padStart(2,"0")}`}function Se(){return typeof window>"u"?false:window.matchMedia("(prefers-color-scheme: dark)").matches}function Ee(t){return t==="dark"||t==="auto"&&Se()?"dark":"light"}function Kt(t=W,e){let s=Ce(t),n=we(s,.15);return Ee(e)==="dark"?{accent:s,accentLight:s+"22",accentDark:n,accentGlow:s+"44",accentGradient:`linear-gradient(135deg, ${s}, ${n})`,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)",statusInProgress:"#fbbf24",statusInProgressBg:"rgba(245, 158, 11, 0.15)",statusWontFix:"#94a3b8",statusWontFixBg:"rgba(148, 163, 184, 0.15)"}:{accent:s,accentLight:s+"14",accentDark:n,accentGlow:s+"33",accentGradient:`linear-gradient(135deg, ${s}, ${n})`,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",statusInProgress:"#d97706",statusInProgressBg:"#fffbeb",statusWontFix:"#64748b",statusWontFixBg:"#f1f5f9"}}function j(t,e){switch(t){case "question":return e.typeQuestion;case "change":return e.typeChange;case "bug":return e.typeBug;default:return e.typeOther}}function Ut(t,e){switch(t){case "in_progress":return e.statusInProgress;case "resolved":return e.statusResolved;case "wont_fix":return e.statusWontFix;default:return e.statusOpen}}function Vt(t,e){switch(t){case "in_progress":return e.statusInProgressBg;case "resolved":return e.statusResolvedBg;case "wont_fix":return e.statusWontFixBg;default:return e.statusOpenBg}}function Q(t,e){switch(t){case "question":return e.typeQuestionBg;case "change":return e.typeChangeBg;case "bug":return e.typeBugBg;default:return e.typeOtherBg}}function Yt(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 n=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
|
-
`}
|
|
38
|
+
`}var q={"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","panel.statusInProgress":"In progress","panel.statusWontFix":"Won't fix","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 \u2014 or press Enter to comment on the last focused element","annotator.instantInstruction":"Comment on the clicked spot","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.closedAt":"Closed 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 $=D(q,{de:()=>import('./de-MAGIJBFC.js').then(t=>t.de),es:()=>import('./es-HEVFJPRI.js').then(t=>t.es),fr:()=>import('./fr-OM2PHLDH.js').then(t=>t.fr),it:()=>import('./it-OQVYHKKV.js').then(t=>t.it),pt:()=>import('./pt-VUUNL42H.js').then(t=>t.pt),ru:()=>import('./ru-NDWY7Y36.js').then(t=>t.ru)}),Jt=$.loadLocale,Zt=$.createT,E=H;function es(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}}function X(t,e){switch(t){case "open":return e("panel.statusOpen");case "in_progress":return e("panel.statusInProgress");case "resolved":return e("panel.statusResolved");case "wont_fix":return e("panel.statusWontFix");default:return t}}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 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>',Le='<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>',ns=`
|
|
39
39
|
/* ============================
|
|
40
40
|
Export Button & Menu
|
|
41
41
|
============================ */
|
|
@@ -153,9 +153,9 @@ function c(t){let n=document.createRange().createContextualFragment(t).firstElem
|
|
|
153
153
|
outline: 3px solid Highlight !important;
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
|
-
`,
|
|
157
|
-
`)||e.includes("\r")?`"${e.replace(/"/g,'""')}"`:e}function
|
|
158
|
-
`)}function
|
|
156
|
+
`,J=["id","type","status","message","url","authorName","authorEmail","createdAt","resolvedAt","viewport"];function Ae(t){let e=/^[=+\-@\t\r]/.test(t)?`'${t}`:t;return e.includes('"')||e.includes(",")||e.includes(`
|
|
157
|
+
`)||e.includes("\r")?`"${e.replace(/"/g,'""')}"`:e}function Fe(t){let e=J.join(","),s=t.map(n=>J.map(r=>{let o=n[r];return Ae(o==null?"":String(o))}).join(","));return [e,...s].join(`
|
|
158
|
+
`)}function Re(t){return JSON.stringify(t,null,2)}function Z(t,e,s){let n=new Blob([t],{type:s}),r=URL.createObjectURL(n),o=document.createElement("a");o.href=r,o.download=e,o.style.display="none",document.body.appendChild(o),o.click(),requestAnimationFrame(()=>{URL.revokeObjectURL(r),o.remove();});}var ee=class{constructor(e,s,n){this.getFeedbacks=s;this.element=i("div",{style:"position: relative; display: inline-flex;"});let r=document.createElement("button");r.className="sp-export-btn",r.setAttribute("aria-haspopup","true"),r.setAttribute("aria-expanded","false"),r.appendChild(c(Te));let o=document.createElement("span");l(o,n("export.label")),r.appendChild(o),r.addEventListener("click",d=>{d.stopPropagation(),this.toggle();}),this.menu=i("div",{class:"sp-export-menu"}),this.menu.setAttribute("role","menu");let a=this.createOption(Be,n("export.csv"),()=>{this.exportAs("csv");}),p=this.createOption(Le,n("export.json"),()=>{this.exportAs("json");});this.menu.appendChild(a),this.menu.appendChild(p),this.element.appendChild(r),this.element.appendChild(this.menu),this.onDocumentClick=d=>{this.isOpen&&!this.element.contains(d.target)&&this.close();},document.addEventListener("click",this.onDocumentClick,true);}getFeedbacks;element;menu;isOpen=false;onDocumentClick;createOption(e,s,n){let r=document.createElement("button");r.className="sp-export-option",r.setAttribute("role","menuitem");let o=i("span",{class:"sp-export-option-icon"});o.appendChild(c(e));let a=i("span",{class:"sp-export-option-label"});return l(a,s),r.appendChild(o),r.appendChild(a),r.addEventListener("click",p=>{p.stopPropagation(),n(),this.close();}),r}toggle(){this.isOpen?this.close():this.open();}open(){this.isOpen=true,this.menu.classList.add("sp-export-menu--open"),this.element.querySelector(".sp-export-btn")?.setAttribute("aria-expanded","true");}close(){this.isOpen=false,this.menu.classList.remove("sp-export-menu--open"),this.element.querySelector(".sp-export-btn")?.setAttribute("aria-expanded","false");}exportAs(e){let s=this.getFeedbacks();if(s.length===0)return;let n=s[0]?.projectName??"feedbacks",r=new Date().toISOString().slice(0,10),o=n.replace(/[^a-zA-Z0-9_-]/g,"_");if(e==="csv"){let a=Fe(s);Z(a,`feedbacks-${o}-${r}.csv`,"text/csv;charset=utf-8");}else {let a=Re(s);Z(a,`feedbacks-${o}-${r}.json`,"application/json;charset=utf-8");}}destroy(){document.removeEventListener("click",this.onDocumentClick,true),this.element.remove();}};var R='<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>',te='<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>',as=`
|
|
159
159
|
/* ============================
|
|
160
160
|
Bulk Checkbox
|
|
161
161
|
============================ */
|
|
@@ -453,7 +453,7 @@ function c(t){let n=document.createRange().createContextualFragment(t).firstElem
|
|
|
453
453
|
transition-duration: 0.01ms !important;
|
|
454
454
|
}
|
|
455
455
|
}
|
|
456
|
-
`,
|
|
456
|
+
`,se=class{constructor(e,s,n){this.callbacks=s;this.t=n,this.barElement=i("div",{class:"sp-bulk-bar"}),this.barElement.setAttribute("role","toolbar"),this.barElement.setAttribute("aria-label","Bulk actions"),this.countLabel=i("span",{class:"sp-bulk-bar-count"}),l(this.countLabel,E(this.t,"bulk.selected",{count:0}));let r=i("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 o=document.createElement("button");o.className="sp-bulk-btn-deselect",o.type="button",o.setAttribute("aria-label",this.t("bulk.deselect")),o.appendChild(c('<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>')),o.addEventListener("click",()=>this.deselectAll()),r.appendChild(this.resolveBtn),r.appendChild(this.deleteBtn),r.appendChild(o),this.barElement.appendChild(this.countLabel),this.barElement.appendChild(r),this.updateButtonLabels();}callbacks;barElement;selected=new Set;checkboxMap=new Map;countLabel;resolveBtn;deleteBtn;selectAllCheckbox=null;listContainer=null;isProcessing=false;t;createCheckbox(e){let s=i("div",{class:"sp-bulk-checkbox"});return s.setAttribute("role","checkbox"),s.setAttribute("aria-checked","false"),s.setAttribute("tabindex","0"),s.setAttribute("aria-label",`Select feedback ${e}`),s.appendChild(c(R)),s.addEventListener("click",n=>{n.stopPropagation(),this.toggle(e);}),s.addEventListener("keydown",n=>{(n.key===" "||n.key==="Enter")&&(n.preventDefault(),n.stopPropagation(),this.toggle(e));}),this.checkboxMap.set(e,s),s}createSelectAllBar(e,s){let n=i("div",{class:"sp-bulk-select-all"}),r=i("div",{class:"sp-bulk-checkbox"});r.appendChild(c(R)),this.selectAllCheckbox=r;let o=i("span");return l(o,s),n.appendChild(r),n.appendChild(o),n.addEventListener("click",()=>{this.selected.size===e.length&&e.length>0?this.deselectAll():this.selectAll(e);}),n}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 s of e)this.selected.add(s),this.updateCheckbox(s),this.updateCardSelectedState(s);this.updateBar(),this.updateSelectAllCheckbox(),this.updateListSelectionClass();}}deselectAll(){let e=[...this.selected];this.selected.clear();for(let s of e)this.updateCheckbox(s),this.updateCardSelectedState(s);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=false,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,s=e>0;this.barElement.classList.toggle("sp-bulk-bar--visible",s),l(this.countLabel,E(this.t,"bulk.selected",{count:e})),this.updateButtonLabels();}updateButtonLabels(){let e=this.selected.size,s=this.t("bulk.resolve"),n=this.t("bulk.delete");this.resolveBtn.replaceChildren();let r=document.createElement("span");l(r,e>0?`${s} ${e}`:s),this.resolveBtn.appendChild(r),this.deleteBtn.replaceChildren();let o=document.createElement("span");l(o,e>0?`${n} ${e}`:n),this.deleteBtn.appendChild(o);}updateCheckbox(e){let s=this.checkboxMap.get(e);if(!s)return;let n=this.selected.has(e);s.classList.toggle("sp-bulk-checkbox--checked",n),s.setAttribute("aria-checked",String(n)),s.replaceChildren(),s.appendChild(c(n?te:R));}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(c(e?te:R));}updateListSelectionClass(){this.listContainer&&this.listContainer.classList.toggle("sp-list--has-selection",this.selected.size>0);}updateCardSelectedState(e){if(!this.listContainer)return;let s=CSS.escape(e),n=this.listContainer.querySelector(`[data-feedback-id="${s}"]`);n&&n.classList.toggle("sp-card--selected",this.selected.has(e));}async handleResolve(){if(this.isProcessing||this.selected.size===0)return;this.isProcessing=true;let e=[...this.selected],s=_(this.resolveBtn);this.deleteBtn.disabled=true;try{await this.callbacks.onResolve(e),this.reset();}catch{s(),this.deleteBtn.disabled=false;}finally{this.isProcessing=false;}}async handleDelete(){if(this.isProcessing||this.selected.size===0)return;this.isProcessing=true;let e=[...this.selected],s=_(this.deleteBtn);this.resolveBtn.disabled=true;try{await this.callbacks.onDelete(e),this.reset();}catch{s(),this.resolveBtn.disabled=false;}finally{this.isProcessing=false;}}};var Pe='<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>',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="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>',Me='<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>',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="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>',Ne='<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>',De='<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>',K='<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>',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="1 4 1 10 7 10"/><path d="M3.51 15a9 9 0 1 0 2.13-9.36L1 10"/></svg>',re='<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>',Ie='<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>',He='<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>',_e='<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>',je='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="4 17 10 11 4 5"/><line x1="12" y1="19" x2="20" y2="19"/></svg>',hs=`
|
|
457
457
|
/* ============================
|
|
458
458
|
Detail View \u2014 Panel-in-Panel
|
|
459
459
|
============================ */
|
|
@@ -1177,7 +1177,7 @@ function c(t){let n=document.createRange().createContextualFragment(t).firstElem
|
|
|
1177
1177
|
animation-duration: 0.01ms !important;
|
|
1178
1178
|
}
|
|
1179
1179
|
}
|
|
1180
|
-
`;function _e(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 re(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 je(t){try{return new URL(t).pathname}catch{return t}}function $e(t){return !!(/^data:image\/(jpeg|png|webp);/i.test(t)||/^https:\/\//i.test(t))}function P(t,e){return t.length<=e?t:t.slice(0,e-1)+"\u2026"}function ze(t){if(!t)return false;let e=Array.isArray(t.console)?t.console.length:0,s=Array.isArray(t.network)?t.network.length:0;return e>0||s>0}function Ke(t){return !Number.isFinite(t)||t<0?"\u2014":t<1e3?`${Math.round(t)} ms`:`${(t/1e3).toFixed(1)} s`}var oe=class{constructor(e,s,n,r){this.colors=e;this.callbacks=s;this.t=n,this.locale=r,this.element=i("div",{class:"sp-detail"}),this.element.setAttribute("role","dialog"),this.element.setAttribute("aria-label","Feedback detail"),this.element.setAttribute("aria-hidden","true");let o=i("div",{class:"sp-detail-header"}),a=document.createElement("button");a.type="button",a.className="sp-detail-back",a.setAttribute("aria-label",this.t("detail.back")),a.appendChild(c(Fe)),a.addEventListener("click",()=>{this.hide(),this.callbacks.onBack();}),this.element.appendChild(o),o.appendChild(a),this.content=i("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,s){this.currentFeedback=e,this.isProcessing=false;let n=this.element.querySelector(".sp-detail-header");if(!n)return;let r=n.querySelector(".sp-detail-back");if(!r)return;n.replaceChildren(r);let o=i("span",{class:"sp-detail-title"});l(o,E(this.t,"detail.title",{number:s})),n.appendChild(o);let a=i("span",{class:"sp-badge"});a.style.background=Y(e.type,this.colors),a.style.color=D(e.type,this.colors),l(a,e.type),n.appendChild(a),this.content.replaceChildren();let p=0,d=this.buildSection(p++);this.buildStatusActions(d,e),this.content.appendChild(d);let h=this.buildSection(p++),u=i("div",{class:"sp-detail-section-title"});l(u,this.t("detail.message")),h.appendChild(u);let f=i("div",{class:"sp-detail-message"});if(f.style.borderLeftColor=D(e.type,this.colors),l(f,e.message),h.appendChild(f),this.content.appendChild(h),e.screenshotUrl&&$e(e.screenshotUrl)){let g=this.buildSection(p++),x=i("div",{class:"sp-detail-section-title"});l(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(p++),v=i("div",{class:"sp-detail-section-title"});if(l(v,this.t("detail.metadata")),m.appendChild(v),this.buildMetadata(m,e),this.content.appendChild(m),e.annotations.length>0){let g=this.buildSection(p++),x=i("div",{class:"sp-detail-section-title"});x.appendChild(c(z));let b=i("span");l(b,this.t("detail.annotation")),x.appendChild(b),g.appendChild(x),this.buildAnnotation(g,e),this.content.appendChild(g);}if(ze(e.diagnostics)){let g=this.buildSection(p++),x=i("div",{class:"sp-detail-section-title"});x.appendChild(c(Ie));let b=i("span");l(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 s=i("div",{class:"sp-detail-section"});return s.style.animationDelay=`${e*40}ms`,s}buildStatusActions(e,s){let n=k(s.status),r=i("div",{class:"sp-detail-section-title"});l(r,this.t("detail.status")),e.appendChild(r);let o=s.status.replace(/_/g,"-"),a={open:"#22c55e",in_progress:"#f59e0b",resolved:"#9ca3af",wont_fix:"#94a3b8"},p=i("div",{class:"sp-detail-status"}),d=i("span",{class:`sp-detail-status-pill sp-detail-status-pill--${o}`}),h=i("span",{class:"sp-detail-status-dot"});h.style.background=a[s.status]??a.open,d.appendChild(h);let u=i("span");l(u,q(s.status,this.t)),d.appendChild(u),p.appendChild(d),e.appendChild(p);let f=i("div",{class:"sp-detail-actions"});if(this.resolveBtn=document.createElement("button"),this.resolveBtn.type="button",n){this.resolveBtn.className="sp-detail-btn-reopen",this.resolveBtn.appendChild(c(se));let v=document.createElement("span");l(v,this.t("detail.reopen")),this.resolveBtn.appendChild(v);}else {this.resolveBtn.className="sp-detail-btn-resolve",this.resolveBtn.appendChild(c(K));let v=document.createElement("span");l(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(ne));let m=document.createElement("span");l(m,this.t("detail.delete")),this.deleteBtn.appendChild(m),this.deleteBtn.addEventListener("click",()=>this.handleDelete()),f.appendChild(this.resolveBtn),f.appendChild(this.deleteBtn),e.appendChild(f);}buildMetadata(e,s){let n=i("div",{class:"sp-detail-meta"});if(this.addMetaRow(n,Re,this.t("detail.page"),()=>{let r=i("div",{class:"sp-detail-meta-value"}),o=je(s.url);return l(r,P(o,60)),r.title=s.url,r}),this.addMetaRow(n,Pe,this.t("detail.author"),()=>{let r=i("div",{class:"sp-detail-meta-value"}),o=s.authorName||"Anonymous",a=s.authorEmail;return l(r,a?`${o} (${a})`:o),r}),this.addMetaRow(n,Me,this.t("detail.date"),()=>{let r=i("div",{class:"sp-detail-meta-value"});return l(r,re(s.createdAt,this.locale.startsWith("fr")?"fr":"en")),r}),this.addMetaRow(n,Oe,this.t("detail.viewport"),()=>{let r=i("div",{class:"sp-detail-meta-value sp-detail-meta-value--mono"});return l(r,s.viewport||"Unknown"),r}),this.addMetaRow(n,'<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=i("div",{class:"sp-detail-meta-value"});return l(r,_e(s.userAgent)),r}),s.resolvedAt){let r=s.resolvedAt,o=s.status==="wont_fix"?this.t("detail.closedAt"):this.t("detail.resolvedAt");this.addMetaRow(n,K,o,()=>{let a=i("div",{class:"sp-detail-meta-value sp-detail-meta-value--secondary"});return l(a,re(r,this.locale.startsWith("fr")?"fr":"en")),a});}e.appendChild(n);}addMetaRow(e,s,n,r){let o=i("div",{class:"sp-detail-meta-row"});o.appendChild(c(s));let a=i("div",{class:"sp-detail-meta-content"}),p=i("div",{class:"sp-detail-meta-label"});l(p,n),a.appendChild(p),a.appendChild(r()),o.appendChild(a),e.appendChild(o);}buildAnnotation(e,s){let n=s.annotations[0];if(!n)return;let r=i("div",{class:"sp-detail-annotation"}),o=i("div",{class:"sp-detail-annotation-info"});this.addAnnotationRow(o,De,this.t("detail.element"),()=>{let d=i("span",{class:"sp-detail-annotation-value sp-detail-annotation-value--mono"}),h=n.elementId?`<${n.elementTag}#${n.elementId}>`:`<${n.elementTag}>`;return l(d,h),d}),this.addAnnotationRow(o,Ne,this.t("detail.selector"),()=>{let d=i("span",{class:"sp-detail-annotation-value sp-detail-annotation-value--mono"});return l(d,P(n.cssSelector,60)),d.title=n.cssSelector,d}),this.addAnnotationRow(o,z,this.t("detail.position"),()=>{let d=i("span",{class:"sp-detail-annotation-value"});return l(d,`${n.xPct.toFixed(1)}%, ${n.yPct.toFixed(1)}%`+(n.wPct>0||n.hPct>0?` (${n.wPct.toFixed(1)}% \xD7 ${n.hPct.toFixed(1)}%)`:"")),d}),r.appendChild(o);let a=document.createElement("button");a.type="button",a.className="sp-detail-btn-goto",a.appendChild(c(z));let p=document.createElement("span");l(p,this.t("detail.goToAnnotation")),a.appendChild(p),a.addEventListener("click",()=>{this.currentFeedback&&this.callbacks.onGoToAnnotation(this.currentFeedback);}),r.appendChild(a),e.appendChild(r);}buildDiagnostics(e,s){let n=s.diagnostics;if(!n)return;let r=Array.isArray(n.console)?n.console:[],o=Array.isArray(n.network)?n.network:[],a=r.filter(x=>x.level==="error").length,p=i("div",{class:"sp-detail-diag"}),d=document.createElement("button");d.type="button",d.className="sp-detail-diag-toggle",d.setAttribute("aria-expanded","false"),d.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(He)),l(h,this.t("detail.diagnostics")),u.appendChild(h),d.appendChild(u);let f=i("span",{class:"sp-detail-diag-counts"}),m=i("span",{class:`sp-detail-diag-count${a>0?" sp-detail-diag-count--errors":""}`});l(m,`${r.length} console`);let v=i("span",{class:`sp-detail-diag-count${o.length>0?" sp-detail-diag-count--errors":""}`});l(v,`${o.length} net`),f.appendChild(m),f.appendChild(v),d.appendChild(f);let g=i("div",{class:"sp-detail-diag-body"});if(r.length>0){let x=document.createElement("div"),b=i("div",{class:"sp-detail-diag-group-title"});l(b,this.t("detail.diagnostics.console")),x.appendChild(b);let w=document.createElement("ul");w.className="sp-detail-diag-list";for(let y of r){let C=document.createElement("li"),B=i("span",{class:`sp-detail-diag-level sp-detail-diag-level--${y.level}`});l(B,y.level);let T=i("span",{class:"sp-detail-diag-message"});l(T,P(y.message,240)),T.title=y.message,C.appendChild(B),C.appendChild(T),w.appendChild(C);}x.appendChild(w),g.appendChild(x);}if(o.length>0){let x=document.createElement("div"),b=i("div",{class:"sp-detail-diag-group-title"});l(b,this.t("detail.diagnostics.network")),x.appendChild(b);let w=document.createElement("ul");w.className="sp-detail-diag-list";for(let y of o){let C=document.createElement("li");C.classList.add("sp-detail-diag-net");let B=i("span",{class:"sp-detail-diag-net-status"});l(B,y.status===0?"ERR":String(y.status));let T=i("span",{class:"sp-detail-diag-net-method"});l(T,y.method);let M=i("span",{class:"sp-detail-diag-net-url"});l(M,P(y.url,120)),M.title=`${y.url} \u2014 ${Ke(y.durationMs)}`,C.appendChild(B),C.appendChild(T),C.appendChild(M),w.appendChild(C);}x.appendChild(w),g.appendChild(x);}d.addEventListener("click",()=>{let b=!(d.getAttribute("aria-expanded")==="true");d.setAttribute("aria-expanded",String(b)),d.setAttribute("aria-label",b?this.t("detail.diagnostics.collapse"):this.t("detail.diagnostics.expand")),g.classList.toggle("sp-detail-diag-body--open",b);}),p.appendChild(d),p.appendChild(g),e.appendChild(p);}addAnnotationRow(e,s,n,r){let o=i("div",{class:"sp-detail-annotation-row"});o.appendChild(c(s));let a=i("div",{class:"sp-detail-meta-content"}),p=i("div",{class:"sp-detail-annotation-label"});l(p,n),a.appendChild(p),a.appendChild(r()),o.appendChild(a),e.appendChild(o);}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(i("div",{class:"sp-spinner sp-spinner--sm"}));}restoreResolveBtn(e){if(!this.resolveBtn)return;this.resolveBtn.disabled=false,this.resolveBtn.replaceChildren();let s=k(e.status);this.resolveBtn.appendChild(c(s?se:K));let n=document.createElement("span");l(n,s?this.t("detail.reopen"):this.t("detail.resolve")),this.resolveBtn.appendChild(n);}restoreDeleteBtn(){if(!this.deleteBtn)return;this.deleteBtn.disabled=false,this.deleteBtn.replaceChildren(),this.deleteBtn.appendChild(c(ne));let e=document.createElement("span");l(e,this.t("detail.delete")),this.deleteBtn.appendChild(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="M11 5h10"/><path d="M11 9h7"/><path d="M11 13h4"/><path d="M3 17l3 3 3-3"/><path d="M6 18V4"/></svg>',le='<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>',Ve='<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>',ie={question:0,change:1,bug:2,other:3};function us(t,e){let s=[...t];switch(e){case "newest":s.sort((n,r)=>new Date(r.createdAt).getTime()-new Date(n.createdAt).getTime());break;case "oldest":s.sort((n,r)=>new Date(n.createdAt).getTime()-new Date(r.createdAt).getTime());break;case "by-type":s.sort((n,r)=>{let o=ie[n.type]??99,a=ie[r.type]??99;return o!==a?o-a:new Date(r.createdAt).getTime()-new Date(n.createdAt).getTime()});break;case "open-first":s.sort((n,r)=>{let o=k(n.status)?1:0,a=k(r.status)?1:0;return o!==a?o-a:new Date(r.createdAt).getTime()-new Date(n.createdAt).getTime()});break}return s}function Ye(t){try{return new URL(t).pathname}catch{return t}}function We(t,e){if(t.length<=e)return t;let s="\u2026",n=Math.floor((e-1)/2);return t.slice(0,n)+s+t.slice(-n)}function hs(t){let e=new Map;for(let n of t){let r=Ye(n.url),o=e.get(r);o?o.push(n):e.set(r,[n]);}return new Map([...e.entries()].sort((n,r)=>r[1].length-n[1].length))}function gs(t,e,s){let n=i("div",{class:"sp-group-header"});n.setAttribute("role","button"),n.setAttribute("tabindex","0"),n.setAttribute("aria-expanded","true"),n.style.borderBottomColor=s.border;let r=i("span",{class:"sp-group-header-chevron"});r.appendChild(c(Ve)),n.appendChild(r);let o=i("span",{class:"sp-group-header-icon"});o.appendChild(c(le)),n.appendChild(o);let a=i("span",{class:"sp-group-header-path"}),p=We(t,40);l(a,p),t.length>40&&(a.title=t),n.appendChild(a);let d=i("span",{class:"sp-group-header-count"});d.style.background=s.accentLight,d.style.color=s.accent,l(d,String(e)),n.appendChild(d);let h=()=>{let u=n.getAttribute("aria-expanded")==="true";n.setAttribute("aria-expanded",String(!u)),n.classList.toggle("sp-group-header--collapsed",u);let f=n.nextElementSibling;f?.classList.contains("sp-group-content")&&f.classList.toggle("sp-group-content--collapsed",u);};return n.addEventListener("click",h),n.addEventListener("keydown",u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),h());}),n}var ae=class{element;_sortMode="newest";_groupByPage=false;menuEl=null;sortBtn;groupToggle;t;colors;onChange;outsideClickHandler=null;constructor(e,s,n){this.colors=e,this.onChange=s,this.t=n,this.element=i("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(Ue);this.sortBtn.appendChild(r);let o=i("span",{class:"sp-sort-btn-label"});l(o,this.t("sort.newest")),this.sortBtn.appendChild(o),this.sortBtn.addEventListener("click",d=>{d.stopPropagation(),this.toggleMenu();}),this.groupToggle=document.createElement("button"),this.groupToggle.className="sp-group-toggle",this.groupToggle.setAttribute("aria-pressed","false");let a=c(le);this.groupToggle.appendChild(a);let p=i("span",{class:"sp-group-toggle-label"});l(p,this.t("group.byPage")),this.groupToggle.appendChild(p),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=i("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 s of e){let n=document.createElement("button");n.className=`sp-sort-option${s.mode===this._sortMode?" sp-sort-option--active":""}`,n.setAttribute("role","option"),n.setAttribute("aria-selected",String(s.mode===this._sortMode)),s.mode===this._sortMode&&(n.style.background=this.colors.accentLight,n.style.color=this.colors.accent),l(n,s.label),n.addEventListener("click",r=>{r.stopPropagation(),this._sortMode=s.mode,this.updateSortLabel(),this.closeMenu(),this.onChange();}),this.menuEl.appendChild(n);}this.element.appendChild(this.menuEl),requestAnimationFrame(()=>{this.outsideClickHandler=s=>{this.menuEl&&!this.element.contains(s.target)&&this.closeMenu();},document.addEventListener("click",this.outsideClickHandler,true);}),this.menuEl.addEventListener("keydown",s=>{s.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")},s=this.sortBtn.querySelector(".sp-sort-btn-label");s&&l(s,e[this._sortMode]);}destroy(){this.closeMenu();}},bs=`
|
|
1180
|
+
`;function $e(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 oe(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 ze(t){try{return new URL(t).pathname}catch{return t}}function Ke(t){return !!(/^data:image\/(jpeg|png|webp);/i.test(t)||/^https:\/\//i.test(t))}function P(t,e){return t.length<=e?t:t.slice(0,e-1)+"\u2026"}function Ue(t){if(!t)return false;let e=Array.isArray(t.console)?t.console.length:0,s=Array.isArray(t.network)?t.network.length:0;return e>0||s>0}function Ve(t){return !Number.isFinite(t)||t<0?"\u2014":t<1e3?`${Math.round(t)} ms`:`${(t/1e3).toFixed(1)} s`}var ie=class{constructor(e,s,n,r){this.colors=e;this.callbacks=s;this.t=n,this.locale=r,this.element=i("div",{class:"sp-detail"}),this.element.setAttribute("role","dialog"),this.element.setAttribute("aria-label","Feedback detail"),this.element.setAttribute("aria-hidden","true");let o=i("div",{class:"sp-detail-header"}),a=document.createElement("button");a.type="button",a.className="sp-detail-back",a.setAttribute("aria-label",this.t("detail.back")),a.appendChild(c(Pe)),a.addEventListener("click",()=>{this.hide(),this.callbacks.onBack();}),this.element.appendChild(o),o.appendChild(a),this.content=i("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,s){this.currentFeedback=e,this.isProcessing=false;let n=this.element.querySelector(".sp-detail-header");if(!n)return;let r=n.querySelector(".sp-detail-back");if(!r)return;n.replaceChildren(r);let o=i("span",{class:"sp-detail-title"});l(o,E(this.t,"detail.title",{number:s})),n.appendChild(o);let a=i("span",{class:"sp-badge"});a.style.background=Q(e.type,this.colors),a.style.color=j(e.type,this.colors),l(a,e.type),n.appendChild(a),this.content.replaceChildren();let p=0,d=this.buildSection(p++);this.buildStatusActions(d,e),this.content.appendChild(d);let h=this.buildSection(p++),u=i("div",{class:"sp-detail-section-title"});l(u,this.t("detail.message")),h.appendChild(u);let f=i("div",{class:"sp-detail-message"});if(f.style.borderLeftColor=j(e.type,this.colors),l(f,e.message),h.appendChild(f),this.content.appendChild(h),e.screenshotUrl&&Ke(e.screenshotUrl)){let g=this.buildSection(p++),x=i("div",{class:"sp-detail-section-title"});l(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(p++),v=i("div",{class:"sp-detail-section-title"});if(l(v,this.t("detail.metadata")),m.appendChild(v),this.buildMetadata(m,e),this.content.appendChild(m),e.annotations.length>0){let g=this.buildSection(p++),x=i("div",{class:"sp-detail-section-title"});x.appendChild(c(z));let b=i("span");l(b,this.t("detail.annotation")),x.appendChild(b),g.appendChild(x),this.buildAnnotation(g,e),this.content.appendChild(g);}if(Ue(e.diagnostics)){let g=this.buildSection(p++),x=i("div",{class:"sp-detail-section-title"});x.appendChild(c(je));let b=i("span");l(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 s=i("div",{class:"sp-detail-section"});return s.style.animationDelay=`${e*40}ms`,s}buildStatusActions(e,s){let n=k(s.status),r=i("div",{class:"sp-detail-section-title"});l(r,this.t("detail.status")),e.appendChild(r);let o=s.status.replace(/_/g,"-"),a={open:"#22c55e",in_progress:"#f59e0b",resolved:"#9ca3af",wont_fix:"#94a3b8"},p=i("div",{class:"sp-detail-status"}),d=i("span",{class:`sp-detail-status-pill sp-detail-status-pill--${o}`}),h=i("span",{class:"sp-detail-status-dot"});h.style.background=a[s.status]??a.open,d.appendChild(h);let u=i("span");l(u,X(s.status,this.t)),d.appendChild(u),p.appendChild(d),e.appendChild(p);let f=i("div",{class:"sp-detail-actions"});if(this.resolveBtn=document.createElement("button"),this.resolveBtn.type="button",n){this.resolveBtn.className="sp-detail-btn-reopen",this.resolveBtn.appendChild(c(ne));let v=document.createElement("span");l(v,this.t("detail.reopen")),this.resolveBtn.appendChild(v);}else {this.resolveBtn.className="sp-detail-btn-resolve",this.resolveBtn.appendChild(c(K));let v=document.createElement("span");l(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(re));let m=document.createElement("span");l(m,this.t("detail.delete")),this.deleteBtn.appendChild(m),this.deleteBtn.addEventListener("click",()=>this.handleDelete()),f.appendChild(this.resolveBtn),f.appendChild(this.deleteBtn),e.appendChild(f);}buildMetadata(e,s){let n=i("div",{class:"sp-detail-meta"});if(this.addMetaRow(n,Me,this.t("detail.page"),()=>{let r=i("div",{class:"sp-detail-meta-value"}),o=ze(s.url);return l(r,P(o,60)),r.title=s.url,r}),this.addMetaRow(n,Oe,this.t("detail.author"),()=>{let r=i("div",{class:"sp-detail-meta-value"}),o=s.authorName||"Anonymous",a=s.authorEmail;return l(r,a?`${o} (${a})`:o),r}),this.addMetaRow(n,Ne,this.t("detail.date"),()=>{let r=i("div",{class:"sp-detail-meta-value"});return l(r,oe(s.createdAt,this.locale.startsWith("fr")?"fr":"en")),r}),this.addMetaRow(n,De,this.t("detail.viewport"),()=>{let r=i("div",{class:"sp-detail-meta-value sp-detail-meta-value--mono"});return l(r,s.viewport||"Unknown"),r}),this.addMetaRow(n,'<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=i("div",{class:"sp-detail-meta-value"});return l(r,$e(s.userAgent)),r}),s.resolvedAt){let r=s.resolvedAt,o=s.status==="wont_fix"?this.t("detail.closedAt"):this.t("detail.resolvedAt");this.addMetaRow(n,K,o,()=>{let a=i("div",{class:"sp-detail-meta-value sp-detail-meta-value--secondary"});return l(a,oe(r,this.locale.startsWith("fr")?"fr":"en")),a});}e.appendChild(n);}addMetaRow(e,s,n,r){let o=i("div",{class:"sp-detail-meta-row"});o.appendChild(c(s));let a=i("div",{class:"sp-detail-meta-content"}),p=i("div",{class:"sp-detail-meta-label"});l(p,n),a.appendChild(p),a.appendChild(r()),o.appendChild(a),e.appendChild(o);}buildAnnotation(e,s){let n=s.annotations[0];if(!n)return;let r=i("div",{class:"sp-detail-annotation"}),o=i("div",{class:"sp-detail-annotation-info"});this.addAnnotationRow(o,Ie,this.t("detail.element"),()=>{let d=i("span",{class:"sp-detail-annotation-value sp-detail-annotation-value--mono"}),h=n.elementId?`<${n.elementTag}#${n.elementId}>`:`<${n.elementTag}>`;return l(d,h),d}),this.addAnnotationRow(o,He,this.t("detail.selector"),()=>{let d=i("span",{class:"sp-detail-annotation-value sp-detail-annotation-value--mono"});return l(d,P(n.cssSelector,60)),d.title=n.cssSelector,d}),this.addAnnotationRow(o,z,this.t("detail.position"),()=>{let d=i("span",{class:"sp-detail-annotation-value"});return l(d,`${n.xPct.toFixed(1)}%, ${n.yPct.toFixed(1)}%`+(n.wPct>0||n.hPct>0?` (${n.wPct.toFixed(1)}% \xD7 ${n.hPct.toFixed(1)}%)`:"")),d}),r.appendChild(o);let a=document.createElement("button");a.type="button",a.className="sp-detail-btn-goto",a.appendChild(c(z));let p=document.createElement("span");l(p,this.t("detail.goToAnnotation")),a.appendChild(p),a.addEventListener("click",()=>{this.currentFeedback&&this.callbacks.onGoToAnnotation(this.currentFeedback);}),r.appendChild(a),e.appendChild(r);}buildDiagnostics(e,s){let n=s.diagnostics;if(!n)return;let r=Array.isArray(n.console)?n.console:[],o=Array.isArray(n.network)?n.network:[],a=r.filter(x=>x.level==="error").length,p=i("div",{class:"sp-detail-diag"}),d=document.createElement("button");d.type="button",d.className="sp-detail-diag-toggle",d.setAttribute("aria-expanded","false"),d.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(_e)),l(h,this.t("detail.diagnostics")),u.appendChild(h),d.appendChild(u);let f=i("span",{class:"sp-detail-diag-counts"}),m=i("span",{class:`sp-detail-diag-count${a>0?" sp-detail-diag-count--errors":""}`});l(m,`${r.length} console`);let v=i("span",{class:`sp-detail-diag-count${o.length>0?" sp-detail-diag-count--errors":""}`});l(v,`${o.length} net`),f.appendChild(m),f.appendChild(v),d.appendChild(f);let g=i("div",{class:"sp-detail-diag-body"});if(r.length>0){let x=document.createElement("div"),b=i("div",{class:"sp-detail-diag-group-title"});l(b,this.t("detail.diagnostics.console")),x.appendChild(b);let S=document.createElement("ul");S.className="sp-detail-diag-list";for(let y of r){let C=document.createElement("li"),L=i("span",{class:`sp-detail-diag-level sp-detail-diag-level--${y.level}`});l(L,y.level);let T=i("span",{class:"sp-detail-diag-message"});l(T,P(y.message,240)),T.title=y.message,C.appendChild(L),C.appendChild(T),S.appendChild(C);}x.appendChild(S),g.appendChild(x);}if(o.length>0){let x=document.createElement("div"),b=i("div",{class:"sp-detail-diag-group-title"});l(b,this.t("detail.diagnostics.network")),x.appendChild(b);let S=document.createElement("ul");S.className="sp-detail-diag-list";for(let y of o){let C=document.createElement("li");C.classList.add("sp-detail-diag-net");let L=i("span",{class:"sp-detail-diag-net-status"});l(L,y.status===0?"ERR":String(y.status));let T=i("span",{class:"sp-detail-diag-net-method"});l(T,y.method);let M=i("span",{class:"sp-detail-diag-net-url"});l(M,P(y.url,120)),M.title=`${y.url} \u2014 ${Ve(y.durationMs)}`,C.appendChild(L),C.appendChild(T),C.appendChild(M),S.appendChild(C);}x.appendChild(S),g.appendChild(x);}d.addEventListener("click",()=>{let b=!(d.getAttribute("aria-expanded")==="true");d.setAttribute("aria-expanded",String(b)),d.setAttribute("aria-label",b?this.t("detail.diagnostics.collapse"):this.t("detail.diagnostics.expand")),g.classList.toggle("sp-detail-diag-body--open",b);}),p.appendChild(d),p.appendChild(g),e.appendChild(p);}addAnnotationRow(e,s,n,r){let o=i("div",{class:"sp-detail-annotation-row"});o.appendChild(c(s));let a=i("div",{class:"sp-detail-meta-content"}),p=i("div",{class:"sp-detail-annotation-label"});l(p,n),a.appendChild(p),a.appendChild(r()),o.appendChild(a),e.appendChild(o);}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(i("div",{class:"sp-spinner sp-spinner--sm"}));}restoreResolveBtn(e){if(!this.resolveBtn)return;this.resolveBtn.disabled=false,this.resolveBtn.replaceChildren();let s=k(e.status);this.resolveBtn.appendChild(c(s?ne:K));let n=document.createElement("span");l(n,s?this.t("detail.reopen"):this.t("detail.resolve")),this.resolveBtn.appendChild(n);}restoreDeleteBtn(){if(!this.deleteBtn)return;this.deleteBtn.disabled=false,this.deleteBtn.replaceChildren(),this.deleteBtn.appendChild(c(re));let e=document.createElement("span");l(e,this.t("detail.delete")),this.deleteBtn.appendChild(e);}};var 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="M11 5h10"/><path d="M11 9h7"/><path d="M11 13h4"/><path d="M3 17l3 3 3-3"/><path d="M6 18V4"/></svg>',pe='<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>',Ge='<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>',ae={question:0,change:1,bug:2,other:3};function fs(t,e){let s=[...t];switch(e){case "newest":s.sort((n,r)=>new Date(r.createdAt).getTime()-new Date(n.createdAt).getTime());break;case "oldest":s.sort((n,r)=>new Date(n.createdAt).getTime()-new Date(r.createdAt).getTime());break;case "by-type":s.sort((n,r)=>{let o=ae[n.type]??99,a=ae[r.type]??99;return o!==a?o-a:new Date(r.createdAt).getTime()-new Date(n.createdAt).getTime()});break;case "open-first":s.sort((n,r)=>{let o=k(n.status)?1:0,a=k(r.status)?1:0;return o!==a?o-a:new Date(r.createdAt).getTime()-new Date(n.createdAt).getTime()});break}return s}function We(t){try{return new URL(t).pathname}catch{return t}}function Qe(t,e){if(t.length<=e)return t;let s="\u2026",n=Math.floor((e-1)/2);return t.slice(0,n)+s+t.slice(-n)}function vs(t){let e=new Map;for(let n of t){let r=We(n.url),o=e.get(r);o?o.push(n):e.set(r,[n]);}return new Map([...e.entries()].sort((n,r)=>r[1].length-n[1].length))}function ms(t,e,s){let n=i("div",{class:"sp-group-header"});n.setAttribute("role","button"),n.setAttribute("tabindex","0"),n.setAttribute("aria-expanded","true"),n.style.borderBottomColor=s.border;let r=i("span",{class:"sp-group-header-chevron"});r.appendChild(c(Ge)),n.appendChild(r);let o=i("span",{class:"sp-group-header-icon"});o.appendChild(c(pe)),n.appendChild(o);let a=i("span",{class:"sp-group-header-path"}),p=Qe(t,40);l(a,p),t.length>40&&(a.title=t),n.appendChild(a);let d=i("span",{class:"sp-group-header-count"});d.style.background=s.accentLight,d.style.color=s.accent,l(d,String(e)),n.appendChild(d);let h=()=>{let u=n.getAttribute("aria-expanded")==="true";n.setAttribute("aria-expanded",String(!u)),n.classList.toggle("sp-group-header--collapsed",u);let f=n.nextElementSibling;f?.classList.contains("sp-group-content")&&f.classList.toggle("sp-group-content--collapsed",u);};return n.addEventListener("click",h),n.addEventListener("keydown",u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),h());}),n}var le=class{element;_sortMode="newest";_groupByPage=false;menuEl=null;sortBtn;groupToggle;t;colors;onChange;outsideClickHandler=null;constructor(e,s,n){this.colors=e,this.onChange=s,this.t=n,this.element=i("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(Ye);this.sortBtn.appendChild(r);let o=i("span",{class:"sp-sort-btn-label"});l(o,this.t("sort.newest")),this.sortBtn.appendChild(o),this.sortBtn.addEventListener("click",d=>{d.stopPropagation(),this.toggleMenu();}),this.groupToggle=document.createElement("button"),this.groupToggle.className="sp-group-toggle",this.groupToggle.setAttribute("aria-pressed","false");let a=c(pe);this.groupToggle.appendChild(a);let p=i("span",{class:"sp-group-toggle-label"});l(p,this.t("group.byPage")),this.groupToggle.appendChild(p),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=i("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 s of e){let n=document.createElement("button");n.className=`sp-sort-option${s.mode===this._sortMode?" sp-sort-option--active":""}`,n.setAttribute("role","option"),n.setAttribute("aria-selected",String(s.mode===this._sortMode)),s.mode===this._sortMode&&(n.style.background=this.colors.accentLight,n.style.color=this.colors.accent),l(n,s.label),n.addEventListener("click",r=>{r.stopPropagation(),this._sortMode=s.mode,this.updateSortLabel(),this.closeMenu(),this.onChange();}),this.menuEl.appendChild(n);}this.element.appendChild(this.menuEl),requestAnimationFrame(()=>{this.outsideClickHandler=s=>{this.menuEl&&!this.element.contains(s.target)&&this.closeMenu();},document.addEventListener("click",this.outsideClickHandler,true);}),this.menuEl.addEventListener("keydown",s=>{s.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")},s=this.sortBtn.querySelector(".sp-sort-btn-label");s&&l(s,e[this._sortMode]);}destroy(){this.closeMenu();}},ys=`
|
|
1181
1181
|
/* ============================
|
|
1182
1182
|
Sort Controls Container
|
|
1183
1183
|
============================ */
|
|
@@ -1482,7 +1482,7 @@ function c(t){let n=document.createRange().createContextualFragment(t).firstElem
|
|
|
1482
1482
|
transition: none;
|
|
1483
1483
|
}
|
|
1484
1484
|
}
|
|
1485
|
-
`;var
|
|
1485
|
+
`;var Es=`
|
|
1486
1486
|
.sp-stats-bar {
|
|
1487
1487
|
display: flex;
|
|
1488
1488
|
flex-direction: column;
|
|
@@ -1565,7 +1565,7 @@ function c(t){let n=document.createRange().createContextualFragment(t).firstElem
|
|
|
1565
1565
|
min-width: 64px;
|
|
1566
1566
|
text-align: right;
|
|
1567
1567
|
}
|
|
1568
|
-
`,
|
|
1568
|
+
`,de=class{constructor(e,s){this.colors=e;this.t=s,this.element=i("div",{class:"sp-stats-bar"}),this.element.setAttribute("aria-label","Feedback statistics"),this.element.hidden=true;let n=i("div",{class:"sp-stats-row"}),r=i("div",{class:"sp-stats-item"}),o=i("span",{class:"sp-stats-dot"});o.style.background="#22c55e",this.valueOpen=i("span",{class:"sp-stats-value"}),l(this.valueOpen,"0");let a=i("span",{class:"sp-stats-label"});l(a,this.t("stats.open")),r.appendChild(o),r.appendChild(this.valueOpen),r.appendChild(a);let p=i("div",{class:"sp-stats-item"}),d=i("span",{class:"sp-stats-dot"});d.style.background="#9ca3af",this.valueResolved=i("span",{class:"sp-stats-value"}),l(this.valueResolved,"0");let h=i("span",{class:"sp-stats-label"});l(h,this.t("stats.resolved")),p.appendChild(d),p.appendChild(this.valueResolved),p.appendChild(h);let u=i("div",{class:"sp-stats-item"}),f=i("span",{class:"sp-stats-dot"});f.style.background=this.colors.typeBug,this.valueBugs=i("span",{class:"sp-stats-value"}),l(this.valueBugs,"0");let m=i("span",{class:"sp-stats-label"});l(m,this.t("stats.bugs")),u.appendChild(f),u.appendChild(this.valueBugs),u.appendChild(m),n.appendChild(r),n.appendChild(p),n.appendChild(u);let v=i("div",{class:"sp-stats-progress"}),g=i("div",{class:"sp-stats-progress-track"});this.progressFill=i("div",{class:"sp-stats-progress-fill"}),g.appendChild(this.progressFill),this.progressLabel=i("span",{class:"sp-stats-progress-label"}),l(this.progressLabel,""),v.appendChild(g),v.appendChild(this.progressLabel),this.element.appendChild(n),this.element.appendChild(v);}colors;element;valueOpen;valueResolved;valueBugs;progressFill;progressLabel;t;update(e,s){if(s===0){this.element.hidden=true;return}this.element.hidden=false;let n=0,r=0,o=0;for(let h of e)k(h.status)?r++:n++,h.type==="bug"&&o++;l(this.valueOpen,String(n)),l(this.valueResolved,String(r)),l(this.valueBugs,String(o));let a=e.length,p=a>0?Math.round(r/a*100):0;requestAnimationFrame(()=>{this.progressFill.style.width=`${p}%`;});let d=E(this.t,"stats.progress",{percent:p});l(this.progressLabel,d);}};var 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="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>';function Ls(t){let e=t.querySelectorAll(".sp-card");for(let s=0;s<e.length;s++)if(e[s]?.classList.contains("sp-card--focused"))return s;return -1}function As(t,e){let s=t.querySelectorAll(".sp-card");if(s.length===0)return;for(let o of s)o.classList.remove("sp-card--focused");let n=Math.max(0,Math.min(e,s.length-1)),r=s[n];r&&(r.classList.add("sp-card--focused"),r.scrollIntoView({block:"nearest",behavior:"smooth"}),r.focus({preventScroll:true}));}var Xe=[{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"}],Fs=`
|
|
1569
1569
|
/* ---- Help overlay backdrop ---- */
|
|
1570
1570
|
|
|
1571
1571
|
.sp-shortcuts-overlay {
|
|
@@ -1792,5 +1792,5 @@ function c(t){let n=document.createRange().createContextualFragment(t).firstElem
|
|
|
1792
1792
|
transition-duration: 0.01ms !important;
|
|
1793
1793
|
}
|
|
1794
1794
|
}
|
|
1795
|
-
`,
|
|
1796
|
-
//# sourceMappingURL=chunk-
|
|
1795
|
+
`,Je='<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>',ce=class{constructor(e,s,n){this.t=n;this.keyMap=new Map([["j",()=>s.onNavigate("down")],["k",()=>s.onNavigate("up")],["r",()=>s.onResolve()],["d",()=>s.onDelete()],["f",()=>s.onFocusSearch()],["/",()=>s.onFocusSearch()],["x",()=>s.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 s=e.composedPath()[0];if(s){let r=s.tagName?.toLowerCase();if(r==="input"||r==="textarea"||r==="select"||s.isContentEditable)return}if(e.ctrlKey||e.altKey||e.metaKey)return;let n=this.keyMap.get(e.key);n&&(e.preventDefault(),e.stopPropagation(),n());}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=i("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",p=>{p.target===e&&this.hideHelp();});let s=i("div",{class:"sp-shortcuts-card"}),n=i("div",{class:"sp-shortcuts-title"});n.appendChild(c(qe));let r=i("span");l(r,this.t("shortcuts.title")),n.appendChild(r),s.appendChild(n);let o=document.createElement("button");o.className="sp-shortcuts-close",o.setAttribute("aria-label",this.t("shortcuts.close")),o.appendChild(c(Je)),o.addEventListener("click",()=>this.hideHelp()),s.appendChild(o);let a=i("div",{class:"sp-shortcuts-grid"});for(let p of Xe){let d=i("div",{class:"sp-shortcuts-row"}),h=i("div",{class:"sp-shortcuts-keys"});p.keys.forEach((f,m)=>{if(m>0){let g=i("span",{class:"sp-shortcuts-separator"});l(g,"/"),h.appendChild(g);}let v=i("span",{class:"sp-kbd"});l(v,f),h.appendChild(v);});let u=i("span",{class:"sp-shortcuts-desc"});l(u,this.t(p.label)),d.appendChild(h),d.appendChild(u),a.appendChild(d);}return s.appendChild(a),e.appendChild(s),e}buildHintButton(){let e=document.createElement("button");return e.className="sp-shortcuts-hint",e.setAttribute("aria-label",this.t("shortcuts.hint")),l(e,"?"),e.addEventListener("click",s=>{s.stopPropagation(),this.toggleHelp();}),e}};export{ms as $,Ot as A,Nt as B,Dt as C,It as D,Ht as E,_t as F,jt as G,$t as H,Kt as I,j as J,Ut as K,Vt as L,Q as M,Yt as N,Jt as O,Zt as P,E as Q,es as R,X as S,ns as T,ee as U,as as V,se as W,hs as X,ie as Y,fs as Z,vs as _,xe as a,le as aa,w as b,ys as ba,B as c,Es as ca,ue as d,de as da,he as e,Ls as ea,V as f,As as fa,k as g,Fs as ga,ge as h,ce as ha,be as i,fe as j,ve as k,me as l,c as m,i as n,l as o,_ as p,wt as q,Et as r,Tt as s,Bt as t,Lt as u,At as v,Ft as w,Rt as x,Pt as y,Mt as z};//# sourceMappingURL=chunk-4CK3N4YE.js.map
|
|
1796
|
+
//# sourceMappingURL=chunk-4CK3N4YE.js.map
|