react-grab 0.1.44-dev.0b82e39 → 0.1.44-dev.27e140d

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.
Files changed (39) hide show
  1. package/dist/{action-shortcuts-C9e6Nnvm.cjs → action-shortcuts-7hAew2FY.cjs} +1 -1
  2. package/dist/action-shortcuts-DEFWl3W8.js +9 -0
  3. package/dist/{index-aMJqwVQq.d.cts → copy-content-B5eFPFGr.d.cts} +219 -17
  4. package/dist/copy-content-Blo2x2eu.js +10 -0
  5. package/dist/{index-qewm1CVI.d.ts → copy-content-DmBP15ec.d.ts} +219 -17
  6. package/dist/copy-content-crbRiXWE.cjs +10 -0
  7. package/dist/core/index.cjs +1 -1
  8. package/dist/core/index.d.cts +3 -3
  9. package/dist/core/index.d.ts +3 -3
  10. package/dist/core/index.js +1 -1
  11. package/dist/core-BhuVN81r.cjs +11 -0
  12. package/dist/core-xn9USmBJ.js +11 -0
  13. package/dist/freeze-updates-BO5ajc-z.cjs +51 -0
  14. package/dist/freeze-updates-bDQWoAI1.js +51 -0
  15. package/dist/index-CTRX5ujF.d.ts +27 -0
  16. package/dist/index-D_u6ADO3.d.cts +27 -0
  17. package/dist/index.cjs +1 -1
  18. package/dist/index.d.cts +3 -3
  19. package/dist/index.d.ts +3 -3
  20. package/dist/index.global.js +16 -16
  21. package/dist/index.js +1 -1
  22. package/dist/primitives.cjs +2 -2
  23. package/dist/primitives.d.cts +1 -1
  24. package/dist/primitives.d.ts +1 -1
  25. package/dist/primitives.js +2 -2
  26. package/dist/{renderer-D9QhYh51.cjs → renderer-DzgGE4Yp.cjs} +2 -2
  27. package/dist/renderer-sKopdMTW.js +13 -0
  28. package/dist/styles.css +1 -1
  29. package/package.json +3 -3
  30. package/dist/action-shortcuts-DhpJOHLV.js +0 -9
  31. package/dist/copy-content-3pnWacho.d.cts +0 -218
  32. package/dist/copy-content-Bdbw0DFG.js +0 -9
  33. package/dist/copy-content-D3sfU8oN.cjs +0 -9
  34. package/dist/copy-content-DH6fBB50.d.ts +0 -218
  35. package/dist/core-BLw9XEeN.js +0 -11
  36. package/dist/core-kvq5wF90.cjs +0 -11
  37. package/dist/freeze-updates-Bj2Yd3Uy.cjs +0 -52
  38. package/dist/freeze-updates-DwcTZAwS.js +0 -52
  39. package/dist/renderer-CN3zPN8I.js +0 -13
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @license MIT
3
+ *
4
+ * Copyright (c) 2025 Aiden Bai
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
+ import{A as e,C as t,Ct as n,D as r,E as i,F as a,M as o,N as s,O as c,P as l,R as u,S as d,St as f,T as p,Tt as ee,j as m,jt as te,k as ne,kt as re,lt as ie,w as ae,wt as oe,x as se}from"./freeze-updates-bDQWoAI1.js";var h=class extends Error{constructor(e){super(e),this.name=`ReactGrabError`}},ce=class extends h{constructor(){super(`Can't generate CSS selector for non-element node type.`),this.name=`NonElementNodeError`}},le=class extends h{constructor(e){super(`Timeout: Can't find a unique selector after ${e}ms`),this.name=`SelectorTimeoutError`,this.timeoutMs=e}},ue=class extends h{constructor(){super(`Selector was not found.`),this.name=`SelectorNotFoundError`}},de=class extends h{constructor(){super(`Failed to copy`),this.name=`CopyFailedError`}};const g=e=>{try{return decodeURIComponent(e)}catch{return e}},fe=/(?:^|[/\\])node_modules[/\\]/,pe=/[/\\]\.vite[/\\]deps[^/\\]*[/\\]/,_=/\.[mc]?[jt]sx?$/i,me=/^chunk-[A-Za-z0-9_-]+$/,he=/[/\\]/,ge=/^(.+?)@v?\d/,v=e=>e.split(he).filter(Boolean),_e=e=>{let[t,n]=v(e);return!t||t.startsWith(`.`)?null:t.startsWith(`@`)?n?`${t}/${n}`:null:t},ve=e=>{let t=v(e)[0];if(!t)return null;let n=t.replace(_,``);if(me.test(n))return null;if(!n.startsWith(`@`))return n;let r=n.indexOf(`_`);return r===-1?null:`${n.slice(0,r)}/${n.slice(r+1)}`},y=(e,t,n)=>{let r=e.split(t);return r.length>1?n(r[r.length-1]):null},b=e=>e?.match(ge)?.[1]??null,ye=e=>{let t;try{t=new URL(e)}catch{return null}if(!t.hostname)return null;let n=v(t.pathname).map(g);for(let[e,t]of n.entries()){if(t.startsWith(`@`)){let r=b(n[e+1]);if(r)return`${t}/${r}`;continue}let r=b(t);if(r)return r}return null},be=e=>y(e,pe,ve)??y(e,fe,_e),xe=e=>{if(!e)return null;let t=c(e);return t&&(be(g(t))||ye(e))||null},Se=/^@[A-Za-z0-9][A-Za-z0-9._-]*$/,Ce=/^[A-Za-z0-9][A-Za-z0-9._-]*$/,we=new Set([`app`,`web`,`website`,`frontend`,`client`,`src`]),Te=new Set([`app`,`src`,`components`,`pages`,`features`,`modules`,`hooks`,`lib`,`utils`,`ui`,`shared`,`common`,`core`,`styles`,`assets`]),Ee=e=>{let t=e;for(;t.startsWith(`../`)||t.startsWith(`./`);)t=t.slice(t.startsWith(`../`)?3:2);return t},De=e=>{let t=Ee(g(c(e)));if(t.startsWith(`/`))return null;let[n,r,...i]=v(t);return!n||!r||i.length===0||!Se.test(n)||Te.has(n.slice(1))||!Ce.test(r)||_.test(r)||we.has(r)?null:`${n}/${r}`},Oe=e=>e?xe(e)??De(e):null,x=e=>{if(!e)return{origin:`unknown`,packageName:null};let t=Oe(e);return t?{origin:`package`,packageName:t}:i(e)?{origin:`app`,packageName:null}:{origin:`unknown`,packageName:null}},ke=new Set([`role`,`name`,`aria-label`,`rel`,`href`]),S=e=>{if(!/^[a-z-]{3,}$/i.test(e))return!1;let t=e.split(/-|[A-Z]/);for(let e of t)if(e.length<=2||/[^aeiou]{4,}/i.test(e))return!1;return!0},Ae=(e,t)=>{let n=ke.has(e)||e.startsWith(`data-`)&&S(e),r=S(t)&&t.length<100||t.startsWith(`#`)&&S(t.slice(1));return n&&r},C=e=>{let t=e[0].name;for(let n=1;n<e.length;n++)t=`${e[n].name} > ${t}`;return t},w=e=>{let t=0;for(let n of e)t+=n.penalty;return t},T=(e,t)=>w(e)-w(t),E=(e,t)=>{let n=e.parentNode;if(!n)return;let r=n.firstChild;if(!r)return;let i=0;for(;r&&(r instanceof Element&&(t===void 0||r.tagName.toLowerCase()===t)&&i++,r!==e);)r=r.nextSibling;return i},je=(e,t)=>e===`html`?`html`:`${e}:nth-child(${t})`,D=(e,t)=>e===`html`?`html`:`${e}:nth-of-type(${t})`,Me=(e,t)=>{let n=[],r=e.getAttribute(`id`),i=e.tagName.toLowerCase();r&&S(r)&&n.push({name:`#${CSS.escape(r)}`,penalty:0});for(let t of e.classList)S(t)&&n.push({name:`.${CSS.escape(t)}`,penalty:1});for(let r of e.attributes)t(r.name,r.value)&&n.push({name:`[${CSS.escape(r.name)}="${CSS.escape(r.value)}"]`,penalty:2});n.push({name:i,penalty:5});let a=E(e,i);a!==void 0&&n.push({name:D(i,a),penalty:10});let o=E(e);return o!==void 0&&n.push({name:je(i,o),penalty:50}),n},O=(e,t=ie,n=[])=>{if(t<=0)return[];if(e.length===0)return[n];let r=[];for(let i of e[0]){let a=t-r.length;if(a<=0)break;r.push(...O(e.slice(1),a,[...n,i]))}return r},Ne=(e,t)=>{let n=t.getRootNode?.();return n instanceof ShadowRoot?n:e instanceof Document?e:e.ownerDocument},k=(e,t)=>t.querySelectorAll(C(e)).length===1,Pe=(e,t)=>{let n=e,r=[];for(;n&&n!==t;){let e=n.tagName.toLowerCase(),t=E(n,e);if(t===void 0)return;r.push({name:D(e,t),penalty:10}),n=n.parentElement}return k(r,t)?r:void 0},Fe=(e,t,n,r)=>{if(e.nodeType!==Node.ELEMENT_NODE)throw new ce;if(e.tagName.toLowerCase()===`html`)return`html`;let i=Ne(t,e),a=Date.now(),o=[],s=e,c=0,l;for(;s&&s!==i&&!l;)if(o.push(Me(s,r)),s=s.parentElement,c++,c>=3){let t=O(o);t.sort(T);for(let r of t){if(Date.now()-a>n){let t=Pe(e,i);if(!t)throw new le(n);return C(t)}if(k(r,i)){l=r;break}}}if(!l&&c<3){let e=O(o);e.sort(T);for(let t of e){if(Date.now()-a>n)break;if(k(t,i)){l=t;break}}}if(!l)throw new ue;return C(l)},A=e=>e.ownerDocument.body??e.ownerDocument.documentElement,j=new Set([`data-testid`,`data-test-id`,`data-test`,`data-cy`,`data-qa`,`aria-label`,`href`,`src`,`role`,`name`,`title`,`alt`]),Ie=e=>e.length>0&&e.length<=120,M=(e,t)=>{try{let n=e.ownerDocument.querySelectorAll(t);return n.length===1&&n[0]===e}catch{return!1}},Le=e=>{if(e instanceof HTMLElement&&e.id){let t=`#${CSS.escape(e.id)}`;if(M(e,t))return t}for(let t of j){let n=e.getAttribute(t);if(!n||!Ie(n))continue;let r=`[${t}=${JSON.stringify(n)}]`;if(M(e,r))return r;let i=`${e.tagName.toLowerCase()}${r}`;if(M(e,i))return i}return null},Re=e=>{let t=[],n=A(e),r=e;for(;r;){if(r instanceof HTMLElement&&r.id){t.unshift(`#${CSS.escape(r.id)}`);break}let e=r.parentElement;if(!e){t.unshift(r.tagName.toLowerCase());break}let i=Array.from(e.children).indexOf(r)+1;if(t.unshift(`${r.tagName.toLowerCase()}:nth-child(${i})`),e===n){t.unshift(n.tagName.toLowerCase());break}r=e}return t.join(` > `)},N=e=>{let t=Le(e);if(t)return t;try{let t=Fe(e,A(e),200,(e,t)=>Ae(e,t)||j.has(e)&&Ie(t));if(t)return t}catch{}return Re(e)},P=[`about://React/`,`rsc://React/`],ze=e=>P.some(t=>e.startsWith(t)),Be=e=>{for(let t of P){if(!e.startsWith(t))continue;let n=e.indexOf(`/`,t.length);if(n===-1)continue;let r=n+1,i=e.lastIndexOf(`?`);return g(i>r?e.slice(r,i):e.slice(r))}return e},Ve=async e=>{let t=[],n=[];for(let r=0;r<e.length;r++){let i=e[r];!i.isServer||!i.fileName||(t.push(r),n.push({file:Be(i.fileName),methodName:i.functionName??`<unknown>`,line1:i.lineNumber??null,column1:i.columnNumber??null,arguments:[]}))}if(n.length===0)return e;let r=new AbortController,i=setTimeout(()=>r.abort(),re);try{let i=await fetch(`${se()}/__nextjs_original-stack-frames`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({frames:n,isServer:!0,isEdgeServer:!1,isAppDirectory:!0}),signal:r.signal});if(!i.ok)return e;let a=await i.json(),o=[...e];for(let n=0;n<t.length;n++){let r=a[n];if(r?.status!==`fulfilled`)continue;let i=r.value?.originalStackFrame;if(!i?.file||i.ignored)continue;let s=t[n];o[s]={...e[s],fileName:i.file,lineNumber:i.line1??void 0,columnNumber:i.column1??void 0,isSymbolicated:!0}}return o}catch{return e}finally{clearTimeout(i)}},He=t=>{let n=new Map;return m(t,t=>{if(!ne(t))return!1;let r=p(t._debugStack.stack);if(!r)return!1;for(let t of e(r))!t.functionName||!t.fileName||ze(t.fileName)&&(n.has(t.functionName)||n.set(t.functionName,{...t,isServer:!0}));return!1},!0),n},Ue=(e,t)=>{if(!t.some(e=>e.isServer&&!e.fileName&&e.functionName))return t;let n=He(e);return n.size===0?t:t.map(e=>{if(!e.isServer||e.fileName||!e.functionName)return e;let t=n.get(e.functionName);return t?{...e,fileName:t.fileName,lineNumber:t.lineNumber,columnNumber:t.columnNumber}:e})},F=(e,t)=>e.length>t?`${e.slice(0,t)}...`:e,We=e=>e.startsWith(`data-react-grab-`),I=e=>e.replace(/\s+/g,` `).trim(),Ge=e=>{let t=[];for(let n of e.childNodes){if(n.nodeType!==Node.TEXT_NODE)continue;let e=I(n.textContent??``);e&&t.push(e)}return t.join(` `)},L=e=>e.getAttribute(`aria-hidden`)===`true`||e.hasAttribute(`hidden`)?!0:ee.has(e.tagName.toLowerCase()),R=(e,t,n)=>{if(e.nodeType===Node.TEXT_NODE){let r=I(e.textContent??``);return r?(t.push(r),n-r.length):n}if(!(e instanceof Element)||L(e))return n;for(let r of e.childNodes)if(n=R(r,t,n),n<=0)break;return n},z=(e,t)=>{if(L(e))return``;let n=Ge(e);if(!f.has(t)||n&&e.children.length===0)return n;let r=[];return R(e,r,100),r.join(` `)},B=e=>F(e,15),Ke=e=>{let t=[];for(let n of oe){let r=e.getAttribute(n);r&&t.push(`${n}="${r}"`)}return t.length>0?` ${t.join(` `)}`:``},qe=e=>e===`class`||e===`className`||e===`style`,V=e=>{let t=[],r=[],i=``;for(let{name:a,value:o}of e.attributes)if(!We(a)){if(qe(a)){a!==`style`&&o&&(i=` class="${B(o)}"`);continue}n.has(a)?t.push(o?` ${a}="${o}"`:` ${a}`):o&&r.push(` ${a}="${B(o)}"`)}return t.join(``)+r.join(``)+i},H=e=>e.length===0?``:e.length<=2?e.map(e=>`<${u(e)} ...>`).join(`
10
+ `):`(${e.length} elements)`,Je=e=>{let t=u(e);if(!(e instanceof HTMLElement))return`<${t}${Ke(e)} />`;let n=V(e),r=F(z(e,t),100);return r?`<${t}${n}>${r}</${t}>`:`<${t}${n} />`},U=e=>{let t=u(e),n=V(e),r=z(e,t),i=[],a=[],o=!1;for(let t of e.childNodes)t.nodeType!==Node.COMMENT_NODE&&(t.nodeType===Node.TEXT_NODE?t.textContent&&t.textContent.trim().length>0&&(o=!0):t instanceof Element&&(o?a.push(t):i.push(t)));let s=r.length>0&&f.has(t),c=``,l=H(i);l&&!s&&(c+=`\n ${l}`),r&&(c+=`\n ${F(r,100)}`);let d=H(a);return d&&!s&&(c+=`\n ${d}`),c.length>0?`<${t}${n}>${c}\n</${t}>`:`<${t}${n} />`},Ye=new Set([`_`,`$`,`motion.`,`styled.`,`chakra.`,`ark.`,`Primitive.`,`Slot.`]),Xe=new Set(`AppRouter.AppRouterAnnouncer.AppDevOverlay.AppDevOverlayErrorBoundary.ClientPageRoot.ClientSegmentRoot.DevRootHTTPAccessFallbackBoundary.ErrorBoundary.ErrorBoundaryHandler.GracefulDegradeBoundary.HTTPAccessErrorFallback.HTTPAccessFallbackBoundary.HTTPAccessFallbackErrorBoundary.HandleRedirect.Head.HistoryUpdater.HotReload.InnerLayoutRouter.InnerScrollAndFocusHandler.InnerScrollAndFocusHandlerOld.InnerScrollAndMaybeFocusHandler.InnerScrollHandlerNew.LoadableComponent.LoadingBoundary.LoadingBoundaryProvider.NotAllowedRootHTTPFallbackError.OfflineProvider.OuterLayoutRouter.RedirectBoundary.RedirectErrorBoundary.RenderFromTemplateContext.RenderValidationBoundaryAtThisLevel.ReplaySsrOnlyErrors.RootErrorBoundary.RootLevelDevOverlayElement.Router.ScrollAndFocusHandler.ScrollAndMaybeFocusHandler.SegmentBoundaryTrigger.SegmentBoundaryTriggerNode.SegmentStateProvider.SegmentTrieNode.SegmentViewNode.SegmentViewStateNode.ServerRoot.body.html`.split(`.`)),Ze=new Set([`Suspense`,`Fragment`,`StrictMode`,`Profiler`,`SuspenseList`]),Qe=new Set([`MotionDOMComponent`]),W=e=>{if(Xe.has(e)||Ze.has(e)||Qe.has(e))return!0;for(let t of Ye)if(e.startsWith(t))return!0;return!1},$e=e=>!(!e||W(e)||e===`SlotClone`||e===`Slot`),et=e=>!(e.length<=1||W(e)||e[0]!==e[0].toUpperCase()||e.endsWith(`Provider`)||e.endsWith(`Context`)),G=e=>e&&et(e)?e:null,K=e=>{if(!o())return e;let t=e;for(;t;){if(l(t))return t;t=t.parentElement}return e},q=new WeakMap,J=new WeakMap,tt=async e=>{try{let t=l(e);if(!t)return null;let n=await r(t);return d()?await Ve(Ue(t,n)):n}catch{return null}},Y=e=>{if(!o())return Promise.resolve([]);let t=K(e),n=q.get(t);if(n)return n;let r=tt(t);return q.set(t,r),r},nt=async e=>{if(!o())return null;let t=await Y(e);if(!t)return null;for(let e of t){let t=G(e.functionName);if(t)return t}return null},rt=e=>e.find(e=>!!G(e.functionName))??e[0]??null,it=e=>!e||!a(e)?null:G(s(e.type)),at=async e=>{let n=l(K(e));if(!n)return null;try{let e=await ae(n);return e?.fileName?{filePath:t(e.fileName),lineNumber:e.lineNumber??null,columnNumber:e.columnNumber??null,componentName:G(e.functionName)??it(n._debugOwner),origin:x(e.fileName).origin}:null}catch{return null}},X=e=>{let t=K(e),n=J.get(t);if(n)return n;let r=at(t).then(e=>(e||J.delete(t),e));return J.set(t,r),r},ot=[`app`,`package`],st=(e,n)=>{for(let r of ot){if(e?.origin===r)return e;let i=rt(n.filter(e=>x(e.fileName).origin===r));if(i?.fileName)return{filePath:t(i.fileName),lineNumber:i.lineNumber??null,columnNumber:i.columnNumber??null,componentName:G(i.functionName),origin:r}}return null},ct=async e=>{let t=await X(e);return t?.origin===`app`?t:st(t,await Y(e)??[])},lt=e=>Z(K(e),1)[0]??null,Z=(e,t)=>{if(!o())return[];let n=l(e);if(!n)return[];let r=[];return m(n,e=>{if(r.length>=t)return!0;if(a(e)){let t=s(e.type);t&&$e(t)&&r.push(t)}return!1},!0),r},ut=[`/src/app/`,`/src/pages/`,`/app/`,`/pages/`],dt=(e,n)=>{let r=t(e);if(!n||!r.startsWith(`/`))return r;for(let e of ut){let t=r.indexOf(e);if(t!==-1)return`/./${r.slice(t+1)}`}return r},Q=(e,t)=>{let n=dt(e.filePath,t),r=t&&e.lineNumber?`${n}:${e.lineNumber}${e.columnNumber?`:${e.columnNumber}`:``}`:n;return e.componentName?`\n in ${e.componentName} (at ${r})`:`\n in ${r}`},ft=(e,t,n,r)=>{let i=t.packageName,a=t.origin===`app`?e.fileName:null;if(e.isServer&&!a&&(n||!e.functionName)){let e=i?`${i} at Server`:`at Server`;return{text:`\n in ${n??`<anonymous>`} (${e})`,isTrustedSource:!1}}return!a&&n?{text:i?`\n in ${n} (${i})`:`\n in ${n}`,isTrustedSource:!1}:i?{text:`\n in ${i}`,isTrustedSource:!1}:a?{text:Q({componentName:n,filePath:a,lineNumber:e.lineNumber??null,columnNumber:e.columnNumber??null},r),isTrustedSource:!0}:null},pt=(e,t={},n=null)=>{let{maxLines:r=3}=t,i=Math.max(r,20),a=d(),o=[],s=null,c=!1,l=!1,u=0;n&&(l=n.origin===`app`,u+=1,o.push(Q(n,a)));for(let t of e){if(u>=r||o.length>=i)break;let e=x(t.fileName),d=G(t.functionName),f=e.packageName?`${e.packageName}:${d??``}:${t.isServer?`server`:`client`}`:null;if(f&&f===s)continue;if(!c&&d&&d===n?.componentName){c=!0;continue}let p=ft(t,e,d,a);p!==null&&(p.isTrustedSource&&(l=!0,u+=1),o.push(p.text),s=f)}return{text:o.join(``),shouldAppendSelectorHint:!l}},mt=async e=>{let t=await X(e);return t?.origin===`app`?t:null},$=async(e,t={})=>{let n=await mt(e),r=pt(await Y(e)??[],t,n);if(r.text)return r;let i=Z(K(e),t.maxLines??3);return i.length>0?{text:i.map(e=>`\n in ${e}`).join(``),shouldAppendSelectorHint:!0}:{text:``,shouldAppendSelectorHint:!0}},ht=async(e,t={})=>(await $(e,t)).text,gt=(e,t)=>{let n=t.shouldAppendSelectorHint?`\n selector: ${N(e)}`:``;return`${t.text}${n}`},_t=async(e,t={})=>{let n=await $(e,t);return`${Je(e)}${gt(e,n).replace(/\n\s+/g,` `)}`},vt=async(e,t={})=>{let n=K(e);return`${U(n)}${gt(n,await $(n,t))}`},yt=e=>e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`),bt=(e,t)=>{let n=t?.componentName??`div`,r={version:te,content:e,entries:t?.entries??[{tagName:t?.tagName,componentName:n,content:e,commentText:t?.commentText}],timestamp:Date.now()},i=t=>{t.preventDefault(),t.clipboardData?.setData(`text/plain`,e),t.clipboardData?.setData(`text/html`,`<meta charset='utf-8'><pre><code>${yt(e)}</code></pre>`),t.clipboardData?.setData(`application/x-react-grab`,JSON.stringify(r))};document.addEventListener(`copy`,i);let a=document.createElement(`textarea`);a.value=e,a.style.position=`fixed`,a.style.left=`-9999px`,a.ariaHidden=`true`,document.body.appendChild(a),a.select();try{return typeof document.execCommand==`function`?document.execCommand(`copy`):!1}finally{document.removeEventListener(`copy`,i),a.remove()}};export{nt as a,ct as c,de as d,_t as i,U as l,vt as n,Y as o,lt as r,ht as s,bt as t,N as u};
@@ -6,8 +6,6 @@
6
6
  * This source code is licensed under the MIT license found in the
7
7
  * LICENSE file in the root directory of this source tree.
8
8
  */
9
- import { n as StackFrame } from "./copy-content-DH6fBB50.js";
10
-
11
9
  //#region ../../node_modules/.pnpm/solid-js@1.9.12/node_modules/solid-js/types/reactive/observable.d.ts
12
10
  declare global {
13
11
  interface SymbolConstructor {
@@ -456,24 +454,228 @@ interface DragRect {
456
454
  width: number;
457
455
  height: number;
458
456
  }
459
- //#endregion
460
- //#region src/core/context.d.ts
461
- declare const getStack: (element: Element) => Promise<StackFrame[] | null>;
462
- interface StackContextOptions {
463
- maxLines?: number;
457
+ interface SourceLocation extends SourceInfo {
458
+ columnNumber: number | null;
459
+ }
460
+ interface ReactGrabStackFrame {
461
+ functionName?: string;
462
+ fileName?: string;
463
+ lineNumber?: number;
464
+ columnNumber?: number;
465
+ isServer?: boolean;
466
+ isSymbolicated?: boolean;
467
+ }
468
+ interface ReactGrabEntry {
469
+ tagName?: string;
470
+ componentName?: string;
471
+ content: string;
472
+ commentText?: string;
473
+ source?: SourceLocation | null;
474
+ stackContext?: string;
475
+ frames?: ReactGrabStackFrame[];
464
476
  }
465
- declare const getElementContext: (element: Element, options?: StackContextOptions) => Promise<string>;
466
477
  //#endregion
467
- //#region src/core/theme.d.ts
468
- declare const DEFAULT_THEME: Required<Theme>;
478
+ //#region ../../node_modules/.pnpm/bippy@0.5.41_react@19.2.6/node_modules/bippy/dist/core.d.ts
479
+ type Flags = number;
480
+ type Lanes = number;
481
+ type TypeOfMode = number;
482
+ type WorkTag = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31;
483
+ type HookType = "useState" | "useReducer" | "useContext" | "useRef" | "useEffect" | "useLayoutEffect" | "useCallback" | "useMemo" | "useImperativeHandle" | "useDebugValue" | "useDeferredValue" | "useTransition" | "useMutableSource" | "useOpaqueIdentifier" | "useCacheRefresh";
484
+ type FiberRoot = any;
485
+ interface Source {
486
+ fileName: string;
487
+ lineNumber: number;
488
+ }
489
+ interface RefObject {
490
+ current: any;
491
+ }
492
+ interface ReactContext<T> {
493
+ $$typeof: symbol | number;
494
+ Consumer: ReactContext<T>;
495
+ Provider: ReactProviderType<T>;
496
+ _calculateChangedBits: ((a: T, b: T) => number) | null;
497
+ _currentValue: T;
498
+ _currentValue2: T;
499
+ _threadCount: number;
500
+ _currentRenderer?: Record<string, any> | null;
501
+ _currentRenderer2?: Record<string, any> | null;
502
+ displayName?: string;
503
+ }
504
+ interface ReactProviderType<T> {
505
+ $$typeof: symbol | number;
506
+ _context: ReactContext<T>;
507
+ }
508
+ interface ReactFiber {
509
+ tag: WorkTag;
510
+ key: null | string;
511
+ elementType: any;
512
+ type: any;
513
+ stateNode: any;
514
+ return: ReactFiber | null;
515
+ child: ReactFiber | null;
516
+ sibling: ReactFiber | null;
517
+ index: number;
518
+ ref: null | (((handle: unknown) => void) & {
519
+ _stringRef?: string | null;
520
+ }) | RefObject;
521
+ pendingProps: any;
522
+ memoizedProps: any;
523
+ updateQueue: unknown;
524
+ memoizedState: any;
525
+ dependencies: Dependencies | null;
526
+ mode: TypeOfMode;
527
+ flags: Flags;
528
+ subtreeFlags: Flags;
529
+ deletions: ReactFiber[] | null;
530
+ nextEffect: ReactFiber | null;
531
+ firstEffect: ReactFiber | null;
532
+ lastEffect: ReactFiber | null;
533
+ lanes: Lanes;
534
+ childLanes: Lanes;
535
+ alternate: ReactFiber | null;
536
+ actualDuration?: number;
537
+ actualStartTime?: number;
538
+ selfBaseDuration?: number;
539
+ treeBaseDuration?: number;
540
+ _debugID?: number;
541
+ _debugSource?: Source | null;
542
+ _debugOwner?: ReactFiber | null;
543
+ _debugIsCurrentlyTiming?: boolean;
544
+ _debugNeedsRemount?: boolean;
545
+ _debugHookTypes?: HookType[] | null;
546
+ }
547
+ interface ContextDependency<T> {
548
+ context: ReactContext<T>;
549
+ memoizedValue: T;
550
+ next: ContextDependency<unknown> | null;
551
+ observedBits: number;
552
+ }
553
+ interface Dependencies {
554
+ firstContext: ContextDependency<unknown> | null;
555
+ lanes: Lanes;
556
+ }
557
+ interface Effect {
558
+ [key: string]: unknown;
559
+ create: (...args: unknown[]) => unknown;
560
+ deps: null | unknown[];
561
+ destroy: ((...args: unknown[]) => unknown) | null;
562
+ next: Effect | null;
563
+ tag: number;
564
+ }
565
+ interface Family {
566
+ current: unknown;
567
+ }
568
+ /**
569
+ * Represents a react-internal Fiber node.
570
+ */
571
+ type Fiber<T = any> = Omit<ReactFiber, "alternate" | "child" | "dependencies" | "memoizedProps" | "memoizedState" | "pendingProps" | "return" | "sibling" | "stateNode" | "updateQueue"> & {
572
+ _debugInfo?: Array<{
573
+ debugLocation?: unknown;
574
+ env?: string;
575
+ name?: string;
576
+ }>;
577
+ _debugOwner?: Fiber;
578
+ _debugSource?: {
579
+ columnNumber?: number;
580
+ fileName: string;
581
+ lineNumber: number;
582
+ };
583
+ _debugStack?: Error & {
584
+ stack: string;
585
+ };
586
+ alternate: Fiber | null;
587
+ child: Fiber | null;
588
+ dependencies: Dependencies | null;
589
+ memoizedProps: Props;
590
+ memoizedState: MemoizedState;
591
+ pendingProps: Props;
592
+ return: Fiber | null;
593
+ sibling: Fiber | null;
594
+ stateNode: T;
595
+ updateQueue: {
596
+ [key: string]: unknown;
597
+ lastEffect: Effect | null;
598
+ };
599
+ };
600
+ interface MemoizedState {
601
+ [key: string]: unknown;
602
+ memoizedState: unknown;
603
+ next: MemoizedState | null;
604
+ }
605
+ interface Props {
606
+ [key: string]: unknown;
607
+ }
608
+ interface ReactDevToolsGlobalHook {
609
+ _instrumentationIsActive?: boolean;
610
+ _instrumentationSource?: string;
611
+ checkDCE: (fn: unknown) => void;
612
+ hasUnsupportedRendererAttached: boolean;
613
+ inject: (renderer: ReactRenderer) => number;
614
+ on: () => void;
615
+ onCommitFiberRoot: (rendererID: number, root: FiberRoot, priority: number | void) => void;
616
+ onCommitFiberUnmount: (rendererID: number, fiber: Fiber) => void;
617
+ onPostCommitFiberRoot: (rendererID: number, root: FiberRoot) => void;
618
+ renderers: Map<number, ReactRenderer>;
619
+ supportsFiber: boolean;
620
+ supportsFlight: boolean;
621
+ }
622
+ interface ReactRenderer {
623
+ bundleType: 0 | 1;
624
+ currentDispatcherRef: any;
625
+ findFiberByHostInstance?: (hostInstance: unknown) => Fiber | null;
626
+ getCurrentFiber?: (fiber: Fiber) => Fiber | null;
627
+ overrideContext?: (fiber: Fiber, contextType: unknown, path: string[], value: unknown) => void;
628
+ overrideHookState?: (fiber: Fiber, id: string, path: string[], value: unknown) => void;
629
+ overrideHookStateDeletePath?: (fiber: Fiber, id: number, path: Array<number | string>) => void;
630
+ overrideHookStateRenamePath?: (fiber: Fiber, id: number, oldPath: Array<number | string>, newPath: Array<number | string>) => void;
631
+ overrideProps?: (fiber: Fiber, path: string[], value: unknown) => void;
632
+ overridePropsDeletePath?: (fiber: Fiber, path: Array<number | string>) => void;
633
+ overridePropsRenamePath?: (fiber: Fiber, oldPath: Array<number | string>, newPath: Array<number | string>) => void;
634
+ reconcilerVersion: string;
635
+ rendererPackageName: string;
636
+ scheduleRefresh?: (root: FiberRoot, update: {
637
+ staleFamilies: Set<Family>;
638
+ updatedFamilies: Set<Family>;
639
+ }) => void;
640
+ scheduleRoot?: (root: FiberRoot, element: React.ReactNode) => void;
641
+ scheduleUpdate?: (fiber: Fiber) => void;
642
+ setErrorHandler?: (newShouldErrorImpl: (fiber: Fiber) => boolean) => void;
643
+ setRefreshHandler?: (handler: ((fiber: Fiber) => Family | null) | null) => void;
644
+ setSuspenseHandler?: (newShouldSuspendImpl: (suspenseInstance: unknown) => void) => void;
645
+ version: string;
646
+ }
647
+ declare global {
648
+ var __REACT_DEVTOOLS_GLOBAL_HOOK__: ReactDevToolsGlobalHook | undefined;
649
+ } //#endregion
650
+ //#region src/rdt-hook.d.ts
651
+ /**
652
+ * Returns `true` if bippy's instrumentation is active.
653
+ */
654
+ declare const isInstrumentationActive: () => boolean;
655
+ /**
656
+ * Returns the latest fiber (since it may be double-buffered).
657
+ */
469
658
  //#endregion
470
- //#region src/utils/generate-snippet.d.ts
471
- interface GenerateSnippetOptions {
472
- maxLines?: number;
659
+ //#region ../../node_modules/.pnpm/bippy@0.5.41_react@19.2.6/node_modules/bippy/dist/source.d.ts
660
+ //#region src/source/parse-stack.d.ts
661
+ interface StackFrame {
662
+ args?: unknown[];
663
+ columnNumber?: number;
664
+ lineNumber?: number;
665
+ fileName?: string;
666
+ functionName?: string;
667
+ source?: string;
668
+ isServer?: boolean;
669
+ isSymbolicated?: boolean;
473
670
  }
474
- declare const generateSnippet: (elements: Element[], options?: GenerateSnippetOptions) => Promise<string[]>;
475
671
  //#endregion
476
- //#region src/core/index.d.ts
477
- declare const init: (rawOptions?: Options) => ReactGrabAPI;
672
+ //#region src/utils/copy-content.d.ts
673
+ interface CopyContentOptions {
674
+ componentName?: string;
675
+ tagName?: string;
676
+ commentText?: string;
677
+ entries?: ReactGrabEntry[];
678
+ }
679
+ declare const copyContent: (content: string, options?: CopyContentOptions) => boolean;
478
680
  //#endregion
479
- export { Theme as A, PromptModeContext as C, Rect as D, ReactGrabState as E, SettableOptions as O, Position as S, ReactGrabRendererProps as T, Options as _, getStack as a, PluginConfig as b, ActivationMode as c, ContextMenuActionContext as d, DeepPartial as f, GrabbedBox as g, ElementLabelVariant as h, getElementContext as i, ToolbarState as j, SourceInfo as k, AgentContext as l, ElementLabelContext as m, generateSnippet as n, ActionContext as o, DragRect as p, DEFAULT_THEME as r, ActionContextHooks as s, init as t, ContextMenuAction as u, OverlayBounds as v, ReactGrabAPI as w, PluginHooks as x, Plugin as y };
681
+ export { ToolbarState as A, ReactGrabAPI as C, SettableOptions as D, Rect as E, SourceInfo as O, PromptModeContext as S, ReactGrabState as T, OverlayBounds as _, ActionContext as a, PluginHooks as b, AgentContext as c, DeepPartial as d, DragRect as f, Options as g, GrabbedBox as h, isInstrumentationActive as i, Theme as k, ContextMenuAction as l, ElementLabelVariant as m, StackFrame as n, ActionContextHooks as o, ElementLabelContext as p, Fiber as r, ActivationMode as s, copyContent as t, ContextMenuActionContext as u, Plugin as v, ReactGrabRendererProps as w, Position as x, PluginConfig as y };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @license MIT
3
+ *
4
+ * Copyright (c) 2025 Aiden Bai
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
+ const e=require(`./freeze-updates-BO5ajc-z.cjs`);var t=class extends Error{constructor(e){super(e),this.name=`ReactGrabError`}},n=class extends t{constructor(){super(`Can't generate CSS selector for non-element node type.`),this.name=`NonElementNodeError`}},r=class extends t{constructor(e){super(`Timeout: Can't find a unique selector after ${e}ms`),this.name=`SelectorTimeoutError`,this.timeoutMs=e}},i=class extends t{constructor(){super(`Selector was not found.`),this.name=`SelectorNotFoundError`}},a=class extends t{constructor(){super(`Failed to copy`),this.name=`CopyFailedError`}};const o=e=>{try{return decodeURIComponent(e)}catch{return e}},s=/(?:^|[/\\])node_modules[/\\]/,c=/[/\\]\.vite[/\\]deps[^/\\]*[/\\]/,l=/\.[mc]?[jt]sx?$/i,u=/^chunk-[A-Za-z0-9_-]+$/,d=/[/\\]/,f=/^(.+?)@v?\d/,p=e=>e.split(d).filter(Boolean),ee=e=>{let[t,n]=p(e);return!t||t.startsWith(`.`)?null:t.startsWith(`@`)?n?`${t}/${n}`:null:t},te=e=>{let t=p(e)[0];if(!t)return null;let n=t.replace(l,``);if(u.test(n))return null;if(!n.startsWith(`@`))return n;let r=n.indexOf(`_`);return r===-1?null:`${n.slice(0,r)}/${n.slice(r+1)}`},m=(e,t,n)=>{let r=e.split(t);return r.length>1?n(r[r.length-1]):null},h=e=>e?.match(f)?.[1]??null,ne=e=>{let t;try{t=new URL(e)}catch{return null}if(!t.hostname)return null;let n=p(t.pathname).map(o);for(let[e,t]of n.entries()){if(t.startsWith(`@`)){let r=h(n[e+1]);if(r)return`${t}/${r}`;continue}let r=h(t);if(r)return r}return null},re=e=>m(e,c,te)??m(e,s,ee),ie=t=>{if(!t)return null;let n=e.O(t);return n&&(re(o(n))||ne(t))||null},ae=/^@[A-Za-z0-9][A-Za-z0-9._-]*$/,oe=/^[A-Za-z0-9][A-Za-z0-9._-]*$/,se=new Set([`app`,`web`,`website`,`frontend`,`client`,`src`]),ce=new Set([`app`,`src`,`components`,`pages`,`features`,`modules`,`hooks`,`lib`,`utils`,`ui`,`shared`,`common`,`core`,`styles`,`assets`]),le=e=>{let t=e;for(;t.startsWith(`../`)||t.startsWith(`./`);)t=t.slice(t.startsWith(`../`)?3:2);return t},ue=t=>{let n=le(o(e.O(t)));if(n.startsWith(`/`))return null;let[r,i,...a]=p(n);return!r||!i||a.length===0||!ae.test(r)||ce.has(r.slice(1))||!oe.test(i)||l.test(i)||se.has(i)?null:`${r}/${i}`},de=e=>e?ie(e)??ue(e):null,g=t=>{if(!t)return{origin:`unknown`,packageName:null};let n=de(t);return n?{origin:`package`,packageName:n}:e.E(t)?{origin:`app`,packageName:null}:{origin:`unknown`,packageName:null}},fe=new Set([`role`,`name`,`aria-label`,`rel`,`href`]),_=e=>{if(!/^[a-z-]{3,}$/i.test(e))return!1;let t=e.split(/-|[A-Z]/);for(let e of t)if(e.length<=2||/[^aeiou]{4,}/i.test(e))return!1;return!0},pe=(e,t)=>{let n=fe.has(e)||e.startsWith(`data-`)&&_(e),r=_(t)&&t.length<100||t.startsWith(`#`)&&_(t.slice(1));return n&&r},v=e=>{let t=e[0].name;for(let n=1;n<e.length;n++)t=`${e[n].name} > ${t}`;return t},y=e=>{let t=0;for(let n of e)t+=n.penalty;return t},b=(e,t)=>y(e)-y(t),x=(e,t)=>{let n=e.parentNode;if(!n)return;let r=n.firstChild;if(!r)return;let i=0;for(;r&&(r instanceof Element&&(t===void 0||r.tagName.toLowerCase()===t)&&i++,r!==e);)r=r.nextSibling;return i},me=(e,t)=>e===`html`?`html`:`${e}:nth-child(${t})`,S=(e,t)=>e===`html`?`html`:`${e}:nth-of-type(${t})`,he=(e,t)=>{let n=[],r=e.getAttribute(`id`),i=e.tagName.toLowerCase();r&&_(r)&&n.push({name:`#${CSS.escape(r)}`,penalty:0});for(let t of e.classList)_(t)&&n.push({name:`.${CSS.escape(t)}`,penalty:1});for(let r of e.attributes)t(r.name,r.value)&&n.push({name:`[${CSS.escape(r.name)}="${CSS.escape(r.value)}"]`,penalty:2});n.push({name:i,penalty:5});let a=x(e,i);a!==void 0&&n.push({name:S(i,a),penalty:10});let o=x(e);return o!==void 0&&n.push({name:me(i,o),penalty:50}),n},C=(t,n=e.lt,r=[])=>{if(n<=0)return[];if(t.length===0)return[r];let i=[];for(let e of t[0]){let a=n-i.length;if(a<=0)break;i.push(...C(t.slice(1),a,[...r,e]))}return i},ge=(e,t)=>{let n=t.getRootNode?.();return n instanceof ShadowRoot?n:e instanceof Document?e:e.ownerDocument},w=(e,t)=>t.querySelectorAll(v(e)).length===1,_e=(e,t)=>{let n=e,r=[];for(;n&&n!==t;){let e=n.tagName.toLowerCase(),t=x(n,e);if(t===void 0)return;r.push({name:S(e,t),penalty:10}),n=n.parentElement}return w(r,t)?r:void 0},ve=(e,t,a,o)=>{if(e.nodeType!==Node.ELEMENT_NODE)throw new n;if(e.tagName.toLowerCase()===`html`)return`html`;let s=ge(t,e),c=Date.now(),l=[],u=e,d=0,f;for(;u&&u!==s&&!f;)if(l.push(he(u,o)),u=u.parentElement,d++,d>=3){let t=C(l);t.sort(b);for(let n of t){if(Date.now()-c>a){let t=_e(e,s);if(!t)throw new r(a);return v(t)}if(w(n,s)){f=n;break}}}if(!f&&d<3){let e=C(l);e.sort(b);for(let t of e){if(Date.now()-c>a)break;if(w(t,s)){f=t;break}}}if(!f)throw new i;return v(f)},T=e=>e.ownerDocument.body??e.ownerDocument.documentElement,E=new Set([`data-testid`,`data-test-id`,`data-test`,`data-cy`,`data-qa`,`aria-label`,`href`,`src`,`role`,`name`,`title`,`alt`]),D=e=>e.length>0&&e.length<=120,O=(e,t)=>{try{let n=e.ownerDocument.querySelectorAll(t);return n.length===1&&n[0]===e}catch{return!1}},ye=e=>{if(e instanceof HTMLElement&&e.id){let t=`#${CSS.escape(e.id)}`;if(O(e,t))return t}for(let t of E){let n=e.getAttribute(t);if(!n||!D(n))continue;let r=`[${t}=${JSON.stringify(n)}]`;if(O(e,r))return r;let i=`${e.tagName.toLowerCase()}${r}`;if(O(e,i))return i}return null},be=e=>{let t=[],n=T(e),r=e;for(;r;){if(r instanceof HTMLElement&&r.id){t.unshift(`#${CSS.escape(r.id)}`);break}let e=r.parentElement;if(!e){t.unshift(r.tagName.toLowerCase());break}let i=Array.from(e.children).indexOf(r)+1;if(t.unshift(`${r.tagName.toLowerCase()}:nth-child(${i})`),e===n){t.unshift(n.tagName.toLowerCase());break}r=e}return t.join(` > `)},k=e=>{let t=ye(e);if(t)return t;try{let t=ve(e,T(e),200,(e,t)=>pe(e,t)||E.has(e)&&D(t));if(t)return t}catch{}return be(e)},A=[`about://React/`,`rsc://React/`],xe=e=>A.some(t=>e.startsWith(t)),j=e=>{for(let t of A){if(!e.startsWith(t))continue;let n=e.indexOf(`/`,t.length);if(n===-1)continue;let r=n+1,i=e.lastIndexOf(`?`);return o(i>r?e.slice(r,i):e.slice(r))}return e},M=async t=>{let n=[],r=[];for(let e=0;e<t.length;e++){let i=t[e];!i.isServer||!i.fileName||(n.push(e),r.push({file:j(i.fileName),methodName:i.functionName??`<unknown>`,line1:i.lineNumber??null,column1:i.columnNumber??null,arguments:[]}))}if(r.length===0)return t;let i=new AbortController,a=setTimeout(()=>i.abort(),e.kt);try{let a=await fetch(`${e.x()}/__nextjs_original-stack-frames`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({frames:r,isServer:!0,isEdgeServer:!1,isAppDirectory:!0}),signal:i.signal});if(!a.ok)return t;let o=await a.json(),s=[...t];for(let e=0;e<n.length;e++){let r=o[e];if(r?.status!==`fulfilled`)continue;let i=r.value?.originalStackFrame;if(!i?.file||i.ignored)continue;let a=n[e];s[a]={...t[a],fileName:i.file,lineNumber:i.line1??void 0,columnNumber:i.column1??void 0,isSymbolicated:!0}}return s}catch{return t}finally{clearTimeout(a)}},Se=t=>{let n=new Map;return e.j(t,t=>{if(!e.k(t))return!1;let r=e.T(t._debugStack.stack);if(!r)return!1;for(let t of e.A(r))!t.functionName||!t.fileName||xe(t.fileName)&&(n.has(t.functionName)||n.set(t.functionName,{...t,isServer:!0}));return!1},!0),n},Ce=(e,t)=>{if(!t.some(e=>e.isServer&&!e.fileName&&e.functionName))return t;let n=Se(e);return n.size===0?t:t.map(e=>{if(!e.isServer||e.fileName||!e.functionName)return e;let t=n.get(e.functionName);return t?{...e,fileName:t.fileName,lineNumber:t.lineNumber,columnNumber:t.columnNumber}:e})},N=(e,t)=>e.length>t?`${e.slice(0,t)}...`:e,we=e=>e.startsWith(`data-react-grab-`),P=e=>e.replace(/\s+/g,` `).trim(),Te=e=>{let t=[];for(let n of e.childNodes){if(n.nodeType!==Node.TEXT_NODE)continue;let e=P(n.textContent??``);e&&t.push(e)}return t.join(` `)},F=t=>t.getAttribute(`aria-hidden`)===`true`||t.hasAttribute(`hidden`)?!0:e.Tt.has(t.tagName.toLowerCase()),I=(e,t,n)=>{if(e.nodeType===Node.TEXT_NODE){let r=P(e.textContent??``);return r?(t.push(r),n-r.length):n}if(!(e instanceof Element)||F(e))return n;for(let r of e.childNodes)if(n=I(r,t,n),n<=0)break;return n},L=(t,n)=>{if(F(t))return``;let r=Te(t);if(!e.St.has(n)||r&&t.children.length===0)return r;let i=[];return I(t,i,100),i.join(` `)},R=e=>N(e,15),Ee=t=>{let n=[];for(let r of e.wt){let e=t.getAttribute(r);e&&n.push(`${r}="${e}"`)}return n.length>0?` ${n.join(` `)}`:``},De=e=>e===`class`||e===`className`||e===`style`,z=t=>{let n=[],r=[],i=``;for(let{name:a,value:o}of t.attributes)if(!we(a)){if(De(a)){a!==`style`&&o&&(i=` class="${R(o)}"`);continue}e.Ct.has(a)?n.push(o?` ${a}="${o}"`:` ${a}`):o&&r.push(` ${a}="${R(o)}"`)}return n.join(``)+r.join(``)+i},B=t=>t.length===0?``:t.length<=2?t.map(t=>`<${e.R(t)} ...>`).join(`
10
+ `):`(${t.length} elements)`,Oe=t=>{let n=e.R(t);if(!(t instanceof HTMLElement))return`<${n}${Ee(t)} />`;let r=z(t),i=N(L(t,n),100);return i?`<${n}${r}>${i}</${n}>`:`<${n}${r} />`},V=t=>{let n=e.R(t),r=z(t),i=L(t,n),a=[],o=[],s=!1;for(let e of t.childNodes)e.nodeType!==Node.COMMENT_NODE&&(e.nodeType===Node.TEXT_NODE?e.textContent&&e.textContent.trim().length>0&&(s=!0):e instanceof Element&&(s?o.push(e):a.push(e)));let c=i.length>0&&e.St.has(n),l=``,u=B(a);u&&!c&&(l+=`\n ${u}`),i&&(l+=`\n ${N(i,100)}`);let d=B(o);return d&&!c&&(l+=`\n ${d}`),l.length>0?`<${n}${r}>${l}\n</${n}>`:`<${n}${r} />`},ke=new Set([`_`,`$`,`motion.`,`styled.`,`chakra.`,`ark.`,`Primitive.`,`Slot.`]),Ae=new Set(`AppRouter.AppRouterAnnouncer.AppDevOverlay.AppDevOverlayErrorBoundary.ClientPageRoot.ClientSegmentRoot.DevRootHTTPAccessFallbackBoundary.ErrorBoundary.ErrorBoundaryHandler.GracefulDegradeBoundary.HTTPAccessErrorFallback.HTTPAccessFallbackBoundary.HTTPAccessFallbackErrorBoundary.HandleRedirect.Head.HistoryUpdater.HotReload.InnerLayoutRouter.InnerScrollAndFocusHandler.InnerScrollAndFocusHandlerOld.InnerScrollAndMaybeFocusHandler.InnerScrollHandlerNew.LoadableComponent.LoadingBoundary.LoadingBoundaryProvider.NotAllowedRootHTTPFallbackError.OfflineProvider.OuterLayoutRouter.RedirectBoundary.RedirectErrorBoundary.RenderFromTemplateContext.RenderValidationBoundaryAtThisLevel.ReplaySsrOnlyErrors.RootErrorBoundary.RootLevelDevOverlayElement.Router.ScrollAndFocusHandler.ScrollAndMaybeFocusHandler.SegmentBoundaryTrigger.SegmentBoundaryTriggerNode.SegmentStateProvider.SegmentTrieNode.SegmentViewNode.SegmentViewStateNode.ServerRoot.body.html`.split(`.`)),je=new Set([`Suspense`,`Fragment`,`StrictMode`,`Profiler`,`SuspenseList`]),Me=new Set([`MotionDOMComponent`]),H=e=>{if(Ae.has(e)||je.has(e)||Me.has(e))return!0;for(let t of ke)if(e.startsWith(t))return!0;return!1},Ne=e=>!(!e||H(e)||e===`SlotClone`||e===`Slot`),Pe=e=>!(e.length<=1||H(e)||e[0]!==e[0].toUpperCase()||e.endsWith(`Provider`)||e.endsWith(`Context`)),U=e=>e&&Pe(e)?e:null,W=t=>{if(!e.M())return t;let n=t;for(;n;){if(e.P(n))return n;n=n.parentElement}return t},G=new WeakMap,K=new WeakMap,Fe=async t=>{try{let n=e.P(t);if(!n)return null;let r=await e.D(n);return e.S()?await M(Ce(n,r)):r}catch{return null}},q=t=>{if(!e.M())return Promise.resolve([]);let n=W(t),r=G.get(n);if(r)return r;let i=Fe(n);return G.set(n,i),i},Ie=async t=>{if(!e.M())return null;let n=await q(t);if(!n)return null;for(let e of n){let t=U(e.functionName);if(t)return t}return null},Le=e=>e.find(e=>!!U(e.functionName))??e[0]??null,Re=t=>!t||!e.F(t)?null:U(e.N(t.type)),ze=async t=>{let n=e.P(W(t));if(!n)return null;try{let t=await e.w(n);return t?.fileName?{filePath:e.C(t.fileName),lineNumber:t.lineNumber??null,columnNumber:t.columnNumber??null,componentName:U(t.functionName)??Re(n._debugOwner),origin:g(t.fileName).origin}:null}catch{return null}},J=e=>{let t=W(e),n=K.get(t);if(n)return n;let r=ze(t).then(e=>(e||K.delete(t),e));return K.set(t,r),r},Be=[`app`,`package`],Ve=(t,n)=>{for(let r of Be){if(t?.origin===r)return t;let i=Le(n.filter(e=>g(e.fileName).origin===r));if(i?.fileName)return{filePath:e.C(i.fileName),lineNumber:i.lineNumber??null,columnNumber:i.columnNumber??null,componentName:U(i.functionName),origin:r}}return null},He=async e=>{let t=await J(e);return t?.origin===`app`?t:Ve(t,await q(e)??[])},Ue=e=>Y(W(e),1)[0]??null,Y=(t,n)=>{if(!e.M())return[];let r=e.P(t);if(!r)return[];let i=[];return e.j(r,t=>{if(i.length>=n)return!0;if(e.F(t)){let n=e.N(t.type);n&&Ne(n)&&i.push(n)}return!1},!0),i},We=[`/src/app/`,`/src/pages/`,`/app/`,`/pages/`],X=(t,n)=>{let r=e.C(t);if(!n||!r.startsWith(`/`))return r;for(let e of We){let t=r.indexOf(e);if(t!==-1)return`/./${r.slice(t+1)}`}return r},Z=(e,t)=>{let n=X(e.filePath,t),r=t&&e.lineNumber?`${n}:${e.lineNumber}${e.columnNumber?`:${e.columnNumber}`:``}`:n;return e.componentName?`\n in ${e.componentName} (at ${r})`:`\n in ${r}`},Ge=(e,t,n,r)=>{let i=t.packageName,a=t.origin===`app`?e.fileName:null;if(e.isServer&&!a&&(n||!e.functionName)){let e=i?`${i} at Server`:`at Server`;return{text:`\n in ${n??`<anonymous>`} (${e})`,isTrustedSource:!1}}return!a&&n?{text:i?`\n in ${n} (${i})`:`\n in ${n}`,isTrustedSource:!1}:i?{text:`\n in ${i}`,isTrustedSource:!1}:a?{text:Z({componentName:n,filePath:a,lineNumber:e.lineNumber??null,columnNumber:e.columnNumber??null},r),isTrustedSource:!0}:null},Ke=(t,n={},r=null)=>{let{maxLines:i=3}=n,a=Math.max(i,20),o=e.S(),s=[],c=null,l=!1,u=!1,d=0;r&&(u=r.origin===`app`,d+=1,s.push(Z(r,o)));for(let e of t){if(d>=i||s.length>=a)break;let t=g(e.fileName),n=U(e.functionName),f=t.packageName?`${t.packageName}:${n??``}:${e.isServer?`server`:`client`}`:null;if(f&&f===c)continue;if(!l&&n&&n===r?.componentName){l=!0;continue}let p=Ge(e,t,n,o);p!==null&&(p.isTrustedSource&&(u=!0,d+=1),s.push(p.text),c=f)}return{text:s.join(``),shouldAppendSelectorHint:!u}},qe=async e=>{let t=await J(e);return t?.origin===`app`?t:null},Q=async(e,t={})=>{let n=await qe(e),r=Ke(await q(e)??[],t,n);if(r.text)return r;let i=Y(W(e),t.maxLines??3);return i.length>0?{text:i.map(e=>`\n in ${e}`).join(``),shouldAppendSelectorHint:!0}:{text:``,shouldAppendSelectorHint:!0}},Je=async(e,t={})=>(await Q(e,t)).text,$=(e,t)=>{let n=t.shouldAppendSelectorHint?`\n selector: ${k(e)}`:``;return`${t.text}${n}`},Ye=async(e,t={})=>{let n=await Q(e,t);return`${Oe(e)}${$(e,n).replace(/\n\s+/g,` `)}`},Xe=async(e,t={})=>{let n=W(e);return`${V(n)}${$(n,await Q(n,t))}`},Ze=e=>e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`),Qe=(t,n)=>{let r=n?.componentName??`div`,i={version:e.jt,content:t,entries:n?.entries??[{tagName:n?.tagName,componentName:r,content:t,commentText:n?.commentText}],timestamp:Date.now()},a=e=>{e.preventDefault(),e.clipboardData?.setData(`text/plain`,t),e.clipboardData?.setData(`text/html`,`<meta charset='utf-8'><pre><code>${Ze(t)}</code></pre>`),e.clipboardData?.setData(`application/x-react-grab`,JSON.stringify(i))};document.addEventListener(`copy`,a);let o=document.createElement(`textarea`);o.value=t,o.style.position=`fixed`,o.style.left=`-9999px`,o.ariaHidden=`true`,document.body.appendChild(o),o.select();try{return typeof document.execCommand==`function`?document.execCommand(`copy`):!1}finally{document.removeEventListener(`copy`,a),o.remove()}};Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return Ie}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return He}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return Ye}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return V}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return Xe}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return Ue}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return Je}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return Qe}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return k}});
@@ -6,4 +6,4 @@
6
6
  * This source code is licensed under the MIT license found in the
