@searchcraft/javascript-sdk 0.10.2 → 0.10.3

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.
Files changed (50) hide show
  1. package/dist/components/index.d.ts +31 -9
  2. package/dist/components/index.js +4 -4
  3. package/dist/components/{p-01589c0b.js → p-06bac1fc.js} +2 -2
  4. package/dist/components/{p-01589c0b.js.map → p-06bac1fc.js.map} +1 -1
  5. package/dist/components/{p-48fa555e.js → p-508ee769.js} +3 -2
  6. package/dist/components/p-508ee769.js.map +1 -0
  7. package/dist/components/{p-66109c31.js → p-53c795bd.js} +3 -4
  8. package/dist/components/p-53c795bd.js.map +1 -0
  9. package/dist/components/{p-2999498a.js → p-5a4be632.js} +2 -2
  10. package/dist/components/{p-2999498a.js.map → p-5a4be632.js.map} +1 -1
  11. package/dist/components/{p-0f5b47be.js → p-6717ab82.js} +2 -2
  12. package/dist/components/{p-0f5b47be.js.map → p-6717ab82.js.map} +1 -1
  13. package/dist/components/{p-435bec83.js → p-ad569b01.js} +12 -7
  14. package/dist/components/p-ad569b01.js.map +1 -0
  15. package/dist/components/{p-3465cbc7.js → p-d4558d44.js} +272 -259
  16. package/dist/components/p-d4558d44.js.map +1 -0
  17. package/dist/components/{p-760c6845.js → p-da1fb5c0.js} +2 -2
  18. package/dist/components/{p-760c6845.js.map → p-da1fb5c0.js.map} +1 -1
  19. package/dist/components/{p-c1f43fe1.js → p-fd564261.js} +4 -4
  20. package/dist/components/{p-c1f43fe1.js.map → p-fd564261.js.map} +1 -1
  21. package/dist/components/searchcraft-ad.js +1 -1
  22. package/dist/components/searchcraft-facet-list.js +1 -1
  23. package/dist/components/searchcraft-filter-panel.js +18 -7
  24. package/dist/components/searchcraft-filter-panel.js.map +1 -1
  25. package/dist/components/searchcraft-input-form.js +1 -1
  26. package/dist/components/searchcraft-pagination.js +1 -1
  27. package/dist/components/searchcraft-popover-button.js +1 -1
  28. package/dist/components/searchcraft-popover-footer.js +1 -1
  29. package/dist/components/searchcraft-popover-form.js +6 -6
  30. package/dist/components/searchcraft-popover-list-item.js +1 -1
  31. package/dist/components/searchcraft-popover-list-view.js +1 -1
  32. package/dist/components/searchcraft-results-info.js +1 -1
  33. package/dist/components/searchcraft-search-result.js +1 -1
  34. package/dist/components/searchcraft-search-results-per-page.js +1 -1
  35. package/dist/components/searchcraft-search-results.js +3 -3
  36. package/dist/components/searchcraft-theme.js +1 -1
  37. package/dist/components/searchcraft-theme.js.map +1 -1
  38. package/dist/components/searchcraft-toggle-button.js +1 -1
  39. package/dist/hydrate/index.js +188 -170
  40. package/dist/hydrate/index.mjs +188 -170
  41. package/dist/themes/hologram.css +1 -1
  42. package/dist/themes/hologram.css.map +1 -1
  43. package/dist/types/components/searchcraft-facet-list/searchcraft-facet-list.d.ts +1 -1
  44. package/dist/types/components/searchcraft-filter-panel/searchcraft-filter-panel.d.ts +1 -1
  45. package/dist/types/store/SearchcraftStore.types.d.ts +6 -2
  46. package/package.json +3 -3
  47. package/dist/components/p-3465cbc7.js.map +0 -1
  48. package/dist/components/p-435bec83.js.map +0 -1
  49. package/dist/components/p-48fa555e.js.map +0 -1
  50. package/dist/components/p-66109c31.js.map +0 -1
