@opentiny/tiny-robot 0.3.0-alpha.12 → 0.3.0-alpha.13

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