@mtngtools/frame-vue 0.0.25-experimental.0 → 0.0.27-experimental.0

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.
@@ -0,0 +1,1542 @@
1
+ import { i as IconPanelRight_default, n as IconPanelFull_default, r as IconPanelBottom_default, t as IconClose_default } from "./IconClose-B7WnTow-.js";
2
+ import { n as useSimpleLoggedIn } from "./useSimpleLoggedIn-DT4aMAWu.js";
3
+ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, getCurrentInstance, getCurrentScope, isRef, nextTick, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, onScopeDispose, onUnmounted, openBlock, readonly, ref, renderList, renderSlot, resolveDynamicComponent, shallowReadonly, shallowRef, toDisplayString, toRaw, toValue, unref, useSlots, vModelCheckbox, vShow, watch, withCtx, withDirectives, withModifiers } from "vue";
4
+ function tryOnScopeDispose(e, t) {
5
+ return getCurrentScope() ? (onScopeDispose(e, t), !0) : !1;
6
+ }
7
+ var isClient = typeof window < "u" && typeof document < "u";
8
+ typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
9
+ var toString = Object.prototype.toString, isObject = (e) => toString.call(e) === "[object Object]";
10
+ function createSingletonPromise(e) {
11
+ let t;
12
+ function n() {
13
+ return t ||= e(), t;
14
+ }
15
+ return n.reset = async () => {
16
+ let e = t;
17
+ t = void 0, e && await e;
18
+ }, n;
19
+ }
20
+ function toArray(e) {
21
+ return Array.isArray(e) ? e : [e];
22
+ }
23
+ function useIntervalFn(e, t = 1e3, n = {}) {
24
+ let { immediate: r = !0, immediateCallback: i = !1 } = n, a = null, o = shallowRef(!1);
25
+ function s() {
26
+ a &&= (clearInterval(a), null);
27
+ }
28
+ function c() {
29
+ o.value = !1, s();
30
+ }
31
+ function l() {
32
+ let n = toValue(t);
33
+ n <= 0 || (o.value = !0, i && e(), s(), o.value && (a = setInterval(e, n)));
34
+ }
35
+ return r && isClient && l(), (isRef(t) || typeof t == "function") && tryOnScopeDispose(watch(t, () => {
36
+ o.value && isClient && l();
37
+ })), tryOnScopeDispose(c), {
38
+ isActive: shallowReadonly(o),
39
+ pause: c,
40
+ resume: l
41
+ };
42
+ }
43
+ function useTimeoutFn(e, t, n = {}) {
44
+ let { immediate: r = !0, immediateCallback: i = !1 } = n, a = shallowRef(!1), o;
45
+ function s() {
46
+ o &&= (clearTimeout(o), void 0);
47
+ }
48
+ function c() {
49
+ a.value = !1, s();
50
+ }
51
+ function l(...n) {
52
+ i && e(), s(), a.value = !0, o = setTimeout(() => {
53
+ a.value = !1, o = void 0, e(...n);
54
+ }, toValue(t));
55
+ }
56
+ return r && (a.value = !0, isClient && l()), tryOnScopeDispose(c), {
57
+ isPending: shallowReadonly(a),
58
+ start: l,
59
+ stop: c
60
+ };
61
+ }
62
+ function watchImmediate(e, t, n) {
63
+ return watch(e, t, {
64
+ ...n,
65
+ immediate: !0
66
+ });
67
+ }
68
+ var defaultWindow = isClient ? window : void 0;
69
+ isClient && window.document;
70
+ var defaultNavigator = isClient ? window.navigator : void 0;
71
+ isClient && window.location;
72
+ function unrefElement(e) {
73
+ let t = toValue(e);
74
+ return t?.$el ?? t;
75
+ }
76
+ function useEventListener(...e) {
77
+ let t = (e, t, n, r) => (e.addEventListener(t, n, r), () => e.removeEventListener(t, n, r)), n = computed(() => {
78
+ let t = toArray(toValue(e[0])).filter((e) => e != null);
79
+ return t.every((e) => typeof e != "string") ? t : void 0;
80
+ });
81
+ return watchImmediate(() => [
82
+ n.value?.map((e) => unrefElement(e)) ?? [defaultWindow].filter((e) => e != null),
83
+ toArray(toValue(n.value ? e[1] : e[0])),
84
+ toArray(unref(n.value ? e[2] : e[1])),
85
+ toValue(n.value ? e[3] : e[2])
86
+ ], ([e, n, r, i], a, o) => {
87
+ if (!e?.length || !n?.length || !r?.length) return;
88
+ let s = isObject(i) ? { ...i } : i, c = e.flatMap((e) => n.flatMap((n) => r.map((r) => t(e, n, r, s))));
89
+ o(() => {
90
+ c.forEach((e) => e());
91
+ });
92
+ }, { flush: "post" });
93
+ }
94
+ function useMounted() {
95
+ let e = shallowRef(!1), t = getCurrentInstance();
96
+ return t && onMounted(() => {
97
+ e.value = !0;
98
+ }, t), e;
99
+ }
100
+ /* @__NO_SIDE_EFFECTS__ */
101
+ function useSupported(e) {
102
+ let t = useMounted();
103
+ return computed(() => (t.value, !!e()));
104
+ }
105
+ function usePermission(e, t = {}) {
106
+ let { controls: n = !1, navigator: r = defaultNavigator } = t, i = /* @__PURE__ */ useSupported(() => r && "permissions" in r), a = shallowRef(), o = typeof e == "string" ? { name: e } : e, s = shallowRef(), c = () => {
107
+ s.value = a.value?.state ?? "prompt";
108
+ };
109
+ useEventListener(a, "change", c, { passive: !0 });
110
+ let l = createSingletonPromise(async () => {
111
+ if (i.value) {
112
+ if (!a.value) try {
113
+ a.value = await r.permissions.query(o);
114
+ } catch {
115
+ a.value = void 0;
116
+ } finally {
117
+ c();
118
+ }
119
+ if (n) return toRaw(a.value);
120
+ }
121
+ });
122
+ return l(), n ? {
123
+ state: s,
124
+ isSupported: i,
125
+ query: l
126
+ } : s;
127
+ }
128
+ function useClipboard(e = {}) {
129
+ let { navigator: t = defaultNavigator, read: n = !1, source: r, copiedDuring: i = 1500, legacy: a = !1 } = e, s = /* @__PURE__ */ useSupported(() => t && "clipboard" in t), c = usePermission("clipboard-read"), l = usePermission("clipboard-write"), u = computed(() => s.value || a), d = shallowRef(""), f = shallowRef(!1), p = useTimeoutFn(() => f.value = !1, i, { immediate: !1 });
130
+ async function m() {
131
+ let e = !(s.value && v(c.value));
132
+ if (!e) try {
133
+ d.value = await t.clipboard.readText();
134
+ } catch {
135
+ e = !0;
136
+ }
137
+ e && (d.value = _());
138
+ }
139
+ u.value && n && useEventListener(["copy", "cut"], m, { passive: !0 });
140
+ async function h(e = toValue(r)) {
141
+ if (u.value && e != null) {
142
+ let n = !(s.value && v(l.value));
143
+ if (!n) try {
144
+ await t.clipboard.writeText(e);
145
+ } catch {
146
+ n = !0;
147
+ }
148
+ n && g(e), d.value = e, f.value = !0, p.start();
149
+ }
150
+ }
151
+ function g(e) {
152
+ let t = document.createElement("textarea");
153
+ t.value = e, t.style.position = "absolute", t.style.opacity = "0", t.setAttribute("readonly", ""), document.body.appendChild(t), t.select(), document.execCommand("copy"), t.remove();
154
+ }
155
+ function _() {
156
+ var e, t;
157
+ return ((e = document) == null || (t = e.getSelection) == null || (t = t.call(e)) == null ? void 0 : t.toString()) ?? "";
158
+ }
159
+ function v(e) {
160
+ return e === "granted" || e === "prompt";
161
+ }
162
+ return {
163
+ isSupported: u,
164
+ text: readonly(d),
165
+ copied: readonly(f),
166
+ copy: h
167
+ };
168
+ }
169
+ var _hoisted_1$5 = ["disabled"], SidePanelControlButton_default = /* @__PURE__ */ defineComponent({
170
+ __name: "SidePanelControlButton",
171
+ props: {
172
+ state: {},
173
+ active: {
174
+ type: Boolean,
175
+ default: !1
176
+ },
177
+ activeResolved: {
178
+ type: Boolean,
179
+ default: !1
180
+ },
181
+ disabled: {
182
+ type: Boolean,
183
+ default: !1
184
+ },
185
+ hideIcon: {
186
+ type: Boolean,
187
+ default: !1
188
+ }
189
+ },
190
+ emits: ["click"],
191
+ setup(i, { emit: a }) {
192
+ let u = i, f = a, p = {
193
+ auto: "Auto",
194
+ right: "Right",
195
+ bottom: "Bottom",
196
+ full: "Full",
197
+ minimized: "Close"
198
+ }, m = {
199
+ auto: null,
200
+ right: IconPanelRight_default,
201
+ bottom: IconPanelBottom_default,
202
+ full: IconPanelFull_default,
203
+ minimized: IconClose_default
204
+ }, h = computed(() => p[u.state]), g = computed(() => {
205
+ if (u.disabled) return "cursor-not-allowed border-neutral-700 text-neutral-500";
206
+ {
207
+ let e = "cursor-pointer";
208
+ return u.activeResolved ? `${e} text-accent-400/80 bg-accent/20 border-accent-900/10` : `${e} text-accent-200 bg-accent/50 hover:bg-accent/90 border-accent hover:text-white hover:border-white`;
209
+ }
210
+ });
211
+ function _() {
212
+ u.disabled || f("click", u.state);
213
+ }
214
+ return (e, t) => (openBlock(), createElementBlock("button", {
215
+ type: "button",
216
+ disabled: i.disabled,
217
+ class: normalizeClass(g.value),
218
+ style: {
219
+ display: "inline-flex",
220
+ alignItems: "center",
221
+ gap: "0.25rem",
222
+ borderRadius: "0.375rem",
223
+ borderWidth: "1px",
224
+ borderStyle: "solid",
225
+ paddingLeft: "0.375rem",
226
+ paddingRight: "0.375rem",
227
+ paddingTop: "0.125rem",
228
+ paddingBottom: "0.125rem",
229
+ fontSize: "0.70rem",
230
+ lineHeight: "1.2rem",
231
+ textTransform: "uppercase"
232
+ },
233
+ onClick: _
234
+ }, [renderSlot(e.$slots, "icon", { state: i.state }, () => [!i.hideIcon && m[i.state] ? (openBlock(), createBlock(resolveDynamicComponent(m[i.state]), {
235
+ key: 0,
236
+ style: {
237
+ width: ".85em",
238
+ height: ".85em"
239
+ }
240
+ })) : createCommentVNode("", !0)]), renderSlot(e.$slots, "label", { state: i.state }, () => [createTextVNode(toDisplayString(h.value), 1)])], 10, _hoisted_1$5));
241
+ }
242
+ }), _hoisted_1$4 = {
243
+ class: "",
244
+ style: {
245
+ display: "flex",
246
+ alignItems: "center",
247
+ gap: "0.5rem"
248
+ }
249
+ }, SidePanelButtonGroup_default = /* @__PURE__ */ defineComponent({
250
+ __name: "SidePanelButtonGroup",
251
+ props: {
252
+ sidePanelMode: { default: "none" },
253
+ sidePanelModeResolved: { default: "none" },
254
+ availableStates: { default: () => [] },
255
+ overlayOnly: {
256
+ type: Boolean,
257
+ default: !1
258
+ },
259
+ hideIcons: {
260
+ type: Boolean,
261
+ default: !1
262
+ }
263
+ },
264
+ emits: ["setSidePanelMode", "closeSidePanel"],
265
+ setup(e, { emit: t }) {
266
+ let n = e, r = t, i = computed(() => n.sidePanelModeResolved !== "none"), d = computed(() => n.overlayOnly && n.sidePanelModeResolved === "full" ? n.availableStates.includes("minimized") ? ["minimized"] : [] : n.availableStates);
267
+ function f(e) {
268
+ r("setSidePanelMode", e);
269
+ }
270
+ function p() {
271
+ r("closeSidePanel");
272
+ }
273
+ return (t, n) => i.value ? renderSlot(t.$slots, "default", {
274
+ key: 0,
275
+ sidePanelMode: e.sidePanelMode,
276
+ sidePanelModeResolved: e.sidePanelModeResolved,
277
+ availableStates: e.availableStates,
278
+ overlayOnly: e.overlayOnly,
279
+ setSidePanelMode: f,
280
+ closeSidePanel: p
281
+ }, () => [createElementVNode("div", _hoisted_1$4, [(openBlock(!0), createElementBlock(Fragment, null, renderList(d.value, (t) => (openBlock(), createBlock(SidePanelControlButton_default, {
282
+ key: t,
283
+ state: t,
284
+ active: t === e.sidePanelMode,
285
+ "active-resolved": t === e.sidePanelModeResolved,
286
+ "hide-icon": e.hideIcons,
287
+ onClick: f
288
+ }, null, 8, [
289
+ "state",
290
+ "active",
291
+ "active-resolved",
292
+ "hide-icon"
293
+ ]))), 128))])]) : createCommentVNode("", !0);
294
+ }
295
+ }), _hoisted_1$3 = {
296
+ key: 0,
297
+ class: "",
298
+ style: {
299
+ display: "flex",
300
+ height: "100%",
301
+ minHeight: 0,
302
+ minWidth: 0,
303
+ alignItems: "center",
304
+ justifyContent: "space-between",
305
+ gap: "0.5rem",
306
+ overflow: "hidden",
307
+ padding: "0.5rem 0.5rem"
308
+ }
309
+ }, _hoisted_2$2 = {
310
+ key: 1,
311
+ class: "text-sm font-medium text-neutral-100",
312
+ style: {
313
+ minWidth: 0,
314
+ minHeight: 0,
315
+ margin: 0,
316
+ textAlign: "left"
317
+ }
318
+ }, _hoisted_3$2 = {
319
+ key: 0,
320
+ style: {
321
+ display: "flex",
322
+ alignItems: "center",
323
+ justifyContent: "flex-end",
324
+ minWidth: 0,
325
+ minHeight: 0,
326
+ marginLeft: "auto"
327
+ }
328
+ }, SidePanelHeader_default = /* @__PURE__ */ defineComponent({
329
+ __name: "SidePanelHeader",
330
+ props: {
331
+ title: { default: "Submit Questions" },
332
+ showTitleLabel: {
333
+ type: Boolean,
334
+ default: !0
335
+ },
336
+ sidePanelMode: { default: "none" },
337
+ sidePanelModeResolved: { default: "none" },
338
+ overlayOnly: {
339
+ type: Boolean,
340
+ default: !1
341
+ },
342
+ availableStates: { default: () => [] }
343
+ },
344
+ emits: ["setSidePanelMode", "closeSidePanel"],
345
+ setup(e, { emit: t }) {
346
+ let n = e, r = t, i = useSlots(), d = computed(() => n.sidePanelModeResolved !== "none"), f = computed(() => n.sidePanelModeResolved === "minimized"), p = computed(() => !!i.default), m = computed(() => !!i.controls), h = computed(() => !f.value);
347
+ return (t, n) => d.value ? (openBlock(), createElementBlock("header", _hoisted_1$3, [createElementVNode("div", { style: normalizeStyle({
348
+ display: "flex",
349
+ flex: f.value && !p.value ? "1 1 auto" : "0 1 auto",
350
+ minWidth: 0,
351
+ minHeight: 0,
352
+ alignItems: "center",
353
+ justifyContent: f.value && !p.value ? "center" : "flex-start",
354
+ overflow: "hidden"
355
+ }) }, [p.value ? renderSlot(t.$slots, "default", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [f.value ? (openBlock(), createElementBlock("button", {
356
+ key: 0,
357
+ type: "button",
358
+ class: "text-accent-200 bg-accent/50 hover:bg-accent/90 border-accent hover:text-white hover:border-white",
359
+ style: {
360
+ display: "inline-flex",
361
+ alignItems: "center",
362
+ gap: "0.25rem",
363
+ borderRadius: "0.375rem 0.375rem 0 0",
364
+ borderWidth: "1px",
365
+ borderStyle: "solid",
366
+ paddingLeft: "0.375rem",
367
+ paddingRight: "0.375rem",
368
+ paddingTop: "0.125rem",
369
+ paddingBottom: "0.125rem",
370
+ fontSize: "0.70rem",
371
+ lineHeight: "1.2rem",
372
+ textTransform: "uppercase"
373
+ },
374
+ onClick: n[0] ||= (e) => r("setSidePanelMode", "auto")
375
+ }, toDisplayString(e.title), 1)) : e.showTitleLabel ? (openBlock(), createElementBlock("h2", _hoisted_2$2, toDisplayString(e.title) + ": ", 1)) : createCommentVNode("", !0)], 64))], 4), m.value || h.value ? (openBlock(), createElementBlock("div", _hoisted_3$2, [renderSlot(t.$slots, "controls", {}, () => [h.value ? (openBlock(), createBlock(SidePanelButtonGroup_default, {
376
+ key: 0,
377
+ "side-panel-mode": e.sidePanelMode,
378
+ "side-panel-mode-resolved": e.sidePanelModeResolved,
379
+ "available-states": e.availableStates,
380
+ "overlay-only": e.overlayOnly,
381
+ onSetSidePanelMode: n[1] ||= (e) => r("setSidePanelMode", e),
382
+ onCloseSidePanel: n[2] ||= (e) => r("closeSidePanel")
383
+ }, null, 8, [
384
+ "side-panel-mode",
385
+ "side-panel-mode-resolved",
386
+ "available-states",
387
+ "overlay-only"
388
+ ])) : createCommentVNode("", !0)])])) : createCommentVNode("", !0)])) : createCommentVNode("", !0);
389
+ }
390
+ }), _hoisted_1$2 = {
391
+ key: 0,
392
+ class: "",
393
+ style: {
394
+ width: "100%",
395
+ height: "100%"
396
+ }
397
+ }, _hoisted_2$1 = {
398
+ class: "",
399
+ style: {
400
+ gridColumn: "1 / 2",
401
+ gridRow: "1 / 2",
402
+ minWidth: 0,
403
+ minHeight: 0,
404
+ overflow: "hidden"
405
+ }
406
+ }, _hoisted_3$1 = {
407
+ class: "",
408
+ style: {
409
+ gridColumn: "1 / 2",
410
+ gridRow: "2 / 3",
411
+ minWidth: 0,
412
+ minHeight: 0,
413
+ width: "100%",
414
+ height: "100%",
415
+ display: "grid",
416
+ placeContent: "stretch"
417
+ }
418
+ }, SidePanelFrame_default = /* @__PURE__ */ defineComponent({
419
+ __name: "SidePanelFrame",
420
+ props: {
421
+ sidePanelMode: { default: "none" },
422
+ sidePanelModeResolved: { default: "none" },
423
+ availableStates: { default: () => [] },
424
+ overlayOnly: {
425
+ type: Boolean,
426
+ default: !1
427
+ },
428
+ showTitleLabel: {
429
+ type: Boolean,
430
+ default: !1
431
+ },
432
+ hideIcons: {
433
+ type: Boolean,
434
+ default: !1
435
+ },
436
+ minWidth: { default: "320px" },
437
+ maxWidth: { default: "30vw" },
438
+ minHeight: { default: "200px" },
439
+ maxHeight: { default: "30vh" }
440
+ },
441
+ emits: ["setSidePanelMode", "closeSidePanel"],
442
+ setup(e, { emit: t }) {
443
+ let n = e, r = t, i = computed(() => n.sidePanelModeResolved !== "none"), a = computed(() => n.sidePanelModeResolved === "minimized"), s = computed(() => {
444
+ let e = {
445
+ width: "100%",
446
+ height: "100%",
447
+ display: "grid",
448
+ overflow: "hidden",
449
+ placeItems: "stretch"
450
+ };
451
+ return n.sidePanelModeResolved === "full" || n.sidePanelModeResolved === "right" || n.sidePanelModeResolved === "bottom" ? e : {
452
+ ...e,
453
+ placeItems: "end center"
454
+ };
455
+ }), d = computed(() => {
456
+ if (n.sidePanelModeResolved === "full") return {
457
+ width: "100%",
458
+ height: "100%"
459
+ };
460
+ if (n.sidePanelModeResolved === "right") return {
461
+ minWidth: n.minWidth,
462
+ maxWidth: n.maxWidth,
463
+ width: "100%"
464
+ };
465
+ if (n.sidePanelModeResolved === "bottom") return {
466
+ minHeight: n.minHeight,
467
+ maxHeight: n.maxHeight,
468
+ height: "100%",
469
+ width: "100%"
470
+ };
471
+ }), p = computed(() => (n.sidePanelModeResolved === "full" && n.overlayOnly, {
472
+ maxWidth: "100%",
473
+ maxHeight: "100%",
474
+ minHeight: 0,
475
+ minWidth: 0,
476
+ overflow: "hidden"
477
+ })), m = computed(() => ({
478
+ display: "grid",
479
+ gridTemplateColumns: "1fr",
480
+ gridTemplateRows: a.value ? "max-content" : "max-content minmax(0, 1fr)"
481
+ })), h = computed(() => n.overlayOnly ? "border-neutral-700 bg-black/95" : "");
482
+ return (t, n) => i.value ? (openBlock(), createElementBlock("div", _hoisted_1$2, [createElementVNode("div", { style: normalizeStyle(s.value) }, [createElementVNode("section", {
483
+ "data-test": "side-panel-frame-shell",
484
+ class: normalizeClass(h.value),
485
+ style: normalizeStyle([
486
+ p.value,
487
+ d.value,
488
+ m.value
489
+ ])
490
+ }, [createElementVNode("div", _hoisted_2$1, [createVNode(SidePanelHeader_default, {
491
+ "show-title-label": e.showTitleLabel,
492
+ "side-panel-mode": e.sidePanelMode,
493
+ "side-panel-mode-resolved": e.sidePanelModeResolved,
494
+ "available-states": e.availableStates,
495
+ "overlay-only": e.overlayOnly,
496
+ "hide-icons": e.hideIcons,
497
+ onSetSidePanelMode: n[0] ||= (e) => r("setSidePanelMode", e),
498
+ onCloseSidePanel: n[1] ||= (e) => r("closeSidePanel")
499
+ }, null, 8, [
500
+ "show-title-label",
501
+ "side-panel-mode",
502
+ "side-panel-mode-resolved",
503
+ "available-states",
504
+ "overlay-only",
505
+ "hide-icons"
506
+ ])]), withDirectives(createElementVNode("div", _hoisted_3$1, [renderSlot(t.$slots, "default")], 512), [[vShow, !a.value]])], 6)], 4)])) : createCommentVNode("", !0);
507
+ }
508
+ }), _hoisted_1$1 = {
509
+ id: "header-outer",
510
+ style: {
511
+ position: "relative",
512
+ width: "100%",
513
+ margin: 0,
514
+ padding: 0
515
+ }
516
+ }, LiveFrame_default = /* @__PURE__ */ ((e, t) => {
517
+ let n = e.__vccOpts || e;
518
+ for (let [e, r] of t) n[e] = r;
519
+ return n;
520
+ })(/* @__PURE__ */ defineComponent({
521
+ __name: "LiveFrame",
522
+ props: {
523
+ sidePanelPosition: { default: "minimized" },
524
+ mainContentAspectRatio: { default: "16/9" },
525
+ autoBottomAspectRatioBreakpoint: { default: .9 },
526
+ autoRightAspectRatioBreakpoint: { default: 3.2 },
527
+ sidePanelBreakpoint: { default: "md" },
528
+ controlsOverlayOnly: { default: "sm" },
529
+ autoHideTimeout: { default: 5e3 },
530
+ layoutDebounceMs: { default: 50 },
531
+ sidePanelMinRight: { default: "20rem" },
532
+ sidePanelMaxRight: { default: "30vw" },
533
+ sidePanelMaxRightWide: { default: "40vw" },
534
+ sidePanelMinBottom: { default: "12.5rem" },
535
+ sidePanelMaxBottom: { default: "30vh" },
536
+ sidePanelMaxBottomTall: { default: "60vh" },
537
+ headerHideWidthThreshold: { default: "50rem" },
538
+ headerHideHeightThreshold: { default: "40rem" },
539
+ displaySidePanel: {
540
+ type: [
541
+ Boolean,
542
+ Function,
543
+ Object
544
+ ],
545
+ default: !0
546
+ },
547
+ displaySidePanelWindowFn: {},
548
+ hideSidePanelIcons: {
549
+ type: Boolean,
550
+ default: !1
551
+ },
552
+ enforceSlotSizingQuerySelector: {},
553
+ autoRefresh: {
554
+ type: Boolean,
555
+ default: !1
556
+ },
557
+ autoRefreshInterval: { default: 2e3 }
558
+ },
559
+ emits: [
560
+ "update:sidePanelPosition",
561
+ "sidePanelTransition",
562
+ "sidePanelAvailableStates",
563
+ "defaultSlotResize"
564
+ ],
565
+ setup(e, { expose: t, emit: n }) {
566
+ let r = e, i = n, a = useSlots(), p = ref(null), m = ref(null), h = ref(null), g = ref(0), v = ref(0), y = ref(0), b = ref(0), x = ref(0);
567
+ function S() {
568
+ let e = h.value;
569
+ if (!e) return;
570
+ let t = r.enforceSlotSizingQuerySelector ? Array.from(e.querySelectorAll(r.enforceSlotSizingQuerySelector)) : Array.from(e.children), n = `${x.value}px`;
571
+ t.forEach((e) => {
572
+ e.style.height !== n && (e.style.height = n);
573
+ });
574
+ }
575
+ let w = ref("none"), T = ref("none"), E = ref([]), D = ref("none"), O = ref(!0), k = ref(!1), A = {
576
+ sm: 640,
577
+ md: 768,
578
+ lg: 1024,
579
+ xl: 1280,
580
+ "2xl": 1536
581
+ }, j = computed(() => {
582
+ if (typeof window < "u" && r.displaySidePanelWindowFn && typeof window[r.displaySidePanelWindowFn] == "function") return !!window[r.displaySidePanelWindowFn]();
583
+ let e = unref(r.displaySidePanel);
584
+ return typeof e == "function" ? e() : !!e;
585
+ }), M = computed(() => !!a.sidePanelContent && j.value), N = computed(() => !!a.header), oe = computed(() => E.value.filter((e) => e !== "auto")), P = computed(() => Math.max(0, v.value - y.value)), F = computed(() => g.value < Se(r.controlsOverlayOnly)), se = computed(() => g.value === 0 ? !1 : P.value / g.value > 1.1), ce = computed(() => T.value === "right" && D.value === "wide-right" ? r.sidePanelMaxRightWide : r.sidePanelMaxRight), le = computed(() => Ce(r.mainContentAspectRatio, 16 / 9)), ue = computed(() => b.value > 0 ? b.value : Math.max(1, g.value)), de = computed(() => ue.value / le.value + 20), fe = computed(() => Math.max(1, g.value) / le.value), pe = computed(() => K(r.sidePanelMinBottom, g.value, v.value)), me = computed(() => {
586
+ let e = fe.value + pe.value;
587
+ return P.value >= e;
588
+ }), he = computed(() => Math.max(0, P.value - de.value)), ge = computed(() => {
589
+ if (T.value !== "bottom") return r.sidePanelMinBottom;
590
+ let e = K(r.sidePanelMinBottom, g.value, v.value), t = Math.min(e, I.value);
591
+ return `${Math.max(0, Math.floor(t))}px`;
592
+ }), I = computed(() => {
593
+ let e = K(T.value === "bottom" && D.value === "tall-bottom" ? r.sidePanelMaxBottomTall : r.sidePanelMaxBottom, g.value, v.value);
594
+ return Math.max(0, Math.min(e, he.value));
595
+ }), L = computed(() => T.value === "bottom" ? `${Math.max(0, Math.floor(I.value))}px` : r.sidePanelMaxBottom), _e = computed(() => T.value === "right" || T.value === "bottom" ? {} : T.value === "full" && !F.value ? {
596
+ opacity: 0,
597
+ pointerEvents: "none"
598
+ } : {}), R = computed(() => !M.value || F.value || T.value === "none" || T.value === "minimized" || T.value === "right" || T.value === "bottom" ? null : {
599
+ position: "absolute",
600
+ top: 0,
601
+ right: 0,
602
+ bottom: 0,
603
+ left: 0,
604
+ zIndex: 10,
605
+ pointerEvents: "none"
606
+ }), z = computed(() => !M.value || T.value === "none" || T.value === "full" ? { gridTemplate: "1fr / 1fr" } : T.value === "right" ? {
607
+ gridTemplateRows: "1fr",
608
+ gridTemplateColumns: `minmax(0, 1fr) max(${r.sidePanelMinRight}, ${ce.value})`
609
+ } : T.value === "bottom" ? {
610
+ gridTemplateRows: `minmax(0, 1fr) ${L.value}`,
611
+ gridTemplateColumns: "1fr"
612
+ } : T.value === "minimized" ? {
613
+ gridTemplateRows: "1fr max-content",
614
+ gridTemplateColumns: "1fr"
615
+ } : { gridTemplate: "1fr / 1fr" }), ve = computed(() => {
616
+ let e = {
617
+ minWidth: 0,
618
+ minHeight: 0,
619
+ width: "100%",
620
+ height: "100%",
621
+ placeSelf: "stretch",
622
+ zIndex: 20
623
+ };
624
+ if (M.value) {
625
+ if (T.value === "right") return {
626
+ ...e,
627
+ gridColumn: "2 / 3",
628
+ gridRow: "1 / 2"
629
+ };
630
+ if (T.value === "full") return {
631
+ ...e,
632
+ gridColumn: "1 / 2",
633
+ gridRow: "1 / 2"
634
+ };
635
+ }
636
+ return {
637
+ ...e,
638
+ gridColumn: "1 / 2",
639
+ gridRow: "2 / 3"
640
+ };
641
+ }), ye = computed(() => {
642
+ let e = {
643
+ position: "fixed",
644
+ top: 0,
645
+ right: 0,
646
+ bottom: 0,
647
+ left: 0,
648
+ overflow: "hidden"
649
+ };
650
+ return N.value ? {
651
+ ...e,
652
+ display: "grid",
653
+ gridTemplateRows: "auto 1fr"
654
+ } : {
655
+ ...e,
656
+ display: "block"
657
+ };
658
+ }), be = computed(() => N.value ? {
659
+ position: "relative",
660
+ zIndex: 0,
661
+ display: "grid",
662
+ ...z.value,
663
+ gridRow: "2 / 3",
664
+ minWidth: 0,
665
+ minHeight: 0,
666
+ overflow: "hidden"
667
+ } : {
668
+ position: "absolute",
669
+ zIndex: 0,
670
+ display: "grid",
671
+ ...z.value,
672
+ minWidth: 0,
673
+ minHeight: 0,
674
+ overflow: "hidden",
675
+ top: "0",
676
+ right: "0",
677
+ bottom: "0",
678
+ left: "0"
679
+ }), xe = computed(() => !F.value || O.value), B = null, V, H, U = null, W = "", G = !1;
680
+ function Se(e) {
681
+ let t = A[e];
682
+ if (t !== void 0) return t;
683
+ if (e.endsWith("px")) {
684
+ let t = Number.parseFloat(e);
685
+ return Number.isFinite(t) ? t : 0;
686
+ }
687
+ let n = Number.parseFloat(e);
688
+ return Number.isFinite(n) ? n : 0;
689
+ }
690
+ function Ce(e, t) {
691
+ if (typeof e == "number") return Number.isFinite(e) && e > 0 ? e : t;
692
+ let n = String(e).trim();
693
+ if (n.includes("/")) {
694
+ let e = n.split("/", 2), r = e[0] ?? "", i = e[1] ?? "", a = Number.parseFloat(r), o = Number.parseFloat(i);
695
+ return Number.isFinite(a) && Number.isFinite(o) && a > 0 && o > 0 ? a / o : t;
696
+ }
697
+ let r = Number.parseFloat(n);
698
+ return Number.isFinite(r) && r > 0 ? r : t;
699
+ }
700
+ function K(e, t, n) {
701
+ let r = e.trim();
702
+ if (r.endsWith("px")) {
703
+ let e = Number.parseFloat(r);
704
+ return Number.isFinite(e) ? e : 0;
705
+ }
706
+ if (r.endsWith("vh")) {
707
+ let e = Number.parseFloat(r);
708
+ return Number.isFinite(e) ? n * e / 100 : 0;
709
+ }
710
+ if (r.endsWith("vw")) {
711
+ let e = Number.parseFloat(r);
712
+ return Number.isFinite(e) ? t * e / 100 : 0;
713
+ }
714
+ let i = Number.parseFloat(r);
715
+ return Number.isFinite(i) ? i : 0;
716
+ }
717
+ function we() {
718
+ let e = Math.max(1, g.value), t = Math.max(1, P.value), n = e / t, i = e / t, a = Se(r.sidePanelBreakpoint), o = me.value;
719
+ return n < r.autoBottomAspectRatioBreakpoint && o ? (D.value = "tall-bottom", {
720
+ states: [
721
+ "auto",
722
+ "full",
723
+ "bottom",
724
+ "minimized"
725
+ ],
726
+ resolved: "bottom"
727
+ }) : i > r.autoRightAspectRatioBreakpoint ? (D.value = "wide-right", {
728
+ states: [
729
+ "auto",
730
+ "full",
731
+ "right",
732
+ "minimized"
733
+ ],
734
+ resolved: "right"
735
+ }) : (D.value = "mixed", e >= a ? {
736
+ states: o ? [
737
+ "auto",
738
+ "full",
739
+ "bottom",
740
+ "right",
741
+ "minimized"
742
+ ] : [
743
+ "auto",
744
+ "full",
745
+ "right",
746
+ "minimized"
747
+ ],
748
+ resolved: "right"
749
+ } : {
750
+ states: [
751
+ "auto",
752
+ "full",
753
+ "minimized"
754
+ ],
755
+ resolved: "full"
756
+ });
757
+ }
758
+ function Te(e, t, n) {
759
+ e === t || t === "none" || !M.value || i("sidePanelTransition", {
760
+ from: e,
761
+ to: t,
762
+ reason: n
763
+ });
764
+ }
765
+ function q(e = !1) {
766
+ let t = {
767
+ availableStates: M.value ? [...oe.value] : [],
768
+ sidePanelMode: M.value ? w.value : "none",
769
+ sidePanelModeResolved: M.value ? T.value : "none",
770
+ overlayOnly: F.value
771
+ };
772
+ if (!M.value) {
773
+ if (G) return;
774
+ G = !0, i("sidePanelAvailableStates", t);
775
+ return;
776
+ }
777
+ G = !1;
778
+ let n = JSON.stringify(t);
779
+ !e && n === W || (W = n, i("sidePanelAvailableStates", t));
780
+ }
781
+ function J(e) {
782
+ let t = T.value;
783
+ if (!M.value) {
784
+ w.value = "none", T.value = "none", E.value = [], q();
785
+ return;
786
+ }
787
+ let n = we();
788
+ E.value = n.states;
789
+ let r = w.value === "none" ? "auto" : w.value;
790
+ r !== "auto" && !E.value.includes(r) ? (w.value = "auto", i("update:sidePanelPosition", "auto")) : w.value = r, T.value = w.value === "auto" ? n.resolved : w.value, Te(t, T.value, e), q(k.value === !1);
791
+ }
792
+ function Y(e, t = !1) {
793
+ if (V &&= (clearTimeout(V), void 0), t || !k.value) {
794
+ J(e);
795
+ return;
796
+ }
797
+ V = setTimeout(() => {
798
+ J(e);
799
+ }, r.layoutDebounceMs);
800
+ }
801
+ function Ee(e) {
802
+ if (!M.value) return;
803
+ let t = E.value.includes(e) ? e : "auto";
804
+ t !== w.value && (w.value = t, i("update:sidePanelPosition", t)), Y("set-side-panel-mode", !0);
805
+ }
806
+ function De() {
807
+ !M.value || !F.value || Ee("minimized");
808
+ }
809
+ function X() {
810
+ H &&= (clearTimeout(H), void 0);
811
+ }
812
+ function Oe() {
813
+ if (X(), !F.value || se.value || T.value === "none") {
814
+ O.value = !0;
815
+ return;
816
+ }
817
+ H = setTimeout(() => {
818
+ O.value = !1;
819
+ }, r.autoHideTimeout);
820
+ }
821
+ function Z() {
822
+ O.value = !0, Oe();
823
+ }
824
+ function ke() {
825
+ if (!p.value) return;
826
+ let e = [
827
+ "mousemove",
828
+ "click",
829
+ "scroll",
830
+ "keydown",
831
+ "touchstart"
832
+ ], t = () => {
833
+ Z();
834
+ };
835
+ for (let n of e) p.value.addEventListener(n, t, { passive: !0 });
836
+ U = () => {
837
+ if (p.value) for (let n of e) p.value.removeEventListener(n, t);
838
+ };
839
+ }
840
+ function Q() {
841
+ g.value = window.innerWidth, v.value = window.innerHeight, Y("viewport-resize");
842
+ }
843
+ function $() {
844
+ try {
845
+ if (typeof window > "u") return;
846
+ g.value = window.innerWidth, v.value = window.innerHeight, y.value = m.value?.offsetHeight ?? 0, b.value = h.value?.offsetWidth ?? 0, x.value = h.value?.offsetHeight ?? 0, S(), Y("manual-refresh", !0);
847
+ } catch (e) {
848
+ console.warn("[LiveFrame] Error during refresh cycle:", e);
849
+ }
850
+ }
851
+ t({ refresh: $ });
852
+ let { pause: Ae, resume: je } = useIntervalFn($, () => r.autoRefreshInterval, {
853
+ immediate: r.autoRefresh,
854
+ immediateCallback: !1
855
+ });
856
+ return watch(() => r.autoRefresh, (e) => {
857
+ e ? je() : Ae();
858
+ }), watch(() => r.sidePanelPosition, (e) => {
859
+ if (!M.value) {
860
+ w.value = "none";
861
+ return;
862
+ }
863
+ w.value = e, Y("prop-sync");
864
+ }, { immediate: !0 }), watch(M, (e) => {
865
+ if (!e) {
866
+ w.value = "none", T.value = "none", E.value = [], q();
867
+ return;
868
+ }
869
+ w.value = r.sidePanelPosition, Y("slot-state-change", !0);
870
+ }, { immediate: !0 }), watch(() => [
871
+ F.value,
872
+ r.autoHideTimeout,
873
+ T.value
874
+ ], () => {
875
+ if (T.value === "full") {
876
+ Oe();
877
+ return;
878
+ }
879
+ Z();
880
+ }), watch(se, (e, t) => {
881
+ if (e) {
882
+ O.value = !0, X();
883
+ return;
884
+ }
885
+ t && Z();
886
+ }), watch(() => [
887
+ b.value,
888
+ x.value,
889
+ T.value,
890
+ M.value
891
+ ], () => {
892
+ !M.value || T.value === "none" || i("defaultSlotResize", {
893
+ width: b.value,
894
+ height: x.value
895
+ });
896
+ }), onMounted(async () => {
897
+ k.value = !0, Q(), window.addEventListener("resize", Q), ke(), Z(), await nextTick(), B = new ResizeObserver(() => {
898
+ y.value = m.value?.offsetHeight ?? 0, b.value = h.value?.offsetWidth ?? 0, x.value = h.value?.offsetHeight ?? 0, S(), Y("slot-measure");
899
+ }), m.value && B.observe(m.value), h.value && (B.observe(h.value), b.value = h.value.offsetWidth, x.value = h.value.offsetHeight), y.value = m.value?.offsetHeight ?? 0, Y("mounted", !0);
900
+ }), onBeforeUnmount(() => {
901
+ window.removeEventListener("resize", Q), U?.(), U = null, B?.disconnect(), B = null, X(), V &&= (clearTimeout(V), void 0);
902
+ }), (t, n) => (openBlock(), createElementBlock("section", {
903
+ ref_key: "rootRef",
904
+ ref: p,
905
+ class: "bg-black text-neutral-100",
906
+ style: normalizeStyle({ ...ye.value })
907
+ }, [N.value ? withDirectives((openBlock(), createElementBlock("header", {
908
+ key: 0,
909
+ ref_key: "headerRef",
910
+ ref: m,
911
+ class: "",
912
+ style: {
913
+ position: "relative",
914
+ width: "100%",
915
+ gridRow: "1 / 2",
916
+ zIndex: 40
917
+ }
918
+ }, [(openBlock(), createBlock(resolveDynamicComponent("style"), null, {
919
+ default: withCtx(() => [createTextVNode(" #header-outer { display: none; } @media (min-width: " + toDisplayString(r.headerHideWidthThreshold) + ") and (min-height: " + toDisplayString(r.headerHideHeightThreshold) + ") { #header-outer { display: block; } } ", 1)]),
920
+ _: 1
921
+ })), createElementVNode("div", _hoisted_1$1, [renderSlot(t.$slots, "header")])], 512)), [[vShow, xe.value]]) : createCommentVNode("", !0), createElementVNode("article", {
922
+ class: "",
923
+ style: normalizeStyle({ ...be.value })
924
+ }, [
925
+ createElementVNode("main", {
926
+ ref_key: "defaultRef",
927
+ ref: h,
928
+ class: "slot-content-container",
929
+ style: normalizeStyle({
930
+ position: "relative",
931
+ boxSizing: "border-box",
932
+ width: "100%",
933
+ height: "100%",
934
+ display: "grid",
935
+ placeItems: "stretch",
936
+ minHeight: 0,
937
+ overflow: "hidden",
938
+ gridColumn: "1 / 2",
939
+ gridRow: "1 / 2",
940
+ zIndex: 0,
941
+ ..._e.value
942
+ })
943
+ }, [renderSlot(t.$slots, "default")], 4),
944
+ R.value ? (openBlock(), createElementBlock("div", {
945
+ key: 0,
946
+ class: "bg-black",
947
+ style: normalizeStyle({
948
+ ...R.value,
949
+ gridColumn: "1 / 2",
950
+ gridRow: "1 / 2"
951
+ })
952
+ }, null, 4)) : createCommentVNode("", !0),
953
+ M.value && T.value !== "none" ? (openBlock(), createElementBlock("div", {
954
+ key: 1,
955
+ class: "",
956
+ style: normalizeStyle(ve.value)
957
+ }, [createVNode(SidePanelFrame_default, {
958
+ "side-panel-mode": w.value,
959
+ "side-panel-mode-resolved": T.value,
960
+ "available-states": oe.value,
961
+ "overlay-only": F.value,
962
+ "hide-icons": e.hideSidePanelIcons,
963
+ "min-width": e.sidePanelMinRight,
964
+ "max-width": ce.value,
965
+ "min-height": ge.value,
966
+ "max-height": L.value,
967
+ onSetSidePanelMode: Ee,
968
+ onCloseSidePanel: De
969
+ }, {
970
+ default: withCtx(() => [renderSlot(t.$slots, "sidePanelContent")]),
971
+ _: 3
972
+ }, 8, [
973
+ "side-panel-mode",
974
+ "side-panel-mode-resolved",
975
+ "available-states",
976
+ "overlay-only",
977
+ "hide-icons",
978
+ "min-width",
979
+ "max-width",
980
+ "min-height",
981
+ "max-height"
982
+ ])], 4)) : createCommentVNode("", !0)
983
+ ], 4)], 4));
984
+ }
985
+ }), [["__scopeId", "data-v-f7a0b92e"]]), LoggedInOut_default = /* @__PURE__ */ defineComponent({
986
+ __name: "LoggedInOut",
987
+ props: {
988
+ initiallyLoggedIn: { type: Boolean },
989
+ addWindowAccess: {
990
+ type: Boolean,
991
+ default: !1
992
+ },
993
+ windowAccessObjectName: { default: "loggedInOut" },
994
+ initializeFromWindowAccessObject: {
995
+ type: Boolean,
996
+ default: !1
997
+ },
998
+ initializeWindowAccessObjectName: { default: "initialLoggedIn" },
999
+ waitBehavior: {
1000
+ type: Boolean,
1001
+ default: void 0
1002
+ }
1003
+ },
1004
+ setup(e, { expose: t }) {
1005
+ let n = e, { loggedIn: r, isInitialized: s, setToLoggedIn: u, setToLoggedOut: d, toggleLoggedIn: f, getLoggedIn: p, setLoggedIn: m, setupWindowAccess: h, cleanupWindowAccess: g } = useSimpleLoggedIn({
1006
+ initialValue: n.initiallyLoggedIn,
1007
+ addWindowAccess: n.addWindowAccess,
1008
+ windowAccessObjectName: n.windowAccessObjectName,
1009
+ initializeFromWindowAccessObject: n.initializeFromWindowAccessObject,
1010
+ initializeWindowAccessObjectName: n.initializeWindowAccessObjectName
1011
+ }), _ = computed(() => n.waitBehavior === void 0 ? n.initializeFromWindowAccessObject : n.waitBehavior);
1012
+ return onMounted(() => {
1013
+ n.addWindowAccess && h(n.windowAccessObjectName);
1014
+ }), onUnmounted(() => {
1015
+ g(n.windowAccessObjectName);
1016
+ }), watch(() => n.addWindowAccess, (e) => {
1017
+ e ? h(n.windowAccessObjectName) : g(n.windowAccessObjectName);
1018
+ }), watch(() => n.windowAccessObjectName, (e, t) => {
1019
+ n.addWindowAccess && (t && g(t), h(n.windowAccessObjectName));
1020
+ }), t({
1021
+ loggedIn: r,
1022
+ setToLoggedIn: u,
1023
+ setToLoggedOut: d,
1024
+ toggleLoggedIn: f,
1025
+ getLoggedIn: p,
1026
+ setLoggedIn: m
1027
+ }), (e, t) => !_.value || unref(s) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [unref(r) ? renderSlot(e.$slots, "loggedIn", { key: 0 }) : renderSlot(e.$slots, "loggedOut", { key: 1 })], 64)) : createCommentVNode("", !0);
1028
+ }
1029
+ }), VanillaIf_default = /* @__PURE__ */ defineComponent({
1030
+ __name: "VanillaIf",
1031
+ props: {
1032
+ show: { type: [
1033
+ Boolean,
1034
+ Function,
1035
+ Object
1036
+ ] },
1037
+ showWindowFn: {}
1038
+ },
1039
+ setup(e) {
1040
+ let t = e, n = ref(!1), r = ref(!1), i = null;
1041
+ function o() {
1042
+ i &&= (clearInterval(i), null);
1043
+ }
1044
+ function s() {
1045
+ let e;
1046
+ if (e = typeof window < "u" && t.showWindowFn ? window[t.showWindowFn] : unref(t.show), typeof e == "function") try {
1047
+ let t = e();
1048
+ return typeof t == "boolean" ? {
1049
+ ready: !0,
1050
+ value: t
1051
+ } : {
1052
+ ready: !1,
1053
+ value: !1
1054
+ };
1055
+ } catch (e) {
1056
+ if (e instanceof ReferenceError || e instanceof TypeError) return {
1057
+ ready: !1,
1058
+ value: !1
1059
+ };
1060
+ throw e;
1061
+ }
1062
+ return t.showWindowFn ? {
1063
+ ready: !1,
1064
+ value: !1
1065
+ } : typeof e == "boolean" ? {
1066
+ ready: !0,
1067
+ value: e
1068
+ } : e == null ? {
1069
+ ready: !1,
1070
+ value: !1
1071
+ } : {
1072
+ ready: !0,
1073
+ value: !!e
1074
+ };
1075
+ }
1076
+ function u() {
1077
+ let { ready: e, value: t } = s();
1078
+ e ? (r.value = t, n.value = !0, o()) : i ||= setInterval(() => {
1079
+ let e = s();
1080
+ e.ready && (r.value = e.value, n.value = !0, o());
1081
+ }, 50);
1082
+ }
1083
+ let d = s();
1084
+ return d.ready && (n.value = !0, r.value = d.value), watch(() => [t.show, t.showWindowFn], () => {
1085
+ n.value = !1, o(), u();
1086
+ }, { deep: !0 }), onMounted(() => {
1087
+ n.value || u();
1088
+ }), onUnmounted(() => {
1089
+ o();
1090
+ }), (e, t) => n.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [r.value ? renderSlot(e.$slots, "default", { key: 0 }) : renderSlot(e.$slots, "else", { key: 1 })], 64)) : createCommentVNode("", !0);
1091
+ }
1092
+ }), suspectProtoRx = /"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/, suspectConstructorRx = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/, JsonSigRx = /^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;
1093
+ function jsonParseTransform(e, t) {
1094
+ if (e === "__proto__" || e === "constructor" && t && typeof t == "object" && "prototype" in t) {
1095
+ warnKeyDropped(e);
1096
+ return;
1097
+ }
1098
+ return t;
1099
+ }
1100
+ function warnKeyDropped(e) {
1101
+ console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`);
1102
+ }
1103
+ function destr(e, t = {}) {
1104
+ if (typeof e != "string") return e;
1105
+ if (e[0] === "\"" && e[e.length - 1] === "\"" && e.indexOf("\\") === -1) return e.slice(1, -1);
1106
+ let n = e.trim();
1107
+ if (n.length <= 9) switch (n.toLowerCase()) {
1108
+ case "true": return !0;
1109
+ case "false": return !1;
1110
+ case "undefined": return;
1111
+ case "null": return null;
1112
+ case "nan": return NaN;
1113
+ case "infinity": return Infinity;
1114
+ case "-infinity": return -Infinity;
1115
+ }
1116
+ if (!JsonSigRx.test(e)) {
1117
+ if (t.strict) throw SyntaxError("[destr] Invalid JSON");
1118
+ return e;
1119
+ }
1120
+ try {
1121
+ if (suspectProtoRx.test(e) || suspectConstructorRx.test(e)) {
1122
+ if (t.strict) throw Error("[destr] Possible prototype pollution");
1123
+ return JSON.parse(e, jsonParseTransform);
1124
+ }
1125
+ return JSON.parse(e);
1126
+ } catch (n) {
1127
+ if (t.strict) throw n;
1128
+ return e;
1129
+ }
1130
+ }
1131
+ String.fromCharCode;
1132
+ var HASH_RE = /#/g, AMPERSAND_RE = /&/g, SLASH_RE = /\//g, EQUAL_RE = /=/g, PLUS_RE = /\+/g, ENC_CARET_RE = /%5e/gi, ENC_BACKTICK_RE = /%60/gi, ENC_PIPE_RE = /%7c/gi, ENC_SPACE_RE = /%20/gi;
1133
+ function encode(e) {
1134
+ return encodeURI("" + e).replace(ENC_PIPE_RE, "|");
1135
+ }
1136
+ function encodeQueryValue(e) {
1137
+ return encode(typeof e == "string" ? e : JSON.stringify(e)).replace(PLUS_RE, "%2B").replace(ENC_SPACE_RE, "+").replace(HASH_RE, "%23").replace(AMPERSAND_RE, "%26").replace(ENC_BACKTICK_RE, "`").replace(ENC_CARET_RE, "^").replace(SLASH_RE, "%2F");
1138
+ }
1139
+ function encodeQueryKey(e) {
1140
+ return encodeQueryValue(e).replace(EQUAL_RE, "%3D");
1141
+ }
1142
+ function decode(e = "") {
1143
+ try {
1144
+ return decodeURIComponent("" + e);
1145
+ } catch {
1146
+ return "" + e;
1147
+ }
1148
+ }
1149
+ function decodeQueryKey(e) {
1150
+ return decode(e.replace(PLUS_RE, " "));
1151
+ }
1152
+ function decodeQueryValue(e) {
1153
+ return decode(e.replace(PLUS_RE, " "));
1154
+ }
1155
+ function parseQuery(e = "") {
1156
+ let t = /* @__PURE__ */ Object.create(null);
1157
+ e[0] === "?" && (e = e.slice(1));
1158
+ for (let n of e.split("&")) {
1159
+ let e = n.match(/([^=]+)=?(.*)/) || [];
1160
+ if (e.length < 2) continue;
1161
+ let r = decodeQueryKey(e[1]);
1162
+ if (r === "__proto__" || r === "constructor") continue;
1163
+ let i = decodeQueryValue(e[2] || "");
1164
+ t[r] === void 0 ? t[r] = i : Array.isArray(t[r]) ? t[r].push(i) : t[r] = [t[r], i];
1165
+ }
1166
+ return t;
1167
+ }
1168
+ function encodeQueryItem(e, t) {
1169
+ return (typeof t == "number" || typeof t == "boolean") && (t = String(t)), t ? Array.isArray(t) ? t.map((t) => `${encodeQueryKey(e)}=${encodeQueryValue(t)}`).join("&") : `${encodeQueryKey(e)}=${encodeQueryValue(t)}` : encodeQueryKey(e);
1170
+ }
1171
+ function stringifyQuery(e) {
1172
+ return Object.keys(e).filter((t) => e[t] !== void 0).map((t) => encodeQueryItem(t, e[t])).filter(Boolean).join("&");
1173
+ }
1174
+ var PROTOCOL_STRICT_REGEX = /^[\s\w\0+.-]{2,}:([/\\]{1,2})/, PROTOCOL_REGEX = /^[\s\w\0+.-]{2,}:([/\\]{2})?/, PROTOCOL_RELATIVE_REGEX = /^([/\\]\s*){2,}[^/\\]/, TRAILING_SLASH_RE = /\/$|\/\?|\/#/, JOIN_LEADING_SLASH_RE = /^\.?\//;
1175
+ function hasProtocol(e, t = {}) {
1176
+ return typeof t == "boolean" && (t = { acceptRelative: t }), t.strict ? PROTOCOL_STRICT_REGEX.test(e) : PROTOCOL_REGEX.test(e) || (t.acceptRelative ? PROTOCOL_RELATIVE_REGEX.test(e) : !1);
1177
+ }
1178
+ function hasTrailingSlash(e = "", t) {
1179
+ return t ? TRAILING_SLASH_RE.test(e) : e.endsWith("/");
1180
+ }
1181
+ function withoutTrailingSlash(e = "", t) {
1182
+ if (!t) return (hasTrailingSlash(e) ? e.slice(0, -1) : e) || "/";
1183
+ if (!hasTrailingSlash(e, !0)) return e || "/";
1184
+ let n = e, r = "", i = e.indexOf("#");
1185
+ i !== -1 && (n = e.slice(0, i), r = e.slice(i));
1186
+ let [a, ...o] = n.split("?");
1187
+ return ((a.endsWith("/") ? a.slice(0, -1) : a) || "/") + (o.length > 0 ? `?${o.join("?")}` : "") + r;
1188
+ }
1189
+ function withTrailingSlash(e = "", t) {
1190
+ if (!t) return e.endsWith("/") ? e : e + "/";
1191
+ if (hasTrailingSlash(e, !0)) return e || "/";
1192
+ let n = e, r = "", i = e.indexOf("#");
1193
+ if (i !== -1 && (n = e.slice(0, i), r = e.slice(i), !n)) return r;
1194
+ let [a, ...o] = n.split("?");
1195
+ return a + "/" + (o.length > 0 ? `?${o.join("?")}` : "") + r;
1196
+ }
1197
+ function withBase(e, t) {
1198
+ if (isEmptyURL(t) || hasProtocol(e)) return e;
1199
+ let n = withoutTrailingSlash(t);
1200
+ if (e.startsWith(n)) {
1201
+ let t = e[n.length];
1202
+ if (!t || t === "/" || t === "?") return e;
1203
+ }
1204
+ return joinURL(n, e);
1205
+ }
1206
+ function withQuery(e, t) {
1207
+ let n = parseURL(e);
1208
+ return n.search = stringifyQuery({
1209
+ ...parseQuery(n.search),
1210
+ ...t
1211
+ }), stringifyParsedURL(n);
1212
+ }
1213
+ function isEmptyURL(e) {
1214
+ return !e || e === "/";
1215
+ }
1216
+ function isNonEmptyURL(e) {
1217
+ return e && e !== "/";
1218
+ }
1219
+ function joinURL(e, ...t) {
1220
+ let n = e || "";
1221
+ for (let e of t.filter((e) => isNonEmptyURL(e))) if (n) {
1222
+ let t = e.replace(JOIN_LEADING_SLASH_RE, "");
1223
+ n = withTrailingSlash(n) + t;
1224
+ } else n = e;
1225
+ return n;
1226
+ }
1227
+ var protocolRelative = Symbol.for("ufo:protocolRelative");
1228
+ function parseURL(e = "", t) {
1229
+ let n = e.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);
1230
+ if (n) {
1231
+ let [, e, t = ""] = n;
1232
+ return {
1233
+ protocol: e.toLowerCase(),
1234
+ pathname: t,
1235
+ href: e + t,
1236
+ auth: "",
1237
+ host: "",
1238
+ search: "",
1239
+ hash: ""
1240
+ };
1241
+ }
1242
+ if (!hasProtocol(e, { acceptRelative: !0 })) return t ? parseURL(t + e) : parsePath(e);
1243
+ let [, r = "", i, a = ""] = e.replace(/\\/g, "/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/) || [], [, o = "", s = ""] = a.match(/([^#/?]*)(.*)?/) || [];
1244
+ r === "file:" && (s = s.replace(/\/(?=[A-Za-z]:)/, ""));
1245
+ let { pathname: c, search: l, hash: u } = parsePath(s);
1246
+ return {
1247
+ protocol: r.toLowerCase(),
1248
+ auth: i ? i.slice(0, Math.max(0, i.length - 1)) : "",
1249
+ host: o,
1250
+ pathname: c,
1251
+ search: l,
1252
+ hash: u,
1253
+ [protocolRelative]: !r
1254
+ };
1255
+ }
1256
+ function parsePath(e = "") {
1257
+ let [t = "", n = "", r = ""] = (e.match(/([^#?]*)(\?[^#]*)?(#.*)?/) || []).splice(1);
1258
+ return {
1259
+ pathname: t,
1260
+ search: n,
1261
+ hash: r
1262
+ };
1263
+ }
1264
+ function stringifyParsedURL(e) {
1265
+ let t = e.pathname || "", n = e.search ? (e.search.startsWith("?") ? "" : "?") + e.search : "", r = e.hash || "", i = e.auth ? e.auth + "@" : "", a = e.host || "";
1266
+ return (e.protocol || e[protocolRelative] ? (e.protocol || "") + "//" : "") + i + a + t + n + r;
1267
+ }
1268
+ var FetchError = class extends Error {
1269
+ constructor(e, t) {
1270
+ super(e, t), this.name = "FetchError", t?.cause && !this.cause && (this.cause = t.cause);
1271
+ }
1272
+ };
1273
+ function createFetchError(e) {
1274
+ let t = e.error?.message || e.error?.toString() || "", n = e.request?.method || e.options?.method || "GET", r = e.request?.url || String(e.request) || "/", i = new FetchError(`${`[${n}] ${JSON.stringify(r)}`}: ${e.response ? `${e.response.status} ${e.response.statusText}` : "<no response>"}${t ? ` ${t}` : ""}`, e.error ? { cause: e.error } : void 0);
1275
+ for (let t of [
1276
+ "request",
1277
+ "options",
1278
+ "response"
1279
+ ]) Object.defineProperty(i, t, { get() {
1280
+ return e[t];
1281
+ } });
1282
+ for (let [t, n] of [
1283
+ ["data", "_data"],
1284
+ ["status", "status"],
1285
+ ["statusCode", "status"],
1286
+ ["statusText", "statusText"],
1287
+ ["statusMessage", "statusText"]
1288
+ ]) Object.defineProperty(i, t, { get() {
1289
+ return e.response && e.response[n];
1290
+ } });
1291
+ return i;
1292
+ }
1293
+ var payloadMethods = new Set(Object.freeze([
1294
+ "PATCH",
1295
+ "POST",
1296
+ "PUT",
1297
+ "DELETE"
1298
+ ]));
1299
+ function isPayloadMethod(e = "GET") {
1300
+ return payloadMethods.has(e.toUpperCase());
1301
+ }
1302
+ function isJSONSerializable(e) {
1303
+ if (e === void 0) return !1;
1304
+ let t = typeof e;
1305
+ return t === "string" || t === "number" || t === "boolean" || t === null ? !0 : t === "object" ? Array.isArray(e) ? !0 : e.buffer || e instanceof FormData || e instanceof URLSearchParams ? !1 : e.constructor && e.constructor.name === "Object" || typeof e.toJSON == "function" : !1;
1306
+ }
1307
+ var textTypes = /* @__PURE__ */ new Set([
1308
+ "image/svg",
1309
+ "application/xml",
1310
+ "application/xhtml",
1311
+ "application/html"
1312
+ ]), JSON_RE = /^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;
1313
+ function detectResponseType(e = "") {
1314
+ if (!e) return "json";
1315
+ let t = e.split(";").shift() || "";
1316
+ return JSON_RE.test(t) ? "json" : t === "text/event-stream" ? "stream" : textTypes.has(t) || t.startsWith("text/") ? "text" : "blob";
1317
+ }
1318
+ function resolveFetchOptions(e, t, n, r) {
1319
+ let i = mergeHeaders(t?.headers ?? e?.headers, n?.headers, r), a;
1320
+ return (n?.query || n?.params || t?.params || t?.query) && (a = {
1321
+ ...n?.params,
1322
+ ...n?.query,
1323
+ ...t?.params,
1324
+ ...t?.query
1325
+ }), {
1326
+ ...n,
1327
+ ...t,
1328
+ query: a,
1329
+ params: a,
1330
+ headers: i
1331
+ };
1332
+ }
1333
+ function mergeHeaders(e, t, n) {
1334
+ if (!t) return new n(e);
1335
+ let r = new n(t);
1336
+ if (e) for (let [t, i] of Symbol.iterator in e || Array.isArray(e) ? e : new n(e)) r.set(t, i);
1337
+ return r;
1338
+ }
1339
+ async function callHooks(e, t) {
1340
+ if (t) if (Array.isArray(t)) for (let n of t) await n(e);
1341
+ else await t(e);
1342
+ }
1343
+ var retryStatusCodes = /* @__PURE__ */ new Set([
1344
+ 408,
1345
+ 409,
1346
+ 425,
1347
+ 429,
1348
+ 500,
1349
+ 502,
1350
+ 503,
1351
+ 504
1352
+ ]), nullBodyResponses = /* @__PURE__ */ new Set([
1353
+ 101,
1354
+ 204,
1355
+ 205,
1356
+ 304
1357
+ ]);
1358
+ function createFetch(e = {}) {
1359
+ let { fetch: t = globalThis.fetch, Headers: n = globalThis.Headers, AbortController: r = globalThis.AbortController } = e;
1360
+ async function i(e) {
1361
+ let t = e.error && e.error.name === "AbortError" && !e.options.timeout || !1;
1362
+ if (e.options.retry !== !1 && !t) {
1363
+ let t;
1364
+ t = typeof e.options.retry == "number" ? e.options.retry : isPayloadMethod(e.options.method) ? 0 : 1;
1365
+ let n = e.response && e.response.status || 500;
1366
+ if (t > 0 && (Array.isArray(e.options.retryStatusCodes) ? e.options.retryStatusCodes.includes(n) : retryStatusCodes.has(n))) {
1367
+ let n = typeof e.options.retryDelay == "function" ? e.options.retryDelay(e) : e.options.retryDelay || 0;
1368
+ return n > 0 && await new Promise((e) => setTimeout(e, n)), a(e.request, {
1369
+ ...e.options,
1370
+ retry: t - 1
1371
+ });
1372
+ }
1373
+ }
1374
+ let n = createFetchError(e);
1375
+ throw Error.captureStackTrace && Error.captureStackTrace(n, a), n;
1376
+ }
1377
+ let a = async function(a, o = {}) {
1378
+ let s = {
1379
+ request: a,
1380
+ options: resolveFetchOptions(a, o, e.defaults, n),
1381
+ response: void 0,
1382
+ error: void 0
1383
+ };
1384
+ if (s.options.method && (s.options.method = s.options.method.toUpperCase()), s.options.onRequest && (await callHooks(s, s.options.onRequest), s.options.headers instanceof n || (s.options.headers = new n(s.options.headers || {}))), typeof s.request == "string" && (s.options.baseURL && (s.request = withBase(s.request, s.options.baseURL)), s.options.query && (s.request = withQuery(s.request, s.options.query), delete s.options.query), "query" in s.options && delete s.options.query, "params" in s.options && delete s.options.params), s.options.body && isPayloadMethod(s.options.method)) if (isJSONSerializable(s.options.body)) {
1385
+ let e = s.options.headers.get("content-type");
1386
+ typeof s.options.body != "string" && (s.options.body = e === "application/x-www-form-urlencoded" ? new URLSearchParams(s.options.body).toString() : JSON.stringify(s.options.body)), e || s.options.headers.set("content-type", "application/json"), s.options.headers.has("accept") || s.options.headers.set("accept", "application/json");
1387
+ } else ("pipeTo" in s.options.body && typeof s.options.body.pipeTo == "function" || typeof s.options.body.pipe == "function") && ("duplex" in s.options || (s.options.duplex = "half"));
1388
+ let c;
1389
+ if (!s.options.signal && s.options.timeout) {
1390
+ let e = new r();
1391
+ c = setTimeout(() => {
1392
+ let t = /* @__PURE__ */ Error("[TimeoutError]: The operation was aborted due to timeout");
1393
+ t.name = "TimeoutError", t.code = 23, e.abort(t);
1394
+ }, s.options.timeout), s.options.signal = e.signal;
1395
+ }
1396
+ try {
1397
+ s.response = await t(s.request, s.options);
1398
+ } catch (e) {
1399
+ return s.error = e, s.options.onRequestError && await callHooks(s, s.options.onRequestError), await i(s);
1400
+ } finally {
1401
+ c && clearTimeout(c);
1402
+ }
1403
+ if ((s.response.body || s.response._bodyInit) && !nullBodyResponses.has(s.response.status) && s.options.method !== "HEAD") {
1404
+ let e = (s.options.parseResponse ? "json" : s.options.responseType) || detectResponseType(s.response.headers.get("content-type") || "");
1405
+ switch (e) {
1406
+ case "json": {
1407
+ let e = await s.response.text(), t = s.options.parseResponse || destr;
1408
+ s.response._data = t(e);
1409
+ break;
1410
+ }
1411
+ case "stream":
1412
+ s.response._data = s.response.body || s.response._bodyInit;
1413
+ break;
1414
+ default: s.response._data = await s.response[e]();
1415
+ }
1416
+ }
1417
+ return s.options.onResponse && await callHooks(s, s.options.onResponse), !s.options.ignoreResponseError && s.response.status >= 400 && s.response.status < 600 ? (s.options.onResponseError && await callHooks(s, s.options.onResponseError), await i(s)) : s.response;
1418
+ }, o = async function(e, t) {
1419
+ return (await a(e, t))._data;
1420
+ };
1421
+ return o.raw = a, o.native = (...e) => t(...e), o.create = (t = {}, n = {}) => createFetch({
1422
+ ...e,
1423
+ ...n,
1424
+ defaults: {
1425
+ ...e.defaults,
1426
+ ...n.defaults,
1427
+ ...t
1428
+ }
1429
+ }), o;
1430
+ }
1431
+ var _globalThis = (function() {
1432
+ if (typeof globalThis < "u") return globalThis;
1433
+ if (typeof self < "u") return self;
1434
+ if (typeof window < "u") return window;
1435
+ if (typeof global < "u") return global;
1436
+ throw Error("unable to locate global object");
1437
+ })(), fetch = _globalThis.fetch ? (...e) => _globalThis.fetch(...e) : () => Promise.reject(/* @__PURE__ */ Error("[ofetch] global.fetch is not supported!")), Headers$1 = _globalThis.Headers, AbortController$1 = _globalThis.AbortController, ofetch = createFetch({
1438
+ fetch,
1439
+ Headers: Headers$1,
1440
+ AbortController: AbortController$1
1441
+ }), _hoisted_1 = { class: "border border-neutral-300 rounded-lg bg-white shadow-sm grid grid-rows-[min-content_auto_min-content] overflow-hidden" }, _hoisted_2 = { class: "flex items-center justify-between px-3 py-1 bg-neutral-900 border-b border-neutral-800" }, _hoisted_3 = { class: "px-2 py-0.5 bg-neutral-800 text-neutral-300 font-mono text-[10px] uppercase font-bold rounded" }, _hoisted_4 = {
1442
+ key: 0,
1443
+ class: "flex items-center gap-2"
1444
+ }, _hoisted_5 = { class: "flex items-center gap-4 px-4 py-3 bg-white" }, _hoisted_6 = ["disabled"], _hoisted_7 = { key: 0 }, _hoisted_8 = { key: 1 }, _hoisted_9 = { class: "grid grid-cols-[10rem_1fr] bg-neutral-900 border-t border-neutral-800 group h-auto" }, _hoisted_10 = { class: "flex flex-col w-full min-w-0 p-3 relative h-max" }, _hoisted_11 = { class: "absolute top-2 right-2 flex justify-end z-10" }, _hoisted_12 = {
1445
+ key: 0,
1446
+ class: "text-sm text-neutral-300 font-mono m-0 whitespace-pre-wrap break-words"
1447
+ }, _hoisted_13 = {
1448
+ key: 1,
1449
+ class: "text-sm text-neutral-300 font-mono m-0 whitespace-pre-wrap break-words"
1450
+ }, _hoisted_14 = {
1451
+ key: 2,
1452
+ class: "text-sm text-neutral-500 font-mono italic h-full flex items-center"
1453
+ }, FetchCard_default = /* @__PURE__ */ defineComponent({
1454
+ __name: "FetchCard",
1455
+ props: {
1456
+ requireCheckboxToEnable: {},
1457
+ fetchOptions: {},
1458
+ responseDisplayTimeout: {},
1459
+ fetchOnMount: {},
1460
+ fetchButtonText: {},
1461
+ fetchButtonClass: {},
1462
+ responseClass: {},
1463
+ responseMaxHeight: {},
1464
+ url: {},
1465
+ urlClass: {},
1466
+ urlCommonClass: {},
1467
+ urlParts: {},
1468
+ urlPartsClasses: {},
1469
+ urlPartsDirection: {}
1470
+ },
1471
+ emits: [
1472
+ "fetching",
1473
+ "onResult",
1474
+ "onSuccess",
1475
+ "onError"
1476
+ ],
1477
+ setup(e, { emit: t }) {
1478
+ let n = e, r = t, i = ref(!1), s = ref(!1), d = ref(null), f = ref(null), p = ref(null), m = computed(() => toValue(n.requireCheckboxToEnable) ?? !1), h = computed(() => toValue(n.fetchOptions) ?? {}), g = computed(() => toValue(n.responseDisplayTimeout) ?? 2e4), _ = computed(() => toValue(n.fetchOnMount) ?? !1), ee = computed(() => toValue(n.fetchButtonText) ?? "Fetch"), y = computed(() => toValue(n.fetchButtonClass) ?? ""), b = computed(() => toValue(n.responseClass)), x = computed(() => toValue(n.responseMaxHeight) ?? "40vh"), te = computed(() => h.value.method || "GET"), C = computed(() => n.url === void 0 ? n.urlParts === void 0 ? "" : toValue(n.urlParts).join("") : toValue(n.url)), w = computed(() => m.value && !i.value ? !0 : s.value || !C.value), T = ref("neutral"), E = null, ne = () => {
1479
+ E && clearTimeout(E), E = setTimeout(() => {
1480
+ T.value = "neutral";
1481
+ }, g.value);
1482
+ }, re = async () => {
1483
+ if (!w.value) {
1484
+ s.value = !0, T.value = "yellow", d.value = null, p.value = null, f.value = null, m.value && (i.value = !1), r("fetching", n);
1485
+ try {
1486
+ let e = await ofetch.raw(C.value, h.value);
1487
+ d.value = e._data, f.value = e.status, T.value = "green", r("onResult", n, e), r("onSuccess", n, e);
1488
+ } catch (e) {
1489
+ p.value = e.data || e.message || "Unknown error", f.value = e.status || 500, T.value = "red", r("onResult", n, e), r("onError", n, e);
1490
+ } finally {
1491
+ s.value = !1, ne();
1492
+ }
1493
+ }
1494
+ }, ie = computed(() => {
1495
+ switch (T.value) {
1496
+ case "yellow": return "text-yellow-400 bg-yellow-900/30 border-yellow-700/50";
1497
+ case "green": return "text-green-400 bg-green-900/30 border-green-700/50";
1498
+ case "red": return "text-red-400 bg-red-900/30 border-red-700/50";
1499
+ default: return "text-neutral-500 bg-neutral-800/50 border-neutral-700";
1500
+ }
1501
+ }), { copy: ae, copied: A, isSupported: j } = useClipboard({ legacy: !0 }), M = () => {
1502
+ let e = d.value || p.value;
1503
+ e && ae(JSON.stringify(e, null, 2));
1504
+ };
1505
+ return onMounted(() => {
1506
+ C.value && _.value && (!m.value || i.value) && re();
1507
+ }), (e, t) => (openBlock(), createElementBlock("div", _hoisted_1, [
1508
+ createElementVNode("div", _hoisted_2, [createElementVNode("span", _hoisted_3, toDisplayString(te.value), 1), m.value ? (openBlock(), createElementBlock("div", _hoisted_4, [t[1] ||= createElementVNode("label", {
1509
+ for: "enable-fetch",
1510
+ class: "text-xs font-medium text-neutral-300 cursor-pointer select-none"
1511
+ }, " Enable Request ", -1), withDirectives(createElementVNode("input", {
1512
+ id: "enable-fetch",
1513
+ type: "checkbox",
1514
+ "onUpdate:modelValue": t[0] ||= (e) => i.value = e,
1515
+ class: "w-3.5 h-3.5 rounded border-neutral-600 bg-neutral-800 text-indigo-500 focus:ring-indigo-500 cursor-pointer"
1516
+ }, null, 512), [[vModelCheckbox, i.value]])])) : createCommentVNode("", !0)]),
1517
+ createElementVNode("div", _hoisted_5, [createElementVNode("div", { class: normalizeClass(["flex-1 min-w-0", toValue(n.urlCommonClass)]) }, [n.url === void 0 ? n.urlParts === void 0 ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", {
1518
+ key: 1,
1519
+ class: normalizeClass(["flex flex-wrap font-mono break-all text-neutral-800", toValue(n.urlPartsDirection) === "column" ? "flex-col items-start gap-1" : "flex-row items-baseline"])
1520
+ }, [(openBlock(!0), createElementBlock(Fragment, null, renderList(toValue(n.urlParts), (e, t) => (openBlock(), createElementBlock("div", {
1521
+ key: t,
1522
+ class: normalizeClass(toValue(n.urlPartsClasses)?.[t] ?? (toValue(n.urlParts).length > 2 ? t === 0 ? "hidden" : t === 1 ? "text-sm font-medium mr-1" : "text-2xl font-bold" : toValue(n.urlParts).length > 1 ? t === 0 ? "hidden" : "text-sm font-medium" : "text-sm"))
1523
+ }, toDisplayString(e), 3))), 128))], 2)) : (openBlock(), createElementBlock("span", {
1524
+ key: 0,
1525
+ class: normalizeClass(["font-mono text-sm break-all text-neutral-600", toValue(n.urlClass)])
1526
+ }, toDisplayString(C.value), 3))], 2), createElementVNode("button", {
1527
+ onClick: re,
1528
+ disabled: w.value,
1529
+ class: normalizeClass(["shrink-0 px-4 py-2 text-sm font-medium rounded disabled:opacity-50 disabled:cursor-not-allowed transition-colors", y.value || "bg-indigo-600 text-white hover:bg-indigo-700"])
1530
+ }, [s.value ? (openBlock(), createElementBlock("span", _hoisted_7, "Fetching...")) : (openBlock(), createElementBlock("span", _hoisted_8, toDisplayString(ee.value), 1))], 10, _hoisted_6)]),
1531
+ createElementVNode("div", _hoisted_9, [createElementVNode("div", { class: normalizeClass(["flex items-center justify-center font-mono text-2xl font-black shadow-sm transition-colors duration-300 h-16", ie.value]) }, toDisplayString(f.value || "---"), 3), createElementVNode("div", _hoisted_10, [createElementVNode("div", _hoisted_11, [(d.value || p.value) && unref(j) ? (openBlock(), createElementBlock("button", {
1532
+ key: 0,
1533
+ onClick: withModifiers(M, ["prevent"]),
1534
+ class: normalizeClass(["px-2.5 py-1.5 rounded-md text-xs font-bold font-mono border backdrop-blur-sm transition-all duration-200 opacity-0 transform -translate-y-1 group-hover:opacity-100 group-hover:translate-y-0 shadow shadow-neutral-900", unref(A) ? "bg-emerald-900/80 text-emerald-300 border-emerald-700/50" : "bg-neutral-800/90 text-neutral-300 border-neutral-700 hover:bg-neutral-700"])
1535
+ }, toDisplayString(unref(A) ? "COPIED!" : "COPY"), 3)) : createCommentVNode("", !0)]), createElementVNode("div", {
1536
+ class: normalizeClass(["w-full overflow-y-auto transition-all duration-300 custom-scrollbar mt-1 overflow-x-hidden pr-16", b.value ? b.value : "max-h-12 hover:max-h-[var(--hover-max-h)]"]),
1537
+ style: normalizeStyle({ "--hover-max-h": x.value })
1538
+ }, [d.value ? (openBlock(), createElementBlock("pre", _hoisted_12, toDisplayString(JSON.stringify(d.value, null, 2)), 1)) : p.value ? (openBlock(), createElementBlock("pre", _hoisted_13, toDisplayString(JSON.stringify(p.value, null, 2)), 1)) : (openBlock(), createElementBlock("div", _hoisted_14, "Awaiting request..."))], 6)])])
1539
+ ]));
1540
+ }
1541
+ });
1542
+ export { SidePanelFrame_default as a, SidePanelControlButton_default as c, LiveFrame_default as i, VanillaIf_default as n, SidePanelHeader_default as o, LoggedInOut_default as r, SidePanelButtonGroup_default as s, FetchCard_default as t };