react-simple-clock
Version:
A react component to display clock
1,367 lines (1,363 loc) • 48.1 kB
JavaScript
(function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode(".rac-clock-body{display:block;position:relative;border:1px solid;border-radius:50%}.rac-mid-point{border-radius:50%}.rac-hour-body{position:absolute;inset:5px;text-align:center}.rac-hand-wrapper{display:flex;align-items:flex-end;justify-content:center}.rac-clock-hand{transform-origin:bottom;position:absolute}.bg-light{background-color:#121214}.bg-dark{background-color:#dcddde}.col-light{color:#121214}.col-dark{color:#dcddde}")),document.head.appendChild(o)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
import cr, { useRef as $r, useEffect as fr, useState as xe } from "react";
function Dr(o) {
return o && o.__esModule && Object.prototype.hasOwnProperty.call(o, "default") ? o.default : o;
}
var Me = { exports: {} }, be = {};
/**
* @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 Ze;
function Mr() {
if (Ze)
return be;
Ze = 1;
var o = cr, I = Symbol.for("react.element"), R = Symbol.for("react.fragment"), u = Object.prototype.hasOwnProperty, p = o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, c = { key: !0, ref: !0, __self: !0, __source: !0 };
function w(f, y, O) {
var l, m = {}, A = null, M = null;
O !== void 0 && (A = "" + O), y.key !== void 0 && (A = "" + y.key), y.ref !== void 0 && (M = y.ref);
for (l in y)
u.call(y, l) && !c.hasOwnProperty(l) && (m[l] = y[l]);
if (f && f.defaultProps)
for (l in y = f.defaultProps, y)
m[l] === void 0 && (m[l] = y[l]);
return { $$typeof: I, type: f, key: A, ref: M, props: m, _owner: p.current };
}
return be.Fragment = R, be.jsx = w, be.jsxs = w, be;
}
var ge = {};
/**
* @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 Qe;
function Fr() {
return Qe || (Qe = 1, process.env.NODE_ENV !== "production" && function() {
var o = cr, I = Symbol.for("react.element"), R = Symbol.for("react.portal"), u = Symbol.for("react.fragment"), p = Symbol.for("react.strict_mode"), c = Symbol.for("react.profiler"), w = Symbol.for("react.provider"), f = Symbol.for("react.context"), y = Symbol.for("react.forward_ref"), O = Symbol.for("react.suspense"), l = Symbol.for("react.suspense_list"), m = Symbol.for("react.memo"), A = Symbol.for("react.lazy"), M = Symbol.for("react.offscreen"), z = Symbol.iterator, F = "@@iterator";
function W(e) {
if (e === null || typeof e != "object")
return null;
var r = z && e[z] || e[F];
return typeof r == "function" ? r : null;
}
var Y = o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
function L(e) {
{
for (var r = arguments.length, n = new Array(r > 1 ? r - 1 : 0), d = 1; d < r; d++)
n[d - 1] = arguments[d];
V("error", e, n);
}
}
function V(e, r, n) {
{
var d = Y.ReactDebugCurrentFrame, j = d.getStackAddendum();
j !== "" && (r += "%s", n = n.concat([j]));
var D = n.map(function(C) {
return String(C);
});
D.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, D);
}
}
var q = !1, i = !1, te = !1, pe = !1, ye = !1, se;
se = Symbol.for("react.module.reference");
function he(e) {
return !!(typeof e == "string" || typeof e == "function" || e === u || e === c || ye || e === p || e === O || e === l || pe || e === M || q || i || te || typeof e == "object" && e !== null && (e.$$typeof === A || e.$$typeof === m || e.$$typeof === w || e.$$typeof === f || e.$$typeof === y || // 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.
e.$$typeof === se || e.getModuleId !== void 0));
}
function ue(e, r, n) {
var d = e.displayName;
if (d)
return d;
var j = r.displayName || r.name || "";
return j !== "" ? n + "(" + j + ")" : n;
}
function ce(e) {
return e.displayName || "Context";
}
function K(e) {
if (e == null)
return null;
if (typeof e.tag == "number" && L("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
return e.displayName || e.name || null;
if (typeof e == "string")
return e;
switch (e) {
case u:
return "Fragment";
case R:
return "Portal";
case c:
return "Profiler";
case p:
return "StrictMode";
case O:
return "Suspense";
case l:
return "SuspenseList";
}
if (typeof e == "object")
switch (e.$$typeof) {
case f:
var r = e;
return ce(r) + ".Consumer";
case w:
var n = e;
return ce(n._context) + ".Provider";
case y:
return ue(e, e.render, "ForwardRef");
case m:
var d = e.displayName || null;
return d !== null ? d : K(e.type) || "Memo";
case A: {
var j = e, D = j._payload, C = j._init;
try {
return K(C(D));
} catch {
return null;
}
}
}
return null;
}
var X = Object.assign, ne = 0, Z, re, oe, fe, t, s, E;
function g() {
}
g.__reactDisabledLog = !0;
function v() {
{
if (ne === 0) {
Z = console.log, re = console.info, oe = console.warn, fe = console.error, t = console.group, s = console.groupCollapsed, E = console.groupEnd;
var e = {
configurable: !0,
enumerable: !0,
value: g,
writable: !0
};
Object.defineProperties(console, {
info: e,
log: e,
warn: e,
error: e,
group: e,
groupCollapsed: e,
groupEnd: e
});
}
ne++;
}
}
function P() {
{
if (ne--, ne === 0) {
var e = {
configurable: !0,
enumerable: !0,
writable: !0
};
Object.defineProperties(console, {
log: X({}, e, {
value: Z
}),
info: X({}, e, {
value: re
}),
warn: X({}, e, {
value: oe
}),
error: X({}, e, {
value: fe
}),
group: X({}, e, {
value: t
}),
groupCollapsed: X({}, e, {
value: s
}),
groupEnd: X({}, e, {
value: E
})
});
}
ne < 0 && L("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
}
}
var h = Y.ReactCurrentDispatcher, b;
function T(e, r, n) {
{
if (b === void 0)
try {
throw Error();
} catch (j) {
var d = j.stack.trim().match(/\n( *(at )?)/);
b = d && d[1] || "";
}
return `
` + b + e;
}
}
var x = !1, _;
{
var H = typeof WeakMap == "function" ? WeakMap : Map;
_ = new H();
}
function a(e, r) {
if (!e || x)
return "";
{
var n = _.get(e);
if (n !== void 0)
return n;
}
var d;
x = !0;
var j = Error.prepareStackTrace;
Error.prepareStackTrace = void 0;
var D;
D = h.current, h.current = null, v();
try {
if (r) {
var C = function() {
throw Error();
};
if (Object.defineProperty(C.prototype, "props", {
set: function() {
throw Error();
}
}), typeof Reflect == "object" && Reflect.construct) {
try {
Reflect.construct(C, []);
} catch (ae) {
d = ae;
}
Reflect.construct(e, [], C);
} else {
try {
C.call();
} catch (ae) {
d = ae;
}
e.call(C.prototype);
}
} else {
try {
throw Error();
} catch (ae) {
d = ae;
}
e();
}
} catch (ae) {
if (ae && d && typeof ae.stack == "string") {
for (var S = ae.stack.split(`
`), J = d.stack.split(`
`), N = S.length - 1, U = J.length - 1; N >= 1 && U >= 0 && S[N] !== J[U]; )
U--;
for (; N >= 1 && U >= 0; N--, U--)
if (S[N] !== J[U]) {
if (N !== 1 || U !== 1)
do
if (N--, U--, U < 0 || S[N] !== J[U]) {
var ee = `
` + S[N].replace(" at new ", " at ");
return e.displayName && ee.includes("<anonymous>") && (ee = ee.replace("<anonymous>", e.displayName)), typeof e == "function" && _.set(e, ee), ee;
}
while (N >= 1 && U >= 0);
break;
}
}
} finally {
x = !1, h.current = D, P(), Error.prepareStackTrace = j;
}
var ve = e ? e.displayName || e.name : "", Ke = ve ? T(ve) : "";
return typeof e == "function" && _.set(e, Ke), Ke;
}
function Q(e, r, n) {
return a(e, !1);
}
function le(e) {
var r = e.prototype;
return !!(r && r.isReactComponent);
}
function ie(e, r, n) {
if (e == null)
return "";
if (typeof e == "function")
return a(e, le(e));
if (typeof e == "string")
return T(e);
switch (e) {
case O:
return T("Suspense");
case l:
return T("SuspenseList");
}
if (typeof e == "object")
switch (e.$$typeof) {
case y:
return Q(e.render);
case m:
return ie(e.type, r, n);
case A: {
var d = e, j = d._payload, D = d._init;
try {
return ie(D(j), r, n);
} catch {
}
}
}
return "";
}
var Ee = Object.prototype.hasOwnProperty, We = {}, Le = Y.ReactDebugCurrentFrame;
function Te(e) {
if (e) {
var r = e._owner, n = ie(e.type, e._source, r ? r.type : null);
Le.setExtraStackFrame(n);
} else
Le.setExtraStackFrame(null);
}
function pr(e, r, n, d, j) {
{
var D = Function.call.bind(Ee);
for (var C in e)
if (D(e, C)) {
var S = void 0;
try {
if (typeof e[C] != "function") {
var J = Error((d || "React class") + ": " + n + " type `" + C + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[C] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
throw J.name = "Invariant Violation", J;
}
S = e[C](r, C, d, n, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
} catch (N) {
S = N;
}
S && !(S instanceof Error) && (Te(j), L("%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).", d || "React class", n, C, typeof S), Te(null)), S instanceof Error && !(S.message in We) && (We[S.message] = !0, Te(j), L("Failed %s type: %s", n, S.message), Te(null));
}
}
}
var yr = Array.isArray;
function Se(e) {
return yr(e);
}
function hr(e) {
{
var r = typeof Symbol == "function" && Symbol.toStringTag, n = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
return n;
}
}
function mr(e) {
try {
return qe(e), !1;
} catch {
return !0;
}
}
function qe(e) {
return "" + e;
}
function Ve(e) {
if (mr(e))
return L("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", hr(e)), qe(e);
}
var me = Y.ReactCurrentOwner, br = {
key: !0,
ref: !0,
__self: !0,
__source: !0
}, Ne, Ue, Oe;
Oe = {};
function gr(e) {
if (Ee.call(e, "ref")) {
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
if (r && r.isReactWarning)
return !1;
}
return e.ref !== void 0;
}
function Er(e) {
if (Ee.call(e, "key")) {
var r = Object.getOwnPropertyDescriptor(e, "key").get;
if (r && r.isReactWarning)
return !1;
}
return e.key !== void 0;
}
function Tr(e, r) {
if (typeof e.ref == "string" && me.current && r && me.current.stateNode !== r) {
var n = K(me.current.type);
Oe[n] || (L('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', K(me.current.type), e.ref), Oe[n] = !0);
}
}
function _r(e, r) {
{
var n = function() {
Ne || (Ne = !0, L("%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)", r));
};
n.isReactWarning = !0, Object.defineProperty(e, "key", {
get: n,
configurable: !0
});
}
}
function Rr(e, r) {
{
var n = function() {
Ue || (Ue = !0, L("%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)", r));
};
n.isReactWarning = !0, Object.defineProperty(e, "ref", {
get: n,
configurable: !0
});
}
}
var Sr = function(e, r, n, d, j, D, C) {
var S = {
// This tag allows us to uniquely identify this as a React Element
$$typeof: I,
// Built-in properties that belong on the element
type: e,
key: r,
ref: n,
props: C,
// Record the component responsible for creating this element.
_owner: D
};
return S._store = {}, Object.defineProperty(S._store, "validated", {
configurable: !1,
enumerable: !1,
writable: !0,
value: !1
}), Object.defineProperty(S, "_self", {
configurable: !1,
enumerable: !1,
writable: !1,
value: d
}), Object.defineProperty(S, "_source", {
configurable: !1,
enumerable: !1,
writable: !1,
value: j
}), Object.freeze && (Object.freeze(S.props), Object.freeze(S)), S;
};
function Or(e, r, n, d, j) {
{
var D, C = {}, S = null, J = null;
n !== void 0 && (Ve(n), S = "" + n), Er(r) && (Ve(r.key), S = "" + r.key), gr(r) && (J = r.ref, Tr(r, j));
for (D in r)
Ee.call(r, D) && !br.hasOwnProperty(D) && (C[D] = r[D]);
if (e && e.defaultProps) {
var N = e.defaultProps;
for (D in N)
C[D] === void 0 && (C[D] = N[D]);
}
if (S || J) {
var U = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
S && _r(C, U), J && Rr(C, U);
}
return Sr(e, S, J, j, d, me.current, C);
}
}
var Pe = Y.ReactCurrentOwner, ze = Y.ReactDebugCurrentFrame;
function de(e) {
if (e) {
var r = e._owner, n = ie(e.type, e._source, r ? r.type : null);
ze.setExtraStackFrame(n);
} else
ze.setExtraStackFrame(null);
}
var Ce;
Ce = !1;
function we(e) {
return typeof e == "object" && e !== null && e.$$typeof === I;
}
function Be() {
{
if (Pe.current) {
var e = K(Pe.current.type);
if (e)
return `
Check the render method of \`` + e + "`.";
}
return "";
}
}
function Pr(e) {
{
if (e !== void 0) {
var r = e.fileName.replace(/^.*[\\\/]/, ""), n = e.lineNumber;
return `
Check your code at ` + r + ":" + n + ".";
}
return "";
}
}
var He = {};
function Cr(e) {
{
var r = Be();
if (!r) {
var n = typeof e == "string" ? e : e.displayName || e.name;
n && (r = `
Check the top-level render call using <` + n + ">.");
}
return r;
}
}
function Je(e, r) {
{
if (!e._store || e._store.validated || e.key != null)
return;
e._store.validated = !0;
var n = Cr(r);
if (He[n])
return;
He[n] = !0;
var d = "";
e && e._owner && e._owner !== Pe.current && (d = " It was passed a child from " + K(e._owner.type) + "."), de(e), L('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', n, d), de(null);
}
}
function Xe(e, r) {
{
if (typeof e != "object")
return;
if (Se(e))
for (var n = 0; n < e.length; n++) {
var d = e[n];
we(d) && Je(d, r);
}
else if (we(e))
e._store && (e._store.validated = !0);
else if (e) {
var j = W(e);
if (typeof j == "function" && j !== e.entries)
for (var D = j.call(e), C; !(C = D.next()).done; )
we(C.value) && Je(C.value, r);
}
}
}
function wr(e) {
{
var r = e.type;
if (r == null || typeof r == "string")
return;
var n;
if (typeof r == "function")
n = r.propTypes;
else if (typeof r == "object" && (r.$$typeof === y || // Note: Memo only checks outer props here.
// Inner props are checked in the reconciler.
r.$$typeof === m))
n = r.propTypes;
else
return;
if (n) {
var d = K(r);
pr(n, e.props, "prop", d, e);
} else if (r.PropTypes !== void 0 && !Ce) {
Ce = !0;
var j = K(r);
L("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", j || "Unknown");
}
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && L("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
}
}
function xr(e) {
{
for (var r = Object.keys(e.props), n = 0; n < r.length; n++) {
var d = r[n];
if (d !== "children" && d !== "key") {
de(e), L("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", d), de(null);
break;
}
}
e.ref !== null && (de(e), L("Invalid attribute `ref` supplied to `React.Fragment`."), de(null));
}
}
function Ge(e, r, n, d, j, D) {
{
var C = he(e);
if (!C) {
var S = "";
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (S += " 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 J = Pr(j);
J ? S += J : S += Be();
var N;
e === null ? N = "null" : Se(e) ? N = "array" : e !== void 0 && e.$$typeof === I ? (N = "<" + (K(e.type) || "Unknown") + " />", S = " Did you accidentally export a JSX literal instead of a component?") : N = typeof e, L("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", N, S);
}
var U = Or(e, r, n, j, D);
if (U == null)
return U;
if (C) {
var ee = r.children;
if (ee !== void 0)
if (d)
if (Se(ee)) {
for (var ve = 0; ve < ee.length; ve++)
Xe(ee[ve], e);
Object.freeze && Object.freeze(ee);
} else
L("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
Xe(ee, e);
}
return e === u ? xr(U) : wr(U), U;
}
}
function jr(e, r, n) {
return Ge(e, r, n, !0);
}
function Ir(e, r, n) {
return Ge(e, r, n, !1);
}
var Ar = Ir, kr = jr;
ge.Fragment = u, ge.jsx = Ar, ge.jsxs = kr;
}()), ge;
}
process.env.NODE_ENV === "production" ? Me.exports = Mr() : Me.exports = Fr();
var G = Me.exports, Fe = { exports: {} }, _e = { exports: {} }, k = {};
/** @license React v16.13.1
* react-is.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 er;
function Yr() {
if (er)
return k;
er = 1;
var o = typeof Symbol == "function" && Symbol.for, I = o ? Symbol.for("react.element") : 60103, R = o ? Symbol.for("react.portal") : 60106, u = o ? Symbol.for("react.fragment") : 60107, p = o ? Symbol.for("react.strict_mode") : 60108, c = o ? Symbol.for("react.profiler") : 60114, w = o ? Symbol.for("react.provider") : 60109, f = o ? Symbol.for("react.context") : 60110, y = o ? Symbol.for("react.async_mode") : 60111, O = o ? Symbol.for("react.concurrent_mode") : 60111, l = o ? Symbol.for("react.forward_ref") : 60112, m = o ? Symbol.for("react.suspense") : 60113, A = o ? Symbol.for("react.suspense_list") : 60120, M = o ? Symbol.for("react.memo") : 60115, z = o ? Symbol.for("react.lazy") : 60116, F = o ? Symbol.for("react.block") : 60121, W = o ? Symbol.for("react.fundamental") : 60117, Y = o ? Symbol.for("react.responder") : 60118, L = o ? Symbol.for("react.scope") : 60119;
function V(i) {
if (typeof i == "object" && i !== null) {
var te = i.$$typeof;
switch (te) {
case I:
switch (i = i.type, i) {
case y:
case O:
case u:
case c:
case p:
case m:
return i;
default:
switch (i = i && i.$$typeof, i) {
case f:
case l:
case z:
case M:
case w:
return i;
default:
return te;
}
}
case R:
return te;
}
}
}
function q(i) {
return V(i) === O;
}
return k.AsyncMode = y, k.ConcurrentMode = O, k.ContextConsumer = f, k.ContextProvider = w, k.Element = I, k.ForwardRef = l, k.Fragment = u, k.Lazy = z, k.Memo = M, k.Portal = R, k.Profiler = c, k.StrictMode = p, k.Suspense = m, k.isAsyncMode = function(i) {
return q(i) || V(i) === y;
}, k.isConcurrentMode = q, k.isContextConsumer = function(i) {
return V(i) === f;
}, k.isContextProvider = function(i) {
return V(i) === w;
}, k.isElement = function(i) {
return typeof i == "object" && i !== null && i.$$typeof === I;
}, k.isForwardRef = function(i) {
return V(i) === l;
}, k.isFragment = function(i) {
return V(i) === u;
}, k.isLazy = function(i) {
return V(i) === z;
}, k.isMemo = function(i) {
return V(i) === M;
}, k.isPortal = function(i) {
return V(i) === R;
}, k.isProfiler = function(i) {
return V(i) === c;
}, k.isStrictMode = function(i) {
return V(i) === p;
}, k.isSuspense = function(i) {
return V(i) === m;
}, k.isValidElementType = function(i) {
return typeof i == "string" || typeof i == "function" || i === u || i === O || i === c || i === p || i === m || i === A || typeof i == "object" && i !== null && (i.$$typeof === z || i.$$typeof === M || i.$$typeof === w || i.$$typeof === f || i.$$typeof === l || i.$$typeof === W || i.$$typeof === Y || i.$$typeof === L || i.$$typeof === F);
}, k.typeOf = V, k;
}
var $ = {};
/** @license React v16.13.1
* react-is.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 rr;
function Wr() {
return rr || (rr = 1, process.env.NODE_ENV !== "production" && function() {
var o = typeof Symbol == "function" && Symbol.for, I = o ? Symbol.for("react.element") : 60103, R = o ? Symbol.for("react.portal") : 60106, u = o ? Symbol.for("react.fragment") : 60107, p = o ? Symbol.for("react.strict_mode") : 60108, c = o ? Symbol.for("react.profiler") : 60114, w = o ? Symbol.for("react.provider") : 60109, f = o ? Symbol.for("react.context") : 60110, y = o ? Symbol.for("react.async_mode") : 60111, O = o ? Symbol.for("react.concurrent_mode") : 60111, l = o ? Symbol.for("react.forward_ref") : 60112, m = o ? Symbol.for("react.suspense") : 60113, A = o ? Symbol.for("react.suspense_list") : 60120, M = o ? Symbol.for("react.memo") : 60115, z = o ? Symbol.for("react.lazy") : 60116, F = o ? Symbol.for("react.block") : 60121, W = o ? Symbol.for("react.fundamental") : 60117, Y = o ? Symbol.for("react.responder") : 60118, L = o ? Symbol.for("react.scope") : 60119;
function V(a) {
return typeof a == "string" || typeof a == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
a === u || a === O || a === c || a === p || a === m || a === A || typeof a == "object" && a !== null && (a.$$typeof === z || a.$$typeof === M || a.$$typeof === w || a.$$typeof === f || a.$$typeof === l || a.$$typeof === W || a.$$typeof === Y || a.$$typeof === L || a.$$typeof === F);
}
function q(a) {
if (typeof a == "object" && a !== null) {
var Q = a.$$typeof;
switch (Q) {
case I:
var le = a.type;
switch (le) {
case y:
case O:
case u:
case c:
case p:
case m:
return le;
default:
var ie = le && le.$$typeof;
switch (ie) {
case f:
case l:
case z:
case M:
case w:
return ie;
default:
return Q;
}
}
case R:
return Q;
}
}
}
var i = y, te = O, pe = f, ye = w, se = I, he = l, ue = u, ce = z, K = M, X = R, ne = c, Z = p, re = m, oe = !1;
function fe(a) {
return oe || (oe = !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.")), t(a) || q(a) === y;
}
function t(a) {
return q(a) === O;
}
function s(a) {
return q(a) === f;
}
function E(a) {
return q(a) === w;
}
function g(a) {
return typeof a == "object" && a !== null && a.$$typeof === I;
}
function v(a) {
return q(a) === l;
}
function P(a) {
return q(a) === u;
}
function h(a) {
return q(a) === z;
}
function b(a) {
return q(a) === M;
}
function T(a) {
return q(a) === R;
}
function x(a) {
return q(a) === c;
}
function _(a) {
return q(a) === p;
}
function H(a) {
return q(a) === m;
}
$.AsyncMode = i, $.ConcurrentMode = te, $.ContextConsumer = pe, $.ContextProvider = ye, $.Element = se, $.ForwardRef = he, $.Fragment = ue, $.Lazy = ce, $.Memo = K, $.Portal = X, $.Profiler = ne, $.StrictMode = Z, $.Suspense = re, $.isAsyncMode = fe, $.isConcurrentMode = t, $.isContextConsumer = s, $.isContextProvider = E, $.isElement = g, $.isForwardRef = v, $.isFragment = P, $.isLazy = h, $.isMemo = b, $.isPortal = T, $.isProfiler = x, $.isStrictMode = _, $.isSuspense = H, $.isValidElementType = V, $.typeOf = q;
}()), $;
}
var tr;
function lr() {
return tr || (tr = 1, process.env.NODE_ENV === "production" ? _e.exports = Yr() : _e.exports = Wr()), _e.exports;
}
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
var je, nr;
function Lr() {
if (nr)
return je;
nr = 1;
var o = Object.getOwnPropertySymbols, I = Object.prototype.hasOwnProperty, R = Object.prototype.propertyIsEnumerable;
function u(c) {
if (c == null)
throw new TypeError("Object.assign cannot be called with null or undefined");
return Object(c);
}
function p() {
try {
if (!Object.assign)
return !1;
var c = new String("abc");
if (c[5] = "de", Object.getOwnPropertyNames(c)[0] === "5")
return !1;
for (var w = {}, f = 0; f < 10; f++)
w["_" + String.fromCharCode(f)] = f;
var y = Object.getOwnPropertyNames(w).map(function(l) {
return w[l];
});
if (y.join("") !== "0123456789")
return !1;
var O = {};
return "abcdefghijklmnopqrst".split("").forEach(function(l) {
O[l] = l;
}), Object.keys(Object.assign({}, O)).join("") === "abcdefghijklmnopqrst";
} catch {
return !1;
}
}
return je = p() ? Object.assign : function(c, w) {
for (var f, y = u(c), O, l = 1; l < arguments.length; l++) {
f = Object(arguments[l]);
for (var m in f)
I.call(f, m) && (y[m] = f[m]);
if (o) {
O = o(f);
for (var A = 0; A < O.length; A++)
R.call(f, O[A]) && (y[O[A]] = f[O[A]]);
}
}
return y;
}, je;
}
var Ie, ar;
function Ye() {
if (ar)
return Ie;
ar = 1;
var o = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
return Ie = o, Ie;
}
var Ae, or;
function dr() {
return or || (or = 1, Ae = Function.call.bind(Object.prototype.hasOwnProperty)), Ae;
}
var ke, ir;
function qr() {
if (ir)
return ke;
ir = 1;
var o = function() {
};
if (process.env.NODE_ENV !== "production") {
var I = Ye(), R = {}, u = dr();
o = function(c) {
var w = "Warning: " + c;
typeof console < "u" && console.error(w);
try {
throw new Error(w);
} catch {
}
};
}
function p(c, w, f, y, O) {
if (process.env.NODE_ENV !== "production") {
for (var l in c)
if (u(c, l)) {
var m;
try {
if (typeof c[l] != "function") {
var A = Error(
(y || "React class") + ": " + f + " type `" + l + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof c[l] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
);
throw A.name = "Invariant Violation", A;
}
m = c[l](w, l, y, f, null, I);
} catch (z) {
m = z;
}
if (m && !(m instanceof Error) && o(
(y || "React class") + ": type specification of " + f + " `" + l + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof m + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
), m instanceof Error && !(m.message in R)) {
R[m.message] = !0;
var M = O ? O() : "";
o(
"Failed " + f + " type: " + m.message + (M ?? "")
);
}
}
}
}
return p.resetWarningCache = function() {
process.env.NODE_ENV !== "production" && (R = {});
}, ke = p, ke;
}
var $e, sr;
function Vr() {
if (sr)
return $e;
sr = 1;
var o = lr(), I = Lr(), R = Ye(), u = dr(), p = qr(), c = function() {
};
process.env.NODE_ENV !== "production" && (c = function(f) {
var y = "Warning: " + f;
typeof console < "u" && console.error(y);
try {
throw new Error(y);
} catch {
}
});
function w() {
return null;
}
return $e = function(f, y) {
var O = typeof Symbol == "function" && Symbol.iterator, l = "@@iterator";
function m(t) {
var s = t && (O && t[O] || t[l]);
if (typeof s == "function")
return s;
}
var A = "<<anonymous>>", M = {
array: Y("array"),
bigint: Y("bigint"),
bool: Y("boolean"),
func: Y("function"),
number: Y("number"),
object: Y("object"),
string: Y("string"),
symbol: Y("symbol"),
any: L(),
arrayOf: V,
element: q(),
elementType: i(),
instanceOf: te,
node: he(),
objectOf: ye,
oneOf: pe,
oneOfType: se,
shape: ce,
exact: K
};
function z(t, s) {
return t === s ? t !== 0 || 1 / t === 1 / s : t !== t && s !== s;
}
function F(t, s) {
this.message = t, this.data = s && typeof s == "object" ? s : {}, this.stack = "";
}
F.prototype = Error.prototype;
function W(t) {
if (process.env.NODE_ENV !== "production")
var s = {}, E = 0;
function g(P, h, b, T, x, _, H) {
if (T = T || A, _ = _ || b, H !== R) {
if (y) {
var a = new Error(
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
);
throw a.name = "Invariant Violation", a;
} else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
var Q = T + ":" + b;
!s[Q] && // Avoid spamming the console because they are often not actionable except for lib authors
E < 3 && (c(
"You are manually calling a React.PropTypes validation function for the `" + _ + "` prop on `" + T + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
), s[Q] = !0, E++);
}
}
return h[b] == null ? P ? h[b] === null ? new F("The " + x + " `" + _ + "` is marked as required " + ("in `" + T + "`, but its value is `null`.")) : new F("The " + x + " `" + _ + "` is marked as required in " + ("`" + T + "`, but its value is `undefined`.")) : null : t(h, b, T, x, _);
}
var v = g.bind(null, !1);
return v.isRequired = g.bind(null, !0), v;
}
function Y(t) {
function s(E, g, v, P, h, b) {
var T = E[g], x = Z(T);
if (x !== t) {
var _ = re(T);
return new F(
"Invalid " + P + " `" + h + "` of type " + ("`" + _ + "` supplied to `" + v + "`, expected ") + ("`" + t + "`."),
{ expectedType: t }
);
}
return null;
}
return W(s);
}
function L() {
return W(w);
}
function V(t) {
function s(E, g, v, P, h) {
if (typeof t != "function")
return new F("Property `" + h + "` of component `" + v + "` has invalid PropType notation inside arrayOf.");
var b = E[g];
if (!Array.isArray(b)) {
var T = Z(b);
return new F("Invalid " + P + " `" + h + "` of type " + ("`" + T + "` supplied to `" + v + "`, expected an array."));
}
for (var x = 0; x < b.length; x++) {
var _ = t(b, x, v, P, h + "[" + x + "]", R);
if (_ instanceof Error)
return _;
}
return null;
}
return W(s);
}
function q() {
function t(s, E, g, v, P) {
var h = s[E];
if (!f(h)) {
var b = Z(h);
return new F("Invalid " + v + " `" + P + "` of type " + ("`" + b + "` supplied to `" + g + "`, expected a single ReactElement."));
}
return null;
}
return W(t);
}
function i() {
function t(s, E, g, v, P) {
var h = s[E];
if (!o.isValidElementType(h)) {
var b = Z(h);
return new F("Invalid " + v + " `" + P + "` of type " + ("`" + b + "` supplied to `" + g + "`, expected a single ReactElement type."));
}
return null;
}
return W(t);
}
function te(t) {
function s(E, g, v, P, h) {
if (!(E[g] instanceof t)) {
var b = t.name || A, T = fe(E[g]);
return new F("Invalid " + P + " `" + h + "` of type " + ("`" + T + "` supplied to `" + v + "`, expected ") + ("instance of `" + b + "`."));
}
return null;
}
return W(s);
}
function pe(t) {
if (!Array.isArray(t))
return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? c(
"Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
) : c("Invalid argument supplied to oneOf, expected an array.")), w;
function s(E, g, v, P, h) {
for (var b = E[g], T = 0; T < t.length; T++)
if (z(b, t[T]))
return null;
var x = JSON.stringify(t, function(H, a) {
var Q = re(a);
return Q === "symbol" ? String(a) : a;
});
return new F("Invalid " + P + " `" + h + "` of value `" + String(b) + "` " + ("supplied to `" + v + "`, expected one of " + x + "."));
}
return W(s);
}
function ye(t) {
function s(E, g, v, P, h) {
if (typeof t != "function")
return new F("Property `" + h + "` of component `" + v + "` has invalid PropType notation inside objectOf.");
var b = E[g], T = Z(b);
if (T !== "object")
return new F("Invalid " + P + " `" + h + "` of type " + ("`" + T + "` supplied to `" + v + "`, expected an object."));
for (var x in b)
if (u(b, x)) {
var _ = t(b, x, v, P, h + "." + x, R);
if (_ instanceof Error)
return _;
}
return null;
}
return W(s);
}
function se(t) {
if (!Array.isArray(t))
return process.env.NODE_ENV !== "production" && c("Invalid argument supplied to oneOfType, expected an instance of array."), w;
for (var s = 0; s < t.length; s++) {
var E = t[s];
if (typeof E != "function")
return c(
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + oe(E) + " at index " + s + "."
), w;
}
function g(v, P, h, b, T) {
for (var x = [], _ = 0; _ < t.length; _++) {
var H = t[_], a = H(v, P, h, b, T, R);
if (a == null)
return null;
a.data && u(a.data, "expectedType") && x.push(a.data.expectedType);
}
var Q = x.length > 0 ? ", expected one of type [" + x.join(", ") + "]" : "";
return new F("Invalid " + b + " `" + T + "` supplied to " + ("`" + h + "`" + Q + "."));
}
return W(g);
}
function he() {
function t(s, E, g, v, P) {
return X(s[E]) ? null : new F("Invalid " + v + " `" + P + "` supplied to " + ("`" + g + "`, expected a ReactNode."));
}
return W(t);
}
function ue(t, s, E, g, v) {
return new F(
(t || "React class") + ": " + s + " type `" + E + "." + g + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + v + "`."
);
}
function ce(t) {
function s(E, g, v, P, h) {
var b = E[g], T = Z(b);
if (T !== "object")
return new F("Invalid " + P + " `" + h + "` of type `" + T + "` " + ("supplied to `" + v + "`, expected `object`."));
for (var x in t) {
var _ = t[x];
if (typeof _ != "function")
return ue(v, P, h, x, re(_));
var H = _(b, x, v, P, h + "." + x, R);
if (H)
return H;
}
return null;
}
return W(s);
}
function K(t) {
function s(E, g, v, P, h) {
var b = E[g], T = Z(b);
if (T !== "object")
return new F("Invalid " + P + " `" + h + "` of type `" + T + "` " + ("supplied to `" + v + "`, expected `object`."));
var x = I({}, E[g], t);
for (var _ in x) {
var H = t[_];
if (u(t, _) && typeof H != "function")
return ue(v, P, h, _, re(H));
if (!H)
return new F(
"Invalid " + P + " `" + h + "` key `" + _ + "` supplied to `" + v + "`.\nBad object: " + JSON.stringify(E[g], null, " ") + `
Valid keys: ` + JSON.stringify(Object.keys(t), null, " ")
);
var a = H(b, _, v, P, h + "." + _, R);
if (a)
return a;
}
return null;
}
return W(s);
}
function X(t) {
switch (typeof t) {
case "number":
case "string":
case "undefined":
return !0;
case "boolean":
return !t;
case "object":
if (Array.isArray(t))
return t.every(X);
if (t === null || f(t))
return !0;
var s = m(t);
if (s) {
var E = s.call(t), g;
if (s !== t.entries) {
for (; !(g = E.next()).done; )
if (!X(g.value))
return !1;
} else
for (; !(g = E.next()).done; ) {
var v = g.value;
if (v && !X(v[1]))
return !1;
}
} else
return !1;
return !0;
default:
return !1;
}
}
function ne(t, s) {
return t === "symbol" ? !0 : s ? s["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && s instanceof Symbol : !1;
}
function Z(t) {
var s = typeof t;
return Array.isArray(t) ? "array" : t instanceof RegExp ? "object" : ne(s, t) ? "symbol" : s;
}
function re(t) {
if (typeof t > "u" || t === null)
return "" + t;
var s = Z(t);
if (s === "object") {
if (t instanceof Date)
return "date";
if (t instanceof RegExp)
return "regexp";
}
return s;
}
function oe(t) {
var s = re(t);
switch (s) {
case "array":
case "object":
return "an " + s;
case "boolean":
case "date":
case "regexp":
return "a " + s;
default:
return s;
}
}
function fe(t) {
return !t.constructor || !t.constructor.name ? A : t.constructor.name;
}
return M.checkPropTypes = p, M.resetWarningCache = p.resetWarningCache, M.PropTypes = M, M;
}, $e;
}
var De, ur;
function Nr() {
if (ur)
return De;
ur = 1;
var o = Ye();
function I() {
}
function R() {
}
return R.resetWarningCache = I, De = function() {
function u(w, f, y, O, l, m) {
if (m !== o) {
var A = new Error(
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
);
throw A.name = "Invariant Violation", A;
}
}
u.isRequired = u;
function p() {
return u;
}
var c = {
array: u,
bigint: u,
bool: u,
func: u,
number: u,
object: u,
string: u,
symbol: u,
any: u,
arrayOf: p,
element: u,
elementType: u,
instanceOf: p,
node: u,
objectOf: p,
oneOf: p,
oneOfType: p,
shape: p,
exact: p,
checkPropTypes: R,
resetWarningCache: I
};
return c.PropTypes = c, c;
}, De;
}
if (process.env.NODE_ENV !== "production") {
var Ur = lr(), zr = !0;
Fe.exports = Vr()(Ur.isElement, zr);
} else
Fe.exports = Nr()();
var Br = Fe.exports;
const B = /* @__PURE__ */ Dr(Br);
const vr = ({ angle: o, value: I, format: R, _mode: u }) => {
let p;
return R === "number" ? p = /* @__PURE__ */ G.jsx("div", { style: { transform: `rotate(${-o}deg)` }, children: /* @__PURE__ */ G.jsx("b", { children: I }) }) : R === "roman" ? p = /* @__PURE__ */ G.jsx("div", { children: /* @__PURE__ */ G.jsx("b", { children: I }) }) : p = /* @__PURE__ */ G.jsx("div", { style: { width: 5, height: 20, backgroundColor: u === "light" ? "#121214" : "#DCDDDE", display: "inline-block" } }), /* @__PURE__ */ G.jsx("div", { style: { transform: `rotate(${o}deg)` }, className: `rac-hour-body col-${u}`, children: p });
};
vr.propTypes = {
angle: B.number,
value: B.oneOfType([
B.number,
B.string
]),
format: B.string,
_mode: B.string
};
const Re = ({ height: o, width: I = 5, angle: R, _mode: u }) => {
const p = $r();
return fr(() => {
try {
p.current.style.transform = `rotate(${R}deg)`;
} catch (c) {
console.error(c);
}
}, [R]), /* @__PURE__ */ G.jsx("div", { ref: p, style: { height: o, width: I }, className: `rac-clock-hand bg-${u}` });
};
Re.propTypes = {
height: B.number,
width: B.number,
angle: B.number,
_mode: B.string
};
const Hr = (o) => {
const { hourValue: I, minuteValue: R, size: u = 200, hourMarkFormat: p, live: c, className: w, mode: f = "light" } = o, y = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], O = ["", "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X", "XI", "XII"], [l, m] = xe(0), [A, M] = xe(0), [z, F] = xe(0);
return fr(() => {
if (c) {
const W = setInterval(() => {
const Y = /* @__PURE__ */ new Date(), L = Y.getHours(), V = Y.getMinutes(), q = Y.getSeconds();
m(L), M(V), F(q);
}, 1e3);
return () => clearInterval(W);
} else
M(R), m(I);
}, [c, R, I]), /* @__PURE__ */ G.jsxs("div", { style: { width: u, height: u }, className: `rac-clock-body ${w}`, children: [
y.map((W, Y) => /* @__PURE__ */ G.jsx(
vr,
{
value: p === "number" ? W : O[W],
angle: W * 30,
format: p,
_mode: f
},
Y
)),
/* @__PURE__ */ G.jsxs("div", { className: "rac-hand-wrapper", style: { width: u, height: u / 2 }, children: [
/* @__PURE__ */ G.jsx("div", { className: `rac-mid-point bg-${f}`, style: { height: u / 20, width: u / 20, transform: `translateY(${u / 40}px)` } }),
c && /* @__PURE__ */ G.jsx(Re, { height: 3.5 * u / 10, width: 2, angle: z * 6, _mode: f }),
/* @__PURE__ */ G.jsx(Re, { height: 3 * u / 10, width: 4, angle: A * 6 + z / 10, _mode: f }),
/* @__PURE__ */ G.jsx(Re, { height: u / 5, angle: l * 30 + A / 2, _mode: f })
] })
] });
};
Hr.propTypes = {
hourValue: B.number,
minuteValue: B.number,
size: B.number,
hourMarkFormat: B.string,
className: B.string,
live: B.bool,
mode: B.string
};
export {
Hr as default
};