react-grab 0.0.26 → 0.0.28
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 +53 -4
- package/dist/index.global.js +16 -16
- package/dist/index.js +54 -5
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -739,7 +739,15 @@ var getSourceTrace = async (element) => {
|
|
|
739
739
|
Number.MAX_SAFE_INTEGER
|
|
740
740
|
);
|
|
741
741
|
if (!sources) return null;
|
|
742
|
-
|
|
742
|
+
console.log(sources);
|
|
743
|
+
return sources.map((source$1) => {
|
|
744
|
+
return {
|
|
745
|
+
...source$1,
|
|
746
|
+
fileName: source.normalizeFileName(source$1.fileName)
|
|
747
|
+
};
|
|
748
|
+
}).filter((source$1) => {
|
|
749
|
+
return source.isSourceFile(source$1.fileName);
|
|
750
|
+
});
|
|
743
751
|
};
|
|
744
752
|
var getHTMLSnippet = (element) => {
|
|
745
753
|
const semanticTags = /* @__PURE__ */ new Set([
|
|
@@ -1231,12 +1239,40 @@ var init = (rawOptions) => {
|
|
|
1231
1239
|
const fileName = source.fileName ?? "unknown";
|
|
1232
1240
|
const lineNumber = source.lineNumber ?? 0;
|
|
1233
1241
|
const columnNumber = source.columnNumber ?? 0;
|
|
1234
|
-
return ` ${functionName}
|
|
1242
|
+
return ` at ${functionName} (${fileName}:${lineNumber}:${columnNumber})`;
|
|
1235
1243
|
}).join("\n");
|
|
1236
1244
|
};
|
|
1237
1245
|
const wrapContextInXmlTags = (context) => {
|
|
1238
1246
|
return `<selected_element>${context}</selected_element>`;
|
|
1239
1247
|
};
|
|
1248
|
+
const getComputedStyles = (element) => {
|
|
1249
|
+
const computed = window.getComputedStyle(element);
|
|
1250
|
+
const rect = element.getBoundingClientRect();
|
|
1251
|
+
return {
|
|
1252
|
+
width: `${rect.width}px`,
|
|
1253
|
+
height: `${rect.height}px`,
|
|
1254
|
+
paddingTop: computed.paddingTop,
|
|
1255
|
+
paddingRight: computed.paddingRight,
|
|
1256
|
+
paddingBottom: computed.paddingBottom,
|
|
1257
|
+
paddingLeft: computed.paddingLeft,
|
|
1258
|
+
background: computed.background,
|
|
1259
|
+
opacity: computed.opacity
|
|
1260
|
+
};
|
|
1261
|
+
};
|
|
1262
|
+
const createStructuredClipboardHtml = (elements) => {
|
|
1263
|
+
const structuredData = {
|
|
1264
|
+
elements: elements.map((element) => ({
|
|
1265
|
+
tagName: element.tagName,
|
|
1266
|
+
content: element.content,
|
|
1267
|
+
computedStyles: element.computedStyles
|
|
1268
|
+
}))
|
|
1269
|
+
};
|
|
1270
|
+
const base64Data = btoa(JSON.stringify(structuredData));
|
|
1271
|
+
const htmlContent = `<div data-react-grab="${base64Data}"></div>`;
|
|
1272
|
+
return new Blob([htmlContent], {
|
|
1273
|
+
type: "text/html"
|
|
1274
|
+
});
|
|
1275
|
+
};
|
|
1240
1276
|
const getElementContentWithTrace = async (element) => {
|
|
1241
1277
|
const elementHtml = getHTMLSnippet(element);
|
|
1242
1278
|
const componentStackTrace = await getSourceTrace(element);
|
|
@@ -1256,7 +1292,13 @@ ${formattedStackTrace}`;
|
|
|
1256
1292
|
addGrabbedBox(createElementBounds(targetElement2));
|
|
1257
1293
|
try {
|
|
1258
1294
|
const content = await getElementContentWithTrace(targetElement2);
|
|
1259
|
-
|
|
1295
|
+
const plainTextContent = wrapContextInXmlTags(content);
|
|
1296
|
+
const htmlContent = createStructuredClipboardHtml([{
|
|
1297
|
+
tagName,
|
|
1298
|
+
content: await getElementContentWithTrace(targetElement2),
|
|
1299
|
+
computedStyles: getComputedStyles(targetElement2)
|
|
1300
|
+
}]);
|
|
1301
|
+
await copyContent([plainTextContent, htmlContent]);
|
|
1260
1302
|
} catch {
|
|
1261
1303
|
}
|
|
1262
1304
|
addSuccessLabel(tagName ? `<${tagName}>` : "<element>", elementBounds.left, elementBounds.top);
|
|
@@ -1274,7 +1316,14 @@ ${formattedStackTrace}`;
|
|
|
1274
1316
|
try {
|
|
1275
1317
|
const elementSnippets = await Promise.all(targetElements.map((element) => getElementContentWithTrace(element)));
|
|
1276
1318
|
const combinedContent = elementSnippets.join("\n\n---\n\n");
|
|
1277
|
-
|
|
1319
|
+
const plainTextContent = wrapContextInXmlTags(combinedContent);
|
|
1320
|
+
const structuredElements = await Promise.all(targetElements.map(async (element) => ({
|
|
1321
|
+
tagName: getElementTagName(element),
|
|
1322
|
+
content: await getElementContentWithTrace(element),
|
|
1323
|
+
computedStyles: getComputedStyles(element)
|
|
1324
|
+
})));
|
|
1325
|
+
const htmlContent = createStructuredClipboardHtml(structuredElements);
|
|
1326
|
+
await copyContent([plainTextContent, htmlContent]);
|
|
1278
1327
|
} catch {
|
|
1279
1328
|
}
|
|
1280
1329
|
addSuccessLabel(`${targetElements.length} elements`, minPositionX, minPositionY);
|
package/dist/index.global.js
CHANGED
|
@@ -6,29 +6,29 @@ 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 sr=(e,t)=>e===t;var ir=Symbol("solid-track"),Xe={equals:sr},Kt=tn,ue=1,Le=2,Zt={owned:null,cleanups:null,context:null,owner:null};var $=null,y=null,Ne=null,Y=null,Z=null,te=null,We=0;function Oe(e,t){let n=Y,r=$,s=e.length===0,o=t===void 0?r:t,i=s?Zt:{owned:null,cleanups:null,context:o?o.context:null,owner:o},a=s?e:()=>e(()=>ie(()=>Ce(i)));$=i,Y=null;try{return be(a,!0)}finally{Y=n,$=r;}}function P(e,t){t=t?Object.assign({},Xe,t):Xe;let n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=s=>(typeof s=="function"&&(s=s(n.value)),en(n,s));return [Jt.bind(n),r]}function ae(e,t,n){let r=dt(e,t,false,ue);je(r);}function re(e,t,n){Kt=fr;let r=dt(e,t,false,ue);(r.user=true),te?te.push(r):je(r);}function U(e,t,n){n=n?Object.assign({},Xe,n):Xe;let r=dt(e,t,true,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,je(r),Jt.bind(r)}function ie(e){if(Y===null)return e();let t=Y;Y=null;try{return Ne?Ne.untrack(e):e()}finally{Y=t;}}function ve(e,t,n){let r=Array.isArray(e),s;return i=>{let a;if(r){a=Array(e.length);for(let c=0;c<e.length;c++)a[c]=e[c]();}else a=e();let l=ie(()=>t(a,s,i));return s=a,l}}function Qt(e){re(()=>ie(e));}function fe(e){return $===null||($.cleanups===null?$.cleanups=[e]:$.cleanups.push(e)),e}P(false);function Jt(){let e=y;if(this.sources&&(this.state))if((this.state)===ue)je(this);else {let t=Z;Z=null,be(()=>qe(this),false),Z=t;}if(Y){let t=this.observers?this.observers.length:0;Y.sources?(Y.sources.push(this),Y.sourceSlots.push(t)):(Y.sources=[this],Y.sourceSlots=[t]),this.observers?(this.observers.push(Y),this.observerSlots.push(Y.sources.length-1)):(this.observers=[Y],this.observerSlots=[Y.sources.length-1]);}return e&&y.sources.has(this)?this.tValue:this.value}function en(e,t,n){let r=e.value;if(!e.comparator||!e.comparator(r,t)){e.value=t;e.observers&&e.observers.length&&be(()=>{for(let s=0;s<e.observers.length;s+=1){let o=e.observers[s],i=y&&y.running;i&&y.disposed.has(o)||((i?!o.tState:!o.state)&&(o.pure?Z.push(o):te.push(o),o.observers&&nn(o)),i?o.tState=ue:o.state=ue);}if(Z.length>1e6)throw Z=[],new Error},false);}return t}function je(e){if(!e.fn)return;Ce(e);let t=We;Xt(e,e.value,t);}function Xt(e,t,n){let r,s=$,o=Y;Y=$=e;try{r=e.fn(t);}catch(i){return e.pure&&((e.state=ue,e.owned&&e.owned.forEach(Ce),e.owned=null)),e.updatedAt=n+1,mt(i)}finally{Y=o,$=s;}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?en(e,r):e.value=r,e.updatedAt=n);}function dt(e,t,n,r=ue,s){let o={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:$,context:$?$.context:null,pure:n};if($===null||$!==Zt&&($.owned?$.owned.push(o):$.owned=[o]),Ne);return o}function De(e){let t=y;if((e.state)===0)return;if((e.state)===Le)return qe(e);if(e.suspense&&ie(e.suspense.inFallback))return e.suspense.effects.push(e);let n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<We);){(e.state)&&n.push(e);}for(let r=n.length-1;r>=0;r--){if(e=n[r],t);if((e.state)===ue)je(e);else if((e.state)===Le){let s=Z;Z=null,be(()=>qe(e,n[0]),false),Z=s;}}}function be(e,t){if(Z)return e();let n=false;t||(Z=[]),te?n=true:te=[],We++;try{let r=e();return cr(n),r}catch(r){n||(te=null),Z=null,mt(r);}}function cr(e){if(Z&&(tn(Z),Z=null),e)return;let n=te;te=null,n.length&&be(()=>Kt(n),false);}function tn(e){for(let t=0;t<e.length;t++)De(e[t]);}function fr(e){let t,n=0;for(t=0;t<e.length;t++){let r=e[t];r.user?e[n++]=r:De(r);}for(t=0;t<n;t++)De(e[t]);}function qe(e,t){e.state=0;for(let r=0;r<e.sources.length;r+=1){let s=e.sources[r];if(s.sources){let o=s.state;o===ue?s!==t&&(!s.updatedAt||s.updatedAt<We)&&De(s):o===Le&&qe(s,t);}}}function nn(e){for(let n=0;n<e.observers.length;n+=1){let r=e.observers[n];(!r.state)&&(r.state=Le,r.pure?Z.push(r):te.push(r),r.observers&&nn(r));}}function Ce(e){let t;if(e.sources)for(;e.sources.length;){let n=e.sources.pop(),r=e.sourceSlots.pop(),s=n.observers;if(s&&s.length){let o=s.pop(),i=n.observerSlots.pop();r<s.length&&(o.sourceSlots[i]=r,s[r]=o,n.observerSlots[r]=i);}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)Ce(e.tOwned[t]);delete e.tOwned;}if(e.owned){for(t=e.owned.length-1;t>=0;t--)Ce(e.owned[t]);e.owned=null;}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null;}e.state=0;}function dr(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function mt(e,t=$){let r=dr(e);throw r;}var mr=Symbol("fallback");function Wt(e){for(let t=0;t<e.length;t++)e[t]();}function hr(e,t,n={}){let r=[],s=[],o=[],i=0,a=t.length>1?[]:null;return fe(()=>Wt(o)),()=>{let l=e()||[],c=l.length,f,m;return l[ir],ie(()=>{let T,w,E,p,d,g,v,O,A;if(c===0)i!==0&&(Wt(o),o=[],r=[],s=[],i=0,a&&(a=[])),n.fallback&&(r=[mr],s[0]=Oe(H=>(o[0]=H,n.fallback())),i=1);else if(i===0){for(s=new Array(c),m=0;m<c;m++)r[m]=l[m],s[m]=Oe(C);i=c;}else {for(E=new Array(c),p=new Array(c),a&&(d=new Array(c)),g=0,v=Math.min(i,c);g<v&&r[g]===l[g];g++);for(v=i-1,O=c-1;v>=g&&O>=g&&r[v]===l[O];v--,O--)E[O]=s[v],p[O]=o[v],a&&(d[O]=a[v]);for(T=new Map,w=new Array(O+1),m=O;m>=g;m--)A=l[m],f=T.get(A),w[m]=f===void 0?-1:f,T.set(A,m);for(f=g;f<=v;f++)A=r[f],m=T.get(A),m!==void 0&&m!==-1?(E[m]=s[f],p[m]=o[f],a&&(d[m]=a[f]),m=w[m],T.set(A,m)):o[f]();for(m=g;m<c;m++)m in E?(s[m]=E[m],o[m]=p[m],a&&(a[m]=d[m],a[m](m))):s[m]=Oe(C);s=s.slice(0,i=c),r=l.slice(0);}return s});function C(T){if(o[m]=T,a){let[w,E]=P(m);return a[m]=E,t(l[m],w)}return t(l[m])}}}function F(e,t){return ie(()=>e(t||{}))}var pr=e=>`Stale read from <${e}>.`;function Ke(e){let t="fallback"in e&&{fallback:()=>e.fallback};return U(hr(()=>e.each,e.children,t||void 0))}function X(e){let t=e.keyed,n=U(()=>e.when,void 0,void 0),r=t?n:U(n,void 0,{equals:(s,o)=>!s==!o});return U(()=>{let s=r();if(s){let o=e.children;return typeof o=="function"&&o.length>0?ie(()=>o(t?s:()=>{if(!ie(r))throw pr("Show");return n()})):o}return e.fallback},void 0,void 0)}var Ie=e=>U(()=>e());function wr(e,t,n){let r=n.length,s=t.length,o=r,i=0,a=0,l=t[s-1].nextSibling,c=null;for(;i<s||a<o;){if(t[i]===n[a]){i++,a++;continue}for(;t[s-1]===n[o-1];)s--,o--;if(s===i){let f=o<r?a?n[a-1].nextSibling:n[o-a]:l;for(;a<o;)e.insertBefore(n[a++],f);}else if(o===a)for(;i<s;)(!c||!c.has(t[i]))&&t[i].remove(),i++;else if(t[i]===n[o-1]&&n[a]===t[s-1]){let f=t[--s].nextSibling;e.insertBefore(n[a++],t[i++].nextSibling),e.insertBefore(n[--o],f),t[s]=n[o];}else {if(!c){c=new Map;let m=a;for(;m<o;)c.set(n[m],m++);}let f=c.get(t[i]);if(f!=null)if(a<f&&f<o){let m=i,C=1,T;for(;++m<s&&m<o&&!((T=c.get(t[m]))==null||T!==f+C);)C++;if(C>f-a){let w=t[i];for(;a<f;)e.insertBefore(n[a++],w);}else e.replaceChild(n[a++],t[i++]);}else i++;else t[i++].remove();}}}function sn(e,t,n,r={}){let s;return Oe(o=>{s=o,t===document?e():ye(t,e(),t.firstChild?null:void 0,n);},r.owner),()=>{s(),t.textContent="";}}function oe(e,t,n,r){let s,o=()=>{let a=document.createElement("template");return a.innerHTML=e,a.content.firstChild},i=()=>(s||(s=o())).cloneNode(true);return i.cloneNode=i,i}function Sr(e,t,n){(e.removeAttribute(t));}function Qe(e,t,n){if(!t)return n?Sr(e,"style"):t;let r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let s,o;for(o in n)t[o]==null&&r.removeProperty(o),delete n[o];for(o in t)s=t[o],s!==n[o]&&(r.setProperty(o,s),n[o]=s);return n}function he(e,t,n){n!=null?e.style.setProperty(t,n):e.style.removeProperty(t);}function Ee(e,t,n){return ie(()=>e(t,n))}function ye(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return Ze(e,t,r,n);ae(s=>Ze(e,t(),s,n),r);}function Ze(e,t,n,r,s){for(;typeof n=="function";)n=n();if(t===n)return n;let i=typeof t,a=r!==void 0;if(e=a&&n[0]&&n[0].parentNode||e,i==="string"||i==="number"){if(i==="number"&&(t=t.toString(),t===n))return n;if(a){let l=n[0];l&&l.nodeType===3?l.data!==t&&(l.data=t):l=document.createTextNode(t),n=Fe(e,n,r,l);}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t;}else if(t==null||i==="boolean"){n=Fe(e,n,r);}else {if(i==="function")return ae(()=>{let l=t();for(;typeof l=="function";)l=l();n=Ze(e,l,n,r);}),()=>n;if(Array.isArray(t)){let l=[],c=n&&Array.isArray(n);if(ht(l,t,n,s))return ae(()=>n=Ze(e,l,n,r,true)),()=>n;if(l.length===0){if(n=Fe(e,n,r),a)return n}else c?n.length===0?on(e,l,r):wr(e,n,l):(n&&Fe(e),on(e,l));n=l;}else if(t.nodeType){if(Array.isArray(n)){if(a)return n=Fe(e,n,r,t);Fe(e,n,null,t);}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t;}}return n}function ht(e,t,n,r){let s=false;for(let o=0,i=t.length;o<i;o++){let a=t[o],l=n&&n[e.length],c;if(!(a==null||a===true||a===false))if((c=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))s=ht(e,a,l)||s;else if(c==="function")if(r){for(;typeof a=="function";)a=a();s=ht(e,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||s;}else e.push(a),s=true;else {let f=String(a);l&&l.nodeType===3&&l.data===f?e.push(l):e.push(document.createTextNode(f));}}return s}function on(e,t,n=null){for(let r=0,s=t.length;r<s;r++)e.insertBefore(t[r],n);}function Fe(e,t,n,r){if(n===void 0)return e.textContent="";let s=r||document.createTextNode("");if(t.length){let o=false;for(let i=t.length-1;i>=0;i--){let a=t[i];if(s!==a){let l=a.parentNode===e;!o&&!i?l?e.replaceChild(s,a):e.insertBefore(s,n):l&&a.remove();}else o=true;}}else e.insertBefore(s,n);return [s]}var Tr=["input","textarea","select","searchbox","slider","spinbutton","menuitem","menuitemcheckbox","menuitemradio","option","radio","textbox"],xr=e=>!!e.tagName&&!e.tagName.startsWith("-")&&e.tagName.includes("-"),Cr=e=>Array.isArray(e),vr=(e,t=false)=>{let{composed:n,target:r}=e,s,o;if(r instanceof HTMLElement&&xr(r)&&n){let a=e.composedPath()[0];a instanceof HTMLElement&&(s=a.tagName,o=a.role);}else r instanceof HTMLElement&&(s=r.tagName,o=r.role);return Cr(t)?!!(s&&t&&t.some(i=>typeof s=="string"&&i.toLowerCase()===s.toLowerCase()||i===o)):!!(s&&t&&t)},ln=e=>vr(e,Tr);var $e="data-react-grab",cn=()=>{let e=document.querySelector(`[${$e}]`);if(e){let o=e.shadowRoot?.querySelector(`[${$e}]`);if(o instanceof HTMLDivElement&&e.shadowRoot)return o}let t=document.createElement("div");t.setAttribute($e,"true"),t.style.zIndex="2147483646",t.style.position="fixed",t.style.top="0",t.style.left="0";let n=t.attachShadow({mode:"open"}),r=document.createElement("div");return r.setAttribute($e,"true"),n.appendChild(r),(document.body??document.documentElement).appendChild(t),r};var de=(e,t,n)=>e+(t-e)*n;var Rr=oe("<div>"),Je=e=>{let[t,n]=P(e.bounds.x),[r,s]=P(e.bounds.y),[o,i]=P(e.bounds.width),[a,l]=P(e.bounds.height),[c,f]=P(1),m=false,C=null,T=null,w=e.bounds,E=false,p=()=>e.lerpFactor!==void 0?e.lerpFactor:e.variant==="drag"?.7:.95,d=()=>{if(E)return;E=true;let O=()=>{let A=de(t(),w.x,p()),H=de(r(),w.y,p()),k=de(o(),w.width,p()),Q=de(a(),w.height,p());n(A),s(H),i(k),l(Q),Math.abs(A-w.x)<.5&&Math.abs(H-w.y)<.5&&Math.abs(k-w.width)<.5&&Math.abs(Q-w.height)<.5?(C=null,E=false):C=requestAnimationFrame(O);};C=requestAnimationFrame(O);};re(ve(()=>e.bounds,O=>{if(w=O,!m){n(w.x),s(w.y),i(w.width),l(w.height),m=true;return}d();})),re(()=>{e.variant==="grabbed"&&e.createdAt&&(T=window.setTimeout(()=>{f(0);},1500));}),fe(()=>{C!==null&&(cancelAnimationFrame(C),C=null),T!==null&&(window.clearTimeout(T),T=null),E=false;});let g={position:"fixed","box-sizing":"border-box","pointer-events":e.variant==="drag"?"none":"auto","z-index":"2147483646"},v=()=>e.variant==="drag"?{border:"1px dashed rgba(210, 57, 192, 0.4)","background-color":"rgba(210, 57, 192, 0.05)","will-change":"transform, width, height",contain:"layout paint size",cursor:"crosshair"}:{border:"1px solid rgb(210, 57, 192)","background-color":"rgba(210, 57, 192, 0.2)",transition:e.variant==="grabbed"?"opacity 0.3s ease-out":void 0};return F(X,{get when(){return e.visible!==false},get children(){var O=Rr();return ae(A=>Qe(O,{...g,...v(),top:`${r()}px`,left:`${t()}px`,width:`${o()}px`,height:`${a()}px`,"border-radius":e.bounds.borderRadius,transform:e.bounds.transform,opacity:c()},A)),O}})};var _r=oe('<span style="display:inline-block;width:8px;height:8px;border:1.5px solid rgb(210, 57, 192);border-top-color:transparent;border-radius:50%;margin-right:4px;vertical-align:middle">'),un=e=>{let t;return Qt(()=>{t&&t.animate([{transform:"rotate(0deg)"},{transform:"rotate(360deg)"}],{duration:600,easing:"linear",iterations:1/0});}),(()=>{var n=_r(),r=t;return typeof r=="function"?Ee(r,n):t=n,ae(s=>Qe(n,{...e.style},s)),n})()};var Be=(e,t,n,r)=>{let s=window.innerWidth,o=window.innerHeight,i=8,a=8,l=s-n-8,c=o-r-8,f=Math.max(i,Math.min(e,l)),m=Math.max(a,Math.min(t,c));return {left:f,top:m}};var Or=oe("<span style=display:inline-block;margin-right:4px;font-weight:600>\u2713"),kr=oe("<div style=margin-right:4px>Copied"),Ar=oe("<div style=margin-left:4px>to clipboard"),Nr=oe(`<div style="position:fixed;padding:2px 6px;background-color:#fde7f7;color:#b21c8e;border:1px solid #f7c5ec;border-radius:4px;font-size:11px;font-weight:500;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;pointer-events:none;transition:opacity 0.2s ease-in-out;display:flex;align-items:center;max-width:calc(100vw - (16px + env(safe-area-inset-left) + env(safe-area-inset-right)));overflow:hidden;text-overflow:ellipsis;white-space:nowrap">`),Fr=oe(`<span style="font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;font-variant-numeric:tabular-nums">`),gt=e=>{let[t,n]=P(0),[r,s]=P(0),o,i=e.x,a=e.y,l=e.x,c=e.y,f=null,m=false,C=()=>{i=de(i,l,.3),a=de(a,c,.3),s(g=>g+1),Math.abs(i-l)<.5&&Math.abs(a-c)<.5?f=null:f=requestAnimationFrame(C);},T=()=>{f===null&&(f=requestAnimationFrame(C));},w=()=>{if(l=e.x,c=e.y,!m){i=l,a=c,m=true,s(d=>d+1);return}T();};re(ve(()=>e.visible,d=>{if(d!==false)requestAnimationFrame(()=>{n(1);});else {n(0);return}if(e.variant==="success"){let g=setTimeout(()=>{n(0);},1500);fe(()=>clearTimeout(g));}})),re(()=>{w();}),fe(()=>{f!==null&&(cancelAnimationFrame(f),f=null);});let E=()=>o?.getBoundingClientRect(),p=()=>{r();let d=E();if(!d)return {left:i,top:a};if(e.variant==="success"){let k=Math.round(i),Q=Math.round(a)-d.height-6,ne=k<8,Me=Q<8,x=ne||Me,b=Be(k,Q,d.width,d.height);return x&&(b.left+=4,b.top+=4),b}let g=12,v=window.innerWidth,O=window.innerHeight,A=[{left:Math.round(i)+g,top:Math.round(a)+g},{left:Math.round(i)-d.width-g,top:Math.round(a)+g},{left:Math.round(i)+g,top:Math.round(a)-d.height-g},{left:Math.round(i)-d.width-g,top:Math.round(a)-d.height-g}];for(let k of A){let Q=k.left>=8&&k.left+d.width<=v-8,ne=k.top>=8&&k.top+d.height<=O-8;if(Q&&ne)return k}let H=Be(A[0].left,A[0].top,d.width,d.height);return H.left+=4,H.top+=4,H};return F(X,{get when(){return e.visible!==false},get children(){var d=Nr(),g=o;return typeof g=="function"?Ee(g,d):o=d,ye(d,F(X,{get when(){return e.variant==="processing"},get children(){return F(un,{})}}),null),ye(d,F(X,{get when(){return e.variant==="success"},get children(){return Or()}}),null),ye(d,F(X,{get when(){return e.variant==="success"},get children(){return kr()}}),null),ye(d,F(X,{get when(){return e.variant==="processing"},children:"Grabbing\u2026"}),null),ye(d,F(X,{get when(){return e.text.startsWith("(")},get fallback(){return (()=>{var v=Fr();return ye(v,()=>e.text),v})()},get children(){return e.text}}),null),ye(d,F(X,{get when(){return e.variant==="success"},get children(){return Ar()}}),null),ae(v=>{var O=`${p().top}px`,A=`${p().left}px`,H=e.zIndex?.toString()??"2147483647",k=t();return O!==v.e&&he(d,"top",v.e=O),A!==v.t&&he(d,"left",v.t=A),H!==v.a&&he(d,"z-index",v.a=H),k!==v.o&&he(d,"opacity",v.o=k),v},{e:void 0,t:void 0,a:void 0,o:void 0}),d}})};var Ir=oe('<div style="position:fixed;z-index:2147483647;pointer-events:none;transition:opacity 0.1s ease-in-out"><div style="width:32px;height:2px;background-color:rgba(178, 28, 142, 0.2);border-radius:1px;overflow:hidden;position:relative"><div style="height:100%;background-color:#b21c8e;border-radius:1px;transition:width 0.05s cubic-bezier(0.165, 0.84, 0.44, 1)">'),$r=e=>{let[t,n]=P(0);return re(ve(()=>e,r=>{r!==false?requestAnimationFrame(()=>{n(1);}):n(0);})),t},fn=e=>{let t=$r(e.visible),n,r=()=>{let s=n?.getBoundingClientRect();if(!s)return {left:e.mouseX,top:e.mouseY};let o=window.innerHeight,i=e.mouseX-s.width/2,a=e.mouseY+14+s.height+8>o?e.mouseY-s.height-14:e.mouseY+14;return Be(i,a,s.width,s.height)};return F(X,{get when(){return e.visible!==false},get children(){var s=Ir(),o=s.firstChild,i=o.firstChild,a=n;return typeof a=="function"?Ee(a,s):n=s,ae(l=>{var c=`${r().top}px`,f=`${r().left}px`,m=t(),C=`${Math.min(100,Math.max(0,e.progress*100))}%`;return c!==l.e&&he(s,"top",l.e=c),f!==l.t&&he(s,"left",l.t=f),m!==l.a&&he(s,"opacity",l.a=m),C!==l.o&&he(i,"width",l.o=C),l},{e:void 0,t:void 0,a:void 0,o:void 0}),s}})};var Mr=oe("<canvas style=position:fixed;top:0;left:0;pointer-events:none;z-index:2147483645>"),dn=e=>{let t,n=null,r=0,s=0,o=1,i=e.mouseX,a=e.mouseY,l=e.mouseX,c=e.mouseY,f=null,m=false,C=()=>{t&&(o=Math.max(window.devicePixelRatio||1,2),r=window.innerWidth,s=window.innerHeight,t.width=r*o,t.height=s*o,t.style.width=`${r}px`,t.style.height=`${s}px`,n=t.getContext("2d"),n&&n.scale(o,o));},T=()=>{n&&(n.clearRect(0,0,r,s),n.strokeStyle="rgba(210, 57, 192)",n.lineWidth=1,n.beginPath(),n.moveTo(i,0),n.lineTo(i,s),n.moveTo(0,a),n.lineTo(r,a),n.stroke());},w=()=>{i=de(i,l,.3),a=de(a,c,.3),T(),Math.abs(i-l)<.5&&Math.abs(a-c)<.5?f=null:f=requestAnimationFrame(w);},E=()=>{f===null&&(f=requestAnimationFrame(w));},p=()=>{if(l=e.mouseX,c=e.mouseY,!m){i=l,a=c,m=true,T();return}E();};return re(()=>{C(),T();let d=()=>{C(),T();};window.addEventListener("resize",d),fe(()=>{window.removeEventListener("resize",d),f!==null&&(cancelAnimationFrame(f),f=null);});}),re(()=>{p();}),F(X,{get when(){return e.visible!==false},get children(){var d=Mr(),g=t;return typeof g=="function"?Ee(g,d):t=d,d}})};var mn=e=>[F(X,{get when(){return Ie(()=>!!e.selectionVisible)()&&e.selectionBounds},get children(){return F(Je,{variant:"selection",get bounds(){return e.selectionBounds},get visible(){return e.selectionVisible}})}}),F(X,{get when(){return Ie(()=>e.crosshairVisible===true&&e.mouseX!==void 0)()&&e.mouseY!==void 0},get children(){return F(dn,{get mouseX(){return e.mouseX},get mouseY(){return e.mouseY},visible:true})}}),F(X,{get when(){return Ie(()=>!!e.dragVisible)()&&e.dragBounds},get children(){return F(Je,{variant:"drag",get bounds(){return e.dragBounds},get visible(){return e.dragVisible}})}}),F(Ke,{get each(){return e.grabbedBoxes??[]},children:t=>F(Je,{variant:"grabbed",get bounds(){return t.bounds},get createdAt(){return t.createdAt}})}),F(Ke,{get each(){return e.successLabels??[]},children:t=>F(gt,{variant:"success",get text(){return t.text},get x(){return t.x},get y(){return t.y}})}),F(X,{get when(){return Ie(()=>!!(e.labelVisible&&e.labelVariant&&e.labelText&&e.labelX!==void 0))()&&e.labelY!==void 0},get children(){return F(gt,{get variant(){return e.labelVariant},get text(){return e.labelText},get x(){return e.labelX},get y(){return e.labelY},get visible(){return e.labelVisible},get zIndex(){return e.labelZIndex}})}}),F(X,{get when(){return Ie(()=>!!(e.progressVisible&&e.progress!==void 0&&e.mouseX!==void 0))()&&e.mouseY!==void 0},get children(){return F(fn,{get progress(){return e.progress},get mouseX(){return e.mouseX},get mouseY(){return e.mouseY},get visible(){return e.progressVisible}})}})];var pn="0.5.14",Ye=`bippy-${pn}`,hn=Object.defineProperty,Pr=Object.prototype.hasOwnProperty,Ve=()=>{},bn=e=>{try{Function.prototype.toString.call(e).indexOf("^_^")>-1&&setTimeout(()=>{throw 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{}},bt=(e=we())=>"getFiberRoots"in e,yn=false,gn,nt=(e=we())=>yn?true:(typeof e.inject=="function"&&(gn=e.inject.toString()),!!gn?.includes("(injected)")),tt=new Set,ke=new Set,wn=e=>{let t=new Map,n=0,r={_instrumentationIsActive:false,_instrumentationSource:Ye,checkDCE:bn,hasUnsupportedRendererAttached:false,inject(s){let o=++n;return t.set(o,s),ke.add(s),r._instrumentationIsActive||(r._instrumentationIsActive=true,tt.forEach(i=>i())),o},on:Ve,onCommitFiberRoot:Ve,onCommitFiberUnmount:Ve,onPostCommitFiberRoot:Ve,renderers:t,supportsFiber:true,supportsFlight:true};try{hn(globalThis,"__REACT_DEVTOOLS_GLOBAL_HOOK__",{configurable:!0,enumerable:!0,get(){return r},set(i){if(i&&typeof i=="object"){let a=r.renderers;r=i,a.size>0&&(a.forEach((l,c)=>{ke.add(l),i.renderers.set(c,l);}),rt(e));}}});let s=window.hasOwnProperty,o=!1;hn(window,"hasOwnProperty",{configurable:!0,value:function(...i){try{if(!o&&i[0]==="__REACT_DEVTOOLS_GLOBAL_HOOK__")return globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__=void 0,o=!0,-0}catch{}return s.apply(this,i)},writable:!0});}catch{rt(e);}return r},rt=e=>{e&&tt.add(e);try{let t=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!t)return;if(!t._instrumentationSource){t.checkDCE=bn,t.supportsFiber=!0,t.supportsFlight=!0,t.hasUnsupportedRendererAttached=!1,t._instrumentationSource=Ye,t._instrumentationIsActive=!1;let n=bt(t);if(n||(t.on=Ve),t.renderers.size){t._instrumentationIsActive=!0,tt.forEach(o=>o());return}let r=t.inject,s=nt(t);s&&!n&&(yn=!0,t.inject({scheduleRefresh(){}})&&(t._instrumentationIsActive=!0)),t.inject=o=>{let i=r(o);return ke.add(o),s&&t.renderers.set(i,o),t._instrumentationIsActive=!0,tt.forEach(a=>a()),i};}(t.renderers.size||t._instrumentationIsActive||nt())&&e?.();}catch{}},yt=()=>Pr.call(globalThis,"__REACT_DEVTOOLS_GLOBAL_HOOK__"),we=e=>yt()?(rt(e),globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__):wn(e),Sn=()=>!!(typeof window<"u"&&(window.document?.createElement||window.navigator?.product==="ReactNative")),wt=()=>{try{Sn()&&we();}catch{}};wt();var St=0,Tt=1;var xt=5;var Ct=11,vt=13;var Et=15,Rt=16;var _t=19;var Ot=26,kt=27,At=28,Nt=30;var Ft=e=>{let t=e;return typeof t=="function"?t:typeof t=="object"&&t?Ft(t.type||t.render):null},ot=e=>{let t=e;if(typeof t=="string")return t;if(typeof t!="function"&&!(typeof t=="object"&&t))return null;let n=t.displayName||t.name||null;if(n)return n;let r=Ft(t);return r&&(r.displayName||r.name)||null};var It=e=>{let t=we(e.onActive);t._instrumentationSource=e.name??Ye;let n=t.onCommitFiberRoot;if(e.onCommitFiberRoot){let o=(i,a,l)=>{n!==o&&(n?.(i,a,l),e.onCommitFiberRoot?.(i,a,l));};t.onCommitFiberRoot=o;}let r=t.onCommitFiberUnmount;if(e.onCommitFiberUnmount){let o=(i,a)=>{t.onCommitFiberUnmount===o&&(r?.(i,a),e.onCommitFiberUnmount?.(i,a));};t.onCommitFiberUnmount=o;}let s=t.onPostCommitFiberRoot;if(e.onPostCommitFiberRoot){let o=(i,a)=>{t.onPostCommitFiberRoot===o&&(s?.(i,a),e.onPostCommitFiberRoot?.(i,a));};t.onPostCommitFiberRoot=o;}return t},st=e=>{let t=we();for(let n of t.renderers.values())try{let r=n.findFiberByHostInstance?.(e);if(r)return r}catch{}if(typeof e=="object"&&e){if("_reactRootContainer"in e)return e._reactRootContainer?._internalRoot?.current?.child;for(let n in e)if(n.startsWith("__reactContainer$")||n.startsWith("__reactInternalInstance$")||n.startsWith("__reactFiber"))return e[n]||null}return null},$t=new Set;var Wr=Object.create,Rn=Object.defineProperty,Kr=Object.getOwnPropertyDescriptor,Zr=Object.getOwnPropertyNames,Qr=Object.getPrototypeOf,Jr=Object.prototype.hasOwnProperty,eo=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),to=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var s=Zr(t),o=0,i=s.length,a;o<i;o++)a=s[o],!Jr.call(e,a)&&a!==n&&Rn(e,a,{get:(l=>t[l]).bind(null,a),enumerable:!(r=Kr(t,a))||r.enumerable});return e},no=(e,t,n)=>(n=e==null?{}:Wr(Qr(e)),to(Rn(n,"default",{value:e,enumerable:true}),e)),ro=()=>{let e=we();for(let t of [...Array.from(ke),...Array.from(e.renderers.values())]){let n=t.currentDispatcherRef;if(n&&typeof n=="object")return "H"in n?n.H:n.current}return null},Tn=e=>{for(let t of ke){let n=t.currentDispatcherRef;n&&typeof n=="object"&&("H"in n?n.H=e:n.current=e);}},Se=e=>`
|
|
10
|
-
in ${e}`,
|
|
11
|
-
`),T=
|
|
12
|
-
`),w=0,
|
|
13
|
-
${C[w].replace(" at new "," at ")}`,d=
|
|
9
|
+
var mr=(e,t)=>e===t;var gr=Symbol("solid-track"),We={equals:mr},en=sn,ue=1,De=2,tn={owned:null,cleanups:null,context:null,owner:null};var M=null,y=null,Fe=null,G=null,J=null,te=null,Ze=0;function _e(e,t){let n=G,r=M,o=e.length===0,i=t===void 0?r:t,s=o?tn:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e(()=>ae(()=>Ce(s)));M=s,G=null;try{return be(a,!0)}finally{G=n,M=r;}}function L(e,t){t=t?Object.assign({},We,t):We;let n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(o=o(n.value)),on(n,o));return [rn.bind(n),r]}function le(e,t,n){let r=gt(e,t,false,ue);Be(r);}function re(e,t,n){en=wr;let r=gt(e,t,false,ue);(r.user=true),te?te.push(r):Be(r);}function z(e,t,n){n=n?Object.assign({},We,n):We;let r=gt(e,t,true,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,Be(r),rn.bind(r)}function ae(e){if(G===null)return e();let t=G;G=null;try{return Fe?Fe.untrack(e):e()}finally{G=t;}}function ve(e,t,n){let r=Array.isArray(e),o;return s=>{let a;if(r){a=Array(e.length);for(let c=0;c<e.length;c++)a[c]=e[c]();}else a=e();let l=ae(()=>t(a,o,s));return o=a,l}}function nn(e){re(()=>ae(e));}function fe(e){return M===null||(M.cleanups===null?M.cleanups=[e]:M.cleanups.push(e)),e}L(false);function rn(){let e=y;if(this.sources&&(this.state))if((this.state)===ue)Be(this);else {let t=J;J=null,be(()=>Ke(this),false),J=t;}if(G){let t=this.observers?this.observers.length:0;G.sources?(G.sources.push(this),G.sourceSlots.push(t)):(G.sources=[this],G.sourceSlots=[t]),this.observers?(this.observers.push(G),this.observerSlots.push(G.sources.length-1)):(this.observers=[G],this.observerSlots=[G.sources.length-1]);}return e&&y.sources.has(this)?this.tValue:this.value}function on(e,t,n){let r=e.value;if(!e.comparator||!e.comparator(r,t)){e.value=t;e.observers&&e.observers.length&&be(()=>{for(let o=0;o<e.observers.length;o+=1){let i=e.observers[o],s=y&&y.running;s&&y.disposed.has(i)||((s?!i.tState:!i.state)&&(i.pure?J.push(i):te.push(i),i.observers&&an(i)),s?i.tState=ue:i.state=ue);}if(J.length>1e6)throw J=[],new Error},false);}return t}function Be(e){if(!e.fn)return;Ce(e);let t=Ze;Zt(e,e.value,t);}function Zt(e,t,n){let r,o=M,i=G;G=M=e;try{r=e.fn(t);}catch(s){return e.pure&&((e.state=ue,e.owned&&e.owned.forEach(Ce),e.owned=null)),e.updatedAt=n+1,ht(s)}finally{G=i,M=o;}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?on(e,r):e.value=r,e.updatedAt=n);}function gt(e,t,n,r=ue,o){let i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:M,context:M?M.context:null,pure:n};if(M===null||M!==tn&&(M.owned?M.owned.push(i):M.owned=[i]),Fe);return i}function He(e){let t=y;if((e.state)===0)return;if((e.state)===De)return Ke(e);if(e.suspense&&ae(e.suspense.inFallback))return e.suspense.effects.push(e);let n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<Ze);){(e.state)&&n.push(e);}for(let r=n.length-1;r>=0;r--){if(e=n[r],t);if((e.state)===ue)Be(e);else if((e.state)===De){let o=J;J=null,be(()=>Ke(e,n[0]),false),J=o;}}}function be(e,t){if(J)return e();let n=false;t||(J=[]),te?n=true:te=[],Ze++;try{let r=e();return br(n),r}catch(r){n||(te=null),J=null,ht(r);}}function br(e){if(J&&(sn(J),J=null),e)return;let n=te;te=null,n.length&&be(()=>en(n),false);}function sn(e){for(let t=0;t<e.length;t++)He(e[t]);}function wr(e){let t,n=0;for(t=0;t<e.length;t++){let r=e[t];r.user?e[n++]=r:He(r);}for(t=0;t<n;t++)He(e[t]);}function Ke(e,t){e.state=0;for(let r=0;r<e.sources.length;r+=1){let o=e.sources[r];if(o.sources){let i=o.state;i===ue?o!==t&&(!o.updatedAt||o.updatedAt<Ze)&&He(o):i===De&&Ke(o,t);}}}function an(e){for(let n=0;n<e.observers.length;n+=1){let r=e.observers[n];(!r.state)&&(r.state=De,r.pure?J.push(r):te.push(r),r.observers&&an(r));}}function Ce(e){let t;if(e.sources)for(;e.sources.length;){let n=e.sources.pop(),r=e.sourceSlots.pop(),o=n.observers;if(o&&o.length){let i=o.pop(),s=n.observerSlots.pop();r<o.length&&(i.sourceSlots[s]=r,o[r]=i,n.observerSlots[r]=s);}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)Ce(e.tOwned[t]);delete e.tOwned;}if(e.owned){for(t=e.owned.length-1;t>=0;t--)Ce(e.owned[t]);e.owned=null;}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null;}e.state=0;}function Sr(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function ht(e,t=M){let r=Sr(e);throw r;}var Tr=Symbol("fallback");function Jt(e){for(let t=0;t<e.length;t++)e[t]();}function xr(e,t,n={}){let r=[],o=[],i=[],s=0,a=t.length>1?[]:null;return fe(()=>Jt(i)),()=>{let l=e()||[],c=l.length,f,g;return l[gr],ae(()=>{let T,w,R,p,d,h,v,O,k;if(c===0)s!==0&&(Jt(i),i=[],r=[],o=[],s=0,a&&(a=[])),n.fallback&&(r=[Tr],o[0]=_e(j=>(i[0]=j,n.fallback())),s=1);else if(s===0){for(o=new Array(c),g=0;g<c;g++)r[g]=l[g],o[g]=_e(C);s=c;}else {for(R=new Array(c),p=new Array(c),a&&(d=new Array(c)),h=0,v=Math.min(s,c);h<v&&r[h]===l[h];h++);for(v=s-1,O=c-1;v>=h&&O>=h&&r[v]===l[O];v--,O--)R[O]=o[v],p[O]=i[v],a&&(d[O]=a[v]);for(T=new Map,w=new Array(O+1),g=O;g>=h;g--)k=l[g],f=T.get(k),w[g]=f===void 0?-1:f,T.set(k,g);for(f=h;f<=v;f++)k=r[f],g=T.get(k),g!==void 0&&g!==-1?(R[g]=o[f],p[g]=i[f],a&&(d[g]=a[f]),g=w[g],T.set(k,g)):i[f]();for(g=h;g<c;g++)g in R?(o[g]=R[g],i[g]=p[g],a&&(a[g]=d[g],a[g](g))):o[g]=_e(C);o=o.slice(0,s=c),r=l.slice(0);}return o});function C(T){if(i[g]=T,a){let[w,R]=L(g);return a[g]=R,t(l[g],w)}return t(l[g])}}}function A(e,t){return ae(()=>e(t||{}))}var vr=e=>`Stale read from <${e}>.`;function Qe(e){let t="fallback"in e&&{fallback:()=>e.fallback};return z(xr(()=>e.each,e.children,t||void 0))}function q(e){let t=e.keyed,n=z(()=>e.when,void 0,void 0),r=t?n:z(n,void 0,{equals:(o,i)=>!o==!i});return z(()=>{let o=r();if(o){let i=e.children;return typeof i=="function"&&i.length>0?ae(()=>i(t?o:()=>{if(!ae(r))throw vr("Show");return n()})):i}return e.fallback},void 0,void 0)}var $e=e=>z(()=>e());function _r(e,t,n){let r=n.length,o=t.length,i=r,s=0,a=0,l=t[o-1].nextSibling,c=null;for(;s<o||a<i;){if(t[s]===n[a]){s++,a++;continue}for(;t[o-1]===n[i-1];)o--,i--;if(o===s){let f=i<r?a?n[a-1].nextSibling:n[i-a]:l;for(;a<i;)e.insertBefore(n[a++],f);}else if(i===a)for(;s<o;)(!c||!c.has(t[s]))&&t[s].remove(),s++;else if(t[s]===n[i-1]&&n[a]===t[o-1]){let f=t[--o].nextSibling;e.insertBefore(n[a++],t[s++].nextSibling),e.insertBefore(n[--i],f),t[o]=n[i];}else {if(!c){c=new Map;let g=a;for(;g<i;)c.set(n[g],g++);}let f=c.get(t[s]);if(f!=null)if(a<f&&f<i){let g=s,C=1,T;for(;++g<o&&g<i&&!((T=c.get(t[g]))==null||T!==f+C);)C++;if(C>f-a){let w=t[s];for(;a<f;)e.insertBefore(n[a++],w);}else e.replaceChild(n[a++],t[s++]);}else s++;else t[s++].remove();}}}function un(e,t,n,r={}){let o;return _e(i=>{o=i,t===document?e():ye(t,e(),t.firstChild?null:void 0,n);},r.owner),()=>{o(),t.textContent="";}}function ie(e,t,n,r){let o,i=()=>{let a=document.createElement("template");return a.innerHTML=e,a.content.firstChild},s=()=>(o||(o=i())).cloneNode(true);return s.cloneNode=s,s}function Or(e,t,n){(e.removeAttribute(t));}function et(e,t,n){if(!t)return n?Or(e,"style"):t;let r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let o,i;for(i in n)t[i]==null&&r.removeProperty(i),delete n[i];for(i in t)o=t[i],o!==n[i]&&(r.setProperty(i,o),n[i]=o);return n}function pe(e,t,n){n!=null?e.style.setProperty(t,n):e.style.removeProperty(t);}function Ee(e,t,n){return ae(()=>e(t,n))}function ye(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return Je(e,t,r,n);le(o=>Je(e,t(),o,n),r);}function Je(e,t,n,r,o){for(;typeof n=="function";)n=n();if(t===n)return n;let s=typeof t,a=r!==void 0;if(e=a&&n[0]&&n[0].parentNode||e,s==="string"||s==="number"){if(s==="number"&&(t=t.toString(),t===n))return n;if(a){let l=n[0];l&&l.nodeType===3?l.data!==t&&(l.data=t):l=document.createTextNode(t),n=Ae(e,n,r,l);}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t;}else if(t==null||s==="boolean"){n=Ae(e,n,r);}else {if(s==="function")return le(()=>{let l=t();for(;typeof l=="function";)l=l();n=Je(e,l,n,r);}),()=>n;if(Array.isArray(t)){let l=[],c=n&&Array.isArray(n);if(pt(l,t,n,o))return le(()=>n=Je(e,l,n,r,true)),()=>n;if(l.length===0){if(n=Ae(e,n,r),a)return n}else c?n.length===0?cn(e,l,r):_r(e,n,l):(n&&Ae(e),cn(e,l));n=l;}else if(t.nodeType){if(Array.isArray(n)){if(a)return n=Ae(e,n,r,t);Ae(e,n,null,t);}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t;}}return n}function pt(e,t,n,r){let o=false;for(let i=0,s=t.length;i<s;i++){let a=t[i],l=n&&n[e.length],c;if(!(a==null||a===true||a===false))if((c=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))o=pt(e,a,l)||o;else if(c==="function")if(r){for(;typeof a=="function";)a=a();o=pt(e,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||o;}else e.push(a),o=true;else {let f=String(a);l&&l.nodeType===3&&l.data===f?e.push(l):e.push(document.createTextNode(f));}}return o}function cn(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n);}function Ae(e,t,n,r){if(n===void 0)return e.textContent="";let o=r||document.createTextNode("");if(t.length){let i=false;for(let s=t.length-1;s>=0;s--){let a=t[s];if(o!==a){let l=a.parentNode===e;!i&&!s?l?e.replaceChild(o,a):e.insertBefore(o,n):l&&a.remove();}else i=true;}}else e.insertBefore(o,n);return [o]}var Nr=["input","textarea","select","searchbox","slider","spinbutton","menuitem","menuitemcheckbox","menuitemradio","option","radio","textbox"],kr=e=>!!e.tagName&&!e.tagName.startsWith("-")&&e.tagName.includes("-"),Fr=e=>Array.isArray(e),Ar=(e,t=false)=>{let{composed:n,target:r}=e,o,i;if(r instanceof HTMLElement&&kr(r)&&n){let a=e.composedPath()[0];a instanceof HTMLElement&&(o=a.tagName,i=a.role);}else r instanceof HTMLElement&&(o=r.tagName,i=r.role);return Fr(t)?!!(o&&t&&t.some(s=>typeof o=="string"&&s.toLowerCase()===o.toLowerCase()||s===i)):!!(o&&t&&t)},dn=e=>Ar(e,Nr);var Ie="data-react-grab",mn=()=>{let e=document.querySelector(`[${Ie}]`);if(e){let i=e.shadowRoot?.querySelector(`[${Ie}]`);if(i instanceof HTMLDivElement&&e.shadowRoot)return i}let t=document.createElement("div");t.setAttribute(Ie,"true"),t.style.zIndex="2147483646",t.style.position="fixed",t.style.top="0",t.style.left="0";let n=t.attachShadow({mode:"open"}),r=document.createElement("div");return r.setAttribute(Ie,"true"),n.appendChild(r),(document.body??document.documentElement).appendChild(t),r};var de=(e,t,n)=>e+(t-e)*n;var Ir=ie("<div>"),tt=e=>{let[t,n]=L(e.bounds.x),[r,o]=L(e.bounds.y),[i,s]=L(e.bounds.width),[a,l]=L(e.bounds.height),[c,f]=L(1),g=false,C=null,T=null,w=e.bounds,R=false,p=()=>e.lerpFactor!==void 0?e.lerpFactor:e.variant==="drag"?.7:.95,d=()=>{if(R)return;R=true;let O=()=>{let k=de(t(),w.x,p()),j=de(r(),w.y,p()),N=de(i(),w.width,p()),ee=de(a(),w.height,p());n(k),o(j),s(N),l(ee),Math.abs(k-w.x)<.5&&Math.abs(j-w.y)<.5&&Math.abs(N-w.width)<.5&&Math.abs(ee-w.height)<.5?(C=null,R=false):C=requestAnimationFrame(O);};C=requestAnimationFrame(O);};re(ve(()=>e.bounds,O=>{if(w=O,!g){n(w.x),o(w.y),s(w.width),l(w.height),g=true;return}d();})),re(()=>{e.variant==="grabbed"&&e.createdAt&&(T=window.setTimeout(()=>{f(0);},1500));}),fe(()=>{C!==null&&(cancelAnimationFrame(C),C=null),T!==null&&(window.clearTimeout(T),T=null),R=false;});let h={position:"fixed","box-sizing":"border-box","pointer-events":e.variant==="drag"?"none":"auto","z-index":"2147483646"},v=()=>e.variant==="drag"?{border:"1px dashed rgba(210, 57, 192, 0.4)","background-color":"rgba(210, 57, 192, 0.05)","will-change":"transform, width, height",contain:"layout paint size",cursor:"crosshair"}:{border:"1px solid rgb(210, 57, 192)","background-color":"rgba(210, 57, 192, 0.2)",transition:e.variant==="grabbed"?"opacity 0.3s ease-out":void 0};return A(q,{get when(){return e.visible!==false},get children(){var O=Ir();return le(k=>et(O,{...h,...v(),top:`${r()}px`,left:`${t()}px`,width:`${i()}px`,height:`${a()}px`,"border-radius":e.bounds.borderRadius,transform:e.bounds.transform,opacity:c()},k)),O}})};var Mr=ie('<span style="display:inline-block;width:8px;height:8px;border:1.5px solid rgb(210, 57, 192);border-top-color:transparent;border-radius:50%;margin-right:4px;vertical-align:middle">'),gn=e=>{let t;return nn(()=>{t&&t.animate([{transform:"rotate(0deg)"},{transform:"rotate(360deg)"}],{duration:600,easing:"linear",iterations:1/0});}),(()=>{var n=Mr(),r=t;return typeof r=="function"?Ee(r,n):t=n,le(o=>et(n,{...e.style},o)),n})()};var Ve=(e,t,n,r)=>{let o=window.innerWidth,i=window.innerHeight,s=8,a=8,l=o-n-8,c=i-r-8,f=Math.max(s,Math.min(e,l)),g=Math.max(a,Math.min(t,c));return {left:f,top:g}};var Pr=ie("<span style=display:inline-block;margin-right:4px;font-weight:600>\u2713"),Lr=ie("<div style=margin-right:4px>Copied"),Dr=ie("<div style=margin-left:4px>to clipboard"),Hr=ie(`<div style="position:fixed;padding:2px 6px;background-color:#fde7f7;color:#b21c8e;border:1px solid #f7c5ec;border-radius:4px;font-size:11px;font-weight:500;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;pointer-events:none;transition:opacity 0.2s ease-in-out;display:flex;align-items:center;max-width:calc(100vw - (16px + env(safe-area-inset-left) + env(safe-area-inset-right)));overflow:hidden;text-overflow:ellipsis;white-space:nowrap">`),jr=ie(`<span style="font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;font-variant-numeric:tabular-nums">`),bt=e=>{let[t,n]=L(0),[r,o]=L(0),i,s=e.x,a=e.y,l=e.x,c=e.y,f=null,g=false,C=()=>{s=de(s,l,.3),a=de(a,c,.3),o(h=>h+1),Math.abs(s-l)<.5&&Math.abs(a-c)<.5?f=null:f=requestAnimationFrame(C);},T=()=>{f===null&&(f=requestAnimationFrame(C));},w=()=>{if(l=e.x,c=e.y,!g){s=l,a=c,g=true,o(d=>d+1);return}T();};re(ve(()=>e.visible,d=>{if(d!==false)requestAnimationFrame(()=>{n(1);});else {n(0);return}if(e.variant==="success"){let h=setTimeout(()=>{n(0);},1500);fe(()=>clearTimeout(h));}})),re(()=>{w();}),fe(()=>{f!==null&&(cancelAnimationFrame(f),f=null);});let R=()=>i?.getBoundingClientRect(),p=()=>{r();let d=R();if(!d)return {left:s,top:a};if(e.variant==="success"){let N=Math.round(s),ee=Math.round(a)-d.height-6,ne=N<8,Me=ee<8,x=ne||Me,b=Ve(N,ee,d.width,d.height);return x&&(b.left+=4,b.top+=4),b}let h=12,v=window.innerWidth,O=window.innerHeight,k=[{left:Math.round(s)+h,top:Math.round(a)+h},{left:Math.round(s)-d.width-h,top:Math.round(a)+h},{left:Math.round(s)+h,top:Math.round(a)-d.height-h},{left:Math.round(s)-d.width-h,top:Math.round(a)-d.height-h}];for(let N of k){let ee=N.left>=8&&N.left+d.width<=v-8,ne=N.top>=8&&N.top+d.height<=O-8;if(ee&&ne)return N}let j=Ve(k[0].left,k[0].top,d.width,d.height);return j.left+=4,j.top+=4,j};return A(q,{get when(){return e.visible!==false},get children(){var d=Hr(),h=i;return typeof h=="function"?Ee(h,d):i=d,ye(d,A(q,{get when(){return e.variant==="processing"},get children(){return A(gn,{})}}),null),ye(d,A(q,{get when(){return e.variant==="success"},get children(){return Pr()}}),null),ye(d,A(q,{get when(){return e.variant==="success"},get children(){return Lr()}}),null),ye(d,A(q,{get when(){return e.variant==="processing"},children:"Grabbing\u2026"}),null),ye(d,A(q,{get when(){return e.text.startsWith("(")},get fallback(){return (()=>{var v=jr();return ye(v,()=>e.text),v})()},get children(){return e.text}}),null),ye(d,A(q,{get when(){return e.variant==="success"},get children(){return Dr()}}),null),le(v=>{var O=`${p().top}px`,k=`${p().left}px`,j=e.zIndex?.toString()??"2147483647",N=t();return O!==v.e&&pe(d,"top",v.e=O),k!==v.t&&pe(d,"left",v.t=k),j!==v.a&&pe(d,"z-index",v.a=j),N!==v.o&&pe(d,"opacity",v.o=N),v},{e:void 0,t:void 0,a:void 0,o:void 0}),d}})};var Br=ie('<div style="position:fixed;z-index:2147483647;pointer-events:none;transition:opacity 0.1s ease-in-out"><div style="width:32px;height:2px;background-color:rgba(178, 28, 142, 0.2);border-radius:1px;overflow:hidden;position:relative"><div style="height:100%;background-color:#b21c8e;border-radius:1px;transition:width 0.05s cubic-bezier(0.165, 0.84, 0.44, 1)">'),Vr=e=>{let[t,n]=L(0);return re(ve(()=>e,r=>{r!==false?requestAnimationFrame(()=>{n(1);}):n(0);})),t},hn=e=>{let t=Vr(e.visible),n,r=()=>{let o=n?.getBoundingClientRect();if(!o)return {left:e.mouseX,top:e.mouseY};let i=window.innerHeight,s=e.mouseX-o.width/2,a=e.mouseY+14+o.height+8>i?e.mouseY-o.height-14:e.mouseY+14;return Ve(s,a,o.width,o.height)};return A(q,{get when(){return e.visible!==false},get children(){var o=Br(),i=o.firstChild,s=i.firstChild,a=n;return typeof a=="function"?Ee(a,o):n=o,le(l=>{var c=`${r().top}px`,f=`${r().left}px`,g=t(),C=`${Math.min(100,Math.max(0,e.progress*100))}%`;return c!==l.e&&pe(o,"top",l.e=c),f!==l.t&&pe(o,"left",l.t=f),g!==l.a&&pe(o,"opacity",l.a=g),C!==l.o&&pe(s,"width",l.o=C),l},{e:void 0,t:void 0,a:void 0,o:void 0}),o}})};var Yr=ie("<canvas style=position:fixed;top:0;left:0;pointer-events:none;z-index:2147483645>"),pn=e=>{let t,n=null,r=0,o=0,i=1,s=e.mouseX,a=e.mouseY,l=e.mouseX,c=e.mouseY,f=null,g=false,C=()=>{t&&(i=Math.max(window.devicePixelRatio||1,2),r=window.innerWidth,o=window.innerHeight,t.width=r*i,t.height=o*i,t.style.width=`${r}px`,t.style.height=`${o}px`,n=t.getContext("2d"),n&&n.scale(i,i));},T=()=>{n&&(n.clearRect(0,0,r,o),n.strokeStyle="rgba(210, 57, 192)",n.lineWidth=1,n.beginPath(),n.moveTo(s,0),n.lineTo(s,o),n.moveTo(0,a),n.lineTo(r,a),n.stroke());},w=()=>{s=de(s,l,.3),a=de(a,c,.3),T(),Math.abs(s-l)<.5&&Math.abs(a-c)<.5?f=null:f=requestAnimationFrame(w);},R=()=>{f===null&&(f=requestAnimationFrame(w));},p=()=>{if(l=e.mouseX,c=e.mouseY,!g){s=l,a=c,g=true,T();return}R();};return re(()=>{C(),T();let d=()=>{C(),T();};window.addEventListener("resize",d),fe(()=>{window.removeEventListener("resize",d),f!==null&&(cancelAnimationFrame(f),f=null);});}),re(()=>{p();}),A(q,{get when(){return e.visible!==false},get children(){var d=Yr(),h=t;return typeof h=="function"?Ee(h,d):t=d,d}})};var bn=e=>[A(q,{get when(){return $e(()=>!!e.selectionVisible)()&&e.selectionBounds},get children(){return A(tt,{variant:"selection",get bounds(){return e.selectionBounds},get visible(){return e.selectionVisible}})}}),A(q,{get when(){return $e(()=>e.crosshairVisible===true&&e.mouseX!==void 0)()&&e.mouseY!==void 0},get children(){return A(pn,{get mouseX(){return e.mouseX},get mouseY(){return e.mouseY},visible:true})}}),A(q,{get when(){return $e(()=>!!e.dragVisible)()&&e.dragBounds},get children(){return A(tt,{variant:"drag",get bounds(){return e.dragBounds},get visible(){return e.dragVisible}})}}),A(Qe,{get each(){return e.grabbedBoxes??[]},children:t=>A(tt,{variant:"grabbed",get bounds(){return t.bounds},get createdAt(){return t.createdAt}})}),A(Qe,{get each(){return e.successLabels??[]},children:t=>A(bt,{variant:"success",get text(){return t.text},get x(){return t.x},get y(){return t.y}})}),A(q,{get when(){return $e(()=>!!(e.labelVisible&&e.labelVariant&&e.labelText&&e.labelX!==void 0))()&&e.labelY!==void 0},get children(){return A(bt,{get variant(){return e.labelVariant},get text(){return e.labelText},get x(){return e.labelX},get y(){return e.labelY},get visible(){return e.labelVisible},get zIndex(){return e.labelZIndex}})}}),A(q,{get when(){return $e(()=>!!(e.progressVisible&&e.progress!==void 0&&e.mouseX!==void 0))()&&e.mouseY!==void 0},get children(){return A(hn,{get progress(){return e.progress},get mouseX(){return e.mouseX},get mouseY(){return e.mouseY},get visible(){return e.progressVisible}})}})];var Sn="0.5.14",Ge=`bippy-${Sn}`,yn=Object.defineProperty,Gr=Object.prototype.hasOwnProperty,Ye=()=>{},Tn=e=>{try{Function.prototype.toString.call(e).indexOf("^_^")>-1&&setTimeout(()=>{throw 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{}},wt=(e=we())=>"getFiberRoots"in e,xn=false,wn,ot=(e=we())=>xn?true:(typeof e.inject=="function"&&(wn=e.inject.toString()),!!wn?.includes("(injected)")),rt=new Set,Oe=new Set,Cn=e=>{let t=new Map,n=0,r={_instrumentationIsActive:false,_instrumentationSource:Ge,checkDCE:Tn,hasUnsupportedRendererAttached:false,inject(o){let i=++n;return t.set(i,o),Oe.add(o),r._instrumentationIsActive||(r._instrumentationIsActive=true,rt.forEach(s=>s())),i},on:Ye,onCommitFiberRoot:Ye,onCommitFiberUnmount:Ye,onPostCommitFiberRoot:Ye,renderers:t,supportsFiber:true,supportsFlight:true};try{yn(globalThis,"__REACT_DEVTOOLS_GLOBAL_HOOK__",{configurable:!0,enumerable:!0,get(){return r},set(s){if(s&&typeof s=="object"){let a=r.renderers;r=s,a.size>0&&(a.forEach((l,c)=>{Oe.add(l),s.renderers.set(c,l);}),it(e));}}});let o=window.hasOwnProperty,i=!1;yn(window,"hasOwnProperty",{configurable:!0,value:function(...s){try{if(!i&&s[0]==="__REACT_DEVTOOLS_GLOBAL_HOOK__")return globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__=void 0,i=!0,-0}catch{}return o.apply(this,s)},writable:!0});}catch{it(e);}return r},it=e=>{e&&rt.add(e);try{let t=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!t)return;if(!t._instrumentationSource){t.checkDCE=Tn,t.supportsFiber=!0,t.supportsFlight=!0,t.hasUnsupportedRendererAttached=!1,t._instrumentationSource=Ge,t._instrumentationIsActive=!1;let n=wt(t);if(n||(t.on=Ye),t.renderers.size){t._instrumentationIsActive=!0,rt.forEach(i=>i());return}let r=t.inject,o=ot(t);o&&!n&&(xn=!0,t.inject({scheduleRefresh(){}})&&(t._instrumentationIsActive=!0)),t.inject=i=>{let s=r(i);return Oe.add(i),o&&t.renderers.set(s,i),t._instrumentationIsActive=!0,rt.forEach(a=>a()),s};}(t.renderers.size||t._instrumentationIsActive||ot())&&e?.();}catch{}},St=()=>Gr.call(globalThis,"__REACT_DEVTOOLS_GLOBAL_HOOK__"),we=e=>St()?(it(e),globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__):Cn(e),vn=()=>!!(typeof window<"u"&&(window.document?.createElement||window.navigator?.product==="ReactNative")),Tt=()=>{try{vn()&&we();}catch{}};Tt();var xt=0,Ct=1;var vt=5;var Et=11,Rt=13;var _t=15,Ot=16;var Nt=19;var kt=26,Ft=27,At=28,$t=30;var It=e=>{let t=e;return typeof t=="function"?t:typeof t=="object"&&t?It(t.type||t.render):null},st=e=>{let t=e;if(typeof t=="string")return t;if(typeof t!="function"&&!(typeof t=="object"&&t))return null;let n=t.displayName||t.name||null;if(n)return n;let r=It(t);return r&&(r.displayName||r.name)||null};var Mt=e=>{let t=we(e.onActive);t._instrumentationSource=e.name??Ge;let n=t.onCommitFiberRoot;if(e.onCommitFiberRoot){let i=(s,a,l)=>{n!==i&&(n?.(s,a,l),e.onCommitFiberRoot?.(s,a,l));};t.onCommitFiberRoot=i;}let r=t.onCommitFiberUnmount;if(e.onCommitFiberUnmount){let i=(s,a)=>{t.onCommitFiberUnmount===i&&(r?.(s,a),e.onCommitFiberUnmount?.(s,a));};t.onCommitFiberUnmount=i;}let o=t.onPostCommitFiberRoot;if(e.onPostCommitFiberRoot){let i=(s,a)=>{t.onPostCommitFiberRoot===i&&(o?.(s,a),e.onPostCommitFiberRoot?.(s,a));};t.onPostCommitFiberRoot=i;}return t},at=e=>{let t=we();for(let n of t.renderers.values())try{let r=n.findFiberByHostInstance?.(e);if(r)return r}catch{}if(typeof e=="object"&&e){if("_reactRootContainer"in e)return e._reactRootContainer?._internalRoot?.current?.child;for(let n in e)if(n.startsWith("__reactContainer$")||n.startsWith("__reactInternalInstance$")||n.startsWith("__reactFiber"))return e[n]||null}return null},Pt=new Set;var ro=Object.create,An=Object.defineProperty,oo=Object.getOwnPropertyDescriptor,io=Object.getOwnPropertyNames,so=Object.getPrototypeOf,ao=Object.prototype.hasOwnProperty,lo=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),co=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=io(t),i=0,s=o.length,a;i<s;i++)a=o[i],!ao.call(e,a)&&a!==n&&An(e,a,{get:(l=>t[l]).bind(null,a),enumerable:!(r=oo(t,a))||r.enumerable});return e},uo=(e,t,n)=>(n=e==null?{}:ro(so(e)),co(An(n,"default",{value:e,enumerable:true}),e)),fo=()=>{let e=we();for(let t of [...Array.from(Oe),...Array.from(e.renderers.values())]){let n=t.currentDispatcherRef;if(n&&typeof n=="object")return "H"in n?n.H:n.current}return null},En=e=>{for(let t of Oe){let n=t.currentDispatcherRef;n&&typeof n=="object"&&("H"in n?n.H=e:n.current=e);}},Se=e=>`
|
|
10
|
+
in ${e}`,mo=(e,t)=>{let n=Se(e);return t&&(n+=` (at ${t})`),n},Lt=false,Dt=(e,t)=>{if(!e||Lt)return "";let n=Error.prepareStackTrace;Error.prepareStackTrace=void 0,Lt=true;let r=fo();En(null);let o=console.error,i=console.warn;console.error=()=>{},console.warn=()=>{};try{let l={DetermineComponentFrameRoot(){let C;try{if(t){let T=function(){throw Error()};if(Object.defineProperty(T.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(T,[]);}catch(w){C=w;}Reflect.construct(e,[],T);}else {try{T.call();}catch(w){C=w;}e.call(T.prototype);}}else {try{throw Error()}catch(w){C=w;}let T=e();T&&typeof T.catch=="function"&&T.catch(()=>{});}}catch(T){if(T instanceof Error&&C instanceof Error&&typeof T.stack=="string")return [T.stack,C.stack]}return [null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot",Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name")?.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});let[f,g]=l.DetermineComponentFrameRoot();if(f&&g){let C=f.split(`
|
|
11
|
+
`),T=g.split(`
|
|
12
|
+
`),w=0,R=0;for(;w<C.length&&!C[w].includes("DetermineComponentFrameRoot");)w++;for(;R<T.length&&!T[R].includes("DetermineComponentFrameRoot");)R++;if(w===C.length||R===T.length)for(w=C.length-1,R=T.length-1;w>=1&&R>=0&&C[w]!==T[R];)R--;for(;w>=1&&R>=0;w--,R--)if(C[w]!==T[R]){if(w!==1||R!==1)do if(w--,R--,R<0||C[w]!==T[R]){let p=`
|
|
13
|
+
${C[w].replace(" at new "," at ")}`,d=st(e);return d&&p.includes("<anonymous>")&&(p=p.replace("<anonymous>",d)),p}while(w>=1&&R>=0);break}}}finally{Lt=false,Error.prepareStackTrace=n,En(r),console.error=o,console.warn=i;}let s=e?st(e):"";return s?Se(s):""},go=(e,t)=>{let n=e.tag,r="";switch(n){case At:r=Se("Activity");break;case Ct:r=Dt(e.type,true);break;case Et:r=Dt(e.type.render,false);break;case xt:case _t:r=Dt(e.type,false);break;case vt:case kt:case Ft:r=Se(e.type);break;case Ot:r=Se("Lazy");break;case Rt:r=e.child!==t&&t!==null?Se("Suspense Fallback"):Se("Suspense");break;case Nt:r=Se("SuspenseList");break;case $t:r=Se("ViewTransition");break;default:return ""}return r},ho=e=>{try{let t="",n=e,r=null;do{t+=go(n,r);let o=n._debugInfo;if(o&&Array.isArray(o))for(let i=o.length-1;i>=0;i--){let s=o[i];typeof s.name=="string"&&(t+=mo(s.name,s.env));}r=n,n=n.return;}while(n);return t}catch(t){return t instanceof Error?`
|
|
14
14
|
Error generating stack: ${t.message}
|
|
15
|
-
${t.stack}`:""}},
|
|
15
|
+
${t.stack}`:""}},po=e=>{let t=Error.prepareStackTrace;Error.prepareStackTrace=void 0;let n=e;if(!n)return "";Error.prepareStackTrace=t,n.startsWith(`Error: react-stack-top-frame
|
|
16
16
|
`)&&(n=n.slice(29));let r=n.indexOf(`
|
|
17
17
|
`);if(r!==-1&&(n=n.slice(r+1)),r=Math.max(n.indexOf("react_stack_bottom_frame"),n.indexOf("react-stack-bottom-frame")),r!==-1&&(r=n.lastIndexOf(`
|
|
18
|
-
`,r)),r!==-1)n=n.slice(0,r);else return "";return n},
|
|
19
|
-
`),r=[];for(let
|
|
20
|
-
`).filter(r=>!!r.match(
|
|
21
|
-
`).filter(r=>!r.match(
|
|
22
|
-
`),r;for(let
|
|
23
|
-
`)};var
|
|
24
|
-
`),se=
|
|
18
|
+
`,r)),r!==-1)n=n.slice(0,r);else return "";return n},bo=/(^|@)\S+:\d+/,$n=/^\s*at .*(\S+:\d+|\(native\))/m,yo=/^(eval@)?(\[native code\])?$/;var wo=(e,t)=>{if(t?.includeInElement!==false){let n=e.split(`
|
|
19
|
+
`),r=[];for(let o of n)if(/^\s*at\s+/.test(o)){let i=Rn(o,void 0)[0];i&&r.push(i);}else if(/^\s*in\s+/.test(o)){let i=o.replace(/^\s*in\s+/,"").replace(/\s*\(at .*\)$/,"");r.push({function:i,raw:o});}else if(o.match(bo)){let i=_n(o,void 0)[0];i&&r.push(i);}return Ht(r,t)}return e.match($n)?Rn(e,t):_n(e,t)},In=e=>{if(!e.includes(":"))return [e,void 0,void 0];let t=/(.+?)(?::(\d+))?(?::(\d+))?$/,n=t.exec(e.replace(/[()]/g,""));return [n[1],n[2]||void 0,n[3]||void 0]},Ht=(e,t)=>t&&t.slice!=null?Array.isArray(t.slice)?e.slice(t.slice[0],t.slice[1]):e.slice(0,t.slice):e;var Rn=(e,t)=>Ht(e.split(`
|
|
20
|
+
`).filter(r=>!!r.match($n)),t).map(r=>{let o=r;o.includes("(eval ")&&(o=o.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));let i=o.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),s=i.match(/ (\(.+\)$)/);i=s?i.replace(s[0],""):i;let a=In(s?s[1]:i),l=s&&i||void 0,c=["eval","<anonymous>"].includes(a[0])?void 0:a[0];return {function:l,file:c,line:a[1]?+a[1]:void 0,col:a[2]?+a[2]:void 0,raw:o}});var _n=(e,t)=>Ht(e.split(`
|
|
21
|
+
`).filter(r=>!r.match(yo)),t).map(r=>{let o=r;if(o.includes(" > eval")&&(o=o.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),!o.includes("@")&&!o.includes(":"))return {function:o};{let i=/(([^\n\r"\u2028\u2029]*".[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*(?:@[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*)*(?:[\n\r\u2028\u2029][^@]*)?)?[^@]*)@/,s=o.match(i),a=s&&s[1]?s[1]:void 0,l=In(o.replace(i,""));return {function:a,file:l[0],line:l[1]?+l[1]:void 0,col:l[2]?+l[2]:void 0,raw:o}}});var So=lo((e,t)=>{(function(n,r){typeof e=="object"&&t!==void 0?r(e):typeof define=="function"&&define.amd?define(["exports"],r):(n=typeof globalThis<"u"?globalThis:n||self,r(n.sourcemapCodec={}));})(void 0,function(n){let r=44,o=59,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=new Uint8Array(64),a=new Uint8Array(128);for(let x=0;x<i.length;x++){let b=i.charCodeAt(x);s[x]=b,a[b]=x;}function l(x,b){let u=0,S=0,_=0;do{let D=x.next();_=a[D],u|=(_&31)<<S,S+=5;}while(_&32);let F=u&1;return u>>>=1,F&&(u=-2147483648|-u),b+u}function c(x,b,u){let S=b-u;S=S<0?-S<<1|1:S<<1;do{let _=S&31;S>>>=5,S>0&&(_|=32),x.write(s[_]);}while(S>0);return b}function f(x,b){return x.pos>=b?false:x.peek()!==r}let g=1024*16,C=typeof TextDecoder<"u"?new TextDecoder:typeof Buffer<"u"?{decode(x){return Buffer.from(x.buffer,x.byteOffset,x.byteLength).toString()}}:{decode(x){let b="";for(let u=0;u<x.length;u++)b+=String.fromCharCode(x[u]);return b}};class T{constructor(){this.pos=0,this.out="",this.buffer=new Uint8Array(g);}write(b){let{buffer:u}=this;u[this.pos++]=b,this.pos===g&&(this.out+=C.decode(u),this.pos=0);}flush(){let{buffer:b,out:u,pos:S}=this;return S>0?u+C.decode(b.subarray(0,S)):u}}class w{constructor(b){this.pos=0,this.buffer=b;}next(){return this.buffer.charCodeAt(this.pos++)}peek(){return this.buffer.charCodeAt(this.pos)}indexOf(b){let{buffer:u,pos:S}=this,_=u.indexOf(b,S);return _===-1?u.length:_}}let R=[];function p(x){let{length:b}=x,u=new w(x),S=[],_=[],F=0;for(;u.pos<b;u.pos++){F=l(u,F);let D=l(u,0);if(!f(u,b)){let X=_.pop();X[2]=F,X[3]=D;continue}let $=l(u,0),H=l(u,0),B=H&1,V=B?[F,D,0,0,$,l(u,0)]:[F,D,0,0,$],W=R;if(f(u,b)){W=[];do{let X=l(u,0);W.push(X);}while(f(u,b))}V.vars=W,S.push(V),_.push(V);}return S}function d(x){let b=new T;for(let u=0;u<x.length;)u=h(x,u,b,[0]);return b.flush()}function h(x,b,u,S){let _=x[b],{0:F,1:D,2:$,3:H,4:B,vars:V}=_;b>0&&u.write(r),S[0]=c(u,F,S[0]),c(u,D,0),c(u,B,0);let W=_.length===6?1:0;c(u,W,0),_.length===6&&c(u,_[5],0);for(let X of V)c(u,X,0);for(b++;b<x.length;){let X=x[b],{0:P,1:K}=X;if(P>$||P===$&&K>=H)break;b=h(x,b,u,S);}return u.write(r),S[0]=c(u,$,S[0]),c(u,H,0),b}function v(x){let{length:b}=x,u=new w(x),S=[],_=[],F=0,D=0,$=0,H=0,B=0,V=0,W=0,X=0;do{let P=u.indexOf(";"),K=0;for(;u.pos<P;u.pos++){if(K=l(u,K),!f(u,P)){let Q=_.pop();Q[2]=F,Q[3]=K;continue}let se=l(u,0),Re=se&1,Te=se&2,me=se&4,Ne=null,Pe=R,ge;if(Re){let Q=l(u,D);$=l(u,D===Q?$:0),D=Q,ge=[F,K,0,0,Q,$];}else ge=[F,K,0,0];if(ge.isScope=!!me,Te){let Q=H,xe=B;H=l(u,H);let he=Q===H;B=l(u,he?B:0),V=l(u,he&&xe===B?V:0),Ne=[H,B,V];}if(ge.callsite=Ne,f(u,P)){Pe=[];do{W=F,X=K;let Q=l(u,0),xe;if(Q<-1){xe=[[l(u,0)]];for(let he=-1;he>Q;he--){let Xe=W;W=l(u,W),X=l(u,W===Xe?X:0);let qe=l(u,0);xe.push([qe,W,X]);}}else xe=[[Q]];Pe.push(xe);}while(f(u,P))}ge.bindings=Pe,S.push(ge),_.push(ge);}F++,u.pos=P+1;}while(u.pos<b);return S}function O(x){if(x.length===0)return "";let b=new T;for(let u=0;u<x.length;)u=k(x,u,b,[0,0,0,0,0,0,0]);return b.flush()}function k(x,b,u,S){let _=x[b],{0:F,1:D,2:$,3:H,isScope:B,callsite:V,bindings:W}=_;S[0]<F?(j(u,S[0],F),S[0]=F,S[1]=0):b>0&&u.write(r),S[1]=c(u,_[1],S[1]);let X=(_.length===6?1:0)|(V?2:0)|(B?4:0);if(c(u,X,0),_.length===6){let{4:P,5:K}=_;P!==S[2]&&(S[3]=0),S[2]=c(u,P,S[2]),S[3]=c(u,K,S[3]);}if(V){let{0:P,1:K,2:se}=_.callsite;P===S[4]?K!==S[5]&&(S[6]=0):(S[5]=0,S[6]=0),S[4]=c(u,P,S[4]),S[5]=c(u,K,S[5]),S[6]=c(u,se,S[6]);}if(W)for(let P of W){P.length>1&&c(u,-P.length,0);let K=P[0][0];c(u,K,0);let se=F,Re=D;for(let Te=1;Te<P.length;Te++){let me=P[Te];se=c(u,me[1],se),Re=c(u,me[2],Re),c(u,me[0],0);}}for(b++;b<x.length;){let P=x[b],{0:K,1:se}=P;if(K>$||K===$&&se>=H)break;b=k(x,b,u,S);}return S[0]<$?(j(u,S[0],$),S[0]=$,S[1]=0):u.write(r),S[1]=c(u,H,S[1]),b}function j(x,b,u){do x.write(o);while(++b<u)}function N(x){let{length:b}=x,u=new w(x),S=[],_=0,F=0,D=0,$=0,H=0;do{let B=u.indexOf(";"),V=[],W=true,X=0;for(_=0;u.pos<B;){let P;_=l(u,_),_<X&&(W=false),X=_,f(u,B)?(F=l(u,F),D=l(u,D),$=l(u,$),f(u,B)?(H=l(u,H),P=[_,F,D,$,H]):P=[_,F,D,$]):P=[_],V.push(P),u.pos++;}W||ee(V),S.push(V),u.pos=B+1;}while(u.pos<=b);return S}function ee(x){x.sort(ne);}function ne(x,b){return x[0]-b[0]}function Me(x){let b=new T,u=0,S=0,_=0,F=0;for(let D=0;D<x.length;D++){let $=x[D];if(D>0&&b.write(o),$.length===0)continue;let H=0;for(let B=0;B<$.length;B++){let V=$[B];B>0&&b.write(r),H=c(b,V[0],H),V.length!==1&&(u=c(b,V[1],u),S=c(b,V[2],S),_=c(b,V[3],_),V.length!==4&&(F=c(b,V[4],F)));}}return b.flush()}n.decode=N,n.decodeGeneratedRanges=v,n.decodeOriginalScopes=p,n.encode=Me,n.encodeGeneratedRanges=O,n.encodeOriginalScopes=d,Object.defineProperty(n,"__esModule",{value:true});});}),Mn=uo(So()),Pn=/^[a-zA-Z][a-zA-Z\d+\-.]*:/,To=/^data:application\/json[^,]+base64,/,xo=/(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^*]+?)[ \t]*(?:\*\/)[ \t]*$)/,Ln=typeof WeakRef<"u",Ue=new Map,lt=new Map,Co=e=>Ln&&e instanceof WeakRef,On=(e,t,n,r)=>{if(n<0||n>=e.length)return null;let o=e[n];if(!o||o.length===0)return null;let i=null;for(let f of o)if(f[0]<=r)i=f;else break;if(!i||i.length<4)return null;let[,s,a,l]=i;if(s===void 0||a===void 0||l===void 0)return null;let c=t[s];return c?{columnNumber:l,fileName:c,lineNumber:a+1}:null},vo=(e,t,n)=>{if(e.sections){let r=null;for(let s of e.sections)if(t>s.offset.line||t===s.offset.line&&n>=s.offset.column)r=s;else break;if(!r)return null;let o=t-r.offset.line,i=t===r.offset.line?n-r.offset.column:n;return On(r.map.mappings,r.map.sources,o,i)}return On(e.mappings,e.sources,t-1,n)},Eo=(e,t)=>{let n=t.split(`
|
|
22
|
+
`),r;for(let i=n.length-1;i>=0&&!r;i--){let s=n[i].match(xo);s&&(r=s[1]||s[2]);}if(!r)return null;let o=Pn.test(r);if(!(To.test(r)||o||r.startsWith("/"))){let i=e.split("/");i[i.length-1]=r,r=i.join("/");}return r},Ro=e=>({file:e.file,mappings:(0, Mn.decode)(e.mappings),names:e.names,sourceRoot:e.sourceRoot,sources:e.sources,sourcesContent:e.sourcesContent,version:3}),_o=e=>{let t=e.sections.map(({map:r,offset:o})=>({map:{...r,mappings:(0, Mn.decode)(r.mappings)},offset:o})),n=new Set;for(let r of t)for(let o of r.map.sources)n.add(o);return {file:e.file,mappings:[],names:[],sections:t,sourceRoot:void 0,sources:Array.from(n),sourcesContent:void 0,version:3}},Nn=e=>{if(!e)return false;let t=e.trim();if(!t)return false;let n=t.match(Pn);if(!n)return true;let r=n[0].toLowerCase();return r==="http:"||r==="https:"},Oo=async(e,t=fetch)=>{if(!Nn(e))return null;let n;try{n=await(await t(e)).text();}catch{return null}if(!n)return null;let r=Eo(e,n);if(!r||!Nn(r))return null;try{let o=await t(r),i=await o.json();return "sections"in i?_o(i):Ro(i)}catch{return null}},No=async(e,t=true,n)=>{if(t&&Ue.has(e)){let i=Ue.get(e);if(i==null)return null;if(Co(i)){let s=i.deref();if(s)return s;Ue.delete(e);}else return i}if(t&<.has(e))return lt.get(e);let r=Oo(e,n);t&<.set(e,r);let o=await r;return t&<.delete(e),t&&(o===null?Ue.set(e,null):Ue.set(e,Ln?new WeakRef(o):o)),o},kn=/^[a-zA-Z][a-zA-Z\d+\-.]*:/,ko=["rsc://","file:///","webpack://","node:","turbopack://","metro://"],Fn="about://React/",Fo=["<anonymous>","eval",""],Ao=/\.(jsx|tsx|ts|js)$/,$o=/(\.min|bundle|chunk|vendor|vendors|runtime|polyfill|polyfills)\.(js|mjs|cjs)$|(chunk|bundle|vendor|vendors|runtime|polyfill|polyfills|framework|app|main|index)[-_.][A-Za-z0-9_-]{4,}\.(js|mjs|cjs)$|[\da-f]{8,}\.(js|mjs|cjs)$|[-_.][\da-f]{20,}\.(js|mjs|cjs)$|\/dist\/|\/build\/|\/.next\/|\/out\/|\/node_modules\/|\.webpack\.|\.vite\.|\.turbopack\./i,Io=/^\?[\w~.\-]+(?:=[^&#]*)?(?:&[\w~.\-]+(?:=[^&#]*)?)*$/,Mo=e=>e._debugStack instanceof Error&&typeof e._debugStack?.stack=="string";var Dn=e=>Mo(e)?po(e._debugStack.stack):ho(e);var Hn=async(e,t=1,n=true,r)=>{let o=wo(e,{slice:t??1}),i=[];for(let s of o){if(!s?.file)continue;let a=await No(s.file,n,r);if(a&&typeof s.line=="number"&&typeof s.col=="number"){let l=vo(a,s.line,s.col);if(l){i.push(l);continue}}i.push({fileName:s.file,lineNumber:s.line,columnNumber:s.col,functionName:s.function});}return i},jt=e=>{if(!e||Fo.includes(e))return "";let t=e;if(t.startsWith(Fn)){let r=t.slice(Fn.length),o=r.indexOf("/"),i=r.indexOf(":");t=o!==-1&&(i===-1||o<i)?r.slice(o+1):r;}for(let r of ko)if(t.startsWith(r)){t=t.slice(r.length),r==="file:///"&&(t=`/${t.replace(/^\/+/,"")}`);break}if(kn.test(t)){let r=t.match(kn);r&&(t=t.slice(r[0].length));}let n=t.indexOf("?");if(n!==-1){let r=t.slice(n);Io.test(r)&&(t=t.slice(0,n));}return t},jn=e=>{let t=jt(e);return !(!t||!Ao.test(t)||$o.test(t))};Mt({onCommitFiberRoot(e,t){Pt.add(t);}});var Bn=async e=>{let t=at(e);if(!t)return null;let n=Dn(t),r=await Hn(n,Number.MAX_SAFE_INTEGER);return r?(console.log(r),r.map(o=>({...o,fileName:jt(o.fileName)})).filter(o=>jn(o.fileName))):null};var Vn=e=>{let t=new Set(["article","aside","footer","form","header","main","nav","section"]),n=p=>{let d=p.tagName.toLowerCase();if(t.has(d)||p.id)return true;if(p.className&&typeof p.className=="string"){let h=p.className.trim();if(h&&h.length>0)return true}return Array.from(p.attributes).some(h=>h.name.startsWith("data-"))},r=(p,d=10)=>{let h=[],v=p.parentElement,O=0;for(;v&&O<d&&v.tagName!=="BODY"&&!(n(v)&&(h.push(v),h.length>=3));)v=v.parentElement,O++;return h.reverse()},o=p=>{let d=[],h=p,v=0,O=5;for(;h&&v<O&&h.tagName!=="BODY";){let k=h.tagName.toLowerCase();if(h.id){k+=`#${h.id}`,d.unshift(k);break}else if(h.className&&typeof h.className=="string"&&h.className.trim()){let j=h.className.trim().split(/\s+/).slice(0,2);k+=`.${j.join(".")}`;}if(!h.id&&(!h.className||!h.className.trim())&&h.parentElement){let j=Array.from(h.parentElement.children),N=j.indexOf(h);N>=0&&j.length>1&&(k+=`:nth-child(${N+1})`);}d.unshift(k),h=h.parentElement,v++;}return d.join(" > ")},i=(p,d=false)=>{let h=p.tagName.toLowerCase(),v=[];if(p.id&&v.push(`id="${p.id}"`),p.className&&typeof p.className=="string"){let N=p.className.trim().split(/\s+/);if(N.length>0&&N[0]){let ne=(d?N.slice(0,3):N).join(" ");ne.length>30&&(ne=ne.substring(0,30)+"..."),v.push(`class="${ne}"`);}}let O=Array.from(p.attributes).filter(N=>N.name.startsWith("data-")),k=d?O.slice(0,1):O;for(let N of k){let ee=N.value;ee.length>20&&(ee=ee.substring(0,20)+"..."),v.push(`${N.name}="${ee}"`);}let j=p.getAttribute("aria-label");if(j&&!d){let N=j;N.length>20&&(N=N.substring(0,20)+"..."),v.push(`aria-label="${N}"`);}return v.length>0?`<${h} ${v.join(" ")}>`:`<${h}>`},s=p=>`</${p.tagName.toLowerCase()}>`,a=p=>{let d=p.textContent||"";d=d.trim().replace(/\s+/g," ");let h=60;return d.length>h&&(d=d.substring(0,h)+"..."),d},l=p=>{if(p.id)return `#${p.id}`;if(p.className&&typeof p.className=="string"){let d=p.className.trim().split(/\s+/);if(d.length>0&&d[0])return `.${d[0]}`}return null},c=[];c.push(`Path: ${o(e)}`),c.push("");let f=r(e);for(let p=0;p<f.length;p++){let d=" ".repeat(p);c.push(d+i(f[p],true));}let g=e.parentElement,C=-1;if(g){let p=Array.from(g.children);if(C=p.indexOf(e),C>0){let d=p[C-1];if(l(d)&&C<=2){let v=" ".repeat(f.length);c.push(`${v} ${i(d,true)}`),c.push(`${v} </${d.tagName.toLowerCase()}>`);}else if(C>0){let v=" ".repeat(f.length);c.push(`${v} ... (${C} element${C===1?"":"s"})`);}}}let T=" ".repeat(f.length);c.push(T+" <!-- SELECTED -->");let w=a(e),R=e.children.length;if(w&&R===0&&w.length<40?c.push(`${T} ${i(e)}${w}${s(e)}`):(c.push(T+" "+i(e)),w&&c.push(`${T} ${w}`),R>0&&c.push(`${T} ... (${R} element${R===1?"":"s"})`),c.push(T+" "+s(e))),g&&C>=0){let p=Array.from(g.children),d=p.length-C-1;if(d>0){let h=p[C+1];l(h)&&d<=2?(c.push(`${T} ${i(h,true)}`),c.push(`${T} </${h.tagName.toLowerCase()}>`)):c.push(`${T} ... (${d} element${d===1?"":"s"})`);}}for(let p=f.length-1;p>=0;p--){let d=" ".repeat(p);c.push(d+s(f[p]));}return c.join(`
|
|
23
|
+
`)};var Po=()=>document.hasFocus()?Promise.resolve():new Promise(e=>{let t=()=>{window.removeEventListener("focus",t),e();};window.addEventListener("focus",t),window.focus();}),Bt=async e=>{await Po();try{if(Array.isArray(e)){if(!navigator?.clipboard?.write){for(let t of e)if(typeof t=="string"){let n=Yn(t);if(!n)return n}return !0}return await navigator.clipboard.write([new ClipboardItem(Object.fromEntries(e.map(t=>t instanceof Blob?[t.type??"text/plain",t]:["text/plain",new Blob([t],{type:"text/plain"})])))]),!0}else {if(e instanceof Blob)return await navigator.clipboard.write([new ClipboardItem({[e.type]:e})]),!0;try{return await navigator.clipboard.writeText(String(e)),!0}catch{return Yn(e)}}}catch{return false}},Yn=e=>{if(!document.execCommand)return false;let t=document.createElement("textarea");t.value=String(e),t.style.clipPath="inset(50%)",t.ariaHidden="true",(document.body||document.documentElement).append(t);try{return t.select(),document.execCommand("copy")}finally{t.remove();}};var Gn=(e,t=window.getComputedStyle(e))=>t.display!=="none"&&t.visibility!=="hidden"&&t.opacity!=="0";var ze=e=>{if(e.closest(`[${Ie}]`))return false;let t=window.getComputedStyle(e);return !(!Gn(e,t)||t.pointerEvents==="none")};var Vt=(e,t)=>{let n=document.elementsFromPoint(e,t);for(let r of n)if(ze(r))return r;return null};var Un=(e,t,n)=>{let r=[],o=Array.from(document.querySelectorAll("*")),i=e.x,s=e.y,a=e.x+e.width,l=e.y+e.height;for(let c of o){if(!n){let R=(c.tagName||"").toUpperCase();if(R==="HTML"||R==="BODY")continue}if(!t(c))continue;let f=c.getBoundingClientRect(),g=f.left,C=f.top,T=f.left+f.width,w=f.top+f.height;if(n){let R=Math.max(i,g),p=Math.max(s,C),d=Math.min(a,T),h=Math.min(l,w),v=Math.max(0,d-R),O=Math.max(0,h-p),k=v*O,j=Math.max(0,f.width*f.height);j>0&&k/j>=.75&&r.push(c);}else g<a&&T>i&&C<l&&w>s&&r.push(c);}return r},zn=e=>e.filter(t=>!e.some(n=>n!==t&&n.contains(t))),Xn=(e,t,n)=>{if(e.length<=1)return null;let r=t.x,o=t.y,i=t.x+t.width,s=t.y+t.height,a=e[0];for(;a;){let l=a.parentElement;if(!l)break;let c=l.getBoundingClientRect(),f=Math.max(r,c.left),g=Math.max(o,c.top),C=Math.min(i,c.left+c.width),T=Math.min(s,c.top+c.height),w=Math.max(0,C-f),R=Math.max(0,T-g),p=w*R,d=Math.max(0,c.width*c.height);if(!(d>0&&p/d>=.75))break;if(!n(l)){a=l;continue}if(e.every(O=>l.contains(O)))return l;a=l;}return null},qn=(e,t)=>{let n=Un(e,t,true),r=zn(n),o=Xn(r,e,t);return o?[o]:r},Wn=(e,t)=>{let n=Un(e,t,false),r=zn(n),o=Xn(r,e,t);return o?[o]:r};var Yt=e=>{let t=e.getBoundingClientRect(),n=window.getComputedStyle(e);return {borderRadius:n.borderRadius||"0px",height:t.height,transform:n.transform||"none",width:t.width,x:t.left,y:t.top}};var Kn=1700,Lo=150,Zn=e=>{let t={enabled:true,keyHoldDuration:300,...e};if(t.enabled!==false)return _e(n=>{let[o,i]=L(false),[s,a]=L(-1e3),[l,c]=L(-1e3),[f,g]=L(false),[C,T]=L(-1e3),[w,R]=L(-1e3),[p,d]=L(false),[h,v]=L(null),[O,k]=L(null),[j,N]=L(0),[ee,ne]=L([]),[Me,x]=L([]),[b,u]=L(false),[S,_]=L(false),F=null,D=null,$=null,H=null,B=z(()=>b()&&!p()),V=z(()=>s()>-1e3&&l()>-1e3),W=m=>(m.metaKey||m.ctrlKey)&&m.key.toLowerCase()==="c",X=m=>{let E=`grabbed-${Date.now()}-${Math.random()}`,I=Date.now(),Y={id:E,bounds:m,createdAt:I},U=ee();ne([...U,Y]),setTimeout(()=>{ne(oe=>oe.filter(ft=>ft.id!==E));},Kn);},P=(m,E,I)=>{let Y=`success-${Date.now()}-${Math.random()}`;x(U=>[...U,{id:Y,text:m,x:E,y:I}]),setTimeout(()=>{x(U=>U.filter(oe=>oe.id!==Y));},Kn);},K=m=>m.map(E=>{let I=E.functionName??"anonymous",Y=E.fileName??"unknown",U=E.lineNumber??0,oe=E.columnNumber??0;return ` at ${I} (${Y}:${U}:${oe})`}).join(`
|
|
24
|
+
`),se=m=>`<selected_element>${m}</selected_element>`,Re=m=>{let E=window.getComputedStyle(m),I=m.getBoundingClientRect();return {width:`${I.width}px`,height:`${I.height}px`,paddingTop:E.paddingTop,paddingRight:E.paddingRight,paddingBottom:E.paddingBottom,paddingLeft:E.paddingLeft,background:E.background,opacity:E.opacity}},Te=m=>{let E={elements:m.map(U=>({tagName:U.tagName,content:U.content,computedStyles:U.computedStyles}))},Y=`<div data-react-grab="${btoa(JSON.stringify(E))}"></div>`;return new Blob([Y],{type:"text/html"})},me=async m=>{let E=Vn(m),I=await Bn(m);if(I?.length){let Y=K(I);return `${E}
|
|
25
25
|
|
|
26
26
|
Component owner stack:
|
|
27
|
-
${
|
|
27
|
+
${Y}`}return E},Ne=m=>(m.tagName||"").toLowerCase(),Pe=async m=>{let E=m.getBoundingClientRect(),I=Ne(m);X(Yt(m));try{let Y=await me(m),U=se(Y),oe=Te([{tagName:I,content:await me(m),computedStyles:Re(m)}]);await Bt([U,oe]);}catch{}P(I?`<${I}>`:"<element>",E.left,E.top);},ge=async m=>{if(m.length===0)return;let E=1/0,I=1/0;for(let Y of m){let U=Y.getBoundingClientRect();E=Math.min(E,U.left),I=Math.min(I,U.top),X(Yt(Y));}try{let U=(await Promise.all(m.map(Le=>me(Le)))).join(`
|
|
28
28
|
|
|
29
29
|
---
|
|
30
30
|
|
|
31
|
-
`)
|
|
31
|
+
`),oe=se(U),ft=await Promise.all(m.map(async Le=>({tagName:Ne(Le),content:await me(Le),computedStyles:Re(Le)}))),ur=Te(ft);await Bt([oe,ur]);}catch{}P(`${m.length} elements`,E,I);},Q=z(()=>!B()||f()?null:Vt(s(),l())),xe=z(()=>{let m=Q();if(!m)return;let E=m.getBoundingClientRect(),I=window.getComputedStyle(m);return {borderRadius:I.borderRadius||"0px",height:E.height,transform:I.transform||"none",width:E.width,x:E.left,y:E.top}}),he=2,Xe=(m,E)=>({x:Math.abs(m-C()),y:Math.abs(E-w())}),qe=z(()=>{if(!f())return false;let m=Xe(s(),l());return m.x>he||m.y>he}),Gt=(m,E)=>{let I=Math.min(C(),m),Y=Math.min(w(),E),U=Math.abs(m-C()),oe=Math.abs(E-w());return {x:I,y:Y,width:U,height:oe}},Qn=z(()=>{if(!qe())return;let m=Gt(s(),l());return {borderRadius:"0px",height:m.height,transform:"none",width:m.width,x:m.x,y:m.y}}),Jn=z(()=>{let m=Q();if(!m)return "(click or drag to select element(s))";let E=Ne(m);return E?`<${E}>`:"<element>"}),Ut=z(()=>({x:s(),y:l()})),er=z(()=>{let m=Q(),E=h();return !!m&&m===E});re(ve(()=>[Q(),h()],([m,E])=>{E&&m&&E!==m&&v(null);}));let zt=z(()=>{let m=O();if(j(),m===null)return 0;let E=Date.now()-m;return Math.min(E/t.keyHoldDuration,1)}),tr=()=>{k(Date.now()),_(false),$=window.setTimeout(()=>{_(true),$=null;},Lo);let m=()=>{if(O()===null)return;N(I=>I+1),zt()<1&&(D=requestAnimationFrame(m));};m();},ct=()=>{D!==null&&(cancelAnimationFrame(D),D=null),$!==null&&(window.clearTimeout($),$=null),k(null),_(false);},nr=()=>{ct(),u(true),document.body.style.cursor="crosshair";},ut=()=>{i(false),u(false),document.body.style.cursor="",f()&&(g(false),document.body.style.userSelect=""),F&&window.clearTimeout(F),H&&window.clearTimeout(H),ct();},Xt=new AbortController,ke=Xt.signal;window.addEventListener("keydown",m=>{if(m.key==="Escape"&&o()){ut();return}dn(m)||W(m)&&(o()||(i(true),tr(),F=window.setTimeout(()=>{nr(),t.onActivate?.();},t.keyHoldDuration)),b()&&(H&&window.clearTimeout(H),H=window.setTimeout(()=>{ut();},200)));},{signal:ke}),window.addEventListener("keyup",m=>{if(!o()&&!b())return;let E=m.key.toLowerCase()==="c",I=!m.metaKey&&!m.ctrlKey;(E||I)&&ut();},{signal:ke,capture:true}),window.addEventListener("mousemove",m=>{a(m.clientX),c(m.clientY);},{signal:ke}),window.addEventListener("mousedown",m=>{!B()||p()||(m.preventDefault(),g(true),T(m.clientX),R(m.clientY),document.body.style.userSelect="none");},{signal:ke}),window.addEventListener("mouseup",m=>{if(!f())return;let E=Xe(m.clientX,m.clientY),I=E.x>he||E.y>he;if(g(false),document.body.style.userSelect="",I){let Y=Gt(m.clientX,m.clientY),U=qn(Y,ze);if(U.length>0)d(true),ge(U).finally(()=>{d(false);});else {let oe=Wn(Y,ze);oe.length>0&&(d(true),ge(oe).finally(()=>{d(false);}));}}else {let Y=Vt(m.clientX,m.clientY);if(!Y)return;d(true),v(Y),Pe(Y).finally(()=>{d(false);});}},{signal:ke}),document.addEventListener("visibilitychange",()=>{document.hidden&&ne([]);},{signal:ke}),fe(()=>{Xt.abort(),F&&window.clearTimeout(F),H&&window.clearTimeout(H),ct(),document.body.style.userSelect="",document.body.style.cursor="";});let rr=mn(),or=z(()=>false),ir=z(()=>B()&&qe()),sr=z(()=>p()?"processing":"hover"),ar=z(()=>B()&&!f()&&(!!Q()&&!er()||!Q())||p()),lr=z(()=>o()&&S()&&V()),cr=z(()=>B()&&!f());return un(()=>A(bn,{get selectionVisible(){return or()},get selectionBounds(){return xe()},get dragVisible(){return ir()},get dragBounds(){return Qn()},get grabbedBoxes(){return ee()},get successLabels(){return Me()},get labelVariant(){return sr()},get labelText(){return Jn()},get labelX(){return Ut().x},get labelY(){return Ut().y},get labelVisible(){return ar()},get progressVisible(){return lr()},get progress(){return zt()},get mouseX(){return s()},get mouseY(){return l()},get crosshairVisible(){return cr()}}),rr),n})};Zn();/*! Bundled license information:
|
|
32
32
|
|
|
33
33
|
bippy/dist/rdt-hook-DAGphl8S.js:
|
|
34
34
|
(**
|
|
@@ -89,4 +89,4 @@ bippy/dist/source.js:
|
|
|
89
89
|
* This source code is licensed under the MIT license found in the
|
|
90
90
|
* LICENSE file in the root directory of this source tree.
|
|
91
91
|
*)
|
|
92
|
-
*/exports.init=
|
|
92
|
+
*/exports.init=Zn;return exports;})({});
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { render, createComponent, memo, template, effect, style, insert, setStyleProperty, use } from 'solid-js/web';
|
|
2
2
|
import { createRoot, createSignal, createMemo, createEffect, on, onCleanup, Show, For, onMount } from 'solid-js';
|
|
3
3
|
import { instrument, _fiberRoots, getFiberFromHostInstance } from 'bippy';
|
|
4
|
-
import { getOwnerStack, getSourcesFromStack } from 'bippy/dist/source';
|
|
4
|
+
import { getOwnerStack, getSourcesFromStack, normalizeFileName, isSourceFile } from 'bippy/dist/source';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* @license MIT
|
|
@@ -737,7 +737,15 @@ var getSourceTrace = async (element) => {
|
|
|
737
737
|
Number.MAX_SAFE_INTEGER
|
|
738
738
|
);
|
|
739
739
|
if (!sources) return null;
|
|
740
|
-
|
|
740
|
+
console.log(sources);
|
|
741
|
+
return sources.map((source) => {
|
|
742
|
+
return {
|
|
743
|
+
...source,
|
|
744
|
+
fileName: normalizeFileName(source.fileName)
|
|
745
|
+
};
|
|
746
|
+
}).filter((source) => {
|
|
747
|
+
return isSourceFile(source.fileName);
|
|
748
|
+
});
|
|
741
749
|
};
|
|
742
750
|
var getHTMLSnippet = (element) => {
|
|
743
751
|
const semanticTags = /* @__PURE__ */ new Set([
|
|
@@ -1229,12 +1237,40 @@ var init = (rawOptions) => {
|
|
|
1229
1237
|
const fileName = source.fileName ?? "unknown";
|
|
1230
1238
|
const lineNumber = source.lineNumber ?? 0;
|
|
1231
1239
|
const columnNumber = source.columnNumber ?? 0;
|
|
1232
|
-
return ` ${functionName}
|
|
1240
|
+
return ` at ${functionName} (${fileName}:${lineNumber}:${columnNumber})`;
|
|
1233
1241
|
}).join("\n");
|
|
1234
1242
|
};
|
|
1235
1243
|
const wrapContextInXmlTags = (context) => {
|
|
1236
1244
|
return `<selected_element>${context}</selected_element>`;
|
|
1237
1245
|
};
|
|
1246
|
+
const getComputedStyles = (element) => {
|
|
1247
|
+
const computed = window.getComputedStyle(element);
|
|
1248
|
+
const rect = element.getBoundingClientRect();
|
|
1249
|
+
return {
|
|
1250
|
+
width: `${rect.width}px`,
|
|
1251
|
+
height: `${rect.height}px`,
|
|
1252
|
+
paddingTop: computed.paddingTop,
|
|
1253
|
+
paddingRight: computed.paddingRight,
|
|
1254
|
+
paddingBottom: computed.paddingBottom,
|
|
1255
|
+
paddingLeft: computed.paddingLeft,
|
|
1256
|
+
background: computed.background,
|
|
1257
|
+
opacity: computed.opacity
|
|
1258
|
+
};
|
|
1259
|
+
};
|
|
1260
|
+
const createStructuredClipboardHtml = (elements) => {
|
|
1261
|
+
const structuredData = {
|
|
1262
|
+
elements: elements.map((element) => ({
|
|
1263
|
+
tagName: element.tagName,
|
|
1264
|
+
content: element.content,
|
|
1265
|
+
computedStyles: element.computedStyles
|
|
1266
|
+
}))
|
|
1267
|
+
};
|
|
1268
|
+
const base64Data = btoa(JSON.stringify(structuredData));
|
|
1269
|
+
const htmlContent = `<div data-react-grab="${base64Data}"></div>`;
|
|
1270
|
+
return new Blob([htmlContent], {
|
|
1271
|
+
type: "text/html"
|
|
1272
|
+
});
|
|
1273
|
+
};
|
|
1238
1274
|
const getElementContentWithTrace = async (element) => {
|
|
1239
1275
|
const elementHtml = getHTMLSnippet(element);
|
|
1240
1276
|
const componentStackTrace = await getSourceTrace(element);
|
|
@@ -1254,7 +1290,13 @@ ${formattedStackTrace}`;
|
|
|
1254
1290
|
addGrabbedBox(createElementBounds(targetElement2));
|
|
1255
1291
|
try {
|
|
1256
1292
|
const content = await getElementContentWithTrace(targetElement2);
|
|
1257
|
-
|
|
1293
|
+
const plainTextContent = wrapContextInXmlTags(content);
|
|
1294
|
+
const htmlContent = createStructuredClipboardHtml([{
|
|
1295
|
+
tagName,
|
|
1296
|
+
content: await getElementContentWithTrace(targetElement2),
|
|
1297
|
+
computedStyles: getComputedStyles(targetElement2)
|
|
1298
|
+
}]);
|
|
1299
|
+
await copyContent([plainTextContent, htmlContent]);
|
|
1258
1300
|
} catch {
|
|
1259
1301
|
}
|
|
1260
1302
|
addSuccessLabel(tagName ? `<${tagName}>` : "<element>", elementBounds.left, elementBounds.top);
|
|
@@ -1272,7 +1314,14 @@ ${formattedStackTrace}`;
|
|
|
1272
1314
|
try {
|
|
1273
1315
|
const elementSnippets = await Promise.all(targetElements.map((element) => getElementContentWithTrace(element)));
|
|
1274
1316
|
const combinedContent = elementSnippets.join("\n\n---\n\n");
|
|
1275
|
-
|
|
1317
|
+
const plainTextContent = wrapContextInXmlTags(combinedContent);
|
|
1318
|
+
const structuredElements = await Promise.all(targetElements.map(async (element) => ({
|
|
1319
|
+
tagName: getElementTagName(element),
|
|
1320
|
+
content: await getElementContentWithTrace(element),
|
|
1321
|
+
computedStyles: getComputedStyles(element)
|
|
1322
|
+
})));
|
|
1323
|
+
const htmlContent = createStructuredClipboardHtml(structuredElements);
|
|
1324
|
+
await copyContent([plainTextContent, htmlContent]);
|
|
1276
1325
|
} catch {
|
|
1277
1326
|
}
|
|
1278
1327
|
addSuccessLabel(`${targetElements.length} elements`, minPositionX, minPositionY);
|