arpeggi-framer-components 0.0.32 → 0.0.34
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.es.js +60 -61
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +14 -14
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
@@ -2,7 +2,7 @@ var Qa = Object.defineProperty;
|
|
2
2
|
var eo = (e, t, i) => t in e ? Qa(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i;
|
3
3
|
var Yt = (e, t, i) => eo(e, typeof t != "symbol" ? t + "" : t, i);
|
4
4
|
import * as to from "react";
|
5
|
-
import
|
5
|
+
import ce, { useState as gn, useLayoutEffect as zr, useEffect as Et, useMemo as Ze, useRef as Se, useReducer as no, useCallback as Ce, forwardRef as io, useImperativeHandle as ro, Fragment as ao, createContext as Mr, useContext as ui, useDebugValue as $r } from "react";
|
6
6
|
var Kt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
7
7
|
function Nr(e) {
|
8
8
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
@@ -15,16 +15,16 @@ function oo() {
|
|
15
15
|
return l.Date.now();
|
16
16
|
};
|
17
17
|
function w(v, O, B) {
|
18
|
-
var A, H, G, ne, ie, X, q = 0,
|
18
|
+
var A, H, G, ne, ie, X, q = 0, le = !1, me = !1, ye = !0;
|
19
19
|
if (typeof v != "function")
|
20
20
|
throw new TypeError(e);
|
21
|
-
O = T(O) || 0, m(B) && (
|
21
|
+
O = T(O) || 0, m(B) && (le = !!B.leading, me = "maxWait" in B, G = me ? x(T(B.maxWait) || 0, O) : G, ye = "trailing" in B ? !!B.trailing : ye);
|
22
22
|
function se(F) {
|
23
23
|
var U = A, K = H;
|
24
24
|
return A = H = void 0, q = F, ne = v.apply(K, U), ne;
|
25
25
|
}
|
26
26
|
function ve(F) {
|
27
|
-
return q = F, ie = setTimeout(L, O),
|
27
|
+
return q = F, ie = setTimeout(L, O), le ? se(F) : ne;
|
28
28
|
}
|
29
29
|
function S(F) {
|
30
30
|
var U = F - X, K = F - q, $ = O - U;
|
@@ -119,7 +119,7 @@ var Di;
|
|
119
119
|
function lo() {
|
120
120
|
if (Di) return It;
|
121
121
|
Di = 1;
|
122
|
-
var e =
|
122
|
+
var e = ce, t = Symbol.for("react.element"), i = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, r = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, a = { key: !0, ref: !0, __self: !0, __source: !0 };
|
123
123
|
function o(s, c, p) {
|
124
124
|
var l, u = {}, f = null, x = null;
|
125
125
|
p !== void 0 && (f = "" + p), c.key !== void 0 && (f = "" + c.key), c.ref !== void 0 && (x = c.ref);
|
@@ -142,7 +142,7 @@ var Bt = {};
|
|
142
142
|
var Fi;
|
143
143
|
function po() {
|
144
144
|
return Fi || (Fi = 1, process.env.NODE_ENV !== "production" && function() {
|
145
|
-
var e =
|
145
|
+
var e = ce, t = Symbol.for("react.element"), i = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), r = Symbol.for("react.strict_mode"), a = Symbol.for("react.profiler"), o = Symbol.for("react.provider"), s = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), p = Symbol.for("react.suspense"), l = Symbol.for("react.suspense_list"), u = Symbol.for("react.memo"), f = Symbol.for("react.lazy"), x = Symbol.for("react.offscreen"), h = Symbol.iterator, g = "@@iterator";
|
146
146
|
function w(d) {
|
147
147
|
if (d === null || typeof d != "object")
|
148
148
|
return null;
|
@@ -231,13 +231,13 @@ function po() {
|
|
231
231
|
}
|
232
232
|
return null;
|
233
233
|
}
|
234
|
-
var q = Object.assign,
|
234
|
+
var q = Object.assign, le = 0, me, ye, se, ve, S, _, L;
|
235
235
|
function N() {
|
236
236
|
}
|
237
237
|
N.__reactDisabledLog = !0;
|
238
238
|
function M() {
|
239
239
|
{
|
240
|
-
if (
|
240
|
+
if (le === 0) {
|
241
241
|
me = console.log, ye = console.info, se = console.warn, ve = console.error, S = console.group, _ = console.groupCollapsed, L = console.groupEnd;
|
242
242
|
var d = {
|
243
243
|
configurable: !0,
|
@@ -255,12 +255,12 @@ function po() {
|
|
255
255
|
groupEnd: d
|
256
256
|
});
|
257
257
|
}
|
258
|
-
|
258
|
+
le++;
|
259
259
|
}
|
260
260
|
}
|
261
261
|
function Y() {
|
262
262
|
{
|
263
|
-
if (
|
263
|
+
if (le--, le === 0) {
|
264
264
|
var d = {
|
265
265
|
configurable: !0,
|
266
266
|
enumerable: !0,
|
@@ -290,7 +290,7 @@ function po() {
|
|
290
290
|
})
|
291
291
|
});
|
292
292
|
}
|
293
|
-
|
293
|
+
le < 0 && k("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
294
294
|
}
|
295
295
|
}
|
296
296
|
var z = m.ReactCurrentDispatcher, F;
|
@@ -754,8 +754,8 @@ var ae = uo(), he = "colors", Ie = "sizes", I = "space", fo = { gap: I, gridGap:
|
|
754
754
|
}
|
755
755
|
}
|
756
756
|
if (k && (w = f.slice(1) in n.media ? "@media " + n.media[f.slice(1)] : f, f = w.replace(/\(\s*([\w-]+)\s*(=|<|<=|>|>=)\s*([\w-]+)\s*(?:(<|<=|>|>=)\s*([\w-]+)\s*)?\)/g, (O, B, A, H, G, ne) => {
|
757
|
-
const ie = _n.test(B), X = 0.0625 * (ie ? -1 : 1), [q,
|
758
|
-
return "(" + (A[0] === "=" ? "" : A[0] === ">" === ie ? "max-" : "min-") + q + ":" + (A[0] !== "=" && A.length === 1 ?
|
757
|
+
const ie = _n.test(B), X = 0.0625 * (ie ? -1 : 1), [q, le] = ie ? [H, B] : [B, H];
|
758
|
+
return "(" + (A[0] === "=" ? "" : A[0] === ">" === ie ? "max-" : "min-") + q + ":" + (A[0] !== "=" && A.length === 1 ? le.replace(_n, (me, ye, se) => Number(ye) + X * (A === ">" ? 1 : -1) + se) : le) + (G ? ") and (" + (G[0] === ">" ? "min-" : "max-") + q + ":" + (G.length === 1 ? ne.replace(_n, (me, ye, se) => Number(ye) + X * (G === ">" ? -1 : 1) + se) : ne) : "") + ")";
|
759
759
|
})), v) {
|
760
760
|
const O = k ? u.concat(f) : [...u], B = k ? [...l] : go(l, f.split(bo));
|
761
761
|
a !== void 0 && r(Li(...a)), a = void 0, c(x, B, O);
|
@@ -1049,9 +1049,9 @@ var ae = uo(), he = "colors", Ie = "sizes", I = "space", fo = { gap: I, gridGap:
|
|
1049
1049
|
return t.styled = (({ config: i, sheet: n }) => Mo(i, () => {
|
1050
1050
|
const r = Mi(i, n);
|
1051
1051
|
return (...a) => {
|
1052
|
-
const o = r(...a), s = o[pt].type, c =
|
1052
|
+
const o = r(...a), s = o[pt].type, c = ce.forwardRef((p, l) => {
|
1053
1053
|
const u = p && p.as || s, { props: f, deferredInjector: x } = o(p);
|
1054
|
-
return delete f.as, f.ref = l, x ?
|
1054
|
+
return delete f.as, f.ref = l, x ? ce.createElement(ce.Fragment, null, ce.createElement(u, f), ce.createElement(x, null)) : ce.createElement(u, f);
|
1055
1055
|
});
|
1056
1056
|
return c.className = o.className, c.displayName = `Styled.${s.displayName || s.name || s}`, c.selector = o.selector, c.toString = () => o.selector, c[pt] = o[pt], c;
|
1057
1057
|
};
|
@@ -2554,7 +2554,7 @@ function Go() {
|
|
2554
2554
|
}
|
2555
2555
|
}
|
2556
2556
|
}
|
2557
|
-
var v = c, O = p, B = s, A = o, H = t, G = l, ne = n, ie = h, X = x, q = i,
|
2557
|
+
var v = c, O = p, B = s, A = o, H = t, G = l, ne = n, ie = h, X = x, q = i, le = a, me = r, ye = u, se = !1;
|
2558
2558
|
function ve(b) {
|
2559
2559
|
return se || (se = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), S(b) || T(b) === c;
|
2560
2560
|
}
|
@@ -2594,7 +2594,7 @@ function Go() {
|
|
2594
2594
|
function be(b) {
|
2595
2595
|
return T(b) === u;
|
2596
2596
|
}
|
2597
|
-
fe.AsyncMode = v, fe.ConcurrentMode = O, fe.ContextConsumer = B, fe.ContextProvider = A, fe.Element = H, fe.ForwardRef = G, fe.Fragment = ne, fe.Lazy = ie, fe.Memo = X, fe.Portal = q, fe.Profiler =
|
2597
|
+
fe.AsyncMode = v, fe.ConcurrentMode = O, fe.ContextConsumer = B, fe.ContextProvider = A, fe.Element = H, fe.ForwardRef = G, fe.Fragment = ne, fe.Lazy = ie, fe.Memo = X, fe.Portal = q, fe.Profiler = le, fe.StrictMode = me, fe.Suspense = ye, fe.isAsyncMode = ve, fe.isConcurrentMode = S, fe.isContextConsumer = _, fe.isContextProvider = L, fe.isElement = N, fe.isForwardRef = M, fe.isFragment = Y, fe.isLazy = z, fe.isMemo = F, fe.isPortal = U, fe.isProfiler = K, fe.isStrictMode = $, fe.isSuspense = be, fe.isValidElementType = C, fe.typeOf = T;
|
2598
2598
|
}()), fe;
|
2599
2599
|
}
|
2600
2600
|
var Yi;
|
@@ -2994,12 +2994,12 @@ Valid keys: ` + JSON.stringify(Object.keys(S), null, " ")
|
|
2994
2994
|
return !1;
|
2995
2995
|
}
|
2996
2996
|
}
|
2997
|
-
function
|
2997
|
+
function le(S, _) {
|
2998
2998
|
return S === "symbol" ? !0 : _ ? _["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && _ instanceof Symbol : !1;
|
2999
2999
|
}
|
3000
3000
|
function me(S) {
|
3001
3001
|
var _ = typeof S;
|
3002
|
-
return Array.isArray(S) ? "array" : S instanceof RegExp ? "object" :
|
3002
|
+
return Array.isArray(S) ? "array" : S instanceof RegExp ? "object" : le(_, S) ? "symbol" : _;
|
3003
3003
|
}
|
3004
3004
|
function ye(S) {
|
3005
3005
|
if (typeof S > "u" || S === null)
|
@@ -4792,7 +4792,7 @@ var mi = /* @__PURE__ */ io(function(e, t) {
|
|
4792
4792
|
return {
|
4793
4793
|
open: a
|
4794
4794
|
};
|
4795
|
-
}, [a]), /* @__PURE__ */
|
4795
|
+
}, [a]), /* @__PURE__ */ ce.createElement(ao, null, i(Oe(Oe({}, o), {}, {
|
4796
4796
|
open: a
|
4797
4797
|
})));
|
4798
4798
|
});
|
@@ -5000,10 +5000,10 @@ function ia() {
|
|
5000
5000
|
return typeof w == "function" ? w : fr;
|
5001
5001
|
}, [w]), X = Ze(function() {
|
5002
5002
|
return typeof g == "function" ? g : fr;
|
5003
|
-
}, [g]), q = Se(null),
|
5003
|
+
}, [g]), q = Se(null), le = Se(null), me = no(Ys, ei), ye = Ln(me, 2), se = ye[0], ve = ye[1], S = se.isFocused, _ = se.isFileDialogActive, L = Se(typeof window < "u" && window.isSecureContext && m && js()), N = function() {
|
5004
5004
|
!L.current && _ && setTimeout(function() {
|
5005
|
-
if (
|
5006
|
-
var j =
|
5005
|
+
if (le.current) {
|
5006
|
+
var j = le.current.files;
|
5007
5007
|
j.length || (ve({
|
5008
5008
|
type: "closeDialog"
|
5009
5009
|
}), X());
|
@@ -5014,7 +5014,7 @@ function ia() {
|
|
5014
5014
|
return window.addEventListener("focus", N, !1), function() {
|
5015
5015
|
window.removeEventListener("focus", N, !1);
|
5016
5016
|
};
|
5017
|
-
}, [
|
5017
|
+
}, [le, _, X, L]);
|
5018
5018
|
var M = Se([]), Y = function(j) {
|
5019
5019
|
q.current && q.current.contains(j.target) || (j.preventDefault(), M.current = []);
|
5020
5020
|
};
|
@@ -5122,13 +5122,13 @@ function ia() {
|
|
5122
5122
|
}).catch(function(j) {
|
5123
5123
|
Ps(j) ? (X(j), ve({
|
5124
5124
|
type: "closeDialog"
|
5125
|
-
})) : Is(j) ? (L.current = !1,
|
5125
|
+
})) : Is(j) ? (L.current = !1, le.current ? (le.current.value = null, le.current.click()) : z(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))) : z(j);
|
5126
5126
|
});
|
5127
5127
|
return;
|
5128
5128
|
}
|
5129
|
-
|
5129
|
+
le.current && (ve({
|
5130
5130
|
type: "openDialog"
|
5131
|
-
}), ie(),
|
5131
|
+
}), ie(), le.current.value = null, le.current.click());
|
5132
5132
|
}, [ve, ie, X, m, $, z, ne, s]), P = Ce(function(E) {
|
5133
5133
|
!q.current || !q.current.isEqualNode(E.target) || (E.key === " " || E.key === "Enter" || E.keyCode === 32 || E.keyCode === 13) && (E.preventDefault(), b());
|
5134
5134
|
}, [q, b]), Z = Ce(function() {
|
@@ -5189,16 +5189,16 @@ function ia() {
|
|
5189
5189
|
onChange: Te(Ue(ge, be)),
|
5190
5190
|
onClick: Te(Ue(ke, Ne)),
|
5191
5191
|
tabIndex: -1
|
5192
|
-
}, pe,
|
5192
|
+
}, pe, le);
|
5193
5193
|
return Oe(Oe({}, Je), et);
|
5194
5194
|
};
|
5195
|
-
}, [
|
5195
|
+
}, [le, i, s, be, n]);
|
5196
5196
|
return Oe(Oe({}, se), {}, {
|
5197
5197
|
isFocused: S && !n,
|
5198
5198
|
getRootProps: Ye,
|
5199
5199
|
getInputProps: Ke,
|
5200
5200
|
rootRef: q,
|
5201
|
-
inputRef:
|
5201
|
+
inputRef: le,
|
5202
5202
|
open: Te(b)
|
5203
5203
|
});
|
5204
5204
|
}
|
@@ -5374,9 +5374,9 @@ const oc = (e) => ({
|
|
5374
5374
|
});
|
5375
5375
|
}
|
5376
5376
|
}), error: o, ...e };
|
5377
|
-
}, aa =
|
5377
|
+
}, aa = ce.createContext(
|
5378
5378
|
{}
|
5379
|
-
), lu = () =>
|
5379
|
+
), lu = () => ce.useContext(aa), cc = qe(xt, {
|
5380
5380
|
position: "relative",
|
5381
5381
|
display: "flex",
|
5382
5382
|
flexDirection: "column",
|
@@ -7141,7 +7141,7 @@ var Cr;
|
|
7141
7141
|
function Ul() {
|
7142
7142
|
if (Cr) return qn;
|
7143
7143
|
Cr = 1;
|
7144
|
-
var e =
|
7144
|
+
var e = ce;
|
7145
7145
|
function t(u, f) {
|
7146
7146
|
return u === f && (u !== 0 || 1 / u === 1 / f) || u !== u && f !== f;
|
7147
7147
|
}
|
@@ -7186,7 +7186,7 @@ var Ar;
|
|
7186
7186
|
function Vl() {
|
7187
7187
|
return Ar || (Ar = 1, process.env.NODE_ENV !== "production" && function() {
|
7188
7188
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
7189
|
-
var e =
|
7189
|
+
var e = ce, t = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
7190
7190
|
function i(C) {
|
7191
7191
|
{
|
7192
7192
|
for (var T = arguments.length, v = new Array(T > 1 ? T - 1 : 0), O = 1; O < T; O++)
|
@@ -7332,7 +7332,7 @@ const Jl = () => ci, [li, pi] = Rn && window.addEventListener ? [
|
|
7332
7332
|
}, tp = {
|
7333
7333
|
initFocus: Zl,
|
7334
7334
|
initReconnect: Ql
|
7335
|
-
}, Ut = !
|
7335
|
+
}, Ut = !ce.useId, mt = !Rn || "Deno" in window, ja = (e) => Kl() ? window.requestAnimationFrame(e) : setTimeout(e, 1), nt = mt ? Et : zr, Hn = typeof navigator < "u" && navigator.connection, Dr = !mt && Hn && ([
|
7336
7336
|
"slow-2g",
|
7337
7337
|
"2g"
|
7338
7338
|
].includes(Hn.effectiveType) || Hn.saveData), Gt = (e) => {
|
@@ -7517,7 +7517,7 @@ const Fr = (e, t) => {
|
|
7517
7517
|
}
|
7518
7518
|
return i;
|
7519
7519
|
}, pp = Mr({}), up = "$inf$", Ba = Rn && window.__SWR_DEVTOOLS_USE__, dp = Ba ? window.__SWR_DEVTOOLS_USE__ : [], fp = () => {
|
7520
|
-
Ba && (window.__SWR_DEVTOOLS_REACT__ =
|
7520
|
+
Ba && (window.__SWR_DEVTOOLS_REACT__ = ce);
|
7521
7521
|
}, La = (e) => Me(e[1]) ? [
|
7522
7522
|
e[0],
|
7523
7523
|
e[1],
|
@@ -7553,7 +7553,7 @@ const Fr = (e, t) => {
|
|
7553
7553
|
});
|
7554
7554
|
};
|
7555
7555
|
fp();
|
7556
|
-
const Pr =
|
7556
|
+
const Pr = ce.use || ((e) => {
|
7557
7557
|
if (e.status === "pending")
|
7558
7558
|
throw e;
|
7559
7559
|
if (e.status === "fulfilled")
|
@@ -7566,7 +7566,7 @@ const Pr = le.use || ((e) => {
|
|
7566
7566
|
}), Gn = {
|
7567
7567
|
dedupe: !0
|
7568
7568
|
}, gp = (e, t, i) => {
|
7569
|
-
const { cache: n, compare: r, suspense: a, fallbackData: o, revalidateOnMount: s, revalidateIfStale: c, refreshInterval: p, refreshWhenHidden: l, refreshWhenOffline: u, keepPreviousData: f } = i, [x, h, g, w] = He.get(n), [m, k] = Gt(e), C = Se(!1), T = Se(!1), v = Se(m), O = Se(t), B = Se(i), A = () => B.current, H = () => A().isVisible() && A().isOnline(), [G, ne, ie, X] = bi(n, m), q = Se({}).current,
|
7569
|
+
const { cache: n, compare: r, suspense: a, fallbackData: o, revalidateOnMount: s, revalidateIfStale: c, refreshInterval: p, refreshWhenHidden: l, refreshWhenOffline: u, keepPreviousData: f } = i, [x, h, g, w] = He.get(n), [m, k] = Gt(e), C = Se(!1), T = Se(!1), v = Se(m), O = Se(t), B = Se(i), A = () => B.current, H = () => A().isVisible() && A().isOnline(), [G, ne, ie, X] = bi(n, m), q = Se({}).current, le = V(o) ? i.fallback[m] : o, me = (b, P) => {
|
7570
7570
|
for (const Z in q) {
|
7571
7571
|
const W = Z;
|
7572
7572
|
if (W === "data") {
|
@@ -7605,7 +7605,7 @@ const Pr = le.use || ((e) => {
|
|
7605
7605
|
n,
|
7606
7606
|
m
|
7607
7607
|
]
|
7608
|
-
), ye[0], ye[1]), ve = !C.current, S = x[m] && x[m].length > 0, _ = se.data, L = V(_) ?
|
7608
|
+
), ye[0], ye[1]), ve = !C.current, S = x[m] && x[m].length > 0, _ = se.data, L = V(_) ? le : _, N = se.error, M = Se(L), Y = f ? V(_) ? M.current : _ : L, z = S && !V(N) ? !1 : ve && !V(s) ? s : A().isPaused() ? !1 : a ? V(L) ? !1 : c : V(L) || c, F = !!(m && t && ve && z), U = V(se.isValidating) ? F : se.isValidating, K = V(se.isLoading) ? F : se.isLoading, $ = Ce(
|
7609
7609
|
async (b) => {
|
7610
7610
|
const P = O.current;
|
7611
7611
|
if (!m || !P || T.current || A().isPaused())
|
@@ -7747,7 +7747,7 @@ const Pr = le.use || ((e) => {
|
|
7747
7747
|
return q.isLoading = !0, K;
|
7748
7748
|
}
|
7749
7749
|
};
|
7750
|
-
}, hp = Ma(gp), Ir =
|
7750
|
+
}, hp = Ma(gp), Ir = ce.use || ((e) => {
|
7751
7751
|
if (e.status === "pending")
|
7752
7752
|
throw e;
|
7753
7753
|
if (e.status === "fulfilled")
|
@@ -7760,7 +7760,7 @@ const Pr = le.use || ((e) => {
|
|
7760
7760
|
}), Yn = {
|
7761
7761
|
dedupe: !0
|
7762
7762
|
}, yp = (e, t, i) => {
|
7763
|
-
const { cache: n, compare: r, suspense: a, fallbackData: o, revalidateOnMount: s, revalidateIfStale: c, refreshInterval: p, refreshWhenHidden: l, refreshWhenOffline: u, keepPreviousData: f } = i, [x, h, g, w] = He.get(n), [m, k] = Gt(e), C = Se(!1), T = Se(!1), v = Se(m), O = Se(t), B = Se(i), A = () => B.current, H = () => A().isVisible() && A().isOnline(), [G, ne, ie, X] = bi(n, m), q = Se({}).current,
|
7763
|
+
const { cache: n, compare: r, suspense: a, fallbackData: o, revalidateOnMount: s, revalidateIfStale: c, refreshInterval: p, refreshWhenHidden: l, refreshWhenOffline: u, keepPreviousData: f } = i, [x, h, g, w] = He.get(n), [m, k] = Gt(e), C = Se(!1), T = Se(!1), v = Se(m), O = Se(t), B = Se(i), A = () => B.current, H = () => A().isVisible() && A().isOnline(), [G, ne, ie, X] = bi(n, m), q = Se({}).current, le = V(o) ? i.fallback[m] : o, me = (b, P) => {
|
7764
7764
|
for (const Z in q) {
|
7765
7765
|
const W = Z;
|
7766
7766
|
if (W === "data") {
|
@@ -7799,7 +7799,7 @@ const Pr = le.use || ((e) => {
|
|
7799
7799
|
n,
|
7800
7800
|
m
|
7801
7801
|
]
|
7802
|
-
), ye[0], ye[1]), ve = !C.current, S = x[m] && x[m].length > 0, _ = se.data, L = V(_) ?
|
7802
|
+
), ye[0], ye[1]), ve = !C.current, S = x[m] && x[m].length > 0, _ = se.data, L = V(_) ? le : _, N = se.error, M = Se(L), Y = f ? V(_) ? M.current : _ : L, z = S && !V(N) ? !1 : ve && !V(s) ? s : A().isPaused() ? !1 : a ? V(L) ? !1 : c : V(L) || c, F = !!(m && t && ve && z), U = V(se.isValidating) ? F : se.isValidating, K = V(se.isLoading) ? F : se.isLoading, $ = Ce(
|
7803
7803
|
async (b) => {
|
7804
7804
|
const P = O.current;
|
7805
7805
|
if (!m || !P || T.current || A().isPaused())
|
@@ -7943,7 +7943,7 @@ const Pr = le.use || ((e) => {
|
|
7943
7943
|
};
|
7944
7944
|
}, bp = Ma(yp), Br = Ut ? (e) => {
|
7945
7945
|
e();
|
7946
|
-
} :
|
7946
|
+
} : ce.startTransition, wp = (e) => {
|
7947
7947
|
const [, t] = gn({}), i = Se(!1), n = Se(e), r = Se({
|
7948
7948
|
data: !1,
|
7949
7949
|
error: !1,
|
@@ -8207,7 +8207,6 @@ const Ip = (e) => {
|
|
8207
8207
|
height: "100%",
|
8208
8208
|
width: "100%",
|
8209
8209
|
background: "#ffffff",
|
8210
|
-
transition: "transform 0.2s ease-in-out",
|
8211
8210
|
transform: "translateX(var(--progress))",
|
8212
8211
|
borderRadius: "12px"
|
8213
8212
|
}), it = {
|
@@ -8310,8 +8309,8 @@ class Up {
|
|
8310
8309
|
}
|
8311
8310
|
}
|
8312
8311
|
const sn = new Up(), qa = "Recording.wav", Vp = 1500, du = (e) => {
|
8313
|
-
const [t, i] =
|
8314
|
-
return
|
8312
|
+
const [t, i] = ce.useState(!1), [n, r] = ce.useState(!1), [a, o] = ce.useState(!1);
|
8313
|
+
return ce.useEffect(() => {
|
8315
8314
|
var p;
|
8316
8315
|
const c = async () => {
|
8317
8316
|
sn.checkMicrophonePermission().then(i);
|
@@ -8365,7 +8364,7 @@ const sn = new Up(), qa = "Recording.wav", Vp = 1500, du = (e) => {
|
|
8365
8364
|
refreshInterval: 1e3
|
8366
8365
|
});
|
8367
8366
|
}, Jp = () => {
|
8368
|
-
const [e, t] =
|
8367
|
+
const [e, t] = ce.useState(null), [i, n] = ce.useState(0), [r, a] = ce.useState(0), { data: o, isLoading: s } = Kp(i), { trigger: c, isMutating: p } = Sp("/ml-inference-jobs", Gp);
|
8369
8368
|
return {
|
8370
8369
|
file: e,
|
8371
8370
|
setFile: t,
|
@@ -8393,7 +8392,7 @@ const sn = new Up(), qa = "Recording.wav", Vp = 1500, du = (e) => {
|
|
8393
8392
|
},
|
8394
8393
|
isMutating: p
|
8395
8394
|
};
|
8396
|
-
}, Ua =
|
8395
|
+
}, Ua = ce.createContext({}), Si = () => ce.useContext(Ua), fu = ({ children: e }) => {
|
8397
8396
|
const t = Jp();
|
8398
8397
|
return /* @__PURE__ */ ae.jsx(Fp, { children: /* @__PURE__ */ ae.jsx(Ua.Provider, { value: t, children: e }) });
|
8399
8398
|
}, Xp = qe("button", {
|
@@ -8426,24 +8425,24 @@ const sn = new Up(), qa = "Recording.wav", Vp = 1500, du = (e) => {
|
|
8426
8425
|
cursor: "not-allowed"
|
8427
8426
|
}
|
8428
8427
|
}), mu = (e) => {
|
8429
|
-
var
|
8430
|
-
const { data: t, isMutating: i } = Si(), n = (
|
8431
|
-
return
|
8432
|
-
if (!r.
|
8428
|
+
var c;
|
8429
|
+
const { data: t, isMutating: i } = Si(), n = (c = t == null ? void 0 : t.lossyOutputFile) == null ? void 0 : c.url, { player: r, playPause: a } = Pp(n), o = ce.useRef(null), s = ce.useRef();
|
8430
|
+
return ce.useEffect(() => {
|
8431
|
+
if (!r.isPlaying)
|
8433
8432
|
return () => {
|
8434
8433
|
var l;
|
8435
|
-
(l = o.current) == null || l.style.setProperty("--progress", "0%");
|
8434
|
+
(l = o.current) == null || l.style.setProperty("--progress", "0%"), cancelAnimationFrame(s.current);
|
8436
8435
|
};
|
8437
|
-
const
|
8436
|
+
const p = () => {
|
8438
8437
|
var u;
|
8439
|
-
const l =
|
8440
|
-
(u = o
|
8438
|
+
const l = r.audioRef.current.currentTime / r.audioRef.current.duration;
|
8439
|
+
(u = o.current) == null || u.style.setProperty("--progress", `${-100 + l * 100}%`), s.current = requestAnimationFrame(p);
|
8441
8440
|
};
|
8442
|
-
return
|
8441
|
+
return s.current = requestAnimationFrame(p), () => {
|
8443
8442
|
var l;
|
8444
|
-
|
8443
|
+
cancelAnimationFrame(s.current), (l = o.current) == null || l.style.setProperty("--progress", "0%");
|
8445
8444
|
};
|
8446
|
-
}, [r.
|
8445
|
+
}, [r.isPlaying, r.audioRef]), /* @__PURE__ */ ae.jsxs(xt, { row: !0, align: "center", flex: "1", gap: "16", ...e, children: [
|
8447
8446
|
/* @__PURE__ */ ae.jsx(Xp, { onClick: a, disabled: r.isLoading || !n, children: /* @__PURE__ */ ae.jsxs(lt, { children: [
|
8448
8447
|
/* @__PURE__ */ ae.jsx(lt.If, { isTrue: r.isLoading || (t == null ? void 0 : t.jobStatus) === "running" || i, children: /* @__PURE__ */ ae.jsx(kp, {}) }),
|
8449
8448
|
/* @__PURE__ */ ae.jsx(lt.If, { isTrue: r.isPlaying, children: /* @__PURE__ */ ae.jsx(Op, {}) }),
|
@@ -8452,8 +8451,8 @@ const sn = new Up(), qa = "Recording.wav", Vp = 1500, du = (e) => {
|
|
8452
8451
|
/* @__PURE__ */ ae.jsx(it.Root, { ref: o, children: /* @__PURE__ */ ae.jsx(it.Bar, {}) })
|
8453
8452
|
] });
|
8454
8453
|
}, Zp = 30, Qp = (e) => {
|
8455
|
-
const t =
|
8456
|
-
return
|
8454
|
+
const t = ce.useRef(), i = ce.useRef(null);
|
8455
|
+
return ce.useEffect(() => {
|
8457
8456
|
let n = 0;
|
8458
8457
|
return t.current = setInterval(() => {
|
8459
8458
|
var a;
|