blocfeed 0.8.0 → 0.9.0
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 +34 -0
- package/README.md +27 -0
- package/dist/chunk-EFTA67IW.cjs +2 -0
- package/dist/chunk-QL6DSCNT.js +2 -0
- package/dist/{controller-BnTq9F8J.d.cts → controller-C6M-ge3K.d.cts} +15 -1
- package/dist/{controller-BnTq9F8J.d.ts → controller-C6M-ge3K.d.ts} +15 -1
- package/dist/engine.cjs +1 -1
- package/dist/engine.d.cts +6 -3
- package/dist/engine.d.ts +6 -3
- package/dist/engine.js +1 -1
- package/dist/main.cjs +69 -4
- package/dist/main.d.cts +2 -2
- package/dist/main.d.ts +2 -2
- package/dist/main.js +69 -4
- package/package.json +1 -1
- package/dist/chunk-KJRV7PRA.js +0 -2
- package/dist/chunk-ORVW2RTZ.cjs +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.9.0 — 2026-02-25
|
|
4
|
+
|
|
5
|
+
### New features
|
|
6
|
+
|
|
7
|
+
- **Click tracking during video recording** — Every user click between recording start and stop is automatically captured and included with the feedback. Each click event records:
|
|
8
|
+
- **Timestamp** (ms offset from recording start, synced to video timeline)
|
|
9
|
+
- **Page path** (`window.location.pathname`)
|
|
10
|
+
- **Element tag** (e.g. `<button>`, `<a>`, `<div>`)
|
|
11
|
+
- **Text snippet** (truncated text content of the clicked element)
|
|
12
|
+
- **Component name** (React component name via `data-blocfeed-component` or React fiber introspection)
|
|
13
|
+
- No configuration needed — click tracking is automatic when `recording.enabled` is `true`.
|
|
14
|
+
|
|
15
|
+
### Improvements
|
|
16
|
+
|
|
17
|
+
- New types exported: `ClickEvent`.
|
|
18
|
+
- Engine exports: `drainClickEvents`, `clearClickEvents` for headless usage.
|
|
19
|
+
- `FeedbackPayload` extended with optional `click_events` field.
|
|
20
|
+
|
|
21
|
+
### Platform changes (blocfeed-frontend)
|
|
22
|
+
|
|
23
|
+
- New SQL migration `scripts/034_click_events.sql` adds `meta_click_events` JSONB column.
|
|
24
|
+
- `POST /api/feedback` now extracts and persists click events from `metadata._clickEvents`.
|
|
25
|
+
- Dashboard Video tab shows a **click timeline** below the video player. Each entry displays the timestamp, element tag, component name, text snippet, and page path. Clicking a timeline entry **seeks the video** to that moment.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 0.8.1 — 2026-02-24
|
|
30
|
+
|
|
31
|
+
### Bug fixes
|
|
32
|
+
|
|
33
|
+
- **Recording flow: widget no longer closes when clicking the page** — During video recording, the overlay and backdrop are removed so users can freely interact with the page to demonstrate bugs. The full panel collapses into a compact floating recording bar (pulsing dot + timer + stop button) positioned at the widget corner. When recording stops, the panel re-opens with the video preview attached.
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
3
37
|
## 0.8.0 — 2026-02-24
|
|
4
38
|
|
|
5
39
|
### New features
|
package/README.md
CHANGED
|
@@ -16,6 +16,7 @@ Drop-in in-app feedback widget for **Next.js** and **React**:
|
|
|
16
16
|
- **Conditional display** — show/hide widget by route pattern or custom predicate
|
|
17
17
|
- **Programmatic API** — `ref.open()`, `ref.close()`, `ref.submit(msg)` via React ref
|
|
18
18
|
- **Video recording** — record a short screen capture clip (via `getDisplayMedia`) to show bug reproduction steps
|
|
19
|
+
- **Click tracking** — automatically captures every click during video recording with page path, component name, element tag, and text
|
|
19
20
|
- **Secret leak detection** — scans client-side code for exposed API keys, database credentials, and tokens
|
|
20
21
|
|
|
21
22
|
Docs live in `docs/` (start at `docs/index.md`). Architecture pointers are in `ARCHITECTURE.md`.
|
|
@@ -739,6 +740,31 @@ strings: {
|
|
|
739
740
|
}
|
|
740
741
|
```
|
|
741
742
|
|
|
743
|
+
### Click tracking during recording
|
|
744
|
+
|
|
745
|
+
When video recording is active, BlocFeed automatically captures every user click on the page. Each click event records:
|
|
746
|
+
|
|
747
|
+
| Field | Description |
|
|
748
|
+
|-------|-------------|
|
|
749
|
+
| `timestampMs` | Milliseconds from recording start (synced to video timeline) |
|
|
750
|
+
| `path` | `window.location.pathname` at the time of click |
|
|
751
|
+
| `tagName` | HTML tag of the clicked element (e.g. `button`, `a`) |
|
|
752
|
+
| `textSnippet` | Truncated text content of the clicked element |
|
|
753
|
+
| `componentName` | React component name (via `data-blocfeed-component` or fiber introspection) |
|
|
754
|
+
|
|
755
|
+
Click events are included in the payload as `metadata._clickEvents` and displayed as a **click timeline** in the dashboard Video tab. Clicking a timeline entry seeks the video to that moment.
|
|
756
|
+
|
|
757
|
+
No extra configuration is needed — click tracking is automatic when `recording.enabled` is `true`. Up to 200 click events are captured per recording session. Clicks on the BlocFeed widget itself are excluded.
|
|
758
|
+
|
|
759
|
+
#### Headless click tracking
|
|
760
|
+
|
|
761
|
+
```ts
|
|
762
|
+
import { drainClickEvents, clearClickEvents } from "blocfeed/engine";
|
|
763
|
+
|
|
764
|
+
const events = drainClickEvents(); // returns ClickEvent[]
|
|
765
|
+
clearClickEvents(); // reset the buffer
|
|
766
|
+
```
|
|
767
|
+
|
|
742
768
|
### Known limitations
|
|
743
769
|
|
|
744
770
|
The default screenshot engine (`html-to-image`) has known issues with:
|
|
@@ -855,6 +881,7 @@ import type {
|
|
|
855
881
|
SecurityConfig,
|
|
856
882
|
SecurityFinding,
|
|
857
883
|
SecuritySnapshot,
|
|
884
|
+
ClickEvent,
|
|
858
885
|
// ... and more
|
|
859
886
|
} from "blocfeed";
|
|
860
887
|
```
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';function b(){return typeof window<"u"&&typeof document<"u"}function ke(e){let t=globalThis.CSS;return typeof t?.escape=="function"?t.escape(e):e.replace(/[^a-zA-Z0-9_-]/g,n=>{let r=n.codePointAt(0);return r===void 0?"":`\\${r.toString(16)} `})}function re(e){return {x:e.x,y:e.y,width:e.width,height:e.height}}function Ge(e){return {x:e.x+window.scrollX,y:e.y+window.scrollY,width:e.width,height:e.height}}function Je(e){return e.replace(/\s+/g," ").trim()}function oe(e,t=140){let n=e.textContent;if(!n)return;let r=Je(n);if(r)return r.length<=t?r:`${r.slice(0,t-1)}\u2026`}function et(e){let t=1;for(let n=e.previousElementSibling;n;n=n.previousElementSibling)n.tagName===e.tagName&&(t+=1);return t}var Re=["data-testid","data-test-id","data-test","data-qa","data-cy"],Se="data-blocfeed-component";function ie(e){let t=e.closest(`[${Se}]`);if(!t)return;let r=t.getAttribute(Se)?.trim();return r||void 0}function tt(e){for(let t of Re){let n=e.closest(`[${t}]`);if(!n)continue;let o=n.getAttribute(t)?.trim();if(o)return o}}function ve(e){try{let t=e,n=Object.getOwnPropertyNames(t);for(let r of n)if(r.startsWith("__reactFiber$")||r.startsWith("__reactInternalInstance$")){let o=t[r];if(o&&typeof o=="object")return o}}catch{}return null}function B(e){if(e.length<=1||e.length===2&&e[0]===e[0].toLowerCase())return true;let t=e[0];return t>="a"&&t<="z"}function q(e){if(e){for(let t of e)if(typeof t.name=="string"&&t.name&&!B(t.name))return t.name}}function A(e){if(e&&typeof e!="string"){if(typeof e=="function"){let t=e;return typeof t.displayName=="string"&&t.displayName?t.displayName:typeof t.name=="string"&&t.name?t.name:void 0}if(typeof e=="object"){let t=e,n=t.displayName;if(typeof n=="string"&&n)return n;let r=t.render;if(typeof r=="function"){let i=r;if(typeof i.displayName=="string"&&i.displayName)return i.displayName;if(typeof i.name=="string"&&i.name)return i.name}let o=t.type;return A(o)}}}function ae(e){let t=ve(e);if(!t)return;let n=q(t._debugInfo);if(n)return n;let r=t._debugOwner!==void 0;if(r){let s=t._debugOwner;for(let c=0;s&&c<50;c+=1){let h=q(s._debugInfo);if(h)return h;let p=A(s.type)??A(s.elementType);if(p&&!B(p))return p;s=s._debugOwner;}}if(t._owner!==void 0&&t._owner!==t._debugOwner){let s=t._owner;for(let c=0;s&&c<50;c+=1){let h=q(s._debugInfo);if(h)return h;let p=A(s.type)??A(s.elementType);if(p&&!B(p))return p;s=s._owner;}}let i=t,l=r?80:25;for(let s=0;i&&s<l;s+=1){let c=q(i._debugInfo);if(c)return c;let h=A(i.type)??A(i.elementType);if(h&&!B(h))return h;i=i.return;}let a=e.parentElement;for(let s=0;a&&s<15;s+=1){let c=ve(a);if(c){let h=q(c._debugInfo);if(h)return h;let p=A(c.type)??A(c.elementType);if(p&&!B(p))return p;if(c._debugOwner){let m=A(c._debugOwner.type)??A(c._debugOwner.elementType);if(m&&!B(m))return m}if(c._owner&&c._owner!==c._debugOwner){let m=A(c._owner.type)??A(c._owner.elementType);if(m&&!B(m))return m}}a=a.parentElement;}}function nt(e){let t=e.tagName.toLowerCase(),n=e.getAttribute("id");if(n)return `#${ke(n)}`;for(let r of Re){let o=e.getAttribute(r);if(o)return `${t}[${r}="${ke(o)}"]`}return `${t}:nth-of-type(${et(e)})`}function rt(e,t=10){let n=[],r=e;for(;r&&n.length<t;){let o=nt(r);if(n.unshift(o),o.startsWith("#"))break;r=r.parentElement;}return n.join(" > ")}function _e(e,t){if(!t||t.length===0)return false;for(let n of t)if(e.closest(n))return true;return false}function se(e,t){if(!e||_e(e,t.ignoreSelectors))return null;let n=e;for(;n;){if(_e(n,t.ignoreSelectors))return null;if(t.isSelectable?.(n)??ot(n))return n;n=n.parentElement;}return null}function ot(e){let t=e.tagName;return !(t==="HTML"||t==="BODY")}function Ae(e){let t=e.getBoundingClientRect(),n={selector:rt(e),tagName:e.tagName.toLowerCase(),rect:re(t),pageRect:Ge(t)},r=e.getAttribute("id");r&&(n.id=r);let o=e.className;typeof o=="string"&&o.trim()&&(n.className=o);let i=oe(e);i&&(n.textSnippet=i);let l=ie(e)??ae(e);l&&(n.componentName=l);let a=tt(e);return a&&(n.testId=a),n}var ce=null;async function Te(){return ce||(ce=import('html-to-image')),ce}async function it(e){return await new Promise((t,n)=>{let r=new Image;r.onload=()=>t({width:r.naturalWidth,height:r.naturalHeight}),r.onerror=()=>n(new Error("Failed to load generated screenshot")),r.src=e;})}async function xe(e,t){let{width:n,height:r}=await it(e);return {dataUrl:e,mime:t,width:n,height:r}}function O(e){if(e?.aborted)throw new Error("Aborted")}function Pe(){return {async captureElement(e,t){if(!b())throw new Error("captureElement can only run in the browser");O(t.signal);let n=await Te();O(t.signal);let r=t.mime==="image/jpeg"?await n.toJpeg(e,{quality:t.quality??.92,pixelRatio:t.pixelRatio}):await n.toPng(e,{pixelRatio:t.pixelRatio});return O(t.signal),await xe(r,t.mime)},async captureFullPage(e){if(!b())throw new Error("captureFullPage can only run in the browser");O(e.signal);let t=document.documentElement,n=Math.max(t.scrollWidth,t.clientWidth),r=Math.max(t.scrollHeight,t.clientHeight),o=Math.min(1,e.maxDimension/Math.max(n,r)),i=Math.max(1,Math.round(n*o)),l=Math.max(1,Math.round(r*o)),a=await Te();O(e.signal);let s=e.mime==="image/jpeg"?await a.toJpeg(t,{width:i,height:l,quality:e.quality??.92,pixelRatio:e.pixelRatio}):await a.toPng(t,{width:i,height:l,pixelRatio:e.pixelRatio});return O(e.signal),await xe(s,e.mime)}}}function at(e){if(e instanceof Error)return e.message;if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return "Unknown error"}}function w(e,t,n){let r={kind:e,message:at(t)};return n&&(r.detail=n),r}var st=12e3,ct=2048,lt=.92;function Ce(){return Date.now()}function ut(e){return new Promise((t,n)=>{let r=()=>n(new Error("Aborted"));if(e.aborted){r();return}e.addEventListener("abort",r,{once:true});})}async function Fe(e,t,n){let r=new Promise((i,l)=>{let a=setTimeout(()=>l(new Error("Timeout")),t);typeof a.unref=="function"&&a.unref();}),o=[e,r];return n&&o.push(ut(n)),await Promise.race(o)}function dt(e){if(!b())return 1;let t=window.devicePixelRatio||1,n=e?.pixelRatio??Math.min(t,2);return Math.max(.1,n)}function ft(e){return !!(e?.element||e?.fullPage)}function Me(e){let t={mime:e.mime,pixelRatio:e.pixelRatio,maxDimension:e.maxDimension};return e.includeQuality&&(t.quality=e.quality),e.signal&&(t.signal=e.signal),t}async function Le(e){let{selectionElement:t,capture:n,signal:r}=e;if(!b()||!ft(n))return;let o=Ce(),i=[],l=n?.timeoutMs??st,a=n?.maxDimension??ct,s=n?.mime??"image/png",c=n?.quality??lt,h=n?.adapter??Pe(),p={},m=dt(n);if(n?.element&&t)try{let f=t.getBoundingClientRect(),g=Math.min(1,a/Math.max(f.width,f.height)),S=Math.min(m,m*g),_=await Fe(Promise.resolve(h.captureElement(t,{...Me({mime:s,quality:c,pixelRatio:S,maxDimension:a,includeQuality:s==="image/jpeg",...r?{signal:r}:{}})})),l,r);p.element=_;}catch(f){if(r?.aborted)throw f;i.push(w("capture_failed",f,{target:"element"}));}if(n?.fullPage)try{let f=await Fe(Promise.resolve(h.captureFullPage(Me({mime:s,quality:c,pixelRatio:m,maxDimension:a,includeQuality:s==="image/jpeg",...r?{signal:r}:{}}))),l,r);p.fullPage=f;}catch(f){if(r?.aborted)throw f;i.push(w("capture_failed",f,{target:"fullPage"}));}let y=Ce(),u={startedAt:o,finishedAt:y,durationMs:Math.max(0,y-o)};return i.length>0&&(u.errors=i),{...p,diagnostics:u}}function mt(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function pt(){return b()?{url:window.location.href,title:document.title,referrer:document.referrer||void 0,userAgent:navigator.userAgent,language:navigator.language,platform:navigator.platform,viewport:{width:window.innerWidth,height:window.innerHeight},screen:{width:window.screen.width,height:window.screen.height},scroll:{x:window.scrollX,y:window.scrollY},devicePixelRatio:window.devicePixelRatio||1,timezone:mt()}:{}}function gt(e){if(!e)return {};let t={};return e.id&&(t.userId=e.id),e.email&&(t.userEmail=e.email),e.name&&(t.userName=e.name),t}async function De(e){let{config:t,context:n,user:r}=e;if(t?.enabled===false)return {};let o={...pt(),...gt(r)},i=t?.enrich;if(!i)return o;try{let l=await i(n);return {...o,...l}}catch(l){let a=w("unknown",l);return {...o,blocfeedMetadataError:a.message}}}var le="blocfeed-queue",ht=50;function ue(){if(!b())return [];try{let e=localStorage.getItem(le);if(!e)return [];let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return []}}function de(e){if(b())try{e.length===0?localStorage.removeItem(le):localStorage.setItem(le,JSON.stringify(e));}catch{}}function wt(e){let t={...e};if(t.screenshots){let n={...t.screenshots};n.element&&(n.element={...n.element,dataUrl:""}),n.fullPage&&(n.fullPage={...n.fullPage,dataUrl:""}),t.screenshots=n;}return delete t.video,t}function fe(e){let t=ue(),n=wt(e);for(n.metadata={...n.metadata,_queued:true},t.push({payload:n,timestamp:Date.now()});t.length>ht;)t.shift();de(t);}function Be(){let e=ue();return e.length===0?[]:(de([]),e.map(t=>t.payload))}function ln(){de([]);}function un(){return ue().length}var bt=200,z=[],Ie=0,Q=false;function Ne(e){let t=e.target;if(!(t instanceof Element)||t.closest("[data-blocfeed-ui]"))return;let n={timestampMs:Date.now()-Ie,path:window.location.pathname,tagName:t.tagName.toLowerCase()},r=oe(t,100);r&&(n.textSnippet=r);let o=ie(t)??ae(t);o&&(n.componentName=o),z.length<bt&&z.push(n);}function Oe(){Q||!b()||(Q=true,z=[],Ie=Date.now(),document.addEventListener("click",Ne,{capture:true,passive:true}));}function Ue(){Q&&(Q=false,document.removeEventListener("click",Ne,{capture:true}));}function yt(){return [...z]}function Et(){z=[];}var kt=3e4,St=25e5,He="video/webm",vt=250,_t=1e3,Rt=["video/webm;codecs=vp9","video/webm;codecs=vp8","video/webm"];function qe(){if(typeof MediaRecorder>"u")return null;for(let e of Rt)if(MediaRecorder.isTypeSupported(e))return e;return null}function At(){return !b()||typeof navigator?.mediaDevices?.getDisplayMedia!="function"?false:qe()!==null}async function me(e){let{config:t,signal:n}=e;if(!b()||typeof navigator?.mediaDevices?.getDisplayMedia!="function")throw w("recording_failed",new Error("Screen recording is not supported in this browser"));let r=qe();if(!r)throw w("recording_failed",new Error("No supported video codec found (WebM required)"));if(n?.aborted)throw w("aborted",new Error("Recording aborted before start"));let o;try{o=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser"},audio:!1});}catch(g){let S=g instanceof DOMException&&g.name==="NotAllowedError"?"Screen share permission denied":"Failed to start screen share";throw w("recording_failed",new Error(S))}if(n?.aborted)throw o.getTracks().forEach(g=>g.stop()),w("aborted",new Error("Recording aborted after permission"));let i=t?.maxDurationMs??kt,l=t?.videoBitsPerSecond??St,a=new MediaRecorder(o,{mimeType:r,videoBitsPerSecond:l}),s=[],c=[],h=0,p=null,m=null,y=false,u=()=>{Ue(),p!==null&&(clearInterval(p),p=null),m!==null&&(clearTimeout(m),m=null),o.getTracks().forEach(g=>g.stop());},f=new Promise((g,S)=>{a.ondataavailable=E=>{E.data.size>0&&s.push(E.data);},a.onstop=()=>{if(y)return;y=true,u();let E=Date.now()-h,x=new Blob(s,{type:He}),M=URL.createObjectURL(x);g({mime:He,blobUrl:M,blob:x,durationMs:E,sizeBytes:x.size});},a.onerror=()=>{y||(y=true,u(),S(w("recording_failed",new Error("MediaRecorder error"))));};let _=o.getVideoTracks()[0];if(_&&_.addEventListener("ended",()=>{a.state!=="inactive"&&a.stop();}),n){let E=()=>{y||(y=true,a.state!=="inactive"&&a.stop(),u(),S(w("aborted",new Error("Recording aborted"))));};n.addEventListener("abort",E,{once:true});}});return a.start(_t),Oe(),h=Date.now(),p=setInterval(()=>{let g=Date.now()-h;for(let S of c)S(g);},vt),m=setTimeout(()=>{!y&&a.state!=="inactive"&&a.stop();},i),{result:f,stop(){!y&&a.state!=="inactive"&&a.stop();},onTick(g){c.push(g);},abort(){y||(y=true,a.state!=="inactive"&&a.stop(),u());}}}function pe(e){let t=null,n=null,r=(...o)=>{n=o,t===null&&(t=requestAnimationFrame(()=>{if(t=null,!n)return;let i=n;n=null,e(...i);}));};return r.cancel=()=>{t!==null&&cancelAnimationFrame(t),t=null,n=null;},r}function Y(e){return e instanceof Element?!!e.closest("[data-blocfeed-ui]"):false}function G(e){e.stopPropagation(),e.stopImmediatePropagation?.();}function ze(e,t){if(!b())throw new Error("BlocFeed picker can only run in a browser environment.");let n=e.ignoreSelectors,r=e.isSelectable,o={};n&&n.length>0&&(o.ignoreSelectors=n),r&&(o.isSelectable=r);let i=null,l=null,a=(u,f=false)=>{if(!u){i=null,l=null,t.onHover(null);return}let g=re(u.getBoundingClientRect()),S=`${Math.round(g.x)}:${Math.round(g.y)}:${Math.round(g.width)}:${Math.round(g.height)}`;!f&&u===i&&S===l||(i=u,l=S,t.onHover({element:u,rect:g}));},s=pe(u=>{if(Y(u.target))return;let f=document.elementFromPoint(u.clientX,u.clientY),g=se(f,o);a(g);}),c=pe(()=>{i&&a(i,true);}),h=u=>{Y(u.target)||(G(u),u.pointerType==="mouse"&&u.preventDefault());},p=u=>{Y(u.target)||(G(u),u.pointerType==="mouse"&&u.preventDefault());},m=u=>{if(Y(u.target))return;G(u),u.preventDefault();let f=document.elementFromPoint(u.clientX,u.clientY),g=se(f,o);g&&t.onSelect({element:g,descriptor:Ae(g)});},y=u=>{u.key==="Escape"&&(G(u),u.preventDefault(),t.onCancel());};return window.addEventListener("pointermove",s,{capture:true,passive:true}),window.addEventListener("pointerdown",h,{capture:true}),window.addEventListener("pointerup",p,{capture:true}),window.addEventListener("click",m,{capture:true}),window.addEventListener("keydown",y,{capture:true}),window.addEventListener("scroll",c,{capture:true,passive:true}),window.addEventListener("resize",c,{passive:true}),{stop(){window.removeEventListener("pointermove",s,{capture:true}),window.removeEventListener("pointerdown",h,{capture:true}),window.removeEventListener("pointerup",p,{capture:true}),window.removeEventListener("click",m,{capture:true}),window.removeEventListener("keydown",y,{capture:true}),window.removeEventListener("scroll",c,{capture:true}),window.removeEventListener("resize",c),s.cancel(),c.cancel(),t.onHover(null);}}}var Tt=12e3,xt=2,Pt=500,Ct=2e3,ge="https://blocfeed.com/api/feedback",$e=0;function je(e,t){return new Promise((n,r)=>{if(t?.aborted){r(new Error("Aborted"));return}let o=setTimeout(n,e),i=()=>{clearTimeout(o),r(new Error("Aborted"));};t?.addEventListener("abort",i,{once:true});})}function Ft(e){return e>=500&&e<=599}function Mt(e){let[t,n]=e.split(",",2);if(!t||!n)throw new Error("Invalid data URL");let o=/data:(.*?);base64/.exec(t)?.[1]||"application/octet-stream",i=atob(n),l=new Uint8Array(i.length);for(let a=0;a<i.length;a+=1)l[a]=i.charCodeAt(a);return new Blob([l],{type:o})}function Lt(e){let t={},n={},r={...e};if(r.screenshots){let o={},i={...r.screenshots};i.element&&(t.element=i.element.dataUrl,o.element={mime:i.element.mime,width:i.element.width,height:i.element.height},i.element={...i.element,dataUrl:""}),i.fullPage&&(t.fullPage=i.fullPage.dataUrl,o.fullPage={mime:i.fullPage.mime,width:i.fullPage.width,height:i.fullPage.height},i.fullPage={...i.fullPage,dataUrl:""}),r.screenshots=i,(o.element||o.fullPage)&&(r.screenshot_intent=o);}return r.video&&(n.blob=r.video.blob,r.video_intent={mime:r.video.mime,durationMs:r.video.durationMs,sizeBytes:r.video.sizeBytes},delete r.video),{lean:r,extracted:t,extractedVideo:n}}async function Ve(e,t,n){let r=Mt(t);await fetch(e,{method:"PUT",body:r,headers:{"content-type":r.type},...n?{signal:n}:{}});}async function Dt(e){let{feedbackId:t,extracted:n,screenshots:r,signal:o}=e,i={};n.element&&r?.element&&(i.element={dataUrl:n.element,mime:r.element.mime,width:r.element.width,height:r.element.height}),n.fullPage&&r?.fullPage&&(i.fullPage={dataUrl:n.fullPage,mime:r.fullPage.mime,width:r.fullPage.width,height:r.fullPage.height}),Object.keys(i).length!==0&&await fetch(`${ge}/${t}/screenshots`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(i),...o?{signal:o}:{}});}async function Bt(e){await fetch(`${ge}/${e.feedbackId}/video`,{method:"POST",body:e.blob,headers:{"content-type":e.blob.type},...e.signal?{signal:e.signal}:{}});}async function Xe(e){let{signal:t,transport:n}=e;if(Date.now()-$e<Ct)return {ok:false,error:w("configuration",new Error("Please wait before submitting again"))};let o=n?.timeoutMs??Tt,i=n?.maxAttempts??xt,l=n?.backoffMs??Pt,a=!!(e.payload.screenshots?.element?.dataUrl||e.payload.screenshots?.fullPage?.dataUrl),s=!!e.payload.video?.blob,c=a||s,{lean:h,extracted:p,extractedVideo:m}=c?Lt(e.payload):{lean:e.payload,extracted:{},extractedVideo:{}},y={...p,...e.screenshotDataUrls};for(let u=1;u<=i;u+=1){let f=new AbortController,g=setTimeout(()=>f.abort(),o),S=()=>f.abort();t&&t.addEventListener("abort",S,{once:true});try{let _=await fetch(ge,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(h),signal:f.signal});if(_.ok){$e=Date.now();let E;try{E=await _.json();}catch{}if((y.element||y.fullPage)&&E){let d=E.upload_urls;if(d){let k=[];y.element&&d.element&&k.push(Ve(d.element,y.element,t)),y.fullPage&&d.fullPage&&k.push(Ve(d.fullPage,y.fullPage,t));try{await Promise.all(k);}catch{}}else if(E.feedback_id)try{await Dt({feedbackId:E.feedback_id,extracted:y,screenshots:e.payload.screenshots,...t?{signal:t}:{}});}catch{}}if(m.blob&&E){let d=E.upload_urls;if(d?.video)try{await fetch(d.video,{method:"PUT",body:m.blob,headers:{"content-type":m.blob.type},...t?{signal:t}:{}});}catch{}else if(E.feedback_id)try{await Bt({feedbackId:E.feedback_id,blob:m.blob,...t?{signal:t}:{}});}catch{}}let M={ok:!0,status:_.status};return E&&(M.apiResponse=E),M}if(u<i&&Ft(_.status)){let E=.85+Math.random()*.3,x=Math.round(l*2**(u-1)*E);await je(x,t);continue}return {ok:!1,status:_.status,error:w("api_failed",new Error(`HTTP ${_.status}`))}}catch(_){if(f.signal.aborted||t?.aborted)return {ok:false,error:w("aborted",_)};if(u<i){let E=.85+Math.random()*.3,x=Math.round(l*2**(u-1)*E);await je(x,t);continue}return {ok:false,error:w("api_failed",_)}}finally{clearTimeout(g),t&&t.removeEventListener("abort",S);}}return {ok:false,error:w("api_failed",new Error("Failed"))}}async function he(e){let{signal:t,transport:n}=e,r={ok:false};try{let o={payload:e.payload,...t?{signal:t}:{},...n?{transport:n}:{}};r.api=await Xe(o),r.ok=!!r.api?.ok;}catch(o){r.api={ok:false,error:w("api_failed",o)},r.ok=false;}return {payload:e.payload,result:r}}var It=["[data-blocfeed-ui]","[data-blocfeed-ignore]"];function Nt(e){let t=[...It,...e?.ignoreSelectors??[]],n=Array.from(new Set(t));return {...e,ignoreSelectors:n}}function Ze(){return {phase:"idle"}}function Ot(e){if(e.ok)return false;let t=e.api;return t?t.status&&t.status>=400&&t.status<500||t.error?.kind==="aborted"||t.error?.kind==="configuration"?false:!t.ok:true}function On(e){let t=e,n=Ze(),r=new Set,o=new Set,i=null,l=null,a=null,s=null,c=0,h=null,p=null,m=null,y=()=>{for(let d of r)d(n);},u=d=>{for(let k of o)k(d);},f=d=>{n=d,y();},g=()=>{c+=1,s?.abort(),s=null;},S=()=>{i?.stop(),i=null,u(null),a!==null&&b()&&(document.documentElement.style.cursor=a,a=null);},_=()=>{p&&(p.abort(),p=null),m&&(URL.revokeObjectURL(m.blobUrl),m=null);},E=()=>{g(),S(),_(),l=null,f(Ze());},x=()=>{if(!b())return;S(),l=null;let d=Nt(t.picker);a=document.documentElement.style.cursor,document.documentElement.style.cursor="crosshair",f({phase:"picking"}),i=ze(d,{onHover:u,onSelect:({element:k,descriptor:P})=>{l=k,S(),f({phase:"review",selection:P});},onCancel:()=>{E();}});},M=()=>{let d=Be();if(d.length!==0)for(let k of d)he({payload:k,...t.transport?{transport:t.transport}:{}}).catch(()=>{fe(k);});};if(b()){setTimeout(M,1e3);let d=()=>M();window.addEventListener("online",d),h=()=>window.removeEventListener("online",d);}return {getState:()=>n,subscribe(d){return r.add(d),()=>r.delete(d)},subscribeHover(d){return o.add(d),()=>o.delete(d)},start(){n.phase==="capturing"||n.phase==="submitting"||n.phase==="recording"||n.phase!=="picking"&&x();},stop(){E();},clearSelection(){n.phase==="capturing"||n.phase==="submitting"||n.phase==="recording"||x();},setConfig(d){t=d;},async submit(d,k){if(!b()){let R=w("configuration",new Error("BlocFeed submit can only run in the browser"));return f({phase:"error",lastError:R}),{ok:false}}let P=t.blocfeed_id?.trim?.()??"";if(!P){let L={phase:"error",lastError:w("configuration",new Error("Missing blocfeed_id. Create a project in BlocFeed and pass its blocfeed_id."))};return n.selection&&(L.selection=n.selection),f(L),{ok:false}}if(n.phase==="capturing"||n.phase==="submitting"||n.phase==="recording")return {ok:false};let C=c+1;c=C,s?.abort(),s=new AbortController;let T=s.signal,v=n.selection,U=k?.capture?{...t.capture,...k.capture}:t.capture,H=!!(U?.element||U?.fullPage),Ee={phase:H?"capturing":"submitting"};v&&(Ee.selection=v),f(Ee);try{let R=H?await Le({selectionElement:l,capture:U,signal:T}):void 0;if(T.aborted||c!==C)return {ok:!1};let L={phase:"submitting"};v&&(L.selection=v),R&&(L.capture=R),f(L);let N={};v&&(N.selection=v),R&&(N.capture=R);let Qe=await De({config:t.metadata,context:N,...t.user?{user:t.user}:{}}),D={version:1,createdAt:new Date().toISOString(),blocfeed_id:P,message:d,metadata:Qe};k?.category&&(D.category=k.category),t.user&&(D.user=t.user),v&&(D.selection=v),R&&(D.screenshots=R),m&&(D.video=m);let{result:F}=await he({payload:D,signal:T,...t.transport?{transport:t.transport}:{}});if(T.aborted||c!==C)return F;if(F.ok){m&&(URL.revokeObjectURL(m.blobUrl),m=null);let ne={phase:"success",lastSubmit:F};return v&&(ne.selection=v),R&&(ne.capture=R),f(ne),F}Ot(F)&&fe(D);let Ye=F.api?.error??w("unknown",new Error("Submission failed")),te={phase:"error",lastSubmit:F,lastError:Ye};return v&&(te.selection=v),R&&(te.capture=R),f(te),F}catch(R){if(T.aborted||c!==C)return {ok:false};let N={phase:"error",lastError:T.aborted?w("aborted",R):w("unknown",R)};return v&&(N.selection=v),f(N),{ok:false}}finally{c===C&&(s=null);}},async startRecording(){if(n.phase!=="review"||!t.recording?.enabled)return;let d=n.selection,k={phase:"recording",recordingElapsedMs:0};d&&(k.selection=d),f(k);try{let P={config:t.recording};s&&(P.signal=s.signal);let C=await me(P);p=C,C.onTick(U=>{if(n.phase==="recording"){let H={phase:"recording",recordingElapsedMs:U};d&&(H.selection=d),f(H);}});let T=await C.result;p=null,m=T;let v={phase:"review",video:T};d&&(v.selection=d),f(v);}catch(P){p=null;let T={phase:"review",lastError:P?.kind?P:w("recording_failed",P)};d&&(T.selection=d),f(T);}},stopRecording(){n.phase!=="recording"||!p||p.stop();},removeVideo(){m&&(URL.revokeObjectURL(m.blobUrl),m=null);let d=n.selection,k={phase:"review"};d&&(k.selection=d),f(k);},__unsafeGetSelectedElement(){return l},destroy(){E(),r.clear(),o.clear(),h?.(),h=null;}}}var $=[],j=[],We=20,Ke=15,J=[],V={},X=null,Z=null,W=null,ee=false,Ut=["blocfeed.com","google-analytics.com","googletagmanager.com","analytics.google.com","googleads.g.doubleclick.net","googlesyndication.com","googleadservices.com","google.com/pagead","google.com/ads","facebook.net","facebook.com/tr","connect.facebook.net","graph.facebook.com","api.mixpanel.com","api-js.mixpanel.com","api.amplitude.com","api2.amplitude.com","api.segment.io","cdn.segment.com","vars.hotjar.com","in.hotjar.com","script.hotjar.com","heapanalytics.com","fullstory.com/s/fs.js","rs.fullstory.com","app.posthog.com","us.posthog.com","eu.posthog.com","api-iam.intercom.io","widget.intercom.io","sentry.io/api","browser.sentry-cdn.com","browser-intake-datadoghq.com","clarity.ms","js.hs-analytics.net","api.hubapi.com","forms.hubspot.com","plausible.io/api","client.crisp.chat","js.driftt.com","r.logrocket.com","app.pendo.io","events.launchdarkly.com","app.launchdarkly.com","grammarly.com","gnar.grammarly.com","capi.grammarly.com","api.languagetool.org","api.languagetoolplus.com","fonts.googleapis.com","fonts.gstatic.com","cdn.cookielaw.org","consent.cookiebot.com","js.stripe.com","api.stripe.com/v1/tokens","google.com/recaptcha","hcaptcha.com","bam.nr-data.net","rec.smartlook.com","o2.mouseflow.com","api.luckyorange.com","static.zdassets.com","ekr.zdassets.com"];function Ht(e){if(e instanceof Error)return e.message;if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function qt(e,t){let n=t.map(Ht).join(" "),r=t.find(i=>i instanceof Error),o={level:e,message:n.slice(0,2e3),timestamp:Date.now()};for(r?.stack&&(o.stack=r.stack.slice(0,2e3)),$.push(o);$.length>We;)$.shift();}function we(e){let t=e.url.toLowerCase();for(let n of J)if(t.includes(n))return;for(j.push(e);j.length>Ke;)j.shift();}function qn(e={}){if(ee||!b())return;ee=true,We=e.consoleLimit??20,Ke=e.networkLimit??15;let t=e.ignoreUrls;if(t!==void 0?J=t.map(n=>n.toLowerCase()):J=[...Ut],e.console!==false){let n=e.consoleLevels??["error","warn"];for(let r of n)V[r]=console[r],console[r]=(...o)=>{qt(r,o),V[r]?.apply(console,o);};}if(e.network!==false&&typeof window.fetch=="function"){X=window.fetch;let n=X;window.fetch=async function(o,i){let l=typeof o=="string"?o:o instanceof URL?o.toString():o.url,a=(i?.method??"GET").toUpperCase(),s=Date.now();try{let c=await n.call(window,o,i);return c.ok||we({url:l.slice(0,500),method:a,status:c.status,statusText:c.statusText,timestamp:s,durationMs:Date.now()-s}),c}catch(c){throw we({url:l.slice(0,500),method:a,status:0,statusText:c instanceof Error?c.message:"Network error",timestamp:s,durationMs:Date.now()-s}),c}};}if(e.network!==false&&typeof XMLHttpRequest<"u"){Z=XMLHttpRequest.prototype.open,W=XMLHttpRequest.prototype.send;let n=Z,r=W;XMLHttpRequest.prototype.open=function(o,i,...l){return this.__bf_method=o.toUpperCase(),this.__bf_url=String(i),n.apply(this,[o,i,...l])},XMLHttpRequest.prototype.send=function(...o){let i=this.__bf_method||"GET",l=this.__bf_url||"",a=Date.now();return this.addEventListener("loadend",function(){if(this.status>=400||this.status===0){let s={url:l.slice(0,500),method:i,status:this.status,timestamp:a,durationMs:Date.now()-a};this.statusText&&(s.statusText=this.statusText),we(s);}}),r.apply(this,o)};}}function zn(){if(ee){for(let[e,t]of Object.entries(V))console[e]=t;for(let e of Object.keys(V))delete V[e];X&&(window.fetch=X,X=null),Z&&(XMLHttpRequest.prototype.open=Z,Z=null),W&&(XMLHttpRequest.prototype.send=W,W=null),J=[],ee=false;}}function $n(){return {consoleLogs:[...$],networkErrors:[...j]}}function jn(){$=[],j=[];}var zt=[{name:"supabase_service_role_key",pattern:/SUPABASE_SERVICE_ROLE_KEY["'=:\s]+[A-Za-z0-9_.=-]{30,}/},{name:"supabase_db_password",pattern:/SUPABASE_DB_PASSWORD["'=:\s]+[^\s"']{6,}/},{name:"postgres_password",pattern:/POSTGRES_PASSWORD["'=:\s]+[^\s"']{6,}/},{name:"database_url_with_creds",pattern:/(?:postgres|postgresql|mysql|mongodb|redis|amqp):\/\/[^:]+:[^@\s"']+@/},{name:"aws_access_key",pattern:/AKIA[0-9A-Z]{16}/},{name:"aws_secret_key",pattern:/AWS_SECRET_ACCESS_KEY["'=:\s]+[A-Za-z0-9/+=]{30,}/},{name:"aws_session_token",pattern:/AWS_SESSION_TOKEN["'=:\s]+[A-Za-z0-9/+=]{30,}/},{name:"stripe_secret_key",pattern:/sk_live_[a-zA-Z0-9]{10,}/},{name:"stripe_secret_key_test",pattern:/sk_test_[a-zA-Z0-9]{10,}/},{name:"stripe_restricted_key",pattern:/rk_(?:live|test)_[a-zA-Z0-9]{10,}/},{name:"github_pat",pattern:/ghp_[A-Za-z0-9_]{36,}/},{name:"github_oauth",pattern:/gho_[A-Za-z0-9_]{36,}/},{name:"github_user_token",pattern:/ghu_[A-Za-z0-9_]{36,}/},{name:"github_server_token",pattern:/ghs_[A-Za-z0-9_]{36,}/},{name:"github_fine_grained",pattern:/github_pat_[A-Za-z0-9_]{22,}/},{name:"openai_api_key",pattern:/sk-[a-zA-Z0-9]{20,}(?![a-zA-Z0-9_])/},{name:"anthropic_api_key",pattern:/sk-ant-[a-zA-Z0-9\-_]{20,}/},{name:"private_key",pattern:/-----BEGIN (?:RSA |EC |DSA |OPENSSH |PGP )?PRIVATE KEY-----/},{name:"sendgrid_api_key",pattern:/SG\.[a-zA-Z0-9_-]{22,}\.[a-zA-Z0-9_-]{22,}/},{name:"twilio_auth_token",pattern:/TWILIO_AUTH_TOKEN["'=:\s]+[a-f0-9]{32}/},{name:"generic_secret_key",pattern:/[A-Z_]{2,}_SECRET_KEY["'=:\s]+[^\s"']{8,}/},{name:"generic_secret",pattern:/[A-Z_]{2,}_SECRET["'=:\s]+[^\s"']{8,}/},{name:"generic_password",pattern:/[A-Z_]{2,}_PASSWORD["'=:\s]+[^\s"']{6,}/},{name:"generic_private_key_var",pattern:/[A-Z_]{2,}_PRIVATE_KEY["'=:\s]+[^\s"']{8,}/}],I=[],ye=0,be=false;function $t(e){let t=e.slice(0,80);return t.length<=6?"***":t.slice(0,6)+"***"}function jt(e,t,n,r){if(I.some(l=>l.rule===e&&l.source===t))return;let i={rule:e,source:t,hint:$t(n),timestamp:Date.now()};r&&(i.location=r),I.push(i);}function K(e,t,n,r){for(let{name:o,pattern:i}of n){let l=i.exec(e);l&&jt(o,t,l[0],r);}}function Vt(e){try{let t=window;if(t.__NEXT_DATA__){let n=JSON.stringify(t.__NEXT_DATA__);K(n,"hydration",e,"__NEXT_DATA__");}if(t.__NUXT__){let n=JSON.stringify(t.__NUXT__);K(n,"hydration",e,"__NUXT__");}}catch{}}function Xt(e){try{document.querySelectorAll("script:not([src])").forEach((n,r)=>{let o=n.textContent;o&&o.length>0&&K(o,"scripts",e,`inline-script[${r}]`);});}catch{}}function Zt(e){try{document.querySelectorAll("meta[content]").forEach(n=>{let r=n.getAttribute("content"),o=n.getAttribute("name")||n.getAttribute("property")||"";r&&r.length>10&&K(r,"meta",e,o?`meta[${o}]`:void 0);});}catch{}}function Wt(e){try{document.querySelectorAll("[data-api-key], [data-secret], [data-token], [data-password]").forEach(n=>{let r=n.attributes;for(let o=0;o<r.length;o++){let i=r[o];i.name.startsWith("data-")&&i.value.length>10&&K(i.value,"dom",e,`${n.tagName.toLowerCase()}[${i.name}]`);}});}catch{}}function Zn(e={}){if(be||!b()||(be=true,e.secretScan===false))return;let t=[...zt,...e.customPatterns??[]],n=e.scanTargets??["hydration","scripts","meta","dom"];setTimeout(()=>{ye=Date.now(),n.includes("hydration")&&Vt(t),n.includes("scripts")&&Xt(t),n.includes("meta")&&Zt(t),n.includes("dom")&&Wt(t);let r=e.notify??"both";I.length>0&&(r==="console"||r==="both")&&console.warn(`[BlocFeed Security] Found ${I.length} potential secret(s) exposed in client code:`,I.map(o=>`${o.rule} (${o.source}${o.location?`: ${o.location}`:""})`));},100);}function Wn(){return {findings:[...I],scannedAt:ye}}function Kn(){I=[],ye=0,be=false;}
|
|
2
|
+
exports.a=b;exports.b=re;exports.c=Pe;exports.d=Le;exports.e=De;exports.f=fe;exports.g=Be;exports.h=ln;exports.i=un;exports.j=yt;exports.k=Et;exports.l=At;exports.m=me;exports.n=On;exports.o=qn;exports.p=zn;exports.q=$n;exports.r=jn;exports.s=Zn;exports.t=Wn;exports.u=Kn;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function b(){return typeof window<"u"&&typeof document<"u"}function ke(e){let t=globalThis.CSS;return typeof t?.escape=="function"?t.escape(e):e.replace(/[^a-zA-Z0-9_-]/g,n=>{let r=n.codePointAt(0);return r===void 0?"":`\\${r.toString(16)} `})}function re(e){return {x:e.x,y:e.y,width:e.width,height:e.height}}function Ge(e){return {x:e.x+window.scrollX,y:e.y+window.scrollY,width:e.width,height:e.height}}function Je(e){return e.replace(/\s+/g," ").trim()}function oe(e,t=140){let n=e.textContent;if(!n)return;let r=Je(n);if(r)return r.length<=t?r:`${r.slice(0,t-1)}\u2026`}function et(e){let t=1;for(let n=e.previousElementSibling;n;n=n.previousElementSibling)n.tagName===e.tagName&&(t+=1);return t}var Re=["data-testid","data-test-id","data-test","data-qa","data-cy"],Se="data-blocfeed-component";function ie(e){let t=e.closest(`[${Se}]`);if(!t)return;let r=t.getAttribute(Se)?.trim();return r||void 0}function tt(e){for(let t of Re){let n=e.closest(`[${t}]`);if(!n)continue;let o=n.getAttribute(t)?.trim();if(o)return o}}function ve(e){try{let t=e,n=Object.getOwnPropertyNames(t);for(let r of n)if(r.startsWith("__reactFiber$")||r.startsWith("__reactInternalInstance$")){let o=t[r];if(o&&typeof o=="object")return o}}catch{}return null}function B(e){if(e.length<=1||e.length===2&&e[0]===e[0].toLowerCase())return true;let t=e[0];return t>="a"&&t<="z"}function q(e){if(e){for(let t of e)if(typeof t.name=="string"&&t.name&&!B(t.name))return t.name}}function A(e){if(e&&typeof e!="string"){if(typeof e=="function"){let t=e;return typeof t.displayName=="string"&&t.displayName?t.displayName:typeof t.name=="string"&&t.name?t.name:void 0}if(typeof e=="object"){let t=e,n=t.displayName;if(typeof n=="string"&&n)return n;let r=t.render;if(typeof r=="function"){let i=r;if(typeof i.displayName=="string"&&i.displayName)return i.displayName;if(typeof i.name=="string"&&i.name)return i.name}let o=t.type;return A(o)}}}function ae(e){let t=ve(e);if(!t)return;let n=q(t._debugInfo);if(n)return n;let r=t._debugOwner!==void 0;if(r){let s=t._debugOwner;for(let c=0;s&&c<50;c+=1){let h=q(s._debugInfo);if(h)return h;let p=A(s.type)??A(s.elementType);if(p&&!B(p))return p;s=s._debugOwner;}}if(t._owner!==void 0&&t._owner!==t._debugOwner){let s=t._owner;for(let c=0;s&&c<50;c+=1){let h=q(s._debugInfo);if(h)return h;let p=A(s.type)??A(s.elementType);if(p&&!B(p))return p;s=s._owner;}}let i=t,l=r?80:25;for(let s=0;i&&s<l;s+=1){let c=q(i._debugInfo);if(c)return c;let h=A(i.type)??A(i.elementType);if(h&&!B(h))return h;i=i.return;}let a=e.parentElement;for(let s=0;a&&s<15;s+=1){let c=ve(a);if(c){let h=q(c._debugInfo);if(h)return h;let p=A(c.type)??A(c.elementType);if(p&&!B(p))return p;if(c._debugOwner){let m=A(c._debugOwner.type)??A(c._debugOwner.elementType);if(m&&!B(m))return m}if(c._owner&&c._owner!==c._debugOwner){let m=A(c._owner.type)??A(c._owner.elementType);if(m&&!B(m))return m}}a=a.parentElement;}}function nt(e){let t=e.tagName.toLowerCase(),n=e.getAttribute("id");if(n)return `#${ke(n)}`;for(let r of Re){let o=e.getAttribute(r);if(o)return `${t}[${r}="${ke(o)}"]`}return `${t}:nth-of-type(${et(e)})`}function rt(e,t=10){let n=[],r=e;for(;r&&n.length<t;){let o=nt(r);if(n.unshift(o),o.startsWith("#"))break;r=r.parentElement;}return n.join(" > ")}function _e(e,t){if(!t||t.length===0)return false;for(let n of t)if(e.closest(n))return true;return false}function se(e,t){if(!e||_e(e,t.ignoreSelectors))return null;let n=e;for(;n;){if(_e(n,t.ignoreSelectors))return null;if(t.isSelectable?.(n)??ot(n))return n;n=n.parentElement;}return null}function ot(e){let t=e.tagName;return !(t==="HTML"||t==="BODY")}function Ae(e){let t=e.getBoundingClientRect(),n={selector:rt(e),tagName:e.tagName.toLowerCase(),rect:re(t),pageRect:Ge(t)},r=e.getAttribute("id");r&&(n.id=r);let o=e.className;typeof o=="string"&&o.trim()&&(n.className=o);let i=oe(e);i&&(n.textSnippet=i);let l=ie(e)??ae(e);l&&(n.componentName=l);let a=tt(e);return a&&(n.testId=a),n}var ce=null;async function Te(){return ce||(ce=import('html-to-image')),ce}async function it(e){return await new Promise((t,n)=>{let r=new Image;r.onload=()=>t({width:r.naturalWidth,height:r.naturalHeight}),r.onerror=()=>n(new Error("Failed to load generated screenshot")),r.src=e;})}async function xe(e,t){let{width:n,height:r}=await it(e);return {dataUrl:e,mime:t,width:n,height:r}}function O(e){if(e?.aborted)throw new Error("Aborted")}function Pe(){return {async captureElement(e,t){if(!b())throw new Error("captureElement can only run in the browser");O(t.signal);let n=await Te();O(t.signal);let r=t.mime==="image/jpeg"?await n.toJpeg(e,{quality:t.quality??.92,pixelRatio:t.pixelRatio}):await n.toPng(e,{pixelRatio:t.pixelRatio});return O(t.signal),await xe(r,t.mime)},async captureFullPage(e){if(!b())throw new Error("captureFullPage can only run in the browser");O(e.signal);let t=document.documentElement,n=Math.max(t.scrollWidth,t.clientWidth),r=Math.max(t.scrollHeight,t.clientHeight),o=Math.min(1,e.maxDimension/Math.max(n,r)),i=Math.max(1,Math.round(n*o)),l=Math.max(1,Math.round(r*o)),a=await Te();O(e.signal);let s=e.mime==="image/jpeg"?await a.toJpeg(t,{width:i,height:l,quality:e.quality??.92,pixelRatio:e.pixelRatio}):await a.toPng(t,{width:i,height:l,pixelRatio:e.pixelRatio});return O(e.signal),await xe(s,e.mime)}}}function at(e){if(e instanceof Error)return e.message;if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return "Unknown error"}}function w(e,t,n){let r={kind:e,message:at(t)};return n&&(r.detail=n),r}var st=12e3,ct=2048,lt=.92;function Ce(){return Date.now()}function ut(e){return new Promise((t,n)=>{let r=()=>n(new Error("Aborted"));if(e.aborted){r();return}e.addEventListener("abort",r,{once:true});})}async function Fe(e,t,n){let r=new Promise((i,l)=>{let a=setTimeout(()=>l(new Error("Timeout")),t);typeof a.unref=="function"&&a.unref();}),o=[e,r];return n&&o.push(ut(n)),await Promise.race(o)}function dt(e){if(!b())return 1;let t=window.devicePixelRatio||1,n=e?.pixelRatio??Math.min(t,2);return Math.max(.1,n)}function ft(e){return !!(e?.element||e?.fullPage)}function Me(e){let t={mime:e.mime,pixelRatio:e.pixelRatio,maxDimension:e.maxDimension};return e.includeQuality&&(t.quality=e.quality),e.signal&&(t.signal=e.signal),t}async function Le(e){let{selectionElement:t,capture:n,signal:r}=e;if(!b()||!ft(n))return;let o=Ce(),i=[],l=n?.timeoutMs??st,a=n?.maxDimension??ct,s=n?.mime??"image/png",c=n?.quality??lt,h=n?.adapter??Pe(),p={},m=dt(n);if(n?.element&&t)try{let f=t.getBoundingClientRect(),g=Math.min(1,a/Math.max(f.width,f.height)),S=Math.min(m,m*g),_=await Fe(Promise.resolve(h.captureElement(t,{...Me({mime:s,quality:c,pixelRatio:S,maxDimension:a,includeQuality:s==="image/jpeg",...r?{signal:r}:{}})})),l,r);p.element=_;}catch(f){if(r?.aborted)throw f;i.push(w("capture_failed",f,{target:"element"}));}if(n?.fullPage)try{let f=await Fe(Promise.resolve(h.captureFullPage(Me({mime:s,quality:c,pixelRatio:m,maxDimension:a,includeQuality:s==="image/jpeg",...r?{signal:r}:{}}))),l,r);p.fullPage=f;}catch(f){if(r?.aborted)throw f;i.push(w("capture_failed",f,{target:"fullPage"}));}let y=Ce(),u={startedAt:o,finishedAt:y,durationMs:Math.max(0,y-o)};return i.length>0&&(u.errors=i),{...p,diagnostics:u}}function mt(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function pt(){return b()?{url:window.location.href,title:document.title,referrer:document.referrer||void 0,userAgent:navigator.userAgent,language:navigator.language,platform:navigator.platform,viewport:{width:window.innerWidth,height:window.innerHeight},screen:{width:window.screen.width,height:window.screen.height},scroll:{x:window.scrollX,y:window.scrollY},devicePixelRatio:window.devicePixelRatio||1,timezone:mt()}:{}}function gt(e){if(!e)return {};let t={};return e.id&&(t.userId=e.id),e.email&&(t.userEmail=e.email),e.name&&(t.userName=e.name),t}async function De(e){let{config:t,context:n,user:r}=e;if(t?.enabled===false)return {};let o={...pt(),...gt(r)},i=t?.enrich;if(!i)return o;try{let l=await i(n);return {...o,...l}}catch(l){let a=w("unknown",l);return {...o,blocfeedMetadataError:a.message}}}var le="blocfeed-queue",ht=50;function ue(){if(!b())return [];try{let e=localStorage.getItem(le);if(!e)return [];let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return []}}function de(e){if(b())try{e.length===0?localStorage.removeItem(le):localStorage.setItem(le,JSON.stringify(e));}catch{}}function wt(e){let t={...e};if(t.screenshots){let n={...t.screenshots};n.element&&(n.element={...n.element,dataUrl:""}),n.fullPage&&(n.fullPage={...n.fullPage,dataUrl:""}),t.screenshots=n;}return delete t.video,t}function fe(e){let t=ue(),n=wt(e);for(n.metadata={...n.metadata,_queued:true},t.push({payload:n,timestamp:Date.now()});t.length>ht;)t.shift();de(t);}function Be(){let e=ue();return e.length===0?[]:(de([]),e.map(t=>t.payload))}function ln(){de([]);}function un(){return ue().length}var bt=200,z=[],Ie=0,Q=false;function Ne(e){let t=e.target;if(!(t instanceof Element)||t.closest("[data-blocfeed-ui]"))return;let n={timestampMs:Date.now()-Ie,path:window.location.pathname,tagName:t.tagName.toLowerCase()},r=oe(t,100);r&&(n.textSnippet=r);let o=ie(t)??ae(t);o&&(n.componentName=o),z.length<bt&&z.push(n);}function Oe(){Q||!b()||(Q=true,z=[],Ie=Date.now(),document.addEventListener("click",Ne,{capture:true,passive:true}));}function Ue(){Q&&(Q=false,document.removeEventListener("click",Ne,{capture:true}));}function yt(){return [...z]}function Et(){z=[];}var kt=3e4,St=25e5,He="video/webm",vt=250,_t=1e3,Rt=["video/webm;codecs=vp9","video/webm;codecs=vp8","video/webm"];function qe(){if(typeof MediaRecorder>"u")return null;for(let e of Rt)if(MediaRecorder.isTypeSupported(e))return e;return null}function At(){return !b()||typeof navigator?.mediaDevices?.getDisplayMedia!="function"?false:qe()!==null}async function me(e){let{config:t,signal:n}=e;if(!b()||typeof navigator?.mediaDevices?.getDisplayMedia!="function")throw w("recording_failed",new Error("Screen recording is not supported in this browser"));let r=qe();if(!r)throw w("recording_failed",new Error("No supported video codec found (WebM required)"));if(n?.aborted)throw w("aborted",new Error("Recording aborted before start"));let o;try{o=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser"},audio:!1});}catch(g){let S=g instanceof DOMException&&g.name==="NotAllowedError"?"Screen share permission denied":"Failed to start screen share";throw w("recording_failed",new Error(S))}if(n?.aborted)throw o.getTracks().forEach(g=>g.stop()),w("aborted",new Error("Recording aborted after permission"));let i=t?.maxDurationMs??kt,l=t?.videoBitsPerSecond??St,a=new MediaRecorder(o,{mimeType:r,videoBitsPerSecond:l}),s=[],c=[],h=0,p=null,m=null,y=false,u=()=>{Ue(),p!==null&&(clearInterval(p),p=null),m!==null&&(clearTimeout(m),m=null),o.getTracks().forEach(g=>g.stop());},f=new Promise((g,S)=>{a.ondataavailable=E=>{E.data.size>0&&s.push(E.data);},a.onstop=()=>{if(y)return;y=true,u();let E=Date.now()-h,x=new Blob(s,{type:He}),M=URL.createObjectURL(x);g({mime:He,blobUrl:M,blob:x,durationMs:E,sizeBytes:x.size});},a.onerror=()=>{y||(y=true,u(),S(w("recording_failed",new Error("MediaRecorder error"))));};let _=o.getVideoTracks()[0];if(_&&_.addEventListener("ended",()=>{a.state!=="inactive"&&a.stop();}),n){let E=()=>{y||(y=true,a.state!=="inactive"&&a.stop(),u(),S(w("aborted",new Error("Recording aborted"))));};n.addEventListener("abort",E,{once:true});}});return a.start(_t),Oe(),h=Date.now(),p=setInterval(()=>{let g=Date.now()-h;for(let S of c)S(g);},vt),m=setTimeout(()=>{!y&&a.state!=="inactive"&&a.stop();},i),{result:f,stop(){!y&&a.state!=="inactive"&&a.stop();},onTick(g){c.push(g);},abort(){y||(y=true,a.state!=="inactive"&&a.stop(),u());}}}function pe(e){let t=null,n=null,r=(...o)=>{n=o,t===null&&(t=requestAnimationFrame(()=>{if(t=null,!n)return;let i=n;n=null,e(...i);}));};return r.cancel=()=>{t!==null&&cancelAnimationFrame(t),t=null,n=null;},r}function Y(e){return e instanceof Element?!!e.closest("[data-blocfeed-ui]"):false}function G(e){e.stopPropagation(),e.stopImmediatePropagation?.();}function ze(e,t){if(!b())throw new Error("BlocFeed picker can only run in a browser environment.");let n=e.ignoreSelectors,r=e.isSelectable,o={};n&&n.length>0&&(o.ignoreSelectors=n),r&&(o.isSelectable=r);let i=null,l=null,a=(u,f=false)=>{if(!u){i=null,l=null,t.onHover(null);return}let g=re(u.getBoundingClientRect()),S=`${Math.round(g.x)}:${Math.round(g.y)}:${Math.round(g.width)}:${Math.round(g.height)}`;!f&&u===i&&S===l||(i=u,l=S,t.onHover({element:u,rect:g}));},s=pe(u=>{if(Y(u.target))return;let f=document.elementFromPoint(u.clientX,u.clientY),g=se(f,o);a(g);}),c=pe(()=>{i&&a(i,true);}),h=u=>{Y(u.target)||(G(u),u.pointerType==="mouse"&&u.preventDefault());},p=u=>{Y(u.target)||(G(u),u.pointerType==="mouse"&&u.preventDefault());},m=u=>{if(Y(u.target))return;G(u),u.preventDefault();let f=document.elementFromPoint(u.clientX,u.clientY),g=se(f,o);g&&t.onSelect({element:g,descriptor:Ae(g)});},y=u=>{u.key==="Escape"&&(G(u),u.preventDefault(),t.onCancel());};return window.addEventListener("pointermove",s,{capture:true,passive:true}),window.addEventListener("pointerdown",h,{capture:true}),window.addEventListener("pointerup",p,{capture:true}),window.addEventListener("click",m,{capture:true}),window.addEventListener("keydown",y,{capture:true}),window.addEventListener("scroll",c,{capture:true,passive:true}),window.addEventListener("resize",c,{passive:true}),{stop(){window.removeEventListener("pointermove",s,{capture:true}),window.removeEventListener("pointerdown",h,{capture:true}),window.removeEventListener("pointerup",p,{capture:true}),window.removeEventListener("click",m,{capture:true}),window.removeEventListener("keydown",y,{capture:true}),window.removeEventListener("scroll",c,{capture:true}),window.removeEventListener("resize",c),s.cancel(),c.cancel(),t.onHover(null);}}}var Tt=12e3,xt=2,Pt=500,Ct=2e3,ge="https://blocfeed.com/api/feedback",$e=0;function je(e,t){return new Promise((n,r)=>{if(t?.aborted){r(new Error("Aborted"));return}let o=setTimeout(n,e),i=()=>{clearTimeout(o),r(new Error("Aborted"));};t?.addEventListener("abort",i,{once:true});})}function Ft(e){return e>=500&&e<=599}function Mt(e){let[t,n]=e.split(",",2);if(!t||!n)throw new Error("Invalid data URL");let o=/data:(.*?);base64/.exec(t)?.[1]||"application/octet-stream",i=atob(n),l=new Uint8Array(i.length);for(let a=0;a<i.length;a+=1)l[a]=i.charCodeAt(a);return new Blob([l],{type:o})}function Lt(e){let t={},n={},r={...e};if(r.screenshots){let o={},i={...r.screenshots};i.element&&(t.element=i.element.dataUrl,o.element={mime:i.element.mime,width:i.element.width,height:i.element.height},i.element={...i.element,dataUrl:""}),i.fullPage&&(t.fullPage=i.fullPage.dataUrl,o.fullPage={mime:i.fullPage.mime,width:i.fullPage.width,height:i.fullPage.height},i.fullPage={...i.fullPage,dataUrl:""}),r.screenshots=i,(o.element||o.fullPage)&&(r.screenshot_intent=o);}return r.video&&(n.blob=r.video.blob,r.video_intent={mime:r.video.mime,durationMs:r.video.durationMs,sizeBytes:r.video.sizeBytes},delete r.video),{lean:r,extracted:t,extractedVideo:n}}async function Ve(e,t,n){let r=Mt(t);await fetch(e,{method:"PUT",body:r,headers:{"content-type":r.type},...n?{signal:n}:{}});}async function Dt(e){let{feedbackId:t,extracted:n,screenshots:r,signal:o}=e,i={};n.element&&r?.element&&(i.element={dataUrl:n.element,mime:r.element.mime,width:r.element.width,height:r.element.height}),n.fullPage&&r?.fullPage&&(i.fullPage={dataUrl:n.fullPage,mime:r.fullPage.mime,width:r.fullPage.width,height:r.fullPage.height}),Object.keys(i).length!==0&&await fetch(`${ge}/${t}/screenshots`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(i),...o?{signal:o}:{}});}async function Bt(e){await fetch(`${ge}/${e.feedbackId}/video`,{method:"POST",body:e.blob,headers:{"content-type":e.blob.type},...e.signal?{signal:e.signal}:{}});}async function Xe(e){let{signal:t,transport:n}=e;if(Date.now()-$e<Ct)return {ok:false,error:w("configuration",new Error("Please wait before submitting again"))};let o=n?.timeoutMs??Tt,i=n?.maxAttempts??xt,l=n?.backoffMs??Pt,a=!!(e.payload.screenshots?.element?.dataUrl||e.payload.screenshots?.fullPage?.dataUrl),s=!!e.payload.video?.blob,c=a||s,{lean:h,extracted:p,extractedVideo:m}=c?Lt(e.payload):{lean:e.payload,extracted:{},extractedVideo:{}},y={...p,...e.screenshotDataUrls};for(let u=1;u<=i;u+=1){let f=new AbortController,g=setTimeout(()=>f.abort(),o),S=()=>f.abort();t&&t.addEventListener("abort",S,{once:true});try{let _=await fetch(ge,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(h),signal:f.signal});if(_.ok){$e=Date.now();let E;try{E=await _.json();}catch{}if((y.element||y.fullPage)&&E){let d=E.upload_urls;if(d){let k=[];y.element&&d.element&&k.push(Ve(d.element,y.element,t)),y.fullPage&&d.fullPage&&k.push(Ve(d.fullPage,y.fullPage,t));try{await Promise.all(k);}catch{}}else if(E.feedback_id)try{await Dt({feedbackId:E.feedback_id,extracted:y,screenshots:e.payload.screenshots,...t?{signal:t}:{}});}catch{}}if(m.blob&&E){let d=E.upload_urls;if(d?.video)try{await fetch(d.video,{method:"PUT",body:m.blob,headers:{"content-type":m.blob.type},...t?{signal:t}:{}});}catch{}else if(E.feedback_id)try{await Bt({feedbackId:E.feedback_id,blob:m.blob,...t?{signal:t}:{}});}catch{}}let M={ok:!0,status:_.status};return E&&(M.apiResponse=E),M}if(u<i&&Ft(_.status)){let E=.85+Math.random()*.3,x=Math.round(l*2**(u-1)*E);await je(x,t);continue}return {ok:!1,status:_.status,error:w("api_failed",new Error(`HTTP ${_.status}`))}}catch(_){if(f.signal.aborted||t?.aborted)return {ok:false,error:w("aborted",_)};if(u<i){let E=.85+Math.random()*.3,x=Math.round(l*2**(u-1)*E);await je(x,t);continue}return {ok:false,error:w("api_failed",_)}}finally{clearTimeout(g),t&&t.removeEventListener("abort",S);}}return {ok:false,error:w("api_failed",new Error("Failed"))}}async function he(e){let{signal:t,transport:n}=e,r={ok:false};try{let o={payload:e.payload,...t?{signal:t}:{},...n?{transport:n}:{}};r.api=await Xe(o),r.ok=!!r.api?.ok;}catch(o){r.api={ok:false,error:w("api_failed",o)},r.ok=false;}return {payload:e.payload,result:r}}var It=["[data-blocfeed-ui]","[data-blocfeed-ignore]"];function Nt(e){let t=[...It,...e?.ignoreSelectors??[]],n=Array.from(new Set(t));return {...e,ignoreSelectors:n}}function Ze(){return {phase:"idle"}}function Ot(e){if(e.ok)return false;let t=e.api;return t?t.status&&t.status>=400&&t.status<500||t.error?.kind==="aborted"||t.error?.kind==="configuration"?false:!t.ok:true}function On(e){let t=e,n=Ze(),r=new Set,o=new Set,i=null,l=null,a=null,s=null,c=0,h=null,p=null,m=null,y=()=>{for(let d of r)d(n);},u=d=>{for(let k of o)k(d);},f=d=>{n=d,y();},g=()=>{c+=1,s?.abort(),s=null;},S=()=>{i?.stop(),i=null,u(null),a!==null&&b()&&(document.documentElement.style.cursor=a,a=null);},_=()=>{p&&(p.abort(),p=null),m&&(URL.revokeObjectURL(m.blobUrl),m=null);},E=()=>{g(),S(),_(),l=null,f(Ze());},x=()=>{if(!b())return;S(),l=null;let d=Nt(t.picker);a=document.documentElement.style.cursor,document.documentElement.style.cursor="crosshair",f({phase:"picking"}),i=ze(d,{onHover:u,onSelect:({element:k,descriptor:P})=>{l=k,S(),f({phase:"review",selection:P});},onCancel:()=>{E();}});},M=()=>{let d=Be();if(d.length!==0)for(let k of d)he({payload:k,...t.transport?{transport:t.transport}:{}}).catch(()=>{fe(k);});};if(b()){setTimeout(M,1e3);let d=()=>M();window.addEventListener("online",d),h=()=>window.removeEventListener("online",d);}return {getState:()=>n,subscribe(d){return r.add(d),()=>r.delete(d)},subscribeHover(d){return o.add(d),()=>o.delete(d)},start(){n.phase==="capturing"||n.phase==="submitting"||n.phase==="recording"||n.phase!=="picking"&&x();},stop(){E();},clearSelection(){n.phase==="capturing"||n.phase==="submitting"||n.phase==="recording"||x();},setConfig(d){t=d;},async submit(d,k){if(!b()){let R=w("configuration",new Error("BlocFeed submit can only run in the browser"));return f({phase:"error",lastError:R}),{ok:false}}let P=t.blocfeed_id?.trim?.()??"";if(!P){let L={phase:"error",lastError:w("configuration",new Error("Missing blocfeed_id. Create a project in BlocFeed and pass its blocfeed_id."))};return n.selection&&(L.selection=n.selection),f(L),{ok:false}}if(n.phase==="capturing"||n.phase==="submitting"||n.phase==="recording")return {ok:false};let C=c+1;c=C,s?.abort(),s=new AbortController;let T=s.signal,v=n.selection,U=k?.capture?{...t.capture,...k.capture}:t.capture,H=!!(U?.element||U?.fullPage),Ee={phase:H?"capturing":"submitting"};v&&(Ee.selection=v),f(Ee);try{let R=H?await Le({selectionElement:l,capture:U,signal:T}):void 0;if(T.aborted||c!==C)return {ok:!1};let L={phase:"submitting"};v&&(L.selection=v),R&&(L.capture=R),f(L);let N={};v&&(N.selection=v),R&&(N.capture=R);let Qe=await De({config:t.metadata,context:N,...t.user?{user:t.user}:{}}),D={version:1,createdAt:new Date().toISOString(),blocfeed_id:P,message:d,metadata:Qe};k?.category&&(D.category=k.category),t.user&&(D.user=t.user),v&&(D.selection=v),R&&(D.screenshots=R),m&&(D.video=m);let{result:F}=await he({payload:D,signal:T,...t.transport?{transport:t.transport}:{}});if(T.aborted||c!==C)return F;if(F.ok){m&&(URL.revokeObjectURL(m.blobUrl),m=null);let ne={phase:"success",lastSubmit:F};return v&&(ne.selection=v),R&&(ne.capture=R),f(ne),F}Ot(F)&&fe(D);let Ye=F.api?.error??w("unknown",new Error("Submission failed")),te={phase:"error",lastSubmit:F,lastError:Ye};return v&&(te.selection=v),R&&(te.capture=R),f(te),F}catch(R){if(T.aborted||c!==C)return {ok:false};let N={phase:"error",lastError:T.aborted?w("aborted",R):w("unknown",R)};return v&&(N.selection=v),f(N),{ok:false}}finally{c===C&&(s=null);}},async startRecording(){if(n.phase!=="review"||!t.recording?.enabled)return;let d=n.selection,k={phase:"recording",recordingElapsedMs:0};d&&(k.selection=d),f(k);try{let P={config:t.recording};s&&(P.signal=s.signal);let C=await me(P);p=C,C.onTick(U=>{if(n.phase==="recording"){let H={phase:"recording",recordingElapsedMs:U};d&&(H.selection=d),f(H);}});let T=await C.result;p=null,m=T;let v={phase:"review",video:T};d&&(v.selection=d),f(v);}catch(P){p=null;let T={phase:"review",lastError:P?.kind?P:w("recording_failed",P)};d&&(T.selection=d),f(T);}},stopRecording(){n.phase!=="recording"||!p||p.stop();},removeVideo(){m&&(URL.revokeObjectURL(m.blobUrl),m=null);let d=n.selection,k={phase:"review"};d&&(k.selection=d),f(k);},__unsafeGetSelectedElement(){return l},destroy(){E(),r.clear(),o.clear(),h?.(),h=null;}}}var $=[],j=[],We=20,Ke=15,J=[],V={},X=null,Z=null,W=null,ee=false,Ut=["blocfeed.com","google-analytics.com","googletagmanager.com","analytics.google.com","googleads.g.doubleclick.net","googlesyndication.com","googleadservices.com","google.com/pagead","google.com/ads","facebook.net","facebook.com/tr","connect.facebook.net","graph.facebook.com","api.mixpanel.com","api-js.mixpanel.com","api.amplitude.com","api2.amplitude.com","api.segment.io","cdn.segment.com","vars.hotjar.com","in.hotjar.com","script.hotjar.com","heapanalytics.com","fullstory.com/s/fs.js","rs.fullstory.com","app.posthog.com","us.posthog.com","eu.posthog.com","api-iam.intercom.io","widget.intercom.io","sentry.io/api","browser.sentry-cdn.com","browser-intake-datadoghq.com","clarity.ms","js.hs-analytics.net","api.hubapi.com","forms.hubspot.com","plausible.io/api","client.crisp.chat","js.driftt.com","r.logrocket.com","app.pendo.io","events.launchdarkly.com","app.launchdarkly.com","grammarly.com","gnar.grammarly.com","capi.grammarly.com","api.languagetool.org","api.languagetoolplus.com","fonts.googleapis.com","fonts.gstatic.com","cdn.cookielaw.org","consent.cookiebot.com","js.stripe.com","api.stripe.com/v1/tokens","google.com/recaptcha","hcaptcha.com","bam.nr-data.net","rec.smartlook.com","o2.mouseflow.com","api.luckyorange.com","static.zdassets.com","ekr.zdassets.com"];function Ht(e){if(e instanceof Error)return e.message;if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function qt(e,t){let n=t.map(Ht).join(" "),r=t.find(i=>i instanceof Error),o={level:e,message:n.slice(0,2e3),timestamp:Date.now()};for(r?.stack&&(o.stack=r.stack.slice(0,2e3)),$.push(o);$.length>We;)$.shift();}function we(e){let t=e.url.toLowerCase();for(let n of J)if(t.includes(n))return;for(j.push(e);j.length>Ke;)j.shift();}function qn(e={}){if(ee||!b())return;ee=true,We=e.consoleLimit??20,Ke=e.networkLimit??15;let t=e.ignoreUrls;if(t!==void 0?J=t.map(n=>n.toLowerCase()):J=[...Ut],e.console!==false){let n=e.consoleLevels??["error","warn"];for(let r of n)V[r]=console[r],console[r]=(...o)=>{qt(r,o),V[r]?.apply(console,o);};}if(e.network!==false&&typeof window.fetch=="function"){X=window.fetch;let n=X;window.fetch=async function(o,i){let l=typeof o=="string"?o:o instanceof URL?o.toString():o.url,a=(i?.method??"GET").toUpperCase(),s=Date.now();try{let c=await n.call(window,o,i);return c.ok||we({url:l.slice(0,500),method:a,status:c.status,statusText:c.statusText,timestamp:s,durationMs:Date.now()-s}),c}catch(c){throw we({url:l.slice(0,500),method:a,status:0,statusText:c instanceof Error?c.message:"Network error",timestamp:s,durationMs:Date.now()-s}),c}};}if(e.network!==false&&typeof XMLHttpRequest<"u"){Z=XMLHttpRequest.prototype.open,W=XMLHttpRequest.prototype.send;let n=Z,r=W;XMLHttpRequest.prototype.open=function(o,i,...l){return this.__bf_method=o.toUpperCase(),this.__bf_url=String(i),n.apply(this,[o,i,...l])},XMLHttpRequest.prototype.send=function(...o){let i=this.__bf_method||"GET",l=this.__bf_url||"",a=Date.now();return this.addEventListener("loadend",function(){if(this.status>=400||this.status===0){let s={url:l.slice(0,500),method:i,status:this.status,timestamp:a,durationMs:Date.now()-a};this.statusText&&(s.statusText=this.statusText),we(s);}}),r.apply(this,o)};}}function zn(){if(ee){for(let[e,t]of Object.entries(V))console[e]=t;for(let e of Object.keys(V))delete V[e];X&&(window.fetch=X,X=null),Z&&(XMLHttpRequest.prototype.open=Z,Z=null),W&&(XMLHttpRequest.prototype.send=W,W=null),J=[],ee=false;}}function $n(){return {consoleLogs:[...$],networkErrors:[...j]}}function jn(){$=[],j=[];}var zt=[{name:"supabase_service_role_key",pattern:/SUPABASE_SERVICE_ROLE_KEY["'=:\s]+[A-Za-z0-9_.=-]{30,}/},{name:"supabase_db_password",pattern:/SUPABASE_DB_PASSWORD["'=:\s]+[^\s"']{6,}/},{name:"postgres_password",pattern:/POSTGRES_PASSWORD["'=:\s]+[^\s"']{6,}/},{name:"database_url_with_creds",pattern:/(?:postgres|postgresql|mysql|mongodb|redis|amqp):\/\/[^:]+:[^@\s"']+@/},{name:"aws_access_key",pattern:/AKIA[0-9A-Z]{16}/},{name:"aws_secret_key",pattern:/AWS_SECRET_ACCESS_KEY["'=:\s]+[A-Za-z0-9/+=]{30,}/},{name:"aws_session_token",pattern:/AWS_SESSION_TOKEN["'=:\s]+[A-Za-z0-9/+=]{30,}/},{name:"stripe_secret_key",pattern:/sk_live_[a-zA-Z0-9]{10,}/},{name:"stripe_secret_key_test",pattern:/sk_test_[a-zA-Z0-9]{10,}/},{name:"stripe_restricted_key",pattern:/rk_(?:live|test)_[a-zA-Z0-9]{10,}/},{name:"github_pat",pattern:/ghp_[A-Za-z0-9_]{36,}/},{name:"github_oauth",pattern:/gho_[A-Za-z0-9_]{36,}/},{name:"github_user_token",pattern:/ghu_[A-Za-z0-9_]{36,}/},{name:"github_server_token",pattern:/ghs_[A-Za-z0-9_]{36,}/},{name:"github_fine_grained",pattern:/github_pat_[A-Za-z0-9_]{22,}/},{name:"openai_api_key",pattern:/sk-[a-zA-Z0-9]{20,}(?![a-zA-Z0-9_])/},{name:"anthropic_api_key",pattern:/sk-ant-[a-zA-Z0-9\-_]{20,}/},{name:"private_key",pattern:/-----BEGIN (?:RSA |EC |DSA |OPENSSH |PGP )?PRIVATE KEY-----/},{name:"sendgrid_api_key",pattern:/SG\.[a-zA-Z0-9_-]{22,}\.[a-zA-Z0-9_-]{22,}/},{name:"twilio_auth_token",pattern:/TWILIO_AUTH_TOKEN["'=:\s]+[a-f0-9]{32}/},{name:"generic_secret_key",pattern:/[A-Z_]{2,}_SECRET_KEY["'=:\s]+[^\s"']{8,}/},{name:"generic_secret",pattern:/[A-Z_]{2,}_SECRET["'=:\s]+[^\s"']{8,}/},{name:"generic_password",pattern:/[A-Z_]{2,}_PASSWORD["'=:\s]+[^\s"']{6,}/},{name:"generic_private_key_var",pattern:/[A-Z_]{2,}_PRIVATE_KEY["'=:\s]+[^\s"']{8,}/}],I=[],ye=0,be=false;function $t(e){let t=e.slice(0,80);return t.length<=6?"***":t.slice(0,6)+"***"}function jt(e,t,n,r){if(I.some(l=>l.rule===e&&l.source===t))return;let i={rule:e,source:t,hint:$t(n),timestamp:Date.now()};r&&(i.location=r),I.push(i);}function K(e,t,n,r){for(let{name:o,pattern:i}of n){let l=i.exec(e);l&&jt(o,t,l[0],r);}}function Vt(e){try{let t=window;if(t.__NEXT_DATA__){let n=JSON.stringify(t.__NEXT_DATA__);K(n,"hydration",e,"__NEXT_DATA__");}if(t.__NUXT__){let n=JSON.stringify(t.__NUXT__);K(n,"hydration",e,"__NUXT__");}}catch{}}function Xt(e){try{document.querySelectorAll("script:not([src])").forEach((n,r)=>{let o=n.textContent;o&&o.length>0&&K(o,"scripts",e,`inline-script[${r}]`);});}catch{}}function Zt(e){try{document.querySelectorAll("meta[content]").forEach(n=>{let r=n.getAttribute("content"),o=n.getAttribute("name")||n.getAttribute("property")||"";r&&r.length>10&&K(r,"meta",e,o?`meta[${o}]`:void 0);});}catch{}}function Wt(e){try{document.querySelectorAll("[data-api-key], [data-secret], [data-token], [data-password]").forEach(n=>{let r=n.attributes;for(let o=0;o<r.length;o++){let i=r[o];i.name.startsWith("data-")&&i.value.length>10&&K(i.value,"dom",e,`${n.tagName.toLowerCase()}[${i.name}]`);}});}catch{}}function Zn(e={}){if(be||!b()||(be=true,e.secretScan===false))return;let t=[...zt,...e.customPatterns??[]],n=e.scanTargets??["hydration","scripts","meta","dom"];setTimeout(()=>{ye=Date.now(),n.includes("hydration")&&Vt(t),n.includes("scripts")&&Xt(t),n.includes("meta")&&Zt(t),n.includes("dom")&&Wt(t);let r=e.notify??"both";I.length>0&&(r==="console"||r==="both")&&console.warn(`[BlocFeed Security] Found ${I.length} potential secret(s) exposed in client code:`,I.map(o=>`${o.rule} (${o.source}${o.location?`: ${o.location}`:""})`));},100);}function Wn(){return {findings:[...I],scannedAt:ye}}function Kn(){I=[],ye=0,be=false;}
|
|
2
|
+
export{b as a,re as b,Pe as c,Le as d,De as e,fe as f,Be as g,ln as h,un as i,yt as j,Et as k,At as l,me as m,On as n,qn as o,zn as p,$n as q,jn as r,Zn as s,Wn as t,Kn as u};
|
|
@@ -219,6 +219,18 @@ interface VideoIntent {
|
|
|
219
219
|
durationMs: number;
|
|
220
220
|
sizeBytes: number;
|
|
221
221
|
}
|
|
222
|
+
interface ClickEvent {
|
|
223
|
+
/** Ms offset from recording start — maps to video timeline. */
|
|
224
|
+
timestampMs: number;
|
|
225
|
+
/** window.location.pathname at click time. */
|
|
226
|
+
path: string;
|
|
227
|
+
/** HTML tag name (lowercase). */
|
|
228
|
+
tagName: string;
|
|
229
|
+
/** Text content (truncated). */
|
|
230
|
+
textSnippet?: string;
|
|
231
|
+
/** React/annotated component name. */
|
|
232
|
+
componentName?: string;
|
|
233
|
+
}
|
|
222
234
|
interface CaptureConfig {
|
|
223
235
|
element?: boolean;
|
|
224
236
|
fullPage?: boolean;
|
|
@@ -334,6 +346,8 @@ interface FeedbackPayload {
|
|
|
334
346
|
video?: VideoAsset;
|
|
335
347
|
/** Lightweight video metadata sent instead of the blob. */
|
|
336
348
|
video_intent?: VideoIntent;
|
|
349
|
+
/** Click events captured during video recording. */
|
|
350
|
+
click_events?: ClickEvent[];
|
|
337
351
|
/** First-class user identity. */
|
|
338
352
|
user?: BlocFeedUser;
|
|
339
353
|
metadata: Record<string, unknown>;
|
|
@@ -395,4 +409,4 @@ interface BlocFeedController {
|
|
|
395
409
|
}
|
|
396
410
|
declare function createBlocFeedController(config: BlocFeedConfig): BlocFeedController;
|
|
397
411
|
|
|
398
|
-
export { type VideoMime as A, type BlocFeedConfig as B, type CaptureConfig as C, type DiagnosticsConfig as D, type ElementDescriptor as E, type FeedbackCategory as F, type
|
|
412
|
+
export { type VideoMime as A, type BlocFeedConfig as B, type CaptureConfig as C, type DiagnosticsConfig as D, type ElementDescriptor as E, type FeedbackCategory as F, type ClickEvent as G, type HoverListener as H, type ImageAsset as I, type StateListener as J, createBlocFeedController as K, type MaybePromise as M, type NetworkEntry as N, type PickerConfig as P, type RecordingConfig as R, type SubmitResult as S, type ThemeConfig as T, type VideoAsset as V, type WidgetPosition as W, type BlocFeedHandle as a, type BlocFeedState as b, type BlocFeedController as c, type BlocFeedError as d, type BlocFeedStrings as e, type BlocFeedUser as f, type CaptureDiagnostics as g, type CaptureResult as h, type ConsoleEntry as i, type FeedbackApiResponse as j, type FeedbackPayload as k, type MetadataConfig as l, type MetadataContext as m, type Rect as n, type ScreenshotAdapter as o, type ScreenshotAdapterOptions as p, type ScreenshotIntent as q, type ScreenshotMime as r, type SecurityConfig as s, type SecurityFinding as t, type SecuritySnapshot as u, type SessionPhase as v, type TransportConfig as w, type TransportResult as x, type TriggerStyle as y, type VideoIntent as z };
|
|
@@ -219,6 +219,18 @@ interface VideoIntent {
|
|
|
219
219
|
durationMs: number;
|
|
220
220
|
sizeBytes: number;
|
|
221
221
|
}
|
|
222
|
+
interface ClickEvent {
|
|
223
|
+
/** Ms offset from recording start — maps to video timeline. */
|
|
224
|
+
timestampMs: number;
|
|
225
|
+
/** window.location.pathname at click time. */
|
|
226
|
+
path: string;
|
|
227
|
+
/** HTML tag name (lowercase). */
|
|
228
|
+
tagName: string;
|
|
229
|
+
/** Text content (truncated). */
|
|
230
|
+
textSnippet?: string;
|
|
231
|
+
/** React/annotated component name. */
|
|
232
|
+
componentName?: string;
|
|
233
|
+
}
|
|
222
234
|
interface CaptureConfig {
|
|
223
235
|
element?: boolean;
|
|
224
236
|
fullPage?: boolean;
|
|
@@ -334,6 +346,8 @@ interface FeedbackPayload {
|
|
|
334
346
|
video?: VideoAsset;
|
|
335
347
|
/** Lightweight video metadata sent instead of the blob. */
|
|
336
348
|
video_intent?: VideoIntent;
|
|
349
|
+
/** Click events captured during video recording. */
|
|
350
|
+
click_events?: ClickEvent[];
|
|
337
351
|
/** First-class user identity. */
|
|
338
352
|
user?: BlocFeedUser;
|
|
339
353
|
metadata: Record<string, unknown>;
|
|
@@ -395,4 +409,4 @@ interface BlocFeedController {
|
|
|
395
409
|
}
|
|
396
410
|
declare function createBlocFeedController(config: BlocFeedConfig): BlocFeedController;
|
|
397
411
|
|
|
398
|
-
export { type VideoMime as A, type BlocFeedConfig as B, type CaptureConfig as C, type DiagnosticsConfig as D, type ElementDescriptor as E, type FeedbackCategory as F, type
|
|
412
|
+
export { type VideoMime as A, type BlocFeedConfig as B, type CaptureConfig as C, type DiagnosticsConfig as D, type ElementDescriptor as E, type FeedbackCategory as F, type ClickEvent as G, type HoverListener as H, type ImageAsset as I, type StateListener as J, createBlocFeedController as K, type MaybePromise as M, type NetworkEntry as N, type PickerConfig as P, type RecordingConfig as R, type SubmitResult as S, type ThemeConfig as T, type VideoAsset as V, type WidgetPosition as W, type BlocFeedHandle as a, type BlocFeedState as b, type BlocFeedController as c, type BlocFeedError as d, type BlocFeedStrings as e, type BlocFeedUser as f, type CaptureDiagnostics as g, type CaptureResult as h, type ConsoleEntry as i, type FeedbackApiResponse as j, type FeedbackPayload as k, type MetadataConfig as l, type MetadataContext as m, type Rect as n, type ScreenshotAdapter as o, type ScreenshotAdapterOptions as p, type ScreenshotIntent as q, type ScreenshotMime as r, type SecurityConfig as s, type SecurityFinding as t, type SecuritySnapshot as u, type SessionPhase as v, type TransportConfig as w, type TransportResult as x, type TriggerStyle as y, type VideoIntent as z };
|
package/dist/engine.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkEFTA67IW_cjs=require('./chunk-EFTA67IW.cjs');function c(o){if(o?.aborted)throw new Error("Aborted")}async function k(o){return await new Promise((t,e)=>{let r=new Image;r.onload=()=>t({width:r.naturalWidth,height:r.naturalHeight}),r.onerror=()=>e(new Error("Failed to load generated screenshot")),r.src=o;})}async function l(o,t){let{width:e,height:r}=await k(o);return {dataUrl:o,mime:t,width:e,height:r}}function T(o){return {async captureElement(t,e){if(!chunkEFTA67IW_cjs.a())throw new Error("captureElement can only run in the browser");c(e.signal);let r={scale:e.pixelRatio},n=e.mime==="image/jpeg"?await o.domToJpeg(t,{...r,quality:e.quality??.92}):await o.domToPng(t,r);return c(e.signal),await l(n,e.mime)},async captureFullPage(t){if(!chunkEFTA67IW_cjs.a())throw new Error("captureFullPage can only run in the browser");c(t.signal);let e=document.documentElement,r=Math.max(e.scrollWidth,e.clientWidth),n=Math.max(e.scrollHeight,e.clientHeight),a=Math.min(1,t.maxDimension/Math.max(r,n)),s={width:Math.max(1,Math.round(r*a)),height:Math.max(1,Math.round(n*a)),scale:t.pixelRatio},i=t.mime==="image/jpeg"?await o.domToJpeg(e,{...s,quality:t.quality??.92}):await o.domToPng(e,s);return c(t.signal),await l(i,t.mime)}}}function q(o){let[t,e]=o.split(",",2);if(!t||!e)throw new Error("Invalid data URL");let n=/data:(.*?);base64/.exec(t)?.[1]||"application/octet-stream",a=atob(e),s=new Uint8Array(a.length);for(let i=0;i<a.length;i+=1)s[i]=a.charCodeAt(i);return new Blob([s],{type:n})}Object.defineProperty(exports,"clearClickEvents",{enumerable:true,get:function(){return chunkEFTA67IW_cjs.k}});Object.defineProperty(exports,"clearDiagnostics",{enumerable:true,get:function(){return chunkEFTA67IW_cjs.r}});Object.defineProperty(exports,"clearQueue",{enumerable:true,get:function(){return chunkEFTA67IW_cjs.h}});Object.defineProperty(exports,"clearSecurityFindings",{enumerable:true,get:function(){return chunkEFTA67IW_cjs.u}});Object.defineProperty(exports,"collectMetadata",{enumerable:true,get:function(){return chunkEFTA67IW_cjs.e}});Object.defineProperty(exports,"createBlocFeedController",{enumerable:true,get:function(){return chunkEFTA67IW_cjs.n}});Object.defineProperty(exports,"createHtmlToImageAdapter",{enumerable:true,get:function(){return chunkEFTA67IW_cjs.c}});Object.defineProperty(exports,"dequeueAll",{enumerable:true,get:function(){return chunkEFTA67IW_cjs.g}});Object.defineProperty(exports,"drainClickEvents",{enumerable:true,get:function(){return chunkEFTA67IW_cjs.j}});Object.defineProperty(exports,"drainDiagnostics",{enumerable:true,get:function(){return chunkEFTA67IW_cjs.q}});Object.defineProperty(exports,"enqueue",{enumerable:true,get:function(){return chunkEFTA67IW_cjs.f}});Object.defineProperty(exports,"getQueueSize",{enumerable:true,get:function(){return chunkEFTA67IW_cjs.i}});Object.defineProperty(exports,"getSecurityFindings",{enumerable:true,get:function(){return chunkEFTA67IW_cjs.t}});Object.defineProperty(exports,"installDiagnostics",{enumerable:true,get:function(){return chunkEFTA67IW_cjs.o}});Object.defineProperty(exports,"isRecordingSupported",{enumerable:true,get:function(){return chunkEFTA67IW_cjs.l}});Object.defineProperty(exports,"runCapture",{enumerable:true,get:function(){return chunkEFTA67IW_cjs.d}});Object.defineProperty(exports,"runSecretScan",{enumerable:true,get:function(){return chunkEFTA67IW_cjs.s}});Object.defineProperty(exports,"startRecording",{enumerable:true,get:function(){return chunkEFTA67IW_cjs.m}});Object.defineProperty(exports,"uninstallDiagnostics",{enumerable:true,get:function(){return chunkEFTA67IW_cjs.p}});exports.createModernScreenshotAdapter=T;exports.dataUrlToBlob=q;
|
package/dist/engine.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { o as ScreenshotAdapter, C as CaptureConfig, h as CaptureResult, V as VideoAsset, R as RecordingConfig, l as MetadataConfig, m as MetadataContext, f as BlocFeedUser, k as FeedbackPayload, u as SecuritySnapshot, s as SecurityConfig } from './controller-
|
|
2
|
-
export { B as BlocFeedConfig, c as BlocFeedController, d as BlocFeedError, a as BlocFeedHandle, b as BlocFeedState, e as BlocFeedStrings, i as ConsoleEntry, D as DiagnosticsConfig, E as ElementDescriptor, j as FeedbackApiResponse, F as FeedbackCategory, H as HoverListener, I as ImageAsset, N as NetworkEntry, n as Rect, p as ScreenshotAdapterOptions, q as ScreenshotIntent, r as ScreenshotMime, t as SecurityFinding, v as SessionPhase,
|
|
1
|
+
import { o as ScreenshotAdapter, C as CaptureConfig, h as CaptureResult, V as VideoAsset, R as RecordingConfig, G as ClickEvent, l as MetadataConfig, m as MetadataContext, f as BlocFeedUser, k as FeedbackPayload, u as SecuritySnapshot, s as SecurityConfig } from './controller-C6M-ge3K.cjs';
|
|
2
|
+
export { B as BlocFeedConfig, c as BlocFeedController, d as BlocFeedError, a as BlocFeedHandle, b as BlocFeedState, e as BlocFeedStrings, i as ConsoleEntry, D as DiagnosticsConfig, E as ElementDescriptor, j as FeedbackApiResponse, F as FeedbackCategory, H as HoverListener, I as ImageAsset, N as NetworkEntry, n as Rect, p as ScreenshotAdapterOptions, q as ScreenshotIntent, r as ScreenshotMime, t as SecurityFinding, v as SessionPhase, J as StateListener, S as SubmitResult, T as ThemeConfig, w as TransportConfig, y as TriggerStyle, z as VideoIntent, A as VideoMime, W as WidgetPosition, K as createBlocFeedController } from './controller-C6M-ge3K.cjs';
|
|
3
3
|
|
|
4
4
|
declare function createHtmlToImageAdapter(): ScreenshotAdapter;
|
|
5
5
|
|
|
@@ -65,6 +65,9 @@ declare function startRecording(params: {
|
|
|
65
65
|
signal?: AbortSignal;
|
|
66
66
|
}): Promise<RecordingSession>;
|
|
67
67
|
|
|
68
|
+
declare function drainClickEvents(): ClickEvent[];
|
|
69
|
+
declare function clearClickEvents(): void;
|
|
70
|
+
|
|
68
71
|
declare function collectMetadata(params: {
|
|
69
72
|
config: MetadataConfig | undefined;
|
|
70
73
|
context: MetadataContext;
|
|
@@ -159,4 +162,4 @@ declare function clearSecurityFindings(): void;
|
|
|
159
162
|
|
|
160
163
|
declare function dataUrlToBlob(dataUrl: string): Blob;
|
|
161
164
|
|
|
162
|
-
export { BlocFeedUser, CaptureResult, FeedbackPayload, type ModernScreenshotModule, RecordingConfig, type RecordingSession, ScreenshotAdapter, SecurityConfig, SecuritySnapshot, VideoAsset, clearDiagnostics, clearQueue, clearSecurityFindings, collectMetadata, createHtmlToImageAdapter, createModernScreenshotAdapter, dataUrlToBlob, dequeueAll, drainDiagnostics, enqueue, getQueueSize, getSecurityFindings, installDiagnostics, isRecordingSupported, runCapture, runSecretScan, startRecording, uninstallDiagnostics };
|
|
165
|
+
export { BlocFeedUser, CaptureResult, ClickEvent, FeedbackPayload, type ModernScreenshotModule, RecordingConfig, type RecordingSession, ScreenshotAdapter, SecurityConfig, SecuritySnapshot, VideoAsset, clearClickEvents, clearDiagnostics, clearQueue, clearSecurityFindings, collectMetadata, createHtmlToImageAdapter, createModernScreenshotAdapter, dataUrlToBlob, dequeueAll, drainClickEvents, drainDiagnostics, enqueue, getQueueSize, getSecurityFindings, installDiagnostics, isRecordingSupported, runCapture, runSecretScan, startRecording, uninstallDiagnostics };
|
package/dist/engine.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { o as ScreenshotAdapter, C as CaptureConfig, h as CaptureResult, V as VideoAsset, R as RecordingConfig, l as MetadataConfig, m as MetadataContext, f as BlocFeedUser, k as FeedbackPayload, u as SecuritySnapshot, s as SecurityConfig } from './controller-
|
|
2
|
-
export { B as BlocFeedConfig, c as BlocFeedController, d as BlocFeedError, a as BlocFeedHandle, b as BlocFeedState, e as BlocFeedStrings, i as ConsoleEntry, D as DiagnosticsConfig, E as ElementDescriptor, j as FeedbackApiResponse, F as FeedbackCategory, H as HoverListener, I as ImageAsset, N as NetworkEntry, n as Rect, p as ScreenshotAdapterOptions, q as ScreenshotIntent, r as ScreenshotMime, t as SecurityFinding, v as SessionPhase,
|
|
1
|
+
import { o as ScreenshotAdapter, C as CaptureConfig, h as CaptureResult, V as VideoAsset, R as RecordingConfig, G as ClickEvent, l as MetadataConfig, m as MetadataContext, f as BlocFeedUser, k as FeedbackPayload, u as SecuritySnapshot, s as SecurityConfig } from './controller-C6M-ge3K.js';
|
|
2
|
+
export { B as BlocFeedConfig, c as BlocFeedController, d as BlocFeedError, a as BlocFeedHandle, b as BlocFeedState, e as BlocFeedStrings, i as ConsoleEntry, D as DiagnosticsConfig, E as ElementDescriptor, j as FeedbackApiResponse, F as FeedbackCategory, H as HoverListener, I as ImageAsset, N as NetworkEntry, n as Rect, p as ScreenshotAdapterOptions, q as ScreenshotIntent, r as ScreenshotMime, t as SecurityFinding, v as SessionPhase, J as StateListener, S as SubmitResult, T as ThemeConfig, w as TransportConfig, y as TriggerStyle, z as VideoIntent, A as VideoMime, W as WidgetPosition, K as createBlocFeedController } from './controller-C6M-ge3K.js';
|
|
3
3
|
|
|
4
4
|
declare function createHtmlToImageAdapter(): ScreenshotAdapter;
|
|
5
5
|
|
|
@@ -65,6 +65,9 @@ declare function startRecording(params: {
|
|
|
65
65
|
signal?: AbortSignal;
|
|
66
66
|
}): Promise<RecordingSession>;
|
|
67
67
|
|
|
68
|
+
declare function drainClickEvents(): ClickEvent[];
|
|
69
|
+
declare function clearClickEvents(): void;
|
|
70
|
+
|
|
68
71
|
declare function collectMetadata(params: {
|
|
69
72
|
config: MetadataConfig | undefined;
|
|
70
73
|
context: MetadataContext;
|
|
@@ -159,4 +162,4 @@ declare function clearSecurityFindings(): void;
|
|
|
159
162
|
|
|
160
163
|
declare function dataUrlToBlob(dataUrl: string): Blob;
|
|
161
164
|
|
|
162
|
-
export { BlocFeedUser, CaptureResult, FeedbackPayload, type ModernScreenshotModule, RecordingConfig, type RecordingSession, ScreenshotAdapter, SecurityConfig, SecuritySnapshot, VideoAsset, clearDiagnostics, clearQueue, clearSecurityFindings, collectMetadata, createHtmlToImageAdapter, createModernScreenshotAdapter, dataUrlToBlob, dequeueAll, drainDiagnostics, enqueue, getQueueSize, getSecurityFindings, installDiagnostics, isRecordingSupported, runCapture, runSecretScan, startRecording, uninstallDiagnostics };
|
|
165
|
+
export { BlocFeedUser, CaptureResult, ClickEvent, FeedbackPayload, type ModernScreenshotModule, RecordingConfig, type RecordingSession, ScreenshotAdapter, SecurityConfig, SecuritySnapshot, VideoAsset, clearClickEvents, clearDiagnostics, clearQueue, clearSecurityFindings, collectMetadata, createHtmlToImageAdapter, createModernScreenshotAdapter, dataUrlToBlob, dequeueAll, drainClickEvents, drainDiagnostics, enqueue, getQueueSize, getSecurityFindings, installDiagnostics, isRecordingSupported, runCapture, runSecretScan, startRecording, uninstallDiagnostics };
|
package/dist/engine.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-QL6DSCNT.js';export{k as clearClickEvents,r as clearDiagnostics,h as clearQueue,u as clearSecurityFindings,e as collectMetadata,n as createBlocFeedController,c as createHtmlToImageAdapter,g as dequeueAll,j as drainClickEvents,q as drainDiagnostics,f as enqueue,i as getQueueSize,t as getSecurityFindings,o as installDiagnostics,l as isRecordingSupported,d as runCapture,s as runSecretScan,m as startRecording,p as uninstallDiagnostics}from'./chunk-QL6DSCNT.js';function c(o){if(o?.aborted)throw new Error("Aborted")}async function k(o){return await new Promise((t,e)=>{let r=new Image;r.onload=()=>t({width:r.naturalWidth,height:r.naturalHeight}),r.onerror=()=>e(new Error("Failed to load generated screenshot")),r.src=o;})}async function l(o,t){let{width:e,height:r}=await k(o);return {dataUrl:o,mime:t,width:e,height:r}}function T(o){return {async captureElement(t,e){if(!a())throw new Error("captureElement can only run in the browser");c(e.signal);let r={scale:e.pixelRatio},n=e.mime==="image/jpeg"?await o.domToJpeg(t,{...r,quality:e.quality??.92}):await o.domToPng(t,r);return c(e.signal),await l(n,e.mime)},async captureFullPage(t){if(!a())throw new Error("captureFullPage can only run in the browser");c(t.signal);let e=document.documentElement,r=Math.max(e.scrollWidth,e.clientWidth),n=Math.max(e.scrollHeight,e.clientHeight),a$1=Math.min(1,t.maxDimension/Math.max(r,n)),s={width:Math.max(1,Math.round(r*a$1)),height:Math.max(1,Math.round(n*a$1)),scale:t.pixelRatio},i=t.mime==="image/jpeg"?await o.domToJpeg(e,{...s,quality:t.quality??.92}):await o.domToPng(e,s);return c(t.signal),await l(i,t.mime)}}}function q(o){let[t,e]=o.split(",",2);if(!t||!e)throw new Error("Invalid data URL");let n=/data:(.*?);base64/.exec(t)?.[1]||"application/octet-stream",a=atob(e),s=new Uint8Array(a.length);for(let i=0;i<a.length;i+=1)s[i]=a.charCodeAt(i);return new Blob([s],{type:n})}export{T as createModernScreenshotAdapter,q as dataUrlToBlob};
|
package/dist/main.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
'use strict';var
|
|
2
|
+
'use strict';var chunkEFTA67IW_cjs=require('./chunk-EFTA67IW.cjs'),react=require('react'),jsxRuntime=require('react/jsx-runtime'),reactDom=require('react-dom'),framerMotion=require('framer-motion');var U=react.createContext(null);function te(e){let t=react.useMemo(()=>chunkEFTA67IW_cjs.n({...e.config??{},blocfeed_id:e.blocfeed_id}),[]),[i,o]=react.useState(()=>t.getState());return react.useEffect(()=>t.subscribe(o),[t]),react.useEffect(()=>t.setConfig({...e.config??{},blocfeed_id:e.blocfeed_id}),[t,e.config,e.blocfeed_id]),react.useEffect(()=>()=>t.destroy(),[t]),jsxRuntime.jsx(U.Provider,{value:{controller:t,state:i},children:e.children})}var Te="blocfeed-styles-v1",Tt=`
|
|
3
3
|
:where([data-blocfeed-ui-root]),
|
|
4
4
|
:where([data-blocfeed-ui-root]) * {
|
|
5
5
|
box-sizing: border-box;
|
|
@@ -705,6 +705,70 @@
|
|
|
705
705
|
padding: 4px 8px;
|
|
706
706
|
}
|
|
707
707
|
|
|
708
|
+
/* ------------------------------------------------------------------ */
|
|
709
|
+
/* Floating recording bar (shown during active recording) */
|
|
710
|
+
/* ------------------------------------------------------------------ */
|
|
711
|
+
|
|
712
|
+
:where([data-blocfeed-ui-root]) .bf-recording-bar {
|
|
713
|
+
position: fixed;
|
|
714
|
+
z-index: var(--bf-z);
|
|
715
|
+
display: flex;
|
|
716
|
+
align-items: center;
|
|
717
|
+
gap: 10px;
|
|
718
|
+
padding: 8px 14px;
|
|
719
|
+
border-radius: 20px;
|
|
720
|
+
background: var(--bf-bg);
|
|
721
|
+
border: 1px solid var(--bf-danger);
|
|
722
|
+
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(239, 68, 68, 0.25);
|
|
723
|
+
font-size: 13px;
|
|
724
|
+
color: var(--bf-fg);
|
|
725
|
+
pointer-events: auto;
|
|
726
|
+
animation: bf-slideUp 0.2s ease-out;
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
:where([data-blocfeed-ui-root]) .bf-recording-bar.bf-pos-bottom-right {
|
|
730
|
+
bottom: 24px;
|
|
731
|
+
right: 24px;
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
:where([data-blocfeed-ui-root]) .bf-recording-bar.bf-pos-bottom-left {
|
|
735
|
+
bottom: 24px;
|
|
736
|
+
left: 24px;
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
:where([data-blocfeed-ui-root]) .bf-recording-bar.bf-pos-top-right {
|
|
740
|
+
top: 24px;
|
|
741
|
+
right: 24px;
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
:where([data-blocfeed-ui-root]) .bf-recording-bar.bf-pos-top-left {
|
|
745
|
+
top: 24px;
|
|
746
|
+
left: 24px;
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
:where([data-blocfeed-ui-root]) .bf-recording-bar-timer {
|
|
750
|
+
color: var(--bf-danger);
|
|
751
|
+
font-weight: 500;
|
|
752
|
+
font-variant-numeric: tabular-nums;
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
:where([data-blocfeed-ui-root]) .bf-recording-bar-stop {
|
|
756
|
+
padding: 4px 12px;
|
|
757
|
+
border-radius: 12px;
|
|
758
|
+
border: 1px solid var(--bf-danger);
|
|
759
|
+
background: transparent;
|
|
760
|
+
color: var(--bf-danger);
|
|
761
|
+
font-size: 12px;
|
|
762
|
+
font-weight: 600;
|
|
763
|
+
cursor: pointer;
|
|
764
|
+
transition: background 0.15s, color 0.15s;
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
:where([data-blocfeed-ui-root]) .bf-recording-bar-stop:hover {
|
|
768
|
+
background: var(--bf-danger);
|
|
769
|
+
color: #fff;
|
|
770
|
+
}
|
|
771
|
+
|
|
708
772
|
/* ------------------------------------------------------------------ */
|
|
709
773
|
/* Watermark */
|
|
710
774
|
/* ------------------------------------------------------------------ */
|
|
@@ -734,9 +798,10 @@
|
|
|
734
798
|
:where([data-blocfeed-ui-root]) .bf-toast,
|
|
735
799
|
:where([data-blocfeed-ui-root]) .bf-hint,
|
|
736
800
|
:where([data-blocfeed-ui-root]) .bf-cursor,
|
|
737
|
-
:where([data-blocfeed-ui-root]) .bf-rec-dot-pulse
|
|
801
|
+
:where([data-blocfeed-ui-root]) .bf-rec-dot-pulse,
|
|
802
|
+
:where([data-blocfeed-ui-root]) .bf-recording-bar {
|
|
738
803
|
animation: none;
|
|
739
804
|
}
|
|
740
805
|
}
|
|
741
|
-
`;function Te(){if(!chunkORVW2RTZ_cjs.a()||document.getElementById(ke))return;let e=document.createElement("style");e.id=ke,e.textContent=kt,document.head.appendChild(e);}var Se={triggerLabel:"Feedback",panelTitle:"Feedback",hintText:"Click an element to attach your feedback. Press Esc to cancel.",cancelButton:"Cancel",rePickButton:"Re-pick",closeButton:"Close",textareaPlaceholder:"What's happening? What did you expect?",screenshotElement:"Screenshot element",screenshotFullPage:"Full page",capturingText:"Capturing screenshots\u2026",submittingText:"Submitting\u2026",successText:"Sent. Thank you!",toastText:"Feedback sent",sendButton:"Send",categoryBug:"Bug",categoryFeature:"Feature",categoryUx:"UX",categoryGeneral:"General",recordButton:"Record",stopRecordButton:"Stop",recordingText:"Recording\u2026",recordingDeniedText:"Screen share was denied",videoPreviewLabel:"Video attached",removeVideoButton:"Remove"};function Pe(e){return e?{...Se,...e}:Se}function te(){let e=react.useContext(V);if(!e)throw new Error("useBlocFeed must be used within a <BlocFeedProvider />");return {state:e.state,controller:e.controller,start:e.controller.start,stop:e.controller.stop,clearSelection:e.controller.clearSelection,submit:e.controller.submit,startRecording:e.controller.startRecording,stopRecording:e.controller.stopRecording,removeVideo:e.controller.removeVideo}}function v(e){switch(e){case "bottom-left":return "bf-trigger bf-trigger-bl";case "top-right":return "bf-trigger bf-trigger-tr";case "top-left":return "bf-trigger bf-trigger-tl";default:return "bf-trigger"}}function g({size:e=14}){return jsxRuntime.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:jsxRuntime.jsx("path",{d:"M20 6L9 17l-5-5",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ce({size:e=14}){return jsxRuntime.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:jsxRuntime.jsx("path",{d:"M21 11.5a8.38 8.38 0 01-.9 3.8 8.5 8.5 0 01-7.6 4.7 8.38 8.38 0 01-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 01-.9-3.8 8.5 8.5 0 014.7-7.6 8.38 8.38 0 013.8-.9h.5a8.48 8.48 0 018 8v.5z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ee({size:e=16}){return jsxRuntime.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[jsxRuntime.jsx("path",{d:"M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M22 6l-10 7L2 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Fe({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){return i?jsxRuntime.jsxs("button",{className:v(e),type:"button",onClick:t,"aria-label":o,children:[l?jsxRuntime.jsx("span",{style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(g,{size:14})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"bf-dot","aria-hidden":"true"}),o]}),a>0&&jsxRuntime.jsx("span",{className:"bf-badge","aria-label":`${a} queued`,children:a})]}):null}function m(){let[e,t]=react.useState(()=>typeof window>"u"?false:window.matchMedia("(prefers-reduced-motion: reduce)").matches);return react.useEffect(()=>{let i=window.matchMedia("(prefers-reduced-motion: reduce)"),o=a=>t(a.matches);return i.addEventListener("change",o),()=>i.removeEventListener("change",o)},[]),e}var Ft={duration:.18,ease:"easeOut"},Nt={duration:0};function Re({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=react.useState(false),r=m(),s=r?Nt:Ft;return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:i&&jsxRuntime.jsx(framerMotion.motion.button,{className:v(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":o,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:s,whileTap:{scale:.92},style:{overflow:"hidden"},children:l?jsxRuntime.jsx(framerMotion.motion.span,{initial:{scale:0},animate:{scale:1},transition:s,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(g,{size:14})},"success"):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.span,{className:"bf-dot","aria-hidden":"true",animate:r?{}:{scale:n?1:[1,1.2,1],boxShadow:n?"0 0 0 4px rgba(99, 102, 241, 0.18)":["0 0 0 4px rgba(99, 102, 241, 0.18)","0 0 0 8px rgba(99, 102, 241, 0.28)","0 0 0 4px rgba(99, 102, 241, 0.18)"]},transition:n||r?s:{duration:2,repeat:1/0,ease:"easeInOut"}}),jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:n&&jsxRuntime.jsx(framerMotion.motion.span,{initial:{opacity:0,x:r?0:-6},animate:{opacity:1,x:0},exit:{opacity:0,x:r?0:-6},transition:s,style:{whiteSpace:"nowrap"},children:o},"label")}),a>0&&jsxRuntime.jsx("span",{className:"bf-badge","aria-label":`${a} queued`,children:a})]})},"dot")})}var zt={duration:.18,ease:"easeOut"},Le={duration:0};function Ae({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=react.useState(false),r=m(),s=r?Le:zt;return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:i&&jsxRuntime.jsxs(framerMotion.motion.div,{className:v(e),initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{y:8,opacity:0},transition:s,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),style:{background:"transparent",border:"none",boxShadow:"none",padding:0},children:[jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:n&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:r?0:4},animate:{opacity:1,y:0},exit:{opacity:0,y:r?0:4},transition:s,style:{position:"absolute",bottom:"calc(100% + 8px)",left:"50%",transform:"translateX(-50%)",padding:"6px 12px",borderRadius:"8px",background:"var(--bf-panel-bg)",border:"1px solid var(--bf-border)",boxShadow:"var(--bf-shadow)",whiteSpace:"nowrap",fontSize:"12px",color:"var(--bf-panel-fg)",pointerEvents:"none"},children:o},"tooltip")}),jsxRuntime.jsxs(framerMotion.motion.button,{type:"button",onClick:t,"aria-label":o,style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",width:"40px",height:"40px",borderRadius:"50%",border:"1px solid var(--bf-border)",background:"var(--bf-panel-bg)",color:"var(--bf-panel-fg)",boxShadow:"var(--bf-shadow)",cursor:"pointer",padding:0},animate:r?{}:{y:[0,-3,0]},transition:r?Le:{y:{duration:3,repeat:1/0,ease:"easeInOut"}},whileHover:{scale:1.1,borderColor:"var(--bf-accent)"},whileTap:{scale:.9},children:[l?jsxRuntime.jsx(framerMotion.motion.span,{initial:{scale:0},animate:{scale:1},transition:s,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(g,{size:16})},"success"):jsxRuntime.jsx(Ce,{size:16}),a>0&&jsxRuntime.jsx("span",{className:"bf-badge bf-badge-float","aria-label":`${a} queued`,children:a})]})]},"bubble")})}var Wt={duration:.2,ease:"easeOut"},_t={duration:0};function We(e){return e==="bottom-left"||e==="top-left"}function Ht(e){return `bf-trigger-edge ${We(e)?"bf-trigger-edge-left":"bf-trigger-edge-right"}`}function _e({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=react.useState(false),r=We(e),s=m(),h=s?_t:Wt;return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:i&&jsxRuntime.jsx(framerMotion.motion.button,{className:Ht(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":o,initial:{opacity:0,width:0},animate:{opacity:1,width:n?140:22,height:n?40:90},exit:{width:0,opacity:0},transition:h,whileTap:{scale:.97},style:{top:"50%",translateY:"-50%"},children:l?jsxRuntime.jsx(framerMotion.motion.span,{initial:{scale:0},animate:{scale:1},transition:h,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(g,{size:14})},"success"):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(framerMotion.motion.span,{animate:{rotate:s||n?0:r?-90:90,opacity:n?1:.6},transition:h,style:{display:"flex",alignItems:"center",gap:"8px",whiteSpace:"nowrap",fontSize:"12px",letterSpacing:"0.5px",textTransform:"uppercase"},children:[n&&jsxRuntime.jsx(framerMotion.motion.span,{initial:{scale:0},animate:{scale:1},transition:{duration:.12},style:{width:"6px",height:"6px",borderRadius:"50%",background:"var(--bf-accent)",flexShrink:0}}),o]}),jsxRuntime.jsx(framerMotion.motion.span,{"aria-hidden":"true",animate:{opacity:n?1:0},transition:{duration:.12},style:{position:"absolute",top:0,bottom:0,[r?"left":"right"]:0,width:"2px",background:"var(--bf-accent)"}}),a>0&&jsxRuntime.jsx("span",{className:"bf-badge","aria-label":`${a} queued`,children:a})]})},"edge-tab")})}var $t={duration:.18,ease:"easeOut"},Kt={duration:0};function Oe({delay:e,hovered:t,reduced:i}){return i?null:jsxRuntime.jsx(framerMotion.motion.span,{"aria-hidden":"true",style:{position:"absolute",width:"10px",height:"10px",borderRadius:"50%",border:"2px solid var(--bf-accent)",pointerEvents:"none"},animate:t?{scale:1,opacity:0}:{scale:[1,1.8],opacity:[.5,0]},transition:t?{duration:.15}:{duration:2,repeat:1/0,delay:e,ease:"easeOut"}})}function $e({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=react.useState(false),r=m(),s=r?Kt:$t;return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:i&&jsxRuntime.jsx(framerMotion.motion.button,{className:v(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":o,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:s,whileTap:{scale:.92},style:{overflow:"hidden"},children:l?jsxRuntime.jsx(framerMotion.motion.span,{initial:{scale:0},animate:{scale:1},transition:s,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(g,{size:14})},"success"):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("span",{style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",width:"10px",height:"10px",flexShrink:0},children:[jsxRuntime.jsx(Oe,{delay:0,hovered:n,reduced:r}),jsxRuntime.jsx(Oe,{delay:.7,hovered:n,reduced:r}),jsxRuntime.jsx(framerMotion.motion.span,{className:"bf-dot","aria-hidden":"true",style:{position:"relative",zIndex:1}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:n&&jsxRuntime.jsx(framerMotion.motion.span,{initial:{opacity:0,x:r?0:-6},animate:{opacity:1,x:0},exit:{opacity:0,x:r?0:-6},transition:s,style:{whiteSpace:"nowrap"},children:o},"label")}),a>0&&jsxRuntime.jsx("span",{className:"bf-badge","aria-label":`${a} queued`,children:a})]})},"pulse-ring")})}var Yt={duration:.18,ease:"easeOut"},Gt={duration:0};function jt(e){switch(e){case "bottom-left":return "bf-trigger-minimal bf-trigger-bl";case "top-right":return "bf-trigger-minimal bf-trigger-tr";case "top-left":return "bf-trigger-minimal bf-trigger-tl";default:return "bf-trigger-minimal"}}function Ue({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=react.useState(false),r=m(),s=r?Gt:Yt;return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:i&&jsxRuntime.jsxs(framerMotion.motion.button,{className:jt(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":o,initial:{opacity:0,y:r?0:5},animate:{opacity:n?1:.65,y:0},exit:{opacity:0,y:r?0:5},transition:s,whileTap:{scale:.95},children:[l?jsxRuntime.jsx("span",{style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(g,{size:14})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{children:o}),a>0&&jsxRuntime.jsx("span",{className:"bf-badge",style:{marginLeft:"4px"},"aria-label":`${a} queued`,children:a})]}),!r&&jsxRuntime.jsx(framerMotion.motion.span,{"aria-hidden":"true",style:{position:"absolute",bottom:4,left:4,right:4,height:"2px",background:"var(--bf-accent)",borderRadius:"1px",transformOrigin:"left"},initial:false,animate:{scaleX:n?1:0},transition:s})]},"minimal")})}var Jt={duration:.18,ease:"easeOut"},Zt={duration:0};function Ye({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=react.useState(false),r=m(),s=r?Zt:Jt;return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:i&&jsxRuntime.jsx(framerMotion.motion.button,{className:v(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":o,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:s,whileTap:{scale:.9},style:{overflow:"hidden"},children:l?jsxRuntime.jsx(framerMotion.motion.span,{initial:{scale:0},animate:{scale:1},transition:s,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(g,{size:14})},"success"):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.span,{style:{display:"inline-flex",flexShrink:0},animate:r?{}:n?{scale:1.2,rotate:0}:{rotate:[-5,5,-5]},transition:n||r?s:{duration:3,repeat:1/0,ease:"easeInOut"},children:jsxRuntime.jsx(Ee,{size:16})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:n&&jsxRuntime.jsx(framerMotion.motion.span,{initial:{opacity:0,x:r?0:-8},animate:{opacity:1,x:0},exit:{opacity:0,x:r?0:-8},transition:s,style:{whiteSpace:"nowrap"},children:o},"label")}),a>0&&jsxRuntime.jsx("span",{className:"bf-badge","aria-label":`${a} queued`,children:a})]})},"icon-pop")})}var ro={duration:.18,ease:"easeOut"},ao={duration:0};function Qe({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=react.useState(false),r=m(),s=r?ao:ro;return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:i&&jsxRuntime.jsx(framerMotion.motion.button,{className:v(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":o,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:s,whileTap:{scale:.92},style:{overflow:"hidden"},children:l?jsxRuntime.jsx(framerMotion.motion.span,{initial:{scale:0},animate:{scale:1},transition:s,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(g,{size:14})},"success"):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("span",{style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:"10px",height:"10px",flexShrink:0},children:[jsxRuntime.jsx(framerMotion.motion.span,{"aria-hidden":"true",style:{width:"10px",height:"10px",borderRadius:"50%",background:"var(--bf-accent)",position:"relative",zIndex:1},animate:r?{}:{opacity:n?1:[.5,1,.5],boxShadow:n?"0 0 8px 2px var(--bf-accent)":["0 0 4px 1px var(--bf-accent)","0 0 12px 4px var(--bf-accent)","0 0 4px 1px var(--bf-accent)"]},transition:n||r?s:{duration:2,repeat:1/0,ease:"easeInOut"}}),!n&&!r&&jsxRuntime.jsx(framerMotion.motion.span,{"aria-hidden":"true",style:{position:"absolute",width:"18px",height:"2px",background:"linear-gradient(90deg, var(--bf-accent), transparent)",transformOrigin:"left center",left:"5px",top:"4px"},animate:{rotate:[0,360]},transition:{duration:4,repeat:1/0,ease:"linear"}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:n&&jsxRuntime.jsx(framerMotion.motion.span,{initial:{opacity:0,x:r?0:-6},animate:{opacity:1,x:0},exit:{opacity:0,x:r?0:-6},transition:s,style:{whiteSpace:"nowrap"},children:o},"label")}),a>0&&jsxRuntime.jsx("span",{className:"bf-badge","aria-label":`${a} queued`,children:a})]})},"beacon")})}var lo={duration:.18,ease:"easeOut"},po={duration:0};function et({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=react.useState(false),[r,s]=react.useState(0),h=m(),M=h?po:lo,f=react.useRef(null);react.useEffect(()=>{if(f.current&&(clearInterval(f.current),f.current=null),!i||n||h){s(n||h?o.length:0);return}let u=8,C=o.length*2+u*2,y=0;return f.current=setInterval(()=>{y=(y+1)%C,y<=o.length?s(y):y<=o.length+u?s(o.length):y<=o.length*2+u?s(o.length*2+u-y):s(0);},100),()=>{f.current&&(clearInterval(f.current),f.current=null);}},[i,n,h,o]);let S=o.slice(0,r);return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:i&&jsxRuntime.jsx(framerMotion.motion.button,{className:v(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":o,initial:{opacity:0,y:h?0:5},animate:{opacity:1,y:0},exit:{opacity:0,y:h?0:5},transition:M,whileTap:{scale:.95},style:{minWidth:"44px"},children:l?jsxRuntime.jsx(framerMotion.motion.span,{initial:{scale:0},animate:{scale:1},transition:M,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(g,{size:14})},"success"):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"bf-dot","aria-hidden":"true"}),jsxRuntime.jsxs("span",{style:{whiteSpace:"nowrap",minWidth:"1ch"},children:[S,jsxRuntime.jsx("span",{className:"bf-cursor","aria-hidden":"true"})]}),a>0&&jsxRuntime.jsx("span",{className:"bf-badge","aria-label":`${a} queued`,children:a})]})},"typewriter")})}function tt(e){switch(e){case "dot":return Re;case "bubble":return Ae;case "edge-tab":return _e;case "pulse-ring":return $e;case "minimal":return Ue;case "icon-pop":return Ye;case "beacon":return Qe;case "typewriter":return et;default:return Fe}}function rt(e,t,i){return Math.max(t,Math.min(i,e))}function mo(e,t,i="bottom-right"){let a=window.innerWidth,l=window.innerHeight,n;n=rt(e.x,12,Math.max(12,a-t-12));let c=e.y+e.height+12,r=Math.max(12,e.y-240);return {top:c+240<=l?c:r,left:n}}function ho(e){let{rect:t}=e,i={left:`${t.x}px`,top:`${t.y}px`,width:`${Math.max(0,t.width)}px`,height:`${Math.max(0,t.height)}px`};return jsxRuntime.jsx("div",{className:"bf-highlight",style:i,"aria-hidden":"true"})}function xo(e){let t=react.useRef(null);return react.useEffect(()=>{if(!e||!t.current)return;t.current.querySelector(".bf-textarea")?.focus();let o=a=>{if(a.key!=="Tab"||!t.current)return;let l=t.current.querySelectorAll('button:not([disabled]), textarea:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])');if(l.length===0)return;let n=l[0],c=l[l.length-1];a.shiftKey&&document.activeElement===n?(a.preventDefault(),c.focus()):!a.shiftKey&&document.activeElement===c&&(a.preventDefault(),n.focus());};return document.addEventListener("keydown",o,{capture:true}),()=>document.removeEventListener("keydown",o,{capture:true})},[e]),t}function yo(e,t){return e?typeof e=="function"?e(t):e.some(i=>i.endsWith("*")?t.startsWith(i.slice(0,-1)):t===i):true}function vo(e){let[t,i]=react.useState(()=>typeof window<"u"?window.location.pathname:"/");return react.useEffect(()=>{if(typeof window>"u")return;let o=()=>i(window.location.pathname);window.addEventListener("popstate",o);let a=history.pushState,l=history.replaceState;return history.pushState=function(...n){a.apply(this,n),o();},history.replaceState=function(...n){l.apply(this,n),o();},()=>{window.removeEventListener("popstate",o),history.pushState=a,history.replaceState=l;}},[]),yo(e,t)}function wo(e){let[t,i]=react.useState(()=>!e||e==="dark"?"dark":e==="light"?"light":typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light");return react.useEffect(()=>{if(e!=="auto"){i(e==="light"?"light":"dark");return}let o=window.matchMedia("(prefers-color-scheme: dark)"),a=l=>i(l.matches?"dark":"light");return i(o.matches?"dark":"light"),o.addEventListener("change",a),()=>o.removeEventListener("change",a)},[e]),t}var ko=["bug","feature","ux","general"],To={bug:"categoryBug",feature:"categoryFeature",ux:"categoryUx",general:"categoryGeneral"};function oe(e){let t=Math.floor(e/1e3),i=Math.floor(t/60),o=t%60;return `${i}:${String(o).padStart(2,"0")}`}function So(e){return e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Po(e){let{state:t,controller:i,start:o,stop:a,clearSelection:l,submit:n}=te(),c=e.config.ui?.position,r=Pe(e.config.ui?.strings),s=e.config.ui?.branding!==false,[h,M]=react.useState(null),[f,S]=react.useState(""),[u,C]=react.useState(e.config.capture?.element??true),[y,ae]=react.useState(e.config.capture?.fullPage??false),[it,ie]=react.useState(null),[O,ne]=react.useState(void 0),se=e.config.ui?.categories??ko,nt=e.config.recording?.enabled===true&&chunkORVW2RTZ_cjs.j(),st=e.config.recording?.maxDurationMs??3e4,[ct,lt]=react.useState(false),[j,dt]=react.useState(0);react.useEffect(()=>{let d=window.setTimeout(()=>{let N=chunkORVW2RTZ_cjs.r();dt(N.findings.length);},500);return ()=>window.clearTimeout(d)},[]),react.useImperativeHandle(e.handleRef,()=>({open:o,close:a,submit:d=>n(d),startRecording:()=>i.startRecording(),stopRecording:()=>i.stopRecording(),get isOpen(){return t.phase!=="idle"}}),[o,a,n,i,t.phase]);let ce=t.phase==="review"||t.phase==="recording"||t.phase==="capturing"||t.phase==="submitting"||t.phase==="error"||t.phase==="success",pt=xo(ce),[ft,ut]=react.useState(0);react.useEffect(()=>{t.phase==="idle"&&ut(chunkORVW2RTZ_cjs.i());},[t.phase]);let[bt,le]=react.useState(false),de=react.useRef(t.phase);react.useEffect(()=>{if(de.current==="success"&&t.phase==="idle"){le(true);let d=window.setTimeout(()=>le(false),1500);return ()=>window.clearTimeout(d)}de.current=t.phase;},[t.phase]),react.useEffect(()=>{let d=e.config.ui?.shortcut;if(!d)return;let N=d.toLowerCase().split("+").map(P=>P.trim()),W=N[N.length-1]||"",L=new Set(N.slice(0,-1)),fe=P=>{let ht=/Mac|iPod|iPhone|iPad/.test(navigator.platform);if(L.has("mod")){if(ht?!P.metaKey:!P.ctrlKey)return}else if(L.has("ctrl")&&!P.ctrlKey||(L.has("meta")||L.has("cmd"))&&!P.metaKey)return;L.has("shift")&&!P.shiftKey||(L.has("alt")||L.has("option"))&&!P.altKey||P.key.toLowerCase()===W&&(P.preventDefault(),t.phase==="idle"?o():a());};return document.addEventListener("keydown",fe),()=>document.removeEventListener("keydown",fe)},[e.config.ui?.shortcut,t.phase,o,a]),react.useEffect(()=>i.subscribeHover(M),[i]),react.useEffect(()=>{let d=i.__unsafeGetSelectedElement();if(!d||t.phase==="idle"||t.phase==="picking"){ie(null);return}let N=()=>{ie(chunkORVW2RTZ_cjs.b(d.getBoundingClientRect()));};N();let W=()=>N();return window.addEventListener("scroll",W,{capture:true,passive:true}),window.addEventListener("resize",W,{passive:true}),()=>{window.removeEventListener("scroll",W,{capture:true}),window.removeEventListener("resize",W);}},[i,t.phase,t.selection?.selector]),react.useEffect(()=>{t.phase==="review"&&(S(""),C(e.config.capture?.element??true),ae(e.config.capture?.fullPage??false),ne(void 0));},[t.phase,t.selection?.selector,e.config.capture?.element,e.config.capture?.fullPage]),react.useEffect(()=>{if(t.phase!=="success")return;let d=window.setTimeout(()=>a(),1200);return ()=>window.clearTimeout(d)},[t.phase,a]);let k=t.phase==="capturing"||t.phase==="submitting"||t.phase==="recording",F=t.phase==="picking"?h?.rect??null:it??t.selection?.rect??null,Q=react.useMemo(()=>F?mo(F,360,c):null,[F?.x,F?.y,F?.width,F?.height,c]),pe=t.lastError?.message,q=react.useCallback(()=>{let d={capture:{element:u,fullPage:y}};O&&(d.category=O),n(f,d);},[n,f,u,y,O]),gt=react.useCallback(d=>{(d.metaKey||d.ctrlKey)&&d.key==="Enter"&&f.trim().length>0&&!k&&(d.preventDefault(),q());},[q,f,k]),mt=tt(e.config.ui?.triggerStyle);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(mt,{position:c,onClick:()=>o(),isVisible:t.phase==="idle",label:e.config.ui?.triggerLabel??r.triggerLabel,queueCount:ft,showSuccess:bt}),t.phase!=="idle"&&jsxRuntime.jsxs("div",{className:"bf-overlay",role:"presentation",children:[t.phase!=="picking"&&jsxRuntime.jsx("div",{className:"bf-blocker",role:"presentation",onClick:()=>a()}),F&&jsxRuntime.jsx(ho,{rect:F}),t.phase==="picking"&&jsxRuntime.jsxs("div",{className:"bf-hint",role:"status","aria-live":"polite",children:[jsxRuntime.jsx("p",{id:"bf-hint-text",children:r.hintText}),jsxRuntime.jsx("button",{type:"button",className:"bf-btn",onClick:()=>a(),"aria-label":r.cancelButton,children:r.cancelButton})]}),ce&&Q&&jsxRuntime.jsxs("div",{ref:pt,className:"bf-panel",style:{left:Q.left,top:Q.top},role:"dialog","aria-modal":"true","aria-label":"Feedback form",children:[jsxRuntime.jsxs("div",{className:"bf-panelHeader",children:[jsxRuntime.jsx("div",{className:"bf-title",id:"bf-panel-title",children:r.panelTitle}),jsxRuntime.jsxs("div",{className:"bf-row",style:{justifyContent:"flex-end"},children:[jsxRuntime.jsx("button",{type:"button",className:"bf-btn",onClick:()=>l(),disabled:k,"aria-label":r.rePickButton,children:r.rePickButton}),jsxRuntime.jsx("button",{type:"button",className:"bf-btn",onClick:()=>a(),disabled:k,"aria-label":r.closeButton,children:r.closeButton})]})]}),jsxRuntime.jsxs("div",{className:"bf-panelBody",children:[jsxRuntime.jsx("textarea",{className:"bf-textarea",placeholder:r.textareaPlaceholder,value:f,onChange:d=>S(d.target.value),onKeyDown:gt,disabled:k,"aria-label":r.panelTitle}),se.length>0&&jsxRuntime.jsx("div",{className:"bf-pills",role:"group","aria-label":"Feedback category",children:se.map(d=>jsxRuntime.jsx("button",{type:"button",className:`bf-pill${O===d?" bf-pill-active":""}`,onClick:()=>ne(O===d?void 0:d),disabled:k,children:r[To[d]]},d))}),jsxRuntime.jsxs("div",{className:"bf-row",role:"group","aria-label":r.screenshotElement,children:[jsxRuntime.jsxs("label",{children:[jsxRuntime.jsx("input",{type:"checkbox",checked:u,onChange:d=>C(d.target.checked),disabled:k}),r.screenshotElement]}),jsxRuntime.jsxs("label",{children:[jsxRuntime.jsx("input",{type:"checkbox",checked:y,onChange:d=>ae(d.target.checked),disabled:k}),r.screenshotFullPage]})]}),nt&&t.phase==="review"&&!t.video&&jsxRuntime.jsxs("button",{type:"button",className:"bf-record-btn",onClick:()=>i.startRecording(),disabled:k,"aria-label":r.recordButton,children:[jsxRuntime.jsx("span",{className:"bf-rec-dot","aria-hidden":"true"}),r.recordButton]}),t.phase==="recording"&&jsxRuntime.jsxs("div",{className:"bf-recording-indicator",role:"status","aria-live":"polite",children:[jsxRuntime.jsx("span",{className:"bf-rec-dot bf-rec-dot-pulse","aria-hidden":"true"}),jsxRuntime.jsxs("span",{children:[r.recordingText," ",oe(t.recordingElapsedMs??0)," / ",oe(st)]}),jsxRuntime.jsx("button",{type:"button",className:"bf-btn",onClick:()=>i.stopRecording(),"aria-label":r.stopRecordButton,children:r.stopRecordButton})]}),t.video&&t.phase==="review"&&jsxRuntime.jsxs("div",{className:"bf-video-preview",children:[jsxRuntime.jsx("video",{src:t.video.blobUrl,controls:true,muted:true,playsInline:true}),jsxRuntime.jsx("button",{type:"button",className:"bf-video-remove",onClick:()=>i.removeVideo(),"aria-label":r.removeVideoButton,children:"\xD7"}),jsxRuntime.jsxs("div",{className:"bf-video-meta",children:[r.videoPreviewLabel," (",oe(t.video.durationMs),", ",So(t.video.sizeBytes),")"]})]}),t.phase==="capturing"&&jsxRuntime.jsxs("div",{className:"bf-status",role:"status","aria-live":"polite",children:[jsxRuntime.jsx("span",{className:"bf-spinner","aria-hidden":"true"}),r.capturingText]}),t.phase==="submitting"&&jsxRuntime.jsxs("div",{className:"bf-status",role:"status","aria-live":"polite",children:[jsxRuntime.jsx("span",{className:"bf-spinner","aria-hidden":"true"}),r.submittingText]}),t.phase==="success"&&jsxRuntime.jsx("div",{className:"bf-status",role:"status","aria-live":"polite",children:r.successText}),t.phase==="error"&&pe&&jsxRuntime.jsx("div",{className:"bf-error",role:"alert",children:pe}),jsxRuntime.jsxs("div",{className:"bf-actions",children:[jsxRuntime.jsx("button",{type:"button",className:"bf-btn",onClick:()=>a(),disabled:k,"aria-label":r.cancelButton,children:r.cancelButton}),jsxRuntime.jsx("button",{type:"button",className:"bf-btn bf-btnPrimary",onClick:q,disabled:k||f.trim().length===0,"aria-label":r.sendButton,children:r.sendButton})]})]}),s&&jsxRuntime.jsx("div",{className:"bf-watermark",children:jsxRuntime.jsx("a",{href:"https://blocfeed.com",target:"_blank",rel:"noopener noreferrer",children:"Powered by BlocFeed"})})]})]}),t.phase==="success"&&jsxRuntime.jsx("div",{className:"bf-toast",role:"status","aria-live":"polite",children:r.toastText}),j>0&&!ct&&jsxRuntime.jsxs("div",{className:"bf-security-banner",role:"alert",children:[jsxRuntime.jsx("button",{type:"button",className:"bf-security-banner-dismiss",onClick:()=>lt(true),"aria-label":"Dismiss",children:"\xD7"}),jsxRuntime.jsx("strong",{children:"Security Warning"}),j," potential secret",j>1?"s":""," exposed in client code. Check your environment variables."]})]})}var Co=react.forwardRef(function(t,i){let o={...t.config??{},blocfeed_id:t.blocfeed_id},[a,l]=react.useState(null),n=vo(o.ui?.showOn),c=wo(o.ui?.theme?.mode),r=!!o.diagnostics;react.useEffect(()=>{if(r)return chunkORVW2RTZ_cjs.m(o.diagnostics),()=>chunkORVW2RTZ_cjs.n()},[r]);let s=!!o.security;react.useEffect(()=>{s&&chunkORVW2RTZ_cjs.q(o.security);},[s]);let h=react.useRef(t.config?.metadata?.enrich);h.current=t.config?.metadata?.enrich;let M=react.useMemo(()=>{if(t.config)return {...t.config,metadata:{...t.config.metadata,enrich:async f=>{let S=h.current,u=S?await S(f):{},C=chunkORVW2RTZ_cjs.o(),y=chunkORVW2RTZ_cjs.r();return {...u,...C.consoleLogs.length>0?{_consoleLogs:C.consoleLogs}:{},...C.networkErrors.length>0?{_networkErrors:C.networkErrors}:{},...y.findings.length>0?{_securityFindings:y.findings}:{}}}}}},[]);return react.useEffect(()=>{Te();let f=document.createElement("div");f.setAttribute("data-blocfeed-ui-root","true"),f.setAttribute("data-blocfeed-ui","true"),f.setAttribute("data-bf-theme",c);let S=o.ui?.zIndex;typeof S=="number"&&f.style.setProperty("--bf-z",String(S));let u=o.ui?.theme;return u&&(u.accentColor&&f.style.setProperty("--bf-accent",u.accentColor),u.panelBackground&&f.style.setProperty("--bf-panel-bg",u.panelBackground),u.panelForeground&&f.style.setProperty("--bf-panel-fg",u.panelForeground),u.fontFamily&&f.style.setProperty("--bf-font",u.fontFamily)),document.body.appendChild(f),l(f),()=>{f.remove(),l(null);}},[o.ui?.zIndex,o.ui?.theme?.accentColor,o.ui?.theme?.panelBackground,o.ui?.theme?.panelForeground,o.ui?.theme?.fontFamily,c]),react.useEffect(()=>{a&&a.setAttribute("data-bf-theme",c);},[a,c]),!n||!a?null:reactDom.createPortal(jsxRuntime.jsx(ee,{blocfeed_id:o.blocfeed_id,...M?{config:M}:{},children:jsxRuntime.jsx(Po,{config:o,handleRef:i})}),a)});
|
|
742
|
-
exports.BlocFeedProvider=
|
|
806
|
+
`;function Se(){if(!chunkEFTA67IW_cjs.a()||document.getElementById(Te))return;let e=document.createElement("style");e.id=Te,e.textContent=Tt,document.head.appendChild(e);}var Pe={triggerLabel:"Feedback",panelTitle:"Feedback",hintText:"Click an element to attach your feedback. Press Esc to cancel.",cancelButton:"Cancel",rePickButton:"Re-pick",closeButton:"Close",textareaPlaceholder:"What's happening? What did you expect?",screenshotElement:"Screenshot element",screenshotFullPage:"Full page",capturingText:"Capturing screenshots\u2026",submittingText:"Submitting\u2026",successText:"Sent. Thank you!",toastText:"Feedback sent",sendButton:"Send",categoryBug:"Bug",categoryFeature:"Feature",categoryUx:"UX",categoryGeneral:"General",recordButton:"Record",stopRecordButton:"Stop",recordingText:"Recording\u2026",recordingDeniedText:"Screen share was denied",videoPreviewLabel:"Video attached",removeVideoButton:"Remove"};function Ce(e){return e?{...Pe,...e}:Pe}function oe(){let e=react.useContext(U);if(!e)throw new Error("useBlocFeed must be used within a <BlocFeedProvider />");return {state:e.state,controller:e.controller,start:e.controller.start,stop:e.controller.stop,clearSelection:e.controller.clearSelection,submit:e.controller.submit,startRecording:e.controller.startRecording,stopRecording:e.controller.stopRecording,removeVideo:e.controller.removeVideo}}function v(e){switch(e){case "bottom-left":return "bf-trigger bf-trigger-bl";case "top-right":return "bf-trigger bf-trigger-tr";case "top-left":return "bf-trigger bf-trigger-tl";default:return "bf-trigger"}}function g({size:e=14}){return jsxRuntime.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:jsxRuntime.jsx("path",{d:"M20 6L9 17l-5-5",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ee({size:e=14}){return jsxRuntime.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:jsxRuntime.jsx("path",{d:"M21 11.5a8.38 8.38 0 01-.9 3.8 8.5 8.5 0 01-7.6 4.7 8.38 8.38 0 01-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 01-.9-3.8 8.5 8.5 0 014.7-7.6 8.38 8.38 0 013.8-.9h.5a8.48 8.48 0 018 8v.5z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function Be({size:e=16}){return jsxRuntime.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[jsxRuntime.jsx("path",{d:"M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M22 6l-10 7L2 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Ne({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){return i?jsxRuntime.jsxs("button",{className:v(e),type:"button",onClick:t,"aria-label":o,children:[l?jsxRuntime.jsx("span",{style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(g,{size:14})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"bf-dot","aria-hidden":"true"}),o]}),a>0&&jsxRuntime.jsx("span",{className:"bf-badge","aria-label":`${a} queued`,children:a})]}):null}function m(){let[e,t]=react.useState(()=>typeof window>"u"?false:window.matchMedia("(prefers-reduced-motion: reduce)").matches);return react.useEffect(()=>{let i=window.matchMedia("(prefers-reduced-motion: reduce)"),o=a=>t(a.matches);return i.addEventListener("change",o),()=>i.removeEventListener("change",o)},[]),e}var Nt={duration:.18,ease:"easeOut"},Rt={duration:0};function Me({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=react.useState(false),r=m(),s=r?Rt:Nt;return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:i&&jsxRuntime.jsx(framerMotion.motion.button,{className:v(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":o,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:s,whileTap:{scale:.92},style:{overflow:"hidden"},children:l?jsxRuntime.jsx(framerMotion.motion.span,{initial:{scale:0},animate:{scale:1},transition:s,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(g,{size:14})},"success"):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.span,{className:"bf-dot","aria-hidden":"true",animate:r?{}:{scale:n?1:[1,1.2,1],boxShadow:n?"0 0 0 4px rgba(99, 102, 241, 0.18)":["0 0 0 4px rgba(99, 102, 241, 0.18)","0 0 0 8px rgba(99, 102, 241, 0.28)","0 0 0 4px rgba(99, 102, 241, 0.18)"]},transition:n||r?s:{duration:2,repeat:1/0,ease:"easeInOut"}}),jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:n&&jsxRuntime.jsx(framerMotion.motion.span,{initial:{opacity:0,x:r?0:-6},animate:{opacity:1,x:0},exit:{opacity:0,x:r?0:-6},transition:s,style:{whiteSpace:"nowrap"},children:o},"label")}),a>0&&jsxRuntime.jsx("span",{className:"bf-badge","aria-label":`${a} queued`,children:a})]})},"dot")})}var At={duration:.18,ease:"easeOut"},Le={duration:0};function Ie({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=react.useState(false),r=m(),s=r?Le:At;return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:i&&jsxRuntime.jsxs(framerMotion.motion.div,{className:v(e),initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{y:8,opacity:0},transition:s,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),style:{background:"transparent",border:"none",boxShadow:"none",padding:0},children:[jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:n&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:r?0:4},animate:{opacity:1,y:0},exit:{opacity:0,y:r?0:4},transition:s,style:{position:"absolute",bottom:"calc(100% + 8px)",left:"50%",transform:"translateX(-50%)",padding:"6px 12px",borderRadius:"8px",background:"var(--bf-panel-bg)",border:"1px solid var(--bf-border)",boxShadow:"var(--bf-shadow)",whiteSpace:"nowrap",fontSize:"12px",color:"var(--bf-panel-fg)",pointerEvents:"none"},children:o},"tooltip")}),jsxRuntime.jsxs(framerMotion.motion.button,{type:"button",onClick:t,"aria-label":o,style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",width:"40px",height:"40px",borderRadius:"50%",border:"1px solid var(--bf-border)",background:"var(--bf-panel-bg)",color:"var(--bf-panel-fg)",boxShadow:"var(--bf-shadow)",cursor:"pointer",padding:0},animate:r?{}:{y:[0,-3,0]},transition:r?Le:{y:{duration:3,repeat:1/0,ease:"easeInOut"}},whileHover:{scale:1.1,borderColor:"var(--bf-accent)"},whileTap:{scale:.9},children:[l?jsxRuntime.jsx(framerMotion.motion.span,{initial:{scale:0},animate:{scale:1},transition:s,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(g,{size:16})},"success"):jsxRuntime.jsx(Ee,{size:16}),a>0&&jsxRuntime.jsx("span",{className:"bf-badge bf-badge-float","aria-label":`${a} queued`,children:a})]})]},"bubble")})}var _t={duration:.2,ease:"easeOut"},Ht={duration:0};function _e(e){return e==="bottom-left"||e==="top-left"}function Ot(e){return `bf-trigger-edge ${_e(e)?"bf-trigger-edge-left":"bf-trigger-edge-right"}`}function He({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=react.useState(false),r=_e(e),s=m(),h=s?Ht:_t;return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:i&&jsxRuntime.jsx(framerMotion.motion.button,{className:Ot(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":o,initial:{opacity:0,width:0},animate:{opacity:1,width:n?140:22,height:n?40:90},exit:{width:0,opacity:0},transition:h,whileTap:{scale:.97},style:{top:"50%",translateY:"-50%"},children:l?jsxRuntime.jsx(framerMotion.motion.span,{initial:{scale:0},animate:{scale:1},transition:h,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(g,{size:14})},"success"):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(framerMotion.motion.span,{animate:{rotate:s||n?0:r?-90:90,opacity:n?1:.6},transition:h,style:{display:"flex",alignItems:"center",gap:"8px",whiteSpace:"nowrap",fontSize:"12px",letterSpacing:"0.5px",textTransform:"uppercase"},children:[n&&jsxRuntime.jsx(framerMotion.motion.span,{initial:{scale:0},animate:{scale:1},transition:{duration:.12},style:{width:"6px",height:"6px",borderRadius:"50%",background:"var(--bf-accent)",flexShrink:0}}),o]}),jsxRuntime.jsx(framerMotion.motion.span,{"aria-hidden":"true",animate:{opacity:n?1:0},transition:{duration:.12},style:{position:"absolute",top:0,bottom:0,[r?"left":"right"]:0,width:"2px",background:"var(--bf-accent)"}}),a>0&&jsxRuntime.jsx("span",{className:"bf-badge","aria-label":`${a} queued`,children:a})]})},"edge-tab")})}var Kt={duration:.18,ease:"easeOut"},Vt={duration:0};function De({delay:e,hovered:t,reduced:i}){return i?null:jsxRuntime.jsx(framerMotion.motion.span,{"aria-hidden":"true",style:{position:"absolute",width:"10px",height:"10px",borderRadius:"50%",border:"2px solid var(--bf-accent)",pointerEvents:"none"},animate:t?{scale:1,opacity:0}:{scale:[1,1.8],opacity:[.5,0]},transition:t?{duration:.15}:{duration:2,repeat:1/0,delay:e,ease:"easeOut"}})}function Ke({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=react.useState(false),r=m(),s=r?Vt:Kt;return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:i&&jsxRuntime.jsx(framerMotion.motion.button,{className:v(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":o,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:s,whileTap:{scale:.92},style:{overflow:"hidden"},children:l?jsxRuntime.jsx(framerMotion.motion.span,{initial:{scale:0},animate:{scale:1},transition:s,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(g,{size:14})},"success"):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("span",{style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",width:"10px",height:"10px",flexShrink:0},children:[jsxRuntime.jsx(De,{delay:0,hovered:n,reduced:r}),jsxRuntime.jsx(De,{delay:.7,hovered:n,reduced:r}),jsxRuntime.jsx(framerMotion.motion.span,{className:"bf-dot","aria-hidden":"true",style:{position:"relative",zIndex:1}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:n&&jsxRuntime.jsx(framerMotion.motion.span,{initial:{opacity:0,x:r?0:-6},animate:{opacity:1,x:0},exit:{opacity:0,x:r?0:-6},transition:s,style:{whiteSpace:"nowrap"},children:o},"label")}),a>0&&jsxRuntime.jsx("span",{className:"bf-badge","aria-label":`${a} queued`,children:a})]})},"pulse-ring")})}var Gt={duration:.18,ease:"easeOut"},jt={duration:0};function Qt(e){switch(e){case "bottom-left":return "bf-trigger-minimal bf-trigger-bl";case "top-right":return "bf-trigger-minimal bf-trigger-tr";case "top-left":return "bf-trigger-minimal bf-trigger-tl";default:return "bf-trigger-minimal"}}function Xe({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=react.useState(false),r=m(),s=r?jt:Gt;return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:i&&jsxRuntime.jsxs(framerMotion.motion.button,{className:Qt(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":o,initial:{opacity:0,y:r?0:5},animate:{opacity:n?1:.65,y:0},exit:{opacity:0,y:r?0:5},transition:s,whileTap:{scale:.95},children:[l?jsxRuntime.jsx("span",{style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(g,{size:14})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{children:o}),a>0&&jsxRuntime.jsx("span",{className:"bf-badge",style:{marginLeft:"4px"},"aria-label":`${a} queued`,children:a})]}),!r&&jsxRuntime.jsx(framerMotion.motion.span,{"aria-hidden":"true",style:{position:"absolute",bottom:4,left:4,right:4,height:"2px",background:"var(--bf-accent)",borderRadius:"1px",transformOrigin:"left"},initial:false,animate:{scaleX:n?1:0},transition:s})]},"minimal")})}var Zt={duration:.18,ease:"easeOut"},eo={duration:0};function Ge({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=react.useState(false),r=m(),s=r?eo:Zt;return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:i&&jsxRuntime.jsx(framerMotion.motion.button,{className:v(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":o,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:s,whileTap:{scale:.9},style:{overflow:"hidden"},children:l?jsxRuntime.jsx(framerMotion.motion.span,{initial:{scale:0},animate:{scale:1},transition:s,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(g,{size:14})},"success"):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.span,{style:{display:"inline-flex",flexShrink:0},animate:r?{}:n?{scale:1.2,rotate:0}:{rotate:[-5,5,-5]},transition:n||r?s:{duration:3,repeat:1/0,ease:"easeInOut"},children:jsxRuntime.jsx(Be,{size:16})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:n&&jsxRuntime.jsx(framerMotion.motion.span,{initial:{opacity:0,x:r?0:-8},animate:{opacity:1,x:0},exit:{opacity:0,x:r?0:-8},transition:s,style:{whiteSpace:"nowrap"},children:o},"label")}),a>0&&jsxRuntime.jsx("span",{className:"bf-badge","aria-label":`${a} queued`,children:a})]})},"icon-pop")})}var ao={duration:.18,ease:"easeOut"},io={duration:0};function qe({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=react.useState(false),r=m(),s=r?io:ao;return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:i&&jsxRuntime.jsx(framerMotion.motion.button,{className:v(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":o,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:s,whileTap:{scale:.92},style:{overflow:"hidden"},children:l?jsxRuntime.jsx(framerMotion.motion.span,{initial:{scale:0},animate:{scale:1},transition:s,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(g,{size:14})},"success"):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("span",{style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:"10px",height:"10px",flexShrink:0},children:[jsxRuntime.jsx(framerMotion.motion.span,{"aria-hidden":"true",style:{width:"10px",height:"10px",borderRadius:"50%",background:"var(--bf-accent)",position:"relative",zIndex:1},animate:r?{}:{opacity:n?1:[.5,1,.5],boxShadow:n?"0 0 8px 2px var(--bf-accent)":["0 0 4px 1px var(--bf-accent)","0 0 12px 4px var(--bf-accent)","0 0 4px 1px var(--bf-accent)"]},transition:n||r?s:{duration:2,repeat:1/0,ease:"easeInOut"}}),!n&&!r&&jsxRuntime.jsx(framerMotion.motion.span,{"aria-hidden":"true",style:{position:"absolute",width:"18px",height:"2px",background:"linear-gradient(90deg, var(--bf-accent), transparent)",transformOrigin:"left center",left:"5px",top:"4px"},animate:{rotate:[0,360]},transition:{duration:4,repeat:1/0,ease:"linear"}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:n&&jsxRuntime.jsx(framerMotion.motion.span,{initial:{opacity:0,x:r?0:-6},animate:{opacity:1,x:0},exit:{opacity:0,x:r?0:-6},transition:s,style:{whiteSpace:"nowrap"},children:o},"label")}),a>0&&jsxRuntime.jsx("span",{className:"bf-badge","aria-label":`${a} queued`,children:a})]})},"beacon")})}var po={duration:.18,ease:"easeOut"},fo={duration:0};function tt({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=react.useState(false),[r,s]=react.useState(0),h=m(),M=h?fo:po,f=react.useRef(null);react.useEffect(()=>{if(f.current&&(clearInterval(f.current),f.current=null),!i||n||h){s(n||h?o.length:0);return}let u=8,C=o.length*2+u*2,y=0;return f.current=setInterval(()=>{y=(y+1)%C,y<=o.length?s(y):y<=o.length+u?s(o.length):y<=o.length*2+u?s(o.length*2+u-y):s(0);},100),()=>{f.current&&(clearInterval(f.current),f.current=null);}},[i,n,h,o]);let S=o.slice(0,r);return jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",children:i&&jsxRuntime.jsx(framerMotion.motion.button,{className:v(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":o,initial:{opacity:0,y:h?0:5},animate:{opacity:1,y:0},exit:{opacity:0,y:h?0:5},transition:M,whileTap:{scale:.95},style:{minWidth:"44px"},children:l?jsxRuntime.jsx(framerMotion.motion.span,{initial:{scale:0},animate:{scale:1},transition:M,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsxRuntime.jsx(g,{size:14})},"success"):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"bf-dot","aria-hidden":"true"}),jsxRuntime.jsxs("span",{style:{whiteSpace:"nowrap",minWidth:"1ch"},children:[S,jsxRuntime.jsx("span",{className:"bf-cursor","aria-hidden":"true"})]}),a>0&&jsxRuntime.jsx("span",{className:"bf-badge","aria-label":`${a} queued`,children:a})]})},"typewriter")})}function ot(e){switch(e){case "dot":return Me;case "bubble":return Ie;case "edge-tab":return He;case "pulse-ring":return Ke;case "minimal":return Xe;case "icon-pop":return Ge;case "beacon":return qe;case "typewriter":return tt;default:return Ne}}function at(e,t,i){return Math.max(t,Math.min(i,e))}function ho(e,t,i="bottom-right"){let a=window.innerWidth,l=window.innerHeight,n;n=at(e.x,12,Math.max(12,a-t-12));let c=e.y+e.height+12,r=Math.max(12,e.y-240);return {top:c+240<=l?c:r,left:n}}function xo(e){let{rect:t}=e,i={left:`${t.x}px`,top:`${t.y}px`,width:`${Math.max(0,t.width)}px`,height:`${Math.max(0,t.height)}px`};return jsxRuntime.jsx("div",{className:"bf-highlight",style:i,"aria-hidden":"true"})}function yo(e){let t=react.useRef(null);return react.useEffect(()=>{if(!e||!t.current)return;t.current.querySelector(".bf-textarea")?.focus();let o=a=>{if(a.key!=="Tab"||!t.current)return;let l=t.current.querySelectorAll('button:not([disabled]), textarea:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])');if(l.length===0)return;let n=l[0],c=l[l.length-1];a.shiftKey&&document.activeElement===n?(a.preventDefault(),c.focus()):!a.shiftKey&&document.activeElement===c&&(a.preventDefault(),n.focus());};return document.addEventListener("keydown",o,{capture:true}),()=>document.removeEventListener("keydown",o,{capture:true})},[e]),t}function vo(e,t){return e?typeof e=="function"?e(t):e.some(i=>i.endsWith("*")?t.startsWith(i.slice(0,-1)):t===i):true}function wo(e){let[t,i]=react.useState(()=>typeof window<"u"?window.location.pathname:"/");return react.useEffect(()=>{if(typeof window>"u")return;let o=()=>i(window.location.pathname);window.addEventListener("popstate",o);let a=history.pushState,l=history.replaceState;return history.pushState=function(...n){a.apply(this,n),o();},history.replaceState=function(...n){l.apply(this,n),o();},()=>{window.removeEventListener("popstate",o),history.pushState=a,history.replaceState=l;}},[]),vo(e,t)}function ko(e){let[t,i]=react.useState(()=>!e||e==="dark"?"dark":e==="light"?"light":typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light");return react.useEffect(()=>{if(e!=="auto"){i(e==="light"?"light":"dark");return}let o=window.matchMedia("(prefers-color-scheme: dark)"),a=l=>i(l.matches?"dark":"light");return i(o.matches?"dark":"light"),o.addEventListener("change",a),()=>o.removeEventListener("change",a)},[e]),t}var To=["bug","feature","ux","general"],So={bug:"categoryBug",feature:"categoryFeature",ux:"categoryUx",general:"categoryGeneral"};function re(e){let t=Math.floor(e/1e3),i=Math.floor(t/60),o=t%60;return `${i}:${String(o).padStart(2,"0")}`}function Po(e){return e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Co(e){let{state:t,controller:i,start:o,stop:a,clearSelection:l,submit:n}=oe(),c=e.config.ui?.position,r=Ce(e.config.ui?.strings),s=e.config.ui?.branding!==false,[h,M]=react.useState(null),[f,S]=react.useState(""),[u,C]=react.useState(e.config.capture?.element??true),[y,O]=react.useState(e.config.capture?.fullPage??false),[nt,ie]=react.useState(null),[D,ne]=react.useState(void 0),se=e.config.ui?.categories??To,st=e.config.recording?.enabled===true&&chunkEFTA67IW_cjs.l(),ct=e.config.recording?.maxDurationMs??3e4,[lt,dt]=react.useState(false),[Q,pt]=react.useState(0);react.useEffect(()=>{let d=window.setTimeout(()=>{let N=chunkEFTA67IW_cjs.t();pt(N.findings.length);},500);return ()=>window.clearTimeout(d)},[]),react.useImperativeHandle(e.handleRef,()=>({open:o,close:a,submit:d=>n(d),startRecording:()=>i.startRecording(),stopRecording:()=>i.stopRecording(),get isOpen(){return t.phase!=="idle"}}),[o,a,n,i,t.phase]);let ce=t.phase==="review"||t.phase==="capturing"||t.phase==="submitting"||t.phase==="error"||t.phase==="success",ft=yo(ce),[ut,bt]=react.useState(0);react.useEffect(()=>{t.phase==="idle"&&bt(chunkEFTA67IW_cjs.i());},[t.phase]);let[gt,le]=react.useState(false),de=react.useRef(t.phase);react.useEffect(()=>{if(de.current==="success"&&t.phase==="idle"){le(true);let d=window.setTimeout(()=>le(false),1500);return ()=>window.clearTimeout(d)}de.current=t.phase;},[t.phase]),react.useEffect(()=>{let d=e.config.ui?.shortcut;if(!d)return;let N=d.toLowerCase().split("+").map(P=>P.trim()),W=N[N.length-1]||"",z=new Set(N.slice(0,-1)),fe=P=>{let xt=/Mac|iPod|iPhone|iPad/.test(navigator.platform);if(z.has("mod")){if(xt?!P.metaKey:!P.ctrlKey)return}else if(z.has("ctrl")&&!P.ctrlKey||(z.has("meta")||z.has("cmd"))&&!P.metaKey)return;z.has("shift")&&!P.shiftKey||(z.has("alt")||z.has("option"))&&!P.altKey||P.key.toLowerCase()===W&&(P.preventDefault(),t.phase==="idle"?o():a());};return document.addEventListener("keydown",fe),()=>document.removeEventListener("keydown",fe)},[e.config.ui?.shortcut,t.phase,o,a]),react.useEffect(()=>i.subscribeHover(M),[i]),react.useEffect(()=>{let d=i.__unsafeGetSelectedElement();if(!d||t.phase==="idle"||t.phase==="picking"){ie(null);return}let N=()=>{ie(chunkEFTA67IW_cjs.b(d.getBoundingClientRect()));};N();let W=()=>N();return window.addEventListener("scroll",W,{capture:true,passive:true}),window.addEventListener("resize",W,{passive:true}),()=>{window.removeEventListener("scroll",W,{capture:true}),window.removeEventListener("resize",W);}},[i,t.phase,t.selection?.selector]),react.useEffect(()=>{t.phase==="review"&&(S(""),C(e.config.capture?.element??true),O(e.config.capture?.fullPage??false),ne(void 0));},[t.phase,t.selection?.selector,e.config.capture?.element,e.config.capture?.fullPage]),react.useEffect(()=>{if(t.phase!=="success")return;let d=window.setTimeout(()=>a(),1200);return ()=>window.clearTimeout(d)},[t.phase,a]);let k=t.phase==="capturing"||t.phase==="submitting",F=t.phase==="picking"?h?.rect??null:nt??t.selection?.rect??null,q=react.useMemo(()=>F?ho(F,360,c):null,[F?.x,F?.y,F?.width,F?.height,c]),pe=t.lastError?.message,J=react.useCallback(()=>{let d={capture:{element:u,fullPage:y}};D&&(d.category=D),n(f,d);},[n,f,u,y,D]),mt=react.useCallback(d=>{(d.metaKey||d.ctrlKey)&&d.key==="Enter"&&f.trim().length>0&&!k&&(d.preventDefault(),J());},[J,f,k]),ht=ot(e.config.ui?.triggerStyle);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(ht,{position:c,onClick:()=>o(),isVisible:t.phase==="idle",label:e.config.ui?.triggerLabel??r.triggerLabel,queueCount:ut,showSuccess:gt}),t.phase!=="idle"&&t.phase!=="recording"&&jsxRuntime.jsxs("div",{className:"bf-overlay",role:"presentation",children:[t.phase!=="picking"&&jsxRuntime.jsx("div",{className:"bf-blocker",role:"presentation",onClick:()=>a()}),F&&jsxRuntime.jsx(xo,{rect:F}),t.phase==="picking"&&jsxRuntime.jsxs("div",{className:"bf-hint",role:"status","aria-live":"polite",children:[jsxRuntime.jsx("p",{id:"bf-hint-text",children:r.hintText}),jsxRuntime.jsx("button",{type:"button",className:"bf-btn",onClick:()=>a(),"aria-label":r.cancelButton,children:r.cancelButton})]}),ce&&q&&jsxRuntime.jsxs("div",{ref:ft,className:"bf-panel",style:{left:q.left,top:q.top},role:"dialog","aria-modal":"true","aria-label":"Feedback form",children:[jsxRuntime.jsxs("div",{className:"bf-panelHeader",children:[jsxRuntime.jsx("div",{className:"bf-title",id:"bf-panel-title",children:r.panelTitle}),jsxRuntime.jsxs("div",{className:"bf-row",style:{justifyContent:"flex-end"},children:[jsxRuntime.jsx("button",{type:"button",className:"bf-btn",onClick:()=>l(),disabled:k,"aria-label":r.rePickButton,children:r.rePickButton}),jsxRuntime.jsx("button",{type:"button",className:"bf-btn",onClick:()=>a(),disabled:k,"aria-label":r.closeButton,children:r.closeButton})]})]}),jsxRuntime.jsxs("div",{className:"bf-panelBody",children:[jsxRuntime.jsx("textarea",{className:"bf-textarea",placeholder:r.textareaPlaceholder,value:f,onChange:d=>S(d.target.value),onKeyDown:mt,disabled:k,"aria-label":r.panelTitle}),se.length>0&&jsxRuntime.jsx("div",{className:"bf-pills",role:"group","aria-label":"Feedback category",children:se.map(d=>jsxRuntime.jsx("button",{type:"button",className:`bf-pill${D===d?" bf-pill-active":""}`,onClick:()=>ne(D===d?void 0:d),disabled:k,children:r[So[d]]},d))}),jsxRuntime.jsxs("div",{className:"bf-row",role:"group","aria-label":r.screenshotElement,children:[jsxRuntime.jsxs("label",{children:[jsxRuntime.jsx("input",{type:"checkbox",checked:u,onChange:d=>C(d.target.checked),disabled:k}),r.screenshotElement]}),jsxRuntime.jsxs("label",{children:[jsxRuntime.jsx("input",{type:"checkbox",checked:y,onChange:d=>O(d.target.checked),disabled:k}),r.screenshotFullPage]})]}),st&&t.phase==="review"&&!t.video&&jsxRuntime.jsxs("button",{type:"button",className:"bf-record-btn",onClick:()=>i.startRecording(),disabled:k,"aria-label":r.recordButton,children:[jsxRuntime.jsx("span",{className:"bf-rec-dot","aria-hidden":"true"}),r.recordButton]}),t.video&&t.phase==="review"&&jsxRuntime.jsxs("div",{className:"bf-video-preview",children:[jsxRuntime.jsx("video",{src:t.video.blobUrl,controls:true,muted:true,playsInline:true}),jsxRuntime.jsx("button",{type:"button",className:"bf-video-remove",onClick:()=>i.removeVideo(),"aria-label":r.removeVideoButton,children:"\xD7"}),jsxRuntime.jsxs("div",{className:"bf-video-meta",children:[r.videoPreviewLabel," (",re(t.video.durationMs),", ",Po(t.video.sizeBytes),")"]})]}),t.phase==="capturing"&&jsxRuntime.jsxs("div",{className:"bf-status",role:"status","aria-live":"polite",children:[jsxRuntime.jsx("span",{className:"bf-spinner","aria-hidden":"true"}),r.capturingText]}),t.phase==="submitting"&&jsxRuntime.jsxs("div",{className:"bf-status",role:"status","aria-live":"polite",children:[jsxRuntime.jsx("span",{className:"bf-spinner","aria-hidden":"true"}),r.submittingText]}),t.phase==="success"&&jsxRuntime.jsx("div",{className:"bf-status",role:"status","aria-live":"polite",children:r.successText}),t.phase==="error"&&pe&&jsxRuntime.jsx("div",{className:"bf-error",role:"alert",children:pe}),jsxRuntime.jsxs("div",{className:"bf-actions",children:[jsxRuntime.jsx("button",{type:"button",className:"bf-btn",onClick:()=>a(),disabled:k,"aria-label":r.cancelButton,children:r.cancelButton}),jsxRuntime.jsx("button",{type:"button",className:"bf-btn bf-btnPrimary",onClick:J,disabled:k||f.trim().length===0,"aria-label":r.sendButton,children:r.sendButton})]})]}),s&&jsxRuntime.jsx("div",{className:"bf-watermark",children:jsxRuntime.jsx("a",{href:"https://blocfeed.com",target:"_blank",rel:"noopener noreferrer",children:"Powered by BlocFeed"})})]})]}),t.phase==="recording"&&jsxRuntime.jsxs("div",{className:`bf-recording-bar bf-pos-${c}`,role:"status","aria-live":"polite","data-blocfeed-ui":"true",children:[jsxRuntime.jsx("span",{className:"bf-rec-dot bf-rec-dot-pulse","aria-hidden":"true"}),jsxRuntime.jsxs("span",{className:"bf-recording-bar-timer",children:[r.recordingText," ",re(t.recordingElapsedMs??0)," / ",re(ct)]}),jsxRuntime.jsx("button",{type:"button",className:"bf-recording-bar-stop",onClick:()=>i.stopRecording(),"aria-label":r.stopRecordButton,children:r.stopRecordButton})]}),t.phase==="success"&&jsxRuntime.jsx("div",{className:"bf-toast",role:"status","aria-live":"polite",children:r.toastText}),Q>0&&!lt&&jsxRuntime.jsxs("div",{className:"bf-security-banner",role:"alert",children:[jsxRuntime.jsx("button",{type:"button",className:"bf-security-banner-dismiss",onClick:()=>dt(true),"aria-label":"Dismiss",children:"\xD7"}),jsxRuntime.jsx("strong",{children:"Security Warning"}),Q," potential secret",Q>1?"s":""," exposed in client code. Check your environment variables."]})]})}var Eo=react.forwardRef(function(t,i){let o={...t.config??{},blocfeed_id:t.blocfeed_id},[a,l]=react.useState(null),n=wo(o.ui?.showOn),c=ko(o.ui?.theme?.mode),r=!!o.diagnostics;react.useEffect(()=>{if(r)return chunkEFTA67IW_cjs.o(o.diagnostics),()=>chunkEFTA67IW_cjs.p()},[r]);let s=!!o.security;react.useEffect(()=>{s&&chunkEFTA67IW_cjs.s(o.security);},[s]);let h=react.useRef(t.config?.metadata?.enrich);h.current=t.config?.metadata?.enrich;let M=react.useMemo(()=>{if(t.config)return {...t.config,metadata:{...t.config.metadata,enrich:async f=>{let S=h.current,u=S?await S(f):{},C=chunkEFTA67IW_cjs.q(),y=chunkEFTA67IW_cjs.t(),O=chunkEFTA67IW_cjs.j();return {...u,...C.consoleLogs.length>0?{_consoleLogs:C.consoleLogs}:{},...C.networkErrors.length>0?{_networkErrors:C.networkErrors}:{},...y.findings.length>0?{_securityFindings:y.findings}:{},...O.length>0?{_clickEvents:O}:{}}}}}},[]);return react.useEffect(()=>{Se();let f=document.createElement("div");f.setAttribute("data-blocfeed-ui-root","true"),f.setAttribute("data-blocfeed-ui","true"),f.setAttribute("data-bf-theme",c);let S=o.ui?.zIndex;typeof S=="number"&&f.style.setProperty("--bf-z",String(S));let u=o.ui?.theme;return u&&(u.accentColor&&f.style.setProperty("--bf-accent",u.accentColor),u.panelBackground&&f.style.setProperty("--bf-panel-bg",u.panelBackground),u.panelForeground&&f.style.setProperty("--bf-panel-fg",u.panelForeground),u.fontFamily&&f.style.setProperty("--bf-font",u.fontFamily)),document.body.appendChild(f),l(f),()=>{f.remove(),l(null);}},[o.ui?.zIndex,o.ui?.theme?.accentColor,o.ui?.theme?.panelBackground,o.ui?.theme?.panelForeground,o.ui?.theme?.fontFamily,c]),react.useEffect(()=>{a&&a.setAttribute("data-bf-theme",c);},[a,c]),!n||!a?null:reactDom.createPortal(jsxRuntime.jsx(te,{blocfeed_id:o.blocfeed_id,...M?{config:M}:{},children:jsxRuntime.jsx(Co,{config:o,handleRef:i})}),a)});
|
|
807
|
+
exports.BlocFeedProvider=te;exports.BlocFeedWidget=Eo;exports.useBlocFeed=oe;
|
package/dist/main.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as BlocFeedConfig, a as BlocFeedHandle, b as BlocFeedState, c as BlocFeedController, C as CaptureConfig, F as FeedbackCategory, S as SubmitResult } from './controller-
|
|
2
|
-
export { d as BlocFeedError, e as BlocFeedStrings, f as BlocFeedUser, g as CaptureDiagnostics, h as CaptureResult, i as ConsoleEntry, D as DiagnosticsConfig, E as ElementDescriptor, j as FeedbackApiResponse, k as FeedbackPayload, I as ImageAsset, M as MaybePromise, l as MetadataConfig, m as MetadataContext, N as NetworkEntry, P as PickerConfig, R as RecordingConfig, n as Rect, o as ScreenshotAdapter, p as ScreenshotAdapterOptions, q as ScreenshotIntent, r as ScreenshotMime, s as SecurityConfig, t as SecurityFinding, u as SecuritySnapshot, v as SessionPhase, T as ThemeConfig, w as TransportConfig, x as TransportResult, y as TriggerStyle, V as VideoAsset, z as VideoIntent, A as VideoMime, W as WidgetPosition } from './controller-
|
|
1
|
+
import { B as BlocFeedConfig, a as BlocFeedHandle, b as BlocFeedState, c as BlocFeedController, C as CaptureConfig, F as FeedbackCategory, S as SubmitResult } from './controller-C6M-ge3K.cjs';
|
|
2
|
+
export { d as BlocFeedError, e as BlocFeedStrings, f as BlocFeedUser, g as CaptureDiagnostics, h as CaptureResult, i as ConsoleEntry, D as DiagnosticsConfig, E as ElementDescriptor, j as FeedbackApiResponse, k as FeedbackPayload, I as ImageAsset, M as MaybePromise, l as MetadataConfig, m as MetadataContext, N as NetworkEntry, P as PickerConfig, R as RecordingConfig, n as Rect, o as ScreenshotAdapter, p as ScreenshotAdapterOptions, q as ScreenshotIntent, r as ScreenshotMime, s as SecurityConfig, t as SecurityFinding, u as SecuritySnapshot, v as SessionPhase, T as ThemeConfig, w as TransportConfig, x as TransportResult, y as TriggerStyle, V as VideoAsset, z as VideoIntent, A as VideoMime, W as WidgetPosition } from './controller-C6M-ge3K.cjs';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import * as react from 'react';
|
|
5
5
|
import { ReactNode } from 'react';
|
package/dist/main.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as BlocFeedConfig, a as BlocFeedHandle, b as BlocFeedState, c as BlocFeedController, C as CaptureConfig, F as FeedbackCategory, S as SubmitResult } from './controller-
|
|
2
|
-
export { d as BlocFeedError, e as BlocFeedStrings, f as BlocFeedUser, g as CaptureDiagnostics, h as CaptureResult, i as ConsoleEntry, D as DiagnosticsConfig, E as ElementDescriptor, j as FeedbackApiResponse, k as FeedbackPayload, I as ImageAsset, M as MaybePromise, l as MetadataConfig, m as MetadataContext, N as NetworkEntry, P as PickerConfig, R as RecordingConfig, n as Rect, o as ScreenshotAdapter, p as ScreenshotAdapterOptions, q as ScreenshotIntent, r as ScreenshotMime, s as SecurityConfig, t as SecurityFinding, u as SecuritySnapshot, v as SessionPhase, T as ThemeConfig, w as TransportConfig, x as TransportResult, y as TriggerStyle, V as VideoAsset, z as VideoIntent, A as VideoMime, W as WidgetPosition } from './controller-
|
|
1
|
+
import { B as BlocFeedConfig, a as BlocFeedHandle, b as BlocFeedState, c as BlocFeedController, C as CaptureConfig, F as FeedbackCategory, S as SubmitResult } from './controller-C6M-ge3K.js';
|
|
2
|
+
export { d as BlocFeedError, e as BlocFeedStrings, f as BlocFeedUser, g as CaptureDiagnostics, h as CaptureResult, i as ConsoleEntry, D as DiagnosticsConfig, E as ElementDescriptor, j as FeedbackApiResponse, k as FeedbackPayload, I as ImageAsset, M as MaybePromise, l as MetadataConfig, m as MetadataContext, N as NetworkEntry, P as PickerConfig, R as RecordingConfig, n as Rect, o as ScreenshotAdapter, p as ScreenshotAdapterOptions, q as ScreenshotIntent, r as ScreenshotMime, s as SecurityConfig, t as SecurityFinding, u as SecuritySnapshot, v as SessionPhase, T as ThemeConfig, w as TransportConfig, x as TransportResult, y as TriggerStyle, V as VideoAsset, z as VideoIntent, A as VideoMime, W as WidgetPosition } from './controller-C6M-ge3K.js';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import * as react from 'react';
|
|
5
5
|
import { ReactNode } from 'react';
|
package/dist/main.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import {o,p,s,q,t,j,a,n,l,i,b}from'./chunk-QL6DSCNT.js';import {createContext,forwardRef,useState,useEffect,useRef,useMemo,useImperativeHandle,useCallback,useContext}from'react';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {createPortal}from'react-dom';import {AnimatePresence,motion}from'framer-motion';var U=createContext(null);function te(e){let t=useMemo(()=>n({...e.config??{},blocfeed_id:e.blocfeed_id}),[]),[i,o]=useState(()=>t.getState());return useEffect(()=>t.subscribe(o),[t]),useEffect(()=>t.setConfig({...e.config??{},blocfeed_id:e.blocfeed_id}),[t,e.config,e.blocfeed_id]),useEffect(()=>()=>t.destroy(),[t]),jsx(U.Provider,{value:{controller:t,state:i},children:e.children})}var Te="blocfeed-styles-v1",Tt=`
|
|
3
3
|
:where([data-blocfeed-ui-root]),
|
|
4
4
|
:where([data-blocfeed-ui-root]) * {
|
|
5
5
|
box-sizing: border-box;
|
|
@@ -705,6 +705,70 @@ import {m as m$1,n,q,o,r,a,l,j,i,b}from'./chunk-KJRV7PRA.js';import {createConte
|
|
|
705
705
|
padding: 4px 8px;
|
|
706
706
|
}
|
|
707
707
|
|
|
708
|
+
/* ------------------------------------------------------------------ */
|
|
709
|
+
/* Floating recording bar (shown during active recording) */
|
|
710
|
+
/* ------------------------------------------------------------------ */
|
|
711
|
+
|
|
712
|
+
:where([data-blocfeed-ui-root]) .bf-recording-bar {
|
|
713
|
+
position: fixed;
|
|
714
|
+
z-index: var(--bf-z);
|
|
715
|
+
display: flex;
|
|
716
|
+
align-items: center;
|
|
717
|
+
gap: 10px;
|
|
718
|
+
padding: 8px 14px;
|
|
719
|
+
border-radius: 20px;
|
|
720
|
+
background: var(--bf-bg);
|
|
721
|
+
border: 1px solid var(--bf-danger);
|
|
722
|
+
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(239, 68, 68, 0.25);
|
|
723
|
+
font-size: 13px;
|
|
724
|
+
color: var(--bf-fg);
|
|
725
|
+
pointer-events: auto;
|
|
726
|
+
animation: bf-slideUp 0.2s ease-out;
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
:where([data-blocfeed-ui-root]) .bf-recording-bar.bf-pos-bottom-right {
|
|
730
|
+
bottom: 24px;
|
|
731
|
+
right: 24px;
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
:where([data-blocfeed-ui-root]) .bf-recording-bar.bf-pos-bottom-left {
|
|
735
|
+
bottom: 24px;
|
|
736
|
+
left: 24px;
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
:where([data-blocfeed-ui-root]) .bf-recording-bar.bf-pos-top-right {
|
|
740
|
+
top: 24px;
|
|
741
|
+
right: 24px;
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
:where([data-blocfeed-ui-root]) .bf-recording-bar.bf-pos-top-left {
|
|
745
|
+
top: 24px;
|
|
746
|
+
left: 24px;
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
:where([data-blocfeed-ui-root]) .bf-recording-bar-timer {
|
|
750
|
+
color: var(--bf-danger);
|
|
751
|
+
font-weight: 500;
|
|
752
|
+
font-variant-numeric: tabular-nums;
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
:where([data-blocfeed-ui-root]) .bf-recording-bar-stop {
|
|
756
|
+
padding: 4px 12px;
|
|
757
|
+
border-radius: 12px;
|
|
758
|
+
border: 1px solid var(--bf-danger);
|
|
759
|
+
background: transparent;
|
|
760
|
+
color: var(--bf-danger);
|
|
761
|
+
font-size: 12px;
|
|
762
|
+
font-weight: 600;
|
|
763
|
+
cursor: pointer;
|
|
764
|
+
transition: background 0.15s, color 0.15s;
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
:where([data-blocfeed-ui-root]) .bf-recording-bar-stop:hover {
|
|
768
|
+
background: var(--bf-danger);
|
|
769
|
+
color: #fff;
|
|
770
|
+
}
|
|
771
|
+
|
|
708
772
|
/* ------------------------------------------------------------------ */
|
|
709
773
|
/* Watermark */
|
|
710
774
|
/* ------------------------------------------------------------------ */
|
|
@@ -734,9 +798,10 @@ import {m as m$1,n,q,o,r,a,l,j,i,b}from'./chunk-KJRV7PRA.js';import {createConte
|
|
|
734
798
|
:where([data-blocfeed-ui-root]) .bf-toast,
|
|
735
799
|
:where([data-blocfeed-ui-root]) .bf-hint,
|
|
736
800
|
:where([data-blocfeed-ui-root]) .bf-cursor,
|
|
737
|
-
:where([data-blocfeed-ui-root]) .bf-rec-dot-pulse
|
|
801
|
+
:where([data-blocfeed-ui-root]) .bf-rec-dot-pulse,
|
|
802
|
+
:where([data-blocfeed-ui-root]) .bf-recording-bar {
|
|
738
803
|
animation: none;
|
|
739
804
|
}
|
|
740
805
|
}
|
|
741
|
-
`;function Te(){if(!a()||document.getElementById(ke))return;let e=document.createElement("style");e.id=ke,e.textContent=kt,document.head.appendChild(e);}var Se={triggerLabel:"Feedback",panelTitle:"Feedback",hintText:"Click an element to attach your feedback. Press Esc to cancel.",cancelButton:"Cancel",rePickButton:"Re-pick",closeButton:"Close",textareaPlaceholder:"What's happening? What did you expect?",screenshotElement:"Screenshot element",screenshotFullPage:"Full page",capturingText:"Capturing screenshots\u2026",submittingText:"Submitting\u2026",successText:"Sent. Thank you!",toastText:"Feedback sent",sendButton:"Send",categoryBug:"Bug",categoryFeature:"Feature",categoryUx:"UX",categoryGeneral:"General",recordButton:"Record",stopRecordButton:"Stop",recordingText:"Recording\u2026",recordingDeniedText:"Screen share was denied",videoPreviewLabel:"Video attached",removeVideoButton:"Remove"};function Pe(e){return e?{...Se,...e}:Se}function te(){let e=useContext(V);if(!e)throw new Error("useBlocFeed must be used within a <BlocFeedProvider />");return {state:e.state,controller:e.controller,start:e.controller.start,stop:e.controller.stop,clearSelection:e.controller.clearSelection,submit:e.controller.submit,startRecording:e.controller.startRecording,stopRecording:e.controller.stopRecording,removeVideo:e.controller.removeVideo}}function v(e){switch(e){case "bottom-left":return "bf-trigger bf-trigger-bl";case "top-right":return "bf-trigger bf-trigger-tr";case "top-left":return "bf-trigger bf-trigger-tl";default:return "bf-trigger"}}function g({size:e=14}){return jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:jsx("path",{d:"M20 6L9 17l-5-5",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ce({size:e=14}){return jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:jsx("path",{d:"M21 11.5a8.38 8.38 0 01-.9 3.8 8.5 8.5 0 01-7.6 4.7 8.38 8.38 0 01-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 01-.9-3.8 8.5 8.5 0 014.7-7.6 8.38 8.38 0 013.8-.9h.5a8.48 8.48 0 018 8v.5z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ee({size:e=16}){return jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[jsx("path",{d:"M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M22 6l-10 7L2 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Fe({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){return i?jsxs("button",{className:v(e),type:"button",onClick:t,"aria-label":o,children:[l?jsx("span",{style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(g,{size:14})}):jsxs(Fragment,{children:[jsx("span",{className:"bf-dot","aria-hidden":"true"}),o]}),a>0&&jsx("span",{className:"bf-badge","aria-label":`${a} queued`,children:a})]}):null}function m(){let[e,t]=useState(()=>typeof window>"u"?false:window.matchMedia("(prefers-reduced-motion: reduce)").matches);return useEffect(()=>{let i=window.matchMedia("(prefers-reduced-motion: reduce)"),o=a=>t(a.matches);return i.addEventListener("change",o),()=>i.removeEventListener("change",o)},[]),e}var Ft={duration:.18,ease:"easeOut"},Nt={duration:0};function Re({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=useState(false),r=m(),s=r?Nt:Ft;return jsx(AnimatePresence,{mode:"wait",children:i&&jsx(motion.button,{className:v(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":o,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:s,whileTap:{scale:.92},style:{overflow:"hidden"},children:l?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:s,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(g,{size:14})},"success"):jsxs(Fragment,{children:[jsx(motion.span,{className:"bf-dot","aria-hidden":"true",animate:r?{}:{scale:n?1:[1,1.2,1],boxShadow:n?"0 0 0 4px rgba(99, 102, 241, 0.18)":["0 0 0 4px rgba(99, 102, 241, 0.18)","0 0 0 8px rgba(99, 102, 241, 0.28)","0 0 0 4px rgba(99, 102, 241, 0.18)"]},transition:n||r?s:{duration:2,repeat:1/0,ease:"easeInOut"}}),jsx(AnimatePresence,{mode:"wait",children:n&&jsx(motion.span,{initial:{opacity:0,x:r?0:-6},animate:{opacity:1,x:0},exit:{opacity:0,x:r?0:-6},transition:s,style:{whiteSpace:"nowrap"},children:o},"label")}),a>0&&jsx("span",{className:"bf-badge","aria-label":`${a} queued`,children:a})]})},"dot")})}var zt={duration:.18,ease:"easeOut"},Le={duration:0};function Ae({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=useState(false),r=m(),s=r?Le:zt;return jsx(AnimatePresence,{mode:"wait",children:i&&jsxs(motion.div,{className:v(e),initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{y:8,opacity:0},transition:s,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),style:{background:"transparent",border:"none",boxShadow:"none",padding:0},children:[jsx(AnimatePresence,{mode:"wait",children:n&&jsx(motion.div,{initial:{opacity:0,y:r?0:4},animate:{opacity:1,y:0},exit:{opacity:0,y:r?0:4},transition:s,style:{position:"absolute",bottom:"calc(100% + 8px)",left:"50%",transform:"translateX(-50%)",padding:"6px 12px",borderRadius:"8px",background:"var(--bf-panel-bg)",border:"1px solid var(--bf-border)",boxShadow:"var(--bf-shadow)",whiteSpace:"nowrap",fontSize:"12px",color:"var(--bf-panel-fg)",pointerEvents:"none"},children:o},"tooltip")}),jsxs(motion.button,{type:"button",onClick:t,"aria-label":o,style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",width:"40px",height:"40px",borderRadius:"50%",border:"1px solid var(--bf-border)",background:"var(--bf-panel-bg)",color:"var(--bf-panel-fg)",boxShadow:"var(--bf-shadow)",cursor:"pointer",padding:0},animate:r?{}:{y:[0,-3,0]},transition:r?Le:{y:{duration:3,repeat:1/0,ease:"easeInOut"}},whileHover:{scale:1.1,borderColor:"var(--bf-accent)"},whileTap:{scale:.9},children:[l?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:s,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(g,{size:16})},"success"):jsx(Ce,{size:16}),a>0&&jsx("span",{className:"bf-badge bf-badge-float","aria-label":`${a} queued`,children:a})]})]},"bubble")})}var Wt={duration:.2,ease:"easeOut"},_t={duration:0};function We(e){return e==="bottom-left"||e==="top-left"}function Ht(e){return `bf-trigger-edge ${We(e)?"bf-trigger-edge-left":"bf-trigger-edge-right"}`}function _e({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=useState(false),r=We(e),s=m(),h=s?_t:Wt;return jsx(AnimatePresence,{mode:"wait",children:i&&jsx(motion.button,{className:Ht(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":o,initial:{opacity:0,width:0},animate:{opacity:1,width:n?140:22,height:n?40:90},exit:{width:0,opacity:0},transition:h,whileTap:{scale:.97},style:{top:"50%",translateY:"-50%"},children:l?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:h,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(g,{size:14})},"success"):jsxs(Fragment,{children:[jsxs(motion.span,{animate:{rotate:s||n?0:r?-90:90,opacity:n?1:.6},transition:h,style:{display:"flex",alignItems:"center",gap:"8px",whiteSpace:"nowrap",fontSize:"12px",letterSpacing:"0.5px",textTransform:"uppercase"},children:[n&&jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:{duration:.12},style:{width:"6px",height:"6px",borderRadius:"50%",background:"var(--bf-accent)",flexShrink:0}}),o]}),jsx(motion.span,{"aria-hidden":"true",animate:{opacity:n?1:0},transition:{duration:.12},style:{position:"absolute",top:0,bottom:0,[r?"left":"right"]:0,width:"2px",background:"var(--bf-accent)"}}),a>0&&jsx("span",{className:"bf-badge","aria-label":`${a} queued`,children:a})]})},"edge-tab")})}var $t={duration:.18,ease:"easeOut"},Kt={duration:0};function Oe({delay:e,hovered:t,reduced:i}){return i?null:jsx(motion.span,{"aria-hidden":"true",style:{position:"absolute",width:"10px",height:"10px",borderRadius:"50%",border:"2px solid var(--bf-accent)",pointerEvents:"none"},animate:t?{scale:1,opacity:0}:{scale:[1,1.8],opacity:[.5,0]},transition:t?{duration:.15}:{duration:2,repeat:1/0,delay:e,ease:"easeOut"}})}function $e({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=useState(false),r=m(),s=r?Kt:$t;return jsx(AnimatePresence,{mode:"wait",children:i&&jsx(motion.button,{className:v(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":o,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:s,whileTap:{scale:.92},style:{overflow:"hidden"},children:l?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:s,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(g,{size:14})},"success"):jsxs(Fragment,{children:[jsxs("span",{style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",width:"10px",height:"10px",flexShrink:0},children:[jsx(Oe,{delay:0,hovered:n,reduced:r}),jsx(Oe,{delay:.7,hovered:n,reduced:r}),jsx(motion.span,{className:"bf-dot","aria-hidden":"true",style:{position:"relative",zIndex:1}})]}),jsx(AnimatePresence,{mode:"wait",children:n&&jsx(motion.span,{initial:{opacity:0,x:r?0:-6},animate:{opacity:1,x:0},exit:{opacity:0,x:r?0:-6},transition:s,style:{whiteSpace:"nowrap"},children:o},"label")}),a>0&&jsx("span",{className:"bf-badge","aria-label":`${a} queued`,children:a})]})},"pulse-ring")})}var Yt={duration:.18,ease:"easeOut"},Gt={duration:0};function jt(e){switch(e){case "bottom-left":return "bf-trigger-minimal bf-trigger-bl";case "top-right":return "bf-trigger-minimal bf-trigger-tr";case "top-left":return "bf-trigger-minimal bf-trigger-tl";default:return "bf-trigger-minimal"}}function Ue({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=useState(false),r=m(),s=r?Gt:Yt;return jsx(AnimatePresence,{mode:"wait",children:i&&jsxs(motion.button,{className:jt(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":o,initial:{opacity:0,y:r?0:5},animate:{opacity:n?1:.65,y:0},exit:{opacity:0,y:r?0:5},transition:s,whileTap:{scale:.95},children:[l?jsx("span",{style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(g,{size:14})}):jsxs(Fragment,{children:[jsx("span",{children:o}),a>0&&jsx("span",{className:"bf-badge",style:{marginLeft:"4px"},"aria-label":`${a} queued`,children:a})]}),!r&&jsx(motion.span,{"aria-hidden":"true",style:{position:"absolute",bottom:4,left:4,right:4,height:"2px",background:"var(--bf-accent)",borderRadius:"1px",transformOrigin:"left"},initial:false,animate:{scaleX:n?1:0},transition:s})]},"minimal")})}var Jt={duration:.18,ease:"easeOut"},Zt={duration:0};function Ye({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=useState(false),r=m(),s=r?Zt:Jt;return jsx(AnimatePresence,{mode:"wait",children:i&&jsx(motion.button,{className:v(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":o,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:s,whileTap:{scale:.9},style:{overflow:"hidden"},children:l?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:s,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(g,{size:14})},"success"):jsxs(Fragment,{children:[jsx(motion.span,{style:{display:"inline-flex",flexShrink:0},animate:r?{}:n?{scale:1.2,rotate:0}:{rotate:[-5,5,-5]},transition:n||r?s:{duration:3,repeat:1/0,ease:"easeInOut"},children:jsx(Ee,{size:16})}),jsx(AnimatePresence,{mode:"wait",children:n&&jsx(motion.span,{initial:{opacity:0,x:r?0:-8},animate:{opacity:1,x:0},exit:{opacity:0,x:r?0:-8},transition:s,style:{whiteSpace:"nowrap"},children:o},"label")}),a>0&&jsx("span",{className:"bf-badge","aria-label":`${a} queued`,children:a})]})},"icon-pop")})}var ro={duration:.18,ease:"easeOut"},ao={duration:0};function Qe({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=useState(false),r=m(),s=r?ao:ro;return jsx(AnimatePresence,{mode:"wait",children:i&&jsx(motion.button,{className:v(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":o,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:s,whileTap:{scale:.92},style:{overflow:"hidden"},children:l?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:s,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(g,{size:14})},"success"):jsxs(Fragment,{children:[jsxs("span",{style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:"10px",height:"10px",flexShrink:0},children:[jsx(motion.span,{"aria-hidden":"true",style:{width:"10px",height:"10px",borderRadius:"50%",background:"var(--bf-accent)",position:"relative",zIndex:1},animate:r?{}:{opacity:n?1:[.5,1,.5],boxShadow:n?"0 0 8px 2px var(--bf-accent)":["0 0 4px 1px var(--bf-accent)","0 0 12px 4px var(--bf-accent)","0 0 4px 1px var(--bf-accent)"]},transition:n||r?s:{duration:2,repeat:1/0,ease:"easeInOut"}}),!n&&!r&&jsx(motion.span,{"aria-hidden":"true",style:{position:"absolute",width:"18px",height:"2px",background:"linear-gradient(90deg, var(--bf-accent), transparent)",transformOrigin:"left center",left:"5px",top:"4px"},animate:{rotate:[0,360]},transition:{duration:4,repeat:1/0,ease:"linear"}})]}),jsx(AnimatePresence,{mode:"wait",children:n&&jsx(motion.span,{initial:{opacity:0,x:r?0:-6},animate:{opacity:1,x:0},exit:{opacity:0,x:r?0:-6},transition:s,style:{whiteSpace:"nowrap"},children:o},"label")}),a>0&&jsx("span",{className:"bf-badge","aria-label":`${a} queued`,children:a})]})},"beacon")})}var lo={duration:.18,ease:"easeOut"},po={duration:0};function et({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=useState(false),[r,s]=useState(0),h=m(),M=h?po:lo,f=useRef(null);useEffect(()=>{if(f.current&&(clearInterval(f.current),f.current=null),!i||n||h){s(n||h?o.length:0);return}let u=8,C=o.length*2+u*2,y=0;return f.current=setInterval(()=>{y=(y+1)%C,y<=o.length?s(y):y<=o.length+u?s(o.length):y<=o.length*2+u?s(o.length*2+u-y):s(0);},100),()=>{f.current&&(clearInterval(f.current),f.current=null);}},[i,n,h,o]);let S=o.slice(0,r);return jsx(AnimatePresence,{mode:"wait",children:i&&jsx(motion.button,{className:v(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":o,initial:{opacity:0,y:h?0:5},animate:{opacity:1,y:0},exit:{opacity:0,y:h?0:5},transition:M,whileTap:{scale:.95},style:{minWidth:"44px"},children:l?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:M,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(g,{size:14})},"success"):jsxs(Fragment,{children:[jsx("span",{className:"bf-dot","aria-hidden":"true"}),jsxs("span",{style:{whiteSpace:"nowrap",minWidth:"1ch"},children:[S,jsx("span",{className:"bf-cursor","aria-hidden":"true"})]}),a>0&&jsx("span",{className:"bf-badge","aria-label":`${a} queued`,children:a})]})},"typewriter")})}function tt(e){switch(e){case "dot":return Re;case "bubble":return Ae;case "edge-tab":return _e;case "pulse-ring":return $e;case "minimal":return Ue;case "icon-pop":return Ye;case "beacon":return Qe;case "typewriter":return et;default:return Fe}}function rt(e,t,i){return Math.max(t,Math.min(i,e))}function mo(e,t,i="bottom-right"){let a=window.innerWidth,l=window.innerHeight,n;n=rt(e.x,12,Math.max(12,a-t-12));let c=e.y+e.height+12,r=Math.max(12,e.y-240);return {top:c+240<=l?c:r,left:n}}function ho(e){let{rect:t}=e,i={left:`${t.x}px`,top:`${t.y}px`,width:`${Math.max(0,t.width)}px`,height:`${Math.max(0,t.height)}px`};return jsx("div",{className:"bf-highlight",style:i,"aria-hidden":"true"})}function xo(e){let t=useRef(null);return useEffect(()=>{if(!e||!t.current)return;t.current.querySelector(".bf-textarea")?.focus();let o=a=>{if(a.key!=="Tab"||!t.current)return;let l=t.current.querySelectorAll('button:not([disabled]), textarea:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])');if(l.length===0)return;let n=l[0],c=l[l.length-1];a.shiftKey&&document.activeElement===n?(a.preventDefault(),c.focus()):!a.shiftKey&&document.activeElement===c&&(a.preventDefault(),n.focus());};return document.addEventListener("keydown",o,{capture:true}),()=>document.removeEventListener("keydown",o,{capture:true})},[e]),t}function yo(e,t){return e?typeof e=="function"?e(t):e.some(i=>i.endsWith("*")?t.startsWith(i.slice(0,-1)):t===i):true}function vo(e){let[t,i]=useState(()=>typeof window<"u"?window.location.pathname:"/");return useEffect(()=>{if(typeof window>"u")return;let o=()=>i(window.location.pathname);window.addEventListener("popstate",o);let a=history.pushState,l=history.replaceState;return history.pushState=function(...n){a.apply(this,n),o();},history.replaceState=function(...n){l.apply(this,n),o();},()=>{window.removeEventListener("popstate",o),history.pushState=a,history.replaceState=l;}},[]),yo(e,t)}function wo(e){let[t,i]=useState(()=>!e||e==="dark"?"dark":e==="light"?"light":typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light");return useEffect(()=>{if(e!=="auto"){i(e==="light"?"light":"dark");return}let o=window.matchMedia("(prefers-color-scheme: dark)"),a=l=>i(l.matches?"dark":"light");return i(o.matches?"dark":"light"),o.addEventListener("change",a),()=>o.removeEventListener("change",a)},[e]),t}var ko=["bug","feature","ux","general"],To={bug:"categoryBug",feature:"categoryFeature",ux:"categoryUx",general:"categoryGeneral"};function oe(e){let t=Math.floor(e/1e3),i=Math.floor(t/60),o=t%60;return `${i}:${String(o).padStart(2,"0")}`}function So(e){return e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Po(e){let{state:t,controller:i$1,start:o,stop:a,clearSelection:l,submit:n}=te(),c=e.config.ui?.position,r$1=Pe(e.config.ui?.strings),s=e.config.ui?.branding!==false,[h,M]=useState(null),[f,S]=useState(""),[u,C]=useState(e.config.capture?.element??true),[y,ae]=useState(e.config.capture?.fullPage??false),[it,ie]=useState(null),[O,ne]=useState(void 0),se=e.config.ui?.categories??ko,nt=e.config.recording?.enabled===true&&j(),st=e.config.recording?.maxDurationMs??3e4,[ct,lt]=useState(false),[j$1,dt]=useState(0);useEffect(()=>{let d=window.setTimeout(()=>{let N=r();dt(N.findings.length);},500);return ()=>window.clearTimeout(d)},[]),useImperativeHandle(e.handleRef,()=>({open:o,close:a,submit:d=>n(d),startRecording:()=>i$1.startRecording(),stopRecording:()=>i$1.stopRecording(),get isOpen(){return t.phase!=="idle"}}),[o,a,n,i$1,t.phase]);let ce=t.phase==="review"||t.phase==="recording"||t.phase==="capturing"||t.phase==="submitting"||t.phase==="error"||t.phase==="success",pt=xo(ce),[ft,ut]=useState(0);useEffect(()=>{t.phase==="idle"&&ut(i());},[t.phase]);let[bt,le]=useState(false),de=useRef(t.phase);useEffect(()=>{if(de.current==="success"&&t.phase==="idle"){le(true);let d=window.setTimeout(()=>le(false),1500);return ()=>window.clearTimeout(d)}de.current=t.phase;},[t.phase]),useEffect(()=>{let d=e.config.ui?.shortcut;if(!d)return;let N=d.toLowerCase().split("+").map(P=>P.trim()),W=N[N.length-1]||"",L=new Set(N.slice(0,-1)),fe=P=>{let ht=/Mac|iPod|iPhone|iPad/.test(navigator.platform);if(L.has("mod")){if(ht?!P.metaKey:!P.ctrlKey)return}else if(L.has("ctrl")&&!P.ctrlKey||(L.has("meta")||L.has("cmd"))&&!P.metaKey)return;L.has("shift")&&!P.shiftKey||(L.has("alt")||L.has("option"))&&!P.altKey||P.key.toLowerCase()===W&&(P.preventDefault(),t.phase==="idle"?o():a());};return document.addEventListener("keydown",fe),()=>document.removeEventListener("keydown",fe)},[e.config.ui?.shortcut,t.phase,o,a]),useEffect(()=>i$1.subscribeHover(M),[i$1]),useEffect(()=>{let d=i$1.__unsafeGetSelectedElement();if(!d||t.phase==="idle"||t.phase==="picking"){ie(null);return}let N=()=>{ie(b(d.getBoundingClientRect()));};N();let W=()=>N();return window.addEventListener("scroll",W,{capture:true,passive:true}),window.addEventListener("resize",W,{passive:true}),()=>{window.removeEventListener("scroll",W,{capture:true}),window.removeEventListener("resize",W);}},[i$1,t.phase,t.selection?.selector]),useEffect(()=>{t.phase==="review"&&(S(""),C(e.config.capture?.element??true),ae(e.config.capture?.fullPage??false),ne(void 0));},[t.phase,t.selection?.selector,e.config.capture?.element,e.config.capture?.fullPage]),useEffect(()=>{if(t.phase!=="success")return;let d=window.setTimeout(()=>a(),1200);return ()=>window.clearTimeout(d)},[t.phase,a]);let k=t.phase==="capturing"||t.phase==="submitting"||t.phase==="recording",F=t.phase==="picking"?h?.rect??null:it??t.selection?.rect??null,Q=useMemo(()=>F?mo(F,360,c):null,[F?.x,F?.y,F?.width,F?.height,c]),pe=t.lastError?.message,q=useCallback(()=>{let d={capture:{element:u,fullPage:y}};O&&(d.category=O),n(f,d);},[n,f,u,y,O]),gt=useCallback(d=>{(d.metaKey||d.ctrlKey)&&d.key==="Enter"&&f.trim().length>0&&!k&&(d.preventDefault(),q());},[q,f,k]),mt=tt(e.config.ui?.triggerStyle);return jsxs(Fragment,{children:[jsx(mt,{position:c,onClick:()=>o(),isVisible:t.phase==="idle",label:e.config.ui?.triggerLabel??r$1.triggerLabel,queueCount:ft,showSuccess:bt}),t.phase!=="idle"&&jsxs("div",{className:"bf-overlay",role:"presentation",children:[t.phase!=="picking"&&jsx("div",{className:"bf-blocker",role:"presentation",onClick:()=>a()}),F&&jsx(ho,{rect:F}),t.phase==="picking"&&jsxs("div",{className:"bf-hint",role:"status","aria-live":"polite",children:[jsx("p",{id:"bf-hint-text",children:r$1.hintText}),jsx("button",{type:"button",className:"bf-btn",onClick:()=>a(),"aria-label":r$1.cancelButton,children:r$1.cancelButton})]}),ce&&Q&&jsxs("div",{ref:pt,className:"bf-panel",style:{left:Q.left,top:Q.top},role:"dialog","aria-modal":"true","aria-label":"Feedback form",children:[jsxs("div",{className:"bf-panelHeader",children:[jsx("div",{className:"bf-title",id:"bf-panel-title",children:r$1.panelTitle}),jsxs("div",{className:"bf-row",style:{justifyContent:"flex-end"},children:[jsx("button",{type:"button",className:"bf-btn",onClick:()=>l(),disabled:k,"aria-label":r$1.rePickButton,children:r$1.rePickButton}),jsx("button",{type:"button",className:"bf-btn",onClick:()=>a(),disabled:k,"aria-label":r$1.closeButton,children:r$1.closeButton})]})]}),jsxs("div",{className:"bf-panelBody",children:[jsx("textarea",{className:"bf-textarea",placeholder:r$1.textareaPlaceholder,value:f,onChange:d=>S(d.target.value),onKeyDown:gt,disabled:k,"aria-label":r$1.panelTitle}),se.length>0&&jsx("div",{className:"bf-pills",role:"group","aria-label":"Feedback category",children:se.map(d=>jsx("button",{type:"button",className:`bf-pill${O===d?" bf-pill-active":""}`,onClick:()=>ne(O===d?void 0:d),disabled:k,children:r$1[To[d]]},d))}),jsxs("div",{className:"bf-row",role:"group","aria-label":r$1.screenshotElement,children:[jsxs("label",{children:[jsx("input",{type:"checkbox",checked:u,onChange:d=>C(d.target.checked),disabled:k}),r$1.screenshotElement]}),jsxs("label",{children:[jsx("input",{type:"checkbox",checked:y,onChange:d=>ae(d.target.checked),disabled:k}),r$1.screenshotFullPage]})]}),nt&&t.phase==="review"&&!t.video&&jsxs("button",{type:"button",className:"bf-record-btn",onClick:()=>i$1.startRecording(),disabled:k,"aria-label":r$1.recordButton,children:[jsx("span",{className:"bf-rec-dot","aria-hidden":"true"}),r$1.recordButton]}),t.phase==="recording"&&jsxs("div",{className:"bf-recording-indicator",role:"status","aria-live":"polite",children:[jsx("span",{className:"bf-rec-dot bf-rec-dot-pulse","aria-hidden":"true"}),jsxs("span",{children:[r$1.recordingText," ",oe(t.recordingElapsedMs??0)," / ",oe(st)]}),jsx("button",{type:"button",className:"bf-btn",onClick:()=>i$1.stopRecording(),"aria-label":r$1.stopRecordButton,children:r$1.stopRecordButton})]}),t.video&&t.phase==="review"&&jsxs("div",{className:"bf-video-preview",children:[jsx("video",{src:t.video.blobUrl,controls:true,muted:true,playsInline:true}),jsx("button",{type:"button",className:"bf-video-remove",onClick:()=>i$1.removeVideo(),"aria-label":r$1.removeVideoButton,children:"\xD7"}),jsxs("div",{className:"bf-video-meta",children:[r$1.videoPreviewLabel," (",oe(t.video.durationMs),", ",So(t.video.sizeBytes),")"]})]}),t.phase==="capturing"&&jsxs("div",{className:"bf-status",role:"status","aria-live":"polite",children:[jsx("span",{className:"bf-spinner","aria-hidden":"true"}),r$1.capturingText]}),t.phase==="submitting"&&jsxs("div",{className:"bf-status",role:"status","aria-live":"polite",children:[jsx("span",{className:"bf-spinner","aria-hidden":"true"}),r$1.submittingText]}),t.phase==="success"&&jsx("div",{className:"bf-status",role:"status","aria-live":"polite",children:r$1.successText}),t.phase==="error"&&pe&&jsx("div",{className:"bf-error",role:"alert",children:pe}),jsxs("div",{className:"bf-actions",children:[jsx("button",{type:"button",className:"bf-btn",onClick:()=>a(),disabled:k,"aria-label":r$1.cancelButton,children:r$1.cancelButton}),jsx("button",{type:"button",className:"bf-btn bf-btnPrimary",onClick:q,disabled:k||f.trim().length===0,"aria-label":r$1.sendButton,children:r$1.sendButton})]})]}),s&&jsx("div",{className:"bf-watermark",children:jsx("a",{href:"https://blocfeed.com",target:"_blank",rel:"noopener noreferrer",children:"Powered by BlocFeed"})})]})]}),t.phase==="success"&&jsx("div",{className:"bf-toast",role:"status","aria-live":"polite",children:r$1.toastText}),j$1>0&&!ct&&jsxs("div",{className:"bf-security-banner",role:"alert",children:[jsx("button",{type:"button",className:"bf-security-banner-dismiss",onClick:()=>lt(true),"aria-label":"Dismiss",children:"\xD7"}),jsx("strong",{children:"Security Warning"}),j$1," potential secret",j$1>1?"s":""," exposed in client code. Check your environment variables."]})]})}var Co=forwardRef(function(t,i){let o$1={...t.config??{},blocfeed_id:t.blocfeed_id},[a,l]=useState(null),n$1=vo(o$1.ui?.showOn),c=wo(o$1.ui?.theme?.mode),r$1=!!o$1.diagnostics;useEffect(()=>{if(r$1)return m$1(o$1.diagnostics),()=>n()},[r$1]);let s=!!o$1.security;useEffect(()=>{s&&q(o$1.security);},[s]);let h=useRef(t.config?.metadata?.enrich);h.current=t.config?.metadata?.enrich;let M=useMemo(()=>{if(t.config)return {...t.config,metadata:{...t.config.metadata,enrich:async f=>{let S=h.current,u=S?await S(f):{},C=o(),y=r();return {...u,...C.consoleLogs.length>0?{_consoleLogs:C.consoleLogs}:{},...C.networkErrors.length>0?{_networkErrors:C.networkErrors}:{},...y.findings.length>0?{_securityFindings:y.findings}:{}}}}}},[]);return useEffect(()=>{Te();let f=document.createElement("div");f.setAttribute("data-blocfeed-ui-root","true"),f.setAttribute("data-blocfeed-ui","true"),f.setAttribute("data-bf-theme",c);let S=o$1.ui?.zIndex;typeof S=="number"&&f.style.setProperty("--bf-z",String(S));let u=o$1.ui?.theme;return u&&(u.accentColor&&f.style.setProperty("--bf-accent",u.accentColor),u.panelBackground&&f.style.setProperty("--bf-panel-bg",u.panelBackground),u.panelForeground&&f.style.setProperty("--bf-panel-fg",u.panelForeground),u.fontFamily&&f.style.setProperty("--bf-font",u.fontFamily)),document.body.appendChild(f),l(f),()=>{f.remove(),l(null);}},[o$1.ui?.zIndex,o$1.ui?.theme?.accentColor,o$1.ui?.theme?.panelBackground,o$1.ui?.theme?.panelForeground,o$1.ui?.theme?.fontFamily,c]),useEffect(()=>{a&&a.setAttribute("data-bf-theme",c);},[a,c]),!n$1||!a?null:createPortal(jsx(ee,{blocfeed_id:o$1.blocfeed_id,...M?{config:M}:{},children:jsx(Po,{config:o$1,handleRef:i})}),a)});
|
|
742
|
-
export{
|
|
806
|
+
`;function Se(){if(!a()||document.getElementById(Te))return;let e=document.createElement("style");e.id=Te,e.textContent=Tt,document.head.appendChild(e);}var Pe={triggerLabel:"Feedback",panelTitle:"Feedback",hintText:"Click an element to attach your feedback. Press Esc to cancel.",cancelButton:"Cancel",rePickButton:"Re-pick",closeButton:"Close",textareaPlaceholder:"What's happening? What did you expect?",screenshotElement:"Screenshot element",screenshotFullPage:"Full page",capturingText:"Capturing screenshots\u2026",submittingText:"Submitting\u2026",successText:"Sent. Thank you!",toastText:"Feedback sent",sendButton:"Send",categoryBug:"Bug",categoryFeature:"Feature",categoryUx:"UX",categoryGeneral:"General",recordButton:"Record",stopRecordButton:"Stop",recordingText:"Recording\u2026",recordingDeniedText:"Screen share was denied",videoPreviewLabel:"Video attached",removeVideoButton:"Remove"};function Ce(e){return e?{...Pe,...e}:Pe}function oe(){let e=useContext(U);if(!e)throw new Error("useBlocFeed must be used within a <BlocFeedProvider />");return {state:e.state,controller:e.controller,start:e.controller.start,stop:e.controller.stop,clearSelection:e.controller.clearSelection,submit:e.controller.submit,startRecording:e.controller.startRecording,stopRecording:e.controller.stopRecording,removeVideo:e.controller.removeVideo}}function v(e){switch(e){case "bottom-left":return "bf-trigger bf-trigger-bl";case "top-right":return "bf-trigger bf-trigger-tr";case "top-left":return "bf-trigger bf-trigger-tl";default:return "bf-trigger"}}function g({size:e=14}){return jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:jsx("path",{d:"M20 6L9 17l-5-5",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ee({size:e=14}){return jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:jsx("path",{d:"M21 11.5a8.38 8.38 0 01-.9 3.8 8.5 8.5 0 01-7.6 4.7 8.38 8.38 0 01-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 01-.9-3.8 8.5 8.5 0 014.7-7.6 8.38 8.38 0 013.8-.9h.5a8.48 8.48 0 018 8v.5z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function Be({size:e=16}){return jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[jsx("path",{d:"M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M22 6l-10 7L2 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Ne({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){return i?jsxs("button",{className:v(e),type:"button",onClick:t,"aria-label":o,children:[l?jsx("span",{style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(g,{size:14})}):jsxs(Fragment,{children:[jsx("span",{className:"bf-dot","aria-hidden":"true"}),o]}),a>0&&jsx("span",{className:"bf-badge","aria-label":`${a} queued`,children:a})]}):null}function m(){let[e,t]=useState(()=>typeof window>"u"?false:window.matchMedia("(prefers-reduced-motion: reduce)").matches);return useEffect(()=>{let i=window.matchMedia("(prefers-reduced-motion: reduce)"),o=a=>t(a.matches);return i.addEventListener("change",o),()=>i.removeEventListener("change",o)},[]),e}var Nt={duration:.18,ease:"easeOut"},Rt={duration:0};function Me({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=useState(false),r=m(),s=r?Rt:Nt;return jsx(AnimatePresence,{mode:"wait",children:i&&jsx(motion.button,{className:v(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":o,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:s,whileTap:{scale:.92},style:{overflow:"hidden"},children:l?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:s,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(g,{size:14})},"success"):jsxs(Fragment,{children:[jsx(motion.span,{className:"bf-dot","aria-hidden":"true",animate:r?{}:{scale:n?1:[1,1.2,1],boxShadow:n?"0 0 0 4px rgba(99, 102, 241, 0.18)":["0 0 0 4px rgba(99, 102, 241, 0.18)","0 0 0 8px rgba(99, 102, 241, 0.28)","0 0 0 4px rgba(99, 102, 241, 0.18)"]},transition:n||r?s:{duration:2,repeat:1/0,ease:"easeInOut"}}),jsx(AnimatePresence,{mode:"wait",children:n&&jsx(motion.span,{initial:{opacity:0,x:r?0:-6},animate:{opacity:1,x:0},exit:{opacity:0,x:r?0:-6},transition:s,style:{whiteSpace:"nowrap"},children:o},"label")}),a>0&&jsx("span",{className:"bf-badge","aria-label":`${a} queued`,children:a})]})},"dot")})}var At={duration:.18,ease:"easeOut"},Le={duration:0};function Ie({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=useState(false),r=m(),s=r?Le:At;return jsx(AnimatePresence,{mode:"wait",children:i&&jsxs(motion.div,{className:v(e),initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{y:8,opacity:0},transition:s,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),style:{background:"transparent",border:"none",boxShadow:"none",padding:0},children:[jsx(AnimatePresence,{mode:"wait",children:n&&jsx(motion.div,{initial:{opacity:0,y:r?0:4},animate:{opacity:1,y:0},exit:{opacity:0,y:r?0:4},transition:s,style:{position:"absolute",bottom:"calc(100% + 8px)",left:"50%",transform:"translateX(-50%)",padding:"6px 12px",borderRadius:"8px",background:"var(--bf-panel-bg)",border:"1px solid var(--bf-border)",boxShadow:"var(--bf-shadow)",whiteSpace:"nowrap",fontSize:"12px",color:"var(--bf-panel-fg)",pointerEvents:"none"},children:o},"tooltip")}),jsxs(motion.button,{type:"button",onClick:t,"aria-label":o,style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",width:"40px",height:"40px",borderRadius:"50%",border:"1px solid var(--bf-border)",background:"var(--bf-panel-bg)",color:"var(--bf-panel-fg)",boxShadow:"var(--bf-shadow)",cursor:"pointer",padding:0},animate:r?{}:{y:[0,-3,0]},transition:r?Le:{y:{duration:3,repeat:1/0,ease:"easeInOut"}},whileHover:{scale:1.1,borderColor:"var(--bf-accent)"},whileTap:{scale:.9},children:[l?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:s,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(g,{size:16})},"success"):jsx(Ee,{size:16}),a>0&&jsx("span",{className:"bf-badge bf-badge-float","aria-label":`${a} queued`,children:a})]})]},"bubble")})}var _t={duration:.2,ease:"easeOut"},Ht={duration:0};function _e(e){return e==="bottom-left"||e==="top-left"}function Ot(e){return `bf-trigger-edge ${_e(e)?"bf-trigger-edge-left":"bf-trigger-edge-right"}`}function He({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=useState(false),r=_e(e),s=m(),h=s?Ht:_t;return jsx(AnimatePresence,{mode:"wait",children:i&&jsx(motion.button,{className:Ot(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":o,initial:{opacity:0,width:0},animate:{opacity:1,width:n?140:22,height:n?40:90},exit:{width:0,opacity:0},transition:h,whileTap:{scale:.97},style:{top:"50%",translateY:"-50%"},children:l?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:h,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(g,{size:14})},"success"):jsxs(Fragment,{children:[jsxs(motion.span,{animate:{rotate:s||n?0:r?-90:90,opacity:n?1:.6},transition:h,style:{display:"flex",alignItems:"center",gap:"8px",whiteSpace:"nowrap",fontSize:"12px",letterSpacing:"0.5px",textTransform:"uppercase"},children:[n&&jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:{duration:.12},style:{width:"6px",height:"6px",borderRadius:"50%",background:"var(--bf-accent)",flexShrink:0}}),o]}),jsx(motion.span,{"aria-hidden":"true",animate:{opacity:n?1:0},transition:{duration:.12},style:{position:"absolute",top:0,bottom:0,[r?"left":"right"]:0,width:"2px",background:"var(--bf-accent)"}}),a>0&&jsx("span",{className:"bf-badge","aria-label":`${a} queued`,children:a})]})},"edge-tab")})}var Kt={duration:.18,ease:"easeOut"},Vt={duration:0};function De({delay:e,hovered:t,reduced:i}){return i?null:jsx(motion.span,{"aria-hidden":"true",style:{position:"absolute",width:"10px",height:"10px",borderRadius:"50%",border:"2px solid var(--bf-accent)",pointerEvents:"none"},animate:t?{scale:1,opacity:0}:{scale:[1,1.8],opacity:[.5,0]},transition:t?{duration:.15}:{duration:2,repeat:1/0,delay:e,ease:"easeOut"}})}function Ke({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=useState(false),r=m(),s=r?Vt:Kt;return jsx(AnimatePresence,{mode:"wait",children:i&&jsx(motion.button,{className:v(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":o,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:s,whileTap:{scale:.92},style:{overflow:"hidden"},children:l?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:s,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(g,{size:14})},"success"):jsxs(Fragment,{children:[jsxs("span",{style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",width:"10px",height:"10px",flexShrink:0},children:[jsx(De,{delay:0,hovered:n,reduced:r}),jsx(De,{delay:.7,hovered:n,reduced:r}),jsx(motion.span,{className:"bf-dot","aria-hidden":"true",style:{position:"relative",zIndex:1}})]}),jsx(AnimatePresence,{mode:"wait",children:n&&jsx(motion.span,{initial:{opacity:0,x:r?0:-6},animate:{opacity:1,x:0},exit:{opacity:0,x:r?0:-6},transition:s,style:{whiteSpace:"nowrap"},children:o},"label")}),a>0&&jsx("span",{className:"bf-badge","aria-label":`${a} queued`,children:a})]})},"pulse-ring")})}var Gt={duration:.18,ease:"easeOut"},jt={duration:0};function Qt(e){switch(e){case "bottom-left":return "bf-trigger-minimal bf-trigger-bl";case "top-right":return "bf-trigger-minimal bf-trigger-tr";case "top-left":return "bf-trigger-minimal bf-trigger-tl";default:return "bf-trigger-minimal"}}function Xe({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=useState(false),r=m(),s=r?jt:Gt;return jsx(AnimatePresence,{mode:"wait",children:i&&jsxs(motion.button,{className:Qt(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":o,initial:{opacity:0,y:r?0:5},animate:{opacity:n?1:.65,y:0},exit:{opacity:0,y:r?0:5},transition:s,whileTap:{scale:.95},children:[l?jsx("span",{style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(g,{size:14})}):jsxs(Fragment,{children:[jsx("span",{children:o}),a>0&&jsx("span",{className:"bf-badge",style:{marginLeft:"4px"},"aria-label":`${a} queued`,children:a})]}),!r&&jsx(motion.span,{"aria-hidden":"true",style:{position:"absolute",bottom:4,left:4,right:4,height:"2px",background:"var(--bf-accent)",borderRadius:"1px",transformOrigin:"left"},initial:false,animate:{scaleX:n?1:0},transition:s})]},"minimal")})}var Zt={duration:.18,ease:"easeOut"},eo={duration:0};function Ge({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=useState(false),r=m(),s=r?eo:Zt;return jsx(AnimatePresence,{mode:"wait",children:i&&jsx(motion.button,{className:v(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":o,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:s,whileTap:{scale:.9},style:{overflow:"hidden"},children:l?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:s,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(g,{size:14})},"success"):jsxs(Fragment,{children:[jsx(motion.span,{style:{display:"inline-flex",flexShrink:0},animate:r?{}:n?{scale:1.2,rotate:0}:{rotate:[-5,5,-5]},transition:n||r?s:{duration:3,repeat:1/0,ease:"easeInOut"},children:jsx(Be,{size:16})}),jsx(AnimatePresence,{mode:"wait",children:n&&jsx(motion.span,{initial:{opacity:0,x:r?0:-8},animate:{opacity:1,x:0},exit:{opacity:0,x:r?0:-8},transition:s,style:{whiteSpace:"nowrap"},children:o},"label")}),a>0&&jsx("span",{className:"bf-badge","aria-label":`${a} queued`,children:a})]})},"icon-pop")})}var ao={duration:.18,ease:"easeOut"},io={duration:0};function qe({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=useState(false),r=m(),s=r?io:ao;return jsx(AnimatePresence,{mode:"wait",children:i&&jsx(motion.button,{className:v(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":o,initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:s,whileTap:{scale:.92},style:{overflow:"hidden"},children:l?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:s,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(g,{size:14})},"success"):jsxs(Fragment,{children:[jsxs("span",{style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:"10px",height:"10px",flexShrink:0},children:[jsx(motion.span,{"aria-hidden":"true",style:{width:"10px",height:"10px",borderRadius:"50%",background:"var(--bf-accent)",position:"relative",zIndex:1},animate:r?{}:{opacity:n?1:[.5,1,.5],boxShadow:n?"0 0 8px 2px var(--bf-accent)":["0 0 4px 1px var(--bf-accent)","0 0 12px 4px var(--bf-accent)","0 0 4px 1px var(--bf-accent)"]},transition:n||r?s:{duration:2,repeat:1/0,ease:"easeInOut"}}),!n&&!r&&jsx(motion.span,{"aria-hidden":"true",style:{position:"absolute",width:"18px",height:"2px",background:"linear-gradient(90deg, var(--bf-accent), transparent)",transformOrigin:"left center",left:"5px",top:"4px"},animate:{rotate:[0,360]},transition:{duration:4,repeat:1/0,ease:"linear"}})]}),jsx(AnimatePresence,{mode:"wait",children:n&&jsx(motion.span,{initial:{opacity:0,x:r?0:-6},animate:{opacity:1,x:0},exit:{opacity:0,x:r?0:-6},transition:s,style:{whiteSpace:"nowrap"},children:o},"label")}),a>0&&jsx("span",{className:"bf-badge","aria-label":`${a} queued`,children:a})]})},"beacon")})}var po={duration:.18,ease:"easeOut"},fo={duration:0};function tt({position:e,onClick:t,isVisible:i,label:o,queueCount:a,showSuccess:l}){let[n,c]=useState(false),[r,s]=useState(0),h=m(),M=h?fo:po,f=useRef(null);useEffect(()=>{if(f.current&&(clearInterval(f.current),f.current=null),!i||n||h){s(n||h?o.length:0);return}let u=8,C=o.length*2+u*2,y=0;return f.current=setInterval(()=>{y=(y+1)%C,y<=o.length?s(y):y<=o.length+u?s(o.length):y<=o.length*2+u?s(o.length*2+u-y):s(0);},100),()=>{f.current&&(clearInterval(f.current),f.current=null);}},[i,n,h,o]);let S=o.slice(0,r);return jsx(AnimatePresence,{mode:"wait",children:i&&jsx(motion.button,{className:v(e),type:"button",onClick:t,onMouseEnter:()=>c(true),onMouseLeave:()=>c(false),"aria-label":o,initial:{opacity:0,y:h?0:5},animate:{opacity:1,y:0},exit:{opacity:0,y:h?0:5},transition:M,whileTap:{scale:.95},style:{minWidth:"44px"},children:l?jsx(motion.span,{initial:{scale:0},animate:{scale:1},transition:M,style:{display:"inline-flex",color:"var(--bf-accent)"},children:jsx(g,{size:14})},"success"):jsxs(Fragment,{children:[jsx("span",{className:"bf-dot","aria-hidden":"true"}),jsxs("span",{style:{whiteSpace:"nowrap",minWidth:"1ch"},children:[S,jsx("span",{className:"bf-cursor","aria-hidden":"true"})]}),a>0&&jsx("span",{className:"bf-badge","aria-label":`${a} queued`,children:a})]})},"typewriter")})}function ot(e){switch(e){case "dot":return Me;case "bubble":return Ie;case "edge-tab":return He;case "pulse-ring":return Ke;case "minimal":return Xe;case "icon-pop":return Ge;case "beacon":return qe;case "typewriter":return tt;default:return Ne}}function at(e,t,i){return Math.max(t,Math.min(i,e))}function ho(e,t,i="bottom-right"){let a=window.innerWidth,l=window.innerHeight,n;n=at(e.x,12,Math.max(12,a-t-12));let c=e.y+e.height+12,r=Math.max(12,e.y-240);return {top:c+240<=l?c:r,left:n}}function xo(e){let{rect:t}=e,i={left:`${t.x}px`,top:`${t.y}px`,width:`${Math.max(0,t.width)}px`,height:`${Math.max(0,t.height)}px`};return jsx("div",{className:"bf-highlight",style:i,"aria-hidden":"true"})}function yo(e){let t=useRef(null);return useEffect(()=>{if(!e||!t.current)return;t.current.querySelector(".bf-textarea")?.focus();let o=a=>{if(a.key!=="Tab"||!t.current)return;let l=t.current.querySelectorAll('button:not([disabled]), textarea:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex="-1"])');if(l.length===0)return;let n=l[0],c=l[l.length-1];a.shiftKey&&document.activeElement===n?(a.preventDefault(),c.focus()):!a.shiftKey&&document.activeElement===c&&(a.preventDefault(),n.focus());};return document.addEventListener("keydown",o,{capture:true}),()=>document.removeEventListener("keydown",o,{capture:true})},[e]),t}function vo(e,t){return e?typeof e=="function"?e(t):e.some(i=>i.endsWith("*")?t.startsWith(i.slice(0,-1)):t===i):true}function wo(e){let[t,i]=useState(()=>typeof window<"u"?window.location.pathname:"/");return useEffect(()=>{if(typeof window>"u")return;let o=()=>i(window.location.pathname);window.addEventListener("popstate",o);let a=history.pushState,l=history.replaceState;return history.pushState=function(...n){a.apply(this,n),o();},history.replaceState=function(...n){l.apply(this,n),o();},()=>{window.removeEventListener("popstate",o),history.pushState=a,history.replaceState=l;}},[]),vo(e,t)}function ko(e){let[t,i]=useState(()=>!e||e==="dark"?"dark":e==="light"?"light":typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light");return useEffect(()=>{if(e!=="auto"){i(e==="light"?"light":"dark");return}let o=window.matchMedia("(prefers-color-scheme: dark)"),a=l=>i(l.matches?"dark":"light");return i(o.matches?"dark":"light"),o.addEventListener("change",a),()=>o.removeEventListener("change",a)},[e]),t}var To=["bug","feature","ux","general"],So={bug:"categoryBug",feature:"categoryFeature",ux:"categoryUx",general:"categoryGeneral"};function re(e){let t=Math.floor(e/1e3),i=Math.floor(t/60),o=t%60;return `${i}:${String(o).padStart(2,"0")}`}function Po(e){return e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Co(e){let{state:t$1,controller:i$1,start:o,stop:a,clearSelection:l$1,submit:n}=oe(),c=e.config.ui?.position,r=Ce(e.config.ui?.strings),s=e.config.ui?.branding!==false,[h,M]=useState(null),[f,S]=useState(""),[u,C]=useState(e.config.capture?.element??true),[y,O]=useState(e.config.capture?.fullPage??false),[nt,ie]=useState(null),[D,ne]=useState(void 0),se=e.config.ui?.categories??To,st=e.config.recording?.enabled===true&&l(),ct=e.config.recording?.maxDurationMs??3e4,[lt,dt]=useState(false),[Q,pt]=useState(0);useEffect(()=>{let d=window.setTimeout(()=>{let N=t();pt(N.findings.length);},500);return ()=>window.clearTimeout(d)},[]),useImperativeHandle(e.handleRef,()=>({open:o,close:a,submit:d=>n(d),startRecording:()=>i$1.startRecording(),stopRecording:()=>i$1.stopRecording(),get isOpen(){return t$1.phase!=="idle"}}),[o,a,n,i$1,t$1.phase]);let ce=t$1.phase==="review"||t$1.phase==="capturing"||t$1.phase==="submitting"||t$1.phase==="error"||t$1.phase==="success",ft=yo(ce),[ut,bt]=useState(0);useEffect(()=>{t$1.phase==="idle"&&bt(i());},[t$1.phase]);let[gt,le]=useState(false),de=useRef(t$1.phase);useEffect(()=>{if(de.current==="success"&&t$1.phase==="idle"){le(true);let d=window.setTimeout(()=>le(false),1500);return ()=>window.clearTimeout(d)}de.current=t$1.phase;},[t$1.phase]),useEffect(()=>{let d=e.config.ui?.shortcut;if(!d)return;let N=d.toLowerCase().split("+").map(P=>P.trim()),W=N[N.length-1]||"",z=new Set(N.slice(0,-1)),fe=P=>{let xt=/Mac|iPod|iPhone|iPad/.test(navigator.platform);if(z.has("mod")){if(xt?!P.metaKey:!P.ctrlKey)return}else if(z.has("ctrl")&&!P.ctrlKey||(z.has("meta")||z.has("cmd"))&&!P.metaKey)return;z.has("shift")&&!P.shiftKey||(z.has("alt")||z.has("option"))&&!P.altKey||P.key.toLowerCase()===W&&(P.preventDefault(),t$1.phase==="idle"?o():a());};return document.addEventListener("keydown",fe),()=>document.removeEventListener("keydown",fe)},[e.config.ui?.shortcut,t$1.phase,o,a]),useEffect(()=>i$1.subscribeHover(M),[i$1]),useEffect(()=>{let d=i$1.__unsafeGetSelectedElement();if(!d||t$1.phase==="idle"||t$1.phase==="picking"){ie(null);return}let N=()=>{ie(b(d.getBoundingClientRect()));};N();let W=()=>N();return window.addEventListener("scroll",W,{capture:true,passive:true}),window.addEventListener("resize",W,{passive:true}),()=>{window.removeEventListener("scroll",W,{capture:true}),window.removeEventListener("resize",W);}},[i$1,t$1.phase,t$1.selection?.selector]),useEffect(()=>{t$1.phase==="review"&&(S(""),C(e.config.capture?.element??true),O(e.config.capture?.fullPage??false),ne(void 0));},[t$1.phase,t$1.selection?.selector,e.config.capture?.element,e.config.capture?.fullPage]),useEffect(()=>{if(t$1.phase!=="success")return;let d=window.setTimeout(()=>a(),1200);return ()=>window.clearTimeout(d)},[t$1.phase,a]);let k=t$1.phase==="capturing"||t$1.phase==="submitting",F=t$1.phase==="picking"?h?.rect??null:nt??t$1.selection?.rect??null,q=useMemo(()=>F?ho(F,360,c):null,[F?.x,F?.y,F?.width,F?.height,c]),pe=t$1.lastError?.message,J=useCallback(()=>{let d={capture:{element:u,fullPage:y}};D&&(d.category=D),n(f,d);},[n,f,u,y,D]),mt=useCallback(d=>{(d.metaKey||d.ctrlKey)&&d.key==="Enter"&&f.trim().length>0&&!k&&(d.preventDefault(),J());},[J,f,k]),ht=ot(e.config.ui?.triggerStyle);return jsxs(Fragment,{children:[jsx(ht,{position:c,onClick:()=>o(),isVisible:t$1.phase==="idle",label:e.config.ui?.triggerLabel??r.triggerLabel,queueCount:ut,showSuccess:gt}),t$1.phase!=="idle"&&t$1.phase!=="recording"&&jsxs("div",{className:"bf-overlay",role:"presentation",children:[t$1.phase!=="picking"&&jsx("div",{className:"bf-blocker",role:"presentation",onClick:()=>a()}),F&&jsx(xo,{rect:F}),t$1.phase==="picking"&&jsxs("div",{className:"bf-hint",role:"status","aria-live":"polite",children:[jsx("p",{id:"bf-hint-text",children:r.hintText}),jsx("button",{type:"button",className:"bf-btn",onClick:()=>a(),"aria-label":r.cancelButton,children:r.cancelButton})]}),ce&&q&&jsxs("div",{ref:ft,className:"bf-panel",style:{left:q.left,top:q.top},role:"dialog","aria-modal":"true","aria-label":"Feedback form",children:[jsxs("div",{className:"bf-panelHeader",children:[jsx("div",{className:"bf-title",id:"bf-panel-title",children:r.panelTitle}),jsxs("div",{className:"bf-row",style:{justifyContent:"flex-end"},children:[jsx("button",{type:"button",className:"bf-btn",onClick:()=>l$1(),disabled:k,"aria-label":r.rePickButton,children:r.rePickButton}),jsx("button",{type:"button",className:"bf-btn",onClick:()=>a(),disabled:k,"aria-label":r.closeButton,children:r.closeButton})]})]}),jsxs("div",{className:"bf-panelBody",children:[jsx("textarea",{className:"bf-textarea",placeholder:r.textareaPlaceholder,value:f,onChange:d=>S(d.target.value),onKeyDown:mt,disabled:k,"aria-label":r.panelTitle}),se.length>0&&jsx("div",{className:"bf-pills",role:"group","aria-label":"Feedback category",children:se.map(d=>jsx("button",{type:"button",className:`bf-pill${D===d?" bf-pill-active":""}`,onClick:()=>ne(D===d?void 0:d),disabled:k,children:r[So[d]]},d))}),jsxs("div",{className:"bf-row",role:"group","aria-label":r.screenshotElement,children:[jsxs("label",{children:[jsx("input",{type:"checkbox",checked:u,onChange:d=>C(d.target.checked),disabled:k}),r.screenshotElement]}),jsxs("label",{children:[jsx("input",{type:"checkbox",checked:y,onChange:d=>O(d.target.checked),disabled:k}),r.screenshotFullPage]})]}),st&&t$1.phase==="review"&&!t$1.video&&jsxs("button",{type:"button",className:"bf-record-btn",onClick:()=>i$1.startRecording(),disabled:k,"aria-label":r.recordButton,children:[jsx("span",{className:"bf-rec-dot","aria-hidden":"true"}),r.recordButton]}),t$1.video&&t$1.phase==="review"&&jsxs("div",{className:"bf-video-preview",children:[jsx("video",{src:t$1.video.blobUrl,controls:true,muted:true,playsInline:true}),jsx("button",{type:"button",className:"bf-video-remove",onClick:()=>i$1.removeVideo(),"aria-label":r.removeVideoButton,children:"\xD7"}),jsxs("div",{className:"bf-video-meta",children:[r.videoPreviewLabel," (",re(t$1.video.durationMs),", ",Po(t$1.video.sizeBytes),")"]})]}),t$1.phase==="capturing"&&jsxs("div",{className:"bf-status",role:"status","aria-live":"polite",children:[jsx("span",{className:"bf-spinner","aria-hidden":"true"}),r.capturingText]}),t$1.phase==="submitting"&&jsxs("div",{className:"bf-status",role:"status","aria-live":"polite",children:[jsx("span",{className:"bf-spinner","aria-hidden":"true"}),r.submittingText]}),t$1.phase==="success"&&jsx("div",{className:"bf-status",role:"status","aria-live":"polite",children:r.successText}),t$1.phase==="error"&&pe&&jsx("div",{className:"bf-error",role:"alert",children:pe}),jsxs("div",{className:"bf-actions",children:[jsx("button",{type:"button",className:"bf-btn",onClick:()=>a(),disabled:k,"aria-label":r.cancelButton,children:r.cancelButton}),jsx("button",{type:"button",className:"bf-btn bf-btnPrimary",onClick:J,disabled:k||f.trim().length===0,"aria-label":r.sendButton,children:r.sendButton})]})]}),s&&jsx("div",{className:"bf-watermark",children:jsx("a",{href:"https://blocfeed.com",target:"_blank",rel:"noopener noreferrer",children:"Powered by BlocFeed"})})]})]}),t$1.phase==="recording"&&jsxs("div",{className:`bf-recording-bar bf-pos-${c}`,role:"status","aria-live":"polite","data-blocfeed-ui":"true",children:[jsx("span",{className:"bf-rec-dot bf-rec-dot-pulse","aria-hidden":"true"}),jsxs("span",{className:"bf-recording-bar-timer",children:[r.recordingText," ",re(t$1.recordingElapsedMs??0)," / ",re(ct)]}),jsx("button",{type:"button",className:"bf-recording-bar-stop",onClick:()=>i$1.stopRecording(),"aria-label":r.stopRecordButton,children:r.stopRecordButton})]}),t$1.phase==="success"&&jsx("div",{className:"bf-toast",role:"status","aria-live":"polite",children:r.toastText}),Q>0&&!lt&&jsxs("div",{className:"bf-security-banner",role:"alert",children:[jsx("button",{type:"button",className:"bf-security-banner-dismiss",onClick:()=>dt(true),"aria-label":"Dismiss",children:"\xD7"}),jsx("strong",{children:"Security Warning"}),Q," potential secret",Q>1?"s":""," exposed in client code. Check your environment variables."]})]})}var Eo=forwardRef(function(t$1,i){let o$1={...t$1.config??{},blocfeed_id:t$1.blocfeed_id},[a,l]=useState(null),n=wo(o$1.ui?.showOn),c=ko(o$1.ui?.theme?.mode),r=!!o$1.diagnostics;useEffect(()=>{if(r)return o(o$1.diagnostics),()=>p()},[r]);let s$1=!!o$1.security;useEffect(()=>{s$1&&s(o$1.security);},[s$1]);let h=useRef(t$1.config?.metadata?.enrich);h.current=t$1.config?.metadata?.enrich;let M=useMemo(()=>{if(t$1.config)return {...t$1.config,metadata:{...t$1.config.metadata,enrich:async f=>{let S=h.current,u=S?await S(f):{},C=q(),y=t(),O=j();return {...u,...C.consoleLogs.length>0?{_consoleLogs:C.consoleLogs}:{},...C.networkErrors.length>0?{_networkErrors:C.networkErrors}:{},...y.findings.length>0?{_securityFindings:y.findings}:{},...O.length>0?{_clickEvents:O}:{}}}}}},[]);return useEffect(()=>{Se();let f=document.createElement("div");f.setAttribute("data-blocfeed-ui-root","true"),f.setAttribute("data-blocfeed-ui","true"),f.setAttribute("data-bf-theme",c);let S=o$1.ui?.zIndex;typeof S=="number"&&f.style.setProperty("--bf-z",String(S));let u=o$1.ui?.theme;return u&&(u.accentColor&&f.style.setProperty("--bf-accent",u.accentColor),u.panelBackground&&f.style.setProperty("--bf-panel-bg",u.panelBackground),u.panelForeground&&f.style.setProperty("--bf-panel-fg",u.panelForeground),u.fontFamily&&f.style.setProperty("--bf-font",u.fontFamily)),document.body.appendChild(f),l(f),()=>{f.remove(),l(null);}},[o$1.ui?.zIndex,o$1.ui?.theme?.accentColor,o$1.ui?.theme?.panelBackground,o$1.ui?.theme?.panelForeground,o$1.ui?.theme?.fontFamily,c]),useEffect(()=>{a&&a.setAttribute("data-bf-theme",c);},[a,c]),!n||!a?null:createPortal(jsx(te,{blocfeed_id:o$1.blocfeed_id,...M?{config:M}:{},children:jsx(Co,{config:o$1,handleRef:i})}),a)});
|
|
807
|
+
export{te as BlocFeedProvider,Eo as BlocFeedWidget,oe as useBlocFeed};
|
package/package.json
CHANGED
package/dist/chunk-KJRV7PRA.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function E(){return typeof window<"u"&&typeof document<"u"}function he(e){let t=globalThis.CSS;return typeof t?.escape=="function"?t.escape(e):e.replace(/[^a-zA-Z0-9_-]/g,n=>{let r=n.codePointAt(0);return r===void 0?"":`\\${r.toString(16)} `})}function te(e){return {x:e.x,y:e.y,width:e.width,height:e.height}}function $e(e){return {x:e.x+window.scrollX,y:e.y+window.scrollY,width:e.width,height:e.height}}function je(e){return e.replace(/\s+/g," ").trim()}function Ve(e,t=140){let n=e.textContent;if(!n)return;let r=je(n);if(r)return r.length<=t?r:`${r.slice(0,t-1)}\u2026`}function Xe(e){let t=1;for(let n=e.previousElementSibling;n;n=n.previousElementSibling)n.tagName===e.tagName&&(t+=1);return t}var Ee=["data-testid","data-test-id","data-test","data-qa","data-cy"],we="data-blocfeed-component";function Ze(e){let t=e.closest(`[${we}]`);if(!t)return;let r=t.getAttribute(we)?.trim();return r||void 0}function We(e){for(let t of Ee){let n=e.closest(`[${t}]`);if(!n)continue;let o=n.getAttribute(t)?.trim();if(o)return o}}function be(e){try{let t=e,n=Object.getOwnPropertyNames(t);for(let r of n)if(r.startsWith("__reactFiber$")||r.startsWith("__reactInternalInstance$")){let o=t[r];if(o&&typeof o=="object")return o}}catch{}return null}function B(e){if(e.length<=1||e.length===2&&e[0]===e[0].toLowerCase())return true;let t=e[0];return t>="a"&&t<="z"}function q(e){if(e){for(let t of e)if(typeof t.name=="string"&&t.name&&!B(t.name))return t.name}}function A(e){if(e&&typeof e!="string"){if(typeof e=="function"){let t=e;return typeof t.displayName=="string"&&t.displayName?t.displayName:typeof t.name=="string"&&t.name?t.name:void 0}if(typeof e=="object"){let t=e,n=t.displayName;if(typeof n=="string"&&n)return n;let r=t.render;if(typeof r=="function"){let i=r;if(typeof i.displayName=="string"&&i.displayName)return i.displayName;if(typeof i.name=="string"&&i.name)return i.name}let o=t.type;return A(o)}}}function Ke(e){let t=be(e);if(!t)return;let n=q(t._debugInfo);if(n)return n;let r=t._debugOwner!==void 0;if(r){let s=t._debugOwner;for(let c=0;s&&c<50;c+=1){let h=q(s._debugInfo);if(h)return h;let p=A(s.type)??A(s.elementType);if(p&&!B(p))return p;s=s._debugOwner;}}if(t._owner!==void 0&&t._owner!==t._debugOwner){let s=t._owner;for(let c=0;s&&c<50;c+=1){let h=q(s._debugInfo);if(h)return h;let p=A(s.type)??A(s.elementType);if(p&&!B(p))return p;s=s._owner;}}let i=t,l=r?80:25;for(let s=0;i&&s<l;s+=1){let c=q(i._debugInfo);if(c)return c;let h=A(i.type)??A(i.elementType);if(h&&!B(h))return h;i=i.return;}let a=e.parentElement;for(let s=0;a&&s<15;s+=1){let c=be(a);if(c){let h=q(c._debugInfo);if(h)return h;let p=A(c.type)??A(c.elementType);if(p&&!B(p))return p;if(c._debugOwner){let m=A(c._debugOwner.type)??A(c._debugOwner.elementType);if(m&&!B(m))return m}if(c._owner&&c._owner!==c._debugOwner){let m=A(c._owner.type)??A(c._owner.elementType);if(m&&!B(m))return m}}a=a.parentElement;}}function Qe(e){let t=e.tagName.toLowerCase(),n=e.getAttribute("id");if(n)return `#${he(n)}`;for(let r of Ee){let o=e.getAttribute(r);if(o)return `${t}[${r}="${he(o)}"]`}return `${t}:nth-of-type(${Xe(e)})`}function Ye(e,t=10){let n=[],r=e;for(;r&&n.length<t;){let o=Qe(r);if(n.unshift(o),o.startsWith("#"))break;r=r.parentElement;}return n.join(" > ")}function ye(e,t){if(!t||t.length===0)return false;for(let n of t)if(e.closest(n))return true;return false}function ne(e,t){if(!e||ye(e,t.ignoreSelectors))return null;let n=e;for(;n;){if(ye(n,t.ignoreSelectors))return null;if(t.isSelectable?.(n)??Ge(n))return n;n=n.parentElement;}return null}function Ge(e){let t=e.tagName;return !(t==="HTML"||t==="BODY")}function Se(e){let t=e.getBoundingClientRect(),n={selector:Ye(e),tagName:e.tagName.toLowerCase(),rect:te(t),pageRect:$e(t)},r=e.getAttribute("id");r&&(n.id=r);let o=e.className;typeof o=="string"&&o.trim()&&(n.className=o);let i=Ve(e);i&&(n.textSnippet=i);let l=Ze(e)??Ke(e);l&&(n.componentName=l);let a=We(e);return a&&(n.testId=a),n}var re=null;async function ke(){return re||(re=import('html-to-image')),re}async function Je(e){return await new Promise((t,n)=>{let r=new Image;r.onload=()=>t({width:r.naturalWidth,height:r.naturalHeight}),r.onerror=()=>n(new Error("Failed to load generated screenshot")),r.src=e;})}async function _e(e,t){let{width:n,height:r}=await Je(e);return {dataUrl:e,mime:t,width:n,height:r}}function O(e){if(e?.aborted)throw new Error("Aborted")}function ve(){return {async captureElement(e,t){if(!E())throw new Error("captureElement can only run in the browser");O(t.signal);let n=await ke();O(t.signal);let r=t.mime==="image/jpeg"?await n.toJpeg(e,{quality:t.quality??.92,pixelRatio:t.pixelRatio}):await n.toPng(e,{pixelRatio:t.pixelRatio});return O(t.signal),await _e(r,t.mime)},async captureFullPage(e){if(!E())throw new Error("captureFullPage can only run in the browser");O(e.signal);let t=document.documentElement,n=Math.max(t.scrollWidth,t.clientWidth),r=Math.max(t.scrollHeight,t.clientHeight),o=Math.min(1,e.maxDimension/Math.max(n,r)),i=Math.max(1,Math.round(n*o)),l=Math.max(1,Math.round(r*o)),a=await ke();O(e.signal);let s=e.mime==="image/jpeg"?await a.toJpeg(t,{width:i,height:l,quality:e.quality??.92,pixelRatio:e.pixelRatio}):await a.toPng(t,{width:i,height:l,pixelRatio:e.pixelRatio});return O(e.signal),await _e(s,e.mime)}}}function et(e){if(e instanceof Error)return e.message;if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return "Unknown error"}}function w(e,t,n){let r={kind:e,message:et(t)};return n&&(r.detail=n),r}var tt=12e3,nt=2048,rt=.92;function Re(){return Date.now()}function ot(e){return new Promise((t,n)=>{let r=()=>n(new Error("Aborted"));if(e.aborted){r();return}e.addEventListener("abort",r,{once:true});})}async function Ae(e,t,n){let r=new Promise((i,l)=>{let a=setTimeout(()=>l(new Error("Timeout")),t);typeof a.unref=="function"&&a.unref();}),o=[e,r];return n&&o.push(ot(n)),await Promise.race(o)}function it(e){if(!E())return 1;let t=window.devicePixelRatio||1,n=e?.pixelRatio??Math.min(t,2);return Math.max(.1,n)}function at(e){return !!(e?.element||e?.fullPage)}function Te(e){let t={mime:e.mime,pixelRatio:e.pixelRatio,maxDimension:e.maxDimension};return e.includeQuality&&(t.quality=e.quality),e.signal&&(t.signal=e.signal),t}async function Pe(e){let{selectionElement:t,capture:n,signal:r}=e;if(!E()||!at(n))return;let o=Re(),i=[],l=n?.timeoutMs??tt,a=n?.maxDimension??nt,s=n?.mime??"image/png",c=n?.quality??rt,h=n?.adapter??ve(),p={},m=it(n);if(n?.element&&t)try{let f=t.getBoundingClientRect(),g=Math.min(1,a/Math.max(f.width,f.height)),k=Math.min(m,m*g),v=await Ae(Promise.resolve(h.captureElement(t,{...Te({mime:s,quality:c,pixelRatio:k,maxDimension:a,includeQuality:s==="image/jpeg",...r?{signal:r}:{}})})),l,r);p.element=v;}catch(f){if(r?.aborted)throw f;i.push(w("capture_failed",f,{target:"element"}));}if(n?.fullPage)try{let f=await Ae(Promise.resolve(h.captureFullPage(Te({mime:s,quality:c,pixelRatio:m,maxDimension:a,includeQuality:s==="image/jpeg",...r?{signal:r}:{}}))),l,r);p.fullPage=f;}catch(f){if(r?.aborted)throw f;i.push(w("capture_failed",f,{target:"fullPage"}));}let b=Re(),u={startedAt:o,finishedAt:b,durationMs:Math.max(0,b-o)};return i.length>0&&(u.errors=i),{...p,diagnostics:u}}function st(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function ct(){return E()?{url:window.location.href,title:document.title,referrer:document.referrer||void 0,userAgent:navigator.userAgent,language:navigator.language,platform:navigator.platform,viewport:{width:window.innerWidth,height:window.innerHeight},screen:{width:window.screen.width,height:window.screen.height},scroll:{x:window.scrollX,y:window.scrollY},devicePixelRatio:window.devicePixelRatio||1,timezone:st()}:{}}function lt(e){if(!e)return {};let t={};return e.id&&(t.userId=e.id),e.email&&(t.userEmail=e.email),e.name&&(t.userName=e.name),t}async function xe(e){let{config:t,context:n,user:r}=e;if(t?.enabled===false)return {};let o={...ct(),...lt(r)},i=t?.enrich;if(!i)return o;try{let l=await i(n);return {...o,...l}}catch(l){let a=w("unknown",l);return {...o,blocfeedMetadataError:a.message}}}var oe="blocfeed-queue",ut=50;function ie(){if(!E())return [];try{let e=localStorage.getItem(oe);if(!e)return [];let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return []}}function ae(e){if(E())try{e.length===0?localStorage.removeItem(oe):localStorage.setItem(oe,JSON.stringify(e));}catch{}}function dt(e){let t={...e};if(t.screenshots){let n={...t.screenshots};n.element&&(n.element={...n.element,dataUrl:""}),n.fullPage&&(n.fullPage={...n.fullPage,dataUrl:""}),t.screenshots=n;}return delete t.video,t}function se(e){let t=ie(),n=dt(e);for(n.metadata={...n.metadata,_queued:true},t.push({payload:n,timestamp:Date.now()});t.length>ut;)t.shift();ae(t);}function Fe(){let e=ie();return e.length===0?[]:(ae([]),e.map(t=>t.payload))}function Jt(){ae([]);}function en(){return ie().length}var ft=3e4,mt=25e5,Ce="video/webm",pt=250,gt=1e3,ht=["video/webm;codecs=vp9","video/webm;codecs=vp8","video/webm"];function Me(){if(typeof MediaRecorder>"u")return null;for(let e of ht)if(MediaRecorder.isTypeSupported(e))return e;return null}function wt(){return !E()||typeof navigator?.mediaDevices?.getDisplayMedia!="function"?false:Me()!==null}async function ce(e){let{config:t,signal:n}=e;if(!E()||typeof navigator?.mediaDevices?.getDisplayMedia!="function")throw w("recording_failed",new Error("Screen recording is not supported in this browser"));let r=Me();if(!r)throw w("recording_failed",new Error("No supported video codec found (WebM required)"));if(n?.aborted)throw w("aborted",new Error("Recording aborted before start"));let o;try{o=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser"},audio:!1});}catch(g){let k=g instanceof DOMException&&g.name==="NotAllowedError"?"Screen share permission denied":"Failed to start screen share";throw w("recording_failed",new Error(k))}if(n?.aborted)throw o.getTracks().forEach(g=>g.stop()),w("aborted",new Error("Recording aborted after permission"));let i=t?.maxDurationMs??ft,l=t?.videoBitsPerSecond??mt,a=new MediaRecorder(o,{mimeType:r,videoBitsPerSecond:l}),s=[],c=[],h=0,p=null,m=null,b=false,u=()=>{p!==null&&(clearInterval(p),p=null),m!==null&&(clearTimeout(m),m=null),o.getTracks().forEach(g=>g.stop());},f=new Promise((g,k)=>{a.ondataavailable=y=>{y.data.size>0&&s.push(y.data);},a.onstop=()=>{if(b)return;b=true,u();let y=Date.now()-h,P=new Blob(s,{type:Ce}),M=URL.createObjectURL(P);g({mime:Ce,blobUrl:M,blob:P,durationMs:y,sizeBytes:P.size});},a.onerror=()=>{b||(b=true,u(),k(w("recording_failed",new Error("MediaRecorder error"))));};let v=o.getVideoTracks()[0];if(v&&v.addEventListener("ended",()=>{a.state!=="inactive"&&a.stop();}),n){let y=()=>{b||(b=true,a.state!=="inactive"&&a.stop(),u(),k(w("aborted",new Error("Recording aborted"))));};n.addEventListener("abort",y,{once:true});}});return a.start(gt),h=Date.now(),p=setInterval(()=>{let g=Date.now()-h;for(let k of c)k(g);},pt),m=setTimeout(()=>{!b&&a.state!=="inactive"&&a.stop();},i),{result:f,stop(){!b&&a.state!=="inactive"&&a.stop();},onTick(g){c.push(g);},abort(){b||(b=true,a.state!=="inactive"&&a.stop(),u());}}}function le(e){let t=null,n=null,r=(...o)=>{n=o,t===null&&(t=requestAnimationFrame(()=>{if(t=null,!n)return;let i=n;n=null,e(...i);}));};return r.cancel=()=>{t!==null&&cancelAnimationFrame(t),t=null,n=null;},r}function K(e){return e instanceof Element?!!e.closest("[data-blocfeed-ui]"):false}function Q(e){e.stopPropagation(),e.stopImmediatePropagation?.();}function Le(e,t){if(!E())throw new Error("BlocFeed picker can only run in a browser environment.");let n=e.ignoreSelectors,r=e.isSelectable,o={};n&&n.length>0&&(o.ignoreSelectors=n),r&&(o.isSelectable=r);let i=null,l=null,a=(u,f=false)=>{if(!u){i=null,l=null,t.onHover(null);return}let g=te(u.getBoundingClientRect()),k=`${Math.round(g.x)}:${Math.round(g.y)}:${Math.round(g.width)}:${Math.round(g.height)}`;!f&&u===i&&k===l||(i=u,l=k,t.onHover({element:u,rect:g}));},s=le(u=>{if(K(u.target))return;let f=document.elementFromPoint(u.clientX,u.clientY),g=ne(f,o);a(g);}),c=le(()=>{i&&a(i,true);}),h=u=>{K(u.target)||(Q(u),u.pointerType==="mouse"&&u.preventDefault());},p=u=>{K(u.target)||(Q(u),u.pointerType==="mouse"&&u.preventDefault());},m=u=>{if(K(u.target))return;Q(u),u.preventDefault();let f=document.elementFromPoint(u.clientX,u.clientY),g=ne(f,o);g&&t.onSelect({element:g,descriptor:Se(g)});},b=u=>{u.key==="Escape"&&(Q(u),u.preventDefault(),t.onCancel());};return window.addEventListener("pointermove",s,{capture:true,passive:true}),window.addEventListener("pointerdown",h,{capture:true}),window.addEventListener("pointerup",p,{capture:true}),window.addEventListener("click",m,{capture:true}),window.addEventListener("keydown",b,{capture:true}),window.addEventListener("scroll",c,{capture:true,passive:true}),window.addEventListener("resize",c,{passive:true}),{stop(){window.removeEventListener("pointermove",s,{capture:true}),window.removeEventListener("pointerdown",h,{capture:true}),window.removeEventListener("pointerup",p,{capture:true}),window.removeEventListener("click",m,{capture:true}),window.removeEventListener("keydown",b,{capture:true}),window.removeEventListener("scroll",c,{capture:true}),window.removeEventListener("resize",c),s.cancel(),c.cancel(),t.onHover(null);}}}var bt=12e3,yt=2,Et=500,St=2e3,ue="https://blocfeed.com/api/feedback",De=0;function Be(e,t){return new Promise((n,r)=>{if(t?.aborted){r(new Error("Aborted"));return}let o=setTimeout(n,e),i=()=>{clearTimeout(o),r(new Error("Aborted"));};t?.addEventListener("abort",i,{once:true});})}function kt(e){return e>=500&&e<=599}function _t(e){let[t,n]=e.split(",",2);if(!t||!n)throw new Error("Invalid data URL");let o=/data:(.*?);base64/.exec(t)?.[1]||"application/octet-stream",i=atob(n),l=new Uint8Array(i.length);for(let a=0;a<i.length;a+=1)l[a]=i.charCodeAt(a);return new Blob([l],{type:o})}function vt(e){let t={},n={},r={...e};if(r.screenshots){let o={},i={...r.screenshots};i.element&&(t.element=i.element.dataUrl,o.element={mime:i.element.mime,width:i.element.width,height:i.element.height},i.element={...i.element,dataUrl:""}),i.fullPage&&(t.fullPage=i.fullPage.dataUrl,o.fullPage={mime:i.fullPage.mime,width:i.fullPage.width,height:i.fullPage.height},i.fullPage={...i.fullPage,dataUrl:""}),r.screenshots=i,(o.element||o.fullPage)&&(r.screenshot_intent=o);}return r.video&&(n.blob=r.video.blob,r.video_intent={mime:r.video.mime,durationMs:r.video.durationMs,sizeBytes:r.video.sizeBytes},delete r.video),{lean:r,extracted:t,extractedVideo:n}}async function Ie(e,t,n){let r=_t(t);await fetch(e,{method:"PUT",body:r,headers:{"content-type":r.type},...n?{signal:n}:{}});}async function Rt(e){let{feedbackId:t,extracted:n,screenshots:r,signal:o}=e,i={};n.element&&r?.element&&(i.element={dataUrl:n.element,mime:r.element.mime,width:r.element.width,height:r.element.height}),n.fullPage&&r?.fullPage&&(i.fullPage={dataUrl:n.fullPage,mime:r.fullPage.mime,width:r.fullPage.width,height:r.fullPage.height}),Object.keys(i).length!==0&&await fetch(`${ue}/${t}/screenshots`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(i),...o?{signal:o}:{}});}async function At(e){await fetch(`${ue}/${e.feedbackId}/video`,{method:"POST",body:e.blob,headers:{"content-type":e.blob.type},...e.signal?{signal:e.signal}:{}});}async function Ne(e){let{signal:t,transport:n}=e;if(Date.now()-De<St)return {ok:false,error:w("configuration",new Error("Please wait before submitting again"))};let o=n?.timeoutMs??bt,i=n?.maxAttempts??yt,l=n?.backoffMs??Et,a=!!(e.payload.screenshots?.element?.dataUrl||e.payload.screenshots?.fullPage?.dataUrl),s=!!e.payload.video?.blob,c=a||s,{lean:h,extracted:p,extractedVideo:m}=c?vt(e.payload):{lean:e.payload,extracted:{},extractedVideo:{}},b={...p,...e.screenshotDataUrls};for(let u=1;u<=i;u+=1){let f=new AbortController,g=setTimeout(()=>f.abort(),o),k=()=>f.abort();t&&t.addEventListener("abort",k,{once:true});try{let v=await fetch(ue,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(h),signal:f.signal});if(v.ok){De=Date.now();let y;try{y=await v.json();}catch{}if((b.element||b.fullPage)&&y){let d=y.upload_urls;if(d){let S=[];b.element&&d.element&&S.push(Ie(d.element,b.element,t)),b.fullPage&&d.fullPage&&S.push(Ie(d.fullPage,b.fullPage,t));try{await Promise.all(S);}catch{}}else if(y.feedback_id)try{await Rt({feedbackId:y.feedback_id,extracted:b,screenshots:e.payload.screenshots,...t?{signal:t}:{}});}catch{}}if(m.blob&&y){let d=y.upload_urls;if(d?.video)try{await fetch(d.video,{method:"PUT",body:m.blob,headers:{"content-type":m.blob.type},...t?{signal:t}:{}});}catch{}else if(y.feedback_id)try{await At({feedbackId:y.feedback_id,blob:m.blob,...t?{signal:t}:{}});}catch{}}let M={ok:!0,status:v.status};return y&&(M.apiResponse=y),M}if(u<i&&kt(v.status)){let y=.85+Math.random()*.3,P=Math.round(l*2**(u-1)*y);await Be(P,t);continue}return {ok:!1,status:v.status,error:w("api_failed",new Error(`HTTP ${v.status}`))}}catch(v){if(f.signal.aborted||t?.aborted)return {ok:false,error:w("aborted",v)};if(u<i){let y=.85+Math.random()*.3,P=Math.round(l*2**(u-1)*y);await Be(P,t);continue}return {ok:false,error:w("api_failed",v)}}finally{clearTimeout(g),t&&t.removeEventListener("abort",k);}}return {ok:false,error:w("api_failed",new Error("Failed"))}}async function de(e){let{signal:t,transport:n}=e,r={ok:false};try{let o={payload:e.payload,...t?{signal:t}:{},...n?{transport:n}:{}};r.api=await Ne(o),r.ok=!!r.api?.ok;}catch(o){r.api={ok:false,error:w("api_failed",o)},r.ok=false;}return {payload:e.payload,result:r}}var Tt=["[data-blocfeed-ui]","[data-blocfeed-ignore]"];function Pt(e){let t=[...Tt,...e?.ignoreSelectors??[]],n=Array.from(new Set(t));return {...e,ignoreSelectors:n}}function Oe(){return {phase:"idle"}}function xt(e){if(e.ok)return false;let t=e.api;return t?t.status&&t.status>=400&&t.status<500||t.error?.kind==="aborted"||t.error?.kind==="configuration"?false:!t.ok:true}function Rn(e){let t=e,n=Oe(),r=new Set,o=new Set,i=null,l=null,a=null,s=null,c=0,h=null,p=null,m=null,b=()=>{for(let d of r)d(n);},u=d=>{for(let S of o)S(d);},f=d=>{n=d,b();},g=()=>{c+=1,s?.abort(),s=null;},k=()=>{i?.stop(),i=null,u(null),a!==null&&E()&&(document.documentElement.style.cursor=a,a=null);},v=()=>{p&&(p.abort(),p=null),m&&(URL.revokeObjectURL(m.blobUrl),m=null);},y=()=>{g(),k(),v(),l=null,f(Oe());},P=()=>{if(!E())return;k(),l=null;let d=Pt(t.picker);a=document.documentElement.style.cursor,document.documentElement.style.cursor="crosshair",f({phase:"picking"}),i=Le(d,{onHover:u,onSelect:({element:S,descriptor:x})=>{l=S,k(),f({phase:"review",selection:x});},onCancel:()=>{y();}});},M=()=>{let d=Fe();if(d.length!==0)for(let S of d)de({payload:S,...t.transport?{transport:t.transport}:{}}).catch(()=>{se(S);});};if(E()){setTimeout(M,1e3);let d=()=>M();window.addEventListener("online",d),h=()=>window.removeEventListener("online",d);}return {getState:()=>n,subscribe(d){return r.add(d),()=>r.delete(d)},subscribeHover(d){return o.add(d),()=>o.delete(d)},start(){n.phase==="capturing"||n.phase==="submitting"||n.phase==="recording"||n.phase!=="picking"&&P();},stop(){y();},clearSelection(){n.phase==="capturing"||n.phase==="submitting"||n.phase==="recording"||P();},setConfig(d){t=d;},async submit(d,S){if(!E()){let R=w("configuration",new Error("BlocFeed submit can only run in the browser"));return f({phase:"error",lastError:R}),{ok:false}}let x=t.blocfeed_id?.trim?.()??"";if(!x){let L={phase:"error",lastError:w("configuration",new Error("Missing blocfeed_id. Create a project in BlocFeed and pass its blocfeed_id."))};return n.selection&&(L.selection=n.selection),f(L),{ok:false}}if(n.phase==="capturing"||n.phase==="submitting"||n.phase==="recording")return {ok:false};let F=c+1;c=F,s?.abort(),s=new AbortController;let T=s.signal,_=n.selection,U=S?.capture?{...t.capture,...S.capture}:t.capture,H=!!(U?.element||U?.fullPage),ge={phase:H?"capturing":"submitting"};_&&(ge.selection=_),f(ge);try{let R=H?await Pe({selectionElement:l,capture:U,signal:T}):void 0;if(T.aborted||c!==F)return {ok:!1};let L={phase:"submitting"};_&&(L.selection=_),R&&(L.capture=R),f(L);let N={};_&&(N.selection=_),R&&(N.capture=R);let qe=await xe({config:t.metadata,context:N,...t.user?{user:t.user}:{}}),D={version:1,createdAt:new Date().toISOString(),blocfeed_id:x,message:d,metadata:qe};S?.category&&(D.category=S.category),t.user&&(D.user=t.user),_&&(D.selection=_),R&&(D.screenshots=R),m&&(D.video=m);let{result:C}=await de({payload:D,signal:T,...t.transport?{transport:t.transport}:{}});if(T.aborted||c!==F)return C;if(C.ok){m&&(URL.revokeObjectURL(m.blobUrl),m=null);let ee={phase:"success",lastSubmit:C};return _&&(ee.selection=_),R&&(ee.capture=R),f(ee),C}xt(C)&&se(D);let ze=C.api?.error??w("unknown",new Error("Submission failed")),J={phase:"error",lastSubmit:C,lastError:ze};return _&&(J.selection=_),R&&(J.capture=R),f(J),C}catch(R){if(T.aborted||c!==F)return {ok:false};let N={phase:"error",lastError:T.aborted?w("aborted",R):w("unknown",R)};return _&&(N.selection=_),f(N),{ok:false}}finally{c===F&&(s=null);}},async startRecording(){if(n.phase!=="review"||!t.recording?.enabled)return;let d=n.selection,S={phase:"recording",recordingElapsedMs:0};d&&(S.selection=d),f(S);try{let x={config:t.recording};s&&(x.signal=s.signal);let F=await ce(x);p=F,F.onTick(U=>{if(n.phase==="recording"){let H={phase:"recording",recordingElapsedMs:U};d&&(H.selection=d),f(H);}});let T=await F.result;p=null,m=T;let _={phase:"review",video:T};d&&(_.selection=d),f(_);}catch(x){p=null;let T={phase:"review",lastError:x?.kind?x:w("recording_failed",x)};d&&(T.selection=d),f(T);}},stopRecording(){n.phase!=="recording"||!p||p.stop();},removeVideo(){m&&(URL.revokeObjectURL(m.blobUrl),m=null);let d=n.selection,S={phase:"review"};d&&(S.selection=d),f(S);},__unsafeGetSelectedElement(){return l},destroy(){y(),r.clear(),o.clear(),h?.(),h=null;}}}var z=[],$=[],Ue=20,He=15,Y=[],j={},V=null,X=null,Z=null,G=false,Ft=["blocfeed.com","google-analytics.com","googletagmanager.com","analytics.google.com","googleads.g.doubleclick.net","googlesyndication.com","googleadservices.com","google.com/pagead","google.com/ads","facebook.net","facebook.com/tr","connect.facebook.net","graph.facebook.com","api.mixpanel.com","api-js.mixpanel.com","api.amplitude.com","api2.amplitude.com","api.segment.io","cdn.segment.com","vars.hotjar.com","in.hotjar.com","script.hotjar.com","heapanalytics.com","fullstory.com/s/fs.js","rs.fullstory.com","app.posthog.com","us.posthog.com","eu.posthog.com","api-iam.intercom.io","widget.intercom.io","sentry.io/api","browser.sentry-cdn.com","browser-intake-datadoghq.com","clarity.ms","js.hs-analytics.net","api.hubapi.com","forms.hubspot.com","plausible.io/api","client.crisp.chat","js.driftt.com","r.logrocket.com","app.pendo.io","events.launchdarkly.com","app.launchdarkly.com","grammarly.com","gnar.grammarly.com","capi.grammarly.com","api.languagetool.org","api.languagetoolplus.com","fonts.googleapis.com","fonts.gstatic.com","cdn.cookielaw.org","consent.cookiebot.com","js.stripe.com","api.stripe.com/v1/tokens","google.com/recaptcha","hcaptcha.com","bam.nr-data.net","rec.smartlook.com","o2.mouseflow.com","api.luckyorange.com","static.zdassets.com","ekr.zdassets.com"];function Ct(e){if(e instanceof Error)return e.message;if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function Mt(e,t){let n=t.map(Ct).join(" "),r=t.find(i=>i instanceof Error),o={level:e,message:n.slice(0,2e3),timestamp:Date.now()};for(r?.stack&&(o.stack=r.stack.slice(0,2e3)),z.push(o);z.length>Ue;)z.shift();}function fe(e){let t=e.url.toLowerCase();for(let n of Y)if(t.includes(n))return;for($.push(e);$.length>He;)$.shift();}function Pn(e={}){if(G||!E())return;G=true,Ue=e.consoleLimit??20,He=e.networkLimit??15;let t=e.ignoreUrls;if(t!==void 0?Y=t.map(n=>n.toLowerCase()):Y=[...Ft],e.console!==false){let n=e.consoleLevels??["error","warn"];for(let r of n)j[r]=console[r],console[r]=(...o)=>{Mt(r,o),j[r]?.apply(console,o);};}if(e.network!==false&&typeof window.fetch=="function"){V=window.fetch;let n=V;window.fetch=async function(o,i){let l=typeof o=="string"?o:o instanceof URL?o.toString():o.url,a=(i?.method??"GET").toUpperCase(),s=Date.now();try{let c=await n.call(window,o,i);return c.ok||fe({url:l.slice(0,500),method:a,status:c.status,statusText:c.statusText,timestamp:s,durationMs:Date.now()-s}),c}catch(c){throw fe({url:l.slice(0,500),method:a,status:0,statusText:c instanceof Error?c.message:"Network error",timestamp:s,durationMs:Date.now()-s}),c}};}if(e.network!==false&&typeof XMLHttpRequest<"u"){X=XMLHttpRequest.prototype.open,Z=XMLHttpRequest.prototype.send;let n=X,r=Z;XMLHttpRequest.prototype.open=function(o,i,...l){return this.__bf_method=o.toUpperCase(),this.__bf_url=String(i),n.apply(this,[o,i,...l])},XMLHttpRequest.prototype.send=function(...o){let i=this.__bf_method||"GET",l=this.__bf_url||"",a=Date.now();return this.addEventListener("loadend",function(){if(this.status>=400||this.status===0){let s={url:l.slice(0,500),method:i,status:this.status,timestamp:a,durationMs:Date.now()-a};this.statusText&&(s.statusText=this.statusText),fe(s);}}),r.apply(this,o)};}}function xn(){if(G){for(let[e,t]of Object.entries(j))console[e]=t;for(let e of Object.keys(j))delete j[e];V&&(window.fetch=V,V=null),X&&(XMLHttpRequest.prototype.open=X,X=null),Z&&(XMLHttpRequest.prototype.send=Z,Z=null),Y=[],G=false;}}function Fn(){return {consoleLogs:[...z],networkErrors:[...$]}}function Cn(){z=[],$=[];}var Lt=[{name:"supabase_service_role_key",pattern:/SUPABASE_SERVICE_ROLE_KEY["'=:\s]+[A-Za-z0-9_.=-]{30,}/},{name:"supabase_db_password",pattern:/SUPABASE_DB_PASSWORD["'=:\s]+[^\s"']{6,}/},{name:"postgres_password",pattern:/POSTGRES_PASSWORD["'=:\s]+[^\s"']{6,}/},{name:"database_url_with_creds",pattern:/(?:postgres|postgresql|mysql|mongodb|redis|amqp):\/\/[^:]+:[^@\s"']+@/},{name:"aws_access_key",pattern:/AKIA[0-9A-Z]{16}/},{name:"aws_secret_key",pattern:/AWS_SECRET_ACCESS_KEY["'=:\s]+[A-Za-z0-9/+=]{30,}/},{name:"aws_session_token",pattern:/AWS_SESSION_TOKEN["'=:\s]+[A-Za-z0-9/+=]{30,}/},{name:"stripe_secret_key",pattern:/sk_live_[a-zA-Z0-9]{10,}/},{name:"stripe_secret_key_test",pattern:/sk_test_[a-zA-Z0-9]{10,}/},{name:"stripe_restricted_key",pattern:/rk_(?:live|test)_[a-zA-Z0-9]{10,}/},{name:"github_pat",pattern:/ghp_[A-Za-z0-9_]{36,}/},{name:"github_oauth",pattern:/gho_[A-Za-z0-9_]{36,}/},{name:"github_user_token",pattern:/ghu_[A-Za-z0-9_]{36,}/},{name:"github_server_token",pattern:/ghs_[A-Za-z0-9_]{36,}/},{name:"github_fine_grained",pattern:/github_pat_[A-Za-z0-9_]{22,}/},{name:"openai_api_key",pattern:/sk-[a-zA-Z0-9]{20,}(?![a-zA-Z0-9_])/},{name:"anthropic_api_key",pattern:/sk-ant-[a-zA-Z0-9\-_]{20,}/},{name:"private_key",pattern:/-----BEGIN (?:RSA |EC |DSA |OPENSSH |PGP )?PRIVATE KEY-----/},{name:"sendgrid_api_key",pattern:/SG\.[a-zA-Z0-9_-]{22,}\.[a-zA-Z0-9_-]{22,}/},{name:"twilio_auth_token",pattern:/TWILIO_AUTH_TOKEN["'=:\s]+[a-f0-9]{32}/},{name:"generic_secret_key",pattern:/[A-Z_]{2,}_SECRET_KEY["'=:\s]+[^\s"']{8,}/},{name:"generic_secret",pattern:/[A-Z_]{2,}_SECRET["'=:\s]+[^\s"']{8,}/},{name:"generic_password",pattern:/[A-Z_]{2,}_PASSWORD["'=:\s]+[^\s"']{6,}/},{name:"generic_private_key_var",pattern:/[A-Z_]{2,}_PRIVATE_KEY["'=:\s]+[^\s"']{8,}/}],I=[],pe=0,me=false;function Dt(e){let t=e.slice(0,80);return t.length<=6?"***":t.slice(0,6)+"***"}function Bt(e,t,n,r){if(I.some(l=>l.rule===e&&l.source===t))return;let i={rule:e,source:t,hint:Dt(n),timestamp:Date.now()};r&&(i.location=r),I.push(i);}function W(e,t,n,r){for(let{name:o,pattern:i}of n){let l=i.exec(e);l&&Bt(o,t,l[0],r);}}function It(e){try{let t=window;if(t.__NEXT_DATA__){let n=JSON.stringify(t.__NEXT_DATA__);W(n,"hydration",e,"__NEXT_DATA__");}if(t.__NUXT__){let n=JSON.stringify(t.__NUXT__);W(n,"hydration",e,"__NUXT__");}}catch{}}function Nt(e){try{document.querySelectorAll("script:not([src])").forEach((n,r)=>{let o=n.textContent;o&&o.length>0&&W(o,"scripts",e,`inline-script[${r}]`);});}catch{}}function Ot(e){try{document.querySelectorAll("meta[content]").forEach(n=>{let r=n.getAttribute("content"),o=n.getAttribute("name")||n.getAttribute("property")||"";r&&r.length>10&&W(r,"meta",e,o?`meta[${o}]`:void 0);});}catch{}}function Ut(e){try{document.querySelectorAll("[data-api-key], [data-secret], [data-token], [data-password]").forEach(n=>{let r=n.attributes;for(let o=0;o<r.length;o++){let i=r[o];i.name.startsWith("data-")&&i.value.length>10&&W(i.value,"dom",e,`${n.tagName.toLowerCase()}[${i.name}]`);}});}catch{}}function Dn(e={}){if(me||!E()||(me=true,e.secretScan===false))return;let t=[...Lt,...e.customPatterns??[]],n=e.scanTargets??["hydration","scripts","meta","dom"];setTimeout(()=>{pe=Date.now(),n.includes("hydration")&&It(t),n.includes("scripts")&&Nt(t),n.includes("meta")&&Ot(t),n.includes("dom")&&Ut(t);let r=e.notify??"both";I.length>0&&(r==="console"||r==="both")&&console.warn(`[BlocFeed Security] Found ${I.length} potential secret(s) exposed in client code:`,I.map(o=>`${o.rule} (${o.source}${o.location?`: ${o.location}`:""})`));},100);}function Bn(){return {findings:[...I],scannedAt:pe}}function In(){I=[],pe=0,me=false;}
|
|
2
|
-
export{E as a,te as b,ve as c,Pe as d,xe as e,se as f,Fe as g,Jt as h,en as i,wt as j,ce as k,Rn as l,Pn as m,xn as n,Fn as o,Cn as p,Dn as q,Bn as r,In as s};
|
package/dist/chunk-ORVW2RTZ.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
'use strict';function E(){return typeof window<"u"&&typeof document<"u"}function he(e){let t=globalThis.CSS;return typeof t?.escape=="function"?t.escape(e):e.replace(/[^a-zA-Z0-9_-]/g,n=>{let r=n.codePointAt(0);return r===void 0?"":`\\${r.toString(16)} `})}function te(e){return {x:e.x,y:e.y,width:e.width,height:e.height}}function $e(e){return {x:e.x+window.scrollX,y:e.y+window.scrollY,width:e.width,height:e.height}}function je(e){return e.replace(/\s+/g," ").trim()}function Ve(e,t=140){let n=e.textContent;if(!n)return;let r=je(n);if(r)return r.length<=t?r:`${r.slice(0,t-1)}\u2026`}function Xe(e){let t=1;for(let n=e.previousElementSibling;n;n=n.previousElementSibling)n.tagName===e.tagName&&(t+=1);return t}var Ee=["data-testid","data-test-id","data-test","data-qa","data-cy"],we="data-blocfeed-component";function Ze(e){let t=e.closest(`[${we}]`);if(!t)return;let r=t.getAttribute(we)?.trim();return r||void 0}function We(e){for(let t of Ee){let n=e.closest(`[${t}]`);if(!n)continue;let o=n.getAttribute(t)?.trim();if(o)return o}}function be(e){try{let t=e,n=Object.getOwnPropertyNames(t);for(let r of n)if(r.startsWith("__reactFiber$")||r.startsWith("__reactInternalInstance$")){let o=t[r];if(o&&typeof o=="object")return o}}catch{}return null}function B(e){if(e.length<=1||e.length===2&&e[0]===e[0].toLowerCase())return true;let t=e[0];return t>="a"&&t<="z"}function q(e){if(e){for(let t of e)if(typeof t.name=="string"&&t.name&&!B(t.name))return t.name}}function A(e){if(e&&typeof e!="string"){if(typeof e=="function"){let t=e;return typeof t.displayName=="string"&&t.displayName?t.displayName:typeof t.name=="string"&&t.name?t.name:void 0}if(typeof e=="object"){let t=e,n=t.displayName;if(typeof n=="string"&&n)return n;let r=t.render;if(typeof r=="function"){let i=r;if(typeof i.displayName=="string"&&i.displayName)return i.displayName;if(typeof i.name=="string"&&i.name)return i.name}let o=t.type;return A(o)}}}function Ke(e){let t=be(e);if(!t)return;let n=q(t._debugInfo);if(n)return n;let r=t._debugOwner!==void 0;if(r){let s=t._debugOwner;for(let c=0;s&&c<50;c+=1){let h=q(s._debugInfo);if(h)return h;let p=A(s.type)??A(s.elementType);if(p&&!B(p))return p;s=s._debugOwner;}}if(t._owner!==void 0&&t._owner!==t._debugOwner){let s=t._owner;for(let c=0;s&&c<50;c+=1){let h=q(s._debugInfo);if(h)return h;let p=A(s.type)??A(s.elementType);if(p&&!B(p))return p;s=s._owner;}}let i=t,l=r?80:25;for(let s=0;i&&s<l;s+=1){let c=q(i._debugInfo);if(c)return c;let h=A(i.type)??A(i.elementType);if(h&&!B(h))return h;i=i.return;}let a=e.parentElement;for(let s=0;a&&s<15;s+=1){let c=be(a);if(c){let h=q(c._debugInfo);if(h)return h;let p=A(c.type)??A(c.elementType);if(p&&!B(p))return p;if(c._debugOwner){let m=A(c._debugOwner.type)??A(c._debugOwner.elementType);if(m&&!B(m))return m}if(c._owner&&c._owner!==c._debugOwner){let m=A(c._owner.type)??A(c._owner.elementType);if(m&&!B(m))return m}}a=a.parentElement;}}function Qe(e){let t=e.tagName.toLowerCase(),n=e.getAttribute("id");if(n)return `#${he(n)}`;for(let r of Ee){let o=e.getAttribute(r);if(o)return `${t}[${r}="${he(o)}"]`}return `${t}:nth-of-type(${Xe(e)})`}function Ye(e,t=10){let n=[],r=e;for(;r&&n.length<t;){let o=Qe(r);if(n.unshift(o),o.startsWith("#"))break;r=r.parentElement;}return n.join(" > ")}function ye(e,t){if(!t||t.length===0)return false;for(let n of t)if(e.closest(n))return true;return false}function ne(e,t){if(!e||ye(e,t.ignoreSelectors))return null;let n=e;for(;n;){if(ye(n,t.ignoreSelectors))return null;if(t.isSelectable?.(n)??Ge(n))return n;n=n.parentElement;}return null}function Ge(e){let t=e.tagName;return !(t==="HTML"||t==="BODY")}function Se(e){let t=e.getBoundingClientRect(),n={selector:Ye(e),tagName:e.tagName.toLowerCase(),rect:te(t),pageRect:$e(t)},r=e.getAttribute("id");r&&(n.id=r);let o=e.className;typeof o=="string"&&o.trim()&&(n.className=o);let i=Ve(e);i&&(n.textSnippet=i);let l=Ze(e)??Ke(e);l&&(n.componentName=l);let a=We(e);return a&&(n.testId=a),n}var re=null;async function ke(){return re||(re=import('html-to-image')),re}async function Je(e){return await new Promise((t,n)=>{let r=new Image;r.onload=()=>t({width:r.naturalWidth,height:r.naturalHeight}),r.onerror=()=>n(new Error("Failed to load generated screenshot")),r.src=e;})}async function _e(e,t){let{width:n,height:r}=await Je(e);return {dataUrl:e,mime:t,width:n,height:r}}function O(e){if(e?.aborted)throw new Error("Aborted")}function ve(){return {async captureElement(e,t){if(!E())throw new Error("captureElement can only run in the browser");O(t.signal);let n=await ke();O(t.signal);let r=t.mime==="image/jpeg"?await n.toJpeg(e,{quality:t.quality??.92,pixelRatio:t.pixelRatio}):await n.toPng(e,{pixelRatio:t.pixelRatio});return O(t.signal),await _e(r,t.mime)},async captureFullPage(e){if(!E())throw new Error("captureFullPage can only run in the browser");O(e.signal);let t=document.documentElement,n=Math.max(t.scrollWidth,t.clientWidth),r=Math.max(t.scrollHeight,t.clientHeight),o=Math.min(1,e.maxDimension/Math.max(n,r)),i=Math.max(1,Math.round(n*o)),l=Math.max(1,Math.round(r*o)),a=await ke();O(e.signal);let s=e.mime==="image/jpeg"?await a.toJpeg(t,{width:i,height:l,quality:e.quality??.92,pixelRatio:e.pixelRatio}):await a.toPng(t,{width:i,height:l,pixelRatio:e.pixelRatio});return O(e.signal),await _e(s,e.mime)}}}function et(e){if(e instanceof Error)return e.message;if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return "Unknown error"}}function w(e,t,n){let r={kind:e,message:et(t)};return n&&(r.detail=n),r}var tt=12e3,nt=2048,rt=.92;function Re(){return Date.now()}function ot(e){return new Promise((t,n)=>{let r=()=>n(new Error("Aborted"));if(e.aborted){r();return}e.addEventListener("abort",r,{once:true});})}async function Ae(e,t,n){let r=new Promise((i,l)=>{let a=setTimeout(()=>l(new Error("Timeout")),t);typeof a.unref=="function"&&a.unref();}),o=[e,r];return n&&o.push(ot(n)),await Promise.race(o)}function it(e){if(!E())return 1;let t=window.devicePixelRatio||1,n=e?.pixelRatio??Math.min(t,2);return Math.max(.1,n)}function at(e){return !!(e?.element||e?.fullPage)}function Te(e){let t={mime:e.mime,pixelRatio:e.pixelRatio,maxDimension:e.maxDimension};return e.includeQuality&&(t.quality=e.quality),e.signal&&(t.signal=e.signal),t}async function Pe(e){let{selectionElement:t,capture:n,signal:r}=e;if(!E()||!at(n))return;let o=Re(),i=[],l=n?.timeoutMs??tt,a=n?.maxDimension??nt,s=n?.mime??"image/png",c=n?.quality??rt,h=n?.adapter??ve(),p={},m=it(n);if(n?.element&&t)try{let f=t.getBoundingClientRect(),g=Math.min(1,a/Math.max(f.width,f.height)),k=Math.min(m,m*g),v=await Ae(Promise.resolve(h.captureElement(t,{...Te({mime:s,quality:c,pixelRatio:k,maxDimension:a,includeQuality:s==="image/jpeg",...r?{signal:r}:{}})})),l,r);p.element=v;}catch(f){if(r?.aborted)throw f;i.push(w("capture_failed",f,{target:"element"}));}if(n?.fullPage)try{let f=await Ae(Promise.resolve(h.captureFullPage(Te({mime:s,quality:c,pixelRatio:m,maxDimension:a,includeQuality:s==="image/jpeg",...r?{signal:r}:{}}))),l,r);p.fullPage=f;}catch(f){if(r?.aborted)throw f;i.push(w("capture_failed",f,{target:"fullPage"}));}let b=Re(),u={startedAt:o,finishedAt:b,durationMs:Math.max(0,b-o)};return i.length>0&&(u.errors=i),{...p,diagnostics:u}}function st(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function ct(){return E()?{url:window.location.href,title:document.title,referrer:document.referrer||void 0,userAgent:navigator.userAgent,language:navigator.language,platform:navigator.platform,viewport:{width:window.innerWidth,height:window.innerHeight},screen:{width:window.screen.width,height:window.screen.height},scroll:{x:window.scrollX,y:window.scrollY},devicePixelRatio:window.devicePixelRatio||1,timezone:st()}:{}}function lt(e){if(!e)return {};let t={};return e.id&&(t.userId=e.id),e.email&&(t.userEmail=e.email),e.name&&(t.userName=e.name),t}async function xe(e){let{config:t,context:n,user:r}=e;if(t?.enabled===false)return {};let o={...ct(),...lt(r)},i=t?.enrich;if(!i)return o;try{let l=await i(n);return {...o,...l}}catch(l){let a=w("unknown",l);return {...o,blocfeedMetadataError:a.message}}}var oe="blocfeed-queue",ut=50;function ie(){if(!E())return [];try{let e=localStorage.getItem(oe);if(!e)return [];let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return []}}function ae(e){if(E())try{e.length===0?localStorage.removeItem(oe):localStorage.setItem(oe,JSON.stringify(e));}catch{}}function dt(e){let t={...e};if(t.screenshots){let n={...t.screenshots};n.element&&(n.element={...n.element,dataUrl:""}),n.fullPage&&(n.fullPage={...n.fullPage,dataUrl:""}),t.screenshots=n;}return delete t.video,t}function se(e){let t=ie(),n=dt(e);for(n.metadata={...n.metadata,_queued:true},t.push({payload:n,timestamp:Date.now()});t.length>ut;)t.shift();ae(t);}function Fe(){let e=ie();return e.length===0?[]:(ae([]),e.map(t=>t.payload))}function Jt(){ae([]);}function en(){return ie().length}var ft=3e4,mt=25e5,Ce="video/webm",pt=250,gt=1e3,ht=["video/webm;codecs=vp9","video/webm;codecs=vp8","video/webm"];function Me(){if(typeof MediaRecorder>"u")return null;for(let e of ht)if(MediaRecorder.isTypeSupported(e))return e;return null}function wt(){return !E()||typeof navigator?.mediaDevices?.getDisplayMedia!="function"?false:Me()!==null}async function ce(e){let{config:t,signal:n}=e;if(!E()||typeof navigator?.mediaDevices?.getDisplayMedia!="function")throw w("recording_failed",new Error("Screen recording is not supported in this browser"));let r=Me();if(!r)throw w("recording_failed",new Error("No supported video codec found (WebM required)"));if(n?.aborted)throw w("aborted",new Error("Recording aborted before start"));let o;try{o=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser"},audio:!1});}catch(g){let k=g instanceof DOMException&&g.name==="NotAllowedError"?"Screen share permission denied":"Failed to start screen share";throw w("recording_failed",new Error(k))}if(n?.aborted)throw o.getTracks().forEach(g=>g.stop()),w("aborted",new Error("Recording aborted after permission"));let i=t?.maxDurationMs??ft,l=t?.videoBitsPerSecond??mt,a=new MediaRecorder(o,{mimeType:r,videoBitsPerSecond:l}),s=[],c=[],h=0,p=null,m=null,b=false,u=()=>{p!==null&&(clearInterval(p),p=null),m!==null&&(clearTimeout(m),m=null),o.getTracks().forEach(g=>g.stop());},f=new Promise((g,k)=>{a.ondataavailable=y=>{y.data.size>0&&s.push(y.data);},a.onstop=()=>{if(b)return;b=true,u();let y=Date.now()-h,P=new Blob(s,{type:Ce}),M=URL.createObjectURL(P);g({mime:Ce,blobUrl:M,blob:P,durationMs:y,sizeBytes:P.size});},a.onerror=()=>{b||(b=true,u(),k(w("recording_failed",new Error("MediaRecorder error"))));};let v=o.getVideoTracks()[0];if(v&&v.addEventListener("ended",()=>{a.state!=="inactive"&&a.stop();}),n){let y=()=>{b||(b=true,a.state!=="inactive"&&a.stop(),u(),k(w("aborted",new Error("Recording aborted"))));};n.addEventListener("abort",y,{once:true});}});return a.start(gt),h=Date.now(),p=setInterval(()=>{let g=Date.now()-h;for(let k of c)k(g);},pt),m=setTimeout(()=>{!b&&a.state!=="inactive"&&a.stop();},i),{result:f,stop(){!b&&a.state!=="inactive"&&a.stop();},onTick(g){c.push(g);},abort(){b||(b=true,a.state!=="inactive"&&a.stop(),u());}}}function le(e){let t=null,n=null,r=(...o)=>{n=o,t===null&&(t=requestAnimationFrame(()=>{if(t=null,!n)return;let i=n;n=null,e(...i);}));};return r.cancel=()=>{t!==null&&cancelAnimationFrame(t),t=null,n=null;},r}function K(e){return e instanceof Element?!!e.closest("[data-blocfeed-ui]"):false}function Q(e){e.stopPropagation(),e.stopImmediatePropagation?.();}function Le(e,t){if(!E())throw new Error("BlocFeed picker can only run in a browser environment.");let n=e.ignoreSelectors,r=e.isSelectable,o={};n&&n.length>0&&(o.ignoreSelectors=n),r&&(o.isSelectable=r);let i=null,l=null,a=(u,f=false)=>{if(!u){i=null,l=null,t.onHover(null);return}let g=te(u.getBoundingClientRect()),k=`${Math.round(g.x)}:${Math.round(g.y)}:${Math.round(g.width)}:${Math.round(g.height)}`;!f&&u===i&&k===l||(i=u,l=k,t.onHover({element:u,rect:g}));},s=le(u=>{if(K(u.target))return;let f=document.elementFromPoint(u.clientX,u.clientY),g=ne(f,o);a(g);}),c=le(()=>{i&&a(i,true);}),h=u=>{K(u.target)||(Q(u),u.pointerType==="mouse"&&u.preventDefault());},p=u=>{K(u.target)||(Q(u),u.pointerType==="mouse"&&u.preventDefault());},m=u=>{if(K(u.target))return;Q(u),u.preventDefault();let f=document.elementFromPoint(u.clientX,u.clientY),g=ne(f,o);g&&t.onSelect({element:g,descriptor:Se(g)});},b=u=>{u.key==="Escape"&&(Q(u),u.preventDefault(),t.onCancel());};return window.addEventListener("pointermove",s,{capture:true,passive:true}),window.addEventListener("pointerdown",h,{capture:true}),window.addEventListener("pointerup",p,{capture:true}),window.addEventListener("click",m,{capture:true}),window.addEventListener("keydown",b,{capture:true}),window.addEventListener("scroll",c,{capture:true,passive:true}),window.addEventListener("resize",c,{passive:true}),{stop(){window.removeEventListener("pointermove",s,{capture:true}),window.removeEventListener("pointerdown",h,{capture:true}),window.removeEventListener("pointerup",p,{capture:true}),window.removeEventListener("click",m,{capture:true}),window.removeEventListener("keydown",b,{capture:true}),window.removeEventListener("scroll",c,{capture:true}),window.removeEventListener("resize",c),s.cancel(),c.cancel(),t.onHover(null);}}}var bt=12e3,yt=2,Et=500,St=2e3,ue="https://blocfeed.com/api/feedback",De=0;function Be(e,t){return new Promise((n,r)=>{if(t?.aborted){r(new Error("Aborted"));return}let o=setTimeout(n,e),i=()=>{clearTimeout(o),r(new Error("Aborted"));};t?.addEventListener("abort",i,{once:true});})}function kt(e){return e>=500&&e<=599}function _t(e){let[t,n]=e.split(",",2);if(!t||!n)throw new Error("Invalid data URL");let o=/data:(.*?);base64/.exec(t)?.[1]||"application/octet-stream",i=atob(n),l=new Uint8Array(i.length);for(let a=0;a<i.length;a+=1)l[a]=i.charCodeAt(a);return new Blob([l],{type:o})}function vt(e){let t={},n={},r={...e};if(r.screenshots){let o={},i={...r.screenshots};i.element&&(t.element=i.element.dataUrl,o.element={mime:i.element.mime,width:i.element.width,height:i.element.height},i.element={...i.element,dataUrl:""}),i.fullPage&&(t.fullPage=i.fullPage.dataUrl,o.fullPage={mime:i.fullPage.mime,width:i.fullPage.width,height:i.fullPage.height},i.fullPage={...i.fullPage,dataUrl:""}),r.screenshots=i,(o.element||o.fullPage)&&(r.screenshot_intent=o);}return r.video&&(n.blob=r.video.blob,r.video_intent={mime:r.video.mime,durationMs:r.video.durationMs,sizeBytes:r.video.sizeBytes},delete r.video),{lean:r,extracted:t,extractedVideo:n}}async function Ie(e,t,n){let r=_t(t);await fetch(e,{method:"PUT",body:r,headers:{"content-type":r.type},...n?{signal:n}:{}});}async function Rt(e){let{feedbackId:t,extracted:n,screenshots:r,signal:o}=e,i={};n.element&&r?.element&&(i.element={dataUrl:n.element,mime:r.element.mime,width:r.element.width,height:r.element.height}),n.fullPage&&r?.fullPage&&(i.fullPage={dataUrl:n.fullPage,mime:r.fullPage.mime,width:r.fullPage.width,height:r.fullPage.height}),Object.keys(i).length!==0&&await fetch(`${ue}/${t}/screenshots`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(i),...o?{signal:o}:{}});}async function At(e){await fetch(`${ue}/${e.feedbackId}/video`,{method:"POST",body:e.blob,headers:{"content-type":e.blob.type},...e.signal?{signal:e.signal}:{}});}async function Ne(e){let{signal:t,transport:n}=e;if(Date.now()-De<St)return {ok:false,error:w("configuration",new Error("Please wait before submitting again"))};let o=n?.timeoutMs??bt,i=n?.maxAttempts??yt,l=n?.backoffMs??Et,a=!!(e.payload.screenshots?.element?.dataUrl||e.payload.screenshots?.fullPage?.dataUrl),s=!!e.payload.video?.blob,c=a||s,{lean:h,extracted:p,extractedVideo:m}=c?vt(e.payload):{lean:e.payload,extracted:{},extractedVideo:{}},b={...p,...e.screenshotDataUrls};for(let u=1;u<=i;u+=1){let f=new AbortController,g=setTimeout(()=>f.abort(),o),k=()=>f.abort();t&&t.addEventListener("abort",k,{once:true});try{let v=await fetch(ue,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(h),signal:f.signal});if(v.ok){De=Date.now();let y;try{y=await v.json();}catch{}if((b.element||b.fullPage)&&y){let d=y.upload_urls;if(d){let S=[];b.element&&d.element&&S.push(Ie(d.element,b.element,t)),b.fullPage&&d.fullPage&&S.push(Ie(d.fullPage,b.fullPage,t));try{await Promise.all(S);}catch{}}else if(y.feedback_id)try{await Rt({feedbackId:y.feedback_id,extracted:b,screenshots:e.payload.screenshots,...t?{signal:t}:{}});}catch{}}if(m.blob&&y){let d=y.upload_urls;if(d?.video)try{await fetch(d.video,{method:"PUT",body:m.blob,headers:{"content-type":m.blob.type},...t?{signal:t}:{}});}catch{}else if(y.feedback_id)try{await At({feedbackId:y.feedback_id,blob:m.blob,...t?{signal:t}:{}});}catch{}}let M={ok:!0,status:v.status};return y&&(M.apiResponse=y),M}if(u<i&&kt(v.status)){let y=.85+Math.random()*.3,P=Math.round(l*2**(u-1)*y);await Be(P,t);continue}return {ok:!1,status:v.status,error:w("api_failed",new Error(`HTTP ${v.status}`))}}catch(v){if(f.signal.aborted||t?.aborted)return {ok:false,error:w("aborted",v)};if(u<i){let y=.85+Math.random()*.3,P=Math.round(l*2**(u-1)*y);await Be(P,t);continue}return {ok:false,error:w("api_failed",v)}}finally{clearTimeout(g),t&&t.removeEventListener("abort",k);}}return {ok:false,error:w("api_failed",new Error("Failed"))}}async function de(e){let{signal:t,transport:n}=e,r={ok:false};try{let o={payload:e.payload,...t?{signal:t}:{},...n?{transport:n}:{}};r.api=await Ne(o),r.ok=!!r.api?.ok;}catch(o){r.api={ok:false,error:w("api_failed",o)},r.ok=false;}return {payload:e.payload,result:r}}var Tt=["[data-blocfeed-ui]","[data-blocfeed-ignore]"];function Pt(e){let t=[...Tt,...e?.ignoreSelectors??[]],n=Array.from(new Set(t));return {...e,ignoreSelectors:n}}function Oe(){return {phase:"idle"}}function xt(e){if(e.ok)return false;let t=e.api;return t?t.status&&t.status>=400&&t.status<500||t.error?.kind==="aborted"||t.error?.kind==="configuration"?false:!t.ok:true}function Rn(e){let t=e,n=Oe(),r=new Set,o=new Set,i=null,l=null,a=null,s=null,c=0,h=null,p=null,m=null,b=()=>{for(let d of r)d(n);},u=d=>{for(let S of o)S(d);},f=d=>{n=d,b();},g=()=>{c+=1,s?.abort(),s=null;},k=()=>{i?.stop(),i=null,u(null),a!==null&&E()&&(document.documentElement.style.cursor=a,a=null);},v=()=>{p&&(p.abort(),p=null),m&&(URL.revokeObjectURL(m.blobUrl),m=null);},y=()=>{g(),k(),v(),l=null,f(Oe());},P=()=>{if(!E())return;k(),l=null;let d=Pt(t.picker);a=document.documentElement.style.cursor,document.documentElement.style.cursor="crosshair",f({phase:"picking"}),i=Le(d,{onHover:u,onSelect:({element:S,descriptor:x})=>{l=S,k(),f({phase:"review",selection:x});},onCancel:()=>{y();}});},M=()=>{let d=Fe();if(d.length!==0)for(let S of d)de({payload:S,...t.transport?{transport:t.transport}:{}}).catch(()=>{se(S);});};if(E()){setTimeout(M,1e3);let d=()=>M();window.addEventListener("online",d),h=()=>window.removeEventListener("online",d);}return {getState:()=>n,subscribe(d){return r.add(d),()=>r.delete(d)},subscribeHover(d){return o.add(d),()=>o.delete(d)},start(){n.phase==="capturing"||n.phase==="submitting"||n.phase==="recording"||n.phase!=="picking"&&P();},stop(){y();},clearSelection(){n.phase==="capturing"||n.phase==="submitting"||n.phase==="recording"||P();},setConfig(d){t=d;},async submit(d,S){if(!E()){let R=w("configuration",new Error("BlocFeed submit can only run in the browser"));return f({phase:"error",lastError:R}),{ok:false}}let x=t.blocfeed_id?.trim?.()??"";if(!x){let L={phase:"error",lastError:w("configuration",new Error("Missing blocfeed_id. Create a project in BlocFeed and pass its blocfeed_id."))};return n.selection&&(L.selection=n.selection),f(L),{ok:false}}if(n.phase==="capturing"||n.phase==="submitting"||n.phase==="recording")return {ok:false};let F=c+1;c=F,s?.abort(),s=new AbortController;let T=s.signal,_=n.selection,U=S?.capture?{...t.capture,...S.capture}:t.capture,H=!!(U?.element||U?.fullPage),ge={phase:H?"capturing":"submitting"};_&&(ge.selection=_),f(ge);try{let R=H?await Pe({selectionElement:l,capture:U,signal:T}):void 0;if(T.aborted||c!==F)return {ok:!1};let L={phase:"submitting"};_&&(L.selection=_),R&&(L.capture=R),f(L);let N={};_&&(N.selection=_),R&&(N.capture=R);let qe=await xe({config:t.metadata,context:N,...t.user?{user:t.user}:{}}),D={version:1,createdAt:new Date().toISOString(),blocfeed_id:x,message:d,metadata:qe};S?.category&&(D.category=S.category),t.user&&(D.user=t.user),_&&(D.selection=_),R&&(D.screenshots=R),m&&(D.video=m);let{result:C}=await de({payload:D,signal:T,...t.transport?{transport:t.transport}:{}});if(T.aborted||c!==F)return C;if(C.ok){m&&(URL.revokeObjectURL(m.blobUrl),m=null);let ee={phase:"success",lastSubmit:C};return _&&(ee.selection=_),R&&(ee.capture=R),f(ee),C}xt(C)&&se(D);let ze=C.api?.error??w("unknown",new Error("Submission failed")),J={phase:"error",lastSubmit:C,lastError:ze};return _&&(J.selection=_),R&&(J.capture=R),f(J),C}catch(R){if(T.aborted||c!==F)return {ok:false};let N={phase:"error",lastError:T.aborted?w("aborted",R):w("unknown",R)};return _&&(N.selection=_),f(N),{ok:false}}finally{c===F&&(s=null);}},async startRecording(){if(n.phase!=="review"||!t.recording?.enabled)return;let d=n.selection,S={phase:"recording",recordingElapsedMs:0};d&&(S.selection=d),f(S);try{let x={config:t.recording};s&&(x.signal=s.signal);let F=await ce(x);p=F,F.onTick(U=>{if(n.phase==="recording"){let H={phase:"recording",recordingElapsedMs:U};d&&(H.selection=d),f(H);}});let T=await F.result;p=null,m=T;let _={phase:"review",video:T};d&&(_.selection=d),f(_);}catch(x){p=null;let T={phase:"review",lastError:x?.kind?x:w("recording_failed",x)};d&&(T.selection=d),f(T);}},stopRecording(){n.phase!=="recording"||!p||p.stop();},removeVideo(){m&&(URL.revokeObjectURL(m.blobUrl),m=null);let d=n.selection,S={phase:"review"};d&&(S.selection=d),f(S);},__unsafeGetSelectedElement(){return l},destroy(){y(),r.clear(),o.clear(),h?.(),h=null;}}}var z=[],$=[],Ue=20,He=15,Y=[],j={},V=null,X=null,Z=null,G=false,Ft=["blocfeed.com","google-analytics.com","googletagmanager.com","analytics.google.com","googleads.g.doubleclick.net","googlesyndication.com","googleadservices.com","google.com/pagead","google.com/ads","facebook.net","facebook.com/tr","connect.facebook.net","graph.facebook.com","api.mixpanel.com","api-js.mixpanel.com","api.amplitude.com","api2.amplitude.com","api.segment.io","cdn.segment.com","vars.hotjar.com","in.hotjar.com","script.hotjar.com","heapanalytics.com","fullstory.com/s/fs.js","rs.fullstory.com","app.posthog.com","us.posthog.com","eu.posthog.com","api-iam.intercom.io","widget.intercom.io","sentry.io/api","browser.sentry-cdn.com","browser-intake-datadoghq.com","clarity.ms","js.hs-analytics.net","api.hubapi.com","forms.hubspot.com","plausible.io/api","client.crisp.chat","js.driftt.com","r.logrocket.com","app.pendo.io","events.launchdarkly.com","app.launchdarkly.com","grammarly.com","gnar.grammarly.com","capi.grammarly.com","api.languagetool.org","api.languagetoolplus.com","fonts.googleapis.com","fonts.gstatic.com","cdn.cookielaw.org","consent.cookiebot.com","js.stripe.com","api.stripe.com/v1/tokens","google.com/recaptcha","hcaptcha.com","bam.nr-data.net","rec.smartlook.com","o2.mouseflow.com","api.luckyorange.com","static.zdassets.com","ekr.zdassets.com"];function Ct(e){if(e instanceof Error)return e.message;if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function Mt(e,t){let n=t.map(Ct).join(" "),r=t.find(i=>i instanceof Error),o={level:e,message:n.slice(0,2e3),timestamp:Date.now()};for(r?.stack&&(o.stack=r.stack.slice(0,2e3)),z.push(o);z.length>Ue;)z.shift();}function fe(e){let t=e.url.toLowerCase();for(let n of Y)if(t.includes(n))return;for($.push(e);$.length>He;)$.shift();}function Pn(e={}){if(G||!E())return;G=true,Ue=e.consoleLimit??20,He=e.networkLimit??15;let t=e.ignoreUrls;if(t!==void 0?Y=t.map(n=>n.toLowerCase()):Y=[...Ft],e.console!==false){let n=e.consoleLevels??["error","warn"];for(let r of n)j[r]=console[r],console[r]=(...o)=>{Mt(r,o),j[r]?.apply(console,o);};}if(e.network!==false&&typeof window.fetch=="function"){V=window.fetch;let n=V;window.fetch=async function(o,i){let l=typeof o=="string"?o:o instanceof URL?o.toString():o.url,a=(i?.method??"GET").toUpperCase(),s=Date.now();try{let c=await n.call(window,o,i);return c.ok||fe({url:l.slice(0,500),method:a,status:c.status,statusText:c.statusText,timestamp:s,durationMs:Date.now()-s}),c}catch(c){throw fe({url:l.slice(0,500),method:a,status:0,statusText:c instanceof Error?c.message:"Network error",timestamp:s,durationMs:Date.now()-s}),c}};}if(e.network!==false&&typeof XMLHttpRequest<"u"){X=XMLHttpRequest.prototype.open,Z=XMLHttpRequest.prototype.send;let n=X,r=Z;XMLHttpRequest.prototype.open=function(o,i,...l){return this.__bf_method=o.toUpperCase(),this.__bf_url=String(i),n.apply(this,[o,i,...l])},XMLHttpRequest.prototype.send=function(...o){let i=this.__bf_method||"GET",l=this.__bf_url||"",a=Date.now();return this.addEventListener("loadend",function(){if(this.status>=400||this.status===0){let s={url:l.slice(0,500),method:i,status:this.status,timestamp:a,durationMs:Date.now()-a};this.statusText&&(s.statusText=this.statusText),fe(s);}}),r.apply(this,o)};}}function xn(){if(G){for(let[e,t]of Object.entries(j))console[e]=t;for(let e of Object.keys(j))delete j[e];V&&(window.fetch=V,V=null),X&&(XMLHttpRequest.prototype.open=X,X=null),Z&&(XMLHttpRequest.prototype.send=Z,Z=null),Y=[],G=false;}}function Fn(){return {consoleLogs:[...z],networkErrors:[...$]}}function Cn(){z=[],$=[];}var Lt=[{name:"supabase_service_role_key",pattern:/SUPABASE_SERVICE_ROLE_KEY["'=:\s]+[A-Za-z0-9_.=-]{30,}/},{name:"supabase_db_password",pattern:/SUPABASE_DB_PASSWORD["'=:\s]+[^\s"']{6,}/},{name:"postgres_password",pattern:/POSTGRES_PASSWORD["'=:\s]+[^\s"']{6,}/},{name:"database_url_with_creds",pattern:/(?:postgres|postgresql|mysql|mongodb|redis|amqp):\/\/[^:]+:[^@\s"']+@/},{name:"aws_access_key",pattern:/AKIA[0-9A-Z]{16}/},{name:"aws_secret_key",pattern:/AWS_SECRET_ACCESS_KEY["'=:\s]+[A-Za-z0-9/+=]{30,}/},{name:"aws_session_token",pattern:/AWS_SESSION_TOKEN["'=:\s]+[A-Za-z0-9/+=]{30,}/},{name:"stripe_secret_key",pattern:/sk_live_[a-zA-Z0-9]{10,}/},{name:"stripe_secret_key_test",pattern:/sk_test_[a-zA-Z0-9]{10,}/},{name:"stripe_restricted_key",pattern:/rk_(?:live|test)_[a-zA-Z0-9]{10,}/},{name:"github_pat",pattern:/ghp_[A-Za-z0-9_]{36,}/},{name:"github_oauth",pattern:/gho_[A-Za-z0-9_]{36,}/},{name:"github_user_token",pattern:/ghu_[A-Za-z0-9_]{36,}/},{name:"github_server_token",pattern:/ghs_[A-Za-z0-9_]{36,}/},{name:"github_fine_grained",pattern:/github_pat_[A-Za-z0-9_]{22,}/},{name:"openai_api_key",pattern:/sk-[a-zA-Z0-9]{20,}(?![a-zA-Z0-9_])/},{name:"anthropic_api_key",pattern:/sk-ant-[a-zA-Z0-9\-_]{20,}/},{name:"private_key",pattern:/-----BEGIN (?:RSA |EC |DSA |OPENSSH |PGP )?PRIVATE KEY-----/},{name:"sendgrid_api_key",pattern:/SG\.[a-zA-Z0-9_-]{22,}\.[a-zA-Z0-9_-]{22,}/},{name:"twilio_auth_token",pattern:/TWILIO_AUTH_TOKEN["'=:\s]+[a-f0-9]{32}/},{name:"generic_secret_key",pattern:/[A-Z_]{2,}_SECRET_KEY["'=:\s]+[^\s"']{8,}/},{name:"generic_secret",pattern:/[A-Z_]{2,}_SECRET["'=:\s]+[^\s"']{8,}/},{name:"generic_password",pattern:/[A-Z_]{2,}_PASSWORD["'=:\s]+[^\s"']{6,}/},{name:"generic_private_key_var",pattern:/[A-Z_]{2,}_PRIVATE_KEY["'=:\s]+[^\s"']{8,}/}],I=[],pe=0,me=false;function Dt(e){let t=e.slice(0,80);return t.length<=6?"***":t.slice(0,6)+"***"}function Bt(e,t,n,r){if(I.some(l=>l.rule===e&&l.source===t))return;let i={rule:e,source:t,hint:Dt(n),timestamp:Date.now()};r&&(i.location=r),I.push(i);}function W(e,t,n,r){for(let{name:o,pattern:i}of n){let l=i.exec(e);l&&Bt(o,t,l[0],r);}}function It(e){try{let t=window;if(t.__NEXT_DATA__){let n=JSON.stringify(t.__NEXT_DATA__);W(n,"hydration",e,"__NEXT_DATA__");}if(t.__NUXT__){let n=JSON.stringify(t.__NUXT__);W(n,"hydration",e,"__NUXT__");}}catch{}}function Nt(e){try{document.querySelectorAll("script:not([src])").forEach((n,r)=>{let o=n.textContent;o&&o.length>0&&W(o,"scripts",e,`inline-script[${r}]`);});}catch{}}function Ot(e){try{document.querySelectorAll("meta[content]").forEach(n=>{let r=n.getAttribute("content"),o=n.getAttribute("name")||n.getAttribute("property")||"";r&&r.length>10&&W(r,"meta",e,o?`meta[${o}]`:void 0);});}catch{}}function Ut(e){try{document.querySelectorAll("[data-api-key], [data-secret], [data-token], [data-password]").forEach(n=>{let r=n.attributes;for(let o=0;o<r.length;o++){let i=r[o];i.name.startsWith("data-")&&i.value.length>10&&W(i.value,"dom",e,`${n.tagName.toLowerCase()}[${i.name}]`);}});}catch{}}function Dn(e={}){if(me||!E()||(me=true,e.secretScan===false))return;let t=[...Lt,...e.customPatterns??[]],n=e.scanTargets??["hydration","scripts","meta","dom"];setTimeout(()=>{pe=Date.now(),n.includes("hydration")&&It(t),n.includes("scripts")&&Nt(t),n.includes("meta")&&Ot(t),n.includes("dom")&&Ut(t);let r=e.notify??"both";I.length>0&&(r==="console"||r==="both")&&console.warn(`[BlocFeed Security] Found ${I.length} potential secret(s) exposed in client code:`,I.map(o=>`${o.rule} (${o.source}${o.location?`: ${o.location}`:""})`));},100);}function Bn(){return {findings:[...I],scannedAt:pe}}function In(){I=[],pe=0,me=false;}
|
|
2
|
-
exports.a=E;exports.b=te;exports.c=ve;exports.d=Pe;exports.e=xe;exports.f=se;exports.g=Fe;exports.h=Jt;exports.i=en;exports.j=wt;exports.k=ce;exports.l=Rn;exports.m=Pn;exports.n=xn;exports.o=Fn;exports.p=Cn;exports.q=Dn;exports.r=Bn;exports.s=In;
|