@blipit/browser 0.3.8 → 0.3.10

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/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ ## 0.3.10
2
+
3
+ - Add voice: when the site's `Permissions-Policy` turns the microphone off (`microphone=()`), the permission panel offers "Add voice". It opens a small Blipit window (`voice.html` served next to the SDK on blipit.io, with its own `Permissions-Policy: microphone=(self)`) from the visitor's click, so pop-up blockers allow it. The window asks for the microphone, shows the site it records for, a level meter and Mute, and records your voice with `MediaRecorder` (webm/opus, mp4/aac in Safari) while the page records the screen. Start, pause, resume and stop follow the recording bar; Stop in the window stops the recording.
4
+ - The two windows talk only through `postMessage` with the exact origin on both sides, the opener window checked as the message source, and a random nonce per recording in the URL fragment. No key or upload token is ever passed to the window; the voice comes back to the page in one-second pieces and is uploaded by the page with the report's own token.
5
+ - The voice uploads through in.blipit.io as a separate track next to the video (`recording/:position/voice/start`, `PUT`, `complete`), with the offset measured between the two recordings so it plays in sync. The preview in the reporter plays video and voice together with one control.
6
+ - A blocked pop-up says how to allow it and offers Try again; closing the window during a recording keeps the video and marks the voice as ending early. Phones and tablets get the guide only. Firefox does not apply the policy to the microphone and records directly; Safari cannot detect the policy, so nothing changes there.
7
+ - The video editor's voice-over uses the same window when the site blocks the microphone. Editing a video that has a separate voice puts the voice on its own lane, and Apply mixes it into the video.
8
+ - `blipit.js` is unchanged at 9.8 KB gzipped; all of this is in the lazily loaded reporter and the window's own script.
9
+
10
+ ## 0.3.9
11
+
12
+ - Before a screen recording starts, the reporter checks screen sharing (Permissions-Policy `display-capture`, browser support) and the microphone (Permissions-Policy `microphone`, `navigator.permissions.query({ name: "microphone" })`, `enumerateDevices` audio inputs). If both are fine it records at once. If not, a panel says why in plain words (the site turned it off, the visitor blocked it for this site, the operating system blocks the browser, no microphone) with steps for the visitor's browser (Chrome, Edge, Brave, Opera, Firefox, Safari) and system (macOS, Windows, Linux, iOS, Android), Try again, Record without voice, and Attach a video instead when screen recording is off. When the site's policy is the cause, a "For the site's developer" section shows `Permissions-Policy: microphone=(self)` or `display-capture=(self)`.
13
+ - When `getUserMedia` fails anyway, `NotAllowedError` (visitor), `NotAllowedError` "by system" and `NotReadableError` (operating system) and `NotFoundError` (no device) are told apart. The recording bar says "Voice off — how to turn on", which opens the same guide. The video editor's voice-over uses the same check, reason, steps and Try again. One shared module (`perm-guide.ts`) in the lazily loaded reporter; `blipit.js` stays 9.8 KB gzipped. With `debug` the reason is logged once.
14
+ - The minimized recording bar stays at the edge when hovered instead of jumping back to the middle, so Stop no longer moves away from the cursor.
15
+ - Recordings upload to in.blipit.io like screenshots (a server change that also applies to every earlier version), so the Content Security Policy needs only `connect-src https://in.blipit.io`.
16
+
1
17
  ## 0.3.8
2
18
 
