react-grab 0.0.2 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -12,26 +12,156 @@ var source = require('bippy/dist/source');
12
12
  * LICENSE file in the root directory of this source tree.
13
13
  */
14
14
 
15
- var getReactData = async (element) => {
15
+ var getStack = async (element) => {
16
16
  const fiber = bippy.getFiberFromHostInstance(element);
17
17
  if (!fiber) return null;
18
18
  const stackTrace = source.getFiberStackTrace(fiber);
19
19
  const rawOwnerStack = await source.getOwnerStack(stackTrace);
20
- const stack = rawOwnerStack.filter((item) => !item.source?.fileName.includes("node_modules")).map((item) => ({
20
+ const stack = rawOwnerStack.map((item) => ({
21
21
  componentName: item.name,
22
22
  fileName: item.source?.fileName
23
23
  }));
24
- return {
25
- fiber,
26
- stack
24
+ return stack;
25
+ };
26
+ var filterStack = (stack) => {
27
+ return stack.filter(
28
+ (item) => item.fileName && !item.fileName.includes("node_modules") && item.componentName.length > 1 && !item.fileName.startsWith("_")
29
+ );
30
+ };
31
+ var findCommonRoot = (paths) => {
32
+ if (paths.length === 0) return "";
33
+ if (paths.length === 1) {
34
+ const lastSlash2 = paths[0].lastIndexOf("/");
35
+ return lastSlash2 > 0 ? paths[0].substring(0, lastSlash2 + 1) : "";
36
+ }
37
+ let commonPrefix = paths[0];
38
+ for (let i = 1; i < paths.length; i++) {
39
+ const path = paths[i];
40
+ let j = 0;
41
+ while (j < commonPrefix.length && j < path.length && commonPrefix[j] === path[j]) {
42
+ j++;
43
+ }
44
+ commonPrefix = commonPrefix.substring(0, j);
45
+ }
46
+ const lastSlash = commonPrefix.lastIndexOf("/");
47
+ return lastSlash > 0 ? commonPrefix.substring(0, lastSlash + 1) : "";
48
+ };
49
+ var serializeStack = (stack) => {
50
+ const filePaths = stack.map((item) => item.fileName).filter((path) => !!path);
51
+ const commonRoot = findCommonRoot(filePaths);
52
+ return stack.map((item) => {
53
+ let fileName = item.fileName;
54
+ if (fileName && commonRoot) {
55
+ fileName = fileName.startsWith(commonRoot) ? fileName.substring(commonRoot.length) : fileName;
56
+ }
57
+ return `${item.componentName}${fileName ? ` (${fileName})` : ""}`;
58
+ }).join("\n");
59
+ };
60
+ var getHTMLSnippet = (element) => {
61
+ const getElementTag = (el) => {
62
+ const tagName = el.tagName.toLowerCase();
63
+ const importantAttrs = [
64
+ "id",
65
+ "class",
66
+ "name",
67
+ "type",
68
+ "role",
69
+ "aria-label"
70
+ ];
71
+ const maxValueLength = 50;
72
+ const attrs = Array.from(el.attributes).filter((attr) => {
73
+ return importantAttrs.includes(attr.name) || attr.name.startsWith("data-");
74
+ }).map((attr) => {
75
+ let value = attr.value;
76
+ if (value.length > maxValueLength) {
77
+ value = value.substring(0, maxValueLength) + "...";
78
+ }
79
+ return `${attr.name}="${value}"`;
80
+ }).join(" ");
81
+ return attrs ? `<${tagName} ${attrs}>` : `<${tagName}>`;
82
+ };
83
+ const getClosingTag = (el) => {
84
+ return `</${el.tagName.toLowerCase()}>`;
85
+ };
86
+ const getChildrenCount = (el) => {
87
+ const children = Array.from(el.children);
88
+ return children.length;
27
89
  };
90
+ const lines = [];
91
+ const parent = element.parentElement;
92
+ if (parent) {
93
+ lines.push(getElementTag(parent));
94
+ const siblings = Array.from(parent.children);
95
+ const targetIndex = siblings.indexOf(element);
96
+ if (targetIndex > 0) {
97
+ lines.push(
98
+ ` ... (${targetIndex} element${targetIndex === 1 ? "" : "s"})`
99
+ );
100
+ }
101
+ }
102
+ const indent = parent ? " " : "";
103
+ lines.push(indent + "<!-- SELECTED -->");
104
+ lines.push(indent + getElementTag(element));
105
+ const childrenCount = getChildrenCount(element);
106
+ if (childrenCount > 0) {
107
+ lines.push(
108
+ `${indent} ... (${childrenCount} element${childrenCount === 1 ? "" : "s"})`
109
+ );
110
+ }
111
+ lines.push(indent + getClosingTag(element));
112
+ if (parent) {
113
+ const siblings = Array.from(parent.children);
114
+ const targetIndex = siblings.indexOf(element);
115
+ const siblingsAfter = siblings.length - targetIndex - 1;
116
+ if (siblingsAfter > 0) {
117
+ lines.push(
118
+ ` ... (${siblingsAfter} element${siblingsAfter === 1 ? "" : "s"})`
119
+ );
120
+ }
121
+ lines.push(getClosingTag(parent));
122
+ }
123
+ return lines.join("\n");
28
124
  };
125
+
126
+ // src/index.ts
29
127
  var init = () => {
30
128
  let metaKeyTimer = null;
31
129
  let overlay = null;
32
130
  let isActive = false;
33
131
  let currentElement = null;
34
132
  let animationFrame = null;
133
+ let pendingCopyText = null;
134
+ const copyToClipboard = async (text) => {
135
+ if (!document.hasFocus()) {
136
+ pendingCopyText = text;
137
+ return;
138
+ }
139
+ try {
140
+ await navigator.clipboard.writeText(text);
141
+ pendingCopyText = null;
142
+ } catch {
143
+ const textarea = document.createElement("textarea");
144
+ textarea.value = text;
145
+ textarea.style.position = "fixed";
146
+ textarea.style.left = "-999999px";
147
+ textarea.style.top = "-999999px";
148
+ document.body.appendChild(textarea);
149
+ textarea.focus();
150
+ textarea.select();
151
+ try {
152
+ document.execCommand("copy");
153
+ pendingCopyText = null;
154
+ } catch (execErr) {
155
+ console.error("Failed to copy to clipboard:", execErr);
156
+ }
157
+ document.body.removeChild(textarea);
158
+ }
159
+ };
160
+ const handleWindowFocus = () => {
161
+ if (pendingCopyText) {
162
+ void copyToClipboard(pendingCopyText);
163
+ }
164
+ };
35
165
  let currentX = 0;
36
166
  let currentY = 0;
37
167
  let currentWidth = 0;
@@ -61,7 +191,7 @@ var init = () => {
61
191
  };
62
192
  const updateOverlayPosition = () => {
63
193
  if (!overlay || !isActive) return;
64
- const factor = 0.2;
194
+ const factor = 0.5;
65
195
  currentX = lerp(currentX, targetX, factor);
66
196
  currentY = lerp(currentY, targetY, factor);
67
197
  currentWidth = lerp(currentWidth, targetWidth, factor);
@@ -93,11 +223,18 @@ var init = () => {
93
223
  const elementToInspect = currentElement;
94
224
  hideOverlay();
95
225
  if (elementToInspect) {
96
- void getReactData(elementToInspect).then((data) => {
97
- const serializedStack = data?.stack.map((item) => `${item.componentName} (${item.fileName})`).join("\n");
98
- if (serializedStack) {
99
- void navigator.clipboard.writeText(serializedStack);
100
- }
226
+ void getStack(elementToInspect).then((stack) => {
227
+ if (!stack) return;
228
+ const serializedStack = serializeStack(filterStack(stack));
229
+ const htmlSnippet = getHTMLSnippet(elementToInspect);
230
+ const payload = `## Referenced element
231
+ ${htmlSnippet}
232
+
233
+ Import traces:
234
+ ${serializedStack}
235
+
236
+ Page: ${window.location.href}`;
237
+ void copyToClipboard(payload);
101
238
  });
102
239
  }
103
240
  };
@@ -133,7 +270,6 @@ var init = () => {
133
270
  const handleKeyDown = (e) => {
134
271
  if (e.metaKey && !metaKeyTimer && !isActive) {
135
272
  metaKeyTimer = setTimeout(() => {
136
- console.log("Meta key held for 750ms");
137
273
  if (!isInsideInputOrTextarea()) {
138
274
  showOverlay();
139
275
  }
@@ -157,6 +293,7 @@ var init = () => {
157
293
  document.addEventListener("mousemove", handleMouseMove);
158
294
  document.addEventListener("mousedown", handleMouseDown, true);
159
295
  document.addEventListener("click", handleClick, true);
296
+ window.addEventListener("focus", handleWindowFocus);
160
297
  return () => {
161
298
  if (metaKeyTimer) {
162
299
  clearTimeout(metaKeyTimer);
@@ -172,9 +309,9 @@ var init = () => {
172
309
  document.removeEventListener("mousemove", handleMouseMove);
173
310
  document.removeEventListener("mousedown", handleMouseDown, true);
174
311
  document.removeEventListener("click", handleClick, true);
312
+ window.removeEventListener("focus", handleWindowFocus);
175
313
  };
176
314
  };
177
315
  init();
178
316
 
179
- exports.getReactData = getReactData;
180
317
  exports.init = init;
package/dist/index.d.cts CHANGED
@@ -1,13 +1,3 @@
1
- import * as bippy from 'bippy';
2
-
3
- interface StackItem {
4
- componentName: string;
5
- fileName: string | undefined;
6
- }
7
- declare const getReactData: (element: Element) => Promise<{
8
- fiber: bippy.Fiber;
9
- stack: StackItem[];
10
- } | null>;
11
1
  declare const init: () => () => void;
12
2
 
13
- export { type StackItem, getReactData, init };
3
+ export { init };
package/dist/index.d.ts CHANGED
@@ -1,13 +1,3 @@
1
- import * as bippy from 'bippy';
2
-
3
- interface StackItem {
4
- componentName: string;
5
- fileName: string | undefined;
6
- }
7
- declare const getReactData: (element: Element) => Promise<{
8
- fiber: bippy.Fiber;
9
- stack: StackItem[];
10
- } | null>;
11
1
  declare const init: () => () => void;
12
2
 
13
- export { type StackItem, getReactData, init };
3
+ export { init };
@@ -6,18 +6,25 @@ var ReactGrab=(function(exports){'use strict';/**
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
- var me="0.3.28",W=`bippy-${me}`,fe=Object.defineProperty,De=Object.prototype.hasOwnProperty,G=()=>{},pe=n=>{try{Function.prototype.toString.call(n).indexOf("^_^")>-1&&setTimeout(()=>{throw new Error("React is running in production mode, but dead code elimination has not been applied. Read how to correctly configure React for production: https://reactjs.org/link/perf-use-production-build")});}catch{}},he=(n=j())=>"getFiberRoots"in n,ge=false,de,q=(n=j())=>ge?true:(typeof n.inject=="function"&&(de=n.inject.toString()),!!de?.includes("(injected)")),U=new Set,P=new Set,ve=n=>{let e=new Map,a=0,p={checkDCE:pe,supportsFiber:true,supportsFlight:true,hasUnsupportedRendererAttached:false,renderers:e,onCommitFiberRoot:G,onCommitFiberUnmount:G,onPostCommitFiberRoot:G,on:G,inject(C){let d=++a;return e.set(d,C),P.add(C),p._instrumentationIsActive||(p._instrumentationIsActive=true,U.forEach(s=>s())),d},_instrumentationSource:W,_instrumentationIsActive:false};try{fe(globalThis,"__REACT_DEVTOOLS_GLOBAL_HOOK__",{get(){return p},set(s){if(s&&typeof s=="object"){let o=p.renderers;p=s,o.size>0&&(o.forEach((i,u)=>{P.add(i),s.renderers.set(u,i);}),z(n));}},configurable:!0,enumerable:!0});let C=window.hasOwnProperty,d=!1;fe(window,"hasOwnProperty",{value:function(){try{if(!d&&arguments[0]==="__REACT_DEVTOOLS_GLOBAL_HOOK__")return globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__=void 0,d=!0,-0}catch{}return C.apply(this,arguments)},configurable:!0,writable:!0});}catch{z(n);}return p},z=n=>{try{let e=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!e)return;if(!e._instrumentationSource){if(e.checkDCE=pe,e.supportsFiber=!0,e.supportsFlight=!0,e.hasUnsupportedRendererAttached=!1,e._instrumentationSource=W,e._instrumentationIsActive=!1,e.on=G,e.renderers.size){e._instrumentationIsActive=!0,U.forEach(p=>p());return}let a=e.inject;q(e)&&!he()&&(ge=!0,e.inject({scheduleRefresh(){}})&&(e._instrumentationIsActive=!0)),e.inject=p=>{let C=a(p);return P.add(p),e._instrumentationIsActive=!0,U.forEach(d=>d()),C};}(e.renderers.size||e._instrumentationIsActive||q())&&n?.();}catch{}},_e=()=>De.call(globalThis,"__REACT_DEVTOOLS_GLOBAL_HOOK__"),j=n=>_e()?(z(n),globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__):ve(n),ye=()=>!!(typeof window<"u"&&(window.document?.createElement||window.navigator?.product==="ReactNative")),Ce=()=>{try{ye()&&j();}catch{}},Y=0,K=1;var Q=5;var X=11,J=13;var Z=15,ee=16;var te=19;var ne=26,re=27,oe=28,ie=30;var $=n=>{let e=n;return typeof e=="function"?e:typeof e=="object"&&e?$(e.type||e.render):null},B=n=>{let e=n;if(typeof e=="string")return e;if(typeof e!="function"&&!(typeof e=="object"&&e))return null;let a=e.displayName||e.name||null;if(a)return a;let p=$(e);return p&&(p.displayName||p.name)||null};var se=n=>{let e=j();for(let a of e.renderers.values())try{let p=a.findFiberByHostInstance?.(n);if(p)return p}catch{}if(typeof n=="object"&&n!=null){if("_reactRootContainer"in n)return n._reactRootContainer?._internalRoot?.current?.child;for(let a in n)if(a.startsWith("__reactContainer$")||a.startsWith("__reactInternalInstance$")||a.startsWith("__reactFiber"))return n[a]||null}return null};Ce();var We=Object.create,Se=Object.defineProperty,Ye=Object.getOwnPropertyDescriptor,be=Object.getOwnPropertyNames,Ke=Object.getPrototypeOf,Qe=Object.prototype.hasOwnProperty,N=(n,e)=>function(){return e||(0, n[be(n)[0]])((e={exports:{}}).exports,e),e.exports},Xe=(n,e,a,p)=>{if(e&&typeof e=="object"||typeof e=="function")for(var C=be(e),d=0,s=C.length,o;d<s;d++)o=C[d],!Qe.call(n,o)&&o!==a&&Se(n,o,{get:(i=>e[i]).bind(null,o),enumerable:!(p=Ye(e,o))||p.enumerable});return n},Je=(n,e,a)=>(a=n!=null?We(Ke(n)):{},Xe(Se(a,"default",{value:n,enumerable:true}),n)),Ee=/^\s*at .*(\S+:\d+|\(native\))/m,Ze=/^(eval@)?(\[native code\])?$/;function et(n,e){return n.match(Ee)?tt(n,e):nt(n,e)}function we(n){if(!n.includes(":"))return [n,undefined,undefined];let a=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(n.replace(/[()]/g,""));return [a[1],a[2]||undefined,a[3]||undefined]}function Te(n,e){return e&&e.slice!=null?Array.isArray(e.slice)?n.slice(e.slice[0],e.slice[1]):n.slice(0,e.slice):n}function tt(n,e){return Te(n.split(`
10
- `).filter(p=>!!p.match(Ee)),e).map(p=>{p.includes("(eval ")&&(p=p.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));let C=p.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),d=C.match(/ (\(.+\)$)/);C=d?C.replace(d[0],""):C;let s=we(d?d[1]:C),o=d&&C||undefined,i=["eval","<anonymous>"].includes(s[0])?undefined:s[0];return {function:o,file:i,line:s[1]?+s[1]:undefined,col:s[2]?+s[2]:undefined,raw:p}})}function nt(n,e){return Te(n.split(`
11
- `).filter(p=>!p.match(Ze)),e).map(p=>{if(p.includes(" > eval")&&(p=p.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),!p.includes("@")&&!p.includes(":"))return {function:p};{let C=/(([^\n\r"\u2028\u2029]*".[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*(?:@[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*)*(?:[\n\r\u2028\u2029][^@]*)?)?[^@]*)@/,d=p.match(C),s=d&&d[1]?d[1]:undefined,o=we(p.replace(C,""));return {function:s,file:o[0],line:o[1]?+o[1]:undefined,col:o[2]?+o[2]:undefined,raw:p}}})}var rt=N({"../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/base64.js"(n){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");n.encode=function(a){if(0<=a&&a<e.length)return e[a];throw new TypeError("Must be between 0 and 63: "+a)},n.decode=function(a){var p=65,C=90,d=97,s=122,o=48,i=57,u=43,y=47,g=26,h=52;return p<=a&&a<=C?a-p:d<=a&&a<=s?a-d+g:o<=a&&a<=i?a-o+h:a==u?62:a==y?63:-1};}}),Oe=N({"../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/base64-vlq.js"(n){var e=rt(),a=5,p=1<<a,C=p-1,d=p;function s(i){return i<0?(-i<<1)+1:(i<<1)+0}function o(i){var u=(i&1)===1,y=i>>1;return u?-y:y}n.encode=function(u){var y="",g,h=s(u);do g=h&C,h>>>=a,h>0&&(g|=d),y+=e.encode(g);while(h>0);return y},n.decode=function(u,y,g){var h=u.length,r=0,l=0,c,v;do{if(y>=h)throw new Error("Expected more digits in base 64 VLQ value.");if(v=e.decode(u.charCodeAt(y++)),v===-1)throw new Error("Invalid base64 digit: "+u.charAt(y-1));c=!!(v&d),v&=C,r=r+(v<<l),l+=a;}while(c);g.value=o(r),g.rest=y;};}}),H=N({"../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/util.js"(n){function e(f,t,S){if(t in f)return f[t];if(arguments.length===3)return S;throw new Error('"'+t+'" is a required argument.')}n.getArg=e;var a=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,p=/^data:.+\,.+$/;function C(f){var t=f.match(a);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}n.urlParse=C;function d(f){var t="";return f.scheme&&(t+=f.scheme+":"),t+="//",f.auth&&(t+=f.auth+"@"),f.host&&(t+=f.host),f.port&&(t+=":"+f.port),f.path&&(t+=f.path),t}n.urlGenerate=d;var s=32;function o(f){var t=[];return function(S){for(var m=0;m<t.length;m++)if(t[m].input===S){var F=t[0];return t[0]=t[m],t[m]=F,t[0].result}var R=f(S);return t.unshift({input:S,result:R}),t.length>s&&t.pop(),R}}var i=o(function(t){var S=t,m=C(t);if(m){if(!m.path)return t;S=m.path;}for(var F=n.isAbsolute(S),R=[],A=0,L=0;;)if(A=L,L=S.indexOf("/",A),L===-1){R.push(S.slice(A));break}else for(R.push(S.slice(A,L));L<S.length&&S[L]==="/";)L++;for(var D,I=0,L=R.length-1;L>=0;L--)D=R[L],D==="."?R.splice(L,1):D===".."?I++:I>0&&(D===""?(R.splice(L+1,I),I=0):(R.splice(L,2),I--));return S=R.join("/"),S===""&&(S=F?"/":"."),m?(m.path=S,d(m)):S});n.normalize=i;function u(f,t){f===""&&(f="."),t===""&&(t=".");var S=C(t),m=C(f);if(m&&(f=m.path||"/"),S&&!S.scheme)return m&&(S.scheme=m.scheme),d(S);if(S||t.match(p))return t;if(m&&!m.host&&!m.path)return m.host=t,d(m);var F=t.charAt(0)==="/"?t:i(f.replace(/\/+$/,"")+"/"+t);return m?(m.path=F,d(m)):F}n.join=u,n.isAbsolute=function(f){return f.charAt(0)==="/"||a.test(f)};function y(f,t){f===""&&(f="."),f=f.replace(/\/$/,"");for(var S=0;t.indexOf(f+"/")!==0;){var m=f.lastIndexOf("/");if(m<0||(f=f.slice(0,m),f.match(/^([^\/]+:\/)?\/*$/)))return t;++S;}return Array(S+1).join("../")+t.substr(f.length+1)}n.relative=y;var g=function(){var f=Object.create(null);return !("__proto__"in f)}();function h(f){return f}function r(f){return c(f)?"$"+f:f}n.toSetString=g?h:r;function l(f){return c(f)?f.slice(1):f}n.fromSetString=g?h:l;function c(f){if(!f)return false;var t=f.length;if(t<9||f.charCodeAt(t-1)!==95||f.charCodeAt(t-2)!==95||f.charCodeAt(t-3)!==111||f.charCodeAt(t-4)!==116||f.charCodeAt(t-5)!==111||f.charCodeAt(t-6)!==114||f.charCodeAt(t-7)!==112||f.charCodeAt(t-8)!==95||f.charCodeAt(t-9)!==95)return false;for(var S=t-10;S>=0;S--)if(f.charCodeAt(S)!==36)return false;return true}function v(f,t,S){var m=w(f.source,t.source);return m!==0||(m=f.originalLine-t.originalLine,m!==0)||(m=f.originalColumn-t.originalColumn,m!==0||S)||(m=f.generatedColumn-t.generatedColumn,m!==0)||(m=f.generatedLine-t.generatedLine,m!==0)?m:w(f.name,t.name)}n.compareByOriginalPositions=v;function _(f,t,S){var m;return m=f.originalLine-t.originalLine,m!==0||(m=f.originalColumn-t.originalColumn,m!==0||S)||(m=f.generatedColumn-t.generatedColumn,m!==0)||(m=f.generatedLine-t.generatedLine,m!==0)?m:w(f.name,t.name)}n.compareByOriginalPositionsNoSource=_;function b(f,t,S){var m=f.generatedLine-t.generatedLine;return m!==0||(m=f.generatedColumn-t.generatedColumn,m!==0||S)||(m=w(f.source,t.source),m!==0)||(m=f.originalLine-t.originalLine,m!==0)||(m=f.originalColumn-t.originalColumn,m!==0)?m:w(f.name,t.name)}n.compareByGeneratedPositionsDeflated=b;function E(f,t,S){var m=f.generatedColumn-t.generatedColumn;return m!==0||S||(m=w(f.source,t.source),m!==0)||(m=f.originalLine-t.originalLine,m!==0)||(m=f.originalColumn-t.originalColumn,m!==0)?m:w(f.name,t.name)}n.compareByGeneratedPositionsDeflatedNoLine=E;function w(f,t){return f===t?0:f===null?1:t===null?-1:f>t?1:-1}function T(f,t){var S=f.generatedLine-t.generatedLine;return S!==0||(S=f.generatedColumn-t.generatedColumn,S!==0)||(S=w(f.source,t.source),S!==0)||(S=f.originalLine-t.originalLine,S!==0)||(S=f.originalColumn-t.originalColumn,S!==0)?S:w(f.name,t.name)}n.compareByGeneratedPositionsInflated=T;function O(f){return JSON.parse(f.replace(/^\)]}'[^\n]*\n/,""))}n.parseSourceMapInput=O;function M(f,t,S){if(t=t||"",f&&(f[f.length-1]!=="/"&&t[0]!=="/"&&(f+="/"),t=f+t),S){var m=C(S);if(!m)throw new Error("sourceMapURL could not be parsed");if(m.path){var F=m.path.lastIndexOf("/");F>=0&&(m.path=m.path.substring(0,F+1));}t=u(d(m),t);}return i(t)}n.computeSourceURL=M;}}),Re=N({"../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/array-set.js"(n){var e=H(),a=Object.prototype.hasOwnProperty,p=typeof Map<"u";function C(){this._array=[],this._set=p?new Map:Object.create(null);}C.fromArray=function(s,o){for(var i=new C,u=0,y=s.length;u<y;u++)i.add(s[u],o);return i},C.prototype.size=function(){return p?this._set.size:Object.getOwnPropertyNames(this._set).length},C.prototype.add=function(s,o){var i=p?s:e.toSetString(s),u=p?this.has(s):a.call(this._set,i),y=this._array.length;(!u||o)&&this._array.push(s),u||(p?this._set.set(s,y):this._set[i]=y);},C.prototype.has=function(s){if(p)return this._set.has(s);var o=e.toSetString(s);return a.call(this._set,o)},C.prototype.indexOf=function(s){if(p){var o=this._set.get(s);if(o>=0)return o}else {var i=e.toSetString(s);if(a.call(this._set,i))return this._set[i]}throw new Error('"'+s+'" is not in the set.')},C.prototype.at=function(s){if(s>=0&&s<this._array.length)return this._array[s];throw new Error("No element indexed by "+s)},C.prototype.toArray=function(){return this._array.slice()},n.ArraySet=C;}}),ot=N({"../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/mapping-list.js"(n){var e=H();function a(C,d){var s=C.generatedLine,o=d.generatedLine,i=C.generatedColumn,u=d.generatedColumn;return o>s||o==s&&u>=i||e.compareByGeneratedPositionsInflated(C,d)<=0}function p(){this._array=[],this._sorted=true,this._last={generatedLine:-1,generatedColumn:0};}p.prototype.unsortedForEach=function(d,s){this._array.forEach(d,s);},p.prototype.add=function(d){a(this._last,d)?(this._last=d,this._array.push(d)):(this._sorted=false,this._array.push(d));},p.prototype.toArray=function(){return this._sorted||(this._array.sort(e.compareByGeneratedPositionsInflated),this._sorted=true),this._array},n.MappingList=p;}}),Le=N({"../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/source-map-generator.js"(n){var e=Oe(),a=H(),p=Re().ArraySet,C=ot().MappingList;function d(s){s||(s={}),this._file=a.getArg(s,"file",null),this._sourceRoot=a.getArg(s,"sourceRoot",null),this._skipValidation=a.getArg(s,"skipValidation",false),this._ignoreInvalidMapping=a.getArg(s,"ignoreInvalidMapping",false),this._sources=new p,this._names=new p,this._mappings=new C,this._sourcesContents=null;}d.prototype._version=3,d.fromSourceMap=function(o,i){var u=o.sourceRoot,y=new d(Object.assign(i||{},{file:o.file,sourceRoot:u}));return o.eachMapping(function(g){var h={generated:{line:g.generatedLine,column:g.generatedColumn}};g.source!=null&&(h.source=g.source,u!=null&&(h.source=a.relative(u,h.source)),h.original={line:g.originalLine,column:g.originalColumn},g.name!=null&&(h.name=g.name)),y.addMapping(h);}),o.sources.forEach(function(g){var h=g;u!==null&&(h=a.relative(u,g)),y._sources.has(h)||y._sources.add(h);var r=o.sourceContentFor(g);r!=null&&y.setSourceContent(g,r);}),y},d.prototype.addMapping=function(o){var i=a.getArg(o,"generated"),u=a.getArg(o,"original",null),y=a.getArg(o,"source",null),g=a.getArg(o,"name",null);!this._skipValidation&&this._validateMapping(i,u,y,g)===false||(y!=null&&(y=String(y),this._sources.has(y)||this._sources.add(y)),g!=null&&(g=String(g),this._names.has(g)||this._names.add(g)),this._mappings.add({generatedLine:i.line,generatedColumn:i.column,originalLine:u!=null&&u.line,originalColumn:u!=null&&u.column,source:y,name:g}));},d.prototype.setSourceContent=function(o,i){var u=o;this._sourceRoot!=null&&(u=a.relative(this._sourceRoot,u)),i!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[a.toSetString(u)]=i):this._sourcesContents&&(delete this._sourcesContents[a.toSetString(u)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null));},d.prototype.applySourceMap=function(o,i,u){var y=i;if(i==null){if(o.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);y=o.file;}var g=this._sourceRoot;g!=null&&(y=a.relative(g,y));var h=new p,r=new p;this._mappings.unsortedForEach(function(l){if(l.source===y&&l.originalLine!=null){var c=o.originalPositionFor({line:l.originalLine,column:l.originalColumn});c.source!=null&&(l.source=c.source,u!=null&&(l.source=a.join(u,l.source)),g!=null&&(l.source=a.relative(g,l.source)),l.originalLine=c.line,l.originalColumn=c.column,c.name!=null&&(l.name=c.name));}var v=l.source;v!=null&&!h.has(v)&&h.add(v);var _=l.name;_!=null&&!r.has(_)&&r.add(_);},this),this._sources=h,this._names=r,o.sources.forEach(function(l){var c=o.sourceContentFor(l);c!=null&&(u!=null&&(l=a.join(u,l)),g!=null&&(l=a.relative(g,l)),this.setSourceContent(l,c));},this);},d.prototype._validateMapping=function(o,i,u,y){if(i&&typeof i.line!="number"&&typeof i.column!="number"){var g="original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.";if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(g),false;throw new Error(g)}if(!(o&&"line"in o&&"column"in o&&o.line>0&&o.column>=0&&!i&&!u&&!y)){if(o&&"line"in o&&"column"in o&&i&&"line"in i&&"column"in i&&o.line>0&&o.column>=0&&i.line>0&&i.column>=0&&u)return;var g="Invalid mapping: "+JSON.stringify({generated:o,source:u,original:i,name:y});if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(g),false;throw new Error(g)}},d.prototype._serializeMappings=function(){for(var o=0,i=1,u=0,y=0,g=0,h=0,r="",l,c,v,_,b=this._mappings.toArray(),E=0,w=b.length;E<w;E++){if(c=b[E],l="",c.generatedLine!==i)for(o=0;c.generatedLine!==i;)l+=";",i++;else if(E>0){if(!a.compareByGeneratedPositionsInflated(c,b[E-1]))continue;l+=",";}l+=e.encode(c.generatedColumn-o),o=c.generatedColumn,c.source!=null&&(_=this._sources.indexOf(c.source),l+=e.encode(_-h),h=_,l+=e.encode(c.originalLine-1-y),y=c.originalLine-1,l+=e.encode(c.originalColumn-u),u=c.originalColumn,c.name!=null&&(v=this._names.indexOf(c.name),l+=e.encode(v-g),g=v)),r+=l;}return r},d.prototype._generateSourcesContent=function(o,i){return o.map(function(u){if(!this._sourcesContents)return null;i!=null&&(u=a.relative(i,u));var y=a.toSetString(u);return Object.prototype.hasOwnProperty.call(this._sourcesContents,y)?this._sourcesContents[y]:null},this)},d.prototype.toJSON=function(){var o={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(o.file=this._file),this._sourceRoot!=null&&(o.sourceRoot=this._sourceRoot),this._sourcesContents&&(o.sourcesContent=this._generateSourcesContent(o.sources,o.sourceRoot)),o},d.prototype.toString=function(){return JSON.stringify(this.toJSON())},n.SourceMapGenerator=d;}}),it=N({"../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/binary-search.js"(n){n.GREATEST_LOWER_BOUND=1,n.LEAST_UPPER_BOUND=2;function e(a,p,C,d,s,o){var i=Math.floor((p-a)/2)+a,u=s(C,d[i],true);return u===0?i:u>0?p-i>1?e(i,p,C,d,s,o):o==n.LEAST_UPPER_BOUND?p<d.length?p:-1:i:i-a>1?e(a,i,C,d,s,o):o==n.LEAST_UPPER_BOUND?i:a<0?-1:a}n.search=function(p,C,d,s){if(C.length===0)return -1;var o=e(-1,C.length,p,C,d,s||n.GREATEST_LOWER_BOUND);if(o<0)return -1;for(;o-1>=0&&d(C[o],C[o-1],true)===0;)--o;return o};}}),st=N({"../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/quick-sort.js"(n){function e(C){function d(i,u,y){var g=i[u];i[u]=i[y],i[y]=g;}function s(i,u){return Math.round(i+Math.random()*(u-i))}function o(i,u,y,g){if(y<g){var h=s(y,g),r=y-1;d(i,h,g);for(var l=i[g],c=y;c<g;c++)u(i[c],l,false)<=0&&(r+=1,d(i,r,c));d(i,r+1,c);var v=r+1;o(i,u,y,v-1),o(i,u,v+1,g);}}return o}function a(C){let d=e.toString();return new Function(`return ${d}`)()(C)}let p=new WeakMap;n.quickSort=function(C,d,s=0){let o=p.get(d);o===undefined&&(o=a(d),p.set(d,o)),o(C,d,s,C.length-1);};}}),at=N({"../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/source-map-consumer.js"(n){var e=H(),a=it(),p=Re().ArraySet,C=Oe(),d=st().quickSort;function s(h,r){var l=h;return typeof h=="string"&&(l=e.parseSourceMapInput(h)),l.sections!=null?new g(l,r):new o(l,r)}s.fromSourceMap=function(h,r){return o.fromSourceMap(h,r)},s.prototype._version=3,s.prototype.__generatedMappings=null,Object.defineProperty(s.prototype,"_generatedMappings",{configurable:true,enumerable:true,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),s.prototype.__originalMappings=null,Object.defineProperty(s.prototype,"_originalMappings",{configurable:true,enumerable:true,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),s.prototype._charIsMappingSeparator=function(r,l){var c=r.charAt(l);return c===";"||c===","},s.prototype._parseMappings=function(r,l){throw new Error("Subclasses must implement _parseMappings")},s.GENERATED_ORDER=1,s.ORIGINAL_ORDER=2,s.GREATEST_LOWER_BOUND=1,s.LEAST_UPPER_BOUND=2,s.prototype.eachMapping=function(r,l,c){var v=l||null,_=c||s.GENERATED_ORDER,b;switch(_){case s.GENERATED_ORDER:b=this._generatedMappings;break;case s.ORIGINAL_ORDER:b=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}for(var E=this.sourceRoot,w=r.bind(v),T=this._names,O=this._sources,M=this._sourceMapURL,f=0,t=b.length;f<t;f++){var S=b[f],m=S.source===null?null:O.at(S.source);m!==null&&(m=e.computeSourceURL(E,m,M)),w({source:m,generatedLine:S.generatedLine,generatedColumn:S.generatedColumn,originalLine:S.originalLine,originalColumn:S.originalColumn,name:S.name===null?null:T.at(S.name)});}},s.prototype.allGeneratedPositionsFor=function(r){var l=e.getArg(r,"line"),c={source:e.getArg(r,"source"),originalLine:l,originalColumn:e.getArg(r,"column",0)};if(c.source=this._findSourceIndex(c.source),c.source<0)return [];var v=[],_=this._findMapping(c,this._originalMappings,"originalLine","originalColumn",e.compareByOriginalPositions,a.LEAST_UPPER_BOUND);if(_>=0){var b=this._originalMappings[_];if(r.column===undefined)for(var E=b.originalLine;b&&b.originalLine===E;)v.push({line:e.getArg(b,"generatedLine",null),column:e.getArg(b,"generatedColumn",null),lastColumn:e.getArg(b,"lastGeneratedColumn",null)}),b=this._originalMappings[++_];else for(var w=b.originalColumn;b&&b.originalLine===l&&b.originalColumn==w;)v.push({line:e.getArg(b,"generatedLine",null),column:e.getArg(b,"generatedColumn",null),lastColumn:e.getArg(b,"lastGeneratedColumn",null)}),b=this._originalMappings[++_];}return v},n.SourceMapConsumer=s;function o(h,r){var l=h;typeof h=="string"&&(l=e.parseSourceMapInput(h));var c=e.getArg(l,"version"),v=e.getArg(l,"sources"),_=e.getArg(l,"names",[]),b=e.getArg(l,"sourceRoot",null),E=e.getArg(l,"sourcesContent",null),w=e.getArg(l,"mappings"),T=e.getArg(l,"file",null);if(c!=this._version)throw new Error("Unsupported version: "+c);b&&(b=e.normalize(b)),v=v.map(String).map(e.normalize).map(function(O){return b&&e.isAbsolute(b)&&e.isAbsolute(O)?e.relative(b,O):O}),this._names=p.fromArray(_.map(String),true),this._sources=p.fromArray(v,true),this._absoluteSources=this._sources.toArray().map(function(O){return e.computeSourceURL(b,O,r)}),this.sourceRoot=b,this.sourcesContent=E,this._mappings=w,this._sourceMapURL=r,this.file=T;}o.prototype=Object.create(s.prototype),o.prototype.consumer=s,o.prototype._findSourceIndex=function(h){var r=h;if(this.sourceRoot!=null&&(r=e.relative(this.sourceRoot,r)),this._sources.has(r))return this._sources.indexOf(r);var l;for(l=0;l<this._absoluteSources.length;++l)if(this._absoluteSources[l]==h)return l;return -1},o.fromSourceMap=function(r,l){var c=Object.create(o.prototype),v=c._names=p.fromArray(r._names.toArray(),true),_=c._sources=p.fromArray(r._sources.toArray(),true);c.sourceRoot=r._sourceRoot,c.sourcesContent=r._generateSourcesContent(c._sources.toArray(),c.sourceRoot),c.file=r._file,c._sourceMapURL=l,c._absoluteSources=c._sources.toArray().map(function(t){return e.computeSourceURL(c.sourceRoot,t,l)});for(var b=r._mappings.toArray().slice(),E=c.__generatedMappings=[],w=c.__originalMappings=[],T=0,O=b.length;T<O;T++){var M=b[T],f=new i;f.generatedLine=M.generatedLine,f.generatedColumn=M.generatedColumn,M.source&&(f.source=_.indexOf(M.source),f.originalLine=M.originalLine,f.originalColumn=M.originalColumn,M.name&&(f.name=v.indexOf(M.name)),w.push(f)),E.push(f);}return d(c.__originalMappings,e.compareByOriginalPositions),c},o.prototype._version=3,Object.defineProperty(o.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function i(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null;}let u=e.compareByGeneratedPositionsDeflatedNoLine;function y(h,r){let l=h.length,c=h.length-r;if(!(c<=1))if(c==2){let v=h[r],_=h[r+1];u(v,_)>0&&(h[r]=_,h[r+1]=v);}else if(c<20)for(let v=r;v<l;v++)for(let _=v;_>r;_--){let b=h[_-1],E=h[_];if(u(b,E)<=0)break;h[_-1]=E,h[_]=b;}else d(h,u,r);}o.prototype._parseMappings=function(r,l){var c=1,v=0,_=0,b=0,E=0,w=0,T=r.length,O=0,f={},t=[],S=[],m,R,A,L;let D=0;for(;O<T;)if(r.charAt(O)===";")c++,O++,v=0,y(S,D),D=S.length;else if(r.charAt(O)===",")O++;else {for(m=new i,m.generatedLine=c,A=O;A<T&&!this._charIsMappingSeparator(r,A);A++);for(r.slice(O,A),R=[];O<A;)C.decode(r,O,f),L=f.value,O=f.rest,R.push(L);if(R.length===2)throw new Error("Found a source, but no line and column");if(R.length===3)throw new Error("Found a source and line, but no column");if(m.generatedColumn=v+R[0],v=m.generatedColumn,R.length>1&&(m.source=E+R[1],E+=R[1],m.originalLine=_+R[2],_=m.originalLine,m.originalLine+=1,m.originalColumn=b+R[3],b=m.originalColumn,R.length>4&&(m.name=w+R[4],w+=R[4])),S.push(m),typeof m.originalLine=="number"){let x=m.source;for(;t.length<=x;)t.push(null);t[x]===null&&(t[x]=[]),t[x].push(m);}}y(S,D),this.__generatedMappings=S;for(var I=0;I<t.length;I++)t[I]!=null&&d(t[I],e.compareByOriginalPositionsNoSource);this.__originalMappings=[].concat(...t);},o.prototype._findMapping=function(r,l,c,v,_,b){if(r[c]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+r[c]);if(r[v]<0)throw new TypeError("Column must be greater than or equal to 0, got "+r[v]);return a.search(r,l,_,b)},o.prototype.computeColumnSpans=function(){for(var r=0;r<this._generatedMappings.length;++r){var l=this._generatedMappings[r];if(r+1<this._generatedMappings.length){var c=this._generatedMappings[r+1];if(l.generatedLine===c.generatedLine){l.lastGeneratedColumn=c.generatedColumn-1;continue}}l.lastGeneratedColumn=1/0;}},o.prototype.originalPositionFor=function(r){var l={generatedLine:e.getArg(r,"line"),generatedColumn:e.getArg(r,"column")},c=this._findMapping(l,this._generatedMappings,"generatedLine","generatedColumn",e.compareByGeneratedPositionsDeflated,e.getArg(r,"bias",s.GREATEST_LOWER_BOUND));if(c>=0){var v=this._generatedMappings[c];if(v.generatedLine===l.generatedLine){var _=e.getArg(v,"source",null);_!==null&&(_=this._sources.at(_),_=e.computeSourceURL(this.sourceRoot,_,this._sourceMapURL));var b=e.getArg(v,"name",null);return b!==null&&(b=this._names.at(b)),{source:_,line:e.getArg(v,"originalLine",null),column:e.getArg(v,"originalColumn",null),name:b}}}return {source:null,line:null,column:null,name:null}},o.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(r){return r==null}):false},o.prototype.sourceContentFor=function(r,l){if(!this.sourcesContent)return null;var c=this._findSourceIndex(r);if(c>=0)return this.sourcesContent[c];var v=r;this.sourceRoot!=null&&(v=e.relative(this.sourceRoot,v));var _;if(this.sourceRoot!=null&&(_=e.urlParse(this.sourceRoot))){var b=v.replace(/^file:\/\//,"");if(_.scheme=="file"&&this._sources.has(b))return this.sourcesContent[this._sources.indexOf(b)];if((!_.path||_.path=="/")&&this._sources.has("/"+v))return this.sourcesContent[this._sources.indexOf("/"+v)]}if(l)return null;throw new Error('"'+v+'" is not in the SourceMap.')},o.prototype.generatedPositionFor=function(r){var l=e.getArg(r,"source");if(l=this._findSourceIndex(l),l<0)return {line:null,column:null,lastColumn:null};var c={source:l,originalLine:e.getArg(r,"line"),originalColumn:e.getArg(r,"column")},v=this._findMapping(c,this._originalMappings,"originalLine","originalColumn",e.compareByOriginalPositions,e.getArg(r,"bias",s.GREATEST_LOWER_BOUND));if(v>=0){var _=this._originalMappings[v];if(_.source===c.source)return {line:e.getArg(_,"generatedLine",null),column:e.getArg(_,"generatedColumn",null),lastColumn:e.getArg(_,"lastGeneratedColumn",null)}}return {line:null,column:null,lastColumn:null}},n.BasicSourceMapConsumer=o;function g(h,r){var l=h;typeof h=="string"&&(l=e.parseSourceMapInput(h));var c=e.getArg(l,"version"),v=e.getArg(l,"sections");if(c!=this._version)throw new Error("Unsupported version: "+c);this._sources=new p,this._names=new p;var _={line:-1,column:0};this._sections=v.map(function(b){if(b.url)throw new Error("Support for url field in sections not implemented.");var E=e.getArg(b,"offset"),w=e.getArg(E,"line"),T=e.getArg(E,"column");if(w<_.line||w===_.line&&T<_.column)throw new Error("Section offsets must be ordered and non-overlapping.");return _=E,{generatedOffset:{generatedLine:w+1,generatedColumn:T+1},consumer:new s(e.getArg(b,"map"),r)}});}g.prototype=Object.create(s.prototype),g.prototype.constructor=s,g.prototype._version=3,Object.defineProperty(g.prototype,"sources",{get:function(){for(var h=[],r=0;r<this._sections.length;r++)for(var l=0;l<this._sections[r].consumer.sources.length;l++)h.push(this._sections[r].consumer.sources[l]);return h}}),g.prototype.originalPositionFor=function(r){var l={generatedLine:e.getArg(r,"line"),generatedColumn:e.getArg(r,"column")},c=a.search(l,this._sections,function(_,b){var E=_.generatedLine-b.generatedOffset.generatedLine;return E||_.generatedColumn-b.generatedOffset.generatedColumn}),v=this._sections[c];return v?v.consumer.originalPositionFor({line:l.generatedLine-(v.generatedOffset.generatedLine-1),column:l.generatedColumn-(v.generatedOffset.generatedLine===l.generatedLine?v.generatedOffset.generatedColumn-1:0),bias:r.bias}):{source:null,line:null,column:null,name:null}},g.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(r){return r.consumer.hasContentsOfAllSources()})},g.prototype.sourceContentFor=function(r,l){for(var c=0;c<this._sections.length;c++){var v=this._sections[c],_=v.consumer.sourceContentFor(r,true);if(_||_==="")return _}if(l)return null;throw new Error('"'+r+'" is not in the SourceMap.')},g.prototype.generatedPositionFor=function(r){for(var l=0;l<this._sections.length;l++){var c=this._sections[l];if(c.consumer._findSourceIndex(e.getArg(r,"source"))!==-1){var v=c.consumer.generatedPositionFor(r);if(v){var _={line:v.line+(c.generatedOffset.generatedLine-1),column:v.column+(c.generatedOffset.generatedLine===v.line?c.generatedOffset.generatedColumn-1:0)};return _}}}return {line:null,column:null}},g.prototype._parseMappings=function(r,l){this.__generatedMappings=[],this.__originalMappings=[];for(var c=0;c<this._sections.length;c++)for(var v=this._sections[c],_=v.consumer._generatedMappings,b=0;b<_.length;b++){var E=_[b],w=v.consumer._sources.at(E.source);w!==null&&(w=e.computeSourceURL(v.consumer.sourceRoot,w,this._sourceMapURL)),this._sources.add(w),w=this._sources.indexOf(w);var T=null;E.name&&(T=v.consumer._names.at(E.name),this._names.add(T),T=this._names.indexOf(T));var O={source:w,generatedLine:E.generatedLine+(v.generatedOffset.generatedLine-1),generatedColumn:E.generatedColumn+(v.generatedOffset.generatedLine===E.generatedLine?v.generatedOffset.generatedColumn-1:0),originalLine:E.originalLine,originalColumn:E.originalColumn,name:T};this.__generatedMappings.push(O),typeof O.originalLine=="number"&&this.__originalMappings.push(O);}d(this.__generatedMappings,e.compareByGeneratedPositionsDeflated),d(this.__originalMappings,e.compareByOriginalPositions);},n.IndexedSourceMapConsumer=g;}}),lt=N({"../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/source-node.js"(n){var e=Le().SourceMapGenerator,a=H(),p=/(\r?\n)/,C=10,d="$$$isSourceNode$$$";function s(o,i,u,y,g){this.children=[],this.sourceContents={},this.line=o??null,this.column=i??null,this.source=u??null,this.name=g??null,this[d]=true,y!=null&&this.add(y);}s.fromStringWithSourceMap=function(i,u,y){var g=new s,h=i.split(p),r=0,l=function(){var E=T(),w=T()||"";return E+w;function T(){return r<h.length?h[r++]:undefined}},c=1,v=0,_=null;return u.eachMapping(function(E){if(_!==null)if(c<E.generatedLine)b(_,l()),c++,v=0;else {var w=h[r]||"",T=w.substr(0,E.generatedColumn-v);h[r]=w.substr(E.generatedColumn-v),v=E.generatedColumn,b(_,T),_=E;return}for(;c<E.generatedLine;)g.add(l()),c++;if(v<E.generatedColumn){var w=h[r]||"";g.add(w.substr(0,E.generatedColumn)),h[r]=w.substr(E.generatedColumn),v=E.generatedColumn;}_=E;},this),r<h.length&&(_&&b(_,l()),g.add(h.splice(r).join(""))),u.sources.forEach(function(E){var w=u.sourceContentFor(E);w!=null&&(y!=null&&(E=a.join(y,E)),g.setSourceContent(E,w));}),g;function b(E,w){if(E===null||E.source===undefined)g.add(w);else {var T=y?a.join(y,E.source):E.source;g.add(new s(E.originalLine,E.originalColumn,T,w,E.name));}}},s.prototype.add=function(i){if(Array.isArray(i))i.forEach(function(u){this.add(u);},this);else if(i[d]||typeof i=="string")i&&this.children.push(i);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+i);return this},s.prototype.prepend=function(i){if(Array.isArray(i))for(var u=i.length-1;u>=0;u--)this.prepend(i[u]);else if(i[d]||typeof i=="string")this.children.unshift(i);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+i);return this},s.prototype.walk=function(i){for(var u,y=0,g=this.children.length;y<g;y++)u=this.children[y],u[d]?u.walk(i):u!==""&&i(u,{source:this.source,line:this.line,column:this.column,name:this.name});},s.prototype.join=function(i){var u,y,g=this.children.length;if(g>0){for(u=[],y=0;y<g-1;y++)u.push(this.children[y]),u.push(i);u.push(this.children[y]),this.children=u;}return this},s.prototype.replaceRight=function(i,u){var y=this.children[this.children.length-1];return y[d]?y.replaceRight(i,u):typeof y=="string"?this.children[this.children.length-1]=y.replace(i,u):this.children.push("".replace(i,u)),this},s.prototype.setSourceContent=function(i,u){this.sourceContents[a.toSetString(i)]=u;},s.prototype.walkSourceContents=function(i){for(var u=0,y=this.children.length;u<y;u++)this.children[u][d]&&this.children[u].walkSourceContents(i);for(var g=Object.keys(this.sourceContents),u=0,y=g.length;u<y;u++)i(a.fromSetString(g[u]),this.sourceContents[g[u]]);},s.prototype.toString=function(){var i="";return this.walk(function(u){i+=u;}),i},s.prototype.toStringWithSourceMap=function(i){var u={code:"",line:1,column:0},y=new e(i),g=false,h=null,r=null,l=null,c=null;return this.walk(function(v,_){u.code+=v,_.source!==null&&_.line!==null&&_.column!==null?((h!==_.source||r!==_.line||l!==_.column||c!==_.name)&&y.addMapping({source:_.source,original:{line:_.line,column:_.column},generated:{line:u.line,column:u.column},name:_.name}),h=_.source,r=_.line,l=_.column,c=_.name,g=true):g&&(y.addMapping({generated:{line:u.line,column:u.column}}),h=null,g=false);for(var b=0,E=v.length;b<E;b++)v.charCodeAt(b)===C?(u.line++,u.column=0,b+1===E?(h=null,g=false):g&&y.addMapping({source:_.source,original:{line:_.line,column:_.column},generated:{line:u.line,column:u.column},name:_.name})):u.column++;}),this.walkSourceContents(function(v,_){y.setSourceContent(v,_);}),{code:u.code,map:y}},n.SourceNode=s;}}),ut=N({"../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/source-map.js"(n){n.SourceMapGenerator=Le().SourceMapGenerator,n.SourceMapConsumer=at().SourceMapConsumer,n.SourceNode=lt().SourceNode;}}),ct=Je(ut()),ae=false,k=n=>`
12
- in ${n}`,ft=/^data:application\/json[^,]+base64,/,dt=/(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^*]+?)[ \t]*(?:\*\/)[ \t]*$)/,Me=async(n,e)=>{let a=e.split(`
13
- `),p;for(let s=a.length-1;s>=0&&!p;s--){let o=a[s].match(dt);o&&(p=o[1]);}if(!p)return null;if(!(ft.test(p)||p.startsWith("/"))){let s=n.split("/");s[s.length-1]=p,p=s.join("/");}let d=await(await fetch(p)).json();return new ct.SourceMapConsumer(d)},Fe=async(n,e)=>{let a=et(n);if(!a.length)return [];let p=a.slice(0,e);return (await Promise.all(p.map(async({file:d,line:s,col:o=0})=>{if(!d||!s)return null;try{let i=await fetch(d);if(i.ok){let u=await i.text(),y=await Me(d,u);if(y){let g=y.originalPositionFor({line:s,column:o});return {fileName:(y.file||g.source).replace(/^file:\/\//,""),lineNumber:g.line,columnNumber:g.column}}}return {fileName:d.replace(/^file:\/\//,""),lineNumber:s,columnNumber:o}}catch{return {fileName:d.replace(/^file:\/\//,""),lineNumber:s,columnNumber:o}}}))).filter(d=>d!==null)},V=(n,e)=>{if(!n||ae)return "";let a=Error.prepareStackTrace;Error.prepareStackTrace=undefined,ae=true;let p=Ae();le(null);let C=console.error,d=console.warn;console.error=()=>{},console.warn=()=>{};try{let i={DetermineComponentFrameRoot(){let h;try{if(e){let r=function(){throw Error()};if(Object.defineProperty(r.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(r,[]);}catch(l){h=l;}Reflect.construct(n,[],r);}else {try{r.call();}catch(l){h=l;}n.call(r.prototype);}}else {try{throw Error()}catch(l){h=l;}let r=n();r&&typeof r.catch=="function"&&r.catch(()=>{});}}catch(r){if(r&&h&&typeof r.stack=="string")return [r.stack,h.stack]}return [null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot",Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name")?.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});let[y,g]=i.DetermineComponentFrameRoot();if(y&&g){let h=y.split(`
14
- `),r=g.split(`
15
- `),l=0,c=0;for(;l<h.length&&!h[l].includes("DetermineComponentFrameRoot");)l++;for(;c<r.length&&!r[c].includes("DetermineComponentFrameRoot");)c++;if(l===h.length||c===r.length)for(l=h.length-1,c=r.length-1;l>=1&&c>=0&&h[l]!==r[c];)c--;for(;l>=1&&c>=0;l--,c--)if(h[l]!==r[c]){if(l!==1||c!==1)do if(l--,c--,c<0||h[l]!==r[c]){let v=`
16
- ${h[l].replace(" at new "," at ")}`,_=B(n);return _&&v.includes("<anonymous>")&&(v=v.replace("<anonymous>",_)),v}while(l>=1&&c>=0);break}}}finally{ae=false,Error.prepareStackTrace=a,le(p),console.error=C,console.warn=d;}let s=n?B(n):"";return s?k(s):""},Ae=()=>{let n=j();for(let e of [...Array.from(P),...Array.from(n.renderers.values())]){let a=e.currentDispatcherRef;if(a&&typeof a=="object")return "H"in a?a.H:a.current}return null},le=n=>{for(let e of P){let a=e.currentDispatcherRef;a&&typeof a=="object"&&("H"in a?a.H=n:a.current=n);}};var Ne=(n,e)=>{switch(n.tag){case ne:case re:case Q:return k(n.type);case ee:return k("Lazy");case J:return n.child!==e&&e!==null?k("Suspense Fallback"):k("Suspense");case te:return k("SuspenseList");case Y:case Z:return V(n.type,false);case X:return V(n.type.render,false);case K:return V(n.type,true);case oe:return k("Activity");case ie:return k("ViewTransition");default:return ""}},Ie=(n,e,a)=>{let p=`
17
- in ${n}`;return e&&(p+=` (at ${e})`),p},ue=n=>{try{let e="",a=n,p=null;do{e+=Ne(a,p);let C=a._debugInfo;if(C&&Array.isArray(C))for(let d=C.length-1;d>=0;d--){let s=C[d];typeof s.name=="string"&&(e+=Ie(s.name,s.env,s.debugLocation));}p=a,a=a.return;}while(a);return e}catch(e){return e instanceof Error?`
9
+ var me="0.3.28",q=`bippy-${me}`,fe=Object.defineProperty,He=Object.prototype.hasOwnProperty,x=()=>{},pe=t=>{try{Function.prototype.toString.call(t).indexOf("^_^")>-1&&setTimeout(()=>{throw new Error("React is running in production mode, but dead code elimination has not been applied. Read how to correctly configure React for production: https://reactjs.org/link/perf-use-production-build")});}catch{}},he=(t=D())=>"getFiberRoots"in t,ge=false,de,W=(t=D())=>ge?true:(typeof t.inject=="function"&&(de=t.inject.toString()),!!de?.includes("(injected)")),$=new Set,j=new Set,ve=t=>{let e=new Map,o=0,c={checkDCE:pe,supportsFiber:true,supportsFlight:true,hasUnsupportedRendererAttached:false,renderers:e,onCommitFiberRoot:x,onCommitFiberUnmount:x,onPostCommitFiberRoot:x,on:x,inject(g){let u=++o;return e.set(u,g),j.add(g),c._instrumentationIsActive||(c._instrumentationIsActive=true,$.forEach(s=>s())),u},_instrumentationSource:q,_instrumentationIsActive:false};try{fe(globalThis,"__REACT_DEVTOOLS_GLOBAL_HOOK__",{get(){return c},set(s){if(s&&typeof s=="object"){let i=c.renderers;c=s,i.size>0&&(i.forEach((n,l)=>{j.add(n),s.renderers.set(l,n);}),z(t));}},configurable:!0,enumerable:!0});let g=window.hasOwnProperty,u=!1;fe(window,"hasOwnProperty",{value:function(){try{if(!u&&arguments[0]==="__REACT_DEVTOOLS_GLOBAL_HOOK__")return globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__=void 0,u=!0,-0}catch{}return g.apply(this,arguments)},configurable:!0,writable:!0});}catch{z(t);}return c},z=t=>{try{let e=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!e)return;if(!e._instrumentationSource){if(e.checkDCE=pe,e.supportsFiber=!0,e.supportsFlight=!0,e.hasUnsupportedRendererAttached=!1,e._instrumentationSource=q,e._instrumentationIsActive=!1,e.on=x,e.renderers.size){e._instrumentationIsActive=!0,$.forEach(c=>c());return}let o=e.inject;W(e)&&!he()&&(ge=!0,e.inject({scheduleRefresh(){}})&&(e._instrumentationIsActive=!0)),e.inject=c=>{let g=o(c);return j.add(c),e._instrumentationIsActive=!0,$.forEach(u=>u()),g};}(e.renderers.size||e._instrumentationIsActive||W())&&t?.();}catch{}},_e=()=>He.call(globalThis,"__REACT_DEVTOOLS_GLOBAL_HOOK__"),D=t=>_e()?(z(t),globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__):ve(t),ye=()=>!!(typeof window<"u"&&(window.document?.createElement||window.navigator?.product==="ReactNative")),Ce=()=>{try{ye()&&D();}catch{}},Y=0,K=1;var Q=5;var X=11,J=13;var Z=15,ee=16;var te=19;var ne=26,re=27,oe=28,ie=30;var U=t=>{let e=t;return typeof e=="function"?e:typeof e=="object"&&e?U(e.type||e.render):null},B=t=>{let e=t;if(typeof e=="string")return e;if(typeof e!="function"&&!(typeof e=="object"&&e))return null;let o=e.displayName||e.name||null;if(o)return o;let c=U(e);return c&&(c.displayName||c.name)||null};var se=t=>{let e=D();for(let o of e.renderers.values())try{let c=o.findFiberByHostInstance?.(t);if(c)return c}catch{}if(typeof t=="object"&&t!=null){if("_reactRootContainer"in t)return t._reactRootContainer?._internalRoot?.current?.child;for(let o in t)if(o.startsWith("__reactContainer$")||o.startsWith("__reactInternalInstance$")||o.startsWith("__reactFiber"))return t[o]||null}return null};Ce();var Xe=Object.create,Se=Object.defineProperty,Je=Object.getOwnPropertyDescriptor,be=Object.getOwnPropertyNames,Ze=Object.getPrototypeOf,et=Object.prototype.hasOwnProperty,I=(t,e)=>function(){return e||(0, t[be(t)[0]])((e={exports:{}}).exports,e),e.exports},tt=(t,e,o,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(var g=be(e),u=0,s=g.length,i;u<s;u++)i=g[u],!et.call(t,i)&&i!==o&&Se(t,i,{get:(n=>e[n]).bind(null,i),enumerable:!(c=Je(e,i))||c.enumerable});return t},nt=(t,e,o)=>(o=t!=null?Xe(Ze(t)):{},tt(Se(o,"default",{value:t,enumerable:true}),t)),Ee=/^\s*at .*(\S+:\d+|\(native\))/m,rt=/^(eval@)?(\[native code\])?$/;function ot(t,e){return t.match(Ee)?it(t,e):st(t,e)}function we(t){if(!t.includes(":"))return [t,undefined,undefined];let o=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));return [o[1],o[2]||undefined,o[3]||undefined]}function Te(t,e){return e&&e.slice!=null?Array.isArray(e.slice)?t.slice(e.slice[0],e.slice[1]):t.slice(0,e.slice):t}function it(t,e){return Te(t.split(`
10
+ `).filter(c=>!!c.match(Ee)),e).map(c=>{c.includes("(eval ")&&(c=c.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));let g=c.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),u=g.match(/ (\(.+\)$)/);g=u?g.replace(u[0],""):g;let s=we(u?u[1]:g),i=u&&g||undefined,n=["eval","<anonymous>"].includes(s[0])?undefined:s[0];return {function:i,file:n,line:s[1]?+s[1]:undefined,col:s[2]?+s[2]:undefined,raw:c}})}function st(t,e){return Te(t.split(`
11
+ `).filter(c=>!c.match(rt)),e).map(c=>{if(c.includes(" > eval")&&(c=c.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),!c.includes("@")&&!c.includes(":"))return {function:c};{let g=/(([^\n\r"\u2028\u2029]*".[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*(?:@[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*)*(?:[\n\r\u2028\u2029][^@]*)?)?[^@]*)@/,u=c.match(g),s=u&&u[1]?u[1]:undefined,i=we(c.replace(g,""));return {function:s,file:i[0],line:i[1]?+i[1]:undefined,col:i[2]?+i[2]:undefined,raw:c}}})}var at=I({"../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/base64.js"(t){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");t.encode=function(o){if(0<=o&&o<e.length)return e[o];throw new TypeError("Must be between 0 and 63: "+o)},t.decode=function(o){var c=65,g=90,u=97,s=122,i=48,n=57,l=43,_=47,v=26,p=52;return c<=o&&o<=g?o-c:u<=o&&o<=s?o-u+v:i<=o&&o<=n?o-i+p:o==l?62:o==_?63:-1};}}),Le=I({"../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/base64-vlq.js"(t){var e=at(),o=5,c=1<<o,g=c-1,u=c;function s(n){return n<0?(-n<<1)+1:(n<<1)+0}function i(n){var l=(n&1)===1,_=n>>1;return l?-_:_}t.encode=function(l){var _="",v,p=s(l);do v=p&g,p>>>=o,p>0&&(v|=u),_+=e.encode(v);while(p>0);return _},t.decode=function(l,_,v){var p=l.length,r=0,a=0,f,y;do{if(_>=p)throw new Error("Expected more digits in base 64 VLQ value.");if(y=e.decode(l.charCodeAt(_++)),y===-1)throw new Error("Invalid base64 digit: "+l.charAt(_-1));f=!!(y&u),y&=g,r=r+(y<<a),a+=o;}while(f);v.value=i(r),v.rest=_;};}}),H=I({"../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/util.js"(t){function e(d,m,b){if(m in d)return d[m];if(arguments.length===3)return b;throw new Error('"'+m+'" is a required argument.')}t.getArg=e;var o=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,c=/^data:.+\,.+$/;function g(d){var m=d.match(o);return m?{scheme:m[1],auth:m[2],host:m[3],port:m[4],path:m[5]}:null}t.urlParse=g;function u(d){var m="";return d.scheme&&(m+=d.scheme+":"),m+="//",d.auth&&(m+=d.auth+"@"),d.host&&(m+=d.host),d.port&&(m+=":"+d.port),d.path&&(m+=d.path),m}t.urlGenerate=u;var s=32;function i(d){var m=[];return function(b){for(var h=0;h<m.length;h++)if(m[h].input===b){var w=m[0];return m[0]=m[h],m[h]=w,m[0].result}var L=d(b);return m.unshift({input:b,result:L}),m.length>s&&m.pop(),L}}var n=i(function(m){var b=m,h=g(m);if(h){if(!h.path)return m;b=h.path;}for(var w=t.isAbsolute(b),L=[],M=0,F=0;;)if(M=F,F=b.indexOf("/",M),F===-1){L.push(b.slice(M));break}else for(L.push(b.slice(M,F));F<b.length&&b[F]==="/";)F++;for(var k,N=0,F=L.length-1;F>=0;F--)k=L[F],k==="."?L.splice(F,1):k===".."?N++:N>0&&(k===""?(L.splice(F+1,N),N=0):(L.splice(F,2),N--));return b=L.join("/"),b===""&&(b=w?"/":"."),h?(h.path=b,u(h)):b});t.normalize=n;function l(d,m){d===""&&(d="."),m===""&&(m=".");var b=g(m),h=g(d);if(h&&(d=h.path||"/"),b&&!b.scheme)return h&&(b.scheme=h.scheme),u(b);if(b||m.match(c))return m;if(h&&!h.host&&!h.path)return h.host=m,u(h);var w=m.charAt(0)==="/"?m:n(d.replace(/\/+$/,"")+"/"+m);return h?(h.path=w,u(h)):w}t.join=l,t.isAbsolute=function(d){return d.charAt(0)==="/"||o.test(d)};function _(d,m){d===""&&(d="."),d=d.replace(/\/$/,"");for(var b=0;m.indexOf(d+"/")!==0;){var h=d.lastIndexOf("/");if(h<0||(d=d.slice(0,h),d.match(/^([^\/]+:\/)?\/*$/)))return m;++b;}return Array(b+1).join("../")+m.substr(d.length+1)}t.relative=_;var v=function(){var d=Object.create(null);return !("__proto__"in d)}();function p(d){return d}function r(d){return f(d)?"$"+d:d}t.toSetString=v?p:r;function a(d){return f(d)?d.slice(1):d}t.fromSetString=v?p:a;function f(d){if(!d)return false;var m=d.length;if(m<9||d.charCodeAt(m-1)!==95||d.charCodeAt(m-2)!==95||d.charCodeAt(m-3)!==111||d.charCodeAt(m-4)!==116||d.charCodeAt(m-5)!==111||d.charCodeAt(m-6)!==114||d.charCodeAt(m-7)!==112||d.charCodeAt(m-8)!==95||d.charCodeAt(m-9)!==95)return false;for(var b=m-10;b>=0;b--)if(d.charCodeAt(b)!==36)return false;return true}function y(d,m,b){var h=T(d.source,m.source);return h!==0||(h=d.originalLine-m.originalLine,h!==0)||(h=d.originalColumn-m.originalColumn,h!==0||b)||(h=d.generatedColumn-m.generatedColumn,h!==0)||(h=d.generatedLine-m.generatedLine,h!==0)?h:T(d.name,m.name)}t.compareByOriginalPositions=y;function C(d,m,b){var h;return h=d.originalLine-m.originalLine,h!==0||(h=d.originalColumn-m.originalColumn,h!==0||b)||(h=d.generatedColumn-m.generatedColumn,h!==0)||(h=d.generatedLine-m.generatedLine,h!==0)?h:T(d.name,m.name)}t.compareByOriginalPositionsNoSource=C;function S(d,m,b){var h=d.generatedLine-m.generatedLine;return h!==0||(h=d.generatedColumn-m.generatedColumn,h!==0||b)||(h=T(d.source,m.source),h!==0)||(h=d.originalLine-m.originalLine,h!==0)||(h=d.originalColumn-m.originalColumn,h!==0)?h:T(d.name,m.name)}t.compareByGeneratedPositionsDeflated=S;function E(d,m,b){var h=d.generatedColumn-m.generatedColumn;return h!==0||b||(h=T(d.source,m.source),h!==0)||(h=d.originalLine-m.originalLine,h!==0)||(h=d.originalColumn-m.originalColumn,h!==0)?h:T(d.name,m.name)}t.compareByGeneratedPositionsDeflatedNoLine=E;function T(d,m){return d===m?0:d===null?1:m===null?-1:d>m?1:-1}function O(d,m){var b=d.generatedLine-m.generatedLine;return b!==0||(b=d.generatedColumn-m.generatedColumn,b!==0)||(b=T(d.source,m.source),b!==0)||(b=d.originalLine-m.originalLine,b!==0)||(b=d.originalColumn-m.originalColumn,b!==0)?b:T(d.name,m.name)}t.compareByGeneratedPositionsInflated=O;function R(d){return JSON.parse(d.replace(/^\)]}'[^\n]*\n/,""))}t.parseSourceMapInput=R;function A(d,m,b){if(m=m||"",d&&(d[d.length-1]!=="/"&&m[0]!=="/"&&(d+="/"),m=d+m),b){var h=g(b);if(!h)throw new Error("sourceMapURL could not be parsed");if(h.path){var w=h.path.lastIndexOf("/");w>=0&&(h.path=h.path.substring(0,w+1));}m=l(u(h),m);}return n(m)}t.computeSourceURL=A;}}),Oe=I({"../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/array-set.js"(t){var e=H(),o=Object.prototype.hasOwnProperty,c=typeof Map<"u";function g(){this._array=[],this._set=c?new Map:Object.create(null);}g.fromArray=function(s,i){for(var n=new g,l=0,_=s.length;l<_;l++)n.add(s[l],i);return n},g.prototype.size=function(){return c?this._set.size:Object.getOwnPropertyNames(this._set).length},g.prototype.add=function(s,i){var n=c?s:e.toSetString(s),l=c?this.has(s):o.call(this._set,n),_=this._array.length;(!l||i)&&this._array.push(s),l||(c?this._set.set(s,_):this._set[n]=_);},g.prototype.has=function(s){if(c)return this._set.has(s);var i=e.toSetString(s);return o.call(this._set,i)},g.prototype.indexOf=function(s){if(c){var i=this._set.get(s);if(i>=0)return i}else {var n=e.toSetString(s);if(o.call(this._set,n))return this._set[n]}throw new Error('"'+s+'" is not in the set.')},g.prototype.at=function(s){if(s>=0&&s<this._array.length)return this._array[s];throw new Error("No element indexed by "+s)},g.prototype.toArray=function(){return this._array.slice()},t.ArraySet=g;}}),lt=I({"../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/mapping-list.js"(t){var e=H();function o(g,u){var s=g.generatedLine,i=u.generatedLine,n=g.generatedColumn,l=u.generatedColumn;return i>s||i==s&&l>=n||e.compareByGeneratedPositionsInflated(g,u)<=0}function c(){this._array=[],this._sorted=true,this._last={generatedLine:-1,generatedColumn:0};}c.prototype.unsortedForEach=function(u,s){this._array.forEach(u,s);},c.prototype.add=function(u){o(this._last,u)?(this._last=u,this._array.push(u)):(this._sorted=false,this._array.push(u));},c.prototype.toArray=function(){return this._sorted||(this._array.sort(e.compareByGeneratedPositionsInflated),this._sorted=true),this._array},t.MappingList=c;}}),Re=I({"../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/source-map-generator.js"(t){var e=Le(),o=H(),c=Oe().ArraySet,g=lt().MappingList;function u(s){s||(s={}),this._file=o.getArg(s,"file",null),this._sourceRoot=o.getArg(s,"sourceRoot",null),this._skipValidation=o.getArg(s,"skipValidation",false),this._ignoreInvalidMapping=o.getArg(s,"ignoreInvalidMapping",false),this._sources=new c,this._names=new c,this._mappings=new g,this._sourcesContents=null;}u.prototype._version=3,u.fromSourceMap=function(i,n){var l=i.sourceRoot,_=new u(Object.assign(n||{},{file:i.file,sourceRoot:l}));return i.eachMapping(function(v){var p={generated:{line:v.generatedLine,column:v.generatedColumn}};v.source!=null&&(p.source=v.source,l!=null&&(p.source=o.relative(l,p.source)),p.original={line:v.originalLine,column:v.originalColumn},v.name!=null&&(p.name=v.name)),_.addMapping(p);}),i.sources.forEach(function(v){var p=v;l!==null&&(p=o.relative(l,v)),_._sources.has(p)||_._sources.add(p);var r=i.sourceContentFor(v);r!=null&&_.setSourceContent(v,r);}),_},u.prototype.addMapping=function(i){var n=o.getArg(i,"generated"),l=o.getArg(i,"original",null),_=o.getArg(i,"source",null),v=o.getArg(i,"name",null);!this._skipValidation&&this._validateMapping(n,l,_,v)===false||(_!=null&&(_=String(_),this._sources.has(_)||this._sources.add(_)),v!=null&&(v=String(v),this._names.has(v)||this._names.add(v)),this._mappings.add({generatedLine:n.line,generatedColumn:n.column,originalLine:l!=null&&l.line,originalColumn:l!=null&&l.column,source:_,name:v}));},u.prototype.setSourceContent=function(i,n){var l=i;this._sourceRoot!=null&&(l=o.relative(this._sourceRoot,l)),n!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[o.toSetString(l)]=n):this._sourcesContents&&(delete this._sourcesContents[o.toSetString(l)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null));},u.prototype.applySourceMap=function(i,n,l){var _=n;if(n==null){if(i.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);_=i.file;}var v=this._sourceRoot;v!=null&&(_=o.relative(v,_));var p=new c,r=new c;this._mappings.unsortedForEach(function(a){if(a.source===_&&a.originalLine!=null){var f=i.originalPositionFor({line:a.originalLine,column:a.originalColumn});f.source!=null&&(a.source=f.source,l!=null&&(a.source=o.join(l,a.source)),v!=null&&(a.source=o.relative(v,a.source)),a.originalLine=f.line,a.originalColumn=f.column,f.name!=null&&(a.name=f.name));}var y=a.source;y!=null&&!p.has(y)&&p.add(y);var C=a.name;C!=null&&!r.has(C)&&r.add(C);},this),this._sources=p,this._names=r,i.sources.forEach(function(a){var f=i.sourceContentFor(a);f!=null&&(l!=null&&(a=o.join(l,a)),v!=null&&(a=o.relative(v,a)),this.setSourceContent(a,f));},this);},u.prototype._validateMapping=function(i,n,l,_){if(n&&typeof n.line!="number"&&typeof n.column!="number"){var v="original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.";if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(v),false;throw new Error(v)}if(!(i&&"line"in i&&"column"in i&&i.line>0&&i.column>=0&&!n&&!l&&!_)){if(i&&"line"in i&&"column"in i&&n&&"line"in n&&"column"in n&&i.line>0&&i.column>=0&&n.line>0&&n.column>=0&&l)return;var v="Invalid mapping: "+JSON.stringify({generated:i,source:l,original:n,name:_});if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(v),false;throw new Error(v)}},u.prototype._serializeMappings=function(){for(var i=0,n=1,l=0,_=0,v=0,p=0,r="",a,f,y,C,S=this._mappings.toArray(),E=0,T=S.length;E<T;E++){if(f=S[E],a="",f.generatedLine!==n)for(i=0;f.generatedLine!==n;)a+=";",n++;else if(E>0){if(!o.compareByGeneratedPositionsInflated(f,S[E-1]))continue;a+=",";}a+=e.encode(f.generatedColumn-i),i=f.generatedColumn,f.source!=null&&(C=this._sources.indexOf(f.source),a+=e.encode(C-p),p=C,a+=e.encode(f.originalLine-1-_),_=f.originalLine-1,a+=e.encode(f.originalColumn-l),l=f.originalColumn,f.name!=null&&(y=this._names.indexOf(f.name),a+=e.encode(y-v),v=y)),r+=a;}return r},u.prototype._generateSourcesContent=function(i,n){return i.map(function(l){if(!this._sourcesContents)return null;n!=null&&(l=o.relative(n,l));var _=o.toSetString(l);return Object.prototype.hasOwnProperty.call(this._sourcesContents,_)?this._sourcesContents[_]:null},this)},u.prototype.toJSON=function(){var i={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(i.file=this._file),this._sourceRoot!=null&&(i.sourceRoot=this._sourceRoot),this._sourcesContents&&(i.sourcesContent=this._generateSourcesContent(i.sources,i.sourceRoot)),i},u.prototype.toString=function(){return JSON.stringify(this.toJSON())},t.SourceMapGenerator=u;}}),ut=I({"../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/binary-search.js"(t){t.GREATEST_LOWER_BOUND=1,t.LEAST_UPPER_BOUND=2;function e(o,c,g,u,s,i){var n=Math.floor((c-o)/2)+o,l=s(g,u[n],true);return l===0?n:l>0?c-n>1?e(n,c,g,u,s,i):i==t.LEAST_UPPER_BOUND?c<u.length?c:-1:n:n-o>1?e(o,n,g,u,s,i):i==t.LEAST_UPPER_BOUND?n:o<0?-1:o}t.search=function(c,g,u,s){if(g.length===0)return -1;var i=e(-1,g.length,c,g,u,s||t.GREATEST_LOWER_BOUND);if(i<0)return -1;for(;i-1>=0&&u(g[i],g[i-1],true)===0;)--i;return i};}}),ct=I({"../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/quick-sort.js"(t){function e(g){function u(n,l,_){var v=n[l];n[l]=n[_],n[_]=v;}function s(n,l){return Math.round(n+Math.random()*(l-n))}function i(n,l,_,v){if(_<v){var p=s(_,v),r=_-1;u(n,p,v);for(var a=n[v],f=_;f<v;f++)l(n[f],a,false)<=0&&(r+=1,u(n,r,f));u(n,r+1,f);var y=r+1;i(n,l,_,y-1),i(n,l,y+1,v);}}return i}function o(g){let u=e.toString();return new Function(`return ${u}`)()(g)}let c=new WeakMap;t.quickSort=function(g,u,s=0){let i=c.get(u);i===undefined&&(i=o(u),c.set(u,i)),i(g,u,s,g.length-1);};}}),ft=I({"../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/source-map-consumer.js"(t){var e=H(),o=ut(),c=Oe().ArraySet,g=Le(),u=ct().quickSort;function s(p,r){var a=p;return typeof p=="string"&&(a=e.parseSourceMapInput(p)),a.sections!=null?new v(a,r):new i(a,r)}s.fromSourceMap=function(p,r){return i.fromSourceMap(p,r)},s.prototype._version=3,s.prototype.__generatedMappings=null,Object.defineProperty(s.prototype,"_generatedMappings",{configurable:true,enumerable:true,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),s.prototype.__originalMappings=null,Object.defineProperty(s.prototype,"_originalMappings",{configurable:true,enumerable:true,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),s.prototype._charIsMappingSeparator=function(r,a){var f=r.charAt(a);return f===";"||f===","},s.prototype._parseMappings=function(r,a){throw new Error("Subclasses must implement _parseMappings")},s.GENERATED_ORDER=1,s.ORIGINAL_ORDER=2,s.GREATEST_LOWER_BOUND=1,s.LEAST_UPPER_BOUND=2,s.prototype.eachMapping=function(r,a,f){var y=a||null,C=f||s.GENERATED_ORDER,S;switch(C){case s.GENERATED_ORDER:S=this._generatedMappings;break;case s.ORIGINAL_ORDER:S=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}for(var E=this.sourceRoot,T=r.bind(y),O=this._names,R=this._sources,A=this._sourceMapURL,d=0,m=S.length;d<m;d++){var b=S[d],h=b.source===null?null:R.at(b.source);h!==null&&(h=e.computeSourceURL(E,h,A)),T({source:h,generatedLine:b.generatedLine,generatedColumn:b.generatedColumn,originalLine:b.originalLine,originalColumn:b.originalColumn,name:b.name===null?null:O.at(b.name)});}},s.prototype.allGeneratedPositionsFor=function(r){var a=e.getArg(r,"line"),f={source:e.getArg(r,"source"),originalLine:a,originalColumn:e.getArg(r,"column",0)};if(f.source=this._findSourceIndex(f.source),f.source<0)return [];var y=[],C=this._findMapping(f,this._originalMappings,"originalLine","originalColumn",e.compareByOriginalPositions,o.LEAST_UPPER_BOUND);if(C>=0){var S=this._originalMappings[C];if(r.column===undefined)for(var E=S.originalLine;S&&S.originalLine===E;)y.push({line:e.getArg(S,"generatedLine",null),column:e.getArg(S,"generatedColumn",null),lastColumn:e.getArg(S,"lastGeneratedColumn",null)}),S=this._originalMappings[++C];else for(var T=S.originalColumn;S&&S.originalLine===a&&S.originalColumn==T;)y.push({line:e.getArg(S,"generatedLine",null),column:e.getArg(S,"generatedColumn",null),lastColumn:e.getArg(S,"lastGeneratedColumn",null)}),S=this._originalMappings[++C];}return y},t.SourceMapConsumer=s;function i(p,r){var a=p;typeof p=="string"&&(a=e.parseSourceMapInput(p));var f=e.getArg(a,"version"),y=e.getArg(a,"sources"),C=e.getArg(a,"names",[]),S=e.getArg(a,"sourceRoot",null),E=e.getArg(a,"sourcesContent",null),T=e.getArg(a,"mappings"),O=e.getArg(a,"file",null);if(f!=this._version)throw new Error("Unsupported version: "+f);S&&(S=e.normalize(S)),y=y.map(String).map(e.normalize).map(function(R){return S&&e.isAbsolute(S)&&e.isAbsolute(R)?e.relative(S,R):R}),this._names=c.fromArray(C.map(String),true),this._sources=c.fromArray(y,true),this._absoluteSources=this._sources.toArray().map(function(R){return e.computeSourceURL(S,R,r)}),this.sourceRoot=S,this.sourcesContent=E,this._mappings=T,this._sourceMapURL=r,this.file=O;}i.prototype=Object.create(s.prototype),i.prototype.consumer=s,i.prototype._findSourceIndex=function(p){var r=p;if(this.sourceRoot!=null&&(r=e.relative(this.sourceRoot,r)),this._sources.has(r))return this._sources.indexOf(r);var a;for(a=0;a<this._absoluteSources.length;++a)if(this._absoluteSources[a]==p)return a;return -1},i.fromSourceMap=function(r,a){var f=Object.create(i.prototype),y=f._names=c.fromArray(r._names.toArray(),true),C=f._sources=c.fromArray(r._sources.toArray(),true);f.sourceRoot=r._sourceRoot,f.sourcesContent=r._generateSourcesContent(f._sources.toArray(),f.sourceRoot),f.file=r._file,f._sourceMapURL=a,f._absoluteSources=f._sources.toArray().map(function(m){return e.computeSourceURL(f.sourceRoot,m,a)});for(var S=r._mappings.toArray().slice(),E=f.__generatedMappings=[],T=f.__originalMappings=[],O=0,R=S.length;O<R;O++){var A=S[O],d=new n;d.generatedLine=A.generatedLine,d.generatedColumn=A.generatedColumn,A.source&&(d.source=C.indexOf(A.source),d.originalLine=A.originalLine,d.originalColumn=A.originalColumn,A.name&&(d.name=y.indexOf(A.name)),T.push(d)),E.push(d);}return u(f.__originalMappings,e.compareByOriginalPositions),f},i.prototype._version=3,Object.defineProperty(i.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function n(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null;}let l=e.compareByGeneratedPositionsDeflatedNoLine;function _(p,r){let a=p.length,f=p.length-r;if(!(f<=1))if(f==2){let y=p[r],C=p[r+1];l(y,C)>0&&(p[r]=C,p[r+1]=y);}else if(f<20)for(let y=r;y<a;y++)for(let C=y;C>r;C--){let S=p[C-1],E=p[C];if(l(S,E)<=0)break;p[C-1]=E,p[C]=S;}else u(p,l,r);}i.prototype._parseMappings=function(r,a){var f=1,y=0,C=0,S=0,E=0,T=0,O=r.length,R=0,d={},m=[],b=[],h,L,M,F;let k=0;for(;R<O;)if(r.charAt(R)===";")f++,R++,y=0,_(b,k),k=b.length;else if(r.charAt(R)===",")R++;else {for(h=new n,h.generatedLine=f,M=R;M<O&&!this._charIsMappingSeparator(r,M);M++);for(r.slice(R,M),L=[];R<M;)g.decode(r,R,d),F=d.value,R=d.rest,L.push(F);if(L.length===2)throw new Error("Found a source, but no line and column");if(L.length===3)throw new Error("Found a source and line, but no column");if(h.generatedColumn=y+L[0],y=h.generatedColumn,L.length>1&&(h.source=E+L[1],E+=L[1],h.originalLine=C+L[2],C=h.originalLine,h.originalLine+=1,h.originalColumn=S+L[3],S=h.originalColumn,L.length>4&&(h.name=T+L[4],T+=L[4])),b.push(h),typeof h.originalLine=="number"){let G=h.source;for(;m.length<=G;)m.push(null);m[G]===null&&(m[G]=[]),m[G].push(h);}}_(b,k),this.__generatedMappings=b;for(var N=0;N<m.length;N++)m[N]!=null&&u(m[N],e.compareByOriginalPositionsNoSource);this.__originalMappings=[].concat(...m);},i.prototype._findMapping=function(r,a,f,y,C,S){if(r[f]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+r[f]);if(r[y]<0)throw new TypeError("Column must be greater than or equal to 0, got "+r[y]);return o.search(r,a,C,S)},i.prototype.computeColumnSpans=function(){for(var r=0;r<this._generatedMappings.length;++r){var a=this._generatedMappings[r];if(r+1<this._generatedMappings.length){var f=this._generatedMappings[r+1];if(a.generatedLine===f.generatedLine){a.lastGeneratedColumn=f.generatedColumn-1;continue}}a.lastGeneratedColumn=1/0;}},i.prototype.originalPositionFor=function(r){var a={generatedLine:e.getArg(r,"line"),generatedColumn:e.getArg(r,"column")},f=this._findMapping(a,this._generatedMappings,"generatedLine","generatedColumn",e.compareByGeneratedPositionsDeflated,e.getArg(r,"bias",s.GREATEST_LOWER_BOUND));if(f>=0){var y=this._generatedMappings[f];if(y.generatedLine===a.generatedLine){var C=e.getArg(y,"source",null);C!==null&&(C=this._sources.at(C),C=e.computeSourceURL(this.sourceRoot,C,this._sourceMapURL));var S=e.getArg(y,"name",null);return S!==null&&(S=this._names.at(S)),{source:C,line:e.getArg(y,"originalLine",null),column:e.getArg(y,"originalColumn",null),name:S}}}return {source:null,line:null,column:null,name:null}},i.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(r){return r==null}):false},i.prototype.sourceContentFor=function(r,a){if(!this.sourcesContent)return null;var f=this._findSourceIndex(r);if(f>=0)return this.sourcesContent[f];var y=r;this.sourceRoot!=null&&(y=e.relative(this.sourceRoot,y));var C;if(this.sourceRoot!=null&&(C=e.urlParse(this.sourceRoot))){var S=y.replace(/^file:\/\//,"");if(C.scheme=="file"&&this._sources.has(S))return this.sourcesContent[this._sources.indexOf(S)];if((!C.path||C.path=="/")&&this._sources.has("/"+y))return this.sourcesContent[this._sources.indexOf("/"+y)]}if(a)return null;throw new Error('"'+y+'" is not in the SourceMap.')},i.prototype.generatedPositionFor=function(r){var a=e.getArg(r,"source");if(a=this._findSourceIndex(a),a<0)return {line:null,column:null,lastColumn:null};var f={source:a,originalLine:e.getArg(r,"line"),originalColumn:e.getArg(r,"column")},y=this._findMapping(f,this._originalMappings,"originalLine","originalColumn",e.compareByOriginalPositions,e.getArg(r,"bias",s.GREATEST_LOWER_BOUND));if(y>=0){var C=this._originalMappings[y];if(C.source===f.source)return {line:e.getArg(C,"generatedLine",null),column:e.getArg(C,"generatedColumn",null),lastColumn:e.getArg(C,"lastGeneratedColumn",null)}}return {line:null,column:null,lastColumn:null}},t.BasicSourceMapConsumer=i;function v(p,r){var a=p;typeof p=="string"&&(a=e.parseSourceMapInput(p));var f=e.getArg(a,"version"),y=e.getArg(a,"sections");if(f!=this._version)throw new Error("Unsupported version: "+f);this._sources=new c,this._names=new c;var C={line:-1,column:0};this._sections=y.map(function(S){if(S.url)throw new Error("Support for url field in sections not implemented.");var E=e.getArg(S,"offset"),T=e.getArg(E,"line"),O=e.getArg(E,"column");if(T<C.line||T===C.line&&O<C.column)throw new Error("Section offsets must be ordered and non-overlapping.");return C=E,{generatedOffset:{generatedLine:T+1,generatedColumn:O+1},consumer:new s(e.getArg(S,"map"),r)}});}v.prototype=Object.create(s.prototype),v.prototype.constructor=s,v.prototype._version=3,Object.defineProperty(v.prototype,"sources",{get:function(){for(var p=[],r=0;r<this._sections.length;r++)for(var a=0;a<this._sections[r].consumer.sources.length;a++)p.push(this._sections[r].consumer.sources[a]);return p}}),v.prototype.originalPositionFor=function(r){var a={generatedLine:e.getArg(r,"line"),generatedColumn:e.getArg(r,"column")},f=o.search(a,this._sections,function(C,S){var E=C.generatedLine-S.generatedOffset.generatedLine;return E||C.generatedColumn-S.generatedOffset.generatedColumn}),y=this._sections[f];return y?y.consumer.originalPositionFor({line:a.generatedLine-(y.generatedOffset.generatedLine-1),column:a.generatedColumn-(y.generatedOffset.generatedLine===a.generatedLine?y.generatedOffset.generatedColumn-1:0),bias:r.bias}):{source:null,line:null,column:null,name:null}},v.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(r){return r.consumer.hasContentsOfAllSources()})},v.prototype.sourceContentFor=function(r,a){for(var f=0;f<this._sections.length;f++){var y=this._sections[f],C=y.consumer.sourceContentFor(r,true);if(C||C==="")return C}if(a)return null;throw new Error('"'+r+'" is not in the SourceMap.')},v.prototype.generatedPositionFor=function(r){for(var a=0;a<this._sections.length;a++){var f=this._sections[a];if(f.consumer._findSourceIndex(e.getArg(r,"source"))!==-1){var y=f.consumer.generatedPositionFor(r);if(y){var C={line:y.line+(f.generatedOffset.generatedLine-1),column:y.column+(f.generatedOffset.generatedLine===y.line?f.generatedOffset.generatedColumn-1:0)};return C}}}return {line:null,column:null}},v.prototype._parseMappings=function(r,a){this.__generatedMappings=[],this.__originalMappings=[];for(var f=0;f<this._sections.length;f++)for(var y=this._sections[f],C=y.consumer._generatedMappings,S=0;S<C.length;S++){var E=C[S],T=y.consumer._sources.at(E.source);T!==null&&(T=e.computeSourceURL(y.consumer.sourceRoot,T,this._sourceMapURL)),this._sources.add(T),T=this._sources.indexOf(T);var O=null;E.name&&(O=y.consumer._names.at(E.name),this._names.add(O),O=this._names.indexOf(O));var R={source:T,generatedLine:E.generatedLine+(y.generatedOffset.generatedLine-1),generatedColumn:E.generatedColumn+(y.generatedOffset.generatedLine===E.generatedLine?y.generatedOffset.generatedColumn-1:0),originalLine:E.originalLine,originalColumn:E.originalColumn,name:O};this.__generatedMappings.push(R),typeof R.originalLine=="number"&&this.__originalMappings.push(R);}u(this.__generatedMappings,e.compareByGeneratedPositionsDeflated),u(this.__originalMappings,e.compareByOriginalPositions);},t.IndexedSourceMapConsumer=v;}}),dt=I({"../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/source-node.js"(t){var e=Re().SourceMapGenerator,o=H(),c=/(\r?\n)/,g=10,u="$$$isSourceNode$$$";function s(i,n,l,_,v){this.children=[],this.sourceContents={},this.line=i??null,this.column=n??null,this.source=l??null,this.name=v??null,this[u]=true,_!=null&&this.add(_);}s.fromStringWithSourceMap=function(n,l,_){var v=new s,p=n.split(c),r=0,a=function(){var E=O(),T=O()||"";return E+T;function O(){return r<p.length?p[r++]:undefined}},f=1,y=0,C=null;return l.eachMapping(function(E){if(C!==null)if(f<E.generatedLine)S(C,a()),f++,y=0;else {var T=p[r]||"",O=T.substr(0,E.generatedColumn-y);p[r]=T.substr(E.generatedColumn-y),y=E.generatedColumn,S(C,O),C=E;return}for(;f<E.generatedLine;)v.add(a()),f++;if(y<E.generatedColumn){var T=p[r]||"";v.add(T.substr(0,E.generatedColumn)),p[r]=T.substr(E.generatedColumn),y=E.generatedColumn;}C=E;},this),r<p.length&&(C&&S(C,a()),v.add(p.splice(r).join(""))),l.sources.forEach(function(E){var T=l.sourceContentFor(E);T!=null&&(_!=null&&(E=o.join(_,E)),v.setSourceContent(E,T));}),v;function S(E,T){if(E===null||E.source===undefined)v.add(T);else {var O=_?o.join(_,E.source):E.source;v.add(new s(E.originalLine,E.originalColumn,O,T,E.name));}}},s.prototype.add=function(n){if(Array.isArray(n))n.forEach(function(l){this.add(l);},this);else if(n[u]||typeof n=="string")n&&this.children.push(n);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+n);return this},s.prototype.prepend=function(n){if(Array.isArray(n))for(var l=n.length-1;l>=0;l--)this.prepend(n[l]);else if(n[u]||typeof n=="string")this.children.unshift(n);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+n);return this},s.prototype.walk=function(n){for(var l,_=0,v=this.children.length;_<v;_++)l=this.children[_],l[u]?l.walk(n):l!==""&&n(l,{source:this.source,line:this.line,column:this.column,name:this.name});},s.prototype.join=function(n){var l,_,v=this.children.length;if(v>0){for(l=[],_=0;_<v-1;_++)l.push(this.children[_]),l.push(n);l.push(this.children[_]),this.children=l;}return this},s.prototype.replaceRight=function(n,l){var _=this.children[this.children.length-1];return _[u]?_.replaceRight(n,l):typeof _=="string"?this.children[this.children.length-1]=_.replace(n,l):this.children.push("".replace(n,l)),this},s.prototype.setSourceContent=function(n,l){this.sourceContents[o.toSetString(n)]=l;},s.prototype.walkSourceContents=function(n){for(var l=0,_=this.children.length;l<_;l++)this.children[l][u]&&this.children[l].walkSourceContents(n);for(var v=Object.keys(this.sourceContents),l=0,_=v.length;l<_;l++)n(o.fromSetString(v[l]),this.sourceContents[v[l]]);},s.prototype.toString=function(){var n="";return this.walk(function(l){n+=l;}),n},s.prototype.toStringWithSourceMap=function(n){var l={code:"",line:1,column:0},_=new e(n),v=false,p=null,r=null,a=null,f=null;return this.walk(function(y,C){l.code+=y,C.source!==null&&C.line!==null&&C.column!==null?((p!==C.source||r!==C.line||a!==C.column||f!==C.name)&&_.addMapping({source:C.source,original:{line:C.line,column:C.column},generated:{line:l.line,column:l.column},name:C.name}),p=C.source,r=C.line,a=C.column,f=C.name,v=true):v&&(_.addMapping({generated:{line:l.line,column:l.column}}),p=null,v=false);for(var S=0,E=y.length;S<E;S++)y.charCodeAt(S)===g?(l.line++,l.column=0,S+1===E?(p=null,v=false):v&&_.addMapping({source:C.source,original:{line:C.line,column:C.column},generated:{line:l.line,column:l.column},name:C.name})):l.column++;}),this.walkSourceContents(function(y,C){_.setSourceContent(y,C);}),{code:l.code,map:_}},t.SourceNode=s;}}),mt=I({"../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/source-map.js"(t){t.SourceMapGenerator=Re().SourceMapGenerator,t.SourceMapConsumer=ft().SourceMapConsumer,t.SourceNode=dt().SourceNode;}}),pt=nt(mt()),ae=false,P=t=>`
12
+ in ${t}`,ht=/^data:application\/json[^,]+base64,/,gt=/(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^*]+?)[ \t]*(?:\*\/)[ \t]*$)/,Me=async(t,e)=>{let o=e.split(`
13
+ `),c;for(let s=o.length-1;s>=0&&!c;s--){let i=o[s].match(gt);i&&(c=i[1]);}if(!c)return null;if(!(ht.test(c)||c.startsWith("/"))){let s=t.split("/");s[s.length-1]=c,c=s.join("/");}let u=await(await fetch(c)).json();return new pt.SourceMapConsumer(u)},Fe=async(t,e)=>{let o=ot(t);if(!o.length)return [];let c=o.slice(0,e);return (await Promise.all(c.map(async({file:u,line:s,col:i=0})=>{if(!u||!s)return null;try{let n=await fetch(u);if(n.ok){let l=await n.text(),_=await Me(u,l);if(_){let v=_.originalPositionFor({line:s,column:i});return {fileName:(_.file||v.source).replace(/^file:\/\//,""),lineNumber:v.line,columnNumber:v.column}}}return {fileName:u.replace(/^file:\/\//,""),lineNumber:s,columnNumber:i}}catch{return {fileName:u.replace(/^file:\/\//,""),lineNumber:s,columnNumber:i}}}))).filter(u=>u!==null)},V=(t,e)=>{if(!t||ae)return "";let o=Error.prepareStackTrace;Error.prepareStackTrace=undefined,ae=true;let c=Ae();le(null);let g=console.error,u=console.warn;console.error=()=>{},console.warn=()=>{};try{let n={DetermineComponentFrameRoot(){let p;try{if(e){let r=function(){throw Error()};if(Object.defineProperty(r.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(r,[]);}catch(a){p=a;}Reflect.construct(t,[],r);}else {try{r.call();}catch(a){p=a;}t.call(r.prototype);}}else {try{throw Error()}catch(a){p=a;}let r=t();r&&typeof r.catch=="function"&&r.catch(()=>{});}}catch(r){if(r&&p&&typeof r.stack=="string")return [r.stack,p.stack]}return [null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot",Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name")?.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});let[_,v]=n.DetermineComponentFrameRoot();if(_&&v){let p=_.split(`
14
+ `),r=v.split(`
15
+ `),a=0,f=0;for(;a<p.length&&!p[a].includes("DetermineComponentFrameRoot");)a++;for(;f<r.length&&!r[f].includes("DetermineComponentFrameRoot");)f++;if(a===p.length||f===r.length)for(a=p.length-1,f=r.length-1;a>=1&&f>=0&&p[a]!==r[f];)f--;for(;a>=1&&f>=0;a--,f--)if(p[a]!==r[f]){if(a!==1||f!==1)do if(a--,f--,f<0||p[a]!==r[f]){let y=`
16
+ ${p[a].replace(" at new "," at ")}`,C=B(t);return C&&y.includes("<anonymous>")&&(y=y.replace("<anonymous>",C)),y}while(a>=1&&f>=0);break}}}finally{ae=false,Error.prepareStackTrace=o,le(c),console.error=g,console.warn=u;}let s=t?B(t):"";return s?P(s):""},Ae=()=>{let t=D();for(let e of [...Array.from(j),...Array.from(t.renderers.values())]){let o=e.currentDispatcherRef;if(o&&typeof o=="object")return "H"in o?o.H:o.current}return null},le=t=>{for(let e of j){let o=e.currentDispatcherRef;o&&typeof o=="object"&&("H"in o?o.H=t:o.current=t);}};var Ne=(t,e)=>{switch(t.tag){case ne:case re:case Q:return P(t.type);case ee:return P("Lazy");case J:return t.child!==e&&e!==null?P("Suspense Fallback"):P("Suspense");case te:return P("SuspenseList");case Y:case Z:return V(t.type,false);case X:return V(t.type.render,false);case K:return V(t.type,true);case oe:return P("Activity");case ie:return P("ViewTransition");default:return ""}},Ie=(t,e,o)=>{let c=`
17
+ in ${t}`;return e&&(c+=` (at ${e})`),c},ue=t=>{try{let e="",o=t,c=null;do{e+=Ne(o,c);let g=o._debugInfo;if(g&&Array.isArray(g))for(let u=g.length-1;u>=0;u--){let s=g[u];typeof s.name=="string"&&(e+=Ie(s.name,s.env,s.debugLocation));}c=o,o=o.return;}while(o);return e}catch(e){return e instanceof Error?`
18
18
  Error generating stack: ${e.message}
19
- ${e.stack}`:""}},ke=n=>n.length?n[0]===n[0].toUpperCase():false,ce=async n=>{let e=/\n\s+(?:in|at)\s+([^\s(]+)(?:\s+\((?:at\s+)?([^)]+)\))?/g,a=[],p;for(p=e.exec(n);p!==null;){let C=p[1],d=p[2];if(!ke(C)){p=e.exec(n),a.push({name:C,source:undefined});continue}let s;if(d&&d!=="Server")try{let o=` at ${C} (${d})`,i=await Fe(o,1);i.length>0&&(s=i[0]);}catch{}a.push({name:C,source:s||undefined}),p=e.exec(n);}return a};var mt=async n=>{let e=se(n);if(!e)return null;let a=ue(e),C=(await ce(a)).filter(d=>!d.source?.fileName.includes("node_modules")).map(d=>({componentName:d.name,fileName:d.source?.fileName}));return {fiber:e,stack:C}},pt=()=>{let n=null,e=null,a=false,p=null,C=null,d=0,s=0,o=0,i=0,u=0,y=0,g=0,h=0,r="",l=()=>{let t=document.activeElement;return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t?.tagName==="INPUT"||t?.tagName==="TEXTAREA"},c=()=>{let t=document.createElement("div");return t.style.position="fixed",t.style.border="2px solid #3b82f6",t.style.backgroundColor="rgba(59, 130, 246, 0.1)",t.style.pointerEvents="none",t.style.zIndex="999999",t.style.transition="none",document.body.appendChild(t),t},v=(t,S,m)=>t+(S-t)*m,_=()=>{if(!e||!a)return;let t=.2;d=v(d,u,t),s=v(s,y,t),o=v(o,g,t),i=v(i,h,t),e.style.left=`${d}px`,e.style.top=`${s}px`,e.style.width=`${o}px`,e.style.height=`${i}px`,e.style.borderRadius=r,C=requestAnimationFrame(_);},b=t=>{let S=document.elementFromPoint(t.clientX,t.clientY);if(!S||S===e)return;p=S;let m=S.getBoundingClientRect(),F=window.getComputedStyle(S);u=m.left,y=m.top,g=m.width,h=m.height,r=F.borderRadius;},E=t=>{if(!a)return;t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation();let S=p;O(),S&&mt(S).then(m=>{let F=m?.stack.map(R=>`${R.componentName} (${R.fileName})`).join(`
20
- `);F&&navigator.clipboard.writeText(F);});},w=t=>{a&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation());},T=()=>{e||(e=c()),a=true,e.style.display="block",d=u,s=y,o=g,i=h,_();},O=()=>{a=false,e&&(e.style.display="none"),C&&(cancelAnimationFrame(C),C=null),p=null;},M=t=>{t.metaKey&&!n&&!a&&(n=setTimeout(()=>{console.log("Meta key held for 750ms"),l()||T(),n=null;},750));},f=t=>{t.metaKey||(n&&(clearTimeout(n),n=null),a&&O());};return document.addEventListener("keydown",M),document.addEventListener("keyup",f),document.addEventListener("mousemove",b),document.addEventListener("mousedown",w,true),document.addEventListener("click",E,true),()=>{n&&clearTimeout(n),C&&cancelAnimationFrame(C),e&&e.parentNode&&e.parentNode.removeChild(e),document.removeEventListener("keydown",M),document.removeEventListener("keyup",f),document.removeEventListener("mousemove",b),document.removeEventListener("mousedown",w,true),document.removeEventListener("click",E,true);}};pt();/*! Bundled license information:
19
+ ${e.stack}`:""}},ke=t=>t.length?t[0]===t[0].toUpperCase():false,ce=async t=>{let e=/\n\s+(?:in|at)\s+([^\s(]+)(?:\s+\((?:at\s+)?([^)]+)\))?/g,o=[],c;for(c=e.exec(t);c!==null;){let g=c[1],u=c[2];if(!ke(g)){c=e.exec(t),o.push({name:g,source:undefined});continue}let s;if(u&&u!=="Server")try{let i=` at ${g} (${u})`,n=await Fe(i,1);n.length>0&&(s=n[0]);}catch{}o.push({name:g,source:s||undefined}),c=e.exec(t);}return o};var Pe=async t=>{let e=se(t);if(!e)return null;let o=ue(e);return (await ce(o)).map(u=>({componentName:u.name,fileName:u.source?.fileName}))},je=t=>t.filter(e=>e.fileName&&!e.fileName.includes("node_modules")&&e.componentName.length>1&&!e.fileName.startsWith("_")),vt=t=>{if(t.length===0)return "";if(t.length===1){let c=t[0].lastIndexOf("/");return c>0?t[0].substring(0,c+1):""}let e=t[0];for(let c=1;c<t.length;c++){let g=t[c],u=0;for(;u<e.length&&u<g.length&&e[u]===g[u];)u++;e=e.substring(0,u);}let o=e.lastIndexOf("/");return o>0?e.substring(0,o+1):""},De=t=>{let e=t.map(c=>c.fileName).filter(c=>!!c),o=vt(e);return t.map(c=>{let g=c.fileName;return g&&o&&(g=g.startsWith(o)?g.substring(o.length):g),`${c.componentName}${g?` (${g})`:""}`}).join(`
20
+ `)},xe=t=>{let e=n=>{let l=n.tagName.toLowerCase(),_=["id","class","name","type","role","aria-label"],v=50,p=Array.from(n.attributes).filter(r=>_.includes(r.name)||r.name.startsWith("data-")).map(r=>{let a=r.value;return a.length>v&&(a=a.substring(0,v)+"..."),`${r.name}="${a}"`}).join(" ");return p?`<${l} ${p}>`:`<${l}>`},o=n=>`</${n.tagName.toLowerCase()}>`,c=n=>Array.from(n.children).length,g=[],u=t.parentElement;if(u){g.push(e(u));let l=Array.from(u.children).indexOf(t);l>0&&g.push(` ... (${l} element${l===1?"":"s"})`);}let s=u?" ":"";g.push(s+"<!-- SELECTED -->"),g.push(s+e(t));let i=c(t);if(i>0&&g.push(`${s} ... (${i} element${i===1?"":"s"})`),g.push(s+o(t)),u){let n=Array.from(u.children),l=n.indexOf(t),_=n.length-l-1;_>0&&g.push(` ... (${_} element${_===1?"":"s"})`),g.push(o(u));}return g.join(`
21
+ `)};var _t=()=>{let t=null,e=null,o=false,c=null,g=null,u=null,s=async w=>{if(!document.hasFocus()){u=w;return}try{await navigator.clipboard.writeText(w),u=null;}catch{let L=document.createElement("textarea");L.value=w,L.style.position="fixed",L.style.left="-999999px",L.style.top="-999999px",document.body.appendChild(L),L.focus(),L.select();try{document.execCommand("copy"),u=null;}catch(M){console.error("Failed to copy to clipboard:",M);}document.body.removeChild(L);}},i=()=>{u&&s(u);},n=0,l=0,_=0,v=0,p=0,r=0,a=0,f=0,y="",C=()=>{let w=document.activeElement;return w instanceof HTMLInputElement||w instanceof HTMLTextAreaElement||w?.tagName==="INPUT"||w?.tagName==="TEXTAREA"},S=()=>{let w=document.createElement("div");return w.style.position="fixed",w.style.border="2px solid #3b82f6",w.style.backgroundColor="rgba(59, 130, 246, 0.1)",w.style.pointerEvents="none",w.style.zIndex="999999",w.style.transition="none",document.body.appendChild(w),w},E=(w,L,M)=>w+(L-w)*M,T=()=>{if(!e||!o)return;let w=.5;n=E(n,p,w),l=E(l,r,w),_=E(_,a,w),v=E(v,f,w),e.style.left=`${n}px`,e.style.top=`${l}px`,e.style.width=`${_}px`,e.style.height=`${v}px`,e.style.borderRadius=y,g=requestAnimationFrame(T);},O=w=>{let L=document.elementFromPoint(w.clientX,w.clientY);if(!L||L===e)return;c=L;let M=L.getBoundingClientRect(),F=window.getComputedStyle(L);p=M.left,r=M.top,a=M.width,f=M.height,y=F.borderRadius;},R=w=>{if(!o)return;w.preventDefault(),w.stopPropagation(),w.stopImmediatePropagation();let L=c;m(),L&&Pe(L).then(M=>{if(!M)return;let F=De(je(M)),N=`## Referenced element
22
+ ${xe(L)}
23
+
24
+ Import traces:
25
+ ${F}
26
+
27
+ Page: ${window.location.href}`;s(N);});},A=w=>{o&&(w.preventDefault(),w.stopPropagation(),w.stopImmediatePropagation());},d=()=>{e||(e=S()),o=true,e.style.display="block",n=p,l=r,_=a,v=f,T();},m=()=>{o=false,e&&(e.style.display="none"),g&&(cancelAnimationFrame(g),g=null),c=null;},b=w=>{w.metaKey&&!t&&!o&&(t=setTimeout(()=>{C()||d(),t=null;},750));},h=w=>{w.metaKey||(t&&(clearTimeout(t),t=null),o&&m());};return document.addEventListener("keydown",b),document.addEventListener("keyup",h),document.addEventListener("mousemove",O),document.addEventListener("mousedown",A,true),document.addEventListener("click",R,true),window.addEventListener("focus",i),()=>{t&&clearTimeout(t),g&&cancelAnimationFrame(g),e&&e.parentNode&&e.parentNode.removeChild(e),document.removeEventListener("keydown",b),document.removeEventListener("keyup",h),document.removeEventListener("mousemove",O),document.removeEventListener("mousedown",A,true),document.removeEventListener("click",R,true),window.removeEventListener("focus",i);}};_t();/*! Bundled license information:
21
28
 
22
29
  bippy/dist/src-CqIv1vpl.js:
23
30
  (**
@@ -58,4 +65,4 @@ bippy/dist/source.js:
58
65
  * This source code is licensed under the MIT license found in the
59
66
  * LICENSE file in the root directory of this source tree.
60
67
  *)
61
- */exports.getReactData=mt;exports.init=pt;return exports;})({});
68
+ */exports.init=_t;return exports;})({});
package/dist/index.js CHANGED
@@ -10,26 +10,156 @@ import { getFiberStackTrace, getOwnerStack } from 'bippy/dist/source';
10
10
  * LICENSE file in the root directory of this source tree.
11
11
  */
12
12
 
13
- var getReactData = async (element) => {
13
+ var getStack = async (element) => {
14
14
  const fiber = getFiberFromHostInstance(element);
15
15
  if (!fiber) return null;
16
16
  const stackTrace = getFiberStackTrace(fiber);
17
17
  const rawOwnerStack = await getOwnerStack(stackTrace);
18
- const stack = rawOwnerStack.filter((item) => !item.source?.fileName.includes("node_modules")).map((item) => ({
18
+ const stack = rawOwnerStack.map((item) => ({
19
19
  componentName: item.name,
20
20
  fileName: item.source?.fileName
21
21
  }));
22
- return {
23
- fiber,
24
- stack
22
+ return stack;
23
+ };
24
+ var filterStack = (stack) => {
25
+ return stack.filter(
26
+ (item) => item.fileName && !item.fileName.includes("node_modules") && item.componentName.length > 1 && !item.fileName.startsWith("_")
27
+ );
28
+ };
29
+ var findCommonRoot = (paths) => {
30
+ if (paths.length === 0) return "";
31
+ if (paths.length === 1) {
32
+ const lastSlash2 = paths[0].lastIndexOf("/");
33
+ return lastSlash2 > 0 ? paths[0].substring(0, lastSlash2 + 1) : "";
34
+ }
35
+ let commonPrefix = paths[0];
36
+ for (let i = 1; i < paths.length; i++) {
37
+ const path = paths[i];
38
+ let j = 0;
39
+ while (j < commonPrefix.length && j < path.length && commonPrefix[j] === path[j]) {
40
+ j++;
41
+ }
42
+ commonPrefix = commonPrefix.substring(0, j);
43
+ }
44
+ const lastSlash = commonPrefix.lastIndexOf("/");
45
+ return lastSlash > 0 ? commonPrefix.substring(0, lastSlash + 1) : "";
46
+ };
47
+ var serializeStack = (stack) => {
48
+ const filePaths = stack.map((item) => item.fileName).filter((path) => !!path);
49
+ const commonRoot = findCommonRoot(filePaths);
50
+ return stack.map((item) => {
51
+ let fileName = item.fileName;
52
+ if (fileName && commonRoot) {
53
+ fileName = fileName.startsWith(commonRoot) ? fileName.substring(commonRoot.length) : fileName;
54
+ }
55
+ return `${item.componentName}${fileName ? ` (${fileName})` : ""}`;
56
+ }).join("\n");
57
+ };
58
+ var getHTMLSnippet = (element) => {
59
+ const getElementTag = (el) => {
60
+ const tagName = el.tagName.toLowerCase();
61
+ const importantAttrs = [
62
+ "id",
63
+ "class",
64
+ "name",
65
+ "type",
66
+ "role",
67
+ "aria-label"
68
+ ];
69
+ const maxValueLength = 50;
70
+ const attrs = Array.from(el.attributes).filter((attr) => {
71
+ return importantAttrs.includes(attr.name) || attr.name.startsWith("data-");
72
+ }).map((attr) => {
73
+ let value = attr.value;
74
+ if (value.length > maxValueLength) {
75
+ value = value.substring(0, maxValueLength) + "...";
76
+ }
77
+ return `${attr.name}="${value}"`;
78
+ }).join(" ");
79
+ return attrs ? `<${tagName} ${attrs}>` : `<${tagName}>`;
80
+ };
81
+ const getClosingTag = (el) => {
82
+ return `</${el.tagName.toLowerCase()}>`;
83
+ };
84
+ const getChildrenCount = (el) => {
85
+ const children = Array.from(el.children);
86
+ return children.length;
25
87
  };
88
+ const lines = [];
89
+ const parent = element.parentElement;
90
+ if (parent) {
91
+ lines.push(getElementTag(parent));
92
+ const siblings = Array.from(parent.children);
93
+ const targetIndex = siblings.indexOf(element);
94
+ if (targetIndex > 0) {
95
+ lines.push(
96
+ ` ... (${targetIndex} element${targetIndex === 1 ? "" : "s"})`
97
+ );
98
+ }
99
+ }
100
+ const indent = parent ? " " : "";
101
+ lines.push(indent + "<!-- SELECTED -->");
102
+ lines.push(indent + getElementTag(element));
103
+ const childrenCount = getChildrenCount(element);
104
+ if (childrenCount > 0) {
105
+ lines.push(
106
+ `${indent} ... (${childrenCount} element${childrenCount === 1 ? "" : "s"})`
107
+ );
108
+ }
109
+ lines.push(indent + getClosingTag(element));
110
+ if (parent) {
111
+ const siblings = Array.from(parent.children);
112
+ const targetIndex = siblings.indexOf(element);
113
+ const siblingsAfter = siblings.length - targetIndex - 1;
114
+ if (siblingsAfter > 0) {
115
+ lines.push(
116
+ ` ... (${siblingsAfter} element${siblingsAfter === 1 ? "" : "s"})`
117
+ );
118
+ }
119
+ lines.push(getClosingTag(parent));
120
+ }
121
+ return lines.join("\n");
26
122
  };
123
+
124
+ // src/index.ts
27
125
  var init = () => {
28
126
  let metaKeyTimer = null;
29
127
  let overlay = null;
30
128
  let isActive = false;
31
129
  let currentElement = null;
32
130
  let animationFrame = null;
131
+ let pendingCopyText = null;
132
+ const copyToClipboard = async (text) => {
133
+ if (!document.hasFocus()) {
134
+ pendingCopyText = text;
135
+ return;
136
+ }
137
+ try {
138
+ await navigator.clipboard.writeText(text);
139
+ pendingCopyText = null;
140
+ } catch {
141
+ const textarea = document.createElement("textarea");
142
+ textarea.value = text;
143
+ textarea.style.position = "fixed";
144
+ textarea.style.left = "-999999px";
145
+ textarea.style.top = "-999999px";
146
+ document.body.appendChild(textarea);
147
+ textarea.focus();
148
+ textarea.select();
149
+ try {
150
+ document.execCommand("copy");
151
+ pendingCopyText = null;
152
+ } catch (execErr) {
153
+ console.error("Failed to copy to clipboard:", execErr);
154
+ }
155
+ document.body.removeChild(textarea);
156
+ }
157
+ };
158
+ const handleWindowFocus = () => {
159
+ if (pendingCopyText) {
160
+ void copyToClipboard(pendingCopyText);
161
+ }
162
+ };
33
163
  let currentX = 0;
34
164
  let currentY = 0;
35
165
  let currentWidth = 0;
@@ -59,7 +189,7 @@ var init = () => {
59
189
  };
60
190
  const updateOverlayPosition = () => {
61
191
  if (!overlay || !isActive) return;
62
- const factor = 0.2;
192
+ const factor = 0.5;
63
193
  currentX = lerp(currentX, targetX, factor);
64
194
  currentY = lerp(currentY, targetY, factor);
65
195
  currentWidth = lerp(currentWidth, targetWidth, factor);
@@ -91,11 +221,18 @@ var init = () => {
91
221
  const elementToInspect = currentElement;
92
222
  hideOverlay();
93
223
  if (elementToInspect) {
94
- void getReactData(elementToInspect).then((data) => {
95
- const serializedStack = data?.stack.map((item) => `${item.componentName} (${item.fileName})`).join("\n");
96
- if (serializedStack) {
97
- void navigator.clipboard.writeText(serializedStack);
98
- }
224
+ void getStack(elementToInspect).then((stack) => {
225
+ if (!stack) return;
226
+ const serializedStack = serializeStack(filterStack(stack));
227
+ const htmlSnippet = getHTMLSnippet(elementToInspect);
228
+ const payload = `## Referenced element
229
+ ${htmlSnippet}
230
+
231
+ Import traces:
232
+ ${serializedStack}
233
+
234
+ Page: ${window.location.href}`;
235
+ void copyToClipboard(payload);
99
236
  });
100
237
  }
101
238
  };
@@ -131,7 +268,6 @@ var init = () => {
131
268
  const handleKeyDown = (e) => {
132
269
  if (e.metaKey && !metaKeyTimer && !isActive) {
133
270
  metaKeyTimer = setTimeout(() => {
134
- console.log("Meta key held for 750ms");
135
271
  if (!isInsideInputOrTextarea()) {
136
272
  showOverlay();
137
273
  }
@@ -155,6 +291,7 @@ var init = () => {
155
291
  document.addEventListener("mousemove", handleMouseMove);
156
292
  document.addEventListener("mousedown", handleMouseDown, true);
157
293
  document.addEventListener("click", handleClick, true);
294
+ window.addEventListener("focus", handleWindowFocus);
158
295
  return () => {
159
296
  if (metaKeyTimer) {
160
297
  clearTimeout(metaKeyTimer);
@@ -170,8 +307,9 @@ var init = () => {
170
307
  document.removeEventListener("mousemove", handleMouseMove);
171
308
  document.removeEventListener("mousedown", handleMouseDown, true);
172
309
  document.removeEventListener("click", handleClick, true);
310
+ window.removeEventListener("focus", handleWindowFocus);
173
311
  };
174
312
  };
175
313
  init();
176
314
 
177
- export { getReactData, init };
315
+ export { init };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-grab",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "homepage": "https://github.com/aidenybai/react-grab#readme",
package/README.md DELETED
@@ -1,64 +0,0 @@
1
- # <img src="https://github.com/aidenybai/yaps/blob/main/.github/assets/yaps.png?raw=true" width="60" align="center" /> yaps – yet another project starter
2
-
3
- i got super tired of manually setting up projects every time i start a new one, so i made this boilerplate.
4
-
5
- yaps should help you quickly get set up with a typescript web library in less than 2min of setup.
6
-
7
- a similar underlying structure is used in [react-scan](https://github.com/aidenybai/react-scan) and [bippy](https://github.com/aidenybai/bippy). it makes me feel super productive and it's not super boilerplate-y so i can can just focus on building stuff, and when it comes time to scale features it's easy to delete/add code.
8
-
9
- this is mainly maintained for me and by me, feel free to remix/use it as you see fit.
10
-
11
- ## setup
12
-
13
- ```sh
14
- git clone https://github.com/aidenybai/yaps.git
15
- cd yaps
16
- pnpm install
17
- ```
18
-
19
- next, i recommend you global search `REPLACE_ME_PLEASE` and replace it with whatever you want. here are some files you should enter your project name in:
20
-
21
- - `kitchen-sink/vite.config.mjs`
22
- - `kitchen-sink/index.html`
23
- - `kitchen-sink/LICENSE`
24
- - `kitchen-sink/package.json`
25
- - `kitchen-sink/tsup.config.ts`
26
-
27
- ## development
28
-
29
- here are some neat commands you can run:
30
-
31
- ```sh
32
- # dev
33
- pnpm run dev
34
-
35
- # build
36
- pnpm run build
37
-
38
- # lint
39
- pnpm run lint
40
-
41
- # format
42
- pnpm run format
43
-
44
- # lint publish config
45
- pnpm run publint
46
-
47
- # test
48
- pnpm run test
49
- ```
50
-
51
- ## testing
52
-
53
- for ad-hoc testing use the `kitchen-sink` directory:
54
-
55
- ```sh
56
- cd kitchen-sink
57
- pnpm run dev
58
- ```
59
-
60
- for unit testing, edit `src/index.test.ts` and run:
61
-
62
- ```sh
63
- pnpm run test
64
- ```