bugstash 0.1.9 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +224 -371
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +224 -371
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,13 +1,24 @@
|
|
|
1
|
-
"use strict";var
|
|
2
|
-
${t.stack??""}`;if(typeof t=="object")try{return JSON.stringify(t,null,2)}catch{return String(t)}return String(t)})}function
|
|
1
|
+
"use strict";var It=Object.defineProperty;var fs=Object.getOwnPropertyDescriptor;var hs=Object.getOwnPropertyNames;var vs=Object.prototype.hasOwnProperty;var xs=(e,t)=>{for(var n in t)It(e,n,{get:t[n],enumerable:!0})},ys=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of hs(t))!vs.call(e,r)&&r!==n&&It(e,r,{get:()=>t[r],enumerable:!(s=fs(t,r))||s.enumerable});return e};var ws=e=>ys(It({},"__esModule",{value:!0}),e);var dr={};xs(dr,{BugStash:()=>ds,default:()=>cr});module.exports=ws(dr);var Ie=[],rn=50,He=null,Re=null,Be=null,Ne=null;function et(e){if(e.id)return`#${e.id}`;let t=e.tagName.toLowerCase(),n=e.className&&typeof e.className=="string"?"."+e.className.trim().split(/\s+/).slice(0,2).join("."):"",s=(e.textContent||"").trim().slice(0,30),r=s?` "${s}"`:"";return`${t}${n}${r}`}function _(e){Ie.push(e),Ie.length>rn&&Ie.shift()}function on(e){e&&(rn=e),He=n=>{let s=n.target;!s||!s.tagName||_({type:"click",category:"ui",message:`Clicked ${et(s)}`,timestamp:Date.now(),data:{x:n.clientX,y:n.clientY,selector:et(s)}})},document.addEventListener("click",He,!0);let t=new WeakMap;Re=n=>{let s=n.target;if(!s||!s.tagName)return;let r=s.tagName.toLowerCase();if(r!=="input"&&r!=="textarea"&&r!=="select")return;let a=t.get(s);a&&clearTimeout(a),t.set(s,window.setTimeout(()=>{let l=s instanceof HTMLInputElement&&s.type==="password";_({type:"input",category:"ui",message:`Input ${et(s)}`,timestamp:Date.now(),data:{selector:et(s),value:l?"[redacted]":void 0}})},300))},document.addEventListener("input",Re,!0),Be=()=>{_({type:"navigation",category:"navigation",message:`Navigated to ${window.location.pathname}`,timestamp:Date.now(),data:{url:window.location.href}})},window.addEventListener("popstate",Be),Ne=()=>{_({type:"navigation",category:"navigation",message:`Hash changed to ${window.location.hash}`,timestamp:Date.now(),data:{url:window.location.href}})},window.addEventListener("hashchange",Ne),_({type:"navigation",category:"navigation",message:`Page loaded: ${window.location.pathname}`,timestamp:Date.now(),data:{url:window.location.href}})}function he(){return[...Ie]}function an(){Ie=[]}function ln(){He&&document.removeEventListener("click",He,!0),Re&&document.removeEventListener("input",Re,!0),Be&&window.removeEventListener("popstate",Be),Ne&&window.removeEventListener("hashchange",Ne),He=null,Re=null,Be=null,Ne=null}var Ht="[REDACTED]",ks=[[/\b(?:\d[ -]*?){13,19}\b/g,"[CC_REDACTED]"],[/\b\d{3}-\d{2}-\d{4}\b/g,"[SSN_REDACTED]"],[/Bearer\s+[A-Za-z0-9\-._~+/]+=*/g,"Bearer [TOKEN_REDACTED]"],[/eyJ[A-Za-z0-9_-]+\.eyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g,"[JWT_REDACTED]"],[/(?:api[_-]?key|apikey|secret|token|password|passwd|authorization)['":\s=]+['"]?([A-Za-z0-9\-._~+/]{20,})['"]?/gi,e=>{let t=e.search(/[=:]/);return e.slice(0,t+1)+" "+Ht}],[/AKIA[0-9A-Z]{16}/g,"[AWS_KEY_REDACTED]"],[/"(?:password|passwd|secret|token|access_token|refresh_token|api_key|apiKey|private_key)":\s*"[^"]*"/gi,e=>{let t=e.indexOf(":");return e.slice(0,t+1)+' "'+Ht+'"'}]];function ve(e){let t=e;for(let[n,s]of ks)t=t.replace(n,s);return t}function cn(e){return e.map(ve)}function tt(e){if(typeof e=="string")return ve(e);if(Array.isArray(e))return e.map(tt);if(e&&typeof e=="object"){let t={};for(let[n,s]of Object.entries(e)){let r=n.toLowerCase();r.includes("password")||r.includes("secret")||r.includes("token")||r.includes("apikey")||r.includes("api_key")||r.includes("private")?t[n]=Ht:t[n]=tt(s)}return t}return e}var nt={log:console.log,warn:console.warn,error:console.error,debug:console.debug,info:console.info},De=[],dn=50;function Es(e){return e.map(t=>{if(t instanceof Error)return`${t.name}: ${t.message}
|
|
2
|
+
${t.stack??""}`;if(typeof t=="object")try{return JSON.stringify(t,null,2)}catch{return String(t)}return String(t)})}function Ls(e,t){let n={level:e,args:cn(Es(t)),timestamp:Date.now()};e==="error"&&(n.stack=new Error().stack?.split(`
|
|
3
3
|
`).slice(2).join(`
|
|
4
|
-
`)),
|
|
4
|
+
`)),De.push(n),De.length>dn&&De.shift(),_({type:"console",category:`console.${e}`,message:n.args.join(" ").slice(0,200),timestamp:n.timestamp})}function pn(e){e&&(dn=e);for(let t of Object.keys(nt))console[t]=function(...n){Ls(t,n),nt[t].apply(console,n)}}function te(){return[...De]}function bn(){De=[]}function un(){for(let e of Object.keys(nt))console[e]=nt[e]}var xe=[],mn=50,st,rt,ot;function Rt(e){xe.push(e),xe.length>mn&&xe.shift(),_({type:"network",category:e.failed?"network.error":"network.ok",message:`${e.method} ${e.url} \u2192 ${e.status} (${e.duration}ms)`,timestamp:e.timestamp,data:{status:e.status,duration:e.duration}})}function gn(e){try{let t=new URL(e,window.location.origin),n=new URLSearchParams(t.search);for(let r of n.keys()){let a=r.toLowerCase();(a.includes("token")||a.includes("key")||a.includes("secret")||a.includes("password")||a.includes("auth"))&&n.set(r,"[REDACTED]")}let s=n.toString();return t.pathname+(s?"?"+s:"")}catch{return ve(e)}}function Ss(){st=window.fetch,window.fetch=async function(e,t){let n=t?.method?.toUpperCase()??"GET",s=typeof e=="string"?e:e instanceof URL?e.href:e.url,r=gn(s),a=Date.now();try{let l=await st.call(window,e,t);return Rt({method:n,url:r,status:l.status,statusText:l.statusText,duration:Date.now()-a,responseType:l.headers.get("content-type")??void 0,timestamp:a,failed:l.status>=400}),l}catch(l){throw Rt({method:n,url:r,status:0,statusText:"Network Error",duration:Date.now()-a,timestamp:a,failed:!0}),l}}}function Cs(){rt=XMLHttpRequest.prototype.open,ot=XMLHttpRequest.prototype.send,XMLHttpRequest.prototype.open=function(e,t,...n){return this.__bs_method=e.toUpperCase(),this.__bs_url=gn(typeof t=="string"?t:t.href),rt.apply(this,[e,t,...n])},XMLHttpRequest.prototype.send=function(e){let t=Date.now();return this.addEventListener("loadend",function(){Rt({method:this.__bs_method??"GET",url:this.__bs_url??"",status:this.status,statusText:this.statusText,duration:Date.now()-t,responseType:this.getResponseHeader("content-type")??void 0,timestamp:t,failed:this.status>=400||this.status===0})}),ot.call(this,e)}}function fn(e){e&&(mn=e),Ss(),Cs()}function ye(){return[...xe]}function le(){return xe.filter(e=>e.failed)}function hn(){xe=[]}function vn(){st&&(window.fetch=st),rt&&(XMLHttpRequest.prototype.open=rt),ot&&(XMLHttpRequest.prototype.send=ot)}var at=[],je=null,Oe=null;function xn(){je=e=>{let t={message:e.message||"Unknown error",source:e.filename,lineno:e.lineno,colno:e.colno,stack:e.error?.stack,type:"error",timestamp:Date.now()};at.push(t),_({type:"error",category:"exception",message:t.message,timestamp:t.timestamp,data:{source:t.source,lineno:t.lineno}})},Oe=e=>{let t=e.reason,n=t instanceof Error?t.message:typeof t=="string"?t:"Unhandled promise rejection",s={message:n,stack:t instanceof Error?t.stack:void 0,type:"unhandledrejection",timestamp:Date.now()};at.push(s),_({type:"error",category:"promise",message:n,timestamp:s.timestamp})},window.addEventListener("error",je),window.addEventListener("unhandledrejection",Oe)}function ne(){return[...at]}function yn(){at=[]}function wn(){je&&window.removeEventListener("error",je),Oe&&window.removeEventListener("unhandledrejection",Oe),je=null,Oe=null}var $=null,it=null,lt=null,ct=null;function kn(){if($={timestamp:Date.now()},performance.getEntriesByType){let e=()=>{let[t]=performance.getEntriesByType("navigation");t&&$&&($.pageLoadTime=Math.round(t.loadEventEnd-t.startTime),$.domContentLoaded=Math.round(t.domContentLoadedEventEnd-t.startTime));let n=performance.getEntriesByType("paint");for(let r of n)r.name==="first-paint"&&$&&($.firstPaint=Math.round(r.startTime)),r.name==="first-contentful-paint"&&$&&($.firstContentfulPaint=Math.round(r.startTime));$&&($.resourceCount=performance.getEntriesByType("resource").length);let s=performance.memory;s&&$&&($.memoryUsage={usedJSHeapSize:s.usedJSHeapSize,totalJSHeapSize:s.totalJSHeapSize})};document.readyState==="complete"?setTimeout(e,0):window.addEventListener("load",()=>setTimeout(e,100))}if(typeof PerformanceObserver<"u"){try{it=new PerformanceObserver(e=>{let t=e.getEntries(),n=t[t.length-1];n&&$&&($.largestContentfulPaint=Math.round(n.startTime))}),it.observe({type:"largest-contentful-paint",buffered:!0})}catch{}try{let e=0;lt=new PerformanceObserver(t=>{for(let n of t.getEntries())n.hadRecentInput||(e+=n.value);$&&($.cumulativeLayoutShift=Math.round(e*1e3)/1e3)}),lt.observe({type:"layout-shift",buffered:!0})}catch{}try{ct=new PerformanceObserver(e=>{let[t]=e.getEntries();t&&$&&($.firstInputDelay=Math.round(t.processingStart-t.startTime))}),ct.observe({type:"first-input",buffered:!0})}catch{}}}function we(){return $&&($.timestamp=Date.now()),$?{...$}:null}function En(){it?.disconnect(),lt?.disconnect(),ct?.disconnect(),it=null,lt=null,ct=null,$=null}function Ts(){let e=document.createElement("div");if(e.style.cssText=`
|
|
5
|
+
position: fixed; inset: 0; z-index: 2147483647;
|
|
6
|
+
background: white; opacity: 0;
|
|
7
|
+
pointer-events: none;
|
|
8
|
+
animation: bs-flash 0.4s ease-out forwards;
|
|
9
|
+
`,!document.getElementById("bs-flash-style")){let t=document.createElement("style");t.id="bs-flash-style",t.textContent=`
|
|
10
|
+
@keyframes bs-flash {
|
|
11
|
+
0% { opacity: 0; }
|
|
12
|
+
15% { opacity: 0.7; }
|
|
13
|
+
100% { opacity: 0; }
|
|
14
|
+
}
|
|
15
|
+
`,document.head.appendChild(t)}document.body.appendChild(e),e.addEventListener("animationend",()=>e.remove())}async function qe(){Ts();try{let e=await $s();if(e)return e}catch{}return null}async function $s(){let e=window.innerWidth,t=window.innerHeight,n=document.documentElement.cloneNode(!0),s=document.documentElement.querySelectorAll("*"),r=n.querySelectorAll("*");for(let b=0;b<s.length&&b<r.length;b++){let h=window.getComputedStyle(s[b]),y=r[b];if(y.style){let M=["background","background-color","background-image","color","font","font-size","font-family","font-weight","border","border-radius","padding","margin","display","flex-direction","align-items","justify-content","gap","width","height","max-width","max-height","overflow","position","top","left","right","bottom","box-shadow","text-shadow","opacity","transform","text-align","line-height","letter-spacing","text-decoration","visibility","z-index","grid-template-columns","grid-template-rows","box-sizing"];for(let ae of M)try{y.style.setProperty(ae,h.getPropertyValue(ae))}catch{}}}n.querySelectorAll("script, [data-bugstash], .bs-fab, .bs-toolbar, .bs-modal, .bs-backdrop").forEach(b=>b.remove()),n.querySelectorAll('[style*="bs-flash"]').forEach(b=>b.remove()),n.querySelectorAll("img").forEach(b=>{try{let h=b.getAttribute("src")||"";h&&!h.startsWith("data:")&&!h.startsWith(window.location.origin)&&(b.removeAttribute("src"),b.style.backgroundColor="#e5e7eb")}catch{}});let l=new XMLSerializer().serializeToString(n),d=`
|
|
5
16
|
<svg xmlns="http://www.w3.org/2000/svg" width="${e}" height="${t}">
|
|
6
17
|
<foreignObject width="100%" height="100%">
|
|
7
|
-
${
|
|
18
|
+
${l}
|
|
8
19
|
</foreignObject>
|
|
9
20
|
</svg>
|
|
10
|
-
`,l=new Blob([p],{type:"image/svg+xml;charset=utf-8"}),x=URL.createObjectURL(l);return new Promise(g=>{let h=new Image;h.onload=()=>{let y=document.createElement("canvas");y.width=e*.5,y.height=t*.5;let M=y.getContext("2d");if(!M){URL.revokeObjectURL(x),g(null);return}M.scale(.5,.5),M.drawImage(h,0,0),URL.revokeObjectURL(x),g(y.toDataURL("image/jpeg",.6))},h.onerror=()=>{URL.revokeObjectURL(x),g(null)},h.src=x})}async function Ln(){if(!navigator.mediaDevices?.getDisplayMedia)return null;let e=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser"}}),t=e.getVideoTracks()[0],s=document.createElement("video");return new Promise(n=>{s.onloadedmetadata=()=>{s.play();let r=document.createElement("canvas");r.width=s.videoWidth*.5,r.height=s.videoHeight*.5;let i=r.getContext("2d");if(!i){t.stop(),n(null);return}i.scale(.5,.5),i.drawImage(s,0,0),t.stop(),n(r.toDataURL("image/jpeg",.6))},s.onerror=()=>{t.stop(),n(null)},s.srcObject=e})}var Sn="https://api.bugstash.com",ys="https://bugstash-backend.azurewebsites.net",U=Sn,It=!1;function ws(e){U=e.replace(/\/$/,""),It=!1}function ks(){return U}async function X(e,t){try{return await fetch(e,t)}catch(s){if(It)throw s;It=!0;let n=U;U=ys;let r=e.replace(n,ys);return fetch(r,t)}}var Ht="bugstash_auth";function Rt(){try{let e=localStorage.getItem(Ht);if(!e)return null;let t=JSON.parse(e);return t.tokens.expiresAt<Date.now(),t}catch{return null}}function Es(e){localStorage.setItem(Ht,JSON.stringify(e))}function Cn(){localStorage.removeItem(Ht)}function J(){return Rt()?.user||null}function Ls(){return Rt()?.tokens.accessToken||null}async function ie(){let e=Rt();if(!e)return{"Content-Type":"application/json"};if(e.tokens.expiresAt<Date.now()+6e4)try{let t=await X(`${U}/api/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:e.tokens.refreshToken})});if(t.ok){let s=await t.json();s.success&&(e.tokens=s.data,Es(e))}}catch{}return{"Content-Type":"application/json",Authorization:`Bearer ${e.tokens.accessToken}`}}async function at(e,t,s){try{let r=await(await X(`${U}/api/auth/login`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e,password:t,projectId:s})})).json();return r.success&&Es({user:r.data.user,tokens:r.data.tokens}),r}catch{return{success:!1,error:"Network error"}}}async function it(){Cn()}async function Bt(e){try{let t=await ie();return await(await X(`${U}/api/reports`,{method:"POST",headers:t,body:JSON.stringify(e)})).json()}catch{return{success:!1,error:"Network error - could not reach BugStash"}}}async function Ss(e,t){try{let s=await ie();return await(await X(`${U}/api/pins/by-page?projectId=${e}&pathname=${encodeURIComponent(t)}`,{headers:s})).json()}catch{return{success:!1,error:"Network error"}}}async function Nt(e){try{let t=await ie();return await(await X(`${U}/api/pins`,{method:"POST",headers:t,body:JSON.stringify(e)})).json()}catch{return{success:!1,error:"Network error"}}}async function lt(e,t){try{let s=await ie();return await(await X(`${U}/api/pins/${e}`,{method:"PUT",headers:s,body:JSON.stringify(t)})).json()}catch{return{success:!1,error:"Network error"}}}async function Cs(e){try{let t=await ie();return await(await X(`${U}/api/pins/${e}`,{method:"DELETE",headers:t})).json()}catch{return{success:!1,error:"Network error"}}}async function Ts(e){try{let t=await ie();return await(await X(`${U}/api/pins/${e}/comments`,{headers:t})).json()}catch{return{success:!1,error:"Network error"}}}async function Dt(e,t,s=[]){try{let n=await ie();return await(await X(`${U}/api/pins/${e}/comments`,{method:"POST",headers:n,body:JSON.stringify({body:t,mentions:s})})).json()}catch{return{success:!1,error:"Network error"}}}async function $s(e){try{let t=await ie();return await(await X(`${U}/api/members/for-project/${e}`,{headers:t})).json()}catch{return{success:!1,error:"Network error"}}}var jt="bugstash_offline_queue";function Ot(e){let t=Ms();t.push({...e,id:Math.random().toString(36).slice(2),timestamp:Date.now()}),localStorage.setItem(jt,JSON.stringify(t))}function Ms(){try{return JSON.parse(localStorage.getItem(jt)||"[]")}catch{return[]}}async function Tn(){let e=Ms();if(e.length===0)return 0;let t=0,s=[];for(let n of e)try{let r;switch(n.type){case"create_pin":r=await Nt(n.data);break;case"create_comment":r=await Dt(n.data.pinId,n.data.body,n.data.mentions);break;case"update_pin":r=await lt(n.data.pinId,n.data.updates);break;case"submit_report":r=await Bt(n.data);break;default:r={success:!1,error:"Unknown action"}}r.success?t++:s.push(n)}catch{s.push(n)}return localStorage.setItem(jt,JSON.stringify(s)),t}typeof window<"u"&&window.addEventListener("online",()=>{Tn().catch(()=>{})});var qt=[{id:"midnight",name:"Midnight",preview:["#1a1d2e","#6E9ED0"],vars:{"--bs-bg":"#1a1d2e","--bs-bg2":"#222639","--bs-bg3":"#2a2e42","--bs-text":"#e2e5ed","--bs-muted":"#7c82a0","--bs-border":"#333754","--bs-accent":"#6E9ED0","--bs-accent2":"#8FAFD6","--bs-fab1":"#6E9ED0","--bs-fab2":"#8FAFD6","--bs-radius":"16px","--bs-radius-sm":"10px","--bs-red":"#f87171","--bs-green":"#4ade80","--bs-orange":"#fb923c","--bs-yellow":"#fbbf24"}},{id:"purple",name:"Deep Purple",preview:["#1c1628","#a78bfa"],vars:{"--bs-bg":"#1c1628","--bs-bg2":"#241e34","--bs-bg3":"#2e2640","--bs-text":"#e8e0f5","--bs-muted":"#8b7faa","--bs-border":"#3b3255","--bs-accent":"#a78bfa","--bs-accent2":"#c4b5fd","--bs-fab1":"#a78bfa","--bs-fab2":"#c084fc","--bs-radius":"16px","--bs-radius-sm":"10px","--bs-red":"#fb7185","--bs-green":"#6ee7b7","--bs-orange":"#fdba74","--bs-yellow":"#fde68a"}},{id:"cyberpunk",name:"Cyberpunk",preview:["#0a0a12","#00fff0"],vars:{"--bs-bg":"#0a0a12","--bs-bg2":"#12121f","--bs-bg3":"#1a1a2c","--bs-text":"#e0f7fa","--bs-muted":"#5e7f88","--bs-border":"#1e3a3f","--bs-accent":"#00fff0","--bs-accent2":"#00c8ff","--bs-fab1":"#00fff0","--bs-fab2":"#ff00c8","--bs-radius":"4px","--bs-radius-sm":"2px","--bs-red":"#ff3860","--bs-green":"#00ff88","--bs-orange":"#ffaa00","--bs-yellow":"#ffe600"}},{id:"sunset",name:"Sunset",preview:["#1f1318","#f97316"],vars:{"--bs-bg":"#1f1318","--bs-bg2":"#291a20","--bs-bg3":"#33212a","--bs-text":"#f5e6ea","--bs-muted":"#a07880","--bs-border":"#4a2a34","--bs-accent":"#f97316","--bs-accent2":"#fb923c","--bs-fab1":"#f97316","--bs-fab2":"#ef4444","--bs-radius":"14px","--bs-radius-sm":"8px","--bs-red":"#ef4444","--bs-green":"#4ade80","--bs-orange":"#fb923c","--bs-yellow":"#fbbf24"}},{id:"ocean",name:"Ocean",preview:["#0d1b2a","#2dd4bf"],vars:{"--bs-bg":"#0d1b2a","--bs-bg2":"#132638","--bs-bg3":"#1a3146","--bs-text":"#d6f0ee","--bs-muted":"#5c8a8e","--bs-border":"#1f4050","--bs-accent":"#2dd4bf","--bs-accent2":"#5eead4","--bs-fab1":"#2dd4bf","--bs-fab2":"#22d3ee","--bs-radius":"16px","--bs-radius-sm":"10px","--bs-red":"#fca5a5","--bs-green":"#6ee7b7","--bs-orange":"#fdba74","--bs-yellow":"#fde68a"}},{id:"rose",name:"Rose Gold",preview:["#1f1520","#f472b6"],vars:{"--bs-bg":"#1f1520","--bs-bg2":"#2a1c2a","--bs-bg3":"#352434","--bs-text":"#f5e0ec","--bs-muted":"#a07090","--bs-border":"#4a2a44","--bs-accent":"#f472b6","--bs-accent2":"#f9a8d4","--bs-fab1":"#f472b6","--bs-fab2":"#e879f9","--bs-radius":"20px","--bs-radius-sm":"12px","--bs-red":"#fb7185","--bs-green":"#86efac","--bs-orange":"#fdba74","--bs-yellow":"#fde68a"}},{id:"arctic",name:"Arctic Light",preview:["#f0f4f8","#3b82f6"],vars:{"--bs-bg":"#f0f4f8","--bs-bg2":"#e2e8f0","--bs-bg3":"#ffffff","--bs-text":"#1e293b","--bs-muted":"#64748b","--bs-border":"#cbd5e1","--bs-accent":"#3b82f6","--bs-accent2":"#60a5fa","--bs-fab1":"#3b82f6","--bs-fab2":"#6366f1","--bs-radius":"16px","--bs-radius-sm":"10px","--bs-red":"#ef4444","--bs-green":"#22c55e","--bs-orange":"#f97316","--bs-yellow":"#eab308"}},{id:"glass",name:"Glassmorphism",preview:["rgba(30,30,50,0.6)","#a5b4fc"],vars:{"--bs-bg":"rgba(22,22,40,0.75)","--bs-bg2":"rgba(35,35,60,0.6)","--bs-bg3":"rgba(45,45,75,0.5)","--bs-text":"#e8eaff","--bs-muted":"#8888bb","--bs-border":"rgba(255,255,255,0.1)","--bs-accent":"#a5b4fc","--bs-accent2":"#c7d2fe","--bs-fab1":"#818cf8","--bs-fab2":"#a78bfa","--bs-radius":"20px","--bs-radius-sm":"12px","--bs-red":"#fca5a5","--bs-green":"#86efac","--bs-orange":"#fdba74","--bs-yellow":"#fde68a"}},{id:"neon",name:"Neon",preview:["#080c08","#39ff14"],vars:{"--bs-bg":"#080c08","--bs-bg2":"#0f150f","--bs-bg3":"#161e16","--bs-text":"#d0f0c0","--bs-muted":"#5a7a50","--bs-border":"#1e3018","--bs-accent":"#39ff14","--bs-accent2":"#7dff5e","--bs-fab1":"#39ff14","--bs-fab2":"#00ff88","--bs-radius":"8px","--bs-radius-sm":"4px","--bs-red":"#ff4444","--bs-green":"#39ff14","--bs-orange":"#ffaa00","--bs-yellow":"#e6ff00"}},{id:"forest",name:"Forest",preview:["#111c15","#34d399"],vars:{"--bs-bg":"#111c15","--bs-bg2":"#18261d","--bs-bg3":"#203026","--bs-text":"#d1f0dd","--bs-muted":"#6a9a7a","--bs-border":"#2a4a33","--bs-accent":"#34d399","--bs-accent2":"#6ee7b7","--bs-fab1":"#34d399","--bs-fab2":"#2dd4bf","--bs-radius":"14px","--bs-radius-sm":"8px","--bs-red":"#fca5a5","--bs-green":"#4ade80","--bs-orange":"#fdba74","--bs-yellow":"#fde68a"}},{id:"minimal-dark",name:"Minimal Dark",preview:["#18181b","#a1a1aa"],vars:{"--bs-bg":"#18181b","--bs-bg2":"#212124","--bs-bg3":"#2a2a2e","--bs-text":"#e4e4e7","--bs-muted":"#71717a","--bs-border":"#333338","--bs-accent":"#a1a1aa","--bs-accent2":"#d4d4d8","--bs-fab1":"#52525b","--bs-fab2":"#71717a","--bs-radius":"12px","--bs-radius-sm":"8px","--bs-red":"#f87171","--bs-green":"#4ade80","--bs-orange":"#fb923c","--bs-yellow":"#fbbf24"}},{id:"minimal-light",name:"Minimal Light",preview:["#fafafa","#52525b"],vars:{"--bs-bg":"#fafafa","--bs-bg2":"#f0f0f0","--bs-bg3":"#ffffff","--bs-text":"#18181b","--bs-muted":"#71717a","--bs-border":"#e4e4e7","--bs-accent":"#18181b","--bs-accent2":"#3f3f46","--bs-fab1":"#18181b","--bs-fab2":"#3f3f46","--bs-radius":"12px","--bs-radius-sm":"8px","--bs-red":"#dc2626","--bs-green":"#16a34a","--bs-orange":"#ea580c","--bs-yellow":"#ca8a04"}},{id:"dracula",name:"Dracula",preview:["#282a36","#bd93f9"],vars:{"--bs-bg":"#282a36","--bs-bg2":"#2e303e","--bs-bg3":"#363848","--bs-text":"#f8f8f2","--bs-muted":"#6272a4","--bs-border":"#44475a","--bs-accent":"#bd93f9","--bs-accent2":"#caa9fa","--bs-fab1":"#bd93f9","--bs-fab2":"#ff79c6","--bs-radius":"12px","--bs-radius-sm":"8px","--bs-red":"#ff5555","--bs-green":"#50fa7b","--bs-orange":"#ffb86c","--bs-yellow":"#f1fa8c"}},{id:"nord",name:"Nord",preview:["#2e3440","#88c0d0"],vars:{"--bs-bg":"#2e3440","--bs-bg2":"#3b4252","--bs-bg3":"#434c5e","--bs-text":"#eceff4","--bs-muted":"#7b88a1","--bs-border":"#4c566a","--bs-accent":"#88c0d0","--bs-accent2":"#8fbcbb","--bs-fab1":"#88c0d0","--bs-fab2":"#81a1c1","--bs-radius":"10px","--bs-radius-sm":"6px","--bs-red":"#bf616a","--bs-green":"#a3be8c","--bs-orange":"#d08770","--bs-yellow":"#ebcb8b"}},{id:"monokai",name:"Monokai",preview:["#272822","#a6e22e"],vars:{"--bs-bg":"#272822","--bs-bg2":"#2f302a","--bs-bg3":"#383930","--bs-text":"#f8f8f2","--bs-muted":"#75715e","--bs-border":"#49483e","--bs-accent":"#a6e22e","--bs-accent2":"#c4f060","--bs-fab1":"#a6e22e","--bs-fab2":"#66d9ef","--bs-radius":"8px","--bs-radius-sm":"4px","--bs-red":"#f92672","--bs-green":"#a6e22e","--bs-orange":"#fd971f","--bs-yellow":"#e6db74"}},{id:"solarized",name:"Solarized Dark",preview:["#002b36","#268bd2"],vars:{"--bs-bg":"#002b36","--bs-bg2":"#073642","--bs-bg3":"#0e4050","--bs-text":"#eee8d5","--bs-muted":"#839496","--bs-border":"#1a4f5c","--bs-accent":"#268bd2","--bs-accent2":"#2aa198","--bs-fab1":"#268bd2","--bs-fab2":"#2aa198","--bs-radius":"10px","--bs-radius-sm":"6px","--bs-red":"#dc322f","--bs-green":"#859900","--bs-orange":"#cb4b16","--bs-yellow":"#b58900"}},{id:"candy",name:"Candy",preview:["#fef1f8","#ec4899"],vars:{"--bs-bg":"#fef1f8","--bs-bg2":"#fce7f3","--bs-bg3":"#ffffff","--bs-text":"#4a1942","--bs-muted":"#9f5090","--bs-border":"#f0c6e0","--bs-accent":"#ec4899","--bs-accent2":"#f472b6","--bs-fab1":"#ec4899","--bs-fab2":"#a855f7","--bs-radius":"20px","--bs-radius-sm":"14px","--bs-red":"#e11d48","--bs-green":"#059669","--bs-orange":"#ea580c","--bs-yellow":"#ca8a04"}},{id:"slate",name:"Slate",preview:["#1e2432","#94a3b8"],vars:{"--bs-bg":"#1e2432","--bs-bg2":"#263040","--bs-bg3":"#2e384a","--bs-text":"#e2e8f0","--bs-muted":"#64748b","--bs-border":"#374462","--bs-accent":"#94a3b8","--bs-accent2":"#cbd5e1","--bs-fab1":"#475569","--bs-fab2":"#64748b","--bs-radius":"14px","--bs-radius-sm":"8px","--bs-red":"#f87171","--bs-green":"#4ade80","--bs-orange":"#fb923c","--bs-yellow":"#fbbf24"}},{id:"ember",name:"Ember",preview:["#1a0f0f","#ef4444"],vars:{"--bs-bg":"#1a0f0f","--bs-bg2":"#241515","--bs-bg3":"#2e1c1c","--bs-text":"#fde8e8","--bs-muted":"#a06060","--bs-border":"#4a2222","--bs-accent":"#ef4444","--bs-accent2":"#f87171","--bs-fab1":"#ef4444","--bs-fab2":"#f97316","--bs-radius":"12px","--bs-radius-sm":"8px","--bs-red":"#fca5a5","--bs-green":"#86efac","--bs-orange":"#fdba74","--bs-yellow":"#fde68a"}},{id:"lavender",name:"Lavender",preview:["#f5f0ff","#7c3aed"],vars:{"--bs-bg":"#f5f0ff","--bs-bg2":"#ede5ff","--bs-bg3":"#ffffff","--bs-text":"#2e1065","--bs-muted":"#7c6a9a","--bs-border":"#d8c8f0","--bs-accent":"#7c3aed","--bs-accent2":"#8b5cf6","--bs-fab1":"#7c3aed","--bs-fab2":"#a855f7","--bs-radius":"18px","--bs-radius-sm":"12px","--bs-red":"#dc2626","--bs-green":"#16a34a","--bs-orange":"#ea580c","--bs-yellow":"#ca8a04"}}];function ct(){return qt}function dt(e){return qt.find(t=>t.id===e)}function Ps(){return qt[0]}var Ut=[{id:"classic",name:"Classic Center",description:"Centered modal, top tabs",tabPosition:"top"},{id:"drawer-right",name:"Right Drawer",description:"Slides in from the right",tabPosition:"top"},{id:"drawer-left",name:"Left Drawer",description:"Slides in from the left",tabPosition:"top"},{id:"bottom-sheet",name:"Bottom Sheet",description:"Slides up from the bottom",tabPosition:"top"},{id:"top-bar",name:"Top Drop",description:"Drops down from the top",tabPosition:"top"},{id:"compact",name:"Compact",description:"Small centered popup",tabPosition:"top"},{id:"wide",name:"Wide",description:"Wide horizontal modal",tabPosition:"top"},{id:"fullscreen",name:"Fullscreen",description:"Full screen overlay",tabPosition:"top"},{id:"corner-br",name:"Corner Card",description:"Bottom-right corner card",tabPosition:"top"},{id:"corner-bl",name:"Corner Left",description:"Bottom-left corner card",tabPosition:"top"},{id:"pill-tabs",name:"Pill Tabs",description:"Centered with pill-style tabs",tabPosition:"top"},{id:"sidebar-tabs",name:"Sidebar Tabs",description:"Vertical tabs on the left",tabPosition:"left"},{id:"segmented",name:"Segmented",description:"Tabs as segmented control",tabPosition:"top"},{id:"minimal",name:"Minimal",description:"Ultra clean, spacious",tabPosition:"top"},{id:"dense",name:"Dense",description:"Compact, tight spacing",tabPosition:"top"},{id:"rounded",name:"Bubble",description:"Extra rounded, playful",tabPosition:"top"},{id:"sharp",name:"Sharp",description:"Square corners, industrial",tabPosition:"top"},{id:"split",name:"Split View",description:"Two-column layout",tabPosition:"left"},{id:"floating",name:"Floating",description:"Heavy shadow, borderless",tabPosition:"top"},{id:"bottom-tabs",name:"Bottom Tabs",description:"Tabs at the bottom",tabPosition:"bottom"}];function bt(){return Ut}function De(e){return Ut.find(t=>t.id===e)}function zs(){return Ut[0]}var As=`
|
|
21
|
+
`,c=new Blob([d],{type:"image/svg+xml;charset=utf-8"}),v=URL.createObjectURL(c);return new Promise(b=>{let h=new Image;h.crossOrigin="anonymous",h.onload=()=>{let y=document.createElement("canvas");y.width=e*.5,y.height=t*.5;let M=y.getContext("2d");if(!M){URL.revokeObjectURL(v),b(null);return}M.scale(.5,.5),M.drawImage(h,0,0),URL.revokeObjectURL(v);try{b(y.toDataURL("image/jpeg",.6))}catch{b(null)}},h.onerror=()=>{URL.revokeObjectURL(v),b(null)},h.src=v})}var Ms="https://bugstash-backend.vercel.app",Ln="https://bugstash-backend.vercel.app",F=Ms,Bt=!1;function Sn(e){F=e.replace(/\/$/,""),Bt=!1}function Cn(){return F}async function V(e,t){try{return await fetch(e,t)}catch(n){if(Bt)throw n;Bt=!0;let s=F;F=Ln;let r=e.replace(s,Ln);return fetch(r,t)}}var Nt="bugstash_auth";function Dt(){try{let e=localStorage.getItem(Nt);if(!e)return null;let t=JSON.parse(e);return t.tokens.expiresAt<Date.now(),t}catch{return null}}function Tn(e){localStorage.setItem(Nt,JSON.stringify(e))}function Ps(){localStorage.removeItem(Nt)}function Q(){return Dt()?.user||null}function $n(){return Dt()?.tokens.accessToken||null}async function ce(){let e=Dt();if(!e)return{"Content-Type":"application/json"};if(e.tokens.expiresAt<Date.now()+6e4)try{let t=await V(`${F}/api/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:e.tokens.refreshToken})});if(t.ok){let n=await t.json();n.success&&(e.tokens=n.data,Tn(e))}}catch{}return{"Content-Type":"application/json",Authorization:`Bearer ${e.tokens.accessToken}`}}async function dt(e,t,n){try{let r=await(await V(`${F}/api/auth/login`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e,password:t,projectId:n})})).json();return r.success&&Tn({user:r.data.user,tokens:r.data.tokens}),r}catch{return{success:!1,error:"Network error"}}}async function pt(){Ps()}async function jt(e){try{let t=await ce();return await(await V(`${F}/api/reports`,{method:"POST",headers:t,body:JSON.stringify(e)})).json()}catch{return{success:!1,error:"Network error - could not reach BugStash"}}}async function Mn(e,t){try{let n=await ce();return await(await V(`${F}/api/pins/by-page?projectId=${e}&pathname=${encodeURIComponent(t)}`,{headers:n})).json()}catch{return{success:!1,error:"Network error"}}}async function Ot(e){try{let t=await ce();return await(await V(`${F}/api/pins`,{method:"POST",headers:t,body:JSON.stringify(e)})).json()}catch{return{success:!1,error:"Network error"}}}async function bt(e,t){try{let n=await ce();return await(await V(`${F}/api/pins/${e}`,{method:"PUT",headers:n,body:JSON.stringify(t)})).json()}catch{return{success:!1,error:"Network error"}}}async function Pn(e){try{let t=await ce();return await(await V(`${F}/api/pins/${e}`,{method:"DELETE",headers:t})).json()}catch{return{success:!1,error:"Network error"}}}async function zn(e){try{let t=await ce();return await(await V(`${F}/api/pins/${e}/comments`,{headers:t})).json()}catch{return{success:!1,error:"Network error"}}}async function qt(e,t,n=[]){try{let s=await ce();return await(await V(`${F}/api/pins/${e}/comments`,{method:"POST",headers:s,body:JSON.stringify({body:t,mentions:n})})).json()}catch{return{success:!1,error:"Network error"}}}async function An(e){try{let t=await ce();return await(await V(`${F}/api/members/for-project/${e}`,{headers:t})).json()}catch{return{success:!1,error:"Network error"}}}var Ut="bugstash_offline_queue";function _t(e){let t=In();t.push({...e,id:Math.random().toString(36).slice(2),timestamp:Date.now()}),localStorage.setItem(Ut,JSON.stringify(t))}function In(){try{return JSON.parse(localStorage.getItem(Ut)||"[]")}catch{return[]}}async function zs(){let e=In();if(e.length===0)return 0;let t=0,n=[];for(let s of e)try{let r;switch(s.type){case"create_pin":r=await Ot(s.data);break;case"create_comment":r=await qt(s.data.pinId,s.data.body,s.data.mentions);break;case"update_pin":r=await bt(s.data.pinId,s.data.updates);break;case"submit_report":r=await jt(s.data);break;default:r={success:!1,error:"Unknown action"}}r.success?t++:n.push(s)}catch{n.push(s)}return localStorage.setItem(Ut,JSON.stringify(n)),t}typeof window<"u"&&window.addEventListener("online",()=>{zs().catch(()=>{})});var Ft=[{id:"slate",name:"Slate",preview:["#0f1117","#6E9ED0"],vars:{"--bs-bg":"#0f1117","--bs-bg2":"#1a1d27","--bs-bg3":"#2a2d37","--bs-text":"#e8eaed","--bs-muted":"#9ca3af","--bs-border":"#2a2d37","--bs-accent":"#6E9ED0","--bs-accent2":"#C3CAD6","--bs-fab1":"#6E9ED0","--bs-fab2":"#4a7ba8","--bs-radius":"12px","--bs-radius-sm":"8px","--bs-red":"#ef4444","--bs-green":"#22c55e","--bs-orange":"#f97316","--bs-yellow":"#eab308"}},{id:"black",name:"Dark",preview:["#0a0a0a","#ffffff"],vars:{"--bs-bg":"#0a0a0a","--bs-bg2":"#141414","--bs-bg3":"#1e1e1e","--bs-text":"#f5f5f5","--bs-muted":"#737373","--bs-border":"#262626","--bs-accent":"#f5f5f5","--bs-accent2":"#d4d4d4","--bs-fab1":"#262626","--bs-fab2":"#171717","--bs-radius":"12px","--bs-radius-sm":"8px","--bs-red":"#ef4444","--bs-green":"#22c55e","--bs-orange":"#f97316","--bs-yellow":"#eab308"}},{id:"white",name:"Light",preview:["#ffffff","#0a0a0a"],vars:{"--bs-bg":"#ffffff","--bs-bg2":"#f5f5f5","--bs-bg3":"#e5e5e5","--bs-text":"#0a0a0a","--bs-muted":"#737373","--bs-border":"#e5e5e5","--bs-accent":"#0a0a0a","--bs-accent2":"#404040","--bs-fab1":"#0a0a0a","--bs-fab2":"#262626","--bs-radius":"12px","--bs-radius-sm":"8px","--bs-red":"#dc2626","--bs-green":"#16a34a","--bs-orange":"#ea580c","--bs-yellow":"#ca8a04"}}];function ut(){return Ft}function mt(e){return Ft.find(t=>t.id===e)}function Hn(){return Ft[0]}var Wt=[{id:"classic",name:"Center",description:"Centered modal",tabPosition:"top"},{id:"drawer-right",name:"Right Drawer",description:"Slides from right",tabPosition:"top"},{id:"bottom-sheet",name:"Bottom Sheet",description:"Slides from bottom",tabPosition:"top"},{id:"sidebar-tabs",name:"Sidebar",description:"Side navigation",tabPosition:"left"}];function gt(){return Wt}function Ue(e){return Wt.find(t=>t.id===e)}function Rn(){return Wt[0]}var Bn=`
|
|
11
22
|
/* \u2500\u2500 1. Classic (default \u2014 no overrides) \u2500\u2500 */
|
|
12
23
|
|
|
13
24
|
/* \u2500\u2500 2. Drawer Right \u2500\u2500 */
|
|
@@ -24,21 +35,7 @@ ${t.stack??""}`;if(typeof t=="object")try{return JSON.stringify(t,null,2)}catch{
|
|
|
24
35
|
opacity: 1;
|
|
25
36
|
}
|
|
26
37
|
|
|
27
|
-
/* \u2500\u2500 3.
|
|
28
|
-
.bs-ly-drawer-left.bs-modal {
|
|
29
|
-
top: 0; left: 0; right: auto; bottom: 0;
|
|
30
|
-
width: 420px; max-width: 100vw; max-height: 100vh;
|
|
31
|
-
height: 100vh;
|
|
32
|
-
border-radius: 0;
|
|
33
|
-
transform: translateX(-100%);
|
|
34
|
-
transition: transform 0.4s cubic-bezier(0.22,1,0.36,1), opacity 0.3s ease;
|
|
35
|
-
}
|
|
36
|
-
.bs-ly-drawer-left.bs-modal.bs-in {
|
|
37
|
-
transform: translateX(0);
|
|
38
|
-
opacity: 1;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/* \u2500\u2500 4. Bottom Sheet \u2500\u2500 */
|
|
38
|
+
/* \u2500\u2500 3. Bottom Sheet \u2500\u2500 */
|
|
42
39
|
.bs-ly-bottom-sheet.bs-modal {
|
|
43
40
|
top: auto; left: 50%; right: auto; bottom: 0;
|
|
44
41
|
width: 600px; max-width: 100vw;
|
|
@@ -52,105 +49,7 @@ ${t.stack??""}`;if(typeof t=="object")try{return JSON.stringify(t,null,2)}catch{
|
|
|
52
49
|
opacity: 1;
|
|
53
50
|
}
|
|
54
51
|
|
|
55
|
-
/* \u2500\u2500
|
|
56
|
-
.bs-ly-top-bar.bs-modal {
|
|
57
|
-
top: 0; left: 50%; bottom: auto;
|
|
58
|
-
width: 700px; max-width: 100vw;
|
|
59
|
-
max-height: 75vh;
|
|
60
|
-
border-radius: 0 0 var(--bs-radius) var(--bs-radius);
|
|
61
|
-
transform: translate(-50%, -100%);
|
|
62
|
-
transition: transform 0.45s cubic-bezier(0.22,1,0.36,1), opacity 0.3s ease;
|
|
63
|
-
}
|
|
64
|
-
.bs-ly-top-bar.bs-modal.bs-in {
|
|
65
|
-
transform: translate(-50%, 0);
|
|
66
|
-
opacity: 1;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/* \u2500\u2500 6. Compact \u2500\u2500 */
|
|
70
|
-
.bs-ly-compact.bs-modal {
|
|
71
|
-
width: 380px;
|
|
72
|
-
}
|
|
73
|
-
.bs-ly-compact .bs-scroll { padding: 12px 16px 16px; }
|
|
74
|
-
.bs-ly-compact .bs-hdr { padding: 14px 16px 0; }
|
|
75
|
-
.bs-ly-compact .bs-tabs { padding: 8px 16px 0; }
|
|
76
|
-
.bs-ly-compact .bs-tab { padding: 7px 10px; font-size: 11px; }
|
|
77
|
-
.bs-ly-compact .bs-field { margin-bottom: 10px; }
|
|
78
|
-
.bs-ly-compact .bs-input, .bs-ly-compact .bs-textarea { padding: 8px 10px; font-size: 13px; }
|
|
79
|
-
.bs-ly-compact .bs-submit-btn { padding: 10px; font-size: 13px; }
|
|
80
|
-
|
|
81
|
-
/* \u2500\u2500 7. Wide \u2500\u2500 */
|
|
82
|
-
.bs-ly-wide.bs-modal {
|
|
83
|
-
width: 720px;
|
|
84
|
-
}
|
|
85
|
-
.bs-ly-wide .bs-scroll { padding: 20px 32px 28px; }
|
|
86
|
-
.bs-ly-wide .bs-hdr { padding: 22px 32px 0; }
|
|
87
|
-
.bs-ly-wide .bs-tabs { padding: 14px 32px 0; }
|
|
88
|
-
|
|
89
|
-
/* \u2500\u2500 8. Fullscreen \u2500\u2500 */
|
|
90
|
-
.bs-ly-fullscreen.bs-modal {
|
|
91
|
-
top: 0; left: 0; width: 100vw; max-width: 100vw;
|
|
92
|
-
height: 100vh; max-height: 100vh;
|
|
93
|
-
border-radius: 0;
|
|
94
|
-
transform: scale(0.95);
|
|
95
|
-
transition: transform 0.35s cubic-bezier(0.22,1,0.36,1), opacity 0.3s ease;
|
|
96
|
-
}
|
|
97
|
-
.bs-ly-fullscreen.bs-modal.bs-in {
|
|
98
|
-
transform: scale(1);
|
|
99
|
-
opacity: 1;
|
|
100
|
-
}
|
|
101
|
-
.bs-ly-fullscreen .bs-scroll { padding: 24px 15%; }
|
|
102
|
-
.bs-ly-fullscreen .bs-hdr { padding: 24px 15% 0; }
|
|
103
|
-
.bs-ly-fullscreen .bs-tabs { padding: 16px 15% 0; }
|
|
104
|
-
|
|
105
|
-
/* \u2500\u2500 9. Corner Bottom-Right \u2500\u2500 */
|
|
106
|
-
.bs-ly-corner-br.bs-modal {
|
|
107
|
-
top: auto; left: auto; right: 24px; bottom: 88px;
|
|
108
|
-
width: 400px;
|
|
109
|
-
max-height: 70vh;
|
|
110
|
-
transform: translateY(20px) scale(0.95);
|
|
111
|
-
transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s ease;
|
|
112
|
-
}
|
|
113
|
-
.bs-ly-corner-br.bs-modal.bs-in {
|
|
114
|
-
transform: translateY(0) scale(1);
|
|
115
|
-
opacity: 1;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/* \u2500\u2500 10. Corner Bottom-Left \u2500\u2500 */
|
|
119
|
-
.bs-ly-corner-bl.bs-modal {
|
|
120
|
-
top: auto; left: 24px; right: auto; bottom: 88px;
|
|
121
|
-
width: 400px;
|
|
122
|
-
max-height: 70vh;
|
|
123
|
-
transform: translateY(20px) scale(0.95);
|
|
124
|
-
transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s ease;
|
|
125
|
-
}
|
|
126
|
-
.bs-ly-corner-bl.bs-modal.bs-in {
|
|
127
|
-
transform: translateY(0) scale(1);
|
|
128
|
-
opacity: 1;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
/* \u2500\u2500 11. Pill Tabs \u2500\u2500 */
|
|
132
|
-
.bs-ly-pill-tabs .bs-tabs {
|
|
133
|
-
background: var(--bs-bg2);
|
|
134
|
-
margin: 12px 22px 0;
|
|
135
|
-
border-radius: 999px;
|
|
136
|
-
padding: 4px;
|
|
137
|
-
gap: 4px;
|
|
138
|
-
}
|
|
139
|
-
.bs-ly-pill-tabs .bs-tab {
|
|
140
|
-
border-radius: 999px;
|
|
141
|
-
padding: 8px 14px;
|
|
142
|
-
justify-content: center;
|
|
143
|
-
flex: 1;
|
|
144
|
-
}
|
|
145
|
-
.bs-ly-pill-tabs .bs-tab.bs-active {
|
|
146
|
-
background: var(--bs-accent);
|
|
147
|
-
color: #fff;
|
|
148
|
-
}
|
|
149
|
-
.bs-ly-pill-tabs .bs-tab.bs-active::after { display: none; }
|
|
150
|
-
.bs-ly-pill-tabs .bs-tab.bs-active .bs-tab-badge { background: rgba(255,255,255,0.25); color: #fff; }
|
|
151
|
-
.bs-ly-pill-tabs .bs-tab-divider { display: none; }
|
|
152
|
-
|
|
153
|
-
/* \u2500\u2500 12. Sidebar Tabs \u2500\u2500 */
|
|
52
|
+
/* \u2500\u2500 4. Sidebar Tabs \u2500\u2500 */
|
|
154
53
|
.bs-ly-sidebar-tabs.bs-modal {
|
|
155
54
|
width: 620px;
|
|
156
55
|
}
|
|
@@ -179,162 +78,7 @@ ${t.stack??""}`;if(typeof t=="object")try{return JSON.stringify(t,null,2)}catch{
|
|
|
179
78
|
}
|
|
180
79
|
.bs-ly-sidebar-tabs .bs-tab-divider { display: none; }
|
|
181
80
|
.bs-ly-sidebar-tabs .bs-scroll { flex: 1; }
|
|
182
|
-
|
|
183
|
-
/* \u2500\u2500 13. Segmented \u2500\u2500 */
|
|
184
|
-
.bs-ly-segmented .bs-tabs {
|
|
185
|
-
background: var(--bs-bg2);
|
|
186
|
-
margin: 12px 22px 0;
|
|
187
|
-
border-radius: var(--bs-radius-sm);
|
|
188
|
-
padding: 3px;
|
|
189
|
-
gap: 3px;
|
|
190
|
-
border: 1px solid var(--bs-border);
|
|
191
|
-
}
|
|
192
|
-
.bs-ly-segmented .bs-tab {
|
|
193
|
-
border-radius: calc(var(--bs-radius-sm) - 2px);
|
|
194
|
-
padding: 8px 12px;
|
|
195
|
-
justify-content: center;
|
|
196
|
-
flex: 1;
|
|
197
|
-
font-size: 11px;
|
|
198
|
-
}
|
|
199
|
-
.bs-ly-segmented .bs-tab.bs-active { background: var(--bs-bg); box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
|
|
200
|
-
.bs-ly-segmented .bs-tab.bs-active::after { display: none; }
|
|
201
|
-
.bs-ly-segmented .bs-tab-divider { display: none; }
|
|
202
|
-
|
|
203
|
-
/* \u2500\u2500 14. Minimal \u2500\u2500 */
|
|
204
|
-
.bs-ly-minimal.bs-modal {
|
|
205
|
-
border: none;
|
|
206
|
-
box-shadow: 0 40px 100px rgba(0,0,0,0.5);
|
|
207
|
-
}
|
|
208
|
-
.bs-ly-minimal .bs-hdr { padding: 28px 32px 0; }
|
|
209
|
-
.bs-ly-minimal .bs-tabs { padding: 16px 32px 0; }
|
|
210
|
-
.bs-ly-minimal .bs-scroll { padding: 24px 32px 32px; }
|
|
211
|
-
.bs-ly-minimal .bs-field { margin-bottom: 22px; }
|
|
212
|
-
.bs-ly-minimal .bs-input, .bs-ly-minimal .bs-textarea {
|
|
213
|
-
border-color: transparent;
|
|
214
|
-
background: var(--bs-bg2);
|
|
215
|
-
}
|
|
216
|
-
.bs-ly-minimal .bs-input:focus, .bs-ly-minimal .bs-textarea:focus { border-color: var(--bs-accent); }
|
|
217
|
-
.bs-ly-minimal .bs-tab { font-weight: 400; letter-spacing: 0.5px; }
|
|
218
|
-
.bs-ly-minimal .bs-tab.bs-active { font-weight: 700; }
|
|
219
|
-
|
|
220
|
-
/* \u2500\u2500 15. Dense \u2500\u2500 */
|
|
221
|
-
.bs-ly-dense.bs-modal { width: 480px; }
|
|
222
|
-
.bs-ly-dense .bs-hdr { padding: 10px 14px 0; }
|
|
223
|
-
.bs-ly-dense .bs-logo { font-size: 14px; }
|
|
224
|
-
.bs-ly-dense .bs-tabs { padding: 6px 14px 0; }
|
|
225
|
-
.bs-ly-dense .bs-tab { padding: 6px 8px; font-size: 10px; gap: 4px; }
|
|
226
|
-
.bs-ly-dense .bs-tab svg { width: 12px; height: 12px; }
|
|
227
|
-
.bs-ly-dense .bs-tab-divider { margin: 0; }
|
|
228
|
-
.bs-ly-dense .bs-scroll { padding: 10px 14px 14px; }
|
|
229
|
-
.bs-ly-dense .bs-field { margin-bottom: 8px; }
|
|
230
|
-
.bs-ly-dense .bs-field-label { font-size: 11px; margin-bottom: 4px; }
|
|
231
|
-
.bs-ly-dense .bs-input, .bs-ly-dense .bs-textarea { padding: 7px 10px; font-size: 12px; }
|
|
232
|
-
.bs-ly-dense .bs-textarea { min-height: 50px; }
|
|
233
|
-
.bs-ly-dense .bs-sev-btn { padding: 6px 0; font-size: 10px; }
|
|
234
|
-
.bs-ly-dense .bs-shot-area { padding: 8px 10px; }
|
|
235
|
-
.bs-ly-dense .bs-submit-btn { padding: 10px; font-size: 13px; }
|
|
236
|
-
|
|
237
|
-
/* \u2500\u2500 16. Bubble / Rounded \u2500\u2500 */
|
|
238
|
-
.bs-ly-rounded.bs-modal { border-radius: 28px; }
|
|
239
|
-
.bs-ly-rounded .bs-hdr { padding: 22px 26px 0; }
|
|
240
|
-
.bs-ly-rounded .bs-tabs { padding: 14px 26px 0; }
|
|
241
|
-
.bs-ly-rounded .bs-tab { border-radius: 16px 16px 0 0; }
|
|
242
|
-
.bs-ly-rounded .bs-scroll { padding: 18px 26px 26px; }
|
|
243
|
-
.bs-ly-rounded .bs-input, .bs-ly-rounded .bs-textarea { border-radius: 16px; }
|
|
244
|
-
.bs-ly-rounded .bs-sev-btn { border-radius: 16px; }
|
|
245
|
-
.bs-ly-rounded .bs-submit-btn { border-radius: 20px; }
|
|
246
|
-
.bs-ly-rounded .bs-shot-area { border-radius: 18px; }
|
|
247
|
-
.bs-ly-rounded .bs-log, .bs-ly-rounded .bs-net { border-radius: 14px; }
|
|
248
|
-
.bs-ly-rounded .bs-err-card { border-radius: 16px; }
|
|
249
|
-
|
|
250
|
-
/* \u2500\u2500 17. Sharp \u2500\u2500 */
|
|
251
|
-
.bs-ly-sharp.bs-modal { border-radius: 0; }
|
|
252
|
-
.bs-ly-sharp .bs-tab { border-radius: 0; }
|
|
253
|
-
.bs-ly-sharp .bs-tab.bs-active::after { border-radius: 0; }
|
|
254
|
-
.bs-ly-sharp .bs-input, .bs-ly-sharp .bs-textarea { border-radius: 0; }
|
|
255
|
-
.bs-ly-sharp .bs-sev-btn { border-radius: 0; }
|
|
256
|
-
.bs-ly-sharp .bs-submit-btn { border-radius: 0; }
|
|
257
|
-
.bs-ly-sharp .bs-shot-area { border-radius: 0; }
|
|
258
|
-
.bs-ly-sharp .bs-log, .bs-ly-sharp .bs-net { border-radius: 0; }
|
|
259
|
-
.bs-ly-sharp .bs-err-card { border-radius: 0; }
|
|
260
|
-
.bs-ly-sharp .bs-msg { border-radius: 0; }
|
|
261
|
-
.bs-ly-sharp .bs-ann-wrap { border-radius: 0; }
|
|
262
|
-
.bs-ly-sharp .bs-fab { border-radius: 0; }
|
|
263
|
-
|
|
264
|
-
/* \u2500\u2500 18. Split View \u2500\u2500 */
|
|
265
|
-
.bs-ly-split.bs-modal {
|
|
266
|
-
width: 700px;
|
|
267
|
-
}
|
|
268
|
-
.bs-ly-split .bs-body-wrap {
|
|
269
|
-
display: flex;
|
|
270
|
-
flex: 1;
|
|
271
|
-
overflow: hidden;
|
|
272
|
-
}
|
|
273
|
-
.bs-ly-split .bs-tabs {
|
|
274
|
-
flex-direction: column;
|
|
275
|
-
padding: 16px 0 16px 16px;
|
|
276
|
-
gap: 6px;
|
|
277
|
-
min-width: 160px;
|
|
278
|
-
border-right: 1px solid var(--bs-border);
|
|
279
|
-
overflow-y: auto;
|
|
280
|
-
}
|
|
281
|
-
.bs-ly-split .bs-tab {
|
|
282
|
-
border-radius: var(--bs-radius-sm);
|
|
283
|
-
padding: 12px 14px;
|
|
284
|
-
width: 100%;
|
|
285
|
-
font-size: 13px;
|
|
286
|
-
}
|
|
287
|
-
.bs-ly-split .bs-tab.bs-active { background: var(--bs-accent); color: #fff; }
|
|
288
|
-
.bs-ly-split .bs-tab.bs-active::after { display: none; }
|
|
289
|
-
.bs-ly-split .bs-tab.bs-active .bs-tab-badge { background: rgba(255,255,255,0.25); color: #fff; }
|
|
290
|
-
.bs-ly-split .bs-tab-divider { display: none; }
|
|
291
|
-
.bs-ly-split .bs-scroll { flex: 1; }
|
|
292
|
-
|
|
293
|
-
/* \u2500\u2500 19. Floating \u2500\u2500 */
|
|
294
|
-
.bs-ly-floating.bs-modal {
|
|
295
|
-
border: none;
|
|
296
|
-
box-shadow: 0 50px 120px rgba(0,0,0,0.7), 0 20px 50px rgba(0,0,0,0.4);
|
|
297
|
-
border-radius: 24px;
|
|
298
|
-
}
|
|
299
|
-
.bs-ly-floating .bs-hdr { padding: 22px 26px 0; }
|
|
300
|
-
.bs-ly-floating .bs-tabs {
|
|
301
|
-
padding: 14px 26px 0;
|
|
302
|
-
background: transparent;
|
|
303
|
-
}
|
|
304
|
-
.bs-ly-floating .bs-tab {
|
|
305
|
-
background: var(--bs-bg2);
|
|
306
|
-
border-radius: var(--bs-radius-sm);
|
|
307
|
-
margin-right: 4px;
|
|
308
|
-
}
|
|
309
|
-
.bs-ly-floating .bs-tab.bs-active {
|
|
310
|
-
background: var(--bs-bg3);
|
|
311
|
-
box-shadow: 0 2px 8px rgba(0,0,0,0.2);
|
|
312
|
-
}
|
|
313
|
-
.bs-ly-floating .bs-tab.bs-active::after { display: none; }
|
|
314
|
-
.bs-ly-floating .bs-tab-divider { display: none; }
|
|
315
|
-
.bs-ly-floating .bs-scroll { padding: 18px 26px 26px; }
|
|
316
|
-
|
|
317
|
-
/* \u2500\u2500 20. Bottom Tabs \u2500\u2500 */
|
|
318
|
-
.bs-ly-bottom-tabs .bs-tabs {
|
|
319
|
-
order: 99;
|
|
320
|
-
padding: 0 22px 12px;
|
|
321
|
-
border-top: 1px solid var(--bs-border);
|
|
322
|
-
border-bottom: none;
|
|
323
|
-
background: var(--bs-bg);
|
|
324
|
-
}
|
|
325
|
-
.bs-ly-bottom-tabs .bs-tab {
|
|
326
|
-
border-radius: 0 0 var(--bs-radius-sm) var(--bs-radius-sm);
|
|
327
|
-
flex: 1;
|
|
328
|
-
justify-content: center;
|
|
329
|
-
padding: 12px 8px;
|
|
330
|
-
}
|
|
331
|
-
.bs-ly-bottom-tabs .bs-tab.bs-active::after {
|
|
332
|
-
top: 0; bottom: auto;
|
|
333
|
-
border-radius: 0 0 2px 2px;
|
|
334
|
-
}
|
|
335
|
-
.bs-ly-bottom-tabs .bs-tab-divider { order: 98; }
|
|
336
|
-
.bs-ly-bottom-tabs .bs-scroll { order: 1; }
|
|
337
|
-
`;var ye=null,pt=0,$n=5e3,xe=new Map,ve=null,ut=new Set;function ft(e){ve=e,pt=Date.now(),Mn()}function Mn(){ye||(ye=setInterval(Pn,$n))}async function Pn(){if(!ve)return;let e=Ls();if(e)try{let t=ks(),s=window.location.pathname,n=await fetch(`${t}/api/pins/poll?projectId=${ve}&pathname=${encodeURIComponent(s)}&since=${pt}`,{headers:{Authorization:`Bearer ${e}`}});if(!n.ok)return;let r=await n.json();if(!r.success)return;let{pins:i,serverTime:c}=r.data;pt=c;for(let p of i)ut.has(p.id)?Is("pin:updated",{type:"pin:updated",projectId:ve,data:p,userId:"",timestamp:Date.now()}):(ut.add(p.id),Is("pin:created",{type:"pin:created",projectId:ve,data:p,userId:"",timestamp:Date.now()}))}catch{}}function Hs(){ye&&(clearInterval(ye),ye=null),ve=null,ut.clear(),pt=0}function je(e,t){return xe.has(e)||xe.set(e,new Set),xe.get(e).add(t),()=>{xe.get(e)?.delete(t)}}function Is(e,t){xe.get(e)?.forEach(s=>s(t)),xe.get("*")?.forEach(s=>s(t))}function Rs(e){ut=new Set(e)}function Bs(){return ye!==null}var gt,A=null,j=[],Os=[],we=!1,Oe=null,zn="",Ns={open:"#f97316",in_progress:"#3b82f6",resolved:"#22c55e",closed:"#6b7280"};function mt(e){gt=e,zn=window.location.pathname,An(),Us(),In(),Nn(),Dn()}function qs(){A&&(A.remove(),A=null),j=[]}function ht(e){return we=e!==void 0?e:!we,A&&A.classList.toggle("bs-pin-mode",we),we}function xt(){return we}function An(){if(A)return;A=document.createElement("div"),A.id="bugstash-live-pins";let e=document.createElement("style");e.textContent=`
|
|
81
|
+
`;var Le=null,ft=0,As=5e3,ke=new Map,Ee=null,ht=new Set;function vt(e){Ee=e,ft=Date.now(),Is()}function Is(){Le||(Le=setInterval(Hs,As))}async function Hs(){if(!Ee)return;let e=$n();if(e)try{let t=Cn(),n=window.location.pathname,s=await fetch(`${t}/api/pins/poll?projectId=${Ee}&pathname=${encodeURIComponent(n)}&since=${ft}`,{headers:{Authorization:`Bearer ${e}`}});if(!s.ok)return;let r=await s.json();if(!r.success)return;let{pins:a,serverTime:l}=r.data;ft=l;for(let d of a)ht.has(d.id)?Nn("pin:updated",{type:"pin:updated",projectId:Ee,data:d,userId:"",timestamp:Date.now()}):(ht.add(d.id),Nn("pin:created",{type:"pin:created",projectId:Ee,data:d,userId:"",timestamp:Date.now()}))}catch{}}function Dn(){Le&&(clearInterval(Le),Le=null),Ee=null,ht.clear(),ft=0}function _e(e,t){return ke.has(e)||ke.set(e,new Set),ke.get(e).add(t),()=>{ke.get(e)?.delete(t)}}function Nn(e,t){ke.get(e)?.forEach(n=>n(t)),ke.get("*")?.forEach(n=>n(t))}function jn(e){ht=new Set(e)}function On(){return Le!==null}var xt,A=null,U=[],Fn=[],Se=!1,Fe=null,Rs="",qn={open:"#f97316",in_progress:"#3b82f6",resolved:"#22c55e",closed:"#6b7280"};function yt(e){xt=e,Rs=window.location.pathname,Bs(),Yn(),Ns(),qs(),Us()}function Wn(){A&&(A.remove(),A=null),U=[]}function We(e){return Se=e!==void 0?e:!Se,A&&A.classList.toggle("bs-pin-mode",Se),Se}function wt(){return Se}function Bs(){if(A)return;A=document.createElement("div"),A.id="bugstash-live-pins";let e=document.createElement("style");e.textContent=`
|
|
338
82
|
#bugstash-live-pins {
|
|
339
83
|
position: fixed;
|
|
340
84
|
inset: 0;
|
|
@@ -564,27 +308,27 @@ ${t.stack??""}`;if(typeof t=="object")try{return JSON.stringify(t,null,2)}catch{
|
|
|
564
308
|
background: #333754;
|
|
565
309
|
color: #a0a4b8;
|
|
566
310
|
}
|
|
567
|
-
`,A.appendChild(e),document.body.appendChild(A),A.addEventListener("click",t=>{if(!
|
|
568
|
-
<div class="bs-lp-dot" style="background:${
|
|
311
|
+
`,A.appendChild(e),document.body.appendChild(A),A.addEventListener("click",t=>{if(!Se||t.target.closest(".bs-lp, .bs-lp-popup, .bs-lp-newform"))return;let n=t.clientX+window.scrollX,s=t.clientY+window.scrollY;A.style.pointerEvents="none";let r=document.elementFromPoint(t.clientX,t.clientY);A.style.pointerEvents="",Os(n,s,r)})}async function Yn(){let e=await Mn(xt,window.location.pathname);e.success&&e.data&&(U=e.data,jn(U.map(t=>t.id)),re())}async function Ns(){let e=await An(xt);e.success&&e.data&&(Fn=e.data)}function re(){A&&(A.querySelectorAll(".bs-lp").forEach(e=>e.remove()),U.forEach((e,t)=>{let n=document.createElement("div");n.className="bs-lp",n.style.left=`${e.pageX}px`,n.style.top=`${e.pageY}px`,n.dataset.pinId=e.id;let s=qn[e.status]||qn.open;n.innerHTML=`
|
|
312
|
+
<div class="bs-lp-dot" style="background:${s}">
|
|
569
313
|
<span>${t+1}</span>
|
|
570
314
|
</div>
|
|
571
|
-
`,
|
|
315
|
+
`,n.addEventListener("click",r=>{r.stopPropagation(),Ds(e,n)}),A.appendChild(n)}))}function Un(e){let t=Date.now()-e,n=Math.floor(t/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;let s=Math.floor(n/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`}function _n(e){return{open:"#f97316",in_progress:"#3b82f6",resolved:"#22c55e",closed:"#6b7280"}[e]||"#6b7280"}async function Ds(e,t){ue();let n=document.createElement("div");n.className="bs-lp-popup";let s=await zn(e.id),r=s.success&&s.data?s.data:[],a=Q(),l=a&&(a.role==="owner"||a.role==="admin"||a.id===e.createdBy);n.innerHTML=`
|
|
572
316
|
<div class="bs-lp-popup-header">
|
|
573
|
-
<div class="bs-lp-popup-title">${
|
|
574
|
-
<span class="bs-lp-popup-status" style="background:${
|
|
317
|
+
<div class="bs-lp-popup-title">${se(e.title)}</div>
|
|
318
|
+
<span class="bs-lp-popup-status" style="background:${_n(e.status)}22;color:${_n(e.status)}">${e.status.replace("_"," ")}</span>
|
|
575
319
|
<button class="bs-lp-close">×</button>
|
|
576
320
|
</div>
|
|
577
|
-
${e.description?`<div class="bs-lp-popup-body">${
|
|
321
|
+
${e.description?`<div class="bs-lp-popup-body">${se(e.description)}</div>`:""}
|
|
578
322
|
<div class="bs-lp-popup-meta">
|
|
579
|
-
<span>${e.creatorName||"Unknown"} · ${
|
|
323
|
+
<span>${e.creatorName||"Unknown"} · ${Un(e.createdAt)}</span>
|
|
580
324
|
<span>${e.assigneeName?`Assigned: ${e.assigneeName}`:"Unassigned"}</span>
|
|
581
325
|
</div>
|
|
582
326
|
<div class="bs-lp-comments" id="bs-lp-comments">
|
|
583
|
-
${r.map(
|
|
327
|
+
${r.map(c=>`
|
|
584
328
|
<div class="bs-lp-comment">
|
|
585
|
-
<div class="bs-lp-comment-author">${
|
|
586
|
-
<div class="bs-lp-comment-body">${
|
|
587
|
-
<div class="bs-lp-comment-time">${
|
|
329
|
+
<div class="bs-lp-comment-author">${se(c.author?.name||c.authorName||"Unknown")}</div>
|
|
330
|
+
<div class="bs-lp-comment-body">${se(c.body)}</div>
|
|
331
|
+
<div class="bs-lp-comment-time">${Un(new Date(c.createdAt).getTime())}</div>
|
|
588
332
|
</div>
|
|
589
333
|
`).join("")}
|
|
590
334
|
</div>
|
|
@@ -594,15 +338,15 @@ ${t.stack??""}`;if(typeof t=="object")try{return JSON.stringify(t,null,2)}catch{
|
|
|
594
338
|
</div>
|
|
595
339
|
<div class="bs-lp-actions">
|
|
596
340
|
${e.status!=="resolved"?'<button class="bs-lp-btn resolve" id="bs-lp-resolve">Resolve</button>':'<button class="bs-lp-btn" id="bs-lp-reopen">Reopen</button>'}
|
|
597
|
-
${
|
|
341
|
+
${l?'<button class="bs-lp-btn delete" id="bs-lp-delete">Delete</button>':""}
|
|
598
342
|
</div>
|
|
599
|
-
`,t.appendChild(
|
|
343
|
+
`,t.appendChild(n),Fe=n,n.querySelector(".bs-lp-close").addEventListener("click",c=>{c.stopPropagation(),ue()}),n.querySelector("#bs-lp-comment-send")?.addEventListener("click",async()=>{let c=n.querySelector("#bs-lp-comment-input"),v=c.value.trim();if(v)if(c.value="",navigator.onLine){let b=await qt(e.id,v);if(b.success&&b.data){let h=n.querySelector("#bs-lp-comments"),y=b.data;h.innerHTML+=`
|
|
600
344
|
<div class="bs-lp-comment">
|
|
601
|
-
<div class="bs-lp-comment-author">${
|
|
602
|
-
<div class="bs-lp-comment-body">${
|
|
345
|
+
<div class="bs-lp-comment-author">${se(y.authorName||a?.name||"You")}</div>
|
|
346
|
+
<div class="bs-lp-comment-body">${se(y.body)}</div>
|
|
603
347
|
<div class="bs-lp-comment-time">just now</div>
|
|
604
348
|
</div>
|
|
605
|
-
`,h.scrollTop=h.scrollHeight}}else
|
|
349
|
+
`,h.scrollTop=h.scrollHeight}}else _t({type:"create_comment",data:{pinId:e.id,body:v}})}),n.querySelector("#bs-lp-comment-input")?.addEventListener("keydown",c=>{c.key==="Enter"&&n.querySelector("#bs-lp-comment-send")?.dispatchEvent(new Event("click"))}),n.querySelector("#bs-lp-resolve")?.addEventListener("click",async()=>{await bt(e.id,{status:"resolved"}),e.status="resolved",ue(),re()}),n.querySelector("#bs-lp-reopen")?.addEventListener("click",async()=>{await bt(e.id,{status:"open"}),e.status="open",ue(),re()}),n.querySelector("#bs-lp-delete")?.addEventListener("click",async()=>{confirm("Delete this pin?")&&(await Pn(e.id),U=U.filter(c=>c.id!==e.id),ue(),re())}),n.addEventListener("click",c=>c.stopPropagation())}function ue(){Fe?.remove(),Fe=null}function Xn(e){if(!e||e===document.body||e===document.documentElement)return"body";if(e.id)return`#${e.id}`;let t=e.tagName.toLowerCase();if(e.className&&typeof e.className=="string"){let s=e.className.trim().split(/\s+/).filter(r=>!r.startsWith("bs-")).slice(0,3);s.length&&(t+="."+s.join("."))}let n=e.parentElement;if(n&&n!==document.body){let s=Array.from(n.children).filter(r=>r.tagName===e.tagName);if(s.length>1){let r=s.indexOf(e);t+=`:nth-child(${r+1})`}return Xn(n)+" > "+t}return t}function js(e){if(!e)return"";let t=[],n=e;for(;n&&n!==document.body;){let s=1,r=n.previousElementSibling;for(;r;)r.tagName===n.tagName&&s++,r=r.previousElementSibling;t.unshift(`${n.tagName.toLowerCase()}[${s}]`),n=n.parentElement}return"/body/"+t.join("/")}function Os(e,t,n){ue(),A?.querySelectorAll(".bs-lp-newform").forEach(a=>a.remove());let s=document.createElement("div");s.className="bs-lp-newform",s.style.left=`${e+16}px`,s.style.top=`${t-8}px`,requestAnimationFrame(()=>{let a=s.getBoundingClientRect();a.right>window.innerWidth-16&&(s.style.left=`${e-336}px`),a.bottom>window.innerHeight-16&&(s.style.top=`${t-a.height}px`)});let r=Fn.filter(a=>a.userId!==Q()?.id).map(a=>`<option value="${a.userId}">${se(a.name)}</option>`).join("");s.innerHTML=`
|
|
606
350
|
<label>Title *</label>
|
|
607
351
|
<input type="text" id="bs-np-title" placeholder="What's the issue?" autofocus />
|
|
608
352
|
<label>Description</label>
|
|
@@ -633,13 +377,13 @@ ${t.stack??""}`;if(typeof t=="object")try{return JSON.stringify(t,null,2)}catch{
|
|
|
633
377
|
<button class="bs-lp-newform-cancel" id="bs-np-cancel">Cancel</button>
|
|
634
378
|
<button class="bs-lp-newform-submit" id="bs-np-submit">Create Pin</button>
|
|
635
379
|
</div>
|
|
636
|
-
`,A.appendChild(
|
|
380
|
+
`,A.appendChild(s),s.addEventListener("click",a=>a.stopPropagation()),s.querySelector("#bs-np-cancel").addEventListener("click",()=>s.remove()),s.querySelector("#bs-np-submit").addEventListener("click",async()=>{let a=s.querySelector("#bs-np-title").value.trim();if(!a){s.querySelector("#bs-np-title").style.borderColor="#ef4444";return}let l=s.querySelector("#bs-np-desc").value.trim(),d=s.querySelector("#bs-np-priority").value,c=s.querySelector("#bs-np-category").value,b=s.querySelector("#bs-np-assignee")?.value||void 0,h=Xn(n),y=js(n),M=te().slice(-20).map(k=>`[${k.level}] ${k.args.join(" ")}`),ae=ne().slice(-10).map(k=>`${k.message} at ${k.source}:${k.lineno}`),Me=le().slice(-10).map(k=>`${k.method} ${k.url} \u2192 ${k.status}`),R;try{s.style.display="none",A.style.display="none",R=await qe()??void 0,A.style.display="",s.style.display=""}catch{}let P={projectId:xt,pageUrl:window.location.href,pathname:window.location.pathname,elementSelector:h,elementXPath:y,xPercent:0,yPercent:0,pageX:e,pageY:t,title:a,description:l,screenshot:R,priority:d,category:c,assigneeId:b,browserInfo:navigator.userAgent,screenSize:`${screen.width}x${screen.height}`,viewportSize:`${window.innerWidth}x${window.innerHeight}`,devicePixelRatio:window.devicePixelRatio,consoleLogs:M,networkErrors:Me,jsErrors:ae};if(s.remove(),navigator.onLine){let k=await Ot(P);k.success&&k.data&&(U.push(k.data),re())}else _t({type:"create_pin",data:P}),U.push({...P,id:"local-"+Date.now(),orgId:"",status:"open",tags:[],createdById:Q()?.id||"",creatorName:Q()?.name||"",commentCount:0,createdAt:Date.now(),updatedAt:Date.now()}),re()}),setTimeout(()=>s.querySelector("#bs-np-title")?.focus(),50)}function qs(){_e("pin:created",e=>{let t=e.data;t.pathname===window.location.pathname&&(U.find(n=>n.id===t.id)||(U.push(t),re()))}),_e("pin:updated",e=>{let t=e.data,n=U.findIndex(s=>s.id===t.id);n>=0&&(U[n]={...U[n],...t},re())}),_e("pin:deleted",e=>{let{id:t}=e.data;U=U.filter(n=>n.id!==t),ue(),re()}),_e("comment:created",e=>{let t=e.data;if(Fe){let n=Fe.querySelector("#bs-lp-comments");n&&(n.innerHTML+=`
|
|
637
381
|
<div class="bs-lp-comment">
|
|
638
|
-
<div class="bs-lp-comment-author">${
|
|
639
|
-
<div class="bs-lp-comment-body">${
|
|
382
|
+
<div class="bs-lp-comment-author">${se(t.author?.name||"Someone")}</div>
|
|
383
|
+
<div class="bs-lp-comment-body">${se(t.body)}</div>
|
|
640
384
|
<div class="bs-lp-comment-time">just now</div>
|
|
641
385
|
</div>
|
|
642
|
-
`,
|
|
386
|
+
`,n.scrollTop=n.scrollHeight)}})}function Us(){let e=window.location.pathname,t=()=>{window.location.pathname!==e&&(e=window.location.pathname,window.location.href,Yn())},n=history.pushState,s=history.replaceState;history.pushState=function(...r){n.apply(this,r),t()},history.replaceState=function(...r){s.apply(this,r),t()},window.addEventListener("popstate",t)}function se(e){let t=document.createElement("div");return t.textContent=e,t.innerHTML}var X,D=null,B=null,f=null,Y=null,Ye=null,Xe=null,K=!1,Et=!1,Ce="report";var de=Hn(),me=Rn(),N={bug:'<svg width="28" height="28" viewBox="55 38 60 105" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M95.8 44h-29c-3 0-5.4 2.4-5.4 5.4v29c0 3 2.4 5.4 5.4 5.4h19.5c13 0 23.5-10.5 23.5-23.5v-2.8c0-7.5-6-13.5-13.5-13.5h-.5zm-6.2 28.2H74.8V57.4h14.8c5.8 0 10.4 4.7 10.4 10.4s-4.7 10.4-10.4 10.4z" fill="rgba(255,255,255,0.85)"/><path d="M100.4 96h-33.6c-3 0-5.4 2.4-5.4 5.4v33.6c0 3 2.4 5.4 5.4 5.4h22c15 0 27-12 27-27v-3.9c0-7.5-6-13.5-13.5-13.5h-1.9zm-7.8 32.2H74.8v-20h17.8c6.7 0 12.2 5.5 12.2 12.2 0 4.3-3.5 7.8-7.8 7.8h-4.6z" fill="rgba(255,255,255,1)"/></svg>',x:'<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>',cam:'<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"/><circle cx="12" cy="13" r="4"/></svg>',check:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round"><polyline points="20 6 9 17 4 12"/></svg>',report:'<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><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"/></svg>',console:'<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="4 17 10 11 4 5"/><line x1="12" y1="19" x2="20" y2="19"/></svg>',network:'<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><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>',ctx:'<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg>',settings:'<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="4" y1="21" x2="4" y2="14"/><line x1="4" y1="10" x2="4" y2="3"/><line x1="12" y1="21" x2="12" y2="12"/><line x1="12" y1="8" x2="12" y2="3"/><line x1="20" y1="21" x2="20" y2="16"/><line x1="20" y1="12" x2="20" y2="3"/><line x1="1" y1="14" x2="7" y2="14"/><line x1="9" y1="8" x2="15" y2="8"/><line x1="17" y1="16" x2="23" y2="16"/></svg>',history:'<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>',pin:'<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><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>',sun:'<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/></svg>',moon:'<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/></svg>',keyboard:'<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><rect x="2" y="4" width="20" height="16" rx="2"/><line x1="6" y1="8" x2="6" y2="8"/><line x1="10" y1="8" x2="10" y2="8"/><line x1="14" y1="8" x2="14" y2="8"/><line x1="18" y1="8" x2="18" y2="8"/><line x1="8" y1="12" x2="16" y2="12"/><line x1="6" y1="16" x2="18" y2="16"/></svg>'},_s=`
|
|
643
387
|
@import url('https://fonts.googleapis.com/css2?family=Comfortaa:wght@400;600;700&family=Inter:wght@300;400;500;600;700&display=swap');
|
|
644
388
|
|
|
645
389
|
/* \u2500\u2500 FAB \u2500\u2500 */
|
|
@@ -706,6 +450,65 @@ ${t.stack??""}`;if(typeof t=="object")try{return JSON.stringify(t,null,2)}catch{
|
|
|
706
450
|
border-right: none;
|
|
707
451
|
}
|
|
708
452
|
|
|
453
|
+
/* \u2500\u2500 Quick Action Toolbar \u2500\u2500 */
|
|
454
|
+
.bs-toolbar {
|
|
455
|
+
position: fixed;
|
|
456
|
+
z-index: 2147483646;
|
|
457
|
+
display: flex;
|
|
458
|
+
flex-direction: column;
|
|
459
|
+
gap: 6px;
|
|
460
|
+
bottom: 88px;
|
|
461
|
+
opacity: 0;
|
|
462
|
+
transform: translateY(10px);
|
|
463
|
+
transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
|
|
464
|
+
pointer-events: none;
|
|
465
|
+
}
|
|
466
|
+
.bs-toolbar.bs-show {
|
|
467
|
+
opacity: 1;
|
|
468
|
+
transform: translateY(0);
|
|
469
|
+
pointer-events: all;
|
|
470
|
+
}
|
|
471
|
+
.bs-toolbar-btn {
|
|
472
|
+
all: unset;
|
|
473
|
+
width: 40px;
|
|
474
|
+
height: 40px;
|
|
475
|
+
border-radius: var(--bs-radius-sm);
|
|
476
|
+
background: var(--bs-bg2);
|
|
477
|
+
border: 1px solid var(--bs-border);
|
|
478
|
+
color: var(--bs-muted);
|
|
479
|
+
cursor: pointer;
|
|
480
|
+
display: flex;
|
|
481
|
+
align-items: center;
|
|
482
|
+
justify-content: center;
|
|
483
|
+
transition: all 0.2s;
|
|
484
|
+
position: relative;
|
|
485
|
+
box-shadow: 0 2px 8px rgba(0,0,0,0.15);
|
|
486
|
+
}
|
|
487
|
+
.bs-toolbar-btn:hover { color: var(--bs-text); border-color: var(--bs-accent); background: var(--bs-bg3); }
|
|
488
|
+
.bs-toolbar-btn.bs-active { color: var(--bs-accent); border-color: var(--bs-accent); }
|
|
489
|
+
.bs-toolbar-tip {
|
|
490
|
+
position: absolute;
|
|
491
|
+
right: calc(100% + 8px);
|
|
492
|
+
background: var(--bs-bg2);
|
|
493
|
+
color: var(--bs-text);
|
|
494
|
+
font-family: 'Inter', sans-serif;
|
|
495
|
+
font-size: 11px;
|
|
496
|
+
font-weight: 500;
|
|
497
|
+
padding: 4px 8px;
|
|
498
|
+
border-radius: 6px;
|
|
499
|
+
white-space: nowrap;
|
|
500
|
+
box-shadow: 0 2px 8px rgba(0,0,0,0.2);
|
|
501
|
+
opacity: 0;
|
|
502
|
+
pointer-events: none;
|
|
503
|
+
transition: opacity 0.15s;
|
|
504
|
+
}
|
|
505
|
+
.bs-toolbar-btn:hover .bs-toolbar-tip { opacity: 1; }
|
|
506
|
+
.bs-toolbar-kbd {
|
|
507
|
+
font-size: 9px;
|
|
508
|
+
color: var(--bs-muted);
|
|
509
|
+
margin-left: 4px;
|
|
510
|
+
}
|
|
511
|
+
|
|
709
512
|
/* \u2500\u2500 Backdrop \u2500\u2500 */
|
|
710
513
|
.bs-backdrop {
|
|
711
514
|
position: fixed;
|
|
@@ -1136,6 +939,53 @@ ${t.stack??""}`;if(typeof t=="object")try{return JSON.stringify(t,null,2)}catch{
|
|
|
1136
939
|
letter-spacing: 0.3px;
|
|
1137
940
|
color: var(--bs-muted);
|
|
1138
941
|
}
|
|
942
|
+
|
|
943
|
+
/* \u2500\u2500 Report Summary Bar \u2500\u2500 */
|
|
944
|
+
.bs-report-summary {
|
|
945
|
+
display: flex;
|
|
946
|
+
align-items: center;
|
|
947
|
+
justify-content: space-between;
|
|
948
|
+
padding: 10px 14px;
|
|
949
|
+
border-radius: var(--bs-radius-sm);
|
|
950
|
+
background: var(--bs-bg2);
|
|
951
|
+
border: 1px solid var(--bs-border);
|
|
952
|
+
margin-bottom: 16px;
|
|
953
|
+
font-size: 12px;
|
|
954
|
+
color: var(--bs-muted);
|
|
955
|
+
}
|
|
956
|
+
.bs-report-summary.bs-alert {
|
|
957
|
+
background: color-mix(in srgb, var(--bs-red) 6%, transparent);
|
|
958
|
+
border-color: color-mix(in srgb, var(--bs-red) 15%, transparent);
|
|
959
|
+
color: var(--bs-red);
|
|
960
|
+
}
|
|
961
|
+
.bs-report-summary.bs-has { color: var(--bs-text); }
|
|
962
|
+
.bs-report-summary-left { display: flex; align-items: center; gap: 8px; }
|
|
963
|
+
.bs-report-summary-icon {
|
|
964
|
+
width: 22px; height: 22px;
|
|
965
|
+
border-radius: 50%;
|
|
966
|
+
background: color-mix(in srgb, var(--bs-green) 12%, transparent);
|
|
967
|
+
color: var(--bs-green);
|
|
968
|
+
display: flex; align-items: center; justify-content: center;
|
|
969
|
+
font-size: 10px; flex-shrink: 0;
|
|
970
|
+
}
|
|
971
|
+
.bs-report-summary-icon.bs-warn {
|
|
972
|
+
background: color-mix(in srgb, var(--bs-red) 12%, transparent);
|
|
973
|
+
color: var(--bs-red);
|
|
974
|
+
font-weight: 800; font-size: 12px;
|
|
975
|
+
}
|
|
976
|
+
.bs-input-title {
|
|
977
|
+
font-size: 16px !important;
|
|
978
|
+
font-weight: 600;
|
|
979
|
+
padding: 14px !important;
|
|
980
|
+
}
|
|
981
|
+
.bs-report-row {
|
|
982
|
+
display: flex;
|
|
983
|
+
gap: 16px;
|
|
984
|
+
margin-bottom: 16px;
|
|
985
|
+
}
|
|
986
|
+
.bs-report-col { flex: 1; }
|
|
987
|
+
.bs-cat-icon { margin-right: 2px; }
|
|
988
|
+
|
|
1139
989
|
.bs-auto-step-n {
|
|
1140
990
|
width: 20px;
|
|
1141
991
|
height: 20px;
|
|
@@ -1594,7 +1444,7 @@ ${t.stack??""}`;if(typeof t=="object")try{return JSON.stringify(t,null,2)}catch{
|
|
|
1594
1444
|
.bs-set-ly.bs-picked { border-color: var(--bs-accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--bs-accent) 25%, transparent); }
|
|
1595
1445
|
.bs-set-ly-name { font-size: 12px; font-weight: 600; color: var(--bs-text); margin-bottom: 2px; }
|
|
1596
1446
|
.bs-set-ly-desc { font-size: 10px; color: var(--bs-muted); }
|
|
1597
|
-
`;function
|
|
1447
|
+
`;function Fs(){return`
|
|
1598
1448
|
<div class="bs-login-form">
|
|
1599
1449
|
<div class="bs-login-logo">BugStash</div>
|
|
1600
1450
|
<div class="bs-login-subtitle">Sign in to report bugs & collaborate</div>
|
|
@@ -1604,59 +1454,58 @@ ${t.stack??""}`;if(typeof t=="object")try{return JSON.stringify(t,null,2)}catch{
|
|
|
1604
1454
|
<button class="bs-login-btn" id="bs-login-submit">Sign In</button>
|
|
1605
1455
|
<div style="font-size:11px;color:var(--bs-muted);margin-top:4px">Contact your admin for an account</div>
|
|
1606
1456
|
</div>
|
|
1607
|
-
`}function I(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function
|
|
1457
|
+
`}function I(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Ws(e){let t=Math.floor((Date.now()-e)/1e3);return t<5?"now":t<60?`${t}s ago`:t<3600?`${Math.floor(t/60)}m ago`:new Date(e).toLocaleTimeString()}function Kn(e){return new Date(e).toLocaleTimeString("en",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}var Vn="bugstash_history";function Te(){try{return JSON.parse(localStorage.getItem(Vn)||"[]")}catch{return[]}}function Xt(e){try{localStorage.setItem(Vn,JSON.stringify(e))}catch{}}function Ys(e){let t=Te(),n=Date.now();t.unshift({...e,id:n}),t.length>50&&(t.length=50),Xt(t)}function Xs(e){let t=Te().filter(n=>n.id!==e);Xt(t)}function Js(e,t){let n=Te(),s=n.findIndex(r=>r.id===e);s>=0&&(n[s]={...n[s],...t},Xt(n))}function Qn(){return{url:window.location.href,userAgent:navigator.userAgent,platform:navigator.platform,language:navigator.language,cookiesEnabled:navigator.cookieEnabled,online:navigator.onLine,screenWidth:screen.width,screenHeight:screen.height,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,devicePixelRatio:window.devicePixelRatio,timestamp:Date.now(),environment:X.environment??"development",commitHash:X.commitHash,user:X.user}}function Zn(){let e=ne(),t=te(),n=ye(),s=le(),r=he(),a=we(),l=t.filter(v=>v.level==="error"),d="low";e.length>=3||s.length>=3?d="critical":e.length>=1||s.length>=2?d="high":(l.length>0||s.length>=1)&&(d="medium");let c=[];return e.length&&c.push("has-errors"),s.length&&c.push("network-failures"),l.length&&c.push("console-errors"),a?.pageLoadTime&&a.pageLoadTime>3e3&&c.push("slow-load"),a?.cumulativeLayoutShift&&a.cumulativeLayoutShift>.25&&c.push("layout-shift"),navigator.onLine||c.push("offline"),window.innerWidth<768&&c.push("mobile"),{severity:d,tags:c,counts:{logs:t.length,network:n.length,failedNet:s.length,errors:e.length,crumbs:r.length}}}function Gn(){let e=Zn(),t=[{id:"ui",label:"UI",icon:"\u{1F3A8}"},{id:"functionality",label:"Feature",icon:"\u2699\uFE0F"},{id:"performance",label:"Speed",icon:"\u26A1"},{id:"crash",label:"Crash",icon:"\u{1F4A5}"},{id:"security",label:"Security",icon:"\u{1F512}"},{id:"other",label:"Other",icon:"\u{1F4CC}"}],n=e.counts.errors>0||e.counts.failedNet>0;return`<div class="bs-view">
|
|
1608
1458
|
<form data-bs-form>
|
|
1609
|
-
<div class="bs-
|
|
1610
|
-
<div class="bs-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
<div class="bs-ctx-chip${e.counts.crumbs?" bs-has":""}"><span class="bs-ctx-n">${e.counts.crumbs}</span><span class="bs-ctx-l">Actions</span></div>
|
|
1459
|
+
<div class="bs-report-summary${n?" bs-alert":e.counts.logs>0?" bs-has":""}">
|
|
1460
|
+
<div class="bs-report-summary-left">
|
|
1461
|
+
${n?`<div class="bs-report-summary-icon bs-warn">!</div><span>${e.counts.errors} error${e.counts.errors!==1?"s":""}, ${e.counts.failedNet} failed request${e.counts.failedNet!==1?"s":""} detected</span>`:`<div class="bs-report-summary-icon">${N.check}</div><span>Auto-collecting ${e.counts.logs} logs, ${e.counts.network} requests, ${e.counts.crumbs} actions</span>`}
|
|
1462
|
+
</div>
|
|
1614
1463
|
</div>
|
|
1615
1464
|
<div class="bs-field">
|
|
1616
|
-
<
|
|
1617
|
-
<input class="bs-input" name="title" placeholder="Short summary \u2014 e.g. Checkout button unresponsive" required autocomplete="off" />
|
|
1465
|
+
<input class="bs-input bs-input-title" name="title" placeholder="What's the bug?" required autocomplete="off" />
|
|
1618
1466
|
</div>
|
|
1619
1467
|
<div class="bs-field">
|
|
1620
|
-
<
|
|
1621
|
-
<textarea class="bs-textarea" name="description" placeholder="What were you doing? What went wrong?"></textarea>
|
|
1468
|
+
<textarea class="bs-textarea" name="description" placeholder="Steps to reproduce or extra details (optional)"></textarea>
|
|
1622
1469
|
</div>
|
|
1623
|
-
<div class="bs-
|
|
1624
|
-
<div class="bs-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1470
|
+
<div class="bs-report-row">
|
|
1471
|
+
<div class="bs-report-col">
|
|
1472
|
+
<div class="bs-field-label">Category</div>
|
|
1473
|
+
<input type="hidden" name="category" value="functionality" />
|
|
1474
|
+
<div class="bs-cat-row">
|
|
1475
|
+
${t.map(r=>`<button type="button" class="bs-cat-btn${r.id==="functionality"?" bs-picked":""}" data-cat="${r.id}"><span class="bs-cat-icon">${r.icon}</span>${r.label}</button>`).join("")}
|
|
1476
|
+
</div>
|
|
1628
1477
|
</div>
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1478
|
+
<div class="bs-report-col">
|
|
1479
|
+
<div class="bs-field-label">Severity</div>
|
|
1480
|
+
<input type="hidden" name="severity" value="${e.severity}" />
|
|
1481
|
+
<div class="bs-sev-row">
|
|
1482
|
+
<button type="button" class="bs-sev-btn bs-sev-low${e.severity==="low"?" bs-picked":""}" data-sev="low">Low</button>
|
|
1483
|
+
<button type="button" class="bs-sev-btn bs-sev-medium${e.severity==="medium"?" bs-picked":""}" data-sev="medium">Med</button>
|
|
1484
|
+
<button type="button" class="bs-sev-btn bs-sev-high${e.severity==="high"?" bs-picked":""}" data-sev="high">High</button>
|
|
1485
|
+
<button type="button" class="bs-sev-btn bs-sev-critical${e.severity==="critical"?" bs-picked":""}" data-sev="critical">Critical</button>
|
|
1486
|
+
</div>
|
|
1638
1487
|
</div>
|
|
1639
1488
|
</div>
|
|
1640
1489
|
<div class="bs-shot-area" data-bs-screenshot>
|
|
1641
|
-
<div class="bs-shot-icon">${
|
|
1490
|
+
<div class="bs-shot-icon">${N.cam}</div>
|
|
1642
1491
|
<div class="bs-shot-text">
|
|
1643
1492
|
<div class="bs-shot-title" data-bs-shot-title>Attach screenshot</div>
|
|
1644
|
-
<div class="bs-shot-sub" data-bs-shot-sub>
|
|
1493
|
+
<div class="bs-shot-sub" data-bs-shot-sub>Capture & annotate the current view</div>
|
|
1645
1494
|
</div>
|
|
1646
1495
|
</div>
|
|
1647
1496
|
<div data-bs-annotate></div>
|
|
1648
1497
|
<button type="submit" class="bs-submit-btn">Submit Report</button>
|
|
1649
1498
|
<div data-bs-msg></div>
|
|
1650
1499
|
</form>
|
|
1651
|
-
</div>`}function
|
|
1500
|
+
</div>`}function Ks(){let e=te(),t={error:"bs-le",warn:"bs-lw",log:"bs-ll",info:"bs-li",debug:"bs-ld"};return e.length?`<div class="bs-view">${e.slice().reverse().map(n=>`<div class="bs-log"><span class="bs-log-lv ${t[n.level]||"bs-ll"}">${n.level}</span><span class="bs-log-m">${I(n.args.join(" ")).slice(0,500)}</span><span class="bs-log-t">${Kn(n.timestamp)}</span></div>`).join("")}</div>`:'<div class="bs-view"><div class="bs-empty"><p>No console logs captured yet.<br>Use the app \u2014 logs will appear here automatically.</p></div></div>'}function Vs(){let e=ye();return e.length?`<div class="bs-view">${e.slice().reverse().map(t=>`<div class="bs-net"><span class="bs-net-m">${t.method}</span><span class="bs-net-s ${t.failed?"bs-fail":"bs-ok"}">${t.status||"ERR"}</span><span class="bs-net-u" title="${I(t.url)}">${I(t.url)}</span><span class="bs-net-d">${t.duration}ms</span></div>`).join("")}</div>`:'<div class="bs-view"><div class="bs-empty"><p>No network requests captured yet.<br>API calls will show up here automatically.</p></div></div>'}function Qs(){let e='<div class="bs-view">',t=ne();t.length&&(e+=`<div class="bs-sec">Errors <span class="bs-sec-n">${t.length}</span></div>`,e+=t.slice().reverse().map(a=>`<div class="bs-err-card"><div class="bs-err-m">${I(a.message)}</div>${a.stack?`<div class="bs-err-stack">${I(a.stack)}</div>`:""}<div class="bs-err-meta">${a.type} · ${Kn(a.timestamp)}${a.source?` · ${I(a.source)}:${a.lineno}`:""}</div></div>`).join(""));let n=we();if(n){e+='<div class="bs-sec">Performance</div>';let a=[["Page Load",n.pageLoadTime,5e3],["DOM Ready",n.domContentLoaded,3e3],["First Paint",n.firstPaint,2e3],["FCP",n.firstContentfulPaint,2500],["LCP",n.largestContentfulPaint,4e3],["FID",n.firstInputDelay,300]];for(let[l,d,c]of a){if(d===void 0)continue;let v=Math.min(100,d/c*100);e+=`<div class="bs-pf"><span class="bs-pf-l">${l}</span><div class="bs-pf-tr"><div class="bs-pf-fl${v>75?" bs-slow":""}" style="width:${v}%"></div></div><span class="bs-pf-v">${d}ms</span></div>`}if(n.cumulativeLayoutShift!==void 0){let l=Math.min(100,n.cumulativeLayoutShift*400);e+=`<div class="bs-pf"><span class="bs-pf-l">CLS</span><div class="bs-pf-tr"><div class="bs-pf-fl${l>40?" bs-slow":""}" style="width:${l}%"></div></div><span class="bs-pf-v">${n.cumulativeLayoutShift}</span></div>`}}let s=he();s.length&&(e+=`<div class="bs-sec">Your activity trail <span class="bs-sec-n">${s.length}</span></div>`,e+=s.slice().reverse().map(a=>`<div class="bs-bc"><span class="bs-bc-t bs-t-${a.type}">${a.type}</span><span class="bs-bc-m">${I(a.message).slice(0,120)}</span><span class="bs-bc-time">${Ws(a.timestamp)}</span></div>`).join(""));let r=Qn();return e+='<div class="bs-sec">Environment</div>',e+=`<div class="bs-kv">
|
|
1652
1501
|
<span class="bs-kv-k">URL</span><span class="bs-kv-v">${I(r.url)}</span>
|
|
1653
1502
|
<span class="bs-kv-k">Viewport</span><span class="bs-kv-v">${r.viewportWidth}×${r.viewportHeight} @${r.devicePixelRatio}x</span>
|
|
1654
1503
|
<span class="bs-kv-k">Screen</span><span class="bs-kv-v">${r.screenWidth}×${r.screenHeight}</span>
|
|
1655
1504
|
<span class="bs-kv-k">Platform</span><span class="bs-kv-v">${I(r.platform)}</span>
|
|
1656
1505
|
<span class="bs-kv-k">Language</span><span class="bs-kv-v">${r.language}</span>
|
|
1657
|
-
${
|
|
1658
|
-
${
|
|
1659
|
-
</div>`,e+="</div>",e}function
|
|
1506
|
+
${X.commitHash?`<span class="bs-kv-k">Commit</span><span class="bs-kv-v">${I(X.commitHash)}</span>`:""}
|
|
1507
|
+
${X.user?.email?`<span class="bs-kv-k">User</span><span class="bs-kv-v">${I(X.user.email)}</span>`:""}
|
|
1508
|
+
</div>`,e+="</div>",e}function Zs(){let e=Te();if(!e.length)return'<div class="bs-view"><div class="bs-empty"><p>No reports yet.<br>Submitted bugs will appear here.</p></div></div>';let t={ui:"UI",functionality:"Feature",performance:"Perf",crash:"Crash",security:"Security",other:"Other"},n=r=>{let a=new Date(r),d=new Date().getTime()-a.getTime(),c=Math.floor(d/6e4);if(c<1)return"Just now";if(c<60)return`${c}m ago`;let v=Math.floor(c/60);if(v<24)return`${v}h ago`;let b=Math.floor(v/24);return b<7?`${b}d ago`:a.toLocaleDateString("en",{month:"short",day:"numeric"})},s='<div class="bs-view">';for(let r of e){let a=r.pins?.length?`<div class="bs-hist-pins">${r.pins.slice(0,5).map(l=>`<div class="bs-hist-pin-dot" style="background:${["#ef4444","#3b82f6","#f59e0b","#10b981","#8b5cf6"][l.number%5]}">${l.number}</div>`).join("")}${r.pins.length>5?`<span>+${r.pins.length-5}</span>`:""}</div>`:"";s+=`<div class="bs-hist-card" data-hist-id="${r.id}">
|
|
1660
1509
|
<div class="bs-hist-top">
|
|
1661
1510
|
<div class="bs-hist-title">${I(r.title)}</div>
|
|
1662
1511
|
${r.screenshot?`<img class="bs-hist-thumb" src="${r.screenshot}" alt=""/>`:""}
|
|
@@ -1672,69 +1521,73 @@ ${t.stack??""}`;if(typeof t=="object")try{return JSON.stringify(t,null,2)}catch{
|
|
|
1672
1521
|
</div>
|
|
1673
1522
|
${r.description?`<div class="bs-hist-desc">${I(r.description)}</div>`:""}
|
|
1674
1523
|
<div class="bs-hist-foot">
|
|
1675
|
-
<span>${
|
|
1676
|
-
${
|
|
1524
|
+
<span>${n(r.createdAt)} · ${I(r.url.replace(/^https?:\/\//,"").slice(0,40))}</span>
|
|
1525
|
+
${a}
|
|
1677
1526
|
</div>
|
|
1678
|
-
</div>`}return
|
|
1679
|
-
<div class="bs-ann-pin-num" style="background:${o.color}">${
|
|
1527
|
+
</div>`}return s+="</div>",s}function Gs(){let e=ut(),t=gt(),n='<div class="bs-view">';n+='<div class="bs-set-sec">Layout</div>',n+='<div class="bs-set-ly-grid">';for(let s of t)n+=`<button class="bs-set-ly${s.id===me.id?" bs-picked":""}" data-set-layout="${s.id}"><div class="bs-set-ly-name">${I(s.name)}</div><div class="bs-set-ly-desc">${I(s.description)}</div></button>`;n+="</div>",n+='<div class="bs-set-sec">Theme</div>',n+='<div class="bs-set-grid">';for(let s of e)n+=`<button class="bs-set-card${s.id===de.id?" bs-picked":""}" data-set-theme="${s.id}"><div class="bs-set-preview" style="background:${s.preview[0]}"><div class="bs-set-dot" style="background:${s.preview[1]}"></div><div class="bs-set-dot" style="background:${s.vars["--bs-accent2"]||s.preview[1]};opacity:0.6"></div></div><div class="bs-set-name">${I(s.name)}</div></button>`;return n+="</div>",n+="</div>",n}function er(e,t){let n=["#f87171","#3b82f6","#fb923c","#4ade80","#a78bfa","#facc15"],s=n[0],r="draw",a=4,l=1,d=!1,c=[],v=[],b=-1,h=-1,y=!1,M=!1,ae=0,Me=0,R=0,P=0,k=[],Kt=["#ef4444","#3b82f6","#f59e0b","#10b981","#8b5cf6","#ec4899"],ie=new Image;ie.src=t;let Pe=document.createElement("div");Pe.className="bs-ann-wrap";let ze=document.createElement("div");ze.className="bs-ann-viewport";let w=document.createElement("canvas");w.className="bs-ann-canvas bs-draw";let G=document.createElement("div");G.className="bs-ann-toolbar";let Vt={select:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M3 3l7.07 16.97 2.51-7.39 7.39-2.51L3 3z"/><path d="M13 13l6 6"/></svg>',draw:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M12 19l7-7 3 3-7 7-3-3z"/><path d="M18 13l-1.5-7.5L2 2l3.5 14.5L13 18l5-5z"/><path d="M2 2l7.586 7.586"/></svg>',arrow:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="5" y1="12" x2="19" y2="12"/><polyline points="12 5 19 12 12 19"/></svg>',rect:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="18" height="18" rx="2"/></svg>',circle:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/></svg>',text:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><polyline points="4 7 4 4 20 4 20 7"/><line x1="9.5" y1="20" x2="14.5" y2="20"/><line x1="12" y1="4" x2="12" y2="20"/></svg>',highlight:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M9 11l-6 6v3h9l3-3"/><path d="M22 12l-4.6 4.6a2 2 0 01-2.8 0l-5.2-5.2a2 2 0 010-2.8L14 4"/></svg>',pin:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0118 0z"/><circle cx="12" cy="10" r="3"/></svg>'},ps={select:"Select & Move",draw:"Draw",arrow:"Arrow",rect:"Rectangle",circle:"Circle",text:"Text",highlight:"Highlight",pin:"Pin Issue"},Pt=[],bs=o=>{r=o,b=-1,w.className=`bs-ann-canvas bs-${o}`,Pt.forEach(m=>m.classList.remove("bs-sel")),Pt.find(m=>m.dataset.tool===o)?.classList.add("bs-sel")};Object.keys(Vt).forEach(o=>{let m=document.createElement("button");m.type="button",m.dataset.tool=o,m.className=`bs-ann-btn${o===r?" bs-sel":""}`,m.title=ps[o],m.innerHTML=Vt[o],m.addEventListener("click",()=>bs(o)),Pt.push(m),G.appendChild(m)}),G.appendChild(Object.assign(document.createElement("div"),{className:"bs-ann-sep"})),n.forEach((o,m)=>{let g=document.createElement("button");g.type="button",g.className=`bs-ann-dot${m===0?" bs-sel":""}`,g.style.background=o,g.addEventListener("click",()=>{s=o,G.querySelectorAll(".bs-ann-dot").forEach(C=>C.classList.remove("bs-sel")),g.classList.add("bs-sel")}),G.appendChild(g)}),G.appendChild(Object.assign(document.createElement("div"),{className:"bs-ann-sep"}));let ee=document.createElement("input");ee.type="range",ee.min="1",ee.max="12",ee.value="4",ee.className="bs-ann-size",ee.title="Brush size",ee.addEventListener("input",()=>{a=parseInt(ee.value)}),G.appendChild(ee);let Ke=document.createElement("div");Ke.className="bs-ann-right";let Ve=(o,m)=>{let g=document.createElement("button");return g.type="button",g.className="bs-ann-btn",g.title=o,g.innerHTML=m,g},Qt=Ve("Zoom out",'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/><line x1="8" y1="11" x2="14" y2="11"/></svg>'),Zt=Object.assign(document.createElement("span"),{className:"bs-ann-zoom-label",textContent:"100%"}),Gt=Ve("Zoom in",'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/><line x1="11" y1="8" x2="11" y2="14"/><line x1="8" y1="11" x2="14" y2="11"/></svg>'),en=Ve("Fit",'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M15 3h6v6"/><path d="M9 21H3v-6"/><path d="M21 3l-7 7"/><path d="M3 21l7-7"/></svg>'),tn=Ve("Undo",'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><polyline points="1 4 1 10 7 10"/><path d="M3.51 15a9 9 0 105.42-8.49L1 10"/></svg>'),nn=Object.assign(document.createElement("button"),{type:"button",className:"bs-ann-clr-btn",textContent:"Clear"}),zt=()=>{w.style.transform=`scale(${l})`,Zt.textContent=`${Math.round(l*100)}%`};Gt.addEventListener("click",()=>{l<3&&(l=Math.min(3,l+.25),zt())}),Qt.addEventListener("click",()=>{l>.5&&(l=Math.max(.5,l-.25),zt())}),en.addEventListener("click",()=>{l=1,zt()}),Ke.appendChild(Object.assign(document.createElement("div"),{className:"bs-ann-sep"})),[Qt,Zt,Gt,en,tn,nn].forEach(o=>Ke.appendChild(o)),G.appendChild(Ke);let Qe=document.createElement("div");Qe.className="bs-ann-pins";let fe=document.createElement("div");fe.className="bs-ann-pin-list",fe.style.display="none",ze.appendChild(w),ze.appendChild(Qe),Pe.appendChild(ze),Pe.appendChild(G),Pe.appendChild(fe),e.innerHTML="",e.appendChild(Pe);let Ze=()=>{Qe.innerHTML="",fe.innerHTML="",fe.style.display=v.length?"":"none",v.forEach((o,m)=>{let g=document.createElement("div");g.className="bs-ann-pin",g.style.background=o.color,g.style.color=o.color;let C=o.x/(w.width||1)*100,u=o.y/(w.height||1)*100;g.style.left=`${C}%`,g.style.top=`${u}%`,g.innerHTML=`<span class="bs-ann-pin-n">${m+1}</span><span class="bs-ann-pin-pulse"></span>`,g.title=`#${m+1}: ${o.note}`;let T=!1;g.addEventListener("mousedown",z=>{z.stopPropagation(),T=!0,g.classList.add("bs-dragging");let p=L=>{if(!T)return;let S=ze.getBoundingClientRect();o.x=(L.clientX-S.left)/S.width*w.width,o.y=(L.clientY-S.top)/S.height*w.height,g.style.left=`${(L.clientX-S.left)/S.width*100}%`,g.style.top=`${(L.clientY-S.top)/S.height*100}%`},x=()=>{T=!1,g.classList.remove("bs-dragging"),document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",x),Ze()};document.addEventListener("mousemove",p),document.addEventListener("mouseup",x)}),Qe.appendChild(g);let j=document.createElement("div");j.className="bs-ann-pin-item",j.innerHTML=`
|
|
1528
|
+
<div class="bs-ann-pin-num" style="background:${o.color}">${m+1}</div>
|
|
1680
1529
|
<div class="bs-ann-pin-body">
|
|
1681
1530
|
<div class="bs-ann-pin-note">${I(o.note)}</div>
|
|
1682
|
-
<div class="bs-ann-pin-loc">${Math.round(C)}% \xD7 ${Math.round(
|
|
1683
|
-
</div>`;let
|
|
1531
|
+
<div class="bs-ann-pin-loc">${Math.round(C)}% \xD7 ${Math.round(u)}%</div>
|
|
1532
|
+
</div>`;let q=document.createElement("button");q.type="button",q.className="bs-ann-pin-del",q.innerHTML="×",q.title="Remove pin",q.addEventListener("click",()=>{v.splice(m,1),Ze()}),j.appendChild(q),fe.appendChild(j)})},i,At=()=>d?"rgba(255,255,255,0.5)":"rgba(0,0,0,0.35)",be=(o,m)=>{i.save(),i.strokeStyle=At(),i.lineWidth=m+3,i.lineCap="round",i.lineJoin="round",i.globalAlpha=.5,o(),i.restore()},us=(o,m=!1)=>{if(o.type==="draw"||o.type==="highlight"){if(o.points.length<2)return;let u=o.type==="highlight"?.25:1,T=o.type==="highlight"?o.size*4+10:o.size,j=()=>{i.beginPath(),i.moveTo(o.points[0].x,o.points[0].y);for(let q=1;q<o.points.length;q++)i.lineTo(o.points[q].x,o.points[q].y);i.stroke()};o.type!=="highlight"&&be(j,T),i.strokeStyle=o.color,i.lineWidth=T,i.lineCap="round",i.lineJoin="round",i.globalAlpha=u,j(),i.globalAlpha=1}else if(o.type==="rect"){let u=()=>i.strokeRect(o.x,o.y,o.w,o.h);be(u,o.size),i.strokeStyle=o.color,i.lineWidth=o.size,i.lineCap="round",i.lineJoin="round",u()}else if(o.type==="circle"){let u=()=>{i.beginPath(),i.ellipse(o.cx,o.cy,Math.abs(o.rx),Math.abs(o.ry),0,0,Math.PI*2),i.stroke()};be(u,o.size),i.strokeStyle=o.color,i.lineWidth=o.size,u()}else if(o.type==="arrow"){let u=Math.atan2(o.y2-o.y1,o.x2-o.x1),T=12+o.size*2,j=()=>{i.beginPath(),i.moveTo(o.x1,o.y1),i.lineTo(o.x2,o.y2),i.stroke(),i.beginPath(),i.moveTo(o.x2,o.y2),i.lineTo(o.x2-T*Math.cos(u-.45),o.y2-T*Math.sin(u-.45)),i.moveTo(o.x2,o.y2),i.lineTo(o.x2-T*Math.cos(u+.45),o.y2-T*Math.sin(u+.45)),i.stroke()};be(j,o.size),i.strokeStyle=o.color,i.lineWidth=o.size,i.lineCap="round",i.lineJoin="round",j()}else if(o.type==="text"){let u=o.size*5+12;i.font=`bold ${u}px Inter, -apple-system, sans-serif`,i.fillStyle=At(),i.globalAlpha=.6,i.fillText(o.text,o.x+1,o.y+1),i.globalAlpha=1,i.fillStyle=o.color,i.fillText(o.text,o.x,o.y)}let g=!m&&b>=0&&c[b]===o,C=!m&&!g&&h>=0&&c[h]===o;if(g||C){let u=Ae(o);if(i.save(),i.setLineDash([6,4]),i.strokeStyle=d?"#fff":"#000",i.lineWidth=g?1.5:1,i.globalAlpha=g?.7:.45,i.strokeRect(u.x-4,u.y-4,u.w+8,u.h+8),o.type==="rect"||o.type==="circle"){i.setLineDash([]),i.globalAlpha=g?.9:.6;let j=o.type==="rect"?[[u.x,u.y],[u.x+u.w,u.y],[u.x,u.y+u.h],[u.x+u.w,u.y+u.h]]:[[u.x+u.w/2,u.y],[u.x+u.w,u.y+u.h/2],[u.x+u.w/2,u.y+u.h],[u.x,u.y+u.h/2]];for(let[q,z]of j)i.fillStyle="#fff",i.fillRect(q-5,z-5,10,10),i.strokeStyle=d?"#aaa":"#333",i.lineWidth=1.2,i.strokeRect(q-5,z-5,10,10)}i.restore()}},O=()=>{i.clearRect(0,0,w.width,w.height),i.drawImage(ie,0,0);for(let o of c)us(o)},Ae=o=>{if(o.type==="rect")return{x:Math.min(o.x,o.x+o.w),y:Math.min(o.y,o.y+o.h),w:Math.abs(o.w),h:Math.abs(o.h)};if(o.type==="circle")return{x:o.cx-Math.abs(o.rx),y:o.cy-Math.abs(o.ry),w:Math.abs(o.rx)*2,h:Math.abs(o.ry)*2};if(o.type==="arrow"){let T=Math.min(o.x1,o.x2),j=Math.min(o.y1,o.y2);return{x:T,y:j,w:Math.abs(o.x2-o.x1)||20,h:Math.abs(o.y2-o.y1)||20}}if(o.type==="text")return{x:o.x,y:o.y-(o.size*5+12),w:o.text.length*(o.size*3+8),h:o.size*5+16};if(o.points.length===0)return{x:0,y:0,w:0,h:0};let m=1/0,g=1/0,C=-1/0,u=-1/0;for(let T of o.points)m=Math.min(m,T.x),g=Math.min(g,T.y),C=Math.max(C,T.x),u=Math.max(u,T.y);return{x:m,y:g,w:C-m||10,h:u-g||10}},Ge=(o,m)=>{for(let g=c.length-1;g>=0;g--){let C=Ae(c[g]),u=8;if(o>=C.x-u&&o<=C.x+C.w+u&&m>=C.y-u&&m<=C.y+C.h+u)return g}return-1},ms=(o,m,g)=>{if(o.type==="draw"||o.type==="highlight")for(let C of o.points)C.x+=m,C.y+=g;else o.type==="rect"?(o.x+=m,o.y+=g):o.type==="circle"?(o.cx+=m,o.cy+=g):o.type==="arrow"?(o.x1+=m,o.y1+=g,o.x2+=m,o.y2+=g):o.type==="text"&&(o.x+=m,o.y+=g)};ie.onload=()=>{let m=(e.clientWidth||450)/ie.width;w.width=ie.width,w.height=ie.height,w.style.height=`${ie.height*m}px`,i=w.getContext("2d"),i.drawImage(ie,0,0);let g=[[10,10],[w.width-10,10],[10,w.height-10],[w.width-10,w.height-10],[w.width/2,w.height/2]],C=0;for(let[z,p]of g){let x=i.getImageData(z,p,1,1).data;C+=(x[0]*299+x[1]*587+x[2]*114)/1e3}d=C/g.length<128;let u=z=>{let p=w.getBoundingClientRect();return{x:(z.clientX-p.left)*(w.width/p.width),y:(z.clientY-p.top)*(w.height/p.height)}},T=!1;w.addEventListener("mousedown",z=>{let p=u(z);if(r==="select"){let x=Ge(p.x,p.y);if(x>=0){b=x,y=!0;let L=Ae(c[x]);ae=p.x-L.x,Me=p.y-L.y,w.classList.add("bs-grabbing"),w.classList.remove("bs-grab"),O()}else b=-1,O();return}if(r!=="pin"&&r!=="text"){let x=Ge(p.x,p.y);if(x>=0){b=x,y=!0,T=!0;let L=Ae(c[x]);ae=p.x-L.x,Me=p.y-L.y,w.classList.add("bs-grabbing"),O();return}}if(M=!0,R=p.x,P=p.y,r==="pin"){M=!1;let x=prompt("Describe the issue at this spot:");if(x){let L=Kt[v.length%Kt.length];v.push({x:p.x,y:p.y,note:x,color:L}),Ze()}return}if(r==="text"){M=!1;let x=prompt("Enter text:");x&&(c.push({type:"text",color:s,size:a,x:p.x,y:p.y,text:x}),O());return}(r==="draw"||r==="highlight")&&(k=[{x:p.x,y:p.y}])}),w.addEventListener("mousemove",z=>{let p=u(z);if(y&&b>=0){let x=Ae(c[b]),L=p.x-ae-x.x,S=p.y-Me-x.y;ms(c[b],L,S),O();return}if(r==="select"){let x=Ge(p.x,p.y);w.classList.toggle("bs-grab",x>=0),h!==x&&(h=x,O());return}if(r!=="pin"&&r!=="text"&&!M){let x=Ge(p.x,p.y);w.classList.toggle("bs-grab",x>=0),h!==x&&(h=x,O())}if(M){if(r==="draw"||r==="highlight"){k.push({x:p.x,y:p.y}),O();let x=r==="highlight"?.25:1,L=r==="highlight"?a*4+10:a;if(r!=="highlight"){i.save(),i.strokeStyle=At(),i.lineWidth=L+3,i.lineCap="round",i.lineJoin="round",i.globalAlpha=.5,i.beginPath(),i.moveTo(k[0].x,k[0].y);for(let S=1;S<k.length;S++)i.lineTo(k[S].x,k[S].y);i.stroke(),i.restore()}i.strokeStyle=s,i.lineWidth=L,i.lineCap="round",i.lineJoin="round",i.globalAlpha=x,i.beginPath(),i.moveTo(k[0].x,k[0].y);for(let S=1;S<k.length;S++)i.lineTo(k[S].x,k[S].y);i.stroke(),i.globalAlpha=1}else if(O(),i.strokeStyle=s,i.lineWidth=a,i.lineCap="round",i.lineJoin="round",r==="rect")be(()=>i.strokeRect(R,P,p.x-R,p.y-P),a),i.strokeStyle=s,i.lineWidth=a,i.strokeRect(R,P,p.x-R,p.y-P);else if(r==="circle"){let x=Math.abs(p.x-R)/2,L=Math.abs(p.y-P)/2,S=R+(p.x-R)/2,sn=P+(p.y-P)/2;be(()=>{i.beginPath(),i.ellipse(S,sn,x,L,0,0,Math.PI*2),i.stroke()},a),i.strokeStyle=s,i.lineWidth=a,i.beginPath(),i.ellipse(S,sn,x,L,0,0,Math.PI*2),i.stroke()}else if(r==="arrow"){let x=Math.atan2(p.y-P,p.x-R),L=12+a*2,S=()=>{i.beginPath(),i.moveTo(R,P),i.lineTo(p.x,p.y),i.stroke(),i.beginPath(),i.moveTo(p.x,p.y),i.lineTo(p.x-L*Math.cos(x-.45),p.y-L*Math.sin(x-.45)),i.moveTo(p.x,p.y),i.lineTo(p.x-L*Math.cos(x+.45),p.y-L*Math.sin(x+.45)),i.stroke()};be(S,a),i.strokeStyle=s,i.lineWidth=a,i.lineCap="round",i.lineJoin="round",S()}}});let j=z=>{if(y)return y=!1,T=!1,b=-1,w.classList.remove("bs-grabbing"),w.classList.remove("bs-grab"),O(),void 0;if(!M)return;M=!1;let p=u(z);if(r==="draw"||r==="highlight")k.length>1&&c.push({type:r,color:s,size:a,alpha:r==="highlight"?.25:1,points:[...k]}),k=[];else if(r==="rect")c.push({type:"rect",color:s,size:a,x:R,y:P,w:p.x-R,h:p.y-P});else if(r==="circle"){let x=Math.abs(p.x-R)/2,L=Math.abs(p.y-P)/2;c.push({type:"circle",color:s,size:a,cx:R+(p.x-R)/2,cy:P+(p.y-P)/2,rx:x,ry:L})}else r==="arrow"&&c.push({type:"arrow",color:s,size:a,x1:R,y1:P,x2:p.x,y2:p.y});O()};w.addEventListener("mouseup",j),w.addEventListener("mouseleave",z=>{y?(y=!1,T=!1,w.classList.remove("bs-grabbing"),w.classList.remove("bs-grab"),O()):M&&j(z)});let q=z=>{b>=0&&(z.key==="Delete"||z.key==="Backspace")&&(c.splice(b,1),b=-1,O())};document.addEventListener("keydown",q),tn.addEventListener("click",()=>{c.length&&(c.pop(),b=-1,O())}),nn.addEventListener("click",()=>{c.length=0,v.length=0,b=-1,O(),Ze()})};let gs=()=>{for(let o=0;o<v.length;o++){let m=v[o],g=16;i.beginPath(),i.arc(m.x,m.y-g,g,0,Math.PI*2),i.fillStyle=m.color,i.fill(),i.strokeStyle="#fff",i.lineWidth=2,i.stroke(),i.beginPath(),i.moveTo(m.x-8,m.y-6),i.lineTo(m.x,m.y+4),i.lineTo(m.x+8,m.y-6),i.fillStyle=m.color,i.fill(),i.fillStyle="#fff",i.font="bold 14px Inter, sans-serif",i.textAlign="center",i.textBaseline="middle",i.fillText(`${o+1}`,m.x,m.y-g),i.textAlign="start",i.textBaseline="alphabetic"}};return{getAnnotation:()=>{try{return b=-1,O(),gs(),w.toDataURL("image/jpeg",.7)}catch{return null}},getPins:()=>v.map((o,m)=>({number:m+1,x:Math.round(o.x),y:Math.round(o.y),note:o.note}))}}function kt(e){if(!f)return;Ce=e,f.querySelectorAll(".bs-tab").forEach(s=>{s.classList.toggle("bs-active",s.dataset.tab===e)});let t=f.querySelector(".bs-scroll"),n={report:Gn,console:Ks,network:Vs,context:Qs,history:Zs,settings:Gs};t.innerHTML=n[e](),t.scrollTop=0,es()}function es(){if(!f)return;if(Ce==="history"){f.querySelectorAll("[data-hist-del]").forEach(n=>{n.addEventListener("click",()=>{let s=parseInt(n.dataset.histDel),r=f.querySelector(`[data-hist-id="${s}"]`);if(!r)return;let a=r.querySelector(".bs-hist-confirm");if(a){a.remove();return}let l=document.createElement("div");l.className="bs-hist-confirm",l.innerHTML="<span>Delete this report?</span>";let d=document.createElement("button");d.type="button",d.className="bs-hist-confirm-yes",d.textContent="Delete";let c=document.createElement("button");c.type="button",c.className="bs-hist-confirm-no",c.textContent="Cancel",d.addEventListener("click",()=>{Xs(s),kt("history")}),c.addEventListener("click",()=>l.remove()),l.appendChild(d),l.appendChild(c),r.appendChild(l)})}),f.querySelectorAll("[data-hist-edit]").forEach(n=>{n.addEventListener("click",()=>{let s=parseInt(n.dataset.histEdit),r=f.querySelector(`[data-hist-id="${s}"]`);if(!r)return;let a=r.querySelector(".bs-hist-edit-wrap");if(a){a.remove();return}r.querySelector(".bs-hist-confirm")?.remove();let l=Te().find(y=>y.id===s);if(!l)return;let d=document.createElement("div");d.className="bs-hist-edit-wrap",d.innerHTML=`
|
|
1684
1533
|
<div class="bs-field" style="margin-bottom:8px">
|
|
1685
|
-
<input class="bs-input" data-edit-title value="${I(
|
|
1534
|
+
<input class="bs-input" data-edit-title value="${I(l.title)}" />
|
|
1686
1535
|
</div>
|
|
1687
1536
|
<div class="bs-field" style="margin-bottom:8px">
|
|
1688
|
-
<textarea class="bs-textarea" data-edit-desc style="min-height:56px">${I(
|
|
1537
|
+
<textarea class="bs-textarea" data-edit-desc style="min-height:56px">${I(l.description)}</textarea>
|
|
1689
1538
|
</div>
|
|
1690
1539
|
<div class="bs-field" style="margin-bottom:8px">
|
|
1691
1540
|
<div class="bs-sev-row">
|
|
1692
|
-
<button type="button" class="bs-sev-btn bs-sev-low${
|
|
1693
|
-
<button type="button" class="bs-sev-btn bs-sev-medium${
|
|
1694
|
-
<button type="button" class="bs-sev-btn bs-sev-high${
|
|
1695
|
-
<button type="button" class="bs-sev-btn bs-sev-critical${
|
|
1541
|
+
<button type="button" class="bs-sev-btn bs-sev-low${l.severity==="low"?" bs-picked":""}" data-edit-sev="low">Low</button>
|
|
1542
|
+
<button type="button" class="bs-sev-btn bs-sev-medium${l.severity==="medium"?" bs-picked":""}" data-edit-sev="medium">Medium</button>
|
|
1543
|
+
<button type="button" class="bs-sev-btn bs-sev-high${l.severity==="high"?" bs-picked":""}" data-edit-sev="high">High</button>
|
|
1544
|
+
<button type="button" class="bs-sev-btn bs-sev-critical${l.severity==="critical"?" bs-picked":""}" data-edit-sev="critical">Critical</button>
|
|
1696
1545
|
</div>
|
|
1697
1546
|
</div>
|
|
1698
|
-
<div class="bs-hist-edit-row"></div>`;let l
|
|
1547
|
+
<div class="bs-hist-edit-row"></div>`;let c=l.severity;r.appendChild(d),d.querySelectorAll("[data-edit-sev]").forEach(y=>{y.addEventListener("click",()=>{c=y.dataset.editSev,d.querySelectorAll(".bs-sev-btn").forEach(M=>M.classList.remove("bs-picked")),y.classList.add("bs-picked")})});let v=d.querySelector(".bs-hist-edit-row"),b=document.createElement("button");b.type="button",b.className="bs-hist-save",b.textContent="Save";let h=document.createElement("button");h.type="button",h.className="bs-hist-cancel",h.textContent="Cancel",b.addEventListener("click",()=>{let y=d.querySelector("[data-edit-title]").value.trim(),M=d.querySelector("[data-edit-desc]").value.trim();y&&(Js(s,{title:y,description:M,severity:c}),kt("history"))}),h.addEventListener("click",()=>d.remove()),v.appendChild(b),v.appendChild(h)})});return}if(Ce==="settings"){f.querySelectorAll("[data-set-theme]").forEach(n=>{n.addEventListener("click",()=>{let s=n.dataset.setTheme;Lt(s),f.querySelectorAll("[data-set-theme]").forEach(r=>r.classList.remove("bs-picked")),n.classList.add("bs-picked")})}),f.querySelectorAll("[data-set-layout]").forEach(n=>{n.addEventListener("click",()=>{let s=n.dataset.setLayout,r=Ue(s);r&&(me=r,J(),setTimeout(()=>{Ce="settings",pe(),setTimeout(()=>kt("settings"),50)},400))})});return}if(Ce!=="report")return;f.querySelectorAll(".bs-cat-btn").forEach(n=>{n.addEventListener("click",()=>{let s=n.dataset.cat;f.querySelector('input[name="category"]').value=s,f.querySelectorAll(".bs-cat-btn").forEach(r=>r.classList.remove("bs-picked")),n.classList.add("bs-picked")})}),f.querySelectorAll(".bs-sev-btn").forEach(n=>{n.addEventListener("click",()=>{let s=n.dataset.sev;f.querySelector('input[name="severity"]').value=s,f.querySelectorAll(".bs-sev-btn").forEach(r=>r.classList.remove("bs-picked")),n.classList.add("bs-picked")})});let e=null,t=null;f.querySelector("[data-bs-screenshot]")?.addEventListener("click",async()=>{let n=f?.querySelector("[data-bs-shot-title]"),s=f?.querySelector("[data-bs-shot-sub]"),r=f?.querySelector("[data-bs-screenshot]");if(n&&(n.textContent="Capturing..."),f&&(f.style.visibility="hidden"),Y&&(Y.style.visibility="hidden"),await new Promise(a=>setTimeout(a,200)),e=await qe(),f&&(f.style.visibility=""),Y&&(Y.style.visibility=""),e){n&&(n.textContent="Screenshot captured!"),s&&(s.textContent="Draw on the image below to highlight the issue"),r?.classList.add("bs-captured");let a=f?.querySelector("[data-bs-annotate]");a&&(t=er(a,e))}else n&&(n.textContent="Screenshot unavailable"),s&&(s.textContent="Could not capture screenshot on this page")}),f.querySelector("[data-bs-form]")?.addEventListener("submit",async n=>{n.preventDefault();let s=n.target,r=s.querySelector(".bs-submit-btn"),a=s.querySelector("[data-bs-msg]"),l=s.elements.namedItem("title").value.trim(),d=s.elements.namedItem("description").value.trim(),c=s.elements.namedItem("severity").value,v=s.elements.namedItem("category").value;if(!l)return;r.disabled=!0,r.textContent="Sending...";let b=Zn(),h={projectId:X.projectId,title:l,description:d,category:v,severity:c,tags:b.tags.length?b.tags:void 0,context:Qn(),consoleLogs:te(),errors:ne(),networkCaptures:le(),breadcrumbs:he(),performance:we()??void 0,screenshot:e??void 0,annotation:t?.getAnnotation()??void 0,pins:t?.getPins().length?t.getPins():void 0,createdAt:Date.now()},y=await jt(h);Ys({title:h.title,description:h.description,category:h.category,severity:h.severity,tags:h.tags,screenshot:h.screenshot,pins:h.pins,url:window.location.href,createdAt:h.createdAt,status:y.success?"sent":"draft"}),y.success?(a.className="bs-msg bs-msg-ok",a.innerHTML=`${N.check} Bug reported \u2014 thank you!`,setTimeout(J,1200)):(a.className="bs-msg bs-msg-err",a.textContent=y.error??"Could not send. Saved as draft.",r.disabled=!1,r.textContent="Submit Report")})}function pe(){if(K)return;K=!0,Ce="report",Yt(),Y=document.createElement("div"),Y.className="bs-backdrop",document.body.appendChild(Y);let e=le().length,t=ne().length;f=document.createElement("div"),f.className=`bs-modal bs-ly-${me.id}`,ge(f);let n=`
|
|
1699
1548
|
<div class="bs-tabs">
|
|
1700
|
-
<button class="bs-tab bs-active" data-tab="report">${
|
|
1701
|
-
<button class="bs-tab" data-tab="console">${
|
|
1702
|
-
<button class="bs-tab" data-tab="network">${
|
|
1703
|
-
<button class="bs-tab" data-tab="context">${
|
|
1704
|
-
<button class="bs-tab" data-tab="history">${
|
|
1705
|
-
<button class="bs-tab" data-tab="settings" style="margin-left:auto">${
|
|
1706
|
-
</div>`,
|
|
1549
|
+
<button class="bs-tab bs-active" data-tab="report">${N.report} Report</button>
|
|
1550
|
+
<button class="bs-tab" data-tab="console">${N.console} Console <span class="bs-tab-badge">${te().length}</span></button>
|
|
1551
|
+
<button class="bs-tab" data-tab="network">${N.network} Network ${e?`<span class="bs-tab-badge bs-warn">${e}</span>`:`<span class="bs-tab-badge">${ye().length}</span>`}</button>
|
|
1552
|
+
<button class="bs-tab" data-tab="context">${N.ctx} Context ${t?`<span class="bs-tab-badge bs-warn">${t}</span>`:""}</button>
|
|
1553
|
+
<button class="bs-tab" data-tab="history">${N.history} History <span class="bs-tab-badge">${Te().length}</span></button>
|
|
1554
|
+
<button class="bs-tab" data-tab="settings" style="margin-left:auto">${N.settings}</button>
|
|
1555
|
+
</div>`,s=Q(),r=s?s.name.split(" ").map(h=>h[0]).join("").toUpperCase().slice(0,2):"",a=wt(),l=s?`
|
|
1707
1556
|
<div class="bs-hdr">
|
|
1708
1557
|
<div class="bs-logo">BugStash</div>
|
|
1709
1558
|
<div class="bs-hdr-right">
|
|
1710
|
-
${
|
|
1711
|
-
<
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
<div class="bs-user-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
`:""}
|
|
1721
|
-
<button class="bs-close-btn" data-bs-close title="Close">${V.x}</button>
|
|
1559
|
+
<button class="bs-pin-toggle${a?" active":""}" data-bs-pin-toggle title="Toggle pin mode">
|
|
1560
|
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><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>
|
|
1561
|
+
Pins ${a?"ON":"OFF"}
|
|
1562
|
+
</button>
|
|
1563
|
+
<div class="bs-user-badge">
|
|
1564
|
+
<div class="bs-user-avatar">${r}</div>
|
|
1565
|
+
<span>${s.name.split(" ")[0]}</span>
|
|
1566
|
+
</div>
|
|
1567
|
+
<button class="bs-login-logout" data-bs-logout title="Sign out">Logout</button>
|
|
1568
|
+
<button class="bs-close-btn" data-bs-close title="Close">${N.x}</button>
|
|
1722
1569
|
</div>
|
|
1723
|
-
</div
|
|
1724
|
-
|
|
1570
|
+
</div>`:`
|
|
1571
|
+
<div class="bs-hdr" style="justify-content:flex-end">
|
|
1572
|
+
<button class="bs-close-btn" data-bs-close title="Close">${N.x}</button>
|
|
1573
|
+
</div>`,d=me.tabPosition==="left",c=me.tabPosition==="bottom",v=s?Gn():Fs();d?f.innerHTML=`
|
|
1574
|
+
${l}
|
|
1725
1575
|
<div class="bs-body-wrap">
|
|
1726
|
-
${n
|
|
1727
|
-
<div class="bs-scroll">${
|
|
1728
|
-
</div>`:
|
|
1729
|
-
${
|
|
1730
|
-
<div class="bs-scroll">${
|
|
1731
|
-
${
|
|
1732
|
-
${
|
|
1733
|
-
${
|
|
1734
|
-
<div class="bs-scroll">${
|
|
1576
|
+
${s?n:""}
|
|
1577
|
+
<div class="bs-scroll">${v}</div>
|
|
1578
|
+
</div>`:c?f.innerHTML=`
|
|
1579
|
+
${l}
|
|
1580
|
+
<div class="bs-scroll">${v}</div>
|
|
1581
|
+
${s?`<div class="bs-tab-divider"></div>${n}`:""}`:f.innerHTML=`
|
|
1582
|
+
${l}
|
|
1583
|
+
${s?`${n}<div class="bs-tab-divider"></div>`:""}
|
|
1584
|
+
<div class="bs-scroll">${v}</div>`,document.body.appendChild(f),D&&D.classList.add("bs-open"),requestAnimationFrame(()=>{Y?.classList.add("bs-in"),f?.classList.add("bs-in")}),f.querySelectorAll(".bs-tab").forEach(h=>{h.addEventListener("click",()=>kt(h.dataset.tab))}),f.querySelector("[data-bs-close]")?.addEventListener("click",J),Y.addEventListener("click",J),f.querySelector("[data-bs-pin-toggle]")?.addEventListener("click",()=>{let h=We(),y=f?.querySelector("[data-bs-pin-toggle]");y&&(y.classList.toggle("active",h),y.innerHTML=`
|
|
1735
1585
|
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><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>
|
|
1736
1586
|
Pins ${h?"ON":"OFF"}
|
|
1737
|
-
`)}),
|
|
1587
|
+
`)}),f.querySelector("[data-bs-logout]")?.addEventListener("click",()=>{pt(),J(),setTimeout(()=>pe(),300)}),s?es():tr();let b=h=>{h.key==="Escape"&&(J(),document.removeEventListener("keydown",b))};document.addEventListener("keydown",b)}function tr(){if(!f)return;let e=f.querySelector("#bs-login-submit"),t=f.querySelector("#bs-login-email"),n=f.querySelector("#bs-login-pass"),s=f.querySelector("#bs-login-error");if(!e||!t||!n)return;let r=async()=>{let a=t.value.trim(),l=n.value;if(!a||!l){s.textContent="Please enter email and password",s.style.display="block";return}e.setAttribute("disabled","true"),e.textContent="Signing in...",s.style.display="none";let d=await dt(a,l,X.projectId);d.success?(yt(X.projectId),vt(X.projectId),J(),setTimeout(()=>pe(),300)):(s.textContent=d.error||"Invalid credentials",s.style.display="block",e.removeAttribute("disabled"),e.textContent="Sign In")};e.addEventListener("click",r),n.addEventListener("keydown",a=>{a.key==="Enter"&&r()}),t.addEventListener("keydown",a=>{a.key==="Enter"&&n.focus()}),setTimeout(()=>t.focus(),100)}function J(){K&&(D&&D.classList.remove("bs-open"),f&&(f.classList.remove("bs-in"),f.classList.add("bs-out")),Y&&Y.classList.remove("bs-in"),setTimeout(()=>{f?.remove(),Y?.remove(),f=null,Y=null,K=!1},350))}function ge(e){for(let[t,n]of Object.entries(de.vars))e.style.setProperty(t,n)}function Lt(e){let t=mt(e);t&&(de=t,f&&ge(f),D&&ge(D),B&&ge(B))}function ts(){return de.id}function ns(e){let t=Ue(e);t&&(me=t,K&&(J(),setTimeout(pe,400)))}function ss(){return me.id}function rs(e){X=e,Ye=document.createElement("style"),Ye.textContent=_s+Bn,document.head.appendChild(Ye);let t=e.panelPosition==="bottom-left"?"left":"right";D=document.createElement("button"),D.className="bs-fab",ge(D),D.innerHTML=`${N.bug}<span class="bs-fab-label">Report a bug</span>`,D.style[t]="24px",D.addEventListener("click",()=>K?J():pe()),document.body.appendChild(D),B=document.createElement("div"),B.className="bs-toolbar",B.style[t]="32px",ge(B);let s=navigator.platform.toUpperCase().includes("MAC")?"\u2318":"Ctrl",r=[{icon:N.cam,tip:"Screenshot",kbd:`${s}+Shift+S`,action:async()=>{let a=await qe();a&&(K||pe(),setTimeout(()=>{let l=f?.querySelector("[data-bs-screenshot]");if(l){l.__screenshot=a,l.classList.add("bs-captured");let d=l.querySelector("[data-bs-shot-title]"),c=l.querySelector("[data-bs-shot-sub]");d&&(d.textContent="Screenshot captured!"),c&&(c.textContent="Click to retake or annotate"),l.click()}},400))}},{icon:N.pin,tip:"Toggle Pins",kbd:`${s}+Shift+P`,id:"bs-tb-pin",action:()=>{let a=We(),l=B?.querySelector("#bs-tb-pin");l&&l.classList.toggle("bs-active",a);let d=f?.querySelector("[data-bs-pin-toggle]");d&&(d.classList.toggle("active",a),d.innerHTML=`
|
|
1588
|
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><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>
|
|
1589
|
+
Pins ${a?"ON":"OFF"}
|
|
1590
|
+
`)}},{icon:de.id==="black"?N.sun:N.moon,tip:"Toggle Theme",kbd:`${s}+Shift+T`,id:"bs-tb-theme",action:()=>{let a=de.id==="black"?"white":"black";Lt(a),B&&ge(B);let l=B?.querySelector("#bs-tb-theme");l&&(l.innerHTML=`${de.id==="black"?N.sun:N.moon}<span class="bs-toolbar-tip">${de.id==="black"?"Light":"Dark"} Mode<span class="bs-toolbar-kbd">${s}+Shift+T</span></span>`)}},{icon:N.report,tip:"Open Panel",kbd:`${s}+Shift+B`,action:()=>{K?J():pe()}}];for(let a of r){let l=document.createElement("button");l.className="bs-toolbar-btn",a.id&&(l.id=a.id),l.innerHTML=`${a.icon}<span class="bs-toolbar-tip">${a.tip}<span class="bs-toolbar-kbd">${a.kbd}</span></span>`,l.addEventListener("click",d=>{d.stopPropagation(),a.action()}),B.appendChild(l)}document.body.appendChild(B),D.addEventListener("mouseenter",()=>{K||Jn()}),D.addEventListener("mouseleave",a=>{let l=a.relatedTarget;B?.contains(l)||Yt()}),B.addEventListener("mouseenter",()=>Jn()),B.addEventListener("mouseleave",a=>{let l=a.relatedTarget;D?.contains(l)||Yt()}),Xe=a=>{(a.ctrlKey||a.metaKey)&&a.shiftKey&&(a.key==="B"||a.key==="b"?(a.preventDefault(),K?J():pe()):a.key==="S"||a.key==="s"?(a.preventDefault(),r[0].action()):a.key==="P"||a.key==="p"?(a.preventDefault(),r[1].action()):(a.key==="T"||a.key==="t")&&(a.preventDefault(),r[2].action()))},document.addEventListener("keydown",Xe)}function Jn(){Et||K||(Et=!0,B?.classList.add("bs-show"))}function Yt(){Et=!1,B?.classList.remove("bs-show")}function os(){J(),D?.remove(),D=null,B?.remove(),B=null,Et=!1,Ye?.remove(),Ye=null,Xe&&document.removeEventListener("keydown",Xe),Xe=null}var Z=null,H=null,E=null,oe=null,St="freehand",Ct="#ef4444",nr=3,$e=[],W=null,Je=!1,Tt=null,sr=[{id:"freehand",label:"Draw",icon:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25z"},{id:"rectangle",label:"Rect",icon:"M3 3h18v18H3V3zm2 2v14h14V5H5z"},{id:"circle",label:"Circle",icon:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"},{id:"arrow",label:"Arrow",icon:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"}],rr=["#ef4444","#f97316","#eab308","#22c55e","#3b82f6","#8b5cf6","#ffffff","#000000"];function ls(e){return new Promise(t=>{Tt=t,$e=[],W=null,St="freehand",Ct="#ef4444",or(e)})}function or(e){Z&&Z.remove(),Z=document.createElement("div"),Z.id="bs-annotation-overlay";let t=document.createElement("style");t.textContent=`
|
|
1738
1591
|
#bs-annotation-overlay {
|
|
1739
1592
|
position: fixed; inset: 0; z-index: 2147483647;
|
|
1740
1593
|
background: rgba(0,0,0,0.85);
|
|
@@ -1779,5 +1632,5 @@ ${t.stack??""}`;if(typeof t=="object")try{return JSON.stringify(t,null,2)}catch{
|
|
|
1779
1632
|
overflow: hidden; padding: 16px;
|
|
1780
1633
|
}
|
|
1781
1634
|
.bs-ann-canvas-wrap canvas { cursor: crosshair; border-radius: 4px; }
|
|
1782
|
-
`,
|
|
1635
|
+
`,Z.appendChild(t);let n=document.createElement("div");n.className="bs-ann-toolbar";for(let d of sr){let c=document.createElement("button");c.className=`bs-ann-tool${d.id===St?" active":""}`,c.title=d.label,c.innerHTML=`<svg viewBox="0 0 24 24"><path d="${d.icon}"/></svg>`,c.addEventListener("click",()=>{St=d.id,n.querySelectorAll(".bs-ann-tool").forEach(v=>v.classList.remove("active")),c.classList.add("active")}),n.appendChild(c)}n.appendChild(as());for(let d of rr){let c=document.createElement("button");c.className=`bs-ann-color${d===Ct?" active":""}`,c.style.background=d,c.addEventListener("click",()=>{Ct=d,n.querySelectorAll(".bs-ann-color").forEach(v=>v.classList.remove("active")),c.classList.add("active")}),n.appendChild(c)}n.appendChild(as());let s=document.createElement("button");s.className="bs-ann-btn bs-ann-undo",s.textContent="Undo",s.addEventListener("click",()=>{$e.pop(),$t()}),n.appendChild(s);let r=document.createElement("button");r.className="bs-ann-btn bs-ann-save",r.textContent="Save",r.addEventListener("click",ir);let a=document.createElement("button");a.className="bs-ann-btn bs-ann-cancel",a.textContent="Cancel",a.addEventListener("click",()=>{Jt(),Tt?.(null)}),n.appendChild(r),n.appendChild(a),Z.appendChild(n);let l=document.createElement("div");l.className="bs-ann-canvas-wrap",H=document.createElement("canvas"),E=H.getContext("2d"),l.appendChild(H),Z.appendChild(l),document.body.appendChild(Z),oe=new Image,oe.onload=()=>{if(!H||!E||!oe)return;let d=window.innerWidth-32,c=window.innerHeight-100,v=oe.width,b=oe.height,h=Math.min(1,d/v,c/b);v=Math.round(v*h),b=Math.round(b*h),H.width=v,H.height=b,$t(),ar()},oe.src=e}function as(){let e=document.createElement("div");return e.className="bs-ann-sep",e}function ar(){if(!H)return;H.addEventListener("mousedown",t=>{Je=!0;let{x:n,y:s}=is(t);W={type:St,color:Ct,lineWidth:nr,points:[{x:n,y:s}],x:n,y:s,width:0,height:0}}),H.addEventListener("mousemove",t=>{if(!Je||!W)return;let{x:n,y:s}=is(t);W.type==="freehand"?W.points.push({x:n,y:s}):(W.width=n-W.x,W.height=s-W.y),$t(),cs(W)});let e=()=>{Je&&W&&($e.push(W),W=null),Je=!1,$t()};H.addEventListener("mouseup",e),H.addEventListener("mouseleave",e)}function is(e){let t=H.getBoundingClientRect();return{x:e.clientX-t.left,y:e.clientY-t.top}}function $t(){if(!(!E||!H||!oe)){E.clearRect(0,0,H.width,H.height),E.drawImage(oe,0,0,H.width,H.height);for(let e of $e)cs(e)}}function cs(e){if(E)switch(E.strokeStyle=e.color,E.fillStyle=e.color,E.lineWidth=e.lineWidth,E.lineCap="round",E.lineJoin="round",e.type){case"freehand":{if(!e.points||e.points.length<2)return;E.beginPath(),E.moveTo(e.points[0].x,e.points[0].y);for(let t=1;t<e.points.length;t++)E.lineTo(e.points[t].x,e.points[t].y);E.stroke();break}case"rectangle":{E.strokeRect(e.x,e.y,e.width,e.height);break}case"circle":{let t=e.x+e.width/2,n=e.y+e.height/2,s=Math.abs(e.width)/2,r=Math.abs(e.height)/2;E.beginPath(),E.ellipse(t,n,s,r,0,0,Math.PI*2),E.stroke();break}case"arrow":{let t=e.x,n=e.y,s=e.x+e.width,r=e.y+e.height,a=14,l=Math.atan2(r-n,s-t);E.beginPath(),E.moveTo(t,n),E.lineTo(s,r),E.stroke(),E.beginPath(),E.moveTo(s,r),E.lineTo(s-a*Math.cos(l-Math.PI/6),r-a*Math.sin(l-Math.PI/6)),E.lineTo(s-a*Math.cos(l+Math.PI/6),r-a*Math.sin(l+Math.PI/6)),E.closePath(),E.fill();break}}}function ir(){if(!H){Jt(),Tt?.(null);return}let t={dataUrl:H.toDataURL("image/png"),annotations:$e};Jt(),Tt?.(t)}function Jt(){Z?.remove(),Z=null,H=null,E=null,oe=null,$e=[],W=null,Je=!1}var Mt=!1;function lr(){if(typeof window>"u")return"production";let e=window.location.hostname;return e==="localhost"||e==="127.0.0.1"||e==="0.0.0.0"||e.endsWith(".local")||/^192\.168\./.test(e)||/^10\./.test(e)||/^172\.(1[6-9]|2\d|3[01])\./.test(e)?"development":e.includes("staging")||e.includes("stage")||e.includes("preview")||e.includes("preprod")||e.includes("pre-prod")||e.includes("qa.")||e.includes(".qa")||e.includes("test.")||e.includes(".dev.")||e.includes("vercel.app")||e.includes("netlify.app")||e.includes("pages.dev")||e.includes("ngrok.io")||e.includes("ngrok-free.app")||e.includes("localhost.run")||e.includes("loca.lt")?"staging":"production"}var ds={init(e){Mt||typeof window>"u"||(e.environment??lr())==="production"||(Mt=!0,e.endpoint&&Sn(e.endpoint),on(e.maxBreadcrumbs),pn(e.maxLogs),fn(e.maxNetworkCaptures),xn(),e.enablePerformance!==!1&&kn(),rs(e),e.enableLivePins!==!1&&Q()&&(yt(e.projectId),vt(e.projectId)))},destroy(){Mt&&(os(),Wn(),Dn(),un(),vn(),wn(),ln(),En(),Mt=!1)},getLogs:te,clearLogs:bn,getNetworkCaptures:ye,getFailedNetworkCaptures:le,clearNetworkCaptures:hn,getErrors:ne,clearErrors:yn,getBreadcrumbs:he,clearBreadcrumbs:an,getPerformanceMetrics:we,addBreadcrumb:_,getThemes:ut,getThemeById:mt,setTheme:Lt,getCurrentThemeId:ts,getLayouts:gt,getLayoutById:Ue,setLayout:ns,getCurrentLayoutId:ss,getCurrentUser:Q,login:dt,logout:pt,togglePinMode:We,isPinModeActive:wt,isConnected:On,openAnnotationEditor:ls,redactString:ve,redactObject:tt},cr=ds;0&&(module.exports={BugStash});
|
|
1783
1636
|
//# sourceMappingURL=index.cjs.map
|