UNPKG

react-affiliate-program

Version:

Easily create affiliate programs for React apps

1,263 lines (1,260 loc) 55.3 kB
'use client'; import k from "react"; import './index.css';var me = { exports: {} }, U = {}; /** * @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 Na() { if (ze) return U; ze = 1; var a = k, i = Symbol.for("react.element"), s = Symbol.for("react.fragment"), f = Object.prototype.hasOwnProperty, n = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, h = { key: !0, ref: !0, __self: !0, __source: !0 }; function o(p, g, A) { var j, O = {}, S = null, I = null; A !== void 0 && (S = "" + A), g.key !== void 0 && (S = "" + g.key), g.ref !== void 0 && (I = g.ref); for (j in g) f.call(g, j) && !h.hasOwnProperty(j) && (O[j] = g[j]); if (p && p.defaultProps) for (j in g = p.defaultProps, g) O[j] === void 0 && (O[j] = g[j]); return { $$typeof: i, type: p, key: S, ref: I, props: O, _owner: n.current }; } return U.Fragment = s, U.jsx = o, U.jsxs = o, U; } var J = {}; /** * @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 Be; function Ca() { return Be || (Be = 1, process.env.NODE_ENV !== "production" && function() { var a = k, i = Symbol.for("react.element"), s = Symbol.for("react.portal"), f = Symbol.for("react.fragment"), n = Symbol.for("react.strict_mode"), h = Symbol.for("react.profiler"), o = Symbol.for("react.provider"), p = Symbol.for("react.context"), g = Symbol.for("react.forward_ref"), A = Symbol.for("react.suspense"), j = Symbol.for("react.suspense_list"), O = Symbol.for("react.memo"), S = Symbol.for("react.lazy"), I = Symbol.for("react.offscreen"), u = Symbol.iterator, E = "@@iterator"; function D(e) { if (e === null || typeof e != "object") return null; var r = u && e[u] || e[E]; return typeof r == "function" ? r : null; } var P = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; function b(e) { { for (var r = arguments.length, l = new Array(r > 1 ? r - 1 : 0), c = 1; c < r; c++) l[c - 1] = arguments[c]; Je("error", e, l); } } function Je(e, r, l) { { var c = P.ReactDebugCurrentFrame, v = c.getStackAddendum(); v !== "" && (r += "%s", l = l.concat([v])); var x = l.map(function(m) { return String(m); }); x.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, x); } } var He = !1, Ge = !1, Ke = !1, qe = !1, Xe = !1, he; he = Symbol.for("react.module.reference"); function Ze(e) { return !!(typeof e == "string" || typeof e == "function" || e === f || e === h || Xe || e === n || e === A || e === j || qe || e === I || He || Ge || Ke || typeof e == "object" && e !== null && (e.$$typeof === S || e.$$typeof === O || e.$$typeof === o || e.$$typeof === p || e.$$typeof === g || // 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 === he || e.getModuleId !== void 0)); } function Qe(e, r, l) { var c = e.displayName; if (c) return c; var v = r.displayName || r.name || ""; return v !== "" ? l + "(" + v + ")" : l; } function ve(e) { return e.displayName || "Context"; } function T(e) { if (e == null) return null; if (typeof e.tag == "number" && b("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 f: return "Fragment"; case s: return "Portal"; case h: return "Profiler"; case n: return "StrictMode"; case A: return "Suspense"; case j: return "SuspenseList"; } if (typeof e == "object") switch (e.$$typeof) { case p: var r = e; return ve(r) + ".Consumer"; case o: var l = e; return ve(l._context) + ".Provider"; case g: return Qe(e, e.render, "ForwardRef"); case O: var c = e.displayName || null; return c !== null ? c : T(e.type) || "Memo"; case S: { var v = e, x = v._payload, m = v._init; try { return T(m(x)); } catch { return null; } } } return null; } var $ = Object.assign, M = 0, xe, ge, ye, we, be, je, Ee; function Re() { } Re.__reactDisabledLog = !0; function ea() { { if (M === 0) { xe = console.log, ge = console.info, ye = console.warn, we = console.error, be = console.group, je = console.groupCollapsed, Ee = console.groupEnd; var e = { configurable: !0, enumerable: !0, value: Re, writable: !0 }; Object.defineProperties(console, { info: e, log: e, warn: e, error: e, group: e, groupCollapsed: e, groupEnd: e }); } M++; } } function aa() { { if (M--, M === 0) { var e = { configurable: !0, enumerable: !0, writable: !0 }; Object.defineProperties(console, { log: $({}, e, { value: xe }), info: $({}, e, { value: ge }), warn: $({}, e, { value: ye }), error: $({}, e, { value: we }), group: $({}, e, { value: be }), groupCollapsed: $({}, e, { value: je }), groupEnd: $({}, e, { value: Ee }) }); } M < 0 && b("disabledDepth fell below zero. This is a bug in React. Please file an issue."); } } var re = P.ReactCurrentDispatcher, ne; function G(e, r, l) { { if (ne === void 0) try { throw Error(); } catch (v) { var c = v.stack.trim().match(/\n( *(at )?)/); ne = c && c[1] || ""; } return ` ` + ne + e; } } var ie = !1, K; { var ta = typeof WeakMap == "function" ? WeakMap : Map; K = new ta(); } function ke(e, r) { if (!e || ie) return ""; { var l = K.get(e); if (l !== void 0) return l; } var c; ie = !0; var v = Error.prepareStackTrace; Error.prepareStackTrace = void 0; var x; x = re.current, re.current = null, ea(); try { if (r) { var m = function() { throw Error(); }; if (Object.defineProperty(m.prototype, "props", { set: function() { throw Error(); } }), typeof Reflect == "object" && Reflect.construct) { try { Reflect.construct(m, []); } catch (_) { c = _; } Reflect.construct(e, [], m); } else { try { m.call(); } catch (_) { c = _; } e.call(m.prototype); } } else { try { throw Error(); } catch (_) { c = _; } e(); } } catch (_) { if (_ && c && typeof _.stack == "string") { for (var d = _.stack.split(` `), R = c.stack.split(` `), y = d.length - 1, w = R.length - 1; y >= 1 && w >= 0 && d[y] !== R[w]; ) w--; for (; y >= 1 && w >= 0; y--, w--) if (d[y] !== R[w]) { if (y !== 1 || w !== 1) do if (y--, w--, w < 0 || d[y] !== R[w]) { var N = ` ` + d[y].replace(" at new ", " at "); return e.displayName && N.includes("<anonymous>") && (N = N.replace("<anonymous>", e.displayName)), typeof e == "function" && K.set(e, N), N; } while (y >= 1 && w >= 0); break; } } } finally { ie = !1, re.current = x, aa(), Error.prepareStackTrace = v; } var B = e ? e.displayName || e.name : "", F = B ? G(B) : ""; return typeof e == "function" && K.set(e, F), F; } function ra(e, r, l) { return ke(e, !1); } function na(e) { var r = e.prototype; return !!(r && r.isReactComponent); } function q(e, r, l) { if (e == null) return ""; if (typeof e == "function") return ke(e, na(e)); if (typeof e == "string") return G(e); switch (e) { case A: return G("Suspense"); case j: return G("SuspenseList"); } if (typeof e == "object") switch (e.$$typeof) { case g: return ra(e.render); case O: return q(e.type, r, l); case S: { var c = e, v = c._payload, x = c._init; try { return q(x(v), r, l); } catch { } } } return ""; } var V = Object.prototype.hasOwnProperty, _e = {}, Ne = P.ReactDebugCurrentFrame; function X(e) { if (e) { var r = e._owner, l = q(e.type, e._source, r ? r.type : null); Ne.setExtraStackFrame(l); } else Ne.setExtraStackFrame(null); } function ia(e, r, l, c, v) { { var x = Function.call.bind(V); for (var m in e) if (x(e, m)) { var d = void 0; try { if (typeof e[m] != "function") { var R = Error((c || "React class") + ": " + l + " type `" + m + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[m] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."); throw R.name = "Invariant Violation", R; } d = e[m](r, m, c, l, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"); } catch (y) { d = y; } d && !(d instanceof Error) && (X(v), b("%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).", c || "React class", l, m, typeof d), X(null)), d instanceof Error && !(d.message in _e) && (_e[d.message] = !0, X(v), b("Failed %s type: %s", l, d.message), X(null)); } } } var sa = Array.isArray; function se(e) { return sa(e); } function oa(e) { { var r = typeof Symbol == "function" && Symbol.toStringTag, l = r && e[Symbol.toStringTag] || e.constructor.name || "Object"; return l; } } function la(e) { try { return Ce(e), !1; } catch { return !0; } } function Ce(e) { return "" + e; } function Oe(e) { if (la(e)) return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", oa(e)), Ce(e); } var Y = P.ReactCurrentOwner, fa = { key: !0, ref: !0, __self: !0, __source: !0 }, Pe, Se, oe; oe = {}; function ca(e) { if (V.call(e, "ref")) { var r = Object.getOwnPropertyDescriptor(e, "ref").get; if (r && r.isReactWarning) return !1; } return e.ref !== void 0; } function ua(e) { if (V.call(e, "key")) { var r = Object.getOwnPropertyDescriptor(e, "key").get; if (r && r.isReactWarning) return !1; } return e.key !== void 0; } function da(e, r) { if (typeof e.ref == "string" && Y.current && r && Y.current.stateNode !== r) { var l = T(Y.current.type); oe[l] || (b('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', T(Y.current.type), e.ref), oe[l] = !0); } } function pa(e, r) { { var l = function() { Pe || (Pe = !0, b("%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)); }; l.isReactWarning = !0, Object.defineProperty(e, "key", { get: l, configurable: !0 }); } } function ma(e, r) { { var l = function() { Se || (Se = !0, b("%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)); }; l.isReactWarning = !0, Object.defineProperty(e, "ref", { get: l, configurable: !0 }); } } var ha = function(e, r, l, c, v, x, m) { var d = { // 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: l, props: m, // Record the component responsible for creating this element. _owner: x }; return d._store = {}, Object.defineProperty(d._store, "validated", { configurable: !1, enumerable: !1, writable: !0, value: !1 }), Object.defineProperty(d, "_self", { configurable: !1, enumerable: !1, writable: !1, value: c }), Object.defineProperty(d, "_source", { configurable: !1, enumerable: !1, writable: !1, value: v }), Object.freeze && (Object.freeze(d.props), Object.freeze(d)), d; }; function va(e, r, l, c, v) { { var x, m = {}, d = null, R = null; l !== void 0 && (Oe(l), d = "" + l), ua(r) && (Oe(r.key), d = "" + r.key), ca(r) && (R = r.ref, da(r, v)); for (x in r) V.call(r, x) && !fa.hasOwnProperty(x) && (m[x] = r[x]); if (e && e.defaultProps) { var y = e.defaultProps; for (x in y) m[x] === void 0 && (m[x] = y[x]); } if (d || R) { var w = typeof e == "function" ? e.displayName || e.name || "Unknown" : e; d && pa(m, w), R && ma(m, w); } return ha(e, d, R, v, c, Y.current, m); } } var le = P.ReactCurrentOwner, Te = P.ReactDebugCurrentFrame; function z(e) { if (e) { var r = e._owner, l = q(e.type, e._source, r ? r.type : null); Te.setExtraStackFrame(l); } else Te.setExtraStackFrame(null); } var fe; fe = !1; function ce(e) { return typeof e == "object" && e !== null && e.$$typeof === i; } function Le() { { if (le.current) { var e = T(le.current.type); if (e) return ` Check the render method of \`` + e + "`."; } return ""; } } function xa(e) { return ""; } var Ae = {}; function ga(e) { { var r = Le(); if (!r) { var l = typeof e == "string" ? e : e.displayName || e.name; l && (r = ` Check the top-level render call using <` + l + ">."); } return r; } } function De(e, r) { { if (!e._store || e._store.validated || e.key != null) return; e._store.validated = !0; var l = ga(r); if (Ae[l]) return; Ae[l] = !0; var c = ""; e && e._owner && e._owner !== le.current && (c = " It was passed a child from " + T(e._owner.type) + "."), z(e), b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', l, c), z(null); } } function Ie(e, r) { { if (typeof e != "object") return; if (se(e)) for (var l = 0; l < e.length; l++) { var c = e[l]; ce(c) && De(c, r); } else if (ce(e)) e._store && (e._store.validated = !0); else if (e) { var v = D(e); if (typeof v == "function" && v !== e.entries) for (var x = v.call(e), m; !(m = x.next()).done; ) ce(m.value) && De(m.value, r); } } } function ya(e) { { var r = e.type; if (r == null || typeof r == "string") return; var l; if (typeof r == "function") l = r.propTypes; else if (typeof r == "object" && (r.$$typeof === g || // Note: Memo only checks outer props here. // Inner props are checked in the reconciler. r.$$typeof === O)) l = r.propTypes; else return; if (l) { var c = T(r); ia(l, e.props, "prop", c, e); } else if (r.PropTypes !== void 0 && !fe) { fe = !0; var v = T(r); b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", v || "Unknown"); } typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."); } } function wa(e) { { for (var r = Object.keys(e.props), l = 0; l < r.length; l++) { var c = r[l]; if (c !== "children" && c !== "key") { z(e), b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", c), z(null); break; } } e.ref !== null && (z(e), b("Invalid attribute `ref` supplied to `React.Fragment`."), z(null)); } } var $e = {}; function Fe(e, r, l, c, v, x) { { var m = Ze(e); if (!m) { var d = ""; (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (d += " 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 R = xa(); R ? d += R : d += Le(); var y; e === null ? y = "null" : se(e) ? y = "array" : e !== void 0 && e.$$typeof === i ? (y = "<" + (T(e.type) || "Unknown") + " />", d = " Did you accidentally export a JSX literal instead of a component?") : y = typeof e, b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", y, d); } var w = va(e, r, l, v, x); if (w == null) return w; if (m) { var N = r.children; if (N !== void 0) if (c) if (se(N)) { for (var B = 0; B < N.length; B++) Ie(N[B], e); Object.freeze && Object.freeze(N); } else b("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 Ie(N, e); } if (V.call(r, "key")) { var F = T(e), _ = Object.keys(r).filter(function(_a) { return _a !== "key"; }), ue = _.length > 0 ? "{key: someKey, " + _.join(": ..., ") + ": ...}" : "{key: someKey}"; if (!$e[F + ue]) { var ka = _.length > 0 ? "{" + _.join(": ..., ") + ": ...}" : "{}"; b(`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} />`, ue, F, ka, F), $e[F + ue] = !0; } } return e === f ? wa(w) : ya(w), w; } } function ba(e, r, l) { return Fe(e, r, l, !0); } function ja(e, r, l) { return Fe(e, r, l, !1); } var Ea = ja, Ra = ba; J.Fragment = f, J.jsx = Ea, J.jsxs = Ra; }()), J; } process.env.NODE_ENV === "production" ? me.exports = Na() : me.exports = Ca(); var t = me.exports, Ve = { color: void 0, size: void 0, className: void 0, style: void 0, attr: void 0 }, We = k.createContext && /* @__PURE__ */ k.createContext(Ve), Oa = ["attr", "size", "title"]; function Pa(a, i) { if (a == null) return {}; var s = Sa(a, i), f, n; if (Object.getOwnPropertySymbols) { var h = Object.getOwnPropertySymbols(a); for (n = 0; n < h.length; n++) f = h[n], !(i.indexOf(f) >= 0) && Object.prototype.propertyIsEnumerable.call(a, f) && (s[f] = a[f]); } return s; } function Sa(a, i) { if (a == null) return {}; var s = {}; for (var f in a) if (Object.prototype.hasOwnProperty.call(a, f)) { if (i.indexOf(f) >= 0) continue; s[f] = a[f]; } return s; } function ae() { return ae = Object.assign ? Object.assign.bind() : function(a) { for (var i = 1; i < arguments.length; i++) { var s = arguments[i]; for (var f in s) Object.prototype.hasOwnProperty.call(s, f) && (a[f] = s[f]); } return a; }, ae.apply(this, arguments); } function Me(a, i) { var s = Object.keys(a); if (Object.getOwnPropertySymbols) { var f = Object.getOwnPropertySymbols(a); i && (f = f.filter(function(n) { return Object.getOwnPropertyDescriptor(a, n).enumerable; })), s.push.apply(s, f); } return s; } function te(a) { for (var i = 1; i < arguments.length; i++) { var s = arguments[i] != null ? arguments[i] : {}; i % 2 ? Me(Object(s), !0).forEach(function(f) { Ta(a, f, s[f]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(s)) : Me(Object(s)).forEach(function(f) { Object.defineProperty(a, f, Object.getOwnPropertyDescriptor(s, f)); }); } return a; } function Ta(a, i, s) { return i = La(i), i in a ? Object.defineProperty(a, i, { value: s, enumerable: !0, configurable: !0, writable: !0 }) : a[i] = s, a; } function La(a) { var i = Aa(a, "string"); return typeof i == "symbol" ? i : i + ""; } function Aa(a, i) { if (typeof a != "object" || !a) return a; var s = a[Symbol.toPrimitive]; if (s !== void 0) { var f = s.call(a, i || "default"); if (typeof f != "object") return f; throw new TypeError("@@toPrimitive must return a primitive value."); } return (i === "string" ? String : Number)(a); } function Ye(a) { return a && a.map((i, s) => /* @__PURE__ */ k.createElement(i.tag, te({ key: s }, i.attr), Ye(i.child))); } function C(a) { return (i) => /* @__PURE__ */ k.createElement(Da, ae({ attr: te({}, a.attr) }, i), Ye(a.child)); } function Da(a) { var i = (s) => { var { attr: f, size: n, title: h } = a, o = Pa(a, Oa), p = n || s.size || "1em", g; return s.className && (g = s.className), a.className && (g = (g ? g + " " : "") + a.className), /* @__PURE__ */ k.createElement("svg", ae({ stroke: "currentColor", fill: "currentColor", strokeWidth: "0" }, s.attr, f, o, { className: g, style: te(te({ color: a.color || s.color }, s.style), a.style), height: p, width: p, xmlns: "http://www.w3.org/2000/svg" }), h && /* @__PURE__ */ k.createElement("title", null, h), a.children); }; return We !== void 0 ? /* @__PURE__ */ k.createElement(We.Consumer, null, (s) => i(s)) : i(Ve); } function Ia(a) { return C({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M21.822 7.431A1 1 0 0 0 21 7H7.333L6.179 4.23A1.994 1.994 0 0 0 4.333 3H2v2h2.333l4.744 11.385A1 1 0 0 0 10 17h8c.417 0 .79-.259.937-.648l3-8a1 1 0 0 0-.115-.921zM17.307 15h-6.64l-2.5-6h11.39l-2.25 6z" }, child: [] }, { tag: "circle", attr: { cx: "10.5", cy: "19.5", r: "1.5" }, child: [] }, { tag: "circle", attr: { cx: "17.5", cy: "19.5", r: "1.5" }, child: [] }] })(a); } function $a(a) { return C({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M20 2H10c-1.103 0-2 .897-2 2v4H4c-1.103 0-2 .897-2 2v10c0 1.103.897 2 2 2h10c1.103 0 2-.897 2-2v-4h4c1.103 0 2-.897 2-2V4c0-1.103-.897-2-2-2zM4 20V10h10l.002 10H4zm16-6h-4v-4c0-1.103-.897-2-2-2h-4V4h10v10z" }, child: [] }] })(a); } function de(a) { return C({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M15.999 8.5h2c0-2.837-2.755-4.131-5-4.429V2h-2v2.071c-2.245.298-5 1.592-5 4.429 0 2.706 2.666 4.113 5 4.43v4.97c-1.448-.251-3-1.024-3-2.4h-2c0 2.589 2.425 4.119 5 4.436V22h2v-2.07c2.245-.298 5-1.593 5-4.43s-2.755-4.131-5-4.429V6.1c1.33.239 3 .941 3 2.4zm-8 0c0-1.459 1.67-2.161 3-2.4v4.799c-1.371-.253-3-1.002-3-2.399zm8 7c0 1.459-1.67 2.161-3 2.4v-4.8c1.33.239 3 .941 3 2.4z" }, child: [] }] })(a); } function Fa(a) { return C({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M12 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zM6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" }, child: [] }] })(a); } function za(a) { return C({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M20.978 13.21a1 1 0 0 0-.396-1.024l-14-10a.999.999 0 0 0-1.575.931l2 17a1 1 0 0 0 1.767.516l3.612-4.416 3.377 5.46 1.701-1.052-3.357-5.428 6.089-1.218a.995.995 0 0 0 .782-.769zm-8.674.31a1 1 0 0 0-.578.347l-3.008 3.677L7.257 5.127l10.283 7.345-5.236 1.048z" }, child: [] }] })(a); } function Ba(a) { return C({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "m16.192 6.344-4.243 4.242-4.242-4.242-1.414 1.414L10.535 12l-4.242 4.242 1.414 1.414 4.242-4.242 4.243 4.242 1.414-1.414L13.364 12l4.242-4.242z" }, child: [] }] })(a); } const L = ({ children: a, leftIcon: i, rightIcon: s, ...f }) => /* @__PURE__ */ t.jsxs("button", { className: "af-h-9 af-px-4 af-py-2 af-border af-flex af-justify-center af-items-center af-font-medium af-rounded-md af-text-sm hover:af-bg-gray-100 disabled:af-pointer-events-none disabled:af-opacity-50 af-transition-colors", ...f, children: [ i && /* @__PURE__ */ t.jsx("div", { className: "af-mr-3", children: i }), a, s && /* @__PURE__ */ t.jsx("div", { className: "af-ml-3", children: s }) ] }), H = k.forwardRef(({ ...a }, i) => /* @__PURE__ */ t.jsx("input", { ref: i, className: "af-h-9 af-w-full af-flex af-border af-px-3 af-py-1 af-text-sm af-shadow-sm af-rounded-md placeholder:text-muted-foreground focus-visible:af-outline-none disabled:af-cursor-not-allowed disabled:af-opacity-50", ...a })), W = ({ icon: a, title: i, text: s }) => /* @__PURE__ */ t.jsxs("div", { className: "af-flex af-items-center af-space-x-3 af-bg-gray-100 af-px-4 af-py-2 af-rounded-md", children: [ a, /* @__PURE__ */ t.jsxs("div", { className: "af-flex af-flex-col af-items-start", children: [ /* @__PURE__ */ t.jsx("p", { className: "af-text-sm af-text-gray-700 af-font-medium", children: i }), /* @__PURE__ */ t.jsx("span", { className: "af-font-semibold af-text-lg af-text-gray-700 af-break-all", children: s }) ] }) ] }), Wa = ({ status: a }) => { if (a === null) return /* @__PURE__ */ t.jsx("div", { className: "af-bg-gray-200 text-green-950 af-rounded-full af-px-2 af-py-1 af-text-xs af-font-medium", children: "Not Approved Yet" }); if (a) return /* @__PURE__ */ t.jsx("div", { className: "af-bg-green-300 text-green-950 af-rounded-full af-px-2 af-py-1 af-text-xs af-font-medium", children: "Active" }); if (!a) return /* @__PURE__ */ t.jsx("div", { className: "af-bg-red-300 text-green-950 af-rounded-full af-px-2 af-py-1 af-text-xs af-font-medium", children: "Rejected" }); }; function pe(a) { return C({ tag: "svg", attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z" }, child: [] }] })(a); } function Ma(a) { return C({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z" }, child: [] }] })(a); } function Z(a) { return C({ tag: "svg", attr: { viewBox: "0 0 320 512" }, child: [{ tag: "path", attr: { d: "M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z" }, child: [] }] })(a); } function Va(a) { return C({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M256,8C119,8,8,119,8,256S119,504,256,504,504,393,504,256,393,8,256,8Zm92.49,313h0l-20,25a16,16,0,0,1-22.49,2.5h0l-67-49.72a40,40,0,0,1-15-31.23V112a16,16,0,0,1,16-16h32a16,16,0,0,1,16,16V256l58,42.5A16,16,0,0,1,348.49,321Z" }, child: [] }] })(a); } function Ya(a) { return C({ tag: "svg", attr: { viewBox: "0 0 384 512" }, child: [{ tag: "path", attr: { d: "M109.25 173.25c24.99-24.99 24.99-65.52 0-90.51-24.99-24.99-65.52-24.99-90.51 0-24.99 24.99-24.99 65.52 0 90.51 25 25 65.52 25 90.51 0zm256 165.49c-24.99-24.99-65.52-24.99-90.51 0-24.99 24.99-24.99 65.52 0 90.51 24.99 24.99 65.52 24.99 90.51 0 25-24.99 25-65.51 0-90.51zm-1.94-231.43l-22.62-22.62c-12.5-12.5-32.76-12.5-45.25 0L20.69 359.44c-12.5 12.5-12.5 32.76 0 45.25l22.62 22.62c12.5 12.5 32.76 12.5 45.25 0l274.75-274.75c12.5-12.49 12.5-32.75 0-45.25z" }, child: [] }] })(a); } function Ua(a) { return C({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M323.9 19.81l-55.2 55.15L285 91.24 272.2 104 256 87.73 19.81 323.9l45.57 45.6c28.5-14.6 56.22-11.7 72.52 4.6 16.3 16.3 19.2 44 4.6 72.5l45.6 45.6 236.1-236.1-16.2-16.3 12.8-12.8 16.3 16.2 55.1-55.1-45.6-45.6c-28.5 14.6-56.2 11.7-72.5-4.6-16.3-16.3-19.2-44.02-4.6-72.52zm-16.2 93.99l33.9 34-12.8 12.8-33.9-34zM256 130.2L381.8 256 222.1 415.8 96.16 289.9 249.6 136.5zm0 25.4L121.6 289.9l100.5 100.5L356.4 256zm108.2 14.8l34 33.9-12.8 12.8-34-33.9z" }, child: [] }] })(a); } function Ue(a) { let i = typeof a != "string" ? JSON.stringify(a) : a; try { i = JSON.parse(i); } catch { return !1; } return typeof i == "object" && i !== null; } function Ja(a, i, s) { try { if (!a.startsWith("http://") && !a.startsWith("https://") && (a = `https://${a}`), !a.includes(".")) throw new Error(); const f = new URL(a); return f.searchParams.has(i) ? a : (f.searchParams.append(i, s), f.href); } catch { return "Please enter a valid URL!"; } } function Q(a) { return 0 .toLocaleString( "en-US", { style: "currency", currency: a, minimumFractionDigits: 0, maximumFractionDigits: 0 } ).replace(/\d/g, "").trim(); } async function Ha(a) { const i = await fetch(`https://api.afficone.com/v1/public/portal/${a}`); if (i.status === 200) return await i.json(); throw new Error(await i.text()); } async function ee(a) { if (!a) throw new Error("authToken is undefined."); const i = await fetch("https://api.afficone.com/affiliate/profile", { headers: { Authorization: `Bearer ${a}` } }); if (i.status === 200) return await i.json(); throw new Error(await i.text()); } function Ga() { localStorage.removeItem("afficoneAuthToken"); } async function Ka({ token: a, name: i, email: s, password: f, turnstileToken: n }) { if (!a) return { type: "error", value: "No website token supplied." }; if (n === null) return { type: "error", value: "Captcha didn't initialize properly. Please try again." }; if (!i || !s || !f || i.length === 0 || s.length === 0 || f.length === 0) return { type: "error", value: "Please enter your name, email and password." }; const h = await fetch("https://api.afficone.com/affiliate/signup", { method: "post", body: JSON.stringify({ websiteToken: a, name: i, email: s, password: f, promos: !1, token: n }), headers: { "Content-Type": "application/json" } }); if (h.status === 202) { const p = await h.text(); return console.log(p), { type: "verification", value: "Please verify your email." }; } if (h.status === 200) return { type: "success", value: await h.text() }; const o = await h.text(); return Ue(o) ? { type: "error", value: JSON.parse(o).status } : { type: "error", value: o }; } async function qa({ token: a, email: i, password: s, turnstileToken: f }) { if (!a) return { type: "error", value: "Captcha didn't initialize properly. Try reloading your browser." }; if (f === null) return { type: "error", value: "Captcha didn't initialize properly. Try reloading your browser." }; if (!i || !s || i.length === 0 || s.length === 0) return { type: "error", value: "Please enter your email and password." }; const n = await fetch("https://api.afficone.com/affiliate/signin", { method: "post", body: JSON.stringify({ websiteToken: a, email: i, password: s, token: f }), headers: { "Content-Type": "application/json" } }); if (n.status === 200) { const o = await n.text(); return localStorage.setItem("afficoneAuthToken", o), { type: "success", value: o }; } const h = await n.text(); return Ue(h) ? { type: "error", value: JSON.parse(h).status } : { type: "error", value: h }; } const Za = ({ authToken: a, token: i, options: s = { containerShadow: !0, showLogoInHeader: !0, showDescription: !0, showCallous: !0, showInfoCards: !0 } }) => { var S, I; function f() { Ga(), h({ ...n, loaded: !0, authToken: void 0, profile: null }), p({ ...o, type: "choice" }); } const [n, h] = k.useState({ loaded: !1, msg: null, authToken: a, portal: null, profile: null }), [o, p] = k.useState({ type: "choice", name: "", email: ((S = s.defaultLogin) == null ? void 0 : S.email) ?? "", password: ((I = s.defaultLogin) == null ? void 0 : I.password) ?? "", promos: !0, tos: !1, turnstile: null, error: null, affLink: "" }); k.useEffect(() => { const u = (E) => { const D = E.data; if (D.startsWith("affi_")) { const P = D.replace("affi_", ""); p({ ...o, turnstile: P }); } }; return window.addEventListener("message", (E) => u(E)), () => window.removeEventListener("message", u); }, [o]), k.useEffect(() => { if (n.loaded) return; async function u() { let E = null; if (n.authToken) E = await ee(n.authToken); else { const P = localStorage.getItem("afficoneAuthToken"); P !== null && (E = await ee(P)); } const D = await Ha(i); h({ ...n, loaded: !0, portal: D, profile: E }), E !== null && p({ ...o, type: "dashboard", name: "", email: "", password: "", turnstile: null, error: null, affLink: D.url.includes(window.location.host) ? `https://${window.location.host}` : D.url }); } u(); }, []); const g = k.useRef(null); if (!n.loaded || n.portal === null) return /* @__PURE__ */ t.jsx("div", { className: `af-flex af-justify-center af-text-black af-items-center af-bg-white af-w-96 af-h-128 af-rounded-lg${s.containerShadow ? " af-shadow" : ""}`, children: (s == null ? void 0 : s.loadingAnimation) ?? /* @__PURE__ */ t.jsx( "svg", { xmlns: "http://www.w3.org/2000/svg", width: 32, height: 32, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "af-animate-spin", children: /* @__PURE__ */ t.jsx("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) } ) }); if (!n.portal.active && !n.portal.demo) return /* @__PURE__ */ t.jsx("div", { className: `af-bg-white af-text-black af-w-96 af-h-128 af-rounded-lg${s.containerShadow ? " af-shadow" : ""}`, children: /* @__PURE__ */ t.jsxs("div", { className: "af-flex af-flex-col af-h-full af-justify-center af-items-center", children: [ /* @__PURE__ */ t.jsx(Ba, { className: "af-text-4xl af-mb-4" }), /* @__PURE__ */ t.jsx("p", { className: "af-text-center af-text-lg af-px-16", children: "We are currently not accepting new applications" }) ] }) }); if (n.msg !== null) return /* @__PURE__ */ t.jsx("div", { className: `af-bg-white af-text-black af-w-96 af-h-128 af-rounded-lg${s.containerShadow ? " af-shadow" : ""}`, children: /* @__PURE__ */ t.jsxs("div", { className: "af-flex af-flex-col af-space-y-4 af-h-full af-justify-center af-items-center", children: [ /* @__PURE__ */ t.jsx(Fa, { className: "af-text-4xl" }), /* @__PURE__ */ t.jsx("p", { className: "af-text-center af-text-lg af-px-16", children: n.msg }), /* @__PURE__ */ t.jsx(L, { leftIcon: /* @__PURE__ */ t.jsx(Z, {}), onClick: () => { p({ ...o, type: "signin" }), h({ ...n, msg: null }); }, children: "Back to login" }) ] }) }); async function A() { h({ ...n, loaded: !1 }); const u = await qa({ token: i, email: o.email, password: o.password, turnstileToken: o.turnstile }); if (u.type === "error") { p({ ...o, error: u.value }), h({ ...n, loaded: !0 }); return; } h({ ...n, authToken: a, loaded: !0, profile: await ee(u.value) }), p({ ...o, type: "dashboard", affLink: n.portal.url.includes(window.location.host) ? `https://${window.location.host}` : n.portal.url, name: "", email: "", password: "", tos: !1, promos: !0, turnstile: null, error: null }); } async function j() { h({ ...n, loaded: !1 }); const u = await Ka({ token: i, name: o.name, email: o.email, password: o.password, turnstileToken: o.turnstile }); if (u.type === "error") { p({ ...o, error: u.value }), h({ ...n, loaded: !0 }); return; } if (u.type === "verification") { h({ ...n, msg: u.value }); return; } h({ ...n, authToken: a, loaded: !0, profile: await ee(u.value) }), p({ ...o, type: "dashboard", affLink: n.portal.url.includes(window.location.host) ? `https://${window.location.host}` : n.portal.url, name: "", email: "", password: "", tos: !1, promos: !0, turnstile: null, error: null }); } if (n.profile === null) return /* @__PURE__ */ t.jsx("div", { className: `af-bg-white af-text-black af-w-96 af-h-128 af-rounded-lg af-overflow-hidden${s.containerShadow ? " af-shadow" : ""}`, children: o.type === "choice" ? /* @__PURE__ */ t.jsxs("div", { className: "af-relative af-flex af-flex-col af-h-full", children: [ /* @__PURE__ */ t.jsx("div", { style: { background: n.portal.media.background.useImage ? `url(${n.portal.media.background.image})` : n.portal.media.background.color, backgroundRepeat: n.portal.media.background.backgroundRepeat, backgroundSize: n.portal.media.background.backgroundSize }, className: "af-h-1/4" }), /* @__PURE__ */ t.jsxs("div", { className: "af-h-3/4 af-p-4 af-flex af-flex-col af-space-y-2 af-items-center af-text-center", children: [ /* @__PURE__ */ t.jsxs("div", { className: "af-flex af-items-center af-space-x-2", children: [ n.portal.media.logo && /* @__PURE__ */ t.jsx( "img", { alt: "", src: n.portal.media.logo, className: "af-rounded-md", width: 32, height: 32 } ), /* @__PURE__ */ t.jsx("p", { className: "af-text-2xl af-font-semibold", children: n.portal.name }) ] }), /* @__PURE__ */ t.jsxs("div", { className: "af-flex af-flex-col af-w-full af-h-full", children: [ /* @__PURE__ */ t.jsxs("div", { className: "af-flex af-flex-col af-space-y-4 af-flex-1", children: [ s.showDescription !== !1 && /* @__PURE__ */ t.jsx("p", { className: "af-text-lg af-font-medium", children: n.portal.description }), s.customContent, s.showInfoCards !== !1 && /* @__PURE__ */ t.jsxs("div", { className: "af-grid af-grid-cols-2 af-gap-4", children: [ /* @__PURE__ */ t.jsx( W, { icon: /* @__PURE__ */ t.jsx(de, {}), title: "Minimum Payout", text: n.portal.minimumBalance } ), /* @__PURE__ */ t.jsx( W, { icon: /* @__PURE__ */ t.jsx(Ya, {}), title: "Commission", text: n.portal.commissions.type === 0 ? `${n.portal.commissions.amount}%` : n.portal.commissions.applyIndividual ? `${n.portal.commissions.amount} / item` : `${Q(n.portal.currency)}${n.portal.commissions.amount}` } ) ] }), s.showCallous !== !1 && /* @__PURE__ */ t.jsx("div", { className: "af-flex af-flex-col af-items-start text-start af-space-y-1", children: n.portal.callouts.map((u, E) => /* @__PURE__ */ t.jsx("li", { children: u }, E)) }) ] }), n.portal.useWatermark ? /* @__PURE__ */ t.jsxs("div", { className: "af-flex af-items-end af-justify-between", children: [ /* @__PURE__ */ t.jsxs("div", { className: "af-flex af-flex-col af-items-start af-space-y-1", children: [ /* @__PURE__ */ t.jsx("span", { className: "af-text-xs af-font-semibold", children: "Powered by" }), /* @__PURE__ */ t.jsx( "img", { alt: "Afficone logo", src: "https://api.afficone.com/cdn/static/header.png", className: "af-h-5" } ) ] }), /* @__PURE__ */ t.jsx( L, { onClick: () => p({ ...o, type: "signin" }), rightIcon: /* @__PURE__ */ t.jsx(pe, {}), children: "Continue" } ) ] }) : /* @__PURE__ */ t.jsx("div", { className: "af-flex af-items-end af-justify-end", children: /* @__PURE__ */ t.jsx( L, { onClick: () => p({ ...o, type: "signin" }), rightIcon: /* @__PURE__ */ t.jsx(pe, {}), children: "Continue" } ) }) ] }) ] }) ] }) : /* @__PURE__ */ t.jsxs("div", { className: "af-flex af-flex-col af-items-stretch af-h-full", children: [ /* @__PURE__ */ t.jsxs("div", { className: "affi-header af-w-full af-flex af-items-center af-justify-between af-p-4", children: [ /* @__PURE__ */ t.jsxs("div", { className: "af-flex af-items-center af-space-x-2", children: [ /* @__PURE__ */ t.jsx( L, { onClick: () => p({ ...o, type: "choice", error: null }), className: "hover:af-bg-gray-100 af-rounded-md af-p-1 af-border-none af-transition-colors me-2", children: /* @__PURE__ */ t.jsx(Z, { className: "af-text-sm" }) } ), s.showLogoInHeader !== !1 && n.portal.media.logo && /* @__PURE__ */ t.jsx("img", { alt: "", src: n.portal.media.logo, width: 26, height: 26 }), /* @__PURE__ */ t.jsx("p", { className: "af-text-xl af-font-semibold", children: o.type === "signin" ? "Welcome back" : "Create an account" }) ] }), /* @__PURE__ */ t.jsx("div", { className: "af-bg-green-300 text-green-950 af-rounded-full af-px-2 af-py-1 af-text-xs af-font-medium", children: "Active" }) ] }), /* @__PURE__ */ t.jsxs("div", { className: "affi-main af-flex af-flex-col af-space-y-3 af-flex-1 af-px-4 af-overflow-auto", children: [ o.type === "signup" && /* @__PURE__ */ t.jsxs("div", { className: "af-flex af-flex-col af-space-y-2", children: [ /* @__PURE__ */ t.jsx("p", { className: "af-text-sm", children: "Name" }), /* @__PURE__ */ t.jsx( H, { placeholder: "Name", value: o.name, onChange: (u) => p({ ...o, name: u.target.value }) } ) ] }), /* @__PURE__ */ t.jsxs("div", { className: "af-flex af-flex-col af-space-y-2", children: [ /* @__PURE__ */ t.jsx("p", { className: "af-text-sm", children: "Email" }), /* @__PURE__ */ t.jsx( H, { placeholder: "Email", value: o.email, onChange: (u) => p({ ...o, email: u.target.value }) } ) ] }), /* @__PURE__ */ t.jsxs("div", { className: "af-flex af-flex-col af-space-y-2", children: [ /* @__PURE__ */ t.jsx("p", { className: "af-text-sm", children: "Password" }), /* @__PURE__ */ t.jsx( H, { placeholder: "••••••••", type: "password", value: o.password, onChange: (u) => p({ ...o, password: u.target.value }) } ) ] }), o.type === "signup" && /* @__PURE__ */ t.jsxs("div", { className: "af-flex af-space-x-2", children: [ /* @__PURE__ */ t.jsx( H, { id: "tos", className: "", type: "checkbox", value: o.email, onChange: (u) => p({ ...o, tos: u.target.checked }) } ), /* @__PURE__ */ t.jsx("label", { htmlFor: "tos", className: "af-text-sm af-select-none", children: "I agree to the Terms of Service" }) ] }), o.error && /* @__PURE__ */ t.jsx("p", { className: "af-font-medium af-text-red-500", children: o.error }), /* @__PURE__ */ t.jsx("iframe", { width: 300, height: 65, src: "https://afficone.com/turnstile-iframe" }) ] }), /* @__PURE__ */ t.jsxs("div", { className: "affi-footer af-w-full af-flex af-items-center af-justify-between af-p-4", children: [ /* @__PURE__ */ t.jsx("button", { onClick: () => p({ ...o, type: o.type === "signin" ? "signup" : "signin", error: null }), className: "text-md af-font-medium", children: o.type === "signin" ? "Don't have an account?" : "Have an account?" }), /* @__PURE__ */ t.jsx( L, { disabled: o.type === "signup" && (o.name.length === 0 || !o.tos) || o.password.length === 0 || !/^([\w.-]+)@([\w-]+)((\.(\w){2,})+)$/.test(o.email), onClick: o.type === "signin" ? A : j, rightIcon: /* @__PURE__ */ t.jsx(pe, {}), children: "Continue" } ) ] }) ] }) }); async function O() { const u = Ja(o.affLink, n.portal.trackingParameter, n.profile.coupon); await navigator.clipboard.writeText(u), g.current.focus(), p({ ...o, affLink: u }), g.current.select(); } return /* @__PURE__ */ t.jsx("div", { className: `af-bg-white af-text-black af-w-96 af-h-128 af-rounded-lg af-overflow-hidden${s.containerShadow ? " af-shadow" : ""}`, children: /* @__PURE__ */ t.jsxs("div", { className: "af-flex af-flex-col af-items-stretch af-h-full", children: [ /* @__PURE__ */ t.jsxs("div", { className: "affi-header af-w-full af-flex af-items-center af-justify-between af-p-4", children: [ /* @__PURE__ */ t.jsx( L, { onClick: o.type === "dashboard" ? f : () => p({ ...o, type: "dashboard" }), className: "hover:af-bg-gray-100 af-rounded-md af-p-1 af-border-none af-transition-colors", children: /* @__PURE__ */ t.jsx(Z, { className: "af-text-sm" }) } ), /* @__PURE__ */ t.jsxs("div", { className: "af-flex af-items-center af-space-x-2", children: [ s.showLogoInHeader !== !1 && n.portal.media.logo && /* @__PURE__ */ t.jsx("img", { alt: "", src: n.portal.media.logo, width: 26, height: 26 }