| 1 |
(function(react, react_dom) { |
| 2 |
|
| 3 |
//#region \0rolldown/runtime.js |
| 4 |
var __create = Object.create; |
| 5 |
var __defProp$1 = Object.defineProperty; |
| 6 |
var __name = (target, value) => __defProp$1(target, "name", { |
| 7 |
value, |
| 8 |
configurable: true |
| 9 |
}); |
| 10 |
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; |
| 11 |
var __getOwnPropNames = Object.getOwnPropertyNames; |
| 12 |
var __getProtoOf = Object.getPrototypeOf; |
| 13 |
var __hasOwnProp$1 = Object.prototype.hasOwnProperty; |
| 14 |
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports); |
| 15 |
var __exportAll = (all, no_symbols) => { |
| 16 |
let target = {}; |
| 17 |
for (var name in all) { |
| 18 |
__defProp$1(target, name, { |
| 19 |
get: all[name], |
| 20 |
enumerable: true |
| 21 |
}); |
| 22 |
} |
| 23 |
if (!no_symbols) { |
| 24 |
__defProp$1(target, Symbol.toStringTag, { value: "Module" }); |
| 25 |
} |
| 26 |
return target; |
| 27 |
}; |
| 28 |
var __copyProps = (to, from, except, desc) => { |
| 29 |
if (from && typeof from === "object" || typeof from === "function") { |
| 30 |
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) { |
| 31 |
key = keys[i]; |
| 32 |
if (!__hasOwnProp$1.call(to, key) && key !== except) { |
| 33 |
__defProp$1(to, key, { |
| 34 |
get: ((k) => from[k]).bind(null, key), |
| 35 |
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable |
| 36 |
}); |
| 37 |
} |
| 38 |
} |
| 39 |
} |
| 40 |
return to; |
| 41 |
}; |
| 42 |
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp$1(target, "default", { |
| 43 |
value: mod, |
| 44 |
enumerable: true |
| 45 |
}) : target, mod)); |
| 46 |
|
| 47 |
//#endregion |
| 48 |
react = __toESM(react); |
| 49 |
|
| 50 |
//#region node_modules/immer/dist/immer.esm.mjs |
| 51 |
function n(n) { |
| 52 |
for (var r = arguments.length, t = Array(r > 1 ? r - 1 : 0), e = 1; e < r; e++) t[e - 1] = arguments[e]; |
| 53 |
var i = Y[n]; |
| 54 |
var o = i ? "function" == typeof i ? i.apply(null, t) : i : "unknown error nr: " + n; |
| 55 |
throw Error("[Immer] " + o); |
| 56 |
} |
| 57 |
function r(n) { |
| 58 |
return !!n && !!n[Q]; |
| 59 |
} |
| 60 |
function t(n) { |
| 61 |
var r; |
| 62 |
return !!n && (function(n) { |
| 63 |
if (!n || "object" != typeof n) return !1; |
| 64 |
var r = Object.getPrototypeOf(n); |
| 65 |
if (null === r) return !0; |
| 66 |
var t = Object.hasOwnProperty.call(r, "constructor") && r.constructor; |
| 67 |
return t === Object || "function" == typeof t && Function.toString.call(t) === Z; |
| 68 |
}(n) || Array.isArray(n) || !!n[L] || !!(null === (r = n.constructor) || void 0 === r ? void 0 : r[L]) || s(n) || v(n)); |
| 69 |
} |
| 70 |
function e(t) { |
| 71 |
return r(t) || n(23, t), t[Q].t; |
| 72 |
} |
| 73 |
function i(n, r, t) { |
| 74 |
void 0 === t && (t = !1), 0 === o(n) ? (t ? Object.keys : nn)(n).forEach((function(e) { |
| 75 |
t && "symbol" == typeof e || r(e, n[e], n); |
| 76 |
})) : n.forEach((function(t, e) { |
| 77 |
return r(e, t, n); |
| 78 |
})); |
| 79 |
} |
| 80 |
function o(n) { |
| 81 |
var r = n[Q]; |
| 82 |
return r ? r.i > 3 ? r.i - 4 : r.i : Array.isArray(n) ? 1 : s(n) ? 2 : v(n) ? 3 : 0; |
| 83 |
} |
| 84 |
function u(n, r) { |
| 85 |
return 2 === o(n) ? n.has(r) : Object.prototype.hasOwnProperty.call(n, r); |
| 86 |
} |
| 87 |
function a(n, r) { |
| 88 |
return 2 === o(n) ? n.get(r) : n[r]; |
| 89 |
} |
| 90 |
function f(n, r, t) { |
| 91 |
var e = o(n); |
| 92 |
2 === e ? n.set(r, t) : 3 === e ? n.add(t) : n[r] = t; |
| 93 |
} |
| 94 |
function c(n, r) { |
| 95 |
return n === r ? 0 !== n || 1 / n == 1 / r : n != n && r != r; |
| 96 |
} |
| 97 |
function s(n) { |
| 98 |
return X && n instanceof Map; |
| 99 |
} |
| 100 |
function v(n) { |
| 101 |
return q && n instanceof Set; |
| 102 |
} |
| 103 |
function p(n) { |
| 104 |
return n.o || n.t; |
| 105 |
} |
| 106 |
function l(n) { |
| 107 |
if (Array.isArray(n)) return Array.prototype.slice.call(n); |
| 108 |
var r = rn(n); |
| 109 |
delete r[Q]; |
| 110 |
for (var t = nn(r), e = 0; e < t.length; e++) { |
| 111 |
var i = t[e]; |
| 112 |
var o = r[i]; |
| 113 |
!1 === o.writable && (o.writable = !0, o.configurable = !0), (o.get || o.set) && (r[i] = { |
| 114 |
configurable: !0, |
| 115 |
writable: !0, |
| 116 |
enumerable: o.enumerable, |
| 117 |
value: n[i] |
| 118 |
}); |
| 119 |
} |
| 120 |
return Object.create(Object.getPrototypeOf(n), r); |
| 121 |
} |
| 122 |
function d(n, e) { |
| 123 |
return void 0 === e && (e = !1), y(n) || r(n) || !t(n) || (o(n) > 1 && (n.set = n.add = n.clear = n.delete = h), Object.freeze(n), e && i(n, (function(n, r) { |
| 124 |
return d(r, !0); |
| 125 |
}), !0)), n; |
| 126 |
} |
| 127 |
function h() { |
| 128 |
n(2); |
| 129 |
} |
| 130 |
function y(n) { |
| 131 |
return null == n || "object" != typeof n || Object.isFrozen(n); |
| 132 |
} |
| 133 |
function b(r) { |
| 134 |
var t = tn[r]; |
| 135 |
return t || n(18, r), t; |
| 136 |
} |
| 137 |
function m(n, r) { |
| 138 |
tn[n] || (tn[n] = r); |
| 139 |
} |
| 140 |
function _() { |
| 141 |
return U || n(0), U; |
| 142 |
} |
| 143 |
function j(n, r) { |
| 144 |
r && (b("Patches"), n.u = [], n.s = [], n.v = r); |
| 145 |
} |
| 146 |
function g(n) { |
| 147 |
O(n), n.p.forEach(S), n.p = null; |
| 148 |
} |
| 149 |
function O(n) { |
| 150 |
n === U && (U = n.l); |
| 151 |
} |
| 152 |
function w(n) { |
| 153 |
return U = { |
| 154 |
p: [], |
| 155 |
l: U, |
| 156 |
h: n, |
| 157 |
m: !0, |
| 158 |
_: 0 |
| 159 |
}; |
| 160 |
} |
| 161 |
function S(n) { |
| 162 |
var r = n[Q]; |
| 163 |
0 === r.i || 1 === r.i ? r.j() : r.g = !0; |
| 164 |
} |
| 165 |
function P(r, e) { |
| 166 |
e._ = e.p.length; |
| 167 |
var i = e.p[0]; |
| 168 |
var o = void 0 !== r && r !== i; |
| 169 |
return e.h.O || b("ES5").S(e, r, o), o ? (i[Q].P && (g(e), n(4)), t(r) && (r = M(e, r), e.l || x(e, r)), e.u && b("Patches").M(i[Q].t, r, e.u, e.s)) : r = M(e, i, []), g(e), e.u && e.v(e.u, e.s), r !== H ? r : void 0; |
| 170 |
} |
| 171 |
function M(n, r, t) { |
| 172 |
if (y(r)) return r; |
| 173 |
var e = r[Q]; |
| 174 |
if (!e) return i(r, (function(i, o) { |
| 175 |
return A(n, e, r, i, o, t); |
| 176 |
}), !0), r; |
| 177 |
if (e.A !== n) return r; |
| 178 |
if (!e.P) return x(n, e.t, !0), e.t; |
| 179 |
if (!e.I) { |
| 180 |
e.I = !0, e.A._--; |
| 181 |
var o = 4 === e.i || 5 === e.i ? e.o = l(e.k) : e.o; |
| 182 |
var u = o; |
| 183 |
var a = !1; |
| 184 |
3 === e.i && (u = new Set(o), o.clear(), a = !0), i(u, (function(r, i) { |
| 185 |
return A(n, e, o, r, i, t, a); |
| 186 |
})), x(n, o, !1), t && n.u && b("Patches").N(e, t, n.u, n.s); |
| 187 |
} |
| 188 |
return e.o; |
| 189 |
} |
| 190 |
function A(e, i, o, a, c, s, v) { |
| 191 |
if (c === o && n(5), r(c)) { |
| 192 |
var p = M(e, c, s && i && 3 !== i.i && !u(i.R, a) ? s.concat(a) : void 0); |
| 193 |
if (f(o, a, p), !r(p)) return; |
| 194 |
e.m = !1; |
| 195 |
} else v && o.add(c); |
| 196 |
if (t(c) && !y(c)) { |
| 197 |
if (!e.h.D && e._ < 1) return; |
| 198 |
M(e, c), i && i.A.l || x(e, c); |
| 199 |
} |
| 200 |
} |
| 201 |
function x(n, r, t) { |
| 202 |
void 0 === t && (t = !1), !n.l && n.h.D && n.m && d(r, t); |
| 203 |
} |
| 204 |
function z(n, r) { |
| 205 |
var t = n[Q]; |
| 206 |
return (t ? p(t) : n)[r]; |
| 207 |
} |
| 208 |
function I(n, r) { |
| 209 |
if (r in n) for (var t = Object.getPrototypeOf(n); t;) { |
| 210 |
var e = Object.getOwnPropertyDescriptor(t, r); |
| 211 |
if (e) return e; |
| 212 |
t = Object.getPrototypeOf(t); |
| 213 |
} |
| 214 |
} |
| 215 |
function k(n) { |
| 216 |
n.P || (n.P = !0, n.l && k(n.l)); |
| 217 |
} |
| 218 |
function E(n) { |
| 219 |
n.o || (n.o = l(n.t)); |
| 220 |
} |
| 221 |
function N(n, r, t) { |
| 222 |
var e = s(r) ? b("MapSet").F(r, t) : v(r) ? b("MapSet").T(r, t) : n.O ? function(n, r) { |
| 223 |
var t = Array.isArray(n); |
| 224 |
var e = { |
| 225 |
i: t ? 1 : 0, |
| 226 |
A: r ? r.A : _(), |
| 227 |
P: !1, |
| 228 |
I: !1, |
| 229 |
R: {}, |
| 230 |
l: r, |
| 231 |
t: n, |
| 232 |
k: null, |
| 233 |
o: null, |
| 234 |
j: null, |
| 235 |
C: !1 |
| 236 |
}; |
| 237 |
var i = e; |
| 238 |
var o = en; |
| 239 |
t && (i = [e], o = on); |
| 240 |
var u = Proxy.revocable(i, o); |
| 241 |
var a = u.revoke; |
| 242 |
var f = u.proxy; |
| 243 |
return e.k = f, e.j = a, f; |
| 244 |
}(r, t) : b("ES5").J(r, t); |
| 245 |
return (t ? t.A : _()).p.push(e), e; |
| 246 |
} |
| 247 |
function R(e) { |
| 248 |
return r(e) || n(22, e), function n(r) { |
| 249 |
if (!t(r)) return r; |
| 250 |
var e; |
| 251 |
var u = r[Q]; |
| 252 |
var c = o(r); |
| 253 |
if (u) { |
| 254 |
if (!u.P && (u.i < 4 || !b("ES5").K(u))) return u.t; |
| 255 |
u.I = !0, e = D(r, c), u.I = !1; |
| 256 |
} else e = D(r, c); |
| 257 |
return i(e, (function(r, t) { |
| 258 |
u && a(u.t, r) === t || f(e, r, n(t)); |
| 259 |
})), 3 === c ? new Set(e) : e; |
| 260 |
}(e); |
| 261 |
} |
| 262 |
function D(n, r) { |
| 263 |
switch (r) { |
| 264 |
case 2: return new Map(n); |
| 265 |
case 3: return Array.from(n); |
| 266 |
} |
| 267 |
return l(n); |
| 268 |
} |
| 269 |
function F() { |
| 270 |
function t(n, r) { |
| 271 |
var t = s[n]; |
| 272 |
return t ? t.enumerable = r : s[n] = t = { |
| 273 |
configurable: !0, |
| 274 |
enumerable: r, |
| 275 |
get: function() { |
| 276 |
var r = this[Q]; |
| 277 |
return f(r), en.get(r, n); |
| 278 |
}, |
| 279 |
set: function(r) { |
| 280 |
var t = this[Q]; |
| 281 |
f(t), en.set(t, n, r); |
| 282 |
} |
| 283 |
}, t; |
| 284 |
} |
| 285 |
function e(n) { |
| 286 |
for (var r = n.length - 1; r >= 0; r--) { |
| 287 |
var t = n[r][Q]; |
| 288 |
if (!t.P) switch (t.i) { |
| 289 |
case 5: |
| 290 |
a(t) && k(t); |
| 291 |
break; |
| 292 |
case 4: o(t) && k(t); |
| 293 |
} |
| 294 |
} |
| 295 |
} |
| 296 |
function o(n) { |
| 297 |
for (var r = n.t, t = n.k, e = nn(t), i = e.length - 1; i >= 0; i--) { |
| 298 |
var o = e[i]; |
| 299 |
if (o !== Q) { |
| 300 |
var a = r[o]; |
| 301 |
if (void 0 === a && !u(r, o)) return !0; |
| 302 |
var f = t[o]; |
| 303 |
var s = f && f[Q]; |
| 304 |
if (s ? s.t !== a : !c(f, a)) return !0; |
| 305 |
} |
| 306 |
} |
| 307 |
var v = !!r[Q]; |
| 308 |
return e.length !== nn(r).length + (v ? 0 : 1); |
| 309 |
} |
| 310 |
function a(n) { |
| 311 |
var r = n.k; |
| 312 |
if (r.length !== n.t.length) return !0; |
| 313 |
var t = Object.getOwnPropertyDescriptor(r, r.length - 1); |
| 314 |
if (t && !t.get) return !0; |
| 315 |
for (var e = 0; e < r.length; e++) if (!r.hasOwnProperty(e)) return !0; |
| 316 |
return !1; |
| 317 |
} |
| 318 |
function f(r) { |
| 319 |
r.g && n(3, JSON.stringify(p(r))); |
| 320 |
} |
| 321 |
var s = {}; |
| 322 |
m("ES5", { |
| 323 |
J: function(n, r) { |
| 324 |
var e = Array.isArray(n); |
| 325 |
var i = function(n, r) { |
| 326 |
if (n) { |
| 327 |
for (var e = Array(r.length), i = 0; i < r.length; i++) Object.defineProperty(e, "" + i, t(i, !0)); |
| 328 |
return e; |
| 329 |
} |
| 330 |
var o = rn(r); |
| 331 |
delete o[Q]; |
| 332 |
for (var u = nn(o), a = 0; a < u.length; a++) { |
| 333 |
var f = u[a]; |
| 334 |
o[f] = t(f, n || !!o[f].enumerable); |
| 335 |
} |
| 336 |
return Object.create(Object.getPrototypeOf(r), o); |
| 337 |
}(e, n); |
| 338 |
var o = { |
| 339 |
i: e ? 5 : 4, |
| 340 |
A: r ? r.A : _(), |
| 341 |
P: !1, |
| 342 |
I: !1, |
| 343 |
R: {}, |
| 344 |
l: r, |
| 345 |
t: n, |
| 346 |
k: i, |
| 347 |
o: null, |
| 348 |
g: !1, |
| 349 |
C: !1 |
| 350 |
}; |
| 351 |
return Object.defineProperty(i, Q, { |
| 352 |
value: o, |
| 353 |
writable: !0 |
| 354 |
}), i; |
| 355 |
}, |
| 356 |
S: function(n, t, o) { |
| 357 |
o ? r(t) && t[Q].A === n && e(n.p) : (n.u && function n(r) { |
| 358 |
if (r && "object" == typeof r) { |
| 359 |
var t = r[Q]; |
| 360 |
if (t) { |
| 361 |
var e = t.t; |
| 362 |
var o = t.k; |
| 363 |
var f = t.R; |
| 364 |
var c = t.i; |
| 365 |
if (4 === c) i(o, (function(r) { |
| 366 |
r !== Q && (void 0 !== e[r] || u(e, r) ? f[r] || n(o[r]) : (f[r] = !0, k(t))); |
| 367 |
})), i(e, (function(n) { |
| 368 |
void 0 !== o[n] || u(o, n) || (f[n] = !1, k(t)); |
| 369 |
})); |
| 370 |
else if (5 === c) { |
| 371 |
if (a(t) && (k(t), f.length = !0), o.length < e.length) for (var s = o.length; s < e.length; s++) f[s] = !1; |
| 372 |
else for (var v = e.length; v < o.length; v++) f[v] = !0; |
| 373 |
for (var p = Math.min(o.length, e.length), l = 0; l < p; l++) o.hasOwnProperty(l) || (f[l] = !0), void 0 === f[l] && n(o[l]); |
| 374 |
} |
| 375 |
} |
| 376 |
} |
| 377 |
}(n.p[0]), e(n.p)); |
| 378 |
}, |
| 379 |
K: function(n) { |
| 380 |
return 4 === n.i ? o(n) : a(n); |
| 381 |
} |
| 382 |
}); |
| 383 |
} |
| 384 |
var G; |
| 385 |
var U; |
| 386 |
var W = "undefined" != typeof Symbol && "symbol" == typeof Symbol("x"); |
| 387 |
var X = "undefined" != typeof Map; |
| 388 |
var q = "undefined" != typeof Set; |
| 389 |
var B = "undefined" != typeof Proxy && void 0 !== Proxy.revocable && "undefined" != typeof Reflect; |
| 390 |
var H = W ? Symbol.for("immer-nothing") : ((G = {})["immer-nothing"] = !0, G); |
| 391 |
var L = W ? Symbol.for("immer-draftable") : "__$immer_draftable"; |
| 392 |
var Q = W ? Symbol.for("immer-state") : "__$immer_state"; |
| 393 |
var Y = { |
| 394 |
0: "Illegal state", |
| 395 |
1: "Immer drafts cannot have computed properties", |
| 396 |
2: "This object has been frozen and should not be mutated", |
| 397 |
3: function(n) { |
| 398 |
return "Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? " + n; |
| 399 |
}, |
| 400 |
4: "An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.", |
| 401 |
5: "Immer forbids circular references", |
| 402 |
6: "The first or second argument to `produce` must be a function", |
| 403 |
7: "The third argument to `produce` must be a function or undefined", |
| 404 |
8: "First argument to `createDraft` must be a plain object, an array, or an immerable object", |
| 405 |
9: "First argument to `finishDraft` must be a draft returned by `createDraft`", |
| 406 |
10: "The given draft is already finalized", |
| 407 |
11: "Object.defineProperty() cannot be used on an Immer draft", |
| 408 |
12: "Object.setPrototypeOf() cannot be used on an Immer draft", |
| 409 |
13: "Immer only supports deleting array indices", |
| 410 |
14: "Immer only supports setting array indices and the 'length' property", |
| 411 |
15: function(n) { |
| 412 |
return "Cannot apply patch, path doesn't resolve: " + n; |
| 413 |
}, |
| 414 |
16: "Sets cannot have \"replace\" patches.", |
| 415 |
17: function(n) { |
| 416 |
return "Unsupported patch operation: " + n; |
| 417 |
}, |
| 418 |
18: function(n) { |
| 419 |
return "The plugin for '" + n + "' has not been loaded into Immer. To enable the plugin, import and call `enable" + n + "()` when initializing your application."; |
| 420 |
}, |
| 421 |
20: "Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available", |
| 422 |
21: function(n) { |
| 423 |
return "produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '" + n + "'"; |
| 424 |
}, |
| 425 |
22: function(n) { |
| 426 |
return "'current' expects a draft, got: " + n; |
| 427 |
}, |
| 428 |
23: function(n) { |
| 429 |
return "'original' expects a draft, got: " + n; |
| 430 |
}, |
| 431 |
24: "Patching reserved attributes like __proto__, prototype and constructor is not allowed" |
| 432 |
}; |
| 433 |
var Z = "" + Object.prototype.constructor; |
| 434 |
var nn = "undefined" != typeof Reflect && Reflect.ownKeys ? Reflect.ownKeys : void 0 !== Object.getOwnPropertySymbols ? function(n) { |
| 435 |
return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n)); |
| 436 |
} : Object.getOwnPropertyNames; |
| 437 |
var rn = Object.getOwnPropertyDescriptors || function(n) { |
| 438 |
var r = {}; |
| 439 |
return nn(n).forEach((function(t) { |
| 440 |
r[t] = Object.getOwnPropertyDescriptor(n, t); |
| 441 |
})), r; |
| 442 |
}; |
| 443 |
var tn = {}; |
| 444 |
var en = { |
| 445 |
get: function(n, r) { |
| 446 |
if (r === Q) return n; |
| 447 |
var e = p(n); |
| 448 |
if (!u(e, r)) return function(n, r, t) { |
| 449 |
var e; |
| 450 |
var i = I(r, t); |
| 451 |
return i ? "value" in i ? i.value : null === (e = i.get) || void 0 === e ? void 0 : e.call(n.k) : void 0; |
| 452 |
}(n, e, r); |
| 453 |
var i = e[r]; |
| 454 |
return n.I || !t(i) ? i : i === z(n.t, r) ? (E(n), n.o[r] = N(n.A.h, i, n)) : i; |
| 455 |
}, |
| 456 |
has: function(n, r) { |
| 457 |
return r in p(n); |
| 458 |
}, |
| 459 |
ownKeys: function(n) { |
| 460 |
return Reflect.ownKeys(p(n)); |
| 461 |
}, |
| 462 |
set: function(n, r, t) { |
| 463 |
var e = I(p(n), r); |
| 464 |
if (null == e ? void 0 : e.set) return e.set.call(n.k, t), !0; |
| 465 |
if (!n.P) { |
| 466 |
var i = z(p(n), r); |
| 467 |
var o = null == i ? void 0 : i[Q]; |
| 468 |
if (o && o.t === t) return n.o[r] = t, n.R[r] = !1, !0; |
| 469 |
if (c(t, i) && (void 0 !== t || u(n.t, r))) return !0; |
| 470 |
E(n), k(n); |
| 471 |
} |
| 472 |
return n.o[r] === t && (void 0 !== t || r in n.o) || Number.isNaN(t) && Number.isNaN(n.o[r]) || (n.o[r] = t, n.R[r] = !0), !0; |
| 473 |
}, |
| 474 |
deleteProperty: function(n, r) { |
| 475 |
return void 0 !== z(n.t, r) || r in n.t ? (n.R[r] = !1, E(n), k(n)) : delete n.R[r], n.o && delete n.o[r], !0; |
| 476 |
}, |
| 477 |
getOwnPropertyDescriptor: function(n, r) { |
| 478 |
var t = p(n); |
| 479 |
var e = Reflect.getOwnPropertyDescriptor(t, r); |
| 480 |
return e ? { |
| 481 |
writable: !0, |
| 482 |
configurable: 1 !== n.i || "length" !== r, |
| 483 |
enumerable: e.enumerable, |
| 484 |
value: t[r] |
| 485 |
} : e; |
| 486 |
}, |
| 487 |
defineProperty: function() { |
| 488 |
n(11); |
| 489 |
}, |
| 490 |
getPrototypeOf: function(n) { |
| 491 |
return Object.getPrototypeOf(n.t); |
| 492 |
}, |
| 493 |
setPrototypeOf: function() { |
| 494 |
n(12); |
| 495 |
} |
| 496 |
}; |
| 497 |
var on = {}; |
| 498 |
i(en, (function(n, r) { |
| 499 |
on[n] = function() { |
| 500 |
return arguments[0] = arguments[0][0], r.apply(this, arguments); |
| 501 |
}; |
| 502 |
})), on.deleteProperty = function(r, t) { |
| 503 |
return isNaN(parseInt(t)) && n(13), on.set.call(this, r, t, void 0); |
| 504 |
}, on.set = function(r, t, e) { |
| 505 |
return "length" !== t && isNaN(parseInt(t)) && n(14), en.set.call(this, r[0], t, e, r[0]); |
| 506 |
}; |
| 507 |
var un = function() { |
| 508 |
function e(r) { |
| 509 |
var e = this; |
| 510 |
this.O = B, this.D = !0, this.produce = function(r, i, o) { |
| 511 |
if ("function" == typeof r && "function" != typeof i) { |
| 512 |
var u = i; |
| 513 |
i = r; |
| 514 |
var a = e; |
| 515 |
return function(n) { |
| 516 |
var r = this; |
| 517 |
void 0 === n && (n = u); |
| 518 |
for (var t = arguments.length, e = Array(t > 1 ? t - 1 : 0), o = 1; o < t; o++) e[o - 1] = arguments[o]; |
| 519 |
return a.produce(n, (function(n) { |
| 520 |
var t; |
| 521 |
return (t = i).call.apply(t, [r, n].concat(e)); |
| 522 |
})); |
| 523 |
}; |
| 524 |
} |
| 525 |
var f; |
| 526 |
if ("function" != typeof i && n(6), void 0 !== o && "function" != typeof o && n(7), t(r)) { |
| 527 |
var c = w(e); |
| 528 |
var s = N(e, r, void 0); |
| 529 |
var v = !0; |
| 530 |
try { |
| 531 |
f = i(s), v = !1; |
| 532 |
} finally { |
| 533 |
v ? g(c) : O(c); |
| 534 |
} |
| 535 |
return "undefined" != typeof Promise && f instanceof Promise ? f.then((function(n) { |
| 536 |
return j(c, o), P(n, c); |
| 537 |
}), (function(n) { |
| 538 |
throw g(c), n; |
| 539 |
})) : (j(c, o), P(f, c)); |
| 540 |
} |
| 541 |
if (!r || "object" != typeof r) { |
| 542 |
if (void 0 === (f = i(r)) && (f = r), f === H && (f = void 0), e.D && d(f, !0), o) { |
| 543 |
var p = []; |
| 544 |
var l = []; |
| 545 |
b("Patches").M(r, f, p, l), o(p, l); |
| 546 |
} |
| 547 |
return f; |
| 548 |
} |
| 549 |
n(21, r); |
| 550 |
}, this.produceWithPatches = function(n, r) { |
| 551 |
if ("function" == typeof n) return function(r) { |
| 552 |
for (var t = arguments.length, i = Array(t > 1 ? t - 1 : 0), o = 1; o < t; o++) i[o - 1] = arguments[o]; |
| 553 |
return e.produceWithPatches(r, (function(r) { |
| 554 |
return n.apply(void 0, [r].concat(i)); |
| 555 |
})); |
| 556 |
}; |
| 557 |
var t; |
| 558 |
var i; |
| 559 |
var o = e.produce(n, r, (function(n, r) { |
| 560 |
t = n, i = r; |
| 561 |
})); |
| 562 |
return "undefined" != typeof Promise && o instanceof Promise ? o.then((function(n) { |
| 563 |
return [ |
| 564 |
n, |
| 565 |
t, |
| 566 |
i |
| 567 |
]; |
| 568 |
})) : [ |
| 569 |
o, |
| 570 |
t, |
| 571 |
i |
| 572 |
]; |
| 573 |
}, "boolean" == typeof (null == r ? void 0 : r.useProxies) && this.setUseProxies(r.useProxies), "boolean" == typeof (null == r ? void 0 : r.autoFreeze) && this.setAutoFreeze(r.autoFreeze); |
| 574 |
} |
| 575 |
var i = e.prototype; |
| 576 |
return i.createDraft = function(e) { |
| 577 |
t(e) || n(8), r(e) && (e = R(e)); |
| 578 |
var i = w(this); |
| 579 |
var o = N(this, e, void 0); |
| 580 |
return o[Q].C = !0, O(i), o; |
| 581 |
}, i.finishDraft = function(r, t) { |
| 582 |
var e = r && r[Q]; |
| 583 |
e && e.C || n(9), e.I && n(10); |
| 584 |
var i = e.A; |
| 585 |
return j(i, t), P(void 0, i); |
| 586 |
}, i.setAutoFreeze = function(n) { |
| 587 |
this.D = n; |
| 588 |
}, i.setUseProxies = function(r) { |
| 589 |
r && !B && n(20), this.O = r; |
| 590 |
}, i.applyPatches = function(n, t) { |
| 591 |
var e; |
| 592 |
for (e = t.length - 1; e >= 0; e--) { |
| 593 |
var i = t[e]; |
| 594 |
if (0 === i.path.length && "replace" === i.op) { |
| 595 |
n = i.value; |
| 596 |
break; |
| 597 |
} |
| 598 |
} |
| 599 |
e > -1 && (t = t.slice(e + 1)); |
| 600 |
var o = b("Patches").$; |
| 601 |
return r(n) ? o(n, t) : this.produce(n, (function(n) { |
| 602 |
return o(n, t); |
| 603 |
})); |
| 604 |
}, e; |
| 605 |
}(); |
| 606 |
var an = new un(); |
| 607 |
var fn = an.produce; |
| 608 |
var cn = an.produceWithPatches.bind(an); |
| 609 |
var sn = an.setAutoFreeze.bind(an); |
| 610 |
var vn = an.setUseProxies.bind(an); |
| 611 |
var pn = an.applyPatches.bind(an); |
| 612 |
var ln = an.createDraft.bind(an); |
| 613 |
var dn = an.finishDraft.bind(an); |
| 614 |
|
| 615 |
//#endregion |
| 616 |
//#region node_modules/@babel/runtime/helpers/esm/typeof.js |
| 617 |
function _typeof(o) { |
| 618 |
"@babel/helpers - typeof"; |
| 619 |
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) { |
| 620 |
return typeof o; |
| 621 |
} : function(o) { |
| 622 |
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; |
| 623 |
}, _typeof(o); |
| 624 |
} |
| 625 |
|
| 626 |
//#endregion |
| 627 |
//#region node_modules/@babel/runtime/helpers/esm/toPrimitive.js |
| 628 |
function toPrimitive(t, r) { |
| 629 |
if ("object" != _typeof(t) || !t) return t; |
| 630 |
var e = t[Symbol.toPrimitive]; |
| 631 |
if (void 0 !== e) { |
| 632 |
var i = e.call(t, r || "default"); |
| 633 |
if ("object" != _typeof(i)) return i; |
| 634 |
throw new TypeError("@@toPrimitive must return a primitive value."); |
| 635 |
} |
| 636 |
return ("string" === r ? String : Number)(t); |
| 637 |
} |
| 638 |
|
| 639 |
//#endregion |
| 640 |
//#region node_modules/@babel/runtime/helpers/esm/toPropertyKey.js |
| 641 |
function toPropertyKey(t) { |
| 642 |
var i = toPrimitive(t, "string"); |
| 643 |
return "symbol" == _typeof(i) ? i : i + ""; |
| 644 |
} |
| 645 |
|
| 646 |
//#endregion |
| 647 |
//#region node_modules/@babel/runtime/helpers/esm/defineProperty.js |
| 648 |
function _defineProperty(e, r, t) { |
| 649 |
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, { |
| 650 |
value: t, |
| 651 |
enumerable: !0, |
| 652 |
configurable: !0, |
| 653 |
writable: !0 |
| 654 |
}) : e[r] = t, e; |
| 655 |
} |
| 656 |
|
| 657 |
//#endregion |
| 658 |
//#region node_modules/@babel/runtime/helpers/esm/objectSpread2.js |
| 659 |
function ownKeys(e, r) { |
| 660 |
var t = Object.keys(e); |
| 661 |
if (Object.getOwnPropertySymbols) { |
| 662 |
var o = Object.getOwnPropertySymbols(e); |
| 663 |
r && (o = o.filter(function(r) { |
| 664 |
return Object.getOwnPropertyDescriptor(e, r).enumerable; |
| 665 |
})), t.push.apply(t, o); |
| 666 |
} |
| 667 |
return t; |
| 668 |
} |
| 669 |
function _objectSpread2(e) { |
| 670 |
for (var r = 1; r < arguments.length; r++) { |
| 671 |
var t = null != arguments[r] ? arguments[r] : {}; |
| 672 |
r % 2 ? ownKeys(Object(t), !0).forEach(function(r) { |
| 673 |
_defineProperty(e, r, t[r]); |
| 674 |
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) { |
| 675 |
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); |
| 676 |
}); |
| 677 |
} |
| 678 |
return e; |
| 679 |
} |
| 680 |
|
| 681 |
//#endregion |
| 682 |
//#region node_modules/redux/es/redux.js |
| 683 |
var $$observable = (function() { |
| 684 |
return typeof Symbol === "function" && Symbol.observable || "@@observable"; |
| 685 |
})(); |
| 686 |
/** |
| 687 |
* These are private action types reserved by Redux. |
| 688 |
* For any unknown actions, you must return the current state. |
| 689 |
* If the current state is undefined, you must return the initial state. |
| 690 |
* Do not reference these action types directly in your code. |
| 691 |
*/ |
| 692 |
var randomString = function randomString() { |
| 693 |
return Math.random().toString(36).substring(7).split("").join("."); |
| 694 |
}; |
| 695 |
var ActionTypes = { |
| 696 |
INIT: "@@redux/INIT" + randomString(), |
| 697 |
REPLACE: "@@redux/REPLACE" + randomString(), |
| 698 |
PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() { |
| 699 |
return "@@redux/PROBE_UNKNOWN_ACTION" + randomString(); |
| 700 |
} |
| 701 |
}; |
| 702 |
/** |
| 703 |
* @param {any} obj The object to inspect. |
| 704 |
* @returns {boolean} True if the argument appears to be a plain object. |
| 705 |
*/ |
| 706 |
function isPlainObject$2(obj) { |
| 707 |
if (typeof obj !== "object" || obj === null) return false; |
| 708 |
var proto = obj; |
| 709 |
while (Object.getPrototypeOf(proto) !== null) proto = Object.getPrototypeOf(proto); |
| 710 |
return Object.getPrototypeOf(obj) === proto; |
| 711 |
} |
| 712 |
__name(isPlainObject$2, "isPlainObject"); |
| 713 |
function miniKindOf(val) { |
| 714 |
if (val === void 0) return "undefined"; |
| 715 |
if (val === null) return "null"; |
| 716 |
var type = typeof val; |
| 717 |
switch (type) { |
| 718 |
case "boolean": |
| 719 |
case "string": |
| 720 |
case "number": |
| 721 |
case "symbol": |
| 722 |
case "function": return type; |
| 723 |
} |
| 724 |
if (Array.isArray(val)) return "array"; |
| 725 |
if (isDate(val)) return "date"; |
| 726 |
if (isError(val)) return "error"; |
| 727 |
var constructorName = ctorName(val); |
| 728 |
switch (constructorName) { |
| 729 |
case "Symbol": |
| 730 |
case "Promise": |
| 731 |
case "WeakMap": |
| 732 |
case "WeakSet": |
| 733 |
case "Map": |
| 734 |
case "Set": return constructorName; |
| 735 |
} |
| 736 |
return type.slice(8, -1).toLowerCase().replace(/\s/g, ""); |
| 737 |
} |
| 738 |
function ctorName(val) { |
| 739 |
return typeof val.constructor === "function" ? val.constructor.name : null; |
| 740 |
} |
| 741 |
function isError(val) { |
| 742 |
return val instanceof Error || typeof val.message === "string" && val.constructor && typeof val.constructor.stackTraceLimit === "number"; |
| 743 |
} |
| 744 |
function isDate(val) { |
| 745 |
if (val instanceof Date) return true; |
| 746 |
return typeof val.toDateString === "function" && typeof val.getDate === "function" && typeof val.setDate === "function"; |
| 747 |
} |
| 748 |
function kindOf(val) { |
| 749 |
var typeOfVal = typeof val; |
| 750 |
typeOfVal = miniKindOf(val); |
| 751 |
return typeOfVal; |
| 752 |
} |
| 753 |
/** |
| 754 |
* @deprecated |
| 755 |
* |
| 756 |
* **We recommend using the `configureStore` method |
| 757 |
* of the `@reduxjs/toolkit` package**, which replaces `createStore`. |
| 758 |
* |
| 759 |
* Redux Toolkit is our recommended approach for writing Redux logic today, |
| 760 |
* including store setup, reducers, data fetching, and more. |
| 761 |
* |
| 762 |
* **For more details, please read this Redux docs page:** |
| 763 |
* **https://redux.js.org/introduction/why-rtk-is-redux-today** |
| 764 |
* |
| 765 |
* `configureStore` from Redux Toolkit is an improved version of `createStore` that |
| 766 |
* simplifies setup and helps avoid common bugs. |
| 767 |
* |
| 768 |
* You should not be using the `redux` core package by itself today, except for learning purposes. |
| 769 |
* The `createStore` method from the core `redux` package will not be removed, but we encourage |
| 770 |
* all users to migrate to using Redux Toolkit for all Redux code. |
| 771 |
* |
| 772 |
* If you want to use `createStore` without this visual deprecation warning, use |
| 773 |
* the `legacy_createStore` import instead: |
| 774 |
* |
| 775 |
* `import { legacy_createStore as createStore} from 'redux'` |
| 776 |
* |
| 777 |
*/ |
| 778 |
function createStore(reducer, preloadedState, enhancer) { |
| 779 |
var _ref2; |
| 780 |
if (typeof preloadedState === "function" && typeof enhancer === "function" || typeof enhancer === "function" && typeof arguments[3] === "function") throw new Error("It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example."); |
| 781 |
if (typeof preloadedState === "function" && typeof enhancer === "undefined") { |
| 782 |
enhancer = preloadedState; |
| 783 |
preloadedState = void 0; |
| 784 |
} |
| 785 |
if (typeof enhancer !== "undefined") { |
| 786 |
if (typeof enhancer !== "function") throw new Error("Expected the enhancer to be a function. Instead, received: '" + kindOf(enhancer) + "'"); |
| 787 |
return enhancer(createStore)(reducer, preloadedState); |
| 788 |
} |
| 789 |
if (typeof reducer !== "function") throw new Error("Expected the root reducer to be a function. Instead, received: '" + kindOf(reducer) + "'"); |
| 790 |
var currentReducer = reducer; |
| 791 |
var currentState = preloadedState; |
| 792 |
var currentListeners = []; |
| 793 |
var nextListeners = currentListeners; |
| 794 |
var isDispatching = false; |
| 795 |
/** |
| 796 |
* This makes a shallow copy of currentListeners so we can use |
| 797 |
* nextListeners as a temporary list while dispatching. |
| 798 |
* |
| 799 |
* This prevents any bugs around consumers calling |
| 800 |
* subscribe/unsubscribe in the middle of a dispatch. |
| 801 |
*/ |
| 802 |
function ensureCanMutateNextListeners() { |
| 803 |
if (nextListeners === currentListeners) nextListeners = currentListeners.slice(); |
| 804 |
} |
| 805 |
/** |
| 806 |
* Reads the state tree managed by the store. |
| 807 |
* |
| 808 |
* @returns {any} The current state tree of your application. |
| 809 |
*/ |
| 810 |
function getState() { |
| 811 |
if (isDispatching) throw new Error("You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store."); |
| 812 |
return currentState; |
| 813 |
} |
| 814 |
/** |
| 815 |
* Adds a change listener. It will be called any time an action is dispatched, |
| 816 |
* and some part of the state tree may potentially have changed. You may then |
| 817 |
* call `getState()` to read the current state tree inside the callback. |
| 818 |
* |
| 819 |
* You may call `dispatch()` from a change listener, with the following |
| 820 |
* caveats: |
| 821 |
* |
| 822 |
* 1. The subscriptions are snapshotted just before every `dispatch()` call. |
| 823 |
* If you subscribe or unsubscribe while the listeners are being invoked, this |
| 824 |
* will not have any effect on the `dispatch()` that is currently in progress. |
| 825 |
* However, the next `dispatch()` call, whether nested or not, will use a more |
| 826 |
* recent snapshot of the subscription list. |
| 827 |
* |
| 828 |
* 2. The listener should not expect to see all state changes, as the state |
| 829 |
* might have been updated multiple times during a nested `dispatch()` before |
| 830 |
* the listener is called. It is, however, guaranteed that all subscribers |
| 831 |
* registered before the `dispatch()` started will be called with the latest |
| 832 |
* state by the time it exits. |
| 833 |
* |
| 834 |
* @param {Function} listener A callback to be invoked on every dispatch. |
| 835 |
* @returns {Function} A function to remove this change listener. |
| 836 |
*/ |
| 837 |
function subscribe(listener) { |
| 838 |
if (typeof listener !== "function") throw new Error("Expected the listener to be a function. Instead, received: '" + kindOf(listener) + "'"); |
| 839 |
if (isDispatching) throw new Error("You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details."); |
| 840 |
var isSubscribed = true; |
| 841 |
ensureCanMutateNextListeners(); |
| 842 |
nextListeners.push(listener); |
| 843 |
return function unsubscribe() { |
| 844 |
if (!isSubscribed) return; |
| 845 |
if (isDispatching) throw new Error("You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details."); |
| 846 |
isSubscribed = false; |
| 847 |
ensureCanMutateNextListeners(); |
| 848 |
var index = nextListeners.indexOf(listener); |
| 849 |
nextListeners.splice(index, 1); |
| 850 |
currentListeners = null; |
| 851 |
}; |
| 852 |
} |
| 853 |
/** |
| 854 |
* Dispatches an action. It is the only way to trigger a state change. |
| 855 |
* |
| 856 |
* The `reducer` function, used to create the store, will be called with the |
| 857 |
* current state tree and the given `action`. Its return value will |
| 858 |
* be considered the **next** state of the tree, and the change listeners |
| 859 |
* will be notified. |
| 860 |
* |
| 861 |
* The base implementation only supports plain object actions. If you want to |
| 862 |
* dispatch a Promise, an Observable, a thunk, or something else, you need to |
| 863 |
* wrap your store creating function into the corresponding middleware. For |
| 864 |
* example, see the documentation for the `redux-thunk` package. Even the |
| 865 |
* middleware will eventually dispatch plain object actions using this method. |
| 866 |
* |
| 867 |
* @param {Object} action A plain object representing “what changed”. It is |
| 868 |
* a good idea to keep actions serializable so you can record and replay user |
| 869 |
* sessions, or use the time travelling `redux-devtools`. An action must have |
| 870 |
* a `type` property which may not be `undefined`. It is a good idea to use |
| 871 |
* string constants for action types. |
| 872 |
* |
| 873 |
* @returns {Object} For convenience, the same action object you dispatched. |
| 874 |
* |
| 875 |
* Note that, if you use a custom middleware, it may wrap `dispatch()` to |
| 876 |
* return something else (for example, a Promise you can await). |
| 877 |
*/ |
| 878 |
function dispatch(action) { |
| 879 |
if (!isPlainObject$2(action)) throw new Error("Actions must be plain objects. Instead, the actual type was: '" + kindOf(action) + "'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples."); |
| 880 |
if (typeof action.type === "undefined") throw new Error("Actions may not have an undefined \"type\" property. You may have misspelled an action type string constant."); |
| 881 |
if (isDispatching) throw new Error("Reducers may not dispatch actions."); |
| 882 |
try { |
| 883 |
isDispatching = true; |
| 884 |
currentState = currentReducer(currentState, action); |
| 885 |
} finally { |
| 886 |
isDispatching = false; |
| 887 |
} |
| 888 |
var listeners = currentListeners = nextListeners; |
| 889 |
for (var i = 0; i < listeners.length; i++) { |
| 890 |
var listener = listeners[i]; |
| 891 |
listener(); |
| 892 |
} |
| 893 |
return action; |
| 894 |
} |
| 895 |
/** |
| 896 |
* Replaces the reducer currently used by the store to calculate the state. |
| 897 |
* |
| 898 |
* You might need this if your app implements code splitting and you want to |
| 899 |
* load some of the reducers dynamically. You might also need this if you |
| 900 |
* implement a hot reloading mechanism for Redux. |
| 901 |
* |
| 902 |
* @param {Function} nextReducer The reducer for the store to use instead. |
| 903 |
* @returns {void} |
| 904 |
*/ |
| 905 |
function replaceReducer(nextReducer) { |
| 906 |
if (typeof nextReducer !== "function") throw new Error("Expected the nextReducer to be a function. Instead, received: '" + kindOf(nextReducer)); |
| 907 |
currentReducer = nextReducer; |
| 908 |
dispatch({ type: ActionTypes.REPLACE }); |
| 909 |
} |
| 910 |
/** |
| 911 |
* Interoperability point for observable/reactive libraries. |
| 912 |
* @returns {observable} A minimal observable of state changes. |
| 913 |
* For more information, see the observable proposal: |
| 914 |
* https://github.com/tc39/proposal-observable |
| 915 |
*/ |
| 916 |
function observable() { |
| 917 |
var _ref; |
| 918 |
var outerSubscribe = subscribe; |
| 919 |
return _ref = { |
| 920 |
/** |
| 921 |
* The minimal observable subscription method. |
| 922 |
* @param {Object} observer Any object that can be used as an observer. |
| 923 |
* The observer object should have a `next` method. |
| 924 |
* @returns {subscription} An object with an `unsubscribe` method that can |
| 925 |
* be used to unsubscribe the observable from the store, and prevent further |
| 926 |
* emission of values from the observable. |
| 927 |
*/ |
| 928 |
subscribe: function subscribe(observer) { |
| 929 |
if (typeof observer !== "object" || observer === null) throw new Error("Expected the observer to be an object. Instead, received: '" + kindOf(observer) + "'"); |
| 930 |
function observeState() { |
| 931 |
if (observer.next) observer.next(getState()); |
| 932 |
} |
| 933 |
observeState(); |
| 934 |
return { unsubscribe: outerSubscribe(observeState) }; |
| 935 |
} }, _ref[$$observable] = function() { |
| 936 |
return this; |
| 937 |
}, _ref; |
| 938 |
} |
| 939 |
dispatch({ type: ActionTypes.INIT }); |
| 940 |
return _ref2 = { |
| 941 |
dispatch, |
| 942 |
subscribe, |
| 943 |
getState, |
| 944 |
replaceReducer |
| 945 |
}, _ref2[$$observable] = observable, _ref2; |
| 946 |
} |
| 947 |
/** |
| 948 |
* Creates a Redux store that holds the state tree. |
| 949 |
* |
| 950 |
* **We recommend using `configureStore` from the |
| 951 |
* `@reduxjs/toolkit` package**, which replaces `createStore`: |
| 952 |
* **https://redux.js.org/introduction/why-rtk-is-redux-today** |
| 953 |
* |
| 954 |
* The only way to change the data in the store is to call `dispatch()` on it. |
| 955 |
* |
| 956 |
* There should only be a single store in your app. To specify how different |
| 957 |
* parts of the state tree respond to actions, you may combine several reducers |
| 958 |
* into a single reducer function by using `combineReducers`. |
| 959 |
* |
| 960 |
* @param {Function} reducer A function that returns the next state tree, given |
| 961 |
* the current state tree and the action to handle. |
| 962 |
* |
| 963 |
* @param {any} [preloadedState] The initial state. You may optionally specify it |
| 964 |
* to hydrate the state from the server in universal apps, or to restore a |
| 965 |
* previously serialized user session. |
| 966 |
* If you use `combineReducers` to produce the root reducer function, this must be |
| 967 |
* an object with the same shape as `combineReducers` keys. |
| 968 |
* |
| 969 |
* @param {Function} [enhancer] The store enhancer. You may optionally specify it |
| 970 |
* to enhance the store with third-party capabilities such as middleware, |
| 971 |
* time travel, persistence, etc. The only store enhancer that ships with Redux |
| 972 |
* is `applyMiddleware()`. |
| 973 |
* |
| 974 |
* @returns {Store} A Redux store that lets you read the state, dispatch actions |
| 975 |
* and subscribe to changes. |
| 976 |
*/ |
| 977 |
var legacy_createStore = createStore; |
| 978 |
/** |
| 979 |
* Prints a warning in the console if it exists. |
| 980 |
* |
| 981 |
* @param {String} message The warning message. |
| 982 |
* @returns {void} |
| 983 |
*/ |
| 984 |
function warning$1(message) { |
| 985 |
if (typeof console !== "undefined" && typeof console.error === "function") console.error(message); |
| 986 |
try { |
| 987 |
throw new Error(message); |
| 988 |
} catch (e) {} |
| 989 |
} |
| 990 |
__name(warning$1, "warning"); |
| 991 |
function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) { |
| 992 |
var reducerKeys = Object.keys(reducers); |
| 993 |
var argumentName = action && action.type === ActionTypes.INIT ? "preloadedState argument passed to createStore" : "previous state received by the reducer"; |
| 994 |
if (reducerKeys.length === 0) return "Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers."; |
| 995 |
if (!isPlainObject$2(inputState)) return "The " + argumentName + " has unexpected type of \"" + kindOf(inputState) + "\". Expected argument to be an object with the following " + ("keys: \"" + reducerKeys.join("\", \"") + "\""); |
| 996 |
var unexpectedKeys = Object.keys(inputState).filter(function(key) { |
| 997 |
return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]; |
| 998 |
}); |
| 999 |
unexpectedKeys.forEach(function(key) { |
| 1000 |
unexpectedKeyCache[key] = true; |
| 1001 |
}); |
| 1002 |
if (action && action.type === ActionTypes.REPLACE) return; |
| 1003 |
if (unexpectedKeys.length > 0) return "Unexpected " + (unexpectedKeys.length > 1 ? "keys" : "key") + " " + ("\"" + unexpectedKeys.join("\", \"") + "\" found in " + argumentName + ". ") + "Expected to find one of the known reducer keys instead: " + ("\"" + reducerKeys.join("\", \"") + "\". Unexpected keys will be ignored."); |
| 1004 |
} |
| 1005 |
function assertReducerShape(reducers) { |
| 1006 |
Object.keys(reducers).forEach(function(key) { |
| 1007 |
var reducer = reducers[key]; |
| 1008 |
if (typeof reducer(void 0, { type: ActionTypes.INIT }) === "undefined") throw new Error("The slice reducer for key \"" + key + "\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined."); |
| 1009 |
if (typeof reducer(void 0, { type: ActionTypes.PROBE_UNKNOWN_ACTION() }) === "undefined") throw new Error("The slice reducer for key \"" + key + "\" returned undefined when probed with a random type. " + ("Don't try to handle '" + ActionTypes.INIT + "' or other actions in \"redux/*\" ") + "namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null."); |
| 1010 |
}); |
| 1011 |
} |
| 1012 |
/** |
| 1013 |
* Turns an object whose values are different reducer functions, into a single |
| 1014 |
* reducer function. It will call every child reducer, and gather their results |
| 1015 |
* into a single state object, whose keys correspond to the keys of the passed |
| 1016 |
* reducer functions. |
| 1017 |
* |
| 1018 |
* @param {Object} reducers An object whose values correspond to different |
| 1019 |
* reducer functions that need to be combined into one. One handy way to obtain |
| 1020 |
* it is to use ES6 `import * as reducers` syntax. The reducers may never return |
| 1021 |
* undefined for any action. Instead, they should return their initial state |
| 1022 |
* if the state passed to them was undefined, and the current state for any |
| 1023 |
* unrecognized action. |
| 1024 |
* |
| 1025 |
* @returns {Function} A reducer function that invokes every reducer inside the |
| 1026 |
* passed object, and builds a state object with the same shape. |
| 1027 |
*/ |
| 1028 |
function combineReducers(reducers) { |
| 1029 |
var reducerKeys = Object.keys(reducers); |
| 1030 |
var finalReducers = {}; |
| 1031 |
for (var i = 0; i < reducerKeys.length; i++) { |
| 1032 |
var key = reducerKeys[i]; |
| 1033 |
if (typeof reducers[key] === "undefined") warning$1("No reducer provided for key \"" + key + "\""); |
| 1034 |
if (typeof reducers[key] === "function") finalReducers[key] = reducers[key]; |
| 1035 |
} |
| 1036 |
var finalReducerKeys = Object.keys(finalReducers); |
| 1037 |
var unexpectedKeyCache = {}; |
| 1038 |
var shapeAssertionError; |
| 1039 |
try { |
| 1040 |
assertReducerShape(finalReducers); |
| 1041 |
} catch (e) { |
| 1042 |
shapeAssertionError = e; |
| 1043 |
} |
| 1044 |
return function combination(state, action) { |
| 1045 |
if (state === void 0) state = {}; |
| 1046 |
if (shapeAssertionError) throw shapeAssertionError; |
| 1047 |
var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache); |
| 1048 |
if (warningMessage) warning$1(warningMessage); |
| 1049 |
var hasChanged = false; |
| 1050 |
var nextState = {}; |
| 1051 |
for (var _i = 0; _i < finalReducerKeys.length; _i++) { |
| 1052 |
var _key = finalReducerKeys[_i]; |
| 1053 |
var reducer = finalReducers[_key]; |
| 1054 |
var previousStateForKey = state[_key]; |
| 1055 |
var nextStateForKey = reducer(previousStateForKey, action); |
| 1056 |
if (typeof nextStateForKey === "undefined") { |
| 1057 |
var actionType = action && action.type; |
| 1058 |
throw new Error("When called with an action of type " + (actionType ? "\"" + String(actionType) + "\"" : "(unknown type)") + ", the slice reducer for key \"" + _key + "\" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined."); |
| 1059 |
} |
| 1060 |
nextState[_key] = nextStateForKey; |
| 1061 |
hasChanged = hasChanged || nextStateForKey !== previousStateForKey; |
| 1062 |
} |
| 1063 |
hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length; |
| 1064 |
return hasChanged ? nextState : state; |
| 1065 |
}; |
| 1066 |
} |
| 1067 |
function bindActionCreator(actionCreator, dispatch) { |
| 1068 |
return function() { |
| 1069 |
return dispatch(actionCreator.apply(this, arguments)); |
| 1070 |
}; |
| 1071 |
} |
| 1072 |
/** |
| 1073 |
* Turns an object whose values are action creators, into an object with the |
| 1074 |
* same keys, but with every function wrapped into a `dispatch` call so they |
| 1075 |
* may be invoked directly. This is just a convenience method, as you can call |
| 1076 |
* `store.dispatch(MyActionCreators.doSomething())` yourself just fine. |
| 1077 |
* |
| 1078 |
* For convenience, you can also pass an action creator as the first argument, |
| 1079 |
* and get a dispatch wrapped function in return. |
| 1080 |
* |
| 1081 |
* @param {Function|Object} actionCreators An object whose values are action |
| 1082 |
* creator functions. One handy way to obtain it is to use ES6 `import * as` |
| 1083 |
* syntax. You may also pass a single function. |
| 1084 |
* |
| 1085 |
* @param {Function} dispatch The `dispatch` function available on your Redux |
| 1086 |
* store. |
| 1087 |
* |
| 1088 |
* @returns {Function|Object} The object mimicking the original object, but with |
| 1089 |
* every action creator wrapped into the `dispatch` call. If you passed a |
| 1090 |
* function as `actionCreators`, the return value will also be a single |
| 1091 |
* function. |
| 1092 |
*/ |
| 1093 |
function bindActionCreators$1(actionCreators, dispatch) { |
| 1094 |
if (typeof actionCreators === "function") return bindActionCreator(actionCreators, dispatch); |
| 1095 |
if (typeof actionCreators !== "object" || actionCreators === null) throw new Error("bindActionCreators expected an object or a function, but instead received: '" + kindOf(actionCreators) + "'. Did you write \"import ActionCreators from\" instead of \"import * as ActionCreators from\"?"); |
| 1096 |
var boundActionCreators = {}; |
| 1097 |
for (var key in actionCreators) { |
| 1098 |
var actionCreator = actionCreators[key]; |
| 1099 |
if (typeof actionCreator === "function") boundActionCreators[key] = bindActionCreator(actionCreator, dispatch); |
| 1100 |
} |
| 1101 |
return boundActionCreators; |
| 1102 |
} |
| 1103 |
__name(bindActionCreators$1, "bindActionCreators"); |
| 1104 |
/** |
| 1105 |
* Composes single-argument functions from right to left. The rightmost |
| 1106 |
* function can take multiple arguments as it provides the signature for |
| 1107 |
* the resulting composite function. |
| 1108 |
* |
| 1109 |
* @param {...Function} funcs The functions to compose. |
| 1110 |
* @returns {Function} A function obtained by composing the argument functions |
| 1111 |
* from right to left. For example, compose(f, g, h) is identical to doing |
| 1112 |
* (...args) => f(g(h(...args))). |
| 1113 |
*/ |
| 1114 |
function compose() { |
| 1115 |
for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) funcs[_key] = arguments[_key]; |
| 1116 |
if (funcs.length === 0) return function(arg) { |
| 1117 |
return arg; |
| 1118 |
}; |
| 1119 |
if (funcs.length === 1) return funcs[0]; |
| 1120 |
return funcs.reduce(function(a, b) { |
| 1121 |
return function() { |
| 1122 |
return a(b.apply(void 0, arguments)); |
| 1123 |
}; |
| 1124 |
}); |
| 1125 |
} |
| 1126 |
/** |
| 1127 |
* Creates a store enhancer that applies middleware to the dispatch method |
| 1128 |
* of the Redux store. This is handy for a variety of tasks, such as expressing |
| 1129 |
* asynchronous actions in a concise manner, or logging every action payload. |
| 1130 |
* |
| 1131 |
* See `redux-thunk` package as an example of the Redux middleware. |
| 1132 |
* |
| 1133 |
* Because middleware is potentially asynchronous, this should be the first |
| 1134 |
* store enhancer in the composition chain. |
| 1135 |
* |
| 1136 |
* Note that each middleware will be given the `dispatch` and `getState` functions |
| 1137 |
* as named arguments. |
| 1138 |
* |
| 1139 |
* @param {...Function} middlewares The middleware chain to be applied. |
| 1140 |
* @returns {Function} A store enhancer applying the middleware. |
| 1141 |
*/ |
| 1142 |
function applyMiddleware() { |
| 1143 |
for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) middlewares[_key] = arguments[_key]; |
| 1144 |
return function(createStore) { |
| 1145 |
return function() { |
| 1146 |
var store = createStore.apply(void 0, arguments); |
| 1147 |
var _dispatch = function dispatch() { |
| 1148 |
throw new Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch."); |
| 1149 |
}; |
| 1150 |
var middlewareAPI = { |
| 1151 |
getState: store.getState, |
| 1152 |
dispatch: function dispatch() { |
| 1153 |
return _dispatch.apply(void 0, arguments); |
| 1154 |
} |
| 1155 |
}; |
| 1156 |
var chain = middlewares.map(function(middleware) { |
| 1157 |
return middleware(middlewareAPI); |
| 1158 |
}); |
| 1159 |
_dispatch = compose.apply(void 0, chain)(store.dispatch); |
| 1160 |
return _objectSpread2(_objectSpread2({}, store), {}, { dispatch: _dispatch }); |
| 1161 |
}; |
| 1162 |
}; |
| 1163 |
} |
| 1164 |
|
| 1165 |
//#endregion |
| 1166 |
//#region node_modules/reselect/es/defaultMemoize.js |
| 1167 |
var NOT_FOUND = "NOT_FOUND"; |
| 1168 |
function createSingletonCache(equals) { |
| 1169 |
var entry; |
| 1170 |
return { |
| 1171 |
get: function get(key) { |
| 1172 |
if (entry && equals(entry.key, key)) return entry.value; |
| 1173 |
return NOT_FOUND; |
| 1174 |
}, |
| 1175 |
put: function put(key, value) { |
| 1176 |
entry = { |
| 1177 |
key, |
| 1178 |
value |
| 1179 |
}; |
| 1180 |
}, |
| 1181 |
getEntries: function getEntries() { |
| 1182 |
return entry ? [entry] : []; |
| 1183 |
}, |
| 1184 |
clear: function clear() { |
| 1185 |
entry = void 0; |
| 1186 |
} |
| 1187 |
}; |
| 1188 |
} |
| 1189 |
function createLruCache(maxSize, equals) { |
| 1190 |
var entries = []; |
| 1191 |
function get(key) { |
| 1192 |
var cacheIndex = entries.findIndex(function(entry) { |
| 1193 |
return equals(key, entry.key); |
| 1194 |
}); |
| 1195 |
if (cacheIndex > -1) { |
| 1196 |
var entry = entries[cacheIndex]; |
| 1197 |
if (cacheIndex > 0) { |
| 1198 |
entries.splice(cacheIndex, 1); |
| 1199 |
entries.unshift(entry); |
| 1200 |
} |
| 1201 |
return entry.value; |
| 1202 |
} |
| 1203 |
return NOT_FOUND; |
| 1204 |
} |
| 1205 |
function put(key, value) { |
| 1206 |
if (get(key) === NOT_FOUND) { |
| 1207 |
entries.unshift({ |
| 1208 |
key, |
| 1209 |
value |
| 1210 |
}); |
| 1211 |
if (entries.length > maxSize) entries.pop(); |
| 1212 |
} |
| 1213 |
} |
| 1214 |
function getEntries() { |
| 1215 |
return entries; |
| 1216 |
} |
| 1217 |
function clear() { |
| 1218 |
entries = []; |
| 1219 |
} |
| 1220 |
return { |
| 1221 |
get, |
| 1222 |
put, |
| 1223 |
getEntries, |
| 1224 |
clear |
| 1225 |
}; |
| 1226 |
} |
| 1227 |
var defaultEqualityCheck = function defaultEqualityCheck(a, b) { |
| 1228 |
return a === b; |
| 1229 |
}; |
| 1230 |
function createCacheKeyComparator(equalityCheck) { |
| 1231 |
return function areArgumentsShallowlyEqual(prev, next) { |
| 1232 |
if (prev === null || next === null || prev.length !== next.length) return false; |
| 1233 |
var length = prev.length; |
| 1234 |
for (var i = 0; i < length; i++) if (!equalityCheck(prev[i], next[i])) return false; |
| 1235 |
return true; |
| 1236 |
}; |
| 1237 |
} |
| 1238 |
function defaultMemoize(func, equalityCheckOrOptions) { |
| 1239 |
var providedOptions = typeof equalityCheckOrOptions === "object" ? equalityCheckOrOptions : { equalityCheck: equalityCheckOrOptions }; |
| 1240 |
var _providedOptions$equa = providedOptions.equalityCheck; |
| 1241 |
var equalityCheck = _providedOptions$equa === void 0 ? defaultEqualityCheck : _providedOptions$equa; |
| 1242 |
var _providedOptions$maxS = providedOptions.maxSize; |
| 1243 |
var maxSize = _providedOptions$maxS === void 0 ? 1 : _providedOptions$maxS; |
| 1244 |
var resultEqualityCheck = providedOptions.resultEqualityCheck; |
| 1245 |
var comparator = createCacheKeyComparator(equalityCheck); |
| 1246 |
var cache = maxSize === 1 ? createSingletonCache(comparator) : createLruCache(maxSize, comparator); |
| 1247 |
function memoized() { |
| 1248 |
var value = cache.get(arguments); |
| 1249 |
if (value === NOT_FOUND) { |
| 1250 |
value = func.apply(null, arguments); |
| 1251 |
if (resultEqualityCheck) { |
| 1252 |
var matchingEntry = cache.getEntries().find(function(entry) { |
| 1253 |
return resultEqualityCheck(entry.value, value); |
| 1254 |
}); |
| 1255 |
if (matchingEntry) value = matchingEntry.value; |
| 1256 |
} |
| 1257 |
cache.put(arguments, value); |
| 1258 |
} |
| 1259 |
return value; |
| 1260 |
} |
| 1261 |
memoized.clearCache = function() { |
| 1262 |
return cache.clear(); |
| 1263 |
}; |
| 1264 |
return memoized; |
| 1265 |
} |
| 1266 |
|
| 1267 |
//#endregion |
| 1268 |
//#region node_modules/reselect/es/index.js |
| 1269 |
function getDependencies(funcs) { |
| 1270 |
var dependencies = Array.isArray(funcs[0]) ? funcs[0] : funcs; |
| 1271 |
if (!dependencies.every(function(dep) { |
| 1272 |
return typeof dep === "function"; |
| 1273 |
})) { |
| 1274 |
var dependencyTypes = dependencies.map(function(dep) { |
| 1275 |
return typeof dep === "function" ? "function " + (dep.name || "unnamed") + "()" : typeof dep; |
| 1276 |
}).join(", "); |
| 1277 |
throw new Error("createSelector expects all input-selectors to be functions, but received the following types: [" + dependencyTypes + "]"); |
| 1278 |
} |
| 1279 |
return dependencies; |
| 1280 |
} |
| 1281 |
function createSelectorCreator(memoize) { |
| 1282 |
for (var _len = arguments.length, memoizeOptionsFromArgs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) memoizeOptionsFromArgs[_key - 1] = arguments[_key]; |
| 1283 |
return function createSelector() { |
| 1284 |
for (var _len2 = arguments.length, funcs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) funcs[_key2] = arguments[_key2]; |
| 1285 |
var _recomputations = 0; |
| 1286 |
var _lastResult; |
| 1287 |
var directlyPassedOptions = { memoizeOptions: void 0 }; |
| 1288 |
var resultFunc = funcs.pop(); |
| 1289 |
if (typeof resultFunc === "object") { |
| 1290 |
directlyPassedOptions = resultFunc; |
| 1291 |
resultFunc = funcs.pop(); |
| 1292 |
} |
| 1293 |
if (typeof resultFunc !== "function") throw new Error("createSelector expects an output function after the inputs, but received: [" + typeof resultFunc + "]"); |
| 1294 |
var _directlyPassedOption2 = directlyPassedOptions.memoizeOptions; |
| 1295 |
var memoizeOptions = _directlyPassedOption2 === void 0 ? memoizeOptionsFromArgs : _directlyPassedOption2; |
| 1296 |
var finalMemoizeOptions = Array.isArray(memoizeOptions) ? memoizeOptions : [memoizeOptions]; |
| 1297 |
var dependencies = getDependencies(funcs); |
| 1298 |
var memoizedResultFunc = memoize.apply(void 0, [function recomputationWrapper() { |
| 1299 |
_recomputations++; |
| 1300 |
return resultFunc.apply(null, arguments); |
| 1301 |
}].concat(finalMemoizeOptions)); |
| 1302 |
var selector = memoize(function dependenciesChecker() { |
| 1303 |
var params = []; |
| 1304 |
var length = dependencies.length; |
| 1305 |
for (var i = 0; i < length; i++) params.push(dependencies[i].apply(null, arguments)); |
| 1306 |
_lastResult = memoizedResultFunc.apply(null, params); |
| 1307 |
return _lastResult; |
| 1308 |
}); |
| 1309 |
Object.assign(selector, { |
| 1310 |
resultFunc, |
| 1311 |
memoizedResultFunc, |
| 1312 |
dependencies, |
| 1313 |
lastResult: function lastResult() { |
| 1314 |
return _lastResult; |
| 1315 |
}, |
| 1316 |
recomputations: function recomputations() { |
| 1317 |
return _recomputations; |
| 1318 |
}, |
| 1319 |
resetRecomputations: function resetRecomputations() { |
| 1320 |
return _recomputations = 0; |
| 1321 |
} |
| 1322 |
}); |
| 1323 |
return selector; |
| 1324 |
}; |
| 1325 |
} |
| 1326 |
var createSelector = /* #__PURE__ */ createSelectorCreator(defaultMemoize); |
| 1327 |
|
| 1328 |
//#endregion |
| 1329 |
//#region node_modules/redux-thunk/es/index.js |
| 1330 |
/** A function that accepts a potential "extra argument" value to be injected later, |
| 1331 |
* and returns an instance of the thunk middleware that uses that value |
| 1332 |
*/ |
| 1333 |
function createThunkMiddleware(extraArgument) { |
| 1334 |
return function middleware(_ref) { |
| 1335 |
var dispatch = _ref.dispatch; |
| 1336 |
var getState = _ref.getState; |
| 1337 |
return function(next) { |
| 1338 |
return function(action) { |
| 1339 |
if (typeof action === "function") return action(dispatch, getState, extraArgument); |
| 1340 |
return next(action); |
| 1341 |
}; |
| 1342 |
}; |
| 1343 |
}; |
| 1344 |
} |
| 1345 |
var thunk = createThunkMiddleware(); |
| 1346 |
thunk.withExtraArgument = createThunkMiddleware; |
| 1347 |
|
| 1348 |
//#endregion |
| 1349 |
//#region node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js |
| 1350 |
var redux_toolkit_esm_exports = /* @__PURE__ */ __exportAll({ |
| 1351 |
EnhancerArray: () => EnhancerArray, |
| 1352 |
MiddlewareArray: () => MiddlewareArray, |
| 1353 |
SHOULD_AUTOBATCH: () => SHOULD_AUTOBATCH, |
| 1354 |
TaskAbortError: () => TaskAbortError, |
| 1355 |
__DO_NOT_USE__ActionTypes: () => ActionTypes, |
| 1356 |
addListener: () => addListener, |
| 1357 |
applyMiddleware: () => applyMiddleware, |
| 1358 |
autoBatchEnhancer: () => autoBatchEnhancer, |
| 1359 |
bindActionCreators: () => bindActionCreators$1, |
| 1360 |
clearAllListeners: () => clearAllListeners, |
| 1361 |
combineReducers: () => combineReducers, |
| 1362 |
compose: () => compose, |
| 1363 |
configureStore: () => configureStore, |
| 1364 |
createAction: () => createAction, |
| 1365 |
createActionCreatorInvariantMiddleware: () => createActionCreatorInvariantMiddleware, |
| 1366 |
createAsyncThunk: () => createAsyncThunk, |
| 1367 |
createDraftSafeSelector: () => createDraftSafeSelector, |
| 1368 |
createEntityAdapter: () => createEntityAdapter, |
| 1369 |
createImmutableStateInvariantMiddleware: () => createImmutableStateInvariantMiddleware, |
| 1370 |
createListenerMiddleware: () => createListenerMiddleware, |
| 1371 |
createNextState: () => fn, |
| 1372 |
createReducer: () => createReducer, |
| 1373 |
createSelector: () => createSelector, |
| 1374 |
createSerializableStateInvariantMiddleware: () => createSerializableStateInvariantMiddleware, |
| 1375 |
createSlice: () => createSlice, |
| 1376 |
createStore: () => createStore, |
| 1377 |
current: () => R, |
| 1378 |
findNonSerializableValue: () => findNonSerializableValue, |
| 1379 |
freeze: () => d, |
| 1380 |
getDefaultMiddleware: () => getDefaultMiddleware, |
| 1381 |
getType: () => getType, |
| 1382 |
isAction: () => isAction, |
| 1383 |
isActionCreator: () => isActionCreator, |
| 1384 |
isAllOf: () => isAllOf, |
| 1385 |
isAnyOf: () => isAnyOf, |
| 1386 |
isAsyncThunkAction: () => isAsyncThunkAction, |
| 1387 |
isDraft: () => r, |
| 1388 |
isFluxStandardAction: () => isFSA, |
| 1389 |
isFulfilled: () => isFulfilled, |
| 1390 |
isImmutableDefault: () => isImmutableDefault, |
| 1391 |
isPending: () => isPending, |
| 1392 |
isPlain: () => isPlain, |
| 1393 |
isPlainObject: () => isPlainObject$1, |
| 1394 |
isRejected: () => isRejected, |
| 1395 |
isRejectedWithValue: () => isRejectedWithValue, |
| 1396 |
legacy_createStore: () => legacy_createStore, |
| 1397 |
miniSerializeError: () => miniSerializeError, |
| 1398 |
nanoid: () => nanoid, |
| 1399 |
original: () => e, |
| 1400 |
prepareAutoBatched: () => prepareAutoBatched, |
| 1401 |
removeListener: () => removeListener, |
| 1402 |
unwrapResult: () => unwrapResult |
| 1403 |
}); |
| 1404 |
var __extends = void 0 && (void 0).__extends || (function() { |
| 1405 |
var extendStatics = function(d, b) { |
| 1406 |
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) { |
| 1407 |
d.__proto__ = b; |
| 1408 |
} || function(d, b) { |
| 1409 |
for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; |
| 1410 |
}; |
| 1411 |
return extendStatics(d, b); |
| 1412 |
}; |
| 1413 |
return function(d, b) { |
| 1414 |
if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); |
| 1415 |
extendStatics(d, b); |
| 1416 |
function __() { |
| 1417 |
this.constructor = d; |
| 1418 |
} |
| 1419 |
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); |
| 1420 |
}; |
| 1421 |
})(); |
| 1422 |
var __generator = void 0 && (void 0).__generator || function(thisArg, body) { |
| 1423 |
var _ = { |
| 1424 |
label: 0, |
| 1425 |
sent: function() { |
| 1426 |
if (t[0] & 1) throw t[1]; |
| 1427 |
return t[1]; |
| 1428 |
}, |
| 1429 |
trys: [], |
| 1430 |
ops: [] |
| 1431 |
}; |
| 1432 |
var f; |
| 1433 |
var y; |
| 1434 |
var t; |
| 1435 |
var g; |
| 1436 |
return g = { |
| 1437 |
next: verb(0), |
| 1438 |
"throw": verb(1), |
| 1439 |
"return": verb(2) |
| 1440 |
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() { |
| 1441 |
return this; |
| 1442 |
}), g; |
| 1443 |
function verb(n) { |
| 1444 |
return function(v) { |
| 1445 |
return step([n, v]); |
| 1446 |
}; |
| 1447 |
} |
| 1448 |
function step(op) { |
| 1449 |
if (f) throw new TypeError("Generator is already executing."); |
| 1450 |
while (_) try { |
| 1451 |
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; |
| 1452 |
if (y = 0, t) op = [op[0] & 2, t.value]; |
| 1453 |
switch (op[0]) { |
| 1454 |
case 0: |
| 1455 |
case 1: |
| 1456 |
t = op; |
| 1457 |
break; |
| 1458 |
case 4: |
| 1459 |
_.label++; |
| 1460 |
return { |
| 1461 |
value: op[1], |
| 1462 |
done: false |
| 1463 |
}; |
| 1464 |
case 5: |
| 1465 |
_.label++; |
| 1466 |
y = op[1]; |
| 1467 |
op = [0]; |
| 1468 |
continue; |
| 1469 |
case 7: |
| 1470 |
op = _.ops.pop(); |
| 1471 |
_.trys.pop(); |
| 1472 |
continue; |
| 1473 |
default: |
| 1474 |
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { |
| 1475 |
_ = 0; |
| 1476 |
continue; |
| 1477 |
} |
| 1478 |
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { |
| 1479 |
_.label = op[1]; |
| 1480 |
break; |
| 1481 |
} |
| 1482 |
if (op[0] === 6 && _.label < t[1]) { |
| 1483 |
_.label = t[1]; |
| 1484 |
t = op; |
| 1485 |
break; |
| 1486 |
} |
| 1487 |
if (t && _.label < t[2]) { |
| 1488 |
_.label = t[2]; |
| 1489 |
_.ops.push(op); |
| 1490 |
break; |
| 1491 |
} |
| 1492 |
if (t[2]) _.ops.pop(); |
| 1493 |
_.trys.pop(); |
| 1494 |
continue; |
| 1495 |
} |
| 1496 |
op = body.call(thisArg, _); |
| 1497 |
} catch (e) { |
| 1498 |
op = [6, e]; |
| 1499 |
y = 0; |
| 1500 |
} finally { |
| 1501 |
f = t = 0; |
| 1502 |
} |
| 1503 |
if (op[0] & 5) throw op[1]; |
| 1504 |
return { |
| 1505 |
value: op[0] ? op[1] : void 0, |
| 1506 |
done: true |
| 1507 |
}; |
| 1508 |
} |
| 1509 |
}; |
| 1510 |
var __spreadArray = void 0 && (void 0).__spreadArray || function(to, from) { |
| 1511 |
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) to[j] = from[i]; |
| 1512 |
return to; |
| 1513 |
}; |
| 1514 |
var __defProp = Object.defineProperty; |
| 1515 |
var __defProps = Object.defineProperties; |
| 1516 |
var __getOwnPropDescs = Object.getOwnPropertyDescriptors; |
| 1517 |
var __getOwnPropSymbols = Object.getOwnPropertySymbols; |
| 1518 |
var __hasOwnProp = Object.prototype.hasOwnProperty; |
| 1519 |
var __propIsEnum = Object.prototype.propertyIsEnumerable; |
| 1520 |
var __defNormalProp = function(obj, key, value) { |
| 1521 |
return key in obj ? __defProp(obj, key, { |
| 1522 |
enumerable: true, |
| 1523 |
configurable: true, |
| 1524 |
writable: true, |
| 1525 |
value |
| 1526 |
}) : obj[key] = value; |
| 1527 |
}; |
| 1528 |
var __spreadValues = function(a, b) { |
| 1529 |
for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]); |
| 1530 |
if (__getOwnPropSymbols) for (var _i = 0, _c = __getOwnPropSymbols(b); _i < _c.length; _i++) { |
| 1531 |
var prop = _c[_i]; |
| 1532 |
if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]); |
| 1533 |
} |
| 1534 |
return a; |
| 1535 |
}; |
| 1536 |
var __spreadProps = function(a, b) { |
| 1537 |
return __defProps(a, __getOwnPropDescs(b)); |
| 1538 |
}; |
| 1539 |
var __async = function(__this, __arguments, generator) { |
| 1540 |
return new Promise(function(resolve, reject) { |
| 1541 |
var fulfilled = function(value) { |
| 1542 |
try { |
| 1543 |
step(generator.next(value)); |
| 1544 |
} catch (e) { |
| 1545 |
reject(e); |
| 1546 |
} |
| 1547 |
}; |
| 1548 |
var rejected = function(value) { |
| 1549 |
try { |
| 1550 |
step(generator.throw(value)); |
| 1551 |
} catch (e) { |
| 1552 |
reject(e); |
| 1553 |
} |
| 1554 |
}; |
| 1555 |
var step = function(x) { |
| 1556 |
return x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); |
| 1557 |
}; |
| 1558 |
step((generator = generator.apply(__this, __arguments)).next()); |
| 1559 |
}); |
| 1560 |
}; |
| 1561 |
var createDraftSafeSelector = function() { |
| 1562 |
var args = []; |
| 1563 |
for (var _i = 0; _i < arguments.length; _i++) args[_i] = arguments[_i]; |
| 1564 |
var selector = createSelector.apply(void 0, args); |
| 1565 |
var wrappedSelector = function(value) { |
| 1566 |
var rest = []; |
| 1567 |
for (var _i = 1; _i < arguments.length; _i++) rest[_i - 1] = arguments[_i]; |
| 1568 |
return selector.apply(void 0, __spreadArray([r(value) ? R(value) : value], rest)); |
| 1569 |
}; |
| 1570 |
return wrappedSelector; |
| 1571 |
}; |
| 1572 |
var composeWithDevTools = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : function() { |
| 1573 |
if (arguments.length === 0) return void 0; |
| 1574 |
if (typeof arguments[0] === "object") return compose; |
| 1575 |
return compose.apply(null, arguments); |
| 1576 |
}; |
| 1577 |
typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__; |
| 1578 |
function isPlainObject$1(value) { |
| 1579 |
if (typeof value !== "object" || value === null) return false; |
| 1580 |
var proto = Object.getPrototypeOf(value); |
| 1581 |
if (proto === null) return true; |
| 1582 |
var baseProto = proto; |
| 1583 |
while (Object.getPrototypeOf(baseProto) !== null) baseProto = Object.getPrototypeOf(baseProto); |
| 1584 |
return proto === baseProto; |
| 1585 |
} |
| 1586 |
__name(isPlainObject$1, "isPlainObject"); |
| 1587 |
var hasMatchFunction = function(v) { |
| 1588 |
return v && typeof v.match === "function"; |
| 1589 |
}; |
| 1590 |
function createAction(type, prepareAction) { |
| 1591 |
function actionCreator() { |
| 1592 |
var args = []; |
| 1593 |
for (var _i = 0; _i < arguments.length; _i++) args[_i] = arguments[_i]; |
| 1594 |
if (prepareAction) { |
| 1595 |
var prepared = prepareAction.apply(void 0, args); |
| 1596 |
if (!prepared) throw new Error("prepareAction did not return an object"); |
| 1597 |
return __spreadValues(__spreadValues({ |
| 1598 |
type, |
| 1599 |
payload: prepared.payload |
| 1600 |
}, "meta" in prepared && { meta: prepared.meta }), "error" in prepared && { error: prepared.error }); |
| 1601 |
} |
| 1602 |
return { |
| 1603 |
type, |
| 1604 |
payload: args[0] |
| 1605 |
}; |
| 1606 |
} |
| 1607 |
actionCreator.toString = function() { |
| 1608 |
return "" + type; |
| 1609 |
}; |
| 1610 |
actionCreator.type = type; |
| 1611 |
actionCreator.match = function(action) { |
| 1612 |
return action.type === type; |
| 1613 |
}; |
| 1614 |
return actionCreator; |
| 1615 |
} |
| 1616 |
function isAction(action) { |
| 1617 |
return isPlainObject$1(action) && "type" in action; |
| 1618 |
} |
| 1619 |
function isActionCreator(action) { |
| 1620 |
return typeof action === "function" && "type" in action && hasMatchFunction(action); |
| 1621 |
} |
| 1622 |
function isFSA(action) { |
| 1623 |
return isAction(action) && typeof action.type === "string" && Object.keys(action).every(isValidKey); |
| 1624 |
} |
| 1625 |
function isValidKey(key) { |
| 1626 |
return [ |
| 1627 |
"type", |
| 1628 |
"payload", |
| 1629 |
"error", |
| 1630 |
"meta" |
| 1631 |
].indexOf(key) > -1; |
| 1632 |
} |
| 1633 |
function getType(actionCreator) { |
| 1634 |
return "" + actionCreator; |
| 1635 |
} |
| 1636 |
function getMessage(type) { |
| 1637 |
var splitType = type ? ("" + type).split("/") : []; |
| 1638 |
var actionName = splitType[splitType.length - 1] || "actionCreator"; |
| 1639 |
return "Detected an action creator with type \"" + (type || "unknown") + "\" being dispatched. \nMake sure you're calling the action creator before dispatching, i.e. `dispatch(" + actionName + "())` instead of `dispatch(" + actionName + ")`. This is necessary even if the action has no payload."; |
| 1640 |
} |
| 1641 |
function createActionCreatorInvariantMiddleware(options) { |
| 1642 |
if (options === void 0) options = {}; |
| 1643 |
var _c = options.isActionCreator; |
| 1644 |
var isActionCreator2 = _c === void 0 ? isActionCreator : _c; |
| 1645 |
return function() { |
| 1646 |
return function(next) { |
| 1647 |
return function(action) { |
| 1648 |
if (isActionCreator2(action)) console.warn(getMessage(action.type)); |
| 1649 |
return next(action); |
| 1650 |
}; |
| 1651 |
}; |
| 1652 |
}; |
| 1653 |
} |
| 1654 |
function getTimeMeasureUtils(maxDelay, fnName) { |
| 1655 |
var elapsed = 0; |
| 1656 |
return { |
| 1657 |
measureTime: function(fn) { |
| 1658 |
var started = Date.now(); |
| 1659 |
try { |
| 1660 |
return fn(); |
| 1661 |
} finally { |
| 1662 |
elapsed += Date.now() - started; |
| 1663 |
} |
| 1664 |
}, |
| 1665 |
warnIfExceeded: function() { |
| 1666 |
if (elapsed > maxDelay) console.warn(fnName + " took " + elapsed + "ms, which is more than the warning threshold of " + maxDelay + "ms. \nIf your state or actions are very large, you may want to disable the middleware as it might cause too much of a slowdown in development mode. See https://redux-toolkit.js.org/api/getDefaultMiddleware for instructions.\nIt is disabled in production builds, so you don't need to worry about that."); |
| 1667 |
} |
| 1668 |
}; |
| 1669 |
} |
| 1670 |
var MiddlewareArray = function(_super) { |
| 1671 |
__extends(MiddlewareArray, _super); |
| 1672 |
function MiddlewareArray() { |
| 1673 |
var args = []; |
| 1674 |
for (var _i = 0; _i < arguments.length; _i++) args[_i] = arguments[_i]; |
| 1675 |
var _this = _super.apply(this, args) || this; |
| 1676 |
Object.setPrototypeOf(_this, MiddlewareArray.prototype); |
| 1677 |
return _this; |
| 1678 |
} |
| 1679 |
Object.defineProperty(MiddlewareArray, Symbol.species, { |
| 1680 |
get: function() { |
| 1681 |
return MiddlewareArray; |
| 1682 |
}, |
| 1683 |
enumerable: false, |
| 1684 |
configurable: true |
| 1685 |
}); |
| 1686 |
MiddlewareArray.prototype.concat = function() { |
| 1687 |
var arr = []; |
| 1688 |
for (var _i = 0; _i < arguments.length; _i++) arr[_i] = arguments[_i]; |
| 1689 |
return _super.prototype.concat.apply(this, arr); |
| 1690 |
}; |
| 1691 |
MiddlewareArray.prototype.prepend = function() { |
| 1692 |
var arr = []; |
| 1693 |
for (var _i = 0; _i < arguments.length; _i++) arr[_i] = arguments[_i]; |
| 1694 |
if (arr.length === 1 && Array.isArray(arr[0])) return new (MiddlewareArray.bind.apply(MiddlewareArray, __spreadArray([void 0], arr[0].concat(this))))(); |
| 1695 |
return new (MiddlewareArray.bind.apply(MiddlewareArray, __spreadArray([void 0], arr.concat(this))))(); |
| 1696 |
}; |
| 1697 |
return MiddlewareArray; |
| 1698 |
}(Array); |
| 1699 |
var EnhancerArray = function(_super) { |
| 1700 |
__extends(EnhancerArray, _super); |
| 1701 |
function EnhancerArray() { |
| 1702 |
var args = []; |
| 1703 |
for (var _i = 0; _i < arguments.length; _i++) args[_i] = arguments[_i]; |
| 1704 |
var _this = _super.apply(this, args) || this; |
| 1705 |
Object.setPrototypeOf(_this, EnhancerArray.prototype); |
| 1706 |
return _this; |
| 1707 |
} |
| 1708 |
Object.defineProperty(EnhancerArray, Symbol.species, { |
| 1709 |
get: function() { |
| 1710 |
return EnhancerArray; |
| 1711 |
}, |
| 1712 |
enumerable: false, |
| 1713 |
configurable: true |
| 1714 |
}); |
| 1715 |
EnhancerArray.prototype.concat = function() { |
| 1716 |
var arr = []; |
| 1717 |
for (var _i = 0; _i < arguments.length; _i++) arr[_i] = arguments[_i]; |
| 1718 |
return _super.prototype.concat.apply(this, arr); |
| 1719 |
}; |
| 1720 |
EnhancerArray.prototype.prepend = function() { |
| 1721 |
var arr = []; |
| 1722 |
for (var _i = 0; _i < arguments.length; _i++) arr[_i] = arguments[_i]; |
| 1723 |
if (arr.length === 1 && Array.isArray(arr[0])) return new (EnhancerArray.bind.apply(EnhancerArray, __spreadArray([void 0], arr[0].concat(this))))(); |
| 1724 |
return new (EnhancerArray.bind.apply(EnhancerArray, __spreadArray([void 0], arr.concat(this))))(); |
| 1725 |
}; |
| 1726 |
return EnhancerArray; |
| 1727 |
}(Array); |
| 1728 |
function freezeDraftable(val) { |
| 1729 |
return t(val) ? fn(val, function() {}) : val; |
| 1730 |
} |
| 1731 |
var isProduction = false; |
| 1732 |
var prefix = "Invariant failed"; |
| 1733 |
function invariant(condition, message) { |
| 1734 |
if (condition) return; |
| 1735 |
if (isProduction) throw new Error(prefix); |
| 1736 |
throw new Error(prefix + ": " + (message || "")); |
| 1737 |
} |
| 1738 |
function stringify(obj, serializer, indent, decycler) { |
| 1739 |
return JSON.stringify(obj, getSerialize(serializer, decycler), indent); |
| 1740 |
} |
| 1741 |
function getSerialize(serializer, decycler) { |
| 1742 |
var stack = []; |
| 1743 |
var keys = []; |
| 1744 |
if (!decycler) decycler = function(_, value) { |
| 1745 |
if (stack[0] === value) return "[Circular ~]"; |
| 1746 |
return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]"; |
| 1747 |
}; |
| 1748 |
return function(key, value) { |
| 1749 |
if (stack.length > 0) { |
| 1750 |
var thisPos = stack.indexOf(this); |
| 1751 |
~thisPos ? stack.splice(thisPos + 1) : stack.push(this); |
| 1752 |
~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key); |
| 1753 |
if (~stack.indexOf(value)) value = decycler.call(this, key, value); |
| 1754 |
} else stack.push(value); |
| 1755 |
return serializer == null ? value : serializer.call(this, key, value); |
| 1756 |
}; |
| 1757 |
} |
| 1758 |
function isImmutableDefault(value) { |
| 1759 |
return typeof value !== "object" || value == null || Object.isFrozen(value); |
| 1760 |
} |
| 1761 |
function trackForMutations(isImmutable, ignorePaths, obj) { |
| 1762 |
var trackedProperties = trackProperties(isImmutable, ignorePaths, obj); |
| 1763 |
return { detectMutations: function() { |
| 1764 |
return detectMutations(isImmutable, ignorePaths, trackedProperties, obj); |
| 1765 |
} }; |
| 1766 |
} |
| 1767 |
function trackProperties(isImmutable, ignorePaths, obj, path, checkedObjects) { |
| 1768 |
if (ignorePaths === void 0) ignorePaths = []; |
| 1769 |
if (path === void 0) path = ""; |
| 1770 |
if (checkedObjects === void 0) checkedObjects = /* @__PURE__ */ new Set(); |
| 1771 |
var tracked = { value: obj }; |
| 1772 |
if (!isImmutable(obj) && !checkedObjects.has(obj)) { |
| 1773 |
checkedObjects.add(obj); |
| 1774 |
tracked.children = {}; |
| 1775 |
for (var key in obj) { |
| 1776 |
var childPath = path ? path + "." + key : key; |
| 1777 |
if (ignorePaths.length && ignorePaths.indexOf(childPath) !== -1) continue; |
| 1778 |
tracked.children[key] = trackProperties(isImmutable, ignorePaths, obj[key], childPath); |
| 1779 |
} |
| 1780 |
} |
| 1781 |
return tracked; |
| 1782 |
} |
| 1783 |
function detectMutations(isImmutable, ignoredPaths, trackedProperty, obj, sameParentRef, path) { |
| 1784 |
if (ignoredPaths === void 0) ignoredPaths = []; |
| 1785 |
if (sameParentRef === void 0) sameParentRef = false; |
| 1786 |
if (path === void 0) path = ""; |
| 1787 |
var prevObj = trackedProperty ? trackedProperty.value : void 0; |
| 1788 |
var sameRef = prevObj === obj; |
| 1789 |
if (sameParentRef && !sameRef && !Number.isNaN(obj)) return { |
| 1790 |
wasMutated: true, |
| 1791 |
path |
| 1792 |
}; |
| 1793 |
if (isImmutable(prevObj) || isImmutable(obj)) return { wasMutated: false }; |
| 1794 |
var keysToDetect = {}; |
| 1795 |
for (var key in trackedProperty.children) keysToDetect[key] = true; |
| 1796 |
for (var key in obj) keysToDetect[key] = true; |
| 1797 |
var hasIgnoredPaths = ignoredPaths.length > 0; |
| 1798 |
var _loop_1 = function(key) { |
| 1799 |
var nestedPath = path ? path + "." + key : key; |
| 1800 |
if (hasIgnoredPaths) { |
| 1801 |
if (ignoredPaths.some(function(ignored) { |
| 1802 |
if (ignored instanceof RegExp) return ignored.test(nestedPath); |
| 1803 |
return nestedPath === ignored; |
| 1804 |
})) return "continue"; |
| 1805 |
} |
| 1806 |
var result = detectMutations(isImmutable, ignoredPaths, trackedProperty.children[key], obj[key], sameRef, nestedPath); |
| 1807 |
if (result.wasMutated) return { value: result }; |
| 1808 |
}; |
| 1809 |
for (var key in keysToDetect) { |
| 1810 |
var state_1 = _loop_1(key); |
| 1811 |
if (typeof state_1 === "object") return state_1.value; |
| 1812 |
} |
| 1813 |
return { wasMutated: false }; |
| 1814 |
} |
| 1815 |
function createImmutableStateInvariantMiddleware(options) { |
| 1816 |
if (options === void 0) options = {}; |
| 1817 |
var _c = options.isImmutable; |
| 1818 |
var isImmutable = _c === void 0 ? isImmutableDefault : _c; |
| 1819 |
var ignoredPaths = options.ignoredPaths; |
| 1820 |
var _d = options.warnAfter; |
| 1821 |
var warnAfter = _d === void 0 ? 32 : _d; |
| 1822 |
var ignore = options.ignore; |
| 1823 |
ignoredPaths = ignoredPaths || ignore; |
| 1824 |
var track = trackForMutations.bind(null, isImmutable, ignoredPaths); |
| 1825 |
return function(_c) { |
| 1826 |
var getState = _c.getState; |
| 1827 |
var state = getState(); |
| 1828 |
var tracker = track(state); |
| 1829 |
var result; |
| 1830 |
return function(next) { |
| 1831 |
return function(action) { |
| 1832 |
var measureUtils = getTimeMeasureUtils(warnAfter, "ImmutableStateInvariantMiddleware"); |
| 1833 |
measureUtils.measureTime(function() { |
| 1834 |
state = getState(); |
| 1835 |
result = tracker.detectMutations(); |
| 1836 |
tracker = track(state); |
| 1837 |
invariant(!result.wasMutated, "A state mutation was detected between dispatches, in the path '" + (result.path || "") + "'. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)"); |
| 1838 |
}); |
| 1839 |
var dispatchedAction = next(action); |
| 1840 |
measureUtils.measureTime(function() { |
| 1841 |
state = getState(); |
| 1842 |
result = tracker.detectMutations(); |
| 1843 |
tracker = track(state); |
| 1844 |
result.wasMutated && invariant(!result.wasMutated, "A state mutation was detected inside a dispatch, in the path: " + (result.path || "") + ". Take a look at the reducer(s) handling the action " + stringify(action) + ". (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)"); |
| 1845 |
}); |
| 1846 |
measureUtils.warnIfExceeded(); |
| 1847 |
return dispatchedAction; |
| 1848 |
}; |
| 1849 |
}; |
| 1850 |
}; |
| 1851 |
} |
| 1852 |
function isPlain(val) { |
| 1853 |
var type = typeof val; |
| 1854 |
return val == null || type === "string" || type === "boolean" || type === "number" || Array.isArray(val) || isPlainObject$1(val); |
| 1855 |
} |
| 1856 |
function findNonSerializableValue(value, path, isSerializable, getEntries, ignoredPaths, cache) { |
| 1857 |
if (path === void 0) path = ""; |
| 1858 |
if (isSerializable === void 0) isSerializable = isPlain; |
| 1859 |
if (ignoredPaths === void 0) ignoredPaths = []; |
| 1860 |
var foundNestedSerializable; |
| 1861 |
if (!isSerializable(value)) return { |
| 1862 |
keyPath: path || "<root>", |
| 1863 |
value |
| 1864 |
}; |
| 1865 |
if (typeof value !== "object" || value === null) return false; |
| 1866 |
if (cache == null ? void 0 : cache.has(value)) return false; |
| 1867 |
var entries = getEntries != null ? getEntries(value) : Object.entries(value); |
| 1868 |
var hasIgnoredPaths = ignoredPaths.length > 0; |
| 1869 |
var _loop_2 = function(key, nestedValue) { |
| 1870 |
var nestedPath = path ? path + "." + key : key; |
| 1871 |
if (hasIgnoredPaths) { |
| 1872 |
if (ignoredPaths.some(function(ignored) { |
| 1873 |
if (ignored instanceof RegExp) return ignored.test(nestedPath); |
| 1874 |
return nestedPath === ignored; |
| 1875 |
})) return "continue"; |
| 1876 |
} |
| 1877 |
if (!isSerializable(nestedValue)) return { value: { |
| 1878 |
keyPath: nestedPath, |
| 1879 |
value: nestedValue |
| 1880 |
} }; |
| 1881 |
if (typeof nestedValue === "object") { |
| 1882 |
foundNestedSerializable = findNonSerializableValue(nestedValue, nestedPath, isSerializable, getEntries, ignoredPaths, cache); |
| 1883 |
if (foundNestedSerializable) return { value: foundNestedSerializable }; |
| 1884 |
} |
| 1885 |
}; |
| 1886 |
for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) { |
| 1887 |
var _c = entries_1[_i]; |
| 1888 |
var key = _c[0]; |
| 1889 |
var nestedValue = _c[1]; |
| 1890 |
var state_2 = _loop_2(key, nestedValue); |
| 1891 |
if (typeof state_2 === "object") return state_2.value; |
| 1892 |
} |
| 1893 |
if (cache && isNestedFrozen(value)) cache.add(value); |
| 1894 |
return false; |
| 1895 |
} |
| 1896 |
function isNestedFrozen(value) { |
| 1897 |
if (!Object.isFrozen(value)) return false; |
| 1898 |
for (var _i = 0, _c = Object.values(value); _i < _c.length; _i++) { |
| 1899 |
var nestedValue = _c[_i]; |
| 1900 |
if (typeof nestedValue !== "object" || nestedValue === null) continue; |
| 1901 |
if (!isNestedFrozen(nestedValue)) return false; |
| 1902 |
} |
| 1903 |
return true; |
| 1904 |
} |
| 1905 |
function createSerializableStateInvariantMiddleware(options) { |
| 1906 |
if (options === void 0) options = {}; |
| 1907 |
var _c = options.isSerializable; |
| 1908 |
var isSerializable = _c === void 0 ? isPlain : _c; |
| 1909 |
var getEntries = options.getEntries; |
| 1910 |
var _d = options.ignoredActions; |
| 1911 |
var ignoredActions = _d === void 0 ? [] : _d; |
| 1912 |
var _e = options.ignoredActionPaths; |
| 1913 |
var ignoredActionPaths = _e === void 0 ? ["meta.arg", "meta.baseQueryMeta"] : _e; |
| 1914 |
var _f = options.ignoredPaths; |
| 1915 |
var ignoredPaths = _f === void 0 ? [] : _f; |
| 1916 |
var _g = options.warnAfter; |
| 1917 |
var warnAfter = _g === void 0 ? 32 : _g; |
| 1918 |
var _h = options.ignoreState; |
| 1919 |
var ignoreState = _h === void 0 ? false : _h; |
| 1920 |
var _j = options.ignoreActions; |
| 1921 |
var ignoreActions = _j === void 0 ? false : _j; |
| 1922 |
var _k = options.disableCache; |
| 1923 |
var cache = !(_k === void 0 ? false : _k) && WeakSet ? /* @__PURE__ */ new WeakSet() : void 0; |
| 1924 |
return function(storeAPI) { |
| 1925 |
return function(next) { |
| 1926 |
return function(action) { |
| 1927 |
var result = next(action); |
| 1928 |
var measureUtils = getTimeMeasureUtils(warnAfter, "SerializableStateInvariantMiddleware"); |
| 1929 |
if (!ignoreActions && !(ignoredActions.length && ignoredActions.indexOf(action.type) !== -1)) measureUtils.measureTime(function() { |
| 1930 |
var foundActionNonSerializableValue = findNonSerializableValue(action, "", isSerializable, getEntries, ignoredActionPaths, cache); |
| 1931 |
if (foundActionNonSerializableValue) { |
| 1932 |
var keyPath = foundActionNonSerializableValue.keyPath; |
| 1933 |
var value = foundActionNonSerializableValue.value; |
| 1934 |
console.error("A non-serializable value was detected in an action, in the path: `" + keyPath + "`. Value:", value, "\nTake a look at the logic that dispatched this action: ", action, "\n(See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)", "\n(To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)"); |
| 1935 |
} |
| 1936 |
}); |
| 1937 |
if (!ignoreState) { |
| 1938 |
measureUtils.measureTime(function() { |
| 1939 |
var foundStateNonSerializableValue = findNonSerializableValue(storeAPI.getState(), "", isSerializable, getEntries, ignoredPaths, cache); |
| 1940 |
if (foundStateNonSerializableValue) { |
| 1941 |
var keyPath = foundStateNonSerializableValue.keyPath; |
| 1942 |
var value = foundStateNonSerializableValue.value; |
| 1943 |
console.error("A non-serializable value was detected in the state, in the path: `" + keyPath + "`. Value:", value, "\nTake a look at the reducer(s) handling this action type: " + action.type + ".\n(See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)"); |
| 1944 |
} |
| 1945 |
}); |
| 1946 |
measureUtils.warnIfExceeded(); |
| 1947 |
} |
| 1948 |
return result; |
| 1949 |
}; |
| 1950 |
}; |
| 1951 |
}; |
| 1952 |
} |
| 1953 |
function isBoolean(x) { |
| 1954 |
return typeof x === "boolean"; |
| 1955 |
} |
| 1956 |
function curryGetDefaultMiddleware() { |
| 1957 |
return function curriedGetDefaultMiddleware(options) { |
| 1958 |
return getDefaultMiddleware(options); |
| 1959 |
}; |
| 1960 |
} |
| 1961 |
function getDefaultMiddleware(options) { |
| 1962 |
if (options === void 0) options = {}; |
| 1963 |
var _c = options.thunk; |
| 1964 |
var thunk$1 = _c === void 0 ? true : _c; |
| 1965 |
var _d = options.immutableCheck; |
| 1966 |
var immutableCheck = _d === void 0 ? true : _d; |
| 1967 |
var _e = options.serializableCheck; |
| 1968 |
var serializableCheck = _e === void 0 ? true : _e; |
| 1969 |
var _f = options.actionCreatorCheck; |
| 1970 |
var actionCreatorCheck = _f === void 0 ? true : _f; |
| 1971 |
var middlewareArray = new MiddlewareArray(); |
| 1972 |
if (thunk$1) if (isBoolean(thunk$1)) middlewareArray.push(thunk); |
| 1973 |
else middlewareArray.push(thunk.withExtraArgument(thunk$1.extraArgument)); |
| 1974 |
if (immutableCheck) { |
| 1975 |
var immutableOptions = {}; |
| 1976 |
if (!isBoolean(immutableCheck)) immutableOptions = immutableCheck; |
| 1977 |
middlewareArray.unshift(createImmutableStateInvariantMiddleware(immutableOptions)); |
| 1978 |
} |
| 1979 |
if (serializableCheck) { |
| 1980 |
var serializableOptions = {}; |
| 1981 |
if (!isBoolean(serializableCheck)) serializableOptions = serializableCheck; |
| 1982 |
middlewareArray.push(createSerializableStateInvariantMiddleware(serializableOptions)); |
| 1983 |
} |
| 1984 |
if (actionCreatorCheck) { |
| 1985 |
var actionCreatorOptions = {}; |
| 1986 |
if (!isBoolean(actionCreatorCheck)) actionCreatorOptions = actionCreatorCheck; |
| 1987 |
middlewareArray.unshift(createActionCreatorInvariantMiddleware(actionCreatorOptions)); |
| 1988 |
} |
| 1989 |
return middlewareArray; |
| 1990 |
} |
| 1991 |
var IS_PRODUCTION = false; |
| 1992 |
function configureStore(options) { |
| 1993 |
var curriedGetDefaultMiddleware = curryGetDefaultMiddleware(); |
| 1994 |
var _c = options || {}; |
| 1995 |
var _d = _c.reducer; |
| 1996 |
var reducer = _d === void 0 ? void 0 : _d; |
| 1997 |
var _e = _c.middleware; |
| 1998 |
var middleware = _e === void 0 ? curriedGetDefaultMiddleware() : _e; |
| 1999 |
var _f = _c.devTools; |
| 2000 |
var devTools = _f === void 0 ? true : _f; |
| 2001 |
var _g = _c.preloadedState; |
| 2002 |
var preloadedState = _g === void 0 ? void 0 : _g; |
| 2003 |
var _h = _c.enhancers; |
| 2004 |
var enhancers = _h === void 0 ? void 0 : _h; |
| 2005 |
var rootReducer; |
| 2006 |
if (typeof reducer === "function") rootReducer = reducer; |
| 2007 |
else if (isPlainObject$1(reducer)) rootReducer = combineReducers(reducer); |
| 2008 |
else throw new Error("\"reducer\" is a required argument, and must be a function or an object of functions that can be passed to combineReducers"); |
| 2009 |
var finalMiddleware = middleware; |
| 2010 |
if (typeof finalMiddleware === "function") { |
| 2011 |
finalMiddleware = finalMiddleware(curriedGetDefaultMiddleware); |
| 2012 |
if (!IS_PRODUCTION && !Array.isArray(finalMiddleware)) throw new Error("when using a middleware builder function, an array of middleware must be returned"); |
| 2013 |
} |
| 2014 |
if (!IS_PRODUCTION && finalMiddleware.some(function(item) { |
| 2015 |
return typeof item !== "function"; |
| 2016 |
})) throw new Error("each middleware provided to configureStore must be a function"); |
| 2017 |
var middlewareEnhancer = applyMiddleware.apply(void 0, finalMiddleware); |
| 2018 |
var finalCompose = compose; |
| 2019 |
if (devTools) finalCompose = composeWithDevTools(__spreadValues({ trace: !IS_PRODUCTION }, typeof devTools === "object" && devTools)); |
| 2020 |
var defaultEnhancers = new EnhancerArray(middlewareEnhancer); |
| 2021 |
var storeEnhancers = defaultEnhancers; |
| 2022 |
if (Array.isArray(enhancers)) storeEnhancers = __spreadArray([middlewareEnhancer], enhancers); |
| 2023 |
else if (typeof enhancers === "function") storeEnhancers = enhancers(defaultEnhancers); |
| 2024 |
var composedEnhancer = finalCompose.apply(void 0, storeEnhancers); |
| 2025 |
return createStore(rootReducer, preloadedState, composedEnhancer); |
| 2026 |
} |
| 2027 |
function executeReducerBuilderCallback(builderCallback) { |
| 2028 |
var actionsMap = {}; |
| 2029 |
var actionMatchers = []; |
| 2030 |
var defaultCaseReducer; |
| 2031 |
var builder = { |
| 2032 |
addCase: function(typeOrActionCreator, reducer) { |
| 2033 |
if (actionMatchers.length > 0) throw new Error("`builder.addCase` should only be called before calling `builder.addMatcher`"); |
| 2034 |
if (defaultCaseReducer) throw new Error("`builder.addCase` should only be called before calling `builder.addDefaultCase`"); |
| 2035 |
var type = typeof typeOrActionCreator === "string" ? typeOrActionCreator : typeOrActionCreator.type; |
| 2036 |
if (!type) throw new Error("`builder.addCase` cannot be called with an empty action type"); |
| 2037 |
if (type in actionsMap) throw new Error("`builder.addCase` cannot be called with two reducers for the same action type"); |
| 2038 |
actionsMap[type] = reducer; |
| 2039 |
return builder; |
| 2040 |
}, |
| 2041 |
addMatcher: function(matcher, reducer) { |
| 2042 |
if (defaultCaseReducer) throw new Error("`builder.addMatcher` should only be called before calling `builder.addDefaultCase`"); |
| 2043 |
actionMatchers.push({ |
| 2044 |
matcher, |
| 2045 |
reducer |
| 2046 |
}); |
| 2047 |
return builder; |
| 2048 |
}, |
| 2049 |
addDefaultCase: function(reducer) { |
| 2050 |
if (defaultCaseReducer) throw new Error("`builder.addDefaultCase` can only be called once"); |
| 2051 |
defaultCaseReducer = reducer; |
| 2052 |
return builder; |
| 2053 |
} |
| 2054 |
}; |
| 2055 |
builderCallback(builder); |
| 2056 |
return [ |
| 2057 |
actionsMap, |
| 2058 |
actionMatchers, |
| 2059 |
defaultCaseReducer |
| 2060 |
]; |
| 2061 |
} |
| 2062 |
function isStateFunction(x) { |
| 2063 |
return typeof x === "function"; |
| 2064 |
} |
| 2065 |
var hasWarnedAboutObjectNotation = false; |
| 2066 |
function createReducer(initialState, mapOrBuilderCallback, actionMatchers, defaultCaseReducer) { |
| 2067 |
if (actionMatchers === void 0) actionMatchers = []; |
| 2068 |
if (typeof mapOrBuilderCallback === "object") { |
| 2069 |
if (!hasWarnedAboutObjectNotation) { |
| 2070 |
hasWarnedAboutObjectNotation = true; |
| 2071 |
console.warn("The object notation for `createReducer` is deprecated, and will be removed in RTK 2.0. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer"); |
| 2072 |
} |
| 2073 |
} |
| 2074 |
var _c = typeof mapOrBuilderCallback === "function" ? executeReducerBuilderCallback(mapOrBuilderCallback) : [ |
| 2075 |
mapOrBuilderCallback, |
| 2076 |
actionMatchers, |
| 2077 |
defaultCaseReducer |
| 2078 |
]; |
| 2079 |
var actionsMap = _c[0]; |
| 2080 |
var finalActionMatchers = _c[1]; |
| 2081 |
var finalDefaultCaseReducer = _c[2]; |
| 2082 |
var getInitialState; |
| 2083 |
if (isStateFunction(initialState)) getInitialState = function() { |
| 2084 |
return freezeDraftable(initialState()); |
| 2085 |
}; |
| 2086 |
else { |
| 2087 |
var frozenInitialState_1 = freezeDraftable(initialState); |
| 2088 |
getInitialState = function() { |
| 2089 |
return frozenInitialState_1; |
| 2090 |
}; |
| 2091 |
} |
| 2092 |
function reducer(state, action) { |
| 2093 |
if (state === void 0) state = getInitialState(); |
| 2094 |
var caseReducers = __spreadArray([actionsMap[action.type]], finalActionMatchers.filter(function(_c) { |
| 2095 |
var matcher = _c.matcher; |
| 2096 |
return matcher(action); |
| 2097 |
}).map(function(_c) { |
| 2098 |
return _c.reducer; |
| 2099 |
})); |
| 2100 |
if (caseReducers.filter(function(cr) { |
| 2101 |
return !!cr; |
| 2102 |
}).length === 0) caseReducers = [finalDefaultCaseReducer]; |
| 2103 |
return caseReducers.reduce(function(previousState, caseReducer) { |
| 2104 |
if (caseReducer) if (r(previousState)) { |
| 2105 |
var result = caseReducer(previousState, action); |
| 2106 |
if (result === void 0) return previousState; |
| 2107 |
return result; |
| 2108 |
} else if (!t(previousState)) { |
| 2109 |
var result = caseReducer(previousState, action); |
| 2110 |
if (result === void 0) { |
| 2111 |
if (previousState === null) return previousState; |
| 2112 |
throw Error("A case reducer on a non-draftable value must not return undefined"); |
| 2113 |
} |
| 2114 |
return result; |
| 2115 |
} else return fn(previousState, function(draft) { |
| 2116 |
return caseReducer(draft, action); |
| 2117 |
}); |
| 2118 |
return previousState; |
| 2119 |
}, state); |
| 2120 |
} |
| 2121 |
reducer.getInitialState = getInitialState; |
| 2122 |
return reducer; |
| 2123 |
} |
| 2124 |
var hasWarnedAboutObjectNotation2 = false; |
| 2125 |
function getType2(slice, actionKey) { |
| 2126 |
return slice + "/" + actionKey; |
| 2127 |
} |
| 2128 |
function createSlice(options) { |
| 2129 |
var name = options.name; |
| 2130 |
if (!name) throw new Error("`name` is a required option for createSlice"); |
| 2131 |
if (typeof process !== "undefined" && true) { |
| 2132 |
if (options.initialState === void 0) console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`"); |
| 2133 |
} |
| 2134 |
var initialState = typeof options.initialState == "function" ? options.initialState : freezeDraftable(options.initialState); |
| 2135 |
var reducers = options.reducers || {}; |
| 2136 |
var reducerNames = Object.keys(reducers); |
| 2137 |
var sliceCaseReducersByName = {}; |
| 2138 |
var sliceCaseReducersByType = {}; |
| 2139 |
var actionCreators = {}; |
| 2140 |
reducerNames.forEach(function(reducerName) { |
| 2141 |
var maybeReducerWithPrepare = reducers[reducerName]; |
| 2142 |
var type = getType2(name, reducerName); |
| 2143 |
var caseReducer; |
| 2144 |
var prepareCallback; |
| 2145 |
if ("reducer" in maybeReducerWithPrepare) { |
| 2146 |
caseReducer = maybeReducerWithPrepare.reducer; |
| 2147 |
prepareCallback = maybeReducerWithPrepare.prepare; |
| 2148 |
} else caseReducer = maybeReducerWithPrepare; |
| 2149 |
sliceCaseReducersByName[reducerName] = caseReducer; |
| 2150 |
sliceCaseReducersByType[type] = caseReducer; |
| 2151 |
actionCreators[reducerName] = prepareCallback ? createAction(type, prepareCallback) : createAction(type); |
| 2152 |
}); |
| 2153 |
function buildReducer() { |
| 2154 |
if (typeof options.extraReducers === "object") { |
| 2155 |
if (!hasWarnedAboutObjectNotation2) { |
| 2156 |
hasWarnedAboutObjectNotation2 = true; |
| 2157 |
console.warn("The object notation for `createSlice.extraReducers` is deprecated, and will be removed in RTK 2.0. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice"); |
| 2158 |
} |
| 2159 |
} |
| 2160 |
var _c = typeof options.extraReducers === "function" ? executeReducerBuilderCallback(options.extraReducers) : [options.extraReducers]; |
| 2161 |
var _d = _c[0]; |
| 2162 |
var extraReducers = _d === void 0 ? {} : _d; |
| 2163 |
var _e = _c[1]; |
| 2164 |
var actionMatchers = _e === void 0 ? [] : _e; |
| 2165 |
var _f = _c[2]; |
| 2166 |
var defaultCaseReducer = _f === void 0 ? void 0 : _f; |
| 2167 |
var finalCaseReducers = __spreadValues(__spreadValues({}, extraReducers), sliceCaseReducersByType); |
| 2168 |
return createReducer(initialState, function(builder) { |
| 2169 |
for (var key in finalCaseReducers) builder.addCase(key, finalCaseReducers[key]); |
| 2170 |
for (var _i = 0, actionMatchers_1 = actionMatchers; _i < actionMatchers_1.length; _i++) { |
| 2171 |
var m = actionMatchers_1[_i]; |
| 2172 |
builder.addMatcher(m.matcher, m.reducer); |
| 2173 |
} |
| 2174 |
if (defaultCaseReducer) builder.addDefaultCase(defaultCaseReducer); |
| 2175 |
}); |
| 2176 |
} |
| 2177 |
var _reducer; |
| 2178 |
return { |
| 2179 |
name, |
| 2180 |
reducer: function(state, action) { |
| 2181 |
if (!_reducer) _reducer = buildReducer(); |
| 2182 |
return _reducer(state, action); |
| 2183 |
}, |
| 2184 |
actions: actionCreators, |
| 2185 |
caseReducers: sliceCaseReducersByName, |
| 2186 |
getInitialState: function() { |
| 2187 |
if (!_reducer) _reducer = buildReducer(); |
| 2188 |
return _reducer.getInitialState(); |
| 2189 |
} |
| 2190 |
}; |
| 2191 |
} |
| 2192 |
function getInitialEntityState() { |
| 2193 |
return { |
| 2194 |
ids: [], |
| 2195 |
entities: {} |
| 2196 |
}; |
| 2197 |
} |
| 2198 |
function createInitialStateFactory() { |
| 2199 |
function getInitialState(additionalState) { |
| 2200 |
if (additionalState === void 0) additionalState = {}; |
| 2201 |
return Object.assign(getInitialEntityState(), additionalState); |
| 2202 |
} |
| 2203 |
return { getInitialState }; |
| 2204 |
} |
| 2205 |
function createSelectorsFactory() { |
| 2206 |
function getSelectors(selectState) { |
| 2207 |
var selectIds = function(state) { |
| 2208 |
return state.ids; |
| 2209 |
}; |
| 2210 |
var selectEntities = function(state) { |
| 2211 |
return state.entities; |
| 2212 |
}; |
| 2213 |
var selectAll = createDraftSafeSelector(selectIds, selectEntities, function(ids, entities) { |
| 2214 |
return ids.map(function(id) { |
| 2215 |
return entities[id]; |
| 2216 |
}); |
| 2217 |
}); |
| 2218 |
var selectId = function(_, id) { |
| 2219 |
return id; |
| 2220 |
}; |
| 2221 |
var selectById = function(entities, id) { |
| 2222 |
return entities[id]; |
| 2223 |
}; |
| 2224 |
var selectTotal = createDraftSafeSelector(selectIds, function(ids) { |
| 2225 |
return ids.length; |
| 2226 |
}); |
| 2227 |
if (!selectState) return { |
| 2228 |
selectIds, |
| 2229 |
selectEntities, |
| 2230 |
selectAll, |
| 2231 |
selectTotal, |
| 2232 |
selectById: createDraftSafeSelector(selectEntities, selectId, selectById) |
| 2233 |
}; |
| 2234 |
var selectGlobalizedEntities = createDraftSafeSelector(selectState, selectEntities); |
| 2235 |
return { |
| 2236 |
selectIds: createDraftSafeSelector(selectState, selectIds), |
| 2237 |
selectEntities: selectGlobalizedEntities, |
| 2238 |
selectAll: createDraftSafeSelector(selectState, selectAll), |
| 2239 |
selectTotal: createDraftSafeSelector(selectState, selectTotal), |
| 2240 |
selectById: createDraftSafeSelector(selectGlobalizedEntities, selectId, selectById) |
| 2241 |
}; |
| 2242 |
} |
| 2243 |
return { getSelectors }; |
| 2244 |
} |
| 2245 |
function createSingleArgumentStateOperator(mutator) { |
| 2246 |
var operator = createStateOperator(function(_, state) { |
| 2247 |
return mutator(state); |
| 2248 |
}); |
| 2249 |
return function operation(state) { |
| 2250 |
return operator(state, void 0); |
| 2251 |
}; |
| 2252 |
} |
| 2253 |
function createStateOperator(mutator) { |
| 2254 |
return function operation(state, arg) { |
| 2255 |
function isPayloadActionArgument(arg2) { |
| 2256 |
return isFSA(arg2); |
| 2257 |
} |
| 2258 |
var runMutator = function(draft) { |
| 2259 |
if (isPayloadActionArgument(arg)) mutator(arg.payload, draft); |
| 2260 |
else mutator(arg, draft); |
| 2261 |
}; |
| 2262 |
if (r(state)) { |
| 2263 |
runMutator(state); |
| 2264 |
return state; |
| 2265 |
} else return fn(state, runMutator); |
| 2266 |
}; |
| 2267 |
} |
| 2268 |
function selectIdValue(entity, selectId) { |
| 2269 |
var key = selectId(entity); |
| 2270 |
if (key === void 0) console.warn("The entity passed to the `selectId` implementation returned undefined.", "You should probably provide your own `selectId` implementation.", "The entity that was passed:", entity, "The `selectId` implementation:", selectId.toString()); |
| 2271 |
return key; |
| 2272 |
} |
| 2273 |
function ensureEntitiesArray(entities) { |
| 2274 |
if (!Array.isArray(entities)) entities = Object.values(entities); |
| 2275 |
return entities; |
| 2276 |
} |
| 2277 |
function splitAddedUpdatedEntities(newEntities, selectId, state) { |
| 2278 |
newEntities = ensureEntitiesArray(newEntities); |
| 2279 |
var added = []; |
| 2280 |
var updated = []; |
| 2281 |
for (var _i = 0, newEntities_1 = newEntities; _i < newEntities_1.length; _i++) { |
| 2282 |
var entity = newEntities_1[_i]; |
| 2283 |
var id = selectIdValue(entity, selectId); |
| 2284 |
if (id in state.entities) updated.push({ |
| 2285 |
id, |
| 2286 |
changes: entity |
| 2287 |
}); |
| 2288 |
else added.push(entity); |
| 2289 |
} |
| 2290 |
return [added, updated]; |
| 2291 |
} |
| 2292 |
function createUnsortedStateAdapter(selectId) { |
| 2293 |
function addOneMutably(entity, state) { |
| 2294 |
var key = selectIdValue(entity, selectId); |
| 2295 |
if (key in state.entities) return; |
| 2296 |
state.ids.push(key); |
| 2297 |
state.entities[key] = entity; |
| 2298 |
} |
| 2299 |
function addManyMutably(newEntities, state) { |
| 2300 |
newEntities = ensureEntitiesArray(newEntities); |
| 2301 |
for (var _i = 0, newEntities_2 = newEntities; _i < newEntities_2.length; _i++) { |
| 2302 |
var entity = newEntities_2[_i]; |
| 2303 |
addOneMutably(entity, state); |
| 2304 |
} |
| 2305 |
} |
| 2306 |
function setOneMutably(entity, state) { |
| 2307 |
var key = selectIdValue(entity, selectId); |
| 2308 |
if (!(key in state.entities)) state.ids.push(key); |
| 2309 |
state.entities[key] = entity; |
| 2310 |
} |
| 2311 |
function setManyMutably(newEntities, state) { |
| 2312 |
newEntities = ensureEntitiesArray(newEntities); |
| 2313 |
for (var _i = 0, newEntities_3 = newEntities; _i < newEntities_3.length; _i++) { |
| 2314 |
var entity = newEntities_3[_i]; |
| 2315 |
setOneMutably(entity, state); |
| 2316 |
} |
| 2317 |
} |
| 2318 |
function setAllMutably(newEntities, state) { |
| 2319 |
newEntities = ensureEntitiesArray(newEntities); |
| 2320 |
state.ids = []; |
| 2321 |
state.entities = {}; |
| 2322 |
addManyMutably(newEntities, state); |
| 2323 |
} |
| 2324 |
function removeOneMutably(key, state) { |
| 2325 |
return removeManyMutably([key], state); |
| 2326 |
} |
| 2327 |
function removeManyMutably(keys, state) { |
| 2328 |
var didMutate = false; |
| 2329 |
keys.forEach(function(key) { |
| 2330 |
if (key in state.entities) { |
| 2331 |
delete state.entities[key]; |
| 2332 |
didMutate = true; |
| 2333 |
} |
| 2334 |
}); |
| 2335 |
if (didMutate) state.ids = state.ids.filter(function(id) { |
| 2336 |
return id in state.entities; |
| 2337 |
}); |
| 2338 |
} |
| 2339 |
function removeAllMutably(state) { |
| 2340 |
Object.assign(state, { |
| 2341 |
ids: [], |
| 2342 |
entities: {} |
| 2343 |
}); |
| 2344 |
} |
| 2345 |
function takeNewKey(keys, update, state) { |
| 2346 |
var original2 = state.entities[update.id]; |
| 2347 |
var updated = Object.assign({}, original2, update.changes); |
| 2348 |
var newKey = selectIdValue(updated, selectId); |
| 2349 |
var hasNewKey = newKey !== update.id; |
| 2350 |
if (hasNewKey) { |
| 2351 |
keys[update.id] = newKey; |
| 2352 |
delete state.entities[update.id]; |
| 2353 |
} |
| 2354 |
state.entities[newKey] = updated; |
| 2355 |
return hasNewKey; |
| 2356 |
} |
| 2357 |
function updateOneMutably(update, state) { |
| 2358 |
return updateManyMutably([update], state); |
| 2359 |
} |
| 2360 |
function updateManyMutably(updates, state) { |
| 2361 |
var newKeys = {}; |
| 2362 |
var updatesPerEntity = {}; |
| 2363 |
updates.forEach(function(update) { |
| 2364 |
if (update.id in state.entities) updatesPerEntity[update.id] = { |
| 2365 |
id: update.id, |
| 2366 |
changes: __spreadValues(__spreadValues({}, updatesPerEntity[update.id] ? updatesPerEntity[update.id].changes : null), update.changes) |
| 2367 |
}; |
| 2368 |
}); |
| 2369 |
updates = Object.values(updatesPerEntity); |
| 2370 |
if (updates.length > 0) { |
| 2371 |
if (updates.filter(function(update) { |
| 2372 |
return takeNewKey(newKeys, update, state); |
| 2373 |
}).length > 0) state.ids = Object.keys(state.entities); |
| 2374 |
} |
| 2375 |
} |
| 2376 |
function upsertOneMutably(entity, state) { |
| 2377 |
return upsertManyMutably([entity], state); |
| 2378 |
} |
| 2379 |
function upsertManyMutably(newEntities, state) { |
| 2380 |
var _c = splitAddedUpdatedEntities(newEntities, selectId, state); |
| 2381 |
var added = _c[0]; |
| 2382 |
var updated = _c[1]; |
| 2383 |
updateManyMutably(updated, state); |
| 2384 |
addManyMutably(added, state); |
| 2385 |
} |
| 2386 |
return { |
| 2387 |
removeAll: createSingleArgumentStateOperator(removeAllMutably), |
| 2388 |
addOne: createStateOperator(addOneMutably), |
| 2389 |
addMany: createStateOperator(addManyMutably), |
| 2390 |
setOne: createStateOperator(setOneMutably), |
| 2391 |
setMany: createStateOperator(setManyMutably), |
| 2392 |
setAll: createStateOperator(setAllMutably), |
| 2393 |
updateOne: createStateOperator(updateOneMutably), |
| 2394 |
updateMany: createStateOperator(updateManyMutably), |
| 2395 |
upsertOne: createStateOperator(upsertOneMutably), |
| 2396 |
upsertMany: createStateOperator(upsertManyMutably), |
| 2397 |
removeOne: createStateOperator(removeOneMutably), |
| 2398 |
removeMany: createStateOperator(removeManyMutably) |
| 2399 |
}; |
| 2400 |
} |
| 2401 |
function createSortedStateAdapter(selectId, sort) { |
| 2402 |
var _c = createUnsortedStateAdapter(selectId); |
| 2403 |
var removeOne = _c.removeOne; |
| 2404 |
var removeMany = _c.removeMany; |
| 2405 |
var removeAll = _c.removeAll; |
| 2406 |
function addOneMutably(entity, state) { |
| 2407 |
return addManyMutably([entity], state); |
| 2408 |
} |
| 2409 |
function addManyMutably(newEntities, state) { |
| 2410 |
newEntities = ensureEntitiesArray(newEntities); |
| 2411 |
var models = newEntities.filter(function(model) { |
| 2412 |
return !(selectIdValue(model, selectId) in state.entities); |
| 2413 |
}); |
| 2414 |
if (models.length !== 0) merge(models, state); |
| 2415 |
} |
| 2416 |
function setOneMutably(entity, state) { |
| 2417 |
return setManyMutably([entity], state); |
| 2418 |
} |
| 2419 |
function setManyMutably(newEntities, state) { |
| 2420 |
newEntities = ensureEntitiesArray(newEntities); |
| 2421 |
if (newEntities.length !== 0) merge(newEntities, state); |
| 2422 |
} |
| 2423 |
function setAllMutably(newEntities, state) { |
| 2424 |
newEntities = ensureEntitiesArray(newEntities); |
| 2425 |
state.entities = {}; |
| 2426 |
state.ids = []; |
| 2427 |
addManyMutably(newEntities, state); |
| 2428 |
} |
| 2429 |
function updateOneMutably(update, state) { |
| 2430 |
return updateManyMutably([update], state); |
| 2431 |
} |
| 2432 |
function updateManyMutably(updates, state) { |
| 2433 |
var appliedUpdates = false; |
| 2434 |
for (var _i = 0, updates_1 = updates; _i < updates_1.length; _i++) { |
| 2435 |
var update = updates_1[_i]; |
| 2436 |
var entity = state.entities[update.id]; |
| 2437 |
if (!entity) continue; |
| 2438 |
appliedUpdates = true; |
| 2439 |
Object.assign(entity, update.changes); |
| 2440 |
var newId = selectId(entity); |
| 2441 |
if (update.id !== newId) { |
| 2442 |
delete state.entities[update.id]; |
| 2443 |
state.entities[newId] = entity; |
| 2444 |
} |
| 2445 |
} |
| 2446 |
if (appliedUpdates) resortEntities(state); |
| 2447 |
} |
| 2448 |
function upsertOneMutably(entity, state) { |
| 2449 |
return upsertManyMutably([entity], state); |
| 2450 |
} |
| 2451 |
function upsertManyMutably(newEntities, state) { |
| 2452 |
var _c = splitAddedUpdatedEntities(newEntities, selectId, state); |
| 2453 |
var added = _c[0]; |
| 2454 |
var updated = _c[1]; |
| 2455 |
updateManyMutably(updated, state); |
| 2456 |
addManyMutably(added, state); |
| 2457 |
} |
| 2458 |
function areArraysEqual(a, b) { |
| 2459 |
if (a.length !== b.length) return false; |
| 2460 |
for (var i = 0; i < a.length && i < b.length; i++) { |
| 2461 |
if (a[i] === b[i]) continue; |
| 2462 |
return false; |
| 2463 |
} |
| 2464 |
return true; |
| 2465 |
} |
| 2466 |
function merge(models, state) { |
| 2467 |
models.forEach(function(model) { |
| 2468 |
state.entities[selectId(model)] = model; |
| 2469 |
}); |
| 2470 |
resortEntities(state); |
| 2471 |
} |
| 2472 |
function resortEntities(state) { |
| 2473 |
var allEntities = Object.values(state.entities); |
| 2474 |
allEntities.sort(sort); |
| 2475 |
var newSortedIds = allEntities.map(selectId); |
| 2476 |
var ids = state.ids; |
| 2477 |
if (!areArraysEqual(ids, newSortedIds)) state.ids = newSortedIds; |
| 2478 |
} |
| 2479 |
return { |
| 2480 |
removeOne, |
| 2481 |
removeMany, |
| 2482 |
removeAll, |
| 2483 |
addOne: createStateOperator(addOneMutably), |
| 2484 |
updateOne: createStateOperator(updateOneMutably), |
| 2485 |
upsertOne: createStateOperator(upsertOneMutably), |
| 2486 |
setOne: createStateOperator(setOneMutably), |
| 2487 |
setMany: createStateOperator(setManyMutably), |
| 2488 |
setAll: createStateOperator(setAllMutably), |
| 2489 |
addMany: createStateOperator(addManyMutably), |
| 2490 |
updateMany: createStateOperator(updateManyMutably), |
| 2491 |
upsertMany: createStateOperator(upsertManyMutably) |
| 2492 |
}; |
| 2493 |
} |
| 2494 |
function createEntityAdapter(options) { |
| 2495 |
if (options === void 0) options = {}; |
| 2496 |
var _c = __spreadValues({ |
| 2497 |
sortComparer: false, |
| 2498 |
selectId: function(instance) { |
| 2499 |
return instance.id; |
| 2500 |
} |
| 2501 |
}, options); |
| 2502 |
var selectId = _c.selectId; |
| 2503 |
var sortComparer = _c.sortComparer; |
| 2504 |
var stateFactory = createInitialStateFactory(); |
| 2505 |
var selectorsFactory = createSelectorsFactory(); |
| 2506 |
var stateAdapter = sortComparer ? createSortedStateAdapter(selectId, sortComparer) : createUnsortedStateAdapter(selectId); |
| 2507 |
return __spreadValues(__spreadValues(__spreadValues({ |
| 2508 |
selectId, |
| 2509 |
sortComparer |
| 2510 |
}, stateFactory), selectorsFactory), stateAdapter); |
| 2511 |
} |
| 2512 |
var urlAlphabet = "ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"; |
| 2513 |
var nanoid = function(size) { |
| 2514 |
if (size === void 0) size = 21; |
| 2515 |
var id = ""; |
| 2516 |
var i = size; |
| 2517 |
while (i--) id += urlAlphabet[Math.random() * 64 | 0]; |
| 2518 |
return id; |
| 2519 |
}; |
| 2520 |
var commonProperties = [ |
| 2521 |
"name", |
| 2522 |
"message", |
| 2523 |
"stack", |
| 2524 |
"code" |
| 2525 |
]; |
| 2526 |
var RejectWithValue = function() { |
| 2527 |
function RejectWithValue(payload, meta) { |
| 2528 |
this.payload = payload; |
| 2529 |
this.meta = meta; |
| 2530 |
} |
| 2531 |
return RejectWithValue; |
| 2532 |
}(); |
| 2533 |
var FulfillWithMeta = function() { |
| 2534 |
function FulfillWithMeta(payload, meta) { |
| 2535 |
this.payload = payload; |
| 2536 |
this.meta = meta; |
| 2537 |
} |
| 2538 |
return FulfillWithMeta; |
| 2539 |
}(); |
| 2540 |
var miniSerializeError = function(value) { |
| 2541 |
if (typeof value === "object" && value !== null) { |
| 2542 |
var simpleError = {}; |
| 2543 |
for (var _i = 0, commonProperties_1 = commonProperties; _i < commonProperties_1.length; _i++) { |
| 2544 |
var property = commonProperties_1[_i]; |
| 2545 |
if (typeof value[property] === "string") simpleError[property] = value[property]; |
| 2546 |
} |
| 2547 |
return simpleError; |
| 2548 |
} |
| 2549 |
return { message: String(value) }; |
| 2550 |
}; |
| 2551 |
var createAsyncThunk = (function() { |
| 2552 |
function createAsyncThunk2(typePrefix, payloadCreator, options) { |
| 2553 |
var fulfilled = createAction(typePrefix + "/fulfilled", function(payload, requestId, arg, meta) { |
| 2554 |
return { |
| 2555 |
payload, |
| 2556 |
meta: __spreadProps(__spreadValues({}, meta || {}), { |
| 2557 |
arg, |
| 2558 |
requestId, |
| 2559 |
requestStatus: "fulfilled" |
| 2560 |
}) |
| 2561 |
}; |
| 2562 |
}); |
| 2563 |
var pending = createAction(typePrefix + "/pending", function(requestId, arg, meta) { |
| 2564 |
return { |
| 2565 |
payload: void 0, |
| 2566 |
meta: __spreadProps(__spreadValues({}, meta || {}), { |
| 2567 |
arg, |
| 2568 |
requestId, |
| 2569 |
requestStatus: "pending" |
| 2570 |
}) |
| 2571 |
}; |
| 2572 |
}); |
| 2573 |
var rejected = createAction(typePrefix + "/rejected", function(error, requestId, arg, payload, meta) { |
| 2574 |
return { |
| 2575 |
payload, |
| 2576 |
error: (options && options.serializeError || miniSerializeError)(error || "Rejected"), |
| 2577 |
meta: __spreadProps(__spreadValues({}, meta || {}), { |
| 2578 |
arg, |
| 2579 |
requestId, |
| 2580 |
rejectedWithValue: !!payload, |
| 2581 |
requestStatus: "rejected", |
| 2582 |
aborted: (error == null ? void 0 : error.name) === "AbortError", |
| 2583 |
condition: (error == null ? void 0 : error.name) === "ConditionError" |
| 2584 |
}) |
| 2585 |
}; |
| 2586 |
}); |
| 2587 |
var displayedWarning = false; |
| 2588 |
var AC = typeof AbortController !== "undefined" ? AbortController : function() { |
| 2589 |
function class_1() { |
| 2590 |
this.signal = { |
| 2591 |
aborted: false, |
| 2592 |
addEventListener: function() {}, |
| 2593 |
dispatchEvent: function() { |
| 2594 |
return false; |
| 2595 |
}, |
| 2596 |
onabort: function() {}, |
| 2597 |
removeEventListener: function() {}, |
| 2598 |
reason: void 0, |
| 2599 |
throwIfAborted: function() {} |
| 2600 |
}; |
| 2601 |
} |
| 2602 |
class_1.prototype.abort = function() { |
| 2603 |
if (!displayedWarning) { |
| 2604 |
displayedWarning = true; |
| 2605 |
console.info("This platform does not implement AbortController. \nIf you want to use the AbortController to react to `abort` events, please consider importing a polyfill like 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only'."); |
| 2606 |
} |
| 2607 |
}; |
| 2608 |
return class_1; |
| 2609 |
}(); |
| 2610 |
function actionCreator(arg) { |
| 2611 |
return function(dispatch, getState, extra) { |
| 2612 |
var requestId = (options == null ? void 0 : options.idGenerator) ? options.idGenerator(arg) : nanoid(); |
| 2613 |
var abortController = new AC(); |
| 2614 |
var abortReason; |
| 2615 |
function abort(reason) { |
| 2616 |
abortReason = reason; |
| 2617 |
abortController.abort(); |
| 2618 |
} |
| 2619 |
var promise2 = function() { |
| 2620 |
return __async(this, null, function() { |
| 2621 |
var _a; |
| 2622 |
var _b; |
| 2623 |
var finalAction; |
| 2624 |
var conditionResult; |
| 2625 |
var abortedPromise; |
| 2626 |
var err_1; |
| 2627 |
var skipDispatch; |
| 2628 |
return __generator(this, function(_c) { |
| 2629 |
switch (_c.label) { |
| 2630 |
case 0: |
| 2631 |
_c.trys.push([ |
| 2632 |
0, |
| 2633 |
4, |
| 2634 |
, |
| 2635 |
5 |
| 2636 |
]); |
| 2637 |
conditionResult = (_a = options == null ? void 0 : options.condition) == null ? void 0 : _a.call(options, arg, { |
| 2638 |
getState, |
| 2639 |
extra |
| 2640 |
}); |
| 2641 |
if (!isThenable(conditionResult)) return [3, 2]; |
| 2642 |
return [4, conditionResult]; |
| 2643 |
case 1: |
| 2644 |
conditionResult = _c.sent(); |
| 2645 |
_c.label = 2; |
| 2646 |
case 2: |
| 2647 |
if (conditionResult === false || abortController.signal.aborted) throw { |
| 2648 |
name: "ConditionError", |
| 2649 |
message: "Aborted due to condition callback returning false." |
| 2650 |
}; |
| 2651 |
abortedPromise = new Promise(function(_, reject) { |
| 2652 |
return abortController.signal.addEventListener("abort", function() { |
| 2653 |
return reject({ |
| 2654 |
name: "AbortError", |
| 2655 |
message: abortReason || "Aborted" |
| 2656 |
}); |
| 2657 |
}); |
| 2658 |
}); |
| 2659 |
dispatch(pending(requestId, arg, (_b = options == null ? void 0 : options.getPendingMeta) == null ? void 0 : _b.call(options, { |
| 2660 |
requestId, |
| 2661 |
arg |
| 2662 |
}, { |
| 2663 |
getState, |
| 2664 |
extra |
| 2665 |
}))); |
| 2666 |
return [4, Promise.race([abortedPromise, Promise.resolve(payloadCreator(arg, { |
| 2667 |
dispatch, |
| 2668 |
getState, |
| 2669 |
extra, |
| 2670 |
requestId, |
| 2671 |
signal: abortController.signal, |
| 2672 |
abort, |
| 2673 |
rejectWithValue: function(value, meta) { |
| 2674 |
return new RejectWithValue(value, meta); |
| 2675 |
}, |
| 2676 |
fulfillWithValue: function(value, meta) { |
| 2677 |
return new FulfillWithMeta(value, meta); |
| 2678 |
} |
| 2679 |
})).then(function(result) { |
| 2680 |
if (result instanceof RejectWithValue) throw result; |
| 2681 |
if (result instanceof FulfillWithMeta) return fulfilled(result.payload, requestId, arg, result.meta); |
| 2682 |
return fulfilled(result, requestId, arg); |
| 2683 |
})])]; |
| 2684 |
case 3: |
| 2685 |
finalAction = _c.sent(); |
| 2686 |
return [3, 5]; |
| 2687 |
case 4: |
| 2688 |
err_1 = _c.sent(); |
| 2689 |
finalAction = err_1 instanceof RejectWithValue ? rejected(null, requestId, arg, err_1.payload, err_1.meta) : rejected(err_1, requestId, arg); |
| 2690 |
return [3, 5]; |
| 2691 |
case 5: |
| 2692 |
skipDispatch = options && !options.dispatchConditionRejection && rejected.match(finalAction) && finalAction.meta.condition; |
| 2693 |
if (!skipDispatch) dispatch(finalAction); |
| 2694 |
return [2, finalAction]; |
| 2695 |
} |
| 2696 |
}); |
| 2697 |
}); |
| 2698 |
}(); |
| 2699 |
return Object.assign(promise2, { |
| 2700 |
abort, |
| 2701 |
requestId, |
| 2702 |
arg, |
| 2703 |
unwrap: function() { |
| 2704 |
return promise2.then(unwrapResult); |
| 2705 |
} |
| 2706 |
}); |
| 2707 |
}; |
| 2708 |
} |
| 2709 |
return Object.assign(actionCreator, { |
| 2710 |
pending, |
| 2711 |
rejected, |
| 2712 |
fulfilled, |
| 2713 |
typePrefix |
| 2714 |
}); |
| 2715 |
} |
| 2716 |
createAsyncThunk2.withTypes = function() { |
| 2717 |
return createAsyncThunk2; |
| 2718 |
}; |
| 2719 |
return createAsyncThunk2; |
| 2720 |
})(); |
| 2721 |
function unwrapResult(action) { |
| 2722 |
if (action.meta && action.meta.rejectedWithValue) throw action.payload; |
| 2723 |
if (action.error) throw action.error; |
| 2724 |
return action.payload; |
| 2725 |
} |
| 2726 |
function isThenable(value) { |
| 2727 |
return value !== null && typeof value === "object" && typeof value.then === "function"; |
| 2728 |
} |
| 2729 |
var matches = function(matcher, action) { |
| 2730 |
if (hasMatchFunction(matcher)) return matcher.match(action); |
| 2731 |
else return matcher(action); |
| 2732 |
}; |
| 2733 |
function isAnyOf() { |
| 2734 |
var matchers = []; |
| 2735 |
for (var _i = 0; _i < arguments.length; _i++) matchers[_i] = arguments[_i]; |
| 2736 |
return function(action) { |
| 2737 |
return matchers.some(function(matcher) { |
| 2738 |
return matches(matcher, action); |
| 2739 |
}); |
| 2740 |
}; |
| 2741 |
} |
| 2742 |
function isAllOf() { |
| 2743 |
var matchers = []; |
| 2744 |
for (var _i = 0; _i < arguments.length; _i++) matchers[_i] = arguments[_i]; |
| 2745 |
return function(action) { |
| 2746 |
return matchers.every(function(matcher) { |
| 2747 |
return matches(matcher, action); |
| 2748 |
}); |
| 2749 |
}; |
| 2750 |
} |
| 2751 |
function hasExpectedRequestMetadata(action, validStatus) { |
| 2752 |
if (!action || !action.meta) return false; |
| 2753 |
var hasValidRequestId = typeof action.meta.requestId === "string"; |
| 2754 |
var hasValidRequestStatus = validStatus.indexOf(action.meta.requestStatus) > -1; |
| 2755 |
return hasValidRequestId && hasValidRequestStatus; |
| 2756 |
} |
| 2757 |
function isAsyncThunkArray(a) { |
| 2758 |
return typeof a[0] === "function" && "pending" in a[0] && "fulfilled" in a[0] && "rejected" in a[0]; |
| 2759 |
} |
| 2760 |
function isPending() { |
| 2761 |
var asyncThunks = []; |
| 2762 |
for (var _i = 0; _i < arguments.length; _i++) asyncThunks[_i] = arguments[_i]; |
| 2763 |
if (asyncThunks.length === 0) return function(action) { |
| 2764 |
return hasExpectedRequestMetadata(action, ["pending"]); |
| 2765 |
}; |
| 2766 |
if (!isAsyncThunkArray(asyncThunks)) return isPending()(asyncThunks[0]); |
| 2767 |
return function(action) { |
| 2768 |
var matchers = asyncThunks.map(function(asyncThunk) { |
| 2769 |
return asyncThunk.pending; |
| 2770 |
}); |
| 2771 |
return isAnyOf.apply(void 0, matchers)(action); |
| 2772 |
}; |
| 2773 |
} |
| 2774 |
function isRejected() { |
| 2775 |
var asyncThunks = []; |
| 2776 |
for (var _i = 0; _i < arguments.length; _i++) asyncThunks[_i] = arguments[_i]; |
| 2777 |
if (asyncThunks.length === 0) return function(action) { |
| 2778 |
return hasExpectedRequestMetadata(action, ["rejected"]); |
| 2779 |
}; |
| 2780 |
if (!isAsyncThunkArray(asyncThunks)) return isRejected()(asyncThunks[0]); |
| 2781 |
return function(action) { |
| 2782 |
var matchers = asyncThunks.map(function(asyncThunk) { |
| 2783 |
return asyncThunk.rejected; |
| 2784 |
}); |
| 2785 |
return isAnyOf.apply(void 0, matchers)(action); |
| 2786 |
}; |
| 2787 |
} |
| 2788 |
function isRejectedWithValue() { |
| 2789 |
var asyncThunks = []; |
| 2790 |
for (var _i = 0; _i < arguments.length; _i++) asyncThunks[_i] = arguments[_i]; |
| 2791 |
var hasFlag = function(action) { |
| 2792 |
return action && action.meta && action.meta.rejectedWithValue; |
| 2793 |
}; |
| 2794 |
if (asyncThunks.length === 0) return function(action) { |
| 2795 |
return isAllOf(isRejected.apply(void 0, asyncThunks), hasFlag)(action); |
| 2796 |
}; |
| 2797 |
if (!isAsyncThunkArray(asyncThunks)) return isRejectedWithValue()(asyncThunks[0]); |
| 2798 |
return function(action) { |
| 2799 |
return isAllOf(isRejected.apply(void 0, asyncThunks), hasFlag)(action); |
| 2800 |
}; |
| 2801 |
} |
| 2802 |
function isFulfilled() { |
| 2803 |
var asyncThunks = []; |
| 2804 |
for (var _i = 0; _i < arguments.length; _i++) asyncThunks[_i] = arguments[_i]; |
| 2805 |
if (asyncThunks.length === 0) return function(action) { |
| 2806 |
return hasExpectedRequestMetadata(action, ["fulfilled"]); |
| 2807 |
}; |
| 2808 |
if (!isAsyncThunkArray(asyncThunks)) return isFulfilled()(asyncThunks[0]); |
| 2809 |
return function(action) { |
| 2810 |
var matchers = asyncThunks.map(function(asyncThunk) { |
| 2811 |
return asyncThunk.fulfilled; |
| 2812 |
}); |
| 2813 |
return isAnyOf.apply(void 0, matchers)(action); |
| 2814 |
}; |
| 2815 |
} |
| 2816 |
function isAsyncThunkAction() { |
| 2817 |
var asyncThunks = []; |
| 2818 |
for (var _i = 0; _i < arguments.length; _i++) asyncThunks[_i] = arguments[_i]; |
| 2819 |
if (asyncThunks.length === 0) return function(action) { |
| 2820 |
return hasExpectedRequestMetadata(action, [ |
| 2821 |
"pending", |
| 2822 |
"fulfilled", |
| 2823 |
"rejected" |
| 2824 |
]); |
| 2825 |
}; |
| 2826 |
if (!isAsyncThunkArray(asyncThunks)) return isAsyncThunkAction()(asyncThunks[0]); |
| 2827 |
return function(action) { |
| 2828 |
var matchers = []; |
| 2829 |
for (var _i = 0, asyncThunks_1 = asyncThunks; _i < asyncThunks_1.length; _i++) { |
| 2830 |
var asyncThunk = asyncThunks_1[_i]; |
| 2831 |
matchers.push(asyncThunk.pending, asyncThunk.rejected, asyncThunk.fulfilled); |
| 2832 |
} |
| 2833 |
return isAnyOf.apply(void 0, matchers)(action); |
| 2834 |
}; |
| 2835 |
} |
| 2836 |
var assertFunction = function(func, expected) { |
| 2837 |
if (typeof func !== "function") throw new TypeError(expected + " is not a function"); |
| 2838 |
}; |
| 2839 |
var noop = function() {}; |
| 2840 |
var catchRejection = function(promise2, onError) { |
| 2841 |
if (onError === void 0) onError = noop; |
| 2842 |
promise2.catch(onError); |
| 2843 |
return promise2; |
| 2844 |
}; |
| 2845 |
var addAbortSignalListener = function(abortSignal, callback) { |
| 2846 |
abortSignal.addEventListener("abort", callback, { once: true }); |
| 2847 |
return function() { |
| 2848 |
return abortSignal.removeEventListener("abort", callback); |
| 2849 |
}; |
| 2850 |
}; |
| 2851 |
var abortControllerWithReason = function(abortController, reason) { |
| 2852 |
var signal = abortController.signal; |
| 2853 |
if (signal.aborted) return; |
| 2854 |
if (!("reason" in signal)) Object.defineProperty(signal, "reason", { |
| 2855 |
enumerable: true, |
| 2856 |
value: reason, |
| 2857 |
configurable: true, |
| 2858 |
writable: true |
| 2859 |
}); |
| 2860 |
abortController.abort(reason); |
| 2861 |
}; |
| 2862 |
var task = "task"; |
| 2863 |
var listener = "listener"; |
| 2864 |
var completed = "completed"; |
| 2865 |
var cancelled = "cancelled"; |
| 2866 |
var taskCancelled = "task-" + cancelled; |
| 2867 |
var taskCompleted = "task-" + completed; |
| 2868 |
var listenerCancelled = listener + "-" + cancelled; |
| 2869 |
var listenerCompleted = listener + "-" + completed; |
| 2870 |
var TaskAbortError = function() { |
| 2871 |
function TaskAbortError(code) { |
| 2872 |
this.code = code; |
| 2873 |
this.name = "TaskAbortError"; |
| 2874 |
this.message = task + " " + cancelled + " (reason: " + code + ")"; |
| 2875 |
} |
| 2876 |
return TaskAbortError; |
| 2877 |
}(); |
| 2878 |
var validateActive = function(signal) { |
| 2879 |
if (signal.aborted) throw new TaskAbortError(signal.reason); |
| 2880 |
}; |
| 2881 |
function raceWithSignal(signal, promise2) { |
| 2882 |
var cleanup = noop; |
| 2883 |
return new Promise(function(resolve, reject) { |
| 2884 |
var notifyRejection = function() { |
| 2885 |
return reject(new TaskAbortError(signal.reason)); |
| 2886 |
}; |
| 2887 |
if (signal.aborted) { |
| 2888 |
notifyRejection(); |
| 2889 |
return; |
| 2890 |
} |
| 2891 |
cleanup = addAbortSignalListener(signal, notifyRejection); |
| 2892 |
promise2.finally(function() { |
| 2893 |
return cleanup(); |
| 2894 |
}).then(resolve, reject); |
| 2895 |
}).finally(function() { |
| 2896 |
cleanup = noop; |
| 2897 |
}); |
| 2898 |
} |
| 2899 |
var runTask = function(task2, cleanUp) { |
| 2900 |
return __async(void 0, null, function() { |
| 2901 |
var value; |
| 2902 |
var error_1; |
| 2903 |
return __generator(this, function(_c) { |
| 2904 |
switch (_c.label) { |
| 2905 |
case 0: |
| 2906 |
_c.trys.push([ |
| 2907 |
0, |
| 2908 |
3, |
| 2909 |
4, |
| 2910 |
5 |
| 2911 |
]); |
| 2912 |
return [4, Promise.resolve()]; |
| 2913 |
case 1: |
| 2914 |
_c.sent(); |
| 2915 |
return [4, task2()]; |
| 2916 |
case 2: |
| 2917 |
value = _c.sent(); |
| 2918 |
return [2, { |
| 2919 |
status: "ok", |
| 2920 |
value |
| 2921 |
}]; |
| 2922 |
case 3: |
| 2923 |
error_1 = _c.sent(); |
| 2924 |
return [2, { |
| 2925 |
status: error_1 instanceof TaskAbortError ? "cancelled" : "rejected", |
| 2926 |
error: error_1 |
| 2927 |
}]; |
| 2928 |
case 4: |
| 2929 |
cleanUp == null || cleanUp(); |
| 2930 |
return [7]; |
| 2931 |
case 5: return [2]; |
| 2932 |
} |
| 2933 |
}); |
| 2934 |
}); |
| 2935 |
}; |
| 2936 |
var createPause = function(signal) { |
| 2937 |
return function(promise2) { |
| 2938 |
return catchRejection(raceWithSignal(signal, promise2).then(function(output) { |
| 2939 |
validateActive(signal); |
| 2940 |
return output; |
| 2941 |
})); |
| 2942 |
}; |
| 2943 |
}; |
| 2944 |
var createDelay = function(signal) { |
| 2945 |
var pause = createPause(signal); |
| 2946 |
return function(timeoutMs) { |
| 2947 |
return pause(new Promise(function(resolve) { |
| 2948 |
return setTimeout(resolve, timeoutMs); |
| 2949 |
})); |
| 2950 |
}; |
| 2951 |
}; |
| 2952 |
var assign = Object.assign; |
| 2953 |
var INTERNAL_NIL_TOKEN = {}; |
| 2954 |
var alm = "listenerMiddleware"; |
| 2955 |
var createFork = function(parentAbortSignal, parentBlockingPromises) { |
| 2956 |
var linkControllers = function(controller) { |
| 2957 |
return addAbortSignalListener(parentAbortSignal, function() { |
| 2958 |
return abortControllerWithReason(controller, parentAbortSignal.reason); |
| 2959 |
}); |
| 2960 |
}; |
| 2961 |
return function(taskExecutor, opts) { |
| 2962 |
assertFunction(taskExecutor, "taskExecutor"); |
| 2963 |
var childAbortController = new AbortController(); |
| 2964 |
linkControllers(childAbortController); |
| 2965 |
var result = runTask(function() { |
| 2966 |
return __async(void 0, null, function() { |
| 2967 |
var result2; |
| 2968 |
return __generator(this, function(_c) { |
| 2969 |
switch (_c.label) { |
| 2970 |
case 0: |
| 2971 |
validateActive(parentAbortSignal); |
| 2972 |
validateActive(childAbortController.signal); |
| 2973 |
return [4, taskExecutor({ |
| 2974 |
pause: createPause(childAbortController.signal), |
| 2975 |
delay: createDelay(childAbortController.signal), |
| 2976 |
signal: childAbortController.signal |
| 2977 |
})]; |
| 2978 |
case 1: |
| 2979 |
result2 = _c.sent(); |
| 2980 |
validateActive(childAbortController.signal); |
| 2981 |
return [2, result2]; |
| 2982 |
} |
| 2983 |
}); |
| 2984 |
}); |
| 2985 |
}, function() { |
| 2986 |
return abortControllerWithReason(childAbortController, taskCompleted); |
| 2987 |
}); |
| 2988 |
if (opts == null ? void 0 : opts.autoJoin) parentBlockingPromises.push(result); |
| 2989 |
return { |
| 2990 |
result: createPause(parentAbortSignal)(result), |
| 2991 |
cancel: function() { |
| 2992 |
abortControllerWithReason(childAbortController, taskCancelled); |
| 2993 |
} |
| 2994 |
}; |
| 2995 |
}; |
| 2996 |
}; |
| 2997 |
var createTakePattern = function(startListening, signal) { |
| 2998 |
var take = function(predicate, timeout) { |
| 2999 |
return __async(void 0, null, function() { |
| 3000 |
var unsubscribe; |
| 3001 |
var tuplePromise; |
| 3002 |
var promises; |
| 3003 |
var output; |
| 3004 |
return __generator(this, function(_c) { |
| 3005 |
switch (_c.label) { |
| 3006 |
case 0: |
| 3007 |
validateActive(signal); |
| 3008 |
unsubscribe = function() {}; |
| 3009 |
tuplePromise = new Promise(function(resolve, reject) { |
| 3010 |
var stopListening = startListening({ |
| 3011 |
predicate, |
| 3012 |
effect: function(action, listenerApi) { |
| 3013 |
listenerApi.unsubscribe(); |
| 3014 |
resolve([ |
| 3015 |
action, |
| 3016 |
listenerApi.getState(), |
| 3017 |
listenerApi.getOriginalState() |
| 3018 |
]); |
| 3019 |
} |
| 3020 |
}); |
| 3021 |
unsubscribe = function() { |
| 3022 |
stopListening(); |
| 3023 |
reject(); |
| 3024 |
}; |
| 3025 |
}); |
| 3026 |
promises = [tuplePromise]; |
| 3027 |
if (timeout != null) promises.push(new Promise(function(resolve) { |
| 3028 |
return setTimeout(resolve, timeout, null); |
| 3029 |
})); |
| 3030 |
_c.label = 1; |
| 3031 |
case 1: |
| 3032 |
_c.trys.push([ |
| 3033 |
1, |
| 3034 |
, |
| 3035 |
3, |
| 3036 |
4 |
| 3037 |
]); |
| 3038 |
return [4, raceWithSignal(signal, Promise.race(promises))]; |
| 3039 |
case 2: |
| 3040 |
output = _c.sent(); |
| 3041 |
validateActive(signal); |
| 3042 |
return [2, output]; |
| 3043 |
case 3: |
| 3044 |
unsubscribe(); |
| 3045 |
return [7]; |
| 3046 |
case 4: return [2]; |
| 3047 |
} |
| 3048 |
}); |
| 3049 |
}); |
| 3050 |
}; |
| 3051 |
return function(predicate, timeout) { |
| 3052 |
return catchRejection(take(predicate, timeout)); |
| 3053 |
}; |
| 3054 |
}; |
| 3055 |
var getListenerEntryPropsFrom = function(options) { |
| 3056 |
var type = options.type; |
| 3057 |
var actionCreator = options.actionCreator; |
| 3058 |
var matcher = options.matcher; |
| 3059 |
var predicate = options.predicate; |
| 3060 |
var effect = options.effect; |
| 3061 |
if (type) predicate = createAction(type).match; |
| 3062 |
else if (actionCreator) { |
| 3063 |
type = actionCreator.type; |
| 3064 |
predicate = actionCreator.match; |
| 3065 |
} else if (matcher) predicate = matcher; |
| 3066 |
else if (predicate) {} else throw new Error("Creating or removing a listener requires one of the known fields for matching an action"); |
| 3067 |
assertFunction(effect, "options.listener"); |
| 3068 |
return { |
| 3069 |
predicate, |
| 3070 |
type, |
| 3071 |
effect |
| 3072 |
}; |
| 3073 |
}; |
| 3074 |
var createListenerEntry = function(options) { |
| 3075 |
var _c = getListenerEntryPropsFrom(options); |
| 3076 |
var type = _c.type; |
| 3077 |
var predicate = _c.predicate; |
| 3078 |
var effect = _c.effect; |
| 3079 |
return { |
| 3080 |
id: nanoid(), |
| 3081 |
effect, |
| 3082 |
type, |
| 3083 |
predicate, |
| 3084 |
pending: /* @__PURE__ */ new Set(), |
| 3085 |
unsubscribe: function() { |
| 3086 |
throw new Error("Unsubscribe not initialized"); |
| 3087 |
} |
| 3088 |
}; |
| 3089 |
}; |
| 3090 |
var cancelActiveListeners = function(entry) { |
| 3091 |
entry.pending.forEach(function(controller) { |
| 3092 |
abortControllerWithReason(controller, listenerCancelled); |
| 3093 |
}); |
| 3094 |
}; |
| 3095 |
var createClearListenerMiddleware = function(listenerMap) { |
| 3096 |
return function() { |
| 3097 |
listenerMap.forEach(cancelActiveListeners); |
| 3098 |
listenerMap.clear(); |
| 3099 |
}; |
| 3100 |
}; |
| 3101 |
var safelyNotifyError = function(errorHandler, errorToNotify, errorInfo) { |
| 3102 |
try { |
| 3103 |
errorHandler(errorToNotify, errorInfo); |
| 3104 |
} catch (errorHandlerError) { |
| 3105 |
setTimeout(function() { |
| 3106 |
throw errorHandlerError; |
| 3107 |
}, 0); |
| 3108 |
} |
| 3109 |
}; |
| 3110 |
var addListener = createAction(alm + "/add"); |
| 3111 |
var clearAllListeners = createAction(alm + "/removeAll"); |
| 3112 |
var removeListener = createAction(alm + "/remove"); |
| 3113 |
var defaultErrorHandler = function() { |
| 3114 |
var args = []; |
| 3115 |
for (var _i = 0; _i < arguments.length; _i++) args[_i] = arguments[_i]; |
| 3116 |
console.error.apply(console, __spreadArray([alm + "/error"], args)); |
| 3117 |
}; |
| 3118 |
function createListenerMiddleware(middlewareOptions) { |
| 3119 |
var _this = this; |
| 3120 |
if (middlewareOptions === void 0) middlewareOptions = {}; |
| 3121 |
var listenerMap = /* @__PURE__ */ new Map(); |
| 3122 |
var extra = middlewareOptions.extra; |
| 3123 |
var _c = middlewareOptions.onError; |
| 3124 |
var onError = _c === void 0 ? defaultErrorHandler : _c; |
| 3125 |
assertFunction(onError, "onError"); |
| 3126 |
var insertEntry = function(entry) { |
| 3127 |
entry.unsubscribe = function() { |
| 3128 |
return listenerMap.delete(entry.id); |
| 3129 |
}; |
| 3130 |
listenerMap.set(entry.id, entry); |
| 3131 |
return function(cancelOptions) { |
| 3132 |
entry.unsubscribe(); |
| 3133 |
if (cancelOptions == null ? void 0 : cancelOptions.cancelActive) cancelActiveListeners(entry); |
| 3134 |
}; |
| 3135 |
}; |
| 3136 |
var findListenerEntry = function(comparator) { |
| 3137 |
for (var _i = 0, _c = Array.from(listenerMap.values()); _i < _c.length; _i++) { |
| 3138 |
var entry = _c[_i]; |
| 3139 |
if (comparator(entry)) return entry; |
| 3140 |
} |
| 3141 |
}; |
| 3142 |
var startListening = function(options) { |
| 3143 |
var entry = findListenerEntry(function(existingEntry) { |
| 3144 |
return existingEntry.effect === options.effect; |
| 3145 |
}); |
| 3146 |
if (!entry) entry = createListenerEntry(options); |
| 3147 |
return insertEntry(entry); |
| 3148 |
}; |
| 3149 |
var stopListening = function(options) { |
| 3150 |
var _c = getListenerEntryPropsFrom(options); |
| 3151 |
var type = _c.type; |
| 3152 |
var effect = _c.effect; |
| 3153 |
var predicate = _c.predicate; |
| 3154 |
var entry = findListenerEntry(function(entry2) { |
| 3155 |
return (typeof type === "string" ? entry2.type === type : entry2.predicate === predicate) && entry2.effect === effect; |
| 3156 |
}); |
| 3157 |
if (entry) { |
| 3158 |
entry.unsubscribe(); |
| 3159 |
if (options.cancelActive) cancelActiveListeners(entry); |
| 3160 |
} |
| 3161 |
return !!entry; |
| 3162 |
}; |
| 3163 |
var notifyListener = function(entry, action, api, getOriginalState) { |
| 3164 |
return __async(_this, null, function() { |
| 3165 |
var internalTaskController; |
| 3166 |
var take; |
| 3167 |
var autoJoinPromises; |
| 3168 |
var listenerError_1; |
| 3169 |
return __generator(this, function(_c) { |
| 3170 |
switch (_c.label) { |
| 3171 |
case 0: |
| 3172 |
internalTaskController = new AbortController(); |
| 3173 |
take = createTakePattern(startListening, internalTaskController.signal); |
| 3174 |
autoJoinPromises = []; |
| 3175 |
_c.label = 1; |
| 3176 |
case 1: |
| 3177 |
_c.trys.push([ |
| 3178 |
1, |
| 3179 |
3, |
| 3180 |
4, |
| 3181 |
6 |
| 3182 |
]); |
| 3183 |
entry.pending.add(internalTaskController); |
| 3184 |
return [4, Promise.resolve(entry.effect(action, assign({}, api, { |
| 3185 |
getOriginalState, |
| 3186 |
condition: function(predicate, timeout) { |
| 3187 |
return take(predicate, timeout).then(Boolean); |
| 3188 |
}, |
| 3189 |
take, |
| 3190 |
delay: createDelay(internalTaskController.signal), |
| 3191 |
pause: createPause(internalTaskController.signal), |
| 3192 |
extra, |
| 3193 |
signal: internalTaskController.signal, |
| 3194 |
fork: createFork(internalTaskController.signal, autoJoinPromises), |
| 3195 |
unsubscribe: entry.unsubscribe, |
| 3196 |
subscribe: function() { |
| 3197 |
listenerMap.set(entry.id, entry); |
| 3198 |
}, |
| 3199 |
cancelActiveListeners: function() { |
| 3200 |
entry.pending.forEach(function(controller, _, set) { |
| 3201 |
if (controller !== internalTaskController) { |
| 3202 |
abortControllerWithReason(controller, listenerCancelled); |
| 3203 |
set.delete(controller); |
| 3204 |
} |
| 3205 |
}); |
| 3206 |
} |
| 3207 |
})))]; |
| 3208 |
case 2: |
| 3209 |
_c.sent(); |
| 3210 |
return [3, 6]; |
| 3211 |
case 3: |
| 3212 |
listenerError_1 = _c.sent(); |
| 3213 |
if (!(listenerError_1 instanceof TaskAbortError)) safelyNotifyError(onError, listenerError_1, { raisedBy: "effect" }); |
| 3214 |
return [3, 6]; |
| 3215 |
case 4: return [4, Promise.allSettled(autoJoinPromises)]; |
| 3216 |
case 5: |
| 3217 |
_c.sent(); |
| 3218 |
abortControllerWithReason(internalTaskController, listenerCompleted); |
| 3219 |
entry.pending.delete(internalTaskController); |
| 3220 |
return [7]; |
| 3221 |
case 6: return [2]; |
| 3222 |
} |
| 3223 |
}); |
| 3224 |
}); |
| 3225 |
}; |
| 3226 |
var clearListenerMiddleware = createClearListenerMiddleware(listenerMap); |
| 3227 |
var middleware = function(api) { |
| 3228 |
return function(next) { |
| 3229 |
return function(action) { |
| 3230 |
if (!isAction(action)) return next(action); |
| 3231 |
if (addListener.match(action)) return startListening(action.payload); |
| 3232 |
if (clearAllListeners.match(action)) { |
| 3233 |
clearListenerMiddleware(); |
| 3234 |
return; |
| 3235 |
} |
| 3236 |
if (removeListener.match(action)) return stopListening(action.payload); |
| 3237 |
var originalState = api.getState(); |
| 3238 |
var getOriginalState = function() { |
| 3239 |
if (originalState === INTERNAL_NIL_TOKEN) throw new Error(alm + ": getOriginalState can only be called synchronously"); |
| 3240 |
return originalState; |
| 3241 |
}; |
| 3242 |
var result; |
| 3243 |
try { |
| 3244 |
result = next(action); |
| 3245 |
if (listenerMap.size > 0) { |
| 3246 |
var currentState = api.getState(); |
| 3247 |
var listenerEntries = Array.from(listenerMap.values()); |
| 3248 |
for (var _i = 0, listenerEntries_1 = listenerEntries; _i < listenerEntries_1.length; _i++) { |
| 3249 |
var entry = listenerEntries_1[_i]; |
| 3250 |
var runListener = false; |
| 3251 |
try { |
| 3252 |
runListener = entry.predicate(action, currentState, originalState); |
| 3253 |
} catch (predicateError) { |
| 3254 |
runListener = false; |
| 3255 |
safelyNotifyError(onError, predicateError, { raisedBy: "predicate" }); |
| 3256 |
} |
| 3257 |
if (!runListener) continue; |
| 3258 |
notifyListener(entry, action, api, getOriginalState); |
| 3259 |
} |
| 3260 |
} |
| 3261 |
} finally { |
| 3262 |
originalState = INTERNAL_NIL_TOKEN; |
| 3263 |
} |
| 3264 |
return result; |
| 3265 |
}; |
| 3266 |
}; |
| 3267 |
}; |
| 3268 |
return { |
| 3269 |
middleware, |
| 3270 |
startListening, |
| 3271 |
stopListening, |
| 3272 |
clearListeners: clearListenerMiddleware |
| 3273 |
}; |
| 3274 |
} |
| 3275 |
var SHOULD_AUTOBATCH = "RTK_autoBatch"; |
| 3276 |
var prepareAutoBatched = function() { |
| 3277 |
return function(payload) { |
| 3278 |
var _c; |
| 3279 |
return { |
| 3280 |
payload, |
| 3281 |
meta: (_c = {}, _c[SHOULD_AUTOBATCH] = true, _c) |
| 3282 |
}; |
| 3283 |
}; |
| 3284 |
}; |
| 3285 |
var promise; |
| 3286 |
var queueMicrotaskShim = typeof queueMicrotask === "function" ? queueMicrotask.bind(typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : globalThis) : function(cb) { |
| 3287 |
return (promise || (promise = Promise.resolve())).then(cb).catch(function(err) { |
| 3288 |
return setTimeout(function() { |
| 3289 |
throw err; |
| 3290 |
}, 0); |
| 3291 |
}); |
| 3292 |
}; |
| 3293 |
var createQueueWithTimer = function(timeout) { |
| 3294 |
return function(notify) { |
| 3295 |
setTimeout(notify, timeout); |
| 3296 |
}; |
| 3297 |
}; |
| 3298 |
var rAF = typeof window !== "undefined" && window.requestAnimationFrame ? window.requestAnimationFrame : createQueueWithTimer(10); |
| 3299 |
var autoBatchEnhancer = function(options) { |
| 3300 |
if (options === void 0) options = { type: "raf" }; |
| 3301 |
return function(next) { |
| 3302 |
return function() { |
| 3303 |
var args = []; |
| 3304 |
for (var _i = 0; _i < arguments.length; _i++) args[_i] = arguments[_i]; |
| 3305 |
var store = next.apply(void 0, args); |
| 3306 |
var notifying = true; |
| 3307 |
var shouldNotifyAtEndOfTick = false; |
| 3308 |
var notificationQueued = false; |
| 3309 |
var listeners = /* @__PURE__ */ new Set(); |
| 3310 |
var queueCallback = options.type === "tick" ? queueMicrotaskShim : options.type === "raf" ? rAF : options.type === "callback" ? options.queueNotification : createQueueWithTimer(options.timeout); |
| 3311 |
var notifyListeners = function() { |
| 3312 |
notificationQueued = false; |
| 3313 |
if (shouldNotifyAtEndOfTick) { |
| 3314 |
shouldNotifyAtEndOfTick = false; |
| 3315 |
listeners.forEach(function(l) { |
| 3316 |
return l(); |
| 3317 |
}); |
| 3318 |
} |
| 3319 |
}; |
| 3320 |
return Object.assign({}, store, { |
| 3321 |
subscribe: function(listener2) { |
| 3322 |
var wrappedListener = function() { |
| 3323 |
return notifying && listener2(); |
| 3324 |
}; |
| 3325 |
var unsubscribe = store.subscribe(wrappedListener); |
| 3326 |
listeners.add(listener2); |
| 3327 |
return function() { |
| 3328 |
unsubscribe(); |
| 3329 |
listeners.delete(listener2); |
| 3330 |
}; |
| 3331 |
}, |
| 3332 |
dispatch: function(action) { |
| 3333 |
var _a; |
| 3334 |
try { |
| 3335 |
notifying = !((_a = action == null ? void 0 : action.meta) == null ? void 0 : _a[SHOULD_AUTOBATCH]); |
| 3336 |
shouldNotifyAtEndOfTick = !notifying; |
| 3337 |
if (shouldNotifyAtEndOfTick) { |
| 3338 |
if (!notificationQueued) { |
| 3339 |
notificationQueued = true; |
| 3340 |
queueCallback(notifyListeners); |
| 3341 |
} |
| 3342 |
} |
| 3343 |
return store.dispatch(action); |
| 3344 |
} finally { |
| 3345 |
notifying = true; |
| 3346 |
} |
| 3347 |
} |
| 3348 |
}); |
| 3349 |
}; |
| 3350 |
}; |
| 3351 |
}; |
| 3352 |
F(); |
| 3353 |
|
| 3354 |
//#endregion |
| 3355 |
//#region node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js |
| 3356 |
/** |
| 3357 |
* @license React |
| 3358 |
* use-sync-external-store-shim.development.js |
| 3359 |
* |
| 3360 |
* Copyright (c) Meta Platforms, Inc. and affiliates. |
| 3361 |
* |
| 3362 |
* This source code is licensed under the MIT license found in the |
| 3363 |
* LICENSE file in the root directory of this source tree. |
| 3364 |
*/ |
| 3365 |
var require_use_sync_external_store_shim_development = /* @__PURE__ */ __commonJSMin(((exports) => { |
| 3366 |
(function() { |
| 3367 |
function is(x, y) { |
| 3368 |
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y; |
| 3369 |
} |
| 3370 |
function useSyncExternalStore$2(subscribe, getSnapshot) { |
| 3371 |
didWarnOld18Alpha || void 0 === React.startTransition || (didWarnOld18Alpha = !0, console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release.")); |
| 3372 |
var value = getSnapshot(); |
| 3373 |
if (!didWarnUncachedGetSnapshot) { |
| 3374 |
var cachedValue = getSnapshot(); |
| 3375 |
objectIs(value, cachedValue) || (console.error("The result of getSnapshot should be cached to avoid an infinite loop"), didWarnUncachedGetSnapshot = !0); |
| 3376 |
} |
| 3377 |
cachedValue = useState({ inst: { |
| 3378 |
value, |
| 3379 |
getSnapshot |
| 3380 |
} }); |
| 3381 |
var inst = cachedValue[0].inst; |
| 3382 |
var forceUpdate = cachedValue[1]; |
| 3383 |
useLayoutEffect(function() { |
| 3384 |
inst.value = value; |
| 3385 |
inst.getSnapshot = getSnapshot; |
| 3386 |
checkIfSnapshotChanged(inst) && forceUpdate({ inst }); |
| 3387 |
}, [ |
| 3388 |
subscribe, |
| 3389 |
value, |
| 3390 |
getSnapshot |
| 3391 |
]); |
| 3392 |
useEffect(function() { |
| 3393 |
checkIfSnapshotChanged(inst) && forceUpdate({ inst }); |
| 3394 |
return subscribe(function() { |
| 3395 |
checkIfSnapshotChanged(inst) && forceUpdate({ inst }); |
| 3396 |
}); |
| 3397 |
}, [subscribe]); |
| 3398 |
useDebugValue(value); |
| 3399 |
return value; |
| 3400 |
} |
| 3401 |
function checkIfSnapshotChanged(inst) { |
| 3402 |
var latestGetSnapshot = inst.getSnapshot; |
| 3403 |
inst = inst.value; |
| 3404 |
try { |
| 3405 |
var nextValue = latestGetSnapshot(); |
| 3406 |
return !objectIs(inst, nextValue); |
| 3407 |
} catch (error) { |
| 3408 |
return !0; |
| 3409 |
} |
| 3410 |
} |
| 3411 |
function useSyncExternalStore$1(subscribe, getSnapshot) { |
| 3412 |
return getSnapshot(); |
| 3413 |
} |
| 3414 |
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); |
| 3415 |
var React = (globalThis.React); |
| 3416 |
var objectIs = "function" === typeof Object.is ? Object.is : is; |
| 3417 |
var useState = React.useState; |
| 3418 |
var useEffect = React.useEffect; |
| 3419 |
var useLayoutEffect = React.useLayoutEffect; |
| 3420 |
var useDebugValue = React.useDebugValue; |
| 3421 |
var didWarnOld18Alpha = !1; |
| 3422 |
var didWarnUncachedGetSnapshot = !1; |
| 3423 |
var shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2; |
| 3424 |
exports.useSyncExternalStore = void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim; |
| 3425 |
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error()); |
| 3426 |
})(); |
| 3427 |
})); |
| 3428 |
|
| 3429 |
//#endregion |
| 3430 |
//#region node_modules/use-sync-external-store/shim/index.js |
| 3431 |
var require_shim = /* @__PURE__ */ __commonJSMin(((exports, module) => { |
| 3432 |
module.exports = require_use_sync_external_store_shim_development(); |
| 3433 |
})); |
| 3434 |
|
| 3435 |
//#endregion |
| 3436 |
//#region node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js |
| 3437 |
/** |
| 3438 |
* @license React |
| 3439 |
* use-sync-external-store-shim/with-selector.development.js |
| 3440 |
* |
| 3441 |
* Copyright (c) Meta Platforms, Inc. and affiliates. |
| 3442 |
* |
| 3443 |
* This source code is licensed under the MIT license found in the |
| 3444 |
* LICENSE file in the root directory of this source tree. |
| 3445 |
*/ |
| 3446 |
var require_with_selector_development = /* @__PURE__ */ __commonJSMin(((exports) => { |
| 3447 |
(function() { |
| 3448 |
function is(x, y) { |
| 3449 |
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y; |
| 3450 |
} |
| 3451 |
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); |
| 3452 |
var React = (globalThis.React); |
| 3453 |
var shim = require_shim(); |
| 3454 |
var objectIs = "function" === typeof Object.is ? Object.is : is; |
| 3455 |
var useSyncExternalStore = shim.useSyncExternalStore; |
| 3456 |
var useRef = React.useRef; |
| 3457 |
var useEffect = React.useEffect; |
| 3458 |
var useMemo = React.useMemo; |
| 3459 |
var useDebugValue = React.useDebugValue; |
| 3460 |
exports.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) { |
| 3461 |
var instRef = useRef(null); |
| 3462 |
if (null === instRef.current) { |
| 3463 |
var inst = { |
| 3464 |
hasValue: !1, |
| 3465 |
value: null |
| 3466 |
}; |
| 3467 |
instRef.current = inst; |
| 3468 |
} else inst = instRef.current; |
| 3469 |
instRef = useMemo(function() { |
| 3470 |
function memoizedSelector(nextSnapshot) { |
| 3471 |
if (!hasMemo) { |
| 3472 |
hasMemo = !0; |
| 3473 |
memoizedSnapshot = nextSnapshot; |
| 3474 |
nextSnapshot = selector(nextSnapshot); |
| 3475 |
if (void 0 !== isEqual && inst.hasValue) { |
| 3476 |
var currentSelection = inst.value; |
| 3477 |
if (isEqual(currentSelection, nextSnapshot)) return memoizedSelection = currentSelection; |
| 3478 |
} |
| 3479 |
return memoizedSelection = nextSnapshot; |
| 3480 |
} |
| 3481 |
currentSelection = memoizedSelection; |
| 3482 |
if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection; |
| 3483 |
var nextSelection = selector(nextSnapshot); |
| 3484 |
if (void 0 !== isEqual && isEqual(currentSelection, nextSelection)) return memoizedSnapshot = nextSnapshot, currentSelection; |
| 3485 |
memoizedSnapshot = nextSnapshot; |
| 3486 |
return memoizedSelection = nextSelection; |
| 3487 |
} |
| 3488 |
var hasMemo = !1; |
| 3489 |
var memoizedSnapshot; |
| 3490 |
var memoizedSelection; |
| 3491 |
var maybeGetServerSnapshot = void 0 === getServerSnapshot ? null : getServerSnapshot; |
| 3492 |
return [function() { |
| 3493 |
return memoizedSelector(getSnapshot()); |
| 3494 |
}, null === maybeGetServerSnapshot ? void 0 : function() { |
| 3495 |
return memoizedSelector(maybeGetServerSnapshot()); |
| 3496 |
}]; |
| 3497 |
}, [ |
| 3498 |
getSnapshot, |
| 3499 |
getServerSnapshot, |
| 3500 |
selector, |
| 3501 |
isEqual |
| 3502 |
]); |
| 3503 |
var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]); |
| 3504 |
useEffect(function() { |
| 3505 |
inst.hasValue = !0; |
| 3506 |
inst.value = value; |
| 3507 |
}, [value]); |
| 3508 |
useDebugValue(value); |
| 3509 |
return value; |
| 3510 |
}; |
| 3511 |
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error()); |
| 3512 |
})(); |
| 3513 |
})); |
| 3514 |
|
| 3515 |
//#endregion |
| 3516 |
//#region node_modules/use-sync-external-store/shim/with-selector.js |
| 3517 |
var require_with_selector = /* @__PURE__ */ __commonJSMin(((exports, module) => { |
| 3518 |
module.exports = require_with_selector_development(); |
| 3519 |
})); |
| 3520 |
|
| 3521 |
//#endregion |
| 3522 |
//#region node_modules/react-redux/es/utils/reactBatchedUpdates.js |
| 3523 |
var import_shim = require_shim(); |
| 3524 |
var import_with_selector = require_with_selector(); |
| 3525 |
|
| 3526 |
//#endregion |
| 3527 |
//#region node_modules/react-redux/es/utils/batch.js |
| 3528 |
function defaultNoopBatch(callback) { |
| 3529 |
callback(); |
| 3530 |
} |
| 3531 |
var batch = defaultNoopBatch; |
| 3532 |
var setBatch = (newBatch) => batch = newBatch; |
| 3533 |
var getBatch = () => batch; |
| 3534 |
|
| 3535 |
//#endregion |
| 3536 |
//#region node_modules/react-redux/es/components/Context.js |
| 3537 |
var ContextKey = Symbol.for(`react-redux-context`); |
| 3538 |
var gT = typeof globalThis !== "undefined" ? globalThis : {}; |
| 3539 |
function getContext() { |
| 3540 |
var _gT$ContextKey; |
| 3541 |
if (!react.createContext) return {}; |
| 3542 |
const contextMap = (_gT$ContextKey = gT[ContextKey]) != null ? _gT$ContextKey : gT[ContextKey] = /* @__PURE__ */ new Map(); |
| 3543 |
let realContext = contextMap.get(react.createContext); |
| 3544 |
if (!realContext) { |
| 3545 |
realContext = react.createContext(null); |
| 3546 |
realContext.displayName = "ReactRedux"; |
| 3547 |
contextMap.set(react.createContext, realContext); |
| 3548 |
} |
| 3549 |
return realContext; |
| 3550 |
} |
| 3551 |
var ReactReduxContext = /*#__PURE__*/ getContext(); |
| 3552 |
|
| 3553 |
//#endregion |
| 3554 |
//#region node_modules/react-redux/es/hooks/useReduxContext.js |
| 3555 |
/** |
| 3556 |
* Hook factory, which creates a `useReduxContext` hook bound to a given context. This is a low-level |
| 3557 |
* hook that you should usually not need to call directly. |
| 3558 |
* |
| 3559 |
* @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`. |
| 3560 |
* @returns {Function} A `useReduxContext` hook bound to the specified context. |
| 3561 |
*/ |
| 3562 |
function createReduxContextHook(context = ReactReduxContext) { |
| 3563 |
return function useReduxContext() { |
| 3564 |
const contextValue = (0, react.useContext)(context); |
| 3565 |
if (!contextValue) throw new Error("could not find react-redux context value; please ensure the component is wrapped in a <Provider>"); |
| 3566 |
return contextValue; |
| 3567 |
}; |
| 3568 |
} |
| 3569 |
/** |
| 3570 |
* A hook to access the value of the `ReactReduxContext`. This is a low-level |
| 3571 |
* hook that you should usually not need to call directly. |
| 3572 |
* |
| 3573 |
* @returns {any} the value of the `ReactReduxContext` |
| 3574 |
* |
| 3575 |
* @example |
| 3576 |
* |
| 3577 |
* import React from 'react' |
| 3578 |
* import { useReduxContext } from 'react-redux' |
| 3579 |
* |
| 3580 |
* export const CounterComponent = () => { |
| 3581 |
* const { store } = useReduxContext() |
| 3582 |
* return <div>{store.getState()}</div> |
| 3583 |
* } |
| 3584 |
*/ |
| 3585 |
var useReduxContext = /*#__PURE__*/ createReduxContextHook(); |
| 3586 |
|
| 3587 |
//#endregion |
| 3588 |
//#region node_modules/react-redux/es/utils/useSyncExternalStore.js |
| 3589 |
var notInitialized = () => { |
| 3590 |
throw new Error("uSES not initialized!"); |
| 3591 |
}; |
| 3592 |
|
| 3593 |
//#endregion |
| 3594 |
//#region node_modules/react-redux/es/hooks/useSelector.js |
| 3595 |
var useSyncExternalStoreWithSelector$1 = notInitialized; |
| 3596 |
var initializeUseSelector = (fn) => { |
| 3597 |
useSyncExternalStoreWithSelector$1 = fn; |
| 3598 |
}; |
| 3599 |
var refEquality = (a, b) => a === b; |
| 3600 |
/** |
| 3601 |
* Hook factory, which creates a `useSelector` hook bound to a given context. |
| 3602 |
* |
| 3603 |
* @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`. |
| 3604 |
* @returns {Function} A `useSelector` hook bound to the specified context. |
| 3605 |
*/ |
| 3606 |
function createSelectorHook(context = ReactReduxContext) { |
| 3607 |
const useReduxContext$2 = context === ReactReduxContext ? useReduxContext : createReduxContextHook(context); |
| 3608 |
return function useSelector(selector, equalityFnOrOptions = {}) { |
| 3609 |
const { equalityFn = refEquality, stabilityCheck = void 0, noopCheck = void 0 } = typeof equalityFnOrOptions === "function" ? { equalityFn: equalityFnOrOptions } : equalityFnOrOptions; |
| 3610 |
if (!selector) throw new Error(`You must pass a selector to useSelector`); |
| 3611 |
if (typeof selector !== "function") throw new Error(`You must pass a function as a selector to useSelector`); |
| 3612 |
if (typeof equalityFn !== "function") throw new Error(`You must pass a function as an equality function to useSelector`); |
| 3613 |
const { store, subscription, getServerState, stabilityCheck: globalStabilityCheck, noopCheck: globalNoopCheck } = useReduxContext$2(); |
| 3614 |
const firstRun = (0, react.useRef)(true); |
| 3615 |
const wrappedSelector = (0, react.useCallback)({ [selector.name](state) { |
| 3616 |
const selected = selector(state); |
| 3617 |
{ |
| 3618 |
const finalStabilityCheck = typeof stabilityCheck === "undefined" ? globalStabilityCheck : stabilityCheck; |
| 3619 |
if (finalStabilityCheck === "always" || finalStabilityCheck === "once" && firstRun.current) { |
| 3620 |
const toCompare = selector(state); |
| 3621 |
if (!equalityFn(selected, toCompare)) { |
| 3622 |
let stack = void 0; |
| 3623 |
try { |
| 3624 |
throw new Error(); |
| 3625 |
} catch (e) { |
| 3626 |
({stack} = e); |
| 3627 |
} |
| 3628 |
console.warn("Selector " + (selector.name || "unknown") + " returned a different result when called with the same parameters. This can lead to unnecessary rerenders.\nSelectors that return a new reference (such as an object or an array) should be memoized: https://redux.js.org/usage/deriving-data-selectors#optimizing-selectors-with-memoization", { |
| 3629 |
state, |
| 3630 |
selected, |
| 3631 |
selected2: toCompare, |
| 3632 |
stack |
| 3633 |
}); |
| 3634 |
} |
| 3635 |
} |
| 3636 |
const finalNoopCheck = typeof noopCheck === "undefined" ? globalNoopCheck : noopCheck; |
| 3637 |
if (finalNoopCheck === "always" || finalNoopCheck === "once" && firstRun.current) { |
| 3638 |
if (selected === state) { |
| 3639 |
let stack = void 0; |
| 3640 |
try { |
| 3641 |
throw new Error(); |
| 3642 |
} catch (e) { |
| 3643 |
({stack} = e); |
| 3644 |
} |
| 3645 |
console.warn("Selector " + (selector.name || "unknown") + " returned the root state when called. This can lead to unnecessary rerenders.\nSelectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.", { stack }); |
| 3646 |
} |
| 3647 |
} |
| 3648 |
if (firstRun.current) firstRun.current = false; |
| 3649 |
} |
| 3650 |
return selected; |
| 3651 |
} }[selector.name], [ |
| 3652 |
selector, |
| 3653 |
globalStabilityCheck, |
| 3654 |
stabilityCheck |
| 3655 |
]); |
| 3656 |
const selectedState = useSyncExternalStoreWithSelector$1(subscription.addNestedSub, store.getState, getServerState || store.getState, wrappedSelector, equalityFn); |
| 3657 |
(0, react.useDebugValue)(selectedState); |
| 3658 |
return selectedState; |
| 3659 |
}; |
| 3660 |
} |
| 3661 |
/** |
| 3662 |
* A hook to access the redux store's state. This hook takes a selector function |
| 3663 |
* as an argument. The selector is called with the store state. |
| 3664 |
* |
| 3665 |
* This hook takes an optional equality comparison function as the second parameter |
| 3666 |
* that allows you to customize the way the selected state is compared to determine |
| 3667 |
* whether the component needs to be re-rendered. |
| 3668 |
* |
| 3669 |
* @param {Function} selector the selector function |
| 3670 |
* @param {Function=} equalityFn the function that will be used to determine equality |
| 3671 |
* |
| 3672 |
* @returns {any} the selected state |
| 3673 |
* |
| 3674 |
* @example |
| 3675 |
* |
| 3676 |
* import React from 'react' |
| 3677 |
* import { useSelector } from 'react-redux' |
| 3678 |
* |
| 3679 |
* export const CounterComponent = () => { |
| 3680 |
* const counter = useSelector(state => state.counter) |
| 3681 |
* return <div>{counter}</div> |
| 3682 |
* } |
| 3683 |
*/ |
| 3684 |
var useSelector = /*#__PURE__*/ createSelectorHook(); |
| 3685 |
|
| 3686 |
//#endregion |
| 3687 |
//#region node_modules/@babel/runtime/helpers/esm/extends.js |
| 3688 |
function _extends() { |
| 3689 |
return _extends = Object.assign ? Object.assign.bind() : function(n) { |
| 3690 |
for (var e = 1; e < arguments.length; e++) { |
| 3691 |
var t = arguments[e]; |
| 3692 |
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); |
| 3693 |
} |
| 3694 |
return n; |
| 3695 |
}, _extends.apply(null, arguments); |
| 3696 |
} |
| 3697 |
|
| 3698 |
//#endregion |
| 3699 |
//#region node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js |
| 3700 |
function _objectWithoutPropertiesLoose(r, e) { |
| 3701 |
if (null == r) return {}; |
| 3702 |
var t = {}; |
| 3703 |
for (var n in r) if ({}.hasOwnProperty.call(r, n)) { |
| 3704 |
if (-1 !== e.indexOf(n)) continue; |
| 3705 |
t[n] = r[n]; |
| 3706 |
} |
| 3707 |
return t; |
| 3708 |
} |
| 3709 |
|
| 3710 |
//#endregion |
| 3711 |
//#region node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.development.js |
| 3712 |
/** @license React v16.13.1 |
| 3713 |
* react-is.development.js |
| 3714 |
* |
| 3715 |
* Copyright (c) Facebook, Inc. and its affiliates. |
| 3716 |
* |
| 3717 |
* This source code is licensed under the MIT license found in the |
| 3718 |
* LICENSE file in the root directory of this source tree. |
| 3719 |
*/ |
| 3720 |
var require_react_is_development$1 = /* @__PURE__ */ __commonJSMin(((exports) => { |
| 3721 |
(function() { |
| 3722 |
"use strict"; |
| 3723 |
var hasSymbol = typeof Symbol === "function" && Symbol.for; |
| 3724 |
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for("react.element") : 60103; |
| 3725 |
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for("react.portal") : 60106; |
| 3726 |
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for("react.fragment") : 60107; |
| 3727 |
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for("react.strict_mode") : 60108; |
| 3728 |
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for("react.profiler") : 60114; |
| 3729 |
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for("react.provider") : 60109; |
| 3730 |
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for("react.context") : 60110; |
| 3731 |
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for("react.async_mode") : 60111; |
| 3732 |
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for("react.concurrent_mode") : 60111; |
| 3733 |
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for("react.forward_ref") : 60112; |
| 3734 |
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for("react.suspense") : 60113; |
| 3735 |
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for("react.suspense_list") : 60120; |
| 3736 |
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for("react.memo") : 60115; |
| 3737 |
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for("react.lazy") : 60116; |
| 3738 |
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for("react.block") : 60121; |
| 3739 |
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for("react.fundamental") : 60117; |
| 3740 |
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for("react.responder") : 60118; |
| 3741 |
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for("react.scope") : 60119; |
| 3742 |
function isValidElementType(type) { |
| 3743 |
return typeof type === "string" || typeof type === "function" || type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE); |
| 3744 |
} |
| 3745 |
function typeOf(object) { |
| 3746 |
if (typeof object === "object" && object !== null) { |
| 3747 |
var $$typeof = object.$$typeof; |
| 3748 |
switch ($$typeof) { |
| 3749 |
case REACT_ELEMENT_TYPE: |
| 3750 |
var type = object.type; |
| 3751 |
switch (type) { |
| 3752 |
case REACT_ASYNC_MODE_TYPE: |
| 3753 |
case REACT_CONCURRENT_MODE_TYPE: |
| 3754 |
case REACT_FRAGMENT_TYPE: |
| 3755 |
case REACT_PROFILER_TYPE: |
| 3756 |
case REACT_STRICT_MODE_TYPE: |
| 3757 |
case REACT_SUSPENSE_TYPE: return type; |
| 3758 |
default: |
| 3759 |
var $$typeofType = type && type.$$typeof; |
| 3760 |
switch ($$typeofType) { |
| 3761 |
case REACT_CONTEXT_TYPE: |
| 3762 |
case REACT_FORWARD_REF_TYPE: |
| 3763 |
case REACT_LAZY_TYPE: |
| 3764 |
case REACT_MEMO_TYPE: |
| 3765 |
case REACT_PROVIDER_TYPE: return $$typeofType; |
| 3766 |
default: return $$typeof; |
| 3767 |
} |
| 3768 |
} |
| 3769 |
case REACT_PORTAL_TYPE: return $$typeof; |
| 3770 |
} |
| 3771 |
} |
| 3772 |
} |
| 3773 |
var AsyncMode = REACT_ASYNC_MODE_TYPE; |
| 3774 |
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; |
| 3775 |
var ContextConsumer = REACT_CONTEXT_TYPE; |
| 3776 |
var ContextProvider = REACT_PROVIDER_TYPE; |
| 3777 |
var Element = REACT_ELEMENT_TYPE; |
| 3778 |
var ForwardRef = REACT_FORWARD_REF_TYPE; |
| 3779 |
var Fragment = REACT_FRAGMENT_TYPE; |
| 3780 |
var Lazy = REACT_LAZY_TYPE; |
| 3781 |
var Memo = REACT_MEMO_TYPE; |
| 3782 |
var Portal = REACT_PORTAL_TYPE; |
| 3783 |
var Profiler = REACT_PROFILER_TYPE; |
| 3784 |
var StrictMode = REACT_STRICT_MODE_TYPE; |
| 3785 |
var Suspense = REACT_SUSPENSE_TYPE; |
| 3786 |
var hasWarnedAboutDeprecatedIsAsyncMode = false; |
| 3787 |
function isAsyncMode(object) { |
| 3788 |
if (!hasWarnedAboutDeprecatedIsAsyncMode) { |
| 3789 |
hasWarnedAboutDeprecatedIsAsyncMode = true; |
| 3790 |
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."); |
| 3791 |
} |
| 3792 |
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE; |
| 3793 |
} |
| 3794 |
function isConcurrentMode(object) { |
| 3795 |
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE; |
| 3796 |
} |
| 3797 |
function isContextConsumer(object) { |
| 3798 |
return typeOf(object) === REACT_CONTEXT_TYPE; |
| 3799 |
} |
| 3800 |
function isContextProvider(object) { |
| 3801 |
return typeOf(object) === REACT_PROVIDER_TYPE; |
| 3802 |
} |
| 3803 |
function isElement(object) { |
| 3804 |
return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; |
| 3805 |
} |
| 3806 |
function isForwardRef(object) { |
| 3807 |
return typeOf(object) === REACT_FORWARD_REF_TYPE; |
| 3808 |
} |
| 3809 |
function isFragment(object) { |
| 3810 |
return typeOf(object) === REACT_FRAGMENT_TYPE; |
| 3811 |
} |
| 3812 |
function isLazy(object) { |
| 3813 |
return typeOf(object) === REACT_LAZY_TYPE; |
| 3814 |
} |
| 3815 |
function isMemo(object) { |
| 3816 |
return typeOf(object) === REACT_MEMO_TYPE; |
| 3817 |
} |
| 3818 |
function isPortal(object) { |
| 3819 |
return typeOf(object) === REACT_PORTAL_TYPE; |
| 3820 |
} |
| 3821 |
function isProfiler(object) { |
| 3822 |
return typeOf(object) === REACT_PROFILER_TYPE; |
| 3823 |
} |
| 3824 |
function isStrictMode(object) { |
| 3825 |
return typeOf(object) === REACT_STRICT_MODE_TYPE; |
| 3826 |
} |
| 3827 |
function isSuspense(object) { |
| 3828 |
return typeOf(object) === REACT_SUSPENSE_TYPE; |
| 3829 |
} |
| 3830 |
exports.AsyncMode = AsyncMode; |
| 3831 |
exports.ConcurrentMode = ConcurrentMode; |
| 3832 |
exports.ContextConsumer = ContextConsumer; |
| 3833 |
exports.ContextProvider = ContextProvider; |
| 3834 |
exports.Element = Element; |
| 3835 |
exports.ForwardRef = ForwardRef; |
| 3836 |
exports.Fragment = Fragment; |
| 3837 |
exports.Lazy = Lazy; |
| 3838 |
exports.Memo = Memo; |
| 3839 |
exports.Portal = Portal; |
| 3840 |
exports.Profiler = Profiler; |
| 3841 |
exports.StrictMode = StrictMode; |
| 3842 |
exports.Suspense = Suspense; |
| 3843 |
exports.isAsyncMode = isAsyncMode; |
| 3844 |
exports.isConcurrentMode = isConcurrentMode; |
| 3845 |
exports.isContextConsumer = isContextConsumer; |
| 3846 |
exports.isContextProvider = isContextProvider; |
| 3847 |
exports.isElement = isElement; |
| 3848 |
exports.isForwardRef = isForwardRef; |
| 3849 |
exports.isFragment = isFragment; |
| 3850 |
exports.isLazy = isLazy; |
| 3851 |
exports.isMemo = isMemo; |
| 3852 |
exports.isPortal = isPortal; |
| 3853 |
exports.isProfiler = isProfiler; |
| 3854 |
exports.isStrictMode = isStrictMode; |
| 3855 |
exports.isSuspense = isSuspense; |
| 3856 |
exports.isValidElementType = isValidElementType; |
| 3857 |
exports.typeOf = typeOf; |
| 3858 |
})(); |
| 3859 |
})); |
| 3860 |
|
| 3861 |
//#endregion |
| 3862 |
//#region node_modules/hoist-non-react-statics/node_modules/react-is/index.js |
| 3863 |
var require_react_is$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { |
| 3864 |
module.exports = require_react_is_development$1(); |
| 3865 |
})); |
| 3866 |
|
| 3867 |
//#endregion |
| 3868 |
//#region node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js |
| 3869 |
var require_hoist_non_react_statics_cjs = /* @__PURE__ */ __commonJSMin(((exports, module) => { |
| 3870 |
var reactIs = require_react_is$1(); |
| 3871 |
/** |
| 3872 |
* Copyright 2015, Yahoo! Inc. |
| 3873 |
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. |
| 3874 |
*/ |
| 3875 |
var REACT_STATICS = { |
| 3876 |
childContextTypes: true, |
| 3877 |
contextType: true, |
| 3878 |
contextTypes: true, |
| 3879 |
defaultProps: true, |
| 3880 |
displayName: true, |
| 3881 |
getDefaultProps: true, |
| 3882 |
getDerivedStateFromError: true, |
| 3883 |
getDerivedStateFromProps: true, |
| 3884 |
mixins: true, |
| 3885 |
propTypes: true, |
| 3886 |
type: true |
| 3887 |
}; |
| 3888 |
var KNOWN_STATICS = { |
| 3889 |
name: true, |
| 3890 |
length: true, |
| 3891 |
prototype: true, |
| 3892 |
caller: true, |
| 3893 |
callee: true, |
| 3894 |
arguments: true, |
| 3895 |
arity: true |
| 3896 |
}; |
| 3897 |
var FORWARD_REF_STATICS = { |
| 3898 |
"$$typeof": true, |
| 3899 |
render: true, |
| 3900 |
defaultProps: true, |
| 3901 |
displayName: true, |
| 3902 |
propTypes: true |
| 3903 |
}; |
| 3904 |
var MEMO_STATICS = { |
| 3905 |
"$$typeof": true, |
| 3906 |
compare: true, |
| 3907 |
defaultProps: true, |
| 3908 |
displayName: true, |
| 3909 |
propTypes: true, |
| 3910 |
type: true |
| 3911 |
}; |
| 3912 |
var TYPE_STATICS = {}; |
| 3913 |
TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS; |
| 3914 |
TYPE_STATICS[reactIs.Memo] = MEMO_STATICS; |
| 3915 |
function getStatics(component) { |
| 3916 |
if (reactIs.isMemo(component)) return MEMO_STATICS; |
| 3917 |
return TYPE_STATICS[component["$$typeof"]] || REACT_STATICS; |
| 3918 |
} |
| 3919 |
var defineProperty = Object.defineProperty; |
| 3920 |
var getOwnPropertyNames = Object.getOwnPropertyNames; |
| 3921 |
var getOwnPropertySymbols = Object.getOwnPropertySymbols; |
| 3922 |
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; |
| 3923 |
var getPrototypeOf = Object.getPrototypeOf; |
| 3924 |
var objectPrototype = Object.prototype; |
| 3925 |
function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) { |
| 3926 |
if (typeof sourceComponent !== "string") { |
| 3927 |
if (objectPrototype) { |
| 3928 |
var inheritedComponent = getPrototypeOf(sourceComponent); |
| 3929 |
if (inheritedComponent && inheritedComponent !== objectPrototype) hoistNonReactStatics(targetComponent, inheritedComponent, blacklist); |
| 3930 |
} |
| 3931 |
var keys = getOwnPropertyNames(sourceComponent); |
| 3932 |
if (getOwnPropertySymbols) keys = keys.concat(getOwnPropertySymbols(sourceComponent)); |
| 3933 |
var targetStatics = getStatics(targetComponent); |
| 3934 |
var sourceStatics = getStatics(sourceComponent); |
| 3935 |
for (var i = 0; i < keys.length; ++i) { |
| 3936 |
var key = keys[i]; |
| 3937 |
if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) { |
| 3938 |
var descriptor = getOwnPropertyDescriptor(sourceComponent, key); |
| 3939 |
try { |
| 3940 |
defineProperty(targetComponent, key, descriptor); |
| 3941 |
} catch (e) {} |
| 3942 |
} |
| 3943 |
} |
| 3944 |
} |
| 3945 |
return targetComponent; |
| 3946 |
} |
| 3947 |
module.exports = hoistNonReactStatics; |
| 3948 |
})); |
| 3949 |
|
| 3950 |
//#endregion |
| 3951 |
//#region node_modules/react-is/cjs/react-is.development.js |
| 3952 |
/** |
| 3953 |
* @license React |
| 3954 |
* react-is.development.js |
| 3955 |
* |
| 3956 |
* Copyright (c) Facebook, Inc. and its affiliates. |
| 3957 |
* |
| 3958 |
* This source code is licensed under the MIT license found in the |
| 3959 |
* LICENSE file in the root directory of this source tree. |
| 3960 |
*/ |
| 3961 |
var require_react_is_development = /* @__PURE__ */ __commonJSMin(((exports) => { |
| 3962 |
(function() { |
| 3963 |
"use strict"; |
| 3964 |
var REACT_ELEMENT_TYPE = Symbol.for("react.element"); |
| 3965 |
var REACT_PORTAL_TYPE = Symbol.for("react.portal"); |
| 3966 |
var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"); |
| 3967 |
var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"); |
| 3968 |
var REACT_PROFILER_TYPE = Symbol.for("react.profiler"); |
| 3969 |
var REACT_PROVIDER_TYPE = Symbol.for("react.provider"); |
| 3970 |
var REACT_CONTEXT_TYPE = Symbol.for("react.context"); |
| 3971 |
var REACT_SERVER_CONTEXT_TYPE = Symbol.for("react.server_context"); |
| 3972 |
var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"); |
| 3973 |
var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"); |
| 3974 |
var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"); |
| 3975 |
var REACT_MEMO_TYPE = Symbol.for("react.memo"); |
| 3976 |
var REACT_LAZY_TYPE = Symbol.for("react.lazy"); |
| 3977 |
var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"); |
| 3978 |
var enableScopeAPI = false; |
| 3979 |
var enableCacheElement = false; |
| 3980 |
var enableTransitionTracing = false; |
| 3981 |
var enableLegacyHidden = false; |
| 3982 |
var enableDebugTracing = false; |
| 3983 |
var REACT_MODULE_REFERENCE = Symbol.for("react.module.reference"); |
| 3984 |
function isValidElementType(type) { |
| 3985 |
if (typeof type === "string" || typeof type === "function") return true; |
| 3986 |
if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) return true; |
| 3987 |
if (typeof type === "object" && type !== null) { |
| 3988 |
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) return true; |
| 3989 |
} |
| 3990 |
return false; |
| 3991 |
} |
| 3992 |
function typeOf(object) { |
| 3993 |
if (typeof object === "object" && object !== null) { |
| 3994 |
var $$typeof = object.$$typeof; |
| 3995 |
switch ($$typeof) { |
| 3996 |
case REACT_ELEMENT_TYPE: |
| 3997 |
var type = object.type; |
| 3998 |
switch (type) { |
| 3999 |
case REACT_FRAGMENT_TYPE: |
| 4000 |
case REACT_PROFILER_TYPE: |
| 4001 |
case REACT_STRICT_MODE_TYPE: |
| 4002 |
case REACT_SUSPENSE_TYPE: |
| 4003 |
case REACT_SUSPENSE_LIST_TYPE: return type; |
| 4004 |
default: |
| 4005 |
var $$typeofType = type && type.$$typeof; |
| 4006 |
switch ($$typeofType) { |
| 4007 |
case REACT_SERVER_CONTEXT_TYPE: |
| 4008 |
case REACT_CONTEXT_TYPE: |
| 4009 |
case REACT_FORWARD_REF_TYPE: |
| 4010 |
case REACT_LAZY_TYPE: |
| 4011 |
case REACT_MEMO_TYPE: |
| 4012 |
case REACT_PROVIDER_TYPE: return $$typeofType; |
| 4013 |
default: return $$typeof; |
| 4014 |
} |
| 4015 |
} |
| 4016 |
case REACT_PORTAL_TYPE: return $$typeof; |
| 4017 |
} |
| 4018 |
} |
| 4019 |
} |
| 4020 |
var ContextConsumer = REACT_CONTEXT_TYPE; |
| 4021 |
var ContextProvider = REACT_PROVIDER_TYPE; |
| 4022 |
var Element = REACT_ELEMENT_TYPE; |
| 4023 |
var ForwardRef = REACT_FORWARD_REF_TYPE; |
| 4024 |
var Fragment = REACT_FRAGMENT_TYPE; |
| 4025 |
var Lazy = REACT_LAZY_TYPE; |
| 4026 |
var Memo = REACT_MEMO_TYPE; |
| 4027 |
var Portal = REACT_PORTAL_TYPE; |
| 4028 |
var Profiler = REACT_PROFILER_TYPE; |
| 4029 |
var StrictMode = REACT_STRICT_MODE_TYPE; |
| 4030 |
var Suspense = REACT_SUSPENSE_TYPE; |
| 4031 |
var SuspenseList = REACT_SUSPENSE_LIST_TYPE; |
| 4032 |
var hasWarnedAboutDeprecatedIsAsyncMode = false; |
| 4033 |
var hasWarnedAboutDeprecatedIsConcurrentMode = false; |
| 4034 |
function isAsyncMode(object) { |
| 4035 |
if (!hasWarnedAboutDeprecatedIsAsyncMode) { |
| 4036 |
hasWarnedAboutDeprecatedIsAsyncMode = true; |
| 4037 |
console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+."); |
| 4038 |
} |
| 4039 |
return false; |
| 4040 |
} |
| 4041 |
function isConcurrentMode(object) { |
| 4042 |
if (!hasWarnedAboutDeprecatedIsConcurrentMode) { |
| 4043 |
hasWarnedAboutDeprecatedIsConcurrentMode = true; |
| 4044 |
console["warn"]("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+."); |
| 4045 |
} |
| 4046 |
return false; |
| 4047 |
} |
| 4048 |
function isContextConsumer(object) { |
| 4049 |
return typeOf(object) === REACT_CONTEXT_TYPE; |
| 4050 |
} |
| 4051 |
function isContextProvider(object) { |
| 4052 |
return typeOf(object) === REACT_PROVIDER_TYPE; |
| 4053 |
} |
| 4054 |
function isElement(object) { |
| 4055 |
return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; |
| 4056 |
} |
| 4057 |
function isForwardRef(object) { |
| 4058 |
return typeOf(object) === REACT_FORWARD_REF_TYPE; |
| 4059 |
} |
| 4060 |
function isFragment(object) { |
| 4061 |
return typeOf(object) === REACT_FRAGMENT_TYPE; |
| 4062 |
} |
| 4063 |
function isLazy(object) { |
| 4064 |
return typeOf(object) === REACT_LAZY_TYPE; |
| 4065 |
} |
| 4066 |
function isMemo(object) { |
| 4067 |
return typeOf(object) === REACT_MEMO_TYPE; |
| 4068 |
} |
| 4069 |
function isPortal(object) { |
| 4070 |
return typeOf(object) === REACT_PORTAL_TYPE; |
| 4071 |
} |
| 4072 |
function isProfiler(object) { |
| 4073 |
return typeOf(object) === REACT_PROFILER_TYPE; |
| 4074 |
} |
| 4075 |
function isStrictMode(object) { |
| 4076 |
return typeOf(object) === REACT_STRICT_MODE_TYPE; |
| 4077 |
} |
| 4078 |
function isSuspense(object) { |
| 4079 |
return typeOf(object) === REACT_SUSPENSE_TYPE; |
| 4080 |
} |
| 4081 |
function isSuspenseList(object) { |
| 4082 |
return typeOf(object) === REACT_SUSPENSE_LIST_TYPE; |
| 4083 |
} |
| 4084 |
exports.ContextConsumer = ContextConsumer; |
| 4085 |
exports.ContextProvider = ContextProvider; |
| 4086 |
exports.Element = Element; |
| 4087 |
exports.ForwardRef = ForwardRef; |
| 4088 |
exports.Fragment = Fragment; |
| 4089 |
exports.Lazy = Lazy; |
| 4090 |
exports.Memo = Memo; |
| 4091 |
exports.Portal = Portal; |
| 4092 |
exports.Profiler = Profiler; |
| 4093 |
exports.StrictMode = StrictMode; |
| 4094 |
exports.Suspense = Suspense; |
| 4095 |
exports.SuspenseList = SuspenseList; |
| 4096 |
exports.isAsyncMode = isAsyncMode; |
| 4097 |
exports.isConcurrentMode = isConcurrentMode; |
| 4098 |
exports.isContextConsumer = isContextConsumer; |
| 4099 |
exports.isContextProvider = isContextProvider; |
| 4100 |
exports.isElement = isElement; |
| 4101 |
exports.isForwardRef = isForwardRef; |
| 4102 |
exports.isFragment = isFragment; |
| 4103 |
exports.isLazy = isLazy; |
| 4104 |
exports.isMemo = isMemo; |
| 4105 |
exports.isPortal = isPortal; |
| 4106 |
exports.isProfiler = isProfiler; |
| 4107 |
exports.isStrictMode = isStrictMode; |
| 4108 |
exports.isSuspense = isSuspense; |
| 4109 |
exports.isSuspenseList = isSuspenseList; |
| 4110 |
exports.isValidElementType = isValidElementType; |
| 4111 |
exports.typeOf = typeOf; |
| 4112 |
})(); |
| 4113 |
})); |
| 4114 |
|
| 4115 |
//#endregion |
| 4116 |
//#region node_modules/react-is/index.js |
| 4117 |
var require_react_is = /* @__PURE__ */ __commonJSMin(((exports, module) => { |
| 4118 |
module.exports = require_react_is_development(); |
| 4119 |
})); |
| 4120 |
|
| 4121 |
//#endregion |
| 4122 |
//#region node_modules/react-redux/es/utils/warning.js |
| 4123 |
var import_hoist_non_react_statics_cjs = /* @__PURE__ */ __toESM(require_hoist_non_react_statics_cjs()); |
| 4124 |
var import_react_is = require_react_is(); |
| 4125 |
/** |
| 4126 |
* Prints a warning in the console if it exists. |
| 4127 |
* |
| 4128 |
* @param {String} message The warning message. |
| 4129 |
* @returns {void} |
| 4130 |
*/ |
| 4131 |
function warning(message) { |
| 4132 |
if (typeof console !== "undefined" && typeof console.error === "function") console.error(message); |
| 4133 |
try { |
| 4134 |
throw new Error(message); |
| 4135 |
} catch (e) {} |
| 4136 |
} |
| 4137 |
|
| 4138 |
//#endregion |
| 4139 |
//#region node_modules/react-redux/es/connect/verifySubselectors.js |
| 4140 |
function verify(selector, methodName) { |
| 4141 |
if (!selector) throw new Error(`Unexpected value for ${methodName} in connect.`); |
| 4142 |
else if (methodName === "mapStateToProps" || methodName === "mapDispatchToProps") { |
| 4143 |
if (!Object.prototype.hasOwnProperty.call(selector, "dependsOnOwnProps")) warning(`The selector for ${methodName} of connect did not specify a value for dependsOnOwnProps.`); |
| 4144 |
} |
| 4145 |
} |
| 4146 |
function verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps) { |
| 4147 |
verify(mapStateToProps, "mapStateToProps"); |
| 4148 |
verify(mapDispatchToProps, "mapDispatchToProps"); |
| 4149 |
verify(mergeProps, "mergeProps"); |
| 4150 |
} |
| 4151 |
|
| 4152 |
//#endregion |
| 4153 |
//#region node_modules/react-redux/es/connect/selectorFactory.js |
| 4154 |
var _excluded$1 = [ |
| 4155 |
"initMapStateToProps", |
| 4156 |
"initMapDispatchToProps", |
| 4157 |
"initMergeProps" |
| 4158 |
]; |
| 4159 |
function pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, { areStatesEqual, areOwnPropsEqual, areStatePropsEqual }) { |
| 4160 |
let hasRunAtLeastOnce = false; |
| 4161 |
let state; |
| 4162 |
let ownProps; |
| 4163 |
let stateProps; |
| 4164 |
let dispatchProps; |
| 4165 |
let mergedProps; |
| 4166 |
function handleFirstCall(firstState, firstOwnProps) { |
| 4167 |
state = firstState; |
| 4168 |
ownProps = firstOwnProps; |
| 4169 |
stateProps = mapStateToProps(state, ownProps); |
| 4170 |
dispatchProps = mapDispatchToProps(dispatch, ownProps); |
| 4171 |
mergedProps = mergeProps(stateProps, dispatchProps, ownProps); |
| 4172 |
hasRunAtLeastOnce = true; |
| 4173 |
return mergedProps; |
| 4174 |
} |
| 4175 |
function handleNewPropsAndNewState() { |
| 4176 |
stateProps = mapStateToProps(state, ownProps); |
| 4177 |
if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps); |
| 4178 |
mergedProps = mergeProps(stateProps, dispatchProps, ownProps); |
| 4179 |
return mergedProps; |
| 4180 |
} |
| 4181 |
function handleNewProps() { |
| 4182 |
if (mapStateToProps.dependsOnOwnProps) stateProps = mapStateToProps(state, ownProps); |
| 4183 |
if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps); |
| 4184 |
mergedProps = mergeProps(stateProps, dispatchProps, ownProps); |
| 4185 |
return mergedProps; |
| 4186 |
} |
| 4187 |
function handleNewState() { |
| 4188 |
const nextStateProps = mapStateToProps(state, ownProps); |
| 4189 |
const statePropsChanged = !areStatePropsEqual(nextStateProps, stateProps); |
| 4190 |
stateProps = nextStateProps; |
| 4191 |
if (statePropsChanged) mergedProps = mergeProps(stateProps, dispatchProps, ownProps); |
| 4192 |
return mergedProps; |
| 4193 |
} |
| 4194 |
function handleSubsequentCalls(nextState, nextOwnProps) { |
| 4195 |
const propsChanged = !areOwnPropsEqual(nextOwnProps, ownProps); |
| 4196 |
const stateChanged = !areStatesEqual(nextState, state, nextOwnProps, ownProps); |
| 4197 |
state = nextState; |
| 4198 |
ownProps = nextOwnProps; |
| 4199 |
if (propsChanged && stateChanged) return handleNewPropsAndNewState(); |
| 4200 |
if (propsChanged) return handleNewProps(); |
| 4201 |
if (stateChanged) return handleNewState(); |
| 4202 |
return mergedProps; |
| 4203 |
} |
| 4204 |
return function pureFinalPropsSelector(nextState, nextOwnProps) { |
| 4205 |
return hasRunAtLeastOnce ? handleSubsequentCalls(nextState, nextOwnProps) : handleFirstCall(nextState, nextOwnProps); |
| 4206 |
}; |
| 4207 |
} |
| 4208 |
function finalPropsSelectorFactory(dispatch, _ref) { |
| 4209 |
let { initMapStateToProps, initMapDispatchToProps, initMergeProps } = _ref, options = _objectWithoutPropertiesLoose(_ref, _excluded$1); |
| 4210 |
const mapStateToProps = initMapStateToProps(dispatch, options); |
| 4211 |
const mapDispatchToProps = initMapDispatchToProps(dispatch, options); |
| 4212 |
const mergeProps = initMergeProps(dispatch, options); |
| 4213 |
verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps); |
| 4214 |
return pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, options); |
| 4215 |
} |
| 4216 |
|
| 4217 |
//#endregion |
| 4218 |
//#region node_modules/react-redux/es/utils/bindActionCreators.js |
| 4219 |
function bindActionCreators(actionCreators, dispatch) { |
| 4220 |
const boundActionCreators = {}; |
| 4221 |
for (const key in actionCreators) { |
| 4222 |
const actionCreator = actionCreators[key]; |
| 4223 |
if (typeof actionCreator === "function") boundActionCreators[key] = (...args) => dispatch(actionCreator(...args)); |
| 4224 |
} |
| 4225 |
return boundActionCreators; |
| 4226 |
} |
| 4227 |
|
| 4228 |
//#endregion |
| 4229 |
//#region node_modules/react-redux/es/utils/isPlainObject.js |
| 4230 |
/** |
| 4231 |
* @param {any} obj The object to inspect. |
| 4232 |
* @returns {boolean} True if the argument appears to be a plain object. |
| 4233 |
*/ |
| 4234 |
function isPlainObject(obj) { |
| 4235 |
if (typeof obj !== "object" || obj === null) return false; |
| 4236 |
let proto = Object.getPrototypeOf(obj); |
| 4237 |
if (proto === null) return true; |
| 4238 |
let baseProto = proto; |
| 4239 |
while (Object.getPrototypeOf(baseProto) !== null) baseProto = Object.getPrototypeOf(baseProto); |
| 4240 |
return proto === baseProto; |
| 4241 |
} |
| 4242 |
|
| 4243 |
//#endregion |
| 4244 |
//#region node_modules/react-redux/es/utils/verifyPlainObject.js |
| 4245 |
function verifyPlainObject(value, displayName, methodName) { |
| 4246 |
if (!isPlainObject(value)) warning(`${methodName}() in ${displayName} must return a plain object. Instead received ${value}.`); |
| 4247 |
} |
| 4248 |
|
| 4249 |
//#endregion |
| 4250 |
//#region node_modules/react-redux/es/connect/wrapMapToProps.js |
| 4251 |
function wrapMapToPropsConstant(getConstant) { |
| 4252 |
return function initConstantSelector(dispatch) { |
| 4253 |
const constant = getConstant(dispatch); |
| 4254 |
function constantSelector() { |
| 4255 |
return constant; |
| 4256 |
} |
| 4257 |
constantSelector.dependsOnOwnProps = false; |
| 4258 |
return constantSelector; |
| 4259 |
}; |
| 4260 |
} |
| 4261 |
function getDependsOnOwnProps(mapToProps) { |
| 4262 |
return mapToProps.dependsOnOwnProps ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1; |
| 4263 |
} |
| 4264 |
function wrapMapToPropsFunc(mapToProps, methodName) { |
| 4265 |
return function initProxySelector(dispatch, { displayName }) { |
| 4266 |
const proxy = function mapToPropsProxy(stateOrDispatch, ownProps) { |
| 4267 |
return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch, void 0); |
| 4268 |
}; |
| 4269 |
proxy.dependsOnOwnProps = true; |
| 4270 |
proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) { |
| 4271 |
proxy.mapToProps = mapToProps; |
| 4272 |
proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps); |
| 4273 |
let props = proxy(stateOrDispatch, ownProps); |
| 4274 |
if (typeof props === "function") { |
| 4275 |
proxy.mapToProps = props; |
| 4276 |
proxy.dependsOnOwnProps = getDependsOnOwnProps(props); |
| 4277 |
props = proxy(stateOrDispatch, ownProps); |
| 4278 |
} |
| 4279 |
verifyPlainObject(props, displayName, methodName); |
| 4280 |
return props; |
| 4281 |
}; |
| 4282 |
return proxy; |
| 4283 |
}; |
| 4284 |
} |
| 4285 |
|
| 4286 |
//#endregion |
| 4287 |
//#region node_modules/react-redux/es/connect/invalidArgFactory.js |
| 4288 |
function createInvalidArgFactory(arg, name) { |
| 4289 |
return (dispatch, options) => { |
| 4290 |
throw new Error(`Invalid value of type ${typeof arg} for ${name} argument when connecting component ${options.wrappedComponentName}.`); |
| 4291 |
}; |
| 4292 |
} |
| 4293 |
|
| 4294 |
//#endregion |
| 4295 |
//#region node_modules/react-redux/es/connect/mapDispatchToProps.js |
| 4296 |
function mapDispatchToPropsFactory(mapDispatchToProps) { |
| 4297 |
return mapDispatchToProps && typeof mapDispatchToProps === "object" ? wrapMapToPropsConstant((dispatch) => bindActionCreators(mapDispatchToProps, dispatch)) : !mapDispatchToProps ? wrapMapToPropsConstant((dispatch) => ({ dispatch })) : typeof mapDispatchToProps === "function" ? wrapMapToPropsFunc(mapDispatchToProps, "mapDispatchToProps") : createInvalidArgFactory(mapDispatchToProps, "mapDispatchToProps"); |
| 4298 |
} |
| 4299 |
|
| 4300 |
//#endregion |
| 4301 |
//#region node_modules/react-redux/es/connect/mapStateToProps.js |
| 4302 |
function mapStateToPropsFactory(mapStateToProps) { |
| 4303 |
return !mapStateToProps ? wrapMapToPropsConstant(() => ({})) : typeof mapStateToProps === "function" ? wrapMapToPropsFunc(mapStateToProps, "mapStateToProps") : createInvalidArgFactory(mapStateToProps, "mapStateToProps"); |
| 4304 |
} |
| 4305 |
|
| 4306 |
//#endregion |
| 4307 |
//#region node_modules/react-redux/es/connect/mergeProps.js |
| 4308 |
function defaultMergeProps(stateProps, dispatchProps, ownProps) { |
| 4309 |
return _extends({}, ownProps, stateProps, dispatchProps); |
| 4310 |
} |
| 4311 |
function wrapMergePropsFunc(mergeProps) { |
| 4312 |
return function initMergePropsProxy(dispatch, { displayName, areMergedPropsEqual }) { |
| 4313 |
let hasRunOnce = false; |
| 4314 |
let mergedProps; |
| 4315 |
return function mergePropsProxy(stateProps, dispatchProps, ownProps) { |
| 4316 |
const nextMergedProps = mergeProps(stateProps, dispatchProps, ownProps); |
| 4317 |
if (hasRunOnce) { |
| 4318 |
if (!areMergedPropsEqual(nextMergedProps, mergedProps)) mergedProps = nextMergedProps; |
| 4319 |
} else { |
| 4320 |
hasRunOnce = true; |
| 4321 |
mergedProps = nextMergedProps; |
| 4322 |
verifyPlainObject(mergedProps, displayName, "mergeProps"); |
| 4323 |
} |
| 4324 |
return mergedProps; |
| 4325 |
}; |
| 4326 |
}; |
| 4327 |
} |
| 4328 |
function mergePropsFactory(mergeProps) { |
| 4329 |
return !mergeProps ? () => defaultMergeProps : typeof mergeProps === "function" ? wrapMergePropsFunc(mergeProps) : createInvalidArgFactory(mergeProps, "mergeProps"); |
| 4330 |
} |
| 4331 |
|
| 4332 |
//#endregion |
| 4333 |
//#region node_modules/react-redux/es/utils/Subscription.js |
| 4334 |
function createListenerCollection() { |
| 4335 |
const batch = getBatch(); |
| 4336 |
let first = null; |
| 4337 |
let last = null; |
| 4338 |
return { |
| 4339 |
clear() { |
| 4340 |
first = null; |
| 4341 |
last = null; |
| 4342 |
}, |
| 4343 |
notify() { |
| 4344 |
batch(() => { |
| 4345 |
let listener = first; |
| 4346 |
while (listener) { |
| 4347 |
listener.callback(); |
| 4348 |
listener = listener.next; |
| 4349 |
} |
| 4350 |
}); |
| 4351 |
}, |
| 4352 |
get() { |
| 4353 |
let listeners = []; |
| 4354 |
let listener = first; |
| 4355 |
while (listener) { |
| 4356 |
listeners.push(listener); |
| 4357 |
listener = listener.next; |
| 4358 |
} |
| 4359 |
return listeners; |
| 4360 |
}, |
| 4361 |
subscribe(callback) { |
| 4362 |
let isSubscribed = true; |
| 4363 |
let listener = last = { |
| 4364 |
callback, |
| 4365 |
next: null, |
| 4366 |
prev: last |
| 4367 |
}; |
| 4368 |
if (listener.prev) listener.prev.next = listener; |
| 4369 |
else first = listener; |
| 4370 |
return function unsubscribe() { |
| 4371 |
if (!isSubscribed || first === null) return; |
| 4372 |
isSubscribed = false; |
| 4373 |
if (listener.next) listener.next.prev = listener.prev; |
| 4374 |
else last = listener.prev; |
| 4375 |
if (listener.prev) listener.prev.next = listener.next; |
| 4376 |
else first = listener.next; |
| 4377 |
}; |
| 4378 |
} |
| 4379 |
}; |
| 4380 |
} |
| 4381 |
var nullListeners = { |
| 4382 |
notify() {}, |
| 4383 |
get: () => [] |
| 4384 |
}; |
| 4385 |
function createSubscription(store, parentSub) { |
| 4386 |
let unsubscribe; |
| 4387 |
let listeners = nullListeners; |
| 4388 |
let subscriptionsAmount = 0; |
| 4389 |
let selfSubscribed = false; |
| 4390 |
function addNestedSub(listener) { |
| 4391 |
trySubscribe(); |
| 4392 |
const cleanupListener = listeners.subscribe(listener); |
| 4393 |
let removed = false; |
| 4394 |
return () => { |
| 4395 |
if (!removed) { |
| 4396 |
removed = true; |
| 4397 |
cleanupListener(); |
| 4398 |
tryUnsubscribe(); |
| 4399 |
} |
| 4400 |
}; |
| 4401 |
} |
| 4402 |
function notifyNestedSubs() { |
| 4403 |
listeners.notify(); |
| 4404 |
} |
| 4405 |
function handleChangeWrapper() { |
| 4406 |
if (subscription.onStateChange) subscription.onStateChange(); |
| 4407 |
} |
| 4408 |
function isSubscribed() { |
| 4409 |
return selfSubscribed; |
| 4410 |
} |
| 4411 |
function trySubscribe() { |
| 4412 |
subscriptionsAmount++; |
| 4413 |
if (!unsubscribe) { |
| 4414 |
unsubscribe = parentSub ? parentSub.addNestedSub(handleChangeWrapper) : store.subscribe(handleChangeWrapper); |
| 4415 |
listeners = createListenerCollection(); |
| 4416 |
} |
| 4417 |
} |
| 4418 |
function tryUnsubscribe() { |
| 4419 |
subscriptionsAmount--; |
| 4420 |
if (unsubscribe && subscriptionsAmount === 0) { |
| 4421 |
unsubscribe(); |
| 4422 |
unsubscribe = void 0; |
| 4423 |
listeners.clear(); |
| 4424 |
listeners = nullListeners; |
| 4425 |
} |
| 4426 |
} |
| 4427 |
function trySubscribeSelf() { |
| 4428 |
if (!selfSubscribed) { |
| 4429 |
selfSubscribed = true; |
| 4430 |
trySubscribe(); |
| 4431 |
} |
| 4432 |
} |
| 4433 |
function tryUnsubscribeSelf() { |
| 4434 |
if (selfSubscribed) { |
| 4435 |
selfSubscribed = false; |
| 4436 |
tryUnsubscribe(); |
| 4437 |
} |
| 4438 |
} |
| 4439 |
const subscription = { |
| 4440 |
addNestedSub, |
| 4441 |
notifyNestedSubs, |
| 4442 |
handleChangeWrapper, |
| 4443 |
isSubscribed, |
| 4444 |
trySubscribe: trySubscribeSelf, |
| 4445 |
tryUnsubscribe: tryUnsubscribeSelf, |
| 4446 |
getListeners: () => listeners |
| 4447 |
}; |
| 4448 |
return subscription; |
| 4449 |
} |
| 4450 |
|
| 4451 |
//#endregion |
| 4452 |
//#region node_modules/react-redux/es/utils/useIsomorphicLayoutEffect.js |
| 4453 |
var canUseDOM = !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined"); |
| 4454 |
var useIsomorphicLayoutEffect = canUseDOM ? react.useLayoutEffect : react.useEffect; |
| 4455 |
|
| 4456 |
//#endregion |
| 4457 |
//#region node_modules/react-redux/es/utils/shallowEqual.js |
| 4458 |
function is(x, y) { |
| 4459 |
if (x === y) return x !== 0 || y !== 0 || 1 / x === 1 / y; |
| 4460 |
else return x !== x && y !== y; |
| 4461 |
} |
| 4462 |
function shallowEqual(objA, objB) { |
| 4463 |
if (is(objA, objB)) return true; |
| 4464 |
if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) return false; |
| 4465 |
const keysA = Object.keys(objA); |
| 4466 |
const keysB = Object.keys(objB); |
| 4467 |
if (keysA.length !== keysB.length) return false; |
| 4468 |
for (let i = 0; i < keysA.length; i++) if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) return false; |
| 4469 |
return true; |
| 4470 |
} |
| 4471 |
|
| 4472 |
//#endregion |
| 4473 |
//#region node_modules/react-redux/es/components/connect.js |
| 4474 |
var _excluded = ["reactReduxForwardedRef"]; |
| 4475 |
var useSyncExternalStore$1 = notInitialized; |
| 4476 |
var initializeConnect = (fn) => { |
| 4477 |
useSyncExternalStore$1 = fn; |
| 4478 |
}; |
| 4479 |
var NO_SUBSCRIPTION_ARRAY = [null, null]; |
| 4480 |
var stringifyComponent = (Comp) => { |
| 4481 |
try { |
| 4482 |
return JSON.stringify(Comp); |
| 4483 |
} catch (err) { |
| 4484 |
return String(Comp); |
| 4485 |
} |
| 4486 |
}; |
| 4487 |
function useIsomorphicLayoutEffectWithArgs(effectFunc, effectArgs, dependencies) { |
| 4488 |
useIsomorphicLayoutEffect(() => effectFunc(...effectArgs), dependencies); |
| 4489 |
} |
| 4490 |
function captureWrapperProps(lastWrapperProps, lastChildProps, renderIsScheduled, wrapperProps, childPropsFromStoreUpdate, notifyNestedSubs) { |
| 4491 |
lastWrapperProps.current = wrapperProps; |
| 4492 |
renderIsScheduled.current = false; |
| 4493 |
if (childPropsFromStoreUpdate.current) { |
| 4494 |
childPropsFromStoreUpdate.current = null; |
| 4495 |
notifyNestedSubs(); |
| 4496 |
} |
| 4497 |
} |
| 4498 |
function subscribeUpdates(shouldHandleStateChanges, store, subscription, childPropsSelector, lastWrapperProps, lastChildProps, renderIsScheduled, isMounted, childPropsFromStoreUpdate, notifyNestedSubs, additionalSubscribeListener) { |
| 4499 |
if (!shouldHandleStateChanges) return () => {}; |
| 4500 |
let didUnsubscribe = false; |
| 4501 |
let lastThrownError = null; |
| 4502 |
const checkForUpdates = () => { |
| 4503 |
if (didUnsubscribe || !isMounted.current) return; |
| 4504 |
const latestStoreState = store.getState(); |
| 4505 |
let newChildProps; |
| 4506 |
let error; |
| 4507 |
try { |
| 4508 |
newChildProps = childPropsSelector(latestStoreState, lastWrapperProps.current); |
| 4509 |
} catch (e) { |
| 4510 |
error = e; |
| 4511 |
lastThrownError = e; |
| 4512 |
} |
| 4513 |
if (!error) lastThrownError = null; |
| 4514 |
if (newChildProps === lastChildProps.current) { |
| 4515 |
if (!renderIsScheduled.current) notifyNestedSubs(); |
| 4516 |
} else { |
| 4517 |
lastChildProps.current = newChildProps; |
| 4518 |
childPropsFromStoreUpdate.current = newChildProps; |
| 4519 |
renderIsScheduled.current = true; |
| 4520 |
additionalSubscribeListener(); |
| 4521 |
} |
| 4522 |
}; |
| 4523 |
subscription.onStateChange = checkForUpdates; |
| 4524 |
subscription.trySubscribe(); |
| 4525 |
checkForUpdates(); |
| 4526 |
const unsubscribeWrapper = () => { |
| 4527 |
didUnsubscribe = true; |
| 4528 |
subscription.tryUnsubscribe(); |
| 4529 |
subscription.onStateChange = null; |
| 4530 |
if (lastThrownError) throw lastThrownError; |
| 4531 |
}; |
| 4532 |
return unsubscribeWrapper; |
| 4533 |
} |
| 4534 |
function strictEqual(a, b) { |
| 4535 |
return a === b; |
| 4536 |
} |
| 4537 |
/** |
| 4538 |
* Infers the type of props that a connector will inject into a component. |
| 4539 |
*/ |
| 4540 |
var hasWarnedAboutDeprecatedPureOption = false; |
| 4541 |
/** |
| 4542 |
* Connects a React component to a Redux store. |
| 4543 |
* |
| 4544 |
* - Without arguments, just wraps the component, without changing the behavior / props |
| 4545 |
* |
| 4546 |
* - If 2 params are passed (3rd param, mergeProps, is skipped), default behavior |
| 4547 |
* is to override ownProps (as stated in the docs), so what remains is everything that's |
| 4548 |
* not a state or dispatch prop |
| 4549 |
* |
| 4550 |
* - When 3rd param is passed, we don't know if ownProps propagate and whether they |
| 4551 |
* should be valid component props, because it depends on mergeProps implementation. |
| 4552 |
* As such, it is the user's responsibility to extend ownProps interface from state or |
| 4553 |
* dispatch props or both when applicable |
| 4554 |
* |
| 4555 |
* @param mapStateToProps A function that extracts values from state |
| 4556 |
* @param mapDispatchToProps Setup for dispatching actions |
| 4557 |
* @param mergeProps Optional callback to merge state and dispatch props together |
| 4558 |
* @param options Options for configuring the connection |
| 4559 |
* |
| 4560 |
*/ |
| 4561 |
function connect(mapStateToProps, mapDispatchToProps, mergeProps, { pure, areStatesEqual = strictEqual, areOwnPropsEqual = shallowEqual, areStatePropsEqual = shallowEqual, areMergedPropsEqual = shallowEqual, forwardRef = false, context = ReactReduxContext } = {}) { |
| 4562 |
if (pure !== void 0 && !hasWarnedAboutDeprecatedPureOption) { |
| 4563 |
hasWarnedAboutDeprecatedPureOption = true; |
| 4564 |
warning("The `pure` option has been removed. `connect` is now always a \"pure/memoized\" component"); |
| 4565 |
} |
| 4566 |
const Context = context; |
| 4567 |
const initMapStateToProps = mapStateToPropsFactory(mapStateToProps); |
| 4568 |
const initMapDispatchToProps = mapDispatchToPropsFactory(mapDispatchToProps); |
| 4569 |
const initMergeProps = mergePropsFactory(mergeProps); |
| 4570 |
const shouldHandleStateChanges = Boolean(mapStateToProps); |
| 4571 |
const wrapWithConnect = (WrappedComponent) => { |
| 4572 |
if (!(0, import_react_is.isValidElementType)(WrappedComponent)) throw new Error(`You must pass a component to the function returned by connect. Instead received ${stringifyComponent(WrappedComponent)}`); |
| 4573 |
const wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || "Component"; |
| 4574 |
const displayName = `Connect(${wrappedComponentName})`; |
| 4575 |
const selectorFactoryOptions = { |
| 4576 |
shouldHandleStateChanges, |
| 4577 |
displayName, |
| 4578 |
wrappedComponentName, |
| 4579 |
WrappedComponent, |
| 4580 |
initMapStateToProps, |
| 4581 |
initMapDispatchToProps, |
| 4582 |
initMergeProps, |
| 4583 |
areStatesEqual, |
| 4584 |
areStatePropsEqual, |
| 4585 |
areOwnPropsEqual, |
| 4586 |
areMergedPropsEqual |
| 4587 |
}; |
| 4588 |
function ConnectFunction(props) { |
| 4589 |
const [propsContext, reactReduxForwardedRef, wrapperProps] = react.useMemo(() => { |
| 4590 |
const { reactReduxForwardedRef } = props, wrapperProps = _objectWithoutPropertiesLoose(props, _excluded); |
| 4591 |
return [ |
| 4592 |
props.context, |
| 4593 |
reactReduxForwardedRef, |
| 4594 |
wrapperProps |
| 4595 |
]; |
| 4596 |
}, [props]); |
| 4597 |
const ContextToUse = react.useMemo(() => { |
| 4598 |
return propsContext && propsContext.Consumer && (0, import_react_is.isContextConsumer)(/*#__PURE__*/ react.createElement(propsContext.Consumer, null)) ? propsContext : Context; |
| 4599 |
}, [propsContext, Context]); |
| 4600 |
const contextValue = react.useContext(ContextToUse); |
| 4601 |
const didStoreComeFromProps = Boolean(props.store) && Boolean(props.store.getState) && Boolean(props.store.dispatch); |
| 4602 |
const didStoreComeFromContext = Boolean(contextValue) && Boolean(contextValue.store); |
| 4603 |
if (!didStoreComeFromProps && !didStoreComeFromContext) throw new Error(`Could not find "store" in the context of "${displayName}". Either wrap the root component in a <Provider>, or pass a custom React context provider to <Provider> and the corresponding React context consumer to ${displayName} in connect options.`); |
| 4604 |
const store = didStoreComeFromProps ? props.store : contextValue.store; |
| 4605 |
const getServerState = didStoreComeFromContext ? contextValue.getServerState : store.getState; |
| 4606 |
const childPropsSelector = react.useMemo(() => { |
| 4607 |
return finalPropsSelectorFactory(store.dispatch, selectorFactoryOptions); |
| 4608 |
}, [store]); |
| 4609 |
const [subscription, notifyNestedSubs] = react.useMemo(() => { |
| 4610 |
if (!shouldHandleStateChanges) return NO_SUBSCRIPTION_ARRAY; |
| 4611 |
const subscription = createSubscription(store, didStoreComeFromProps ? void 0 : contextValue.subscription); |
| 4612 |
return [subscription, subscription.notifyNestedSubs.bind(subscription)]; |
| 4613 |
}, [ |
| 4614 |
store, |
| 4615 |
didStoreComeFromProps, |
| 4616 |
contextValue |
| 4617 |
]); |
| 4618 |
const overriddenContextValue = react.useMemo(() => { |
| 4619 |
if (didStoreComeFromProps) return contextValue; |
| 4620 |
return _extends({}, contextValue, { subscription }); |
| 4621 |
}, [ |
| 4622 |
didStoreComeFromProps, |
| 4623 |
contextValue, |
| 4624 |
subscription |
| 4625 |
]); |
| 4626 |
const lastChildProps = react.useRef(); |
| 4627 |
const lastWrapperProps = react.useRef(wrapperProps); |
| 4628 |
const childPropsFromStoreUpdate = react.useRef(); |
| 4629 |
const renderIsScheduled = react.useRef(false); |
| 4630 |
react.useRef(false); |
| 4631 |
const isMounted = react.useRef(false); |
| 4632 |
const latestSubscriptionCallbackError = react.useRef(); |
| 4633 |
useIsomorphicLayoutEffect(() => { |
| 4634 |
isMounted.current = true; |
| 4635 |
return () => { |
| 4636 |
isMounted.current = false; |
| 4637 |
}; |
| 4638 |
}, []); |
| 4639 |
const actualChildPropsSelector = react.useMemo(() => { |
| 4640 |
const selector = () => { |
| 4641 |
if (childPropsFromStoreUpdate.current && wrapperProps === lastWrapperProps.current) return childPropsFromStoreUpdate.current; |
| 4642 |
return childPropsSelector(store.getState(), wrapperProps); |
| 4643 |
}; |
| 4644 |
return selector; |
| 4645 |
}, [store, wrapperProps]); |
| 4646 |
const subscribeForReact = react.useMemo(() => { |
| 4647 |
const subscribe = (reactListener) => { |
| 4648 |
if (!subscription) return () => {}; |
| 4649 |
return subscribeUpdates(shouldHandleStateChanges, store, subscription, childPropsSelector, lastWrapperProps, lastChildProps, renderIsScheduled, isMounted, childPropsFromStoreUpdate, notifyNestedSubs, reactListener); |
| 4650 |
}; |
| 4651 |
return subscribe; |
| 4652 |
}, [subscription]); |
| 4653 |
useIsomorphicLayoutEffectWithArgs(captureWrapperProps, [ |
| 4654 |
lastWrapperProps, |
| 4655 |
lastChildProps, |
| 4656 |
renderIsScheduled, |
| 4657 |
wrapperProps, |
| 4658 |
childPropsFromStoreUpdate, |
| 4659 |
notifyNestedSubs |
| 4660 |
]); |
| 4661 |
let actualChildProps; |
| 4662 |
try { |
| 4663 |
actualChildProps = useSyncExternalStore$1(subscribeForReact, actualChildPropsSelector, getServerState ? () => childPropsSelector(getServerState(), wrapperProps) : actualChildPropsSelector); |
| 4664 |
} catch (err) { |
| 4665 |
if (latestSubscriptionCallbackError.current) err.message += `\nThe error may be correlated with this previous error:\n${latestSubscriptionCallbackError.current.stack}\n\n`; |
| 4666 |
throw err; |
| 4667 |
} |
| 4668 |
useIsomorphicLayoutEffect(() => { |
| 4669 |
latestSubscriptionCallbackError.current = void 0; |
| 4670 |
childPropsFromStoreUpdate.current = void 0; |
| 4671 |
lastChildProps.current = actualChildProps; |
| 4672 |
}); |
| 4673 |
const renderedWrappedComponent = react.useMemo(() => { |
| 4674 |
return /*#__PURE__*/ react.createElement(WrappedComponent, _extends({}, actualChildProps, { ref: reactReduxForwardedRef })); |
| 4675 |
}, [ |
| 4676 |
reactReduxForwardedRef, |
| 4677 |
WrappedComponent, |
| 4678 |
actualChildProps |
| 4679 |
]); |
| 4680 |
return react.useMemo(() => { |
| 4681 |
if (shouldHandleStateChanges) return /*#__PURE__*/ react.createElement(ContextToUse.Provider, { value: overriddenContextValue }, renderedWrappedComponent); |
| 4682 |
return renderedWrappedComponent; |
| 4683 |
}, [ |
| 4684 |
ContextToUse, |
| 4685 |
renderedWrappedComponent, |
| 4686 |
overriddenContextValue |
| 4687 |
]); |
| 4688 |
} |
| 4689 |
const Connect = react.memo(ConnectFunction); |
| 4690 |
Connect.WrappedComponent = WrappedComponent; |
| 4691 |
Connect.displayName = ConnectFunction.displayName = displayName; |
| 4692 |
if (forwardRef) { |
| 4693 |
const forwarded = react.forwardRef(function forwardConnectRef(props, ref) { |
| 4694 |
return /*#__PURE__*/ react.createElement(Connect, _extends({}, props, { reactReduxForwardedRef: ref })); |
| 4695 |
}); |
| 4696 |
forwarded.displayName = displayName; |
| 4697 |
forwarded.WrappedComponent = WrappedComponent; |
| 4698 |
return (0, import_hoist_non_react_statics_cjs.default)(forwarded, WrappedComponent); |
| 4699 |
} |
| 4700 |
return (0, import_hoist_non_react_statics_cjs.default)(Connect, WrappedComponent); |
| 4701 |
}; |
| 4702 |
return wrapWithConnect; |
| 4703 |
} |
| 4704 |
|
| 4705 |
//#endregion |
| 4706 |
//#region node_modules/react-redux/es/components/Provider.js |
| 4707 |
function Provider({ store, context, children, serverState, stabilityCheck = "once", noopCheck = "once" }) { |
| 4708 |
const contextValue = react.useMemo(() => { |
| 4709 |
return { |
| 4710 |
store, |
| 4711 |
subscription: createSubscription(store), |
| 4712 |
getServerState: serverState ? () => serverState : void 0, |
| 4713 |
stabilityCheck, |
| 4714 |
noopCheck |
| 4715 |
}; |
| 4716 |
}, [ |
| 4717 |
store, |
| 4718 |
serverState, |
| 4719 |
stabilityCheck, |
| 4720 |
noopCheck |
| 4721 |
]); |
| 4722 |
const previousState = react.useMemo(() => store.getState(), [store]); |
| 4723 |
useIsomorphicLayoutEffect(() => { |
| 4724 |
const { subscription } = contextValue; |
| 4725 |
subscription.onStateChange = subscription.notifyNestedSubs; |
| 4726 |
subscription.trySubscribe(); |
| 4727 |
if (previousState !== store.getState()) subscription.notifyNestedSubs(); |
| 4728 |
return () => { |
| 4729 |
subscription.tryUnsubscribe(); |
| 4730 |
subscription.onStateChange = void 0; |
| 4731 |
}; |
| 4732 |
}, [contextValue, previousState]); |
| 4733 |
const Context = context || ReactReduxContext; |
| 4734 |
return /*#__PURE__*/ react.createElement(Context.Provider, { value: contextValue }, children); |
| 4735 |
} |
| 4736 |
|
| 4737 |
//#endregion |
| 4738 |
//#region node_modules/react-redux/es/hooks/useStore.js |
| 4739 |
/** |
| 4740 |
* Hook factory, which creates a `useStore` hook bound to a given context. |
| 4741 |
* |
| 4742 |
* @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`. |
| 4743 |
* @returns {Function} A `useStore` hook bound to the specified context. |
| 4744 |
*/ |
| 4745 |
function createStoreHook(context = ReactReduxContext) { |
| 4746 |
const useReduxContext$1 = context === ReactReduxContext ? useReduxContext : createReduxContextHook(context); |
| 4747 |
return function useStore() { |
| 4748 |
const { store } = useReduxContext$1(); |
| 4749 |
return store; |
| 4750 |
}; |
| 4751 |
} |
| 4752 |
/** |
| 4753 |
* A hook to access the redux store. |
| 4754 |
* |
| 4755 |
* @returns {any} the redux store |
| 4756 |
* |
| 4757 |
* @example |
| 4758 |
* |
| 4759 |
* import React from 'react' |
| 4760 |
* import { useStore } from 'react-redux' |
| 4761 |
* |
| 4762 |
* export const ExampleComponent = () => { |
| 4763 |
* const store = useStore() |
| 4764 |
* return <div>{store.getState()}</div> |
| 4765 |
* } |
| 4766 |
*/ |
| 4767 |
var useStore = /*#__PURE__*/ createStoreHook(); |
| 4768 |
|
| 4769 |
//#endregion |
| 4770 |
//#region node_modules/react-redux/es/hooks/useDispatch.js |
| 4771 |
/** |
| 4772 |
* Hook factory, which creates a `useDispatch` hook bound to a given context. |
| 4773 |
* |
| 4774 |
* @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`. |
| 4775 |
* @returns {Function} A `useDispatch` hook bound to the specified context. |
| 4776 |
*/ |
| 4777 |
function createDispatchHook(context = ReactReduxContext) { |
| 4778 |
const useStore$1 = context === ReactReduxContext ? useStore : createStoreHook(context); |
| 4779 |
return function useDispatch() { |
| 4780 |
return useStore$1().dispatch; |
| 4781 |
}; |
| 4782 |
} |
| 4783 |
/** |
| 4784 |
* A hook to access the redux `dispatch` function. |
| 4785 |
* |
| 4786 |
* @returns {any|function} redux store's `dispatch` function |
| 4787 |
* |
| 4788 |
* @example |
| 4789 |
* |
| 4790 |
* import React, { useCallback } from 'react' |
| 4791 |
* import { useDispatch } from 'react-redux' |
| 4792 |
* |
| 4793 |
* export const CounterComponent = ({ value }) => { |
| 4794 |
* const dispatch = useDispatch() |
| 4795 |
* const increaseCounter = useCallback(() => dispatch({ type: 'increase-counter' }), []) |
| 4796 |
* return ( |
| 4797 |
* <div> |
| 4798 |
* <span>{value}</span> |
| 4799 |
* <button onClick={increaseCounter}>Increase counter</button> |
| 4800 |
* </div> |
| 4801 |
* ) |
| 4802 |
* } |
| 4803 |
*/ |
| 4804 |
var useDispatch = /*#__PURE__*/ createDispatchHook(); |
| 4805 |
|
| 4806 |
//#endregion |
| 4807 |
//#region node_modules/react-redux/es/index.js |
| 4808 |
var es_exports = /* @__PURE__ */ __exportAll({ |
| 4809 |
Provider: () => Provider, |
| 4810 |
ReactReduxContext: () => ReactReduxContext, |
| 4811 |
batch: () => react_dom.unstable_batchedUpdates, |
| 4812 |
connect: () => connect, |
| 4813 |
createDispatchHook: () => createDispatchHook, |
| 4814 |
createSelectorHook: () => createSelectorHook, |
| 4815 |
createStoreHook: () => createStoreHook, |
| 4816 |
shallowEqual: () => shallowEqual, |
| 4817 |
useDispatch: () => useDispatch, |
| 4818 |
useSelector: () => useSelector, |
| 4819 |
useStore: () => useStore |
| 4820 |
}); |
| 4821 |
initializeUseSelector(import_with_selector.useSyncExternalStoreWithSelector); |
| 4822 |
initializeConnect(import_shim.useSyncExternalStore); |
| 4823 |
setBatch(react_dom.unstable_batchedUpdates); |
| 4824 |
|
| 4825 |
//#endregion |
| 4826 |
//#region core/common/assets/js/vendors-redux.js |
| 4827 |
window.elementorVendors = window.elementorVendors || {}; |
| 4828 |
window.elementorVendors.reduxToolkit = redux_toolkit_esm_exports; |
| 4829 |
window.elementorVendors.reactRedux = es_exports; |
| 4830 |
|
| 4831 |
//#endregion |
| 4832 |
})(React, ReactDOM); |
| 4833 |
//# sourceMappingURL=vendors-redux.js.map |