@apolitical/component-library 1.4.0 → 1.4.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +10 -10
- package/index.mjs +169 -165
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -392,7 +392,7 @@ function Lg() {
|
|
|
392
392
|
}
|
|
393
393
|
}
|
|
394
394
|
}
|
|
395
|
-
var w = l, P = f, F = a, M = s,
|
|
395
|
+
var w = l, P = f, F = a, M = s, q = t, G = u, W = r, H = p, z = c, ie = n, Y = i, k = o, V = h, X = !1;
|
|
396
396
|
function de(ee) {
|
|
397
397
|
return X || (X = !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.")), Q(ee) || x(ee) === l;
|
|
398
398
|
}
|
|
@@ -432,7 +432,7 @@ function Lg() {
|
|
|
432
432
|
function Tt(ee) {
|
|
433
433
|
return x(ee) === h;
|
|
434
434
|
}
|
|
435
|
-
Ce.AsyncMode = w, Ce.ConcurrentMode = P, Ce.ContextConsumer = F, Ce.ContextProvider = M, Ce.Element =
|
|
435
|
+
Ce.AsyncMode = w, Ce.ConcurrentMode = P, Ce.ContextConsumer = F, Ce.ContextProvider = M, Ce.Element = q, Ce.ForwardRef = G, Ce.Fragment = W, Ce.Lazy = H, Ce.Memo = z, Ce.Portal = ie, Ce.Profiler = Y, Ce.StrictMode = k, Ce.Suspense = V, Ce.isAsyncMode = de, Ce.isConcurrentMode = Q, Ce.isContextConsumer = Z, Ce.isContextProvider = ue, Ce.isElement = ce, Ce.isForwardRef = Ye, Ce.isFragment = K, Ce.isLazy = te, Ce.isMemo = Ie, Ce.isPortal = Ae, Ce.isProfiler = ct, Ce.isStrictMode = dt, Ce.isSuspense = Tt, Ce.isValidElementType = b, Ce.typeOf = x;
|
|
436
436
|
}()), Ce;
|
|
437
437
|
}
|
|
438
438
|
process.env.NODE_ENV === "production" ? Ys.exports = Pg() : Ys.exports = Lg();
|
|
@@ -573,12 +573,12 @@ function Ze() {
|
|
|
573
573
|
F(arguments[X], V);
|
|
574
574
|
return k;
|
|
575
575
|
}
|
|
576
|
-
function
|
|
576
|
+
function q(k, V, X) {
|
|
577
577
|
return F(V, function(Q, Z) {
|
|
578
578
|
X && typeof Q == "function" ? k[Z] = e(Q, X) : k[Z] = Q;
|
|
579
579
|
}), k;
|
|
580
580
|
}
|
|
581
|
-
function
|
|
581
|
+
function G(k) {
|
|
582
582
|
return k.charCodeAt(0) === 65279 && (k = k.slice(1)), k;
|
|
583
583
|
}
|
|
584
584
|
function W(k, V, X, de) {
|
|
@@ -634,9 +634,9 @@ function Ze() {
|
|
|
634
634
|
isStandardBrowserEnv: P,
|
|
635
635
|
forEach: F,
|
|
636
636
|
merge: M,
|
|
637
|
-
extend:
|
|
637
|
+
extend: q,
|
|
638
638
|
trim: w,
|
|
639
|
-
stripBOM:
|
|
639
|
+
stripBOM: G,
|
|
640
640
|
inherits: W,
|
|
641
641
|
toFlatObject: H,
|
|
642
642
|
kindOf: n,
|
|
@@ -1005,7 +1005,7 @@ function Ac() {
|
|
|
1005
1005
|
}
|
|
1006
1006
|
var M = o(d.baseURL, d.url);
|
|
1007
1007
|
w.open(d.method.toUpperCase(), r(M, d.params, d.paramsSerializer), !0), w.timeout = d.timeout;
|
|
1008
|
-
function
|
|
1008
|
+
function q() {
|
|
1009
1009
|
if (w) {
|
|
1010
1010
|
var H = "getAllResponseHeaders" in w ? i(w.getAllResponseHeaders()) : null, z = !_ || _ === "text" || _ === "json" ? w.responseText : w.response, ie = {
|
|
1011
1011
|
data: z,
|
|
@@ -1022,8 +1022,8 @@ function Ac() {
|
|
|
1022
1022
|
}, ie), w = null;
|
|
1023
1023
|
}
|
|
1024
1024
|
}
|
|
1025
|
-
if ("onloadend" in w ? w.onloadend =
|
|
1026
|
-
!w || w.readyState !== 4 || w.status === 0 && !(w.responseURL && w.responseURL.indexOf("file:") === 0) || setTimeout(
|
|
1025
|
+
if ("onloadend" in w ? w.onloadend = q : w.onreadystatechange = function() {
|
|
1026
|
+
!w || w.readyState !== 4 || w.status === 0 && !(w.responseURL && w.responseURL.indexOf("file:") === 0) || setTimeout(q);
|
|
1027
1027
|
}, w.onabort = function() {
|
|
1028
1028
|
w && (m(new l("Request aborted", l.ECONNABORTED, d, w)), w = null);
|
|
1029
1029
|
}, w.onerror = function() {
|
|
@@ -1037,8 +1037,8 @@ function Ac() {
|
|
|
1037
1037
|
w
|
|
1038
1038
|
)), w = null;
|
|
1039
1039
|
}, e.isStandardBrowserEnv()) {
|
|
1040
|
-
var
|
|
1041
|
-
|
|
1040
|
+
var G = (d.withCredentials || s(M)) && d.xsrfCookieName ? n.read(d.xsrfCookieName) : void 0;
|
|
1041
|
+
G && (T[d.xsrfHeaderName] = G);
|
|
1042
1042
|
}
|
|
1043
1043
|
"setRequestHeader" in w && e.forEach(T, function(z, ie) {
|
|
1044
1044
|
typeof E > "u" && ie.toLowerCase() === "content-type" ? delete T[ie] : w.setRequestHeader(ie, z);
|
|
@@ -2058,7 +2058,7 @@ var Xs = Wy, tl = Xs.custom, rl = th(tl) ? tl : null, tv = function e(t, n, r, o
|
|
|
2058
2058
|
if (ov(t))
|
|
2059
2059
|
return yi(d(String(t)));
|
|
2060
2060
|
if (!nv(t) && !nl(t)) {
|
|
2061
|
-
var F = co(t, d), M = Zc ? Zc(t) === Object.prototype : t instanceof Object || t.constructor === Object,
|
|
2061
|
+
var F = co(t, d), M = Zc ? Zc(t) === Object.prototype : t instanceof Object || t.constructor === Object, q = t instanceof Object ? "" : "null prototype", G = !M && rt && Object(t) === t && rt in t ? Pu.call(Sr(t), 8, -1) : q ? "Object" : "", W = M || typeof t.constructor != "function" ? "" : t.constructor.name ? t.constructor.name + " " : "", H = W + (G || q ? "[" + jt.call(Xc.call([], G || [], q || []), ": ") + "] " : "");
|
|
2062
2062
|
return F.length === 0 ? H + "{}" : h ? H + "{" + Zs(F, h) + "}" : H + "{ " + jt.call(F, ", ") + " }";
|
|
2063
2063
|
}
|
|
2064
2064
|
return String(t);
|
|
@@ -2529,13 +2529,13 @@ var Lu = Ru, Un = jy, Ev = tv, bv = Lu("%TypeError%"), lo = Lu("%WeakMap%", !0),
|
|
|
2529
2529
|
else if (ar(l))
|
|
2530
2530
|
M = l;
|
|
2531
2531
|
else {
|
|
2532
|
-
var
|
|
2533
|
-
M = f ?
|
|
2532
|
+
var q = Object.keys(T);
|
|
2533
|
+
M = f ? q.sort(f) : q;
|
|
2534
2534
|
}
|
|
2535
|
-
for (var
|
|
2535
|
+
for (var G = o && ar(T) && T.length === 1 ? n + "[]" : n, W = 0; W < M.length; ++W) {
|
|
2536
2536
|
var H = M[W], z = typeof H == "object" && typeof H.value < "u" ? H.value : T[H];
|
|
2537
2537
|
if (!(s && z === null)) {
|
|
2538
|
-
var ie = ar(T) ? typeof r == "function" ? r(
|
|
2538
|
+
var ie = ar(T) ? typeof r == "function" ? r(G, H) : G : G + (u ? "." + H : "[" + H + "]");
|
|
2539
2539
|
E.set(t, b);
|
|
2540
2540
|
var Y = ah();
|
|
2541
2541
|
Y.set(Xa, E), sh(F, e(
|
|
@@ -3357,12 +3357,12 @@ function Dn() {
|
|
|
3357
3357
|
function M() {
|
|
3358
3358
|
this._keys = [], this._values = [];
|
|
3359
3359
|
}
|
|
3360
|
-
return M.prototype.has = function(
|
|
3361
|
-
return !!~this._keys.indexOf(
|
|
3362
|
-
}, M.prototype.get = function(
|
|
3363
|
-
return this._values[this._keys.indexOf(
|
|
3364
|
-
}, M.prototype.set = function(
|
|
3365
|
-
this._keys.push(
|
|
3360
|
+
return M.prototype.has = function(q) {
|
|
3361
|
+
return !!~this._keys.indexOf(q);
|
|
3362
|
+
}, M.prototype.get = function(q) {
|
|
3363
|
+
return this._values[this._keys.indexOf(q)];
|
|
3364
|
+
}, M.prototype.set = function(q, G) {
|
|
3365
|
+
this._keys.push(q), this._values.push(G);
|
|
3366
3366
|
}, M;
|
|
3367
3367
|
}()
|
|
3368
3368
|
);
|
|
@@ -3370,41 +3370,41 @@ function Dn() {
|
|
|
3370
3370
|
return new F();
|
|
3371
3371
|
};
|
|
3372
3372
|
}(), m = function(F, M) {
|
|
3373
|
-
var
|
|
3374
|
-
if (!
|
|
3373
|
+
var q = F.__proto__ || l(F);
|
|
3374
|
+
if (!q)
|
|
3375
3375
|
return r(null);
|
|
3376
|
-
var
|
|
3377
|
-
if (
|
|
3378
|
-
return
|
|
3379
|
-
if (~n.call(
|
|
3376
|
+
var G = q.constructor;
|
|
3377
|
+
if (G === M.Object)
|
|
3378
|
+
return q === M.Object.prototype ? {} : r(q);
|
|
3379
|
+
if (~n.call(G).indexOf("[native code]"))
|
|
3380
3380
|
try {
|
|
3381
|
-
return new
|
|
3381
|
+
return new G();
|
|
3382
3382
|
} catch {
|
|
3383
3383
|
}
|
|
3384
|
-
return r(
|
|
3385
|
-
}, E = function(F, M,
|
|
3384
|
+
return r(q);
|
|
3385
|
+
}, E = function(F, M, q, G) {
|
|
3386
3386
|
var W = m(F, M);
|
|
3387
|
-
|
|
3387
|
+
G.set(F, W);
|
|
3388
3388
|
for (var H in F)
|
|
3389
|
-
u.call(F, H) && (W[H] =
|
|
3389
|
+
u.call(F, H) && (W[H] = q(F[H], G));
|
|
3390
3390
|
if (d)
|
|
3391
3391
|
for (var z = a(F), ie = 0, Y = z.length, k = void 0; ie < Y; ++ie)
|
|
3392
|
-
k = z[ie], h.call(F, k) && (W[k] =
|
|
3392
|
+
k = z[ie], h.call(F, k) && (W[k] = q(F[k], G));
|
|
3393
3393
|
return W;
|
|
3394
|
-
}, T = function(F, M,
|
|
3394
|
+
}, T = function(F, M, q, G) {
|
|
3395
3395
|
var W = m(F, M);
|
|
3396
|
-
|
|
3396
|
+
G.set(F, W);
|
|
3397
3397
|
for (var H = d ? s(F).concat(a(F)) : s(F), z = 0, ie = H.length, Y = void 0, k = void 0; z < ie; ++z)
|
|
3398
3398
|
if (Y = H[z], Y !== "callee" && Y !== "caller")
|
|
3399
3399
|
if (k = i(F, Y), k) {
|
|
3400
|
-
!k.get && !k.set && (k.value =
|
|
3400
|
+
!k.get && !k.set && (k.value = q(F[Y], G));
|
|
3401
3401
|
try {
|
|
3402
3402
|
o(W, Y, k);
|
|
3403
3403
|
} catch {
|
|
3404
3404
|
W[Y] = k.value;
|
|
3405
3405
|
}
|
|
3406
3406
|
} else
|
|
3407
|
-
W[Y] =
|
|
3407
|
+
W[Y] = q(F[Y], G);
|
|
3408
3408
|
return W;
|
|
3409
3409
|
}, _ = function(F) {
|
|
3410
3410
|
var M = "";
|
|
@@ -3413,59 +3413,59 @@ function Dn() {
|
|
|
3413
3413
|
return typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof oe < "u" ? oe : (console && console.error && console.error('Unable to locate global object, returning "this".'), this);
|
|
3414
3414
|
}();
|
|
3415
3415
|
function P(F, M) {
|
|
3416
|
-
var
|
|
3416
|
+
var q = !!(M && M.isStrict), G = M && M.realm || w, W = q ? T : E, H = function(z, ie) {
|
|
3417
3417
|
if (!z || typeof z != "object")
|
|
3418
3418
|
return z;
|
|
3419
3419
|
if (ie.has(z))
|
|
3420
3420
|
return ie.get(z);
|
|
3421
3421
|
var Y = z.__proto__ || x(z), k = Y && Y.constructor;
|
|
3422
|
-
if (!k || k ===
|
|
3423
|
-
return W(z,
|
|
3422
|
+
if (!k || k === G.Object)
|
|
3423
|
+
return W(z, G, H, ie);
|
|
3424
3424
|
var V;
|
|
3425
3425
|
if (b(z)) {
|
|
3426
|
-
if (
|
|
3427
|
-
return T(z,
|
|
3426
|
+
if (q)
|
|
3427
|
+
return T(z, G, H, ie);
|
|
3428
3428
|
V = new k(), ie.set(z, V);
|
|
3429
3429
|
for (var X = 0, de = z.length; X < de; ++X)
|
|
3430
3430
|
V[X] = H(z[X], ie);
|
|
3431
3431
|
return V;
|
|
3432
3432
|
}
|
|
3433
|
-
if (z instanceof
|
|
3433
|
+
if (z instanceof G.Date)
|
|
3434
3434
|
return new k(z.getTime());
|
|
3435
|
-
if (z instanceof
|
|
3435
|
+
if (z instanceof G.RegExp)
|
|
3436
3436
|
return V = new k(z.source, z.flags || _(z)), V.lastIndex = z.lastIndex, V;
|
|
3437
|
-
if (
|
|
3437
|
+
if (G.Map && z instanceof G.Map)
|
|
3438
3438
|
return V = new k(), ie.set(z, V), z.forEach(function(Q, Z) {
|
|
3439
3439
|
V.set(Z, H(Q, ie));
|
|
3440
3440
|
}), V;
|
|
3441
|
-
if (
|
|
3441
|
+
if (G.Set && z instanceof G.Set)
|
|
3442
3442
|
return V = new k(), ie.set(z, V), z.forEach(function(Q) {
|
|
3443
3443
|
V.add(H(Q, ie));
|
|
3444
3444
|
}), V;
|
|
3445
|
-
if (
|
|
3445
|
+
if (G.Blob && z instanceof G.Blob)
|
|
3446
3446
|
return z.slice(0, z.size, z.type);
|
|
3447
|
-
if (
|
|
3448
|
-
return V =
|
|
3449
|
-
if (
|
|
3450
|
-
if (
|
|
3447
|
+
if (G.Buffer && G.Buffer.isBuffer(z))
|
|
3448
|
+
return V = G.Buffer.allocUnsafe ? G.Buffer.allocUnsafe(z.length) : new k(z.length), ie.set(z, V), z.copy(V), V;
|
|
3449
|
+
if (G.ArrayBuffer) {
|
|
3450
|
+
if (G.ArrayBuffer.isView(z))
|
|
3451
3451
|
return V = new k(z.buffer.slice(0)), ie.set(z, V), V;
|
|
3452
|
-
if (z instanceof
|
|
3452
|
+
if (z instanceof G.ArrayBuffer)
|
|
3453
3453
|
return V = z.slice(0), ie.set(z, V), V;
|
|
3454
3454
|
}
|
|
3455
3455
|
return (
|
|
3456
3456
|
// promise-like
|
|
3457
3457
|
typeof z.then == "function" || // errors
|
|
3458
3458
|
z instanceof Error || // weakmaps
|
|
3459
|
-
|
|
3460
|
-
|
|
3459
|
+
G.WeakMap && z instanceof G.WeakMap || // weaksets
|
|
3460
|
+
G.WeakSet && z instanceof G.WeakSet ? z : W(z, G, H, ie)
|
|
3461
3461
|
);
|
|
3462
3462
|
};
|
|
3463
3463
|
return H(F, p());
|
|
3464
3464
|
}
|
|
3465
|
-
return P.default = P, P.strict = function(M,
|
|
3465
|
+
return P.default = P, P.strict = function(M, q) {
|
|
3466
3466
|
return P(M, {
|
|
3467
3467
|
isStrict: !0,
|
|
3468
|
-
realm:
|
|
3468
|
+
realm: q ? q.realm : void 0
|
|
3469
3469
|
});
|
|
3470
3470
|
}, P;
|
|
3471
3471
|
});
|
|
@@ -4028,7 +4028,7 @@ function N_() {
|
|
|
4028
4028
|
wrapAssetKey: F
|
|
4029
4029
|
} = t.default.assetKey, {
|
|
4030
4030
|
wrapLocaleCollection: M
|
|
4031
|
-
} = t.default.locale,
|
|
4031
|
+
} = t.default.locale, q = (K) => {
|
|
4032
4032
|
const te = new Error("The resource could not be found.");
|
|
4033
4033
|
return te.sys = {
|
|
4034
4034
|
type: "Error",
|
|
@@ -4040,7 +4040,7 @@ function N_() {
|
|
|
4040
4040
|
space: c().space
|
|
4041
4041
|
}, te;
|
|
4042
4042
|
};
|
|
4043
|
-
async function
|
|
4043
|
+
async function G() {
|
|
4044
4044
|
Ye(d);
|
|
4045
4045
|
try {
|
|
4046
4046
|
const K = await d.get("/");
|
|
@@ -4073,14 +4073,14 @@ function N_() {
|
|
|
4073
4073
|
async function z(K) {
|
|
4074
4074
|
let te = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
4075
4075
|
if (!K)
|
|
4076
|
-
throw
|
|
4076
|
+
throw q(K);
|
|
4077
4077
|
try {
|
|
4078
4078
|
const Ie = await this.getEntries(a({
|
|
4079
4079
|
"sys.id": K
|
|
4080
4080
|
}, te));
|
|
4081
4081
|
if (Ie.items.length > 0)
|
|
4082
4082
|
return T(Ie.items[0]);
|
|
4083
|
-
throw
|
|
4083
|
+
throw q(K);
|
|
4084
4084
|
} catch (Ie) {
|
|
4085
4085
|
(0, e.errorHandler)(Ie);
|
|
4086
4086
|
}
|
|
@@ -4208,7 +4208,7 @@ function N_() {
|
|
|
4208
4208
|
K.defaults.baseURL = c().spaceBaseUrl;
|
|
4209
4209
|
}
|
|
4210
4210
|
return {
|
|
4211
|
-
getSpace:
|
|
4211
|
+
getSpace: G,
|
|
4212
4212
|
getContentType: W,
|
|
4213
4213
|
getContentTypes: H,
|
|
4214
4214
|
getEntry: z,
|
|
@@ -4455,8 +4455,8 @@ function U_() {
|
|
|
4455
4455
|
return (x, w, P) => {
|
|
4456
4456
|
const F = typeof w == "string" && w.includes(_.arrayFormatSeparator), M = typeof w == "string" && !F && h(w, _).includes(_.arrayFormatSeparator);
|
|
4457
4457
|
w = M ? h(w, _) : w;
|
|
4458
|
-
const
|
|
4459
|
-
P[x] =
|
|
4458
|
+
const q = F || M ? w.split(_.arrayFormatSeparator).map((G) => h(G, _)) : w === null ? w : h(w, _);
|
|
4459
|
+
P[x] = q;
|
|
4460
4460
|
};
|
|
4461
4461
|
case "bracket-separator":
|
|
4462
4462
|
return (x, w, P) => {
|
|
@@ -4465,7 +4465,7 @@ function U_() {
|
|
|
4465
4465
|
P[x] = w && h(w, _);
|
|
4466
4466
|
return;
|
|
4467
4467
|
}
|
|
4468
|
-
const M = w === null ? [] : w.split(_.arrayFormatSeparator).map((
|
|
4468
|
+
const M = w === null ? [] : w.split(_.arrayFormatSeparator).map((q) => h(q, _));
|
|
4469
4469
|
if (P[x] === void 0) {
|
|
4470
4470
|
P[x] = M;
|
|
4471
4471
|
return;
|
|
@@ -4557,8 +4557,8 @@ function U_() {
|
|
|
4557
4557
|
x(M) || (P[M] = _[M]);
|
|
4558
4558
|
const F = Object.keys(P);
|
|
4559
4559
|
return b.sort !== !1 && F.sort(b.sort), F.map((M) => {
|
|
4560
|
-
const
|
|
4561
|
-
return
|
|
4560
|
+
const q = _[M];
|
|
4561
|
+
return q === void 0 ? "" : q === null ? u(M, b) : Array.isArray(q) ? q.length === 0 && b.arrayFormat === "bracket-separator" ? u(M, b) + "[]" : q.reduce(w(M), []).join("&") : u(M, b) + "=" + u(q, b);
|
|
4562
4562
|
}).filter((M) => M.length > 0).join("&");
|
|
4563
4563
|
}, e.parseUrl = (_, b) => {
|
|
4564
4564
|
b = Object.assign({
|
|
@@ -4581,8 +4581,8 @@ function U_() {
|
|
|
4581
4581
|
const x = c(_.url).split("?")[0] || "", w = e.extract(_.url), P = e.parse(w, { sort: !1 }), F = Object.assign(P, _.query);
|
|
4582
4582
|
let M = e.stringify(F, b);
|
|
4583
4583
|
M && (M = `?${M}`);
|
|
4584
|
-
let
|
|
4585
|
-
return _.fragmentIdentifier && (
|
|
4584
|
+
let q = p(_.url);
|
|
4585
|
+
return _.fragmentIdentifier && (q = `#${b[s] ? u(_.fragmentIdentifier, b) : _.fragmentIdentifier}`), `${x}${M}${q}`;
|
|
4586
4586
|
}, e.pick = (_, b, x) => {
|
|
4587
4587
|
x = Object.assign({
|
|
4588
4588
|
parseFragmentIdentifier: !0,
|
|
@@ -4680,7 +4680,7 @@ function D_() {
|
|
|
4680
4680
|
if (!ue)
|
|
4681
4681
|
throw new Error("Cannot flatten asset");
|
|
4682
4682
|
return V ? { description: X || Z, height: ce && ce.image && ce.image.height, type: Q, url: ue, width: ce && ce.image && ce.image.width } : ue;
|
|
4683
|
-
},
|
|
4683
|
+
}, q = (Y) => T(Y) && Y.sys && Y.sys.type === "Entry", G = (Y, k, V) => {
|
|
4684
4684
|
const X = {}, de = ((Q, Z) => {
|
|
4685
4685
|
const ue = {};
|
|
4686
4686
|
for (const [ce, Ye] of Object.entries(Q))
|
|
@@ -4688,7 +4688,7 @@ function D_() {
|
|
|
4688
4688
|
return ue;
|
|
4689
4689
|
})(b(Y), k);
|
|
4690
4690
|
for (const [Q, Z] of Object.entries(de))
|
|
4691
|
-
F(Z) ? X[Q] = M(Z, k, V) :
|
|
4691
|
+
F(Z) ? X[Q] = M(Z, k, V) : q(Z) ? X[Q] = G(Z, k, V) : _(Z) ? X[Q] = Z.map((ue) => F(ue) ? M(ue, k, V) : q(ue) ? G(ue, k, V) : ue) : X[Q] = Z;
|
|
4692
4692
|
return X;
|
|
4693
4693
|
}, W = ({ items: Y }) => {
|
|
4694
4694
|
if (!_(Y))
|
|
@@ -4699,10 +4699,10 @@ function D_() {
|
|
|
4699
4699
|
return await (await (0, l.createClient)(V)).getEntries(Y);
|
|
4700
4700
|
}, z = async (Y = {}, k = {}, V = !1) => ((X, { flatten: de = !0, locale: Q = "en", assetDetails: Z = !1 }) => {
|
|
4701
4701
|
const ue = W(X);
|
|
4702
|
-
return de ?
|
|
4702
|
+
return de ? G(ue[0], Q, Z) : ue[0];
|
|
4703
4703
|
})(await H(Y, V), { ...Y, ...k }), ie = async (Y = {}, k = {}, V = !1) => ((X, { flatten: de = !0, locale: Q = "en", assetDetails: Z = !1 }) => {
|
|
4704
4704
|
const ue = W(X);
|
|
4705
|
-
return de ? ((ce, Ye, K) => ce.map((te) =>
|
|
4705
|
+
return de ? ((ce, Ye, K) => ce.map((te) => G(te, Ye, K)))(ue, Q, Z) : ue;
|
|
4706
4706
|
})(await H(Y, V), { ...Y, ...k });
|
|
4707
4707
|
}(), a;
|
|
4708
4708
|
}();
|
|
@@ -4759,13 +4759,13 @@ function Fu() {
|
|
|
4759
4759
|
}, h.fromString = function(E) {
|
|
4760
4760
|
var T = E.indexOf("("), _ = E.lastIndexOf(")"), b = E.substring(0, T), x = E.substring(T + 1, _).split(","), w = E.substring(_ + 1);
|
|
4761
4761
|
if (w.indexOf("@") === 0)
|
|
4762
|
-
var P = /@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(w, ""), F = P[1], M = P[2],
|
|
4762
|
+
var P = /@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(w, ""), F = P[1], M = P[2], q = P[3];
|
|
4763
4763
|
return new h({
|
|
4764
4764
|
functionName: b,
|
|
4765
4765
|
args: x || void 0,
|
|
4766
4766
|
fileName: F,
|
|
4767
4767
|
lineNumber: M || void 0,
|
|
4768
|
-
columnNumber:
|
|
4768
|
+
columnNumber: q || void 0
|
|
4769
4769
|
});
|
|
4770
4770
|
};
|
|
4771
4771
|
for (var d = 0; d < i.length; d++)
|
|
@@ -4979,8 +4979,8 @@ function yh() {
|
|
|
4979
4979
|
return _;
|
|
4980
4980
|
b = x.path;
|
|
4981
4981
|
}
|
|
4982
|
-
for (var w = e.isAbsolute(b), P = b.split(/\/+/), F, M = 0,
|
|
4983
|
-
F = P[
|
|
4982
|
+
for (var w = e.isAbsolute(b), P = b.split(/\/+/), F, M = 0, q = P.length - 1; q >= 0; q--)
|
|
4983
|
+
F = P[q], F === "." ? P.splice(q, 1) : F === ".." ? M++ : M > 0 && (F === "" ? (P.splice(q + 1, M), M = 0) : (P.splice(q, 2), M--));
|
|
4984
4984
|
return b = P.join("/"), b === "" && (b = w ? "/" : "."), x ? (x.path = b, i(x)) : b;
|
|
4985
4985
|
}
|
|
4986
4986
|
e.normalize = s;
|
|
@@ -5307,7 +5307,7 @@ function z_() {
|
|
|
5307
5307
|
this.generatedLine = 0, this.generatedColumn = 0, this.source = null, this.originalLine = null, this.originalColumn = null, this.name = null;
|
|
5308
5308
|
}
|
|
5309
5309
|
s.prototype._parseMappings = function(u, h) {
|
|
5310
|
-
for (var d = 1, c = 0, p = 0, m = 0, E = 0, T = 0, _ = u.length, b = 0, x = {}, w = {}, P = [], F = [], M,
|
|
5310
|
+
for (var d = 1, c = 0, p = 0, m = 0, E = 0, T = 0, _ = u.length, b = 0, x = {}, w = {}, P = [], F = [], M, q, G, W, H; b < _; )
|
|
5311
5311
|
if (u.charAt(b) === ";")
|
|
5312
5312
|
d++, b++, c = 0;
|
|
5313
5313
|
else if (u.charAt(b) === ",")
|
|
@@ -5315,18 +5315,18 @@ function z_() {
|
|
|
5315
5315
|
else {
|
|
5316
5316
|
for (M = new a(), M.generatedLine = d, W = b; W < _ && !this._charIsMappingSeparator(u, W); W++)
|
|
5317
5317
|
;
|
|
5318
|
-
if (
|
|
5319
|
-
b +=
|
|
5318
|
+
if (q = u.slice(b, W), G = x[q], G)
|
|
5319
|
+
b += q.length;
|
|
5320
5320
|
else {
|
|
5321
|
-
for (
|
|
5322
|
-
r.decode(u, b, w), H = w.value, b = w.rest,
|
|
5323
|
-
if (
|
|
5321
|
+
for (G = []; b < W; )
|
|
5322
|
+
r.decode(u, b, w), H = w.value, b = w.rest, G.push(H);
|
|
5323
|
+
if (G.length === 2)
|
|
5324
5324
|
throw new Error("Found a source, but no line and column");
|
|
5325
|
-
if (
|
|
5325
|
+
if (G.length === 3)
|
|
5326
5326
|
throw new Error("Found a source and line, but no column");
|
|
5327
|
-
x[
|
|
5327
|
+
x[q] = G;
|
|
5328
5328
|
}
|
|
5329
|
-
M.generatedColumn = c +
|
|
5329
|
+
M.generatedColumn = c + G[0], c = M.generatedColumn, G.length > 1 && (M.source = E + G[1], E += G[1], M.originalLine = p + G[2], p = M.originalLine, M.originalLine += 1, M.originalColumn = m + G[3], m = M.originalColumn, G.length > 4 && (M.name = T + G[4], T += G[4])), F.push(M), typeof M.originalLine == "number" && P.push(M);
|
|
5330
5330
|
}
|
|
5331
5331
|
o(F, e.compareByGeneratedPositionsDeflated), this.__generatedMappings = F, o(P, e.compareByOriginalPositions), this.__originalMappings = P;
|
|
5332
5332
|
}, s.prototype._findMapping = function(u, h, d, c, p, m) {
|
|
@@ -6893,10 +6893,10 @@ function gE() {
|
|
|
6893
6893
|
if (F === "%%")
|
|
6894
6894
|
return "%";
|
|
6895
6895
|
w++;
|
|
6896
|
-
const
|
|
6897
|
-
if (typeof
|
|
6898
|
-
const
|
|
6899
|
-
F =
|
|
6896
|
+
const q = r.formatters[M];
|
|
6897
|
+
if (typeof q == "function") {
|
|
6898
|
+
const G = T[w];
|
|
6899
|
+
F = q.call(_, G), T.splice(w, 1), w--;
|
|
6900
6900
|
}
|
|
6901
6901
|
return F;
|
|
6902
6902
|
}), r.formatArgs.call(_, T), (_.log || r.log).apply(_, T);
|
|
@@ -9849,10 +9849,10 @@ function IE() {
|
|
|
9849
9849
|
}
|
|
9850
9850
|
return j;
|
|
9851
9851
|
}
|
|
9852
|
-
function
|
|
9852
|
+
function q(S, g, v, A) {
|
|
9853
9853
|
return Et(Lt(g, S.length - v), S, v, A);
|
|
9854
9854
|
}
|
|
9855
|
-
function
|
|
9855
|
+
function G(S, g, v, A) {
|
|
9856
9856
|
return Et(_t(g), S, v, A);
|
|
9857
9857
|
}
|
|
9858
9858
|
function W(S, g, v, A) {
|
|
@@ -9883,11 +9883,11 @@ function IE() {
|
|
|
9883
9883
|
return M(this, g, v, A);
|
|
9884
9884
|
case "utf8":
|
|
9885
9885
|
case "utf-8":
|
|
9886
|
-
return
|
|
9886
|
+
return q(this, g, v, A);
|
|
9887
9887
|
case "ascii":
|
|
9888
9888
|
case "latin1":
|
|
9889
9889
|
case "binary":
|
|
9890
|
-
return
|
|
9890
|
+
return G(this, g, v, A);
|
|
9891
9891
|
case "base64":
|
|
9892
9892
|
return W(this, g, v, A);
|
|
9893
9893
|
case "ucs2":
|
|
@@ -10503,8 +10503,8 @@ function IE() {
|
|
|
10503
10503
|
} });
|
|
10504
10504
|
var c = h(809), p = h(30), m = h(36), E = { APOLITICAL: { WEBSITES: { LIVE: "https://apolitical.co", LOCALHOST: "localhost", STAGING: /https:\/\/([\w|\d|-]+)\.apolitical\.co/i, STAGING_SPLITTER: "-" }, ENVIRONMENTS: { PRODUCTION: "live", LOCAL: "local" } }, APIS: { ASSETS_API: { BASE_URL: "/api/assets-api", ENDPOINTS: { USERS: "/users", CERTIFICATES: "/certificates" } }, AUTH_API: { BASE_URL: "/api/auth-api", ENDPOINTS: { USER_PASSWORD: "/password", USERS: "/users" } }, CONTENT_INTERACTION_API: { BASE_URL: "/api/content-interaction-api", ENDPOINTS: { QUESTIONS: "/questions", ANSWERS: "/answers", REPLIES: "/replies", LIKES: "/likes" } }, FEATURES_API: { BASE_URL: "/api/features-api", ENDPOINTS: { FLAGS: "/features" } }, MANAGEMENT_API: { BASE_URL: "/api/management-api", ENDPOINTS: { ACCOUNTS: "/accounts", EVENT_REGISTRATIONS: "/event-registrations", LOGINS: "/logins", LOGIN_PASSWORDLESS: "/passwordless", BULK_ENROLMENTS: "/bulk-enrolments" } }, PAYMENTS_API: { BASE_URL: "/api/payments-api", BASE_URL_V2: "/api/payments-api/v2", ENDPOINTS: { PRODUCTS: "/products" } }, PEOPLE_API: { BASE_URL: "/api/people-api", BASE_URL_V2: "/api/people-api/v2", ENDPOINTS: { BULK_ENROLMENTS: "/bulk-enrolments", REGISTRATIONS: "/registrations", USERS: "/users", USER_ANSWERS: "/answers", USER_COURSES: "/courses", USER_EVENTS: "/events", USER_LIKES: "/likes", USER_LESSONS: "/lessons", USER_PRODUCTS: "/products", USER_RATINGS: "/ratings", USER_SUBSCRIPTIONS: "/subscriptions" } }, PEOPLE_ENGAGEMENT_API: { BASE_URL: "/api/people-engagement-api", ENDPOINTS: { ENQUIRY_EMAILS: "/enquiry-emails", USERS: "/users", USER_PROPERTIES: "/properties" } }, SEARCH_API: { BASE_URL: "/api/search-api", ENDPOINTS: { SEARCH: "/search" } } }, CONTENTFUL: { ARTICLES: { TYPE: "solutionArticle" }, CAROUSELS: { CARD_TYPES: { solutionArticle: { INCLUDE: 1, SELECT: "fields.authorIds,fields.authorTag,fields.image,fields.publishedDate,fields.readingTime,fields.slug,fields.title" }, microcourse: { INCLUDE: 2, SELECT: "fields.banner,fields.freeCourse,fields.partnershipDetails,fields.slug,fields.title" }, event: { INCLUDE: 1, SELECT: "fields.bannerImage,fields.defaultStartDate,fields.slug,fields.speakers,fields.title,fields.isEventOngoing" }, listPage: { INCLUDE: 1, SELECT: "fields.hero,fields.slug,fields.title" }, qaQuestion: { INCLUDE: 0, SELECT: "fields.answers,fields.authorId,fields.slug,fields.title,sys.createdAt,fields.projectNames" }, learningHub: { INCLUDE: 1, SELECT: "fields.bannerSection,fields.customLabel,fields.slug,fields.title" } } }, COURSES: { TYPE: "microcourse" }, EDITORIAL_PAGES: { INCLUDE: 1, SELECT: "fields.carousels,fields.slug", TYPE: "editorialPage" }, EVENTS: { TYPE: "event" }, LISTS: { TYPE: "listPage" }, QUESTIONS: { TYPE: "qaQuestion", INCLUDE: 1, LIMIT: 10, ORDER: "-sys.createdAt", SELECT: "sys.createdAt,sys.updatedAt,fields.title,fields.slug,fields.authorId,fields.answers,fields.isEdited,fields.projectNames", SKIP: 0 }, ANSWERS: { TYPE: "qaAnswer" }, REPLIES: { TYPE: "reply" }, LEARNING_HUB: { TYPE: "learningHub" } }, HUBSPOT: { ENVIRONMENTS_MAPPING: { local: "SANDBOX", beta: "SANDBOX", rc: "SANDBOX", live: "LIVE" }, EMAIL_IDS: { SANDBOX: { internalEmailId: 49099078634, externalEmailId: 55196526554 }, LIVE: { internalEmailId: 55233583049, externalEmailId: 55231159239 } } }, USERS: { MYSELF: "me" } };
|
|
10505
10505
|
const { APOLITICAL: { WEBSITES: { LIVE: T, LOCALHOST: _, STAGING: b, STAGING_SPLITTER: x }, ENVIRONMENTS: { PRODUCTION: w, LOCAL: P } } } = E, { HUBSPOT: { ENVIRONMENTS_MAPPING: F, EMAIL_IDS: M } } = E;
|
|
10506
|
-
let
|
|
10507
|
-
var
|
|
10506
|
+
let q = { emailIds: {} };
|
|
10507
|
+
var G = h(300), W = h.n(G);
|
|
10508
10508
|
const H = async (N) => {
|
|
10509
10509
|
try {
|
|
10510
10510
|
const { message: B, response: L, request: D } = N;
|
|
@@ -10928,7 +10928,7 @@ function IE() {
|
|
|
10928
10928
|
} }, gn = { forms: { sendEnquiryEmails: async (N) => {
|
|
10929
10929
|
let B = null;
|
|
10930
10930
|
try {
|
|
10931
|
-
const { emailIds: L } =
|
|
10931
|
+
const { emailIds: L } = q;
|
|
10932
10932
|
B = await hr.emails.create({ ...L, ...N });
|
|
10933
10933
|
} catch (L) {
|
|
10934
10934
|
await H(L);
|
|
@@ -11104,7 +11104,7 @@ function IE() {
|
|
|
11104
11104
|
throw new Error(`Cannot map environment: No mapping found for environment ${Fe}`);
|
|
11105
11105
|
return F[Fe];
|
|
11106
11106
|
})(Te);
|
|
11107
|
-
|
|
11107
|
+
q.emailIds = M[Le];
|
|
11108
11108
|
})(Object.assign({}, { environment: J })), J;
|
|
11109
11109
|
} catch (J) {
|
|
11110
11110
|
console.warn(`Cannot load SDK: ${J.message}`);
|
|
@@ -11160,28 +11160,28 @@ function PE(e, t, n) {
|
|
|
11160
11160
|
}, []);
|
|
11161
11161
|
var T = qi(function() {
|
|
11162
11162
|
var _ = function(M) {
|
|
11163
|
-
var
|
|
11164
|
-
return a.current = l.current = null, i.current = M, f.current = u.current.apply(
|
|
11165
|
-
}, b = function(M,
|
|
11166
|
-
d && cancelAnimationFrame(s.current), s.current = d ? requestAnimationFrame(M) : setTimeout(M,
|
|
11163
|
+
var q = a.current, G = l.current;
|
|
11164
|
+
return a.current = l.current = null, i.current = M, f.current = u.current.apply(G, q);
|
|
11165
|
+
}, b = function(M, q) {
|
|
11166
|
+
d && cancelAnimationFrame(s.current), s.current = d ? requestAnimationFrame(M) : setTimeout(M, q);
|
|
11167
11167
|
}, x = function(M) {
|
|
11168
11168
|
if (!h.current)
|
|
11169
11169
|
return !1;
|
|
11170
|
-
var
|
|
11171
|
-
return !o.current ||
|
|
11170
|
+
var q = M - o.current;
|
|
11171
|
+
return !o.current || q >= t || q < 0 || m && M - i.current >= E;
|
|
11172
11172
|
}, w = function(M) {
|
|
11173
11173
|
return s.current = null, p && a.current ? _(M) : (a.current = l.current = null, f.current);
|
|
11174
11174
|
}, P = function M() {
|
|
11175
|
-
var
|
|
11176
|
-
if (x(
|
|
11177
|
-
return w(
|
|
11175
|
+
var q = Date.now();
|
|
11176
|
+
if (x(q))
|
|
11177
|
+
return w(q);
|
|
11178
11178
|
if (h.current) {
|
|
11179
|
-
var
|
|
11179
|
+
var G = t - (q - o.current), W = m ? Math.min(G, E - (q - i.current)) : G;
|
|
11180
11180
|
b(M, W);
|
|
11181
11181
|
}
|
|
11182
11182
|
}, F = function() {
|
|
11183
|
-
var M = Date.now(),
|
|
11184
|
-
if (a.current = [].slice.call(arguments), l.current = r, o.current = M,
|
|
11183
|
+
var M = Date.now(), q = x(M);
|
|
11184
|
+
if (a.current = [].slice.call(arguments), l.current = r, o.current = M, q) {
|
|
11185
11185
|
if (!s.current && h.current)
|
|
11186
11186
|
return i.current = o.current, b(P, t), c ? _(o.current) : f.current;
|
|
11187
11187
|
if (m)
|
|
@@ -11256,8 +11256,8 @@ const Zo = (e = !0, t = !1) => {
|
|
|
11256
11256
|
var qo = { exports: {} };
|
|
11257
11257
|
qo.exports;
|
|
11258
11258
|
(function(e, t) {
|
|
11259
|
-
var n = 200, r = "__lodash_hash_undefined__", o = 9007199254740991, i = "[object Arguments]", s = "[object Array]", a = "[object Boolean]", l = "[object Date]", f = "[object Error]", u = "[object Function]", h = "[object GeneratorFunction]", d = "[object Map]", c = "[object Number]", p = "[object Object]", m = "[object Promise]", E = "[object RegExp]", T = "[object Set]", _ = "[object String]", b = "[object Symbol]", x = "[object WeakMap]", w = "[object ArrayBuffer]", P = "[object DataView]", F = "[object Float32Array]", M = "[object Float64Array]",
|
|
11260
|
-
Q[i] = Q[s] = Q[w] = Q[P] = Q[a] = Q[l] = Q[F] = Q[M] = Q[
|
|
11259
|
+
var n = 200, r = "__lodash_hash_undefined__", o = 9007199254740991, i = "[object Arguments]", s = "[object Array]", a = "[object Boolean]", l = "[object Date]", f = "[object Error]", u = "[object Function]", h = "[object GeneratorFunction]", d = "[object Map]", c = "[object Number]", p = "[object Object]", m = "[object Promise]", E = "[object RegExp]", T = "[object Set]", _ = "[object String]", b = "[object Symbol]", x = "[object WeakMap]", w = "[object ArrayBuffer]", P = "[object DataView]", F = "[object Float32Array]", M = "[object Float64Array]", q = "[object Int8Array]", G = "[object Int16Array]", W = "[object Int32Array]", H = "[object Uint8Array]", z = "[object Uint8ClampedArray]", ie = "[object Uint16Array]", Y = "[object Uint32Array]", k = /[\\^$.*+?()[\]{}|]/g, V = /\w*$/, X = /^\[object .+?Constructor\]$/, de = /^(?:0|[1-9]\d*)$/, Q = {};
|
|
11260
|
+
Q[i] = Q[s] = Q[w] = Q[P] = Q[a] = Q[l] = Q[F] = Q[M] = Q[q] = Q[G] = Q[W] = Q[d] = Q[c] = Q[p] = Q[E] = Q[T] = Q[_] = Q[b] = Q[H] = Q[z] = Q[ie] = Q[Y] = !0, Q[f] = Q[u] = Q[x] = !1;
|
|
11261
11261
|
var Z = typeof oe == "object" && oe && oe.Object === Object && oe, ue = typeof self == "object" && self && self.Object === Object && self, ce = Z || ue || Function("return this")(), Ye = t && !t.nodeType && t, K = Ye && !0 && e && !e.nodeType && e, te = K && K.exports === Ye;
|
|
11262
11262
|
function Ie(y, O) {
|
|
11263
11263
|
return y.set(O[0], O[1]), y;
|
|
@@ -11609,8 +11609,8 @@ qo.exports;
|
|
|
11609
11609
|
return Zt(y, $);
|
|
11610
11610
|
case F:
|
|
11611
11611
|
case M:
|
|
11612
|
-
case G:
|
|
11613
11612
|
case q:
|
|
11613
|
+
case G:
|
|
11614
11614
|
case W:
|
|
11615
11615
|
case H:
|
|
11616
11616
|
case z:
|
|
@@ -16215,16 +16215,16 @@ function ET(e, t = {}) {
|
|
|
16215
16215
|
const _ = E.indexOf("=");
|
|
16216
16216
|
if (_ !== -1) {
|
|
16217
16217
|
const b = function(F) {
|
|
16218
|
-
return F.indexOf("-") !== -1 && F.match(kS) === null && (F = F.replace(DS, function(M,
|
|
16219
|
-
return
|
|
16218
|
+
return F.indexOf("-") !== -1 && F.match(kS) === null && (F = F.replace(DS, function(M, q) {
|
|
16219
|
+
return q.toUpperCase();
|
|
16220
16220
|
})), F;
|
|
16221
16221
|
}(E.slice(0, _)).trim(), x = function(F) {
|
|
16222
16222
|
const M = F[0];
|
|
16223
16223
|
return (M === '"' || M === "'") && F.length >= 2 && F[F.length - 1] === M ? F.slice(1, -1) : F;
|
|
16224
16224
|
}(E.slice(_ + 1).trim()), w = nd[b] || b, P = m[w] = function(F, M) {
|
|
16225
|
-
return F === "style" ? M.split(/;\s?/).reduce(function(
|
|
16226
|
-
const W =
|
|
16227
|
-
return
|
|
16225
|
+
return F === "style" ? M.split(/;\s?/).reduce(function(q, G) {
|
|
16226
|
+
const W = G.slice(0, G.indexOf(":"));
|
|
16227
|
+
return q[W.replace(/(-[a-z])/g, (H) => H[1].toUpperCase())] = G.slice(W.length + 1).trim(), q;
|
|
16228
16228
|
}, {}) : F === "href" ? On(M) : (M.match(BS) && (M = M.slice(1, M.length - 1)), M === "true" || M !== "false" && M);
|
|
16229
16229
|
}(b, x);
|
|
16230
16230
|
typeof P == "string" && (Eu.test(P) || bu.test(P)) && (m[w] = Oe.cloneElement(o(P.trim()), { key: T }));
|
|
@@ -16267,8 +16267,8 @@ function ET(e, t = {}) {
|
|
|
16267
16267
|
if (F) {
|
|
16268
16268
|
const M = F[0];
|
|
16269
16269
|
E = E.substring(M.length);
|
|
16270
|
-
const
|
|
16271
|
-
|
|
16270
|
+
const q = P.l(F, m, T);
|
|
16271
|
+
q.type == null && (q.type = w), _.push(q), b = M;
|
|
16272
16272
|
break;
|
|
16273
16273
|
}
|
|
16274
16274
|
x++;
|
|
@@ -16873,24 +16873,24 @@ const yt = "discussion_form_", rO = ({
|
|
|
16873
16873
|
},
|
|
16874
16874
|
gtmContext: a = "DiscussionForm"
|
|
16875
16875
|
}) => {
|
|
16876
|
-
var M,
|
|
16876
|
+
var M, q;
|
|
16877
16877
|
const l = Pe(), f = In(no), [u, h] = Be(t.isEditing && t.isEditing.text || ""), [d, c] = Be(i.error || !1), [p, m] = Be(!1), E = at(null);
|
|
16878
16878
|
if (n || (n = E), t.isLoading)
|
|
16879
16879
|
return /* @__PURE__ */ R(nn, { className: "discussion-card discussion-form", "data-testid": "loading-placeholder" });
|
|
16880
|
-
const T = (
|
|
16881
|
-
const W =
|
|
16880
|
+
const T = (G) => {
|
|
16881
|
+
const W = G.target.value;
|
|
16882
16882
|
h(W);
|
|
16883
16883
|
let H;
|
|
16884
16884
|
!f || !f.id ? H = gr(l.formatMessage, `${yt}error_loggedOut`, e.type, "action") : W.length >= r && (H = `${yt}error_tooLong`), H ? c(H) : d && c(!1);
|
|
16885
16885
|
};
|
|
16886
16886
|
let _ = `${e.type}-form`;
|
|
16887
16887
|
if (e.type === "response" || e.type === "reply") {
|
|
16888
|
-
const
|
|
16889
|
-
|
|
16888
|
+
const G = e.type === "response" ? ((M = e.slugs) == null ? void 0 : M.question) || "" : ((q = e.slugs) == null ? void 0 : q.answer) || "";
|
|
16889
|
+
G && (_ = `${_}-${G.slice(-15)}`);
|
|
16890
16890
|
}
|
|
16891
|
-
const b = async (
|
|
16891
|
+
const b = async (G) => {
|
|
16892
16892
|
var H;
|
|
16893
|
-
if (
|
|
16893
|
+
if (G.preventDefault(), G.stopPropagation(), w)
|
|
16894
16894
|
return;
|
|
16895
16895
|
No && clearTimeout(No), m("submitting");
|
|
16896
16896
|
const W = window.location.pathname;
|
|
@@ -16943,12 +16943,12 @@ const yt = "discussion_form_", rO = ({
|
|
|
16943
16943
|
}), F.push({
|
|
16944
16944
|
variant: "primary",
|
|
16945
16945
|
size: { mobile: "small", 600: "medium" },
|
|
16946
|
-
onClick: (
|
|
16946
|
+
onClick: (G) => {
|
|
16947
16947
|
if (t.isEditing) {
|
|
16948
16948
|
m("submitting"), s.handleSaveEdit && s.handleSaveEdit(E.current && "value" in E.current ? E.current.value : "");
|
|
16949
16949
|
return;
|
|
16950
16950
|
}
|
|
16951
|
-
b(
|
|
16951
|
+
b(G);
|
|
16952
16952
|
},
|
|
16953
16953
|
className: "gtm-trackable",
|
|
16954
16954
|
"data-gtm-event-context": a,
|
|
@@ -16983,14 +16983,14 @@ const yt = "discussion_form_", rO = ({
|
|
|
16983
16983
|
}
|
|
16984
16984
|
),
|
|
16985
16985
|
/* @__PURE__ */ R("small", { children: gr(l.formatMessage, `${yt}explainer`, e.type, "action", {
|
|
16986
|
-
a: (
|
|
16986
|
+
a: (G) => /* @__PURE__ */ R(
|
|
16987
16987
|
"a",
|
|
16988
16988
|
{
|
|
16989
16989
|
href: "https://about.apolitical.co/q-and-a-community-guidelines",
|
|
16990
16990
|
className: "gtm-trackable",
|
|
16991
16991
|
"data-gtm-event-context": a,
|
|
16992
16992
|
"data-gtm-event-type": "community-guidelines-link",
|
|
16993
|
-
children:
|
|
16993
|
+
children: G
|
|
16994
16994
|
}
|
|
16995
16995
|
)
|
|
16996
16996
|
}) }),
|
|
@@ -17025,7 +17025,7 @@ const Us = () => {
|
|
|
17025
17025
|
}
|
|
17026
17026
|
}) => {
|
|
17027
17027
|
const l = Pe();
|
|
17028
|
-
ut(() => {
|
|
17028
|
+
console.log("from like", { likes: t, userLiked: r, slug: o.slugs }), ut(() => {
|
|
17029
17029
|
d(r);
|
|
17030
17030
|
}, [r]);
|
|
17031
17031
|
const [f, u] = Be(t), [h, d] = Be(r), [c, p] = Be(!1), m = window.location.pathname, E = (_) => {
|
|
@@ -17082,8 +17082,8 @@ const Us = () => {
|
|
|
17082
17082
|
var Wo = { exports: {} };
|
|
17083
17083
|
Wo.exports;
|
|
17084
17084
|
(function(e, t) {
|
|
17085
|
-
var n = 200, r = "__lodash_hash_undefined__", o = 1, i = 2, s = 9007199254740991, a = "[object Arguments]", l = "[object Array]", f = "[object AsyncFunction]", u = "[object Boolean]", h = "[object Date]", d = "[object Error]", c = "[object Function]", p = "[object GeneratorFunction]", m = "[object Map]", E = "[object Number]", T = "[object Null]", _ = "[object Object]", b = "[object Promise]", x = "[object Proxy]", w = "[object RegExp]", P = "[object Set]", F = "[object String]", M = "[object Symbol]",
|
|
17086
|
-
K[z] = K[ie] = K[Y] = K[k] = K[V] = K[X] = K[de] = K[Q] = K[Z] = !0, K[a] = K[l] = K[W] = K[u] = K[H] = K[h] = K[d] = K[c] = K[m] = K[E] = K[_] = K[w] = K[P] = K[F] = K[
|
|
17085
|
+
var n = 200, r = "__lodash_hash_undefined__", o = 1, i = 2, s = 9007199254740991, a = "[object Arguments]", l = "[object Array]", f = "[object AsyncFunction]", u = "[object Boolean]", h = "[object Date]", d = "[object Error]", c = "[object Function]", p = "[object GeneratorFunction]", m = "[object Map]", E = "[object Number]", T = "[object Null]", _ = "[object Object]", b = "[object Promise]", x = "[object Proxy]", w = "[object RegExp]", P = "[object Set]", F = "[object String]", M = "[object Symbol]", q = "[object Undefined]", G = "[object WeakMap]", W = "[object ArrayBuffer]", H = "[object DataView]", z = "[object Float32Array]", ie = "[object Float64Array]", Y = "[object Int8Array]", k = "[object Int16Array]", V = "[object Int32Array]", X = "[object Uint8Array]", de = "[object Uint8ClampedArray]", Q = "[object Uint16Array]", Z = "[object Uint32Array]", ue = /[\\^$.*+?()[\]{}|]/g, ce = /^\[object .+?Constructor\]$/, Ye = /^(?:0|[1-9]\d*)$/, K = {};
|
|
17086
|
+
K[z] = K[ie] = K[Y] = K[k] = K[V] = K[X] = K[de] = K[Q] = K[Z] = !0, K[a] = K[l] = K[W] = K[u] = K[H] = K[h] = K[d] = K[c] = K[m] = K[E] = K[_] = K[w] = K[P] = K[F] = K[G] = !1;
|
|
17087
17087
|
var te = typeof oe == "object" && oe && oe.Object === Object && oe, Ie = typeof self == "object" && self && self.Object === Object && self, Ae = te || Ie || Function("return this")(), ct = t && !t.nodeType && t, dt = ct && !0 && e && !e.nodeType && e, Tt = dt && dt.exports === ct, ee = Tt && te.process, Ke = function() {
|
|
17088
17088
|
try {
|
|
17089
17089
|
return ee && ee.binding && ee.binding("util");
|
|
@@ -17297,7 +17297,7 @@ Wo.exports;
|
|
|
17297
17297
|
return dr(y) ? $ : Kt($, C(y));
|
|
17298
17298
|
}
|
|
17299
17299
|
function Zt(y) {
|
|
17300
|
-
return y == null ? y === void 0 ?
|
|
17300
|
+
return y == null ? y === void 0 ? q : T : ht && ht in Object(y) ? It(y) : gn(y);
|
|
17301
17301
|
}
|
|
17302
17302
|
function hn(y) {
|
|
17303
17303
|
return bt(y) && Zt(y) == a;
|
|
@@ -17467,7 +17467,7 @@ Wo.exports;
|
|
|
17467
17467
|
return Se.call(y, O);
|
|
17468
17468
|
}));
|
|
17469
17469
|
} : wn, mt = Zt;
|
|
17470
|
-
(Cr && mt(new Cr(new ArrayBuffer(1))) != H || Xt && mt(new Xt()) != m || Rr && mt(Rr.resolve()) != b || Ir && mt(new Ir()) != P || Nr && mt(new Nr()) !=
|
|
17470
|
+
(Cr && mt(new Cr(new ArrayBuffer(1))) != H || Xt && mt(new Xt()) != m || Rr && mt(Rr.resolve()) != b || Ir && mt(new Ir()) != P || Nr && mt(new Nr()) != G) && (mt = function(y) {
|
|
17471
17471
|
var O = Zt(y), C = O == _ ? y.constructor : void 0, $ = C ? Xe(C) : "";
|
|
17472
17472
|
if ($)
|
|
17473
17473
|
switch ($) {
|
|
@@ -17480,7 +17480,7 @@ Wo.exports;
|
|
|
17480
17480
|
case Gn:
|
|
17481
17481
|
return P;
|
|
17482
17482
|
case Wn:
|
|
17483
|
-
return
|
|
17483
|
+
return G;
|
|
17484
17484
|
}
|
|
17485
17485
|
return O;
|
|
17486
17486
|
});
|
|
@@ -17576,74 +17576,78 @@ const aO = /* @__PURE__ */ Vt(oO), sO = (e) => {
|
|
|
17576
17576
|
locale: u = "en",
|
|
17577
17577
|
children: h
|
|
17578
17578
|
}) => {
|
|
17579
|
-
const d = Pe()
|
|
17579
|
+
const d = Pe();
|
|
17580
|
+
In(no);
|
|
17581
|
+
const c = In(qm), [p, m] = Be({
|
|
17580
17582
|
body: e && e.body || "",
|
|
17581
17583
|
isEditing: !1,
|
|
17582
17584
|
didEdit: e && e.isEdited || !1
|
|
17583
|
-
}), [
|
|
17585
|
+
}), [E, T] = Be("");
|
|
17584
17586
|
if (ut(() => {
|
|
17585
|
-
|
|
17586
|
-
...
|
|
17587
|
+
m({
|
|
17588
|
+
...p,
|
|
17587
17589
|
body: e && e.body || "",
|
|
17588
17590
|
didEdit: e && e.isEdited || !1
|
|
17589
17591
|
});
|
|
17590
17592
|
}, [e.isEdited]), t || !e || e.type === "answer" && (!e.slugs || !e.slugs.question))
|
|
17591
17593
|
return /* @__PURE__ */ R(nn, { className: "discussion-card discussion-post" });
|
|
17592
|
-
const { author:
|
|
17593
|
-
|
|
17594
|
+
const { author: _, createdAt: b, likes: x = 0, userLiked: w } = e, P = !0;
|
|
17595
|
+
console.log({ likes: e.likes, userLiked: e.userLiked, slug: e.slug });
|
|
17596
|
+
const F = async (q) => {
|
|
17597
|
+
q || (q = ""), T("");
|
|
17594
17598
|
try {
|
|
17595
|
-
aO(q,
|
|
17599
|
+
aO(q, p.body) || await i(sO(e.slugs), { body: q }), m({ body: q, isEditing: !1, didEdit: !0 });
|
|
17596
17600
|
} catch {
|
|
17597
|
-
|
|
17601
|
+
T(`${vd}form_error`);
|
|
17598
17602
|
}
|
|
17599
|
-
},
|
|
17600
|
-
|
|
17601
|
-
const
|
|
17602
|
-
|
|
17603
|
+
}, M = () => {
|
|
17604
|
+
c && c.updateConversation && c.updateConversation({ showThread: !0, showForm: !0 }), setTimeout(() => {
|
|
17605
|
+
const G = `reply-form-${(e.type === "answer" ? e.slug : e.slugs.answer || "").toLowerCase().slice(-15)}`, W = document.getElementById(G), H = document.getElementById(`${G}-input`);
|
|
17606
|
+
H && H.focus(), W && W.scrollIntoView({ behavior: "smooth" });
|
|
17603
17607
|
}, 0);
|
|
17604
17608
|
};
|
|
17605
17609
|
return /* @__PURE__ */ se("div", { className: ae("discussion-post", l), "data-testid": `discussion-${e.type}-thread`, children: [
|
|
17606
|
-
/* @__PURE__ */ se("div", { className: ae("discussion-card", e.type, { editing:
|
|
17607
|
-
!
|
|
17610
|
+
/* @__PURE__ */ se("div", { className: ae("discussion-card", e.type, { editing: p.isEditing }), children: [
|
|
17611
|
+
!p.isEditing && /* @__PURE__ */ R(
|
|
17608
17612
|
jm,
|
|
17609
17613
|
{
|
|
17610
|
-
member:
|
|
17611
|
-
additionalContent: { createdAt:
|
|
17612
|
-
className: typeof
|
|
17614
|
+
member: _,
|
|
17615
|
+
additionalContent: { createdAt: b, didEdit: p.didEdit },
|
|
17616
|
+
className: typeof _ != "string" && _.id === n ? "highlighted" : "",
|
|
17613
17617
|
gtmContext: f,
|
|
17614
17618
|
gtmType: "profile-click"
|
|
17615
17619
|
}
|
|
17616
17620
|
),
|
|
17617
|
-
|
|
17621
|
+
p.isEditing ? /* @__PURE__ */ R(
|
|
17618
17622
|
rO,
|
|
17619
17623
|
{
|
|
17620
17624
|
content: { type: e.type, slugs: e.slugs },
|
|
17621
|
-
meta: { isLoading: t, isInWrapper: !0, isEditing: { text:
|
|
17622
|
-
forceShow: { error:
|
|
17625
|
+
meta: { isLoading: t, isInWrapper: !0, isEditing: { text: p.body } },
|
|
17626
|
+
forceShow: { error: E !== "" && E !== "delete-error" ? d.formatMessage({ id: E }, {
|
|
17623
17627
|
action: d.formatMessage({
|
|
17624
17628
|
id: `discussion_action_${e.type}`
|
|
17625
17629
|
})
|
|
17626
17630
|
}) : !1 },
|
|
17627
17631
|
functions: {
|
|
17628
17632
|
create: r,
|
|
17629
|
-
handleSaveEdit:
|
|
17633
|
+
handleSaveEdit: F,
|
|
17630
17634
|
handleCancel: () => {
|
|
17631
|
-
|
|
17635
|
+
T(""), m({ ...p, isEditing: !1 });
|
|
17632
17636
|
}
|
|
17633
17637
|
},
|
|
17634
17638
|
gtmContext: `${f}Form`
|
|
17635
17639
|
}
|
|
17636
|
-
) : /* @__PURE__ */ R(IT, { children:
|
|
17637
|
-
!
|
|
17640
|
+
) : /* @__PURE__ */ R(IT, { children: p.body }),
|
|
17641
|
+
!p.isEditing && /* @__PURE__ */ se("ul", { className: ae("actions", e.type), "data-testid": `${e.type}-actions`, children: [
|
|
17638
17642
|
/* @__PURE__ */ R(
|
|
17639
17643
|
iO,
|
|
17640
17644
|
{
|
|
17641
17645
|
element: "li",
|
|
17642
|
-
likes:
|
|
17646
|
+
likes: x,
|
|
17643
17647
|
isShort: !1,
|
|
17644
|
-
userLiked:
|
|
17648
|
+
userLiked: w,
|
|
17645
17649
|
content: { type: e.type, slugs: e.slugs },
|
|
17646
|
-
canLike:
|
|
17650
|
+
canLike: P,
|
|
17647
17651
|
createLike: s,
|
|
17648
17652
|
deleteLike: a,
|
|
17649
17653
|
locale: u
|
|
@@ -17655,7 +17659,7 @@ const aO = /* @__PURE__ */ Vt(oO), sO = (e) => {
|
|
|
17655
17659
|
variant: "tertiary",
|
|
17656
17660
|
size: "medium",
|
|
17657
17661
|
styling: { muted: !0 },
|
|
17658
|
-
onClick:
|
|
17662
|
+
onClick: M,
|
|
17659
17663
|
children: d.formatMessage({ id: `${vd}thread_reply_button` })
|
|
17660
17664
|
}
|
|
17661
17665
|
) })
|