7
7
  * LICENSE file in the root directory of this source tree.
8
8
  */
9
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../core-kvq5wF90.cjs`),t=require(`../freeze-updates-Bj2Yd3Uy.cjs`),n=require(`../copy-content-D3sfU8oN.cjs`);exports.DEFAULT_THEME=e.a,exports.copyContent=n.t,exports.formatElementInfo=t.S,exports.generateSnippet=e.n,exports.getStack=t.E,exports.init=e.t,exports.isInstrumentationActive=t.A;
9
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../core-BhuVN81r.cjs`),t=require(`../freeze-updates-BO5ajc-z.cjs`),n=require(`../copy-content-crbRiXWE.cjs`);exports.DEFAULT_THEME=e.a,exports.copyContent=n.t,exports.formatElementInfo=n.n,exports.generateSnippet=e.n,exports.getStack=n.o,exports.init=e.t,exports.isInstrumentationActive=t.M;
@@ -6,6 +6,6 @@
6
6
  * This source code is licensed under the MIT license found in the
7
7
  * LICENSE file in the root directory of this source tree.
8
8
  */
9
- import { O as SettableOptions, T as ReactGrabRendererProps, _ as Options, a as getStack, b as PluginConfig, i as getElementContext, k as SourceInfo, l as AgentContext, n as generateSnippet, o as ActionContext, r as DEFAULT_THEME, t as init, u as ContextMenuAction, v as OverlayBounds, w as ReactGrabAPI, x as PluginHooks, y as Plugin } from "../index-aMJqwVQq.cjs";
10
- import { i as isInstrumentationActive, t as copyContent } from "../copy-content-3pnWacho.cjs";
11
- export { ActionContext, AgentContext, ContextMenuAction, DEFAULT_THEME, Options, OverlayBounds, Plugin, PluginConfig, PluginHooks, ReactGrabAPI, ReactGrabRendererProps, SettableOptions, SourceInfo, copyContent, getElementContext as formatElementInfo, generateSnippet, getStack, init, isInstrumentationActive };
9
+ import { C as ReactGrabAPI, D as SettableOptions, O as SourceInfo, _ as OverlayBounds, a as ActionContext, b as PluginHooks, c as AgentContext, g as Options, i as isInstrumentationActive, l as ContextMenuAction, t as copyContent, v as Plugin, w as ReactGrabRendererProps, y as PluginConfig } from "../copy-content-B5eFPFGr.cjs";
10
+ import { a as getStack, i as formatElementInfo, n as generateSnippet, r as DEFAULT_THEME, t as init } from "../index-D_u6ADO3.cjs";
11
+ export { ActionContext, AgentContext, ContextMenuAction, DEFAULT_THEME, Options, OverlayBounds, Plugin, PluginConfig, PluginHooks, ReactGrabAPI, ReactGrabRendererProps, SettableOptions, SourceInfo, copyContent, formatElementInfo, generateSnippet, getStack, init, isInstrumentationActive };
@@ -6,6 +6,6 @@
6
6
  * This source code is licensed under the MIT license found in the