@@ -1,15 +1,15 @@
1
- var q = Object.defineProperty;
2
- var B = (a, e, n) => e in a ? q(a, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : a[e] = n;
3
- var h = (a, e, n) => B(a, typeof e != "symbol" ? e + "" : e, n);
4
- var F = /* @__PURE__ */ ((a) => (a[a.DEBUG = 0] = "DEBUG", a[a.INFO = 1] = "INFO", a[a.WARN = 2] = "WARN", a[a.ERROR = 3] = "ERROR", a))(F || {});
1
+ var B = Object.defineProperty;
2
+ var N = (a, e, n) => e in a ? B(a, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : a[e] = n;
3
+ var l = (a, e, n) => N(a, typeof e != "symbol" ? e + "" : e, n);
4
+ var O = /* @__PURE__ */ ((a) => (a[a.DEBUG = 0] = "DEBUG", a[a.INFO = 1] = "INFO", a[a.WARN = 2] = "WARN", a[a.ERROR = 3] = "ERROR", a))(O || {});
5
5
  class pe {
6
6
  constructor(e) {
7
- h(this, "logLevel");
8
- h(this, "logFormatter");
7
+ l(this, "logLevel");
8
+ l(this, "logFormatter");
9
9
  this.logLevel = e.logLevel || 1, this.logFormatter = e.logFormatter || this.defaultFormatter;
10
10
  }
11
11
  defaultFormatter(e, n) {
12
- return `[${F[e]}] ${( new Date()).toISOString()}: ${n}`;
12
+ return `[${O[e]}] ${( new Date()).toISOString()}: ${n}`;
13
13
  }
14
14
  debug(e) {
15
15
  this.logLevel <= 0 && console.log(this.logFormatter(0, e));
@@ -40,32 +40,32 @@ class pe {
40
40
  }
41
41
  }
42
42
  }
43
- function y(a, e, n, r) {
43
+ function w(a, e, n, r) {
44
44
  return new (n || (n = Promise))(function(i, o) {
45
- function t(s) {
45
+ function t(c) {
46
46
  try {
47
- l(r.next(s));
48
- } catch (c) {
49
- o(c);
47
+ h(r.next(c));
48
+ } catch (s) {
49
+ o(s);
50
50
  }
51
51
  }
52
- function u(s) {
52
+ function u(c) {
53
53
  try {
54
- l(r.throw(s));
55
- } catch (c) {
56
- o(c);
54
+ h(r.throw(c));
55
+ } catch (s) {
56
+ o(s);
57
57
  }
58
58
  }
59
- function l(s) {
60
- var c;
61
- s.done ? i(s.value) : (c = s.value, c instanceof n ? c : new n(function(p) {
62
- p(c);
59
+ function h(c) {
60
+ var s;
61
+ c.done ? i(c.value) : (s = c.value, s instanceof n ? s : new n(function(p) {
62
+ p(s);
63
63
  })).then(t, u);
64
64
  }
65
- l((r = r.apply(a, [])).next());
65
+ h((r = r.apply(a, [])).next());
66
66
  });
67
67
  }
68
- function w(a, e) {
68
+ function y(a, e) {
69
69
  var n, r, i, o, t = { label: 0, sent: function() {
70
70
  if (1 & i[0]) throw i[1];
71
71
  return i[1];
@@ -73,150 +73,150 @@ function w(a, e) {
73
73
  return o = { next: u(0), throw: u(1), return: u(2) }, typeof Symbol == "function" && (o[Symbol.iterator] = function() {
74
74
  return this;
75
75
  }), o;
76
- function u(l) {
77
- return function(s) {
78
- return function(c) {
76
+ function u(h) {
77
+ return function(c) {
78
+ return function(s) {
79
79
  if (n) throw new TypeError("Generator is already executing.");
80
- for (; o && (o = 0, c[0] && (t = 0)), t; ) try {
81
- if (n = 1, r && (i = 2 & c[0] ? r.return : c[0] ? r.throw || ((i = r.return) && i.call(r), 0) : r.next) && !(i = i.call(r, c[1])).done) return i;
82
- switch (r = 0, i && (c = [2 & c[0], i.value]), c[0]) {
80
+ for (; o && (o = 0, s[0] && (t = 0)), t; ) try {
81
+ if (n = 1, r && (i = 2 & s[0] ? r.return : s[0] ? r.throw || ((i = r.return) && i.call(r), 0) : r.next) && !(i = i.call(r, s[1])).done) return i;
82
+ switch (r = 0, i && (s = [2 & s[0], i.value]), s[0]) {
83
83
  case 0:
84
84
  case 1:
85
- i = c;
85
+ i = s;
86
86
  break;
87
87
  case 4:
88
- return t.label++, { value: c[1], done: !1 };
88
+ return t.label++, { value: s[1], done: !1 };
89
89
  case 5:
90
- t.label++, r = c[1], c = [0];
90
+ t.label++, r = s[1], s = [0];
91
91
  continue;
92
92
  case 7:
93
- c = t.ops.pop(), t.trys.pop();
93
+ s = t.ops.pop(), t.trys.pop();
94
94
  continue;
95
95
  default:
96
- if (i = t.trys, !((i = i.length > 0 && i[i.length - 1]) || c[0] !== 6 && c[0] !== 2)) {
96
+ if (i = t.trys, !((i = i.length > 0 && i[i.length - 1]) || s[0] !== 6 && s[0] !== 2)) {
97
97
  t = 0;
98
98
  continue;
99
99
  }
100
- if (c[0] === 3 && (!i || c[1] > i[0] && c[1] < i[3])) {
101
- t.label = c[1];
100
+ if (s[0] === 3 && (!i || s[1] > i[0] && s[1] < i[3])) {
101
+ t.label = s[1];
102
102
  break;
103
103
  }
104
- if (c[0] === 6 && t.label < i[1]) {
105
- t.label = i[1], i = c;
104
+ if (s[0] === 6 && t.label < i[1]) {
105
+ t.label = i[1], i = s;
106
106
  break;
107
107
  }
108
108
  if (i && t.label < i[2]) {
109
- t.label = i[2], t.ops.push(c);
109
+ t.label = i[2], t.ops.push(s);
110
110
  break;
111
111
  }
112
112
  i[2] && t.ops.pop(), t.trys.pop();
113
113
  continue;
114
114
  }
115
- c = e.call(a, t);
115
+ s = e.call(a, t);
116
116
  } catch (p) {
117
- c = [6, p], r = 0;
117
+ s = [6, p], r = 0;
118
118
  } finally {
119
119
  n = i = 0;
120
120
  }
121
- if (5 & c[0]) throw c[1];
122
- return { value: c[0] ? c[1] : void 0, done: !0 };
123
- }([l, s]);
121
+ if (5 & s[0]) throw s[1];
122
+ return { value: s[0] ? s[1] : void 0, done: !0 };
123
+ }([h, c]);
124
124
  };
125
125
  }
126
126
  }
127
- var S = { exclude: [] }, O = {}, N = { timeout: "true" }, v = function(a, e) {
128
- typeof window < "u" && (O[a] = e);
129
- }, j = function() {
130
- return Object.fromEntries(Object.entries(O).filter(function(a) {
127
+ var S = { exclude: [] }, D = {}, j = { timeout: "true" }, v = function(a, e) {
128
+ typeof window < "u" && (D[a] = e);
129
+ }, G = function() {
130
+ return Object.fromEntries(Object.entries(D).filter(function(a) {
131
131
  var e, n = a[0];
132
132
  return !(!((e = S == null ? void 0 : S.exclude) === null || e === void 0) && e.includes(n));
133
133
  }).map(function(a) {
134
134
  return [a[0], (0, a[1])()];
135
135
  }));
136
136
  };
137
- function C(a) {
137
+ function T(a) {
138
138
  return a ^= a >>> 16, a = Math.imul(a, 2246822507), a ^= a >>> 13, a = Math.imul(a, 3266489909), (a ^= a >>> 16) >>> 0;
139
139
  }
140
140
  var m = new Uint32Array([597399067, 2869860233, 951274213, 2716044179]);
141
141
  function g(a, e) {
142
142
  return a << e | a >>> 32 - e;
143
143
  }
144
- function _(a, e) {
144
+ function I(a, e) {
145
145
  var n;
146
146
  if (e === void 0 && (e = 0), e = e ? 0 | e : 0, typeof a == "string" && (n = a, a = new TextEncoder().encode(n).buffer), !(a instanceof ArrayBuffer)) throw new TypeError("Expected key to be ArrayBuffer or string");
147
147
  var r = new Uint32Array([e, e, e, e]);
148
148
  ((function(o, t) {
149
- for (var u = o.byteLength / 16 | 0, l = new Uint32Array(o, 0, 4 * u), s = 0; s < u; s++) {
150
- var c = l.subarray(4 * s, 4 * (s + 1));
151
- c[0] = Math.imul(c[0], m[0]), c[0] = g(c[0], 15), c[0] = Math.imul(c[0], m[1]), t[0] = t[0] ^ c[0], t[0] = g(t[0], 19), t[0] = t[0] + t[1], t[0] = Math.imul(t[0], 5) + 1444728091, c[1] = Math.imul(c[1], m[1]), c[1] = g(c[1], 16), c[1] = Math.imul(c[1], m[2]), t[1] = t[1] ^ c[1], t[1] = g(t[1], 17), t[1] = t[1] + t[2], t[1] = Math.imul(t[1], 5) + 197830471, c[2] = Math.imul(c[2], m[2]), c[2] = g(c[2], 17), c[2] = Math.imul(c[2], m[3]), t[2] = t[2] ^ c[2], t[2] = g(t[2], 15), t[2] = t[2] + t[3], t[2] = Math.imul(t[2], 5) + 2530024501, c[3] = Math.imul(c[3], m[3]), c[3] = g(c[3], 18), c[3] = Math.imul(c[3], m[0]), t[3] = t[3] ^ c[3], t[3] = g(t[3], 13), t[3] = t[3] + t[0], t[3] = Math.imul(t[3], 5) + 850148119;
149
+ for (var u = o.byteLength / 16 | 0, h = new Uint32Array(o, 0, 4 * u), c = 0; c < u; c++) {
150
+ var s = h.subarray(4 * c, 4 * (c + 1));
151
+ s[0] = Math.imul(s[0], m[0]), s[0] = g(s[0], 15), s[0] = Math.imul(s[0], m[1]), t[0] = t[0] ^ s[0], t[0] = g(t[0], 19), t[0] = t[0] + t[1], t[0] = Math.imul(t[0], 5) + 1444728091, s[1] = Math.imul(s[1], m[1]), s[1] = g(s[1], 16), s[1] = Math.imul(s[1], m[2]), t[1] = t[1] ^ s[1], t[1] = g(t[1], 17), t[1] = t[1] + t[2], t[1] = Math.imul(t[1], 5) + 197830471, s[2] = Math.imul(s[2], m[2]), s[2] = g(s[2], 17), s[2] = Math.imul(s[2], m[3]), t[2] = t[2] ^ s[2], t[2] = g(t[2], 15), t[2] = t[2] + t[3], t[2] = Math.imul(t[2], 5) + 2530024501, s[3] = Math.imul(s[3], m[3]), s[3] = g(s[3], 18), s[3] = Math.imul(s[3], m[0]), t[3] = t[3] ^ s[3], t[3] = g(t[3], 13), t[3] = t[3] + t[0], t[3] = Math.imul(t[3], 5) + 850148119;
152
152
  }
153
153
  }))(a, r), function(o, t) {
154
- var u = o.byteLength / 16 | 0, l = o.byteLength % 16, s = new Uint32Array(4), c = new Uint8Array(o, 16 * u, l);
155
- switch (l) {
154
+ var u = o.byteLength / 16 | 0, h = o.byteLength % 16, c = new Uint32Array(4), s = new Uint8Array(o, 16 * u, h);
155
+ switch (h) {
156
156
  case 15:
157
- s[3] = s[3] ^ c[14] << 16;
157
+ c[3] = c[3] ^ s[14] << 16;
158
158
  case 14:
159
- s[3] = s[3] ^ c[13] << 8;
159
+ c[3] = c[3] ^ s[13] << 8;
160
160
  case 13:
161
- s[3] = s[3] ^ c[12] << 0, s[3] = Math.imul(s[3], m[3]), s[3] = g(s[3], 18), s[3] = Math.imul(s[3], m[0]), t[3] = t[3] ^ s[3];
161
+ c[3] = c[3] ^ s[12] << 0, c[3] = Math.imul(c[3], m[3]), c[3] = g(c[3], 18), c[3] = Math.imul(c[3], m[0]), t[3] = t[3] ^ c[3];
162
162
  case 12:
163
- s[2] = s[2] ^ c[11] << 24;
163
+ c[2] = c[2] ^ s[11] << 24;
164
164
  case 11:
165
- s[2] = s[2] ^ c[10] << 16;
165
+ c[2] = c[2] ^ s[10] << 16;
166
166
  case 10:
167
- s[2] = s[2] ^ c[9] << 8;
167
+ c[2] = c[2] ^ s[9] << 8;
168
168
  case 9:
169
- s[2] = s[2] ^ c[8] << 0, s[2] = Math.imul(s[2], m[2]), s[2] = g(s[2], 17), s[2] = Math.imul(s[2], m[3]), t[2] = t[2] ^ s[2];
169
+ c[2] = c[2] ^ s[8] << 0, c[2] = Math.imul(c[2], m[2]), c[2] = g(c[2], 17), c[2] = Math.imul(c[2], m[3]), t[2] = t[2] ^ c[2];
170
170
  case 8:
171
- s[1] = s[1] ^ c[7] << 24;
171
+ c[1] = c[1] ^ s[7] << 24;
172
172
  case 7:
173
- s[1] = s[1] ^ c[6] << 16;
173
+ c[1] = c[1] ^ s[6] << 16;
174
174
  case 6:
175
- s[1] = s[1] ^ c[5] << 8;
175
+ c[1] = c[1] ^ s[5] << 8;
176
176
  case 5:
177
- s[1] = s[1] ^ c[4] << 0, s[1] = Math.imul(s[1], m[1]), s[1] = g(s[1], 16), s[1] = Math.imul(s[1], m[2]), t[1] = t[1] ^ s[1];
177
+ c[1] = c[1] ^ s[4] << 0, c[1] = Math.imul(c[1], m[1]), c[1] = g(c[1], 16), c[1] = Math.imul(c[1], m[2]), t[1] = t[1] ^ c[1];
178
178
  case 4:
179
- s[0] = s[0] ^ c[3] << 24;
179
+ c[0] = c[0] ^ s[3] << 24;
180
180
  case 3:
181
- s[0] = s[0] ^ c[2] << 16;
181
+ c[0] = c[0] ^ s[2] << 16;
182
182
  case 2:
183
- s[0] = s[0] ^ c[1] << 8;
183
+ c[0] = c[0] ^ s[1] << 8;
184
184
  case 1:
185
- s[0] = s[0] ^ c[0] << 0, s[0] = Math.imul(s[0], m[0]), s[0] = g(s[0], 15), s[0] = Math.imul(s[0], m[1]), t[0] = t[0] ^ s[0];
185
+ c[0] = c[0] ^ s[0] << 0, c[0] = Math.imul(c[0], m[0]), c[0] = g(c[0], 15), c[0] = Math.imul(c[0], m[1]), t[0] = t[0] ^ c[0];
186
186
  }
187
187
  }(a, r), function(o, t) {
188
- t[0] = t[0] ^ o.byteLength, t[1] = t[1] ^ o.byteLength, t[2] = t[2] ^ o.byteLength, t[3] = t[3] ^ o.byteLength, t[0] = t[0] + t[1] | 0, t[0] = t[0] + t[2] | 0, t[0] = t[0] + t[3] | 0, t[1] = t[1] + t[0] | 0, t[2] = t[2] + t[0] | 0, t[3] = t[3] + t[0] | 0, t[0] = C(t[0]), t[1] = C(t[1]), t[2] = C(t[2]), t[3] = C(t[3]), t[0] = t[0] + t[1] | 0, t[0] = t[0] + t[2] | 0, t[0] = t[0] + t[3] | 0, t[1] = t[1] + t[0] | 0, t[2] = t[2] + t[0] | 0, t[3] = t[3] + t[0] | 0;
188
+ t[0] = t[0] ^ o.byteLength, t[1] = t[1] ^ o.byteLength, t[2] = t[2] ^ o.byteLength, t[3] = t[3] ^ o.byteLength, t[0] = t[0] + t[1] | 0, t[0] = t[0] + t[2] | 0, t[0] = t[0] + t[3] | 0, t[1] = t[1] + t[0] | 0, t[2] = t[2] + t[0] | 0, t[3] = t[3] + t[0] | 0, t[0] = T(t[0]), t[1] = T(t[1]), t[2] = T(t[2]), t[3] = T(t[3]), t[0] = t[0] + t[1] | 0, t[0] = t[0] + t[2] | 0, t[0] = t[0] + t[3] | 0, t[1] = t[1] + t[0] | 0, t[2] = t[2] + t[0] | 0, t[3] = t[3] + t[0] | 0;
189
189
  }(a, r);
190
190
  var i = new Uint8Array(r.buffer);
191
191
  return Array.from(i).map(function(o) {
192
192
  return o.toString(16).padStart(2, "0");
193
193
  }).join("");
194
194
  }
195
- function G(a, e) {
195
+ function W(a, e) {
196
196
  return new Promise(function(n) {
197
197
  setTimeout(function() {
198
198
  return n(e);
199
199
  }, a);
200
200
  });
201
201
  }
202
- function W(a, e, n) {
202
+ function V(a, e, n) {
203
203
  return Promise.all(a.map(function(r) {
204
- return Promise.race([r, G(e, n)]);
204
+ return Promise.race([r, W(e, n)]);
205
205
  }));
206
206
  }
207
- function V() {
208
- return y(this, void 0, void 0, function() {
207
+ function $() {
208
+ return w(this, void 0, void 0, function() {
209
209
  var a, e, n, r, i;
210
- return w(this, function(o) {
210
+ return y(this, function(o) {
211
211
  switch (o.label) {
212
212
  case 0:
213
- return o.trys.push([0, 2, , 3]), a = j(), e = Object.keys(a), [4, W(Object.values(a), (S == null ? void 0 : S.timeout) || 1e3, N)];
213
+ return o.trys.push([0, 2, , 3]), a = G(), e = Object.keys(a), [4, V(Object.values(a), (S == null ? void 0 : S.timeout) || 1e3, j)];
214
214
  case 1:
215
215
  return n = o.sent(), r = n.filter(function(t) {
216
216
  return t !== void 0;
217
217
  }), i = {}, r.forEach(function(t, u) {
218
218
  i[e[u]] = t;
219
- }), [2, D(i, S.exclude || [])];
219
+ }), [2, U(i, S.exclude || [])];
220
220
  case 2:
221
221
  throw o.sent();
222
222
  case 3:
@@ -225,14 +225,14 @@ function V() {
225
225
  });
226
226
  });
227
227
  }
228
- function D(a, e) {
228
+ function U(a, e) {
229
229
  var n = {}, r = function(o) {
230
230
  if (a.hasOwnProperty(o)) {
231
231
  var t = a[o];
232
232
  if (typeof t != "object" || Array.isArray(t)) e.includes(o) || (n[o] = t);
233
233
  else {
234
- var u = D(t, e.map(function(l) {
235
- return l.startsWith(o + ".") ? l.slice(o.length + 1) : l;
234
+ var u = U(t, e.map(function(h) {
235
+ return h.startsWith(o + ".") ? h.slice(o.length + 1) : h;
236
236
  }));
237
237
  Object.keys(u).length > 0 && (n[o] = u);
238
238
  }
@@ -241,15 +241,15 @@ function D(a, e) {
241
241
  for (var i in a) r(i);
242
242
  return n;
243
243
  }
244
- function $(a) {
245
- return y(this, void 0, void 0, function() {
244
+ function z(a) {
245
+ return w(this, void 0, void 0, function() {
246
246
  var e, n;
247
- return w(this, function(r) {
247
+ return y(this, function(r) {
248
248
  switch (r.label) {
249
249
  case 0:
250
- return r.trys.push([0, 2, , 3]), [4, V()];
250
+ return r.trys.push([0, 2, , 3]), [4, $()];
251
251
  case 1:
252
- return e = r.sent(), n = _(JSON.stringify(e)), [2, n.toString()];
252
+ return e = r.sent(), n = I(JSON.stringify(e)), [2, n.toString()];
253
253
  case 2:
254
254
  throw r.sent();
255
255
  case 3:
@@ -258,19 +258,19 @@ function $(a) {
258
258
  });
259
259
  });
260
260
  }
261
- function z(a) {
261
+ function H(a) {
262
262
  for (var e = 0, n = 0; n < a.length; ++n) e += Math.abs(a[n]);
263
263
  return e;
264
264
  }
265
- function U(a, e, n) {
265
+ function L(a, e, n) {
266
266
  for (var r = [], i = 0; i < a[0].data.length; i++) {
267
267
  for (var o = [], t = 0; t < a.length; t++) o.push(a[t].data[i]);
268
- r.push(H(o));
268
+ r.push(Q(o));
269
269
  }
270
270
  var u = new Uint8ClampedArray(r);
271
271
  return new ImageData(u, e, n);
272
272
  }
273
- function H(a) {
273
+ function Q(a) {
274
274
  if (a.length === 0) return 0;
275
275
  for (var e = {}, n = 0, r = a; n < r.length; n++)
276
276
  e[o = r[n]] = (e[o] || 0) + 1;
@@ -278,7 +278,7 @@ function H(a) {
278
278
  for (var o in e) e[o] > e[i] && (i = parseInt(o, 10));
279
279
  return i;
280
280
  }
281
- function E() {
281
+ function C() {
282
282
  if (typeof navigator > "u") return { name: "unknown", version: "unknown" };
283
283
  for (var a = navigator.userAgent, e = { Edg: "Edge", OPR: "Opera" }, n = 0, r = [/(?<name>Edge|Edg)\/(?<version>\d+(?:\.\d+)?)/, /(?<name>(?:Chrome|Chromium|OPR|Opera|Vivaldi|Brave))\/(?<version>\d+(?:\.\d+)?)/, /(?<name>(?:Firefox|Waterfox|Iceweasel|IceCat))\/(?<version>\d+(?:\.\d+)?)/, /(?<name>Safari)\/(?<version>\d+(?:\.\d+)?)/, /(?<name>MSIE|Trident|IEMobile).+?(?<version>\d+(?:\.\d+)?)/, /(?<name>[A-Za-z]+)\/(?<version>\d+(?:\.\d+)?)/, /(?<name>SamsungBrowser)\/(?<version>\d+(?:\.\d+)?)/]; n < r.length; n++) {
284
284
  var i = r[n], o = a.match(i);
@@ -287,31 +287,31 @@ function E() {
287
287
  return { name: "unknown", version: "unknown" };
288
288
  }
289
289
  v("audio", function() {
290
- return y(this, void 0, void 0, function() {
291
- return w(this, function(a) {
290
+ return w(this, void 0, void 0, function() {
291
+ return y(this, function(a) {
292
292
  return [2, new Promise(function(e, n) {
293
293
  try {
294
294
  var r = new (window.OfflineAudioContext || window.webkitOfflineAudioContext)(1, 5e3, 44100), i = r.createBufferSource(), o = r.createOscillator();
295
295
  o.frequency.value = 1e3;
296
296
  var t, u = r.createDynamicsCompressor();
297
- u.threshold.value = -50, u.knee.value = 40, u.ratio.value = 12, u.attack.value = 0, u.release.value = 0.2, o.connect(u), u.connect(r.destination), o.start(), r.oncomplete = function(l) {
298
- t = l.renderedBuffer.getChannelData(0), e({ sampleHash: z(t), oscillator: o.type, maxChannels: r.destination.maxChannelCount, channelCountMode: i.channelCountMode });
297
+ u.threshold.value = -50, u.knee.value = 40, u.ratio.value = 12, u.attack.value = 0, u.release.value = 0.2, o.connect(u), u.connect(r.destination), o.start(), r.oncomplete = function(h) {
298
+ t = h.renderedBuffer.getChannelData(0), e({ sampleHash: H(t), oscillator: o.type, maxChannels: r.destination.maxChannelCount, channelCountMode: i.channelCountMode });
299
299
  }, r.startRendering();
300
- } catch (l) {
301
- console.error("Error creating audio fingerprint:", l), n(l);
300
+ } catch (h) {
301
+ console.error("Error creating audio fingerprint:", h), n(h);
302
302
  }
303
303
  })];
304
304
  });
305
305
  });
306
306
  });
307
- var Q = E().name !== "SamsungBrowser" ? 1 : 3, P = 280, x = 20;
308
- E().name != "Firefox" && v("canvas", function() {
307
+ var K = C().name !== "SamsungBrowser" ? 1 : 3, P = 280, k = 20;
308
+ C().name != "Firefox" && v("canvas", function() {
309
309
  return document.createElement("canvas").getContext("2d"), new Promise(function(a) {
310
- var e = Array.from({ length: Q }, function() {
310
+ var e = Array.from({ length: K }, function() {
311
311
  return function() {
312
312
  var n = document.createElement("canvas"), r = n.getContext("2d");
313
313
  if (!r) return new ImageData(1, 1);
314
- n.width = P, n.height = x;
314
+ n.width = P, n.height = k;
315
315
  var i = r.createLinearGradient(0, 0, n.width, n.height);
316
316
  i.addColorStop(0, "red"), i.addColorStop(0.16666666666666666, "orange"), i.addColorStop(0.3333333333333333, "yellow"), i.addColorStop(0.5, "green"), i.addColorStop(0.6666666666666666, "blue"), i.addColorStop(0.8333333333333334, "indigo"), i.addColorStop(1, "violet"), r.fillStyle = i, r.fillRect(0, 0, n.width, n.height);
317
317
  var o = "Random Text WMwmil10Oo";
@@ -320,23 +320,23 @@ E().name != "Firefox" && v("canvas", function() {
320
320
  return t;
321
321
  }();
322
322
  });
323
- a({ commonImageDataHash: _(U(e, P, x).data.toString()).toString() });
323
+ a({ commonImageDataHash: I(L(e, P, k).data.toString()).toString() });
324
324
  });
325
325
  });
326
- var A, K = ["Arial", "Arial Black", "Arial Narrow", "Arial Rounded MT", "Arimo", "Archivo", "Barlow", "Bebas Neue", "Bitter", "Bookman", "Calibri", "Cabin", "Candara", "Century", "Century Gothic", "Comic Sans MS", "Constantia", "Courier", "Courier New", "Crimson Text", "DM Mono", "DM Sans", "DM Serif Display", "DM Serif Text", "Dosis", "Droid Sans", "Exo", "Fira Code", "Fira Sans", "Franklin Gothic Medium", "Garamond", "Geneva", "Georgia", "Gill Sans", "Helvetica", "Impact", "Inconsolata", "Indie Flower", "Inter", "Josefin Sans", "Karla", "Lato", "Lexend", "Lucida Bright", "Lucida Console", "Lucida Sans Unicode", "Manrope", "Merriweather", "Merriweather Sans", "Montserrat", "Myriad", "Noto Sans", "Nunito", "Nunito Sans", "Open Sans", "Optima", "Orbitron", "Oswald", "Pacifico", "Palatino", "Perpetua", "PT Sans", "PT Serif", "Poppins", "Prompt", "Public Sans", "Quicksand", "Rajdhani", "Recursive", "Roboto", "Roboto Condensed", "Rockwell", "Rubik", "Segoe Print", "Segoe Script", "Segoe UI", "Sora", "Source Sans Pro", "Space Mono", "Tahoma", "Taviraj", "Times", "Times New Roman", "Titillium Web", "Trebuchet MS", "Ubuntu", "Varela Round", "Verdana", "Work Sans"], J = ["monospace", "sans-serif", "serif"];
327
- function k(a, e) {
326
+ var A, X = ["Arial", "Arial Black", "Arial Narrow", "Arial Rounded MT", "Arimo", "Archivo", "Barlow", "Bebas Neue", "Bitter", "Bookman", "Calibri", "Cabin", "Candara", "Century", "Century Gothic", "Comic Sans MS", "Constantia", "Courier", "Courier New", "Crimson Text", "DM Mono", "DM Sans", "DM Serif Display", "DM Serif Text", "Dosis", "Droid Sans", "Exo", "Fira Code", "Fira Sans", "Franklin Gothic Medium", "Garamond", "Geneva", "Georgia", "Gill Sans", "Helvetica", "Impact", "Inconsolata", "Indie Flower", "Inter", "Josefin Sans", "Karla", "Lato", "Lexend", "Lucida Bright", "Lucida Console", "Lucida Sans Unicode", "Manrope", "Merriweather", "Merriweather Sans", "Montserrat", "Myriad", "Noto Sans", "Nunito", "Nunito Sans", "Open Sans", "Optima", "Orbitron", "Oswald", "Pacifico", "Palatino", "Perpetua", "PT Sans", "PT Serif", "Poppins", "Prompt", "Public Sans", "Quicksand", "Rajdhani", "Recursive", "Roboto", "Roboto Condensed", "Rockwell", "Rubik", "Segoe Print", "Segoe Script", "Segoe UI", "Sora", "Source Sans Pro", "Space Mono", "Tahoma", "Taviraj", "Times", "Times New Roman", "Titillium Web", "Trebuchet MS", "Ubuntu", "Varela Round", "Verdana", "Work Sans"], J = ["monospace", "sans-serif", "serif"];
327
+ function F(a, e) {
328
328
  if (!a) throw new Error("Canvas context not supported");
329
329
  return a.font = "72px ".concat(e), a.measureText("WwMmLli0Oo").width;
330
330
  }
331
- function X() {
331
+ function Y() {
332
332
  var a, e = document.createElement("canvas"), n = (a = e.getContext("webgl")) !== null && a !== void 0 ? a : e.getContext("experimental-webgl");
333
333
  if (n && "getParameter" in n) try {
334
334
  var r = (n.getParameter(n.VENDOR) || "").toString(), i = (n.getParameter(n.RENDERER) || "").toString(), o = { vendor: r, renderer: i, version: (n.getParameter(n.VERSION) || "").toString(), shadingLanguageVersion: (n.getParameter(n.SHADING_LANGUAGE_VERSION) || "").toString() };
335
335
  if (!i.length || !r.length) {
336
336
  var t = n.getExtension("WEBGL_debug_renderer_info");
337
337
  if (t) {
338
- var u = (n.getParameter(t.UNMASKED_VENDOR_WEBGL) || "").toString(), l = (n.getParameter(t.UNMASKED_RENDERER_WEBGL) || "").toString();
339
- u && (o.vendorUnmasked = u), l && (o.rendererUnmasked = l);
338
+ var u = (n.getParameter(t.UNMASKED_VENDOR_WEBGL) || "").toString(), h = (n.getParameter(t.UNMASKED_RENDERER_WEBGL) || "").toString();
339
+ u && (o.vendorUnmasked = u), h && (o.rendererUnmasked = h);
340
340
  }
341
341
  }
342
342
  return o;
@@ -344,23 +344,23 @@ function X() {
344
344
  }
345
345
  return "undefined";
346
346
  }
347
- function Y() {
347
+ function Z() {
348
348
  var a = new Float32Array(1), e = new Uint8Array(a.buffer);
349
349
  return a[0] = 1 / 0, a[0] = a[0] - a[0], e[3];
350
350
  }
351
- function Z(a, e) {
351
+ function ee(a, e) {
352
352
  var n = {};
353
353
  return e.forEach(function(r) {
354
354
  var i = function(o) {
355
355
  if (o.length === 0) return null;
356
356
  var t = {};
357
- o.forEach(function(s) {
358
- var c = String(s);
359
- t[c] = (t[c] || 0) + 1;
357
+ o.forEach(function(c) {
358
+ var s = String(c);
359
+ t[s] = (t[s] || 0) + 1;
360
360
  });
361
- var u = o[0], l = 1;
362
- return Object.keys(t).forEach(function(s) {
363
- t[s] > l && (u = s, l = t[s]);
361
+ var u = o[0], h = 1;
362
+ return Object.keys(t).forEach(function(c) {
363
+ t[c] > h && (u = c, h = t[c]);
364
364
  }), u;
365
365
  }(a.map(function(o) {
366
366
  return r in o ? o[r] : void 0;
@@ -370,7 +370,7 @@ function Z(a, e) {
370
370
  i && (n[r] = i);
371
371
  }), n;
372
372
  }
373
- function ee() {
373
+ function te() {
374
374
  var a = [], e = { "prefers-contrast": ["high", "more", "low", "less", "forced", "no-preference"], "any-hover": ["hover", "none"], "any-pointer": ["none", "coarse", "fine"], pointer: ["none", "coarse", "fine"], hover: ["hover", "none"], update: ["fast", "slow"], "inverted-colors": ["inverted", "none"], "prefers-reduced-motion": ["reduce", "no-preference"], "prefers-reduced-transparency": ["reduce", "no-preference"], scripting: ["none", "initial-only", "enabled"], "forced-colors": ["active", "none"] };
375
375
  return Object.keys(e).forEach(function(n) {
376
376
  e[n].forEach(function(r) {
@@ -378,7 +378,7 @@ function ee() {
378
378
  });
379
379
  }), a;
380
380
  }
381
- function te() {
381
+ function ne() {
382
382
  if (window.location.protocol === "https:" && typeof window.ApplePaySession == "function") try {
383
383
  for (var a = window.ApplePaySession.supportsVersion, e = 15; e > 0; e--) if (a(e)) return e;
384
384
  } catch {
@@ -386,42 +386,42 @@ function te() {
386
386
  }
387
387
  return 0;
388
388
  }
389
- E().name != "Firefox" && v("fonts", function() {
389
+ C().name != "Firefox" && v("fonts", function() {
390
390
  var a = this;
391
391
  return new Promise(function(e, n) {
392
392
  try {
393
393
  (function(r) {
394
394
  var i;
395
- y(this, void 0, void 0, function() {
395
+ w(this, void 0, void 0, function() {
396
396
  var o, t, u;
397
- return w(this, function(l) {
398
- switch (l.label) {
397
+ return y(this, function(h) {
398
+ switch (h.label) {
399
399
  case 0:
400
- return document.body ? [3, 2] : [4, (s = 50, new Promise(function(p) {
401
- return setTimeout(p, s, c);
400
+ return document.body ? [3, 2] : [4, (c = 50, new Promise(function(p) {
401
+ return setTimeout(p, c, s);
402
402
  }))];
403
403
  case 1:
404
- return l.sent(), [3, 0];
404
+ return h.sent(), [3, 0];
405
405
  case 2:
406
406
  if ((o = document.createElement("iframe")).setAttribute("frameBorder", "0"), (t = o.style).setProperty("position", "fixed"), t.setProperty("display", "block", "important"), t.setProperty("visibility", "visible"), t.setProperty("border", "0"), t.setProperty("opacity", "0"), o.src = "about:blank", document.body.appendChild(o), !(u = o.contentDocument || ((i = o.contentWindow) === null || i === void 0 ? void 0 : i.document))) throw new Error("Iframe document is not accessible");
407
407
  return r({ iframe: u }), setTimeout(function() {
408
408
  document.body.removeChild(o);
409
409
  }, 0), [2];
410
410
  }
411
- var s, c;
411
+ var c, s;
412
412
  });
413
413
  });
414
414
  })(function(r) {
415
415
  var i = r.iframe;
416
- return y(a, void 0, void 0, function() {
417
- var o, t, u, l;
418
- return w(this, function(s) {
419
- return o = i.createElement("canvas"), t = o.getContext("2d"), u = J.map(function(c) {
420
- return k(t, c);
421
- }), l = {}, K.forEach(function(c) {
422
- var p = k(t, c);
423
- u.includes(p) || (l[c] = p);
424
- }), e(l), [2];
416
+ return w(a, void 0, void 0, function() {
417
+ var o, t, u, h;
418
+ return y(this, function(c) {
419
+ return o = i.createElement("canvas"), t = o.getContext("2d"), u = J.map(function(s) {
420
+ return F(t, s);
421
+ }), h = {}, X.forEach(function(s) {
422
+ var p = F(t, s);
423
+ u.includes(p) || (h[s] = p);
424
+ }), e(h), [2];
425
425
  });
426
426
  });
427
427
  });
@@ -432,21 +432,21 @@ E().name != "Firefox" && v("fonts", function() {
432
432
  }), v("hardware", function() {
433
433
  return new Promise(function(a, e) {
434
434
  var n = navigator.deviceMemory !== void 0 ? navigator.deviceMemory : 0, r = window.performance && window.performance.memory ? window.performance.memory : 0;
435
- a({ videocard: X(), architecture: Y(), deviceMemory: n.toString() || "undefined", jsHeapSizeLimit: r.jsHeapSizeLimit || 0 });
435
+ a({ videocard: Y(), architecture: Z(), deviceMemory: n.toString() || "undefined", jsHeapSizeLimit: r.jsHeapSizeLimit || 0 });
436
436
  });
437
437
  }), v("locales", function() {
438
438
  return new Promise(function(a) {
439
439
  a({ languages: navigator.language, timezone: Intl.DateTimeFormat().resolvedOptions().timeZone });
440
440
  });
441
441
  }), v("permissions", function() {
442
- return y(this, void 0, void 0, function() {
442
+ return w(this, void 0, void 0, function() {
443
443
  var a;
444
- return w(this, function(e) {
444
+ return y(this, function(e) {
445
445
  return A = (S == null ? void 0 : S.permissions_to_check) || ["accelerometer", "accessibility", "accessibility-events", "ambient-light-sensor", "background-fetch", "background-sync", "bluetooth", "camera", "clipboard-read", "clipboard-write", "device-info", "display-capture", "gyroscope", "geolocation", "local-fonts", "magnetometer", "microphone", "midi", "nfc", "notifications", "payment-handler", "persistent-storage", "push", "speaker", "storage-access", "top-level-storage-access", "window-management", "query"], a = Array.from({ length: (S == null ? void 0 : S.retries) || 3 }, function() {
446
446
  return function() {
447
- return y(this, void 0, void 0, function() {
447
+ return w(this, void 0, void 0, function() {
448
448
  var n, r, i, o, t;
449
- return w(this, function(u) {
449
+ return y(this, function(u) {
450
450
  switch (u.label) {
451
451
  case 0:
452
452
  n = {}, r = 0, i = A, u.label = 1;
@@ -468,7 +468,7 @@ E().name != "Firefox" && v("fonts", function() {
468
468
  });
469
469
  }();
470
470
  }), [2, Promise.all(a).then(function(n) {
471
- return Z(n, A);
471
+ return ee(n, A);
472
472
  })];
473
473
  });
474
474
  });
@@ -483,23 +483,23 @@ E().name != "Firefox" && v("fonts", function() {
483
483
  });
484
484
  }), v("screen", function() {
485
485
  return new Promise(function(a) {
486
- a({ is_touchscreen: navigator.maxTouchPoints > 0, maxTouchPoints: navigator.maxTouchPoints, colorDepth: screen.colorDepth, mediaMatches: ee() });
486
+ a({ is_touchscreen: navigator.maxTouchPoints > 0, maxTouchPoints: navigator.maxTouchPoints, colorDepth: screen.colorDepth, mediaMatches: te() });
487
487
  });
488
488
  }), v("system", function() {
489
489
  return new Promise(function(a) {
490
- var e = E();
491
- a({ platform: window.navigator.platform, cookieEnabled: window.navigator.cookieEnabled, productSub: navigator.productSub, product: navigator.product, useragent: navigator.userAgent, hardwareConcurrency: navigator.hardwareConcurrency, browser: { name: e.name, version: e.version }, applePayVersion: te() });
490
+ var e = C();
491
+ a({ platform: window.navigator.platform, cookieEnabled: window.navigator.cookieEnabled, productSub: navigator.productSub, product: navigator.product, useragent: navigator.userAgent, hardwareConcurrency: navigator.hardwareConcurrency, browser: { name: e.name, version: e.version }, applePayVersion: ne() });
492
492
  });
493
493
  });
494
- var f, ne = E().name !== "SamsungBrowser" ? 1 : 3, d = null;
494
+ var f, re = C().name !== "SamsungBrowser" ? 1 : 3, d = null;
495
495
  v("webgl", function() {
496
- return y(this, void 0, void 0, function() {
496
+ return w(this, void 0, void 0, function() {
497
497
  var a;
498
- return w(this, function(e) {
498
+ return y(this, function(e) {
499
499
  typeof document < "u" && ((f = document.createElement("canvas")).width = 200, f.height = 100, d = f.getContext("webgl"));
500
500
  try {
501
501
  if (!d) throw new Error("WebGL not supported");
502
- return a = Array.from({ length: ne }, function() {
502
+ return a = Array.from({ length: re }, function() {
503
503
  return function() {
504
504
  try {
505
505
  if (!d) throw new Error("WebGL not supported");
@@ -521,23 +521,23 @@ v("webgl", function() {
521
521
  if (!t) throw new Error("Failed to create shader program");
522
522
  if (d.attachShader(t, i), d.attachShader(t, o), d.linkProgram(t), !d.getProgramParameter(t, d.LINK_STATUS)) throw new Error("Shader program linking failed: " + d.getProgramInfoLog(t));
523
523
  d.useProgram(t);
524
- for (var u = 137, l = new Float32Array(4 * u), s = 2 * Math.PI / u, c = 0; c < u; c++) {
525
- var p = c * s;
526
- l[4 * c] = 0, l[4 * c + 1] = 0, l[4 * c + 2] = Math.cos(p) * (f.width / 2), l[4 * c + 3] = Math.sin(p) * (f.height / 2);
524
+ for (var u = 137, h = new Float32Array(4 * u), c = 2 * Math.PI / u, s = 0; s < u; s++) {
525
+ var p = s * c;
526
+ h[4 * s] = 0, h[4 * s + 1] = 0, h[4 * s + 2] = Math.cos(p) * (f.width / 2), h[4 * s + 3] = Math.sin(p) * (f.height / 2);
527
527
  }
528
- var L = d.createBuffer();
529
- d.bindBuffer(d.ARRAY_BUFFER, L), d.bufferData(d.ARRAY_BUFFER, l, d.STATIC_DRAW);
530
- var I = d.getAttribLocation(t, "position");
531
- d.enableVertexAttribArray(I), d.vertexAttribPointer(I, 2, d.FLOAT, !1, 0, 0), d.viewport(0, 0, f.width, f.height), d.clearColor(0, 0, 0, 1), d.clear(d.COLOR_BUFFER_BIT), d.drawArrays(d.LINES, 0, 2 * u);
532
- var R = new Uint8ClampedArray(f.width * f.height * 4);
533
- return d.readPixels(0, 0, f.width, f.height, d.RGBA, d.UNSIGNED_BYTE, R), new ImageData(R, f.width, f.height);
528
+ var q = d.createBuffer();
529
+ d.bindBuffer(d.ARRAY_BUFFER, q), d.bufferData(d.ARRAY_BUFFER, h, d.STATIC_DRAW);
530
+ var R = d.getAttribLocation(t, "position");
531
+ d.enableVertexAttribArray(R), d.vertexAttribPointer(R, 2, d.FLOAT, !1, 0, 0), d.viewport(0, 0, f.width, f.height), d.clearColor(0, 0, 0, 1), d.clear(d.COLOR_BUFFER_BIT), d.drawArrays(d.LINES, 0, 2 * u);
532
+ var x = new Uint8ClampedArray(f.width * f.height * 4);
533
+ return d.readPixels(0, 0, f.width, f.height, d.RGBA, d.UNSIGNED_BYTE, x), new ImageData(x, f.width, f.height);
534
534
  } catch {
535
535
  return new ImageData(1, 1);
536
536
  } finally {
537
537
  d && (d.bindBuffer(d.ARRAY_BUFFER, null), d.useProgram(null), d.viewport(0, 0, d.drawingBufferWidth, d.drawingBufferHeight), d.clearColor(0, 0, 0, 0));
538
538
  }
539
539
  }();
540
- }), [2, { commonImageHash: _(U(a, f.width, f.height).data.toString()).toString() }];
540
+ }), [2, { commonImageHash: I(L(a, f.width, f.height).data.toString()).toString() }];
541
541
  } catch {
542
542
  return [2, { webgl: "unsupported" }];
543
543
  }
@@ -551,22 +551,22 @@ var b = function(a, e, n, r) {
551
551
  return o * i;
552
552
  };
553
553
  v("math", function() {
554
- return y(void 0, void 0, void 0, function() {
555
- return w(this, function(a) {
554
+ return w(void 0, void 0, void 0, function() {
555
+ return y(this, function(a) {
556
556
  return [2, { acos: Math.acos(0.5), asin: b(Math.asin, -1, 1, 97), atan: b(Math.atan, -1, 1, 97), cos: b(Math.cos, 0, Math.PI, 97), cosh: Math.cosh(9 / 7), e: Math.E, largeCos: Math.cos(1e20), largeSin: Math.sin(1e20), largeTan: Math.tan(1e20), log: Math.log(1e3), pi: Math.PI, sin: b(Math.sin, -Math.PI, Math.PI, 97), sinh: b(Math.sinh, -9 / 7, 7 / 9, 97), sqrt: Math.sqrt(2), tan: b(Math.tan, 0, 2 * Math.PI, 97), tanh: b(Math.tanh, -9 / 7, 7 / 9, 97) }];
557
557
  });
558
558
  });
559
559
  });
560
- const re = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
561
- let T = (a = 21) => {
560
+ const ae = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
561
+ let E = (a = 21) => {
562
562
  let e = "", n = crypto.getRandomValues(new Uint8Array(a |= 0));
563
563
  for (; a--; )
564
- e += re[n[a] & 63];
564
+ e += ae[n[a] & 63];
565
565
  return e;
566
566
  };
567
567
  class M {
568
568
  constructor(e) {
569
- h(this, "config");
569
+ l(this, "config");
570
570
  this.config = e;
571
571
  }
572
572
  async getAds(e) {
@@ -583,7 +583,7 @@ class M {
583
583
  async onAdContainerViewed(e) {
584
584
  }
585
585
  }
586
- class ae extends M {
586
+ class oe extends M {
587
587
  /**
588
588
  * Gets ads from the adMarketplace API based on the search term.
589
589
  */
@@ -599,17 +599,17 @@ class ae extends M {
599
599
  "results-ta": `${this.config.admTextAdQuantity || 0}`,
600
600
  "results-pa": `${this.config.admProductAdQuantity || 0}`
601
601
  }).toString()}`, o = await (await fetch(r, { method: "GET" })).json(), t = o.product_ads.map(
602
- (s) => ({
603
- id: T(),
602
+ (c) => ({
603
+ id: E(),
604
604
  adSource: "adMarketplace",
605
605
  admAdType: "adm-product-ad",
606
- admAd: s
606
+ admAd: c
607
607
  })
608
- ), u = o.text_ads.map((s) => ({
609
- id: T(),
608
+ ), u = o.text_ads.map((c) => ({
609
+ id: E(),
610
610
  adSource: "adMarketplace",
611
611
  admAdType: "adm-text-ad",
612
- admAd: s
612
+ admAd: c
613
613
  }));
614
614
  return t.concat(u);
615
615
  }
@@ -619,16 +619,16 @@ class ae extends M {
619
619
  (r = n.admAd) != null && r.impression_url && fetch(n.admAd.impression_url);
620
620
  }
621
621
  }
622
- class oe extends M {
622
+ class ie extends M {
623
623
  async getAds(e) {
624
624
  return [];
625
625
  }
626
626
  }
627
- const ie = 1e3;
628
- class se extends M {
627
+ const se = 1e3;
628
+ class ce extends M {
629
629
  constructor(n) {
630
630
  super(n);
631
- h(this, "adCallTimeout");
631
+ l(this, "adCallTimeout");
632
632
  this.addScriptTagToDocument();
633
633
  }
634
634
  async onQuerySubmitted(n) {
@@ -640,7 +640,7 @@ class se extends M {
640
640
  this.removeScriptTagFromDocument();
641
641
  return;
642
642
  }
643
- this.performAdCall(ie);
643
+ this.performAdCall(se);
644
644
  }
645
645
  async onInputCleared() {
646
646
  this.removeScriptTagFromDocument();
@@ -669,15 +669,15 @@ class se extends M {
669
669
  n && document.head.removeChild(n);
670
670
  }
671
671
  }
672
- const ce = 600;
673
- class ue {
672
+ const ue = 600;
673
+ class de {
674
674
  constructor(e, n, r) {
675
- h(this, "measureRequestTimeout");
676
- h(this, "measureRequestsBatched", []);
677
- h(this, "config");
678
- h(this, "sdkInfo");
679
- h(this, "userId");
680
- h(this, "sessionId");
675
+ l(this, "measureRequestTimeout");
676
+ l(this, "measureRequestsBatched", []);
677
+ l(this, "config");
678
+ l(this, "sdkInfo");
679
+ l(this, "userId");
680
+ l(this, "sessionId");
681
681
  /**
682
682
  * Sends a measure event to the `/measure/event` endpoint for analytics purposes.
683
683
  *
@@ -685,7 +685,7 @@ class ue {
685
685
  * @param {Partial<MeasureRequestProperties>} properties - Additional properties to send with the event.
686
686
  * @param {Partial<MeasureRequestUser>} user - Additional user properites to send with the event.
687
687
  */
688
- h(this, "sendMeasureEvent", async (e, n = {}, r = {}) => {
688
+ l(this, "sendMeasureEvent", async (e, n = {}, r = {}) => {
689
689
  const i = {
690
690
  event_name: e,
691
691
  properties: {
@@ -706,7 +706,8 @@ class ue {
706
706
  headers: {
707
707
  "Content-Type": "application/json",
708
708
  Authorization: this.config.readKey,
709
- "X-Sc-User-Id": this.userId
709
+ "X-Sc-User-Id": this.userId,
710
+ "X-Sc-Session-Id": this.sessionId
710
711
  },
711
712
  body: o,
712
713
  keepalive: !0
@@ -727,7 +728,8 @@ class ue {
727
728
  headers: {
728
729
  "Content-Type": "application/json",
729
730
  Authorization: this.config.readKey,
730
- "X-Sc-User-Id": this.userId
731
+ "X-Sc-User-Id": this.userId,
732
+ "X-Sc-Session-Id": this.sessionId
731
733
  },
732
734
  body: o,
733
735
  keepalive: !0
@@ -740,9 +742,9 @@ class ue {
740
742
  } catch (u) {
741
743
  throw this.measureRequestsBatched = [], console.error("Error sending MeasureRequest:", u), u;
742
744
  }
743
- }, ce);
745
+ }, ue);
744
746
  });
745
- this.config = e, this.sdkInfo = n, this.userId = r, this.sessionId = T(), this.sendMeasureEvent("sdk_initialized");
747
+ this.config = e, this.sdkInfo = n, this.userId = r, this.sessionId = E(), this.sendMeasureEvent("sdk_initialized");
746
748
  }
747
749
  /**
748
750
  * Getter for the base url used by the /measure endpoints.
@@ -765,7 +767,7 @@ class ue {
765
767
  };
766
768
  }
767
769
  }
768
- const de = (a) => a.endsWith("/") ? a.slice(0, -1) : a, le = (a) => {
770
+ const he = (a) => a.endsWith("/") ? a.slice(0, -1) : a, _ = (a) => {
769
771
  let e = "";
770
772
  if (e = a.trim(), e = e.replace(/[‘’“”]/g, (r) => ({
771
773
  "‘": "'",
@@ -777,20 +779,20 @@ const de = (a) => a.endsWith("/") ? a.slice(0, -1) : a, le = (a) => {
777
779
  "The search term contains an uneven number of quote characters."
778
780
  );
779
781
  return e;
780
- }, he = 500;
782
+ }, le = 500;
781
783
  class me {
782
784
  constructor(e, n, r) {
783
- h(this, "config");
784
- h(this, "userId");
785
- h(this, "parent");
786
- h(this, "searchCompletedEventTimeout");
785
+ l(this, "config");
786
+ l(this, "userId");
787
+ l(this, "parent");
788
+ l(this, "searchCompletedEventTimeout");
787
789
  /**
788
790
  * Make the request to get the search results.
789
791
  * @param {properties} properties - The properties for the search.
790
792
  * @returns
791
793
  */
792
- h(this, "getSearchResponseItems", async (e) => {
793
- var i, o, t, u, l;
794
+ l(this, "getSearchResponseItems", async (e) => {
795
+ var i, o, t, u, h;
794
796
  let n;
795
797
  const r = typeof e == "string" ? e : e.searchTerm;
796
798
  try {
@@ -807,32 +809,32 @@ class me {
807
809
  search_term: r,
808
810
  number_of_documents: n.data.count
809
811
  }), clearTimeout(this.searchCompletedEventTimeout), this.searchCompletedEventTimeout = setTimeout(() => {
810
- var s;
811
- (s = this.parent.measureClient) == null || s.sendMeasureEvent("search_completed", {
812
+ var c;
813
+ (c = this.parent.measureClient) == null || c.sendMeasureEvent("search_completed", {
812
814
  search_term: r,
813
815
  number_of_documents: n.data.count
814
816
  });
815
- }, he), this.parent.emitEvent("query_fetched", {
817
+ }, le), this.parent.emitEvent("query_fetched", {
816
818
  name: "query_fetched",
817
819
  data: {
818
820
  searchTerm: r
819
821
  }
820
822
  }), (((u = n.data.hits) == null ? void 0 : u.length) || 0) === 0 && this.parent.emitEvent("no_results_returned", {
821
823
  name: "no_results_returned"
822
- }), (l = this.parent.adClient) == null || l.onQueryFetched(
824
+ }), (h = this.parent.adClient) == null || h.onQueryFetched(
823
825
  typeof e == "string" ? { searchTerm: r, mode: "exact" } : e,
824
826
  n
825
827
  ), n;
826
- } catch (s) {
827
- throw console.error("Error parsing response:", s), s;
828
+ } catch (c) {
829
+ throw console.error("Error parsing response:", c), c;
828
830
  }
829
831
  });
830
- h(this, "handleGetSearchResponseItemsWithString", async (e) => {
832
+ l(this, "handleGetSearchResponseItemsWithString", async (e) => {
833
+ var i;
831
834
  let n;
832
835
  try {
833
836
  n = JSON.parse(e), n = {
834
837
  limit: this.config.searchResultsPerPage,
835
- order_by: this.config.indexFieldName,
836
838
  ...n
837
839
  };
838
840
  } catch {
@@ -843,7 +845,8 @@ class me {
843
845
  headers: {
844
846
  Authorization: this.config.readKey,
845
847
  "Content-Type": "application/json",
846
- "X-Sc-User-Id": this.userId
848
+ "X-Sc-User-Id": this.userId,
849
+ "X-Sc-Session-Id": ((i = this.parent.measureClient) == null ? void 0 : i.sessionId) || E()
847
850
  },
848
851
  body: JSON.stringify(n)
849
852
  });
@@ -853,33 +856,36 @@ class me {
853
856
  );
854
857
  return await r.json();
855
858
  });
856
- h(this, "handleGetSearchResponseItemsWithObject", async (e) => {
859
+ l(this, "handleGetSearchResponseItemsWithObject", async (e) => {
860
+ var n;
857
861
  try {
858
- const n = {
859
- query: this.formatParamsForRequest(e),
860
- offset: e.offset || 0,
861
- // Default to 0 (first page) if not provided
862
- limit: e.limit || this.config.searchResultsPerPage || 20,
863
- // Default to 20 if not provided
864
- order_by: e.order_by || this.config.indexFieldName
865
- };
866
- n.order_by && (n.sort = e.sort === "desc" || e.sort === "asc" ? e.sort : "asc");
867
862
  const r = await fetch(this.baseSearchUrl, {
868
863
  method: "POST",
869
864
  headers: {
870
865
  Authorization: this.config.readKey,
871
866
  "Content-Type": "application/json",
872
- "X-Sc-User-Id": this.userId
867
+ "X-Sc-User-Id": this.userId,
868
+ "X-Sc-Session-Id": ((n = this.parent.measureClient) == null ? void 0 : n.sessionId) || E()
873
869
  },
874
- body: JSON.stringify(n)
870
+ body: JSON.stringify({
871
+ query: this.formatParamsForRequest(e),
872
+ offset: e.offset || 0,
873
+ limit: e.limit || this.config.searchResultsPerPage || 20,
874
+ ...e.order_by && {
875
+ order_by: e.order_by
876
+ },
877
+ ...e.sort && {
878
+ sort: e.sort
879
+ }
880
+ })
875
881
  });
876
882
  if (!r.ok)
877
883
  throw new Error(
878
884
  `Error: ${r.statusText} (Status: ${r.status})`
879
885
  );
880
886
  return await r.json();
881
- } catch (n) {
882
- throw console.error("Error parsing response:", n), n;
887
+ } catch (r) {
888
+ throw console.error("Error parsing response:", r), r;
883
889
  }
884
890
  });
885
891
  this.parent = e, this.config = n, this.userId = r;
@@ -897,29 +903,32 @@ class me {
897
903
  */
898
904
  formatParamsForRequest(e) {
899
905
  const n = [];
900
- let r = "should";
901
906
  e.facetPathsForIndexFields && Object.keys(e.facetPathsForIndexFields).forEach((o) => {
902
907
  var u;
903
908
  const t = (u = e.facetPathsForIndexFields) == null ? void 0 : u[o];
904
- t && (r = "must", n.push({
905
- occur: r,
909
+ t && n.push({
910
+ occur: "must",
906
911
  exact: {
907
- ctx: le(t.value)
912
+ ctx: _(t.value)
908
913
  }
909
- }));
914
+ });
910
915
  }), e.rangeValueForIndexFields && Object.keys(e.rangeValueForIndexFields).forEach((o) => {
911
916
  var u;
912
917
  const t = (u = e.rangeValueForIndexFields) == null ? void 0 : u[o];
913
- t && (r = "must", n.push({
914
- occur: r,
918
+ t && n.push({
919
+ occur: "must",
915
920
  exact: {
916
- ctx: t.value
921
+ ctx: _(t.value)
917
922
  }
918
- }));
923
+ });
919
924
  });
920
- const i = e.mode === "fuzzy" ? { fuzzy: { ctx: e.searchTerm } } : { exact: { ctx: e.searchTerm } };
925
+ const r = _(e.searchTerm), i = e.mode === "fuzzy" ? { fuzzy: { ctx: r } } : {
926
+ exact: {
927
+ ctx: `${r.startsWith('"') ? r : `"${r}"`}`
928
+ }
929
+ };
921
930
  return n.push({
922
- occur: r,
931
+ occur: e.mode === "exact" ? "must" : "should",
923
932
  // Valid, as 'occur' is a required property in SearchClientQuery
924
933
  ...i
925
934
  }), n;
@@ -927,24 +936,25 @@ class me {
927
936
  }
928
937
  class ve {
929
938
  constructor(e, n) {
930
- h(this, "config");
931
- h(this, "measureClient");
932
- h(this, "searchClient");
933
- h(this, "adClient");
934
- h(this, "userId");
935
- h(this, "requestTimeout");
936
- h(this, "subscriptionEvents", {});
937
- h(this, "getResponseItems", (e, n, r) => {
939
+ l(this, "config");
940
+ l(this, "measureClient");
941
+ l(this, "searchClient");
942
+ l(this, "adClient");
943
+ l(this, "userId");
944
+ l(this, "requestTimeout");
945
+ l(this, "subscriptionEvents", {});
946
+ l(this, "getResponseItems", (e, n, r) => {
938
947
  const i = async () => {
939
948
  (async () => {
940
- var u, l;
949
+ var u;
941
950
  const o = await ((u = this == null ? void 0 : this.searchClient) == null ? void 0 : u.getSearchResponseItems(e));
942
951
  if (!o)
943
952
  throw new Error("Search client was not initialized.");
944
- const t = (l = o.data.hits || []) == null ? void 0 : l.map((s) => s.doc).filter((s) => !!s).map((s) => ({
945
- type: "SearchDocument",
946
- id: T(),
947
- document: s
953
+ const t = (o.data.hits || []).filter((h) => !!h.doc).map((h) => ({
954
+ id: E(),
955
+ document: h.doc || { id: -1 },
956
+ source_index: h.source_index,
957
+ type: "SearchDocument"
948
958
  }));
949
959
  n(o, t);
950
960
  })(), (async () => {
@@ -966,7 +976,7 @@ class ve {
966
976
  this.config = {
967
977
  ...e,
968
978
  // Strips off the trailing '/' from an endpointURL if one is accidentally added
969
- endpointURL: de(e.endpointURL)
979
+ endpointURL: he(e.endpointURL)
970
980
  }, this.userId = "", typeof window < "u" && typeof customElements < "u" && n.sdkName === "@searchcraft/javascript-sdk" && globalThis.__scDefineCustomElements__ && globalThis.__scDefineCustomElements__(), typeof window < "u" && (this.initClients(this.config, n), this.initInputForms(), this.startObservingMutations());
971
981
  }
972
982
  initInputForms() {
@@ -995,15 +1005,15 @@ class ve {
995
1005
  initClients(e, n) {
996
1006
  setTimeout(async () => {
997
1007
  let r = this.config.userId;
998
- switch (r || (r = await $()), this.measureClient = new ue(e, n, r), this.searchClient = new me(this, e, r), e.adSource) {
1008
+ switch (r || (r = await z()), this.measureClient = new de(e, n, r), this.searchClient = new me(this, e, r), e.adSource) {
999
1009
  case "adMarketplace":
1000
- this.adClient = new ae(e);
1010
+ this.adClient = new oe(e);
1001
1011
  break;
1002
1012
  case "Nativo":
1003
- this.adClient = new se(e);
1013
+ this.adClient = new ce(e);
1004
1014
  break;
1005
1015
  case "Custom":
1006
- this.adClient = new oe(e);
1016
+ this.adClient = new ie(e);
1007
1017
  break;
1008
1018
  }
1009
1019
  this.emitEvent("initialized", {
@@ -1704,7 +1714,8 @@ const initialSearchcraftStateValues = {
1704
1714
  searchResultsCount: 0,
1705
1715
  searchResultsPerPage: 20,
1706
1716
  searchResultsPage: 1,
1707
- sortType: 'asc',
1717
+ sortType: undefined,
1718
+ orderByField: undefined,
1708
1719
  // Callbacks
1709
1720
  afterInit: () => { },
1710
1721
  };
@@ -1732,7 +1743,7 @@ const searchcraftStore = zustand.createStore((_set, get) => {
1732
1743
  },
1733
1744
  init: (core, debug = false) => {
1734
1745
  const logger = debug
1735
- ? new pe({ logLevel: F.DEBUG })
1746
+ ? new pe({ logLevel: O.DEBUG })
1736
1747
  : undefined;
1737
1748
  const state = functions.set({
1738
1749
  core,
@@ -1770,12 +1781,12 @@ const searchcraftStore = zustand.createStore((_set, get) => {
1770
1781
  },
1771
1782
  search: async () => {
1772
1783
  const state = get();
1773
- state.logger?.log(F.INFO, `Starting search with search term: "${state.searchTerm}"`);
1784
+ state.logger?.log(O.INFO, `Starting search with search term: "${state.searchTerm}"`);
1774
1785
  if (!state.core) {
1775
1786
  throw new Error('Searchcraft instance is not initialized.');
1776
1787
  }
1777
1788
  if (!state.searchTerm.trim()) {
1778
- state.logger?.log(F.INFO, 'No search request was made: search term was empty.');
1789
+ state.logger?.log(O.INFO, 'No search request was made: search term was empty.');
1779
1790
  functions.set({
1780
1791
  searchClientResponseItems: [],
1781
1792
  searchResultsCount: 0,
@@ -1789,6 +1800,7 @@ const searchcraftStore = zustand.createStore((_set, get) => {
1789
1800
  searchTerm: state.searchTerm,
1790
1801
  mode: state.searchMode,
1791
1802
  sort: state.sortType,
1803
+ order_by: state.orderByField,
1792
1804
  facetPathsForIndexFields: state.facetPathsForIndexFields,
1793
1805
  rangeValueForIndexFields: state.rangeValueForIndexFields,
1794
1806
  offset: state.searchResultsPerPage
@@ -1812,8 +1824,8 @@ const searchcraftStore = zustand.createStore((_set, get) => {
1812
1824
  ...(facets && { searchResponseFacetPrime: facets }),
1813
1825
  };
1814
1826
  });
1815
- state.logger?.log(F.DEBUG, `Search results: ${JSON.stringify(items)}`);
1816
- state.logger?.log(F.DEBUG, `Facets from response: ${JSON.stringify(facets)}`);
1827
+ state.logger?.log(O.DEBUG, `Search results: ${JSON.stringify(items)}`);
1828
+ state.logger?.log(O.DEBUG, `Facets from response: ${JSON.stringify(facets)}`);
1817
1829
  },
1818
1830
  setInitialSearchClientResponseItemsFromResponse: (response, items) => {
1819
1831
  const state = get();
@@ -1829,11 +1841,11 @@ const searchcraftStore = zustand.createStore((_set, get) => {
1829
1841
  searchResultsCount: count,
1830
1842
  };
1831
1843
  });
1832
- state.logger?.log(F.DEBUG, `Search results: ${JSON.stringify(items)}`);
1844
+ state.logger?.log(O.DEBUG, `Search results: ${JSON.stringify(items)}`);
1833
1845
  },
1834
1846
  setInitialQuery: async (query) => {
1835
1847
  const state = functions.set({ initialQuery: query });
1836
- state.logger?.log(F.INFO, `Starting search with query: "${state.initialQuery}"`);
1848
+ state.logger?.log(O.INFO, `Starting search with query: "${state.initialQuery}"`);
1837
1849
  if (!state.core) {
1838
1850
  throw new Error('Searchcraft instance is not initialized.');
1839
1851
  }
@@ -1843,7 +1855,7 @@ const searchcraftStore = zustand.createStore((_set, get) => {
1843
1855
  isPopoverVisible: isVisible,
1844
1856
  }),
1845
1857
  setSearchMode: (mode) => functions.set({ searchMode: mode }),
1846
- setSortType: (type) => functions.set({ sortType: type }),
1858
+ setSortOrder: ({ orderByField, sortType }) => functions.set({ sortType, orderByField }),
1847
1859
  setSearchTerm: (searchTerm) => {
1848
1860
  const { core } = get();
1849
1861
  if (searchTerm.length === 0) {
@@ -1857,7 +1869,8 @@ const searchcraftStore = zustand.createStore((_set, get) => {
1857
1869
  facetPathsForIndexFields: {},
1858
1870
  ...(searchTerm.trim().length === 0 && {
1859
1871
  searchMode: 'fuzzy',
1860
- sortType: 'asc',
1872
+ sortType: null,
1873
+ orderByField: null,
1861
1874
  }),
1862
1875
  });
1863
1876
  },
@@ -1888,4 +1901,4 @@ const searchcraftStore = zustand.createStore((_set, get) => {
1888
1901
 
1889
1902
  export { searchcraftStore as s, ve as v };
1890
1903
 
1891
- //# sourceMappingURL=p-3465cbc7.js.map
1904
+ //# sourceMappingURL=p-d4558d44.js.map