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