7
7
  * LICENSE file in the root directory of this source tree.
8
8
  */
9
- import { O as SettableOptions, T as ReactGrabRendererProps, _ as Options, a as getStack, b as PluginConfig, i as getElementContext, k as SourceInfo, l as AgentContext, n as generateSnippet, o as ActionContext, r as DEFAULT_THEME, t as init, u as ContextMenuAction, v as OverlayBounds, w as ReactGrabAPI, x as PluginHooks, y as Plugin } from "../index-qewm1CVI.js";
10
- import { i as isInstrumentationActive, t as copyContent } from "../copy-content-DH6fBB50.js";
11
- export { ActionContext, AgentContext, ContextMenuAction, DEFAULT_THEME, Options, OverlayBounds, Plugin, PluginConfig, PluginHooks, ReactGrabAPI, ReactGrabRendererProps, SettableOptions, SourceInfo, copyContent, getElementContext as formatElementInfo, generateSnippet, getStack, init, isInstrumentationActive };
9
+ import { C as ReactGrabAPI, D as SettableOptions, O as SourceInfo, _ as OverlayBounds, a as ActionContext, b as PluginHooks, c as AgentContext, g as Options, i as isInstrumentationActive, l as ContextMenuAction, t as copyContent, v as Plugin, w as ReactGrabRendererProps, y as PluginConfig } from "../copy-content-DmBP15ec.js";
10
+ import { a as getStack, i as formatElementInfo, n as generateSnippet, r as DEFAULT_THEME, t as init } from "../index-CTRX5ujF.js";
11
+ export { ActionContext, AgentContext, ContextMenuAction, DEFAULT_THEME, Options, OverlayBounds, Plugin, PluginConfig, PluginHooks, ReactGrabAPI, ReactGrabRendererProps, SettableOptions, SourceInfo, copyContent, formatElementInfo, generateSnippet, getStack, init, isInstrumentationActive };
@@ -6,4 +6,4 @@
6
6
  * This source code is licensed under the MIT license found in the
7
7
  * LICENSE file in the root directory of this source tree.
8
8
  */
9
- import{a as e,n as t,t as n}from"../core-BLw9XEeN.js";import{A as r,E as i,S as a}from"../freeze-updates-DwcTZAwS.js";import{t as o}from"../copy-content-Bdbw0DFG.js";export{e as DEFAULT_THEME,o as copyContent,a as formatElementInfo,t as generateSnippet,i as getStack,n as init,r as isInstrumentationActive};
9
+ import{a as e,n as t,t as n}from"../core-xn9USmBJ.js";import{M as r}from"../freeze-updates-bDQWoAI1.js";import{n as i,o as a,t as o}from"../copy-content-Blo2x2eu.js";export{e as DEFAULT_THEME,o as copyContent,i as formatElementInfo,t as generateSnippet,a as getStack,n as init,r as isInstrumentationActive};