UNPKG

@yemredurur/feedback-app

Version:

This project is a feedback system for websites. It enables customers to provide feedback and saves it to Firebase.

1,478 lines (1,475 loc) 1.01 MB
import "./index.css"; import l0, { useState as Cs, useCallback as m1, useMemo as y1 } from "react"; import w1 from "react-dom"; var ap = { exports: {} }, ks = {}; /** * @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 Ry; function b1() { if (Ry) return ks; Ry = 1; var e = l0, t = Symbol.for("react.element"), r = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, s = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, u = { key: !0, ref: !0, __self: !0, __source: !0 }; function c(l, f, d) { var g, y = {}, w = null, I = null; d !== void 0 && (w = "" + d), f.key !== void 0 && (w = "" + f.key), f.ref !== void 0 && (I = f.ref); for (g in f) i.call(f, g) && !u.hasOwnProperty(g) && (y[g] = f[g]); if (l && l.defaultProps) for (g in f = l.defaultProps, f) y[g] === void 0 && (y[g] = f[g]); return { $$typeof: t, type: l, key: w, ref: I, props: y, _owner: s.current }; } return ks.Fragment = r, ks.jsx = c, ks.jsxs = c, ks; } var As = {}; /** * @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 Cy; function _1() { return Cy || (Cy = 1, process.env.NODE_ENV !== "production" && function() { var e = l0, t = Symbol.for("react.element"), r = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), s = Symbol.for("react.strict_mode"), u = Symbol.for("react.profiler"), c = Symbol.for("react.provider"), l = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), d = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), y = Symbol.for("react.memo"), w = Symbol.for("react.lazy"), I = Symbol.for("react.offscreen"), E = Symbol.iterator, T = "@@iterator"; function A(_) { if (_ === null || typeof _ != "object") return null; var P = E && _[E] || _[T]; return typeof P == "function" ? P : null; } var D = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; function L(_) { { for (var P = arguments.length, V = new Array(P > 1 ? P - 1 : 0), Q = 1; Q < P; Q++) V[Q - 1] = arguments[Q]; j("error", _, V); } } function j(_, P, V) { { var Q = D.ReactDebugCurrentFrame, ot = Q.getStackAddendum(); ot !== "" && (P += "%s", V = V.concat([ot])); var wt = V.map(function(at) { return String(at); }); wt.unshift("Warning: " + P), Function.prototype.apply.call(console[_], console, wt); } } var $ = !1, Z = !1, F = !1, ht = !1, z = !1, St; St = Symbol.for("react.module.reference"); function S(_) { return !!(typeof _ == "string" || typeof _ == "function" || _ === i || _ === u || z || _ === s || _ === d || _ === g || ht || _ === I || $ || Z || F || typeof _ == "object" && _ !== null && (_.$$typeof === w || _.$$typeof === y || _.$$typeof === c || _.$$typeof === l || _.$$typeof === f || // 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. _.$$typeof === St || _.getModuleId !== void 0)); } function kr(_, P, V) { var Q = _.displayName; if (Q) return Q; var ot = P.displayName || P.name || ""; return ot !== "" ? V + "(" + ot + ")" : V; } function Wn(_) { return _.displayName || "Context"; } function tn(_) { if (_ == null) return null; if (typeof _.tag == "number" && L("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof _ == "function") return _.displayName || _.name || null; if (typeof _ == "string") return _; switch (_) { case i: return "Fragment"; case r: return "Portal"; case u: return "Profiler"; case s: return "StrictMode"; case d: return "Suspense"; case g: return "SuspenseList"; } if (typeof _ == "object") switch (_.$$typeof) { case l: var P = _; return Wn(P) + ".Consumer"; case c: var V = _; return Wn(V._context) + ".Provider"; case f: return kr(_, _.render, "ForwardRef"); case y: var Q = _.displayName || null; return Q !== null ? Q : tn(_.type) || "Memo"; case w: { var ot = _, wt = ot._payload, at = ot._init; try { return tn(at(wt)); } catch { return null; } } } return null; } var en = Object.assign, nn = 0, Xn, Lo, ce, bi, Cn, _i, Mo; function Fo() { } Fo.__reactDisabledLog = !0; function Eu() { { if (nn === 0) { Xn = console.log, Lo = console.info, ce = console.warn, bi = console.error, Cn = console.group, _i = console.groupCollapsed, Mo = console.groupEnd; var _ = { configurable: !0, enumerable: !0, value: Fo, writable: !0 }; Object.defineProperties(console, { info: _, log: _, warn: _, error: _, group: _, groupCollapsed: _, groupEnd: _ }); } nn++; } } function hh() { { if (nn--, nn === 0) { var _ = { configurable: !0, enumerable: !0, writable: !0 }; Object.defineProperties(console, { log: en({}, _, { value: Xn }), info: en({}, _, { value: Lo }), warn: en({}, _, { value: ce }), error: en({}, _, { value: bi }), group: en({}, _, { value: Cn }), groupCollapsed: en({}, _, { value: _i }), groupEnd: en({}, _, { value: Mo }) }); } nn < 0 && L("disabledDepth fell below zero. This is a bug in React. Please file an issue."); } } var Ar = D.ReactCurrentDispatcher, Ii; function _t(_, P, V) { { if (Ii === void 0) try { throw Error(); } catch (ot) { var Q = ot.stack.trim().match(/\n( *(at )?)/); Ii = Q && Q[1] || ""; } return ` ` + Ii + _; } } var Uo = !1, Ei; { var Ti = typeof WeakMap == "function" ? WeakMap : Map; Ei = new Ti(); } function Tu(_, P) { if (!_ || Uo) return ""; { var V = Ei.get(_); if (V !== void 0) return V; } var Q; Uo = !0; var ot = Error.prepareStackTrace; Error.prepareStackTrace = void 0; var wt; wt = Ar.current, Ar.current = null, Eu(); try { if (P) { var at = function() { throw Error(); }; if (Object.defineProperty(at.prototype, "props", { set: function() { throw Error(); } }), typeof Reflect == "object" && Reflect.construct) { try { Reflect.construct(at, []); } catch (Ut) { Q = Ut; } Reflect.construct(_, [], at); } else { try { at.call(); } catch (Ut) { Q = Ut; } _.call(at.prototype); } } else { try { throw Error(); } catch (Ut) { Q = Ut; } _(); } } catch (Ut) { if (Ut && Q && typeof Ut.stack == "string") { for (var st = Ut.stack.split(` `), Qt = Q.stack.split(` `), At = st.length - 1, Nt = Qt.length - 1; At >= 1 && Nt >= 0 && st[At] !== Qt[Nt]; ) Nt--; for (; At >= 1 && Nt >= 0; At--, Nt--) if (st[At] !== Qt[Nt]) { if (At !== 1 || Nt !== 1) do if (At--, Nt--, Nt < 0 || st[At] !== Qt[Nt]) { var fe = ` ` + st[At].replace(" at new ", " at "); return _.displayName && fe.includes("<anonymous>") && (fe = fe.replace("<anonymous>", _.displayName)), typeof _ == "function" && Ei.set(_, fe), fe; } while (At >= 1 && Nt >= 0); break; } } } finally { Uo = !1, Ar.current = wt, hh(), Error.prepareStackTrace = ot; } var Zn = _ ? _.displayName || _.name : "", Pu = Zn ? _t(Zn) : ""; return typeof _ == "function" && Ei.set(_, Pu), Pu; } function lh(_, P, V) { return Tu(_, !1); } function rn(_) { var P = _.prototype; return !!(P && P.isReactComponent); } function Dn(_, P, V) { if (_ == null) return ""; if (typeof _ == "function") return Tu(_, rn(_)); if (typeof _ == "string") return _t(_); switch (_) { case d: return _t("Suspense"); case g: return _t("SuspenseList"); } if (typeof _ == "object") switch (_.$$typeof) { case f: return lh(_.render); case y: return Dn(_.type, P, V); case w: { var Q = _, ot = Q._payload, wt = Q._init; try { return Dn(wt(ot), P, V); } catch { } } } return ""; } var he = Object.prototype.hasOwnProperty, Si = {}, vn = D.ReactDebugCurrentFrame; function Nr(_) { if (_) { var P = _._owner, V = Dn(_.type, _._source, P ? P.type : null); vn.setExtraStackFrame(V); } else vn.setExtraStackFrame(null); } function fh(_, P, V, Q, ot) { { var wt = Function.call.bind(he); for (var at in _) if (wt(_, at)) { var st = void 0; try { if (typeof _[at] != "function") { var Qt = Error((Q || "React class") + ": " + V + " type `" + at + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof _[at] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."); throw Qt.name = "Invariant Violation", Qt; } st = _[at](P, at, Q, V, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"); } catch (At) { st = At; } st && !(st instanceof Error) && (Nr(ot), 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).", Q || "React class", V, at, typeof st), Nr(null)), st instanceof Error && !(st.message in Si) && (Si[st.message] = !0, Nr(ot), L("Failed %s type: %s", V, st.message), Nr(null)); } } } var ph = Array.isArray; function jo(_) { return ph(_); } function dh(_) { { var P = typeof Symbol == "function" && Symbol.toStringTag, V = P && _[Symbol.toStringTag] || _.constructor.name || "Object"; return V; } } function vh(_) { try { return Su(_), !1; } catch { return !0; } } function Su(_) { return "" + _; } function ku(_) { if (vh(_)) return L("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", dh(_)), Su(_); } var dt = D.ReactCurrentOwner, Vo = { key: !0, ref: !0, __self: !0, __source: !0 }, On, qo, ki; ki = {}; function Ft(_) { if (he.call(_, "ref")) { var P = Object.getOwnPropertyDescriptor(_, "ref").get; if (P && P.isReactWarning) return !1; } return _.ref !== void 0; } function Au(_) { if (he.call(_, "key")) { var P = Object.getOwnPropertyDescriptor(_, "key").get; if (P && P.isReactWarning) return !1; } return _.key !== void 0; } function xn(_, P) { if (typeof _.ref == "string" && dt.current && P && dt.current.stateNode !== P) { var V = tn(dt.current.type); ki[V] || (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', tn(dt.current.type), _.ref), ki[V] = !0); } } function gn(_, P) { { var V = function() { On || (On = !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)", P)); }; V.isReactWarning = !0, Object.defineProperty(_, "key", { get: V, configurable: !0 }); } } function Nu(_, P) { { var V = function() { qo || (qo = !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)", P)); }; V.isReactWarning = !0, Object.defineProperty(_, "ref", { get: V, configurable: !0 }); } } var le = function(_, P, V, Q, ot, wt, at) { var st = { // This tag allows us to uniquely identify this as a React Element $$typeof: t, // Built-in properties that belong on the element type: _, key: P, ref: V, props: at, // Record the component responsible for creating this element. _owner: wt }; return st._store = {}, Object.defineProperty(st._store, "validated", { configurable: !1, enumerable: !1, writable: !0, value: !1 }), Object.defineProperty(st, "_self", { configurable: !1, enumerable: !1, writable: !1, value: Q }), Object.defineProperty(st, "_source", { configurable: !1, enumerable: !1, writable: !1, value: ot }), Object.freeze && (Object.freeze(st.props), Object.freeze(st)), st; }; function Ru(_, P, V, Q, ot) { { var wt, at = {}, st = null, Qt = null; V !== void 0 && (ku(V), st = "" + V), Au(P) && (ku(P.key), st = "" + P.key), Ft(P) && (Qt = P.ref, xn(P, ot)); for (wt in P) he.call(P, wt) && !Vo.hasOwnProperty(wt) && (at[wt] = P[wt]); if (_ && _.defaultProps) { var At = _.defaultProps; for (wt in At) at[wt] === void 0 && (at[wt] = At[wt]); } if (st || Qt) { var Nt = typeof _ == "function" ? _.displayName || _.name || "Unknown" : _; st && gn(at, Nt), Qt && Nu(at, Nt); } return le(_, st, Qt, ot, Q, dt.current, at); } } var Re = D.ReactCurrentOwner, Ai = D.ReactDebugCurrentFrame; function Pn(_) { if (_) { var P = _._owner, V = Dn(_.type, _._source, P ? P.type : null); Ai.setExtraStackFrame(V); } else Ai.setExtraStackFrame(null); } var Yn; Yn = !1; function Qn(_) { return typeof _ == "object" && _ !== null && _.$$typeof === t; } function Bo() { { if (Re.current) { var _ = tn(Re.current.type); if (_) return ` Check the render method of \`` + _ + "`."; } return ""; } } function Jn(_) { { if (_ !== void 0) { var P = _.fileName.replace(/^.*[\\\/]/, ""), V = _.lineNumber; return ` Check your code at ` + P + ":" + V + "."; } return ""; } } var Ko = {}; function Ho(_) { { var P = Bo(); if (!P) { var V = typeof _ == "string" ? _ : _.displayName || _.name; V && (P = ` Check the top-level render call using <` + V + ">."); } return P; } } function Cu(_, P) { { if (!_._store || _._store.validated || _.key != null) return; _._store.validated = !0; var V = Ho(P); if (Ko[V]) return; Ko[V] = !0; var Q = ""; _ && _._owner && _._owner !== Re.current && (Q = " It was passed a child from " + tn(_._owner.type) + "."), Pn(_), L('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', V, Q), Pn(null); } } function Du(_, P) { { if (typeof _ != "object") return; if (jo(_)) for (var V = 0; V < _.length; V++) { var Q = _[V]; Qn(Q) && Cu(Q, P); } else if (Qn(_)) _._store && (_._store.validated = !0); else if (_) { var ot = A(_); if (typeof ot == "function" && ot !== _.entries) for (var wt = ot.call(_), at; !(at = wt.next()).done; ) Qn(at.value) && Cu(at.value, P); } } } function Ou(_) { { var P = _.type; if (P == null || typeof P == "string") return; var V; if (typeof P == "function") V = P.propTypes; else if (typeof P == "object" && (P.$$typeof === f || // Note: Memo only checks outer props here. // Inner props are checked in the reconciler. P.$$typeof === y)) V = P.propTypes; else return; if (V) { var Q = tn(P); fh(V, _.props, "prop", Q, _); } else if (P.PropTypes !== void 0 && !Yn) { Yn = !0; var ot = tn(P); L("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", ot || "Unknown"); } typeof P.getDefaultProps == "function" && !P.getDefaultProps.isReactClassApproved && L("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."); } } function gh(_) { { for (var P = Object.keys(_.props), V = 0; V < P.length; V++) { var Q = P[V]; if (Q !== "children" && Q !== "key") { Pn(_), L("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", Q), Pn(null); break; } } _.ref !== null && (Pn(_), L("Invalid attribute `ref` supplied to `React.Fragment`."), Pn(null)); } } function ee(_, P, V, Q, ot, wt) { { var at = S(_); if (!at) { var st = ""; (_ === void 0 || typeof _ == "object" && _ !== null && Object.keys(_).length === 0) && (st += " 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 Qt = Jn(ot); Qt ? st += Qt : st += Bo(); var At; _ === null ? At = "null" : jo(_) ? At = "array" : _ !== void 0 && _.$$typeof === t ? (At = "<" + (tn(_.type) || "Unknown") + " />", st = " Did you accidentally export a JSX literal instead of a component?") : At = typeof _, L("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", At, st); } var Nt = Ru(_, P, V, ot, wt); if (Nt == null) return Nt; if (at) { var fe = P.children; if (fe !== void 0) if (Q) if (jo(fe)) { for (var Zn = 0; Zn < fe.length; Zn++) Du(fe[Zn], _); Object.freeze && Object.freeze(fe); } 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 Du(fe, _); } return _ === i ? gh(Nt) : Ou(Nt), Nt; } } function Ni(_, P, V) { return ee(_, P, V, !0); } function mh(_, P, V) { return ee(_, P, V, !1); } var yh = mh, xu = Ni; As.Fragment = i, As.jsx = yh, As.jsxs = xu; }()), As; } process.env.NODE_ENV === "production" ? ap.exports = b1() : ap.exports = _1(); var it = ap.exports; const I1 = (e) => /* @__PURE__ */ it.jsxs("svg", { width: e.size, height: e.size, stroke: e.color, fill: "none", strokeWidth: "0", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", className: "animate-spin -ml-1 mr-3 h-5 w-5", children: [ /* @__PURE__ */ it.jsx("path", { opacity: "0.2", fillRule: "evenodd", clipRule: "evenodd", d: "M12 19C15.866 19 19 15.866 19 12C19 8.13401 15.866 5 12 5C8.13401 5 5 8.13401 5 12C5 15.866 8.13401 19 12 19ZM12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z", fill: "currentColor" }), /* @__PURE__ */ it.jsx("path", { d: "M2 12C2 6.47715 6.47715 2 12 2V5C8.13401 5 5 8.13401 5 12H2Z", stroke: e.color, fill: e.color }) ] }); const tc = ({ children: e, onClick: t, disabled: r, id: i, className: s, icon: u, loading: c }) => /* @__PURE__ */ it.jsxs( "button", { id: `button-${i}`, className: `button ${s}`, onClick: t, disabled: r, children: [ c && /* @__PURE__ */ it.jsx(I1, { size: "20", color: "white" }), e && e, u && !e && u ] } ); tc.defaultProps = { disabled: !1, loading: !1, className: "primary-button" }; const E1 = (e) => /* @__PURE__ */ it.jsx( "svg", { width: e.size, height: e.size, stroke: e.color, fill: e.color, strokeWidth: "0", viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ it.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M4 11.29l1-1v1.42l-1.15 1.14L3 12.5V10H1.5L1 9.5v-8l.5-.5h12l.5.5V6h-1V2H2v7h1.5l.5.5v1.79zM10.29 13l1.86 1.85.85-.35V13h1.5l.5-.5v-5l-.5-.5h-8l-.5.5v5l.5.5h3.79zm.21-1H7V8h7v4h-1.5l-.5.5v.79l-1.15-1.14-.35-.15z" }) } ); var cp = function(e, t) { return cp = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, i) { r.__proto__ = i; } || function(r, i) { for (var s in i) Object.prototype.hasOwnProperty.call(i, s) && (r[s] = i[s]); }, cp(e, t); }; function Y(e, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); cp(e, t); function r() { this.constructor = e; } e.prototype = t === null ? Object.create(t) : (r.prototype = t.prototype, new r()); } var so = function() { return so = Object.assign || function(t) { for (var r, i = 1, s = arguments.length; i < s; i++) { r = arguments[i]; for (var u in r) Object.prototype.hasOwnProperty.call(r, u) && (t[u] = r[u]); } return t; }, so.apply(this, arguments); }; function C(e, t, r, i) { function s(u) { return u instanceof r ? u : new r(function(c) { c(u); }); } return new (r || (r = Promise))(function(u, c) { function l(g) { try { d(i.next(g)); } catch (y) { c(y); } } function f(g) { try { d(i.throw(g)); } catch (y) { c(y); } } function d(g) { g.done ? u(g.value) : s(g.value).then(l, f); } d((i = i.apply(e, t || [])).next()); }); } function R(e, t) { var r = { label: 0, sent: function() { if (u[0] & 1) throw u[1]; return u[1]; }, trys: [], ops: [] }, i, s, u, c; return c = { next: l(0), throw: l(1), return: l(2) }, typeof Symbol == "function" && (c[Symbol.iterator] = function() { return this; }), c; function l(d) { return function(g) { return f([d, g]); }; } function f(d) { if (i) throw new TypeError("Generator is already executing."); for (; c && (c = 0, d[0] && (r = 0)), r; ) try { if (i = 1, s && (u = d[0] & 2 ? s.return : d[0] ? s.throw || ((u = s.return) && u.call(s), 0) : s.next) && !(u = u.call(s, d[1])).done) return u; switch (s = 0, u && (d = [d[0] & 2, u.value]), d[0]) { case 0: case 1: u = d; break; case 4: return r.label++, { value: d[1], done: !1 }; case 5: r.label++, s = d[1], d = [0]; continue; case 7: d = r.ops.pop(), r.trys.pop(); continue; default: if (u = r.trys, !(u = u.length > 0 && u[u.length - 1]) && (d[0] === 6 || d[0] === 2)) { r = 0; continue; } if (d[0] === 3 && (!u || d[1] > u[0] && d[1] < u[3])) { r.label = d[1]; break; } if (d[0] === 6 && r.label < u[1]) { r.label = u[1], u = d; break; } if (u && r.label < u[2]) { r.label = u[2], r.ops.push(d); break; } u[2] && r.ops.pop(), r.trys.pop(); continue; } d = t.call(e, r); } catch (g) { d = [6, g], s = 0; } finally { i = u = 0; } if (d[0] & 5) throw d[1]; return { value: d[0] ? d[1] : void 0, done: !0 }; } } function Hf(e) { var t = typeof Symbol == "function" && Symbol.iterator, r = t && e[t], i = 0; if (r) return r.call(e); if (e && typeof e.length == "number") return { next: function() { return e && i >= e.length && (e = void 0), { value: e && e[i++], done: !e }; } }; throw new TypeError(t ? "Object is not iterable." : "Symbol.iterator is not defined."); } function xa(e, t) { var r = typeof Symbol == "function" && e[Symbol.iterator]; if (!r) return e; var i = r.call(e), s, u = [], c; try { for (; (t === void 0 || t-- > 0) && !(s = i.next()).done; ) u.push(s.value); } catch (l) { c = { error: l }; } finally { try { s && !s.done && (r = i.return) && r.call(i); } finally { if (c) throw c.error; } } return u; } function Dt(e, t, r) { if (r || arguments.length === 2) for (var i = 0, s = t.length, u; i < s; i++) (u || !(i in t)) && (u || (u = Array.prototype.slice.call(t, 0, i)), u[i] = t[i]); return e.concat(u || Array.prototype.slice.call(t)); } /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ var f0 = function(e) { for (var t = [], r = 0, i = 0; i < e.length; i++) { var s = e.charCodeAt(i); s < 128 ? t[r++] = s : s < 2048 ? (t[r++] = s >> 6 | 192, t[r++] = s & 63 | 128) : (s & 64512) === 55296 && i + 1 < e.length && (e.charCodeAt(i + 1) & 64512) === 56320 ? (s = 65536 + ((s & 1023) << 10) + (e.charCodeAt(++i) & 1023), t[r++] = s >> 18 | 240, t[r++] = s >> 12 & 63 | 128, t[r++] = s >> 6 & 63 | 128, t[r++] = s & 63 | 128) : (t[r++] = s >> 12 | 224, t[r++] = s >> 6 & 63 | 128, t[r++] = s & 63 | 128); } return t; }, T1 = function(e) { for (var t = [], r = 0, i = 0; r < e.length; ) { var s = e[r++]; if (s < 128) t[i++] = String.fromCharCode(s); else if (s > 191 && s < 224) { var u = e[r++]; t[i++] = String.fromCharCode((s & 31) << 6 | u & 63); } else if (s > 239 && s < 365) { var u = e[r++], c = e[r++], l = e[r++], f = ((s & 7) << 18 | (u & 63) << 12 | (c & 63) << 6 | l & 63) - 65536; t[i++] = String.fromCharCode(55296 + (f >> 10)), t[i++] = String.fromCharCode(56320 + (f & 1023)); } else { var u = e[r++], c = e[r++]; t[i++] = String.fromCharCode((s & 15) << 12 | (u & 63) << 6 | c & 63); } } return t.join(""); }, S1 = { /** * Maps bytes to characters. */ byteToCharMap_: null, /** * Maps characters to bytes. */ charToByteMap_: null, /** * Maps bytes to websafe characters. * @private */ byteToCharMapWebSafe_: null, /** * Maps websafe characters to bytes. * @private */ charToByteMapWebSafe_: null, /** * Our default alphabet, shared between * ENCODED_VALS and ENCODED_VALS_WEBSAFE */ ENCODED_VALS_BASE: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", /** * Our default alphabet. Value 64 (=) is special; it means "nothing." */ get ENCODED_VALS() { return this.ENCODED_VALS_BASE + "+/="; }, /** * Our websafe alphabet. */ get ENCODED_VALS_WEBSAFE() { return this.ENCODED_VALS_BASE + "-_."; }, /** * Whether this browser supports the atob and btoa functions. This extension * started at Mozilla but is now implemented by many browsers. We use the * ASSUME_* variables to avoid pulling in the full useragent detection library * but still allowing the standard per-browser compilations. * */ HAS_NATIVE_SUPPORT: typeof atob == "function", /** * Base64-encode an array of bytes. * * @param input An array of bytes (numbers with * value in [0, 255]) to encode. * @param webSafe Boolean indicating we should use the * alternative alphabet. * @return The base64 encoded string. */ encodeByteArray: function(e, t) { if (!Array.isArray(e)) throw Error("encodeByteArray takes an array as a parameter"); this.init_(); for (var r = t ? this.byteToCharMapWebSafe_ : this.byteToCharMap_, i = [], s = 0; s < e.length; s += 3) { var u = e[s], c = s + 1 < e.length, l = c ? e[s + 1] : 0, f = s + 2 < e.length, d = f ? e[s + 2] : 0, g = u >> 2, y = (u & 3) << 4 | l >> 4, w = (l & 15) << 2 | d >> 6, I = d & 63; f || (I = 64, c || (w = 64)), i.push(r[g], r[y], r[w], r[I]); } return i.join(""); }, /** * Base64-encode a string. * * @param input A string to encode. * @param webSafe If true, we should use the * alternative alphabet. * @return The base64 encoded string. */ encodeString: function(e, t) { return this.HAS_NATIVE_SUPPORT && !t ? btoa(e) : this.encodeByteArray(f0(e), t); }, /** * Base64-decode a string. * * @param input to decode. * @param webSafe True if we should use the * alternative alphabet. * @return string representing the decoded value. */ decodeString: function(e, t) { return this.HAS_NATIVE_SUPPORT && !t ? atob(e) : T1(this.decodeStringToByteArray(e, t)); }, /** * Base64-decode a string. * * In base-64 decoding, groups of four characters are converted into three * bytes. If the encoder did not apply padding, the input length may not * be a multiple of 4. * * In this case, the last group will have fewer than 4 characters, and * padding will be inferred. If the group has one or two characters, it decodes * to one byte. If the group has three characters, it decodes to two bytes. * * @param input Input to decode. * @param webSafe True if we should use the web-safe alphabet. * @return bytes representing the decoded value. */ decodeStringToByteArray: function(e, t) { this.init_(); for (var r = t ? this.charToByteMapWebSafe_ : this.charToByteMap_, i = [], s = 0; s < e.length; ) { var u = r[e.charAt(s++)], c = s < e.length, l = c ? r[e.charAt(s)] : 0; ++s; var f = s < e.length, d = f ? r[e.charAt(s)] : 64; ++s; var g = s < e.length, y = g ? r[e.charAt(s)] : 64; if (++s, u == null || l == null || d == null || y == null) throw Error(); var w = u << 2 | l >> 4; if (i.push(w), d !== 64) { var I = l << 4 & 240 | d >> 2; if (i.push(I), y !== 64) { var E = d << 6 & 192 | y; i.push(E); } } } return i; }, /** * Lazy static initialization function. Called before * accessing any of the static map variables. * @private */ init_: function() { if (!this.byteToCharMap_) { this.byteToCharMap_ = {}, this.charToByteMap_ = {}, this.byteToCharMapWebSafe_ = {}, this.charToByteMapWebSafe_ = {}; for (var e = 0; e < this.ENCODED_VALS.length; e++) this.byteToCharMap_[e] = this.ENCODED_VALS.charAt(e), this.charToByteMap_[this.byteToCharMap_[e]] = e, this.byteToCharMapWebSafe_[e] = this.ENCODED_VALS_WEBSAFE.charAt(e), this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]] = e, e >= this.ENCODED_VALS_BASE.length && (this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)] = e, this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)] = e); } } }, k1 = function(e) { var t = f0(e); return S1.encodeByteArray(t, !0); }, Dy = function(e) { return k1(e).replace(/\./g, ""); }; /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ function A1(e) { return js(void 0, e); } function js(e, t) { if (!(t instanceof Object)) return t; switch (t.constructor) { case Date: var r = t; return new Date(r.getTime()); case Object: e === void 0 && (e = {}); break; case Array: e = []; break; default: return t; } for (var i in t) !t.hasOwnProperty(i) || !N1(i) || (e[i] = js(e[i], t[i])); return e; } function N1(e) { return e !== "__proto__"; } /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ var R1 = ( /** @class */ function() { function e() { var t = this; this.reject = function() { }, this.resolve = function() { }, this.promise = new Promise(function(r, i) { t.resolve = r, t.reject = i; }); } return e.prototype.wrapCallback = function(t) { var r = this; return function(i, s) { i ? r.reject(i) : r.resolve(s), typeof t == "function" && (r.promise.catch(function() { }), t.length === 1 ? t(i) : t(i, s)); }; }, e; }() ); /** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ function p0(e, t) { if (e.uid) throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.'); var r = { alg: "none", type: "JWT" }, i = t || "demo-project", s = e.iat || 0, u = e.sub || e.user_id; if (!u) throw new Error("mockUserToken must contain 'sub' or 'user_id' field!"); var c = so({ // Set all required fields to decent defaults iss: "https://securetoken.google.com/" + i, aud: i, iat: s, exp: s + 3600, auth_time: s, sub: u, user_id: u, firebase: { sign_in_provider: "custom", identities: {} } }, e), l = ""; return [ Dy(JSON.stringify(r)), Dy(JSON.stringify(c)), l ].join("."); } /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ function oi() { return typeof navigator < "u" && typeof navigator.userAgent == "string" ? navigator.userAgent : ""; } function C1() { return typeof window < "u" && // @ts-ignore Setting up an broadly applicable index signature for Window // just to deal with this case would probably be a bad idea. !!(window.cordova || window.phonegap || window.PhoneGap) && /ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(oi()); } function d0() { try { return Object.prototype.toString.call(global.process) === "[object process]"; } catch { return !1; } } function D1() { return typeof self == "object" && self.self === self; } function O1() { var e = typeof chrome == "object" ? chrome.runtime : typeof browser == "object" ? browser.runtime : void 0; return typeof e == "object" && e.id !== void 0; } function x1() { return typeof navigator == "object" && navigator.product === "ReactNative"; } function P1() { return oi().indexOf("Electron/") >= 0; } function L1() { var e = oi(); return e.indexOf("MSIE ") >= 0 || e.indexOf("Trident/") >= 0; } function M1() { return oi().indexOf("MSAppHost/") >= 0; } function F1() { return !d0() && navigator.userAgent.includes("Safari") && !navigator.userAgent.includes("Chrome"); } /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ var U1 = "FirebaseError", v0 = ( /** @class */ function(e) { Y(t, e); function t(r, i, s) { var u = e.call(this, i) || this; return u.code = r, u.customData = s, u.name = U1, Object.setPrototypeOf(u, t.prototype), Error.captureStackTrace && Error.captureStackTrace(u, qp.prototype.create), u; } return t; }(Error) ), qp = ( /** @class */ function() { function e(t, r, i) { this.service = t, this.serviceName = r, this.errors = i; } return e.prototype.create = function(t) { for (var r = [], i = 1; i < arguments.length; i++) r[i - 1] = arguments[i]; var s = r[0] || {}, u = this.service + "/" + t, c = this.errors[t], l = c ? j1(c, s) : "Error", f = this.serviceName + ": " + l + " (" + u + ").", d = new v0(u, f, s); return d; }, e; }() ); function j1(e, t) { return e.replace(V1, function(r, i) { var s = t[i]; return s != null ? String(s) : "<" + i + "?>"; }); } var V1 = /\{\$([^}]+)}/g; /** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ function Oy(e, t) { return Object.prototype.hasOwnProperty.call(e, t); } function q1(e, t) { var r = new B1(e, t); return r.subscribe.bind(r); } var B1 = ( /** @class */ function() { function e(t, r) { var i = this; this.observers = [], this.unsubscribes = [], this.observerCount = 0, this.task = Promise.resolve(), this.finalized = !1, this.onNoObservers = r, this.task.then(function() { t(i); }).catch(function(s) { i.error(s); }); } return e.prototype.next = function(t) { this.forEachObserver(function(r) { r.next(t); }); }, e.prototype.error = function(t) { this.forEachObserver(function(r) { r.error(t); }), this.close(t); }, e.prototype.complete = function() { this.forEachObserver(function(t) { t.complete(); }), this.close(); }, e.prototype.subscribe = function(t, r, i) { var s = this, u; if (t === void 0 && r === void 0 && i === void 0) throw new Error("Missing Observer."); K1(t, [ "next", "error", "complete" ]) ? u = t : u = { next: t, error: r, complete: i }, u.next === void 0 && (u.next = zf), u.error === void 0 && (u.error = zf), u.complete === void 0 && (u.complete = zf); var c = this.unsubscribeOne.bind(this, this.observers.length); return this.finalized && this.task.then(function() { try { s.finalError ? u.error(s.finalError) : u.complete(); } catch { } }), this.observers.push(u), c; }, e.prototype.unsubscribeOne = function(t) { this.observers === void 0 || this.observers[t] === void 0 || (delete this.observers[t], this.observerCount -= 1, this.observerCount === 0 && this.onNoObservers !== void 0 && this.onNoObservers(this)); }, e.prototype.forEachObserver = function(t) { if (!this.finalized) for (var r = 0; r < this.observers.length; r++) this.sendOne(r, t); }, e.prototype.sendOne = function(t, r) { var i = this; this.task.then(function() { if (i.observers !== void 0 && i.observers[t] !== void 0) try { r(i.observers[t]); } catch (s) { typeof console < "u" && console.error && console.error(s); } }); }, e.prototype.close = function(t) { var r = this; this.finalized || (this.finalized = !0, t !== void 0 && (this.finalError = t), this.task.then(function() { r.observers = void 0, r.onNoObservers = void 0; })); }, e; }() ); function K1(e, t) { if (typeof e != "object" || e === null) return !1; for (var r = 0, i = t; r < i.length; r++) { var s = i[r]; if (s in e && typeof e[s] == "function") return !0; } return !1; } function zf() { } /** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ function Et(e) { return e && e._delegate ? e._delegate : e; } var ru = ( /** @class */ function() { function e(t, r, i) { this.name = t, this.instanceFactory = r, this.type = i, this.multipleInstances = !1, this.serviceProps = {}, this.instantiationMode = "LAZY", this.onInstanceCreated = null; } return e.prototype.setInstantiationMode = function(t) { return this.instantiationMode = t, this; }, e.prototype.setMultipleInstances = function(t) { return this.multipleInstances = t, this; }, e.prototype.setServiceProps = function(t) { return this.serviceProps = t, this; }, e.prototype.setInstanceCreatedCallback = function(t) { return this.onInstanceCreated = t, this; }, e; }() ); /** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ var Xr = "[DEFAULT]"; /** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ var H1 = ( /** @class */ function() { function e(t, r) { this.name = t, this.container = r, this.component = null, this.instances = /* @__PURE__ */ new Map(), this.instancesDeferred = /* @__PURE__ */ new Map(), this.instancesOptions = /* @__PURE__ */ new Map(), this.onInitCallbacks = /* @__PURE__ */ new Map(); } return e.prototype.get = function(t) { var r = this.normalizeInstanceIdentifier(t); if (!this.instancesDeferred.has(r)) { var i = new R1(); if (this.instancesDeferred.set(r, i), this.isInitialized(r) || this.shouldAutoInitialize()) try { var s = this.getOrInitializeService({ instanceIdentifier: r }); s && i.resolve(s); } catch { } } return this.instancesDeferred.get(r).promise; }, e.prototype.getImmediate = function(t) { var r, i = this.normalizeInstanceIdentifier(t == null ? void 0 : t.identifier), s = (r = t == null ? void 0 : t.optional) !== null && r !== void 0 ? r : !1; if (this.isInitialized(i) || this.shouldAutoInitialize()) try { return this.getOrInitializeService({ instanceIdentifier: i }); } catch (u) { if (s) return null; throw u; } else { if (s) return null; throw Error("Service " + this.name + " is not available"); } }, e.prototype.getComponent = function() { return this.component; }, e.prototype.setComponent = function(t) { var r, i; if (t.name !== this.name) throw Error("Mismatching Component " + t.name + " for Provider " + this.name + "."); if (this.component) throw Error("Component for " + this.name + " has already been provided"); if (this.component = t, !!this.shouldAutoInitialize()) { if (G1(t)) try { this.getOrInitializeService({ instanceIdentifier: Xr }); } catch { } try { for (var s = Hf(this.instancesDeferred.entries()), u = s.next(); !u.done; u = s.next()) { var c = xa(u.value, 2), l = c[0], f = c[1], d = this.normalizeInstanceIdentifier(l); try { var g = this.getOrInitializeService({ instanceIdentifier: d }); f.resolve(g); } catch { } } } catch (y) { r = { error: y }; } finally { try { u && !u.done && (i = s.return) && i.call(s); } finally { if (r) throw r.error; } } } }, e.prototype