react-grab 0.0.36 → 0.0.37
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 +111 -52
- package/dist/index.global.js +16 -16
- package/dist/index.js +111 -52
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -260,9 +260,10 @@ var getClampedElementPosition = (positionLeft, positionTop, elementWidth, elemen
|
|
|
260
260
|
// src/components/label.tsx
|
|
261
261
|
var _tmpl$3 = /* @__PURE__ */ web.template(`<span style=display:inline-block;margin-right:4px;font-weight:600>\u2713`);
|
|
262
262
|
var _tmpl$22 = /* @__PURE__ */ web.template(`<div style=margin-right:4px>Copied`);
|
|
263
|
-
var _tmpl$32 = /* @__PURE__ */ web.template(`<span style="font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;font-variant-numeric:tabular-nums">`);
|
|
264
|
-
var _tmpl$4 = /* @__PURE__ */ web.template(`<
|
|
265
|
-
var _tmpl$5 = /* @__PURE__ */ web.template(`<div style=
|
|
263
|
+
var _tmpl$32 = /* @__PURE__ */ web.template(`<span style="font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;font-variant-numeric:tabular-nums;vertical-align:middle">`);
|
|
264
|
+
var _tmpl$4 = /* @__PURE__ */ web.template(`<span style=font-variant-numeric:tabular-nums;font-size:10px;margin-left:4px;vertical-align:middle>`);
|
|
265
|
+
var _tmpl$5 = /* @__PURE__ */ web.template(`<div style=margin-left:4px>to clipboard`);
|
|
266
|
+
var _tmpl$6 = /* @__PURE__ */ web.template(`<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">`);
|
|
266
267
|
var Label = (props) => {
|
|
267
268
|
const [opacity, setOpacity] = solidJs.createSignal(0);
|
|
268
269
|
const [positionTick, setPositionTick] = solidJs.createSignal(0);
|
|
@@ -360,12 +361,26 @@ var Label = (props) => {
|
|
|
360
361
|
fallback.top += INDICATOR_CLAMP_PADDING_PX;
|
|
361
362
|
return fallback;
|
|
362
363
|
};
|
|
364
|
+
const labelSegments = () => {
|
|
365
|
+
const separator = " in ";
|
|
366
|
+
const separatorIndex = props.text.indexOf(separator);
|
|
367
|
+
if (separatorIndex === -1) {
|
|
368
|
+
return {
|
|
369
|
+
primary: props.text,
|
|
370
|
+
secondary: ""
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
return {
|
|
374
|
+
primary: props.text.slice(0, separatorIndex),
|
|
375
|
+
secondary: props.text.slice(separatorIndex)
|
|
376
|
+
};
|
|
377
|
+
};
|
|
363
378
|
return web.createComponent(solidJs.Show, {
|
|
364
379
|
get when() {
|
|
365
380
|
return props.visible !== false;
|
|
366
381
|
},
|
|
367
382
|
get children() {
|
|
368
|
-
var _el$ = _tmpl$
|
|
383
|
+
var _el$ = _tmpl$6();
|
|
369
384
|
var _ref$ = labelRef;
|
|
370
385
|
typeof _ref$ === "function" ? web.use(_ref$, _el$) : labelRef = _el$;
|
|
371
386
|
web.insert(_el$, web.createComponent(solidJs.Show, {
|
|
@@ -403,9 +418,20 @@ var Label = (props) => {
|
|
|
403
418
|
return props.variant !== "processing";
|
|
404
419
|
},
|
|
405
420
|
get children() {
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
421
|
+
return [(() => {
|
|
422
|
+
var _el$4 = _tmpl$32();
|
|
423
|
+
web.insert(_el$4, () => labelSegments().primary);
|
|
424
|
+
return _el$4;
|
|
425
|
+
})(), web.createComponent(solidJs.Show, {
|
|
426
|
+
get when() {
|
|
427
|
+
return web.memo(() => props.variant === "hover")() && labelSegments().secondary !== "";
|
|
428
|
+
},
|
|
429
|
+
get children() {
|
|
430
|
+
var _el$5 = _tmpl$4();
|
|
431
|
+
web.insert(_el$5, () => labelSegments().secondary);
|
|
432
|
+
return _el$5;
|
|
433
|
+
}
|
|
434
|
+
})];
|
|
409
435
|
}
|
|
410
436
|
}), null);
|
|
411
437
|
web.insert(_el$, web.createComponent(solidJs.Show, {
|
|
@@ -413,7 +439,7 @@ var Label = (props) => {
|
|
|
413
439
|
return props.variant === "success";
|
|
414
440
|
},
|
|
415
441
|
get children() {
|
|
416
|
-
return _tmpl$
|
|
442
|
+
return _tmpl$5();
|
|
417
443
|
}
|
|
418
444
|
}), null);
|
|
419
445
|
web.effect((_p$) => {
|
|
@@ -433,7 +459,7 @@ var Label = (props) => {
|
|
|
433
459
|
}
|
|
434
460
|
});
|
|
435
461
|
};
|
|
436
|
-
var _tmpl$
|
|
462
|
+
var _tmpl$7 = /* @__PURE__ */ web.template(`<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)">`);
|
|
437
463
|
var useFadeInOut = (visible) => {
|
|
438
464
|
const [opacity, setOpacity] = solidJs.createSignal(0);
|
|
439
465
|
solidJs.createEffect(solidJs.on(() => visible, (isVisible) => {
|
|
@@ -466,7 +492,7 @@ var ProgressIndicator = (props) => {
|
|
|
466
492
|
return props.visible !== false;
|
|
467
493
|
},
|
|
468
494
|
get children() {
|
|
469
|
-
var _el$ = _tmpl$
|
|
495
|
+
var _el$ = _tmpl$7(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild;
|
|
470
496
|
var _ref$ = progressIndicatorRef;
|
|
471
497
|
typeof _ref$ === "function" ? web.use(_ref$, _el$) : progressIndicatorRef = _el$;
|
|
472
498
|
web.effect((_p$) => {
|
|
@@ -486,7 +512,7 @@ var ProgressIndicator = (props) => {
|
|
|
486
512
|
}
|
|
487
513
|
});
|
|
488
514
|
};
|
|
489
|
-
var _tmpl$
|
|
515
|
+
var _tmpl$8 = /* @__PURE__ */ web.template(`<canvas style=position:fixed;top:0;left:0;pointer-events:none;z-index:2147483645>`);
|
|
490
516
|
var Crosshair = (props) => {
|
|
491
517
|
let canvasRef;
|
|
492
518
|
let context = null;
|
|
@@ -576,7 +602,7 @@ var Crosshair = (props) => {
|
|
|
576
602
|
return props.visible !== false;
|
|
577
603
|
},
|
|
578
604
|
get children() {
|
|
579
|
-
var _el$ = _tmpl$
|
|
605
|
+
var _el$ = _tmpl$8();
|
|
580
606
|
var _ref$ = canvasRef;
|
|
581
607
|
typeof _ref$ === "function" ? web.use(_ref$, _el$) : canvasRef = _el$;
|
|
582
608
|
return _el$;
|
|
@@ -708,6 +734,11 @@ var ReactGrabRenderer = (props) => {
|
|
|
708
734
|
}
|
|
709
735
|
})];
|
|
710
736
|
};
|
|
737
|
+
|
|
738
|
+
// src/utils/is-capitalized.ts
|
|
739
|
+
var isCapitalized = (value) => value.length > 0 && /^[A-Z]/.test(value);
|
|
740
|
+
|
|
741
|
+
// src/instrumentation.ts
|
|
711
742
|
bippy.instrument({
|
|
712
743
|
onCommitFiberRoot(_, fiberRoot) {
|
|
713
744
|
bippy._fiberRoots.add(fiberRoot);
|
|
@@ -716,40 +747,36 @@ bippy.instrument({
|
|
|
716
747
|
var generateCSSSelector = (element) => {
|
|
717
748
|
return finder.finder(element);
|
|
718
749
|
};
|
|
719
|
-
var
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
if (bippy.isCompositeFiber(currentFiber)) {
|
|
734
|
-
const displayName = bippy.getDisplayName(currentFiber);
|
|
735
|
-
if (displayName && !isInternalComponent(displayName)) {
|
|
736
|
-
componentName = displayName;
|
|
737
|
-
return true;
|
|
738
|
-
}
|
|
750
|
+
var truncateString = (string, maxLength) => string.length > maxLength ? `${string.substring(0, maxLength)}...` : string;
|
|
751
|
+
var isInternalComponent = (name) => !isCapitalized(name) || name.startsWith("_") || name.includes("Provider") && name.includes("Context");
|
|
752
|
+
var getNearestComponentDisplayName = (element) => {
|
|
753
|
+
const fiber = bippy.getFiberFromHostInstance(element);
|
|
754
|
+
if (!fiber) return null;
|
|
755
|
+
let componentName = null;
|
|
756
|
+
bippy.traverseFiber(
|
|
757
|
+
fiber,
|
|
758
|
+
(currentFiber) => {
|
|
759
|
+
if (bippy.isCompositeFiber(currentFiber)) {
|
|
760
|
+
const displayName = bippy.getDisplayName(currentFiber);
|
|
761
|
+
if (displayName && !isInternalComponent(displayName)) {
|
|
762
|
+
componentName = displayName;
|
|
763
|
+
return true;
|
|
739
764
|
}
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
}
|
|
765
|
+
}
|
|
766
|
+
return false;
|
|
767
|
+
},
|
|
768
|
+
true
|
|
769
|
+
);
|
|
770
|
+
return componentName;
|
|
771
|
+
};
|
|
772
|
+
var formatComponentSourceLocation = async (el) => {
|
|
773
|
+
const source$1 = await source.getSourceFromHostInstance(el);
|
|
774
|
+
if (!source$1) return null;
|
|
775
|
+
const fileName = source.normalizeFileName(source$1.fileName);
|
|
776
|
+
if (!source.isSourceFile(fileName)) return null;
|
|
777
|
+
return `${fileName}:${source$1.lineNumber}:${source$1.columnNumber}`;
|
|
778
|
+
};
|
|
779
|
+
var getHTMLSnippet = async (element) => {
|
|
753
780
|
const semanticTags = /* @__PURE__ */ new Set([
|
|
754
781
|
"article",
|
|
755
782
|
"aside",
|
|
@@ -838,9 +865,9 @@ var getHTMLSnippet = async (element) => {
|
|
|
838
865
|
lines.push("```html");
|
|
839
866
|
const ancestors = collectDistinguishingAncestors(element);
|
|
840
867
|
const ancestorComponents = ancestors.map(
|
|
841
|
-
(ancestor) =>
|
|
868
|
+
(ancestor) => getNearestComponentDisplayName(ancestor)
|
|
842
869
|
);
|
|
843
|
-
const elementComponent =
|
|
870
|
+
const elementComponent = getNearestComponentDisplayName(element);
|
|
844
871
|
const ancestorSources = await Promise.all(
|
|
845
872
|
ancestors.map((ancestor) => formatComponentSourceLocation(ancestor))
|
|
846
873
|
);
|
|
@@ -1231,6 +1258,33 @@ ${context}
|
|
|
1231
1258
|
});
|
|
1232
1259
|
};
|
|
1233
1260
|
const extractElementTagName = (element) => (element.tagName || "").toLowerCase();
|
|
1261
|
+
const extractNearestComponentName = (element) => {
|
|
1262
|
+
const fiber = bippy.getFiberFromHostInstance(element);
|
|
1263
|
+
if (!fiber) return null;
|
|
1264
|
+
let componentName = null;
|
|
1265
|
+
bippy.traverseFiber(fiber, (currentFiber) => {
|
|
1266
|
+
if (bippy.isCompositeFiber(currentFiber)) {
|
|
1267
|
+
const displayName = bippy.getDisplayName(currentFiber);
|
|
1268
|
+
if (displayName && isCapitalized(displayName) && !displayName.startsWith("_")) {
|
|
1269
|
+
componentName = displayName;
|
|
1270
|
+
return true;
|
|
1271
|
+
}
|
|
1272
|
+
}
|
|
1273
|
+
return false;
|
|
1274
|
+
}, true);
|
|
1275
|
+
return componentName;
|
|
1276
|
+
};
|
|
1277
|
+
const extractElementLabelText = (element) => {
|
|
1278
|
+
const tagName = extractElementTagName(element);
|
|
1279
|
+
const componentName = extractNearestComponentName(element);
|
|
1280
|
+
if (tagName && componentName) {
|
|
1281
|
+
return `<${tagName}> in ${componentName}`;
|
|
1282
|
+
}
|
|
1283
|
+
if (tagName) {
|
|
1284
|
+
return `<${tagName}>`;
|
|
1285
|
+
}
|
|
1286
|
+
return "<element>";
|
|
1287
|
+
};
|
|
1234
1288
|
const notifyElementsSelected = (elements) => {
|
|
1235
1289
|
try {
|
|
1236
1290
|
const elementsPayload = elements.map((element) => ({
|
|
@@ -1255,21 +1309,20 @@ ${context}
|
|
|
1255
1309
|
});
|
|
1256
1310
|
};
|
|
1257
1311
|
const copySingleElementToClipboard = async (targetElement2) => {
|
|
1258
|
-
const tagName = extractElementTagName(targetElement2);
|
|
1259
1312
|
showTemporaryGrabbedBox(createElementBounds(targetElement2));
|
|
1260
1313
|
await new Promise((resolve) => requestAnimationFrame(resolve));
|
|
1261
1314
|
try {
|
|
1262
1315
|
const content = await getHTMLSnippet(targetElement2);
|
|
1263
1316
|
const plainTextContent = wrapInSelectedElementTags(content);
|
|
1264
1317
|
const htmlContent = createStructuredClipboardHtmlBlob([{
|
|
1265
|
-
tagName,
|
|
1318
|
+
tagName: extractElementTagName(targetElement2),
|
|
1266
1319
|
content,
|
|
1267
1320
|
computedStyles: extractRelevantComputedStyles(targetElement2)
|
|
1268
1321
|
}]);
|
|
1269
1322
|
await copyContent([plainTextContent, htmlContent]);
|
|
1270
1323
|
} catch {
|
|
1271
1324
|
}
|
|
1272
|
-
showTemporarySuccessLabel(
|
|
1325
|
+
showTemporarySuccessLabel(extractElementLabelText(targetElement2), copyStartX(), copyStartY());
|
|
1273
1326
|
notifyElementsSelected([targetElement2]);
|
|
1274
1327
|
};
|
|
1275
1328
|
const copyMultipleElementsToClipboard = async (targetElements) => {
|
|
@@ -1347,7 +1400,7 @@ ${context}
|
|
|
1347
1400
|
});
|
|
1348
1401
|
const labelText = solidJs.createMemo(() => {
|
|
1349
1402
|
const element = targetElement();
|
|
1350
|
-
return element ?
|
|
1403
|
+
return element ? extractElementLabelText(element) : "<element>";
|
|
1351
1404
|
});
|
|
1352
1405
|
const labelPosition = solidJs.createMemo(() => isCopying() ? {
|
|
1353
1406
|
x: copyStartX(),
|
|
@@ -1374,7 +1427,13 @@ ${context}
|
|
|
1374
1427
|
progressTick();
|
|
1375
1428
|
if (startTime === null) return 0;
|
|
1376
1429
|
const elapsedTime = Date.now() - startTime;
|
|
1377
|
-
|
|
1430
|
+
const normalizedTime = elapsedTime / options.keyHoldDuration;
|
|
1431
|
+
const easedProgress = 1 - Math.exp(-normalizedTime);
|
|
1432
|
+
const maxProgressBeforeCompletion = 0.95;
|
|
1433
|
+
if (isCopying()) {
|
|
1434
|
+
return Math.min(easedProgress, maxProgressBeforeCompletion);
|
|
1435
|
+
}
|
|
1436
|
+
return 1;
|
|
1378
1437
|
});
|
|
1379
1438
|
const startProgressAnimation = () => {
|
|
1380
1439
|
setProgressStartTime(Date.now());
|
package/dist/index.global.js
CHANGED
|
@@ -6,25 +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 jr=(e,t)=>e===t;var Vr=Symbol("solid-track"),at={equals:jr},vn=_n,de=1,Ye=2,En={owned:null,cleanups:null,context:null,owner:null};var L=null,p=null,Me=null,V=null,K=null,te=null,ct=0;function ke(e,t){let n=V,r=L,o=e.length===0,i=t===void 0?r:t,s=o?En:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e(()=>le(()=>Ne(s)));L=s,V=null;try{return Ce(a,!0)}finally{V=n,L=r;}}function $(e,t){t=t?Object.assign({},at,t):at;let n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(o=o(n.value)),Nn(n,o));return [On.bind(n),r]}function ce(e,t,n){let r=$t(e,t,false,de);ze(r);}function ne(e,t,n){vn=qr;let r=$t(e,t,false,de);(r.user=true),te?te.push(r):ze(r);}function Y(e,t,n){n=n?Object.assign({},at,n):at;let r=$t(e,t,true,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,ze(r),On.bind(r)}function le(e){if(V===null)return e();let t=V;V=null;try{return Me?Me.untrack(e):e()}finally{V=t;}}function _e(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=le(()=>t(a,o,s));return o=a,l}}function Rn(e){ne(()=>le(e));}function me(e){return L===null||(L.cleanups===null?L.cleanups=[e]:L.cleanups.push(e)),e}$(false);function On(){let e=p;if(this.sources&&(this.state))if((this.state)===de)ze(this);else {let t=K;K=null,Ce(()=>lt(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&&p.sources.has(this)?this.tValue:this.value}function Nn(e,t,n){let r=e.value;if(!e.comparator||!e.comparator(r,t)){e.value=t;e.observers&&e.observers.length&&Ce(()=>{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):te.push(i),i.observers&&An(i)),s?i.tState=de:i.state=de);}if(K.length>1e6)throw K=[],new Error},false);}return t}function ze(e){if(!e.fn)return;Ne(e);let t=ct;Tn(e,e.value,t);}function Tn(e,t,n){let r,o=L,i=V;V=L=e;try{r=e.fn(t);}catch(s){return e.pure&&((e.state=de,e.owned&&e.owned.forEach(Ne),e.owned=null)),e.updatedAt=n+1,kt(s)}finally{V=i,L=o;}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?Nn(e,r):e.value=r,e.updatedAt=n);}function $t(e,t,n,r=de,o){let i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:L,context:L?L.context:null,pure:n};if(L===null||L!==En&&(L.owned?L.owned.push(i):L.owned=[i]),Me);return i}function Ge(e){let t=p;if((e.state)===0)return;if((e.state)===Ye)return lt(e);if(e.suspense&&le(e.suspense.inFallback))return e.suspense.effects.push(e);let n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<ct);){(e.state)&&n.push(e);}for(let r=n.length-1;r>=0;r--){if(e=n[r],t);if((e.state)===de)ze(e);else if((e.state)===Ye){let o=K;K=null,Ce(()=>lt(e,n[0]),false),K=o;}}}function Ce(e,t){if(K)return e();let n=false;t||(K=[]),te?n=true:te=[],ct++;try{let r=e();return Ur(n),r}catch(r){n||(te=null),K=null,kt(r);}}function Ur(e){if(K&&(_n(K),K=null),e)return;let n=te;te=null,n.length&&Ce(()=>vn(n),false);}function _n(e){for(let t=0;t<e.length;t++)Ge(e[t]);}function qr(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 lt(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===de?o!==t&&(!o.updatedAt||o.updatedAt<ct)&&Ge(o):i===Ye&<(o,t);}}}function An(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):te.push(r),r.observers&&An(r));}}function Ne(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--)Ne(e.tOwned[t]);delete e.tOwned;}if(e.owned){for(t=e.owned.length-1;t>=0;t--)Ne(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 Xr(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function kt(e,t=L){let r=Xr(e);throw r;}var Wr=Symbol("fallback");function xn(e){for(let t=0;t<e.length;t++)e[t]();}function Kr(e,t,n={}){let r=[],o=[],i=[],s=0,a=t.length>1?[]:null;return me(()=>xn(i)),()=>{let l=e()||[],f=l.length,h,g;return l[Vr],le(()=>{let x,S,C,R,T,A,O,_,N;if(f===0)s!==0&&(xn(i),i=[],r=[],o=[],s=0,a&&(a=[])),n.fallback&&(r=[Wr],o[0]=ke(D=>(i[0]=D,n.fallback())),s=1);else if(s===0){for(o=new Array(f),g=0;g<f;g++)r[g]=l[g],o[g]=ke(b);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,_=f-1;O>=A&&_>=A&&r[O]===l[_];O--,_--)C[_]=o[O],R[_]=i[O],a&&(T[_]=a[O]);for(x=new Map,S=new Array(_+1),g=_;g>=A;g--)N=l[g],h=x.get(N),S[g]=h===void 0?-1:h,x.set(N,g);for(h=A;h<=O;h++)N=r[h],g=x.get(N),g!==void 0&&g!==-1?(C[g]=o[h],R[g]=i[h],a&&(T[g]=a[h]),g=S[g],x.set(N,g)):i[h]();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]=ke(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 I(e,t){return le(()=>e(t||{}))}var Jr=e=>`Stale read from <${e}>.`;function ut(e){let t="fallback"in e&&{fallback:()=>e.fallback};return Y(Kr(()=>e.each,e.children,t||void 0))}function q(e){let t=e.keyed,n=Y(()=>e.when,void 0,void 0),r=t?n:Y(n,void 0,{equals:(o,i)=>!o==!i});return Y(()=>{let o=r();if(o){let i=e.children;return typeof i=="function"&&i.length>0?le(()=>i(t?o:()=>{if(!le(r))throw Jr("Show");return n()})):i}return e.fallback},void 0,void 0)}var Le=e=>Y(()=>e());function to(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 h=i<r?a?n[a-1].nextSibling:n[i-a]:l;for(;a<i;)e.insertBefore(n[a++],h);}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 h=t[--o].nextSibling;e.insertBefore(n[a++],t[s++].nextSibling),e.insertBefore(n[--i],h),t[o]=n[i];}else {if(!f){f=new Map;let g=a;for(;g<i;)f.set(n[g],g++);}let h=f.get(t[s]);if(h!=null)if(a<h&&h<i){let g=s,b=1,x;for(;++g<o&&g<i&&!((x=f.get(t[g]))==null||x!==h+b);)b++;if(b>h-a){let S=t[s];for(;a<h;)e.insertBefore(n[a++],S);}else e.replaceChild(n[a++],t[s++]);}else s++;else t[s++].remove();}}}function kn(e,t,n,r={}){let o;return ke(i=>{o=i,t===document?e():xe(t,e(),t.firstChild?null:void 0,n);},r.owner),()=>{o(),t.textContent="";}}function ie(e,t,n,r){let o,i=()=>{let a=document.createElement("template");return a.innerHTML=e,a.content.firstChild},s=()=>(o||(o=i())).cloneNode(true);return s.cloneNode=s,s}function no(e,t,n){(e.removeAttribute(t));}function dt(e,t,n){if(!t)return n?no(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 ye(e,t,n){n!=null?e.style.setProperty(t,n):e.style.removeProperty(t);}function Ae(e,t,n){return le(()=>e(t,n))}function xe(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return ft(e,t,r,n);ce(o=>ft(e,t(),o,n),r);}function ft(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=Pe(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=Pe(e,n,r);}else {if(s==="function")return ce(()=>{let l=t();for(;typeof l=="function";)l=l();n=ft(e,l,n,r);}),()=>n;if(Array.isArray(t)){let l=[],f=n&&Array.isArray(n);if(It(l,t,n,o))return ce(()=>n=ft(e,l,n,r,true)),()=>n;if(l.length===0){if(n=Pe(e,n,r),a)return n}else f?n.length===0?$n(e,l,r):to(e,n,l):(n&&Pe(e),$n(e,l));n=l;}else if(t.nodeType){if(Array.isArray(n)){if(a)return n=Pe(e,n,r,t);Pe(e,n,null,t);}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t;}}return n}function It(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=It(e,a,l)||o;else if(f==="function")if(r){for(;typeof a=="function";)a=a();o=It(e,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||o;}else e.push(a),o=true;else {let h=String(a);l&&l.nodeType===3&&l.data===h?e.push(l):e.push(document.createTextNode(h));}}return o}function $n(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n);}function Pe(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 ro=["input","textarea","select","searchbox","slider","spinbutton","menuitem","menuitemcheckbox","menuitemradio","option","radio","textbox"],oo=e=>!!e.tagName&&!e.tagName.startsWith("-")&&e.tagName.includes("-"),io=e=>Array.isArray(e),so=(e,t=false)=>{let{composed:n,target:r}=e,o,i;if(r instanceof HTMLElement&&oo(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 io(t)?!!(o&&t&&t.some(s=>typeof o=="string"&&s.toLowerCase()===o.toLowerCase()||s===i)):!!(o&&t&&t)},Mn=e=>so(e,ro);var De="data-react-grab",Pn=()=>{let e=document.querySelector(`[${De}]`);if(e){let i=e.shadowRoot?.querySelector(`[${De}]`);if(i instanceof HTMLDivElement&&e.shadowRoot)return i}let t=document.createElement("div");t.setAttribute(De,"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(De,"true"),n.appendChild(r),(document.body??document.documentElement).appendChild(t),r};var ge=(e,t,n)=>e+(t-e)*n;var lo=ie("<div>"),mt=e=>{let[t,n]=$(e.bounds.x),[r,o]=$(e.bounds.y),[i,s]=$(e.bounds.width),[a,l]=$(e.bounds.height),[f,h]=$(1),g=false,b=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 _=()=>{let N=ge(t(),S.x,R()),D=ge(r(),S.y,R()),re=ge(i(),S.width,R()),se=ge(a(),S.height,R());n(N),o(D),s(re),l(se),Math.abs(N-S.x)<.5&&Math.abs(D-S.y)<.5&&Math.abs(re-S.width)<.5&&Math.abs(se-S.height)<.5?(b=null,C=false):b=requestAnimationFrame(_);};b=requestAnimationFrame(_);};ne(_e(()=>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(()=>{h(0);},1500));}),me(()=>{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"},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 I(q,{get when(){return e.visible!==false},get children(){var _=lo();return ce(N=>dt(_,{...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 co=ie('<span style="display:inline-block;width:8px;height:8px;border:1.5px solid rgb(210, 57, 192);border-top-color:transparent;border-radius:50%;margin-right:4px;vertical-align:middle">'),Ln=e=>{let t;return Rn(()=>{t&&t.animate([{transform:"rotate(0deg)"},{transform:"rotate(360deg)"}],{duration:600,easing:"linear",iterations:1/0});}),(()=>{var n=co(),r=t;return typeof r=="function"?Ae(r,n):t=n,ce(o=>dt(n,{...e.style},o)),n})()};var ht=(e,t,n,r)=>{let o=window.innerWidth,i=window.innerHeight,s=8,a=8,l=o-n-8,f=i-r-8,h=Math.max(s,Math.min(e,l)),g=Math.max(a,Math.min(t,f));return {left:h,top:g}};var uo=ie("<span style=display:inline-block;margin-right:4px;font-weight:600>\u2713"),fo=ie("<div style=margin-right:4px>Copied"),mo=ie(`<span style="font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;font-variant-numeric:tabular-nums">`),ho=ie("<div style=margin-left:4px>to clipboard"),go=ie(`<div style="position:fixed;padding:2px 6px;background-color:#fde7f7;color:#b21c8e;border:1px solid #f7c5ec;border-radius:4px;font-size:11px;font-weight:500;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;pointer-events:none;transition:opacity 0.2s ease-in-out;display:flex;align-items:center;max-width:calc(100vw - (16px + env(safe-area-inset-left) + env(safe-area-inset-right)));overflow:hidden;text-overflow:ellipsis;white-space:nowrap">`),Mt=e=>{let[t,n]=$(0),[r,o]=$(0),i,s=e.x,a=e.y,l=e.x,f=e.y,h=null,g=false,b=()=>{s=ge(s,l,.3),a=ge(a,f,.3),o(A=>A+1),Math.abs(s-l)<.5&&Math.abs(a-f)<.5?h=null:h=requestAnimationFrame(b);},x=()=>{h===null&&(h=requestAnimationFrame(b));},S=()=>{if(l=e.x,f=e.y,!g){s=l,a=f,g=true,o(T=>T+1);return}x();};ne(_e(()=>e.visible,T=>{if(T!==false)requestAnimationFrame(()=>{n(1);});else {n(0);return}if(e.variant==="success"){let A=setTimeout(()=>{n(0);},1700);me(()=>clearTimeout(A));}})),ne(()=>{S();}),me(()=>{h!==null&&(cancelAnimationFrame(h),h=null);});let C=()=>i?.getBoundingClientRect(),R=()=>{r();let T=C();if(!T)return {left:s,top:a};let A=window.innerWidth,O=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 D of _){let re=D.left>=8&&D.left+T.width<=A-8,se=D.top>=8&&D.top+T.height<=O-8;if(re&&se)return D}let N=ht(_[0].left,_[0].top,T.width,T.height);return N.left+=4,N.top+=4,N};return I(q,{get when(){return e.visible!==false},get children(){var T=go(),A=i;return typeof A=="function"?Ae(A,T):i=T,xe(T,I(q,{get when(){return e.variant==="processing"},get children(){return I(Ln,{})}}),null),xe(T,I(q,{get when(){return e.variant==="success"},get children(){return uo()}}),null),xe(T,I(q,{get when(){return e.variant==="success"},get children(){return fo()}}),null),xe(T,I(q,{get when(){return e.variant==="processing"},children:"Grabbing\u2026"}),null),xe(T,I(q,{get when(){return e.variant!=="processing"},get children(){var O=mo();return xe(O,()=>e.text),O}}),null),xe(T,I(q,{get when(){return e.variant==="success"},get children(){return ho()}}),null),ce(O=>{var _=`${R().top}px`,N=`${R().left}px`,D=e.zIndex?.toString()??"2147483647",re=t();return _!==O.e&&ye(T,"top",O.e=_),N!==O.t&&ye(T,"left",O.t=N),D!==O.a&&ye(T,"z-index",O.a=D),re!==O.o&&ye(T,"opacity",O.o=re),O},{e:void 0,t:void 0,a:void 0,o:void 0}),T}})};var po=ie('<div style="position:fixed;z-index:2147483647;pointer-events:none;transition:opacity 0.1s ease-in-out"><div style="width:32px;height:2px;background-color:rgba(178, 28, 142, 0.2);border-radius:1px;overflow:hidden;position:relative"><div style="height:100%;background-color:#b21c8e;border-radius:1px;transition:width 0.05s cubic-bezier(0.165, 0.84, 0.44, 1)">'),bo=e=>{let[t,n]=$(0);return ne(_e(()=>e,r=>{r!==false?requestAnimationFrame(()=>{n(1);}):n(0);})),t},Hn=e=>{let t=bo(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 ht(s,a,o.width,o.height)};return I(q,{get when(){return e.visible!==false},get children(){var o=po(),i=o.firstChild,s=i.firstChild,a=n;return typeof a=="function"?Ae(a,o):n=o,ce(l=>{var f=`${r().top}px`,h=`${r().left}px`,g=t(),b=`${Math.min(100,Math.max(0,e.progress*100))}%`;return f!==l.e&&ye(o,"top",l.e=f),h!==l.t&&ye(o,"left",l.t=h),g!==l.a&&ye(o,"opacity",l.a=g),b!==l.o&&ye(s,"width",l.o=b),l},{e:void 0,t:void 0,a:void 0,o:void 0}),o}})};var yo=ie("<canvas style=position:fixed;top:0;left:0;pointer-events:none;z-index:2147483645>"),Bn=e=>{let t,n=null,r=0,o=0,i=1,s=e.mouseX,a=e.mouseY,l=e.mouseX,f=e.mouseY,h=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=ge(s,l,.3),a=ge(a,f,.3),x(),Math.abs(s-l)<.5&&Math.abs(a-f)<.5?h=null:h=requestAnimationFrame(S);},C=()=>{h===null&&(h=requestAnimationFrame(S));},R=()=>{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),me(()=>{window.removeEventListener("resize",T),h!==null&&(cancelAnimationFrame(h),h=null);});}),ne(()=>{R();}),I(q,{get when(){return e.visible!==false},get children(){var T=yo(),A=t;return typeof A=="function"?Ae(A,T):t=T,T}})};var jn=e=>[I(q,{get when(){return Le(()=>!!e.selectionVisible)()&&e.selectionBounds},get children(){return I(mt,{variant:"selection",get bounds(){return e.selectionBounds},get visible(){return e.selectionVisible}})}}),I(q,{get when(){return Le(()=>e.crosshairVisible===true&&e.mouseX!==void 0)()&&e.mouseY!==void 0},get children(){return I(Bn,{get mouseX(){return e.mouseX},get mouseY(){return e.mouseY},visible:true})}}),I(q,{get when(){return Le(()=>!!e.dragVisible)()&&e.dragBounds},get children(){return I(mt,{variant:"drag",get bounds(){return e.dragBounds},get visible(){return e.dragVisible}})}}),I(ut,{get each(){return e.grabbedBoxes??[]},children:t=>I(mt,{variant:"grabbed",get bounds(){return t.bounds},get createdAt(){return t.createdAt}})}),I(ut,{get each(){return e.successLabels??[]},children:t=>I(Mt,{variant:"success",get text(){return t.text},get x(){return t.x},get y(){return t.y}})}),I(q,{get when(){return Le(()=>!!(e.labelVisible&&e.labelVariant&&e.labelText&&e.labelX!==void 0))()&&e.labelY!==void 0},get children(){return I(Mt,{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}})}}),I(q,{get when(){return Le(()=>!!(e.progressVisible&&e.progress!==void 0&&e.mouseX!==void 0))()&&e.mouseY!==void 0},get children(){return I(Hn,{get progress(){return e.progress},get mouseX(){return e.mouseX},get mouseY(){return e.mouseY},get visible(){return e.progressVisible}})}})];var Gn="0.5.14",Xe=`bippy-${Gn}`,Vn=Object.defineProperty,wo=Object.prototype.hasOwnProperty,qe=()=>{},Un=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{}},Pt=(e=ve())=>"getFiberRoots"in e,zn=false,Yn,bt=(e=ve())=>zn?true:(typeof e.inject=="function"&&(Yn=e.inject.toString()),!!Yn?.includes("(injected)")),pt=new Set,Ie=new Set,qn=e=>{let t=new Map,n=0,r={_instrumentationIsActive:false,_instrumentationSource:Xe,checkDCE:Un,hasUnsupportedRendererAttached:false,inject(o){let i=++n;return t.set(i,o),Ie.add(o),r._instrumentationIsActive||(r._instrumentationIsActive=true,pt.forEach(s=>s())),i},on:qe,onCommitFiberRoot:qe,onCommitFiberUnmount:qe,onPostCommitFiberRoot:qe,renderers:t,supportsFiber:true,supportsFlight:true};try{Vn(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)=>{Ie.add(l),s.renderers.set(f,l);}),yt(e));}}});let o=window.hasOwnProperty,i=!1;Vn(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{yt(e);}return r},yt=e=>{e&&pt.add(e);try{let t=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!t)return;if(!t._instrumentationSource){t.checkDCE=Un,t.supportsFiber=!0,t.supportsFlight=!0,t.hasUnsupportedRendererAttached=!1,t._instrumentationSource=Xe,t._instrumentationIsActive=!1;let n=Pt(t);if(n||(t.on=qe),t.renderers.size){t._instrumentationIsActive=!0,pt.forEach(i=>i());return}let r=t.inject,o=bt(t);o&&!n&&(zn=!0,t.inject({scheduleRefresh(){}})&&(t._instrumentationIsActive=!0)),t.inject=i=>{let s=r(i);return Ie.add(i),o&&t.renderers.set(s,i),t._instrumentationIsActive=!0,pt.forEach(a=>a()),s};}(t.renderers.size||t._instrumentationIsActive||bt())&&e?.();}catch{}},Lt=()=>wo.call(globalThis,"__REACT_DEVTOOLS_GLOBAL_HOOK__"),ve=e=>Lt()?(yt(e),globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__):qn(e),Xn=()=>!!(typeof window<"u"&&(window.document?.createElement||window.navigator?.product==="ReactNative")),Dt=()=>{try{Xn()&&ve();}catch{}};Dt();var wt=0,St=1;var Tt=5;var Ct=11,Ht=13,Wn=14,xt=15,Bt=16;var jt=19;var vt=26,Et=27,Vt=28,Yt=30;var Gt=e=>{switch(e.tag){case Tt:case vt:case Et:return true;default:return typeof e.type=="string"}},We=e=>{switch(e.tag){case St:case Ct:case wt:case Wn:case xt:return true;default:return false}};function He(e,t,n=false){return e&&t(e)instanceof Promise?zt(e,t,n):Ut(e,t,n)}var Ut=(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=Ut(r,t,n);if(o)return o;r=n?null:r.sibling;}return null},zt=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 zt(r,t,n);if(o)return o;r=n?null:r.sibling;}return null};var qt=e=>{let t=e;return typeof t=="function"?t:typeof t=="object"&&t?qt(t.type||t.render):null},Be=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=qt(t);return r&&(r.displayName||r.name)||null};var Xt=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 Rt){let r=He(n.current,o=>{if(o===e)return true});if(r)return r}return e};var Wt=e=>{let t=ve(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=ve();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},Rt=new Set;var No=Object.create,rr=Object.defineProperty,_o=Object.getOwnPropertyDescriptor,Ao=Object.getOwnPropertyNames,Fo=Object.getPrototypeOf,$o=Object.prototype.hasOwnProperty,ko=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Io=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=Ao(t),i=0,s=o.length,a;i<s;i++)a=o[i],!$o.call(e,a)&&a!==n&&rr(e,a,{get:(l=>t[l]).bind(null,a),enumerable:!(r=_o(t,a))||r.enumerable});return e},Mo=(e,t,n)=>(n=e==null?{}:No(Fo(e)),Io(rr(n,"default",{value:e,enumerable:true}),e)),Po=()=>{let e=ve();for(let t of [...Array.from(Ie),...Array.from(e.renderers.values())]){let n=t.currentDispatcherRef;if(n&&typeof n=="object")return "H"in n?n.H:n.current}return null},Kn=e=>{for(let t of Ie){let n=t.currentDispatcherRef;n&&typeof n=="object"&&("H"in n?n.H=e:n.current=e);}},Ee=e=>`
|
|
10
|
-
in ${e}`,
|
|
11
|
-
`),
|
|
12
|
-
`),
|
|
13
|
-
${
|
|
9
|
+
var qr=(e,t)=>e===t;var Xr=Symbol("solid-track"),at={equals:qr},Nn=$n,me=1,ze=2,On={owned:null,cleanups:null,context:null,owner:null};var L=null,p=null,Be=null,G=null,te=null,ie=null,ct=0;function Pe(e,t){let n=G,r=L,o=e.length===0,i=t===void 0?r:t,s=o?On:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e(()=>ue(()=>Oe(s)));L=s,G=null;try{return ve(a,!0)}finally{G=n,L=r;}}function k(e,t){t=t?Object.assign({},at,t):at;let n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(o=o(n.value)),Fn(n,o));return [An.bind(n),r]}function fe(e,t,n){let r=It(e,t,false,me);Xe(r);}function se(e,t,n){Nn=Qr;let r=It(e,t,false,me);(r.user=true),ie?ie.push(r):Xe(r);}function U(e,t,n){n=n?Object.assign({},at,n):at;let r=It(e,t,true,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,Xe(r),An.bind(r)}function ue(e){if(G===null)return e();let t=G;G=null;try{return Be?Be.untrack(e):e()}finally{G=t;}}function _e(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=ue(()=>t(a,o,s));return o=a,l}}function _n(e){se(()=>ue(e));}function he(e){return L===null||(L.cleanups===null?L.cleanups=[e]:L.cleanups.push(e)),e}k(false);function An(){let e=p;if(this.sources&&(this.state))if((this.state)===me)Xe(this);else {let t=te;te=null,ve(()=>lt(this),false),te=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 Fn(e,t,n){let r=e.value;if(!e.comparator||!e.comparator(r,t)){e.value=t;e.observers&&e.observers.length&&ve(()=>{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?te.push(i):ie.push(i),i.observers&&kn(i)),s?i.tState=me:i.state=me);}if(te.length>1e6)throw te=[],new Error},false);}return t}function Xe(e){if(!e.fn)return;Oe(e);let t=ct;vn(e,e.value,t);}function vn(e,t,n){let r,o=L,i=G;G=L=e;try{r=e.fn(t);}catch(s){return e.pure&&((e.state=me,e.owned&&e.owned.forEach(Oe),e.owned=null)),e.updatedAt=n+1,Mt(s)}finally{G=i,L=o;}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?Fn(e,r):e.value=r,e.updatedAt=n);}function It(e,t,n,r=me,o){let i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:L,context:L?L.context:null,pure:n};if(L===null||L!==On&&(L.owned?L.owned.push(i):L.owned=[i]),Be);return i}function Ue(e){let t=p;if((e.state)===0)return;if((e.state)===ze)return lt(e);if(e.suspense&&ue(e.suspense.inFallback))return e.suspense.effects.push(e);let n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<ct);){(e.state)&&n.push(e);}for(let r=n.length-1;r>=0;r--){if(e=n[r],t);if((e.state)===me)Xe(e);else if((e.state)===ze){let o=te;te=null,ve(()=>lt(e,n[0]),false),te=o;}}}function ve(e,t){if(te)return e();let n=false;t||(te=[]),ie?n=true:ie=[],ct++;try{let r=e();return Zr(n),r}catch(r){n||(ie=null),te=null,Mt(r);}}function Zr(e){if(te&&($n(te),te=null),e)return;let n=ie;ie=null,n.length&&ve(()=>Nn(n),false);}function $n(e){for(let t=0;t<e.length;t++)Ue(e[t]);}function Qr(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 lt(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===me?o!==t&&(!o.updatedAt||o.updatedAt<ct)&&Ue(o):i===ze&<(o,t);}}}function kn(e){for(let n=0;n<e.observers.length;n+=1){let r=e.observers[n];(!r.state)&&(r.state=ze,r.pure?te.push(r):ie.push(r),r.observers&&kn(r));}}function Oe(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--)Oe(e.tOwned[t]);delete e.tOwned;}if(e.owned){for(t=e.owned.length-1;t>=0;t--)Oe(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 eo(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function Mt(e,t=L){let r=eo(e);throw r;}var to=Symbol("fallback");function Rn(e){for(let t=0;t<e.length;t++)e[t]();}function no(e,t,n={}){let r=[],o=[],i=[],s=0,a=t.length>1?[]:null;return he(()=>Rn(i)),()=>{let l=e()||[],f=l.length,d,m;return l[Xr],ue(()=>{let C,w,E,O,N,S,$,R,P;if(f===0)s!==0&&(Rn(i),i=[],r=[],o=[],s=0,a&&(a=[])),n.fallback&&(r=[to],o[0]=Pe(z=>(i[0]=z,n.fallback())),s=1);else if(s===0){for(o=new Array(f),m=0;m<f;m++)r[m]=l[m],o[m]=Pe(x);s=f;}else {for(E=new Array(f),O=new Array(f),a&&(N=new Array(f)),S=0,$=Math.min(s,f);S<$&&r[S]===l[S];S++);for($=s-1,R=f-1;$>=S&&R>=S&&r[$]===l[R];$--,R--)E[R]=o[$],O[R]=i[$],a&&(N[R]=a[$]);for(C=new Map,w=new Array(R+1),m=R;m>=S;m--)P=l[m],d=C.get(P),w[m]=d===void 0?-1:d,C.set(P,m);for(d=S;d<=$;d++)P=r[d],m=C.get(P),m!==void 0&&m!==-1?(E[m]=o[d],O[m]=i[d],a&&(N[m]=a[d]),m=w[m],C.set(P,m)):i[d]();for(m=S;m<f;m++)m in E?(o[m]=E[m],i[m]=O[m],a&&(a[m]=N[m],a[m](m))):o[m]=Pe(x);o=o.slice(0,s=f),r=l.slice(0);}return o});function x(C){if(i[m]=C,a){let[w,E]=k(m);return a[m]=E,t(l[m],w)}return t(l[m])}}}function I(e,t){return ue(()=>e(t||{}))}var oo=e=>`Stale read from <${e}>.`;function ut(e){let t="fallback"in e&&{fallback:()=>e.fallback};return U(no(()=>e.each,e.children,t||void 0))}function J(e){let t=e.keyed,n=U(()=>e.when,void 0,void 0),r=t?n:U(n,void 0,{equals:(o,i)=>!o==!i});return U(()=>{let o=r();if(o){let i=e.children;return typeof i=="function"&&i.length>0?ue(()=>i(t?o:()=>{if(!ue(r))throw oo("Show");return n()})):i}return e.fallback},void 0,void 0)}var Ae=e=>U(()=>e());function ao(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 m=a;for(;m<i;)f.set(n[m],m++);}let d=f.get(t[s]);if(d!=null)if(a<d&&d<i){let m=s,x=1,C;for(;++m<o&&m<i&&!((C=f.get(t[m]))==null||C!==d+x);)x++;if(x>d-a){let w=t[s];for(;a<d;)e.insertBefore(n[a++],w);}else e.replaceChild(n[a++],t[s++]);}else s++;else t[s++].remove();}}}function Pn(e,t,n,r={}){let o;return Pe(i=>{o=i,t===document?e():Se(t,e(),t.firstChild?null:void 0,n);},r.owner),()=>{o(),t.textContent="";}}function ae(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 lo(e,t,n){(e.removeAttribute(t));}function dt(e,t,n){if(!t)return n?lo(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 we(e,t,n){n!=null?e.style.setProperty(t,n):e.style.removeProperty(t);}function Fe(e,t,n){return ue(()=>e(t,n))}function Se(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return ft(e,t,r,n);fe(o=>ft(e,t(),o,n),r);}function ft(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=je(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=je(e,n,r);}else {if(s==="function")return fe(()=>{let l=t();for(;typeof l=="function";)l=l();n=ft(e,l,n,r);}),()=>n;if(Array.isArray(t)){let l=[],f=n&&Array.isArray(n);if(Pt(l,t,n,o))return fe(()=>n=ft(e,l,n,r,true)),()=>n;if(l.length===0){if(n=je(e,n,r),a)return n}else f?n.length===0?Mn(e,l,r):ao(e,n,l):(n&&je(e),Mn(e,l));n=l;}else if(t.nodeType){if(Array.isArray(n)){if(a)return n=je(e,n,r,t);je(e,n,null,t);}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t;}}return n}function Pt(e,t,n,r){let o=false;for(let i=0,s=t.length;i<s;i++){let a=t[i],l=n&&n[e.length],f;if(!(a==null||a===true||a===false))if((f=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))o=Pt(e,a,l)||o;else if(f==="function")if(r){for(;typeof a=="function";)a=a();o=Pt(e,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||o;}else e.push(a),o=true;else {let d=String(a);l&&l.nodeType===3&&l.data===d?e.push(l):e.push(document.createTextNode(d));}}return o}function Mn(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n);}function je(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 co=["input","textarea","select","searchbox","slider","spinbutton","menuitem","menuitemcheckbox","menuitemradio","option","radio","textbox"],uo=e=>!!e.tagName&&!e.tagName.startsWith("-")&&e.tagName.includes("-"),fo=e=>Array.isArray(e),mo=(e,t=false)=>{let{composed:n,target:r}=e,o,i;if(r instanceof HTMLElement&&uo(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 fo(t)?!!(o&&t&&t.some(s=>typeof o=="string"&&s.toLowerCase()===o.toLowerCase()||s===i)):!!(o&&t&&t)},Dn=e=>mo(e,co);var Ve="data-react-grab",Hn=()=>{let e=document.querySelector(`[${Ve}]`);if(e){let i=e.shadowRoot?.querySelector(`[${Ve}]`);if(i instanceof HTMLDivElement&&e.shadowRoot)return i}let t=document.createElement("div");t.setAttribute(Ve,"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(Ve,"true"),n.appendChild(r),(document.body??document.documentElement).appendChild(t),r};var pe=(e,t,n)=>e+(t-e)*n;var go=ae("<div>"),mt=e=>{let[t,n]=k(e.bounds.x),[r,o]=k(e.bounds.y),[i,s]=k(e.bounds.width),[a,l]=k(e.bounds.height),[f,d]=k(1),m=false,x=null,C=null,w=e.bounds,E=false,O=()=>e.lerpFactor!==void 0?e.lerpFactor:e.variant==="drag"?.7:.95,N=()=>{if(E)return;E=true;let R=()=>{let P=pe(t(),w.x,O()),z=pe(r(),w.y,O()),K=pe(i(),w.width,O()),y=pe(a(),w.height,O());n(P),o(z),s(K),l(y),Math.abs(P-w.x)<.5&&Math.abs(z-w.y)<.5&&Math.abs(K-w.width)<.5&&Math.abs(y-w.height)<.5?(x=null,E=false):x=requestAnimationFrame(R);};x=requestAnimationFrame(R);};se(_e(()=>e.bounds,R=>{if(w=R,!m){n(w.x),o(w.y),s(w.width),l(w.height),m=true;return}N();})),se(()=>{e.variant==="grabbed"&&e.createdAt&&(C=window.setTimeout(()=>{d(0);},1500));}),he(()=>{x!==null&&(cancelAnimationFrame(x),x=null),C!==null&&(window.clearTimeout(C),C=null),E=false;});let S={position:"fixed","box-sizing":"border-box","pointer-events":e.variant==="drag"?"none":"auto","z-index":"2147483646"},$=()=>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 I(J,{get when(){return e.visible!==false},get children(){var R=go();return fe(P=>dt(R,{...S,...$(),top:`${r()}px`,left:`${t()}px`,width:`${i()}px`,height:`${a()}px`,"border-radius":e.bounds.borderRadius,transform:e.bounds.transform,opacity:f()},P)),R}})};var po=ae('<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">'),Bn=e=>{let t;return _n(()=>{t&&t.animate([{transform:"rotate(0deg)"},{transform:"rotate(360deg)"}],{duration:600,easing:"linear",iterations:1/0});}),(()=>{var n=po(),r=t;return typeof r=="function"?Fe(r,n):t=n,fe(o=>dt(n,{...e.style},o)),n})()};var ht=(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)),m=Math.max(a,Math.min(t,f));return {left:d,top:m}};var bo=ae("<span style=display:inline-block;margin-right:4px;font-weight:600>\u2713"),yo=ae("<div style=margin-right:4px>Copied"),wo=ae(`<span style="font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;font-variant-numeric:tabular-nums;vertical-align:middle">`),So=ae("<span style=font-variant-numeric:tabular-nums;font-size:10px;margin-left:4px;vertical-align:middle>"),To=ae("<div style=margin-left:4px>to clipboard"),Co=ae(`<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">`),Lt=e=>{let[t,n]=k(0),[r,o]=k(0),i,s=e.x,a=e.y,l=e.x,f=e.y,d=null,m=false,x=()=>{s=pe(s,l,.3),a=pe(a,f,.3),o($=>$+1),Math.abs(s-l)<.5&&Math.abs(a-f)<.5?d=null:d=requestAnimationFrame(x);},C=()=>{d===null&&(d=requestAnimationFrame(x));},w=()=>{if(l=e.x,f=e.y,!m){s=l,a=f,m=true,o(S=>S+1);return}C();};se(_e(()=>e.visible,S=>{if(S!==false)requestAnimationFrame(()=>{n(1);});else {n(0);return}if(e.variant==="success"){let $=setTimeout(()=>{n(0);},1700);he(()=>clearTimeout($));}})),se(()=>{w();}),he(()=>{d!==null&&(cancelAnimationFrame(d),d=null);});let E=()=>i?.getBoundingClientRect(),O=()=>{r();let S=E();if(!S)return {left:s,top:a};let $=window.innerWidth,R=window.innerHeight,P=[{left:Math.round(s)+14,top:Math.round(a)+14},{left:Math.round(s)-S.width-14,top:Math.round(a)+14},{left:Math.round(s)+14,top:Math.round(a)-S.height-14},{left:Math.round(s)-S.width-14,top:Math.round(a)-S.height-14}];for(let K of P){let y=K.left>=8&&K.left+S.width<=$-8,_=K.top>=8&&K.top+S.height<=R-8;if(y&&_)return K}let z=ht(P[0].left,P[0].top,S.width,S.height);return z.left+=4,z.top+=4,z},N=()=>{let $=e.text.indexOf(" in ");return $===-1?{primary:e.text,secondary:""}:{primary:e.text.slice(0,$),secondary:e.text.slice($)}};return I(J,{get when(){return e.visible!==false},get children(){var S=Co(),$=i;return typeof $=="function"?Fe($,S):i=S,Se(S,I(J,{get when(){return e.variant==="processing"},get children(){return I(Bn,{})}}),null),Se(S,I(J,{get when(){return e.variant==="success"},get children(){return bo()}}),null),Se(S,I(J,{get when(){return e.variant==="success"},get children(){return yo()}}),null),Se(S,I(J,{get when(){return e.variant==="processing"},children:"Grabbing\u2026"}),null),Se(S,I(J,{get when(){return e.variant!=="processing"},get children(){return [(()=>{var R=wo();return Se(R,()=>N().primary),R})(),I(J,{get when(){return Ae(()=>e.variant==="hover")()&&N().secondary!==""},get children(){var R=So();return Se(R,()=>N().secondary),R}})]}}),null),Se(S,I(J,{get when(){return e.variant==="success"},get children(){return To()}}),null),fe(R=>{var P=`${O().top}px`,z=`${O().left}px`,K=e.zIndex?.toString()??"2147483647",y=t();return P!==R.e&&we(S,"top",R.e=P),z!==R.t&&we(S,"left",R.t=z),K!==R.a&&we(S,"z-index",R.a=K),y!==R.o&&we(S,"opacity",R.o=y),R},{e:void 0,t:void 0,a:void 0,o:void 0}),S}})};var xo=ae('<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)">'),vo=e=>{let[t,n]=k(0);return se(_e(()=>e,r=>{r!==false?requestAnimationFrame(()=>{n(1);}):n(0);})),t},Vn=e=>{let t=vo(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 ht(s,a,o.width,o.height)};return I(J,{get when(){return e.visible!==false},get children(){var o=xo(),i=o.firstChild,s=i.firstChild,a=n;return typeof a=="function"?Fe(a,o):n=o,fe(l=>{var f=`${r().top}px`,d=`${r().left}px`,m=t(),x=`${Math.min(100,Math.max(0,e.progress*100))}%`;return f!==l.e&&we(o,"top",l.e=f),d!==l.t&&we(o,"left",l.t=d),m!==l.a&&we(o,"opacity",l.a=m),x!==l.o&&we(s,"width",l.o=x),l},{e:void 0,t:void 0,a:void 0,o:void 0}),o}})};var Eo=ae("<canvas style=position:fixed;top:0;left:0;pointer-events:none;z-index:2147483645>"),Yn=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,m=false,x=()=>{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));},C=()=>{n&&(n.clearRect(0,0,r,o),n.strokeStyle="rgba(210, 57, 192)",n.lineWidth=1,n.beginPath(),n.moveTo(s,0),n.lineTo(s,o),n.moveTo(0,a),n.lineTo(r,a),n.stroke());},w=()=>{s=pe(s,l,.3),a=pe(a,f,.3),C(),Math.abs(s-l)<.5&&Math.abs(a-f)<.5?d=null:d=requestAnimationFrame(w);},E=()=>{d===null&&(d=requestAnimationFrame(w));},O=()=>{if(l=e.mouseX,f=e.mouseY,!m){s=l,a=f,m=true,C();return}E();};return se(()=>{x(),C();let N=()=>{x(),C();};window.addEventListener("resize",N),he(()=>{window.removeEventListener("resize",N),d!==null&&(cancelAnimationFrame(d),d=null);});}),se(()=>{O();}),I(J,{get when(){return e.visible!==false},get children(){var N=Eo(),S=t;return typeof S=="function"?Fe(S,N):t=N,N}})};var Gn=e=>[I(J,{get when(){return Ae(()=>!!e.selectionVisible)()&&e.selectionBounds},get children(){return I(mt,{variant:"selection",get bounds(){return e.selectionBounds},get visible(){return e.selectionVisible}})}}),I(J,{get when(){return Ae(()=>e.crosshairVisible===true&&e.mouseX!==void 0)()&&e.mouseY!==void 0},get children(){return I(Yn,{get mouseX(){return e.mouseX},get mouseY(){return e.mouseY},visible:true})}}),I(J,{get when(){return Ae(()=>!!e.dragVisible)()&&e.dragBounds},get children(){return I(mt,{variant:"drag",get bounds(){return e.dragBounds},get visible(){return e.dragVisible}})}}),I(ut,{get each(){return e.grabbedBoxes??[]},children:t=>I(mt,{variant:"grabbed",get bounds(){return t.bounds},get createdAt(){return t.createdAt}})}),I(ut,{get each(){return e.successLabels??[]},children:t=>I(Lt,{variant:"success",get text(){return t.text},get x(){return t.x},get y(){return t.y}})}),I(J,{get when(){return Ae(()=>!!(e.labelVisible&&e.labelVariant&&e.labelText&&e.labelX!==void 0))()&&e.labelY!==void 0},get children(){return I(Lt,{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}})}}),I(J,{get when(){return Ae(()=>!!(e.progressVisible&&e.progress!==void 0&&e.mouseX!==void 0))()&&e.mouseY!==void 0},get children(){return I(Vn,{get progress(){return e.progress},get mouseX(){return e.mouseX},get mouseY(){return e.mouseY},get visible(){return e.progressVisible}})}})];var qn="0.5.14",Ke=`bippy-${qn}`,zn=Object.defineProperty,Ro=Object.prototype.hasOwnProperty,We=()=>{},Xn=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{}},Dt=(e=Ee())=>"getFiberRoots"in e,Wn=false,Un,bt=(e=Ee())=>Wn?true:(typeof e.inject=="function"&&(Un=e.inject.toString()),!!Un?.includes("(injected)")),pt=new Set,Le=new Set,Kn=e=>{let t=new Map,n=0,r={_instrumentationIsActive:false,_instrumentationSource:Ke,checkDCE:Xn,hasUnsupportedRendererAttached:false,inject(o){let i=++n;return t.set(i,o),Le.add(o),r._instrumentationIsActive||(r._instrumentationIsActive=true,pt.forEach(s=>s())),i},on:We,onCommitFiberRoot:We,onCommitFiberUnmount:We,onPostCommitFiberRoot:We,renderers:t,supportsFiber:true,supportsFlight:true};try{zn(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)=>{Le.add(l),s.renderers.set(f,l);}),yt(e));}}});let o=window.hasOwnProperty,i=!1;zn(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{yt(e);}return r},yt=e=>{e&&pt.add(e);try{let t=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!t)return;if(!t._instrumentationSource){t.checkDCE=Xn,t.supportsFiber=!0,t.supportsFlight=!0,t.hasUnsupportedRendererAttached=!1,t._instrumentationSource=Ke,t._instrumentationIsActive=!1;let n=Dt(t);if(n||(t.on=We),t.renderers.size){t._instrumentationIsActive=!0,pt.forEach(i=>i());return}let r=t.inject,o=bt(t);o&&!n&&(Wn=!0,t.inject({scheduleRefresh(){}})&&(t._instrumentationIsActive=!0)),t.inject=i=>{let s=r(i);return Le.add(i),o&&t.renderers.set(s,i),t._instrumentationIsActive=!0,pt.forEach(a=>a()),s};}(t.renderers.size||t._instrumentationIsActive||bt())&&e?.();}catch{}},Ht=()=>Ro.call(globalThis,"__REACT_DEVTOOLS_GLOBAL_HOOK__"),Ee=e=>Ht()?(yt(e),globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__):Kn(e),Zn=()=>!!(typeof window<"u"&&(window.document?.createElement||window.navigator?.product==="ReactNative")),Bt=()=>{try{Zn()&&Ee();}catch{}};Bt();var wt=0,St=1;var Tt=5;var Ct=11,jt=13,Jn=14,xt=15,Vt=16;var Yt=19;var vt=26,Et=27,Gt=28,zt=30;var Ut=e=>{switch(e.tag){case Tt:case vt:case Et:return true;default:return typeof e.type=="string"}},De=e=>{switch(e.tag){case St:case Ct:case wt:case Jn:case xt:return true;default:return false}};function $e(e,t,n=false){return e&&t(e)instanceof Promise?Xt(e,t,n):qt(e,t,n)}var qt=(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=qt(r,t,n);if(o)return o;r=n?null:r.sibling;}return null},Xt=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 Xt(r,t,n);if(o)return o;r=n?null:r.sibling;}return null};var Wt=e=>{let t=e;return typeof t=="function"?t:typeof t=="object"&&t?Wt(t.type||t.render):null},ke=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=Wt(t);return r&&(r.displayName||r.name)||null};var Kt=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 Rt){let r=$e(n.current,o=>{if(o===e)return true});if(r)return r}return e};var Zt=e=>{let t=Ee(e.onActive);t._instrumentationSource=e.name??Ke;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},He=e=>{let t=Ee();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},Rt=new Set;var Mo=Object.create,sr=Object.defineProperty,Po=Object.getOwnPropertyDescriptor,Lo=Object.getOwnPropertyNames,Do=Object.getPrototypeOf,Ho=Object.prototype.hasOwnProperty,Bo=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),jo=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=Lo(t),i=0,s=o.length,a;i<s;i++)a=o[i],!Ho.call(e,a)&&a!==n&&sr(e,a,{get:(l=>t[l]).bind(null,a),enumerable:!(r=Po(t,a))||r.enumerable});return e},Vo=(e,t,n)=>(n=e==null?{}:Mo(Do(e)),jo(sr(n,"default",{value:e,enumerable:true}),e)),Yo=()=>{let e=Ee();for(let t of [...Array.from(Le),...Array.from(e.renderers.values())]){let n=t.currentDispatcherRef;if(n&&typeof n=="object")return "H"in n?n.H:n.current}return null},Qn=e=>{for(let t of Le){let n=t.currentDispatcherRef;n&&typeof n=="object"&&("H"in n?n.H=e:n.current=e);}},Re=e=>`
|
|
10
|
+
in ${e}`,Go=(e,t)=>{let n=Re(e);return t&&(n+=` (at ${t})`),n},Jt=false,Qt=(e,t)=>{if(!e||Jt)return "";let n=Error.prepareStackTrace;Error.prepareStackTrace=void 0,Jt=true;let r=Yo();Qn(null);let o=console.error,i=console.warn;console.error=()=>{},console.warn=()=>{};try{let l={DetermineComponentFrameRoot(){let x;try{if(t){let C=function(){throw Error()};if(Object.defineProperty(C.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(C,[]);}catch(w){x=w;}Reflect.construct(e,[],C);}else {try{C.call();}catch(w){x=w;}e.call(C.prototype);}}else {try{throw Error()}catch(w){x=w;}let C=e();C&&typeof C.catch=="function"&&C.catch(()=>{});}}catch(C){if(C instanceof Error&&x instanceof Error&&typeof C.stack=="string")return [C.stack,x.stack]}return [null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot",Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name")?.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});let[d,m]=l.DetermineComponentFrameRoot();if(d&&m){let x=d.split(`
|
|
11
|
+
`),C=m.split(`
|
|
12
|
+
`),w=0,E=0;for(;w<x.length&&!x[w].includes("DetermineComponentFrameRoot");)w++;for(;E<C.length&&!C[E].includes("DetermineComponentFrameRoot");)E++;if(w===x.length||E===C.length)for(w=x.length-1,E=C.length-1;w>=1&&E>=0&&x[w]!==C[E];)E--;for(;w>=1&&E>=0;w--,E--)if(x[w]!==C[E]){if(w!==1||E!==1)do if(w--,E--,E<0||x[w]!==C[E]){let O=`
|
|
13
|
+
${x[w].replace(" at new "," at ")}`,N=ke(e);return N&&O.includes("<anonymous>")&&(O=O.replace("<anonymous>",N)),O}while(w>=1&&E>=0);break}}}finally{Jt=false,Error.prepareStackTrace=n,Qn(r),console.error=o,console.warn=i;}let s=e?ke(e):"";return s?Re(s):""},zo=(e,t)=>{let n=e.tag,r="";switch(n){case Gt:r=Re("Activity");break;case St:r=Qt(e.type,true);break;case Ct:r=Qt(e.type.render,false);break;case wt:case xt:r=Qt(e.type,false);break;case Tt:case vt:case Et:r=Re(e.type);break;case Vt:r=Re("Lazy");break;case jt:r=e.child!==t&&t!==null?Re("Suspense Fallback"):Re("Suspense");break;case Yt:r=Re("SuspenseList");break;case zt:r=Re("ViewTransition");break;default:return ""}return r},Uo=e=>{try{let t="",n=e,r=null;do{t+=zo(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+=Go(s.name,s.env));}r=n,n=n.return;}while(n);return t}catch(t){return t instanceof Error?`
|
|
14
14
|
Error generating stack: ${t.message}
|
|
15
|
-
${t.stack}`:""}},
|
|
15
|
+
${t.stack}`:""}},qo=e=>{let t=Error.prepareStackTrace;Error.prepareStackTrace=void 0;let n=e;if(!n)return "";Error.prepareStackTrace=t,n.startsWith(`Error: react-stack-top-frame
|
|
16
16
|
`)&&(n=n.slice(29));let r=n.indexOf(`
|
|
17
17
|
`);if(r!==-1&&(n=n.slice(r+1)),r=Math.max(n.indexOf("react_stack_bottom_frame"),n.indexOf("react-stack-bottom-frame")),r!==-1&&(r=n.lastIndexOf(`
|
|
18
|
-
`,r)),r!==-1)n=n.slice(0,r);else return "";return n},
|
|
19
|
-
`),r=[];for(let o of n)if(/^\s*at\s+/.test(o)){let i=
|
|
20
|
-
`).filter(r=>!!r.match(
|
|
21
|
-
`).filter(r=>!r.match(
|
|
22
|
-
`),r;for(let i=n.length-1;i>=0&&!r;i--){let s=n[i].match(Uo);s&&(r=s[1]||s[2]);}if(!r)return null;let o=lr.test(r);if(!(Go.test(r)||o||r.startsWith("/"))){let i=e.split("/");i[i.length-1]=r,r=i.join("/");}return r},Wo=e=>({file:e.file,mappings:(0, ar.decode)(e.mappings),names:e.names,sourceRoot:e.sourceRoot,sources:e.sources,sourcesContent:e.sourcesContent,version:3}),Ko=e=>{let t=e.sections.map(({map:r,offset:o})=>({map:{...r,mappings:(0, ar.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}},er=e=>{if(!e)return false;let t=e.trim();if(!t)return false;let n=t.match(lr);if(!n)return true;let r=n[0].toLowerCase();return r==="http:"||r==="https:"},Zo=async(e,t=fetch)=>{if(!er(e))return null;let n;try{n=await(await t(e)).text();}catch{return null}if(!n)return null;let r=Xo(e,n);if(!r||!er(r))return null;try{let o=await t(r),i=await o.json();return "sections"in i?Ko(i):Wo(i)}catch{return null}},Jo=async(e,t=true,n)=>{if(t&&Ze.has(e)){let i=Ze.get(e);if(i==null)return null;if(zo(i)){let s=i.deref();if(s)return s;Ze.delete(e);}else return i}if(t&&Ot.has(e))return Ot.get(e);let r=Zo(e,n);t&&Ot.set(e,r);let o=await r;return t&&Ot.delete(e),t&&(o===null?Ze.set(e,null):Ze.set(e,cr?new WeakRef(o):o)),o},tr=/^[a-zA-Z][a-zA-Z\d+\-.]*:/,Qo=["rsc://","file:///","webpack://","node:","turbopack://","metro://"],nr="about://React/",ei=["<anonymous>","eval",""],ti=/\.(jsx|tsx|ts|js)$/,ni=/(\.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,ri=/^\?[\w~.\-]+(?:=[^&#]*)?(?:&[\w~.\-]+(?:=[^&#]*)?)*$/,oi=e=>e._debugStack instanceof Error&&typeof e._debugStack?.stack=="string",ii=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},si=async(e,t=true,n)=>{if(ii(e))return e._debugSource||null;let r=ur(e);return fr(r,void 0,t,n)},ur=e=>oi(e)?Bo(e._debugStack.stack):Ho(e),ai=async(e,t=true,n)=>{let r=await fr(e,1,t,n);return !r||r.length===0?null:r[0]},fr=async(e,t=1,n=true,r)=>{let o=ir(e,{slice:t??1}),i=[];for(let s of o){if(!s?.file)continue;let a=await Jo(s.file,n,r);if(a&&typeof s.line=="number"&&typeof s.col=="number"){let l=qo(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},je=e=>{if(!e||ei.includes(e))return "";let t=e;if(t.startsWith(nr)){let r=t.slice(nr.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(tr.test(t)){let r=t.match(tr);r&&(t=t.slice(r[0].length));}let n=t.indexOf("?");if(n!==-1){let r=t.slice(n);ri.test(r)&&(t=t.slice(0,n));}return t},Qt=e=>{let t=je(e);return !(!t||!ti.test(t)||ni.test(t))},li=async(e,t=true,n)=>{let r=He(e,s=>{if(We(s))return true},true);if(r){let s=await si(r,t,n);if(s?.fileName){let a=je(s.fileName);if(Qt(a))return {fileName:a,lineNumber:s.lineNumber,columnNumber:s.columnNumber,functionName:s.functionName}}}let o=ir(ur(e),{includeInElement:false}),i=null;for(;o.length;){let s=o.pop();if(!s||!s.raw||!s.file)continue;let a=await ai(s.raw,t,n);if(a)return {fileName:je(a.fileName),lineNumber:a.lineNumber,columnNumber:a.columnNumber,functionName:a.functionName};i={fileName:je(s.file),lineNumber:s.line,columnNumber:s.col,functionName:s.function};}return i},dr=async(e,t=true,n)=>{let r=Ke(e);if(!r||!Gt(r))return null;let o=Xt(r);return o?li(o,t,n):null};var ci=new Set(["role","name","aria-label","rel","href"]);function ui(e,t){let n=ci.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 fi(e){return Je(e)}function di(e){return Je(e)}function mi(e){return true}function hr(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:fi,className:di,tagName:mi,attr:ui,timeoutMs:1e3,seedMinLength:3,optimizedMinLength:2,maxNumberOfPathChecks:1/0},r=new Date,o={...n,...t},i=yi(o.root,n),s,a=0;for(let f of hi(e,o,i)){if(new Date().getTime()-r.getTime()>o.timeoutMs||a>=o.maxNumberOfPathChecks){let g=pi(e,i);if(!g)throw new Error(`Timeout: Can't find a unique selector after ${o.timeoutMs}ms`);return Qe(g)}if(a++,nn(f,i)){s=f;break}}if(!s)throw new Error("Selector was not found.");let l=[...br(s,e,o,i,r)];return l.sort(en),l.length>0?Qe(l[0]):Qe(s)}function*hi(e,t,n){let r=[],o=[],i=e,s=0;for(;i&&i!==n;){let a=gi(i,t);for(let l of a)l.level=s;if(r.push(a),i=i.parentElement,s++,o.push(...pr(r)),s>=t.seedMinLength){o.sort(en);for(let l of o)yield l;o=[];}}o.sort(en);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 gi(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=tn(e,o);s!==void 0&&n.push({name:gr(o,s),penalty:10});}let i=tn(e);return i!==void 0&&n.push({name:bi(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 mr(e){return e.map(t=>t.penalty).reduce((t,n)=>t+n,0)}function en(e,t){return mr(e)-mr(t)}function tn(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 pi(e,t){let n=0,r=e,o=[];for(;r&&r!==t;){let i=r.tagName.toLowerCase(),s=tn(r,i);if(s===void 0)return;o.push({name:gr(i,s),penalty:NaN,level:n}),r=r.parentElement,n++;}if(nn(o,t))return o}function bi(e,t){return e==="html"?"html":`${e}:nth-child(${t})`}function gr(e,t){return e==="html"?"html":`${e}:nth-of-type(${t})`}function*pr(e,t=[]){if(e.length>0)for(let n of e[0])yield*pr(e.slice(1,e.length),t.concat(n));else yield t;}function yi(e,t){return e.nodeType===Node.DOCUMENT_NODE?e:e===t.root?e.ownerDocument:e}function nn(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*br(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),nn(a,r)&&r.querySelector(Qe(a))===t&&(yield a,yield*br(a,t,n,r,o));}}Wt({onCommitFiberRoot(e,t){Rt.add(t);}});var wi=e=>hr(e),rn=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 He(c,y=>{if(We(y)){let E=Be(y);if(E&&!n(E))return m=E,true}return false},true),m},o=async u=>{let c=await dr(u);if(!c)return null;let m=je(c.fileName);return Qt(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,j=t(B.join(" "),30);y.push(`class="${j}"`);}}let E=Array.from(u.attributes).filter(M=>M.name.startsWith("data-")),H=c?E.slice(0,1):E;for(let M of H)y.push(`${M.name}="${t(M.value,20)}"`);let k=u.getAttribute("aria-label");return k&&!c&&y.push(`aria-label="${t(k,20)}"`),y.length>0?`<${m} ${y.join(" ")}>`:`<${m}>`},f=u=>`</${u.tagName.toLowerCase()}>`,h=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=wi(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),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)&&b.push(`${c}<${m} source="${y}">`),b.push(`${c}${l(C[u],true)}`);}let _=e.parentElement,N=-1;if(_){let u=Array.from(_.children);if(N=u.indexOf(e),N>0){let c=u[N-1];if(g(c)&&N<=2){let y=" ".repeat(C.length);b.push(`${y} ${l(c,true)}`),b.push(`${y} </${c.tagName.toLowerCase()}>`);}else if(N>0){let y=" ".repeat(C.length);b.push(`${y} ... (${N} element${N===1?"":"s"})`);}}}let D=" ".repeat(C.length),re=C.length>0?R[R.length-1]:null,se=T&&O&&T!==re;se&&b.push(`${D} <${T} used-at="${O}">`),b.push(`${D} <!-- IMPORTANT: selected element -->`);let ue=h(e),Re=e.children.length,w=`${D}${se?" ":" "}`;if(ue&&Re===0&&ue.length<40?b.push(`${w}${l(e)}${ue}${f(e)}`):(b.push(`${w}${l(e)}`),ue&&b.push(`${w} ${ue}`),Re>0&&b.push(`${w} ... (${Re} element${Re===1?"":"s"})`),b.push(`${w}${f(e)}`)),se&&b.push(`${D} </${T}>`),_&&N>=0){let u=Array.from(_.children),c=u.length-N-1;if(c>0){let m=u[N+1];g(m)&&c<=2?(b.push(`${D} ${l(m,true)}`),b.push(`${D} </${m.tagName.toLowerCase()}>`)):b.push(`${D} ... (${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 m=R[u],y=A[u];m&&y&&(u===C.length-1||R[u+1]!==m)&&b.push(`${c}</${m}>`);}return b.push("```"),b.join(`
|
|
23
|
-
`)};var
|
|
24
|
-
${
|
|
25
|
-
</selected_element>`,nt=
|
|
18
|
+
`,r)),r!==-1)n=n.slice(0,r);else return "";return n},Xo=/(^|@)\S+:\d+/,ar=/^\s*at .*(\S+:\d+|\(native\))/m,Wo=/^(eval@)?(\[native code\])?$/;var lr=(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=er(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(Xo)){let i=tr(o,void 0)[0];i&&r.push(i);}return en(r,t)}return e.match(ar)?er(e,t):tr(e,t)},cr=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]},en=(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 er=(e,t)=>en(e.split(`
|
|
20
|
+
`).filter(r=>!!r.match(ar)),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=cr(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 tr=(e,t)=>en(e.split(`
|
|
21
|
+
`).filter(r=>!r.match(Wo)),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=cr(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 Ko=Bo((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 h=0;h<i.length;h++){let g=i.charCodeAt(h);s[h]=g,a[g]=h;}function l(h,g){let c=0,b=0,v=0;do{let B=h.next();v=a[B],c|=(v&31)<<b,b+=5;}while(v&32);let M=c&1;return c>>>=1,M&&(c=-2147483648|-c),g+c}function f(h,g,c){let b=g-c;b=b<0?-b<<1|1:b<<1;do{let v=b&31;b>>>=5,b>0&&(v|=32),h.write(s[v]);}while(b>0);return g}function d(h,g){return h.pos>=g?false:h.peek()!==r}let m=1024*16,x=typeof TextDecoder<"u"?new TextDecoder:typeof Buffer<"u"?{decode(h){return Buffer.from(h.buffer,h.byteOffset,h.byteLength).toString()}}:{decode(h){let g="";for(let c=0;c<h.length;c++)g+=String.fromCharCode(h[c]);return g}};class C{constructor(){this.pos=0,this.out="",this.buffer=new Uint8Array(m);}write(g){let{buffer:c}=this;c[this.pos++]=g,this.pos===m&&(this.out+=x.decode(c),this.pos=0);}flush(){let{buffer:g,out:c,pos:b}=this;return b>0?c+x.decode(g.subarray(0,b)):c}}class w{constructor(g){this.pos=0,this.buffer=g;}next(){return this.buffer.charCodeAt(this.pos++)}peek(){return this.buffer.charCodeAt(this.pos)}indexOf(g){let{buffer:c,pos:b}=this,v=c.indexOf(g,b);return v===-1?c.length:v}}let E=[];function O(h){let{length:g}=h,c=new w(h),b=[],v=[],M=0;for(;c.pos<g;c.pos++){M=l(c,M);let B=l(c,0);if(!d(c,g)){let q=v.pop();q[2]=M,q[3]=B;continue}let D=l(c,0),Z=l(c,0),j=Z&1,V=j?[M,B,0,0,D,l(c,0)]:[M,B,0,0,D],Q=E;if(d(c,g)){Q=[];do{let q=l(c,0);Q.push(q);}while(d(c,g))}V.vars=Q,b.push(V),v.push(V);}return b}function N(h){let g=new C;for(let c=0;c<h.length;)c=S(h,c,g,[0]);return g.flush()}function S(h,g,c,b){let v=h[g],{0:M,1:B,2:D,3:Z,4:j,vars:V}=v;g>0&&c.write(r),b[0]=f(c,M,b[0]),f(c,B,0),f(c,j,0);let Q=v.length===6?1:0;f(c,Q,0),v.length===6&&f(c,v[5],0);for(let q of V)f(c,q,0);for(g++;g<h.length;){let q=h[g],{0:F,1:X}=q;if(F>D||F===D&&X>=Z)break;g=S(h,g,c,b);}return c.write(r),b[0]=f(c,D,b[0]),f(c,Z,0),g}function $(h){let{length:g}=h,c=new w(h),b=[],v=[],M=0,B=0,D=0,Z=0,j=0,V=0,Q=0,q=0;do{let F=c.indexOf(";"),X=0;for(;c.pos<F;c.pos++){if(X=l(c,X),!d(c,F)){let le=v.pop();le[2]=M,le[3]=X;continue}let re=l(c,0),de=re&1,ne=re&2,ce=re&4,Te=null,ye=E,Ce;if(de){let le=l(c,B);D=l(c,B===le?D:0),B=le,Ce=[M,X,0,0,le,D];}else Ce=[M,X,0,0];if(Ce.isScope=!!ce,ne){let le=Z,xe=j;Z=l(c,Z);let Ne=le===Z;j=l(c,Ne?j:0),V=l(c,Ne&&xe===j?V:0),Te=[Z,j,V];}if(Ce.callsite=Te,d(c,F)){ye=[];do{Q=M,q=X;let le=l(c,0),xe;if(le<-1){xe=[[l(c,0)]];for(let Ne=-1;Ne>le;Ne--){let tt=Q;Q=l(c,Q),q=l(c,Q===tt?q:0);let nt=l(c,0);xe.push([nt,Q,q]);}}else xe=[[le]];ye.push(xe);}while(d(c,F))}Ce.bindings=ye,b.push(Ce),v.push(Ce);}M++,c.pos=F+1;}while(c.pos<g);return b}function R(h){if(h.length===0)return "";let g=new C;for(let c=0;c<h.length;)c=P(h,c,g,[0,0,0,0,0,0,0]);return g.flush()}function P(h,g,c,b){let v=h[g],{0:M,1:B,2:D,3:Z,isScope:j,callsite:V,bindings:Q}=v;b[0]<M?(z(c,b[0],M),b[0]=M,b[1]=0):g>0&&c.write(r),b[1]=f(c,v[1],b[1]);let q=(v.length===6?1:0)|(V?2:0)|(j?4:0);if(f(c,q,0),v.length===6){let{4:F,5:X}=v;F!==b[2]&&(b[3]=0),b[2]=f(c,F,b[2]),b[3]=f(c,X,b[3]);}if(V){let{0:F,1:X,2:re}=v.callsite;F===b[4]?X!==b[5]&&(b[6]=0):(b[5]=0,b[6]=0),b[4]=f(c,F,b[4]),b[5]=f(c,X,b[5]),b[6]=f(c,re,b[6]);}if(Q)for(let F of Q){F.length>1&&f(c,-F.length,0);let X=F[0][0];f(c,X,0);let re=M,de=B;for(let ne=1;ne<F.length;ne++){let ce=F[ne];re=f(c,ce[1],re),de=f(c,ce[2],de),f(c,ce[0],0);}}for(g++;g<h.length;){let F=h[g],{0:X,1:re}=F;if(X>D||X===D&&re>=Z)break;g=P(h,g,c,b);}return b[0]<D?(z(c,b[0],D),b[0]=D,b[1]=0):c.write(r),b[1]=f(c,Z,b[1]),g}function z(h,g,c){do h.write(o);while(++g<c)}function K(h){let{length:g}=h,c=new w(h),b=[],v=0,M=0,B=0,D=0,Z=0;do{let j=c.indexOf(";"),V=[],Q=true,q=0;for(v=0;c.pos<j;){let F;v=l(c,v),v<q&&(Q=false),q=v,d(c,j)?(M=l(c,M),B=l(c,B),D=l(c,D),d(c,j)?(Z=l(c,Z),F=[v,M,B,D,Z]):F=[v,M,B,D]):F=[v],V.push(F),c.pos++;}Q||y(V),b.push(V),c.pos=j+1;}while(c.pos<=g);return b}function y(h){h.sort(_);}function _(h,g){return h[0]-g[0]}function H(h){let g=new C,c=0,b=0,v=0,M=0;for(let B=0;B<h.length;B++){let D=h[B];if(B>0&&g.write(o),D.length===0)continue;let Z=0;for(let j=0;j<D.length;j++){let V=D[j];j>0&&g.write(r),Z=f(g,V[0],Z),V.length!==1&&(c=f(g,V[1],c),b=f(g,V[2],b),v=f(g,V[3],v),V.length!==4&&(M=f(g,V[4],M)));}}return g.flush()}n.decode=K,n.decodeGeneratedRanges=$,n.decodeOriginalScopes=O,n.encode=H,n.encodeGeneratedRanges=R,n.encodeOriginalScopes=N,Object.defineProperty(n,"__esModule",{value:true});});}),ur=Vo(Ko()),fr=/^[a-zA-Z][a-zA-Z\d+\-.]*:/,Zo=/^data:application\/json[^,]+base64,/,Jo=/(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^*]+?)[ \t]*(?:\*\/)[ \t]*$)/,dr=typeof WeakRef<"u",Ze=new Map,Nt=new Map,Qo=e=>dr&&e instanceof WeakRef,nr=(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 d of o)if(d[0]<=r)i=d;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},ei=(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 nr(r.map.mappings,r.map.sources,o,i)}return nr(e.mappings,e.sources,t-1,n)},ti=(e,t)=>{let n=t.split(`
|
|
22
|
+
`),r;for(let i=n.length-1;i>=0&&!r;i--){let s=n[i].match(Jo);s&&(r=s[1]||s[2]);}if(!r)return null;let o=fr.test(r);if(!(Zo.test(r)||o||r.startsWith("/"))){let i=e.split("/");i[i.length-1]=r,r=i.join("/");}return r},ni=e=>({file:e.file,mappings:(0, ur.decode)(e.mappings),names:e.names,sourceRoot:e.sourceRoot,sources:e.sources,sourcesContent:e.sourcesContent,version:3}),ri=e=>{let t=e.sections.map(({map:r,offset:o})=>({map:{...r,mappings:(0, ur.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}},rr=e=>{if(!e)return false;let t=e.trim();if(!t)return false;let n=t.match(fr);if(!n)return true;let r=n[0].toLowerCase();return r==="http:"||r==="https:"},oi=async(e,t=fetch)=>{if(!rr(e))return null;let n;try{n=await(await t(e)).text();}catch{return null}if(!n)return null;let r=ti(e,n);if(!r||!rr(r))return null;try{let o=await t(r),i=await o.json();return "sections"in i?ri(i):ni(i)}catch{return null}},ii=async(e,t=true,n)=>{if(t&&Ze.has(e)){let i=Ze.get(e);if(i==null)return null;if(Qo(i)){let s=i.deref();if(s)return s;Ze.delete(e);}else return i}if(t&&Nt.has(e))return Nt.get(e);let r=oi(e,n);t&&Nt.set(e,r);let o=await r;return t&&Nt.delete(e),t&&(o===null?Ze.set(e,null):Ze.set(e,dr?new WeakRef(o):o)),o},or=/^[a-zA-Z][a-zA-Z\d+\-.]*:/,si=["rsc://","file:///","webpack://","node:","turbopack://","metro://"],ir="about://React/",ai=["<anonymous>","eval",""],li=/\.(jsx|tsx|ts|js)$/,ci=/(\.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,ui=/^\?[\w~.\-]+(?:=[^&#]*)?(?:&[\w~.\-]+(?:=[^&#]*)?)*$/,fi=e=>e._debugStack instanceof Error&&typeof e._debugStack?.stack=="string",di=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},mi=async(e,t=true,n)=>{if(di(e))return e._debugSource||null;let r=mr(e);return hr(r,void 0,t,n)},mr=e=>fi(e)?qo(e._debugStack.stack):Uo(e),hi=async(e,t=true,n)=>{let r=await hr(e,1,t,n);return !r||r.length===0?null:r[0]},hr=async(e,t=1,n=true,r)=>{let o=lr(e,{slice:t??1}),i=[];for(let s of o){if(!s?.file)continue;let a=await ii(s.file,n,r);if(a&&typeof s.line=="number"&&typeof s.col=="number"){let l=ei(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},Ye=e=>{if(!e||ai.includes(e))return "";let t=e;if(t.startsWith(ir)){let r=t.slice(ir.length),o=r.indexOf("/"),i=r.indexOf(":");t=o!==-1&&(i===-1||o<i)?r.slice(o+1):r;}for(let r of si)if(t.startsWith(r)){t=t.slice(r.length),r==="file:///"&&(t=`/${t.replace(/^\/+/,"")}`);break}if(or.test(t)){let r=t.match(or);r&&(t=t.slice(r[0].length));}let n=t.indexOf("?");if(n!==-1){let r=t.slice(n);ui.test(r)&&(t=t.slice(0,n));}return t},tn=e=>{let t=Ye(e);return !(!t||!li.test(t)||ci.test(t))},gi=async(e,t=true,n)=>{let r=$e(e,s=>{if(De(s))return true},true);if(r){let s=await mi(r,t,n);if(s?.fileName){let a=Ye(s.fileName);if(tn(a))return {fileName:a,lineNumber:s.lineNumber,columnNumber:s.columnNumber,functionName:s.functionName}}}let o=lr(mr(e),{includeInElement:false}),i=null;for(;o.length;){let s=o.pop();if(!s||!s.raw||!s.file)continue;let a=await hi(s.raw,t,n);if(a)return {fileName:Ye(a.fileName),lineNumber:a.lineNumber,columnNumber:a.columnNumber,functionName:a.functionName};i={fileName:Ye(s.file),lineNumber:s.line,columnNumber:s.col,functionName:s.function};}return i},gr=async(e,t=true,n)=>{let r=He(e);if(!r||!Ut(r))return null;let o=Kt(r);return o?gi(o,t,n):null};var pi=new Set(["role","name","aria-label","rel","href"]);function bi(e,t){let n=pi.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 yi(e){return Je(e)}function wi(e){return Je(e)}function Si(e){return true}function br(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:yi,className:wi,tagName:Si,attr:bi,timeoutMs:1e3,seedMinLength:3,optimizedMinLength:2,maxNumberOfPathChecks:1/0},r=new Date,o={...n,...t},i=Ei(o.root,n),s,a=0;for(let f of Ti(e,o,i)){if(new Date().getTime()-r.getTime()>o.timeoutMs||a>=o.maxNumberOfPathChecks){let m=xi(e,i);if(!m)throw new Error(`Timeout: Can't find a unique selector after ${o.timeoutMs}ms`);return Qe(m)}if(a++,on(f,i)){s=f;break}}if(!s)throw new Error("Selector was not found.");let l=[...Sr(s,e,o,i,r)];return l.sort(nn),l.length>0?Qe(l[0]):Qe(s)}function*Ti(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(...wr(r)),s>=t.seedMinLength){o.sort(nn);for(let l of o)yield l;o=[];}}o.sort(nn);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=rn(e,o);s!==void 0&&n.push({name:yr(o,s),penalty:10});}let i=rn(e);return i!==void 0&&n.push({name:vi(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 pr(e){return e.map(t=>t.penalty).reduce((t,n)=>t+n,0)}function nn(e,t){return pr(e)-pr(t)}function rn(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 xi(e,t){let n=0,r=e,o=[];for(;r&&r!==t;){let i=r.tagName.toLowerCase(),s=rn(r,i);if(s===void 0)return;o.push({name:yr(i,s),penalty:NaN,level:n}),r=r.parentElement,n++;}if(on(o,t))return o}function vi(e,t){return e==="html"?"html":`${e}:nth-child(${t})`}function yr(e,t){return e==="html"?"html":`${e}:nth-of-type(${t})`}function*wr(e,t=[]){if(e.length>0)for(let n of e[0])yield*wr(e.slice(1,e.length),t.concat(n));else yield t;}function Ei(e,t){return e.nodeType===Node.DOCUMENT_NODE?e:e===t.root?e.ownerDocument:e}function on(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*Sr(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),on(a,r)&&r.querySelector(Qe(a))===t&&(yield a,yield*Sr(a,t,n,r,o));}}var Ot=e=>e.length>0&&/^[A-Z]/.test(e);Zt({onCommitFiberRoot(e,t){Rt.add(t);}});var Ri=e=>br(e),_t=(e,t)=>e.length>t?`${e.substring(0,t)}...`:e,Ni=e=>!Ot(e)||e.startsWith("_")||e.includes("Provider")&&e.includes("Context"),Tr=e=>{let t=He(e);if(!t)return null;let n=null;return $e(t,r=>{if(De(r)){let o=ke(r);if(o&&!Ni(o))return n=o,true}return false},true),n},Cr=async e=>{let t=await gr(e);if(!t)return null;let n=Ye(t.fileName);return tn(n)?`${n}:${t.lineNumber}:${t.columnNumber}`:null},sn=async e=>{let t=new Set(["article","aside","footer","form","header","main","nav","section"]),n=y=>{let _=y.tagName.toLowerCase();if(t.has(_)||y.id)return true;if(y.className&&typeof y.className=="string"){let H=y.className.trim();if(H&&H.length>0)return true}return Array.from(y.attributes).some(H=>H.name.startsWith("data-"))},r=(y,_=10)=>{let H=[],h=y.parentElement,g=0;for(;h&&g<_&&h.tagName!=="BODY"&&!(n(h)&&(H.push(h),H.length>=3));)h=h.parentElement,g++;return H.reverse()},o=(y,_=false)=>{let H=y.tagName.toLowerCase(),h=[];if(y.id&&h.push(`id="${y.id}"`),y.className&&typeof y.className=="string"){let v=y.className.trim().split(/\s+/);if(v.length>0&&v[0]){let M=_?v.slice(0,3):v,B=_t(M.join(" "),30);h.push(`class="${B}"`);}}let g=Array.from(y.attributes).filter(v=>v.name.startsWith("data-")),c=_?g.slice(0,1):g;for(let v of c)h.push(`${v.name}="${_t(v.value,20)}"`);let b=y.getAttribute("aria-label");return b&&!_&&h.push(`aria-label="${_t(b,20)}"`),h.length>0?`<${H} ${h.join(" ")}>`:`<${H}>`},i=y=>`</${y.tagName.toLowerCase()}>`,s=y=>{let _=(y.textContent||"").trim().replace(/\s+/g," ");return _t(_,60)},a=y=>{if(y.id)return `#${y.id}`;if(y.className&&typeof y.className=="string"){let _=y.className.trim().split(/\s+/);if(_.length>0&&_[0])return `.${_[0]}`}return null},l=[],f=Ri(e);l.push(`- selector: ${f}`);let d=e.getBoundingClientRect();l.push(`- width: ${Math.round(d.width)}`),l.push(`- height: ${Math.round(d.height)}`),l.push("HTML snippet:"),l.push("```html");let m=r(e),x=m.map(y=>Tr(y)),C=Tr(e),w=await Promise.all(m.map(y=>Cr(y))),E=await Cr(e);for(let y=0;y<m.length;y++){let _=" ".repeat(y),H=x[y],h=w[y];H&&h&&(y===0||x[y-1]!==H)&&l.push(`${_}<${H} source="${h}">`),l.push(`${_}${o(m[y],true)}`);}let O=e.parentElement,N=-1;if(O){let y=Array.from(O.children);if(N=y.indexOf(e),N>0){let _=y[N-1];if(a(_)&&N<=2){let h=" ".repeat(m.length);l.push(`${h} ${o(_,true)}`),l.push(`${h} </${_.tagName.toLowerCase()}>`);}else if(N>0){let h=" ".repeat(m.length);l.push(`${h} ... (${N} element${N===1?"":"s"})`);}}}let S=" ".repeat(m.length),$=m.length>0?x[x.length-1]:null,R=C&&E&&C!==$;R&&l.push(`${S} <${C} used-at="${E}">`),l.push(`${S} <!-- IMPORTANT: selected element -->`);let P=s(e),z=e.children.length,K=`${S}${R?" ":" "}`;if(P&&z===0&&P.length<40?l.push(`${K}${o(e)}${P}${i(e)}`):(l.push(`${K}${o(e)}`),P&&l.push(`${K} ${P}`),z>0&&l.push(`${K} ... (${z} element${z===1?"":"s"})`),l.push(`${K}${i(e)}`)),R&&l.push(`${S} </${C}>`),O&&N>=0){let y=Array.from(O.children),_=y.length-N-1;if(_>0){let H=y[N+1];a(H)&&_<=2?(l.push(`${S} ${o(H,true)}`),l.push(`${S} </${H.tagName.toLowerCase()}>`)):l.push(`${S} ... (${_} element${_===1?"":"s"})`);}}for(let y=m.length-1;y>=0;y--){let _=" ".repeat(y);l.push(`${_}${i(m[y])}`);let H=x[y],h=w[y];H&&h&&(y===m.length-1||x[y+1]!==H)&&l.push(`${_}</${H}>`);}return l.push("```"),l.join(`
|
|
23
|
+
`)};var Oi=()=>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();}),an=async e=>{await Oi();try{if(Array.isArray(e)){if(!navigator?.clipboard?.write){for(let n of e)if(typeof n=="string"){let r=xr(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 xr(e)}}}catch{return false}},xr=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 vr=(e,t=window.getComputedStyle(e))=>t.display!=="none"&&t.visibility!=="hidden"&&t.opacity!=="0";var et=e=>{if(e.closest(`[${Ve}]`))return false;let t=window.getComputedStyle(e);return !(!vr(e,t)||t.pointerEvents==="none")};var ln=(e,t)=>{let n=document.elementsFromPoint(e,t);for(let r of n)if(et(r))return r;return null};var Er=(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 E=(f.tagName||"").toUpperCase();if(E==="HTML"||E==="BODY")continue}if(!t(f))continue;let d=f.getBoundingClientRect(),m=d.left,x=d.top,C=d.left+d.width,w=d.top+d.height;if(n){let E=Math.max(i,m),O=Math.max(s,x),N=Math.min(a,C),S=Math.min(l,w),$=Math.max(0,N-E),R=Math.max(0,S-O),P=$*R,z=Math.max(0,d.width*d.height);z>0&&P/z>=.75&&r.push(f);}else m<a&&C>i&&x<l&&w>s&&r.push(f);}return r},Rr=e=>e.filter(t=>!e.some(n=>n!==t&&n.contains(t)));var Nr=(e,t)=>{let n=Er(e,t,true);return Rr(n)},Or=(e,t)=>{let n=Er(e,t,false);return Rr(n)};var cn=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 _i=150,_r=e=>{let t={enabled:true,keyHoldDuration:300,allowActivationInsideInput:true,...e};return t.enabled===false?{activate:()=>{},deactivate:()=>{},toggle:()=>{},isActive:()=>false,dispose:()=>{}}:Pe(n=>{let[o,i]=k(false),[s,a]=k(-1e3),[l,f]=k(-1e3),[d,m]=k(false),[x,C]=k(-1e3),[w,E]=k(-1e3),[O,N]=k(false),[S,$]=k(null),[R,P]=k(null),[z,K]=k(0),[y,_]=k([]),[H,h]=k([]),[g,c]=k(false),[b,v]=k(false),[M,B]=k(false),[D,Z]=k(-1e3),[j,V]=k(-1e3),[Q,q]=k(false),F=null,X=null,re=null,de=null,ne=null,ce=-1e3,Te=-1e3,ye=U(()=>g()&&!O()),Ce=U(()=>s()>-1e3&&l()>-1e3),le=u=>(u.metaKey||u.ctrlKey)&&u.key.toLowerCase()==="c",xe=u=>{let T=`grabbed-${Date.now()}-${Math.random()}`,A=Date.now(),Y={id:T,bounds:u,createdAt:A},W=y();_([...W,Y]),setTimeout(()=>{_(oe=>oe.filter(st=>st.id!==T));},1700);},Ne=(u,T,A)=>{let Y=`success-${Date.now()}-${Math.random()}`;h(W=>[...W,{id:Y,text:u,x:T,y:A}]),setTimeout(()=>{h(W=>W.filter(oe=>oe.id!==Y));},1700);},tt=u=>`<selected_element>
|
|
24
|
+
${u}
|
|
25
|
+
</selected_element>`,nt=u=>{let T=window.getComputedStyle(u),A=u.getBoundingClientRect();return {width:`${Math.round(A.width)}px`,height:`${Math.round(A.height)}px`,paddingTop:T.paddingTop,paddingRight:T.paddingRight,paddingBottom:T.paddingBottom,paddingLeft:T.paddingLeft,background:T.background,opacity:T.opacity}},un=u=>{let T={elements:u.map(W=>({tagName:W.tagName,content:W.content,computedStyles:W.computedStyles}))},Y=`<div data-react-grab="${btoa(JSON.stringify(T))}"></div>`;return new Blob([Y],{type:"text/html"})},rt=u=>(u.tagName||"").toLowerCase(),Fr=u=>{let T=He(u);if(!T)return null;let A=null;return $e(T,Y=>{if(De(Y)){let W=ke(Y);if(W&&Ot(W)&&!W.startsWith("_"))return A=W,true}return false},true),A},fn=u=>{let T=rt(u),A=Fr(u);return T&&A?`<${T}> in ${A}`:T?`<${T}>`:"<element>"},dn=u=>{try{let T=u.map(A=>({tagName:rt(A)}));window.dispatchEvent(new CustomEvent("react-grab:element-selected",{detail:{elements:T}}));}catch{}},At=async(u,T,A)=>{Z(u),V(T),N(true),Lr(),await A().finally(()=>{N(false),it();});},$r=async u=>{xe(cn(u)),await new Promise(T=>requestAnimationFrame(T));try{let T=await sn(u),A=tt(T),Y=un([{tagName:rt(u),content:T,computedStyles:nt(u)}]);await an([A,Y]);}catch{}Ne(fn(u),D(),j()),dn([u]);},mn=async u=>{if(u.length!==0){for(let T of u)xe(cn(T));await new Promise(T=>requestAnimationFrame(T));try{let T=await Promise.all(u.map(oe=>sn(oe))),A=T.filter(oe=>oe.trim()).map(oe=>tt(oe)).join(`
|
|
26
26
|
|
|
27
|
-
`),
|
|
27
|
+
`),Y=T.map((oe,st)=>({tagName:rt(u[st]),content:oe,computedStyles:nt(u[st])})),W=un(Y);await an([A,W]);}catch{}Ne(`${u.length} elements`,D(),j()),dn(u);}},Ie=U(()=>!ye()||d()?null:ln(s(),l())),kr=U(()=>{let u=Ie();if(!u)return;let T=u.getBoundingClientRect(),A=window.getComputedStyle(u);return {borderRadius:A.borderRadius||"0px",height:T.height,transform:A.transform||"none",width:T.width,x:T.left,y:T.top}}),ot=2,hn=(u,T)=>({x:Math.abs(u-x()),y:Math.abs(T-w())}),gn=U(()=>{if(!d())return false;let u=hn(s(),l());return u.x>ot||u.y>ot}),pn=(u,T)=>{let A=Math.min(x(),u),Y=Math.min(w(),T),W=Math.abs(u-x()),oe=Math.abs(T-w());return {x:A,y:Y,width:W,height:oe}},Ir=U(()=>{if(!gn())return;let u=pn(s(),l());return {borderRadius:"0px",height:u.height,transform:"none",width:u.width,x:u.x,y:u.y}}),Mr=U(()=>{let u=Ie();return u?fn(u):"<element>"}),bn=U(()=>O()?{x:D(),y:j()}:{x:s(),y:l()}),yn=U(()=>O()?{x:D(),y:j()}:{x:s(),y:l()}),Pr=U(()=>!!(Ie()&&Ie()===S()));se(_e(()=>[Ie(),S()],([u,T])=>{T&&u&&T!==u&&$(null);}));let wn=U(()=>{let u=R();if(z(),u===null)return 0;let A=(Date.now()-u)/t.keyHoldDuration,Y=1-Math.exp(-A),W=.95;return O()?Math.min(Y,W):1}),Lr=()=>{P(Date.now()),v(false),re=window.setTimeout(()=>{v(true),re=null;},_i);let u=()=>{if(R()===null)return;K(A=>A+1),wn()<1&&(X=requestAnimationFrame(u));};u();},it=()=>{X!==null&&(cancelAnimationFrame(X),X=null),re!==null&&(window.clearTimeout(re),re=null),P(null),v(false);},Ft=()=>{it(),c(true),document.body.style.cursor="crosshair";},Ge=()=>{i(false),c(false),document.body.style.cursor="",d()&&(m(false),document.body.style.userSelect=""),F&&window.clearTimeout(F),de&&window.clearTimeout(de),ne&&(window.clearTimeout(ne),ne=null),q(false),ce=-1e3,Te=-1e3,it();},Sn=new AbortController,Me=Sn.signal;window.addEventListener("keydown",u=>{if(u.key==="Escape"&&o()){Ge();return}if(!(!t.allowActivationInsideInput&&Dn(u))&&le(u)){if(g()){de!==null&&window.clearTimeout(de),de=window.setTimeout(()=>{Ge();},200);return}u.repeat||(F!==null&&window.clearTimeout(F),o()||i(true),F=window.setTimeout(()=>{Ft(),t.onActivate?.();},t.keyHoldDuration));}},{signal:Me}),window.addEventListener("keyup",u=>{if(!o()&&!g())return;let T=!u.metaKey&&!u.ctrlKey;(u.key.toLowerCase()==="c"||T)&&Ge();},{signal:Me,capture:true}),window.addEventListener("mousemove",u=>{a(u.clientX),f(u.clientY),ce===-1e3&&(ce=u.clientX,Te=u.clientY);let T=u.clientX-ce,A=u.clientY-Te;Math.sqrt(T*T+A*A)>=200?(ne!==null&&window.clearTimeout(ne),q(false),ce=u.clientX,Te=u.clientY,ne=window.setTimeout(()=>{q(true),ce=s(),Te=l(),ne=null;},100)):ne===null&&!Q()&&(ne=window.setTimeout(()=>{q(true),ce=s(),Te=l(),ne=null;},100));},{signal:Me}),window.addEventListener("mousedown",u=>{!ye()||O()||(u.preventDefault(),m(true),C(u.clientX),E(u.clientY),document.body.style.userSelect="none");},{signal:Me}),window.addEventListener("mouseup",u=>{if(!d())return;let T=hn(u.clientX,u.clientY),A=T.x>ot||T.y>ot;if(m(false),document.body.style.userSelect="",A){B(true);let Y=pn(u.clientX,u.clientY),W=Nr(Y,et);if(W.length>0)At(u.clientX,u.clientY,()=>mn(W));else {let oe=Or(Y,et);oe.length>0&&At(u.clientX,u.clientY,()=>mn(oe));}}else {let Y=ln(u.clientX,u.clientY);if(!Y)return;$(Y),At(u.clientX,u.clientY,()=>$r(Y));}},{signal:Me}),window.addEventListener("click",u=>{(ye()||O()||M())&&(u.preventDefault(),u.stopPropagation(),M()&&B(false));},{signal:Me,capture:true}),document.addEventListener("visibilitychange",()=>{document.hidden&&_([]);},{signal:Me}),he(()=>{Sn.abort(),F&&window.clearTimeout(F),de&&window.clearTimeout(de),ne&&window.clearTimeout(ne),it(),document.body.style.userSelect="",document.body.style.cursor="";});let Dr=Hn(),Hr=U(()=>false),Br=U(()=>ye()&&gn()),jr=U(()=>O()?"processing":"hover"),Vr=U(()=>ye()&&!d()&&Q()&&(!!Ie()&&!Pr()||!Ie())||O()),Yr=U(()=>O()&&b()&&Ce()),Gr=U(()=>ye()&&!d());return Pn(()=>I(Gn,{get selectionVisible(){return Hr()},get selectionBounds(){return kr()},get dragVisible(){return Br()},get dragBounds(){return Ir()},get grabbedBoxes(){return y()},get successLabels(){return H()},get labelVariant(){return jr()},get labelText(){return Mr()},get labelX(){return bn().x},get labelY(){return bn().y},get labelVisible(){return Vr()},get progressVisible(){return Yr()},get progress(){return wn()},get mouseX(){return yn().x},get mouseY(){return yn().y},get crosshairVisible(){return Gr()}}),Dr),{activate:()=>{g()||(Ft(),t.onActivate?.());},deactivate:()=>{g()&&Ge();},toggle:()=>{g()?Ge():(Ft(),t.onActivate?.());},isActive:()=>g(),dispose:n}})};var Ar=null,Il=()=>Ar;Ar=_r();/*! Bundled license information:
|
|
28
28
|
|
|
29
29
|
bippy/dist/rdt-hook-DAGphl8S.js:
|
|
30
30
|
(**
|
|
@@ -85,4 +85,4 @@ bippy/dist/source.js:
|
|
|
85
85
|
* This source code is licensed under the MIT license found in the
|
|
86
86
|
* LICENSE file in the root directory of this source tree.
|
|
87
87
|
*)
|
|
88
|
-
*/exports.getGlobalApi=
|
|
88
|
+
*/exports.getGlobalApi=Il;exports.init=_r;return exports;})({});
|
package/dist/index.js
CHANGED
|
@@ -258,9 +258,10 @@ var getClampedElementPosition = (positionLeft, positionTop, elementWidth, elemen
|
|
|
258
258
|
// src/components/label.tsx
|
|
259
259
|
var _tmpl$3 = /* @__PURE__ */ template(`<span style=display:inline-block;margin-right:4px;font-weight:600>\u2713`);
|
|
260
260
|
var _tmpl$22 = /* @__PURE__ */ template(`<div style=margin-right:4px>Copied`);
|
|
261
|
-
var _tmpl$32 = /* @__PURE__ */ template(`<span style="font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;font-variant-numeric:tabular-nums">`);
|
|
262
|
-
var _tmpl$4 = /* @__PURE__ */ template(`<
|
|
263
|
-
var _tmpl$5 = /* @__PURE__ */ template(`<div style=
|
|
261
|
+
var _tmpl$32 = /* @__PURE__ */ template(`<span style="font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;font-variant-numeric:tabular-nums;vertical-align:middle">`);
|
|
262
|
+
var _tmpl$4 = /* @__PURE__ */ template(`<span style=font-variant-numeric:tabular-nums;font-size:10px;margin-left:4px;vertical-align:middle>`);
|
|
263
|
+
var _tmpl$5 = /* @__PURE__ */ template(`<div style=margin-left:4px>to clipboard`);
|
|
264
|
+
var _tmpl$6 = /* @__PURE__ */ template(`<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">`);
|
|
264
265
|
var Label = (props) => {
|
|
265
266
|
const [opacity, setOpacity] = createSignal(0);
|
|
266
267
|
const [positionTick, setPositionTick] = createSignal(0);
|
|
@@ -358,12 +359,26 @@ var Label = (props) => {
|
|
|
358
359
|
fallback.top += INDICATOR_CLAMP_PADDING_PX;
|
|
359
360
|
return fallback;
|
|
360
361
|
};
|
|
362
|
+
const labelSegments = () => {
|
|
363
|
+
const separator = " in ";
|
|
364
|
+
const separatorIndex = props.text.indexOf(separator);
|
|
365
|
+
if (separatorIndex === -1) {
|
|
366
|
+
return {
|
|
367
|
+
primary: props.text,
|
|
368
|
+
secondary: ""
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
return {
|
|
372
|
+
primary: props.text.slice(0, separatorIndex),
|
|
373
|
+
secondary: props.text.slice(separatorIndex)
|
|
374
|
+
};
|
|
375
|
+
};
|
|
361
376
|
return createComponent(Show, {
|
|
362
377
|
get when() {
|
|
363
378
|
return props.visible !== false;
|
|
364
379
|
},
|
|
365
380
|
get children() {
|
|
366
|
-
var _el$ = _tmpl$
|
|
381
|
+
var _el$ = _tmpl$6();
|
|
367
382
|
var _ref$ = labelRef;
|
|
368
383
|
typeof _ref$ === "function" ? use(_ref$, _el$) : labelRef = _el$;
|
|
369
384
|
insert(_el$, createComponent(Show, {
|
|
@@ -401,9 +416,20 @@ var Label = (props) => {
|
|
|
401
416
|
return props.variant !== "processing";
|
|
402
417
|
},
|
|
403
418
|
get children() {
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
419
|
+
return [(() => {
|
|
420
|
+
var _el$4 = _tmpl$32();
|
|
421
|
+
insert(_el$4, () => labelSegments().primary);
|
|
422
|
+
return _el$4;
|
|
423
|
+
})(), createComponent(Show, {
|
|
424
|
+
get when() {
|
|
425
|
+
return memo(() => props.variant === "hover")() && labelSegments().secondary !== "";
|
|
426
|
+
},
|
|
427
|
+
get children() {
|
|
428
|
+
var _el$5 = _tmpl$4();
|
|
429
|
+
insert(_el$5, () => labelSegments().secondary);
|
|
430
|
+
return _el$5;
|
|
431
|
+
}
|
|
432
|
+
})];
|
|
407
433
|
}
|
|
408
434
|
}), null);
|
|
409
435
|
insert(_el$, createComponent(Show, {
|
|
@@ -411,7 +437,7 @@ var Label = (props) => {
|
|
|
411
437
|
return props.variant === "success";
|
|
412
438
|
},
|
|
413
439
|
get children() {
|
|
414
|
-
return _tmpl$
|
|
440
|
+
return _tmpl$5();
|
|
415
441
|
}
|
|
416
442
|
}), null);
|
|
417
443
|
effect((_p$) => {
|
|
@@ -431,7 +457,7 @@ var Label = (props) => {
|
|
|
431
457
|
}
|
|
432
458
|
});
|
|
433
459
|
};
|
|
434
|
-
var _tmpl$
|
|
460
|
+
var _tmpl$7 = /* @__PURE__ */ template(`<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)">`);
|
|
435
461
|
var useFadeInOut = (visible) => {
|
|
436
462
|
const [opacity, setOpacity] = createSignal(0);
|
|
437
463
|
createEffect(on(() => visible, (isVisible) => {
|
|
@@ -464,7 +490,7 @@ var ProgressIndicator = (props) => {
|
|
|
464
490
|
return props.visible !== false;
|
|
465
491
|
},
|
|
466
492
|
get children() {
|
|
467
|
-
var _el$ = _tmpl$
|
|
493
|
+
var _el$ = _tmpl$7(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild;
|
|
468
494
|
var _ref$ = progressIndicatorRef;
|
|
469
495
|
typeof _ref$ === "function" ? use(_ref$, _el$) : progressIndicatorRef = _el$;
|
|
470
496
|
effect((_p$) => {
|
|
@@ -484,7 +510,7 @@ var ProgressIndicator = (props) => {
|
|
|
484
510
|
}
|
|
485
511
|
});
|
|
486
512
|
};
|
|
487
|
-
var _tmpl$
|
|
513
|
+
var _tmpl$8 = /* @__PURE__ */ template(`<canvas style=position:fixed;top:0;left:0;pointer-events:none;z-index:2147483645>`);
|
|
488
514
|
var Crosshair = (props) => {
|
|
489
515
|
let canvasRef;
|
|
490
516
|
let context = null;
|
|
@@ -574,7 +600,7 @@ var Crosshair = (props) => {
|
|
|
574
600
|
return props.visible !== false;
|
|
575
601
|
},
|
|
576
602
|
get children() {
|
|
577
|
-
var _el$ = _tmpl$
|
|
603
|
+
var _el$ = _tmpl$8();
|
|
578
604
|
var _ref$ = canvasRef;
|
|
579
605
|
typeof _ref$ === "function" ? use(_ref$, _el$) : canvasRef = _el$;
|
|
580
606
|
return _el$;
|
|
@@ -706,6 +732,11 @@ var ReactGrabRenderer = (props) => {
|
|
|
706
732
|
}
|
|
707
733
|
})];
|
|
708
734
|
};
|
|
735
|
+
|
|
736
|
+
// src/utils/is-capitalized.ts
|
|
737
|
+
var isCapitalized = (value) => value.length > 0 && /^[A-Z]/.test(value);
|
|
738
|
+
|
|
739
|
+
// src/instrumentation.ts
|
|
709
740
|
instrument({
|
|
710
741
|
onCommitFiberRoot(_, fiberRoot) {
|
|
711
742
|
_fiberRoots.add(fiberRoot);
|
|
@@ -714,40 +745,36 @@ instrument({
|
|
|
714
745
|
var generateCSSSelector = (element) => {
|
|
715
746
|
return finder(element);
|
|
716
747
|
};
|
|
717
|
-
var
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
if (isCompositeFiber(currentFiber)) {
|
|
732
|
-
const displayName = getDisplayName(currentFiber);
|
|
733
|
-
if (displayName && !isInternalComponent(displayName)) {
|
|
734
|
-
componentName = displayName;
|
|
735
|
-
return true;
|
|
736
|
-
}
|
|
748
|
+
var truncateString = (string, maxLength) => string.length > maxLength ? `${string.substring(0, maxLength)}...` : string;
|
|
749
|
+
var isInternalComponent = (name) => !isCapitalized(name) || name.startsWith("_") || name.includes("Provider") && name.includes("Context");
|
|
750
|
+
var getNearestComponentDisplayName = (element) => {
|
|
751
|
+
const fiber = getFiberFromHostInstance(element);
|
|
752
|
+
if (!fiber) return null;
|
|
753
|
+
let componentName = null;
|
|
754
|
+
traverseFiber(
|
|
755
|
+
fiber,
|
|
756
|
+
(currentFiber) => {
|
|
757
|
+
if (isCompositeFiber(currentFiber)) {
|
|
758
|
+
const displayName = getDisplayName(currentFiber);
|
|
759
|
+
if (displayName && !isInternalComponent(displayName)) {
|
|
760
|
+
componentName = displayName;
|
|
761
|
+
return true;
|
|
737
762
|
}
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
}
|
|
763
|
+
}
|
|
764
|
+
return false;
|
|
765
|
+
},
|
|
766
|
+
true
|
|
767
|
+
);
|
|
768
|
+
return componentName;
|
|
769
|
+
};
|
|
770
|
+
var formatComponentSourceLocation = async (el) => {
|
|
771
|
+
const source = await getSourceFromHostInstance(el);
|
|
772
|
+
if (!source) return null;
|
|
773
|
+
const fileName = normalizeFileName(source.fileName);
|
|
774
|
+
if (!isSourceFile(fileName)) return null;
|
|
775
|
+
return `${fileName}:${source.lineNumber}:${source.columnNumber}`;
|
|
776
|
+
};
|
|
777
|
+
var getHTMLSnippet = async (element) => {
|
|
751
778
|
const semanticTags = /* @__PURE__ */ new Set([
|
|
752
779
|
"article",
|
|
753
780
|
"aside",
|
|
@@ -836,9 +863,9 @@ var getHTMLSnippet = async (element) => {
|
|
|
836
863
|
lines.push("```html");
|
|
837
864
|
const ancestors = collectDistinguishingAncestors(element);
|
|
838
865
|
const ancestorComponents = ancestors.map(
|
|
839
|
-
(ancestor) =>
|
|
866
|
+
(ancestor) => getNearestComponentDisplayName(ancestor)
|
|
840
867
|
);
|
|
841
|
-
const elementComponent =
|
|
868
|
+
const elementComponent = getNearestComponentDisplayName(element);
|
|
842
869
|
const ancestorSources = await Promise.all(
|
|
843
870
|
ancestors.map((ancestor) => formatComponentSourceLocation(ancestor))
|
|
844
871
|
);
|
|
@@ -1229,6 +1256,33 @@ ${context}
|
|
|
1229
1256
|
});
|
|
1230
1257
|
};
|
|
1231
1258
|
const extractElementTagName = (element) => (element.tagName || "").toLowerCase();
|
|
1259
|
+
const extractNearestComponentName = (element) => {
|
|
1260
|
+
const fiber = getFiberFromHostInstance(element);
|
|
1261
|
+
if (!fiber) return null;
|
|
1262
|
+
let componentName = null;
|
|
1263
|
+
traverseFiber(fiber, (currentFiber) => {
|
|
1264
|
+
if (isCompositeFiber(currentFiber)) {
|
|
1265
|
+
const displayName = getDisplayName(currentFiber);
|
|
1266
|
+
if (displayName && isCapitalized(displayName) && !displayName.startsWith("_")) {
|
|
1267
|
+
componentName = displayName;
|
|
1268
|
+
return true;
|
|
1269
|
+
}
|
|
1270
|
+
}
|
|
1271
|
+
return false;
|
|
1272
|
+
}, true);
|
|
1273
|
+
return componentName;
|
|
1274
|
+
};
|
|
1275
|
+
const extractElementLabelText = (element) => {
|
|
1276
|
+
const tagName = extractElementTagName(element);
|
|
1277
|
+
const componentName = extractNearestComponentName(element);
|
|
1278
|
+
if (tagName && componentName) {
|
|
1279
|
+
return `<${tagName}> in ${componentName}`;
|
|
1280
|
+
}
|
|
1281
|
+
if (tagName) {
|
|
1282
|
+
return `<${tagName}>`;
|
|
1283
|
+
}
|
|
1284
|
+
return "<element>";
|
|
1285
|
+
};
|
|
1232
1286
|
const notifyElementsSelected = (elements) => {
|
|
1233
1287
|
try {
|
|
1234
1288
|
const elementsPayload = elements.map((element) => ({
|
|
@@ -1253,21 +1307,20 @@ ${context}
|
|
|
1253
1307
|
});
|
|
1254
1308
|
};
|
|
1255
1309
|
const copySingleElementToClipboard = async (targetElement2) => {
|
|
1256
|
-
const tagName = extractElementTagName(targetElement2);
|
|
1257
1310
|
showTemporaryGrabbedBox(createElementBounds(targetElement2));
|
|
1258
1311
|
await new Promise((resolve) => requestAnimationFrame(resolve));
|
|
1259
1312
|
try {
|
|
1260
1313
|
const content = await getHTMLSnippet(targetElement2);
|
|
1261
1314
|
const plainTextContent = wrapInSelectedElementTags(content);
|
|
1262
1315
|
const htmlContent = createStructuredClipboardHtmlBlob([{
|
|
1263
|
-
tagName,
|
|
1316
|
+
tagName: extractElementTagName(targetElement2),
|
|
1264
1317
|
content,
|
|
1265
1318
|
computedStyles: extractRelevantComputedStyles(targetElement2)
|
|
1266
1319
|
}]);
|
|
1267
1320
|
await copyContent([plainTextContent, htmlContent]);
|
|
1268
1321
|
} catch {
|
|
1269
1322
|
}
|
|
1270
|
-
showTemporarySuccessLabel(
|
|
1323
|
+
showTemporarySuccessLabel(extractElementLabelText(targetElement2), copyStartX(), copyStartY());
|
|
1271
1324
|
notifyElementsSelected([targetElement2]);
|
|
1272
1325
|
};
|
|
1273
1326
|
const copyMultipleElementsToClipboard = async (targetElements) => {
|
|
@@ -1345,7 +1398,7 @@ ${context}
|
|
|
1345
1398
|
});
|
|
1346
1399
|
const labelText = createMemo(() => {
|
|
1347
1400
|
const element = targetElement();
|
|
1348
|
-
return element ?
|
|
1401
|
+
return element ? extractElementLabelText(element) : "<element>";
|
|
1349
1402
|
});
|
|
1350
1403
|
const labelPosition = createMemo(() => isCopying() ? {
|
|
1351
1404
|
x: copyStartX(),
|
|
@@ -1372,7 +1425,13 @@ ${context}
|
|
|
1372
1425
|
progressTick();
|
|
1373
1426
|
if (startTime === null) return 0;
|
|
1374
1427
|
const elapsedTime = Date.now() - startTime;
|
|
1375
|
-
|
|
1428
|
+
const normalizedTime = elapsedTime / options.keyHoldDuration;
|
|
1429
|
+
const easedProgress = 1 - Math.exp(-normalizedTime);
|
|
1430
|
+
const maxProgressBeforeCompletion = 0.95;
|
|
1431
|
+
if (isCopying()) {
|
|
1432
|
+
return Math.min(easedProgress, maxProgressBeforeCompletion);
|
|
1433
|
+
}
|
|
1434
|
+
return 1;
|
|
1376
1435
|
});
|
|
1377
1436
|
const startProgressAnimation = () => {
|
|
1378
1437
|
setProgressStartTime(Date.now());
|