@opentiny/tiny-robot 0.3.1-alpha.3 → 0.3.1-alpha.5

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/index4.js CHANGED
@@ -1,161 +1,743 @@
1
- import { onMounted as U, nextTick as B, h as C, defineComponent as b, render as R, onBeforeUnmount as D, Teleport as W, computed as h, ref as E, createBlock as F, openBlock as g, Transition as j, normalizeProps as q, guardReactiveProps as L, withCtx as Z, createElementBlock as G, createCommentVNode as J, renderSlot as K, useSlots as Q, watch as X, useAttrs as Y, resolveDynamicComponent as ee, unref as S, mergeProps as k, createVNode as te } from "vue";
2
- import { b as oe, a as re, d as ne } from "./index3.js";
3
- import { t as u } from "./utils.js";
4
- import { _ as N } from "./_plugin-vue_export-helper.js";
5
- import { u as se } from "./useSlotRefs.js";
6
- const pe = b({
7
- setup: (r) => () => C(W, r.propsFactory(), r.vnodeFactory()),
8
- props: ["propsFactory", "vnodeFactory"]
9
- });
10
- function ae(r, n) {
11
- let e = null, t = null, s = !1;
12
- U(() => {
13
- B(() => {
14
- s || (t = document.createElement("div"), e = C(pe, { propsFactory: r, vnodeFactory: n }), R(e, t));
1
+ import { onMounted as ie, nextTick as me, watch as A, getCurrentScope as he, onScopeDispose as ge, getCurrentInstance as j, isRef as le, toValue as w, hasInjectionContext as se, inject as we, toRefs as ye, customRef as be, shallowRef as b, computed as _, reactive as ee, unref as Se, watchEffect as ue, ref as Oe, readonly as Te } from "vue";
2
+ function z(e) {
3
+ return he() ? (ge(e), !0) : !1;
4
+ }
5
+ // @__NO_SIDE_EFFECTS__
6
+ function te() {
7
+ const e = /* @__PURE__ */ new Set(), t = (l) => {
8
+ e.delete(l);
9
+ };
10
+ return {
11
+ on: (l) => {
12
+ e.add(l);
13
+ const f = () => t(l);
14
+ return z(f), {
15
+ off: f
16
+ };
17
+ },
18
+ off: t,
19
+ trigger: (...l) => Promise.all(Array.from(e).map((f) => f(...l))),
20
+ clear: () => {
21
+ e.clear();
22
+ }
23
+ };
24
+ }
25
+ const B = /* @__PURE__ */ new WeakMap(), Ee = /* @__NO_SIDE_EFFECTS__ */ (...e) => {
26
+ var t;
27
+ const o = e[0], n = (t = j()) == null ? void 0 : t.proxy;
28
+ if (n == null && !se())
29
+ throw new Error("injectLocal must be called in setup");
30
+ return n && B.has(n) && o in B.get(n) ? B.get(n)[o] : we(...e);
31
+ }, $ = typeof window < "u" && typeof document < "u";
32
+ typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
33
+ const Pe = (e) => e != null, xe = Object.prototype.toString, We = (e) => xe.call(e) === "[object Object]", x = () => {
34
+ }, Me = (e, t) => Object.prototype.hasOwnProperty.call(e, t), _e = /* @__PURE__ */ Ie();
35
+ function Ie() {
36
+ var e, t;
37
+ return $ && ((e = window == null ? void 0 : window.navigator) == null ? void 0 : e.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((t = window == null ? void 0 : window.navigator) == null ? void 0 : t.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent));
38
+ }
39
+ function Y(e, t) {
40
+ function o(...n) {
41
+ return new Promise((u, l) => {
42
+ Promise.resolve(e(() => t.apply(this, n), { fn: t, thisArg: this, args: n })).then(u).catch(l);
15
43
  });
16
- }), D(() => {
17
- s = !0, B(() => {
18
- t && (R(null, t), t.remove(), e = null, t = null);
44
+ }
45
+ return o;
46
+ }
47
+ const Ae = (e) => e();
48
+ function ce(e, t = {}) {
49
+ let o, n, u = x;
50
+ const l = (s) => {
51
+ clearTimeout(s), u(), u = x;
52
+ };
53
+ let f;
54
+ return (s) => {
55
+ const a = w(e), c = w(t.maxWait);
56
+ return o && l(o), a <= 0 || c !== void 0 && c <= 0 ? (n && (l(n), n = void 0), Promise.resolve(s())) : new Promise((i, d) => {
57
+ u = t.rejectOnCancel ? d : i, f = s, c && !n && (n = setTimeout(() => {
58
+ o && l(o), n = void 0, i(f());
59
+ }, c)), o = setTimeout(() => {
60
+ n && l(n), n = void 0, i(s());
61
+ }, a);
19
62
  });
20
- });
63
+ };
64
+ }
65
+ function ae(...e) {
66
+ let t = 0, o, n = !0, u = x, l, f, r, s, a;
67
+ !le(e[0]) && typeof e[0] == "object" ? { delay: f, trailing: r = !0, leading: s = !0, rejectOnCancel: a = !1 } = e[0] : [f, r = !0, s = !0, a = !1] = e;
68
+ const c = () => {
69
+ o && (clearTimeout(o), o = void 0, u(), u = x);
70
+ };
71
+ return (d) => {
72
+ const p = w(f), m = Date.now() - t, S = () => l = d();
73
+ return c(), p <= 0 ? (t = Date.now(), S()) : (m > p && (s || !n) ? (t = Date.now(), S()) : r && (l = new Promise((v, h) => {
74
+ u = a ? h : v, o = setTimeout(() => {
75
+ t = Date.now(), n = !0, v(S()), c();
76
+ }, Math.max(0, p - m));
77
+ })), !s && !o && (o = setTimeout(() => n = !0, p)), n = !1, l);
78
+ };
79
+ }
80
+ function ne(e) {
81
+ return e.endsWith("rem") ? Number.parseFloat(e) * 16 : Number.parseFloat(e);
82
+ }
83
+ function Fe(e, t, o = !1) {
84
+ return t.reduce((n, u) => (u in e && (!o || e[u] !== void 0) && (n[u] = e[u]), n), {});
85
+ }
86
+ function D(e) {
87
+ return Array.isArray(e) ? e : [e];
88
+ }
89
+ function ke(e) {
90
+ return j();
91
+ }
92
+ // @__NO_SIDE_EFFECTS__
93
+ function Ce(e, t = 200, o = {}) {
94
+ return Y(
95
+ ce(t, o),
96
+ e
97
+ );
98
+ }
99
+ // @__NO_SIDE_EFFECTS__
100
+ function Le(e, t = 200, o = !1, n = !0, u = !1) {
101
+ return Y(
102
+ ae(t, o, n, u),
103
+ e
104
+ );
105
+ }
106
+ function fe(e, t, o = {}) {
107
+ const {
108
+ eventFilter: n = Ae,
109
+ ...u
110
+ } = o;
111
+ return A(
112
+ e,
113
+ Y(
114
+ n,
115
+ t
116
+ ),
117
+ u
118
+ );
119
+ }
120
+ function Re(e, t = {}) {
121
+ if (!le(e))
122
+ return ye(e);
123
+ const o = Array.isArray(e.value) ? Array.from({ length: e.value.length }) : {};
124
+ for (const n in e.value)
125
+ o[n] = be(() => ({
126
+ get() {
127
+ return e.value[n];
128
+ },
129
+ set(u) {
130
+ var l;
131
+ if ((l = w(t.replaceRef)) != null ? l : !0)
132
+ if (Array.isArray(e.value)) {
133
+ const r = [...e.value];
134
+ r[n] = u, e.value = r;
135
+ } else {
136
+ const r = { ...e.value, [n]: u };
137
+ Object.setPrototypeOf(r, Object.getPrototypeOf(e.value)), e.value = r;
138
+ }
139
+ else
140
+ e.value[n] = u;
141
+ }
142
+ }));
143
+ return o;
144
+ }
145
+ function N(e, t = !0, o) {
146
+ ke() ? ie(e, o) : t ? e() : me(e);
147
+ }
148
+ function Xe(e, t, o = {}) {
149
+ const {
150
+ debounce: n = 0,
151
+ maxWait: u = void 0,
152
+ ...l
153
+ } = o;
154
+ return fe(
155
+ e,
156
+ t,
157
+ {
158
+ ...l,
159
+ eventFilter: ce(n, { maxWait: u })
160
+ }
161
+ );
162
+ }
163
+ function De(e, t, o) {
164
+ return A(
165
+ e,
166
+ t,
167
+ {
168
+ ...o,
169
+ immediate: !0
170
+ }
171
+ );
172
+ }
173
+ function Qe(e, t, o = {}) {
174
+ const {
175
+ throttle: n = 0,
176
+ trailing: u = !0,
177
+ leading: l = !0,
178
+ ...f
179
+ } = o;
180
+ return fe(
181
+ e,
182
+ t,
183
+ {
184
+ ...f,
185
+ eventFilter: ae(n, u, l)
186
+ }
187
+ );
188
+ }
189
+ const I = $ ? window : void 0, Ve = $ ? window.document : void 0;
190
+ function O(e) {
191
+ var t;
192
+ const o = w(e);
193
+ return (t = o == null ? void 0 : o.$el) != null ? t : o;
21
194
  }
22
- function ce(r, n) {
23
- return h(() => {
24
- var v;
25
- if (n instanceof HTMLElement)
26
- return n;
27
- const e = n, t = oe(r), s = (v = t == null ? void 0 : t.getRootNode) == null ? void 0 : v.call(t), i = s instanceof ShadowRoot, d = i ? s : document.body;
28
- if (e) {
29
- if (!i && e === "body")
30
- return document.body;
31
- const f = d.querySelector(e);
32
- if (f instanceof Node) return f;
33
- }
34
- return d;
195
+ function W(...e) {
196
+ const t = [], o = () => {
197
+ t.forEach((r) => r()), t.length = 0;
198
+ }, n = (r, s, a, c) => (r.addEventListener(s, a, c), () => r.removeEventListener(s, a, c)), u = _(() => {
199
+ const r = D(w(e[0])).filter((s) => s != null);
200
+ return r.every((s) => typeof s != "string") ? r : void 0;
201
+ }), l = De(
202
+ () => {
203
+ var r, s;
204
+ return [
205
+ (s = (r = u.value) == null ? void 0 : r.map((a) => O(a))) != null ? s : [I].filter((a) => a != null),
206
+ D(w(u.value ? e[1] : e[0])),
207
+ D(Se(u.value ? e[2] : e[1])),
208
+ // @ts-expect-error - TypeScript gets the correct types, but somehow still complains
209
+ w(u.value ? e[3] : e[2])
210
+ ];
211
+ },
212
+ ([r, s, a, c]) => {
213
+ if (o(), !(r != null && r.length) || !(s != null && s.length) || !(a != null && a.length))
214
+ return;
215
+ const i = We(c) ? { ...c } : c;
216
+ t.push(
217
+ ...r.flatMap(
218
+ (d) => s.flatMap(
219
+ (p) => a.map((m) => n(d, p, m, i))
220
+ )
221
+ )
222
+ );
223
+ },
224
+ { flush: "post" }
225
+ ), f = () => {
226
+ l(), o();
227
+ };
228
+ return z(o), f;
229
+ }
230
+ let oe = !1;
231
+ function Ue(e, t, o = {}) {
232
+ const { window: n = I, ignore: u = [], capture: l = !0, detectIframe: f = !1, controls: r = !1 } = o;
233
+ if (!n)
234
+ return r ? { stop: x, cancel: x, trigger: x } : x;
235
+ if (_e && !oe) {
236
+ oe = !0;
237
+ const v = { passive: !0 };
238
+ Array.from(n.document.body.children).forEach((h) => h.addEventListener("click", x, v)), n.document.documentElement.addEventListener("click", x, v);
239
+ }
240
+ let s = !0;
241
+ const a = (v) => w(u).some((h) => {
242
+ if (typeof h == "string")
243
+ return Array.from(n.document.querySelectorAll(h)).some((y) => y === v.target || v.composedPath().includes(y));
244
+ {
245
+ const y = O(h);
246
+ return y && (v.target === y || v.composedPath().includes(y));
247
+ }
35
248
  });
249
+ function c(v) {
250
+ const h = w(v);
251
+ return h && h.$.subTree.shapeFlag === 16;
252
+ }
253
+ function i(v, h) {
254
+ const y = w(v), T = y.$.subTree && y.$.subTree.children;
255
+ return T == null || !Array.isArray(T) ? !1 : T.some((E) => E.el === h.target || h.composedPath().includes(E.el));
256
+ }
257
+ const d = (v) => {
258
+ const h = O(e);
259
+ if (v.target != null && !(!(h instanceof Element) && c(e) && i(e, v)) && !(!h || h === v.target || v.composedPath().includes(h))) {
260
+ if ("detail" in v && v.detail === 0 && (s = !a(v)), !s) {
261
+ s = !0;
262
+ return;
263
+ }
264
+ t(v);
265
+ }
266
+ };
267
+ let p = !1;
268
+ const m = [
269
+ W(n, "click", (v) => {
270
+ p || (p = !0, setTimeout(() => {
271
+ p = !1;
272
+ }, 0), d(v));
273
+ }, { passive: !0, capture: l }),
274
+ W(n, "pointerdown", (v) => {
275
+ const h = O(e);
276
+ s = !a(v) && !!(h && !v.composedPath().includes(h));
277
+ }, { passive: !0 }),
278
+ f && W(n, "blur", (v) => {
279
+ setTimeout(() => {
280
+ var h;
281
+ const y = O(e);
282
+ ((h = n.document.activeElement) == null ? void 0 : h.tagName) === "IFRAME" && !(y != null && y.contains(n.document.activeElement)) && t(v);
283
+ }, 0);
284
+ }, { passive: !0 })
285
+ ].filter(Boolean), S = () => m.forEach((v) => v());
286
+ return r ? {
287
+ stop: S,
288
+ cancel: () => {
289
+ s = !1;
290
+ },
291
+ trigger: (v) => {
292
+ s = !0, d(v), s = !1;
293
+ }
294
+ } : S;
295
+ }
296
+ // @__NO_SIDE_EFFECTS__
297
+ function He() {
298
+ const e = b(!1), t = j();
299
+ return t && ie(() => {
300
+ e.value = !0;
301
+ }, t), e;
302
+ }
303
+ // @__NO_SIDE_EFFECTS__
304
+ function G(e) {
305
+ const t = /* @__PURE__ */ He();
306
+ return _(() => (t.value, !!e()));
307
+ }
308
+ function X(e, t, o = {}) {
309
+ const { window: n = I, ...u } = o;
310
+ let l;
311
+ const f = /* @__PURE__ */ G(() => n && "MutationObserver" in n), r = () => {
312
+ l && (l.disconnect(), l = void 0);
313
+ }, s = _(() => {
314
+ const d = w(e), p = D(d).map(O).filter(Pe);
315
+ return new Set(p);
316
+ }), a = A(
317
+ s,
318
+ (d) => {
319
+ r(), f.value && d.size && (l = new MutationObserver(t), d.forEach((p) => l.observe(p, u)));
320
+ },
321
+ { immediate: !0, flush: "post" }
322
+ ), c = () => l == null ? void 0 : l.takeRecords(), i = () => {
323
+ a(), r();
324
+ };
325
+ return z(i), {
326
+ isSupported: f,
327
+ stop: i,
328
+ takeRecords: c
329
+ };
36
330
  }
37
- const ie = /* @__PURE__ */ b({
38
- __name: "Popper",
39
- props: {
40
- show: { type: Boolean },
41
- transitionProps: {}
42
- },
43
- setup(r, { expose: n }) {
44
- const e = E(null);
45
- return n({
46
- popperRef: e
47
- }), (t, s) => (g(), F(j, q(L(r.transitionProps)), {
48
- default: Z(() => [
49
- r.show ? (g(), G("div", {
50
- key: 0,
51
- class: "tr-base-popper",
52
- ref_key: "popperRef",
53
- ref: e
54
- }, [
55
- K(t.$slots, "default", {}, void 0, !0)
56
- ], 512)) : J("", !0)
57
- ]),
58
- _: 3
59
- }, 16));
331
+ const ze = Symbol("vueuse-ssr-width");
332
+ // @__NO_SIDE_EFFECTS__
333
+ function Ne() {
334
+ const e = se() ? /* @__PURE__ */ Ee(ze, null) : null;
335
+ return typeof e == "number" ? e : void 0;
336
+ }
337
+ function Be(e, t = {}) {
338
+ const { window: o = I, ssrWidth: n = /* @__PURE__ */ Ne() } = t, u = /* @__PURE__ */ G(() => o && "matchMedia" in o && typeof o.matchMedia == "function"), l = b(typeof n == "number"), f = b(), r = b(!1), s = (a) => {
339
+ r.value = a.matches;
340
+ };
341
+ return ue(() => {
342
+ if (l.value) {
343
+ l.value = !u.value;
344
+ const a = w(e).split(",");
345
+ r.value = a.some((c) => {
346
+ const i = c.includes("not all"), d = c.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/), p = c.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);
347
+ let m = !!(d || p);
348
+ return d && m && (m = n >= ne(d[1])), p && m && (m = n <= ne(p[1])), i ? !m : m;
349
+ });
350
+ return;
351
+ }
352
+ u.value && (f.value = o.matchMedia(w(e)), r.value = f.value.matches);
353
+ }), W(f, "change", s, { passive: !0 }), _(() => r.value);
354
+ }
355
+ function qe(e, t, o = {}) {
356
+ const { window: n = I, initialValue: u, observe: l = !1 } = o, f = b(u), r = _(() => {
357
+ var a;
358
+ return O(t) || ((a = n == null ? void 0 : n.document) == null ? void 0 : a.documentElement);
359
+ });
360
+ function s() {
361
+ var a;
362
+ const c = w(e), i = w(r);
363
+ if (i && n && c) {
364
+ const d = (a = n.getComputedStyle(i).getPropertyValue(c)) == null ? void 0 : a.trim();
365
+ f.value = d || f.value || u;
366
+ }
60
367
  }
61
- }), le = /* @__PURE__ */ N(ie, [["__scopeId", "data-v-25c13ab7"]]), ue = /* @__PURE__ */ b({
62
- inheritAttrs: !1,
63
- __name: "index",
64
- props: {
65
- appendTo: {},
66
- offset: {},
67
- placement: {
68
- default: "top-center"
368
+ return l && X(r, s, {
369
+ attributeFilter: ["style", "class"],
370
+ window: n
371
+ }), A(
372
+ [r, () => w(e)],
373
+ (a, c) => {
374
+ c[0] && c[1] && c[0].style.removeProperty(c[1]), s();
69
375
  },
70
- preventOverflow: {
71
- type: Boolean
376
+ { immediate: !0 }
377
+ ), A(
378
+ [f, r],
379
+ ([a, c]) => {
380
+ const i = w(e);
381
+ c != null && c.style && i && (a == null ? c.style.removeProperty(i) : c.style.setProperty(i, a));
72
382
  },
73
- show: {
74
- type: Boolean
383
+ { immediate: !0 }
384
+ ), f;
385
+ }
386
+ function de(e, t, o = {}) {
387
+ const { window: n = I, ...u } = o;
388
+ let l;
389
+ const f = /* @__PURE__ */ G(() => n && "ResizeObserver" in n), r = () => {
390
+ l && (l.disconnect(), l = void 0);
391
+ }, s = _(() => {
392
+ const i = w(e);
393
+ return Array.isArray(i) ? i.map((d) => O(d)) : [O(i)];
394
+ }), a = A(
395
+ s,
396
+ (i) => {
397
+ if (r(), f.value && n) {
398
+ l = new ResizeObserver(t);
399
+ for (const d of i)
400
+ d && l.observe(d, u);
401
+ }
75
402
  },
76
- transitionProps: {},
77
- triggerEvents: {}
78
- },
79
- setup(r, {
80
- expose: n
81
- }) {
82
- const e = r, t = Q(), {
83
- vnodes: s,
84
- ref: i,
85
- setRef: d
86
- } = se(t.trigger), v = (o = {}) => {
87
- const p = {};
88
- for (const [c, a] of Object.entries(o))
89
- /^on[A-Z]/.test(c) && typeof a == "function" && (p[c] = a);
90
- return p;
91
- }, f = E(null), _ = h(() => {
92
- var o;
93
- return ((o = f.value) == null ? void 0 : o.popperRef) || null;
94
- }), m = h(() => {
95
- var o, p;
96
- return typeof e.offset == "number" ? {
97
- mainAxis: e.offset,
98
- crossAxis: 0
99
- } : {
100
- mainAxis: ((o = e.offset) == null ? void 0 : o.mainAxis) ?? 0,
101
- crossAxis: ((p = e.offset) == null ? void 0 : p.crossAxis) ?? 0
102
- };
103
- }), {
104
- top: $,
105
- bottom: O,
106
- left: w,
107
- right: V,
108
- width: z,
109
- update: A
110
- } = re(i), {
111
- width: x,
112
- height: P
113
- } = ne(_, void 0, {
114
- box: "border-box"
115
- }), H = h(() => {
116
- const {
117
- placement: o,
118
- preventOverflow: p
119
- } = e, c = {}, a = (l, y) => {
120
- if (!p) {
121
- c[l] = y;
122
- return;
403
+ { immediate: !0, flush: "post" }
404
+ ), c = () => {
405
+ r(), a();
406
+ };
407
+ return z(c), {
408
+ isSupported: f,
409
+ stop: c
410
+ };
411
+ }
412
+ function Je(e, t = {}) {
413
+ const {
414
+ reset: o = !0,
415
+ windowResize: n = !0,
416
+ windowScroll: u = !0,
417
+ immediate: l = !0,
418
+ updateTiming: f = "sync"
419
+ } = t, r = b(0), s = b(0), a = b(0), c = b(0), i = b(0), d = b(0), p = b(0), m = b(0);
420
+ function S() {
421
+ const h = O(e);
422
+ if (!h) {
423
+ o && (r.value = 0, s.value = 0, a.value = 0, c.value = 0, i.value = 0, d.value = 0, p.value = 0, m.value = 0);
424
+ return;
425
+ }
426
+ const y = h.getBoundingClientRect();
427
+ r.value = y.height, s.value = y.bottom, a.value = y.left, c.value = y.right, i.value = y.top, d.value = y.width, p.value = y.x, m.value = y.y;
428
+ }
429
+ function v() {
430
+ f === "sync" ? S() : f === "next-frame" && requestAnimationFrame(() => S());
431
+ }
432
+ return de(e, v), A(() => O(e), (h) => !h && v()), X(e, v, {
433
+ attributeFilter: ["style", "class"]
434
+ }), u && W("scroll", v, { capture: !0, passive: !0 }), n && W("resize", v, { passive: !0 }), N(() => {
435
+ l && v();
436
+ }), {
437
+ height: r,
438
+ bottom: s,
439
+ left: a,
440
+ right: c,
441
+ top: i,
442
+ width: d,
443
+ x: p,
444
+ y: m,
445
+ update: v
446
+ };
447
+ }
448
+ function Ke(e, t = { width: 0, height: 0 }, o = {}) {
449
+ const { window: n = I, box: u = "content-box" } = o, l = _(() => {
450
+ var i, d;
451
+ return (d = (i = O(e)) == null ? void 0 : i.namespaceURI) == null ? void 0 : d.includes("svg");
452
+ }), f = b(t.width), r = b(t.height), { stop: s } = de(
453
+ e,
454
+ ([i]) => {
455
+ const d = u === "border-box" ? i.borderBoxSize : u === "content-box" ? i.contentBoxSize : i.devicePixelContentBoxSize;
456
+ if (n && l.value) {
457
+ const p = O(e);
458
+ if (p) {
459
+ const m = p.getBoundingClientRect();
460
+ f.value = m.width, r.value = m.height;
123
461
  }
124
- const T = u(l === "top" ? P.value : x.value);
125
- l === "top" ? c[l] = `clamp(var(--tr-base-popper-min-top), ${y}, calc(var(--tr-base-popper-max-bottom) - ${T}))` : l === "left" && (c[l] = `clamp(var(--tr-base-popper-min-left), ${y}, calc(var(--tr-base-popper-max-right) - ${T}))`);
126
- };
127
- return o.includes("top") && a("top", u($.value - P.value - m.value.mainAxis)), o.includes("bottom") && a("top", u(O.value + m.value.mainAxis)), o.includes("left") && a("left", u(w.value + m.value.crossAxis)), o.includes("right") && a("left", u(V.value - x.value + m.value.crossAxis)), o.includes("center") && a("left", u(w.value + z.value / 2 - x.value / 2 + m.value.crossAxis)), c;
128
- });
129
- X(() => e.show, (o) => {
130
- o && A();
131
- }, {
132
- flush: "post"
462
+ } else if (d) {
463
+ const p = D(d);
464
+ f.value = p.reduce((m, { inlineSize: S }) => m + S, 0), r.value = p.reduce((m, { blockSize: S }) => m + S, 0);
465
+ } else
466
+ f.value = i.contentRect.width, r.value = i.contentRect.height;
467
+ },
468
+ o
469
+ );
470
+ N(() => {
471
+ const i = O(e);
472
+ i && (f.value = "offsetWidth" in i ? i.offsetWidth : t.width, r.value = "offsetHeight" in i ? i.offsetHeight : t.height);
473
+ });
474
+ const a = A(
475
+ () => O(e),
476
+ (i) => {
477
+ f.value = i ? t.width : 0, r.value = i ? t.height : 0;
478
+ }
479
+ );
480
+ function c() {
481
+ s(), a();
482
+ }
483
+ return {
484
+ width: f,
485
+ height: r,
486
+ stop: c
487
+ };
488
+ }
489
+ const je = {
490
+ multiple: !0,
491
+ accept: "*",
492
+ reset: !1,
493
+ directory: !1
494
+ };
495
+ function $e(e) {
496
+ if (!e)
497
+ return null;
498
+ if (e instanceof FileList)
499
+ return e;
500
+ const t = new DataTransfer();
501
+ for (const o of e)
502
+ t.items.add(o);
503
+ return t.files;
504
+ }
505
+ function Ze(e = {}) {
506
+ const {
507
+ document: t = Ve
508
+ } = e, o = Oe($e(e.initialFiles)), { on: n, trigger: u } = /* @__PURE__ */ te(), { on: l, trigger: f } = /* @__PURE__ */ te(), r = _(() => {
509
+ var i;
510
+ const d = (i = O(e.input)) != null ? i : t ? t.createElement("input") : void 0;
511
+ return d && (d.type = "file", d.onchange = (p) => {
512
+ const m = p.target;
513
+ o.value = m.files, u(o.value);
514
+ }, d.oncancel = () => {
515
+ f();
516
+ }), d;
517
+ }), s = () => {
518
+ o.value = null, r.value && r.value.value && (r.value.value = "", u(null));
519
+ }, a = (i) => {
520
+ const d = r.value;
521
+ d && (d.multiple = w(i.multiple), d.accept = w(i.accept), d.webkitdirectory = w(i.directory), Me(i, "capture") && (d.capture = w(i.capture)));
522
+ }, c = (i) => {
523
+ const d = r.value;
524
+ if (!d)
525
+ return;
526
+ const p = {
527
+ ...je,
528
+ ...e,
529
+ ...i
530
+ };
531
+ a(p), w(p.reset) && s(), d.click();
532
+ };
533
+ return ue(() => {
534
+ a(e);
535
+ }), {
536
+ files: Te(o),
537
+ open: c,
538
+ reset: s,
539
+ onCancel: l,
540
+ onChange: n
541
+ };
542
+ }
543
+ const re = 1;
544
+ function et(e, t = {}) {
545
+ const {
546
+ throttle: o = 0,
547
+ idle: n = 200,
548
+ onStop: u = x,
549
+ onScroll: l = x,
550
+ offset: f = {
551
+ left: 0,
552
+ right: 0,
553
+ top: 0,
554
+ bottom: 0
555
+ },
556
+ observe: r = {
557
+ mutation: !1
558
+ },
559
+ eventListenerOptions: s = {
560
+ capture: !1,
561
+ passive: !0
562
+ },
563
+ behavior: a = "auto",
564
+ window: c = I,
565
+ onError: i = (g) => {
566
+ console.error(g);
567
+ }
568
+ } = t, d = typeof r == "boolean" ? {
569
+ mutation: r
570
+ } : r, p = b(0), m = b(0), S = _({
571
+ get() {
572
+ return p.value;
573
+ },
574
+ set(g) {
575
+ h(g, void 0);
576
+ }
577
+ }), v = _({
578
+ get() {
579
+ return m.value;
580
+ },
581
+ set(g) {
582
+ h(void 0, g);
583
+ }
584
+ });
585
+ function h(g, k) {
586
+ var P, L, R, H;
587
+ if (!c)
588
+ return;
589
+ const M = w(e);
590
+ if (!M)
591
+ return;
592
+ (R = M instanceof Document ? c.document.body : M) == null || R.scrollTo({
593
+ top: (P = w(k)) != null ? P : v.value,
594
+ left: (L = w(g)) != null ? L : S.value,
595
+ behavior: w(a)
133
596
  });
134
- const I = ce(i, e.appendTo), M = Y();
135
- return ae(() => ({
136
- to: I.value
137
- }), () => te(le, k({
138
- ref: f,
139
- show: e.show,
140
- transitionProps: e.transitionProps,
141
- style: H.value
142
- }, M), {
143
- default: () => {
144
- var o;
145
- return [(o = t.content) == null ? void 0 : o.call(t)];
146
- }
147
- })), n({
148
- triggerRef: i,
149
- popperRef: _,
150
- update: A
151
- }), (o, p) => (g(), F(ee(S(s)[0]), k({
152
- ref: S(d)
153
- }, v(e.triggerEvents)), null, 16));
597
+ const F = ((H = M == null ? void 0 : M.document) == null ? void 0 : H.documentElement) || (M == null ? void 0 : M.documentElement) || M;
598
+ S != null && (p.value = F.scrollLeft), v != null && (m.value = F.scrollTop);
599
+ }
600
+ const y = b(!1), T = ee({
601
+ left: !0,
602
+ right: !1,
603
+ top: !0,
604
+ bottom: !1
605
+ }), E = ee({
606
+ left: !1,
607
+ right: !1,
608
+ top: !1,
609
+ bottom: !1
610
+ }), Q = (g) => {
611
+ y.value && (y.value = !1, E.left = !1, E.right = !1, E.top = !1, E.bottom = !1, u(g));
612
+ }, pe = /* @__PURE__ */ Ce(Q, o + n), V = (g) => {
613
+ var k;
614
+ if (!c)
615
+ return;
616
+ const P = ((k = g == null ? void 0 : g.document) == null ? void 0 : k.documentElement) || (g == null ? void 0 : g.documentElement) || O(g), { display: L, flexDirection: R, direction: H } = getComputedStyle(P), M = H === "rtl" ? -1 : 1, F = P.scrollLeft;
617
+ E.left = F < p.value, E.right = F > p.value;
618
+ const q = Math.abs(F * M) <= (f.left || 0), J = Math.abs(F * M) + P.clientWidth >= P.scrollWidth - (f.right || 0) - re;
619
+ L === "flex" && R === "row-reverse" ? (T.left = J, T.right = q) : (T.left = q, T.right = J), p.value = F;
620
+ let C = P.scrollTop;
621
+ g === c.document && !C && (C = c.document.body.scrollTop), E.top = C < m.value, E.bottom = C > m.value;
622
+ const K = Math.abs(C) <= (f.top || 0), Z = Math.abs(C) + P.clientHeight >= P.scrollHeight - (f.bottom || 0) - re;
623
+ L === "flex" && R === "column-reverse" ? (T.top = Z, T.bottom = K) : (T.top = K, T.bottom = Z), m.value = C;
624
+ }, U = (g) => {
625
+ var k;
626
+ if (!c)
627
+ return;
628
+ const P = (k = g.target.documentElement) != null ? k : g.target;
629
+ V(P), y.value = !0, pe(g), l(g);
630
+ };
631
+ return W(
632
+ e,
633
+ "scroll",
634
+ o ? /* @__PURE__ */ Le(U, o, !0, !1) : U,
635
+ s
636
+ ), N(() => {
637
+ try {
638
+ const g = w(e);
639
+ if (!g)
640
+ return;
641
+ V(g);
642
+ } catch (g) {
643
+ i(g);
644
+ }
645
+ }), d != null && d.mutation && e != null && e !== c && e !== document && X(
646
+ e,
647
+ () => {
648
+ const g = w(e);
649
+ g && V(g);
650
+ },
651
+ {
652
+ attributes: !0,
653
+ childList: !0,
654
+ subtree: !0
655
+ }
656
+ ), W(
657
+ e,
658
+ "scrollend",
659
+ Q,
660
+ s
661
+ ), {
662
+ x: S,
663
+ y: v,
664
+ isScrolling: y,
665
+ arrivedState: T,
666
+ directions: E,
667
+ measure() {
668
+ const g = w(e);
669
+ c && g && V(g);
670
+ }
671
+ };
672
+ }
673
+ const ve = {
674
+ x: 0,
675
+ y: 0,
676
+ pointerId: 0,
677
+ pressure: 0,
678
+ tiltX: 0,
679
+ tiltY: 0,
680
+ width: 0,
681
+ height: 0,
682
+ twist: 0,
683
+ pointerType: null
684
+ }, Ye = /* @__PURE__ */ Object.keys(ve);
685
+ function tt(e = {}) {
686
+ const {
687
+ target: t = I
688
+ } = e, o = b(!1), n = b(e.initialValue || {});
689
+ Object.assign(n.value, ve, n.value);
690
+ const u = (l) => {
691
+ o.value = !0, !(e.pointerTypes && !e.pointerTypes.includes(l.pointerType)) && (n.value = Fe(l, Ye, !1));
692
+ };
693
+ if (t) {
694
+ const l = { passive: !0 };
695
+ W(t, ["pointerdown", "pointermove", "pointerup"], u, l), W(t, "pointerleave", () => o.value = !1, l);
154
696
  }
155
- }), fe = /* @__PURE__ */ N(ue, [["__scopeId", "data-v-f1e25842"]]);
156
- fe.name = "TrBasePopper";
697
+ return {
698
+ ...Re(n),
699
+ isInside: o
700
+ };
701
+ }
702
+ // @__NO_SIDE_EFFECTS__
703
+ function nt(e = {}) {
704
+ const {
705
+ window: t = I,
706
+ initialWidth: o = Number.POSITIVE_INFINITY,
707
+ initialHeight: n = Number.POSITIVE_INFINITY,
708
+ listenOrientation: u = !0,
709
+ includeScrollbar: l = !0,
710
+ type: f = "inner"
711
+ } = e, r = b(o), s = b(n), a = () => {
712
+ if (t)
713
+ if (f === "outer")
714
+ r.value = t.outerWidth, s.value = t.outerHeight;
715
+ else if (f === "visual" && t.visualViewport) {
716
+ const { width: i, height: d, scale: p } = t.visualViewport;
717
+ r.value = Math.round(i * p), s.value = Math.round(d * p);
718
+ } else l ? (r.value = t.innerWidth, s.value = t.innerHeight) : (r.value = t.document.documentElement.clientWidth, s.value = t.document.documentElement.clientHeight);
719
+ };
720
+ a(), N(a);
721
+ const c = { passive: !0 };
722
+ if (W("resize", a, c), t && f === "visual" && t.visualViewport && W(t.visualViewport, "resize", a, c), u) {
723
+ const i = Be("(orientation: portrait)");
724
+ A(i, () => a());
725
+ }
726
+ return { width: r, height: s };
727
+ }
157
728
  export {
158
- fe as B,
159
- ae as c,
160
- ce as u
729
+ O as a,
730
+ nt as b,
731
+ Ke as c,
732
+ Je as d,
733
+ Ze as e,
734
+ Xe as f,
735
+ W as g,
736
+ Be as h,
737
+ et as i,
738
+ de as j,
739
+ qe as k,
740
+ Ue as o,
741
+ tt as u,
742
+ Qe as w
161
743
  };