@nosto/nosto-react 1.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,193 +1,53 @@
1
- import B, { createContext as Rt, useContext as ht, useEffect as te, useRef as pe, useMemo as Et, isValidElement as Ct, useState as bt } from "react";
2
- import { createRoot as _t } from "react-dom/client";
3
- const qe = Rt({
4
- account: "",
5
- currentVariation: "",
6
- pageType: "",
7
- responseMode: "HTML",
8
- clientScriptLoaded: !1,
9
- useRenderCampaigns: () => ({
10
- renderCampaigns: () => {
11
- },
12
- pageTypeUpdated: !1
13
- })
14
- });
15
- function x() {
16
- const n = ht(qe);
17
- if (!n)
18
- throw new Error("No nosto context found");
19
- return n;
20
- }
21
- const We = (n) => String(n) === "[object Object]";
22
- function Ve(n) {
23
- if (!We(n))
1
+ import Ne, { useEffect as ie, useRef as ne, useMemo as hr, createContext as Er, useContext as Rr, cloneElement as wr, useState as br, isValidElement as _r } from "react";
2
+ import { createRoot as Cr } from "react-dom/client";
3
+ const Ae = (t) => String(t) === "[object Object]";
4
+ function De(t) {
5
+ if (!Ae(t))
24
6
  return !1;
25
- const o = n.constructor;
26
- if (o === void 0)
7
+ const n = t.constructor;
8
+ if (n === void 0)
27
9
  return !0;
28
- const a = o.prototype;
29
- return !(!We(a) || !a.hasOwnProperty("isPrototypeOf"));
10
+ const a = n.prototype;
11
+ return !(!Ae(a) || !a.hasOwnProperty("isPrototypeOf"));
30
12
  }
31
- function me(n, o) {
32
- if (n === o)
13
+ function oe(t, n) {
14
+ if (t === n)
33
15
  return !0;
34
- if (n instanceof Date && o instanceof Date)
35
- return n.getTime() === o.getTime();
36
- if (n instanceof Array && o instanceof Array)
37
- return n.length !== o.length ? !1 : n.every((a, u) => me(a, o[u]));
38
- if (Ve(n) && Ve(o)) {
39
- const a = Object.entries(n);
40
- return a.length !== Object.keys(o).length ? !1 : a.every(([u, d]) => me(d, o[u]));
16
+ if (t instanceof Date && n instanceof Date)
17
+ return t.getTime() === n.getTime();
18
+ if (t instanceof Array && n instanceof Array)
19
+ return t.length !== n.length ? !1 : t.every((a, c) => oe(a, n[c]));
20
+ if (De(t) && De(n)) {
21
+ const a = Object.entries(t);
22
+ return a.length !== Object.keys(n).length ? !1 : a.every(([c, i]) => oe(i, n[c]));
41
23
  }
42
24
  return !1;
43
25
  }
44
- function Be(n, o) {
45
- return te(n, wt(o));
26
+ function Ie(t, n) {
27
+ return ie(t, Pr(n));
46
28
  }
47
- function wt(n) {
48
- const o = pe(n), a = pe(0);
49
- return me(n, o.current) || (o.current = n, a.current += 1), Et(() => o.current, [a.current]);
29
+ function Pr(t) {
30
+ const n = ne(t), a = ne(0);
31
+ return oe(t, n.current) || (n.current = t, a.current += 1), hr(() => n.current, [a.current]);
50
32
  }
51
- function N(n, o, a) {
52
- const { clientScriptLoaded: u, currentVariation: d, responseMode: c } = x();
53
- (a != null && a.deep ? Be : te)(() => {
54
- u && window.nostojs((m) => {
55
- m.defaultSession().setVariation(d).setResponseMode(c), n(m);
56
- });
57
- }, [u, d, c, ...o ?? []]);
58
- }
59
- function kt(n) {
60
- const {
61
- recommendationComponent: o,
62
- useRenderCampaigns: a
63
- } = x(), {
64
- renderCampaigns: u,
65
- pageTypeUpdated: d
66
- } = a("404");
67
- return N(async (c) => {
68
- const i = await c.defaultSession().viewNotFound().setPlacements(n.placements || c.placements.getPlacements()).load();
69
- u(i, c);
70
- }, [o, d]), null;
71
- }
72
- function Dt(n) {
73
- const {
74
- recommendationComponent: o,
75
- useRenderCampaigns: a
76
- } = x(), {
77
- renderCampaigns: u,
78
- pageTypeUpdated: d
79
- } = a("other");
80
- return N(async (c) => {
81
- const i = await c.defaultSession().viewOther().setPlacements(n.placements || c.placements.getPlacements()).load();
82
- u(i, c);
83
- }, [o, d]), null;
84
- }
85
- function Ft(n) {
86
- const {
87
- recommendationComponent: o,
88
- useRenderCampaigns: a
89
- } = x(), {
90
- renderCampaigns: u,
91
- pageTypeUpdated: d
92
- } = a("checkout");
93
- return N(async (c) => {
94
- const i = await c.defaultSession().viewCart().setPlacements(n.placements || c.placements.getPlacements()).load();
95
- u(i, c);
96
- }, [o, d]), null;
97
- }
98
- function Nt(n) {
99
- const {
100
- product: o,
101
- tagging: a,
102
- placements: u
103
- } = n, {
104
- recommendationComponent: d,
105
- useRenderCampaigns: c
106
- } = x(), {
107
- renderCampaigns: i,
108
- pageTypeUpdated: m
109
- } = c("product");
110
- return N(async (v) => {
111
- const O = await v.defaultSession().viewProduct(a ?? o).setPlacements(u || v.placements.getPlacements()).load();
112
- i(O, v);
113
- }, [o, d, m], {
114
- deep: !0
115
- }), null;
116
- }
117
- function Lt(n) {
118
- const {
119
- category: o,
120
- placements: a
121
- } = n, {
122
- recommendationComponent: u,
123
- useRenderCampaigns: d
124
- } = x(), {
125
- renderCampaigns: c,
126
- pageTypeUpdated: i
127
- } = d("home");
128
- return N(async (m) => {
129
- const v = await m.defaultSession().viewCategory(o).setPlacements(a || m.placements.getPlacements()).load();
130
- c(v, m);
131
- }, [o, u, i]), null;
132
- }
133
- function It(n) {
134
- const {
135
- query: o,
136
- placements: a
137
- } = n, {
138
- recommendationComponent: u,
139
- useRenderCampaigns: d
140
- } = x(), {
141
- renderCampaigns: c,
142
- pageTypeUpdated: i
143
- } = d("search");
144
- return N(async (m) => {
145
- const v = await m.defaultSession().viewSearch(o).setPlacements(a || m.placements.getPlacements()).load();
146
- c(v, m);
147
- }, [o, u, i]), null;
148
- }
149
- function H(n) {
150
- return !n || typeof n != "object" || Tt(n) || St(n) ? n : Array.isArray(n) ? n.map(H) : Object.keys(n).reduce((o, a) => {
151
- const u = a[0].toLowerCase() + a.slice(1).replace(/([A-Z]+)/g, (d, c) => "_" + c.toLowerCase());
152
- return o[u] = H(n[a]), o;
153
- }, {});
154
- }
155
- function Tt(n) {
156
- return Object.prototype.toString.call(n) === "[object Date]";
157
- }
158
- function St(n) {
159
- return Object.prototype.toString.call(n) === "[object RegExp]";
160
- }
161
- function $t(n) {
162
- const {
163
- order: o,
164
- placements: a
165
- } = n, {
166
- recommendationComponent: u,
167
- useRenderCampaigns: d
168
- } = x(), {
169
- renderCampaigns: c,
170
- pageTypeUpdated: i
171
- } = d("order");
172
- return N(async (m) => {
173
- const v = await m.defaultSession().addOrder(H(o)).setPlacements(a || m.placements.getPlacements()).load();
174
- c(v, m);
175
- }, [u, i]), null;
33
+ const $e = Er({
34
+ account: "",
35
+ currentVariation: "",
36
+ responseMode: "HTML",
37
+ clientScriptLoaded: !1
38
+ });
39
+ function se() {
40
+ return Rr($e);
176
41
  }
177
- function Ut(n) {
178
- const {
179
- recommendationComponent: o,
180
- useRenderCampaigns: a
181
- } = x(), {
182
- renderCampaigns: u,
183
- pageTypeUpdated: d
184
- } = a("home");
185
- return N(async (c) => {
186
- const i = await c.defaultSession().viewFrontPage().setPlacements(n.placements || c.placements.getPlacements()).load();
187
- u(i, c);
188
- }, [o, d]), null;
42
+ function x(t, n, a) {
43
+ const { clientScriptLoaded: c, currentVariation: i, responseMode: m } = se();
44
+ (a != null && a.deep ? Ie : ie)(() => {
45
+ c && window.nostojs((v) => {
46
+ v.defaultSession().setVariation(i).setResponseMode(m), t(v);
47
+ });
48
+ }, [c, i, m, ...n ?? []]);
189
49
  }
190
- var ve = { exports: {} }, M = {};
50
+ var ae = { exports: {} }, $ = {};
191
51
  /**
192
52
  * @license React
193
53
  * react-jsx-runtime.production.min.js
@@ -197,25 +57,25 @@ var ve = { exports: {} }, M = {};
197
57
  * This source code is licensed under the MIT license found in the
198
58
  * LICENSE file in the root directory of this source tree.
199
59
  */
200
- var Ye;
201
- function Pt() {
202
- if (Ye)
203
- return M;
204
- Ye = 1;
205
- var n = B, o = Symbol.for("react.element"), a = Symbol.for("react.fragment"), u = Object.prototype.hasOwnProperty, d = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, c = { key: !0, ref: !0, __self: !0, __source: !0 };
206
- function i(m, v, O) {
207
- var C, w = {}, A = null, F = null;
208
- O !== void 0 && (A = "" + O), v.key !== void 0 && (A = "" + v.key), v.ref !== void 0 && (F = v.ref);
209
- for (C in v)
210
- u.call(v, C) && !c.hasOwnProperty(C) && (w[C] = v[C]);
211
- if (m && m.defaultProps)
212
- for (C in v = m.defaultProps, v)
213
- w[C] === void 0 && (w[C] = v[C]);
214
- return { $$typeof: o, type: m, key: A, ref: F, props: w, _owner: d.current };
60
+ var Fe;
61
+ function Sr() {
62
+ if (Fe)
63
+ return $;
64
+ Fe = 1;
65
+ var t = Ne, n = Symbol.for("react.element"), a = Symbol.for("react.fragment"), c = Object.prototype.hasOwnProperty, i = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, m = { key: !0, ref: !0, __self: !0, __source: !0 };
66
+ function h(v, g, P) {
67
+ var R, f = {}, _ = null, O = null;
68
+ P !== void 0 && (_ = "" + P), g.key !== void 0 && (_ = "" + g.key), g.ref !== void 0 && (O = g.ref);
69
+ for (R in g)
70
+ c.call(g, R) && !m.hasOwnProperty(R) && (f[R] = g[R]);
71
+ if (v && v.defaultProps)
72
+ for (R in g = v.defaultProps, g)
73
+ f[R] === void 0 && (f[R] = g[R]);
74
+ return { $$typeof: n, type: v, key: _, ref: O, props: f, _owner: i.current };
215
75
  }
216
- return M.Fragment = a, M.jsx = i, M.jsxs = i, M;
76
+ return $.Fragment = a, $.jsx = h, $.jsxs = h, $;
217
77
  }
218
- var q = {};
78
+ var W = {};
219
79
  /**
220
80
  * @license React
221
81
  * react-jsx-runtime.development.js
@@ -225,91 +85,91 @@ var q = {};
225
85
  * This source code is licensed under the MIT license found in the
226
86
  * LICENSE file in the root directory of this source tree.
227
87
  */
228
- var Me;
229
- function Ot() {
230
- return Me || (Me = 1, process.env.NODE_ENV !== "production" && function() {
231
- var n = B, o = Symbol.for("react.element"), a = Symbol.for("react.portal"), u = Symbol.for("react.fragment"), d = Symbol.for("react.strict_mode"), c = Symbol.for("react.profiler"), i = Symbol.for("react.provider"), m = Symbol.for("react.context"), v = Symbol.for("react.forward_ref"), O = Symbol.for("react.suspense"), C = Symbol.for("react.suspense_list"), w = Symbol.for("react.memo"), A = Symbol.for("react.lazy"), F = Symbol.for("react.offscreen"), J = Symbol.iterator, ne = "@@iterator";
232
- function j(e) {
88
+ var Le;
89
+ function Or() {
90
+ return Le || (Le = 1, process.env.NODE_ENV !== "production" && function() {
91
+ var t = Ne, n = Symbol.for("react.element"), a = Symbol.for("react.portal"), c = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), m = Symbol.for("react.profiler"), h = Symbol.for("react.provider"), v = Symbol.for("react.context"), g = Symbol.for("react.forward_ref"), P = Symbol.for("react.suspense"), R = Symbol.for("react.suspense_list"), f = Symbol.for("react.memo"), _ = Symbol.for("react.lazy"), O = Symbol.for("react.offscreen"), D = Symbol.iterator, Y = "@@iterator";
92
+ function U(e) {
233
93
  if (e === null || typeof e != "object")
234
94
  return null;
235
- var t = J && e[J] || e[ne];
236
- return typeof t == "function" ? t : null;
95
+ var r = D && e[D] || e[Y];
96
+ return typeof r == "function" ? r : null;
237
97
  }
238
- var _ = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
239
- function h(e) {
98
+ var S = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
99
+ function w(e) {
240
100
  {
241
- for (var t = arguments.length, r = new Array(t > 1 ? t - 1 : 0), s = 1; s < t; s++)
242
- r[s - 1] = arguments[s];
243
- y("error", e, r);
101
+ for (var r = arguments.length, o = new Array(r > 1 ? r - 1 : 0), s = 1; s < r; s++)
102
+ o[s - 1] = arguments[s];
103
+ We("error", e, o);
244
104
  }
245
105
  }
246
- function y(e, t, r) {
106
+ function We(e, r, o) {
247
107
  {
248
- var s = _.ReactDebugCurrentFrame, p = s.getStackAddendum();
249
- p !== "" && (t += "%s", r = r.concat([p]));
250
- var g = r.map(function(f) {
251
- return String(f);
108
+ var s = S.ReactDebugCurrentFrame, d = s.getStackAddendum();
109
+ d !== "" && (r += "%s", o = o.concat([d]));
110
+ var p = o.map(function(l) {
111
+ return String(l);
252
112
  });
253
- g.unshift("Warning: " + t), Function.prototype.apply.call(console[e], console, g);
113
+ p.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, p);
254
114
  }
255
115
  }
256
- var T = !1, S = !1, L = !1, I = !1, oe = !1, z;
257
- z = Symbol.for("react.module.reference");
258
- function G(e) {
259
- return !!(typeof e == "string" || typeof e == "function" || e === u || e === c || oe || e === d || e === O || e === C || I || e === F || T || S || L || typeof e == "object" && e !== null && (e.$$typeof === A || e.$$typeof === w || e.$$typeof === i || e.$$typeof === m || e.$$typeof === v || // This needs to include all possible module reference object
116
+ var Me = !1, Ve = !1, Ye = !1, Ue = !1, qe = !1, ce;
117
+ ce = Symbol.for("react.module.reference");
118
+ function Be(e) {
119
+ return !!(typeof e == "string" || typeof e == "function" || e === c || e === m || qe || e === i || e === P || e === R || Ue || e === O || Me || Ve || Ye || typeof e == "object" && e !== null && (e.$$typeof === _ || e.$$typeof === f || e.$$typeof === h || e.$$typeof === v || e.$$typeof === g || // This needs to include all possible module reference object
260
120
  // types supported by any Flight configuration anywhere since
261
121
  // we don't know which Flight build this will end up being used
262
122
  // with.
263
- e.$$typeof === z || e.getModuleId !== void 0));
123
+ e.$$typeof === ce || e.getModuleId !== void 0));
264
124
  }
265
- function ge(e, t, r) {
125
+ function ze(e, r, o) {
266
126
  var s = e.displayName;
267
127
  if (s)
268
128
  return s;
269
- var p = t.displayName || t.name || "";
270
- return p !== "" ? r + "(" + p + ")" : r;
129
+ var d = r.displayName || r.name || "";
130
+ return d !== "" ? o + "(" + d + ")" : o;
271
131
  }
272
- function ye(e) {
132
+ function ue(e) {
273
133
  return e.displayName || "Context";
274
134
  }
275
- function k(e) {
135
+ function T(e) {
276
136
  if (e == null)
277
137
  return null;
278
- if (typeof e.tag == "number" && h("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
138
+ if (typeof e.tag == "number" && w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
279
139
  return e.displayName || e.name || null;
280
140
  if (typeof e == "string")
281
141
  return e;
282
142
  switch (e) {
283
- case u:
143
+ case c:
284
144
  return "Fragment";
285
145
  case a:
286
146
  return "Portal";
287
- case c:
147
+ case m:
288
148
  return "Profiler";
289
- case d:
149
+ case i:
290
150
  return "StrictMode";
291
- case O:
151
+ case P:
292
152
  return "Suspense";
293
- case C:
153
+ case R:
294
154
  return "SuspenseList";
295
155
  }
296
156
  if (typeof e == "object")
297
157
  switch (e.$$typeof) {
298
- case m:
299
- var t = e;
300
- return ye(t) + ".Consumer";
301
- case i:
302
- var r = e;
303
- return ye(r._context) + ".Provider";
304
158
  case v:
305
- return ge(e, e.render, "ForwardRef");
306
- case w:
159
+ var r = e;
160
+ return ue(r) + ".Consumer";
161
+ case h:
162
+ var o = e;
163
+ return ue(o._context) + ".Provider";
164
+ case g:
165
+ return ze(e, e.render, "ForwardRef");
166
+ case f:
307
167
  var s = e.displayName || null;
308
- return s !== null ? s : k(e.type) || "Memo";
309
- case A: {
310
- var p = e, g = p._payload, f = p._init;
168
+ return s !== null ? s : T(e.type) || "Memo";
169
+ case _: {
170
+ var d = e, p = d._payload, l = d._init;
311
171
  try {
312
- return k(f(g));
172
+ return T(l(p));
313
173
  } catch {
314
174
  return null;
315
175
  }
@@ -317,18 +177,18 @@ function Ot() {
317
177
  }
318
178
  return null;
319
179
  }
320
- var $ = Object.assign, V = 0, Re, he, Ee, Ce, be, _e, we;
321
- function Te() {
180
+ var A = Object.assign, N = 0, le, fe, de, me, pe, ve, ge;
181
+ function ye() {
322
182
  }
323
- Te.__reactDisabledLog = !0;
324
- function Je() {
183
+ ye.__reactDisabledLog = !0;
184
+ function He() {
325
185
  {
326
- if (V === 0) {
327
- Re = console.log, he = console.info, Ee = console.warn, Ce = console.error, be = console.group, _e = console.groupCollapsed, we = console.groupEnd;
186
+ if (N === 0) {
187
+ le = console.log, fe = console.info, de = console.warn, me = console.error, pe = console.group, ve = console.groupCollapsed, ge = console.groupEnd;
328
188
  var e = {
329
189
  configurable: !0,
330
190
  enumerable: !0,
331
- value: Te,
191
+ value: ye,
332
192
  writable: !0
333
193
  };
334
194
  Object.defineProperties(console, {
@@ -341,336 +201,336 @@ function Ot() {
341
201
  groupEnd: e
342
202
  });
343
203
  }
344
- V++;
204
+ N++;
345
205
  }
346
206
  }
347
- function ze() {
207
+ function Je() {
348
208
  {
349
- if (V--, V === 0) {
209
+ if (N--, N === 0) {
350
210
  var e = {
351
211
  configurable: !0,
352
212
  enumerable: !0,
353
213
  writable: !0
354
214
  };
355
215
  Object.defineProperties(console, {
356
- log: $({}, e, {
357
- value: Re
216
+ log: A({}, e, {
217
+ value: le
358
218
  }),
359
- info: $({}, e, {
360
- value: he
219
+ info: A({}, e, {
220
+ value: fe
361
221
  }),
362
- warn: $({}, e, {
363
- value: Ee
222
+ warn: A({}, e, {
223
+ value: de
364
224
  }),
365
- error: $({}, e, {
366
- value: Ce
225
+ error: A({}, e, {
226
+ value: me
367
227
  }),
368
- group: $({}, e, {
369
- value: be
228
+ group: A({}, e, {
229
+ value: pe
370
230
  }),
371
- groupCollapsed: $({}, e, {
372
- value: _e
231
+ groupCollapsed: A({}, e, {
232
+ value: ve
373
233
  }),
374
- groupEnd: $({}, e, {
375
- value: we
234
+ groupEnd: A({}, e, {
235
+ value: ge
376
236
  })
377
237
  });
378
238
  }
379
- V < 0 && h("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
239
+ N < 0 && w("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
380
240
  }
381
241
  }
382
- var ae = _.ReactCurrentDispatcher, se;
383
- function K(e, t, r) {
242
+ var G = S.ReactCurrentDispatcher, K;
243
+ function q(e, r, o) {
384
244
  {
385
- if (se === void 0)
245
+ if (K === void 0)
386
246
  try {
387
247
  throw Error();
388
- } catch (p) {
389
- var s = p.stack.trim().match(/\n( *(at )?)/);
390
- se = s && s[1] || "";
248
+ } catch (d) {
249
+ var s = d.stack.trim().match(/\n( *(at )?)/);
250
+ K = s && s[1] || "";
391
251
  }
392
252
  return `
393
- ` + se + e;
253
+ ` + K + e;
394
254
  }
395
255
  }
396
- var ie = !1, X;
256
+ var X = !1, B;
397
257
  {
398
258
  var Ge = typeof WeakMap == "function" ? WeakMap : Map;
399
- X = new Ge();
259
+ B = new Ge();
400
260
  }
401
- function Se(e, t) {
402
- if (!e || ie)
261
+ function he(e, r) {
262
+ if (!e || X)
403
263
  return "";
404
264
  {
405
- var r = X.get(e);
406
- if (r !== void 0)
407
- return r;
265
+ var o = B.get(e);
266
+ if (o !== void 0)
267
+ return o;
408
268
  }
409
269
  var s;
410
- ie = !0;
411
- var p = Error.prepareStackTrace;
270
+ X = !0;
271
+ var d = Error.prepareStackTrace;
412
272
  Error.prepareStackTrace = void 0;
413
- var g;
414
- g = ae.current, ae.current = null, Je();
273
+ var p;
274
+ p = G.current, G.current = null, He();
415
275
  try {
416
- if (t) {
417
- var f = function() {
276
+ if (r) {
277
+ var l = function() {
418
278
  throw Error();
419
279
  };
420
- if (Object.defineProperty(f.prototype, "props", {
280
+ if (Object.defineProperty(l.prototype, "props", {
421
281
  set: function() {
422
282
  throw Error();
423
283
  }
424
284
  }), typeof Reflect == "object" && Reflect.construct) {
425
285
  try {
426
- Reflect.construct(f, []);
427
- } catch (D) {
428
- s = D;
286
+ Reflect.construct(l, []);
287
+ } catch (j) {
288
+ s = j;
429
289
  }
430
- Reflect.construct(e, [], f);
290
+ Reflect.construct(e, [], l);
431
291
  } else {
432
292
  try {
433
- f.call();
434
- } catch (D) {
435
- s = D;
293
+ l.call();
294
+ } catch (j) {
295
+ s = j;
436
296
  }
437
- e.call(f.prototype);
297
+ e.call(l.prototype);
438
298
  }
439
299
  } else {
440
300
  try {
441
301
  throw Error();
442
- } catch (D) {
443
- s = D;
302
+ } catch (j) {
303
+ s = j;
444
304
  }
445
305
  e();
446
306
  }
447
- } catch (D) {
448
- if (D && s && typeof D.stack == "string") {
449
- for (var l = D.stack.split(`
307
+ } catch (j) {
308
+ if (j && s && typeof j.stack == "string") {
309
+ for (var u = j.stack.split(`
450
310
  `), b = s.stack.split(`
451
- `), R = l.length - 1, E = b.length - 1; R >= 1 && E >= 0 && l[R] !== b[E]; )
311
+ `), y = u.length - 1, E = b.length - 1; y >= 1 && E >= 0 && u[y] !== b[E]; )
452
312
  E--;
453
- for (; R >= 1 && E >= 0; R--, E--)
454
- if (l[R] !== b[E]) {
455
- if (R !== 1 || E !== 1)
313
+ for (; y >= 1 && E >= 0; y--, E--)
314
+ if (u[y] !== b[E]) {
315
+ if (y !== 1 || E !== 1)
456
316
  do
457
- if (R--, E--, E < 0 || l[R] !== b[E]) {
458
- var P = `
459
- ` + l[R].replace(" at new ", " at ");
460
- return e.displayName && P.includes("<anonymous>") && (P = P.replace("<anonymous>", e.displayName)), typeof e == "function" && X.set(e, P), P;
317
+ if (y--, E--, E < 0 || u[y] !== b[E]) {
318
+ var C = `
319
+ ` + u[y].replace(" at new ", " at ");
320
+ return e.displayName && C.includes("<anonymous>") && (C = C.replace("<anonymous>", e.displayName)), typeof e == "function" && B.set(e, C), C;
461
321
  }
462
- while (R >= 1 && E >= 0);
322
+ while (y >= 1 && E >= 0);
463
323
  break;
464
324
  }
465
325
  }
466
326
  } finally {
467
- ie = !1, ae.current = g, ze(), Error.prepareStackTrace = p;
327
+ X = !1, G.current = p, Je(), Error.prepareStackTrace = d;
468
328
  }
469
- var W = e ? e.displayName || e.name : "", Ue = W ? K(W) : "";
470
- return typeof e == "function" && X.set(e, Ue), Ue;
329
+ var L = e ? e.displayName || e.name : "", ke = L ? q(L) : "";
330
+ return typeof e == "function" && B.set(e, ke), ke;
471
331
  }
472
- function Ke(e, t, r) {
473
- return Se(e, !1);
332
+ function Ke(e, r, o) {
333
+ return he(e, !1);
474
334
  }
475
335
  function Xe(e) {
476
- var t = e.prototype;
477
- return !!(t && t.isReactComponent);
336
+ var r = e.prototype;
337
+ return !!(r && r.isReactComponent);
478
338
  }
479
- function Z(e, t, r) {
339
+ function z(e, r, o) {
480
340
  if (e == null)
481
341
  return "";
482
342
  if (typeof e == "function")
483
- return Se(e, Xe(e));
343
+ return he(e, Xe(e));
484
344
  if (typeof e == "string")
485
- return K(e);
345
+ return q(e);
486
346
  switch (e) {
487
- case O:
488
- return K("Suspense");
489
- case C:
490
- return K("SuspenseList");
347
+ case P:
348
+ return q("Suspense");
349
+ case R:
350
+ return q("SuspenseList");
491
351
  }
492
352
  if (typeof e == "object")
493
353
  switch (e.$$typeof) {
494
- case v:
354
+ case g:
495
355
  return Ke(e.render);
496
- case w:
497
- return Z(e.type, t, r);
498
- case A: {
499
- var s = e, p = s._payload, g = s._init;
356
+ case f:
357
+ return z(e.type, r, o);
358
+ case _: {
359
+ var s = e, d = s._payload, p = s._init;
500
360
  try {
501
- return Z(g(p), t, r);
361
+ return z(p(d), r, o);
502
362
  } catch {
503
363
  }
504
364
  }
505
365
  }
506
366
  return "";
507
367
  }
508
- var Q = Object.prototype.hasOwnProperty, Pe = {}, Oe = _.ReactDebugCurrentFrame;
509
- function ee(e) {
368
+ var H = Object.prototype.hasOwnProperty, Ee = {}, Re = S.ReactDebugCurrentFrame;
369
+ function J(e) {
510
370
  if (e) {
511
- var t = e._owner, r = Z(e.type, e._source, t ? t.type : null);
512
- Oe.setExtraStackFrame(r);
371
+ var r = e._owner, o = z(e.type, e._source, r ? r.type : null);
372
+ Re.setExtraStackFrame(o);
513
373
  } else
514
- Oe.setExtraStackFrame(null);
374
+ Re.setExtraStackFrame(null);
515
375
  }
516
- function Ze(e, t, r, s, p) {
376
+ function Ze(e, r, o, s, d) {
517
377
  {
518
- var g = Function.call.bind(Q);
519
- for (var f in e)
520
- if (g(e, f)) {
521
- var l = void 0;
378
+ var p = Function.call.bind(H);
379
+ for (var l in e)
380
+ if (p(e, l)) {
381
+ var u = void 0;
522
382
  try {
523
- if (typeof e[f] != "function") {
524
- var b = Error((s || "React class") + ": " + r + " type `" + f + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[f] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
383
+ if (typeof e[l] != "function") {
384
+ var b = Error((s || "React class") + ": " + o + " type `" + l + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[l] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
525
385
  throw b.name = "Invariant Violation", b;
526
386
  }
527
- l = e[f](t, f, s, r, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
528
- } catch (R) {
529
- l = R;
387
+ u = e[l](r, l, s, o, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
388
+ } catch (y) {
389
+ u = y;
530
390
  }
531
- l && !(l instanceof Error) && (ee(p), h("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", s || "React class", r, f, typeof l), ee(null)), l instanceof Error && !(l.message in Pe) && (Pe[l.message] = !0, ee(p), h("Failed %s type: %s", r, l.message), ee(null));
391
+ u && !(u instanceof Error) && (J(d), w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", s || "React class", o, l, typeof u), J(null)), u instanceof Error && !(u.message in Ee) && (Ee[u.message] = !0, J(d), w("Failed %s type: %s", o, u.message), J(null));
532
392
  }
533
393
  }
534
394
  }
535
395
  var Qe = Array.isArray;
536
- function ce(e) {
396
+ function Z(e) {
537
397
  return Qe(e);
538
398
  }
539
- function et(e) {
399
+ function er(e) {
540
400
  {
541
- var t = typeof Symbol == "function" && Symbol.toStringTag, r = t && e[Symbol.toStringTag] || e.constructor.name || "Object";
542
- return r;
401
+ var r = typeof Symbol == "function" && Symbol.toStringTag, o = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
402
+ return o;
543
403
  }
544
404
  }
545
- function tt(e) {
405
+ function rr(e) {
546
406
  try {
547
- return je(e), !1;
407
+ return we(e), !1;
548
408
  } catch {
549
409
  return !0;
550
410
  }
551
411
  }
552
- function je(e) {
412
+ function we(e) {
553
413
  return "" + e;
554
414
  }
555
- function xe(e) {
556
- if (tt(e))
557
- return h("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", et(e)), je(e);
415
+ function be(e) {
416
+ if (rr(e))
417
+ return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", er(e)), we(e);
558
418
  }
559
- var Y = _.ReactCurrentOwner, rt = {
419
+ var I = S.ReactCurrentOwner, tr = {
560
420
  key: !0,
561
421
  ref: !0,
562
422
  __self: !0,
563
423
  __source: !0
564
- }, Ae, ke, ue;
565
- ue = {};
566
- function nt(e) {
567
- if (Q.call(e, "ref")) {
568
- var t = Object.getOwnPropertyDescriptor(e, "ref").get;
569
- if (t && t.isReactWarning)
424
+ }, _e, Ce, Q;
425
+ Q = {};
426
+ function nr(e) {
427
+ if (H.call(e, "ref")) {
428
+ var r = Object.getOwnPropertyDescriptor(e, "ref").get;
429
+ if (r && r.isReactWarning)
570
430
  return !1;
571
431
  }
572
432
  return e.ref !== void 0;
573
433
  }
574
- function ot(e) {
575
- if (Q.call(e, "key")) {
576
- var t = Object.getOwnPropertyDescriptor(e, "key").get;
577
- if (t && t.isReactWarning)
434
+ function or(e) {
435
+ if (H.call(e, "key")) {
436
+ var r = Object.getOwnPropertyDescriptor(e, "key").get;
437
+ if (r && r.isReactWarning)
578
438
  return !1;
579
439
  }
580
440
  return e.key !== void 0;
581
441
  }
582
- function at(e, t) {
583
- if (typeof e.ref == "string" && Y.current && t && Y.current.stateNode !== t) {
584
- var r = k(Y.current.type);
585
- ue[r] || (h('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', k(Y.current.type), e.ref), ue[r] = !0);
442
+ function ar(e, r) {
443
+ if (typeof e.ref == "string" && I.current && r && I.current.stateNode !== r) {
444
+ var o = T(I.current.type);
445
+ Q[o] || (w('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', T(I.current.type), e.ref), Q[o] = !0);
586
446
  }
587
447
  }
588
- function st(e, t) {
448
+ function ir(e, r) {
589
449
  {
590
- var r = function() {
591
- Ae || (Ae = !0, h("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
450
+ var o = function() {
451
+ _e || (_e = !0, w("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
592
452
  };
593
- r.isReactWarning = !0, Object.defineProperty(e, "key", {
594
- get: r,
453
+ o.isReactWarning = !0, Object.defineProperty(e, "key", {
454
+ get: o,
595
455
  configurable: !0
596
456
  });
597
457
  }
598
458
  }
599
- function it(e, t) {
459
+ function sr(e, r) {
600
460
  {
601
- var r = function() {
602
- ke || (ke = !0, h("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
461
+ var o = function() {
462
+ Ce || (Ce = !0, w("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
603
463
  };
604
- r.isReactWarning = !0, Object.defineProperty(e, "ref", {
605
- get: r,
464
+ o.isReactWarning = !0, Object.defineProperty(e, "ref", {
465
+ get: o,
606
466
  configurable: !0
607
467
  });
608
468
  }
609
469
  }
610
- var ct = function(e, t, r, s, p, g, f) {
611
- var l = {
470
+ var cr = function(e, r, o, s, d, p, l) {
471
+ var u = {
612
472
  // This tag allows us to uniquely identify this as a React Element
613
- $$typeof: o,
473
+ $$typeof: n,
614
474
  // Built-in properties that belong on the element
615
475
  type: e,
616
- key: t,
617
- ref: r,
618
- props: f,
476
+ key: r,
477
+ ref: o,
478
+ props: l,
619
479
  // Record the component responsible for creating this element.
620
- _owner: g
480
+ _owner: p
621
481
  };
622
- return l._store = {}, Object.defineProperty(l._store, "validated", {
482
+ return u._store = {}, Object.defineProperty(u._store, "validated", {
623
483
  configurable: !1,
624
484
  enumerable: !1,
625
485
  writable: !0,
626
486
  value: !1
627
- }), Object.defineProperty(l, "_self", {
487
+ }), Object.defineProperty(u, "_self", {
628
488
  configurable: !1,
629
489
  enumerable: !1,
630
490
  writable: !1,
631
491
  value: s
632
- }), Object.defineProperty(l, "_source", {
492
+ }), Object.defineProperty(u, "_source", {
633
493
  configurable: !1,
634
494
  enumerable: !1,
635
495
  writable: !1,
636
- value: p
637
- }), Object.freeze && (Object.freeze(l.props), Object.freeze(l)), l;
496
+ value: d
497
+ }), Object.freeze && (Object.freeze(u.props), Object.freeze(u)), u;
638
498
  };
639
- function ut(e, t, r, s, p) {
499
+ function ur(e, r, o, s, d) {
640
500
  {
641
- var g, f = {}, l = null, b = null;
642
- r !== void 0 && (xe(r), l = "" + r), ot(t) && (xe(t.key), l = "" + t.key), nt(t) && (b = t.ref, at(t, p));
643
- for (g in t)
644
- Q.call(t, g) && !rt.hasOwnProperty(g) && (f[g] = t[g]);
501
+ var p, l = {}, u = null, b = null;
502
+ o !== void 0 && (be(o), u = "" + o), or(r) && (be(r.key), u = "" + r.key), nr(r) && (b = r.ref, ar(r, d));
503
+ for (p in r)
504
+ H.call(r, p) && !tr.hasOwnProperty(p) && (l[p] = r[p]);
645
505
  if (e && e.defaultProps) {
646
- var R = e.defaultProps;
647
- for (g in R)
648
- f[g] === void 0 && (f[g] = R[g]);
506
+ var y = e.defaultProps;
507
+ for (p in y)
508
+ l[p] === void 0 && (l[p] = y[p]);
649
509
  }
650
- if (l || b) {
510
+ if (u || b) {
651
511
  var E = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
652
- l && st(f, E), b && it(f, E);
512
+ u && ir(l, E), b && sr(l, E);
653
513
  }
654
- return ct(e, l, b, p, s, Y.current, f);
514
+ return cr(e, u, b, d, s, I.current, l);
655
515
  }
656
516
  }
657
- var le = _.ReactCurrentOwner, De = _.ReactDebugCurrentFrame;
658
- function U(e) {
517
+ var ee = S.ReactCurrentOwner, Pe = S.ReactDebugCurrentFrame;
518
+ function F(e) {
659
519
  if (e) {
660
- var t = e._owner, r = Z(e.type, e._source, t ? t.type : null);
661
- De.setExtraStackFrame(r);
520
+ var r = e._owner, o = z(e.type, e._source, r ? r.type : null);
521
+ Pe.setExtraStackFrame(o);
662
522
  } else
663
- De.setExtraStackFrame(null);
523
+ Pe.setExtraStackFrame(null);
664
524
  }
665
- var fe;
666
- fe = !1;
667
- function de(e) {
668
- return typeof e == "object" && e !== null && e.$$typeof === o;
525
+ var re;
526
+ re = !1;
527
+ function te(e) {
528
+ return typeof e == "object" && e !== null && e.$$typeof === n;
669
529
  }
670
- function Fe() {
530
+ function Se() {
671
531
  {
672
- if (le.current) {
673
- var e = k(le.current.type);
532
+ if (ee.current) {
533
+ var e = T(ee.current.type);
674
534
  if (e)
675
535
  return `
676
536
 
@@ -679,249 +539,354 @@ Check the render method of \`` + e + "`.";
679
539
  return "";
680
540
  }
681
541
  }
682
- function lt(e) {
542
+ function lr(e) {
683
543
  return "";
684
544
  }
685
- var Ne = {};
686
- function ft(e) {
545
+ var Oe = {};
546
+ function fr(e) {
687
547
  {
688
- var t = Fe();
689
- if (!t) {
690
- var r = typeof e == "string" ? e : e.displayName || e.name;
691
- r && (t = `
548
+ var r = Se();
549
+ if (!r) {
550
+ var o = typeof e == "string" ? e : e.displayName || e.name;
551
+ o && (r = `
692
552
 
693
- Check the top-level render call using <` + r + ">.");
553
+ Check the top-level render call using <` + o + ">.");
694
554
  }
695
- return t;
555
+ return r;
696
556
  }
697
557
  }
698
- function Le(e, t) {
558
+ function Te(e, r) {
699
559
  {
700
560
  if (!e._store || e._store.validated || e.key != null)
701
561
  return;
702
562
  e._store.validated = !0;
703
- var r = ft(t);
704
- if (Ne[r])
563
+ var o = fr(r);
564
+ if (Oe[o])
705
565
  return;
706
- Ne[r] = !0;
566
+ Oe[o] = !0;
707
567
  var s = "";
708
- e && e._owner && e._owner !== le.current && (s = " It was passed a child from " + k(e._owner.type) + "."), U(e), h('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', r, s), U(null);
568
+ e && e._owner && e._owner !== ee.current && (s = " It was passed a child from " + T(e._owner.type) + "."), F(e), w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', o, s), F(null);
709
569
  }
710
570
  }
711
- function Ie(e, t) {
571
+ function je(e, r) {
712
572
  {
713
573
  if (typeof e != "object")
714
574
  return;
715
- if (ce(e))
716
- for (var r = 0; r < e.length; r++) {
717
- var s = e[r];
718
- de(s) && Le(s, t);
575
+ if (Z(e))
576
+ for (var o = 0; o < e.length; o++) {
577
+ var s = e[o];
578
+ te(s) && Te(s, r);
719
579
  }
720
- else if (de(e))
580
+ else if (te(e))
721
581
  e._store && (e._store.validated = !0);
722
582
  else if (e) {
723
- var p = j(e);
724
- if (typeof p == "function" && p !== e.entries)
725
- for (var g = p.call(e), f; !(f = g.next()).done; )
726
- de(f.value) && Le(f.value, t);
583
+ var d = U(e);
584
+ if (typeof d == "function" && d !== e.entries)
585
+ for (var p = d.call(e), l; !(l = p.next()).done; )
586
+ te(l.value) && Te(l.value, r);
727
587
  }
728
588
  }
729
589
  }
730
- function dt(e) {
590
+ function dr(e) {
731
591
  {
732
- var t = e.type;
733
- if (t == null || typeof t == "string")
592
+ var r = e.type;
593
+ if (r == null || typeof r == "string")
734
594
  return;
735
- var r;
736
- if (typeof t == "function")
737
- r = t.propTypes;
738
- else if (typeof t == "object" && (t.$$typeof === v || // Note: Memo only checks outer props here.
595
+ var o;
596
+ if (typeof r == "function")
597
+ o = r.propTypes;
598
+ else if (typeof r == "object" && (r.$$typeof === g || // Note: Memo only checks outer props here.
739
599
  // Inner props are checked in the reconciler.
740
- t.$$typeof === w))
741
- r = t.propTypes;
600
+ r.$$typeof === f))
601
+ o = r.propTypes;
742
602
  else
743
603
  return;
744
- if (r) {
745
- var s = k(t);
746
- Ze(r, e.props, "prop", s, e);
747
- } else if (t.PropTypes !== void 0 && !fe) {
748
- fe = !0;
749
- var p = k(t);
750
- h("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", p || "Unknown");
604
+ if (o) {
605
+ var s = T(r);
606
+ Ze(o, e.props, "prop", s, e);
607
+ } else if (r.PropTypes !== void 0 && !re) {
608
+ re = !0;
609
+ var d = T(r);
610
+ w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", d || "Unknown");
751
611
  }
752
- typeof t.getDefaultProps == "function" && !t.getDefaultProps.isReactClassApproved && h("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
612
+ typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
753
613
  }
754
614
  }
755
- function pt(e) {
615
+ function mr(e) {
756
616
  {
757
- for (var t = Object.keys(e.props), r = 0; r < t.length; r++) {
758
- var s = t[r];
617
+ for (var r = Object.keys(e.props), o = 0; o < r.length; o++) {
618
+ var s = r[o];
759
619
  if (s !== "children" && s !== "key") {
760
- U(e), h("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", s), U(null);
620
+ F(e), w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", s), F(null);
761
621
  break;
762
622
  }
763
623
  }
764
- e.ref !== null && (U(e), h("Invalid attribute `ref` supplied to `React.Fragment`."), U(null));
624
+ e.ref !== null && (F(e), w("Invalid attribute `ref` supplied to `React.Fragment`."), F(null));
765
625
  }
766
626
  }
767
- function $e(e, t, r, s, p, g) {
627
+ function xe(e, r, o, s, d, p) {
768
628
  {
769
- var f = G(e);
770
- if (!f) {
771
- var l = "";
772
- (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (l += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
773
- var b = lt();
774
- b ? l += b : l += Fe();
775
- var R;
776
- e === null ? R = "null" : ce(e) ? R = "array" : e !== void 0 && e.$$typeof === o ? (R = "<" + (k(e.type) || "Unknown") + " />", l = " Did you accidentally export a JSX literal instead of a component?") : R = typeof e, h("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", R, l);
629
+ var l = Be(e);
630
+ if (!l) {
631
+ var u = "";
632
+ (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (u += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
633
+ var b = lr();
634
+ b ? u += b : u += Se();
635
+ var y;
636
+ e === null ? y = "null" : Z(e) ? y = "array" : e !== void 0 && e.$$typeof === n ? (y = "<" + (T(e.type) || "Unknown") + " />", u = " Did you accidentally export a JSX literal instead of a component?") : y = typeof e, w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", y, u);
777
637
  }
778
- var E = ut(e, t, r, p, g);
638
+ var E = ur(e, r, o, d, p);
779
639
  if (E == null)
780
640
  return E;
781
- if (f) {
782
- var P = t.children;
783
- if (P !== void 0)
641
+ if (l) {
642
+ var C = r.children;
643
+ if (C !== void 0)
784
644
  if (s)
785
- if (ce(P)) {
786
- for (var W = 0; W < P.length; W++)
787
- Ie(P[W], e);
788
- Object.freeze && Object.freeze(P);
645
+ if (Z(C)) {
646
+ for (var L = 0; L < C.length; L++)
647
+ je(C[L], e);
648
+ Object.freeze && Object.freeze(C);
789
649
  } else
790
- h("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
650
+ w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
791
651
  else
792
- Ie(P, e);
652
+ je(C, e);
793
653
  }
794
- return e === u ? pt(E) : dt(E), E;
654
+ return e === c ? mr(E) : dr(E), E;
795
655
  }
796
656
  }
797
- function mt(e, t, r) {
798
- return $e(e, t, r, !0);
657
+ function pr(e, r, o) {
658
+ return xe(e, r, o, !0);
799
659
  }
800
- function vt(e, t, r) {
801
- return $e(e, t, r, !1);
660
+ function vr(e, r, o) {
661
+ return xe(e, r, o, !1);
802
662
  }
803
- var gt = vt, yt = mt;
804
- q.Fragment = u, q.jsx = gt, q.jsxs = yt;
805
- }()), q;
663
+ var gr = vr, yr = pr;
664
+ W.Fragment = c, W.jsx = gr, W.jsxs = yr;
665
+ }()), W;
806
666
  }
807
- process.env.NODE_ENV === "production" ? ve.exports = Pt() : ve.exports = Ot();
808
- var He = ve.exports;
809
- const re = He.jsx, jt = He.Fragment;
810
- function Wt(n) {
811
- const {
812
- id: o,
813
- pageType: a
814
- } = n;
815
- return /* @__PURE__ */ re("div", {
816
- className: "nosto_element",
817
- id: o
818
- }, o + (a || ""));
667
+ process.env.NODE_ENV === "production" ? ae.exports = Sr() : ae.exports = Or();
668
+ var M = ae.exports;
669
+ function Tr(t) {
670
+ return wr(t.recommendationComponent, {
671
+ // eslint-disable-next-line react/prop-types
672
+ nostoRecommendation: t.nostoRecommendation
673
+ });
819
674
  }
820
- function Vt(n) {
821
- const {
822
- account: o,
823
- multiCurrency: a = !1,
824
- host: u,
825
- children: d,
826
- recommendationComponent: c,
827
- shopifyMarkets: i
828
- } = n, [m, v] = B.useState(!1), O = B.useMemo(() => m, [m]), C = a ? n.currentVariation : "", w = Ct(c) ? "JSON_ORIGINAL" : "HTML";
829
- function A(j) {
830
- return B.cloneElement(c, {
831
- // eslint-disable-next-line react/prop-types
832
- nostoRecommendation: j.nostoRecommendation
833
- });
834
- }
835
- const [F, J] = bt("");
836
- function ne(j = "") {
837
- const _ = pe({});
838
- te(() => {
839
- F !== j && J(j);
840
- }, []);
841
- const h = j === F;
842
- function y(T, S) {
843
- if (w == "HTML")
844
- S.placements.injectCampaigns(T.recommendations);
845
- else {
846
- const L = T.campaigns.recommendations;
847
- for (const I in L) {
848
- const oe = L[I], z = "#" + I, G = () => document.querySelector(z);
849
- G() && (_.current[I] || (_.current[I] = _t(G())), _.current[I].render(/* @__PURE__ */ re(A, {
850
- nostoRecommendation: oe
851
- })));
852
- }
853
- }
675
+ function jr(t) {
676
+ if (!window.nostojs)
677
+ throw new Error("Nosto has not yet been initialized");
678
+ window.nostojs((n) => {
679
+ n.placements.injectCampaigns(t.recommendations);
680
+ });
681
+ }
682
+ function k() {
683
+ const { responseMode: t, recommendationComponent: n } = se(), a = ne({});
684
+ if (t == "HTML")
685
+ return { renderCampaigns: jr };
686
+ function c(i) {
687
+ var h;
688
+ const m = ((h = i.campaigns) == null ? void 0 : h.recommendations) ?? {};
689
+ for (const v in m) {
690
+ const g = m[v], P = "#" + v, R = document.querySelector(P);
691
+ R && (a.current[v] || (a.current[v] = Cr(R)), a.current[v].render(
692
+ /* @__PURE__ */ M.jsx(
693
+ Tr,
694
+ {
695
+ recommendationComponent: n,
696
+ nostoRecommendation: g
697
+ }
698
+ )
699
+ ));
854
700
  }
855
- return {
856
- renderCampaigns: y,
857
- pageTypeUpdated: h
858
- };
859
701
  }
860
- return te(() => {
861
- var j, _, h;
862
- if (window.nostojs || (window.nostojs = (y) => {
863
- (window.nostojs.q = window.nostojs.q || []).push(y);
864
- }, window.nostojs((y) => y.setAutoLoad(!1))), !document.querySelectorAll("[nosto-client-script]").length && !i) {
865
- const y = document.createElement("script");
866
- y.type = "text/javascript", y.src = "//" + (u || "connect.nosto.com") + "/include/" + o, y.async = !0, y.setAttribute("nosto-client-script", ""), y.onload = () => {
867
- var T;
868
- typeof jest < "u" && ((T = window.nosto) == null || T.reload({
869
- site: "localhost"
870
- })), v(!0);
871
- }, document.body.appendChild(y);
872
- }
873
- if (i) {
874
- const y = document.querySelector("[nosto-client-script]"), T = document.querySelector("#nosto-sandbox");
875
- if (!y || (y == null ? void 0 : y.getAttribute("nosto-language")) !== (i == null ? void 0 : i.language) || (y == null ? void 0 : y.getAttribute("nosto-market-id")) !== (i == null ? void 0 : i.marketId)) {
876
- m && v(!1), (j = y == null ? void 0 : y.parentNode) == null || j.removeChild(y), (_ = T == null ? void 0 : T.parentNode) == null || _.removeChild(T);
877
- const S = document.createElement("script");
878
- S.type = "text/javascript", S.src = "//" + (u || "connect.nosto.com") + `/script/shopify/market/nosto.js?merchant=${o}&market=${i.marketId || ""}&locale=${((h = i == null ? void 0 : i.language) == null ? void 0 : h.toLowerCase()) || ""}`, S.async = !0, S.setAttribute("nosto-client-script", ""), S.setAttribute("nosto-language", (i == null ? void 0 : i.language) || ""), S.setAttribute("nosto-market-id", String(i == null ? void 0 : i.marketId)), S.onload = () => {
879
- var L;
880
- typeof jest < "u" && ((L = window.nosto) == null || L.reload({
881
- site: "localhost"
882
- })), v(!0);
883
- }, document.body.appendChild(S);
702
+ return { renderCampaigns: c };
703
+ }
704
+ function xr() {
705
+ return typeof window.nosto < "u";
706
+ }
707
+ function kr(t, n) {
708
+ return new Promise((a, c) => {
709
+ const i = document.createElement("script");
710
+ i.type = "text/javascript", i.src = t, i.async = !0, i.onload = () => a(), i.onerror = () => c(), Object.entries((n == null ? void 0 : n.attributes) ?? {}).forEach(([m, h]) => i.setAttribute(m, h)), (n == null ? void 0 : n.position) === "head" ? document.head.appendChild(i) : document.body.appendChild(i);
711
+ });
712
+ }
713
+ function Ar(t) {
714
+ const { host: n = "connect.nosto.com", scriptLoader: a = kr, account: c, shopifyMarkets: i, loadScript: m = !0 } = t, [h, v] = br(!1);
715
+ return ie(() => {
716
+ function g() {
717
+ var f;
718
+ "nostoReactTest" in window && ((f = window.nosto) == null || f.reload({
719
+ site: "localhost"
720
+ })), v(!0);
721
+ }
722
+ async function P(f, _ = {}) {
723
+ const O = `//${n}${f}`, D = { "nosto-client-script": "", ..._ };
724
+ await a(O, { attributes: D }), g();
725
+ }
726
+ function R() {
727
+ var Y, U;
728
+ const f = document.querySelector("[nosto-client-script]"), _ = String((i == null ? void 0 : i.marketId) || ""), O = (i == null ? void 0 : i.language) || "", D = (f == null ? void 0 : f.getAttribute("nosto-language")) !== O || (f == null ? void 0 : f.getAttribute("nosto-market-id")) !== _;
729
+ if (!f || D) {
730
+ h && v(!1);
731
+ const S = document.querySelector("#nosto-sandbox");
732
+ (Y = f == null ? void 0 : f.parentNode) == null || Y.removeChild(f), (U = S == null ? void 0 : S.parentNode) == null || U.removeChild(S);
733
+ const w = `/script/shopify/market/nosto.js?merchant=${c}&market=${_}&locale=${O.toLowerCase()}`;
734
+ P(w, { "nosto-language": O, "nosto-market-id": _ });
884
735
  }
885
736
  }
886
- }, [m, i]), /* @__PURE__ */ re(qe.Provider, {
887
- value: {
888
- account: o,
889
- clientScriptLoaded: O,
890
- currentVariation: C,
891
- responseMode: w,
892
- recommendationComponent: c,
893
- useRenderCampaigns: ne,
894
- pageType: F
737
+ if (window.nostojs || (window.nostojs = (f) => {
738
+ (window.nostojs.q = window.nostojs.q || []).push(f);
739
+ }, window.nostojs((f) => f.setAutoLoad(!1))), !m) {
740
+ window.nosto ? g() : window.nostojs(g);
741
+ return;
742
+ }
743
+ if (!xr() && !i) {
744
+ const f = `/include/${c}`;
745
+ P(f);
746
+ }
747
+ i && R();
748
+ }, [i == null ? void 0 : i.marketId, i == null ? void 0 : i.language]), { clientScriptLoaded: h };
749
+ }
750
+ function Ir(t) {
751
+ const { renderCampaigns: n } = k();
752
+ return x(
753
+ async (a) => {
754
+ const c = await a.defaultSession().viewNotFound().setPlacements(t.placements || a.placements.getPlacements()).load();
755
+ n(c);
756
+ }
757
+ ), null;
758
+ }
759
+ function $r(t) {
760
+ const { renderCampaigns: n } = k();
761
+ return x(
762
+ async (a) => {
763
+ const c = await a.defaultSession().viewOther().setPlacements(t.placements || a.placements.getPlacements()).load();
764
+ n(c);
765
+ }
766
+ ), null;
767
+ }
768
+ function Wr(t) {
769
+ const { renderCampaigns: n } = k();
770
+ return x(
771
+ async (a) => {
772
+ const c = await a.defaultSession().viewCart().setPlacements(t.placements || a.placements.getPlacements()).load();
773
+ n(c);
774
+ }
775
+ ), null;
776
+ }
777
+ function Mr(t) {
778
+ const { product: n, tagging: a, placements: c } = t, { renderCampaigns: i } = k();
779
+ return x(
780
+ async (m) => {
781
+ const h = await m.defaultSession().viewProduct(a ?? n).setPlacements(c || m.placements.getPlacements()).load();
782
+ i(h);
895
783
  },
896
- children: d
897
- });
784
+ [n, a == null ? void 0 : a.selected_sku_id]
785
+ ), null;
786
+ }
787
+ function Vr(t) {
788
+ const { category: n, placements: a } = t, { renderCampaigns: c } = k();
789
+ return x(
790
+ async (i) => {
791
+ const m = await i.defaultSession().viewCategory(n).setPlacements(a || i.placements.getPlacements()).load();
792
+ c(m);
793
+ },
794
+ [n]
795
+ ), null;
796
+ }
797
+ function Yr(t) {
798
+ const { query: n, placements: a } = t, { renderCampaigns: c } = k();
799
+ return x(
800
+ async (i) => {
801
+ const m = await i.defaultSession().viewSearch(n).setPlacements(a || i.placements.getPlacements()).load();
802
+ c(m);
803
+ },
804
+ [n]
805
+ ), null;
806
+ }
807
+ function V(t) {
808
+ return !t || typeof t != "object" || Dr(t) || Fr(t) ? t : Array.isArray(t) ? t.map(V) : Object.keys(t).reduce((n, a) => {
809
+ const c = a[0].toLowerCase() + a.slice(1).replace(/([A-Z]+)/g, (i, m) => "_" + m.toLowerCase());
810
+ return n[c] = V(t[a]), n;
811
+ }, {});
812
+ }
813
+ function Dr(t) {
814
+ return Object.prototype.toString.call(t) === "[object Date]";
815
+ }
816
+ function Fr(t) {
817
+ return Object.prototype.toString.call(t) === "[object RegExp]";
818
+ }
819
+ function Ur(t) {
820
+ const { order: n, placements: a } = t, { renderCampaigns: c } = k();
821
+ return x(
822
+ async (i) => {
823
+ const m = await i.defaultSession().addOrder(V(n)).setPlacements(a || i.placements.getPlacements()).load();
824
+ c(m);
825
+ },
826
+ [n],
827
+ { deep: !0 }
828
+ ), null;
898
829
  }
899
- function Yt(n) {
830
+ function qr(t) {
831
+ const { renderCampaigns: n } = k();
832
+ return x(
833
+ async (a) => {
834
+ const c = await a.defaultSession().viewFrontPage().setPlacements(t.placements || a.placements.getPlacements()).load();
835
+ n(c);
836
+ }
837
+ ), null;
838
+ }
839
+ function Br(t) {
840
+ const { id: n, pageType: a } = t;
841
+ return /* @__PURE__ */ M.jsx("div", { className: "nosto_element", id: n }, n + (a || ""));
842
+ }
843
+ function zr(t) {
900
844
  const {
901
- cart: o,
902
- customer: a
903
- } = n ?? {}, {
904
- clientScriptLoaded: u
905
- } = x();
906
- return Be(() => {
907
- const d = o ? H(o) : void 0, c = a ? H(a) : void 0;
908
- u && window.nostojs((i) => {
909
- i.defaultSession().setResponseMode("HTML").setCart(d).setCustomer(c).viewOther().load();
845
+ account: n,
846
+ multiCurrency: a = !1,
847
+ children: c,
848
+ recommendationComponent: i
849
+ } = t, m = a ? t.currentVariation : "";
850
+ if (i && !_r(i))
851
+ throw new Error(
852
+ "The recommendationComponent prop must be a valid React element. Please provide a valid React element."
853
+ );
854
+ const h = i ? "JSON_ORIGINAL" : "HTML", { clientScriptLoaded: v } = Ar(t);
855
+ return /* @__PURE__ */ M.jsx(
856
+ $e.Provider,
857
+ {
858
+ value: {
859
+ account: n,
860
+ clientScriptLoaded: v,
861
+ currentVariation: m,
862
+ responseMode: h,
863
+ recommendationComponent: i
864
+ },
865
+ children: c
866
+ }
867
+ );
868
+ }
869
+ function Hr(t) {
870
+ const { cart: n, customer: a } = t ?? {}, { clientScriptLoaded: c } = se();
871
+ return Ie(() => {
872
+ const i = n ? V(n) : void 0, m = a ? V(a) : void 0;
873
+ c && window.nostojs((h) => {
874
+ h.defaultSession().setResponseMode("HTML").setCart(i).setCustomer(m).viewOther().load();
910
875
  });
911
- }, [u, o, a]), /* @__PURE__ */ re(jt, {});
876
+ }, [c, n, a]), /* @__PURE__ */ M.jsx(M.Fragment, {});
912
877
  }
913
878
  export {
914
- kt as Nosto404,
915
- Lt as NostoCategory,
916
- Ft as NostoCheckout,
917
- qe as NostoContext,
918
- Ut as NostoHome,
919
- $t as NostoOrder,
920
- Dt as NostoOther,
921
- Wt as NostoPlacement,
922
- Nt as NostoProduct,
923
- Vt as NostoProvider,
924
- It as NostoSearch,
925
- Yt as NostoSession,
926
- x as useNostoContext
879
+ Ir as Nosto404,
880
+ Vr as NostoCategory,
881
+ Wr as NostoCheckout,
882
+ $e as NostoContext,
883
+ qr as NostoHome,
884
+ Ur as NostoOrder,
885
+ $r as NostoOther,
886
+ Br as NostoPlacement,
887
+ Mr as NostoProduct,
888
+ zr as NostoProvider,
889
+ Yr as NostoSearch,
890
+ Hr as NostoSession,
891
+ se as useNostoContext
927
892
  };