react-grab 0.0.31 → 0.0.32
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 +95 -79
- package/dist/index.d.cts +11 -2
- package/dist/index.d.ts +11 -2
- package/dist/index.global.js +13 -15
- package/dist/index.js +95 -80
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -830,7 +830,6 @@ var getHTMLSnippet = async (element) => {
|
|
|
830
830
|
};
|
|
831
831
|
const lines = [];
|
|
832
832
|
const selector = generateCSSSelector(element);
|
|
833
|
-
lines.push(`Locate this element in the codebase:`);
|
|
834
833
|
lines.push(`- selector: ${selector}`);
|
|
835
834
|
const rect = element.getBoundingClientRect();
|
|
836
835
|
lines.push(`- width: ${Math.round(rect.width)}`);
|
|
@@ -937,11 +936,13 @@ var getHTMLSnippet = async (element) => {
|
|
|
937
936
|
|
|
938
937
|
// src/utils/copy-content.ts
|
|
939
938
|
var waitForFocus = () => {
|
|
940
|
-
if (document.hasFocus())
|
|
939
|
+
if (document.hasFocus()) {
|
|
940
|
+
return new Promise((resolve) => setTimeout(resolve, 50));
|
|
941
|
+
}
|
|
941
942
|
return new Promise((resolve) => {
|
|
942
943
|
const onFocus = () => {
|
|
943
944
|
window.removeEventListener("focus", onFocus);
|
|
944
|
-
resolve
|
|
945
|
+
setTimeout(resolve, 50);
|
|
945
946
|
};
|
|
946
947
|
window.addEventListener("focus", onFocus);
|
|
947
948
|
window.focus();
|
|
@@ -960,21 +961,24 @@ var copyContent = async (content) => {
|
|
|
960
961
|
}
|
|
961
962
|
return true;
|
|
962
963
|
}
|
|
964
|
+
const mimeTypeMap = /* @__PURE__ */ new Map();
|
|
965
|
+
for (const contentPart of content) {
|
|
966
|
+
if (contentPart instanceof Blob) {
|
|
967
|
+
const mimeType = contentPart.type || "text/plain";
|
|
968
|
+
if (!mimeTypeMap.has(mimeType)) {
|
|
969
|
+
mimeTypeMap.set(mimeType, contentPart);
|
|
970
|
+
}
|
|
971
|
+
} else {
|
|
972
|
+
if (!mimeTypeMap.has("text/plain")) {
|
|
973
|
+
mimeTypeMap.set(
|
|
974
|
+
"text/plain",
|
|
975
|
+
new Blob([contentPart], { type: "text/plain" })
|
|
976
|
+
);
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
}
|
|
963
980
|
await navigator.clipboard.write([
|
|
964
|
-
new ClipboardItem(
|
|
965
|
-
Object.fromEntries(
|
|
966
|
-
content.map((contentPart) => {
|
|
967
|
-
if (contentPart instanceof Blob) {
|
|
968
|
-
return [contentPart.type ?? "text/plain", contentPart];
|
|
969
|
-
} else {
|
|
970
|
-
return [
|
|
971
|
-
"text/plain",
|
|
972
|
-
new Blob([contentPart], { type: "text/plain" })
|
|
973
|
-
];
|
|
974
|
-
}
|
|
975
|
-
})
|
|
976
|
-
)
|
|
977
|
-
)
|
|
981
|
+
new ClipboardItem(Object.fromEntries(mimeTypeMap))
|
|
978
982
|
]);
|
|
979
983
|
return true;
|
|
980
984
|
} else if (content instanceof Blob) {
|
|
@@ -1092,57 +1096,14 @@ var removeNestedElements = (elements) => {
|
|
|
1092
1096
|
);
|
|
1093
1097
|
});
|
|
1094
1098
|
};
|
|
1095
|
-
var findBestParentElement = (elements, dragRect, isValidGrabbableElement2) => {
|
|
1096
|
-
if (elements.length <= 1) return null;
|
|
1097
|
-
const dragLeft = dragRect.x;
|
|
1098
|
-
const dragTop = dragRect.y;
|
|
1099
|
-
const dragRight = dragRect.x + dragRect.width;
|
|
1100
|
-
const dragBottom = dragRect.y + dragRect.height;
|
|
1101
|
-
let currentParent = elements[0];
|
|
1102
|
-
while (currentParent) {
|
|
1103
|
-
const parent = currentParent.parentElement;
|
|
1104
|
-
if (!parent) break;
|
|
1105
|
-
const parentRect = parent.getBoundingClientRect();
|
|
1106
|
-
const intersectionLeft = Math.max(dragLeft, parentRect.left);
|
|
1107
|
-
const intersectionTop = Math.max(dragTop, parentRect.top);
|
|
1108
|
-
const intersectionRight = Math.min(dragRight, parentRect.left + parentRect.width);
|
|
1109
|
-
const intersectionBottom = Math.min(dragBottom, parentRect.top + parentRect.height);
|
|
1110
|
-
const intersectionWidth = Math.max(0, intersectionRight - intersectionLeft);
|
|
1111
|
-
const intersectionHeight = Math.max(0, intersectionBottom - intersectionTop);
|
|
1112
|
-
const intersectionArea = intersectionWidth * intersectionHeight;
|
|
1113
|
-
const parentArea = Math.max(0, parentRect.width * parentRect.height);
|
|
1114
|
-
const hasMajorityCoverage = parentArea > 0 && intersectionArea / parentArea >= DRAG_COVERAGE_THRESHOLD;
|
|
1115
|
-
if (!hasMajorityCoverage) break;
|
|
1116
|
-
if (!isValidGrabbableElement2(parent)) {
|
|
1117
|
-
currentParent = parent;
|
|
1118
|
-
continue;
|
|
1119
|
-
}
|
|
1120
|
-
const allChildrenInParent = elements.every(
|
|
1121
|
-
(element) => parent.contains(element)
|
|
1122
|
-
);
|
|
1123
|
-
if (allChildrenInParent) {
|
|
1124
|
-
return parent;
|
|
1125
|
-
}
|
|
1126
|
-
currentParent = parent;
|
|
1127
|
-
}
|
|
1128
|
-
return null;
|
|
1129
|
-
};
|
|
1130
1099
|
var getElementsInDrag = (dragRect, isValidGrabbableElement2) => {
|
|
1131
1100
|
const elements = filterElementsInDrag(dragRect, isValidGrabbableElement2, true);
|
|
1132
1101
|
const uniqueElements = removeNestedElements(elements);
|
|
1133
|
-
const bestParent = findBestParentElement(uniqueElements, dragRect, isValidGrabbableElement2);
|
|
1134
|
-
if (bestParent) {
|
|
1135
|
-
return [bestParent];
|
|
1136
|
-
}
|
|
1137
1102
|
return uniqueElements;
|
|
1138
1103
|
};
|
|
1139
1104
|
var getElementsInDragLoose = (dragRect, isValidGrabbableElement2) => {
|
|
1140
1105
|
const elements = filterElementsInDrag(dragRect, isValidGrabbableElement2, false);
|
|
1141
1106
|
const uniqueElements = removeNestedElements(elements);
|
|
1142
|
-
const bestParent = findBestParentElement(uniqueElements, dragRect, isValidGrabbableElement2);
|
|
1143
|
-
if (bestParent) {
|
|
1144
|
-
return [bestParent];
|
|
1145
|
-
}
|
|
1146
1107
|
return uniqueElements;
|
|
1147
1108
|
};
|
|
1148
1109
|
|
|
@@ -1169,7 +1130,17 @@ var init = (rawOptions) => {
|
|
|
1169
1130
|
...rawOptions
|
|
1170
1131
|
};
|
|
1171
1132
|
if (options.enabled === false) {
|
|
1172
|
-
return
|
|
1133
|
+
return {
|
|
1134
|
+
activate: () => {
|
|
1135
|
+
},
|
|
1136
|
+
deactivate: () => {
|
|
1137
|
+
},
|
|
1138
|
+
toggle: () => {
|
|
1139
|
+
},
|
|
1140
|
+
isActive: () => false,
|
|
1141
|
+
dispose: () => {
|
|
1142
|
+
}
|
|
1143
|
+
};
|
|
1173
1144
|
}
|
|
1174
1145
|
return solidJs.createRoot((dispose) => {
|
|
1175
1146
|
const OFFSCREEN_POSITION = -1e3;
|
|
@@ -1255,6 +1226,19 @@ ${context}
|
|
|
1255
1226
|
});
|
|
1256
1227
|
};
|
|
1257
1228
|
const extractElementTagName = (element) => (element.tagName || "").toLowerCase();
|
|
1229
|
+
const notifyElementsSelected = (elements) => {
|
|
1230
|
+
try {
|
|
1231
|
+
const elementsPayload = elements.map((element) => ({
|
|
1232
|
+
tagName: extractElementTagName(element)
|
|
1233
|
+
}));
|
|
1234
|
+
window.dispatchEvent(new CustomEvent("react-grab:element-selected", {
|
|
1235
|
+
detail: {
|
|
1236
|
+
elements: elementsPayload
|
|
1237
|
+
}
|
|
1238
|
+
}));
|
|
1239
|
+
} catch {
|
|
1240
|
+
}
|
|
1241
|
+
};
|
|
1258
1242
|
const executeCopyOperation = async (positionX, positionY, operation) => {
|
|
1259
1243
|
setCopyStartX(positionX);
|
|
1260
1244
|
setCopyStartY(positionY);
|
|
@@ -1278,6 +1262,7 @@ ${context}
|
|
|
1278
1262
|
} catch {
|
|
1279
1263
|
}
|
|
1280
1264
|
showTemporarySuccessLabel(tagName ? `<${tagName}>` : "<element>", copyStartX(), copyStartY());
|
|
1265
|
+
notifyElementsSelected([targetElement2]);
|
|
1281
1266
|
};
|
|
1282
1267
|
const copyMultipleElementsToClipboard = async (targetElements) => {
|
|
1283
1268
|
if (targetElements.length === 0) return;
|
|
@@ -1286,8 +1271,7 @@ ${context}
|
|
|
1286
1271
|
}
|
|
1287
1272
|
try {
|
|
1288
1273
|
const elementSnippets = await Promise.all(targetElements.map((element) => getHTMLSnippet(element)));
|
|
1289
|
-
const
|
|
1290
|
-
const plainTextContent = wrapInSelectedElementTags(combinedContent);
|
|
1274
|
+
const plainTextContent = elementSnippets.filter((snippet) => snippet.trim()).map((snippet) => wrapInSelectedElementTags(snippet)).join("\n\n");
|
|
1291
1275
|
const structuredElements = elementSnippets.map((content, index) => ({
|
|
1292
1276
|
tagName: extractElementTagName(targetElements[index]),
|
|
1293
1277
|
content,
|
|
@@ -1298,6 +1282,7 @@ ${context}
|
|
|
1298
1282
|
} catch {
|
|
1299
1283
|
}
|
|
1300
1284
|
showTemporarySuccessLabel(`${targetElements.length} elements`, copyStartX(), copyStartY());
|
|
1285
|
+
notifyElementsSelected(targetElements);
|
|
1301
1286
|
};
|
|
1302
1287
|
const targetElement = solidJs.createMemo(() => {
|
|
1303
1288
|
if (!isRendererActive() || isDragging()) return null;
|
|
@@ -1429,22 +1414,28 @@ ${context}
|
|
|
1429
1414
|
return;
|
|
1430
1415
|
}
|
|
1431
1416
|
if (isKeyboardEventTriggeredByInput(event)) return;
|
|
1432
|
-
if (isTargetKeyCombination(event))
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
holdTimerId = window.setTimeout(() => {
|
|
1437
|
-
activateRenderer();
|
|
1438
|
-
options.onActivate?.();
|
|
1439
|
-
}, options.keyHoldDuration);
|
|
1440
|
-
}
|
|
1441
|
-
if (isActivated()) {
|
|
1442
|
-
if (keydownSpamTimerId) window.clearTimeout(keydownSpamTimerId);
|
|
1443
|
-
keydownSpamTimerId = window.setTimeout(() => {
|
|
1444
|
-
deactivateRenderer();
|
|
1445
|
-
}, 200);
|
|
1417
|
+
if (!isTargetKeyCombination(event)) return;
|
|
1418
|
+
if (isActivated()) {
|
|
1419
|
+
if (keydownSpamTimerId !== null) {
|
|
1420
|
+
window.clearTimeout(keydownSpamTimerId);
|
|
1446
1421
|
}
|
|
1422
|
+
keydownSpamTimerId = window.setTimeout(() => {
|
|
1423
|
+
deactivateRenderer();
|
|
1424
|
+
}, 200);
|
|
1425
|
+
return;
|
|
1426
|
+
}
|
|
1427
|
+
if (event.repeat) return;
|
|
1428
|
+
if (holdTimerId !== null) {
|
|
1429
|
+
window.clearTimeout(holdTimerId);
|
|
1447
1430
|
}
|
|
1431
|
+
if (!isHoldingKeys()) {
|
|
1432
|
+
setIsHoldingKeys(true);
|
|
1433
|
+
}
|
|
1434
|
+
startProgressAnimation();
|
|
1435
|
+
holdTimerId = window.setTimeout(() => {
|
|
1436
|
+
activateRenderer();
|
|
1437
|
+
options.onActivate?.();
|
|
1438
|
+
}, options.keyHoldDuration);
|
|
1448
1439
|
}, {
|
|
1449
1440
|
signal: eventListenerSignal
|
|
1450
1441
|
});
|
|
@@ -1584,11 +1575,36 @@ ${context}
|
|
|
1584
1575
|
return crosshairVisible();
|
|
1585
1576
|
}
|
|
1586
1577
|
}), rendererRoot);
|
|
1587
|
-
return
|
|
1578
|
+
return {
|
|
1579
|
+
activate: () => {
|
|
1580
|
+
if (!isActivated()) {
|
|
1581
|
+
activateRenderer();
|
|
1582
|
+
options.onActivate?.();
|
|
1583
|
+
}
|
|
1584
|
+
},
|
|
1585
|
+
deactivate: () => {
|
|
1586
|
+
if (isActivated()) {
|
|
1587
|
+
deactivateRenderer();
|
|
1588
|
+
}
|
|
1589
|
+
},
|
|
1590
|
+
toggle: () => {
|
|
1591
|
+
if (isActivated()) {
|
|
1592
|
+
deactivateRenderer();
|
|
1593
|
+
} else {
|
|
1594
|
+
activateRenderer();
|
|
1595
|
+
options.onActivate?.();
|
|
1596
|
+
}
|
|
1597
|
+
},
|
|
1598
|
+
isActive: () => isActivated(),
|
|
1599
|
+
dispose
|
|
1600
|
+
};
|
|
1588
1601
|
});
|
|
1589
1602
|
};
|
|
1590
1603
|
|
|
1591
1604
|
// src/index.ts
|
|
1592
|
-
|
|
1605
|
+
var globalApi = null;
|
|
1606
|
+
var getGlobalApi = () => globalApi;
|
|
1607
|
+
globalApi = init();
|
|
1593
1608
|
|
|
1609
|
+
exports.getGlobalApi = getGlobalApi;
|
|
1594
1610
|
exports.init = init;
|
package/dist/index.d.cts
CHANGED
|
@@ -3,6 +3,13 @@ interface Options {
|
|
|
3
3
|
keyHoldDuration?: number;
|
|
4
4
|
onActivate?: () => void;
|
|
5
5
|
}
|
|
6
|
+
interface ReactGrabAPI {
|
|
7
|
+
activate: () => void;
|
|
8
|
+
deactivate: () => void;
|
|
9
|
+
toggle: () => void;
|
|
10
|
+
isActive: () => boolean;
|
|
11
|
+
dispose: () => void;
|
|
12
|
+
}
|
|
6
13
|
interface OverlayBounds {
|
|
7
14
|
borderRadius: string;
|
|
8
15
|
height: number;
|
|
@@ -40,6 +47,8 @@ interface ReactGrabRendererProps {
|
|
|
40
47
|
crosshairVisible?: boolean;
|
|
41
48
|
}
|
|
42
49
|
|
|
43
|
-
declare const init: (rawOptions?: Options) =>
|
|
50
|
+
declare const init: (rawOptions?: Options) => ReactGrabAPI;
|
|
51
|
+
|
|
52
|
+
declare const getGlobalApi: () => ReactGrabAPI | null;
|
|
44
53
|
|
|
45
|
-
export { type Options, type OverlayBounds, type ReactGrabRendererProps, init };
|
|
54
|
+
export { type Options, type OverlayBounds, type ReactGrabAPI, type ReactGrabRendererProps, getGlobalApi, init };
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,13 @@ interface Options {
|
|
|
3
3
|
keyHoldDuration?: number;
|
|
4
4
|
onActivate?: () => void;
|
|
5
5
|
}
|
|
6
|
+
interface ReactGrabAPI {
|
|
7
|
+
activate: () => void;
|
|
8
|
+
deactivate: () => void;
|
|
9
|
+
toggle: () => void;
|
|
10
|
+
isActive: () => boolean;
|
|
11
|
+
dispose: () => void;
|
|
12
|
+
}
|
|
6
13
|
interface OverlayBounds {
|
|
7
14
|
borderRadius: string;
|
|
8
15
|
height: number;
|
|
@@ -40,6 +47,8 @@ interface ReactGrabRendererProps {
|
|
|
40
47
|
crosshairVisible?: boolean;
|
|
41
48
|
}
|
|
42
49
|
|
|
43
|
-
declare const init: (rawOptions?: Options) =>
|
|
50
|
+
declare const init: (rawOptions?: Options) => ReactGrabAPI;
|
|
51
|
+
|
|
52
|
+
declare const getGlobalApi: () => ReactGrabAPI | null;
|
|
44
53
|
|
|
45
|
-
export { type Options, type OverlayBounds, type ReactGrabRendererProps, init };
|
|
54
|
+
export { type Options, type OverlayBounds, type ReactGrabAPI, type ReactGrabRendererProps, getGlobalApi, init };
|
package/dist/index.global.js
CHANGED
|
@@ -6,27 +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 Mr=(e,t)=>e===t;var Pr=Symbol("solid-track"),rt={equals:Mr},yn=xn,le=1,Ye=2,wn={owned:null,cleanups:null,context:null,owner:null};var P=null,b=null,Ie=null,V=null,K=null,Q=null,it=0;function Ae(e,t){let n=V,r=P,o=e.length===0,i=t===void 0?r:t,s=o?wn:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e(()=>ie(()=>ve(s)));P=s,V=null;try{return ye(a,!0)}finally{V=n,P=r;}}function $(e,t){t=t?Object.assign({},rt,t):rt;let n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(o=o(n.value)),Cn(n,o));return [Tn.bind(n),r]}function se(e,t,n){let r=_t(e,t,false,le);ze(r);}function te(e,t,n){yn=jr;let r=_t(e,t,false,le);(r.user=true),Q?Q.push(r):ze(r);}function z(e,t,n){n=n?Object.assign({},rt,n):rt;let r=_t(e,t,true,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,ze(r),Tn.bind(r)}function ie(e){if(V===null)return e();let t=V;V=null;try{return Ie?Ie.untrack(e):e()}finally{V=t;}}function Ee(e,t,n){let r=Array.isArray(e),o;return s=>{let a;if(r){a=Array(e.length);for(let f=0;f<e.length;f++)a[f]=e[f]();}else a=e();let l=ie(()=>t(a,o,s));return o=a,l}}function Sn(e){te(()=>ie(e));}function ce(e){return P===null||(P.cleanups===null?P.cleanups=[e]:P.cleanups.push(e)),e}$(false);function Tn(){let e=b;if(this.sources&&(this.state))if((this.state)===le)ze(this);else {let t=K;K=null,ye(()=>ot(this),false),K=t;}if(V){let t=this.observers?this.observers.length:0;V.sources?(V.sources.push(this),V.sourceSlots.push(t)):(V.sources=[this],V.sourceSlots=[t]),this.observers?(this.observers.push(V),this.observerSlots.push(V.sources.length-1)):(this.observers=[V],this.observerSlots=[V.sources.length-1]);}return e&&b.sources.has(this)?this.tValue:this.value}function Cn(e,t,n){let r=e.value;if(!e.comparator||!e.comparator(r,t)){e.value=t;e.observers&&e.observers.length&&ye(()=>{for(let o=0;o<e.observers.length;o+=1){let i=e.observers[o],s=b&&b.running;s&&b.disposed.has(i)||((s?!i.tState:!i.state)&&(i.pure?K.push(i):Q.push(i),i.observers&&vn(i)),s?i.tState=le:i.state=le);}if(K.length>1e6)throw K=[],new Error},false);}return t}function ze(e){if(!e.fn)return;ve(e);let t=it;gn(e,e.value,t);}function gn(e,t,n){let r,o=P,i=V;V=P=e;try{r=e.fn(t);}catch(s){return e.pure&&((e.state=le,e.owned&&e.owned.forEach(ve),e.owned=null)),e.updatedAt=n+1,At(s)}finally{V=i,P=o;}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?Cn(e,r):e.value=r,e.updatedAt=n);}function _t(e,t,n,r=le,o){let i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:P,context:P?P.context:null,pure:n};if(P===null||P!==wn&&(P.owned?P.owned.push(i):P.owned=[i]),Ie);return i}function Ge(e){let t=b;if((e.state)===0)return;if((e.state)===Ye)return ot(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<it);){(e.state)&&n.push(e);}for(let r=n.length-1;r>=0;r--){if(e=n[r],t);if((e.state)===le)ze(e);else if((e.state)===Ye){let o=K;K=null,ye(()=>ot(e,n[0]),false),K=o;}}}function ye(e,t){if(K)return e();let n=false;t||(K=[]),Q?n=true:Q=[],it++;try{let r=e();return Hr(n),r}catch(r){n||(Q=null),K=null,At(r);}}function Hr(e){if(K&&(xn(K),K=null),e)return;let n=Q;Q=null,n.length&&ye(()=>yn(n),false);}function xn(e){for(let t=0;t<e.length;t++)Ge(e[t]);}function jr(e){let t,n=0;for(t=0;t<e.length;t++){let r=e[t];r.user?e[n++]=r:Ge(r);}for(t=0;t<n;t++)Ge(e[t]);}function ot(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===le?o!==t&&(!o.updatedAt||o.updatedAt<it)&&Ge(o):i===Ye&&ot(o,t);}}}function vn(e){for(let n=0;n<e.observers.length;n+=1){let r=e.observers[n];(!r.state)&&(r.state=Ye,r.pure?K.push(r):Q.push(r),r.observers&&vn(r));}}function ve(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--)ve(e.tOwned[t]);delete e.tOwned;}if(e.owned){for(t=e.owned.length-1;t>=0;t--)ve(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 Vr(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function At(e,t=P){let r=Vr(e);throw r;}var Yr=Symbol("fallback");function bn(e){for(let t=0;t<e.length;t++)e[t]();}function Gr(e,t,n={}){let r=[],o=[],i=[],s=0,a=t.length>1?[]:null;return ce(()=>bn(i)),()=>{let l=e()||[],f=l.length,d,g;return l[Pr],ie(()=>{let x,S,C,R,T,A,O,N,_;if(f===0)s!==0&&(bn(i),i=[],r=[],o=[],s=0,a&&(a=[])),n.fallback&&(r=[Yr],o[0]=Ae(L=>(i[0]=L,n.fallback())),s=1);else if(s===0){for(o=new Array(f),g=0;g<f;g++)r[g]=l[g],o[g]=Ae(p);s=f;}else {for(C=new Array(f),R=new Array(f),a&&(T=new Array(f)),A=0,O=Math.min(s,f);A<O&&r[A]===l[A];A++);for(O=s-1,N=f-1;O>=A&&N>=A&&r[O]===l[N];O--,N--)C[N]=o[O],R[N]=i[O],a&&(T[N]=a[O]);for(x=new Map,S=new Array(N+1),g=N;g>=A;g--)_=l[g],d=x.get(_),S[g]=d===void 0?-1:d,x.set(_,g);for(d=A;d<=O;d++)_=r[d],g=x.get(_),g!==void 0&&g!==-1?(C[g]=o[d],R[g]=i[d],a&&(T[g]=a[d]),g=S[g],x.set(_,g)):i[d]();for(g=A;g<f;g++)g in C?(o[g]=C[g],i[g]=R[g],a&&(a[g]=T[g],a[g](g))):o[g]=Ae(p);o=o.slice(0,s=f),r=l.slice(0);}return o});function p(x){if(i[g]=x,a){let[S,C]=$(g);return a[g]=C,t(l[g],S)}return t(l[g])}}}function k(e,t){return ie(()=>e(t||{}))}var zr=e=>`Stale read from <${e}>.`;function st(e){let t="fallback"in e&&{fallback:()=>e.fallback};return z(Gr(()=>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?ie(()=>i(t?o:()=>{if(!ie(r))throw zr("Show");return n()})):i}return e.fallback},void 0,void 0)}var Pe=e=>z(()=>e());function Wr(e,t,n){let r=n.length,o=t.length,i=r,s=0,a=0,l=t[o-1].nextSibling,f=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 d=i<r?a?n[a-1].nextSibling:n[i-a]:l;for(;a<i;)e.insertBefore(n[a++],d);}else if(i===a)for(;s<o;)(!f||!f.has(t[s]))&&t[s].remove(),s++;else if(t[s]===n[i-1]&&n[a]===t[o-1]){let d=t[--o].nextSibling;e.insertBefore(n[a++],t[s++].nextSibling),e.insertBefore(n[--i],d),t[o]=n[i];}else {if(!f){f=new Map;let g=a;for(;g<i;)f.set(n[g],g++);}let d=f.get(t[s]);if(d!=null)if(a<d&&d<i){let g=s,p=1,x;for(;++g<o&&g<i&&!((x=f.get(t[g]))==null||x!==d+p);)p++;if(p>d-a){let S=t[s];for(;a<d;)e.insertBefore(n[a++],S);}else e.replaceChild(n[a++],t[s++]);}else s++;else t[s++].remove();}}}function On(e,t,n,r={}){let o;return Ae(i=>{o=i,t===document?e():we(t,e(),t.firstChild?null:void 0,n);},r.owner),()=>{o(),t.textContent="";}}function re(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 Kr(e,t,n){(e.removeAttribute(t));}function lt(e,t,n){if(!t)return n?Kr(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 Re(e,t,n){return ie(()=>e(t,n))}function we(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return at(e,t,r,n);se(o=>at(e,t(),o,n),r);}function at(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=Me(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=Me(e,n,r);}else {if(s==="function")return se(()=>{let l=t();for(;typeof l=="function";)l=l();n=at(e,l,n,r);}),()=>n;if(Array.isArray(t)){let l=[],f=n&&Array.isArray(n);if(Ft(l,t,n,o))return se(()=>n=at(e,l,n,r,true)),()=>n;if(l.length===0){if(n=Me(e,n,r),a)return n}else f?n.length===0?Rn(e,l,r):Wr(e,n,l):(n&&Me(e),Rn(e,l));n=l;}else if(t.nodeType){if(Array.isArray(n)){if(a)return n=Me(e,n,r,t);Me(e,n,null,t);}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t;}}return n}function Ft(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],f;if(!(a==null||a===true||a===false))if((f=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))o=Ft(e,a,l)||o;else if(f==="function")if(r){for(;typeof a=="function";)a=a();o=Ft(e,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||o;}else e.push(a),o=true;else {let d=String(a);l&&l.nodeType===3&&l.data===d?e.push(l):e.push(document.createTextNode(d));}}return o}function Rn(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n);}function Me(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 Zr=["input","textarea","select","searchbox","slider","spinbutton","menuitem","menuitemcheckbox","menuitemradio","option","radio","textbox"],Jr=e=>!!e.tagName&&!e.tagName.startsWith("-")&&e.tagName.includes("-"),Qr=e=>Array.isArray(e),eo=(e,t=false)=>{let{composed:n,target:r}=e,o,i;if(r instanceof HTMLElement&&Jr(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 Qr(t)?!!(o&&t&&t.some(s=>typeof o=="string"&&s.toLowerCase()===o.toLowerCase()||s===i)):!!(o&&t&&t)},_n=e=>eo(e,Zr);var Le="data-react-grab",An=()=>{let e=document.querySelector(`[${Le}]`);if(e){let i=e.shadowRoot?.querySelector(`[${Le}]`);if(i instanceof HTMLDivElement&&e.shadowRoot)return i}let t=document.createElement("div");t.setAttribute(Le,"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(Le,"true"),n.appendChild(r),(document.body??document.documentElement).appendChild(t),r};var fe=(e,t,n)=>e+(t-e)*n;var no=re("<div>"),ct=e=>{let[t,n]=$(e.bounds.x),[r,o]=$(e.bounds.y),[i,s]=$(e.bounds.width),[a,l]=$(e.bounds.height),[f,d]=$(1),g=false,p=null,x=null,S=e.bounds,C=false,R=()=>e.lerpFactor!==void 0?e.lerpFactor:e.variant==="drag"?.7:.95,T=()=>{if(C)return;C=true;let N=()=>{let _=fe(t(),S.x,R()),L=fe(r(),S.y,R()),ne=fe(i(),S.width,R()),oe=fe(a(),S.height,R());n(_),o(L),s(ne),l(oe),Math.abs(_-S.x)<.5&&Math.abs(L-S.y)<.5&&Math.abs(ne-S.width)<.5&&Math.abs(oe-S.height)<.5?(p=null,C=false):p=requestAnimationFrame(N);};p=requestAnimationFrame(N);};te(Ee(()=>e.bounds,N=>{if(S=N,!g){n(S.x),o(S.y),s(S.width),l(S.height),g=true;return}T();})),te(()=>{e.variant==="grabbed"&&e.createdAt&&(x=window.setTimeout(()=>{d(0);},1500));}),ce(()=>{p!==null&&(cancelAnimationFrame(p),p=null),x!==null&&(window.clearTimeout(x),x=null),C=false;});let A={position:"fixed","box-sizing":"border-box","pointer-events":e.variant==="drag"?"none":"auto","z-index":"2147483646"},O=()=>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 k(q,{get when(){return e.visible!==false},get children(){var N=no();return se(_=>lt(N,{...A,...O(),top:`${r()}px`,left:`${t()}px`,width:`${i()}px`,height:`${a()}px`,"border-radius":e.bounds.borderRadius,transform:e.bounds.transform,opacity:f()},_)),N}})};var ro=re('<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">'),Fn=e=>{let t;return Sn(()=>{t&&t.animate([{transform:"rotate(0deg)"},{transform:"rotate(360deg)"}],{duration:600,easing:"linear",iterations:1/0});}),(()=>{var n=ro(),r=t;return typeof r=="function"?Re(r,n):t=n,se(o=>lt(n,{...e.style},o)),n})()};var ut=(e,t,n,r)=>{let o=window.innerWidth,i=window.innerHeight,s=8,a=8,l=o-n-8,f=i-r-8,d=Math.max(s,Math.min(e,l)),g=Math.max(a,Math.min(t,f));return {left:d,top:g}};var oo=re("<span style=display:inline-block;margin-right:4px;font-weight:600>\u2713"),io=re("<div style=margin-right:4px>Copied"),so=re(`<span style="font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;font-variant-numeric:tabular-nums">`),ao=re("<div style=margin-left:4px>to clipboard"),lo=re(`<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">`),$t=e=>{let[t,n]=$(0),[r,o]=$(0),i,s=e.x,a=e.y,l=e.x,f=e.y,d=null,g=false,p=()=>{s=fe(s,l,.3),a=fe(a,f,.3),o(A=>A+1),Math.abs(s-l)<.5&&Math.abs(a-f)<.5?d=null:d=requestAnimationFrame(p);},x=()=>{d===null&&(d=requestAnimationFrame(p));},S=()=>{if(l=e.x,f=e.y,!g){s=l,a=f,g=true,o(T=>T+1);return}x();};te(Ee(()=>e.visible,T=>{if(T!==false)requestAnimationFrame(()=>{n(1);});else {n(0);return}if(e.variant==="success"){let A=setTimeout(()=>{n(0);},1700);ce(()=>clearTimeout(A));}})),te(()=>{S();}),ce(()=>{d!==null&&(cancelAnimationFrame(d),d=null);});let C=()=>i?.getBoundingClientRect(),R=()=>{r();let T=C();if(!T)return {left:s,top:a};let A=window.innerWidth,O=window.innerHeight,N=[{left:Math.round(s)+14,top:Math.round(a)+14},{left:Math.round(s)-T.width-14,top:Math.round(a)+14},{left:Math.round(s)+14,top:Math.round(a)-T.height-14},{left:Math.round(s)-T.width-14,top:Math.round(a)-T.height-14}];for(let L of N){let ne=L.left>=8&&L.left+T.width<=A-8,oe=L.top>=8&&L.top+T.height<=O-8;if(ne&&oe)return L}let _=ut(N[0].left,N[0].top,T.width,T.height);return _.left+=4,_.top+=4,_};return k(q,{get when(){return e.visible!==false},get children(){var T=lo(),A=i;return typeof A=="function"?Re(A,T):i=T,we(T,k(q,{get when(){return e.variant==="processing"},get children(){return k(Fn,{})}}),null),we(T,k(q,{get when(){return e.variant==="success"},get children(){return oo()}}),null),we(T,k(q,{get when(){return e.variant==="success"},get children(){return io()}}),null),we(T,k(q,{get when(){return e.variant==="processing"},children:"Grabbing\u2026"}),null),we(T,k(q,{get when(){return e.variant!=="processing"},get children(){var O=so();return we(O,()=>e.text),O}}),null),we(T,k(q,{get when(){return e.variant==="success"},get children(){return ao()}}),null),se(O=>{var N=`${R().top}px`,_=`${R().left}px`,L=e.zIndex?.toString()??"2147483647",ne=t();return N!==O.e&&pe(T,"top",O.e=N),_!==O.t&&pe(T,"left",O.t=_),L!==O.a&&pe(T,"z-index",O.a=L),ne!==O.o&&pe(T,"opacity",O.o=ne),O},{e:void 0,t:void 0,a:void 0,o:void 0}),T}})};var co=re('<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)">'),uo=e=>{let[t,n]=$(0);return te(Ee(()=>e,r=>{r!==false?requestAnimationFrame(()=>{n(1);}):n(0);})),t},kn=e=>{let t=uo(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 ut(s,a,o.width,o.height)};return k(q,{get when(){return e.visible!==false},get children(){var o=co(),i=o.firstChild,s=i.firstChild,a=n;return typeof a=="function"?Re(a,o):n=o,se(l=>{var f=`${r().top}px`,d=`${r().left}px`,g=t(),p=`${Math.min(100,Math.max(0,e.progress*100))}%`;return f!==l.e&&pe(o,"top",l.e=f),d!==l.t&&pe(o,"left",l.t=d),g!==l.a&&pe(o,"opacity",l.a=g),p!==l.o&&pe(s,"width",l.o=p),l},{e:void 0,t:void 0,a:void 0,o:void 0}),o}})};var fo=re("<canvas style=position:fixed;top:0;left:0;pointer-events:none;z-index:2147483645>"),In=e=>{let t,n=null,r=0,o=0,i=1,s=e.mouseX,a=e.mouseY,l=e.mouseX,f=e.mouseY,d=null,g=false,p=()=>{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));},x=()=>{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());},S=()=>{s=fe(s,l,.3),a=fe(a,f,.3),x(),Math.abs(s-l)<.5&&Math.abs(a-f)<.5?d=null:d=requestAnimationFrame(S);},C=()=>{d===null&&(d=requestAnimationFrame(S));},R=()=>{if(l=e.mouseX,f=e.mouseY,!g){s=l,a=f,g=true,x();return}C();};return te(()=>{p(),x();let T=()=>{p(),x();};window.addEventListener("resize",T),ce(()=>{window.removeEventListener("resize",T),d!==null&&(cancelAnimationFrame(d),d=null);});}),te(()=>{R();}),k(q,{get when(){return e.visible!==false},get children(){var T=fo(),A=t;return typeof A=="function"?Re(A,T):t=T,T}})};var Mn=e=>[k(q,{get when(){return Pe(()=>!!e.selectionVisible)()&&e.selectionBounds},get children(){return k(ct,{variant:"selection",get bounds(){return e.selectionBounds},get visible(){return e.selectionVisible}})}}),k(q,{get when(){return Pe(()=>e.crosshairVisible===true&&e.mouseX!==void 0)()&&e.mouseY!==void 0},get children(){return k(In,{get mouseX(){return e.mouseX},get mouseY(){return e.mouseY},visible:true})}}),k(q,{get when(){return Pe(()=>!!e.dragVisible)()&&e.dragBounds},get children(){return k(ct,{variant:"drag",get bounds(){return e.dragBounds},get visible(){return e.dragVisible}})}}),k(st,{get each(){return e.grabbedBoxes??[]},children:t=>k(ct,{variant:"grabbed",get bounds(){return t.bounds},get createdAt(){return t.createdAt}})}),k(st,{get each(){return e.successLabels??[]},children:t=>k($t,{variant:"success",get text(){return t.text},get x(){return t.x},get y(){return t.y}})}),k(q,{get when(){return Pe(()=>!!(e.labelVisible&&e.labelVariant&&e.labelText&&e.labelX!==void 0))()&&e.labelY!==void 0},get children(){return k($t,{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}})}}),k(q,{get when(){return Pe(()=>!!(e.progressVisible&&e.progress!==void 0&&e.mouseX!==void 0))()&&e.mouseY!==void 0},get children(){return k(kn,{get progress(){return e.progress},get mouseX(){return e.mouseX},get mouseY(){return e.mouseY},get visible(){return e.progressVisible}})}})];var Dn="0.5.14",Xe=`bippy-${Dn}`,Pn=Object.defineProperty,mo=Object.prototype.hasOwnProperty,qe=()=>{},Hn=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{}},kt=(e=Se())=>"getFiberRoots"in e,Bn=false,Ln,mt=(e=Se())=>Bn?true:(typeof e.inject=="function"&&(Ln=e.inject.toString()),!!Ln?.includes("(injected)")),dt=new Set,Fe=new Set,jn=e=>{let t=new Map,n=0,r={_instrumentationIsActive:false,_instrumentationSource:Xe,checkDCE:Hn,hasUnsupportedRendererAttached:false,inject(o){let i=++n;return t.set(i,o),Fe.add(o),r._instrumentationIsActive||(r._instrumentationIsActive=true,dt.forEach(s=>s())),i},on:qe,onCommitFiberRoot:qe,onCommitFiberUnmount:qe,onPostCommitFiberRoot:qe,renderers:t,supportsFiber:true,supportsFlight:true};try{Pn(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,f)=>{Fe.add(l),s.renderers.set(f,l);}),ht(e));}}});let o=window.hasOwnProperty,i=!1;Pn(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{ht(e);}return r},ht=e=>{e&&dt.add(e);try{let t=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!t)return;if(!t._instrumentationSource){t.checkDCE=Hn,t.supportsFiber=!0,t.supportsFlight=!0,t.hasUnsupportedRendererAttached=!1,t._instrumentationSource=Xe,t._instrumentationIsActive=!1;let n=kt(t);if(n||(t.on=qe),t.renderers.size){t._instrumentationIsActive=!0,dt.forEach(i=>i());return}let r=t.inject,o=mt(t);o&&!n&&(Bn=!0,t.inject({scheduleRefresh(){}})&&(t._instrumentationIsActive=!0)),t.inject=i=>{let s=r(i);return Fe.add(i),o&&t.renderers.set(s,i),t._instrumentationIsActive=!0,dt.forEach(a=>a()),s};}(t.renderers.size||t._instrumentationIsActive||mt())&&e?.();}catch{}},It=()=>mo.call(globalThis,"__REACT_DEVTOOLS_GLOBAL_HOOK__"),Se=e=>It()?(ht(e),globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__):jn(e),Vn=()=>!!(typeof window<"u"&&(window.document?.createElement||window.navigator?.product==="ReactNative")),Mt=()=>{try{Vn()&&Se();}catch{}};Mt();var gt=0,pt=1;var bt=5;var yt=11,Pt=13,Yn=14,wt=15,Lt=16;var Dt=19;var St=26,Tt=27,Ht=28,Bt=30;var jt=e=>{switch(e.tag){case bt:case St:case Tt:return true;default:return typeof e.type=="string"}},We=e=>{switch(e.tag){case pt:case yt:case gt:case Yn:case wt:return true;default:return false}};function De(e,t,n=false){return e&&t(e)instanceof Promise?Yt(e,t,n):Vt(e,t,n)}var Vt=(e,t,n=false)=>{if(!e)return null;if(t(e)===true)return e;let r=n?e.return:e.child;for(;r;){let o=Vt(r,t,n);if(o)return o;r=n?null:r.sibling;}return null},Yt=async(e,t,n=false)=>{if(!e)return null;if(await t(e)===true)return e;let r=n?e.return:e.child;for(;r;){let o=await Yt(r,t,n);if(o)return o;r=n?null:r.sibling;}return null};var Gt=e=>{let t=e;return typeof t=="function"?t:typeof t=="object"&&t?Gt(t.type||t.render):null},He=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=Gt(t);return r&&(r.displayName||r.name)||null};var Ut=e=>{let t=e.alternate;if(!t)return e;if(t.actualStartTime&&e.actualStartTime)return t.actualStartTime>e.actualStartTime?t:e;for(let n of Ct){let r=De(n.current,o=>{if(o===e)return true});if(r)return r}return e};var zt=e=>{let t=Se(e.onActive);t._instrumentationSource=e.name??Xe;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},Ke=e=>{let t=Se();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},Ct=new Set;var Co=Object.create,Zn=Object.defineProperty,xo=Object.getOwnPropertyDescriptor,vo=Object.getOwnPropertyNames,Eo=Object.getPrototypeOf,Ro=Object.prototype.hasOwnProperty,Oo=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),No=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=vo(t),i=0,s=o.length,a;i<s;i++)a=o[i],!Ro.call(e,a)&&a!==n&&Zn(e,a,{get:(l=>t[l]).bind(null,a),enumerable:!(r=xo(t,a))||r.enumerable});return e},_o=(e,t,n)=>(n=e==null?{}:Co(Eo(e)),No(Zn(n,"default",{value:e,enumerable:true}),e)),Ao=()=>{let e=Se();for(let t of [...Array.from(Fe),...Array.from(e.renderers.values())]){let n=t.currentDispatcherRef;if(n&&typeof n=="object")return "H"in n?n.H:n.current}return null},Gn=e=>{for(let t of Fe){let n=t.currentDispatcherRef;n&&typeof n=="object"&&("H"in n?n.H=e:n.current=e);}},Te=e=>`
|
|
10
|
-
in ${e}`,Fo=(e,t)=>{let n=
|
|
9
|
+
var Mr=(e,t)=>e===t;var Pr=Symbol("solid-track"),ot={equals:Mr},wn=vn,ce=1,Ge=2,Sn={owned:null,cleanups:null,context:null,owner:null};var P=null,p=null,Ie=null,G=null,K=null,ee=null,st=0;function Ae(e,t){let n=G,r=P,o=e.length===0,i=t===void 0?r:t,s=o?Sn:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e(()=>se(()=>ve(s)));P=s,G=null;try{return be(a,!0)}finally{G=n,P=r;}}function $(e,t){t=t?Object.assign({},ot,t):ot;let n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(o=o(n.value)),xn(n,o));return [Cn.bind(n),r]}function ae(e,t,n){let r=At(e,t,false,ce);qe(r);}function ne(e,t,n){wn=jr;let r=At(e,t,false,ce);(r.user=true),ee?ee.push(r):qe(r);}function z(e,t,n){n=n?Object.assign({},ot,n):ot;let r=At(e,t,true,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,qe(r),Cn.bind(r)}function se(e){if(G===null)return e();let t=G;G=null;try{return Ie?Ie.untrack(e):e()}finally{G=t;}}function Ee(e,t,n){let r=Array.isArray(e),o;return s=>{let a;if(r){a=Array(e.length);for(let f=0;f<e.length;f++)a[f]=e[f]();}else a=e();let l=se(()=>t(a,o,s));return o=a,l}}function Tn(e){ne(()=>se(e));}function ue(e){return P===null||(P.cleanups===null?P.cleanups=[e]:P.cleanups.push(e)),e}$(false);function Cn(){let e=p;if(this.sources&&(this.state))if((this.state)===ce)qe(this);else {let t=K;K=null,be(()=>it(this),false),K=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&&p.sources.has(this)?this.tValue:this.value}function xn(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=p&&p.running;s&&p.disposed.has(i)||((s?!i.tState:!i.state)&&(i.pure?K.push(i):ee.push(i),i.observers&&En(i)),s?i.tState=ce:i.state=ce);}if(K.length>1e6)throw K=[],new Error},false);}return t}function qe(e){if(!e.fn)return;ve(e);let t=st;pn(e,e.value,t);}function pn(e,t,n){let r,o=P,i=G;G=P=e;try{r=e.fn(t);}catch(s){return e.pure&&((e.state=ce,e.owned&&e.owned.forEach(ve),e.owned=null)),e.updatedAt=n+1,Ft(s)}finally{G=i,P=o;}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?xn(e,r):e.value=r,e.updatedAt=n);}function At(e,t,n,r=ce,o){let i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:P,context:P?P.context:null,pure:n};if(P===null||P!==Sn&&(P.owned?P.owned.push(i):P.owned=[i]),Ie);return i}function Ue(e){let t=p;if((e.state)===0)return;if((e.state)===Ge)return it(e);if(e.suspense&&se(e.suspense.inFallback))return e.suspense.effects.push(e);let n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<st);){(e.state)&&n.push(e);}for(let r=n.length-1;r>=0;r--){if(e=n[r],t);if((e.state)===ce)qe(e);else if((e.state)===Ge){let o=K;K=null,be(()=>it(e,n[0]),false),K=o;}}}function be(e,t){if(K)return e();let n=false;t||(K=[]),ee?n=true:ee=[],st++;try{let r=e();return Hr(n),r}catch(r){n||(ee=null),K=null,Ft(r);}}function Hr(e){if(K&&(vn(K),K=null),e)return;let n=ee;ee=null,n.length&&be(()=>wn(n),false);}function vn(e){for(let t=0;t<e.length;t++)Ue(e[t]);}function jr(e){let t,n=0;for(t=0;t<e.length;t++){let r=e[t];r.user?e[n++]=r:Ue(r);}for(t=0;t<n;t++)Ue(e[t]);}function it(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===ce?o!==t&&(!o.updatedAt||o.updatedAt<st)&&Ue(o):i===Ge&&it(o,t);}}}function En(e){for(let n=0;n<e.observers.length;n+=1){let r=e.observers[n];(!r.state)&&(r.state=Ge,r.pure?K.push(r):ee.push(r),r.observers&&En(r));}}function ve(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--)ve(e.tOwned[t]);delete e.tOwned;}if(e.owned){for(t=e.owned.length-1;t>=0;t--)ve(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 Vr(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function Ft(e,t=P){let r=Vr(e);throw r;}var Yr=Symbol("fallback");function yn(e){for(let t=0;t<e.length;t++)e[t]();}function Gr(e,t,n={}){let r=[],o=[],i=[],s=0,a=t.length>1?[]:null;return ue(()=>yn(i)),()=>{let l=e()||[],f=l.length,m,g;return l[Pr],se(()=>{let x,S,C,N,T,A,R,_,O;if(f===0)s!==0&&(yn(i),i=[],r=[],o=[],s=0,a&&(a=[])),n.fallback&&(r=[Yr],o[0]=Ae(L=>(i[0]=L,n.fallback())),s=1);else if(s===0){for(o=new Array(f),g=0;g<f;g++)r[g]=l[g],o[g]=Ae(b);s=f;}else {for(C=new Array(f),N=new Array(f),a&&(T=new Array(f)),A=0,R=Math.min(s,f);A<R&&r[A]===l[A];A++);for(R=s-1,_=f-1;R>=A&&_>=A&&r[R]===l[_];R--,_--)C[_]=o[R],N[_]=i[R],a&&(T[_]=a[R]);for(x=new Map,S=new Array(_+1),g=_;g>=A;g--)O=l[g],m=x.get(O),S[g]=m===void 0?-1:m,x.set(O,g);for(m=A;m<=R;m++)O=r[m],g=x.get(O),g!==void 0&&g!==-1?(C[g]=o[m],N[g]=i[m],a&&(T[g]=a[m]),g=S[g],x.set(O,g)):i[m]();for(g=A;g<f;g++)g in C?(o[g]=C[g],i[g]=N[g],a&&(a[g]=T[g],a[g](g))):o[g]=Ae(b);o=o.slice(0,s=f),r=l.slice(0);}return o});function b(x){if(i[g]=x,a){let[S,C]=$(g);return a[g]=C,t(l[g],S)}return t(l[g])}}}function k(e,t){return se(()=>e(t||{}))}var zr=e=>`Stale read from <${e}>.`;function at(e){let t="fallback"in e&&{fallback:()=>e.fallback};return z(Gr(()=>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?se(()=>i(t?o:()=>{if(!se(r))throw zr("Show");return n()})):i}return e.fallback},void 0,void 0)}var Pe=e=>z(()=>e());function Wr(e,t,n){let r=n.length,o=t.length,i=r,s=0,a=0,l=t[o-1].nextSibling,f=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 m=i<r?a?n[a-1].nextSibling:n[i-a]:l;for(;a<i;)e.insertBefore(n[a++],m);}else if(i===a)for(;s<o;)(!f||!f.has(t[s]))&&t[s].remove(),s++;else if(t[s]===n[i-1]&&n[a]===t[o-1]){let m=t[--o].nextSibling;e.insertBefore(n[a++],t[s++].nextSibling),e.insertBefore(n[--i],m),t[o]=n[i];}else {if(!f){f=new Map;let g=a;for(;g<i;)f.set(n[g],g++);}let m=f.get(t[s]);if(m!=null)if(a<m&&m<i){let g=s,b=1,x;for(;++g<o&&g<i&&!((x=f.get(t[g]))==null||x!==m+b);)b++;if(b>m-a){let S=t[s];for(;a<m;)e.insertBefore(n[a++],S);}else e.replaceChild(n[a++],t[s++]);}else s++;else t[s++].remove();}}}function Nn(e,t,n,r={}){let o;return Ae(i=>{o=i,t===document?e():ye(t,e(),t.firstChild?null:void 0,n);},r.owner),()=>{o(),t.textContent="";}}function oe(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 Kr(e,t,n){(e.removeAttribute(t));}function ct(e,t,n){if(!t)return n?Kr(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 Re(e,t,n){return se(()=>e(t,n))}function ye(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return lt(e,t,r,n);ae(o=>lt(e,t(),o,n),r);}function lt(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=Me(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=Me(e,n,r);}else {if(s==="function")return ae(()=>{let l=t();for(;typeof l=="function";)l=l();n=lt(e,l,n,r);}),()=>n;if(Array.isArray(t)){let l=[],f=n&&Array.isArray(n);if($t(l,t,n,o))return ae(()=>n=lt(e,l,n,r,true)),()=>n;if(l.length===0){if(n=Me(e,n,r),a)return n}else f?n.length===0?On(e,l,r):Wr(e,n,l):(n&&Me(e),On(e,l));n=l;}else if(t.nodeType){if(Array.isArray(n)){if(a)return n=Me(e,n,r,t);Me(e,n,null,t);}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t;}}return n}function $t(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],f;if(!(a==null||a===true||a===false))if((f=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))o=$t(e,a,l)||o;else if(f==="function")if(r){for(;typeof a=="function";)a=a();o=$t(e,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||o;}else e.push(a),o=true;else {let m=String(a);l&&l.nodeType===3&&l.data===m?e.push(l):e.push(document.createTextNode(m));}}return o}function On(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n);}function Me(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 Zr=["input","textarea","select","searchbox","slider","spinbutton","menuitem","menuitemcheckbox","menuitemradio","option","radio","textbox"],Jr=e=>!!e.tagName&&!e.tagName.startsWith("-")&&e.tagName.includes("-"),Qr=e=>Array.isArray(e),eo=(e,t=false)=>{let{composed:n,target:r}=e,o,i;if(r instanceof HTMLElement&&Jr(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 Qr(t)?!!(o&&t&&t.some(s=>typeof o=="string"&&s.toLowerCase()===o.toLowerCase()||s===i)):!!(o&&t&&t)},An=e=>eo(e,Zr);var Le="data-react-grab",Fn=()=>{let e=document.querySelector(`[${Le}]`);if(e){let i=e.shadowRoot?.querySelector(`[${Le}]`);if(i instanceof HTMLDivElement&&e.shadowRoot)return i}let t=document.createElement("div");t.setAttribute(Le,"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(Le,"true"),n.appendChild(r),(document.body??document.documentElement).appendChild(t),r};var me=(e,t,n)=>e+(t-e)*n;var no=oe("<div>"),ut=e=>{let[t,n]=$(e.bounds.x),[r,o]=$(e.bounds.y),[i,s]=$(e.bounds.width),[a,l]=$(e.bounds.height),[f,m]=$(1),g=false,b=null,x=null,S=e.bounds,C=false,N=()=>e.lerpFactor!==void 0?e.lerpFactor:e.variant==="drag"?.7:.95,T=()=>{if(C)return;C=true;let _=()=>{let O=me(t(),S.x,N()),L=me(r(),S.y,N()),re=me(i(),S.width,N()),ie=me(a(),S.height,N());n(O),o(L),s(re),l(ie),Math.abs(O-S.x)<.5&&Math.abs(L-S.y)<.5&&Math.abs(re-S.width)<.5&&Math.abs(ie-S.height)<.5?(b=null,C=false):b=requestAnimationFrame(_);};b=requestAnimationFrame(_);};ne(Ee(()=>e.bounds,_=>{if(S=_,!g){n(S.x),o(S.y),s(S.width),l(S.height),g=true;return}T();})),ne(()=>{e.variant==="grabbed"&&e.createdAt&&(x=window.setTimeout(()=>{m(0);},1500));}),ue(()=>{b!==null&&(cancelAnimationFrame(b),b=null),x!==null&&(window.clearTimeout(x),x=null),C=false;});let A={position:"fixed","box-sizing":"border-box","pointer-events":e.variant==="drag"?"none":"auto","z-index":"2147483646"},R=()=>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 k(q,{get when(){return e.visible!==false},get children(){var _=no();return ae(O=>ct(_,{...A,...R(),top:`${r()}px`,left:`${t()}px`,width:`${i()}px`,height:`${a()}px`,"border-radius":e.bounds.borderRadius,transform:e.bounds.transform,opacity:f()},O)),_}})};var ro=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">'),$n=e=>{let t;return Tn(()=>{t&&t.animate([{transform:"rotate(0deg)"},{transform:"rotate(360deg)"}],{duration:600,easing:"linear",iterations:1/0});}),(()=>{var n=ro(),r=t;return typeof r=="function"?Re(r,n):t=n,ae(o=>ct(n,{...e.style},o)),n})()};var ft=(e,t,n,r)=>{let o=window.innerWidth,i=window.innerHeight,s=8,a=8,l=o-n-8,f=i-r-8,m=Math.max(s,Math.min(e,l)),g=Math.max(a,Math.min(t,f));return {left:m,top:g}};var oo=oe("<span style=display:inline-block;margin-right:4px;font-weight:600>\u2713"),io=oe("<div style=margin-right:4px>Copied"),so=oe(`<span style="font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;font-variant-numeric:tabular-nums">`),ao=oe("<div style=margin-left:4px>to clipboard"),lo=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">`),kt=e=>{let[t,n]=$(0),[r,o]=$(0),i,s=e.x,a=e.y,l=e.x,f=e.y,m=null,g=false,b=()=>{s=me(s,l,.3),a=me(a,f,.3),o(A=>A+1),Math.abs(s-l)<.5&&Math.abs(a-f)<.5?m=null:m=requestAnimationFrame(b);},x=()=>{m===null&&(m=requestAnimationFrame(b));},S=()=>{if(l=e.x,f=e.y,!g){s=l,a=f,g=true,o(T=>T+1);return}x();};ne(Ee(()=>e.visible,T=>{if(T!==false)requestAnimationFrame(()=>{n(1);});else {n(0);return}if(e.variant==="success"){let A=setTimeout(()=>{n(0);},1700);ue(()=>clearTimeout(A));}})),ne(()=>{S();}),ue(()=>{m!==null&&(cancelAnimationFrame(m),m=null);});let C=()=>i?.getBoundingClientRect(),N=()=>{r();let T=C();if(!T)return {left:s,top:a};let A=window.innerWidth,R=window.innerHeight,_=[{left:Math.round(s)+14,top:Math.round(a)+14},{left:Math.round(s)-T.width-14,top:Math.round(a)+14},{left:Math.round(s)+14,top:Math.round(a)-T.height-14},{left:Math.round(s)-T.width-14,top:Math.round(a)-T.height-14}];for(let L of _){let re=L.left>=8&&L.left+T.width<=A-8,ie=L.top>=8&&L.top+T.height<=R-8;if(re&&ie)return L}let O=ft(_[0].left,_[0].top,T.width,T.height);return O.left+=4,O.top+=4,O};return k(q,{get when(){return e.visible!==false},get children(){var T=lo(),A=i;return typeof A=="function"?Re(A,T):i=T,ye(T,k(q,{get when(){return e.variant==="processing"},get children(){return k($n,{})}}),null),ye(T,k(q,{get when(){return e.variant==="success"},get children(){return oo()}}),null),ye(T,k(q,{get when(){return e.variant==="success"},get children(){return io()}}),null),ye(T,k(q,{get when(){return e.variant==="processing"},children:"Grabbing\u2026"}),null),ye(T,k(q,{get when(){return e.variant!=="processing"},get children(){var R=so();return ye(R,()=>e.text),R}}),null),ye(T,k(q,{get when(){return e.variant==="success"},get children(){return ao()}}),null),ae(R=>{var _=`${N().top}px`,O=`${N().left}px`,L=e.zIndex?.toString()??"2147483647",re=t();return _!==R.e&&pe(T,"top",R.e=_),O!==R.t&&pe(T,"left",R.t=O),L!==R.a&&pe(T,"z-index",R.a=L),re!==R.o&&pe(T,"opacity",R.o=re),R},{e:void 0,t:void 0,a:void 0,o:void 0}),T}})};var co=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)">'),uo=e=>{let[t,n]=$(0);return ne(Ee(()=>e,r=>{r!==false?requestAnimationFrame(()=>{n(1);}):n(0);})),t},In=e=>{let t=uo(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 ft(s,a,o.width,o.height)};return k(q,{get when(){return e.visible!==false},get children(){var o=co(),i=o.firstChild,s=i.firstChild,a=n;return typeof a=="function"?Re(a,o):n=o,ae(l=>{var f=`${r().top}px`,m=`${r().left}px`,g=t(),b=`${Math.min(100,Math.max(0,e.progress*100))}%`;return f!==l.e&&pe(o,"top",l.e=f),m!==l.t&&pe(o,"left",l.t=m),g!==l.a&&pe(o,"opacity",l.a=g),b!==l.o&&pe(s,"width",l.o=b),l},{e:void 0,t:void 0,a:void 0,o:void 0}),o}})};var fo=oe("<canvas style=position:fixed;top:0;left:0;pointer-events:none;z-index:2147483645>"),Mn=e=>{let t,n=null,r=0,o=0,i=1,s=e.mouseX,a=e.mouseY,l=e.mouseX,f=e.mouseY,m=null,g=false,b=()=>{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));},x=()=>{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());},S=()=>{s=me(s,l,.3),a=me(a,f,.3),x(),Math.abs(s-l)<.5&&Math.abs(a-f)<.5?m=null:m=requestAnimationFrame(S);},C=()=>{m===null&&(m=requestAnimationFrame(S));},N=()=>{if(l=e.mouseX,f=e.mouseY,!g){s=l,a=f,g=true,x();return}C();};return ne(()=>{b(),x();let T=()=>{b(),x();};window.addEventListener("resize",T),ue(()=>{window.removeEventListener("resize",T),m!==null&&(cancelAnimationFrame(m),m=null);});}),ne(()=>{N();}),k(q,{get when(){return e.visible!==false},get children(){var T=fo(),A=t;return typeof A=="function"?Re(A,T):t=T,T}})};var Pn=e=>[k(q,{get when(){return Pe(()=>!!e.selectionVisible)()&&e.selectionBounds},get children(){return k(ut,{variant:"selection",get bounds(){return e.selectionBounds},get visible(){return e.selectionVisible}})}}),k(q,{get when(){return Pe(()=>e.crosshairVisible===true&&e.mouseX!==void 0)()&&e.mouseY!==void 0},get children(){return k(Mn,{get mouseX(){return e.mouseX},get mouseY(){return e.mouseY},visible:true})}}),k(q,{get when(){return Pe(()=>!!e.dragVisible)()&&e.dragBounds},get children(){return k(ut,{variant:"drag",get bounds(){return e.dragBounds},get visible(){return e.dragVisible}})}}),k(at,{get each(){return e.grabbedBoxes??[]},children:t=>k(ut,{variant:"grabbed",get bounds(){return t.bounds},get createdAt(){return t.createdAt}})}),k(at,{get each(){return e.successLabels??[]},children:t=>k(kt,{variant:"success",get text(){return t.text},get x(){return t.x},get y(){return t.y}})}),k(q,{get when(){return Pe(()=>!!(e.labelVisible&&e.labelVariant&&e.labelText&&e.labelX!==void 0))()&&e.labelY!==void 0},get children(){return k(kt,{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}})}}),k(q,{get when(){return Pe(()=>!!(e.progressVisible&&e.progress!==void 0&&e.mouseX!==void 0))()&&e.mouseY!==void 0},get children(){return k(In,{get progress(){return e.progress},get mouseX(){return e.mouseX},get mouseY(){return e.mouseY},get visible(){return e.progressVisible}})}})];var Hn="0.5.14",We=`bippy-${Hn}`,Ln=Object.defineProperty,mo=Object.prototype.hasOwnProperty,Xe=()=>{},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{}},It=(e=we())=>"getFiberRoots"in e,jn=false,Dn,ht=(e=we())=>jn?true:(typeof e.inject=="function"&&(Dn=e.inject.toString()),!!Dn?.includes("(injected)")),mt=new Set,Fe=new Set,Vn=e=>{let t=new Map,n=0,r={_instrumentationIsActive:false,_instrumentationSource:We,checkDCE:Bn,hasUnsupportedRendererAttached:false,inject(o){let i=++n;return t.set(i,o),Fe.add(o),r._instrumentationIsActive||(r._instrumentationIsActive=true,mt.forEach(s=>s())),i},on:Xe,onCommitFiberRoot:Xe,onCommitFiberUnmount:Xe,onPostCommitFiberRoot:Xe,renderers:t,supportsFiber:true,supportsFlight:true};try{Ln(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,f)=>{Fe.add(l),s.renderers.set(f,l);}),gt(e));}}});let o=window.hasOwnProperty,i=!1;Ln(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{gt(e);}return r},gt=e=>{e&&mt.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=We,t._instrumentationIsActive=!1;let n=It(t);if(n||(t.on=Xe),t.renderers.size){t._instrumentationIsActive=!0,mt.forEach(i=>i());return}let r=t.inject,o=ht(t);o&&!n&&(jn=!0,t.inject({scheduleRefresh(){}})&&(t._instrumentationIsActive=!0)),t.inject=i=>{let s=r(i);return Fe.add(i),o&&t.renderers.set(s,i),t._instrumentationIsActive=!0,mt.forEach(a=>a()),s};}(t.renderers.size||t._instrumentationIsActive||ht())&&e?.();}catch{}},Mt=()=>mo.call(globalThis,"__REACT_DEVTOOLS_GLOBAL_HOOK__"),we=e=>Mt()?(gt(e),globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__):Vn(e),Yn=()=>!!(typeof window<"u"&&(window.document?.createElement||window.navigator?.product==="ReactNative")),Pt=()=>{try{Yn()&&we();}catch{}};Pt();var pt=0,bt=1;var yt=5;var wt=11,Lt=13,Gn=14,St=15,Dt=16;var Ht=19;var Tt=26,Ct=27,Bt=28,jt=30;var Vt=e=>{switch(e.tag){case yt:case Tt:case Ct:return true;default:return typeof e.type=="string"}},Ke=e=>{switch(e.tag){case bt:case wt:case pt:case Gn:case St:return true;default:return false}};function De(e,t,n=false){return e&&t(e)instanceof Promise?Gt(e,t,n):Yt(e,t,n)}var Yt=(e,t,n=false)=>{if(!e)return null;if(t(e)===true)return e;let r=n?e.return:e.child;for(;r;){let o=Yt(r,t,n);if(o)return o;r=n?null:r.sibling;}return null},Gt=async(e,t,n=false)=>{if(!e)return null;if(await t(e)===true)return e;let r=n?e.return:e.child;for(;r;){let o=await Gt(r,t,n);if(o)return o;r=n?null:r.sibling;}return null};var Ut=e=>{let t=e;return typeof t=="function"?t:typeof t=="object"&&t?Ut(t.type||t.render):null},He=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=Ut(t);return r&&(r.displayName||r.name)||null};var zt=e=>{let t=e.alternate;if(!t)return e;if(t.actualStartTime&&e.actualStartTime)return t.actualStartTime>e.actualStartTime?t:e;for(let n of xt){let r=De(n.current,o=>{if(o===e)return true});if(r)return r}return e};var qt=e=>{let t=we(e.onActive);t._instrumentationSource=e.name??We;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},Ze=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},xt=new Set;var Co=Object.create,Jn=Object.defineProperty,xo=Object.getOwnPropertyDescriptor,vo=Object.getOwnPropertyNames,Eo=Object.getPrototypeOf,Ro=Object.prototype.hasOwnProperty,Oo=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),No=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=vo(t),i=0,s=o.length,a;i<s;i++)a=o[i],!Ro.call(e,a)&&a!==n&&Jn(e,a,{get:(l=>t[l]).bind(null,a),enumerable:!(r=xo(t,a))||r.enumerable});return e},_o=(e,t,n)=>(n=e==null?{}:Co(Eo(e)),No(Jn(n,"default",{value:e,enumerable:true}),e)),Ao=()=>{let e=we();for(let t of [...Array.from(Fe),...Array.from(e.renderers.values())]){let n=t.currentDispatcherRef;if(n&&typeof n=="object")return "H"in n?n.H:n.current}return null},Un=e=>{for(let t of Fe){let n=t.currentDispatcherRef;n&&typeof n=="object"&&("H"in n?n.H=e:n.current=e);}},Se=e=>`
|
|
10
|
+
in ${e}`,Fo=(e,t)=>{let n=Se(e);return t&&(n+=` (at ${t})`),n},Xt=false,Wt=(e,t)=>{if(!e||Xt)return "";let n=Error.prepareStackTrace;Error.prepareStackTrace=void 0,Xt=true;let r=Ao();Un(null);let o=console.error,i=console.warn;console.error=()=>{},console.warn=()=>{};try{let l={DetermineComponentFrameRoot(){let b;try{if(t){let x=function(){throw Error()};if(Object.defineProperty(x.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(x,[]);}catch(S){b=S;}Reflect.construct(e,[],x);}else {try{x.call();}catch(S){b=S;}e.call(x.prototype);}}else {try{throw Error()}catch(S){b=S;}let x=e();x&&typeof x.catch=="function"&&x.catch(()=>{});}}catch(x){if(x instanceof Error&&b instanceof Error&&typeof x.stack=="string")return [x.stack,b.stack]}return [null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot",Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name")?.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});let[m,g]=l.DetermineComponentFrameRoot();if(m&&g){let b=m.split(`
|
|
11
11
|
`),x=g.split(`
|
|
12
|
-
`),S=0,C=0;for(;S<
|
|
13
|
-
${
|
|
12
|
+
`),S=0,C=0;for(;S<b.length&&!b[S].includes("DetermineComponentFrameRoot");)S++;for(;C<x.length&&!x[C].includes("DetermineComponentFrameRoot");)C++;if(S===b.length||C===x.length)for(S=b.length-1,C=x.length-1;S>=1&&C>=0&&b[S]!==x[C];)C--;for(;S>=1&&C>=0;S--,C--)if(b[S]!==x[C]){if(S!==1||C!==1)do if(S--,C--,C<0||b[S]!==x[C]){let N=`
|
|
13
|
+
${b[S].replace(" at new "," at ")}`,T=He(e);return T&&N.includes("<anonymous>")&&(N=N.replace("<anonymous>",T)),N}while(S>=1&&C>=0);break}}}finally{Xt=false,Error.prepareStackTrace=n,Un(r),console.error=o,console.warn=i;}let s=e?He(e):"";return s?Se(s):""},$o=(e,t)=>{let n=e.tag,r="";switch(n){case Bt:r=Se("Activity");break;case bt:r=Wt(e.type,true);break;case wt:r=Wt(e.type.render,false);break;case pt:case St:r=Wt(e.type,false);break;case yt:case Tt:case Ct:r=Se(e.type);break;case Dt:r=Se("Lazy");break;case Lt:r=e.child!==t&&t!==null?Se("Suspense Fallback"):Se("Suspense");break;case Ht:r=Se("SuspenseList");break;case jt:r=Se("ViewTransition");break;default:return ""}return r},ko=e=>{try{let t="",n=e,r=null;do{t+=$o(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+=Fo(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
15
|
${t.stack}`:""}},Io=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},Mo=/(^|@)\S+:\d+/,
|
|
19
|
-
`),r=[];for(let o of n)if(/^\s*at\s+/.test(o)){let i=
|
|
20
|
-
`).filter(r=>!!r.match(
|
|
21
|
-
`).filter(r=>!r.match(Po)),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=
|
|
22
|
-
`),r;for(let i=n.length-1;i>=0&&!r;i--){let s=n[i].match(Ho);s&&(r=s[1]||s[2]);}if(!r)return null;let o=nr.test(r);if(!(Do.test(r)||o||r.startsWith("/"))){let i=e.split("/");i[i.length-1]=r,r=i.join("/");}return r},Yo=e=>({file:e.file,mappings:(0, tr.decode)(e.mappings),names:e.names,sourceRoot:e.sourceRoot,sources:e.sources,sourcesContent:e.sourcesContent,version:3}),Go=e=>{let t=e.sections.map(({map:r,offset:o})=>({map:{...r,mappings:(0, tr.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}},Xn=e=>{if(!e)return false;let t=e.trim();if(!t)return false;let n=t.match(nr);if(!n)return true;let r=n[0].toLowerCase();return r==="http:"||r==="https:"},Uo=async(e,t=fetch)=>{if(!Xn(e))return null;let n;try{n=await(await t(e)).text();}catch{return null}if(!n)return null;let r=Vo(e,n);if(!r||!Xn(r))return null;try{let o=await t(r),i=await o.json();return "sections"in i?Go(i):Yo(i)}catch{return null}},zo=async(e,t=true,n)=>{if(t&&Ze.has(e)){let i=Ze.get(e);if(i==null)return null;if(Bo(i)){let s=i.deref();if(s)return s;Ze.delete(e);}else return i}if(t&&xt.has(e))return xt.get(e);let r=Uo(e,n);t&&xt.set(e,r);let o=await r;return t&&xt.delete(e),t&&(o===null?Ze.set(e,null):Ze.set(e,rr?new WeakRef(o):o)),o},Wn=/^[a-zA-Z][a-zA-Z\d+\-.]*:/,qo=["rsc://","file:///","webpack://","node:","turbopack://","metro://"],Kn="about://React/",Xo=["<anonymous>","eval",""],Wo=/\.(jsx|tsx|ts|js)$/,Ko=/(\.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,Zo=/^\?[\w~.\-]+(?:=[^&#]*)?(?:&[\w~.\-]+(?:=[^&#]*)?)*$/,Jo=e=>e._debugStack instanceof Error&&typeof e._debugStack?.stack=="string",Qo=e=>{let t=e._debugSource;return t?typeof t=="object"&&!!t&&"fileName"in t&&typeof t.fileName=="string"&&"lineNumber"in t&&typeof t.lineNumber=="number":false},ei=async(e,t=true,n)=>{if(Qo(e))return e._debugSource||null;let r=or(e);return ir(r,void 0,t,n)},or=e=>Jo(e)?Io(e._debugStack.stack):ko(e),ti=async(e,t=true,n)=>{let r=await ir(e,1,t,n);return !r||r.length===0?null:r[0]},ir=async(e,t=1,n=true,r)=>{let o=Qn(e,{slice:t??1}),i=[];for(let s of o){if(!s?.file)continue;let a=await zo(s.file,n,r);if(a&&typeof s.line=="number"&&typeof s.col=="number"){let l=jo(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},Be=e=>{if(!e||Xo.includes(e))return "";let t=e;if(t.startsWith(Kn)){let r=t.slice(Kn.length),o=r.indexOf("/"),i=r.indexOf(":");t=o!==-1&&(i===-1||o<i)?r.slice(o+1):r;}for(let r of qo)if(t.startsWith(r)){t=t.slice(r.length),r==="file:///"&&(t=`/${t.replace(/^\/+/,"")}`);break}if(Wn.test(t)){let r=t.match(Wn);r&&(t=t.slice(r[0].length));}let n=t.indexOf("?");if(n!==-1){let r=t.slice(n);Zo.test(r)&&(t=t.slice(0,n));}return t},Kt=e=>{let t=Be(e);return !(!t||!Wo.test(t)||Ko.test(t))},ni=async(e,t=true,n)=>{let r=De(e,s=>{if(We(s))return true},true);if(r){let s=await ei(r,t,n);if(s?.fileName){let a=Be(s.fileName);if(Kt(a))return {fileName:a,lineNumber:s.lineNumber,columnNumber:s.columnNumber,functionName:s.functionName}}}let o=Qn(or(e),{includeInElement:false}),i=null;for(;o.length;){let s=o.pop();if(!s||!s.raw||!s.file)continue;let a=await ti(s.raw,t,n);if(a)return {fileName:Be(a.fileName),lineNumber:a.lineNumber,columnNumber:a.columnNumber,functionName:a.functionName};i={fileName:Be(s.file),lineNumber:s.line,columnNumber:s.col,functionName:s.function};}return i},sr=async(e,t=true,n)=>{let r=Ke(e);if(!r||!jt(r))return null;let o=Ut(r);return o?ni(o,t,n):null};var ri=new Set(["role","name","aria-label","rel","href"]);function oi(e,t){let n=ri.has(e);n||=e.startsWith("data-")&&Je(e);let r=Je(t)&&t.length<100;return r||=t.startsWith("#")&&Je(t.slice(1)),n&&r}function ii(e){return Je(e)}function si(e){return Je(e)}function ai(e){return true}function lr(e,t){if(e.nodeType!==Node.ELEMENT_NODE)throw new Error("Can't generate CSS selector for non-element node type.");if(e.tagName.toLowerCase()==="html")return "html";let n={root:document.body,idName:ii,className:si,tagName:ai,attr:oi,timeoutMs:1e3,seedMinLength:3,optimizedMinLength:2,maxNumberOfPathChecks:1/0},r=new Date,o={...n,...t},i=di(o.root,n),s,a=0;for(let f of li(e,o,i)){if(new Date().getTime()-r.getTime()>o.timeoutMs||a>=o.maxNumberOfPathChecks){let g=ui(e,i);if(!g)throw new Error(`Timeout: Can't find a unique selector after ${o.timeoutMs}ms`);return Qe(g)}if(a++,Qt(f,i)){s=f;break}}if(!s)throw new Error("Selector was not found.");let l=[...fr(s,e,o,i,r)];return l.sort(Zt),l.length>0?Qe(l[0]):Qe(s)}function*li(e,t,n){let r=[],o=[],i=e,s=0;for(;i&&i!==n;){let a=ci(i,t);for(let l of a)l.level=s;if(r.push(a),i=i.parentElement,s++,o.push(...ur(r)),s>=t.seedMinLength){o.sort(Zt);for(let l of o)yield l;o=[];}}o.sort(Zt);for(let a of o)yield a;}function Je(e){if(/^[a-z\-]{3,}$/i.test(e)){let t=e.split(/-|[A-Z]/);for(let n of t)if(n.length<=2||/[^aeiou]{4,}/i.test(n))return false;return true}return false}function ci(e,t){let n=[],r=e.getAttribute("id");r&&t.idName(r)&&n.push({name:"#"+CSS.escape(r),penalty:0});for(let s=0;s<e.classList.length;s++){let a=e.classList[s];t.className(a)&&n.push({name:"."+CSS.escape(a),penalty:1});}for(let s=0;s<e.attributes.length;s++){let a=e.attributes[s];t.attr(a.name,a.value)&&n.push({name:`[${CSS.escape(a.name)}="${CSS.escape(a.value)}"]`,penalty:2});}let o=e.tagName.toLowerCase();if(t.tagName(o)){n.push({name:o,penalty:5});let s=Jt(e,o);s!==void 0&&n.push({name:cr(o,s),penalty:10});}let i=Jt(e);return i!==void 0&&n.push({name:fi(o,i),penalty:50}),n}function Qe(e){let t=e[0],n=t.name;for(let r=1;r<e.length;r++){let o=e[r].level||0;t.level===o-1?n=`${e[r].name} > ${n}`:n=`${e[r].name} ${n}`,t=e[r];}return n}function ar(e){return e.map(t=>t.penalty).reduce((t,n)=>t+n,0)}function Zt(e,t){return ar(e)-ar(t)}function Jt(e,t){let n=e.parentNode;if(!n)return;let r=n.firstChild;if(!r)return;let o=0;for(;r&&(r.nodeType===Node.ELEMENT_NODE&&(t===void 0||r.tagName.toLowerCase()===t)&&o++,r!==e);)r=r.nextSibling;return o}function ui(e,t){let n=0,r=e,o=[];for(;r&&r!==t;){let i=r.tagName.toLowerCase(),s=Jt(r,i);if(s===void 0)return;o.push({name:cr(i,s),penalty:NaN,level:n}),r=r.parentElement,n++;}if(Qt(o,t))return o}function fi(e,t){return e==="html"?"html":`${e}:nth-child(${t})`}function cr(e,t){return e==="html"?"html":`${e}:nth-of-type(${t})`}function*ur(e,t=[]){if(e.length>0)for(let n of e[0])yield*ur(e.slice(1,e.length),t.concat(n));else yield t;}function di(e,t){return e.nodeType===Node.DOCUMENT_NODE?e:e===t.root?e.ownerDocument:e}function Qt(e,t){let n=Qe(e);switch(t.querySelectorAll(n).length){case 0:throw new Error(`Can't select any node with this selector: ${n}`);case 1:return true;default:return false}}function*fr(e,t,n,r,o){if(e.length>2&&e.length>n.optimizedMinLength)for(let i=1;i<e.length-1;i++){if(new Date().getTime()-o.getTime()>n.timeoutMs)return;let a=[...e];a.splice(i,1),Qt(a,r)&&r.querySelector(Qe(a))===t&&(yield a,yield*fr(a,t,n,r,o));}}zt({onCommitFiberRoot(e,t){Ct.add(t);}});var mi=e=>lr(e),en=async e=>{let t=(u,c)=>u.length>c?`${u.substring(0,c)}...`:u,n=u=>!!(u.startsWith("_")||u.includes("Provider")&&u.includes("Context")),r=u=>{let c=Ke(u);if(!c)return null;let m=null;return De(c,y=>{if(We(y)){let E=He(y);if(E&&!n(E))return m=E,true}return false},true),m},o=async u=>{let c=await sr(u);if(!c)return null;let m=Be(c.fileName);return Kt(m)?`${m}:${c.lineNumber}:${c.columnNumber}`:null},i=new Set(["article","aside","footer","form","header","main","nav","section"]),s=u=>{let c=u.tagName.toLowerCase();if(i.has(c)||u.id)return true;if(u.className&&typeof u.className=="string"){let m=u.className.trim();if(m&&m.length>0)return true}return Array.from(u.attributes).some(m=>m.name.startsWith("data-"))},a=(u,c=10)=>{let m=[],y=u.parentElement,E=0;for(;y&&E<c&&y.tagName!=="BODY"&&!(s(y)&&(m.push(y),m.length>=3));)y=y.parentElement,E++;return m.reverse()},l=(u,c=false)=>{let m=u.tagName.toLowerCase(),y=[];if(u.id&&y.push(`id="${u.id}"`),u.className&&typeof u.className=="string"){let M=u.className.trim().split(/\s+/);if(M.length>0&&M[0]){let B=c?M.slice(0,3):M,H=t(B.join(" "),30);y.push(`class="${H}"`);}}let E=Array.from(u.attributes).filter(M=>M.name.startsWith("data-")),D=c?E.slice(0,1):E;for(let M of D)y.push(`${M.name}="${t(M.value,20)}"`);let I=u.getAttribute("aria-label");return I&&!c&&y.push(`aria-label="${t(I,20)}"`),y.length>0?`<${m} ${y.join(" ")}>`:`<${m}>`},f=u=>`</${u.tagName.toLowerCase()}>`,d=u=>{let c=(u.textContent||"").trim().replace(/\s+/g," ");return t(c,60)},g=u=>{if(u.id)return `#${u.id}`;if(u.className&&typeof u.className=="string"){let c=u.className.trim().split(/\s+/);if(c.length>0&&c[0])return `.${c[0]}`}return null},p=[],x=mi(e);p.push("Locate this element in the codebase:"),p.push(`- selector: ${x}`);let S=e.getBoundingClientRect();p.push(`- width: ${Math.round(S.width)}`),p.push(`- height: ${Math.round(S.height)}`),p.push("HTML snippet:"),p.push("```html");let C=a(e),R=C.map(u=>r(u)),T=r(e),A=await Promise.all(C.map(u=>o(u))),O=await o(e);for(let u=0;u<C.length;u++){let c=" ".repeat(u),m=R[u],y=A[u];m&&y&&(u===0||R[u-1]!==m)&&p.push(`${c}<${m} source="${y}">`),p.push(`${c}${l(C[u],true)}`);}let N=e.parentElement,_=-1;if(N){let u=Array.from(N.children);if(_=u.indexOf(e),_>0){let c=u[_-1];if(g(c)&&_<=2){let y=" ".repeat(C.length);p.push(`${y} ${l(c,true)}`),p.push(`${y} </${c.tagName.toLowerCase()}>`);}else if(_>0){let y=" ".repeat(C.length);p.push(`${y} ... (${_} element${_===1?"":"s"})`);}}}let L=" ".repeat(C.length),ne=C.length>0?R[R.length-1]:null,oe=T&&O&&T!==ne;oe&&p.push(`${L} <${T} used-at="${O}">`),p.push(`${L} <!-- IMPORTANT: selected element -->`);let ae=d(e),Ce=e.children.length,w=`${L}${oe?" ":" "}`;if(ae&&Ce===0&&ae.length<40?p.push(`${w}${l(e)}${ae}${f(e)}`):(p.push(`${w}${l(e)}`),ae&&p.push(`${w} ${ae}`),Ce>0&&p.push(`${w} ... (${Ce} element${Ce===1?"":"s"})`),p.push(`${w}${f(e)}`)),oe&&p.push(`${L} </${T}>`),N&&_>=0){let u=Array.from(N.children),c=u.length-_-1;if(c>0){let m=u[_+1];g(m)&&c<=2?(p.push(`${L} ${l(m,true)}`),p.push(`${L} </${m.tagName.toLowerCase()}>`)):p.push(`${L} ... (${c} element${c===1?"":"s"})`);}}for(let u=C.length-1;u>=0;u--){let c=" ".repeat(u);p.push(`${c}${f(C[u])}`);let m=R[u],y=A[u];m&&y&&(u===C.length-1||R[u+1]!==m)&&p.push(`${c}</${m}>`);}return p.push("```"),p.join(`
|
|
23
|
-
`)};var hi=()=>document.hasFocus()?Promise
|
|
18
|
+
`,r)),r!==-1)n=n.slice(0,r);else return "";return n},Mo=/(^|@)\S+:\d+/,Qn=/^\s*at .*(\S+:\d+|\(native\))/m,Po=/^(eval@)?(\[native code\])?$/;var er=(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=zn(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(Mo)){let i=qn(o,void 0)[0];i&&r.push(i);}return Kt(r,t)}return e.match(Qn)?zn(e,t):qn(e,t)},tr=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]},Kt=(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 zn=(e,t)=>Kt(e.split(`
|
|
20
|
+
`).filter(r=>!!r.match(Qn)),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=tr(s?s[1]:i),l=s&&i||void 0,f=["eval","<anonymous>"].includes(a[0])?void 0:a[0];return {function:l,file:f,line:a[1]?+a[1]:void 0,col:a[2]?+a[2]:void 0,raw:o}});var qn=(e,t)=>Kt(e.split(`
|
|
21
|
+
`).filter(r=>!r.match(Po)),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=tr(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 Lo=Oo((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 w=0;w<i.length;w++){let u=i.charCodeAt(w);s[w]=u,a[u]=w;}function l(w,u){let c=0,d=0,y=0;do{let D=w.next();y=a[D],c|=(y&31)<<d,d+=5;}while(y&32);let E=c&1;return c>>>=1,E&&(c=-2147483648|-c),u+c}function f(w,u,c){let d=u-c;d=d<0?-d<<1|1:d<<1;do{let y=d&31;d>>>=5,d>0&&(y|=32),w.write(s[y]);}while(d>0);return u}function m(w,u){return w.pos>=u?false:w.peek()!==r}let g=1024*16,b=typeof TextDecoder<"u"?new TextDecoder:typeof Buffer<"u"?{decode(w){return Buffer.from(w.buffer,w.byteOffset,w.byteLength).toString()}}:{decode(w){let u="";for(let c=0;c<w.length;c++)u+=String.fromCharCode(w[c]);return u}};class x{constructor(){this.pos=0,this.out="",this.buffer=new Uint8Array(g);}write(u){let{buffer:c}=this;c[this.pos++]=u,this.pos===g&&(this.out+=b.decode(c),this.pos=0);}flush(){let{buffer:u,out:c,pos:d}=this;return d>0?c+b.decode(u.subarray(0,d)):c}}class S{constructor(u){this.pos=0,this.buffer=u;}next(){return this.buffer.charCodeAt(this.pos++)}peek(){return this.buffer.charCodeAt(this.pos)}indexOf(u){let{buffer:c,pos:d}=this,y=c.indexOf(u,d);return y===-1?c.length:y}}let C=[];function N(w){let{length:u}=w,c=new S(w),d=[],y=[],E=0;for(;c.pos<u;c.pos++){E=l(c,E);let D=l(c,0);if(!m(c,u)){let U=y.pop();U[2]=E,U[3]=D;continue}let I=l(c,0),M=l(c,0),B=M&1,H=B?[E,D,0,0,I,l(c,0)]:[E,D,0,0,I],j=C;if(m(c,u)){j=[];do{let U=l(c,0);j.push(U);}while(m(c,u))}H.vars=j,d.push(H),y.push(H);}return d}function T(w){let u=new x;for(let c=0;c<w.length;)c=A(w,c,u,[0]);return u.flush()}function A(w,u,c,d){let y=w[u],{0:E,1:D,2:I,3:M,4:B,vars:H}=y;u>0&&c.write(r),d[0]=f(c,E,d[0]),f(c,D,0),f(c,B,0);let j=y.length===6?1:0;f(c,j,0),y.length===6&&f(c,y[5],0);for(let U of H)f(c,U,0);for(u++;u<w.length;){let U=w[u],{0:F,1:V}=U;if(F>I||F===I&&V>=M)break;u=A(w,u,c,d);}return c.write(r),d[0]=f(c,I,d[0]),f(c,M,0),u}function R(w){let{length:u}=w,c=new S(w),d=[],y=[],E=0,D=0,I=0,M=0,B=0,H=0,j=0,U=0;do{let F=c.indexOf(";"),V=0;for(;c.pos<F;c.pos++){if(V=l(c,V),!m(c,F)){let te=y.pop();te[2]=E,te[3]=V;continue}let J=l(c,0),$e=J&1,Oe=J&2,Ce=J&4,je=null,ke=C,ge;if($e){let te=l(c,D);I=l(c,D===te?I:0),D=te,ge=[E,V,0,0,te,I];}else ge=[E,V,0,0];if(ge.isScope=!!Ce,Oe){let te=M,de=B;M=l(c,M);let xe=te===M;B=l(c,xe?B:0),H=l(c,xe&&de===B?H:0),je=[M,B,H];}if(ge.callsite=je,m(c,F)){ke=[];do{j=E,U=V;let te=l(c,0),de;if(te<-1){de=[[l(c,0)]];for(let xe=-1;xe>te;xe--){let Ve=j;j=l(c,j),U=l(c,j===Ve?U:0);let Et=l(c,0);de.push([Et,j,U]);}}else de=[[te]];ke.push(de);}while(m(c,F))}ge.bindings=ke,d.push(ge),y.push(ge);}E++,c.pos=F+1;}while(c.pos<u);return d}function _(w){if(w.length===0)return "";let u=new x;for(let c=0;c<w.length;)c=O(w,c,u,[0,0,0,0,0,0,0]);return u.flush()}function O(w,u,c,d){let y=w[u],{0:E,1:D,2:I,3:M,isScope:B,callsite:H,bindings:j}=y;d[0]<E?(L(c,d[0],E),d[0]=E,d[1]=0):u>0&&c.write(r),d[1]=f(c,y[1],d[1]);let U=(y.length===6?1:0)|(H?2:0)|(B?4:0);if(f(c,U,0),y.length===6){let{4:F,5:V}=y;F!==d[2]&&(d[3]=0),d[2]=f(c,F,d[2]),d[3]=f(c,V,d[3]);}if(H){let{0:F,1:V,2:J}=y.callsite;F===d[4]?V!==d[5]&&(d[6]=0):(d[5]=0,d[6]=0),d[4]=f(c,F,d[4]),d[5]=f(c,V,d[5]),d[6]=f(c,J,d[6]);}if(j)for(let F of j){F.length>1&&f(c,-F.length,0);let V=F[0][0];f(c,V,0);let J=E,$e=D;for(let Oe=1;Oe<F.length;Oe++){let Ce=F[Oe];J=f(c,Ce[1],J),$e=f(c,Ce[2],$e),f(c,Ce[0],0);}}for(u++;u<w.length;){let F=w[u],{0:V,1:J}=F;if(V>I||V===I&&J>=M)break;u=O(w,u,c,d);}return d[0]<I?(L(c,d[0],I),d[0]=I,d[1]=0):c.write(r),d[1]=f(c,M,d[1]),u}function L(w,u,c){do w.write(o);while(++u<c)}function re(w){let{length:u}=w,c=new S(w),d=[],y=0,E=0,D=0,I=0,M=0;do{let B=c.indexOf(";"),H=[],j=true,U=0;for(y=0;c.pos<B;){let F;y=l(c,y),y<U&&(j=false),U=y,m(c,B)?(E=l(c,E),D=l(c,D),I=l(c,I),m(c,B)?(M=l(c,M),F=[y,E,D,I,M]):F=[y,E,D,I]):F=[y],H.push(F),c.pos++;}j||ie(H),d.push(H),c.pos=B+1;}while(c.pos<=u);return d}function ie(w){w.sort(le);}function le(w,u){return w[0]-u[0]}function Te(w){let u=new x,c=0,d=0,y=0,E=0;for(let D=0;D<w.length;D++){let I=w[D];if(D>0&&u.write(o),I.length===0)continue;let M=0;for(let B=0;B<I.length;B++){let H=I[B];B>0&&u.write(r),M=f(u,H[0],M),H.length!==1&&(c=f(u,H[1],c),d=f(u,H[2],d),y=f(u,H[3],y),H.length!==4&&(E=f(u,H[4],E)));}}return u.flush()}n.decode=re,n.decodeGeneratedRanges=R,n.decodeOriginalScopes=N,n.encode=Te,n.encodeGeneratedRanges=_,n.encodeOriginalScopes=T,Object.defineProperty(n,"__esModule",{value:true});});}),nr=_o(Lo()),rr=/^[a-zA-Z][a-zA-Z\d+\-.]*:/,Do=/^data:application\/json[^,]+base64,/,Ho=/(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^*]+?)[ \t]*(?:\*\/)[ \t]*$)/,or=typeof WeakRef<"u",Je=new Map,vt=new Map,Bo=e=>or&&e instanceof WeakRef,Xn=(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 m of o)if(m[0]<=r)i=m;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 f=t[s];return f?{columnNumber:l,fileName:f,lineNumber:a+1}:null},jo=(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 Xn(r.map.mappings,r.map.sources,o,i)}return Xn(e.mappings,e.sources,t-1,n)},Vo=(e,t)=>{let n=t.split(`
|
|
22
|
+
`),r;for(let i=n.length-1;i>=0&&!r;i--){let s=n[i].match(Ho);s&&(r=s[1]||s[2]);}if(!r)return null;let o=rr.test(r);if(!(Do.test(r)||o||r.startsWith("/"))){let i=e.split("/");i[i.length-1]=r,r=i.join("/");}return r},Yo=e=>({file:e.file,mappings:(0, nr.decode)(e.mappings),names:e.names,sourceRoot:e.sourceRoot,sources:e.sources,sourcesContent:e.sourcesContent,version:3}),Go=e=>{let t=e.sections.map(({map:r,offset:o})=>({map:{...r,mappings:(0, nr.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}},Wn=e=>{if(!e)return false;let t=e.trim();if(!t)return false;let n=t.match(rr);if(!n)return true;let r=n[0].toLowerCase();return r==="http:"||r==="https:"},Uo=async(e,t=fetch)=>{if(!Wn(e))return null;let n;try{n=await(await t(e)).text();}catch{return null}if(!n)return null;let r=Vo(e,n);if(!r||!Wn(r))return null;try{let o=await t(r),i=await o.json();return "sections"in i?Go(i):Yo(i)}catch{return null}},zo=async(e,t=true,n)=>{if(t&&Je.has(e)){let i=Je.get(e);if(i==null)return null;if(Bo(i)){let s=i.deref();if(s)return s;Je.delete(e);}else return i}if(t&&vt.has(e))return vt.get(e);let r=Uo(e,n);t&&vt.set(e,r);let o=await r;return t&&vt.delete(e),t&&(o===null?Je.set(e,null):Je.set(e,or?new WeakRef(o):o)),o},Kn=/^[a-zA-Z][a-zA-Z\d+\-.]*:/,qo=["rsc://","file:///","webpack://","node:","turbopack://","metro://"],Zn="about://React/",Xo=["<anonymous>","eval",""],Wo=/\.(jsx|tsx|ts|js)$/,Ko=/(\.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,Zo=/^\?[\w~.\-]+(?:=[^&#]*)?(?:&[\w~.\-]+(?:=[^&#]*)?)*$/,Jo=e=>e._debugStack instanceof Error&&typeof e._debugStack?.stack=="string",Qo=e=>{let t=e._debugSource;return t?typeof t=="object"&&!!t&&"fileName"in t&&typeof t.fileName=="string"&&"lineNumber"in t&&typeof t.lineNumber=="number":false},ei=async(e,t=true,n)=>{if(Qo(e))return e._debugSource||null;let r=ir(e);return sr(r,void 0,t,n)},ir=e=>Jo(e)?Io(e._debugStack.stack):ko(e),ti=async(e,t=true,n)=>{let r=await sr(e,1,t,n);return !r||r.length===0?null:r[0]},sr=async(e,t=1,n=true,r)=>{let o=er(e,{slice:t??1}),i=[];for(let s of o){if(!s?.file)continue;let a=await zo(s.file,n,r);if(a&&typeof s.line=="number"&&typeof s.col=="number"){let l=jo(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},Be=e=>{if(!e||Xo.includes(e))return "";let t=e;if(t.startsWith(Zn)){let r=t.slice(Zn.length),o=r.indexOf("/"),i=r.indexOf(":");t=o!==-1&&(i===-1||o<i)?r.slice(o+1):r;}for(let r of qo)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);Zo.test(r)&&(t=t.slice(0,n));}return t},Zt=e=>{let t=Be(e);return !(!t||!Wo.test(t)||Ko.test(t))},ni=async(e,t=true,n)=>{let r=De(e,s=>{if(Ke(s))return true},true);if(r){let s=await ei(r,t,n);if(s?.fileName){let a=Be(s.fileName);if(Zt(a))return {fileName:a,lineNumber:s.lineNumber,columnNumber:s.columnNumber,functionName:s.functionName}}}let o=er(ir(e),{includeInElement:false}),i=null;for(;o.length;){let s=o.pop();if(!s||!s.raw||!s.file)continue;let a=await ti(s.raw,t,n);if(a)return {fileName:Be(a.fileName),lineNumber:a.lineNumber,columnNumber:a.columnNumber,functionName:a.functionName};i={fileName:Be(s.file),lineNumber:s.line,columnNumber:s.col,functionName:s.function};}return i},ar=async(e,t=true,n)=>{let r=Ze(e);if(!r||!Vt(r))return null;let o=zt(r);return o?ni(o,t,n):null};var ri=new Set(["role","name","aria-label","rel","href"]);function oi(e,t){let n=ri.has(e);n||=e.startsWith("data-")&&Qe(e);let r=Qe(t)&&t.length<100;return r||=t.startsWith("#")&&Qe(t.slice(1)),n&&r}function ii(e){return Qe(e)}function si(e){return Qe(e)}function ai(e){return true}function cr(e,t){if(e.nodeType!==Node.ELEMENT_NODE)throw new Error("Can't generate CSS selector for non-element node type.");if(e.tagName.toLowerCase()==="html")return "html";let n={root:document.body,idName:ii,className:si,tagName:ai,attr:oi,timeoutMs:1e3,seedMinLength:3,optimizedMinLength:2,maxNumberOfPathChecks:1/0},r=new Date,o={...n,...t},i=di(o.root,n),s,a=0;for(let f of li(e,o,i)){if(new Date().getTime()-r.getTime()>o.timeoutMs||a>=o.maxNumberOfPathChecks){let g=ui(e,i);if(!g)throw new Error(`Timeout: Can't find a unique selector after ${o.timeoutMs}ms`);return et(g)}if(a++,en(f,i)){s=f;break}}if(!s)throw new Error("Selector was not found.");let l=[...dr(s,e,o,i,r)];return l.sort(Jt),l.length>0?et(l[0]):et(s)}function*li(e,t,n){let r=[],o=[],i=e,s=0;for(;i&&i!==n;){let a=ci(i,t);for(let l of a)l.level=s;if(r.push(a),i=i.parentElement,s++,o.push(...fr(r)),s>=t.seedMinLength){o.sort(Jt);for(let l of o)yield l;o=[];}}o.sort(Jt);for(let a of o)yield a;}function Qe(e){if(/^[a-z\-]{3,}$/i.test(e)){let t=e.split(/-|[A-Z]/);for(let n of t)if(n.length<=2||/[^aeiou]{4,}/i.test(n))return false;return true}return false}function ci(e,t){let n=[],r=e.getAttribute("id");r&&t.idName(r)&&n.push({name:"#"+CSS.escape(r),penalty:0});for(let s=0;s<e.classList.length;s++){let a=e.classList[s];t.className(a)&&n.push({name:"."+CSS.escape(a),penalty:1});}for(let s=0;s<e.attributes.length;s++){let a=e.attributes[s];t.attr(a.name,a.value)&&n.push({name:`[${CSS.escape(a.name)}="${CSS.escape(a.value)}"]`,penalty:2});}let o=e.tagName.toLowerCase();if(t.tagName(o)){n.push({name:o,penalty:5});let s=Qt(e,o);s!==void 0&&n.push({name:ur(o,s),penalty:10});}let i=Qt(e);return i!==void 0&&n.push({name:fi(o,i),penalty:50}),n}function et(e){let t=e[0],n=t.name;for(let r=1;r<e.length;r++){let o=e[r].level||0;t.level===o-1?n=`${e[r].name} > ${n}`:n=`${e[r].name} ${n}`,t=e[r];}return n}function lr(e){return e.map(t=>t.penalty).reduce((t,n)=>t+n,0)}function Jt(e,t){return lr(e)-lr(t)}function Qt(e,t){let n=e.parentNode;if(!n)return;let r=n.firstChild;if(!r)return;let o=0;for(;r&&(r.nodeType===Node.ELEMENT_NODE&&(t===void 0||r.tagName.toLowerCase()===t)&&o++,r!==e);)r=r.nextSibling;return o}function ui(e,t){let n=0,r=e,o=[];for(;r&&r!==t;){let i=r.tagName.toLowerCase(),s=Qt(r,i);if(s===void 0)return;o.push({name:ur(i,s),penalty:NaN,level:n}),r=r.parentElement,n++;}if(en(o,t))return o}function fi(e,t){return e==="html"?"html":`${e}:nth-child(${t})`}function ur(e,t){return e==="html"?"html":`${e}:nth-of-type(${t})`}function*fr(e,t=[]){if(e.length>0)for(let n of e[0])yield*fr(e.slice(1,e.length),t.concat(n));else yield t;}function di(e,t){return e.nodeType===Node.DOCUMENT_NODE?e:e===t.root?e.ownerDocument:e}function en(e,t){let n=et(e);switch(t.querySelectorAll(n).length){case 0:throw new Error(`Can't select any node with this selector: ${n}`);case 1:return true;default:return false}}function*dr(e,t,n,r,o){if(e.length>2&&e.length>n.optimizedMinLength)for(let i=1;i<e.length-1;i++){if(new Date().getTime()-o.getTime()>n.timeoutMs)return;let a=[...e];a.splice(i,1),en(a,r)&&r.querySelector(et(a))===t&&(yield a,yield*dr(a,t,n,r,o));}}qt({onCommitFiberRoot(e,t){xt.add(t);}});var mi=e=>cr(e),tn=async e=>{let t=(u,c)=>u.length>c?`${u.substring(0,c)}...`:u,n=u=>!!(u.startsWith("_")||u.includes("Provider")&&u.includes("Context")),r=u=>{let c=Ze(u);if(!c)return null;let d=null;return De(c,y=>{if(Ke(y)){let E=He(y);if(E&&!n(E))return d=E,true}return false},true),d},o=async u=>{let c=await ar(u);if(!c)return null;let d=Be(c.fileName);return Zt(d)?`${d}:${c.lineNumber}:${c.columnNumber}`:null},i=new Set(["article","aside","footer","form","header","main","nav","section"]),s=u=>{let c=u.tagName.toLowerCase();if(i.has(c)||u.id)return true;if(u.className&&typeof u.className=="string"){let d=u.className.trim();if(d&&d.length>0)return true}return Array.from(u.attributes).some(d=>d.name.startsWith("data-"))},a=(u,c=10)=>{let d=[],y=u.parentElement,E=0;for(;y&&E<c&&y.tagName!=="BODY"&&!(s(y)&&(d.push(y),d.length>=3));)y=y.parentElement,E++;return d.reverse()},l=(u,c=false)=>{let d=u.tagName.toLowerCase(),y=[];if(u.id&&y.push(`id="${u.id}"`),u.className&&typeof u.className=="string"){let M=u.className.trim().split(/\s+/);if(M.length>0&&M[0]){let B=c?M.slice(0,3):M,H=t(B.join(" "),30);y.push(`class="${H}"`);}}let E=Array.from(u.attributes).filter(M=>M.name.startsWith("data-")),D=c?E.slice(0,1):E;for(let M of D)y.push(`${M.name}="${t(M.value,20)}"`);let I=u.getAttribute("aria-label");return I&&!c&&y.push(`aria-label="${t(I,20)}"`),y.length>0?`<${d} ${y.join(" ")}>`:`<${d}>`},f=u=>`</${u.tagName.toLowerCase()}>`,m=u=>{let c=(u.textContent||"").trim().replace(/\s+/g," ");return t(c,60)},g=u=>{if(u.id)return `#${u.id}`;if(u.className&&typeof u.className=="string"){let c=u.className.trim().split(/\s+/);if(c.length>0&&c[0])return `.${c[0]}`}return null},b=[],x=mi(e);b.push(`- selector: ${x}`);let S=e.getBoundingClientRect();b.push(`- width: ${Math.round(S.width)}`),b.push(`- height: ${Math.round(S.height)}`),b.push("HTML snippet:"),b.push("```html");let C=a(e),N=C.map(u=>r(u)),T=r(e),A=await Promise.all(C.map(u=>o(u))),R=await o(e);for(let u=0;u<C.length;u++){let c=" ".repeat(u),d=N[u],y=A[u];d&&y&&(u===0||N[u-1]!==d)&&b.push(`${c}<${d} source="${y}">`),b.push(`${c}${l(C[u],true)}`);}let _=e.parentElement,O=-1;if(_){let u=Array.from(_.children);if(O=u.indexOf(e),O>0){let c=u[O-1];if(g(c)&&O<=2){let y=" ".repeat(C.length);b.push(`${y} ${l(c,true)}`),b.push(`${y} </${c.tagName.toLowerCase()}>`);}else if(O>0){let y=" ".repeat(C.length);b.push(`${y} ... (${O} element${O===1?"":"s"})`);}}}let L=" ".repeat(C.length),re=C.length>0?N[N.length-1]:null,ie=T&&R&&T!==re;ie&&b.push(`${L} <${T} used-at="${R}">`),b.push(`${L} <!-- IMPORTANT: selected element -->`);let le=m(e),Te=e.children.length,w=`${L}${ie?" ":" "}`;if(le&&Te===0&&le.length<40?b.push(`${w}${l(e)}${le}${f(e)}`):(b.push(`${w}${l(e)}`),le&&b.push(`${w} ${le}`),Te>0&&b.push(`${w} ... (${Te} element${Te===1?"":"s"})`),b.push(`${w}${f(e)}`)),ie&&b.push(`${L} </${T}>`),_&&O>=0){let u=Array.from(_.children),c=u.length-O-1;if(c>0){let d=u[O+1];g(d)&&c<=2?(b.push(`${L} ${l(d,true)}`),b.push(`${L} </${d.tagName.toLowerCase()}>`)):b.push(`${L} ... (${c} element${c===1?"":"s"})`);}}for(let u=C.length-1;u>=0;u--){let c=" ".repeat(u);b.push(`${c}${f(C[u])}`);let d=N[u],y=A[u];d&&y&&(u===C.length-1||N[u+1]!==d)&&b.push(`${c}</${d}>`);}return b.push("```"),b.join(`
|
|
23
|
+
`)};var hi=()=>document.hasFocus()?new Promise(e=>setTimeout(e,50)):new Promise(e=>{let t=()=>{window.removeEventListener("focus",t),setTimeout(e,50);};window.addEventListener("focus",t),window.focus();}),nn=async e=>{await hi();try{if(Array.isArray(e)){if(!navigator?.clipboard?.write){for(let n of e)if(typeof n=="string"){let r=mr(n);if(!r)return r}return !0}let t=new Map;for(let n of e)if(n instanceof Blob){let r=n.type||"text/plain";t.has(r)||t.set(r,n);}else t.has("text/plain")||t.set("text/plain",new Blob([n],{type:"text/plain"}));return await navigator.clipboard.write([new ClipboardItem(Object.fromEntries(t))]),!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 mr(e)}}}catch{return false}},mr=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 hr=(e,t=window.getComputedStyle(e))=>t.display!=="none"&&t.visibility!=="hidden"&&t.opacity!=="0";var tt=e=>{if(e.closest(`[${Le}]`))return false;let t=window.getComputedStyle(e);return !(!hr(e,t)||t.pointerEvents==="none")};var rn=(e,t)=>{let n=document.elementsFromPoint(e,t);for(let r of n)if(tt(r))return r;return null};var gr=(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 f of o){if(!n){let C=(f.tagName||"").toUpperCase();if(C==="HTML"||C==="BODY")continue}if(!t(f))continue;let m=f.getBoundingClientRect(),g=m.left,b=m.top,x=m.left+m.width,S=m.top+m.height;if(n){let C=Math.max(i,g),N=Math.max(s,b),T=Math.min(a,x),A=Math.min(l,S),R=Math.max(0,T-C),_=Math.max(0,A-N),O=R*_,L=Math.max(0,m.width*m.height);L>0&&O/L>=.75&&r.push(f);}else g<a&&x>i&&b<l&&S>s&&r.push(f);}return r},pr=e=>e.filter(t=>!e.some(n=>n!==t&&n.contains(t)));var br=(e,t)=>{let n=gr(e,t,true);return pr(n)},yr=(e,t)=>{let n=gr(e,t,false);return pr(n)};var on=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 gi=150,wr=e=>{let t={enabled:true,keyHoldDuration:300,...e};return t.enabled===false?{activate:()=>{},deactivate:()=>{},toggle:()=>{},isActive:()=>false,dispose:()=>{}}:Ae(n=>{let[o,i]=$(false),[s,a]=$(-1e3),[l,f]=$(-1e3),[m,g]=$(false),[b,x]=$(-1e3),[S,C]=$(-1e3),[N,T]=$(false),[A,R]=$(null),[_,O]=$(null),[L,re]=$(0),[ie,le]=$([]),[Te,w]=$([]),[u,c]=$(false),[d,y]=$(false),[E,D]=$(false),[I,M]=$(-1e3),[B,H]=$(-1e3),j=null,U=null,F=null,V=null,J=z(()=>u()&&!N()),$e=z(()=>s()>-1e3&&l()>-1e3),Oe=h=>(h.metaKey||h.ctrlKey)&&h.key.toLowerCase()==="c",Ce=h=>{let v=`grabbed-${Date.now()}-${Math.random()}`,Y=Date.now(),W={id:v,bounds:h,createdAt:Y},Z=ie();le([...Z,W]),setTimeout(()=>{le(Q=>Q.filter(rt=>rt.id!==v));},1700);},je=(h,v,Y)=>{let W=`success-${Date.now()}-${Math.random()}`;w(Z=>[...Z,{id:W,text:h,x:v,y:Y}]),setTimeout(()=>{w(Z=>Z.filter(Q=>Q.id!==W));},1700);},ke=h=>`<selected_element>
|
|
24
24
|
${h}
|
|
25
|
-
</selected_element>`,
|
|
25
|
+
</selected_element>`,ge=h=>{let v=window.getComputedStyle(h),Y=h.getBoundingClientRect();return {width:`${Math.round(Y.width)}px`,height:`${Math.round(Y.height)}px`,paddingTop:v.paddingTop,paddingRight:v.paddingRight,paddingBottom:v.paddingBottom,paddingLeft:v.paddingLeft,background:v.background,opacity:v.opacity}},te=h=>{let v={elements:h.map(Z=>({tagName:Z.tagName,content:Z.content,computedStyles:Z.computedStyles}))},W=`<div data-react-grab="${btoa(JSON.stringify(v))}"></div>`;return new Blob([W],{type:"text/html"})},de=h=>(h.tagName||"").toLowerCase(),xe=h=>{try{let v=h.map(Y=>({tagName:de(Y)}));window.dispatchEvent(new CustomEvent("react-grab:element-selected",{detail:{elements:v}}));}catch{}},Ve=async(h,v,Y)=>{M(h),H(v),T(true),await Y().finally(()=>{T(false);});},Et=async h=>{let v=de(h);Ce(on(h));try{let Y=await tn(h),W=ke(Y),Z=te([{tagName:v,content:Y,computedStyles:ge(h)}]);await nn([W,Z]);}catch{}je(v?`<${v}>`:"<element>",I(),B()),xe([h]);},sn=async h=>{if(h.length!==0){for(let v of h)Ce(on(v));try{let v=await Promise.all(h.map(Q=>tn(Q))),Y=v.filter(Q=>Q.trim()).map(Q=>ke(Q)).join(`
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
`),W=ke(G),Z=v.map((Ve,fn)=>({tagName:he(h[fn]),content:Ve,computedStyles:me(h[fn])})),ge=ee(Z);await tn([W,ge]);}catch{}je(`${h.length} elements`,I(),B());}},Ne=z(()=>!J()||d()?null:nn(s(),l())),Sr=z(()=>{let h=Ne();if(!h)return;let v=h.getBoundingClientRect(),G=window.getComputedStyle(h);return {borderRadius:G.borderRadius||"0px",height:v.height,transform:G.transform||"none",width:v.width,x:v.left,y:v.top}}),nt=2,on=(h,v)=>({x:Math.abs(h-p()),y:Math.abs(v-S())}),sn=z(()=>{if(!d())return false;let h=on(s(),l());return h.x>nt||h.y>nt}),an=(h,v)=>{let G=Math.min(p(),h),W=Math.min(S(),v),Z=Math.abs(h-p()),ge=Math.abs(v-S());return {x:G,y:W,width:Z,height:ge}},Tr=z(()=>{if(!sn())return;let h=an(s(),l());return {borderRadius:"0px",height:h.height,transform:"none",width:h.width,x:h.x,y:h.y}}),Cr=z(()=>{let h=Ne();return h?`<${he(h)}>`:"<element>"}),ln=z(()=>R()?{x:I(),y:B()}:{x:s(),y:l()}),xr=z(()=>!!(Ne()&&Ne()===A()));te(Ee(()=>[Ne(),A()],([h,v])=>{v&&h&&v!==h&&O(null);}));let cn=z(()=>{let h=N();if(L(),h===null)return 0;let v=Date.now()-h;return Math.min(v/t.keyHoldDuration,1)}),vr=()=>{_(Date.now()),y(false),F=window.setTimeout(()=>{y(true),F=null;},gi);let h=()=>{if(N()===null)return;ne(G=>G+1),cn()<1&&(U=requestAnimationFrame(h));};h();},Et=()=>{U!==null&&(cancelAnimationFrame(U),U=null),F!==null&&(window.clearTimeout(F),F=null),_(null),y(false);},Er=()=>{Et(),c(true),document.body.style.cursor="crosshair";},Rt=()=>{i(false),c(false),document.body.style.cursor="",d()&&(g(false),document.body.style.userSelect=""),Y&&window.clearTimeout(Y),j&&window.clearTimeout(j),Et();},un=new AbortController,_e=un.signal;window.addEventListener("keydown",h=>{if(h.key==="Escape"&&o()){Rt();return}_n(h)||Oe(h)&&(o()||(i(true),vr(),Y=window.setTimeout(()=>{Er(),t.onActivate?.();},t.keyHoldDuration)),u()&&(j&&window.clearTimeout(j),j=window.setTimeout(()=>{Rt();},200)));},{signal:_e}),window.addEventListener("keyup",h=>{if(!o()&&!u())return;let v=!h.metaKey&&!h.ctrlKey;(h.key.toLowerCase()==="c"||v)&&Rt();},{signal:_e,capture:true}),window.addEventListener("mousemove",h=>{a(h.clientX),f(h.clientY);},{signal:_e}),window.addEventListener("mousedown",h=>{!J()||R()||(h.preventDefault(),g(true),x(h.clientX),C(h.clientY),document.body.style.userSelect="none");},{signal:_e}),window.addEventListener("mouseup",h=>{if(!d())return;let v=on(h.clientX,h.clientY),G=v.x>nt||v.y>nt;if(g(false),document.body.style.userSelect="",G){D(true);let W=an(h.clientX,h.clientY),Z=br(W,et);if(Z.length>0)be(h.clientX,h.clientY,()=>tt(Z));else {let ge=yr(W,et);ge.length>0&&be(h.clientX,h.clientY,()=>tt(ge));}}else {let W=nn(h.clientX,h.clientY);if(!W)return;O(W),be(h.clientX,h.clientY,()=>vt(W));}},{signal:_e}),window.addEventListener("click",h=>{E()&&(h.preventDefault(),h.stopPropagation(),D(false));},{signal:_e,capture:true}),document.addEventListener("visibilitychange",()=>{document.hidden&&ae([]);},{signal:_e}),ce(()=>{un.abort(),Y&&window.clearTimeout(Y),j&&window.clearTimeout(j),Et(),document.body.style.userSelect="",document.body.style.cursor="";});let Rr=An(),Or=z(()=>false),Nr=z(()=>J()&&sn()),_r=z(()=>R()?"processing":"hover"),Ar=z(()=>J()&&!d()&&(!!Ne()&&!xr()||!Ne())||R()),Fr=z(()=>o()&&m()&&$e()),$r=z(()=>J()&&!d());return On(()=>k(Mn,{get selectionVisible(){return Or()},get selectionBounds(){return Sr()},get dragVisible(){return Nr()},get dragBounds(){return Tr()},get grabbedBoxes(){return oe()},get successLabels(){return Ce()},get labelVariant(){return _r()},get labelText(){return Cr()},get labelX(){return ln().x},get labelY(){return ln().y},get labelVisible(){return Ar()},get progressVisible(){return Fr()},get progress(){return cn()},get mouseX(){return s()},get mouseY(){return l()},get crosshairVisible(){return $r()}}),Rr),n})};wr();/*! Bundled license information:
|
|
27
|
+
`),W=v.map((Q,rt)=>({tagName:de(h[rt]),content:Q,computedStyles:ge(h[rt])})),Z=te(W);await nn([Y,Z]);}catch{}je(`${h.length} elements`,I(),B()),xe(h);}},Ne=z(()=>!J()||m()?null:rn(s(),l())),Tr=z(()=>{let h=Ne();if(!h)return;let v=h.getBoundingClientRect(),Y=window.getComputedStyle(h);return {borderRadius:Y.borderRadius||"0px",height:v.height,transform:Y.transform||"none",width:v.width,x:v.left,y:v.top}}),nt=2,an=(h,v)=>({x:Math.abs(h-b()),y:Math.abs(v-S())}),ln=z(()=>{if(!m())return false;let h=an(s(),l());return h.x>nt||h.y>nt}),cn=(h,v)=>{let Y=Math.min(b(),h),W=Math.min(S(),v),Z=Math.abs(h-b()),Q=Math.abs(v-S());return {x:Y,y:W,width:Z,height:Q}},Cr=z(()=>{if(!ln())return;let h=cn(s(),l());return {borderRadius:"0px",height:h.height,transform:"none",width:h.width,x:h.x,y:h.y}}),xr=z(()=>{let h=Ne();return h?`<${de(h)}>`:"<element>"}),un=z(()=>N()?{x:I(),y:B()}:{x:s(),y:l()}),vr=z(()=>!!(Ne()&&Ne()===A()));ne(Ee(()=>[Ne(),A()],([h,v])=>{v&&h&&v!==h&&R(null);}));let fn=z(()=>{let h=_();if(L(),h===null)return 0;let v=Date.now()-h;return Math.min(v/t.keyHoldDuration,1)}),Er=()=>{O(Date.now()),y(false),F=window.setTimeout(()=>{y(true),F=null;},gi);let h=()=>{if(_()===null)return;re(Y=>Y+1),fn()<1&&(U=requestAnimationFrame(h));};h();},Rt=()=>{U!==null&&(cancelAnimationFrame(U),U=null),F!==null&&(window.clearTimeout(F),F=null),O(null),y(false);},Ot=()=>{Rt(),c(true),document.body.style.cursor="crosshair";},Ye=()=>{i(false),c(false),document.body.style.cursor="",m()&&(g(false),document.body.style.userSelect=""),j&&window.clearTimeout(j),V&&window.clearTimeout(V),Rt();},dn=new AbortController,_e=dn.signal;window.addEventListener("keydown",h=>{if(h.key==="Escape"&&o()){Ye();return}if(!An(h)&&Oe(h)){if(u()){V!==null&&window.clearTimeout(V),V=window.setTimeout(()=>{Ye();},200);return}h.repeat||(j!==null&&window.clearTimeout(j),o()||i(true),Er(),j=window.setTimeout(()=>{Ot(),t.onActivate?.();},t.keyHoldDuration));}},{signal:_e}),window.addEventListener("keyup",h=>{if(!o()&&!u())return;let v=!h.metaKey&&!h.ctrlKey;(h.key.toLowerCase()==="c"||v)&&Ye();},{signal:_e,capture:true}),window.addEventListener("mousemove",h=>{a(h.clientX),f(h.clientY);},{signal:_e}),window.addEventListener("mousedown",h=>{!J()||N()||(h.preventDefault(),g(true),x(h.clientX),C(h.clientY),document.body.style.userSelect="none");},{signal:_e}),window.addEventListener("mouseup",h=>{if(!m())return;let v=an(h.clientX,h.clientY),Y=v.x>nt||v.y>nt;if(g(false),document.body.style.userSelect="",Y){D(true);let W=cn(h.clientX,h.clientY),Z=br(W,tt);if(Z.length>0)Ve(h.clientX,h.clientY,()=>sn(Z));else {let Q=yr(W,tt);Q.length>0&&Ve(h.clientX,h.clientY,()=>sn(Q));}}else {let W=rn(h.clientX,h.clientY);if(!W)return;R(W),Ve(h.clientX,h.clientY,()=>Et(W));}},{signal:_e}),window.addEventListener("click",h=>{E()&&(h.preventDefault(),h.stopPropagation(),D(false));},{signal:_e,capture:true}),document.addEventListener("visibilitychange",()=>{document.hidden&&le([]);},{signal:_e}),ue(()=>{dn.abort(),j&&window.clearTimeout(j),V&&window.clearTimeout(V),Rt(),document.body.style.userSelect="",document.body.style.cursor="";});let Rr=Fn(),Or=z(()=>false),Nr=z(()=>J()&&ln()),_r=z(()=>N()?"processing":"hover"),Ar=z(()=>J()&&!m()&&(!!Ne()&&!vr()||!Ne())||N()),Fr=z(()=>o()&&d()&&$e()),$r=z(()=>J()&&!m());return Nn(()=>k(Pn,{get selectionVisible(){return Or()},get selectionBounds(){return Tr()},get dragVisible(){return Nr()},get dragBounds(){return Cr()},get grabbedBoxes(){return ie()},get successLabels(){return Te()},get labelVariant(){return _r()},get labelText(){return xr()},get labelX(){return un().x},get labelY(){return un().y},get labelVisible(){return Ar()},get progressVisible(){return Fr()},get progress(){return fn()},get mouseX(){return s()},get mouseY(){return l()},get crosshairVisible(){return $r()}}),Rr),{activate:()=>{u()||(Ot(),t.onActivate?.());},deactivate:()=>{u()&&Ye();},toggle:()=>{u()?Ye():(Ot(),t.onActivate?.());},isActive:()=>u(),dispose:n}})};var Sr=null,gl=()=>Sr;Sr=wr();/*! Bundled license information:
|
|
30
28
|
|
|
31
29
|
bippy/dist/rdt-hook-DAGphl8S.js:
|
|
32
30
|
(**
|
|
@@ -87,4 +85,4 @@ bippy/dist/source.js:
|
|
|
87
85
|
* This source code is licensed under the MIT license found in the
|
|
88
86
|
* LICENSE file in the root directory of this source tree.
|
|
89
87
|
*)
|
|
90
|
-
*/exports.init=wr;return exports;})({});
|
|
88
|
+
*/exports.getGlobalApi=gl;exports.init=wr;return exports;})({});
|
package/dist/index.js
CHANGED
|
@@ -828,7 +828,6 @@ var getHTMLSnippet = async (element) => {
|
|
|
828
828
|
};
|
|
829
829
|
const lines = [];
|
|
830
830
|
const selector = generateCSSSelector(element);
|
|
831
|
-
lines.push(`Locate this element in the codebase:`);
|
|
832
831
|
lines.push(`- selector: ${selector}`);
|
|
833
832
|
const rect = element.getBoundingClientRect();
|
|
834
833
|
lines.push(`- width: ${Math.round(rect.width)}`);
|
|
@@ -935,11 +934,13 @@ var getHTMLSnippet = async (element) => {
|
|
|
935
934
|
|
|
936
935
|
// src/utils/copy-content.ts
|
|
937
936
|
var waitForFocus = () => {
|
|
938
|
-
if (document.hasFocus())
|
|
937
|
+
if (document.hasFocus()) {
|
|
938
|
+
return new Promise((resolve) => setTimeout(resolve, 50));
|
|
939
|
+
}
|
|
939
940
|
return new Promise((resolve) => {
|
|
940
941
|
const onFocus = () => {
|
|
941
942
|
window.removeEventListener("focus", onFocus);
|
|
942
|
-
resolve
|
|
943
|
+
setTimeout(resolve, 50);
|
|
943
944
|
};
|
|
944
945
|
window.addEventListener("focus", onFocus);
|
|
945
946
|
window.focus();
|
|
@@ -958,21 +959,24 @@ var copyContent = async (content) => {
|
|
|
958
959
|
}
|
|
959
960
|
return true;
|
|
960
961
|
}
|
|
962
|
+
const mimeTypeMap = /* @__PURE__ */ new Map();
|
|
963
|
+
for (const contentPart of content) {
|
|
964
|
+
if (contentPart instanceof Blob) {
|
|
965
|
+
const mimeType = contentPart.type || "text/plain";
|
|
966
|
+
if (!mimeTypeMap.has(mimeType)) {
|
|
967
|
+
mimeTypeMap.set(mimeType, contentPart);
|
|
968
|
+
}
|
|
969
|
+
} else {
|
|
970
|
+
if (!mimeTypeMap.has("text/plain")) {
|
|
971
|
+
mimeTypeMap.set(
|
|
972
|
+
"text/plain",
|
|
973
|
+
new Blob([contentPart], { type: "text/plain" })
|
|
974
|
+
);
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
}
|
|
961
978
|
await navigator.clipboard.write([
|
|
962
|
-
new ClipboardItem(
|
|
963
|
-
Object.fromEntries(
|
|
964
|
-
content.map((contentPart) => {
|
|
965
|
-
if (contentPart instanceof Blob) {
|
|
966
|
-
return [contentPart.type ?? "text/plain", contentPart];
|
|
967
|
-
} else {
|
|
968
|
-
return [
|
|
969
|
-
"text/plain",
|
|
970
|
-
new Blob([contentPart], { type: "text/plain" })
|
|
971
|
-
];
|
|
972
|
-
}
|
|
973
|
-
})
|
|
974
|
-
)
|
|
975
|
-
)
|
|
979
|
+
new ClipboardItem(Object.fromEntries(mimeTypeMap))
|
|
976
980
|
]);
|
|
977
981
|
return true;
|
|
978
982
|
} else if (content instanceof Blob) {
|
|
@@ -1090,57 +1094,14 @@ var removeNestedElements = (elements) => {
|
|
|
1090
1094
|
);
|
|
1091
1095
|
});
|
|
1092
1096
|
};
|
|
1093
|
-
var findBestParentElement = (elements, dragRect, isValidGrabbableElement2) => {
|
|
1094
|
-
if (elements.length <= 1) return null;
|
|
1095
|
-
const dragLeft = dragRect.x;
|
|
1096
|
-
const dragTop = dragRect.y;
|
|
1097
|
-
const dragRight = dragRect.x + dragRect.width;
|
|
1098
|
-
const dragBottom = dragRect.y + dragRect.height;
|
|
1099
|
-
let currentParent = elements[0];
|
|
1100
|
-
while (currentParent) {
|
|
1101
|
-
const parent = currentParent.parentElement;
|
|
1102
|
-
if (!parent) break;
|
|
1103
|
-
const parentRect = parent.getBoundingClientRect();
|
|
1104
|
-
const intersectionLeft = Math.max(dragLeft, parentRect.left);
|
|
1105
|
-
const intersectionTop = Math.max(dragTop, parentRect.top);
|
|
1106
|
-
const intersectionRight = Math.min(dragRight, parentRect.left + parentRect.width);
|
|
1107
|
-
const intersectionBottom = Math.min(dragBottom, parentRect.top + parentRect.height);
|
|
1108
|
-
const intersectionWidth = Math.max(0, intersectionRight - intersectionLeft);
|
|
1109
|
-
const intersectionHeight = Math.max(0, intersectionBottom - intersectionTop);
|
|
1110
|
-
const intersectionArea = intersectionWidth * intersectionHeight;
|
|
1111
|
-
const parentArea = Math.max(0, parentRect.width * parentRect.height);
|
|
1112
|
-
const hasMajorityCoverage = parentArea > 0 && intersectionArea / parentArea >= DRAG_COVERAGE_THRESHOLD;
|
|
1113
|
-
if (!hasMajorityCoverage) break;
|
|
1114
|
-
if (!isValidGrabbableElement2(parent)) {
|
|
1115
|
-
currentParent = parent;
|
|
1116
|
-
continue;
|
|
1117
|
-
}
|
|
1118
|
-
const allChildrenInParent = elements.every(
|
|
1119
|
-
(element) => parent.contains(element)
|
|
1120
|
-
);
|
|
1121
|
-
if (allChildrenInParent) {
|
|
1122
|
-
return parent;
|
|
1123
|
-
}
|
|
1124
|
-
currentParent = parent;
|
|
1125
|
-
}
|
|
1126
|
-
return null;
|
|
1127
|
-
};
|
|
1128
1097
|
var getElementsInDrag = (dragRect, isValidGrabbableElement2) => {
|
|
1129
1098
|
const elements = filterElementsInDrag(dragRect, isValidGrabbableElement2, true);
|
|
1130
1099
|
const uniqueElements = removeNestedElements(elements);
|
|
1131
|
-
const bestParent = findBestParentElement(uniqueElements, dragRect, isValidGrabbableElement2);
|
|
1132
|
-
if (bestParent) {
|
|
1133
|
-
return [bestParent];
|
|
1134
|
-
}
|
|
1135
1100
|
return uniqueElements;
|
|
1136
1101
|
};
|
|
1137
1102
|
var getElementsInDragLoose = (dragRect, isValidGrabbableElement2) => {
|
|
1138
1103
|
const elements = filterElementsInDrag(dragRect, isValidGrabbableElement2, false);
|
|
1139
1104
|
const uniqueElements = removeNestedElements(elements);
|
|
1140
|
-
const bestParent = findBestParentElement(uniqueElements, dragRect, isValidGrabbableElement2);
|
|
1141
|
-
if (bestParent) {
|
|
1142
|
-
return [bestParent];
|
|
1143
|
-
}
|
|
1144
1105
|
return uniqueElements;
|
|
1145
1106
|
};
|
|
1146
1107
|
|
|
@@ -1167,7 +1128,17 @@ var init = (rawOptions) => {
|
|
|
1167
1128
|
...rawOptions
|
|
1168
1129
|
};
|
|
1169
1130
|
if (options.enabled === false) {
|
|
1170
|
-
return
|
|
1131
|
+
return {
|
|
1132
|
+
activate: () => {
|
|
1133
|
+
},
|
|
1134
|
+
deactivate: () => {
|
|
1135
|
+
},
|
|
1136
|
+
toggle: () => {
|
|
1137
|
+
},
|
|
1138
|
+
isActive: () => false,
|
|
1139
|
+
dispose: () => {
|
|
1140
|
+
}
|
|
1141
|
+
};
|
|
1171
1142
|
}
|
|
1172
1143
|
return createRoot((dispose) => {
|
|
1173
1144
|
const OFFSCREEN_POSITION = -1e3;
|
|
@@ -1253,6 +1224,19 @@ ${context}
|
|
|
1253
1224
|
});
|
|
1254
1225
|
};
|
|
1255
1226
|
const extractElementTagName = (element) => (element.tagName || "").toLowerCase();
|
|
1227
|
+
const notifyElementsSelected = (elements) => {
|
|
1228
|
+
try {
|
|
1229
|
+
const elementsPayload = elements.map((element) => ({
|
|
1230
|
+
tagName: extractElementTagName(element)
|
|
1231
|
+
}));
|
|
1232
|
+
window.dispatchEvent(new CustomEvent("react-grab:element-selected", {
|
|
1233
|
+
detail: {
|
|
1234
|
+
elements: elementsPayload
|
|
1235
|
+
}
|
|
1236
|
+
}));
|
|
1237
|
+
} catch {
|
|
1238
|
+
}
|
|
1239
|
+
};
|
|
1256
1240
|
const executeCopyOperation = async (positionX, positionY, operation) => {
|
|
1257
1241
|
setCopyStartX(positionX);
|
|
1258
1242
|
setCopyStartY(positionY);
|
|
@@ -1276,6 +1260,7 @@ ${context}
|
|
|
1276
1260
|
} catch {
|
|
1277
1261
|
}
|
|
1278
1262
|
showTemporarySuccessLabel(tagName ? `<${tagName}>` : "<element>", copyStartX(), copyStartY());
|
|
1263
|
+
notifyElementsSelected([targetElement2]);
|
|
1279
1264
|
};
|
|
1280
1265
|
const copyMultipleElementsToClipboard = async (targetElements) => {
|
|
1281
1266
|
if (targetElements.length === 0) return;
|
|
@@ -1284,8 +1269,7 @@ ${context}
|
|
|
1284
1269
|
}
|
|
1285
1270
|
try {
|
|
1286
1271
|
const elementSnippets = await Promise.all(targetElements.map((element) => getHTMLSnippet(element)));
|
|
1287
|
-
const
|
|
1288
|
-
const plainTextContent = wrapInSelectedElementTags(combinedContent);
|
|
1272
|
+
const plainTextContent = elementSnippets.filter((snippet) => snippet.trim()).map((snippet) => wrapInSelectedElementTags(snippet)).join("\n\n");
|
|
1289
1273
|
const structuredElements = elementSnippets.map((content, index) => ({
|
|
1290
1274
|
tagName: extractElementTagName(targetElements[index]),
|
|
1291
1275
|
content,
|
|
@@ -1296,6 +1280,7 @@ ${context}
|
|
|
1296
1280
|
} catch {
|
|
1297
1281
|
}
|
|
1298
1282
|
showTemporarySuccessLabel(`${targetElements.length} elements`, copyStartX(), copyStartY());
|
|
1283
|
+
notifyElementsSelected(targetElements);
|
|
1299
1284
|
};
|
|
1300
1285
|
const targetElement = createMemo(() => {
|
|
1301
1286
|
if (!isRendererActive() || isDragging()) return null;
|
|
@@ -1427,22 +1412,28 @@ ${context}
|
|
|
1427
1412
|
return;
|
|
1428
1413
|
}
|
|
1429
1414
|
if (isKeyboardEventTriggeredByInput(event)) return;
|
|
1430
|
-
if (isTargetKeyCombination(event))
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
holdTimerId = window.setTimeout(() => {
|
|
1435
|
-
activateRenderer();
|
|
1436
|
-
options.onActivate?.();
|
|
1437
|
-
}, options.keyHoldDuration);
|
|
1438
|
-
}
|
|
1439
|
-
if (isActivated()) {
|
|
1440
|
-
if (keydownSpamTimerId) window.clearTimeout(keydownSpamTimerId);
|
|
1441
|
-
keydownSpamTimerId = window.setTimeout(() => {
|
|
1442
|
-
deactivateRenderer();
|
|
1443
|
-
}, 200);
|
|
1415
|
+
if (!isTargetKeyCombination(event)) return;
|
|
1416
|
+
if (isActivated()) {
|
|
1417
|
+
if (keydownSpamTimerId !== null) {
|
|
1418
|
+
window.clearTimeout(keydownSpamTimerId);
|
|
1444
1419
|
}
|
|
1420
|
+
keydownSpamTimerId = window.setTimeout(() => {
|
|
1421
|
+
deactivateRenderer();
|
|
1422
|
+
}, 200);
|
|
1423
|
+
return;
|
|
1424
|
+
}
|
|
1425
|
+
if (event.repeat) return;
|
|
1426
|
+
if (holdTimerId !== null) {
|
|
1427
|
+
window.clearTimeout(holdTimerId);
|
|
1445
1428
|
}
|
|
1429
|
+
if (!isHoldingKeys()) {
|
|
1430
|
+
setIsHoldingKeys(true);
|
|
1431
|
+
}
|
|
1432
|
+
startProgressAnimation();
|
|
1433
|
+
holdTimerId = window.setTimeout(() => {
|
|
1434
|
+
activateRenderer();
|
|
1435
|
+
options.onActivate?.();
|
|
1436
|
+
}, options.keyHoldDuration);
|
|
1446
1437
|
}, {
|
|
1447
1438
|
signal: eventListenerSignal
|
|
1448
1439
|
});
|
|
@@ -1582,11 +1573,35 @@ ${context}
|
|
|
1582
1573
|
return crosshairVisible();
|
|
1583
1574
|
}
|
|
1584
1575
|
}), rendererRoot);
|
|
1585
|
-
return
|
|
1576
|
+
return {
|
|
1577
|
+
activate: () => {
|
|
1578
|
+
if (!isActivated()) {
|
|
1579
|
+
activateRenderer();
|
|
1580
|
+
options.onActivate?.();
|
|
1581
|
+
}
|
|
1582
|
+
},
|
|
1583
|
+
deactivate: () => {
|
|
1584
|
+
if (isActivated()) {
|
|
1585
|
+
deactivateRenderer();
|
|
1586
|
+
}
|
|
1587
|
+
},
|
|
1588
|
+
toggle: () => {
|
|
1589
|
+
if (isActivated()) {
|
|
1590
|
+
deactivateRenderer();
|
|
1591
|
+
} else {
|
|
1592
|
+
activateRenderer();
|
|
1593
|
+
options.onActivate?.();
|
|
1594
|
+
}
|
|
1595
|
+
},
|
|
1596
|
+
isActive: () => isActivated(),
|
|
1597
|
+
dispose
|
|
1598
|
+
};
|
|
1586
1599
|
});
|
|
1587
1600
|
};
|
|
1588
1601
|
|
|
1589
1602
|
// src/index.ts
|
|
1590
|
-
|
|
1603
|
+
var globalApi = null;
|
|
1604
|
+
var getGlobalApi = () => globalApi;
|
|
1605
|
+
globalApi = init();
|
|
1591
1606
|
|
|
1592
|
-
export { init };
|
|
1607
|
+
export { getGlobalApi, init };
|