my-awesome-react-digital-clock
Version:
A digital clock for React apps
1,181 lines (1,178 loc) • 43.1 kB
JavaScript
import er, { useState as rr, useRef as tr, useEffect as nr } from "react";
function or(r) {
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
}
var he = { exports: {} }, be = {};
/**
* @license React
* react-jsx-runtime.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 Ne;
function ar() {
if (Ne) return be;
Ne = 1;
var r = Symbol.for("react.transitional.element"), m = Symbol.for("react.fragment");
function d(f, E, u) {
var T = null;
if (u !== void 0 && (T = "" + u), E.key !== void 0 && (T = "" + E.key), "key" in E) {
u = {};
for (var l in E)
l !== "key" && (u[l] = E[l]);
} else u = E;
return E = u.ref, {
$$typeof: r,
type: f,
key: T,
ref: E !== void 0 ? E : null,
props: u
};
}
return be.Fragment = m, be.jsx = d, be.jsxs = d, be;
}
var ge = {};
/**
* @license React
* react-jsx-runtime.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 Ye;
function ir() {
return Ye || (Ye = 1, process.env.NODE_ENV !== "production" && function() {
function r(e) {
if (e == null) return null;
if (typeof e == "function")
return e.$$typeof === pe ? null : e.displayName || e.name || null;
if (typeof e == "string") return e;
switch (e) {
case J:
return "Fragment";
case a:
return "Portal";
case le:
return "Profiler";
case fe:
return "StrictMode";
case oe:
return "Suspense";
case ae:
return "SuspenseList";
}
if (typeof e == "object")
switch (typeof e.tag == "number" && console.error(
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
), e.$$typeof) {
case ve:
return (e.displayName || "Context") + ".Provider";
case de:
return (e._context.displayName || "Context") + ".Consumer";
case Q:
var i = e.render;
return e = e.displayName, e || (e = i.displayName || i.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
case G:
return i = e.displayName || null, i !== null ? i : r(e.type) || "Memo";
case ie:
i = e._payload, e = e._init;
try {
return r(e(i));
} catch {
}
}
return null;
}
function m(e) {
return "" + e;
}
function d(e) {
try {
m(e);
var i = !1;
} catch {
i = !0;
}
if (i) {
i = console;
var s = i.error, O = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
return s.call(
i,
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
O
), m(e);
}
}
function f() {
}
function E() {
if (c === 0) {
h = console.log, p = console.info, b = console.warn, _ = console.error, R = console.group, x = console.groupCollapsed, U = console.groupEnd;
var e = {
configurable: !0,
enumerable: !0,
value: f,
writable: !0
};
Object.defineProperties(console, {
info: e,
log: e,
warn: e,
error: e,
group: e,
groupCollapsed: e,
groupEnd: e
});
}
c++;
}
function u() {
if (c--, c === 0) {
var e = { configurable: !0, enumerable: !0, writable: !0 };
Object.defineProperties(console, {
log: o({}, e, { value: h }),
info: o({}, e, { value: p }),
warn: o({}, e, { value: b }),
error: o({}, e, { value: _ }),
group: o({}, e, { value: R }),
groupCollapsed: o({}, e, { value: x }),
groupEnd: o({}, e, { value: U })
});
}
0 > c && console.error(
"disabledDepth fell below zero. This is a bug in React. Please file an issue."
);
}
function T(e) {
if (n === void 0)
try {
throw Error();
} catch (s) {
var i = s.stack.trim().match(/\n( *(at )?)/);
n = i && i[1] || "", V = -1 < s.stack.indexOf(`
at`) ? " (<anonymous>)" : -1 < s.stack.indexOf("@") ? "@unknown:0:0" : "";
}
return `
` + n + e + V;
}
function l(e, i) {
if (!e || ee) return "";
var s = ye.get(e);
if (s !== void 0) return s;
ee = !0, s = Error.prepareStackTrace, Error.prepareStackTrace = void 0;
var O = null;
O = B.H, B.H = null, E();
try {
var z = {
DetermineComponentFrameRoot: function() {
try {
if (i) {
var re = function() {
throw Error();
};
if (Object.defineProperty(re.prototype, "props", {
set: function() {
throw Error();
}
}), typeof Reflect == "object" && Reflect.construct) {
try {
Reflect.construct(re, []);
} catch (K) {
var Te = K;
}
Reflect.construct(e, [], re);
} else {
try {
re.call();
} catch (K) {
Te = K;
}
e.call(re.prototype);
}
} else {
try {
throw Error();
} catch (K) {
Te = K;
}
(re = e()) && typeof re.catch == "function" && re.catch(function() {
});
}
} catch (K) {
if (K && Te && typeof K.stack == "string")
return [K.stack, Te.stack];
}
return [null, null];
}
};
z.DetermineComponentFrameRoot.displayName = "DetermineComponentFrameRoot";
var M = Object.getOwnPropertyDescriptor(
z.DetermineComponentFrameRoot,
"name"
);
M && M.configurable && Object.defineProperty(
z.DetermineComponentFrameRoot,
"name",
{ value: "DetermineComponentFrameRoot" }
);
var y = z.DetermineComponentFrameRoot(), Z = y[0], me = y[1];
if (Z && me) {
var F = Z.split(`
`), se = me.split(`
`);
for (y = M = 0; M < F.length && !F[M].includes(
"DetermineComponentFrameRoot"
); )
M++;
for (; y < se.length && !se[y].includes(
"DetermineComponentFrameRoot"
); )
y++;
if (M === F.length || y === se.length)
for (M = F.length - 1, y = se.length - 1; 1 <= M && 0 <= y && F[M] !== se[y]; )
y--;
for (; 1 <= M && 0 <= y; M--, y--)
if (F[M] !== se[y]) {
if (M !== 1 || y !== 1)
do
if (M--, y--, 0 > y || F[M] !== se[y]) {
var Ee = `
` + F[M].replace(
" at new ",
" at "
);
return e.displayName && Ee.includes("<anonymous>") && (Ee = Ee.replace("<anonymous>", e.displayName)), typeof e == "function" && ye.set(e, Ee), Ee;
}
while (1 <= M && 0 <= y);
break;
}
}
} finally {
ee = !1, B.H = O, u(), Error.prepareStackTrace = s;
}
return F = (F = e ? e.displayName || e.name : "") ? T(F) : "", typeof e == "function" && ye.set(e, F), F;
}
function A(e) {
if (e == null) return "";
if (typeof e == "function") {
var i = e.prototype;
return l(
e,
!(!i || !i.isReactComponent)
);
}
if (typeof e == "string") return T(e);
switch (e) {
case oe:
return T("Suspense");
case ae:
return T("SuspenseList");
}
if (typeof e == "object")
switch (e.$$typeof) {
case Q:
return e = l(e.render, !1), e;
case G:
return A(e.type);
case ie:
i = e._payload, e = e._init;
try {
return A(e(i));
} catch {
}
}
return "";
}
function P() {
var e = B.A;
return e === null ? null : e.getOwner();
}
function S(e) {
if (t.call(e, "key")) {
var i = Object.getOwnPropertyDescriptor(e, "key").get;
if (i && i.isReactWarning) return !1;
}
return e.key !== void 0;
}
function j(e, i) {
function s() {
Ae || (Ae = !0, console.error(
"%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://react.dev/link/special-props)",
i
));
}
s.isReactWarning = !0, Object.defineProperty(e, "key", {
get: s,
configurable: !0
});
}
function Y() {
var e = r(this.type);
return ke[e] || (ke[e] = !0, console.error(
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
)), e = this.props.ref, e !== void 0 ? e : null;
}
function I(e, i, s, O, z, M) {
return s = M.ref, e = {
$$typeof: N,
type: e,
key: i,
props: M,
_owner: z
}, (s !== void 0 ? s : null) !== null ? Object.defineProperty(e, "ref", {
enumerable: !1,
get: Y
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
configurable: !1,
enumerable: !1,
writable: !0,
value: 0
}), Object.defineProperty(e, "_debugInfo", {
configurable: !1,
enumerable: !1,
writable: !0,
value: null
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
}
function D(e, i, s, O, z, M) {
if (typeof e == "string" || typeof e == "function" || e === J || e === le || e === fe || e === oe || e === ae || e === H || typeof e == "object" && e !== null && (e.$$typeof === ie || e.$$typeof === G || e.$$typeof === ve || e.$$typeof === de || e.$$typeof === Q || e.$$typeof === g || e.getModuleId !== void 0)) {
var y = i.children;
if (y !== void 0)
if (O)
if (v(y)) {
for (O = 0; O < y.length; O++)
$(y[O], e);
Object.freeze && Object.freeze(y);
} else
console.error(
"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 $(y, e);
} else
y = "", (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (y += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."), e === null ? O = "null" : v(e) ? O = "array" : e !== void 0 && e.$$typeof === N ? (O = "<" + (r(e.type) || "Unknown") + " />", y = " Did you accidentally export a JSX literal instead of a component?") : O = typeof e, console.error(
"React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",
O,
y
);
if (t.call(i, "key")) {
y = r(e);
var Z = Object.keys(i).filter(function(F) {
return F !== "key";
});
O = 0 < Z.length ? "{key: someKey, " + Z.join(": ..., ") + ": ...}" : "{key: someKey}", $e[y + O] || (Z = 0 < Z.length ? "{" + Z.join(": ..., ") + ": ...}" : "{}", console.error(
`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} />`,
O,
y,
Z,
y
), $e[y + O] = !0);
}
if (y = null, s !== void 0 && (d(s), y = "" + s), S(i) && (d(i.key), y = "" + i.key), "key" in i) {
s = {};
for (var me in i)
me !== "key" && (s[me] = i[me]);
} else s = i;
return y && j(
s,
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
), I(e, y, M, z, P(), s);
}
function $(e, i) {
if (typeof e == "object" && e && e.$$typeof !== Qe) {
if (v(e))
for (var s = 0; s < e.length; s++) {
var O = e[s];
q(O) && L(O, i);
}
else if (q(e))
e._store && (e._store.validated = 1);
else if (e === null || typeof e != "object" ? s = null : (s = X && e[X] || e["@@iterator"], s = typeof s == "function" ? s : null), typeof s == "function" && s !== e.entries && (s = s.call(e), s !== e))
for (; !(e = s.next()).done; )
q(e.value) && L(e.value, i);
}
}
function q(e) {
return typeof e == "object" && e !== null && e.$$typeof === N;
}
function L(e, i) {
if (e._store && !e._store.validated && e.key == null && (e._store.validated = 1, i = ne(i), !Me[i])) {
Me[i] = !0;
var s = "";
e && e._owner != null && e._owner !== P() && (s = null, typeof e._owner.tag == "number" ? s = r(e._owner.type) : typeof e._owner.name == "string" && (s = e._owner.name), s = " It was passed a child from " + s + ".");
var O = B.getCurrentStack;
B.getCurrentStack = function() {
var z = A(e.type);
return O && (z += O() || ""), z;
}, console.error(
'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',
i,
s
), B.getCurrentStack = O;
}
}
function ne(e) {
var i = "", s = P();
return s && (s = r(s.type)) && (i = `
Check the render method of \`` + s + "`."), i || (e = r(e)) && (i = `
Check the top-level render call using <` + e + ">."), i;
}
var W = er, N = Symbol.for("react.transitional.element"), a = Symbol.for("react.portal"), J = Symbol.for("react.fragment"), fe = Symbol.for("react.strict_mode"), le = Symbol.for("react.profiler"), de = Symbol.for("react.consumer"), ve = Symbol.for("react.context"), Q = Symbol.for("react.forward_ref"), oe = Symbol.for("react.suspense"), ae = Symbol.for("react.suspense_list"), G = Symbol.for("react.memo"), ie = Symbol.for("react.lazy"), H = Symbol.for("react.offscreen"), X = Symbol.iterator, pe = Symbol.for("react.client.reference"), B = W.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, t = Object.prototype.hasOwnProperty, o = Object.assign, g = Symbol.for("react.client.reference"), v = Array.isArray, c = 0, h, p, b, _, R, x, U;
f.__reactDisabledLog = !0;
var n, V, ee = !1, ye = new (typeof WeakMap == "function" ? WeakMap : Map)(), Qe = Symbol.for("react.client.reference"), Ae, ke = {}, $e = {}, Me = {};
ge.Fragment = J, ge.jsx = function(e, i, s, O, z) {
return D(e, i, s, !1, O, z);
}, ge.jsxs = function(e, i, s, O, z) {
return D(e, i, s, !0, O, z);
};
}()), ge;
}
var Ie;
function sr() {
return Ie || (Ie = 1, process.env.NODE_ENV === "production" ? he.exports = ar() : he.exports = ir()), he.exports;
}
var k = sr(), _e = { exports: {} }, xe = { exports: {} }, w = {};
/** @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 qe;
function ur() {
if (qe) return w;
qe = 1;
var r = typeof Symbol == "function" && Symbol.for, m = r ? Symbol.for("react.element") : 60103, d = r ? Symbol.for("react.portal") : 60106, f = r ? Symbol.for("react.fragment") : 60107, E = r ? Symbol.for("react.strict_mode") : 60108, u = r ? Symbol.for("react.profiler") : 60114, T = r ? Symbol.for("react.provider") : 60109, l = r ? Symbol.for("react.context") : 60110, A = r ? Symbol.for("react.async_mode") : 60111, P = r ? Symbol.for("react.concurrent_mode") : 60111, S = r ? Symbol.for("react.forward_ref") : 60112, j = r ? Symbol.for("react.suspense") : 60113, Y = r ? Symbol.for("react.suspense_list") : 60120, I = r ? Symbol.for("react.memo") : 60115, D = r ? Symbol.for("react.lazy") : 60116, $ = r ? Symbol.for("react.block") : 60121, q = r ? Symbol.for("react.fundamental") : 60117, L = r ? Symbol.for("react.responder") : 60118, ne = r ? Symbol.for("react.scope") : 60119;
function W(a) {
if (typeof a == "object" && a !== null) {
var J = a.$$typeof;
switch (J) {
case m:
switch (a = a.type, a) {
case A:
case P:
case f:
case u:
case E:
case j:
return a;
default:
switch (a = a && a.$$typeof, a) {
case l:
case S:
case D:
case I:
case T:
return a;
default:
return J;
}
}
case d:
return J;
}
}
}
function N(a) {
return W(a) === P;
}
return w.AsyncMode = A, w.ConcurrentMode = P, w.ContextConsumer = l, w.ContextProvider = T, w.Element = m, w.ForwardRef = S, w.Fragment = f, w.Lazy = D, w.Memo = I, w.Portal = d, w.Profiler = u, w.StrictMode = E, w.Suspense = j, w.isAsyncMode = function(a) {
return N(a) || W(a) === A;
}, w.isConcurrentMode = N, w.isContextConsumer = function(a) {
return W(a) === l;
}, w.isContextProvider = function(a) {
return W(a) === T;
}, w.isElement = function(a) {
return typeof a == "object" && a !== null && a.$$typeof === m;
}, w.isForwardRef = function(a) {
return W(a) === S;
}, w.isFragment = function(a) {
return W(a) === f;
}, w.isLazy = function(a) {
return W(a) === D;
}, w.isMemo = function(a) {
return W(a) === I;
}, w.isPortal = function(a) {
return W(a) === d;
}, w.isProfiler = function(a) {
return W(a) === u;
}, w.isStrictMode = function(a) {
return W(a) === E;
}, w.isSuspense = function(a) {
return W(a) === j;
}, w.isValidElementType = function(a) {
return typeof a == "string" || typeof a == "function" || a === f || a === P || a === u || a === E || a === j || a === Y || typeof a == "object" && a !== null && (a.$$typeof === D || a.$$typeof === I || a.$$typeof === T || a.$$typeof === l || a.$$typeof === S || a.$$typeof === q || a.$$typeof === L || a.$$typeof === ne || a.$$typeof === $);
}, w.typeOf = W, w;
}
var C = {};
/** @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 We;
function cr() {
return We || (We = 1, process.env.NODE_ENV !== "production" && function() {
var r = typeof Symbol == "function" && Symbol.for, m = r ? Symbol.for("react.element") : 60103, d = r ? Symbol.for("react.portal") : 60106, f = r ? Symbol.for("react.fragment") : 60107, E = r ? Symbol.for("react.strict_mode") : 60108, u = r ? Symbol.for("react.profiler") : 60114, T = r ? Symbol.for("react.provider") : 60109, l = r ? Symbol.for("react.context") : 60110, A = r ? Symbol.for("react.async_mode") : 60111, P = r ? Symbol.for("react.concurrent_mode") : 60111, S = r ? Symbol.for("react.forward_ref") : 60112, j = r ? Symbol.for("react.suspense") : 60113, Y = r ? Symbol.for("react.suspense_list") : 60120, I = r ? Symbol.for("react.memo") : 60115, D = r ? Symbol.for("react.lazy") : 60116, $ = r ? Symbol.for("react.block") : 60121, q = r ? Symbol.for("react.fundamental") : 60117, L = r ? Symbol.for("react.responder") : 60118, ne = r ? Symbol.for("react.scope") : 60119;
function W(n) {
return typeof n == "string" || typeof n == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
n === f || n === P || n === u || n === E || n === j || n === Y || typeof n == "object" && n !== null && (n.$$typeof === D || n.$$typeof === I || n.$$typeof === T || n.$$typeof === l || n.$$typeof === S || n.$$typeof === q || n.$$typeof === L || n.$$typeof === ne || n.$$typeof === $);
}
function N(n) {
if (typeof n == "object" && n !== null) {
var V = n.$$typeof;
switch (V) {
case m:
var ee = n.type;
switch (ee) {
case A:
case P:
case f:
case u:
case E:
case j:
return ee;
default:
var ye = ee && ee.$$typeof;
switch (ye) {
case l:
case S:
case D:
case I:
case T:
return ye;
default:
return V;
}
}
case d:
return V;
}
}
}
var a = A, J = P, fe = l, le = T, de = m, ve = S, Q = f, oe = D, ae = I, G = d, ie = u, H = E, X = j, pe = !1;
function B(n) {
return pe || (pe = !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(n) || N(n) === A;
}
function t(n) {
return N(n) === P;
}
function o(n) {
return N(n) === l;
}
function g(n) {
return N(n) === T;
}
function v(n) {
return typeof n == "object" && n !== null && n.$$typeof === m;
}
function c(n) {
return N(n) === S;
}
function h(n) {
return N(n) === f;
}
function p(n) {
return N(n) === D;
}
function b(n) {
return N(n) === I;
}
function _(n) {
return N(n) === d;
}
function R(n) {
return N(n) === u;
}
function x(n) {
return N(n) === E;
}
function U(n) {
return N(n) === j;
}
C.AsyncMode = a, C.ConcurrentMode = J, C.ContextConsumer = fe, C.ContextProvider = le, C.Element = de, C.ForwardRef = ve, C.Fragment = Q, C.Lazy = oe, C.Memo = ae, C.Portal = G, C.Profiler = ie, C.StrictMode = H, C.Suspense = X, C.isAsyncMode = B, C.isConcurrentMode = t, C.isContextConsumer = o, C.isContextProvider = g, C.isElement = v, C.isForwardRef = c, C.isFragment = h, C.isLazy = p, C.isMemo = b, C.isPortal = _, C.isProfiler = R, C.isStrictMode = x, C.isSuspense = U, C.isValidElementType = W, C.typeOf = N;
}()), C;
}
var Ue;
function Be() {
return Ue || (Ue = 1, process.env.NODE_ENV === "production" ? xe.exports = ur() : xe.exports = cr()), xe.exports;
}
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
var Se, De;
function fr() {
if (De) return Se;
De = 1;
var r = Object.getOwnPropertySymbols, m = Object.prototype.hasOwnProperty, d = Object.prototype.propertyIsEnumerable;
function f(u) {
if (u == null)
throw new TypeError("Object.assign cannot be called with null or undefined");
return Object(u);
}
function E() {
try {
if (!Object.assign)
return !1;
var u = new String("abc");
if (u[5] = "de", Object.getOwnPropertyNames(u)[0] === "5")
return !1;
for (var T = {}, l = 0; l < 10; l++)
T["_" + String.fromCharCode(l)] = l;
var A = Object.getOwnPropertyNames(T).map(function(S) {
return T[S];
});
if (A.join("") !== "0123456789")
return !1;
var P = {};
return "abcdefghijklmnopqrst".split("").forEach(function(S) {
P[S] = S;
}), Object.keys(Object.assign({}, P)).join("") === "abcdefghijklmnopqrst";
} catch {
return !1;
}
}
return Se = E() ? Object.assign : function(u, T) {
for (var l, A = f(u), P, S = 1; S < arguments.length; S++) {
l = Object(arguments[S]);
for (var j in l)
m.call(l, j) && (A[j] = l[j]);
if (r) {
P = r(l);
for (var Y = 0; Y < P.length; Y++)
d.call(l, P[Y]) && (A[P[Y]] = l[P[Y]]);
}
}
return A;
}, Se;
}
var Re, ze;
function je() {
if (ze) return Re;
ze = 1;
var r = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
return Re = r, Re;
}
var Oe, Le;
function Ge() {
return Le || (Le = 1, Oe = Function.call.bind(Object.prototype.hasOwnProperty)), Oe;
}
var Pe, Fe;
function lr() {
if (Fe) return Pe;
Fe = 1;
var r = function() {
};
if (process.env.NODE_ENV !== "production") {
var m = /* @__PURE__ */ je(), d = {}, f = /* @__PURE__ */ Ge();
r = function(u) {
var T = "Warning: " + u;
typeof console < "u" && console.error(T);
try {
throw new Error(T);
} catch {
}
};
}
function E(u, T, l, A, P) {
if (process.env.NODE_ENV !== "production") {
for (var S in u)
if (f(u, S)) {
var j;
try {
if (typeof u[S] != "function") {
var Y = Error(
(A || "React class") + ": " + l + " type `" + S + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof u[S] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
);
throw Y.name = "Invariant Violation", Y;
}
j = u[S](T, S, A, l, null, m);
} catch (D) {
j = D;
}
if (j && !(j instanceof Error) && r(
(A || "React class") + ": type specification of " + l + " `" + S + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof j + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
), j instanceof Error && !(j.message in d)) {
d[j.message] = !0;
var I = P ? P() : "";
r(
"Failed " + l + " type: " + j.message + (I ?? "")
);
}
}
}
}
return E.resetWarningCache = function() {
process.env.NODE_ENV !== "production" && (d = {});
}, Pe = E, Pe;
}
var we, Ve;
function dr() {
if (Ve) return we;
Ve = 1;
var r = Be(), m = fr(), d = /* @__PURE__ */ je(), f = /* @__PURE__ */ Ge(), E = /* @__PURE__ */ lr(), u = function() {
};
process.env.NODE_ENV !== "production" && (u = function(l) {
var A = "Warning: " + l;
typeof console < "u" && console.error(A);
try {
throw new Error(A);
} catch {
}
});
function T() {
return null;
}
return we = function(l, A) {
var P = typeof Symbol == "function" && Symbol.iterator, S = "@@iterator";
function j(t) {
var o = t && (P && t[P] || t[S]);
if (typeof o == "function")
return o;
}
var Y = "<<anonymous>>", I = {
array: L("array"),
bigint: L("bigint"),
bool: L("boolean"),
func: L("function"),
number: L("number"),
object: L("object"),
string: L("string"),
symbol: L("symbol"),
any: ne(),
arrayOf: W,
element: N(),
elementType: a(),
instanceOf: J,
node: ve(),
objectOf: le,
oneOf: fe,
oneOfType: de,
shape: oe,
exact: ae
};
function D(t, o) {
return t === o ? t !== 0 || 1 / t === 1 / o : t !== t && o !== o;
}
function $(t, o) {
this.message = t, this.data = o && typeof o == "object" ? o : {}, this.stack = "";
}
$.prototype = Error.prototype;
function q(t) {
if (process.env.NODE_ENV !== "production")
var o = {}, g = 0;
function v(h, p, b, _, R, x, U) {
if (_ = _ || Y, x = x || b, U !== d) {
if (A) {
var n = 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 n.name = "Invariant Violation", n;
} else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
var V = _ + ":" + b;
!o[V] && // Avoid spamming the console because they are often not actionable except for lib authors
g < 3 && (u(
"You are manually calling a React.PropTypes validation function for the `" + x + "` prop on `" + _ + "`. 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."
), o[V] = !0, g++);
}
}
return p[b] == null ? h ? p[b] === null ? new $("The " + R + " `" + x + "` is marked as required " + ("in `" + _ + "`, but its value is `null`.")) : new $("The " + R + " `" + x + "` is marked as required in " + ("`" + _ + "`, but its value is `undefined`.")) : null : t(p, b, _, R, x);
}
var c = v.bind(null, !1);
return c.isRequired = v.bind(null, !0), c;
}
function L(t) {
function o(g, v, c, h, p, b) {
var _ = g[v], R = H(_);
if (R !== t) {
var x = X(_);
return new $(
"Invalid " + h + " `" + p + "` of type " + ("`" + x + "` supplied to `" + c + "`, expected ") + ("`" + t + "`."),
{ expectedType: t }
);
}
return null;
}
return q(o);
}
function ne() {
return q(T);
}
function W(t) {
function o(g, v, c, h, p) {
if (typeof t != "function")
return new $("Property `" + p + "` of component `" + c + "` has invalid PropType notation inside arrayOf.");
var b = g[v];
if (!Array.isArray(b)) {
var _ = H(b);
return new $("Invalid " + h + " `" + p + "` of type " + ("`" + _ + "` supplied to `" + c + "`, expected an array."));
}
for (var R = 0; R < b.length; R++) {
var x = t(b, R, c, h, p + "[" + R + "]", d);
if (x instanceof Error)
return x;
}
return null;
}
return q(o);
}
function N() {
function t(o, g, v, c, h) {
var p = o[g];
if (!l(p)) {
var b = H(p);
return new $("Invalid " + c + " `" + h + "` of type " + ("`" + b + "` supplied to `" + v + "`, expected a single ReactElement."));
}
return null;
}
return q(t);
}
function a() {
function t(o, g, v, c, h) {
var p = o[g];
if (!r.isValidElementType(p)) {
var b = H(p);
return new $("Invalid " + c + " `" + h + "` of type " + ("`" + b + "` supplied to `" + v + "`, expected a single ReactElement type."));
}
return null;
}
return q(t);
}
function J(t) {
function o(g, v, c, h, p) {
if (!(g[v] instanceof t)) {
var b = t.name || Y, _ = B(g[v]);
return new $("Invalid " + h + " `" + p + "` of type " + ("`" + _ + "` supplied to `" + c + "`, expected ") + ("instance of `" + b + "`."));
}
return null;
}
return q(o);
}
function fe(t) {
if (!Array.isArray(t))
return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? u(
"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])."
) : u("Invalid argument supplied to oneOf, expected an array.")), T;
function o(g, v, c, h, p) {
for (var b = g[v], _ = 0; _ < t.length; _++)
if (D(b, t[_]))
return null;
var R = JSON.stringify(t, function(U, n) {
var V = X(n);
return V === "symbol" ? String(n) : n;
});
return new $("Invalid " + h + " `" + p + "` of value `" + String(b) + "` " + ("supplied to `" + c + "`, expected one of " + R + "."));
}
return q(o);
}
function le(t) {
function o(g, v, c, h, p) {
if (typeof t != "function")
return new $("Property `" + p + "` of component `" + c + "` has invalid PropType notation inside objectOf.");
var b = g[v], _ = H(b);
if (_ !== "object")
return new $("Invalid " + h + " `" + p + "` of type " + ("`" + _ + "` supplied to `" + c + "`, expected an object."));
for (var R in b)
if (f(b, R)) {
var x = t(b, R, c, h, p + "." + R, d);
if (x instanceof Error)
return x;
}
return null;
}
return q(o);
}
function de(t) {
if (!Array.isArray(t))
return process.env.NODE_ENV !== "production" && u("Invalid argument supplied to oneOfType, expected an instance of array."), T;
for (var o = 0; o < t.length; o++) {
var g = t[o];
if (typeof g != "function")
return u(
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + pe(g) + " at index " + o + "."
), T;
}
function v(c, h, p, b, _) {
for (var R = [], x = 0; x < t.length; x++) {
var U = t[x], n = U(c, h, p, b, _, d);
if (n == null)
return null;
n.data && f(n.data, "expectedType") && R.push(n.data.expectedType);
}
var V = R.length > 0 ? ", expected one of type [" + R.join(", ") + "]" : "";
return new $("Invalid " + b + " `" + _ + "` supplied to " + ("`" + p + "`" + V + "."));
}
return q(v);
}
function ve() {
function t(o, g, v, c, h) {
return G(o[g]) ? null : new $("Invalid " + c + " `" + h + "` supplied to " + ("`" + v + "`, expected a ReactNode."));
}
return q(t);
}
function Q(t, o, g, v, c) {
return new $(
(t || "React class") + ": " + o + " type `" + g + "." + v + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + c + "`."
);
}
function oe(t) {
function o(g, v, c, h, p) {
var b = g[v], _ = H(b);
if (_ !== "object")
return new $("Invalid " + h + " `" + p + "` of type `" + _ + "` " + ("supplied to `" + c + "`, expected `object`."));
for (var R in t) {
var x = t[R];
if (typeof x != "function")
return Q(c, h, p, R, X(x));
var U = x(b, R, c, h, p + "." + R, d);
if (U)
return U;
}
return null;
}
return q(o);
}
function ae(t) {
function o(g, v, c, h, p) {
var b = g[v], _ = H(b);
if (_ !== "object")
return new $("Invalid " + h + " `" + p + "` of type `" + _ + "` " + ("supplied to `" + c + "`, expected `object`."));
var R = m({}, g[v], t);
for (var x in R) {
var U = t[x];
if (f(t, x) && typeof U != "function")
return Q(c, h, p, x, X(U));
if (!U)
return new $(
"Invalid " + h + " `" + p + "` key `" + x + "` supplied to `" + c + "`.\nBad object: " + JSON.stringify(g[v], null, " ") + `
Valid keys: ` + JSON.stringify(Object.keys(t), null, " ")
);
var n = U(b, x, c, h, p + "." + x, d);
if (n)
return n;
}
return null;
}
return q(o);
}
function G(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(G);
if (t === null || l(t))
return !0;
var o = j(t);
if (o) {
var g = o.call(t), v;
if (o !== t.entries) {
for (; !(v = g.next()).done; )
if (!G(v.value))
return !1;
} else
for (; !(v = g.next()).done; ) {
var c = v.value;
if (c && !G(c[1]))
return !1;
}
} else
return !1;
return !0;
default:
return !1;
}
}
function ie(t, o) {
return t === "symbol" ? !0 : o ? o["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && o instanceof Symbol : !1;
}
function H(t) {
var o = typeof t;
return Array.isArray(t) ? "array" : t instanceof RegExp ? "object" : ie(o, t) ? "symbol" : o;
}
function X(t) {
if (typeof t > "u" || t === null)
return "" + t;
var o = H(t);
if (o === "object") {
if (t instanceof Date)
return "date";
if (t instanceof RegExp)
return "regexp";
}
return o;
}
function pe(t) {
var o = X(t);
switch (o) {
case "array":
case "object":
return "an " + o;
case "boolean":
case "date":
case "regexp":
return "a " + o;
default:
return o;
}
}
function B(t) {
return !t.constructor || !t.constructor.name ? Y : t.constructor.name;
}
return I.checkPropTypes = E, I.resetWarningCache = E.resetWarningCache, I.PropTypes = I, I;
}, we;
}
var Ce, He;
function vr() {
if (He) return Ce;
He = 1;
var r = /* @__PURE__ */ je();
function m() {
}
function d() {
}
return d.resetWarningCache = m, Ce = function() {
function f(T, l, A, P, S, j) {
if (j !== r) {
var Y = 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 Y.name = "Invariant Violation", Y;
}
}
f.isRequired = f;
function E() {
return f;
}
var u = {
array: f,
bigint: f,
bool: f,
func: f,
number: f,
object: f,
string: f,
symbol: f,
any: f,
arrayOf: E,
element: f,
elementType: f,
instanceOf: E,
node: f,
objectOf: E,
oneOf: E,
oneOfType: E,
shape: E,
exact: E,
checkPropTypes: d,
resetWarningCache: m
};
return u.PropTypes = u, u;
}, Ce;
}
var Je;
function pr() {
if (Je) return _e.exports;
if (Je = 1, process.env.NODE_ENV !== "production") {
var r = Be(), m = !0;
_e.exports = /* @__PURE__ */ dr()(r.isElement, m);
} else
_e.exports = /* @__PURE__ */ vr()();
return _e.exports;
}
var yr = /* @__PURE__ */ pr();
const te = /* @__PURE__ */ or(yr), Xe = ({ amPm: r }) => {
const m = r === "AM";
return /* @__PURE__ */ k.jsxs("div", { className: "ampm", children: [
/* @__PURE__ */ k.jsx("span", { className: m ? "active" : "", children: "AM" }),
/* @__PURE__ */ k.jsx("span", { className: m ? "" : "active", children: "PM" })
] });
};
Xe.propTypes = {
amPm: te.string
};
const mr = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"], Ze = ({ today: r }) => /* @__PURE__ */ k.jsx("div", { className: "weekdays", children: mr.map((m, d) => /* @__PURE__ */ k.jsx("span", { className: d === r ? "active" : "", children: m }, d)) });
Ze.propTypes = {
day: te.number
};
const ue = {
// top, tl, tr, br, bl, bottom, mid
0: [!0, !0, !0, !0, !0, !0, !1],
1: [!1, !1, !0, !0, !1, !1, !1],
2: [!0, !1, !0, !1, !0, !0, !0],
3: [!0, !1, !0, !0, !1, !0, !0],
4: [!1, !0, !0, !0, !1, !1, !0],
5: [!0, !0, !1, !0, !1, !0, !0],
6: [!0, !0, !1, !0, !0, !0, !0],
7: [!0, !1, !0, !0, !1, !1, !1],
8: [!0, !0, !0, !0, !0, !0, !0],
9: [!0, !0, !0, !0, !1, !0, !0]
}, ce = ({ number: r = 0 }) => /* @__PURE__ */ k.jsxs("div", { className: "digital-number", children: [
/* @__PURE__ */ k.jsx("span", { className: `top horizontal ${ue[r][0] ? "on" : "off"}` }),
/* @__PURE__ */ k.jsx("span", { className: `top left vertical ${ue[r][1] ? "on" : "off"}` }),
/* @__PURE__ */ k.jsx("span", { className: `top right vertical ${ue[r][2] ? "on" : "off"}` }),
/* @__PURE__ */ k.jsx("span", { className: `bottom right vertical ${ue[r][3] ? "on" : "off"}` }),
/* @__PURE__ */ k.jsx("span", { className: `bottom left vertical ${ue[r][4] ? "on" : "off"}` }),
/* @__PURE__ */ k.jsx("span", { className: `bottom horizontal ${ue[r][5] ? "on" : "off"}` }),
/* @__PURE__ */ k.jsx("span", { className: `mid horizontal ${ue[r][6] ? "on" : "off"}` })
] });
ce.propTypes = {
number: te.number
};
const Ke = ({ hours: r, minutes: m, seconds: d, color: f }) => /* @__PURE__ */ k.jsxs("div", { className: `digital-time ${f}`, children: [
/* @__PURE__ */ k.jsx(ce, { number: +r[0] }),
/* @__PURE__ */ k.jsx(ce, { number: +r[1] }),
/* @__PURE__ */ k.jsx("span", { className: "colon", children: ":" }),
/* @__PURE__ */ k.jsx(ce, { number: +m[0] }),
/* @__PURE__ */ k.jsx(ce, { number: +m[1] }),
/* @__PURE__ */ k.jsx("span", { className: "colon", children: ":" }),
/* @__PURE__ */ k.jsx(ce, { number: +d[0] }),
/* @__PURE__ */ k.jsx(ce, { number: +d[1] })
] });
Ke.propTypes = {
hours: te.string,
minutes: te.string,
seconds: te.string,
color: te.oneOf(["light", "dark"])
};
function Er() {
const [r, m] = rr(/* @__PURE__ */ new Date()), d = tr(null);
return nr(() => (d.current = setInterval(() => {
m(/* @__PURE__ */ new Date());
}, 1e3), () => clearInterval(d.current)), []), r;
}
const br = ({ color: r = "light" }) => {
const m = Er(), d = (m.getHours() % 12).toString().padStart(2, "0"), f = m.getMinutes().toString().padStart(2, "0"), E = m.getSeconds().toString().padStart(2, "0"), u = m.getDay(), T = m.getHours() >= 12 ? "PM" : "AM";
return /* @__PURE__ */ k.jsxs("div", { className: `digital-clock ${r}`, style: { height: "100px", width: "300px" }, children: [
/* @__PURE__ */ k.jsx(Ze, { today: u }),
/* @__PURE__ */ k.jsx(Ke, { hours: d, minutes: f, seconds: E, color: r }),
/* @__PURE__ */ k.jsx(Xe, { amPm: T })
] });
};
br.propTypes = {
color: te.oneOf(["light", "dark"])
};
export {
br as DigitalClock
};