3
19
  - Works with a strict Content Security Policy: the Report a bug button, `reportButton()`, the reporter and the video editor use constructable stylesheets and CSSOM styles instead of `<style>` elements and `style` attributes, so `style-src` needs no `'unsafe-inline'`. The screenshot no longer fails in Chromium when the page has web fonts and `style-src` blocks inline styles.
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
1
  "use strict";var j=Object.defineProperty;var Ae=Object.getOwnPropertyDescriptor;var Fe=Object.getOwnPropertyNames;var Ne=Object.prototype.hasOwnProperty;var De=(e,t)=>{for(var n in t)j(e,n,{get:t[n],enumerable:!0})},Pe=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Fe(t))!Ne.call(e,r)&&r!==n&&j(e,r,{get:()=>t[r],enumerable:!(i=Ae(t,r))||i.enumerable});return e};var Ue=e=>Pe(j({},"__esModule",{value:!0}),e);var St={};De(St,{addBreadcrumb:()=>bt,attachReport:()=>vt,captureException:()=>lt,captureMessage:()=>ft,captureSecurity:()=>mt,flush:()=>wt,init:()=>pt,openReport:()=>te,reportButton:()=>xt,setReportMetadata:()=>ye,setTag:()=>ht,setUser:()=>gt,showFeedback:()=>yt,updateWidget:()=>kt});module.exports=Ue(St);var ie={en:["Report {ref} sent.","We will email you updates."],ar:["\u062A\u0645 \u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0628\u0644\u0627\u063A {ref}.","\u0633\u0646\u0631\u0627\u0633\u0644\u0643 \u0628\u0627\u0644\u062A\u062D\u062F\u064A\u062B\u0627\u062A."],de:["Meldung {ref} gesendet.","Wir informieren Sie per E-Mail."],es:["Reporte {ref} enviado.","Te enviaremos novedades por correo."],fr:["Signalement {ref} envoy\xE9.","Nous vous tiendrons au courant par e-mail."],it:["Segnalazione {ref} inviata.","Ti invieremo aggiornamenti via email."],ja:["\u5831\u544A {ref} \u3092\u9001\u4FE1\u3057\u307E\u3057\u305F\u3002","\u9032\u6357\u306F\u30E1\u30FC\u30EB\u3067\u304A\u77E5\u3089\u305B\u3057\u307E\u3059\u3002"],nl:["Melding {ref} verstuurd.","We mailen je updates."],pt:["Relato {ref} enviado.","Vamos enviar novidades por e-mail."],tr:["{ref} numaral\u0131 bildirim g\xF6nderildi.","Geli\u015Fmeleri e-postayla bildirece\u011Fiz."],zh:["\u62A5\u544A {ref} \u5DF2\u53D1\u9001\u3002","\u6211\u4EEC\u4F1A\u901A\u8FC7\u90AE\u4EF6\u544A\u77E5\u8FDB\u5C55\u3002"]};function ze(e,t,n){if(typeof e!="string"||!/^BR-\d{1,12}$/.test(e))return null;let[i,r]=ie[n.toLowerCase().split(/[-_]/)[0]]??ie.en;return`${i.replace("{ref}",e)}${t===!0?` ${r}`:""}`}function x(e,t,n){let i=document.createElement(e);return i.style.cssText=t,n!==void 0&&(i.textContent=n),i}var W="display:block;width:100%;box-sizing:border-box;margin:4px 0 12px;padding:8px 10px;font:inherit;border:1px solid #c5ccd6;border-radius:6px;background:#fff;color:#111",re="font:inherit;padding:8px 14px;border-radius:6px;cursor:pointer;border:1px solid #c5ccd6;background:#fff;color:#111",q=!1;function oe(e,t,n){if(q||typeof document>"u"||!document.body)return;q=!0;let i=x("dialog","max-width:420px;width:calc(100% - 32px);padding:20px;border:1px solid #c5ccd6;border-radius:10px;font:14px/1.45 system-ui,sans-serif;color:#111;background:#fff");i.setAttribute("aria-labelledby","blipit-fb-title");let r=x("form","margin:0"),o=x("h2","margin:0 0 12px;font-size:17px",n.title??"Tell us what happened");o.id="blipit-fb-title";let c=(b,$,k)=>{let B=x("label","display:block;font-weight:600",b);B.htmlFor=k,$.id=k,r.append(B,$)},d=x("input",W);d.type="text",d.maxLength=128,d.autocomplete="name",d.value=n.name??"";let a=x("input",W);a.type="email",a.maxLength=254,a.autocomplete="email",a.value=n.email??"";let s=x("textarea",`${W};min-height:110px;resize:vertical`);s.required=!0,s.maxLength=5e3;let p=x("p","margin:0 0 12px;min-height:1.2em;font-size:13px");p.setAttribute("role","status"),p.setAttribute("aria-live","polite");let h=x("div","display:flex;gap:8px;justify-content:flex-end"),f=x("button",re,"Cancel");f.type="button";let m=x("button",`${re};background:#111;color:#fff;border-color:#111`,"Send");m.type="submit",r.append(o),c("Name (optional)",d,"blipit-fb-name"),c("Email (optional)",a,"blipit-fb-email"),c("What went wrong?",s,"blipit-fb-message"),h.append(f,m),r.append(p,h),i.append(r),document.body.append(i);let E=()=>{q=!1,i.remove()},R=()=>typeof i.close=="function"&&i.open?i.close():E();f.addEventListener("click",R),i.addEventListener("close",E),r.addEventListener("submit",async b=>{b.preventDefault();let $=s.value.trim();if(!$){p.textContent="Please describe what happened.",s.focus();return}m.disabled=!0,f.disabled=!0,m.setAttribute("aria-busy","true"),m.textContent="Sending\u2026",p.textContent="";try{let k=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json","X-Blipit-Key":t},body:JSON.stringify({name:d.value.trim()||void 0,email:a.value.trim()||void 0,message:$,event_id:n.eventId,url:typeof location<"u"?location.href.split(/[?#]/)[0]:void 0})});if(!k.ok)throw new Error(String(k.status));let B=await k.json().catch(()=>({})),A=ze(B.ref,B.emails,typeof navigator>"u"?"en":navigator.language??"en");p.textContent=A??"Thanks, your message was sent.",m.textContent="Sent",setTimeout(R,A?4e3:1200)}catch{p.textContent="That did not send. Please try again.",m.disabled=!1,f.disabled=!1,m.removeAttribute("aria-busy"),m.textContent="Send"}}),typeof i.showModal=="function"?i.showModal():i.setAttribute("open",""),s.focus()}var se=["login_failed","login_succeeded","login_blocked","password_reset_requested","privilege_granted"];var F=class{constructor(t,n,i,r){this.endpoint=t;this.key=n;this.debug=i;this.instance=r;typeof document<"u"&&document.addEventListener&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&this.flushWithBeacon()})}endpoint;key;debug;instance;queue=[];timer;sending=!1;enqueue(t){this.queue.push(t),this.queue.length>30&&this.queue.shift(),this.timer||(this.timer=setTimeout(()=>{this.timer=void 0,this.flush()},1e3))}async flush(){if(!this.sending){this.sending=!0;try{for(;this.queue.length>0;){let t=this.queue[0];if(!await this.send(t))break;this.queue.shift()}}finally{this.sending=!1}}}async send(t,n=0){try{let i=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","X-Blipit-Key":this.key,...this.instance?{"X-Blipit-Instance":this.instance}:{}},body:JSON.stringify(t),keepalive:!0});return i.status===429||i.status>=500?this.retry(t,n):(this.debug&&i.status>=400&&console.warn("[blipit] event rejected",i.status,await i.text()),!0)}catch{return this.retry(t,n)}}async retry(t,n){return n>=2?(this.debug&&console.warn("[blipit] dropping event after retries",t.event_id),!0):(await new Promise(i=>setTimeout(i,1e3*2**n)),this.send(t,n+1))}flushWithBeacon(){if(!(typeof navigator>"u"||!navigator.sendBeacon))for(;this.queue.length>0;){let t=this.queue.shift(),n=`key=${encodeURIComponent(this.key)}${this.instance?`&instance=${encodeURIComponent(this.instance)}`:""}`,i=`${this.endpoint}${this.endpoint.includes("?")?"&":"?"}${n}`;navigator.sendBeacon(i,JSON.stringify(t))}}};function L(){let e=new Uint8Array(16);if(typeof crypto<"u"&&crypto.getRandomValues)crypto.getRandomValues(e);else for(let n=0;n<16;n++)e[n]=Math.floor(Math.random()*256);e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t="";for(let n=0;n<16;n++)t+=e[n].toString(16).padStart(2,"0");return t}function v(){return new Date().toISOString()}var Ke=/token|key|password|secret|auth|session|passwd|api/i;function C(e){let t=e.indexOf("?");if(t===-1)return e.slice(0,2048);let n=e.slice(0,t),r=e.slice(t+1).split("&").map(o=>{let c=o.indexOf("=");if(c===-1)return o;let d=o.slice(0,c);return Ke.test(d)?`${d}=[redacted]`:o}).join("&");return`${n}?${r}`.slice(0,2048)}var je=/\b((?:[a-zA-Z0-9_-]*(?:token|key|password|secret|auth|session|passwd|api)[a-zA-Z0-9_-]*)=)[^&\s"']+/gi;function ae(e){return e.replace(je,"$1[redacted]")}function l(e,t){return e.length>t?e.slice(0,t):e}var de=".blipit-mask,[data-blipit-mask]";function H(e){return e.replace(/#.*/,"").replace(/([?&][^=&]*)=[^&]*/g,"$1=").slice(0,2048)}function w(e,t,n){e.push(t),e.length>n&&e.shift()}function X(e){let t=e.id?`#${e.id}`:"",n=typeof e.className=="string"&&e.className.trim()?`.${e.className.trim().split(/\s+/).slice(0,2).join(".")}`:"";return l(`${e.tagName.toLowerCase()}${t}${n}`,128)}function N(e,t){try{let n=new CSSStyleSheet;n.replaceSync(t),e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]}catch{let n=document.createElement("style");n.textContent=t,(e===document?document.head:e).append(n)}}function T(e,t){return`${e.replace(/\/api\/v1\/events.*$/,"").replace(/\/$/,"")}${t}`}function ce(e,t){let n=e?/^(https?:\/\/[^?#]*\/)blipit(?:\.min)?\.js(?:[?#].*)?$/.exec(e):null;return n?n[1]:`https://blipit.io/sdk/${t}/`}function We(e){let t=e.match(/rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:[,\s/]+([\d.]+%?))?/);if(!t||(t[4]===void 0?1:t[4].endsWith("%")?parseFloat(t[4])/100:parseFloat(t[4]))<.5)return null;let[i,r,o]=[t[1],t[2],t[3]].map(c=>{let d=parseFloat(c)/255;return d<=.03928?d/12.92:((d+.055)/1.055)**2.4});return .2126*i+.7152*r+.0722*o}function ue(e){if(e==="light"||e==="dark")return e;if(typeof document<"u"){for(let n of[document.body,document.documentElement]){if(!n)continue;let i=We(getComputedStyle(n).backgroundColor);if(i!==null)return i<.4?"dark":"light"}let t=getComputedStyle(document.documentElement).colorScheme;if(t==="dark")return"dark";if(t&&t!=="normal"&&!t.includes("dark"))return"light"}return typeof matchMedia=="function"&&matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}var pe={ok:0,errored:1,crashed:2},D=class{constructor(t,n,i,r){this.url=t;this.key=n;this.release=i;this.environment=r;this.start(),typeof document<"u"&&document.addEventListener&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.end():this.sid||this.start()})}url;key;release;environment;sid="";started="";status="ok";errors=0;did;setUser(t){this.did=t}markError(t){if(!this.sid)return;this.errors+=1;let n=t?"crashed":"errored";pe[n]<=pe[this.status]||(this.status=n,this.send(!1))}start(){this.sid=L(),this.started=v(),this.status="ok",this.errors=0,this.send(!1)}end(){this.sid&&(this.send(!0),this.sid="")}send(t){let n=JSON.stringify({sid:this.sid,did:this.did,status:this.status==="ok"&&t?"exited":this.status,errors:this.errors,started:this.started,release:this.release,environment:this.environment}),i=`${this.url}?key=${encodeURIComponent(this.key)}`;try{if(t&&typeof navigator<"u"&&navigator.sendBeacon){navigator.sendBeacon(i,n);return}if(typeof fetch>"u")return;fetch(this.url,{method:"POST",headers:{"Content-Type":"application/json","X-Blipit-Key":this.key},body:n,keepalive:!0}).catch(()=>{})}catch{return}}};var qe=/^\s*at (?:async )?(?:new )?(?:(.+?) )?\(?((?:file|https?|blob|chrome-extension|moz-extension|safari-web-extension|node|webpack):.*?|[^()]+?)(?::(\d+))?(?::(\d+))?\)?\s*$/,He=/^\s*(?:(.*?)@)?((?:file|https?|blob|chrome-extension|moz-extension|safari-web-extension|node|webpack).*?|[^@]*?)(?::(\d+))?(?::(\d+))?\s*$/,le=/^(chrome|moz|safari-web)-extension:/;function Xe(){if(typeof location<"u"&&location.origin)return location.origin}function Ve(e){if(le.test(e)||e==="<anonymous>"||e==="[native code]")return!1;let t=Xe();return!!(!t||e.startsWith(t)||!/^[a-z]+:/i.test(e))}function fe(e){if(!e)return[];let t=[];for(let n of e.split(`
2
- `)){if(!n||/^\s*(Error|TypeError|RangeError|SyntaxError|ReferenceError)\b/.test(n))continue;let i=qe.exec(n)??He.exec(n);if(!i)continue;let[,r,o,c,d]=i;if(!o)continue;let a={filename:l(o,1024),in_app:Ve(o)};r&&(a.function=l(r,512)),c&&(a.lineno=Number(c)),d&&(a.colno=Number(d)),t.push(a)}return t.reverse(),t.slice(-128)}function me(e){return e.length===0?!1:e.every(t=>le.test(t.filename))}var V="@blipit/browser",M="0.3.8",U=ce(typeof document<"u"?document.currentScript?.src:void 0,M),z="https://in.blipit.io/api/v1/events",Ge=[/ResizeObserver loop/i,/^Script error\.?$/,/__gCrWeb|__firefox__/],Ye={login_failed:"Failed login",login_succeeded:"Successful login",login_blocked:"Blocked login",password_reset_requested:"Password reset requested",privilege_granted:"Privilege granted"},Je={login_failed:"warning",login_succeeded:"info",login_blocked:"warning",password_reset_requested:"info",privilege_granted:"warning"};function Ze(e){if(!se.includes(e?.kind))return;let t=l(String(e.actor??"").trim(),256);if(!t)return;let n={kind:e.kind,actor:t};return e.actorId&&(n.actor_id=l(String(e.actorId),128)),e.ip&&(n.ip=l(String(e.ip).trim(),45)),e.userAgent&&(n.user_agent=l(String(e.userAgent),512)),e.database&&(n.database=l(String(e.database),64)),e.outcome&&(n.outcome=l(String(e.outcome),64)),e.target&&(n.target=l(String(e.target),256)),n}var P=class{constructor(t){this.options=t;this.endpoint=t.endpoint??z,this.transport=new F(this.endpoint,t.key,t.debug??!1,t.instance),t.autoSessionTracking&&(t.release?this.session=new D(T(this.endpoint,"/api/v1/sessions"),t.key,t.release,t.environment??"production"):t.debug&&console.warn("[blipit] session tracking needs the release option")),this.maxBreadcrumbs=Math.min(t.maxBreadcrumbs??50,100),this.ignoreErrors=[...Ge,...t.ignoreErrors??[]]}options;transport;breadcrumbs=[];user;tags={};maxBreadcrumbs;ignoreErrors;seen=new Set;captured=new WeakSet;session;lastEventId;errorIds=[];logs={console:[],network:[],actions:[]};endpoint;replay;setUser(t){this.user=t,this.session?.setUser(t?.id??t?.email)}setTag(t,n){this.tags[l(t,64)]=l(n,256)}addBreadcrumb(t){let n={timestamp:v(),...t};n.message&&(n.message=ae(n.message)),n.data&&typeof n.data.url=="string"&&(n.data={...n.data,url:C(n.data.url)}),this.breadcrumbs.push(n),this.breadcrumbs.length>this.maxBreadcrumbs&&this.breadcrumbs.shift()}captureException(t,n=!0){if(t&&typeof t=="object"){if(this.captured.has(t))return;this.captured.add(t)}let i=t instanceof Error?t:new Error(String(t)),r={type:i.name||"Error",value:l(i.message||String(i),4096),handled:n},o=fe(i.stack);return o.length>0&&(r.stacktrace={frames:o}),this.processAndSend({exception:r,level:"error"})}captureMessage(t,n="info"){return this.processAndSend({message:l(t,8192),level:n})}captureSecurity(t){let n=Ze(t);if(!n){this.options.debug&&console.warn("[blipit] security event dropped, needs a known kind and an actor");return}return this.processAndSend({message:`${Ye[n.kind]} for ${n.actor}`,level:Je[n.kind],security:n},!1)}processAndSend(t,n=!0){if(n&&this.options.sampleRate!==void 0&&Math.random()>this.options.sampleRate)return;let i=t.exception?.value??t.message??"";if(n){for(let d of this.ignoreErrors)if(typeof d=="string"?i.includes(d):d.test(i))return;if((this.options.autoMuteExtensions??!0)&&t.exception?.stacktrace&&me(t.exception.stacktrace.frames))return;let c=`${t.exception?.type??""}|${i}`;if(t.exception?.handled===!1){if(this.seen.has(c)&&this.seen.size<100)return;this.seen.add(c),setTimeout(()=>this.seen.delete(c),5e3)}}let r={event_id:L(),timestamp:v(),platform:"javascript",release:this.options.release,environment:this.options.environment??"production",user:this.user,tags:Object.keys(this.tags).length>0?{...this.tags}:void 0,breadcrumbs:this.breadcrumbs.length>0?[...this.breadcrumbs]:void 0,request:typeof location<"u"?{url:C(location.href)}:void 0,contexts:this.collectContexts(),sdk:{name:V,version:M},...t};for(let c of Object.keys(r))r[c]===void 0&&delete r[c];let o=this.replay?.active()&&(r.level==="error"||r.level==="fatal")?this.replay:void 0;if(o&&(r.tags={...r.tags,replay_id:o.id}),this.options.beforeSend){let c=this.options.beforeSend(r);if(!c)return;r=c}return this.transport.enqueue(r),this.lastEventId=r.event_id,(r.level==="error"||r.level==="fatal")&&w(this.errorIds,r.event_id,20),r.exception&&this.session?.markError(r.exception.handled===!1),o?.error(r.event_id),r.event_id}collectContexts(){if(typeof navigator>"u")return;let t={},n=navigator.userAgent??"",i=/(Edg|OPR|Chrome|Firefox|Safari)\/(\d+[\d.]*)/.exec(n)??void 0;i&&(t.browser={name:i[1],version:i[2]});let r=/\(([^)]+)\)/.exec(n);return r&&r[1]&&(t.os={name:l(r[1],64)}),typeof screen<"u"&&(t.device={screen:`${screen.width}x${screen.height}`}),Object.keys(t).length>0?t:void 0}flush(){return this.transport.flush()}};var Y={en:["Report a bug","Loading\u2026"],ar:["\u0623\u0628\u0644\u063A \u0639\u0646 \u062E\u0637\u0623","\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644\u2026"],de:["Fehler melden","Wird geladen\u2026"],es:["Reportar un error","Cargando\u2026"],fr:["Signaler un bug","Chargement\u2026"],it:["Segnala un bug","Caricamento\u2026"],ja:["\u4E0D\u5177\u5408\u3092\u5831\u544A","\u8AAD\u307F\u8FBC\u307F\u4E2D\u2026"],nl:["Bug melden","Laden\u2026"],pt:["Reportar erro","Carregando\u2026"],tr:["Hata bildir","Y\xFCkleniyor\u2026"],zh:["\u62A5\u544A\u95EE\u9898","\u52A0\u8F7D\u4E2D\u2026"]},Qe="button{all:initial;position:fixed;z-index:2147483646;display:flex;align-items:center;gap:8px;padding:11px 18px;border-radius:99px;background:var(--c,linear-gradient(135deg,#3882F6,#2F5BEA));color:#fff;font:600 14px system-ui,-apple-system,sans-serif;letter-spacing:-.01em;cursor:pointer;box-shadow:0 14px 32px -12px rgba(56,130,246,.75),0 2px 6px rgba(11,26,58,.18),inset 0 1px 0 rgba(255,255,255,.22);transition:transform .2s,box-shadow .2s;animation:in .35s cubic-bezier(.2,.8,.2,1)}button:hover{transform:translateY(-2px);box-shadow:0 20px 40px -12px rgba(56,130,246,.85),0 3px 8px rgba(11,26,58,.2),inset 0 1px 0 rgba(255,255,255,.22)}button:active{transform:scale(.97)}button:focus-visible{outline:3px solid #00C2FF;outline-offset:3px}button:disabled{cursor:progress}svg,i{width:18px;height:18px}i{box-sizing:border-box;border:2px solid;border-right-color:transparent;border-radius:50%;animation:r .8s linear infinite}@keyframes r{to{transform:rotate(1turn)}}@keyframes in{from{opacity:0;transform:translateY(12px) scale(.94)}}.o span{display:none}.o{padding:13px}@media(max-width:480px){span{display:none}button{padding:13px}}@media(pointer:coarse){button{min-height:44px;box-sizing:border-box}}@media(prefers-reduced-motion:reduce){button{animation:none;transition:none}i{animation-duration:3s}}",et='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round" aria-hidden="true"><path d="M4 4h16v12H9l-5 4zM12 7v4M12 13.5v.5"/></svg>',he,G={},be,S,J=()=>{},_,ge=0;function O(e,t){e.options.debug&&console.log(`[blipit] ${t}`)}function ye(e){he=e}function tt(e,t){return G[t]??=new Promise((n,i)=>{let r=document.createElement("script");r.src=e,r.async=!0,r.onload=()=>{let o=window[t];o?n(o):i(new Error(t))},r.onerror=i,document.head.appendChild(r)}).catch(n=>{throw delete G[t],n}),G[t]}function ve(){let e=(navigator.language??"en").slice(0,2);return Y[e]?e:"en"}function xe(e,t){let n=document.createElement("button");return n.type="button",n.className="blipit-rb",n.setAttribute("aria-haspopup","dialog"),e?n.textContent=e:(n.lang=ve(),n.textContent=Y[n.lang][0]),n.addEventListener("click",()=>n.hasAttribute("aria-busy")||t()),n}var ke=()=>{};function we(e){ke=e}function Z(e,t){ke(T(e.endpoint,"/api/v1/feedback"),e.options.key,t)}function K(e){if(typeof document>"u")return;let t=typeof e.options.feedbackWidget=="object"?e.options.feedbackWidget:{},n=document.querySelectorAll("button.blipit-rb"),i=r=>{J(r),n.forEach(o=>r?o.setAttribute("aria-busy","true"):o.removeAttribute("aria-busy"))};i(!0),Promise.all([tt(t.src??`${U}blipit-report.js`,"BlipitReport"),be??=Se(e)]).then(([r,o])=>o.enabled!==!1&&r.open(e,{metadata:he,recording:o.recording===!0,recordingMaxMs:o.recording_max_ms,storageFull:o.storage_full===!0,reportsFull:o.reports_full===!0,theme:o.theme,hide:c=>S&&(S.style.display=c?"none":"")}),()=>Z(e,{eventId:e.lastEventId,name:e.user?.username,email:e.user?.email})).finally(()=>i(!1))}async function Se(e){let t=`blipit_fb_${M}_${e.options.key}`;try{let n=JSON.parse(localStorage.getItem(t)??"null");if(n&&Date.now()-n.t<36e5)return n.s}catch{}try{let n=await fetch(T(e.endpoint,"/api/v1/feedback/settings"),{headers:{"X-Blipit-Key":e.options.key,...e.options.instance?{"X-Blipit-Instance":e.options.instance}:{}}});if(!n.ok)return O(e,`widget settings failed (HTTP ${n.status}), using defaults`),{};let i=await n.json();try{localStorage.setItem(t,JSON.stringify({t:Date.now(),s:i}))}catch{}return i}catch{return O(e,"widget settings unreachable (offline, ad blocker or CSP connect-src), using defaults"),{}}}async function Q(e){let t=e.options.feedbackWidget,n=++ge;if(typeof document>"u")return;if(t===!1)return O(e,"Report a bug button off: feedbackWidget is false");let i=await(be??=Se(e));if(n!==ge)return;if(i.enabled===!1)return O(e,"Report a bug button hidden by the project's Bug report widget setting");let r={...i,...typeof t=="object"?t:{}},[o,c]=Y[ve()],d=r.text||o;S=document.createElement("div"),S.setAttribute("data-blipit-ui","");let a=S.attachShadow({mode:"open"}),s=document.createElement("button");s.type="button";let[p,h]=(/^(bottom|middle)-(left|right)$/.test(r.position??"")?r.position:"bottom-right").split("-");s.style.cssText=`${r.color?`--c:${r.color};`:""}${h}:calc(20px + env(safe-area-inset-${h},0px));${p==="bottom"?"bottom:calc(20px + env(safe-area-inset-bottom,0px))":"top:50%;margin-top:-22px"}`,s.setAttribute("aria-haspopup","dialog"),r.style==="icon"&&(s.className="o",s.title=d);let f=b=>{s.disabled=b,s.setAttribute("aria-label",b?c:d),s.innerHTML=b?"<i></i><span></span>":`${et}<span></span>`,s.lastChild.textContent=b?c:d};J=f,f(!1),s.addEventListener("click",()=>K(e)),N(a,Qe),a.append(s);let m=r.shortcut?.toLowerCase().replace(/\s/g,"");_&&document.removeEventListener("keydown",_),_=void 0,m&&(_=b=>{[b.ctrlKey&&"ctrl",b.shiftKey&&"shift",b.altKey&&"alt",b.metaKey&&"meta",b.key.toLowerCase()].filter(Boolean).join("+")===m&&(b.preventDefault(),K(e))},document.addEventListener("keydown",_));let E=S,R=()=>{S===E&&(document.body.append(E),O(e,`Report a bug button shown at ${p}-${h}`))};document.body?R():document.addEventListener("DOMContentLoaded",R)}function Ee(e,t){let n=e.options.feedbackWidget;e.options.feedbackWidget=t===!1?!1:{...typeof n=="object"?n:{},...t},S?.remove(),S=void 0,_&&document.removeEventListener("keydown",_),_=void 0,J=()=>{},Q(e)}function ee(e){return typeof e=="string"?e.length:e?.size}function Re(e){return e&&Number(e)||void 0}function nt(e,t){return async(n,i)=>{let r=typeof n=="string"?n:n instanceof URL?n.href:n.url,o=(i?.method??n.method??"GET").toUpperCase(),c=Date.now();try{let d=await e(n,i);return t(o,r,d.status,c,ee(i?.body),Re(d.headers.get("content-length"))),d}catch(d){throw t(o,r,0,c,ee(i?.body)),d}}}function it(e,t){let n=e.open,i=e.send;e.open=function(r,o){return this._blipit=[String(r).toUpperCase(),String(o)],n.apply(this,arguments)},e.send=function(r){let o=this._blipit;if(o){let c=Date.now();this.addEventListener("loadend",()=>t(o[0],o[1],this.status,c,ee(r),Re(this.getResponseHeader("content-length"))))}return i.apply(this,arguments)}}function $e(e){if(typeof window>"u")return;let t=T(e.endpoint,""),{console:n,network:i,actions:r}=e.logs;window.addEventListener("error",a=>{e.captureException(a.error??a.message,!1)}),window.addEventListener("unhandledrejection",a=>{e.captureException(a.reason,!1)}),typeof document<"u"&&(document.addEventListener("click",a=>{let s=a.target;if(!(s instanceof Element)||s.closest("[data-blipit-ui]"))return;let p=X(s);e.addBreadcrumb({category:"ui.click",message:`Clicked ${p}`});let h=s.closest(de)?"***":l((s.textContent??"").trim().replace(/\s+/g," "),80);w(r,{timestamp:v(),type:"click",selector:p,text:h},50)},{capture:!0,passive:!0}),document.addEventListener("focusin",a=>{let s=a.target;s instanceof Element&&/^(INPUT|TEXTAREA|SELECT)$/.test(s.tagName)&&w(r,{timestamp:v(),type:"focus",selector:X(s)},50)},{capture:!0,passive:!0}));let o=(a,s,p,h,f,m)=>{t&&s.startsWith(t)||(e.addBreadcrumb({category:"http",message:`${a} ${C(s)} \u2192 ${p||"network error"}`,level:p>=400||!p?"error":"info",data:{url:C(s),method:a,status_code:p||void 0}}),w(i,{timestamp:v(),method:a,url:H(s),status:p,duration:Date.now()-h,request_size:f,response_size:m},50))};typeof window.fetch=="function"&&(window.fetch=nt(window.fetch.bind(window),o)),typeof XMLHttpRequest<"u"&&it(XMLHttpRequest.prototype,o);for(let a of["log","info","debug","warn","error"]){let s=console[a].bind(console);console[a]=(...p)=>{let h=l(p.map(f=>typeof f=="string"?f:rt(f)).join(" "),1024);if(a==="warn"||a==="error"){e.addBreadcrumb({category:"console",level:a==="warn"?"warning":"error",message:h});let f=p.find(m=>m instanceof Error);w(n,{timestamp:v(),level:a,message:h,stack:l((f??new Error).stack??"",2e3)},100)}else w(n,{timestamp:v(),level:a,message:h},100);s(...p)}}let c=()=>w(r,{timestamp:v(),type:"navigation",url:H(location.href)},50),d=()=>{e.addBreadcrumb({category:"navigation",message:`Navigated to ${C(location.href)}`}),c()};if(c(),window.history){let a=window.history.pushState.bind(window.history);window.history.pushState=(...s)=>{a(...s),d()},window.addEventListener("popstate",d)}}function rt(e){try{return JSON.stringify(e)??String(e)}catch{return String(e)}}function Be(){let e=0,t=0,n=0,i=0;return r=>(r.hadRecentInput||(t>0&&r.startTime-i<1e3&&r.startTime-n<5e3?t+=r.value:(t=r.value,n=r.startTime),i=r.startTime,t>e&&(e=t)),e)}function ot(e){if(e.size===0)return;let t=[...e.values()].sort((n,i)=>i-n);return t[Math.min(t.length-1,Math.floor(e.size/50))]}function st(e){return/iPad|Tablet|Android(?!.*Mobile)/i.test(e)?"tablet":/Mobi|iPhone|Android/i.test(e)?"mobile":"desktop"}function I(e,t,n){try{new PerformanceObserver(i=>i.getEntries().forEach(r=>t(r))).observe({type:e,buffered:!0,...n})}catch{}}function Te(e,t,n){if(typeof PerformanceObserver>"u"||typeof document>"u")return;let i=performance.getEntriesByType("navigation")[0],r=i?.activationStart??0,o=y=>Math.max(0,Math.round(y-r)),c=document.visibilityState==="hidden",d=location.pathname,a=i?.type,s={},p=Be(),h=new Map,f=!1,m=!1;i&&i.responseStart>0&&(s.ttfb=o(i.responseStart)),c||(I("paint",y=>{y.name==="first-contentful-paint"&&(s.fcp=o(y.startTime))}),I("largest-contentful-paint",y=>{f||(s.lcp=o(y.startTime))}));let E=()=>{f=!0};addEventListener("keydown",E,{once:!0,capture:!0}),addEventListener("pointerdown",E,{once:!0,capture:!0}),I("layout-shift",y=>{s.cls=Math.round(p(y)*1e4)/1e4});let R=y=>{if(!y.interactionId)return;h.set(y.interactionId,Math.max(h.get(y.interactionId)??0,y.duration));let ne=ot(h);ne!==void 0&&(s.inp=Math.round(ne))};I("event",R,{durationThreshold:40}),I("first-input",R);let b=navigator.connection?.effectiveType,$=`${new URL("/api/v1/vitals",e).href}?key=${encodeURIComponent(t)}${n?`&instance=${encodeURIComponent(n)}`:""}`,k=()=>{if(m||Object.keys(s).length===0)return;m=!0;let y=JSON.stringify({path:d.slice(0,512),metrics:s,nav:a,connection:b&&/^(slow-2g|2g|3g|4g)$/.test(b)?b:void 0,device:st(navigator.userAgent)});try{if(navigator.sendBeacon?.($,y))return}catch{}fetch($,{method:"POST",body:y,keepalive:!0}).catch(()=>{})},B=()=>{location.pathname!==d&&(k(),d=location.pathname,a="route",s={},p=Be(),h=new Map,f=!0,m=!1)};document.addEventListener("visibilitychange",()=>document.visibilityState==="hidden"&&k()),addEventListener("pagehide",k),addEventListener("popstate",B);let A=history.pushState;history.pushState=function(...y){A.apply(this,y),B()}}function at(e,t=Math.random){return t()<(e.sessionSampleRate??0)?"session":t()<(e.onErrorSampleRate??1)?"buffer":null}function _e(e,t,n,i,r){let o=at(e);if(!o||typeof document>"u")return;let c=L(),d,a=document.createElement("script");return a.src=e.src??`${r}blipit-replay.js`,a.async=!0,a.onload=()=>{let s=window.BlipitReplay?.start;d=s?.({id:c,mode:o,endpoint:t,key:n,instance:i})},document.head.appendChild(a),{id:c,active:()=>d?.active()??!1,error:s=>d?.error(s),report:s=>d?.report?.(s)}}var Ce='<svg viewBox="0 0 242.4 208.7" aria-hidden="true"><defs><linearGradient id="bm1" x1="0" y1="1" x2=".5" y2="0"><stop offset="0" stop-color="#00C2FF"/><stop offset=".35" stop-color="#3882F6"/><stop offset="1" stop-color="#0F172A"/></linearGradient><linearGradient id="bm2" x1="0" y1="1" x2="1" y2="0"><stop offset="0" stop-color="#3882F6"/><stop offset=".5" stop-color="#00C2FF"/><stop offset="1" stop-color="#3882F6"/></linearGradient></defs><path fill="url(#bm1)" d="M115.5,164.5c-3.9,0-7.8-.4-11.5-1.2-3.7-.8-7.3-1.9-10.8-3.4-3.4-1.4-6.7-3.2-9.7-5.3-3.0-2.0-5.9-4.4-8.5-7.0s-4.9-5.4-7.0-8.5c-2.1-3.1-3.9-6.3-5.3-9.8-1.5-3.5-2.6-7.1-3.4-10.8-.8-3.8-1.2-7.7-1.2-11.5V19.1c0-6.6,5.4-12.0,12.0-12.0s12.0,5.4,12.0,12.0v88.2c0,2.2.2,4.5.7,6.7.4,2.1,1.1,4.2,1.9,6.2.8,2.0,1.9,3.9,3.1,5.7,1.2,1.8,2.6,3.4,4.1,4.9s3.2,2.9,4.9,4.1c1.8,1.2,3.7,2.2,5.6,3.1,2.0.8,4.1,1.5,6.2,1.9,4.4.9,9.1.9,13.4,0,2.1-.4,4.2-1.1,6.2-1.9,2.0-.8,3.9-1.9,5.7-3.1,1.8-1.2,3.4-2.6,4.9-4.1s2.9-3.2,4.1-4.9c1.2-1.8,2.2-3.7,3.1-5.7.8-2.0,1.5-4.1,1.9-6.2.5-2.2.7-4.5.7-6.7s-.2-4.5-.7-6.7c-.4-2.1-1.1-4.2-1.9-6.2-.8-2.0-1.9-3.9-3.1-5.7-1.2-1.8-2.6-3.4-4.1-4.9s-3.2-2.9-4.9-4.1c-1.8-1.2-3.7-2.2-5.7-3.1-2.0-.8-4.1-1.5-6.2-1.9-4.4-.9-9.1-.9-13.4,0-6.5,1.3-12.9-2.9-14.2-9.4-1.3-6.5,2.9-12.9,9.4-14.2,7.6-1.6,15.5-1.6,23.1,0,3.7.8,7.3,1.9,10.8,3.4,3.4,1.4,6.7,3.2,9.7,5.3,3.0,2.0,5.9,4.4,8.5,7.0s4.9,5.4,7.0,8.5c2.1,3.1,3.9,6.3,5.3,9.8,1.5,3.5,2.6,7.1,3.4,10.8.8,3.8,1.2,7.7,1.2,11.5s-.4,7.8-1.2,11.5c-.8,3.7-1.9,7.3-3.4,10.8-1.4,3.4-3.2,6.7-5.3,9.7-2.0,3.0-4.4,5.9-7.0,8.5s-5.4,4.9-8.5,7.0c-3.1,2.1-6.3,3.9-9.8,5.3-3.5,1.5-7.1,2.6-10.8,3.4-3.8.8-7.7,1.2-11.5,1.2Z"/><path fill="url(#bm2)" d="M208.1,103.0c-.0-.6-.8-.9-1.2-.5-3.2,3.1-7.6,5.0-12.4,5.0-3.9,0-9.1-1.6-10.2-2.5-.3-.1-.1,1.4-.1,2.5,0,40.5-34.4,73.0-75.5,70.0-33.4-2.5-60.8-28.8-64.4-62.1-1.0-9.4-.2-18.6,2.2-27.0,1.6-5.6,2.6-11.4,2.6-17.3v-22.4c0-3.4-4.3-5.0-6.5-2.4-13.2,15.4-21.6,35.1-22.7,56.6-2.6,54.1,40.6,98.9,94.1,98.9s94.2-42.3,94.2-94.2c0-1.5-.1-3.0-.1-4.5Z"/><path fill="url(#bm2)" d="M201.2,70.1c-14.8-35.8-50.9-60.5-92.3-58.3h-.1c-8.2.5-14.6,7.4-14.6,15.7v.1c0,5.4,4.7,9.6,10.0,8.8,3.2-.5,6.5-.7,9.9-.7,28.7,0,53.5,17.4,64.3,42.1.2.5.9.6,1.2.1,3.2-4.8,8.7-7.9,14.9-7.9,2.0,0,4.0.3,5.8,1.0.6.2,1.1-.4.9-1.0Z"/><circle fill="#00C2FF" cx="194.5" cy="88" r="15.8"/></svg>';var u=".blipit-rb.blipit-rb",dt=`${u}{all:unset;box-sizing:border-box;display:inline-flex;align-items:center;gap:9px;height:40px;padding-inline:5px 17px;border-radius:99px;font:600 14px/1 system-ui,-apple-system,"Segoe UI",sans-serif;letter-spacing:-.01em;white-space:nowrap;cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent;color:#fff;background:linear-gradient(135deg,#3882F6,#2F5BEA);box-shadow:0 10px 24px -12px rgba(56,130,246,.8),0 1px 3px rgba(11,26,58,.16),inset 0 1px 0 rgba(255,255,255,.22);transition:transform .2s,box-shadow .2s}${u}:hover{transform:translateY(-1px);box-shadow:0 16px 32px -12px rgba(56,130,246,.85),0 2px 6px rgba(11,26,58,.18),inset 0 1px 0 rgba(255,255,255,.22)}${u}:active{transform:scale(.97)}${u}:focus-visible{outline:3px solid #00C2FF;outline-offset:3px}${u}[aria-busy=true]{cursor:progress}${u}>span{all:unset}${u}>.blipit-rb-m{position:relative;display:grid;place-items:center;flex:none;width:30px;height:30px;border-radius:99px;background:#fff;box-shadow:0 0 0 1px rgba(11,26,58,.08),0 1px 2px rgba(11,26,58,.12)}${u} svg{display:block;width:19px;height:17px}${u}[data-size=sm]{height:32px;gap:7px;padding-inline:4px 13px;font-size:13px}${u}[data-size=sm]>.blipit-rb-m{width:24px;height:24px}${u}[data-size=sm] svg{width:15px;height:13px}${u}[data-variant=outline],${u}[data-variant=ghost]{color:#0B1A3A;background:transparent;box-shadow:inset 0 0 0 1px #CBD7EA}${u}[data-variant=ghost]{box-shadow:none}${u}[data-variant=outline]:hover,${u}[data-variant=ghost]:hover{transform:none;background:rgba(56,130,246,.08);box-shadow:inset 0 0 0 1px rgba(56,130,246,.45)}${u}[data-variant=ghost]:hover{box-shadow:none}${u}[data-theme=dark]{background:linear-gradient(135deg,#5B9BFF,#3D6BF0);box-shadow:0 10px 24px -12px rgba(91,155,255,.7),inset 0 1px 0 rgba(255,255,255,.2)}${u}[data-theme=dark][data-variant=outline],${u}[data-theme=dark][data-variant=ghost]{color:#E8EEF8;background:transparent;box-shadow:inset 0 0 0 1px rgba(255,255,255,.16)}${u}[data-theme=dark][data-variant=ghost]{box-shadow:none}${u}[data-theme=dark][data-variant=outline]:hover,${u}[data-theme=dark][data-variant=ghost]:hover{background:rgba(91,155,255,.16);box-shadow:inset 0 0 0 1px rgba(91,155,255,.45)}${u}[data-theme=dark][data-variant=ghost]:hover{box-shadow:none}${u}[data-theme=dark]>.blipit-rb-m{box-shadow:0 0 0 1px rgba(255,255,255,.1)}${u}[aria-busy=true] svg{visibility:hidden}${u}[aria-busy=true]>.blipit-rb-m::after{content:"";position:absolute;inset:4px;border:2px solid #3882F6;border-right-color:transparent;border-radius:50%;animation:blipit-rb-r .8s linear infinite}@keyframes blipit-rb-r{to{transform:rotate(1turn)}}@media(pointer:coarse){${u}{min-height:44px}}@media(prefers-reduced-motion:reduce){${u}{transition:none}${u}:hover,${u}:active{transform:none}${u}[aria-busy=true]>.blipit-rb-m::after{animation-duration:3s}}@media(forced-colors:active){${u}{border:1px solid ButtonText}}`,Le=0;function Me(e,t={}){Le||N(document,dt);let n=++Le,i=document.createElement("span");i.className="blipit-rb-m",i.innerHTML=Ce.replace(/bm(\d)/g,`bm$1-${n}`);let r=document.createElement("span");r.textContent=e.textContent,e.replaceChildren(i,r),e.classList.add("blipit-rb"),e.setAttribute("data-variant",t.variant==="outline"||t.variant==="ghost"?t.variant:"solid"),e.setAttribute("data-size",t.size==="sm"?"sm":"md"),e.setAttribute("data-theme",ue(t.theme==="light"||t.theme==="dark"?t.theme:void 0))}var g,Oe=new Set;function Ie(e,t){Oe.has(t)||(Oe.add(t),console[e](t))}var ct="[blipit] init() has no key, so error tracking and the Report a bug button are off. Pass your public key (blipit_pk_...) from app.blipit.io, API keys.",ut="[blipit] init() got a secret key (blipit_sk_...), so Blipit did not start: secret keys must never be in browser code. Use the public key (blipit_pk_...) and create a new secret key in app.blipit.io, API keys.";function pt(e){if(g)return;let t=typeof e?.key=="string"?e.key.trim():"";if(!t)return Ie("warn",ct);if(t.startsWith("blipit_sk_"))return Ie("error",ut);if(g=new P({...e,key:t}),e.user){let{id:n,name:i,email:r,username:o}=e.user;g.setUser({id:n===void 0?void 0:String(n),email:r,username:o??i})}$e(g),e.webVitals!==!1&&typeof window<"u"&&Te(e.endpoint??z,t,e.instance),e.replay&&(g.replay=_e(e.replay,e.endpoint??z,t,e.instance,U)),typeof window<"u"&&Q(g),e.debug&&console.log(`[blipit] ${V}@${M} initialized`)}function lt(e){return g?.captureException(e,!0)}function ft(e,t){return g?.captureMessage(e,t)}function mt(e){return g?.captureSecurity(e)}function gt(e){g?.setUser(e)}function ht(e,t){g?.setTag(e,t)}function bt(e){g?.addBreadcrumb(e)}function yt(e={}){g&&Z(g,{...e,eventId:e.eventId??g.lastEventId})}function te(){g&&K(g)}function vt(e){e.addEventListener("click",t=>{t.preventDefault(),te()})}function xt(e={}){let t=xe(e.label,te);return Me(t,e),t}function kt(e){g&&Ee(g,e)}function wt(){return g?.flush()??Promise.resolve()}we(oe);0&&(module.exports={addBreadcrumb,attachReport,captureException,captureMessage,captureSecurity,flush,init,openReport,reportButton,setReportMetadata,setTag,setUser,showFeedback,updateWidget});
2
+ `)){if(!n||/^\s*(Error|TypeError|RangeError|SyntaxError|ReferenceError)\b/.test(n))continue;let i=qe.exec(n)??He.exec(n);if(!i)continue;let[,r,o,c,d]=i;if(!o)continue;let a={filename:l(o,1024),in_app:Ve(o)};r&&(a.function=l(r,512)),c&&(a.lineno=Number(c)),d&&(a.colno=Number(d)),t.push(a)}return t.reverse(),t.slice(-128)}function me(e){return e.length===0?!1:e.every(t=>le.test(t.filename))}var V="@blipit/browser",M="0.3.10",U=ce(typeof document<"u"?document.currentScript?.src:void 0,M),z="https://in.blipit.io/api/v1/events",Ge=[/ResizeObserver loop/i,/^Script error\.?$/,/__gCrWeb|__firefox__/],Ye={login_failed:"Failed login",login_succeeded:"Successful login",login_blocked:"Blocked login",password_reset_requested:"Password reset requested",privilege_granted:"Privilege granted"},Je={login_failed:"warning",login_succeeded:"info",login_blocked:"warning",password_reset_requested:"info",privilege_granted:"warning"};function Ze(e){if(!se.includes(e?.kind))return;let t=l(String(e.actor??"").trim(),256);if(!t)return;let n={kind:e.kind,actor:t};return e.actorId&&(n.actor_id=l(String(e.actorId),128)),e.ip&&(n.ip=l(String(e.ip).trim(),45)),e.userAgent&&(n.user_agent=l(String(e.userAgent),512)),e.database&&(n.database=l(String(e.database),64)),e.outcome&&(n.outcome=l(String(e.outcome),64)),e.target&&(n.target=l(String(e.target),256)),n}var P=class{constructor(t){this.options=t;this.endpoint=t.endpoint??z,this.transport=new F(this.endpoint,t.key,t.debug??!1,t.instance),t.autoSessionTracking&&(t.release?this.session=new D(T(this.endpoint,"/api/v1/sessions"),t.key,t.release,t.environment??"production"):t.debug&&console.warn("[blipit] session tracking needs the release option")),this.maxBreadcrumbs=Math.min(t.maxBreadcrumbs??50,100),this.ignoreErrors=[...Ge,...t.ignoreErrors??[]]}options;transport;breadcrumbs=[];user;tags={};maxBreadcrumbs;ignoreErrors;seen=new Set;captured=new WeakSet;session;lastEventId;errorIds=[];logs={console:[],network:[],actions:[]};endpoint;replay;setUser(t){this.user=t,this.session?.setUser(t?.id??t?.email)}setTag(t,n){this.tags[l(t,64)]=l(n,256)}addBreadcrumb(t){let n={timestamp:v(),...t};n.message&&(n.message=ae(n.message)),n.data&&typeof n.data.url=="string"&&(n.data={...n.data,url:C(n.data.url)}),this.breadcrumbs.push(n),this.breadcrumbs.length>this.maxBreadcrumbs&&this.breadcrumbs.shift()}captureException(t,n=!0){if(t&&typeof t=="object"){if(this.captured.has(t))return;this.captured.add(t)}let i=t instanceof Error?t:new Error(String(t)),r={type:i.name||"Error",value:l(i.message||String(i),4096),handled:n},o=fe(i.stack);return o.length>0&&(r.stacktrace={frames:o}),this.processAndSend({exception:r,level:"error"})}captureMessage(t,n="info"){return this.processAndSend({message:l(t,8192),level:n})}captureSecurity(t){let n=Ze(t);if(!n){this.options.debug&&console.warn("[blipit] security event dropped, needs a known kind and an actor");return}return this.processAndSend({message:`${Ye[n.kind]} for ${n.actor}`,level:Je[n.kind],security:n},!1)}processAndSend(t,n=!0){if(n&&this.options.sampleRate!==void 0&&Math.random()>this.options.sampleRate)return;let i=t.exception?.value??t.message??"";if(n){for(let d of this.ignoreErrors)if(typeof d=="string"?i.includes(d):d.test(i))return;if((this.options.autoMuteExtensions??!0)&&t.exception?.stacktrace&&me(t.exception.stacktrace.frames))return;let c=`${t.exception?.type??""}|${i}`;if(t.exception?.handled===!1){if(this.seen.has(c)&&this.seen.size<100)return;this.seen.add(c),setTimeout(()=>this.seen.delete(c),5e3)}}let r={event_id:L(),timestamp:v(),platform:"javascript",release:this.options.release,environment:this.options.environment??"production",user:this.user,tags:Object.keys(this.tags).length>0?{...this.tags}:void 0,breadcrumbs:this.breadcrumbs.length>0?[...this.breadcrumbs]:void 0,request:typeof location<"u"?{url:C(location.href)}:void 0,contexts:this.collectContexts(),sdk:{name:V,version:M},...t};for(let c of Object.keys(r))r[c]===void 0&&delete r[c];let o=this.replay?.active()&&(r.level==="error"||r.level==="fatal")?this.replay:void 0;if(o&&(r.tags={...r.tags,replay_id:o.id}),this.options.beforeSend){let c=this.options.beforeSend(r);if(!c)return;r=c}return this.transport.enqueue(r),this.lastEventId=r.event_id,(r.level==="error"||r.level==="fatal")&&w(this.errorIds,r.event_id,20),r.exception&&this.session?.markError(r.exception.handled===!1),o?.error(r.event_id),r.event_id}collectContexts(){if(typeof navigator>"u")return;let t={},n=navigator.userAgent??"",i=/(Edg|OPR|Chrome|Firefox|Safari)\/(\d+[\d.]*)/.exec(n)??void 0;i&&(t.browser={name:i[1],version:i[2]});let r=/\(([^)]+)\)/.exec(n);return r&&r[1]&&(t.os={name:l(r[1],64)}),typeof screen<"u"&&(t.device={screen:`${screen.width}x${screen.height}`}),Object.keys(t).length>0?t:void 0}flush(){return this.transport.flush()}};var Y={en:["Report a bug","Loading\u2026"],ar:["\u0623\u0628\u0644\u063A \u0639\u0646 \u062E\u0637\u0623","\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644\u2026"],de:["Fehler melden","Wird geladen\u2026"],es:["Reportar un error","Cargando\u2026"],fr:["Signaler un bug","Chargement\u2026"],it:["Segnala un bug","Caricamento\u2026"],ja:["\u4E0D\u5177\u5408\u3092\u5831\u544A","\u8AAD\u307F\u8FBC\u307F\u4E2D\u2026"],nl:["Bug melden","Laden\u2026"],pt:["Reportar erro","Carregando\u2026"],tr:["Hata bildir","Y\xFCkleniyor\u2026"],zh:["\u62A5\u544A\u95EE\u9898","\u52A0\u8F7D\u4E2D\u2026"]},Qe="button{all:initial;position:fixed;z-index:2147483646;display:flex;align-items:center;gap:8px;padding:11px 18px;border-radius:99px;background:var(--c,linear-gradient(135deg,#3882F6,#2F5BEA));color:#fff;font:600 14px system-ui,-apple-system,sans-serif;letter-spacing:-.01em;cursor:pointer;box-shadow:0 14px 32px -12px rgba(56,130,246,.75),0 2px 6px rgba(11,26,58,.18),inset 0 1px 0 rgba(255,255,255,.22);transition:transform .2s,box-shadow .2s;animation:in .35s cubic-bezier(.2,.8,.2,1)}button:hover{transform:translateY(-2px);box-shadow:0 20px 40px -12px rgba(56,130,246,.85),0 3px 8px rgba(11,26,58,.2),inset 0 1px 0 rgba(255,255,255,.22)}button:active{transform:scale(.97)}button:focus-visible{outline:3px solid #00C2FF;outline-offset:3px}button:disabled{cursor:progress}svg,i{width:18px;height:18px}i{box-sizing:border-box;border:2px solid;border-right-color:transparent;border-radius:50%;animation:r .8s linear infinite}@keyframes r{to{transform:rotate(1turn)}}@keyframes in{from{opacity:0;transform:translateY(12px) scale(.94)}}.o span{display:none}.o{padding:13px}@media(max-width:480px){span{display:none}button{padding:13px}}@media(pointer:coarse){button{min-height:44px;box-sizing:border-box}}@media(prefers-reduced-motion:reduce){button{animation:none;transition:none}i{animation-duration:3s}}",et='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round" aria-hidden="true"><path d="M4 4h16v12H9l-5 4zM12 7v4M12 13.5v.5"/></svg>',he,G={},be,S,J=()=>{},_,ge=0;function O(e,t){e.options.debug&&console.log(`[blipit] ${t}`)}function ye(e){he=e}function tt(e,t){return G[t]??=new Promise((n,i)=>{let r=document.createElement("script");r.src=e,r.async=!0,r.onload=()=>{let o=window[t];o?n(o):i(new Error(t))},r.onerror=i,document.head.appendChild(r)}).catch(n=>{throw delete G[t],n}),G[t]}function ve(){let e=(navigator.language??"en").slice(0,2);return Y[e]?e:"en"}function xe(e,t){let n=document.createElement("button");return n.type="button",n.className="blipit-rb",n.setAttribute("aria-haspopup","dialog"),e?n.textContent=e:(n.lang=ve(),n.textContent=Y[n.lang][0]),n.addEventListener("click",()=>n.hasAttribute("aria-busy")||t()),n}var ke=()=>{};function we(e){ke=e}function Z(e,t){ke(T(e.endpoint,"/api/v1/feedback"),e.options.key,t)}function K(e){if(typeof document>"u")return;let t=typeof e.options.feedbackWidget=="object"?e.options.feedbackWidget:{},n=document.querySelectorAll("button.blipit-rb"),i=r=>{J(r),n.forEach(o=>r?o.setAttribute("aria-busy","true"):o.removeAttribute("aria-busy"))};i(!0),Promise.all([tt(t.src??`${U}blipit-report.js`,"BlipitReport"),be??=Se(e)]).then(([r,o])=>o.enabled!==!1&&r.open(e,{metadata:he,recording:o.recording===!0,recordingMaxMs:o.recording_max_ms,storageFull:o.storage_full===!0,reportsFull:o.reports_full===!0,theme:o.theme,hide:c=>S&&(S.style.display=c?"none":"")}),()=>Z(e,{eventId:e.lastEventId,name:e.user?.username,email:e.user?.email})).finally(()=>i(!1))}async function Se(e){let t=`blipit_fb_${M}_${e.options.key}`;try{let n=JSON.parse(localStorage.getItem(t)??"null");if(n&&Date.now()-n.t<36e5)return n.s}catch{}try{let n=await fetch(T(e.endpoint,"/api/v1/feedback/settings"),{headers:{"X-Blipit-Key":e.options.key,...e.options.instance?{"X-Blipit-Instance":e.options.instance}:{}}});if(!n.ok)return O(e,`widget settings failed (HTTP ${n.status}), using defaults`),{};let i=await n.json();try{localStorage.setItem(t,JSON.stringify({t:Date.now(),s:i}))}catch{}return i}catch{return O(e,"widget settings unreachable (offline, ad blocker or CSP connect-src), using defaults"),{}}}async function Q(e){let t=e.options.feedbackWidget,n=++ge;if(typeof document>"u")return;if(t===!1)return O(e,"Report a bug button off: feedbackWidget is false");let i=await(be??=Se(e));if(n!==ge)return;if(i.enabled===!1)return O(e,"Report a bug button hidden by the project's Bug report widget setting");let r={...i,...typeof t=="object"?t:{}},[o,c]=Y[ve()],d=r.text||o;S=document.createElement("div"),S.setAttribute("data-blipit-ui","");let a=S.attachShadow({mode:"open"}),s=document.createElement("button");s.type="button";let[p,h]=(/^(bottom|middle)-(left|right)$/.test(r.position??"")?r.position:"bottom-right").split("-");s.style.cssText=`${r.color?`--c:${r.color};`:""}${h}:calc(20px + env(safe-area-inset-${h},0px));${p==="bottom"?"bottom:calc(20px + env(safe-area-inset-bottom,0px))":"top:50%;margin-top:-22px"}`,s.setAttribute("aria-haspopup","dialog"),r.style==="icon"&&(s.className="o",s.title=d);let f=b=>{s.disabled=b,s.setAttribute("aria-label",b?c:d),s.innerHTML=b?"<i></i><span></span>":`${et}<span></span>`,s.lastChild.textContent=b?c:d};J=f,f(!1),s.addEventListener("click",()=>K(e)),N(a,Qe),a.append(s);let m=r.shortcut?.toLowerCase().replace(/\s/g,"");_&&document.removeEventListener("keydown",_),_=void 0,m&&(_=b=>{[b.ctrlKey&&"ctrl",b.shiftKey&&"shift",b.altKey&&"alt",b.metaKey&&"meta",b.key.toLowerCase()].filter(Boolean).join("+")===m&&(b.preventDefault(),K(e))},document.addEventListener("keydown",_));let E=S,R=()=>{S===E&&(document.body.append(E),O(e,`Report a bug button shown at ${p}-${h}`))};document.body?R():document.addEventListener("DOMContentLoaded",R)}function Ee(e,t){let n=e.options.feedbackWidget;e.options.feedbackWidget=t===!1?!1:{...typeof n=="object"?n:{},...t},S?.remove(),S=void 0,_&&document.removeEventListener("keydown",_),_=void 0,J=()=>{},Q(e)}function ee(e){return typeof e=="string"?e.length:e?.size}function Re(e){return e&&Number(e)||void 0}function nt(e,t){return async(n,i)=>{let r=typeof n=="string"?n:n instanceof URL?n.href:n.url,o=(i?.method??n.method??"GET").toUpperCase(),c=Date.now();try{let d=await e(n,i);return t(o,r,d.status,c,ee(i?.body),Re(d.headers.get("content-length"))),d}catch(d){throw t(o,r,0,c,ee(i?.body)),d}}}function it(e,t){let n=e.open,i=e.send;e.open=function(r,o){return this._blipit=[String(r).toUpperCase(),String(o)],n.apply(this,arguments)},e.send=function(r){let o=this._blipit;if(o){let c=Date.now();this.addEventListener("loadend",()=>t(o[0],o[1],this.status,c,ee(r),Re(this.getResponseHeader("content-length"))))}return i.apply(this,arguments)}}function $e(e){if(typeof window>"u")return;let t=T(e.endpoint,""),{console:n,network:i,actions:r}=e.logs;window.addEventListener("error",a=>{e.captureException(a.error??a.message,!1)}),window.addEventListener("unhandledrejection",a=>{e.captureException(a.reason,!1)}),typeof document<"u"&&(document.addEventListener("click",a=>{let s=a.target;if(!(s instanceof Element)||s.closest("[data-blipit-ui]"))return;let p=X(s);e.addBreadcrumb({category:"ui.click",message:`Clicked ${p}`});let h=s.closest(de)?"***":l((s.textContent??"").trim().replace(/\s+/g," "),80);w(r,{timestamp:v(),type:"click",selector:p,text:h},50)},{capture:!0,passive:!0}),document.addEventListener("focusin",a=>{let s=a.target;s instanceof Element&&/^(INPUT|TEXTAREA|SELECT)$/.test(s.tagName)&&w(r,{timestamp:v(),type:"focus",selector:X(s)},50)},{capture:!0,passive:!0}));let o=(a,s,p,h,f,m)=>{t&&s.startsWith(t)||(e.addBreadcrumb({category:"http",message:`${a} ${C(s)} \u2192 ${p||"network error"}`,level:p>=400||!p?"error":"info",data:{url:C(s),method:a,status_code:p||void 0}}),w(i,{timestamp:v(),method:a,url:H(s),status:p,duration:Date.now()-h,request_size:f,response_size:m},50))};typeof window.fetch=="function"&&(window.fetch=nt(window.fetch.bind(window),o)),typeof XMLHttpRequest<"u"&&it(XMLHttpRequest.prototype,o);for(let a of["log","info","debug","warn","error"]){let s=console[a].bind(console);console[a]=(...p)=>{let h=l(p.map(f=>typeof f=="string"?f:rt(f)).join(" "),1024);if(a==="warn"||a==="error"){e.addBreadcrumb({category:"console",level:a==="warn"?"warning":"error",message:h});let f=p.find(m=>m instanceof Error);w(n,{timestamp:v(),level:a,message:h,stack:l((f??new Error).stack??"",2e3)},100)}else w(n,{timestamp:v(),level:a,message:h},100);s(...p)}}let c=()=>w(r,{timestamp:v(),type:"navigation",url:H(location.href)},50),d=()=>{e.addBreadcrumb({category:"navigation",message:`Navigated to ${C(location.href)}`}),c()};if(c(),window.history){let a=window.history.pushState.bind(window.history);window.history.pushState=(...s)=>{a(...s),d()},window.addEventListener("popstate",d)}}function rt(e){try{return JSON.stringify(e)??String(e)}catch{return String(e)}}function Be(){let e=0,t=0,n=0,i=0;return r=>(r.hadRecentInput||(t>0&&r.startTime-i<1e3&&r.startTime-n<5e3?t+=r.value:(t=r.value,n=r.startTime),i=r.startTime,t>e&&(e=t)),e)}function ot(e){if(e.size===0)return;let t=[...e.values()].sort((n,i)=>i-n);return t[Math.min(t.length-1,Math.floor(e.size/50))]}function st(e){return/iPad|Tablet|Android(?!.*Mobile)/i.test(e)?"tablet":/Mobi|iPhone|Android/i.test(e)?"mobile":"desktop"}function I(e,t,n){try{new PerformanceObserver(i=>i.getEntries().forEach(r=>t(r))).observe({type:e,buffered:!0,...n})}catch{}}function Te(e,t,n){if(typeof PerformanceObserver>"u"||typeof document>"u")return;let i=performance.getEntriesByType("navigation")[0],r=i?.activationStart??0,o=y=>Math.max(0,Math.round(y-r)),c=document.visibilityState==="hidden",d=location.pathname,a=i?.type,s={},p=Be(),h=new Map,f=!1,m=!1;i&&i.responseStart>0&&(s.ttfb=o(i.responseStart)),c||(I("paint",y=>{y.name==="first-contentful-paint"&&(s.fcp=o(y.startTime))}),I("largest-contentful-paint",y=>{f||(s.lcp=o(y.startTime))}));let E=()=>{f=!0};addEventListener("keydown",E,{once:!0,capture:!0}),addEventListener("pointerdown",E,{once:!0,capture:!0}),I("layout-shift",y=>{s.cls=Math.round(p(y)*1e4)/1e4});let R=y=>{if(!y.interactionId)return;h.set(y.interactionId,Math.max(h.get(y.interactionId)??0,y.duration));let ne=ot(h);ne!==void 0&&(s.inp=Math.round(ne))};I("event",R,{durationThreshold:40}),I("first-input",R);let b=navigator.connection?.effectiveType,$=`${new URL("/api/v1/vitals",e).href}?key=${encodeURIComponent(t)}${n?`&instance=${encodeURIComponent(n)}`:""}`,k=()=>{if(m||Object.keys(s).length===0)return;m=!0;let y=JSON.stringify({path:d.slice(0,512),metrics:s,nav:a,connection:b&&/^(slow-2g|2g|3g|4g)$/.test(b)?b:void 0,device:st(navigator.userAgent)});try{if(navigator.sendBeacon?.($,y))return}catch{}fetch($,{method:"POST",body:y,keepalive:!0}).catch(()=>{})},B=()=>{location.pathname!==d&&(k(),d=location.pathname,a="route",s={},p=Be(),h=new Map,f=!0,m=!1)};document.addEventListener("visibilitychange",()=>document.visibilityState==="hidden"&&k()),addEventListener("pagehide",k),addEventListener("popstate",B);let A=history.pushState;history.pushState=function(...y){A.apply(this,y),B()}}function at(e,t=Math.random){return t()<(e.sessionSampleRate??0)?"session":t()<(e.onErrorSampleRate??1)?"buffer":null}function _e(e,t,n,i,r){let o=at(e);if(!o||typeof document>"u")return;let c=L(),d,a=document.createElement("script");return a.src=e.src??`${r}blipit-replay.js`,a.async=!0,a.onload=()=>{let s=window.BlipitReplay?.start;d=s?.({id:c,mode:o,endpoint:t,key:n,instance:i})},document.head.appendChild(a),{id:c,active:()=>d?.active()??!1,error:s=>d?.error(s),report:s=>d?.report?.(s)}}var Ce='<svg viewBox="0 0 242.4 208.7" aria-hidden="true"><defs><linearGradient id="bm1" x1="0" y1="1" x2=".5" y2="0"><stop offset="0" stop-color="#00C2FF"/><stop offset=".35" stop-color="#3882F6"/><stop offset="1" stop-color="#0F172A"/></linearGradient><linearGradient id="bm2" x1="0" y1="1" x2="1" y2="0"><stop offset="0" stop-color="#3882F6"/><stop offset=".5" stop-color="#00C2FF"/><stop offset="1" stop-color="#3882F6"/></linearGradient></defs><path fill="url(#bm1)" d="M115.5,164.5c-3.9,0-7.8-.4-11.5-1.2-3.7-.8-7.3-1.9-10.8-3.4-3.4-1.4-6.7-3.2-9.7-5.3-3.0-2.0-5.9-4.4-8.5-7.0s-4.9-5.4-7.0-8.5c-2.1-3.1-3.9-6.3-5.3-9.8-1.5-3.5-2.6-7.1-3.4-10.8-.8-3.8-1.2-7.7-1.2-11.5V19.1c0-6.6,5.4-12.0,12.0-12.0s12.0,5.4,12.0,12.0v88.2c0,2.2.2,4.5.7,6.7.4,2.1,1.1,4.2,1.9,6.2.8,2.0,1.9,3.9,3.1,5.7,1.2,1.8,2.6,3.4,4.1,4.9s3.2,2.9,4.9,4.1c1.8,1.2,3.7,2.2,5.6,3.1,2.0.8,4.1,1.5,6.2,1.9,4.4.9,9.1.9,13.4,0,2.1-.4,4.2-1.1,6.2-1.9,2.0-.8,3.9-1.9,5.7-3.1,1.8-1.2,3.4-2.6,4.9-4.1s2.9-3.2,4.1-4.9c1.2-1.8,2.2-3.7,3.1-5.7.8-2.0,1.5-4.1,1.9-6.2.5-2.2.7-4.5.7-6.7s-.2-4.5-.7-6.7c-.4-2.1-1.1-4.2-1.9-6.2-.8-2.0-1.9-3.9-3.1-5.7-1.2-1.8-2.6-3.4-4.1-4.9s-3.2-2.9-4.9-4.1c-1.8-1.2-3.7-2.2-5.7-3.1-2.0-.8-4.1-1.5-6.2-1.9-4.4-.9-9.1-.9-13.4,0-6.5,1.3-12.9-2.9-14.2-9.4-1.3-6.5,2.9-12.9,9.4-14.2,7.6-1.6,15.5-1.6,23.1,0,3.7.8,7.3,1.9,10.8,3.4,3.4,1.4,6.7,3.2,9.7,5.3,3.0,2.0,5.9,4.4,8.5,7.0s4.9,5.4,7.0,8.5c2.1,3.1,3.9,6.3,5.3,9.8,1.5,3.5,2.6,7.1,3.4,10.8.8,3.8,1.2,7.7,1.2,11.5s-.4,7.8-1.2,11.5c-.8,3.7-1.9,7.3-3.4,10.8-1.4,3.4-3.2,6.7-5.3,9.7-2.0,3.0-4.4,5.9-7.0,8.5s-5.4,4.9-8.5,7.0c-3.1,2.1-6.3,3.9-9.8,5.3-3.5,1.5-7.1,2.6-10.8,3.4-3.8.8-7.7,1.2-11.5,1.2Z"/><path fill="url(#bm2)" d="M208.1,103.0c-.0-.6-.8-.9-1.2-.5-3.2,3.1-7.6,5.0-12.4,5.0-3.9,0-9.1-1.6-10.2-2.5-.3-.1-.1,1.4-.1,2.5,0,40.5-34.4,73.0-75.5,70.0-33.4-2.5-60.8-28.8-64.4-62.1-1.0-9.4-.2-18.6,2.2-27.0,1.6-5.6,2.6-11.4,2.6-17.3v-22.4c0-3.4-4.3-5.0-6.5-2.4-13.2,15.4-21.6,35.1-22.7,56.6-2.6,54.1,40.6,98.9,94.1,98.9s94.2-42.3,94.2-94.2c0-1.5-.1-3.0-.1-4.5Z"/><path fill="url(#bm2)" d="M201.2,70.1c-14.8-35.8-50.9-60.5-92.3-58.3h-.1c-8.2.5-14.6,7.4-14.6,15.7v.1c0,5.4,4.7,9.6,10.0,8.8,3.2-.5,6.5-.7,9.9-.7,28.7,0,53.5,17.4,64.3,42.1.2.5.9.6,1.2.1,3.2-4.8,8.7-7.9,14.9-7.9,2.0,0,4.0.3,5.8,1.0.6.2,1.1-.4.9-1.0Z"/><circle fill="#00C2FF" cx="194.5" cy="88" r="15.8"/></svg>';var u=".blipit-rb.blipit-rb",dt=`${u}{all:unset;box-sizing:border-box;display:inline-flex;align-items:center;gap:9px;height:40px;padding-inline:5px 17px;border-radius:99px;font:600 14px/1 system-ui,-apple-system,"Segoe UI",sans-serif;letter-spacing:-.01em;white-space:nowrap;cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent;color:#fff;background:linear-gradient(135deg,#3882F6,#2F5BEA);box-shadow:0 10px 24px -12px rgba(56,130,246,.8),0 1px 3px rgba(11,26,58,.16),inset 0 1px 0 rgba(255,255,255,.22);transition:transform .2s,box-shadow .2s}${u}:hover{transform:translateY(-1px);box-shadow:0 16px 32px -12px rgba(56,130,246,.85),0 2px 6px rgba(11,26,58,.18),inset 0 1px 0 rgba(255,255,255,.22)}${u}:active{transform:scale(.97)}${u}:focus-visible{outline:3px solid #00C2FF;outline-offset:3px}${u}[aria-busy=true]{cursor:progress}${u}>span{all:unset}${u}>.blipit-rb-m{position:relative;display:grid;place-items:center;flex:none;width:30px;height:30px;border-radius:99px;background:#fff;box-shadow:0 0 0 1px rgba(11,26,58,.08),0 1px 2px rgba(11,26,58,.12)}${u} svg{display:block;width:19px;height:17px}${u}[data-size=sm]{height:32px;gap:7px;padding-inline:4px 13px;font-size:13px}${u}[data-size=sm]>.blipit-rb-m{width:24px;height:24px}${u}[data-size=sm] svg{width:15px;height:13px}${u}[data-variant=outline],${u}[data-variant=ghost]{color:#0B1A3A;background:transparent;box-shadow:inset 0 0 0 1px #CBD7EA}${u}[data-variant=ghost]{box-shadow:none}${u}[data-variant=outline]:hover,${u}[data-variant=ghost]:hover{transform:none;background:rgba(56,130,246,.08);box-shadow:inset 0 0 0 1px rgba(56,130,246,.45)}${u}[data-variant=ghost]:hover{box-shadow:none}${u}[data-theme=dark]{background:linear-gradient(135deg,#5B9BFF,#3D6BF0);box-shadow:0 10px 24px -12px rgba(91,155,255,.7),inset 0 1px 0 rgba(255,255,255,.2)}${u}[data-theme=dark][data-variant=outline],${u}[data-theme=dark][data-variant=ghost]{color:#E8EEF8;background:transparent;box-shadow:inset 0 0 0 1px rgba(255,255,255,.16)}${u}[data-theme=dark][data-variant=ghost]{box-shadow:none}${u}[data-theme=dark][data-variant=outline]:hover,${u}[data-theme=dark][data-variant=ghost]:hover{background:rgba(91,155,255,.16);box-shadow:inset 0 0 0 1px rgba(91,155,255,.45)}${u}[data-theme=dark][data-variant=ghost]:hover{box-shadow:none}${u}[data-theme=dark]>.blipit-rb-m{box-shadow:0 0 0 1px rgba(255,255,255,.1)}${u}[aria-busy=true] svg{visibility:hidden}${u}[aria-busy=true]>.blipit-rb-m::after{content:"";position:absolute;inset:4px;border:2px solid #3882F6;border-right-color:transparent;border-radius:50%;animation:blipit-rb-r .8s linear infinite}@keyframes blipit-rb-r{to{transform:rotate(1turn)}}@media(pointer:coarse){${u}{min-height:44px}}@media(prefers-reduced-motion:reduce){${u}{transition:none}${u}:hover,${u}:active{transform:none}${u}[aria-busy=true]>.blipit-rb-m::after{animation-duration:3s}}@media(forced-colors:active){${u}{border:1px solid ButtonText}}`,Le=0;function Me(e,t={}){Le||N(document,dt);let n=++Le,i=document.createElement("span");i.className="blipit-rb-m",i.innerHTML=Ce.replace(/bm(\d)/g,`bm$1-${n}`);let r=document.createElement("span");r.textContent=e.textContent,e.replaceChildren(i,r),e.classList.add("blipit-rb"),e.setAttribute("data-variant",t.variant==="outline"||t.variant==="ghost"?t.variant:"solid"),e.setAttribute("data-size",t.size==="sm"?"sm":"md"),e.setAttribute("data-theme",ue(t.theme==="light"||t.theme==="dark"?t.theme:void 0))}var g,Oe=new Set;function Ie(e,t){Oe.has(t)||(Oe.add(t),console[e](t))}var ct="[blipit] init() has no key, so error tracking and the Report a bug button are off. Pass your public key (blipit_pk_...) from app.blipit.io, API keys.",ut="[blipit] init() got a secret key (blipit_sk_...), so Blipit did not start: secret keys must never be in browser code. Use the public key (blipit_pk_...) and create a new secret key in app.blipit.io, API keys.";function pt(e){if(g)return;let t=typeof e?.key=="string"?e.key.trim():"";if(!t)return Ie("warn",ct);if(t.startsWith("blipit_sk_"))return Ie("error",ut);if(g=new P({...e,key:t}),e.user){let{id:n,name:i,email:r,username:o}=e.user;g.setUser({id:n===void 0?void 0:String(n),email:r,username:o??i})}$e(g),e.webVitals!==!1&&typeof window<"u"&&Te(e.endpoint??z,t,e.instance),e.replay&&(g.replay=_e(e.replay,e.endpoint??z,t,e.instance,U)),typeof window<"u"&&Q(g),e.debug&&console.log(`[blipit] ${V}@${M} initialized`)}function lt(e){return g?.captureException(e,!0)}function ft(e,t){return g?.captureMessage(e,t)}function mt(e){return g?.captureSecurity(e)}function gt(e){g?.setUser(e)}function ht(e,t){g?.setTag(e,t)}function bt(e){g?.addBreadcrumb(e)}function yt(e={}){g&&Z(g,{...e,eventId:e.eventId??g.lastEventId})}function te(){g&&K(g)}function vt(e){e.addEventListener("click",t=>{t.preventDefault(),te()})}function xt(e={}){let t=xe(e.label,te);return Me(t,e),t}function kt(e){g&&Ee(g,e)}function wt(){return g?.flush()??Promise.resolve()}we(oe);0&&(module.exports={addBreadcrumb,attachReport,captureException,captureMessage,captureSecurity,flush,init,openReport,reportButton,setReportMetadata,setTag,setUser,showFeedback,updateWidget});
@@ -1,2 +1,2 @@
1
1
  "use strict";var Blipit=(()=>{var U=Object.defineProperty;var Re=Object.getOwnPropertyDescriptor;var _e=Object.getOwnPropertyNames;var Be=Object.prototype.hasOwnProperty;var Te=(e,t)=>{for(var n in t)U(e,n,{get:t[n],enumerable:!0})},Oe=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of _e(t))!Be.call(e,i)&&i!==n&&U(e,i,{get:()=>t[i],enumerable:!(r=Re(t,i))||r.enumerable});return e};var Ce=e=>Oe(U({},"__esModule",{value:!0}),e);var ct={};Te(ct,{addBreadcrumb:()=>it,attachReport:()=>ot,captureException:()=>Qe,captureMessage:()=>Ze,captureSecurity:()=>et,flush:()=>at,init:()=>Ge,openReport:()=>D,reportButton:()=>dt,setReportMetadata:()=>he,setTag:()=>nt,setUser:()=>tt,showFeedback:()=>rt,updateWidget:()=>st});var Z=["login_failed","login_succeeded","login_blocked","password_reset_requested","privilege_granted"];var I=class{constructor(t,n,r,i){this.endpoint=t;this.key=n;this.debug=r;this.instance=i;typeof document<"u"&&document.addEventListener&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&this.flushWithBeacon()})}endpoint;key;debug;instance;queue=[];timer;sending=!1;enqueue(t){this.queue.push(t),this.queue.length>30&&this.queue.shift(),this.timer||(this.timer=setTimeout(()=>{this.timer=void 0,this.flush()},1e3))}async flush(){if(!this.sending){this.sending=!0;try{for(;this.queue.length>0;){let t=this.queue[0];if(!await this.send(t))break;this.queue.shift()}}finally{this.sending=!1}}}async send(t,n=0){try{let r=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","X-Blipit-Key":this.key,...this.instance?{"X-Blipit-Instance":this.instance}:{}},body:JSON.stringify(t),keepalive:!0});return r.status===429||r.status>=500?this.retry(t,n):(this.debug&&r.status>=400&&console.warn("[blipit] event rejected",r.status,await r.text()),!0)}catch{return this.retry(t,n)}}async retry(t,n){return n>=2?(this.debug&&console.warn("[blipit] dropping event after retries",t.event_id),!0):(await new Promise(r=>setTimeout(r,1e3*2**n)),this.send(t,n+1))}flushWithBeacon(){if(!(typeof navigator>"u"||!navigator.sendBeacon))for(;this.queue.length>0;){let t=this.queue.shift(),n=`key=${encodeURIComponent(this.key)}${this.instance?`&instance=${encodeURIComponent(this.instance)}`:""}`,r=`${this.endpoint}${this.endpoint.includes("?")?"&":"?"}${n}`;navigator.sendBeacon(r,JSON.stringify(t))}}};function R(){let e=new Uint8Array(16);if(typeof crypto<"u"&&crypto.getRandomValues)crypto.getRandomValues(e);else for(let n=0;n<16;n++)e[n]=Math.floor(Math.random()*256);e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t="";for(let n=0;n<16;n++)t+=e[n].toString(16).padStart(2,"0");return t}function b(){return new Date().toISOString()}var Ie=/token|key|password|secret|auth|session|passwd|api/i;function w(e){let t=e.indexOf("?");if(t===-1)return e.slice(0,2048);let n=e.slice(0,t),i=e.slice(t+1).split("&").map(o=>{let d=o.indexOf("=");if(d===-1)return o;let c=o.slice(0,d);return Ie.test(c)?`${c}=[redacted]`:o}).join("&");return`${n}?${i}`.slice(0,2048)}var Le=/\b((?:[a-zA-Z0-9_-]*(?:token|key|password|secret|auth|session|passwd|api)[a-zA-Z0-9_-]*)=)[^&\s"']+/gi;function ee(e){return e.replace(Le,"$1[redacted]")}function u(e,t){return e.length>t?e.slice(0,t):e}var te=".blipit-mask,[data-blipit-mask]";function F(e){return e.replace(/#.*/,"").replace(/([?&][^=&]*)=[^&]*/g,"$1=").slice(0,2048)}function v(e,t,n){e.push(t),e.length>n&&e.shift()}function j(e){let t=e.id?`#${e.id}`:"",n=typeof e.className=="string"&&e.className.trim()?`.${e.className.trim().split(/\s+/).slice(0,2).join(".")}`:"";return u(`${e.tagName.toLowerCase()}${t}${n}`,128)}function ne(e,t){try{let n=new CSSStyleSheet;n.replaceSync(t),e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]}catch{let n=document.createElement("style");n.textContent=t,(e===document?document.head:e).append(n)}}function S(e,t){return`${e.replace(/\/api\/v1\/events.*$/,"").replace(/\/$/,"")}${t}`}function ie(e,t){let n=e?/^(https?:\/\/[^?#]*\/)blipit(?:\.min)?\.js(?:[?#].*)?$/.exec(e):null;return n?n[1]:`https://blipit.io/sdk/${t}/`}var re={ok:0,errored:1,crashed:2},L=class{constructor(t,n,r,i){this.url=t;this.key=n;this.release=r;this.environment=i;this.start(),typeof document<"u"&&document.addEventListener&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.end():this.sid||this.start()})}url;key;release;environment;sid="";started="";status="ok";errors=0;did;setUser(t){this.did=t}markError(t){if(!this.sid)return;this.errors+=1;let n=t?"crashed":"errored";re[n]<=re[this.status]||(this.status=n,this.send(!1))}start(){this.sid=R(),this.started=b(),this.status="ok",this.errors=0,this.send(!1)}end(){this.sid&&(this.send(!0),this.sid="")}send(t){let n=JSON.stringify({sid:this.sid,did:this.did,status:this.status==="ok"&&t?"exited":this.status,errors:this.errors,started:this.started,release:this.release,environment:this.environment}),r=`${this.url}?key=${encodeURIComponent(this.key)}`;try{if(t&&typeof navigator<"u"&&navigator.sendBeacon){navigator.sendBeacon(r,n);return}if(typeof fetch>"u")return;fetch(this.url,{method:"POST",headers:{"Content-Type":"application/json","X-Blipit-Key":this.key},body:n,keepalive:!0}).catch(()=>{})}catch{return}}};var $e=/^\s*at (?:async )?(?:new )?(?:(.+?) )?\(?((?:file|https?|blob|chrome-extension|moz-extension|safari-web-extension|node|webpack):.*?|[^()]+?)(?::(\d+))?(?::(\d+))?\)?\s*$/,Me=/^\s*(?:(.*?)@)?((?:file|https?|blob|chrome-extension|moz-extension|safari-web-extension|node|webpack).*?|[^@]*?)(?::(\d+))?(?::(\d+))?\s*$/,oe=/^(chrome|moz|safari-web)-extension:/;function Ae(){if(typeof location<"u"&&location.origin)return location.origin}function Ne(e){if(oe.test(e)||e==="<anonymous>"||e==="[native code]")return!1;let t=Ae();return!!(!t||e.startsWith(t)||!/^[a-z]+:/i.test(e))}function se(e){if(!e)return[];let t=[];for(let n of e.split(`
2
- `)){if(!n||/^\s*(Error|TypeError|RangeError|SyntaxError|ReferenceError)\b/.test(n))continue;let r=$e.exec(n)??Me.exec(n);if(!r)continue;let[,i,o,d,c]=r;if(!o)continue;let a={filename:u(o,1024),in_app:Ne(o)};i&&(a.function=u(i,512)),d&&(a.lineno=Number(d)),c&&(a.colno=Number(c)),t.push(a)}return t.reverse(),t.slice(-128)}function ae(e){return e.length===0?!1:e.every(t=>oe.test(t.filename))}var K="@blipit/browser",_="0.3.8",E=ie(typeof document<"u"?document.currentScript?.src:void 0,_),M="https://in.blipit.io/api/v1/events",De=[/ResizeObserver loop/i,/^Script error\.?$/,/__gCrWeb|__firefox__/],Pe={login_failed:"Failed login",login_succeeded:"Successful login",login_blocked:"Blocked login",password_reset_requested:"Password reset requested",privilege_granted:"Privilege granted"},Ue={login_failed:"warning",login_succeeded:"info",login_blocked:"warning",password_reset_requested:"info",privilege_granted:"warning"};function Fe(e){if(!Z.includes(e?.kind))return;let t=u(String(e.actor??"").trim(),256);if(!t)return;let n={kind:e.kind,actor:t};return e.actorId&&(n.actor_id=u(String(e.actorId),128)),e.ip&&(n.ip=u(String(e.ip).trim(),45)),e.userAgent&&(n.user_agent=u(String(e.userAgent),512)),e.database&&(n.database=u(String(e.database),64)),e.outcome&&(n.outcome=u(String(e.outcome),64)),e.target&&(n.target=u(String(e.target),256)),n}var $=class{constructor(t){this.options=t;this.endpoint=t.endpoint??M,this.transport=new I(this.endpoint,t.key,t.debug??!1,t.instance),t.autoSessionTracking&&(t.release?this.session=new L(S(this.endpoint,"/api/v1/sessions"),t.key,t.release,t.environment??"production"):t.debug&&console.warn("[blipit] session tracking needs the release option")),this.maxBreadcrumbs=Math.min(t.maxBreadcrumbs??50,100),this.ignoreErrors=[...De,...t.ignoreErrors??[]]}options;transport;breadcrumbs=[];user;tags={};maxBreadcrumbs;ignoreErrors;seen=new Set;captured=new WeakSet;session;lastEventId;errorIds=[];logs={console:[],network:[],actions:[]};endpoint;replay;setUser(t){this.user=t,this.session?.setUser(t?.id??t?.email)}setTag(t,n){this.tags[u(t,64)]=u(n,256)}addBreadcrumb(t){let n={timestamp:b(),...t};n.message&&(n.message=ee(n.message)),n.data&&typeof n.data.url=="string"&&(n.data={...n.data,url:w(n.data.url)}),this.breadcrumbs.push(n),this.breadcrumbs.length>this.maxBreadcrumbs&&this.breadcrumbs.shift()}captureException(t,n=!0){if(t&&typeof t=="object"){if(this.captured.has(t))return;this.captured.add(t)}let r=t instanceof Error?t:new Error(String(t)),i={type:r.name||"Error",value:u(r.message||String(r),4096),handled:n},o=se(r.stack);return o.length>0&&(i.stacktrace={frames:o}),this.processAndSend({exception:i,level:"error"})}captureMessage(t,n="info"){return this.processAndSend({message:u(t,8192),level:n})}captureSecurity(t){let n=Fe(t);if(!n){this.options.debug&&console.warn("[blipit] security event dropped, needs a known kind and an actor");return}return this.processAndSend({message:`${Pe[n.kind]} for ${n.actor}`,level:Ue[n.kind],security:n},!1)}processAndSend(t,n=!0){if(n&&this.options.sampleRate!==void 0&&Math.random()>this.options.sampleRate)return;let r=t.exception?.value??t.message??"";if(n){for(let c of this.ignoreErrors)if(typeof c=="string"?r.includes(c):c.test(r))return;if((this.options.autoMuteExtensions??!0)&&t.exception?.stacktrace&&ae(t.exception.stacktrace.frames))return;let d=`${t.exception?.type??""}|${r}`;if(t.exception?.handled===!1){if(this.seen.has(d)&&this.seen.size<100)return;this.seen.add(d),setTimeout(()=>this.seen.delete(d),5e3)}}let i={event_id:R(),timestamp:b(),platform:"javascript",release:this.options.release,environment:this.options.environment??"production",user:this.user,tags:Object.keys(this.tags).length>0?{...this.tags}:void 0,breadcrumbs:this.breadcrumbs.length>0?[...this.breadcrumbs]:void 0,request:typeof location<"u"?{url:w(location.href)}:void 0,contexts:this.collectContexts(),sdk:{name:K,version:_},...t};for(let d of Object.keys(i))i[d]===void 0&&delete i[d];let o=this.replay?.active()&&(i.level==="error"||i.level==="fatal")?this.replay:void 0;if(o&&(i.tags={...i.tags,replay_id:o.id}),this.options.beforeSend){let d=this.options.beforeSend(i);if(!d)return;i=d}return this.transport.enqueue(i),this.lastEventId=i.event_id,(i.level==="error"||i.level==="fatal")&&v(this.errorIds,i.event_id,20),i.exception&&this.session?.markError(i.exception.handled===!1),o?.error(i.event_id),i.event_id}collectContexts(){if(typeof navigator>"u")return;let t={},n=navigator.userAgent??"",r=/(Edg|OPR|Chrome|Firefox|Safari)\/(\d+[\d.]*)/.exec(n)??void 0;r&&(t.browser={name:r[1],version:r[2]});let i=/\(([^)]+)\)/.exec(n);return i&&i[1]&&(t.os={name:u(i[1],64)}),typeof screen<"u"&&(t.device={screen:`${screen.width}x${screen.height}`}),Object.keys(t).length>0?t:void 0}flush(){return this.transport.flush()}};function q(e){return typeof e=="string"?e.length:e?.size}function de(e){return e&&Number(e)||void 0}function je(e,t){return async(n,r)=>{let i=typeof n=="string"?n:n instanceof URL?n.href:n.url,o=(r?.method??n.method??"GET").toUpperCase(),d=Date.now();try{let c=await e(n,r);return t(o,i,c.status,d,q(r?.body),de(c.headers.get("content-length"))),c}catch(c){throw t(o,i,0,d,q(r?.body)),c}}}function Ke(e,t){let n=e.open,r=e.send;e.open=function(i,o){return this._blipit=[String(i).toUpperCase(),String(o)],n.apply(this,arguments)},e.send=function(i){let o=this._blipit;if(o){let d=Date.now();this.addEventListener("loadend",()=>t(o[0],o[1],this.status,d,q(i),de(this.getResponseHeader("content-length"))))}return r.apply(this,arguments)}}function ce(e){if(typeof window>"u")return;let t=S(e.endpoint,""),{console:n,network:r,actions:i}=e.logs;window.addEventListener("error",a=>{e.captureException(a.error??a.message,!1)}),window.addEventListener("unhandledrejection",a=>{e.captureException(a.reason,!1)}),typeof document<"u"&&(document.addEventListener("click",a=>{let s=a.target;if(!(s instanceof Element)||s.closest("[data-blipit-ui]"))return;let l=j(s);e.addBreadcrumb({category:"ui.click",message:`Clicked ${l}`});let m=s.closest(te)?"***":u((s.textContent??"").trim().replace(/\s+/g," "),80);v(i,{timestamp:b(),type:"click",selector:l,text:m},50)},{capture:!0,passive:!0}),document.addEventListener("focusin",a=>{let s=a.target;s instanceof Element&&/^(INPUT|TEXTAREA|SELECT)$/.test(s.tagName)&&v(i,{timestamp:b(),type:"focus",selector:j(s)},50)},{capture:!0,passive:!0}));let o=(a,s,l,m,h,y)=>{t&&s.startsWith(t)||(e.addBreadcrumb({category:"http",message:`${a} ${w(s)} \u2192 ${l||"network error"}`,level:l>=400||!l?"error":"info",data:{url:w(s),method:a,status_code:l||void 0}}),v(r,{timestamp:b(),method:a,url:F(s),status:l,duration:Date.now()-m,request_size:h,response_size:y},50))};typeof window.fetch=="function"&&(window.fetch=je(window.fetch.bind(window),o)),typeof XMLHttpRequest<"u"&&Ke(XMLHttpRequest.prototype,o);for(let a of["log","info","debug","warn","error"]){let s=console[a].bind(console);console[a]=(...l)=>{let m=u(l.map(h=>typeof h=="string"?h:qe(h)).join(" "),1024);if(a==="warn"||a==="error"){e.addBreadcrumb({category:"console",level:a==="warn"?"warning":"error",message:m});let h=l.find(y=>y instanceof Error);v(n,{timestamp:b(),level:a,message:m,stack:u((h??new Error).stack??"",2e3)},100)}else v(n,{timestamp:b(),level:a,message:m},100);s(...l)}}let d=()=>v(i,{timestamp:b(),type:"navigation",url:F(location.href)},50),c=()=>{e.addBreadcrumb({category:"navigation",message:`Navigated to ${w(location.href)}`}),d()};if(d(),window.history){let a=window.history.pushState.bind(window.history);window.history.pushState=(...s)=>{a(...s),c()},window.addEventListener("popstate",c)}}function qe(e){try{return JSON.stringify(e)??String(e)}catch{return String(e)}}function ue(){let e=0,t=0,n=0,r=0;return i=>(i.hadRecentInput||(t>0&&i.startTime-r<1e3&&i.startTime-n<5e3?t+=i.value:(t=i.value,n=i.startTime),r=i.startTime,t>e&&(e=t)),e)}function We(e){if(e.size===0)return;let t=[...e.values()].sort((n,r)=>r-n);return t[Math.min(t.length-1,Math.floor(e.size/50))]}function He(e){return/iPad|Tablet|Android(?!.*Mobile)/i.test(e)?"tablet":/Mobi|iPhone|Android/i.test(e)?"mobile":"desktop"}function O(e,t,n){try{new PerformanceObserver(r=>r.getEntries().forEach(i=>t(i))).observe({type:e,buffered:!0,...n})}catch{}}function pe(e,t,n){if(typeof PerformanceObserver>"u"||typeof document>"u")return;let r=performance.getEntriesByType("navigation")[0],i=r?.activationStart??0,o=f=>Math.max(0,Math.round(f-i)),d=document.visibilityState==="hidden",c=location.pathname,a=r?.type,s={},l=ue(),m=new Map,h=!1,y=!1;r&&r.responseStart>0&&(s.ttfb=o(r.responseStart)),d||(O("paint",f=>{f.name==="first-contentful-paint"&&(s.fcp=o(f.startTime))}),O("largest-contentful-paint",f=>{h||(s.lcp=o(f.startTime))}));let B=()=>{h=!0};addEventListener("keydown",B,{once:!0,capture:!0}),addEventListener("pointerdown",B,{once:!0,capture:!0}),O("layout-shift",f=>{s.cls=Math.round(l(f)*1e4)/1e4});let T=f=>{if(!f.interactionId)return;m.set(f.interactionId,Math.max(m.get(f.interactionId)??0,f.duration));let Q=We(m);Q!==void 0&&(s.inp=Math.round(Q))};O("event",T,{durationThreshold:40}),O("first-input",T);let g=navigator.connection?.effectiveType,J=`${new URL("/api/v1/vitals",e).href}?key=${encodeURIComponent(t)}${n?`&instance=${encodeURIComponent(n)}`:""}`,P=()=>{if(y||Object.keys(s).length===0)return;y=!0;let f=JSON.stringify({path:c.slice(0,512),metrics:s,nav:a,connection:g&&/^(slow-2g|2g|3g|4g)$/.test(g)?g:void 0,device:He(navigator.userAgent)});try{if(navigator.sendBeacon?.(J,f))return}catch{}fetch(J,{method:"POST",body:f,keepalive:!0}).catch(()=>{})},G=()=>{location.pathname!==c&&(P(),c=location.pathname,a="route",s={},l=ue(),m=new Map,h=!0,y=!1)};document.addEventListener("visibilitychange",()=>document.visibilityState==="hidden"&&P()),addEventListener("pagehide",P),addEventListener("popstate",G);let Ee=history.pushState;history.pushState=function(...f){Ee.apply(this,f),G()}}function ze(e,t=Math.random){return t()<(e.sessionSampleRate??0)?"session":t()<(e.onErrorSampleRate??1)?"buffer":null}function le(e,t,n,r,i){let o=ze(e);if(!o||typeof document>"u")return;let d=R(),c,a=document.createElement("script");return a.src=e.src??`${i}blipit-replay.js`,a.async=!0,a.onload=()=>{let s=window.BlipitReplay?.start;c=s?.({id:d,mode:o,endpoint:t,key:n,instance:r})},document.head.appendChild(a),{id:d,active:()=>c?.active()??!1,error:s=>c?.error(s),report:s=>c?.report?.(s)}}var H={en:["Report a bug","Loading\u2026"],ar:["\u0623\u0628\u0644\u063A \u0639\u0646 \u062E\u0637\u0623","\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644\u2026"],de:["Fehler melden","Wird geladen\u2026"],es:["Reportar un error","Cargando\u2026"],fr:["Signaler un bug","Chargement\u2026"],it:["Segnala un bug","Caricamento\u2026"],ja:["\u4E0D\u5177\u5408\u3092\u5831\u544A","\u8AAD\u307F\u8FBC\u307F\u4E2D\u2026"],nl:["Bug melden","Laden\u2026"],pt:["Reportar erro","Carregando\u2026"],tr:["Hata bildir","Y\xFCkleniyor\u2026"],zh:["\u62A5\u544A\u95EE\u9898","\u52A0\u8F7D\u4E2D\u2026"]},Xe="button{all:initial;position:fixed;z-index:2147483646;display:flex;align-items:center;gap:8px;padding:11px 18px;border-radius:99px;background:var(--c,linear-gradient(135deg,#3882F6,#2F5BEA));color:#fff;font:600 14px system-ui,-apple-system,sans-serif;letter-spacing:-.01em;cursor:pointer;box-shadow:0 14px 32px -12px rgba(56,130,246,.75),0 2px 6px rgba(11,26,58,.18),inset 0 1px 0 rgba(255,255,255,.22);transition:transform .2s,box-shadow .2s;animation:in .35s cubic-bezier(.2,.8,.2,1)}button:hover{transform:translateY(-2px);box-shadow:0 20px 40px -12px rgba(56,130,246,.85),0 3px 8px rgba(11,26,58,.2),inset 0 1px 0 rgba(255,255,255,.22)}button:active{transform:scale(.97)}button:focus-visible{outline:3px solid #00C2FF;outline-offset:3px}button:disabled{cursor:progress}svg,i{width:18px;height:18px}i{box-sizing:border-box;border:2px solid;border-right-color:transparent;border-radius:50%;animation:r .8s linear infinite}@keyframes r{to{transform:rotate(1turn)}}@keyframes in{from{opacity:0;transform:translateY(12px) scale(.94)}}.o span{display:none}.o{padding:13px}@media(max-width:480px){span{display:none}button{padding:13px}}@media(pointer:coarse){button{min-height:44px;box-sizing:border-box}}@media(prefers-reduced-motion:reduce){button{animation:none;transition:none}i{animation-duration:3s}}",Ve='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round" aria-hidden="true"><path d="M4 4h16v12H9l-5 4zM12 7v4M12 13.5v.5"/></svg>',me,W={},ge,x,z=()=>{},k,fe=0;function C(e,t){e.options.debug&&console.log(`[blipit] ${t}`)}function he(e){me=e}function N(e,t){return W[t]??=new Promise((n,r)=>{let i=document.createElement("script");i.src=e,i.async=!0,i.onload=()=>{let o=window[t];o?n(o):r(new Error(t))},i.onerror=r,document.head.appendChild(i)}).catch(n=>{throw delete W[t],n}),W[t]}function be(){let e=(navigator.language??"en").slice(0,2);return H[e]?e:"en"}function X(e,t){let n=document.createElement("button");return n.type="button",n.className="blipit-rb",n.setAttribute("aria-haspopup","dialog"),e?n.textContent=e:(n.lang=be(),n.textContent=H[n.lang][0]),n.addEventListener("click",()=>n.hasAttribute("aria-busy")||t()),n}var ye=()=>{};function ve(e){ye=e}function V(e,t){ye(S(e.endpoint,"/api/v1/feedback"),e.options.key,t)}function A(e){if(typeof document>"u")return;let t=typeof e.options.feedbackWidget=="object"?e.options.feedbackWidget:{},n=document.querySelectorAll("button.blipit-rb"),r=i=>{z(i),n.forEach(o=>i?o.setAttribute("aria-busy","true"):o.removeAttribute("aria-busy"))};r(!0),Promise.all([N(t.src??`${E}blipit-report.js`,"BlipitReport"),ge??=xe(e)]).then(([i,o])=>o.enabled!==!1&&i.open(e,{metadata:me,recording:o.recording===!0,recordingMaxMs:o.recording_max_ms,storageFull:o.storage_full===!0,reportsFull:o.reports_full===!0,theme:o.theme,hide:d=>x&&(x.style.display=d?"none":"")}),()=>V(e,{eventId:e.lastEventId,name:e.user?.username,email:e.user?.email})).finally(()=>r(!1))}async function xe(e){let t=`blipit_fb_${_}_${e.options.key}`;try{let n=JSON.parse(localStorage.getItem(t)??"null");if(n&&Date.now()-n.t<36e5)return n.s}catch{}try{let n=await fetch(S(e.endpoint,"/api/v1/feedback/settings"),{headers:{"X-Blipit-Key":e.options.key,...e.options.instance?{"X-Blipit-Instance":e.options.instance}:{}}});if(!n.ok)return C(e,`widget settings failed (HTTP ${n.status}), using defaults`),{};let r=await n.json();try{localStorage.setItem(t,JSON.stringify({t:Date.now(),s:r}))}catch{}return r}catch{return C(e,"widget settings unreachable (offline, ad blocker or CSP connect-src), using defaults"),{}}}async function Y(e){let t=e.options.feedbackWidget,n=++fe;if(typeof document>"u")return;if(t===!1)return C(e,"Report a bug button off: feedbackWidget is false");let r=await(ge??=xe(e));if(n!==fe)return;if(r.enabled===!1)return C(e,"Report a bug button hidden by the project's Bug report widget setting");let i={...r,...typeof t=="object"?t:{}},[o,d]=H[be()],c=i.text||o;x=document.createElement("div"),x.setAttribute("data-blipit-ui","");let a=x.attachShadow({mode:"open"}),s=document.createElement("button");s.type="button";let[l,m]=(/^(bottom|middle)-(left|right)$/.test(i.position??"")?i.position:"bottom-right").split("-");s.style.cssText=`${i.color?`--c:${i.color};`:""}${m}:calc(20px + env(safe-area-inset-${m},0px));${l==="bottom"?"bottom:calc(20px + env(safe-area-inset-bottom,0px))":"top:50%;margin-top:-22px"}`,s.setAttribute("aria-haspopup","dialog"),i.style==="icon"&&(s.className="o",s.title=c);let h=g=>{s.disabled=g,s.setAttribute("aria-label",g?d:c),s.innerHTML=g?"<i></i><span></span>":`${Ve}<span></span>`,s.lastChild.textContent=g?d:c};z=h,h(!1),s.addEventListener("click",()=>A(e)),ne(a,Xe),a.append(s);let y=i.shortcut?.toLowerCase().replace(/\s/g,"");k&&document.removeEventListener("keydown",k),k=void 0,y&&(k=g=>{[g.ctrlKey&&"ctrl",g.shiftKey&&"shift",g.altKey&&"alt",g.metaKey&&"meta",g.key.toLowerCase()].filter(Boolean).join("+")===y&&(g.preventDefault(),A(e))},document.addEventListener("keydown",k));let B=x,T=()=>{x===B&&(document.body.append(B),C(e,`Report a bug button shown at ${l}-${m}`))};document.body?T():document.addEventListener("DOMContentLoaded",T)}function Se(e,t){let n=e.options.feedbackWidget;e.options.feedbackWidget=t===!1?!1:{...typeof n=="object"?n:{},...t},x?.remove(),x=void 0,k&&document.removeEventListener("keydown",k),k=void 0,z=()=>{},Y(e)}var p,ke=new Set;function we(e,t){ke.has(t)||(ke.add(t),console[e](t))}var Ye="[blipit] init() has no key, so error tracking and the Report a bug button are off. Pass your public key (blipit_pk_...) from app.blipit.io, API keys.",Je="[blipit] init() got a secret key (blipit_sk_...), so Blipit did not start: secret keys must never be in browser code. Use the public key (blipit_pk_...) and create a new secret key in app.blipit.io, API keys.";function Ge(e){if(p)return;let t=typeof e?.key=="string"?e.key.trim():"";if(!t)return we("warn",Ye);if(t.startsWith("blipit_sk_"))return we("error",Je);if(p=new $({...e,key:t}),e.user){let{id:n,name:r,email:i,username:o}=e.user;p.setUser({id:n===void 0?void 0:String(n),email:i,username:o??r})}ce(p),e.webVitals!==!1&&typeof window<"u"&&pe(e.endpoint??M,t,e.instance),e.replay&&(p.replay=le(e.replay,e.endpoint??M,t,e.instance,E)),typeof window<"u"&&Y(p),e.debug&&console.log(`[blipit] ${K}@${_} initialized`)}function Qe(e){return p?.captureException(e,!0)}function Ze(e,t){return p?.captureMessage(e,t)}function et(e){return p?.captureSecurity(e)}function tt(e){p?.setUser(e)}function nt(e,t){p?.setTag(e,t)}function it(e){p?.addBreadcrumb(e)}function rt(e={}){p&&V(p,{...e,eventId:e.eventId??p.lastEventId})}function D(){p&&A(p)}function ot(e){e.addEventListener("click",t=>{t.preventDefault(),D()})}function st(e){p&&Se(p,e)}function at(){return p?.flush()??Promise.resolve()}ve((e,t,n)=>N(`${E}blipit-feedback.js`,"BlipitFeedback").then(r=>r.showFeedbackDialog(e,t,n),()=>{}));function dt(e={}){let t=X(e.label,D);return t.style.visibility="hidden",N(`${E}blipit-button.js`,"BlipitButton").then(n=>n.paint(t,e)).catch(()=>{}).then(()=>t.style.removeProperty("visibility")),t}return Ce(ct);})();
2
+ `)){if(!n||/^\s*(Error|TypeError|RangeError|SyntaxError|ReferenceError)\b/.test(n))continue;let r=$e.exec(n)??Me.exec(n);if(!r)continue;let[,i,o,d,c]=r;if(!o)continue;let a={filename:u(o,1024),in_app:Ne(o)};i&&(a.function=u(i,512)),d&&(a.lineno=Number(d)),c&&(a.colno=Number(c)),t.push(a)}return t.reverse(),t.slice(-128)}function ae(e){return e.length===0?!1:e.every(t=>oe.test(t.filename))}var K="@blipit/browser",_="0.3.10",E=ie(typeof document<"u"?document.currentScript?.src:void 0,_),M="https://in.blipit.io/api/v1/events",De=[/ResizeObserver loop/i,/^Script error\.?$/,/__gCrWeb|__firefox__/],Pe={login_failed:"Failed login",login_succeeded:"Successful login",login_blocked:"Blocked login",password_reset_requested:"Password reset requested",privilege_granted:"Privilege granted"},Ue={login_failed:"warning",login_succeeded:"info",login_blocked:"warning",password_reset_requested:"info",privilege_granted:"warning"};function Fe(e){if(!Z.includes(e?.kind))return;let t=u(String(e.actor??"").trim(),256);if(!t)return;let n={kind:e.kind,actor:t};return e.actorId&&(n.actor_id=u(String(e.actorId),128)),e.ip&&(n.ip=u(String(e.ip).trim(),45)),e.userAgent&&(n.user_agent=u(String(e.userAgent),512)),e.database&&(n.database=u(String(e.database),64)),e.outcome&&(n.outcome=u(String(e.outcome),64)),e.target&&(n.target=u(String(e.target),256)),n}var $=class{constructor(t){this.options=t;this.endpoint=t.endpoint??M,this.transport=new I(this.endpoint,t.key,t.debug??!1,t.instance),t.autoSessionTracking&&(t.release?this.session=new L(S(this.endpoint,"/api/v1/sessions"),t.key,t.release,t.environment??"production"):t.debug&&console.warn("[blipit] session tracking needs the release option")),this.maxBreadcrumbs=Math.min(t.maxBreadcrumbs??50,100),this.ignoreErrors=[...De,...t.ignoreErrors??[]]}options;transport;breadcrumbs=[];user;tags={};maxBreadcrumbs;ignoreErrors;seen=new Set;captured=new WeakSet;session;lastEventId;errorIds=[];logs={console:[],network:[],actions:[]};endpoint;replay;setUser(t){this.user=t,this.session?.setUser(t?.id??t?.email)}setTag(t,n){this.tags[u(t,64)]=u(n,256)}addBreadcrumb(t){let n={timestamp:b(),...t};n.message&&(n.message=ee(n.message)),n.data&&typeof n.data.url=="string"&&(n.data={...n.data,url:w(n.data.url)}),this.breadcrumbs.push(n),this.breadcrumbs.length>this.maxBreadcrumbs&&this.breadcrumbs.shift()}captureException(t,n=!0){if(t&&typeof t=="object"){if(this.captured.has(t))return;this.captured.add(t)}let r=t instanceof Error?t:new Error(String(t)),i={type:r.name||"Error",value:u(r.message||String(r),4096),handled:n},o=se(r.stack);return o.length>0&&(i.stacktrace={frames:o}),this.processAndSend({exception:i,level:"error"})}captureMessage(t,n="info"){return this.processAndSend({message:u(t,8192),level:n})}captureSecurity(t){let n=Fe(t);if(!n){this.options.debug&&console.warn("[blipit] security event dropped, needs a known kind and an actor");return}return this.processAndSend({message:`${Pe[n.kind]} for ${n.actor}`,level:Ue[n.kind],security:n},!1)}processAndSend(t,n=!0){if(n&&this.options.sampleRate!==void 0&&Math.random()>this.options.sampleRate)return;let r=t.exception?.value??t.message??"";if(n){for(let c of this.ignoreErrors)if(typeof c=="string"?r.includes(c):c.test(r))return;if((this.options.autoMuteExtensions??!0)&&t.exception?.stacktrace&&ae(t.exception.stacktrace.frames))return;let d=`${t.exception?.type??""}|${r}`;if(t.exception?.handled===!1){if(this.seen.has(d)&&this.seen.size<100)return;this.seen.add(d),setTimeout(()=>this.seen.delete(d),5e3)}}let i={event_id:R(),timestamp:b(),platform:"javascript",release:this.options.release,environment:this.options.environment??"production",user:this.user,tags:Object.keys(this.tags).length>0?{...this.tags}:void 0,breadcrumbs:this.breadcrumbs.length>0?[...this.breadcrumbs]:void 0,request:typeof location<"u"?{url:w(location.href)}:void 0,contexts:this.collectContexts(),sdk:{name:K,version:_},...t};for(let d of Object.keys(i))i[d]===void 0&&delete i[d];let o=this.replay?.active()&&(i.level==="error"||i.level==="fatal")?this.replay:void 0;if(o&&(i.tags={...i.tags,replay_id:o.id}),this.options.beforeSend){let d=this.options.beforeSend(i);if(!d)return;i=d}return this.transport.enqueue(i),this.lastEventId=i.event_id,(i.level==="error"||i.level==="fatal")&&v(this.errorIds,i.event_id,20),i.exception&&this.session?.markError(i.exception.handled===!1),o?.error(i.event_id),i.event_id}collectContexts(){if(typeof navigator>"u")return;let t={},n=navigator.userAgent??"",r=/(Edg|OPR|Chrome|Firefox|Safari)\/(\d+[\d.]*)/.exec(n)??void 0;r&&(t.browser={name:r[1],version:r[2]});let i=/\(([^)]+)\)/.exec(n);return i&&i[1]&&(t.os={name:u(i[1],64)}),typeof screen<"u"&&(t.device={screen:`${screen.width}x${screen.height}`}),Object.keys(t).length>0?t:void 0}flush(){return this.transport.flush()}};function q(e){return typeof e=="string"?e.length:e?.size}function de(e){return e&&Number(e)||void 0}function je(e,t){return async(n,r)=>{let i=typeof n=="string"?n:n instanceof URL?n.href:n.url,o=(r?.method??n.method??"GET").toUpperCase(),d=Date.now();try{let c=await e(n,r);return t(o,i,c.status,d,q(r?.body),de(c.headers.get("content-length"))),c}catch(c){throw t(o,i,0,d,q(r?.body)),c}}}function Ke(e,t){let n=e.open,r=e.send;e.open=function(i,o){return this._blipit=[String(i).toUpperCase(),String(o)],n.apply(this,arguments)},e.send=function(i){let o=this._blipit;if(o){let d=Date.now();this.addEventListener("loadend",()=>t(o[0],o[1],this.status,d,q(i),de(this.getResponseHeader("content-length"))))}return r.apply(this,arguments)}}function ce(e){if(typeof window>"u")return;let t=S(e.endpoint,""),{console:n,network:r,actions:i}=e.logs;window.addEventListener("error",a=>{e.captureException(a.error??a.message,!1)}),window.addEventListener("unhandledrejection",a=>{e.captureException(a.reason,!1)}),typeof document<"u"&&(document.addEventListener("click",a=>{let s=a.target;if(!(s instanceof Element)||s.closest("[data-blipit-ui]"))return;let l=j(s);e.addBreadcrumb({category:"ui.click",message:`Clicked ${l}`});let m=s.closest(te)?"***":u((s.textContent??"").trim().replace(/\s+/g," "),80);v(i,{timestamp:b(),type:"click",selector:l,text:m},50)},{capture:!0,passive:!0}),document.addEventListener("focusin",a=>{let s=a.target;s instanceof Element&&/^(INPUT|TEXTAREA|SELECT)$/.test(s.tagName)&&v(i,{timestamp:b(),type:"focus",selector:j(s)},50)},{capture:!0,passive:!0}));let o=(a,s,l,m,h,y)=>{t&&s.startsWith(t)||(e.addBreadcrumb({category:"http",message:`${a} ${w(s)} \u2192 ${l||"network error"}`,level:l>=400||!l?"error":"info",data:{url:w(s),method:a,status_code:l||void 0}}),v(r,{timestamp:b(),method:a,url:F(s),status:l,duration:Date.now()-m,request_size:h,response_size:y},50))};typeof window.fetch=="function"&&(window.fetch=je(window.fetch.bind(window),o)),typeof XMLHttpRequest<"u"&&Ke(XMLHttpRequest.prototype,o);for(let a of["log","info","debug","warn","error"]){let s=console[a].bind(console);console[a]=(...l)=>{let m=u(l.map(h=>typeof h=="string"?h:qe(h)).join(" "),1024);if(a==="warn"||a==="error"){e.addBreadcrumb({category:"console",level:a==="warn"?"warning":"error",message:m});let h=l.find(y=>y instanceof Error);v(n,{timestamp:b(),level:a,message:m,stack:u((h??new Error).stack??"",2e3)},100)}else v(n,{timestamp:b(),level:a,message:m},100);s(...l)}}let d=()=>v(i,{timestamp:b(),type:"navigation",url:F(location.href)},50),c=()=>{e.addBreadcrumb({category:"navigation",message:`Navigated to ${w(location.href)}`}),d()};if(d(),window.history){let a=window.history.pushState.bind(window.history);window.history.pushState=(...s)=>{a(...s),c()},window.addEventListener("popstate",c)}}function qe(e){try{return JSON.stringify(e)??String(e)}catch{return String(e)}}function ue(){let e=0,t=0,n=0,r=0;return i=>(i.hadRecentInput||(t>0&&i.startTime-r<1e3&&i.startTime-n<5e3?t+=i.value:(t=i.value,n=i.startTime),r=i.startTime,t>e&&(e=t)),e)}function We(e){if(e.size===0)return;let t=[...e.values()].sort((n,r)=>r-n);return t[Math.min(t.length-1,Math.floor(e.size/50))]}function He(e){return/iPad|Tablet|Android(?!.*Mobile)/i.test(e)?"tablet":/Mobi|iPhone|Android/i.test(e)?"mobile":"desktop"}function O(e,t,n){try{new PerformanceObserver(r=>r.getEntries().forEach(i=>t(i))).observe({type:e,buffered:!0,...n})}catch{}}function pe(e,t,n){if(typeof PerformanceObserver>"u"||typeof document>"u")return;let r=performance.getEntriesByType("navigation")[0],i=r?.activationStart??0,o=f=>Math.max(0,Math.round(f-i)),d=document.visibilityState==="hidden",c=location.pathname,a=r?.type,s={},l=ue(),m=new Map,h=!1,y=!1;r&&r.responseStart>0&&(s.ttfb=o(r.responseStart)),d||(O("paint",f=>{f.name==="first-contentful-paint"&&(s.fcp=o(f.startTime))}),O("largest-contentful-paint",f=>{h||(s.lcp=o(f.startTime))}));let B=()=>{h=!0};addEventListener("keydown",B,{once:!0,capture:!0}),addEventListener("pointerdown",B,{once:!0,capture:!0}),O("layout-shift",f=>{s.cls=Math.round(l(f)*1e4)/1e4});let T=f=>{if(!f.interactionId)return;m.set(f.interactionId,Math.max(m.get(f.interactionId)??0,f.duration));let Q=We(m);Q!==void 0&&(s.inp=Math.round(Q))};O("event",T,{durationThreshold:40}),O("first-input",T);let g=navigator.connection?.effectiveType,J=`${new URL("/api/v1/vitals",e).href}?key=${encodeURIComponent(t)}${n?`&instance=${encodeURIComponent(n)}`:""}`,P=()=>{if(y||Object.keys(s).length===0)return;y=!0;let f=JSON.stringify({path:c.slice(0,512),metrics:s,nav:a,connection:g&&/^(slow-2g|2g|3g|4g)$/.test(g)?g:void 0,device:He(navigator.userAgent)});try{if(navigator.sendBeacon?.(J,f))return}catch{}fetch(J,{method:"POST",body:f,keepalive:!0}).catch(()=>{})},G=()=>{location.pathname!==c&&(P(),c=location.pathname,a="route",s={},l=ue(),m=new Map,h=!0,y=!1)};document.addEventListener("visibilitychange",()=>document.visibilityState==="hidden"&&P()),addEventListener("pagehide",P),addEventListener("popstate",G);let Ee=history.pushState;history.pushState=function(...f){Ee.apply(this,f),G()}}function ze(e,t=Math.random){return t()<(e.sessionSampleRate??0)?"session":t()<(e.onErrorSampleRate??1)?"buffer":null}function le(e,t,n,r,i){let o=ze(e);if(!o||typeof document>"u")return;let d=R(),c,a=document.createElement("script");return a.src=e.src??`${i}blipit-replay.js`,a.async=!0,a.onload=()=>{let s=window.BlipitReplay?.start;c=s?.({id:d,mode:o,endpoint:t,key:n,instance:r})},document.head.appendChild(a),{id:d,active:()=>c?.active()??!1,error:s=>c?.error(s),report:s=>c?.report?.(s)}}var H={en:["Report a bug","Loading\u2026"],ar:["\u0623\u0628\u0644\u063A \u0639\u0646 \u062E\u0637\u0623","\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644\u2026"],de:["Fehler melden","Wird geladen\u2026"],es:["Reportar un error","Cargando\u2026"],fr:["Signaler un bug","Chargement\u2026"],it:["Segnala un bug","Caricamento\u2026"],ja:["\u4E0D\u5177\u5408\u3092\u5831\u544A","\u8AAD\u307F\u8FBC\u307F\u4E2D\u2026"],nl:["Bug melden","Laden\u2026"],pt:["Reportar erro","Carregando\u2026"],tr:["Hata bildir","Y\xFCkleniyor\u2026"],zh:["\u62A5\u544A\u95EE\u9898","\u52A0\u8F7D\u4E2D\u2026"]},Xe="button{all:initial;position:fixed;z-index:2147483646;display:flex;align-items:center;gap:8px;padding:11px 18px;border-radius:99px;background:var(--c,linear-gradient(135deg,#3882F6,#2F5BEA));color:#fff;font:600 14px system-ui,-apple-system,sans-serif;letter-spacing:-.01em;cursor:pointer;box-shadow:0 14px 32px -12px rgba(56,130,246,.75),0 2px 6px rgba(11,26,58,.18),inset 0 1px 0 rgba(255,255,255,.22);transition:transform .2s,box-shadow .2s;animation:in .35s cubic-bezier(.2,.8,.2,1)}button:hover{transform:translateY(-2px);box-shadow:0 20px 40px -12px rgba(56,130,246,.85),0 3px 8px rgba(11,26,58,.2),inset 0 1px 0 rgba(255,255,255,.22)}button:active{transform:scale(.97)}button:focus-visible{outline:3px solid #00C2FF;outline-offset:3px}button:disabled{cursor:progress}svg,i{width:18px;height:18px}i{box-sizing:border-box;border:2px solid;border-right-color:transparent;border-radius:50%;animation:r .8s linear infinite}@keyframes r{to{transform:rotate(1turn)}}@keyframes in{from{opacity:0;transform:translateY(12px) scale(.94)}}.o span{display:none}.o{padding:13px}@media(max-width:480px){span{display:none}button{padding:13px}}@media(pointer:coarse){button{min-height:44px;box-sizing:border-box}}@media(prefers-reduced-motion:reduce){button{animation:none;transition:none}i{animation-duration:3s}}",Ve='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round" aria-hidden="true"><path d="M4 4h16v12H9l-5 4zM12 7v4M12 13.5v.5"/></svg>',me,W={},ge,x,z=()=>{},k,fe=0;function C(e,t){e.options.debug&&console.log(`[blipit] ${t}`)}function he(e){me=e}function N(e,t){return W[t]??=new Promise((n,r)=>{let i=document.createElement("script");i.src=e,i.async=!0,i.onload=()=>{let o=window[t];o?n(o):r(new Error(t))},i.onerror=r,document.head.appendChild(i)}).catch(n=>{throw delete W[t],n}),W[t]}function be(){let e=(navigator.language??"en").slice(0,2);return H[e]?e:"en"}function X(e,t){let n=document.createElement("button");return n.type="button",n.className="blipit-rb",n.setAttribute("aria-haspopup","dialog"),e?n.textContent=e:(n.lang=be(),n.textContent=H[n.lang][0]),n.addEventListener("click",()=>n.hasAttribute("aria-busy")||t()),n}var ye=()=>{};function ve(e){ye=e}function V(e,t){ye(S(e.endpoint,"/api/v1/feedback"),e.options.key,t)}function A(e){if(typeof document>"u")return;let t=typeof e.options.feedbackWidget=="object"?e.options.feedbackWidget:{},n=document.querySelectorAll("button.blipit-rb"),r=i=>{z(i),n.forEach(o=>i?o.setAttribute("aria-busy","true"):o.removeAttribute("aria-busy"))};r(!0),Promise.all([N(t.src??`${E}blipit-report.js`,"BlipitReport"),ge??=xe(e)]).then(([i,o])=>o.enabled!==!1&&i.open(e,{metadata:me,recording:o.recording===!0,recordingMaxMs:o.recording_max_ms,storageFull:o.storage_full===!0,reportsFull:o.reports_full===!0,theme:o.theme,hide:d=>x&&(x.style.display=d?"none":"")}),()=>V(e,{eventId:e.lastEventId,name:e.user?.username,email:e.user?.email})).finally(()=>r(!1))}async function xe(e){let t=`blipit_fb_${_}_${e.options.key}`;try{let n=JSON.parse(localStorage.getItem(t)??"null");if(n&&Date.now()-n.t<36e5)return n.s}catch{}try{let n=await fetch(S(e.endpoint,"/api/v1/feedback/settings"),{headers:{"X-Blipit-Key":e.options.key,...e.options.instance?{"X-Blipit-Instance":e.options.instance}:{}}});if(!n.ok)return C(e,`widget settings failed (HTTP ${n.status}), using defaults`),{};let r=await n.json();try{localStorage.setItem(t,JSON.stringify({t:Date.now(),s:r}))}catch{}return r}catch{return C(e,"widget settings unreachable (offline, ad blocker or CSP connect-src), using defaults"),{}}}async function Y(e){let t=e.options.feedbackWidget,n=++fe;if(typeof document>"u")return;if(t===!1)return C(e,"Report a bug button off: feedbackWidget is false");let r=await(ge??=xe(e));if(n!==fe)return;if(r.enabled===!1)return C(e,"Report a bug button hidden by the project's Bug report widget setting");let i={...r,...typeof t=="object"?t:{}},[o,d]=H[be()],c=i.text||o;x=document.createElement("div"),x.setAttribute("data-blipit-ui","");let a=x.attachShadow({mode:"open"}),s=document.createElement("button");s.type="button";let[l,m]=(/^(bottom|middle)-(left|right)$/.test(i.position??"")?i.position:"bottom-right").split("-");s.style.cssText=`${i.color?`--c:${i.color};`:""}${m}:calc(20px + env(safe-area-inset-${m},0px));${l==="bottom"?"bottom:calc(20px + env(safe-area-inset-bottom,0px))":"top:50%;margin-top:-22px"}`,s.setAttribute("aria-haspopup","dialog"),i.style==="icon"&&(s.className="o",s.title=c);let h=g=>{s.disabled=g,s.setAttribute("aria-label",g?d:c),s.innerHTML=g?"<i></i><span></span>":`${Ve}<span></span>`,s.lastChild.textContent=g?d:c};z=h,h(!1),s.addEventListener("click",()=>A(e)),ne(a,Xe),a.append(s);let y=i.shortcut?.toLowerCase().replace(/\s/g,"");k&&document.removeEventListener("keydown",k),k=void 0,y&&(k=g=>{[g.ctrlKey&&"ctrl",g.shiftKey&&"shift",g.altKey&&"alt",g.metaKey&&"meta",g.key.toLowerCase()].filter(Boolean).join("+")===y&&(g.preventDefault(),A(e))},document.addEventListener("keydown",k));let B=x,T=()=>{x===B&&(document.body.append(B),C(e,`Report a bug button shown at ${l}-${m}`))};document.body?T():document.addEventListener("DOMContentLoaded",T)}function Se(e,t){let n=e.options.feedbackWidget;e.options.feedbackWidget=t===!1?!1:{...typeof n=="object"?n:{},...t},x?.remove(),x=void 0,k&&document.removeEventListener("keydown",k),k=void 0,z=()=>{},Y(e)}var p,ke=new Set;function we(e,t){ke.has(t)||(ke.add(t),console[e](t))}var Ye="[blipit] init() has no key, so error tracking and the Report a bug button are off. Pass your public key (blipit_pk_...) from app.blipit.io, API keys.",Je="[blipit] init() got a secret key (blipit_sk_...), so Blipit did not start: secret keys must never be in browser code. Use the public key (blipit_pk_...) and create a new secret key in app.blipit.io, API keys.";function Ge(e){if(p)return;let t=typeof e?.key=="string"?e.key.trim():"";if(!t)return we("warn",Ye);if(t.startsWith("blipit_sk_"))return we("error",Je);if(p=new $({...e,key:t}),e.user){let{id:n,name:r,email:i,username:o}=e.user;p.setUser({id:n===void 0?void 0:String(n),email:i,username:o??r})}ce(p),e.webVitals!==!1&&typeof window<"u"&&pe(e.endpoint??M,t,e.instance),e.replay&&(p.replay=le(e.replay,e.endpoint??M,t,e.instance,E)),typeof window<"u"&&Y(p),e.debug&&console.log(`[blipit] ${K}@${_} initialized`)}function Qe(e){return p?.captureException(e,!0)}function Ze(e,t){return p?.captureMessage(e,t)}function et(e){return p?.captureSecurity(e)}function tt(e){p?.setUser(e)}function nt(e,t){p?.setTag(e,t)}function it(e){p?.addBreadcrumb(e)}function rt(e={}){p&&V(p,{...e,eventId:e.eventId??p.lastEventId})}function D(){p&&A(p)}function ot(e){e.addEventListener("click",t=>{t.preventDefault(),D()})}function st(e){p&&Se(p,e)}function at(){return p?.flush()??Promise.resolve()}ve((e,t,n)=>N(`${E}blipit-feedback.js`,"BlipitFeedback").then(r=>r.showFeedbackDialog(e,t,n),()=>{}));function dt(e={}){let t=X(e.label,D);return t.style.visibility="hidden",N(`${E}blipit-button.js`,"BlipitButton").then(n=>n.paint(t,e)).catch(()=>{}).then(()=>t.style.removeProperty("visibility")),t}return Ce(ct);})();
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  var te={en:["Report {ref} sent.","We will email you updates."],ar:["\u062A\u0645 \u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0628\u0644\u0627\u063A {ref}.","\u0633\u0646\u0631\u0627\u0633\u0644\u0643 \u0628\u0627\u0644\u062A\u062D\u062F\u064A\u062B\u0627\u062A."],de:["Meldung {ref} gesendet.","Wir informieren Sie per E-Mail."],es:["Reporte {ref} enviado.","Te enviaremos novedades por correo."],fr:["Signalement {ref} envoy\xE9.","Nous vous tiendrons au courant par e-mail."],it:["Segnalazione {ref} inviata.","Ti invieremo aggiornamenti via email."],ja:["\u5831\u544A {ref} \u3092\u9001\u4FE1\u3057\u307E\u3057\u305F\u3002","\u9032\u6357\u306F\u30E1\u30FC\u30EB\u3067\u304A\u77E5\u3089\u305B\u3057\u307E\u3059\u3002"],nl:["Melding {ref} verstuurd.","We mailen je updates."],pt:["Relato {ref} enviado.","Vamos enviar novidades por e-mail."],tr:["{ref} numaral\u0131 bildirim g\xF6nderildi.","Geli\u015Fmeleri e-postayla bildirece\u011Fiz."],zh:["\u62A5\u544A {ref} \u5DF2\u53D1\u9001\u3002","\u6211\u4EEC\u4F1A\u901A\u8FC7\u90AE\u4EF6\u544A\u77E5\u8FDB\u5C55\u3002"]};function Oe(e,t,n){if(typeof e!="string"||!/^BR-\d{1,12}$/.test(e))return null;let[i,r]=te[n.toLowerCase().split(/[-_]/)[0]]??te.en;return`${i.replace("{ref}",e)}${t===!0?` ${r}`:""}`}function x(e,t,n){let i=document.createElement(e);return i.style.cssText=t,n!==void 0&&(i.textContent=n),i}var j="display:block;width:100%;box-sizing:border-box;margin:4px 0 12px;padding:8px 10px;font:inherit;border:1px solid #c5ccd6;border-radius:6px;background:#fff;color:#111",ne="font:inherit;padding:8px 14px;border-radius:6px;cursor:pointer;border:1px solid #c5ccd6;background:#fff;color:#111",W=!1;function ie(e,t,n){if(W||typeof document>"u"||!document.body)return;W=!0;let i=x("dialog","max-width:420px;width:calc(100% - 32px);padding:20px;border:1px solid #c5ccd6;border-radius:10px;font:14px/1.45 system-ui,sans-serif;color:#111;background:#fff");i.setAttribute("aria-labelledby","blipit-fb-title");let r=x("form","margin:0"),o=x("h2","margin:0 0 12px;font-size:17px",n.title??"Tell us what happened");o.id="blipit-fb-title";let c=(b,$,k)=>{let B=x("label","display:block;font-weight:600",b);B.htmlFor=k,$.id=k,r.append(B,$)},d=x("input",j);d.type="text",d.maxLength=128,d.autocomplete="name",d.value=n.name??"";let a=x("input",j);a.type="email",a.maxLength=254,a.autocomplete="email",a.value=n.email??"";let s=x("textarea",`${j};min-height:110px;resize:vertical`);s.required=!0,s.maxLength=5e3;let p=x("p","margin:0 0 12px;min-height:1.2em;font-size:13px");p.setAttribute("role","status"),p.setAttribute("aria-live","polite");let h=x("div","display:flex;gap:8px;justify-content:flex-end"),f=x("button",ne,"Cancel");f.type="button";let m=x("button",`${ne};background:#111;color:#fff;border-color:#111`,"Send");m.type="submit",r.append(o),c("Name (optional)",d,"blipit-fb-name"),c("Email (optional)",a,"blipit-fb-email"),c("What went wrong?",s,"blipit-fb-message"),h.append(f,m),r.append(p,h),i.append(r),document.body.append(i);let E=()=>{W=!1,i.remove()},R=()=>typeof i.close=="function"&&i.open?i.close():E();f.addEventListener("click",R),i.addEventListener("close",E),r.addEventListener("submit",async b=>{b.preventDefault();let $=s.value.trim();if(!$){p.textContent="Please describe what happened.",s.focus();return}m.disabled=!0,f.disabled=!0,m.setAttribute("aria-busy","true"),m.textContent="Sending\u2026",p.textContent="";try{let k=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json","X-Blipit-Key":t},body:JSON.stringify({name:d.value.trim()||void 0,email:a.value.trim()||void 0,message:$,event_id:n.eventId,url:typeof location<"u"?location.href.split(/[?#]/)[0]:void 0})});if(!k.ok)throw new Error(String(k.status));let B=await k.json().catch(()=>({})),A=Oe(B.ref,B.emails,typeof navigator>"u"?"en":navigator.language??"en");p.textContent=A??"Thanks, your message was sent.",m.textContent="Sent",setTimeout(R,A?4e3:1200)}catch{p.textContent="That did not send. Please try again.",m.disabled=!1,f.disabled=!1,m.removeAttribute("aria-busy"),m.textContent="Send"}}),typeof i.showModal=="function"?i.showModal():i.setAttribute("open",""),s.focus()}var re=["login_failed","login_succeeded","login_blocked","password_reset_requested","privilege_granted"];var F=class{constructor(t,n,i,r){this.endpoint=t;this.key=n;this.debug=i;this.instance=r;typeof document<"u"&&document.addEventListener&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&this.flushWithBeacon()})}endpoint;key;debug;instance;queue=[];timer;sending=!1;enqueue(t){this.queue.push(t),this.queue.length>30&&this.queue.shift(),this.timer||(this.timer=setTimeout(()=>{this.timer=void 0,this.flush()},1e3))}async flush(){if(!this.sending){this.sending=!0;try{for(;this.queue.length>0;){let t=this.queue[0];if(!await this.send(t))break;this.queue.shift()}}finally{this.sending=!1}}}async send(t,n=0){try{let i=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","X-Blipit-Key":this.key,...this.instance?{"X-Blipit-Instance":this.instance}:{}},body:JSON.stringify(t),keepalive:!0});return i.status===429||i.status>=500?this.retry(t,n):(this.debug&&i.status>=400&&console.warn("[blipit] event rejected",i.status,await i.text()),!0)}catch{return this.retry(t,n)}}async retry(t,n){return n>=2?(this.debug&&console.warn("[blipit] dropping event after retries",t.event_id),!0):(await new Promise(i=>setTimeout(i,1e3*2**n)),this.send(t,n+1))}flushWithBeacon(){if(!(typeof navigator>"u"||!navigator.sendBeacon))for(;this.queue.length>0;){let t=this.queue.shift(),n=`key=${encodeURIComponent(this.key)}${this.instance?`&instance=${encodeURIComponent(this.instance)}`:""}`,i=`${this.endpoint}${this.endpoint.includes("?")?"&":"?"}${n}`;navigator.sendBeacon(i,JSON.stringify(t))}}};function L(){let e=new Uint8Array(16);if(typeof crypto<"u"&&crypto.getRandomValues)crypto.getRandomValues(e);else for(let n=0;n<16;n++)e[n]=Math.floor(Math.random()*256);e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t="";for(let n=0;n<16;n++)t+=e[n].toString(16).padStart(2,"0");return t}function v(){return new Date().toISOString()}var Ie=/token|key|password|secret|auth|session|passwd|api/i;function C(e){let t=e.indexOf("?");if(t===-1)return e.slice(0,2048);let n=e.slice(0,t),r=e.slice(t+1).split("&").map(o=>{let c=o.indexOf("=");if(c===-1)return o;let d=o.slice(0,c);return Ie.test(d)?`${d}=[redacted]`:o}).join("&");return`${n}?${r}`.slice(0,2048)}var Ae=/\b((?:[a-zA-Z0-9_-]*(?:token|key|password|secret|auth|session|passwd|api)[a-zA-Z0-9_-]*)=)[^&\s"']+/gi;function oe(e){return e.replace(Ae,"$1[redacted]")}function l(e,t){return e.length>t?e.slice(0,t):e}var se=".blipit-mask,[data-blipit-mask]";function q(e){return e.replace(/#.*/,"").replace(/([?&][^=&]*)=[^&]*/g,"$1=").slice(0,2048)}function w(e,t,n){e.push(t),e.length>n&&e.shift()}function H(e){let t=e.id?`#${e.id}`:"",n=typeof e.className=="string"&&e.className.trim()?`.${e.className.trim().split(/\s+/).slice(0,2).join(".")}`:"";return l(`${e.tagName.toLowerCase()}${t}${n}`,128)}function N(e,t){try{let n=new CSSStyleSheet;n.replaceSync(t),e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]}catch{let n=document.createElement("style");n.textContent=t,(e===document?document.head:e).append(n)}}function T(e,t){return`${e.replace(/\/api\/v1\/events.*$/,"").replace(/\/$/,"")}${t}`}function ae(e,t){let n=e?/^(https?:\/\/[^?#]*\/)blipit(?:\.min)?\.js(?:[?#].*)?$/.exec(e):null;return n?n[1]:`https://blipit.io/sdk/${t}/`}function Fe(e){let t=e.match(/rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:[,\s/]+([\d.]+%?))?/);if(!t||(t[4]===void 0?1:t[4].endsWith("%")?parseFloat(t[4])/100:parseFloat(t[4]))<.5)return null;let[i,r,o]=[t[1],t[2],t[3]].map(c=>{let d=parseFloat(c)/255;return d<=.03928?d/12.92:((d+.055)/1.055)**2.4});return .2126*i+.7152*r+.0722*o}function de(e){if(e==="light"||e==="dark")return e;if(typeof document<"u"){for(let n of[document.body,document.documentElement]){if(!n)continue;let i=Fe(getComputedStyle(n).backgroundColor);if(i!==null)return i<.4?"dark":"light"}let t=getComputedStyle(document.documentElement).colorScheme;if(t==="dark")return"dark";if(t&&t!=="normal"&&!t.includes("dark"))return"light"}return typeof matchMedia=="function"&&matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}var ce={ok:0,errored:1,crashed:2},D=class{constructor(t,n,i,r){this.url=t;this.key=n;this.release=i;this.environment=r;this.start(),typeof document<"u"&&document.addEventListener&&document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.end():this.sid||this.start()})}url;key;release;environment;sid="";started="";status="ok";errors=0;did;setUser(t){this.did=t}markError(t){if(!this.sid)return;this.errors+=1;let n=t?"crashed":"errored";ce[n]<=ce[this.status]||(this.status=n,this.send(!1))}start(){this.sid=L(),this.started=v(),this.status="ok",this.errors=0,this.send(!1)}end(){this.sid&&(this.send(!0),this.sid="")}send(t){let n=JSON.stringify({sid:this.sid,did:this.did,status:this.status==="ok"&&t?"exited":this.status,errors:this.errors,started:this.started,release:this.release,environment:this.environment}),i=`${this.url}?key=${encodeURIComponent(this.key)}`;try{if(t&&typeof navigator<"u"&&navigator.sendBeacon){navigator.sendBeacon(i,n);return}if(typeof fetch>"u")return;fetch(this.url,{method:"POST",headers:{"Content-Type":"application/json","X-Blipit-Key":this.key},body:n,keepalive:!0}).catch(()=>{})}catch{return}}};var Ne=/^\s*at (?:async )?(?:new )?(?:(.+?) )?\(?((?:file|https?|blob|chrome-extension|moz-extension|safari-web-extension|node|webpack):.*?|[^()]+?)(?::(\d+))?(?::(\d+))?\)?\s*$/,De=/^\s*(?:(.*?)@)?((?:file|https?|blob|chrome-extension|moz-extension|safari-web-extension|node|webpack).*?|[^@]*?)(?::(\d+))?(?::(\d+))?\s*$/,ue=/^(chrome|moz|safari-web)-extension:/;function Pe(){if(typeof location<"u"&&location.origin)return location.origin}function Ue(e){if(ue.test(e)||e==="<anonymous>"||e==="[native code]")return!1;let t=Pe();return!!(!t||e.startsWith(t)||!/^[a-z]+:/i.test(e))}function pe(e){if(!e)return[];let t=[];for(let n of e.split(`
2
- `)){if(!n||/^\s*(Error|TypeError|RangeError|SyntaxError|ReferenceError)\b/.test(n))continue;let i=Ne.exec(n)??De.exec(n);if(!i)continue;let[,r,o,c,d]=i;if(!o)continue;let a={filename:l(o,1024),in_app:Ue(o)};r&&(a.function=l(r,512)),c&&(a.lineno=Number(c)),d&&(a.colno=Number(d)),t.push(a)}return t.reverse(),t.slice(-128)}function le(e){return e.length===0?!1:e.every(t=>ue.test(t.filename))}var X="@blipit/browser",M="0.3.8",U=ae(typeof document<"u"?document.currentScript?.src:void 0,M),z="https://in.blipit.io/api/v1/events",ze=[/ResizeObserver loop/i,/^Script error\.?$/,/__gCrWeb|__firefox__/],Ke={login_failed:"Failed login",login_succeeded:"Successful login",login_blocked:"Blocked login",password_reset_requested:"Password reset requested",privilege_granted:"Privilege granted"},je={login_failed:"warning",login_succeeded:"info",login_blocked:"warning",password_reset_requested:"info",privilege_granted:"warning"};function We(e){if(!re.includes(e?.kind))return;let t=l(String(e.actor??"").trim(),256);if(!t)return;let n={kind:e.kind,actor:t};return e.actorId&&(n.actor_id=l(String(e.actorId),128)),e.ip&&(n.ip=l(String(e.ip).trim(),45)),e.userAgent&&(n.user_agent=l(String(e.userAgent),512)),e.database&&(n.database=l(String(e.database),64)),e.outcome&&(n.outcome=l(String(e.outcome),64)),e.target&&(n.target=l(String(e.target),256)),n}var P=class{constructor(t){this.options=t;this.endpoint=t.endpoint??z,this.transport=new F(this.endpoint,t.key,t.debug??!1,t.instance),t.autoSessionTracking&&(t.release?this.session=new D(T(this.endpoint,"/api/v1/sessions"),t.key,t.release,t.environment??"production"):t.debug&&console.warn("[blipit] session tracking needs the release option")),this.maxBreadcrumbs=Math.min(t.maxBreadcrumbs??50,100),this.ignoreErrors=[...ze,...t.ignoreErrors??[]]}options;transport;breadcrumbs=[];user;tags={};maxBreadcrumbs;ignoreErrors;seen=new Set;captured=new WeakSet;session;lastEventId;errorIds=[];logs={console:[],network:[],actions:[]};endpoint;replay;setUser(t){this.user=t,this.session?.setUser(t?.id??t?.email)}setTag(t,n){this.tags[l(t,64)]=l(n,256)}addBreadcrumb(t){let n={timestamp:v(),...t};n.message&&(n.message=oe(n.message)),n.data&&typeof n.data.url=="string"&&(n.data={...n.data,url:C(n.data.url)}),this.breadcrumbs.push(n),this.breadcrumbs.length>this.maxBreadcrumbs&&this.breadcrumbs.shift()}captureException(t,n=!0){if(t&&typeof t=="object"){if(this.captured.has(t))return;this.captured.add(t)}let i=t instanceof Error?t:new Error(String(t)),r={type:i.name||"Error",value:l(i.message||String(i),4096),handled:n},o=pe(i.stack);return o.length>0&&(r.stacktrace={frames:o}),this.processAndSend({exception:r,level:"error"})}captureMessage(t,n="info"){return this.processAndSend({message:l(t,8192),level:n})}captureSecurity(t){let n=We(t);if(!n){this.options.debug&&console.warn("[blipit] security event dropped, needs a known kind and an actor");return}return this.processAndSend({message:`${Ke[n.kind]} for ${n.actor}`,level:je[n.kind],security:n},!1)}processAndSend(t,n=!0){if(n&&this.options.sampleRate!==void 0&&Math.random()>this.options.sampleRate)return;let i=t.exception?.value??t.message??"";if(n){for(let d of this.ignoreErrors)if(typeof d=="string"?i.includes(d):d.test(i))return;if((this.options.autoMuteExtensions??!0)&&t.exception?.stacktrace&&le(t.exception.stacktrace.frames))return;let c=`${t.exception?.type??""}|${i}`;if(t.exception?.handled===!1){if(this.seen.has(c)&&this.seen.size<100)return;this.seen.add(c),setTimeout(()=>this.seen.delete(c),5e3)}}let r={event_id:L(),timestamp:v(),platform:"javascript",release:this.options.release,environment:this.options.environment??"production",user:this.user,tags:Object.keys(this.tags).length>0?{...this.tags}:void 0,breadcrumbs:this.breadcrumbs.length>0?[...this.breadcrumbs]:void 0,request:typeof location<"u"?{url:C(location.href)}:void 0,contexts:this.collectContexts(),sdk:{name:X,version:M},...t};for(let c of Object.keys(r))r[c]===void 0&&delete r[c];let o=this.replay?.active()&&(r.level==="error"||r.level==="fatal")?this.replay:void 0;if(o&&(r.tags={...r.tags,replay_id:o.id}),this.options.beforeSend){let c=this.options.beforeSend(r);if(!c)return;r=c}return this.transport.enqueue(r),this.lastEventId=r.event_id,(r.level==="error"||r.level==="fatal")&&w(this.errorIds,r.event_id,20),r.exception&&this.session?.markError(r.exception.handled===!1),o?.error(r.event_id),r.event_id}collectContexts(){if(typeof navigator>"u")return;let t={},n=navigator.userAgent??"",i=/(Edg|OPR|Chrome|Firefox|Safari)\/(\d+[\d.]*)/.exec(n)??void 0;i&&(t.browser={name:i[1],version:i[2]});let r=/\(([^)]+)\)/.exec(n);return r&&r[1]&&(t.os={name:l(r[1],64)}),typeof screen<"u"&&(t.device={screen:`${screen.width}x${screen.height}`}),Object.keys(t).length>0?t:void 0}flush(){return this.transport.flush()}};var G={en:["Report a bug","Loading\u2026"],ar:["\u0623\u0628\u0644\u063A \u0639\u0646 \u062E\u0637\u0623","\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644\u2026"],de:["Fehler melden","Wird geladen\u2026"],es:["Reportar un error","Cargando\u2026"],fr:["Signaler un bug","Chargement\u2026"],it:["Segnala un bug","Caricamento\u2026"],ja:["\u4E0D\u5177\u5408\u3092\u5831\u544A","\u8AAD\u307F\u8FBC\u307F\u4E2D\u2026"],nl:["Bug melden","Laden\u2026"],pt:["Reportar erro","Carregando\u2026"],tr:["Hata bildir","Y\xFCkleniyor\u2026"],zh:["\u62A5\u544A\u95EE\u9898","\u52A0\u8F7D\u4E2D\u2026"]},qe="button{all:initial;position:fixed;z-index:2147483646;display:flex;align-items:center;gap:8px;padding:11px 18px;border-radius:99px;background:var(--c,linear-gradient(135deg,#3882F6,#2F5BEA));color:#fff;font:600 14px system-ui,-apple-system,sans-serif;letter-spacing:-.01em;cursor:pointer;box-shadow:0 14px 32px -12px rgba(56,130,246,.75),0 2px 6px rgba(11,26,58,.18),inset 0 1px 0 rgba(255,255,255,.22);transition:transform .2s,box-shadow .2s;animation:in .35s cubic-bezier(.2,.8,.2,1)}button:hover{transform:translateY(-2px);box-shadow:0 20px 40px -12px rgba(56,130,246,.85),0 3px 8px rgba(11,26,58,.2),inset 0 1px 0 rgba(255,255,255,.22)}button:active{transform:scale(.97)}button:focus-visible{outline:3px solid #00C2FF;outline-offset:3px}button:disabled{cursor:progress}svg,i{width:18px;height:18px}i{box-sizing:border-box;border:2px solid;border-right-color:transparent;border-radius:50%;animation:r .8s linear infinite}@keyframes r{to{transform:rotate(1turn)}}@keyframes in{from{opacity:0;transform:translateY(12px) scale(.94)}}.o span{display:none}.o{padding:13px}@media(max-width:480px){span{display:none}button{padding:13px}}@media(pointer:coarse){button{min-height:44px;box-sizing:border-box}}@media(prefers-reduced-motion:reduce){button{animation:none;transition:none}i{animation-duration:3s}}",He='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round" aria-hidden="true"><path d="M4 4h16v12H9l-5 4zM12 7v4M12 13.5v.5"/></svg>',me,V={},ge,S,Y=()=>{},_,fe=0;function O(e,t){e.options.debug&&console.log(`[blipit] ${t}`)}function Xe(e){me=e}function Ve(e,t){return V[t]??=new Promise((n,i)=>{let r=document.createElement("script");r.src=e,r.async=!0,r.onload=()=>{let o=window[t];o?n(o):i(new Error(t))},r.onerror=i,document.head.appendChild(r)}).catch(n=>{throw delete V[t],n}),V[t]}function he(){let e=(navigator.language??"en").slice(0,2);return G[e]?e:"en"}function be(e,t){let n=document.createElement("button");return n.type="button",n.className="blipit-rb",n.setAttribute("aria-haspopup","dialog"),e?n.textContent=e:(n.lang=he(),n.textContent=G[n.lang][0]),n.addEventListener("click",()=>n.hasAttribute("aria-busy")||t()),n}var ye=()=>{};function ve(e){ye=e}function J(e,t){ye(T(e.endpoint,"/api/v1/feedback"),e.options.key,t)}function K(e){if(typeof document>"u")return;let t=typeof e.options.feedbackWidget=="object"?e.options.feedbackWidget:{},n=document.querySelectorAll("button.blipit-rb"),i=r=>{Y(r),n.forEach(o=>r?o.setAttribute("aria-busy","true"):o.removeAttribute("aria-busy"))};i(!0),Promise.all([Ve(t.src??`${U}blipit-report.js`,"BlipitReport"),ge??=xe(e)]).then(([r,o])=>o.enabled!==!1&&r.open(e,{metadata:me,recording:o.recording===!0,recordingMaxMs:o.recording_max_ms,storageFull:o.storage_full===!0,reportsFull:o.reports_full===!0,theme:o.theme,hide:c=>S&&(S.style.display=c?"none":"")}),()=>J(e,{eventId:e.lastEventId,name:e.user?.username,email:e.user?.email})).finally(()=>i(!1))}async function xe(e){let t=`blipit_fb_${M}_${e.options.key}`;try{let n=JSON.parse(localStorage.getItem(t)??"null");if(n&&Date.now()-n.t<36e5)return n.s}catch{}try{let n=await fetch(T(e.endpoint,"/api/v1/feedback/settings"),{headers:{"X-Blipit-Key":e.options.key,...e.options.instance?{"X-Blipit-Instance":e.options.instance}:{}}});if(!n.ok)return O(e,`widget settings failed (HTTP ${n.status}), using defaults`),{};let i=await n.json();try{localStorage.setItem(t,JSON.stringify({t:Date.now(),s:i}))}catch{}return i}catch{return O(e,"widget settings unreachable (offline, ad blocker or CSP connect-src), using defaults"),{}}}async function Z(e){let t=e.options.feedbackWidget,n=++fe;if(typeof document>"u")return;if(t===!1)return O(e,"Report a bug button off: feedbackWidget is false");let i=await(ge??=xe(e));if(n!==fe)return;if(i.enabled===!1)return O(e,"Report a bug button hidden by the project's Bug report widget setting");let r={...i,...typeof t=="object"?t:{}},[o,c]=G[he()],d=r.text||o;S=document.createElement("div"),S.setAttribute("data-blipit-ui","");let a=S.attachShadow({mode:"open"}),s=document.createElement("button");s.type="button";let[p,h]=(/^(bottom|middle)-(left|right)$/.test(r.position??"")?r.position:"bottom-right").split("-");s.style.cssText=`${r.color?`--c:${r.color};`:""}${h}:calc(20px + env(safe-area-inset-${h},0px));${p==="bottom"?"bottom:calc(20px + env(safe-area-inset-bottom,0px))":"top:50%;margin-top:-22px"}`,s.setAttribute("aria-haspopup","dialog"),r.style==="icon"&&(s.className="o",s.title=d);let f=b=>{s.disabled=b,s.setAttribute("aria-label",b?c:d),s.innerHTML=b?"<i></i><span></span>":`${He}<span></span>`,s.lastChild.textContent=b?c:d};Y=f,f(!1),s.addEventListener("click",()=>K(e)),N(a,qe),a.append(s);let m=r.shortcut?.toLowerCase().replace(/\s/g,"");_&&document.removeEventListener("keydown",_),_=void 0,m&&(_=b=>{[b.ctrlKey&&"ctrl",b.shiftKey&&"shift",b.altKey&&"alt",b.metaKey&&"meta",b.key.toLowerCase()].filter(Boolean).join("+")===m&&(b.preventDefault(),K(e))},document.addEventListener("keydown",_));let E=S,R=()=>{S===E&&(document.body.append(E),O(e,`Report a bug button shown at ${p}-${h}`))};document.body?R():document.addEventListener("DOMContentLoaded",R)}function ke(e,t){let n=e.options.feedbackWidget;e.options.feedbackWidget=t===!1?!1:{...typeof n=="object"?n:{},...t},S?.remove(),S=void 0,_&&document.removeEventListener("keydown",_),_=void 0,Y=()=>{},Z(e)}function Q(e){return typeof e=="string"?e.length:e?.size}function we(e){return e&&Number(e)||void 0}function Ge(e,t){return async(n,i)=>{let r=typeof n=="string"?n:n instanceof URL?n.href:n.url,o=(i?.method??n.method??"GET").toUpperCase(),c=Date.now();try{let d=await e(n,i);return t(o,r,d.status,c,Q(i?.body),we(d.headers.get("content-length"))),d}catch(d){throw t(o,r,0,c,Q(i?.body)),d}}}function Ye(e,t){let n=e.open,i=e.send;e.open=function(r,o){return this._blipit=[String(r).toUpperCase(),String(o)],n.apply(this,arguments)},e.send=function(r){let o=this._blipit;if(o){let c=Date.now();this.addEventListener("loadend",()=>t(o[0],o[1],this.status,c,Q(r),we(this.getResponseHeader("content-length"))))}return i.apply(this,arguments)}}function Se(e){if(typeof window>"u")return;let t=T(e.endpoint,""),{console:n,network:i,actions:r}=e.logs;window.addEventListener("error",a=>{e.captureException(a.error??a.message,!1)}),window.addEventListener("unhandledrejection",a=>{e.captureException(a.reason,!1)}),typeof document<"u"&&(document.addEventListener("click",a=>{let s=a.target;if(!(s instanceof Element)||s.closest("[data-blipit-ui]"))return;let p=H(s);e.addBreadcrumb({category:"ui.click",message:`Clicked ${p}`});let h=s.closest(se)?"***":l((s.textContent??"").trim().replace(/\s+/g," "),80);w(r,{timestamp:v(),type:"click",selector:p,text:h},50)},{capture:!0,passive:!0}),document.addEventListener("focusin",a=>{let s=a.target;s instanceof Element&&/^(INPUT|TEXTAREA|SELECT)$/.test(s.tagName)&&w(r,{timestamp:v(),type:"focus",selector:H(s)},50)},{capture:!0,passive:!0}));let o=(a,s,p,h,f,m)=>{t&&s.startsWith(t)||(e.addBreadcrumb({category:"http",message:`${a} ${C(s)} \u2192 ${p||"network error"}`,level:p>=400||!p?"error":"info",data:{url:C(s),method:a,status_code:p||void 0}}),w(i,{timestamp:v(),method:a,url:q(s),status:p,duration:Date.now()-h,request_size:f,response_size:m},50))};typeof window.fetch=="function"&&(window.fetch=Ge(window.fetch.bind(window),o)),typeof XMLHttpRequest<"u"&&Ye(XMLHttpRequest.prototype,o);for(let a of["log","info","debug","warn","error"]){let s=console[a].bind(console);console[a]=(...p)=>{let h=l(p.map(f=>typeof f=="string"?f:Je(f)).join(" "),1024);if(a==="warn"||a==="error"){e.addBreadcrumb({category:"console",level:a==="warn"?"warning":"error",message:h});let f=p.find(m=>m instanceof Error);w(n,{timestamp:v(),level:a,message:h,stack:l((f??new Error).stack??"",2e3)},100)}else w(n,{timestamp:v(),level:a,message:h},100);s(...p)}}let c=()=>w(r,{timestamp:v(),type:"navigation",url:q(location.href)},50),d=()=>{e.addBreadcrumb({category:"navigation",message:`Navigated to ${C(location.href)}`}),c()};if(c(),window.history){let a=window.history.pushState.bind(window.history);window.history.pushState=(...s)=>{a(...s),d()},window.addEventListener("popstate",d)}}function Je(e){try{return JSON.stringify(e)??String(e)}catch{return String(e)}}function Ee(){let e=0,t=0,n=0,i=0;return r=>(r.hadRecentInput||(t>0&&r.startTime-i<1e3&&r.startTime-n<5e3?t+=r.value:(t=r.value,n=r.startTime),i=r.startTime,t>e&&(e=t)),e)}function Ze(e){if(e.size===0)return;let t=[...e.values()].sort((n,i)=>i-n);return t[Math.min(t.length-1,Math.floor(e.size/50))]}function Qe(e){return/iPad|Tablet|Android(?!.*Mobile)/i.test(e)?"tablet":/Mobi|iPhone|Android/i.test(e)?"mobile":"desktop"}function I(e,t,n){try{new PerformanceObserver(i=>i.getEntries().forEach(r=>t(r))).observe({type:e,buffered:!0,...n})}catch{}}function Re(e,t,n){if(typeof PerformanceObserver>"u"||typeof document>"u")return;let i=performance.getEntriesByType("navigation")[0],r=i?.activationStart??0,o=y=>Math.max(0,Math.round(y-r)),c=document.visibilityState==="hidden",d=location.pathname,a=i?.type,s={},p=Ee(),h=new Map,f=!1,m=!1;i&&i.responseStart>0&&(s.ttfb=o(i.responseStart)),c||(I("paint",y=>{y.name==="first-contentful-paint"&&(s.fcp=o(y.startTime))}),I("largest-contentful-paint",y=>{f||(s.lcp=o(y.startTime))}));let E=()=>{f=!0};addEventListener("keydown",E,{once:!0,capture:!0}),addEventListener("pointerdown",E,{once:!0,capture:!0}),I("layout-shift",y=>{s.cls=Math.round(p(y)*1e4)/1e4});let R=y=>{if(!y.interactionId)return;h.set(y.interactionId,Math.max(h.get(y.interactionId)??0,y.duration));let ee=Ze(h);ee!==void 0&&(s.inp=Math.round(ee))};I("event",R,{durationThreshold:40}),I("first-input",R);let b=navigator.connection?.effectiveType,$=`${new URL("/api/v1/vitals",e).href}?key=${encodeURIComponent(t)}${n?`&instance=${encodeURIComponent(n)}`:""}`,k=()=>{if(m||Object.keys(s).length===0)return;m=!0;let y=JSON.stringify({path:d.slice(0,512),metrics:s,nav:a,connection:b&&/^(slow-2g|2g|3g|4g)$/.test(b)?b:void 0,device:Qe(navigator.userAgent)});try{if(navigator.sendBeacon?.($,y))return}catch{}fetch($,{method:"POST",body:y,keepalive:!0}).catch(()=>{})},B=()=>{location.pathname!==d&&(k(),d=location.pathname,a="route",s={},p=Ee(),h=new Map,f=!0,m=!1)};document.addEventListener("visibilitychange",()=>document.visibilityState==="hidden"&&k()),addEventListener("pagehide",k),addEventListener("popstate",B);let A=history.pushState;history.pushState=function(...y){A.apply(this,y),B()}}function et(e,t=Math.random){return t()<(e.sessionSampleRate??0)?"session":t()<(e.onErrorSampleRate??1)?"buffer":null}function $e(e,t,n,i,r){let o=et(e);if(!o||typeof document>"u")return;let c=L(),d,a=document.createElement("script");return a.src=e.src??`${r}blipit-replay.js`,a.async=!0,a.onload=()=>{let s=window.BlipitReplay?.start;d=s?.({id:c,mode:o,endpoint:t,key:n,instance:i})},document.head.appendChild(a),{id:c,active:()=>d?.active()??!1,error:s=>d?.error(s),report:s=>d?.report?.(s)}}var Be='<svg viewBox="0 0 242.4 208.7" aria-hidden="true"><defs><linearGradient id="bm1" x1="0" y1="1" x2=".5" y2="0"><stop offset="0" stop-color="#00C2FF"/><stop offset=".35" stop-color="#3882F6"/><stop offset="1" stop-color="#0F172A"/></linearGradient><linearGradient id="bm2" x1="0" y1="1" x2="1" y2="0"><stop offset="0" stop-color="#3882F6"/><stop offset=".5" stop-color="#00C2FF"/><stop offset="1" stop-color="#3882F6"/></linearGradient></defs><path fill="url(#bm1)" d="M115.5,164.5c-3.9,0-7.8-.4-11.5-1.2-3.7-.8-7.3-1.9-10.8-3.4-3.4-1.4-6.7-3.2-9.7-5.3-3.0-2.0-5.9-4.4-8.5-7.0s-4.9-5.4-7.0-8.5c-2.1-3.1-3.9-6.3-5.3-9.8-1.5-3.5-2.6-7.1-3.4-10.8-.8-3.8-1.2-7.7-1.2-11.5V19.1c0-6.6,5.4-12.0,12.0-12.0s12.0,5.4,12.0,12.0v88.2c0,2.2.2,4.5.7,6.7.4,2.1,1.1,4.2,1.9,6.2.8,2.0,1.9,3.9,3.1,5.7,1.2,1.8,2.6,3.4,4.1,4.9s3.2,2.9,4.9,4.1c1.8,1.2,3.7,2.2,5.6,3.1,2.0.8,4.1,1.5,6.2,1.9,4.4.9,9.1.9,13.4,0,2.1-.4,4.2-1.1,6.2-1.9,2.0-.8,3.9-1.9,5.7-3.1,1.8-1.2,3.4-2.6,4.9-4.1s2.9-3.2,4.1-4.9c1.2-1.8,2.2-3.7,3.1-5.7.8-2.0,1.5-4.1,1.9-6.2.5-2.2.7-4.5.7-6.7s-.2-4.5-.7-6.7c-.4-2.1-1.1-4.2-1.9-6.2-.8-2.0-1.9-3.9-3.1-5.7-1.2-1.8-2.6-3.4-4.1-4.9s-3.2-2.9-4.9-4.1c-1.8-1.2-3.7-2.2-5.7-3.1-2.0-.8-4.1-1.5-6.2-1.9-4.4-.9-9.1-.9-13.4,0-6.5,1.3-12.9-2.9-14.2-9.4-1.3-6.5,2.9-12.9,9.4-14.2,7.6-1.6,15.5-1.6,23.1,0,3.7.8,7.3,1.9,10.8,3.4,3.4,1.4,6.7,3.2,9.7,5.3,3.0,2.0,5.9,4.4,8.5,7.0s4.9,5.4,7.0,8.5c2.1,3.1,3.9,6.3,5.3,9.8,1.5,3.5,2.6,7.1,3.4,10.8.8,3.8,1.2,7.7,1.2,11.5s-.4,7.8-1.2,11.5c-.8,3.7-1.9,7.3-3.4,10.8-1.4,3.4-3.2,6.7-5.3,9.7-2.0,3.0-4.4,5.9-7.0,8.5s-5.4,4.9-8.5,7.0c-3.1,2.1-6.3,3.9-9.8,5.3-3.5,1.5-7.1,2.6-10.8,3.4-3.8.8-7.7,1.2-11.5,1.2Z"/><path fill="url(#bm2)" d="M208.1,103.0c-.0-.6-.8-.9-1.2-.5-3.2,3.1-7.6,5.0-12.4,5.0-3.9,0-9.1-1.6-10.2-2.5-.3-.1-.1,1.4-.1,2.5,0,40.5-34.4,73.0-75.5,70.0-33.4-2.5-60.8-28.8-64.4-62.1-1.0-9.4-.2-18.6,2.2-27.0,1.6-5.6,2.6-11.4,2.6-17.3v-22.4c0-3.4-4.3-5.0-6.5-2.4-13.2,15.4-21.6,35.1-22.7,56.6-2.6,54.1,40.6,98.9,94.1,98.9s94.2-42.3,94.2-94.2c0-1.5-.1-3.0-.1-4.5Z"/><path fill="url(#bm2)" d="M201.2,70.1c-14.8-35.8-50.9-60.5-92.3-58.3h-.1c-8.2.5-14.6,7.4-14.6,15.7v.1c0,5.4,4.7,9.6,10.0,8.8,3.2-.5,6.5-.7,9.9-.7,28.7,0,53.5,17.4,64.3,42.1.2.5.9.6,1.2.1,3.2-4.8,8.7-7.9,14.9-7.9,2.0,0,4.0.3,5.8,1.0.6.2,1.1-.4.9-1.0Z"/><circle fill="#00C2FF" cx="194.5" cy="88" r="15.8"/></svg>';var u=".blipit-rb.blipit-rb",tt=`${u}{all:unset;box-sizing:border-box;display:inline-flex;align-items:center;gap:9px;height:40px;padding-inline:5px 17px;border-radius:99px;font:600 14px/1 system-ui,-apple-system,"Segoe UI",sans-serif;letter-spacing:-.01em;white-space:nowrap;cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent;color:#fff;background:linear-gradient(135deg,#3882F6,#2F5BEA);box-shadow:0 10px 24px -12px rgba(56,130,246,.8),0 1px 3px rgba(11,26,58,.16),inset 0 1px 0 rgba(255,255,255,.22);transition:transform .2s,box-shadow .2s}${u}:hover{transform:translateY(-1px);box-shadow:0 16px 32px -12px rgba(56,130,246,.85),0 2px 6px rgba(11,26,58,.18),inset 0 1px 0 rgba(255,255,255,.22)}${u}:active{transform:scale(.97)}${u}:focus-visible{outline:3px solid #00C2FF;outline-offset:3px}${u}[aria-busy=true]{cursor:progress}${u}>span{all:unset}${u}>.blipit-rb-m{position:relative;display:grid;place-items:center;flex:none;width:30px;height:30px;border-radius:99px;background:#fff;box-shadow:0 0 0 1px rgba(11,26,58,.08),0 1px 2px rgba(11,26,58,.12)}${u} svg{display:block;width:19px;height:17px}${u}[data-size=sm]{height:32px;gap:7px;padding-inline:4px 13px;font-size:13px}${u}[data-size=sm]>.blipit-rb-m{width:24px;height:24px}${u}[data-size=sm] svg{width:15px;height:13px}${u}[data-variant=outline],${u}[data-variant=ghost]{color:#0B1A3A;background:transparent;box-shadow:inset 0 0 0 1px #CBD7EA}${u}[data-variant=ghost]{box-shadow:none}${u}[data-variant=outline]:hover,${u}[data-variant=ghost]:hover{transform:none;background:rgba(56,130,246,.08);box-shadow:inset 0 0 0 1px rgba(56,130,246,.45)}${u}[data-variant=ghost]:hover{box-shadow:none}${u}[data-theme=dark]{background:linear-gradient(135deg,#5B9BFF,#3D6BF0);box-shadow:0 10px 24px -12px rgba(91,155,255,.7),inset 0 1px 0 rgba(255,255,255,.2)}${u}[data-theme=dark][data-variant=outline],${u}[data-theme=dark][data-variant=ghost]{color:#E8EEF8;background:transparent;box-shadow:inset 0 0 0 1px rgba(255,255,255,.16)}${u}[data-theme=dark][data-variant=ghost]{box-shadow:none}${u}[data-theme=dark][data-variant=outline]:hover,${u}[data-theme=dark][data-variant=ghost]:hover{background:rgba(91,155,255,.16);box-shadow:inset 0 0 0 1px rgba(91,155,255,.45)}${u}[data-theme=dark][data-variant=ghost]:hover{box-shadow:none}${u}[data-theme=dark]>.blipit-rb-m{box-shadow:0 0 0 1px rgba(255,255,255,.1)}${u}[aria-busy=true] svg{visibility:hidden}${u}[aria-busy=true]>.blipit-rb-m::after{content:"";position:absolute;inset:4px;border:2px solid #3882F6;border-right-color:transparent;border-radius:50%;animation:blipit-rb-r .8s linear infinite}@keyframes blipit-rb-r{to{transform:rotate(1turn)}}@media(pointer:coarse){${u}{min-height:44px}}@media(prefers-reduced-motion:reduce){${u}{transition:none}${u}:hover,${u}:active{transform:none}${u}[aria-busy=true]>.blipit-rb-m::after{animation-duration:3s}}@media(forced-colors:active){${u}{border:1px solid ButtonText}}`,Te=0;function _e(e,t={}){Te||N(document,tt);let n=++Te,i=document.createElement("span");i.className="blipit-rb-m",i.innerHTML=Be.replace(/bm(\d)/g,`bm$1-${n}`);let r=document.createElement("span");r.textContent=e.textContent,e.replaceChildren(i,r),e.classList.add("blipit-rb"),e.setAttribute("data-variant",t.variant==="outline"||t.variant==="ghost"?t.variant:"solid"),e.setAttribute("data-size",t.size==="sm"?"sm":"md"),e.setAttribute("data-theme",de(t.theme==="light"||t.theme==="dark"?t.theme:void 0))}var g,Ce=new Set;function Le(e,t){Ce.has(t)||(Ce.add(t),console[e](t))}var nt="[blipit] init() has no key, so error tracking and the Report a bug button are off. Pass your public key (blipit_pk_...) from app.blipit.io, API keys.",it="[blipit] init() got a secret key (blipit_sk_...), so Blipit did not start: secret keys must never be in browser code. Use the public key (blipit_pk_...) and create a new secret key in app.blipit.io, API keys.";function Dt(e){if(g)return;let t=typeof e?.key=="string"?e.key.trim():"";if(!t)return Le("warn",nt);if(t.startsWith("blipit_sk_"))return Le("error",it);if(g=new P({...e,key:t}),e.user){let{id:n,name:i,email:r,username:o}=e.user;g.setUser({id:n===void 0?void 0:String(n),email:r,username:o??i})}Se(g),e.webVitals!==!1&&typeof window<"u"&&Re(e.endpoint??z,t,e.instance),e.replay&&(g.replay=$e(e.replay,e.endpoint??z,t,e.instance,U)),typeof window<"u"&&Z(g),e.debug&&console.log(`[blipit] ${X}@${M} initialized`)}function Pt(e){return g?.captureException(e,!0)}function Ut(e,t){return g?.captureMessage(e,t)}function zt(e){return g?.captureSecurity(e)}function Kt(e){g?.setUser(e)}function jt(e,t){g?.setTag(e,t)}function Wt(e){g?.addBreadcrumb(e)}function qt(e={}){g&&J(g,{...e,eventId:e.eventId??g.lastEventId})}function Me(){g&&K(g)}function Ht(e){e.addEventListener("click",t=>{t.preventDefault(),Me()})}function Xt(e={}){let t=be(e.label,Me);return _e(t,e),t}function Vt(e){g&&ke(g,e)}function Gt(){return g?.flush()??Promise.resolve()}ve(ie);export{Wt as addBreadcrumb,Ht as attachReport,Pt as captureException,Ut as captureMessage,zt as captureSecurity,Gt as flush,Dt as init,Me as openReport,Xt as reportButton,Xe as setReportMetadata,jt as setTag,Kt as setUser,qt as showFeedback,Vt as updateWidget};
2
+ `)){if(!n||/^\s*(Error|TypeError|RangeError|SyntaxError|ReferenceError)\b/.test(n))continue;let i=Ne.exec(n)??De.exec(n);if(!i)continue;let[,r,o,c,d]=i;if(!o)continue;let a={filename:l(o,1024),in_app:Ue(o)};r&&(a.function=l(r,512)),c&&(a.lineno=Number(c)),d&&(a.colno=Number(d)),t.push(a)}return t.reverse(),t.slice(-128)}function le(e){return e.length===0?!1:e.every(t=>ue.test(t.filename))}var X="@blipit/browser",M="0.3.10",U=ae(typeof document<"u"?document.currentScript?.src:void 0,M),z="https://in.blipit.io/api/v1/events",ze=[/ResizeObserver loop/i,/^Script error\.?$/,/__gCrWeb|__firefox__/],Ke={login_failed:"Failed login",login_succeeded:"Successful login",login_blocked:"Blocked login",password_reset_requested:"Password reset requested",privilege_granted:"Privilege granted"},je={login_failed:"warning",login_succeeded:"info",login_blocked:"warning",password_reset_requested:"info",privilege_granted:"warning"};function We(e){if(!re.includes(e?.kind))return;let t=l(String(e.actor??"").trim(),256);if(!t)return;let n={kind:e.kind,actor:t};return e.actorId&&(n.actor_id=l(String(e.actorId),128)),e.ip&&(n.ip=l(String(e.ip).trim(),45)),e.userAgent&&(n.user_agent=l(String(e.userAgent),512)),e.database&&(n.database=l(String(e.database),64)),e.outcome&&(n.outcome=l(String(e.outcome),64)),e.target&&(n.target=l(String(e.target),256)),n}var P=class{constructor(t){this.options=t;this.endpoint=t.endpoint??z,this.transport=new F(this.endpoint,t.key,t.debug??!1,t.instance),t.autoSessionTracking&&(t.release?this.session=new D(T(this.endpoint,"/api/v1/sessions"),t.key,t.release,t.environment??"production"):t.debug&&console.warn("[blipit] session tracking needs the release option")),this.maxBreadcrumbs=Math.min(t.maxBreadcrumbs??50,100),this.ignoreErrors=[...ze,...t.ignoreErrors??[]]}options;transport;breadcrumbs=[];user;tags={};maxBreadcrumbs;ignoreErrors;seen=new Set;captured=new WeakSet;session;lastEventId;errorIds=[];logs={console:[],network:[],actions:[]};endpoint;replay;setUser(t){this.user=t,this.session?.setUser(t?.id??t?.email)}setTag(t,n){this.tags[l(t,64)]=l(n,256)}addBreadcrumb(t){let n={timestamp:v(),...t};n.message&&(n.message=oe(n.message)),n.data&&typeof n.data.url=="string"&&(n.data={...n.data,url:C(n.data.url)}),this.breadcrumbs.push(n),this.breadcrumbs.length>this.maxBreadcrumbs&&this.breadcrumbs.shift()}captureException(t,n=!0){if(t&&typeof t=="object"){if(this.captured.has(t))return;this.captured.add(t)}let i=t instanceof Error?t:new Error(String(t)),r={type:i.name||"Error",value:l(i.message||String(i),4096),handled:n},o=pe(i.stack);return o.length>0&&(r.stacktrace={frames:o}),this.processAndSend({exception:r,level:"error"})}captureMessage(t,n="info"){return this.processAndSend({message:l(t,8192),level:n})}captureSecurity(t){let n=We(t);if(!n){this.options.debug&&console.warn("[blipit] security event dropped, needs a known kind and an actor");return}return this.processAndSend({message:`${Ke[n.kind]} for ${n.actor}`,level:je[n.kind],security:n},!1)}processAndSend(t,n=!0){if(n&&this.options.sampleRate!==void 0&&Math.random()>this.options.sampleRate)return;let i=t.exception?.value??t.message??"";if(n){for(let d of this.ignoreErrors)if(typeof d=="string"?i.includes(d):d.test(i))return;if((this.options.autoMuteExtensions??!0)&&t.exception?.stacktrace&&le(t.exception.stacktrace.frames))return;let c=`${t.exception?.type??""}|${i}`;if(t.exception?.handled===!1){if(this.seen.has(c)&&this.seen.size<100)return;this.seen.add(c),setTimeout(()=>this.seen.delete(c),5e3)}}let r={event_id:L(),timestamp:v(),platform:"javascript",release:this.options.release,environment:this.options.environment??"production",user:this.user,tags:Object.keys(this.tags).length>0?{...this.tags}:void 0,breadcrumbs:this.breadcrumbs.length>0?[...this.breadcrumbs]:void 0,request:typeof location<"u"?{url:C(location.href)}:void 0,contexts:this.collectContexts(),sdk:{name:X,version:M},...t};for(let c of Object.keys(r))r[c]===void 0&&delete r[c];let o=this.replay?.active()&&(r.level==="error"||r.level==="fatal")?this.replay:void 0;if(o&&(r.tags={...r.tags,replay_id:o.id}),this.options.beforeSend){let c=this.options.beforeSend(r);if(!c)return;r=c}return this.transport.enqueue(r),this.lastEventId=r.event_id,(r.level==="error"||r.level==="fatal")&&w(this.errorIds,r.event_id,20),r.exception&&this.session?.markError(r.exception.handled===!1),o?.error(r.event_id),r.event_id}collectContexts(){if(typeof navigator>"u")return;let t={},n=navigator.userAgent??"",i=/(Edg|OPR|Chrome|Firefox|Safari)\/(\d+[\d.]*)/.exec(n)??void 0;i&&(t.browser={name:i[1],version:i[2]});let r=/\(([^)]+)\)/.exec(n);return r&&r[1]&&(t.os={name:l(r[1],64)}),typeof screen<"u"&&(t.device={screen:`${screen.width}x${screen.height}`}),Object.keys(t).length>0?t:void 0}flush(){return this.transport.flush()}};var G={en:["Report a bug","Loading\u2026"],ar:["\u0623\u0628\u0644\u063A \u0639\u0646 \u062E\u0637\u0623","\u062C\u0627\u0631\u064D \u0627\u0644\u062A\u062D\u0645\u064A\u0644\u2026"],de:["Fehler melden","Wird geladen\u2026"],es:["Reportar un error","Cargando\u2026"],fr:["Signaler un bug","Chargement\u2026"],it:["Segnala un bug","Caricamento\u2026"],ja:["\u4E0D\u5177\u5408\u3092\u5831\u544A","\u8AAD\u307F\u8FBC\u307F\u4E2D\u2026"],nl:["Bug melden","Laden\u2026"],pt:["Reportar erro","Carregando\u2026"],tr:["Hata bildir","Y\xFCkleniyor\u2026"],zh:["\u62A5\u544A\u95EE\u9898","\u52A0\u8F7D\u4E2D\u2026"]},qe="button{all:initial;position:fixed;z-index:2147483646;display:flex;align-items:center;gap:8px;padding:11px 18px;border-radius:99px;background:var(--c,linear-gradient(135deg,#3882F6,#2F5BEA));color:#fff;font:600 14px system-ui,-apple-system,sans-serif;letter-spacing:-.01em;cursor:pointer;box-shadow:0 14px 32px -12px rgba(56,130,246,.75),0 2px 6px rgba(11,26,58,.18),inset 0 1px 0 rgba(255,255,255,.22);transition:transform .2s,box-shadow .2s;animation:in .35s cubic-bezier(.2,.8,.2,1)}button:hover{transform:translateY(-2px);box-shadow:0 20px 40px -12px rgba(56,130,246,.85),0 3px 8px rgba(11,26,58,.2),inset 0 1px 0 rgba(255,255,255,.22)}button:active{transform:scale(.97)}button:focus-visible{outline:3px solid #00C2FF;outline-offset:3px}button:disabled{cursor:progress}svg,i{width:18px;height:18px}i{box-sizing:border-box;border:2px solid;border-right-color:transparent;border-radius:50%;animation:r .8s linear infinite}@keyframes r{to{transform:rotate(1turn)}}@keyframes in{from{opacity:0;transform:translateY(12px) scale(.94)}}.o span{display:none}.o{padding:13px}@media(max-width:480px){span{display:none}button{padding:13px}}@media(pointer:coarse){button{min-height:44px;box-sizing:border-box}}@media(prefers-reduced-motion:reduce){button{animation:none;transition:none}i{animation-duration:3s}}",He='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round" aria-hidden="true"><path d="M4 4h16v12H9l-5 4zM12 7v4M12 13.5v.5"/></svg>',me,V={},ge,S,Y=()=>{},_,fe=0;function O(e,t){e.options.debug&&console.log(`[blipit] ${t}`)}function Xe(e){me=e}function Ve(e,t){return V[t]??=new Promise((n,i)=>{let r=document.createElement("script");r.src=e,r.async=!0,r.onload=()=>{let o=window[t];o?n(o):i(new Error(t))},r.onerror=i,document.head.appendChild(r)}).catch(n=>{throw delete V[t],n}),V[t]}function he(){let e=(navigator.language??"en").slice(0,2);return G[e]?e:"en"}function be(e,t){let n=document.createElement("button");return n.type="button",n.className="blipit-rb",n.setAttribute("aria-haspopup","dialog"),e?n.textContent=e:(n.lang=he(),n.textContent=G[n.lang][0]),n.addEventListener("click",()=>n.hasAttribute("aria-busy")||t()),n}var ye=()=>{};function ve(e){ye=e}function J(e,t){ye(T(e.endpoint,"/api/v1/feedback"),e.options.key,t)}function K(e){if(typeof document>"u")return;let t=typeof e.options.feedbackWidget=="object"?e.options.feedbackWidget:{},n=document.querySelectorAll("button.blipit-rb"),i=r=>{Y(r),n.forEach(o=>r?o.setAttribute("aria-busy","true"):o.removeAttribute("aria-busy"))};i(!0),Promise.all([Ve(t.src??`${U}blipit-report.js`,"BlipitReport"),ge??=xe(e)]).then(([r,o])=>o.enabled!==!1&&r.open(e,{metadata:me,recording:o.recording===!0,recordingMaxMs:o.recording_max_ms,storageFull:o.storage_full===!0,reportsFull:o.reports_full===!0,theme:o.theme,hide:c=>S&&(S.style.display=c?"none":"")}),()=>J(e,{eventId:e.lastEventId,name:e.user?.username,email:e.user?.email})).finally(()=>i(!1))}async function xe(e){let t=`blipit_fb_${M}_${e.options.key}`;try{let n=JSON.parse(localStorage.getItem(t)??"null");if(n&&Date.now()-n.t<36e5)return n.s}catch{}try{let n=await fetch(T(e.endpoint,"/api/v1/feedback/settings"),{headers:{"X-Blipit-Key":e.options.key,...e.options.instance?{"X-Blipit-Instance":e.options.instance}:{}}});if(!n.ok)return O(e,`widget settings failed (HTTP ${n.status}), using defaults`),{};let i=await n.json();try{localStorage.setItem(t,JSON.stringify({t:Date.now(),s:i}))}catch{}return i}catch{return O(e,"widget settings unreachable (offline, ad blocker or CSP connect-src), using defaults"),{}}}async function Z(e){let t=e.options.feedbackWidget,n=++fe;if(typeof document>"u")return;if(t===!1)return O(e,"Report a bug button off: feedbackWidget is false");let i=await(ge??=xe(e));if(n!==fe)return;if(i.enabled===!1)return O(e,"Report a bug button hidden by the project's Bug report widget setting");let r={...i,...typeof t=="object"?t:{}},[o,c]=G[he()],d=r.text||o;S=document.createElement("div"),S.setAttribute("data-blipit-ui","");let a=S.attachShadow({mode:"open"}),s=document.createElement("button");s.type="button";let[p,h]=(/^(bottom|middle)-(left|right)$/.test(r.position??"")?r.position:"bottom-right").split("-");s.style.cssText=`${r.color?`--c:${r.color};`:""}${h}:calc(20px + env(safe-area-inset-${h},0px));${p==="bottom"?"bottom:calc(20px + env(safe-area-inset-bottom,0px))":"top:50%;margin-top:-22px"}`,s.setAttribute("aria-haspopup","dialog"),r.style==="icon"&&(s.className="o",s.title=d);let f=b=>{s.disabled=b,s.setAttribute("aria-label",b?c:d),s.innerHTML=b?"<i></i><span></span>":`${He}<span></span>`,s.lastChild.textContent=b?c:d};Y=f,f(!1),s.addEventListener("click",()=>K(e)),N(a,qe),a.append(s);let m=r.shortcut?.toLowerCase().replace(/\s/g,"");_&&document.removeEventListener("keydown",_),_=void 0,m&&(_=b=>{[b.ctrlKey&&"ctrl",b.shiftKey&&"shift",b.altKey&&"alt",b.metaKey&&"meta",b.key.toLowerCase()].filter(Boolean).join("+")===m&&(b.preventDefault(),K(e))},document.addEventListener("keydown",_));let E=S,R=()=>{S===E&&(document.body.append(E),O(e,`Report a bug button shown at ${p}-${h}`))};document.body?R():document.addEventListener("DOMContentLoaded",R)}function ke(e,t){let n=e.options.feedbackWidget;e.options.feedbackWidget=t===!1?!1:{...typeof n=="object"?n:{},...t},S?.remove(),S=void 0,_&&document.removeEventListener("keydown",_),_=void 0,Y=()=>{},Z(e)}function Q(e){return typeof e=="string"?e.length:e?.size}function we(e){return e&&Number(e)||void 0}function Ge(e,t){return async(n,i)=>{let r=typeof n=="string"?n:n instanceof URL?n.href:n.url,o=(i?.method??n.method??"GET").toUpperCase(),c=Date.now();try{let d=await e(n,i);return t(o,r,d.status,c,Q(i?.body),we(d.headers.get("content-length"))),d}catch(d){throw t(o,r,0,c,Q(i?.body)),d}}}function Ye(e,t){let n=e.open,i=e.send;e.open=function(r,o){return this._blipit=[String(r).toUpperCase(),String(o)],n.apply(this,arguments)},e.send=function(r){let o=this._blipit;if(o){let c=Date.now();this.addEventListener("loadend",()=>t(o[0],o[1],this.status,c,Q(r),we(this.getResponseHeader("content-length"))))}return i.apply(this,arguments)}}function Se(e){if(typeof window>"u")return;let t=T(e.endpoint,""),{console:n,network:i,actions:r}=e.logs;window.addEventListener("error",a=>{e.captureException(a.error??a.message,!1)}),window.addEventListener("unhandledrejection",a=>{e.captureException(a.reason,!1)}),typeof document<"u"&&(document.addEventListener("click",a=>{let s=a.target;if(!(s instanceof Element)||s.closest("[data-blipit-ui]"))return;let p=H(s);e.addBreadcrumb({category:"ui.click",message:`Clicked ${p}`});let h=s.closest(se)?"***":l((s.textContent??"").trim().replace(/\s+/g," "),80);w(r,{timestamp:v(),type:"click",selector:p,text:h},50)},{capture:!0,passive:!0}),document.addEventListener("focusin",a=>{let s=a.target;s instanceof Element&&/^(INPUT|TEXTAREA|SELECT)$/.test(s.tagName)&&w(r,{timestamp:v(),type:"focus",selector:H(s)},50)},{capture:!0,passive:!0}));let o=(a,s,p,h,f,m)=>{t&&s.startsWith(t)||(e.addBreadcrumb({category:"http",message:`${a} ${C(s)} \u2192 ${p||"network error"}`,level:p>=400||!p?"error":"info",data:{url:C(s),method:a,status_code:p||void 0}}),w(i,{timestamp:v(),method:a,url:q(s),status:p,duration:Date.now()-h,request_size:f,response_size:m},50))};typeof window.fetch=="function"&&(window.fetch=Ge(window.fetch.bind(window),o)),typeof XMLHttpRequest<"u"&&Ye(XMLHttpRequest.prototype,o);for(let a of["log","info","debug","warn","error"]){let s=console[a].bind(console);console[a]=(...p)=>{let h=l(p.map(f=>typeof f=="string"?f:Je(f)).join(" "),1024);if(a==="warn"||a==="error"){e.addBreadcrumb({category:"console",level:a==="warn"?"warning":"error",message:h});let f=p.find(m=>m instanceof Error);w(n,{timestamp:v(),level:a,message:h,stack:l((f??new Error).stack??"",2e3)},100)}else w(n,{timestamp:v(),level:a,message:h},100);s(...p)}}let c=()=>w(r,{timestamp:v(),type:"navigation",url:q(location.href)},50),d=()=>{e.addBreadcrumb({category:"navigation",message:`Navigated to ${C(location.href)}`}),c()};if(c(),window.history){let a=window.history.pushState.bind(window.history);window.history.pushState=(...s)=>{a(...s),d()},window.addEventListener("popstate",d)}}function Je(e){try{return JSON.stringify(e)??String(e)}catch{return String(e)}}function Ee(){let e=0,t=0,n=0,i=0;return r=>(r.hadRecentInput||(t>0&&r.startTime-i<1e3&&r.startTime-n<5e3?t+=r.value:(t=r.value,n=r.startTime),i=r.startTime,t>e&&(e=t)),e)}function Ze(e){if(e.size===0)return;let t=[...e.values()].sort((n,i)=>i-n);return t[Math.min(t.length-1,Math.floor(e.size/50))]}function Qe(e){return/iPad|Tablet|Android(?!.*Mobile)/i.test(e)?"tablet":/Mobi|iPhone|Android/i.test(e)?"mobile":"desktop"}function I(e,t,n){try{new PerformanceObserver(i=>i.getEntries().forEach(r=>t(r))).observe({type:e,buffered:!0,...n})}catch{}}function Re(e,t,n){if(typeof PerformanceObserver>"u"||typeof document>"u")return;let i=performance.getEntriesByType("navigation")[0],r=i?.activationStart??0,o=y=>Math.max(0,Math.round(y-r)),c=document.visibilityState==="hidden",d=location.pathname,a=i?.type,s={},p=Ee(),h=new Map,f=!1,m=!1;i&&i.responseStart>0&&(s.ttfb=o(i.responseStart)),c||(I("paint",y=>{y.name==="first-contentful-paint"&&(s.fcp=o(y.startTime))}),I("largest-contentful-paint",y=>{f||(s.lcp=o(y.startTime))}));let E=()=>{f=!0};addEventListener("keydown",E,{once:!0,capture:!0}),addEventListener("pointerdown",E,{once:!0,capture:!0}),I("layout-shift",y=>{s.cls=Math.round(p(y)*1e4)/1e4});let R=y=>{if(!y.interactionId)return;h.set(y.interactionId,Math.max(h.get(y.interactionId)??0,y.duration));let ee=Ze(h);ee!==void 0&&(s.inp=Math.round(ee))};I("event",R,{durationThreshold:40}),I("first-input",R);let b=navigator.connection?.effectiveType,$=`${new URL("/api/v1/vitals",e).href}?key=${encodeURIComponent(t)}${n?`&instance=${encodeURIComponent(n)}`:""}`,k=()=>{if(m||Object.keys(s).length===0)return;m=!0;let y=JSON.stringify({path:d.slice(0,512),metrics:s,nav:a,connection:b&&/^(slow-2g|2g|3g|4g)$/.test(b)?b:void 0,device:Qe(navigator.userAgent)});try{if(navigator.sendBeacon?.($,y))return}catch{}fetch($,{method:"POST",body:y,keepalive:!0}).catch(()=>{})},B=()=>{location.pathname!==d&&(k(),d=location.pathname,a="route",s={},p=Ee(),h=new Map,f=!0,m=!1)};document.addEventListener("visibilitychange",()=>document.visibilityState==="hidden"&&k()),addEventListener("pagehide",k),addEventListener("popstate",B);let A=history.pushState;history.pushState=function(...y){A.apply(this,y),B()}}function et(e,t=Math.random){return t()<(e.sessionSampleRate??0)?"session":t()<(e.onErrorSampleRate??1)?"buffer":null}function $e(e,t,n,i,r){let o=et(e);if(!o||typeof document>"u")return;let c=L(),d,a=document.createElement("script");return a.src=e.src??`${r}blipit-replay.js`,a.async=!0,a.onload=()=>{let s=window.BlipitReplay?.start;d=s?.({id:c,mode:o,endpoint:t,key:n,instance:i})},document.head.appendChild(a),{id:c,active:()=>d?.active()??!1,error:s=>d?.error(s),report:s=>d?.report?.(s)}}var Be='<svg viewBox="0 0 242.4 208.7" aria-hidden="true"><defs><linearGradient id="bm1" x1="0" y1="1" x2=".5" y2="0"><stop offset="0" stop-color="#00C2FF"/><stop offset=".35" stop-color="#3882F6"/><stop offset="1" stop-color="#0F172A"/></linearGradient><linearGradient id="bm2" x1="0" y1="1" x2="1" y2="0"><stop offset="0" stop-color="#3882F6"/><stop offset=".5" stop-color="#00C2FF"/><stop offset="1" stop-color="#3882F6"/></linearGradient></defs><path fill="url(#bm1)" d="M115.5,164.5c-3.9,0-7.8-.4-11.5-1.2-3.7-.8-7.3-1.9-10.8-3.4-3.4-1.4-6.7-3.2-9.7-5.3-3.0-2.0-5.9-4.4-8.5-7.0s-4.9-5.4-7.0-8.5c-2.1-3.1-3.9-6.3-5.3-9.8-1.5-3.5-2.6-7.1-3.4-10.8-.8-3.8-1.2-7.7-1.2-11.5V19.1c0-6.6,5.4-12.0,12.0-12.0s12.0,5.4,12.0,12.0v88.2c0,2.2.2,4.5.7,6.7.4,2.1,1.1,4.2,1.9,6.2.8,2.0,1.9,3.9,3.1,5.7,1.2,1.8,2.6,3.4,4.1,4.9s3.2,2.9,4.9,4.1c1.8,1.2,3.7,2.2,5.6,3.1,2.0.8,4.1,1.5,6.2,1.9,4.4.9,9.1.9,13.4,0,2.1-.4,4.2-1.1,6.2-1.9,2.0-.8,3.9-1.9,5.7-3.1,1.8-1.2,3.4-2.6,4.9-4.1s2.9-3.2,4.1-4.9c1.2-1.8,2.2-3.7,3.1-5.7.8-2.0,1.5-4.1,1.9-6.2.5-2.2.7-4.5.7-6.7s-.2-4.5-.7-6.7c-.4-2.1-1.1-4.2-1.9-6.2-.8-2.0-1.9-3.9-3.1-5.7-1.2-1.8-2.6-3.4-4.1-4.9s-3.2-2.9-4.9-4.1c-1.8-1.2-3.7-2.2-5.7-3.1-2.0-.8-4.1-1.5-6.2-1.9-4.4-.9-9.1-.9-13.4,0-6.5,1.3-12.9-2.9-14.2-9.4-1.3-6.5,2.9-12.9,9.4-14.2,7.6-1.6,15.5-1.6,23.1,0,3.7.8,7.3,1.9,10.8,3.4,3.4,1.4,6.7,3.2,9.7,5.3,3.0,2.0,5.9,4.4,8.5,7.0s4.9,5.4,7.0,8.5c2.1,3.1,3.9,6.3,5.3,9.8,1.5,3.5,2.6,7.1,3.4,10.8.8,3.8,1.2,7.7,1.2,11.5s-.4,7.8-1.2,11.5c-.8,3.7-1.9,7.3-3.4,10.8-1.4,3.4-3.2,6.7-5.3,9.7-2.0,3.0-4.4,5.9-7.0,8.5s-5.4,4.9-8.5,7.0c-3.1,2.1-6.3,3.9-9.8,5.3-3.5,1.5-7.1,2.6-10.8,3.4-3.8.8-7.7,1.2-11.5,1.2Z"/><path fill="url(#bm2)" d="M208.1,103.0c-.0-.6-.8-.9-1.2-.5-3.2,3.1-7.6,5.0-12.4,5.0-3.9,0-9.1-1.6-10.2-2.5-.3-.1-.1,1.4-.1,2.5,0,40.5-34.4,73.0-75.5,70.0-33.4-2.5-60.8-28.8-64.4-62.1-1.0-9.4-.2-18.6,2.2-27.0,1.6-5.6,2.6-11.4,2.6-17.3v-22.4c0-3.4-4.3-5.0-6.5-2.4-13.2,15.4-21.6,35.1-22.7,56.6-2.6,54.1,40.6,98.9,94.1,98.9s94.2-42.3,94.2-94.2c0-1.5-.1-3.0-.1-4.5Z"/><path fill="url(#bm2)" d="M201.2,70.1c-14.8-35.8-50.9-60.5-92.3-58.3h-.1c-8.2.5-14.6,7.4-14.6,15.7v.1c0,5.4,4.7,9.6,10.0,8.8,3.2-.5,6.5-.7,9.9-.7,28.7,0,53.5,17.4,64.3,42.1.2.5.9.6,1.2.1,3.2-4.8,8.7-7.9,14.9-7.9,2.0,0,4.0.3,5.8,1.0.6.2,1.1-.4.9-1.0Z"/><circle fill="#00C2FF" cx="194.5" cy="88" r="15.8"/></svg>';var u=".blipit-rb.blipit-rb",tt=`${u}{all:unset;box-sizing:border-box;display:inline-flex;align-items:center;gap:9px;height:40px;padding-inline:5px 17px;border-radius:99px;font:600 14px/1 system-ui,-apple-system,"Segoe UI",sans-serif;letter-spacing:-.01em;white-space:nowrap;cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent;color:#fff;background:linear-gradient(135deg,#3882F6,#2F5BEA);box-shadow:0 10px 24px -12px rgba(56,130,246,.8),0 1px 3px rgba(11,26,58,.16),inset 0 1px 0 rgba(255,255,255,.22);transition:transform .2s,box-shadow .2s}${u}:hover{transform:translateY(-1px);box-shadow:0 16px 32px -12px rgba(56,130,246,.85),0 2px 6px rgba(11,26,58,.18),inset 0 1px 0 rgba(255,255,255,.22)}${u}:active{transform:scale(.97)}${u}:focus-visible{outline:3px solid #00C2FF;outline-offset:3px}${u}[aria-busy=true]{cursor:progress}${u}>span{all:unset}${u}>.blipit-rb-m{position:relative;display:grid;place-items:center;flex:none;width:30px;height:30px;border-radius:99px;background:#fff;box-shadow:0 0 0 1px rgba(11,26,58,.08),0 1px 2px rgba(11,26,58,.12)}${u} svg{display:block;width:19px;height:17px}${u}[data-size=sm]{height:32px;gap:7px;padding-inline:4px 13px;font-size:13px}${u}[data-size=sm]>.blipit-rb-m{width:24px;height:24px}${u}[data-size=sm] svg{width:15px;height:13px}${u}[data-variant=outline],${u}[data-variant=ghost]{color:#0B1A3A;background:transparent;box-shadow:inset 0 0 0 1px #CBD7EA}${u}[data-variant=ghost]{box-shadow:none}${u}[data-variant=outline]:hover,${u}[data-variant=ghost]:hover{transform:none;background:rgba(56,130,246,.08);box-shadow:inset 0 0 0 1px rgba(56,130,246,.45)}${u}[data-variant=ghost]:hover{box-shadow:none}${u}[data-theme=dark]{background:linear-gradient(135deg,#5B9BFF,#3D6BF0);box-shadow:0 10px 24px -12px rgba(91,155,255,.7),inset 0 1px 0 rgba(255,255,255,.2)}${u}[data-theme=dark][data-variant=outline],${u}[data-theme=dark][data-variant=ghost]{color:#E8EEF8;background:transparent;box-shadow:inset 0 0 0 1px rgba(255,255,255,.16)}${u}[data-theme=dark][data-variant=ghost]{box-shadow:none}${u}[data-theme=dark][data-variant=outline]:hover,${u}[data-theme=dark][data-variant=ghost]:hover{background:rgba(91,155,255,.16);box-shadow:inset 0 0 0 1px rgba(91,155,255,.45)}${u}[data-theme=dark][data-variant=ghost]:hover{box-shadow:none}${u}[data-theme=dark]>.blipit-rb-m{box-shadow:0 0 0 1px rgba(255,255,255,.1)}${u}[aria-busy=true] svg{visibility:hidden}${u}[aria-busy=true]>.blipit-rb-m::after{content:"";position:absolute;inset:4px;border:2px solid #3882F6;border-right-color:transparent;border-radius:50%;animation:blipit-rb-r .8s linear infinite}@keyframes blipit-rb-r{to{transform:rotate(1turn)}}@media(pointer:coarse){${u}{min-height:44px}}@media(prefers-reduced-motion:reduce){${u}{transition:none}${u}:hover,${u}:active{transform:none}${u}[aria-busy=true]>.blipit-rb-m::after{animation-duration:3s}}@media(forced-colors:active){${u}{border:1px solid ButtonText}}`,Te=0;function _e(e,t={}){Te||N(document,tt);let n=++Te,i=document.createElement("span");i.className="blipit-rb-m",i.innerHTML=Be.replace(/bm(\d)/g,`bm$1-${n}`);let r=document.createElement("span");r.textContent=e.textContent,e.replaceChildren(i,r),e.classList.add("blipit-rb"),e.setAttribute("data-variant",t.variant==="outline"||t.variant==="ghost"?t.variant:"solid"),e.setAttribute("data-size",t.size==="sm"?"sm":"md"),e.setAttribute("data-theme",de(t.theme==="light"||t.theme==="dark"?t.theme:void 0))}var g,Ce=new Set;function Le(e,t){Ce.has(t)||(Ce.add(t),console[e](t))}var nt="[blipit] init() has no key, so error tracking and the Report a bug button are off. Pass your public key (blipit_pk_...) from app.blipit.io, API keys.",it="[blipit] init() got a secret key (blipit_sk_...), so Blipit did not start: secret keys must never be in browser code. Use the public key (blipit_pk_...) and create a new secret key in app.blipit.io, API keys.";function Dt(e){if(g)return;let t=typeof e?.key=="string"?e.key.trim():"";if(!t)return Le("warn",nt);if(t.startsWith("blipit_sk_"))return Le("error",it);if(g=new P({...e,key:t}),e.user){let{id:n,name:i,email:r,username:o}=e.user;g.setUser({id:n===void 0?void 0:String(n),email:r,username:o??i})}Se(g),e.webVitals!==!1&&typeof window<"u"&&Re(e.endpoint??z,t,e.instance),e.replay&&(g.replay=$e(e.replay,e.endpoint??z,t,e.instance,U)),typeof window<"u"&&Z(g),e.debug&&console.log(`[blipit] ${X}@${M} initialized`)}function Pt(e){return g?.captureException(e,!0)}function Ut(e,t){return g?.captureMessage(e,t)}function zt(e){return g?.captureSecurity(e)}function Kt(e){g?.setUser(e)}function jt(e,t){g?.setTag(e,t)}function Wt(e){g?.addBreadcrumb(e)}function qt(e={}){g&&J(g,{...e,eventId:e.eventId??g.lastEventId})}function Me(){g&&K(g)}function Ht(e){e.addEventListener("click",t=>{t.preventDefault(),Me()})}function Xt(e={}){let t=be(e.label,Me);return _e(t,e),t}function Vt(e){g&&ke(g,e)}function Gt(){return g?.flush()??Promise.resolve()}ve(ie);export{Wt as addBreadcrumb,Ht as attachReport,Pt as captureException,Ut as captureMessage,zt as captureSecurity,Gt as flush,Dt as init,Me as openReport,Xt as reportButton,Xe as setReportMetadata,jt as setTag,Kt as setUser,qt as showFeedback,Vt as updateWidget};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blipit/browser",
3
- "version": "0.3.8",
3
+ "version": "0.3.10",
4
4
  "description": "Blipit error monitoring SDK for browsers. Know your app broke before your users tell you.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -47,8 +47,8 @@
47
47
  "logging"
48
48
  ],
49
49
  "scripts": {
50
- "build": "tsup --entry.index src/npm.ts --format esm,cjs --dts --minify --clean && tsup --entry.index src/global.ts --format iife --global-name Blipit --minify --no-dts && tsup src/replay.ts --format iife --global-name BlipitReplay --minify --no-dts --out-dir served --clean && tsup src/report.ts --format iife --global-name BlipitReport --minify --no-dts --out-dir served && tsup src/button.ts --format iife --global-name BlipitButton --minify --no-dts --out-dir served && tsup src/feedback.ts --format iife --global-name BlipitFeedback --minify --no-dts --out-dir served && node scripts/serve-files.mjs",
50
+ "build": "tsup --entry.index src/npm.ts --format esm,cjs --dts --minify --clean && tsup --entry.index src/global.ts --format iife --global-name Blipit --minify --no-dts && tsup src/replay.ts --format iife --global-name BlipitReplay --minify --no-dts --out-dir served --clean && tsup src/report.ts --format iife --global-name BlipitReport --minify --no-dts --out-dir served && tsup src/button.ts --format iife --global-name BlipitButton --minify --no-dts --out-dir served && tsup src/feedback.ts --format iife --global-name BlipitFeedback --minify --no-dts --out-dir served && tsup src/voice.ts --format iife --global-name BlipitVoice --minify --no-dts --out-dir served && node scripts/serve-files.mjs",
51
51
  "typecheck": "tsc -p tsconfig.json --noEmit",
52
- "size": "gzip -c dist/index.global.js | wc -c && gzip -c served/replay.global.js | wc -c && gzip -c served/report.global.js | wc -c && gzip -c served/button.global.js | wc -c && gzip -c served/feedback.global.js | wc -c"
52
+ "size": "gzip -c dist/index.global.js | wc -c && gzip -c served/replay.global.js | wc -c && gzip -c served/report.global.js | wc -c && gzip -c served/button.global.js | wc -c && gzip -c served/feedback.global.js | wc -c && gzip -c served/voice.global.js | wc -c"
53
53
  }
54
54
  }