twist-aplayer
Version:
A shadui theme aplayer
1,400 lines (1,398 loc) • 67.5 kB
JavaScript
import * as ie from "react";
import Oe, { useMemo as K, useRef as F, useState as Y, useEffect as B, useCallback as R } from "react";
var _e = { exports: {} }, de = {};
/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var nr;
function Ur() {
if (nr) return de;
nr = 1;
var e = Oe, r = Symbol.for("react.element"), n = Symbol.for("react.fragment"), a = Object.prototype.hasOwnProperty, i = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, m = { key: !0, ref: !0, __self: !0, __source: !0 };
function c(g, s, y) {
var l, h = {}, x = null, E = null;
y !== void 0 && (x = "" + y), s.key !== void 0 && (x = "" + s.key), s.ref !== void 0 && (E = s.ref);
for (l in s) a.call(s, l) && !m.hasOwnProperty(l) && (h[l] = s[l]);
if (g && g.defaultProps) for (l in s = g.defaultProps, s) h[l] === void 0 && (h[l] = s[l]);
return { $$typeof: r, type: g, key: x, ref: E, props: h, _owner: i.current };
}
return de.Fragment = n, de.jsx = c, de.jsxs = c, de;
}
var ve = {};
/**
* @license React
* react-jsx-runtime.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var ar;
function Yr() {
return ar || (ar = 1, process.env.NODE_ENV !== "production" && function() {
var e = Oe, r = Symbol.for("react.element"), n = Symbol.for("react.portal"), a = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), m = Symbol.for("react.profiler"), c = Symbol.for("react.provider"), g = Symbol.for("react.context"), s = Symbol.for("react.forward_ref"), y = Symbol.for("react.suspense"), l = Symbol.for("react.suspense_list"), h = Symbol.for("react.memo"), x = Symbol.for("react.lazy"), E = Symbol.for("react.offscreen"), b = Symbol.iterator, u = "@@iterator";
function d(t) {
if (t === null || typeof t != "object")
return null;
var o = b && t[b] || t[u];
return typeof o == "function" ? o : null;
}
var p = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
function T(t) {
{
for (var o = arguments.length, v = new Array(o > 1 ? o - 1 : 0), S = 1; S < o; S++)
v[S - 1] = arguments[S];
j("error", t, v);
}
}
function j(t, o, v) {
{
var S = p.ReactDebugCurrentFrame, O = S.getStackAddendum();
O !== "" && (o += "%s", v = v.concat([O]));
var P = v.map(function(w) {
return String(w);
});
P.unshift("Warning: " + o), Function.prototype.apply.call(console[t], console, P);
}
}
var L = !1, z = !1, H = !1, q = !1, J = !1, A;
A = Symbol.for("react.module.reference");
function pe(t) {
return !!(typeof t == "string" || typeof t == "function" || t === a || t === m || J || t === i || t === y || t === l || q || t === E || L || z || H || typeof t == "object" && t !== null && (t.$$typeof === x || t.$$typeof === h || t.$$typeof === c || t.$$typeof === g || t.$$typeof === s || // This needs to include all possible module reference object
// types supported by any Flight configuration anywhere since
// we don't know which Flight build this will end up being used
// with.
t.$$typeof === A || t.getModuleId !== void 0));
}
function Re(t, o, v) {
var S = t.displayName;
if (S)
return S;
var O = o.displayName || o.name || "";
return O !== "" ? v + "(" + O + ")" : v;
}
function ye(t) {
return t.displayName || "Context";
}
function W(t) {
if (t == null)
return null;
if (typeof t.tag == "number" && T("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof t == "function")
return t.displayName || t.name || null;
if (typeof t == "string")
return t;
switch (t) {
case a:
return "Fragment";
case n:
return "Portal";
case m:
return "Profiler";
case i:
return "StrictMode";
case y:
return "Suspense";
case l:
return "SuspenseList";
}
if (typeof t == "object")
switch (t.$$typeof) {
case g:
var o = t;
return ye(o) + ".Consumer";
case c:
var v = t;
return ye(v._context) + ".Provider";
case s:
return Re(t, t.render, "ForwardRef");
case h:
var S = t.displayName || null;
return S !== null ? S : W(t.type) || "Memo";
case x: {
var O = t, P = O._payload, w = O._init;
try {
return W(w(P));
} catch {
return null;
}
}
}
return null;
}
var U = Object.assign, X = 0, ee, oe, ue, I, re, se, le;
function be() {
}
be.__reactDisabledLog = !0;
function ce() {
{
if (X === 0) {
ee = console.log, oe = console.info, ue = console.warn, I = console.error, re = console.group, se = console.groupCollapsed, le = console.groupEnd;
var t = {
configurable: !0,
enumerable: !0,
value: be,
writable: !0
};
Object.defineProperties(console, {
info: t,
log: t,
warn: t,
error: t,
group: t,
groupCollapsed: t,
groupEnd: t
});
}
X++;
}
}
function Er() {
{
if (X--, X === 0) {
var t = {
configurable: !0,
enumerable: !0,
writable: !0
};
Object.defineProperties(console, {
log: U({}, t, {
value: ee
}),
info: U({}, t, {
value: oe
}),
warn: U({}, t, {
value: ue
}),
error: U({}, t, {
value: I
}),
group: U({}, t, {
value: re
}),
groupCollapsed: U({}, t, {
value: se
}),
groupEnd: U({}, t, {
value: le
})
});
}
X < 0 && T("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
}
}
var Pe = p.ReactCurrentDispatcher, Le;
function ge(t, o, v) {
{
if (Le === void 0)
try {
throw Error();
} catch (O) {
var S = O.stack.trim().match(/\n( *(at )?)/);
Le = S && S[1] || "";
}
return `
` + Le + t;
}
}
var Ce = !1, Ee;
{
var xr = typeof WeakMap == "function" ? WeakMap : Map;
Ee = new xr();
}
function Be(t, o) {
if (!t || Ce)
return "";
{
var v = Ee.get(t);
if (v !== void 0)
return v;
}
var S;
Ce = !0;
var O = Error.prepareStackTrace;
Error.prepareStackTrace = void 0;
var P;
P = Pe.current, Pe.current = null, ce();
try {
if (o) {
var w = function() {
throw Error();
};
if (Object.defineProperty(w.prototype, "props", {
set: function() {
throw Error();
}
}), typeof Reflect == "object" && Reflect.construct) {
try {
Reflect.construct(w, []);
} catch (D) {
S = D;
}
Reflect.construct(t, [], w);
} else {
try {
w.call();
} catch (D) {
S = D;
}
t.call(w.prototype);
}
} else {
try {
throw Error();
} catch (D) {
S = D;
}
t();
}
} catch (D) {
if (D && S && typeof D.stack == "string") {
for (var _ = D.stack.split(`
`), k = S.stack.split(`
`), $ = _.length - 1, M = k.length - 1; $ >= 1 && M >= 0 && _[$] !== k[M]; )
M--;
for (; $ >= 1 && M >= 0; $--, M--)
if (_[$] !== k[M]) {
if ($ !== 1 || M !== 1)
do
if ($--, M--, M < 0 || _[$] !== k[M]) {
var V = `
` + _[$].replace(" at new ", " at ");
return t.displayName && V.includes("<anonymous>") && (V = V.replace("<anonymous>", t.displayName)), typeof t == "function" && Ee.set(t, V), V;
}
while ($ >= 1 && M >= 0);
break;
}
}
} finally {
Ce = !1, Pe.current = P, Er(), Error.prepareStackTrace = O;
}
var ne = t ? t.displayName || t.name : "", Q = ne ? ge(ne) : "";
return typeof t == "function" && Ee.set(t, Q), Q;
}
function Sr(t, o, v) {
return Be(t, !1);
}
function _r(t) {
var o = t.prototype;
return !!(o && o.isReactComponent);
}
function xe(t, o, v) {
if (t == null)
return "";
if (typeof t == "function")
return Be(t, _r(t));
if (typeof t == "string")
return ge(t);
switch (t) {
case y:
return ge("Suspense");
case l:
return ge("SuspenseList");
}
if (typeof t == "object")
switch (t.$$typeof) {
case s:
return Sr(t.render);
case h:
return xe(t.type, o, v);
case x: {
var S = t, O = S._payload, P = S._init;
try {
return xe(P(O), o, v);
} catch {
}
}
}
return "";
}
var fe = Object.prototype.hasOwnProperty, ze = {}, He = p.ReactDebugCurrentFrame;
function Se(t) {
if (t) {
var o = t._owner, v = xe(t.type, t._source, o ? o.type : null);
He.setExtraStackFrame(v);
} else
He.setExtraStackFrame(null);
}
function wr(t, o, v, S, O) {
{
var P = Function.call.bind(fe);
for (var w in t)
if (P(t, w)) {
var _ = void 0;
try {
if (typeof t[w] != "function") {
var k = Error((S || "React class") + ": " + v + " type `" + w + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof t[w] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
throw k.name = "Invariant Violation", k;
}
_ = t[w](o, w, S, v, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
} catch ($) {
_ = $;
}
_ && !(_ instanceof Error) && (Se(O), T("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", S || "React class", v, w, typeof _), Se(null)), _ instanceof Error && !(_.message in ze) && (ze[_.message] = !0, Se(O), T("Failed %s type: %s", v, _.message), Se(null));
}
}
}
var Tr = Array.isArray;
function $e(t) {
return Tr(t);
}
function jr(t) {
{
var o = typeof Symbol == "function" && Symbol.toStringTag, v = o && t[Symbol.toStringTag] || t.constructor.name || "Object";
return v;
}
}
function Or(t) {
try {
return We(t), !1;
} catch {
return !0;
}
}
function We(t) {
return "" + t;
}
function Ue(t) {
if (Or(t))
return T("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", jr(t)), We(t);
}
var Ye = p.ReactCurrentOwner, Rr = {
key: !0,
ref: !0,
__self: !0,
__source: !0
}, Ge, Ke;
function Pr(t) {
if (fe.call(t, "ref")) {
var o = Object.getOwnPropertyDescriptor(t, "ref").get;
if (o && o.isReactWarning)
return !1;
}
return t.ref !== void 0;
}
function Lr(t) {
if (fe.call(t, "key")) {
var o = Object.getOwnPropertyDescriptor(t, "key").get;
if (o && o.isReactWarning)
return !1;
}
return t.key !== void 0;
}
function Cr(t, o) {
typeof t.ref == "string" && Ye.current;
}
function $r(t, o) {
{
var v = function() {
Ge || (Ge = !0, T("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", o));
};
v.isReactWarning = !0, Object.defineProperty(t, "key", {
get: v,
configurable: !0
});
}
}
function Ar(t, o) {
{
var v = function() {
Ke || (Ke = !0, T("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", o));
};
v.isReactWarning = !0, Object.defineProperty(t, "ref", {
get: v,
configurable: !0
});
}
}
var Mr = function(t, o, v, S, O, P, w) {
var _ = {
// This tag allows us to uniquely identify this as a React Element
$$typeof: r,
// Built-in properties that belong on the element
type: t,
key: o,
ref: v,
props: w,
// Record the component responsible for creating this element.
_owner: P
};
return _._store = {}, Object.defineProperty(_._store, "validated", {
configurable: !1,
enumerable: !1,
writable: !0,
value: !1
}), Object.defineProperty(_, "_self", {
configurable: !1,
enumerable: !1,
writable: !1,
value: S
}), Object.defineProperty(_, "_source", {
configurable: !1,
enumerable: !1,
writable: !1,
value: O
}), Object.freeze && (Object.freeze(_.props), Object.freeze(_)), _;
};
function Nr(t, o, v, S, O) {
{
var P, w = {}, _ = null, k = null;
v !== void 0 && (Ue(v), _ = "" + v), Lr(o) && (Ue(o.key), _ = "" + o.key), Pr(o) && (k = o.ref, Cr(o, O));
for (P in o)
fe.call(o, P) && !Rr.hasOwnProperty(P) && (w[P] = o[P]);
if (t && t.defaultProps) {
var $ = t.defaultProps;
for (P in $)
w[P] === void 0 && (w[P] = $[P]);
}
if (_ || k) {
var M = typeof t == "function" ? t.displayName || t.name || "Unknown" : t;
_ && $r(w, M), k && Ar(w, M);
}
return Mr(t, _, k, O, S, Ye.current, w);
}
}
var Ae = p.ReactCurrentOwner, Je = p.ReactDebugCurrentFrame;
function te(t) {
if (t) {
var o = t._owner, v = xe(t.type, t._source, o ? o.type : null);
Je.setExtraStackFrame(v);
} else
Je.setExtraStackFrame(null);
}
var Me;
Me = !1;
function Ne(t) {
return typeof t == "object" && t !== null && t.$$typeof === r;
}
function Xe() {
{
if (Ae.current) {
var t = W(Ae.current.type);
if (t)
return `
Check the render method of \`` + t + "`.";
}
return "";
}
}
function qr(t) {
return "";
}
var Qe = {};
function kr(t) {
{
var o = Xe();
if (!o) {
var v = typeof t == "string" ? t : t.displayName || t.name;
v && (o = `
Check the top-level render call using <` + v + ">.");
}
return o;
}
}
function Ze(t, o) {
{
if (!t._store || t._store.validated || t.key != null)
return;
t._store.validated = !0;
var v = kr(o);
if (Qe[v])
return;
Qe[v] = !0;
var S = "";
t && t._owner && t._owner !== Ae.current && (S = " It was passed a child from " + W(t._owner.type) + "."), te(t), T('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', v, S), te(null);
}
}
function er(t, o) {
{
if (typeof t != "object")
return;
if ($e(t))
for (var v = 0; v < t.length; v++) {
var S = t[v];
Ne(S) && Ze(S, o);
}
else if (Ne(t))
t._store && (t._store.validated = !0);
else if (t) {
var O = d(t);
if (typeof O == "function" && O !== t.entries)
for (var P = O.call(t), w; !(w = P.next()).done; )
Ne(w.value) && Ze(w.value, o);
}
}
}
function Dr(t) {
{
var o = t.type;
if (o == null || typeof o == "string")
return;
var v;
if (typeof o == "function")
v = o.propTypes;
else if (typeof o == "object" && (o.$$typeof === s || // Note: Memo only checks outer props here.
// Inner props are checked in the reconciler.
o.$$typeof === h))
v = o.propTypes;
else
return;
if (v) {
var S = W(o);
wr(v, t.props, "prop", S, t);
} else if (o.PropTypes !== void 0 && !Me) {
Me = !0;
var O = W(o);
T("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", O || "Unknown");
}
typeof o.getDefaultProps == "function" && !o.getDefaultProps.isReactClassApproved && T("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
}
}
function Ir(t) {
{
for (var o = Object.keys(t.props), v = 0; v < o.length; v++) {
var S = o[v];
if (S !== "children" && S !== "key") {
te(t), T("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", S), te(null);
break;
}
}
t.ref !== null && (te(t), T("Invalid attribute `ref` supplied to `React.Fragment`."), te(null));
}
}
var rr = {};
function tr(t, o, v, S, O, P) {
{
var w = pe(t);
if (!w) {
var _ = "";
(t === void 0 || typeof t == "object" && t !== null && Object.keys(t).length === 0) && (_ += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
var k = qr();
k ? _ += k : _ += Xe();
var $;
t === null ? $ = "null" : $e(t) ? $ = "array" : t !== void 0 && t.$$typeof === r ? ($ = "<" + (W(t.type) || "Unknown") + " />", _ = " Did you accidentally export a JSX literal instead of a component?") : $ = typeof t, T("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", $, _);
}
var M = Nr(t, o, v, O, P);
if (M == null)
return M;
if (w) {
var V = o.children;
if (V !== void 0)
if (S)
if ($e(V)) {
for (var ne = 0; ne < V.length; ne++)
er(V[ne], t);
Object.freeze && Object.freeze(V);
} else
T("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
else
er(V, t);
}
if (fe.call(o, "key")) {
var Q = W(t), D = Object.keys(o).filter(function(Wr) {
return Wr !== "key";
}), qe = D.length > 0 ? "{key: someKey, " + D.join(": ..., ") + ": ...}" : "{key: someKey}";
if (!rr[Q + qe]) {
var Hr = D.length > 0 ? "{" + D.join(": ..., ") + ": ...}" : "{}";
T(`A props object containing a "key" prop is being spread into JSX:
let props = %s;
<%s {...props} />
React keys must be passed directly to JSX without using spread:
let props = %s;
<%s key={someKey} {...props} />`, qe, Q, Hr, Q), rr[Q + qe] = !0;
}
}
return t === a ? Ir(M) : Dr(M), M;
}
}
function Vr(t, o, v) {
return tr(t, o, v, !0);
}
function Fr(t, o, v) {
return tr(t, o, v, !1);
}
var Br = Fr, zr = Vr;
ve.Fragment = a, ve.jsx = Br, ve.jsxs = zr;
}()), ve;
}
var ir;
function Gr() {
return ir || (ir = 1, process.env.NODE_ENV === "production" ? _e.exports = Ur() : _e.exports = Yr()), _e.exports;
}
var f = Gr(), we = (e) => `--${e}`, or = (e) => `var(--${e})`, ur = (e, r) => `--${e}: ${r};`;
function Kr(e, r) {
const n = (a) => r;
return {
b: () => `${n()}-${e}`,
be: (a) => `${n()}-${e}__${a}`,
bm: (a) => `${n()}-${e}--${a}`,
bem: (a, i) => `${n()}-${e}__${a}--${i}`,
bs: (a) => `${n()}-${e}-${a}`,
ns: (a) => `${n()}-${a}`,
cb: () => `.${n()}-${e}`,
cbe: (a) => `.${n()}-${e}__${a}`,
cbm: (a) => `.${n()}-${e}--${a}`,
cbem: (a, i) => `.${n()}-${e}__${a}--${i}`,
cbs: (a) => `.${n()}-${e}-${a}`,
cns: (a) => `.${n()}-${a}`,
cv: (a) => we(`${n()}-${e}-${a}`),
cvm: (a, i = {}) => {
const m = n();
for (const c of Object.keys(a))
i[we(`${m}-${e}-${c}`)] = a[c];
return i;
},
gcv: (a) => or(`${n()}-${e}-${a}`),
scv: (a, i) => ur(`${n()}-${e}-${a}`, i),
nv: (a) => we(`${n()}-${a}`),
nvm: (a, i = {}) => {
const m = n();
for (const c of Object.keys(a))
i[we(`${m}-${c}`)] = a[c];
return i;
},
gnv: (a) => or(`${n()}-${a}`),
snv: (a, i) => ur(`${n()}-${a}`, i)
};
}
function G(e) {
return K(() => Kr(e, "twist"), [e]);
}
var hr = {
color: void 0,
size: void 0,
className: void 0,
style: void 0,
attrs: void 0
}, Fe = /* @__PURE__ */ ie.createContext(hr);
Fe.Provider;
function me(e) {
"@babel/helpers - typeof";
return me = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(r) {
return typeof r;
} : function(r) {
return r && typeof Symbol == "function" && r.constructor === Symbol && r !== Symbol.prototype ? "symbol" : typeof r;
}, me(e);
}
var Jr = ["attrs", "size", "title", "spin", "rotate", "color"];
function Xr(e, r) {
return et(e) || Zr(e, r) || pr(e, r) || Qr();
}
function Qr() {
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function Zr(e, r) {
var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
if (n != null) {
var a, i, m, c, g = [], s = !0, y = !1;
try {
if (m = (n = n.call(e)).next, r !== 0) for (; !(s = (a = m.call(n)).done) && (g.push(a.value), g.length !== r); s = !0) ;
} catch (l) {
y = !0, i = l;
} finally {
try {
if (!s && n.return != null && (c = n.return(), Object(c) !== c)) return;
} finally {
if (y) throw i;
}
}
return g;
}
}
function et(e) {
if (Array.isArray(e)) return e;
}
function rt(e, r) {
var n = typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
if (!n) {
if (Array.isArray(e) || (n = pr(e)) || r) {
n && (e = n);
var a = 0, i = function() {
};
return { s: i, n: function() {
return a >= e.length ? { done: !0 } : { done: !1, value: e[a++] };
}, e: function(y) {
throw y;
}, f: i };
}
throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
var m, c = !0, g = !1;
return { s: function() {
n = n.call(e);
}, n: function() {
var y = n.next();
return c = y.done, y;
}, e: function(y) {
g = !0, m = y;
}, f: function() {
try {
c || n.return == null || n.return();
} finally {
if (g) throw m;
}
} };
}
function pr(e, r) {
if (e) {
if (typeof e == "string") return sr(e, r);
var n = {}.toString.call(e).slice(8, -1);
return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? sr(e, r) : void 0;
}
}
function sr(e, r) {
(r == null || r > e.length) && (r = e.length);
for (var n = 0, a = Array(r); n < r; n++) a[n] = e[n];
return a;
}
function je() {
return je = Object.assign ? Object.assign.bind() : function(e) {
for (var r = 1; r < arguments.length; r++) {
var n = arguments[r];
for (var a in n) ({}).hasOwnProperty.call(n, a) && (e[a] = n[a]);
}
return e;
}, je.apply(null, arguments);
}
function lr(e, r) {
var n = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var a = Object.getOwnPropertySymbols(e);
r && (a = a.filter(function(i) {
return Object.getOwnPropertyDescriptor(e, i).enumerable;
})), n.push.apply(n, a);
}
return n;
}
function he(e) {
for (var r = 1; r < arguments.length; r++) {
var n = arguments[r] != null ? arguments[r] : {};
r % 2 ? lr(Object(n), !0).forEach(function(a) {
tt(e, a, n[a]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : lr(Object(n)).forEach(function(a) {
Object.defineProperty(e, a, Object.getOwnPropertyDescriptor(n, a));
});
}
return e;
}
function tt(e, r, n) {
return (r = nt(r)) in e ? Object.defineProperty(e, r, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = n, e;
}
function nt(e) {
var r = at(e, "string");
return me(r) == "symbol" ? r : r + "";
}
function at(e, r) {
if (me(e) != "object" || !e) return e;
var n = e[Symbol.toPrimitive];
if (n !== void 0) {
var a = n.call(e, r);
if (me(a) != "object") return a;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (r === "string" ? String : Number)(e);
}
function it(e, r) {
if (e == null) return {};
var n, a, i = ot(e, r);
if (Object.getOwnPropertySymbols) {
var m = Object.getOwnPropertySymbols(e);
for (a = 0; a < m.length; a++) n = m[a], r.includes(n) || {}.propertyIsEnumerable.call(e, n) && (i[n] = e[n]);
}
return i;
}
function ot(e, r) {
if (e == null) return {};
var n = {};
for (var a in e) if ({}.hasOwnProperty.call(e, a)) {
if (r.includes(a)) continue;
n[a] = e[a];
}
return n;
}
function ut(e) {
var r = e.attrs, n = e.size, a = e.title, i = e.spin, m = e.rotate, c = e.color, g = it(e, Jr), s = function(l) {
var h = n || l.size || "1em", x, E = "", b = "";
return l.className && (x = l.className), e.className && (x = x ? "".concat(x, " ").concat(e.className) : e.className), i && (x ? x += " twist-icon-loading" : x = "twist-icon-loading"), m && (E = "rotate(".concat(m, "deg)"), b = "rotate(".concat(m, "deg)")), /* @__PURE__ */ ie.createElement("svg", je({
xmlns: "http://www.w3.org/2000/svg"
}, l.attrs, r, g, {
className: x,
style: he(he({
color: c || l.color,
msTransform: E,
transform: b
}, l.style), e.style),
width: h,
height: h
}), a && /* @__PURE__ */ ie.createElement("title", null, a), e.children);
};
return Fe !== void 0 ? /* @__PURE__ */ ie.createElement(Fe.Consumer, null, function(y) {
return s(y);
}) : s(hr);
}
function st(e) {
var r = {}, n = e.split(";"), a = rt(n), i;
try {
for (a.s(); !(i = a.n()).done; ) {
var m = i.value, c = m.split(":"), g = Xr(c, 2), s = g[0], y = g[1];
if (s && y) {
var l = s.trim().replace(/-./g, function(h) {
return h.charAt(1).toUpperCase();
});
r[l] = y.trim();
}
}
} catch (h) {
a.e(h);
} finally {
a.f();
}
return r;
}
function yr(e) {
return e && e.map(function(r, n) {
return /* @__PURE__ */ ie.createElement(r.tag, he(he({}, r.attrs), {}, {
key: n,
style: r.attrs.style ? st(r.attrs.style) : null
}), yr(r.children));
});
}
function N(e) {
return function(r) {
return /* @__PURE__ */ ie.createElement(ut, je({
attrs: he({}, e.attrs)
}, r), yr(e.children));
};
}
function lt(e) {
return N({ attrs: { viewBox: "0 0 1024 1024" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M485.6 249.9L198.2 498c-8.3 7.1-8.3 20.8 0 27.9l287.4 248.2c10.7 9.2 26.4.9 26.4-14V263.8c0-14.8-15.7-23.2-26.4-13.9m320 0L518.2 498a18.6 18.6 0 0 0-6.2 14c0 5.2 2.1 10.4 6.2 14l287.4 248.2c10.7 9.2 26.4.9 26.4-14V263.8c0-14.8-15.7-23.2-26.4-13.9" } }] })(e);
}
function ct(e) {
return N({ attrs: { viewBox: "0 0 1024 1024" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M825.8 498L538.4 249.9c-10.7-9.2-26.4-.9-26.4 14v496.3c0 14.9 15.7 23.2 26.4 14L825.8 526c8.3-7.2 8.3-20.8 0-28m-320 0L218.4 249.9c-10.7-9.2-26.4-.9-26.4 14v496.3c0 14.9 15.7 23.2 26.4 14L505.8 526c4.1-3.6 6.2-8.8 6.2-14s-2.1-10.4-6.2-14" } }] })(e);
}
function ft(e) {
return N({ attrs: { viewBox: "0 0 1024 1024" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M512 1024c-69.1 0-136.2-13.5-199.3-40.2C251.7 958 197 921 150 874S66 772.3 40.2 711.3C13.5 648.2 0 581.1 0 512c0-19.9 16.1-36 36-36s36 16.1 36 36c0 59.4 11.6 117 34.6 171.3c22.2 52.4 53.9 99.5 94.3 139.9s87.5 72.2 139.9 94.3C395 940.4 452.6 952 512 952s117-11.6 171.3-34.6c52.4-22.2 99.5-53.9 139.9-94.3s72.2-87.5 94.3-139.9C940.4 629 952 571.4 952 512s-11.6-117-34.6-171.3a440.5 440.5 0 0 0-94.3-139.9a437.7 437.7 0 0 0-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.2C772.3 66 827 103 874 150s83.9 101.8 109.7 162.7c26.7 63.1 40.2 130.2 40.2 199.3s-13.5 136.2-40.2 199.3C958 772.3 921 827 874 874s-101.8 83.9-162.7 109.7c-63.1 26.8-130.2 40.3-199.3 40.3" } }] })(e);
}
function dt(e) {
return N({ attrs: { viewBox: "0 0 512 512" }, children: [{ tag: "path", attrs: { d: "M294.1 256L167 129c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.3 34 0L345 239c9.1 9.1 9.3 23.7.7 33.1L201.1 417c-4.7 4.7-10.9 7-17 7s-12.3-2.3-17-7c-9.4-9.4-9.4-24.6 0-33.9l127-127.1z", fill: "currentColor" } }] })(e);
}
function vt(e) {
return N({ attrs: { viewBox: "0 0 512 512" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M208 432h-48a16 16 0 0 1-16-16V96a16 16 0 0 1 16-16h48a16 16 0 0 1 16 16v320a16 16 0 0 1-16 16m144 0h-48a16 16 0 0 1-16-16V96a16 16 0 0 1 16-16h48a16 16 0 0 1 16 16v320a16 16 0 0 1-16 16" } }] })(e);
}
function mt(e) {
return N({ attrs: { viewBox: "0 0 24 24" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z" } }] })(e);
}
function ht(e) {
return N({ attrs: { viewBox: "0 0 24 24" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M2 5.27L3.28 4L20 20.72L18.73 22l-3-3H7v3l-4-4l4-4v3h6.73L7 10.27V11H5V8.27zM17 13h2v4.18l-2-2zm0-8V2l4 4l-4 4V7H8.82l-2-2z" } }] })(e);
}
function pt(e) {
return N({ attrs: { viewBox: "0 0 24 24" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "m17 3l5.25 4.5L17 12l5.25 4.5L17 21v-3h-2.74l-2.82-2.82l2.12-2.12L15.5 15H17V9h-1.5l-9 9H2v-3h3.26l9-9H17zM2 6h4.5l2.82 2.82l-2.12 2.12L5.26 9H2z" } }] })(e);
}
function yt(e) {
return N({ attrs: { viewBox: "0 0 24 24" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M16.15 13H5q-.425 0-.712-.288T4 12t.288-.712T5 11h11.15L13.3 8.15q-.3-.3-.288-.7t.288-.7q.3-.3.713-.312t.712.287L19.3 11.3q.15.15.213.325t.062.375t-.062.375t-.213.325l-4.575 4.575q-.3.3-.712.288t-.713-.313q-.275-.3-.288-.7t.288-.7z" } }] })(e);
}
function bt(e) {
return N({ attrs: { viewBox: "0 0 24 24" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M10.5 17q1.05 0 1.775-.725T13 14.5V9h3V7h-4v5.5q-.325-.225-.7-.363T10.5 12q-1.05 0-1.775.725T8 14.5t.725 1.775T10.5 17M4 20q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4h16q.825 0 1.413.588T22 6v12q0 .825-.587 1.413T20 20z" } }] })(e);
}
function gt(e) {
return N({ attrs: { viewBox: "0 0 24 24" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M14 19V5h4v14zm-8 0V5h4v14z" } }] })(e);
}
function Et(e) {
return N({ attrs: { viewBox: "0 0 24 24" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712" } }] })(e);
}
function xt(e) {
return N({ attrs: { viewBox: "0 0 24 24" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M11.5 10.5h-.75q-.325 0-.537-.213T10 9.75t.213-.537T10.75 9H12q.425 0 .713.288T13 10v4.25q0 .325-.213.538T12.25 15t-.537-.213t-.213-.537zM6.85 19l.85.85q.3.3.288.7t-.288.7q-.3.3-.712.313t-.713-.288L3.7 18.7q-.15-.15-.213-.325T3.426 18t.063-.375t.212-.325l2.575-2.575q.3-.3.713-.287t.712.312q.275.3.288.7t-.288.7l-.85.85H17v-3q0-.425.288-.712T18 13t.713.288T19 14v3q0 .825-.587 1.413T17 19zm10.3-12H7v3q0 .425-.288.713T6 11t-.712-.288T5 10V7q0-.825.588-1.412T7 5h10.15l-.85-.85q-.3-.3-.288-.7t.288-.7q.3-.3.712-.312t.713.287L20.3 5.3q.15.15.213.325t.062.375t-.062.375t-.213.325l-2.575 2.575q-.3.3-.712.288T16.3 9.25q-.275-.3-.288-.7t.288-.7z" } }] })(e);
}
function St(e) {
return N({ attrs: { viewBox: "0 0 24 24" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "m6.85 19l.85.85q.3.3.288.7t-.288.7q-.3.3-.712.313t-.713-.288L3.7 18.7q-.15-.15-.213-.325T3.426 18t.063-.375t.212-.325l2.575-2.575q.3-.3.713-.287t.712.312q.275.3.288.7t-.288.7l-.85.85H17v-3q0-.425.288-.712T18 13t.713.288T19 14v3q0 .825-.587 1.413T17 19zm10.3-12H7v3q0 .425-.288.713T6 11t-.712-.288T5 10V7q0-.825.588-1.412T7 5h10.15l-.85-.85q-.3-.3-.288-.7t.288-.7q.3-.3.712-.312t.713.287L20.3 5.3q.15.15.213.325t.062.375t-.062.375t-.213.325l-2.575 2.575q-.3.3-.712.288T16.3 9.25q-.275-.3-.288-.7t.288-.7z" } }] })(e);
}
function _t(e) {
return N({ attrs: { viewBox: "0 0 24 24" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M9 15H6q-.425 0-.712-.288T5 14v-4q0-.425.288-.712T6 9h3l3.3-3.3q.475-.475 1.088-.213t.612.938v11.15q0 .675-.612.938T12.3 18.3zm9.5-3q0 1.05-.475 1.988t-1.25 1.537q-.25.15-.512.013T16 15.1V8.85q0-.3.263-.437t.512.012q.775.625 1.25 1.575t.475 2" } }] })(e);
}
function wt(e) {
return N({ attrs: { viewBox: "0 0 24 24" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M7 15V9h4l5-5v16l-5-5z" } }] })(e);
}
function Tt(e) {
return N({ attrs: { viewBox: "0 0 24 24" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M19 11.975q0-2.075-1.1-3.787t-2.95-2.563q-.375-.175-.55-.537t-.05-.738q.15-.4.538-.575t.787 0Q18.1 4.85 19.55 7.063T21 11.974t-1.45 4.913t-3.875 3.287q-.4.175-.788 0t-.537-.575q-.125-.375.05-.737t.55-.538q1.85-.85 2.95-2.562t1.1-3.788M7 15H4q-.425 0-.712-.288T3 14v-4q0-.425.288-.712T4 9h3l3.3-3.3q.475-.475 1.088-.213t.612.938v11.15q0 .675-.612.938T10.3 18.3zm9.5-3q0 1.05-.475 1.988t-1.25 1.537q-.25.15-.513.013T14 15.1V8.85q0-.3.263-.437t.512.012q.775.625 1.25 1.575t.475 2" } }] })(e);
}
function jt(e) {
return N({ attrs: { viewBox: "0 0 24 24" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M18.25 12L8.5 17.629V6.37z" } }] })(e);
}
function ke(e, r) {
if (!r.current) return 0;
let n = (e.clientX - r.current.getBoundingClientRect().left) / r.current.clientWidth;
return n = Math.max(n, 0), n = Math.min(n, 1), n = Math.floor(n * 100) / 100, n;
}
function De(e, r) {
if (!r.current) return 0;
let n = 1 - (e.clientY - r.current.getBoundingClientRect().top) / r.current.clientHeight;
return n = Math.max(n, 0), n = Math.min(n, 1), n = Math.floor(n * 100) / 100, n;
}
function br(e) {
var r, n, a = "";
if (typeof e == "string" || typeof e == "number") a += e;
else if (typeof e == "object") if (Array.isArray(e)) {
var i = e.length;
for (r = 0; r < i; r++) e[r] && (n = br(e[r])) && (a && (a += " "), a += n);
} else for (n in e) e[n] && (a && (a += " "), a += n);
return a;
}
function C() {
for (var e, r, n = 0, a = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (r = br(e)) && (a && (a += " "), a += r);
return a;
}
function Ot({
bufferedPercentage: e,
playedPercentage: r,
onSeek: n
}) {
const a = G("aplayer-bar"), i = G("aplayer-icon"), m = F(null), [c, g] = Y(r), s = F(!1);
B(() => {
s.current || g(r);
}, [r]);
const y = R(
(l) => {
s.current = !0;
const h = ke(l, m);
g(h);
const x = (b) => {
const u = ke(b, m);
g(u);
}, E = (b) => {
document.removeEventListener("mousemove", x), document.removeEventListener("mouseup", E);
const u = ke(b, m);
g(u), n == null || n(u), s.current = !1;
};
document.addEventListener("mousemove", x), document.addEventListener("mouseup", E);
},
[n]
);
return /* @__PURE__ */ f.jsx(
"div",
{
ref: m,
className: C(a.b(), a.bs("vars")),
onMouseDown: y,
role: "slider",
"aria-label": "Audio progress",
"aria-valuenow": c ? c * 100 : 0,
"aria-valuemin": 0,
"aria-valuemax": 100,
"aria-live": "polite",
children: /* @__PURE__ */ f.jsxs("div", { className: a.be("inner"), children: [
typeof e < "u" ? /* @__PURE__ */ f.jsx(
"div",
{
className: a.be("loaded"),
style: { width: `${e * 100}%` }
}
) : null,
typeof c < "u" ? /* @__PURE__ */ f.jsx(
"div",
{
className: a.be("played"),
style: {
width: `${c * 100}%`
},
children: /* @__PURE__ */ f.jsx(
"span",
{
className: a.be("thumb"),
children: /* @__PURE__ */ f.jsx("span", { className: C(i.bs("loading")), children: /* @__PURE__ */ f.jsx(ft, {}) })
}
)
}
) : null
] })
}
);
}
function Rt({
volume: e,
muted: r,
onToggleMuted: n,
onChangeVolume: a
}) {
const i = G("aplayer-volumn"), m = G("aplayer-icon"), c = F(null), [g, s] = Y(!1), y = R(
(l) => {
a(De(l, c)), s(!0);
const h = (E) => {
a(De(E, c));
}, x = (E) => {
document.removeEventListener("mouseup", x), document.removeEventListener("mousemove", h), s(!1), a(De(E, c));
};
document.addEventListener("mousemove", h), document.addEventListener("mouseup", x);
},
[a]
);
return /* @__PURE__ */ f.jsxs("div", { className: C(i.b(), i.bs("vars")), children: [
/* @__PURE__ */ f.jsx(
"button",
{
type: "button",
className: C(m.b(), m.bs("volume-down")),
onClick: () => n(),
"aria-label": r || !e ? "Muted" : "unMuted",
children: r || !e ? /* @__PURE__ */ f.jsx(wt, {}) : e >= 1 ? /* @__PURE__ */ f.jsx(Tt, {}) : /* @__PURE__ */ f.jsx(_t, {})
}
),
/* @__PURE__ */ f.jsx(
"div",
{
className: C(i.be("bar-wrap"), {
[i.bem("bar-wrap", "active")]: g
}),
ref: c,
onMouseDown: y,
children: /* @__PURE__ */ f.jsx("div", { className: i.be("bar"), children: /* @__PURE__ */ f.jsx(
"div",
{
className: i.be("thumb"),
style: {
height: r ? 0 : `${e * 100}%`
}
}
) })
}
)
] });
}
function cr(e) {
if (typeof e > "u")
return "--:--";
if (Number.isNaN(e))
return "00:00";
const r = (c) => c < 10 ? `0${c}` : `${c}`, n = Math.trunc(e / 60), a = Math.trunc(e - n * 60), i = Math.trunc(n / 60), m = Math.trunc(
e / 60 - 60 * Math.trunc(e / 60 / 60)
);
return e >= 3600 ? `${r(i)}:${r(m)}:${r(a)}` : `${r(n)}:${r(a)}`;
}
function Pt({
volume: e,
onChangeVolume: r,
muted: n,
currentTime: a,
audioDurationSeconds: i,
bufferedSeconds: m,
onToggleMenu: c,
onToggleMuted: g,
order: s,
onOrderChange: y,
loop: l,
onLoopChange: h,
onSeek: x,
isPlaying: E,
onTogglePlay: b,
onSkipForward: u,
onSkipBack: d,
showLyrics: p = !0,
onToggleLyrics: T
}) {
const j = G("aplayer-controller"), L = G("aplayer-icon"), z = R(() => {
const q = {
list: "random",
random: "list"
}[s];
y(q);
}, [s, y]), H = R(() => {
const q = {
all: "one",
one: "none",
none: "all"
}[l];
h(q);
}, [l, h]);
return /* @__PURE__ */ f.jsxs(
"div",
{
className: C(j.b(), j.bs("vars")),
role: "group",
"aria-label": "Audio Controls",
children: [
/* @__PURE__ */ f.jsx(
Ot,
{
playedPercentage: typeof a > "u" || typeof i > "u" ? void 0 : a / i,
bufferedPercentage: typeof m > "u" || typeof i > "u" ? void 0 : m / i,
onSeek: (q) => x == null ? void 0 : x(q * i)
}
),
/* @__PURE__ */ f.jsxs("div", { className: j.be("time"), children: [
/* @__PURE__ */ f.jsxs("span", { className: j.be("time-inner"), "aria-live": "polite", children: [
/* @__PURE__ */ f.jsx("span", { className: j.be("ptime"), children: cr(a) }),
" / ",
/* @__PURE__ */ f.jsx("span", { className: j.be("dtime"), children: cr(i) })
] }),
/* @__PURE__ */ f.jsx(
"button",
{
className: C(L.b(), L.bs("back")),
onClick: d,
type: "button",
"aria-label": "Previous track",
children: /* @__PURE__ */ f.jsx(lt, {})
}
),
/* @__PURE__ */ f.jsx(
"button",
{
className: C(L.b(), L.bs("play")),
onClick: b,
type: "button",
"aria-label": E ? "Pause audio" : "Play audio",
children: E ? /* @__PURE__ */ f.jsx(gt, {}) : /* @__PURE__ */ f.jsx(Et, {})
}
),
/* @__PURE__ */ f.jsx(
"button",
{
className: C(L.b(), L.bs("forward")),
onClick: u,
type: "button",
"aria-label": "Next track",
children: /* @__PURE__ */ f.jsx(ct, {})
}
),
/* @__PURE__ */ f.jsx(
Rt,
{
volume: e,
muted: n,
onToggleMuted: g,
onChangeVolume: r
}
),
/* @__PURE__ */ f.jsx(
"button",
{
className: C(L.b(), L.bs("order")),
onClick: z,
type: "button",
"aria-label": `Playback order: ${s}`,
children: { list: /* @__PURE__ */ f.jsx(yt, {}), random: /* @__PURE__ */ f.jsx(pt, {}) }[s]
}
),
/* @__PURE__ */ f.jsx(
"button",
{
className: C(L.b(), L.bs("order")),
onClick: H,
type: "button",
"aria-label": `Loop mode: ${l}`,
children: {
all: /* @__PURE__ */ f.jsx(St, {}),
one: /* @__PURE__ */ f.jsx(xt, {}),
none: /* @__PURE__ */ f.jsx(ht, {})
}[l]
}
),
/* @__PURE__ */ f.jsx(
"button",
{
type: "button",
className: C(L.b(), L.bs("menu")),
onClick: () => c == null ? void 0 : c(),
"aria-label": "Toggle playlist menu",
children: /* @__PURE__ */ f.jsx(mt, {})
}
),
/* @__PURE__ */ f.jsx(
"button",
{
type: "button",
className: C(L.b(), L.bs("lrc"), {
[L.ns("lrc-inactivity")]: !p
}),
onClick: T,
"aria-label": p ? "Hide lyrics" : "Show lyrics",
"aria-pressed": p,
children: /* @__PURE__ */ f.jsx(bt, {})
}
)
] })
]
}
);
}
function Lt({
open: e,
audio: r,
playingAudioUrl: n,
onPlayAudio: a,
listMaxHeight: i,
mini: m
}) {
const c = G("aplayer-list"), g = i ? { maxHeight: i } : void 0, s = R((l) => l ? typeof l == "string" ? l : l.name ?? "Audio artist" : "Audio artist", []), y = F(null);
return B(() => {
if (y.current) {
const l = y.current;
return l.style.maxHeight = `${Math.min(
l.scrollHeight,
i ?? 1 / 0
)}px`, () => {
l.removeAttribute("style");
};
}
}, [i, m]), /* @__PURE__ */ f.jsx(
"div",
{
ref: y,
className: C(c.b(), {
[c.bm("hide")]: !e,
[c.bs("vars")]: !0
}),
"aria-label": "Audio playlist",
"aria-live": "polite",
children: /* @__PURE__ */ f.jsx("ol", { style: g, children: r.map((l, h) => /* @__PURE__ */ f.jsxs(
"li",
{
className: C({
[c.bm("active")]: l.url === n
}),
onClick: () => {
l.url !== n && (a == null || a(l));
},
role: "button",
"aria-label": `${l.name ?? "Audio name"} by ${s(l.artist)}}`,
children: [
/* @__PURE__ */ f.jsx("span", { className: c.be("cur") }),
/* @__PURE__ */ f.jsx("span", { className: c.be("index"), children: h + 1 }),
/* @__PURE__ */ f.jsx("span", { className: c.be("title"), children: l.name ?? "Audio name" }),
/* @__PURE__ */ f.jsx("span", { className: c.be("author"), children: s(l.artist) })
]
},
l.name || h
)) })
}
);
}
function fr({ show: e, lrcText: r, currentTime: n }) {
const a = G("aplayer-lrc"), i = K(() => Ct(r), [r]), m = K(() => {
for (let g = 0; g < i.length; g++) {
const s = i[g], y = i[g + 1];
if (n >= s[0] && (!y || n < y[0]))
return g;
}
return 0;
}, [n, i]), c = K(() => ({
transform: `translateY(${-m * 16}px)`,
WebkitTransform: `translateY(${-m * 16}px)`
}), [m]);
return /* @__PURE__ */ f.jsx(
"div",
{
className: C(a.b(), {
[a.bm("hide")]: !e
}),
children: r ? /* @__PURE__ */ f.jsx("div", { className: a.be("contents"), style: c, children: i.map(([, g], s) => /* @__PURE__ */ f.jsx(
"p",
{
className: C({
[a.be("current")]: s === m
}),
children: g
},
s
)) }) : null
}
);
}
function Ct(e) {
if (e) {
e = e.replace(/([^\]^\n])\[/g, (i, m) => `${m}
[`);
const r = e.split(`
`), n = [], a = r.length;
for (let i = 0; i < a; i++) {
const m = r[i].match(/\[(\d{2}):(\d{2})(\.(\d{2,3}))?\]/g), c = r[i].replace(/.*\[(\d{2}):(\d{2})(\.(\d{2,3}))?\]/g, "").replace(/<(\d{2}):(\d{2})(\.(\d{2,3}))?>/g, "").replace(/^\s+|\s+$/g, "");
if (m) {
const g = m.length;
for (let s = 0; s < g; s++) {
const y = /\[(\d{2}):(\d{2})(\.(\d{2,3}))?\]/.exec(m[s]), l = y[1] * 60, h = Number.parseInt(y[2]), x = y[4] ? Number.parseInt(y[4]) / (`${y[4]}`.length === 2 ? 100 : 1e3) : 0, E = l + h + x;
n.push([E, c]);
}
}
}
return n.sort((i, m) => i[0] - m[0]), n;
} else
return [];
}
var Te = { exports: {} }, Ie = {};
/**
* @license React
* use-sync-external-store-shim.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var dr;
function $t() {
if (dr) return Ie;
dr = 1;
var e = Oe;
function r(h, x) {
return h === x && (h !== 0 || 1 / h === 1 / x) || h !== h && x !== x;
}
var n = typeof Object.is == "function" ? Object.is : r, a = e.useState, i = e.useEffect, m = e.useLayoutEffect, c = e.useDebugValue;
function g(h, x) {
var E = x(), b = a({ inst: { value: E, getSnapshot: x } }), u = b[0].inst, d = b[1];
return m(
function() {
u.value = E, u.getSnapshot = x, s(u) && d({ inst: u });
},
[h, E, x]
), i(
function() {
return s(u) && d({ inst: u }), h(function() {
s(u) && d({ inst: u });
});
},
[h]
), c(E), E;
}
function s(h) {
var x = h.getSnapshot;
h = h.value;
try {
var E = x();
return !n(h, E);
} catch {
return !0;
}
}
function y(h, x) {
return x();
}
var l = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? y : g;
return Ie.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : l, Ie;
}
var Ve = {};
/**
* @license React
* use-sync-external-store-shim.development.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var vr;
function At() {
return vr || (vr = 1, process.env.NODE_ENV !== "production" && function() {
function e(E, b) {
return E === b && (E !== 0 || 1 / E === 1 / b) || E !== E && b !== b;
}
function r(E, b) {
l || i.startTransition === void 0 || (l = !0, console.error(
"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-relea