admesh-ui-sdk 0.3.1 → 0.4.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.mjs CHANGED
@@ -1,8 +1,8 @@
1
- import xe, { useState as K, useCallback as E, useRef as X, useEffect as ae, useMemo as S } from "react";
2
- function fe(a) {
3
- return a && a.__esModule && Object.prototype.hasOwnProperty.call(a, "default") ? a.default : a;
1
+ import ge, { useState as I, useCallback as R, useRef as ae, useEffect as J, useMemo as z } from "react";
2
+ function fe(r) {
3
+ return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
4
4
  }
5
- var C = { exports: {} }, R = {};
5
+ var P = { exports: {} }, S = {};
6
6
  /**
7
7
  * @license React
8
8
  * react-jsx-runtime.production.js
@@ -12,29 +12,29 @@ var C = { exports: {} }, R = {};
12
12
  * This source code is licensed under the MIT license found in the
13
13
  * LICENSE file in the root directory of this source tree.
14
14
  */
15
- var Z;
16
- function ge() {
17
- if (Z) return R;
18
- Z = 1;
19
- var a = Symbol.for("react.transitional.element"), o = Symbol.for("react.fragment");
20
- function n(m, l, s) {
15
+ var te;
16
+ function pe() {
17
+ if (te) return S;
18
+ te = 1;
19
+ var r = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
20
+ function a(m, o, n) {
21
21
  var d = null;
22
- if (s !== void 0 && (d = "" + s), l.key !== void 0 && (d = "" + l.key), "key" in l) {
23
- s = {};
24
- for (var u in l)
25
- u !== "key" && (s[u] = l[u]);
26
- } else s = l;
27
- return l = s.ref, {
28
- $$typeof: a,
22
+ if (n !== void 0 && (d = "" + n), o.key !== void 0 && (d = "" + o.key), "key" in o) {
23
+ n = {};
24
+ for (var i in o)
25
+ i !== "key" && (n[i] = o[i]);
26
+ } else n = o;
27
+ return o = n.ref, {
28
+ $$typeof: r,
29
29
  type: m,
30
30
  key: d,
31
- ref: l !== void 0 ? l : null,
32
- props: s
31
+ ref: o !== void 0 ? o : null,
32
+ props: n
33
33
  };
34
34
  }
35
- return R.Fragment = o, R.jsx = n, R.jsxs = n, R;
35
+ return S.Fragment = t, S.jsx = a, S.jsxs = a, S;
36
36
  }
37
- var M = {};
37
+ var L = {};
38
38
  /**
39
39
  * @license React
40
40
  * react-jsx-runtime.development.js
@@ -44,307 +44,307 @@ var M = {};
44
44
  * This source code is licensed under the MIT license found in the
45
45
  * LICENSE file in the root directory of this source tree.
46
46
  */
47
- var Q;
48
- function pe() {
49
- return Q || (Q = 1, process.env.NODE_ENV !== "production" && function() {
50
- function a(r) {
51
- if (r == null) return null;
52
- if (typeof r == "function")
53
- return r.$$typeof === me ? null : r.displayName || r.name || null;
54
- if (typeof r == "string") return r;
55
- switch (r) {
56
- case _:
47
+ var ne;
48
+ function ye() {
49
+ return ne || (ne = 1, process.env.NODE_ENV !== "production" && function() {
50
+ function r(s) {
51
+ if (s == null) return null;
52
+ if (typeof s == "function")
53
+ return s.$$typeof === ue ? null : s.displayName || s.name || null;
54
+ if (typeof s == "string") return s;
55
+ switch (s) {
56
+ case b:
57
57
  return "Fragment";
58
58
  case w:
59
59
  return "Profiler";
60
- case k:
60
+ case _:
61
61
  return "StrictMode";
62
- case de:
62
+ case T:
63
63
  return "Suspense";
64
64
  case ie:
65
65
  return "SuspenseList";
66
- case ce:
66
+ case me:
67
67
  return "Activity";
68
68
  }
69
- if (typeof r == "object")
70
- switch (typeof r.tag == "number" && console.error(
69
+ if (typeof s == "object")
70
+ switch (typeof s.tag == "number" && console.error(
71
71
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
72
- ), r.$$typeof) {
73
- case f:
72
+ ), s.$$typeof) {
73
+ case x:
74
74
  return "Portal";
75
- case ne:
76
- return (r.displayName || "Context") + ".Provider";
77
- case A:
78
- return (r._context.displayName || "Context") + ".Consumer";
79
- case oe:
80
- var i = r.render;
81
- return r = r.displayName, r || (r = i.displayName || i.name || "", r = r !== "" ? "ForwardRef(" + r + ")" : "ForwardRef"), r;
82
- case le:
83
- return i = r.displayName || null, i !== null ? i : a(r.type) || "Memo";
84
- case Y:
85
- i = r._payload, r = r._init;
75
+ case V:
76
+ return (s.displayName || "Context") + ".Provider";
77
+ case C:
78
+ return (s._context.displayName || "Context") + ".Consumer";
79
+ case j:
80
+ var u = s.render;
81
+ return s = s.displayName, s || (s = u.displayName || u.name || "", s = s !== "" ? "ForwardRef(" + s + ")" : "ForwardRef"), s;
82
+ case ce:
83
+ return u = s.displayName || null, u !== null ? u : r(s.type) || "Memo";
84
+ case K:
85
+ u = s._payload, s = s._init;
86
86
  try {
87
- return a(r(i));
87
+ return r(s(u));
88
88
  } catch {
89
89
  }
90
90
  }
91
91
  return null;
92
92
  }
93
- function o(r) {
94
- return "" + r;
93
+ function t(s) {
94
+ return "" + s;
95
95
  }
96
- function n(r) {
96
+ function a(s) {
97
97
  try {
98
- o(r);
99
- var i = !1;
98
+ t(s);
99
+ var u = !1;
100
100
  } catch {
101
- i = !0;
101
+ u = !0;
102
102
  }
103
- if (i) {
104
- i = console;
105
- var x = i.error, g = typeof Symbol == "function" && Symbol.toStringTag && r[Symbol.toStringTag] || r.constructor.name || "Object";
106
- return x.call(
107
- i,
103
+ if (u) {
104
+ u = console;
105
+ var g = u.error, v = typeof Symbol == "function" && Symbol.toStringTag && s[Symbol.toStringTag] || s.constructor.name || "Object";
106
+ return g.call(
107
+ u,
108
108
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
109
- g
110
- ), o(r);
109
+ v
110
+ ), t(s);
111
111
  }
112
112
  }
113
- function m(r) {
114
- if (r === _) return "<>";
115
- if (typeof r == "object" && r !== null && r.$$typeof === Y)
113
+ function m(s) {
114
+ if (s === b) return "<>";
115
+ if (typeof s == "object" && s !== null && s.$$typeof === K)
116
116
  return "<...>";
117
117
  try {
118
- var i = a(r);
119
- return i ? "<" + i + ">" : "<...>";
118
+ var u = r(s);
119
+ return u ? "<" + u + ">" : "<...>";
120
120
  } catch {
121
121
  return "<...>";
122
122
  }
123
123
  }
124
- function l() {
125
- var r = P.A;
126
- return r === null ? null : r.getOwner();
124
+ function o() {
125
+ var s = W.A;
126
+ return s === null ? null : s.getOwner();
127
127
  }
128
- function s() {
128
+ function n() {
129
129
  return Error("react-stack-top-frame");
130
130
  }
131
- function d(r) {
132
- if (U.call(r, "key")) {
133
- var i = Object.getOwnPropertyDescriptor(r, "key").get;
134
- if (i && i.isReactWarning) return !1;
131
+ function d(s) {
132
+ if (X.call(s, "key")) {
133
+ var u = Object.getOwnPropertyDescriptor(s, "key").get;
134
+ if (u && u.isReactWarning) return !1;
135
135
  }
136
- return r.key !== void 0;
136
+ return s.key !== void 0;
137
137
  }
138
- function u(r, i) {
139
- function x() {
140
- D || (D = !0, console.error(
138
+ function i(s, u) {
139
+ function g() {
140
+ Q || (Q = !0, console.error(
141
141
  "%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://react.dev/link/special-props)",
142
- i
142
+ u
143
143
  ));
144
144
  }
145
- x.isReactWarning = !0, Object.defineProperty(r, "key", {
146
- get: x,
145
+ g.isReactWarning = !0, Object.defineProperty(s, "key", {
146
+ get: g,
147
147
  configurable: !0
148
148
  });
149
149
  }
150
- function v() {
151
- var r = a(this.type);
152
- return H[r] || (H[r] = !0, console.error(
150
+ function f() {
151
+ var s = r(this.type);
152
+ return Z[s] || (Z[s] = !0, console.error(
153
153
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
154
- )), r = this.props.ref, r !== void 0 ? r : null;
154
+ )), s = this.props.ref, s !== void 0 ? s : null;
155
155
  }
156
- function b(r, i, x, g, N, j, I, z) {
157
- return x = j.ref, r = {
156
+ function p(s, u, g, v, A, M, $, Y) {
157
+ return g = M.ref, s = {
158
158
  $$typeof: y,
159
- type: r,
160
- key: i,
161
- props: j,
162
- _owner: N
163
- }, (x !== void 0 ? x : null) !== null ? Object.defineProperty(r, "ref", {
159
+ type: s,
160
+ key: u,
161
+ props: M,
162
+ _owner: A
163
+ }, (g !== void 0 ? g : null) !== null ? Object.defineProperty(s, "ref", {
164
164
  enumerable: !1,
165
- get: v
166
- }) : Object.defineProperty(r, "ref", { enumerable: !1, value: null }), r._store = {}, Object.defineProperty(r._store, "validated", {
165
+ get: f
166
+ }) : Object.defineProperty(s, "ref", { enumerable: !1, value: null }), s._store = {}, Object.defineProperty(s._store, "validated", {
167
167
  configurable: !1,
168
168
  enumerable: !1,
169
169
  writable: !0,
170
170
  value: 0
171
- }), Object.defineProperty(r, "_debugInfo", {
171
+ }), Object.defineProperty(s, "_debugInfo", {
172
172
  configurable: !1,
173
173
  enumerable: !1,
174
174
  writable: !0,
175
175
  value: null
176
- }), Object.defineProperty(r, "_debugStack", {
176
+ }), Object.defineProperty(s, "_debugStack", {
177
177
  configurable: !1,
178
178
  enumerable: !1,
179
179
  writable: !0,
180
- value: I
181
- }), Object.defineProperty(r, "_debugTask", {
180
+ value: $
181
+ }), Object.defineProperty(s, "_debugTask", {
182
182
  configurable: !1,
183
183
  enumerable: !1,
184
184
  writable: !0,
185
- value: z
186
- }), Object.freeze && (Object.freeze(r.props), Object.freeze(r)), r;
185
+ value: Y
186
+ }), Object.freeze && (Object.freeze(s.props), Object.freeze(s)), s;
187
187
  }
188
- function t(r, i, x, g, N, j, I, z) {
189
- var p = i.children;
190
- if (p !== void 0)
191
- if (g)
192
- if (ue(p)) {
193
- for (g = 0; g < p.length; g++)
194
- c(p[g]);
195
- Object.freeze && Object.freeze(p);
188
+ function l(s, u, g, v, A, M, $, Y) {
189
+ var k = u.children;
190
+ if (k !== void 0)
191
+ if (v)
192
+ if (he(k)) {
193
+ for (v = 0; v < k.length; v++)
194
+ c(k[v]);
195
+ Object.freeze && Object.freeze(k);
196
196
  } else
197
197
  console.error(
198
198
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
199
199
  );
200
- else c(p);
201
- if (U.call(i, "key")) {
202
- p = a(r);
203
- var T = Object.keys(i).filter(function(he) {
204
- return he !== "key";
200
+ else c(k);
201
+ if (X.call(u, "key")) {
202
+ k = r(s);
203
+ var E = Object.keys(u).filter(function(xe) {
204
+ return xe !== "key";
205
205
  });
206
- g = 0 < T.length ? "{key: someKey, " + T.join(": ..., ") + ": ...}" : "{key: someKey}", G[p + g] || (T = 0 < T.length ? "{" + T.join(": ..., ") + ": ...}" : "{}", console.error(
206
+ v = 0 < E.length ? "{key: someKey, " + E.join(": ..., ") + ": ...}" : "{key: someKey}", se[k + v] || (E = 0 < E.length ? "{" + E.join(": ..., ") + ": ...}" : "{}", console.error(
207
207
  `A props object containing a "key" prop is being spread into JSX:
208
208
  let props = %s;
209
209
  <%s {...props} />
210
210
  React keys must be passed directly to JSX without using spread:
211
211
  let props = %s;
212
212
  <%s key={someKey} {...props} />`,
213
- g,
214
- p,
215
- T,
216
- p
217
- ), G[p + g] = !0);
213
+ v,
214
+ k,
215
+ E,
216
+ k
217
+ ), se[k + v] = !0);
218
218
  }
219
- if (p = null, x !== void 0 && (n(x), p = "" + x), d(i) && (n(i.key), p = "" + i.key), "key" in i) {
220
- x = {};
221
- for (var $ in i)
222
- $ !== "key" && (x[$] = i[$]);
223
- } else x = i;
224
- return p && u(
225
- x,
226
- typeof r == "function" ? r.displayName || r.name || "Unknown" : r
227
- ), b(
228
- r,
229
- p,
230
- j,
231
- N,
232
- l(),
233
- x,
234
- I,
235
- z
219
+ if (k = null, g !== void 0 && (a(g), k = "" + g), d(u) && (a(u.key), k = "" + u.key), "key" in u) {
220
+ g = {};
221
+ for (var U in u)
222
+ U !== "key" && (g[U] = u[U]);
223
+ } else g = u;
224
+ return k && i(
225
+ g,
226
+ typeof s == "function" ? s.displayName || s.name || "Unknown" : s
227
+ ), p(
228
+ s,
229
+ k,
230
+ M,
231
+ A,
232
+ o(),
233
+ g,
234
+ $,
235
+ Y
236
236
  );
237
237
  }
238
- function c(r) {
239
- typeof r == "object" && r !== null && r.$$typeof === y && r._store && (r._store.validated = 1);
238
+ function c(s) {
239
+ typeof s == "object" && s !== null && s.$$typeof === y && s._store && (s._store.validated = 1);
240
240
  }
241
- var h = xe, y = Symbol.for("react.transitional.element"), f = Symbol.for("react.portal"), _ = Symbol.for("react.fragment"), k = Symbol.for("react.strict_mode"), w = Symbol.for("react.profiler"), A = Symbol.for("react.consumer"), ne = Symbol.for("react.context"), oe = Symbol.for("react.forward_ref"), de = Symbol.for("react.suspense"), ie = Symbol.for("react.suspense_list"), le = Symbol.for("react.memo"), Y = Symbol.for("react.lazy"), ce = Symbol.for("react.activity"), me = Symbol.for("react.client.reference"), P = h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, U = Object.prototype.hasOwnProperty, ue = Array.isArray, L = console.createTask ? console.createTask : function() {
241
+ var h = ge, y = Symbol.for("react.transitional.element"), x = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), _ = Symbol.for("react.strict_mode"), w = Symbol.for("react.profiler"), C = Symbol.for("react.consumer"), V = Symbol.for("react.context"), j = Symbol.for("react.forward_ref"), T = Symbol.for("react.suspense"), ie = Symbol.for("react.suspense_list"), ce = Symbol.for("react.memo"), K = Symbol.for("react.lazy"), me = Symbol.for("react.activity"), ue = Symbol.for("react.client.reference"), W = h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, X = Object.prototype.hasOwnProperty, he = Array.isArray, F = console.createTask ? console.createTask : function() {
242
242
  return null;
243
243
  };
244
244
  h = {
245
- "react-stack-bottom-frame": function(r) {
246
- return r();
245
+ "react-stack-bottom-frame": function(s) {
246
+ return s();
247
247
  }
248
248
  };
249
- var D, H = {}, q = h["react-stack-bottom-frame"].bind(
249
+ var Q, Z = {}, ee = h["react-stack-bottom-frame"].bind(
250
250
  h,
251
- s
252
- )(), J = L(m(s)), G = {};
253
- M.Fragment = _, M.jsx = function(r, i, x, g, N) {
254
- var j = 1e4 > P.recentlyCreatedOwnerStacks++;
255
- return t(
256
- r,
257
- i,
258
- x,
259
- !1,
251
+ n
252
+ )(), re = F(m(n)), se = {};
253
+ L.Fragment = b, L.jsx = function(s, u, g, v, A) {
254
+ var M = 1e4 > W.recentlyCreatedOwnerStacks++;
255
+ return l(
256
+ s,
257
+ u,
260
258
  g,
261
- N,
262
- j ? Error("react-stack-top-frame") : q,
263
- j ? L(m(r)) : J
259
+ !1,
260
+ v,
261
+ A,
262
+ M ? Error("react-stack-top-frame") : ee,
263
+ M ? F(m(s)) : re
264
264
  );
265
- }, M.jsxs = function(r, i, x, g, N) {
266
- var j = 1e4 > P.recentlyCreatedOwnerStacks++;
267
- return t(
268
- r,
269
- i,
270
- x,
271
- !0,
265
+ }, L.jsxs = function(s, u, g, v, A) {
266
+ var M = 1e4 > W.recentlyCreatedOwnerStacks++;
267
+ return l(
268
+ s,
269
+ u,
272
270
  g,
273
- N,
274
- j ? Error("react-stack-top-frame") : q,
275
- j ? L(m(r)) : J
271
+ !0,
272
+ v,
273
+ A,
274
+ M ? Error("react-stack-top-frame") : ee,
275
+ M ? F(m(s)) : re
276
276
  );
277
277
  };
278
- }()), M;
278
+ }()), L;
279
279
  }
280
- var ee;
281
- function ye() {
282
- return ee || (ee = 1, process.env.NODE_ENV === "production" ? C.exports = ge() : C.exports = pe()), C.exports;
280
+ var le;
281
+ function be() {
282
+ return le || (le = 1, process.env.NODE_ENV === "production" ? P.exports = pe() : P.exports = ye()), P.exports;
283
283
  }
284
- var e = ye(), F = { exports: {} };
284
+ var e = be(), D = { exports: {} };
285
285
  /*!
286
286
  Copyright (c) 2018 Jed Watson.
287
287
  Licensed under the MIT License (MIT), see
288
288
  http://jedwatson.github.io/classnames
289
289
  */
290
- var re;
290
+ var de;
291
291
  function ve() {
292
- return re || (re = 1, function(a) {
292
+ return de || (de = 1, function(r) {
293
293
  (function() {
294
- var o = {}.hasOwnProperty;
295
- function n() {
296
- for (var s = "", d = 0; d < arguments.length; d++) {
297
- var u = arguments[d];
298
- u && (s = l(s, m(u)));
294
+ var t = {}.hasOwnProperty;
295
+ function a() {
296
+ for (var n = "", d = 0; d < arguments.length; d++) {
297
+ var i = arguments[d];
298
+ i && (n = o(n, m(i)));
299
299
  }
300
- return s;
300
+ return n;
301
301
  }
302
- function m(s) {
303
- if (typeof s == "string" || typeof s == "number")
304
- return s;
305
- if (typeof s != "object")
302
+ function m(n) {
303
+ if (typeof n == "string" || typeof n == "number")
304
+ return n;
305
+ if (typeof n != "object")
306
306
  return "";
307
- if (Array.isArray(s))
308
- return n.apply(null, s);
309
- if (s.toString !== Object.prototype.toString && !s.toString.toString().includes("[native code]"))
310
- return s.toString();
307
+ if (Array.isArray(n))
308
+ return a.apply(null, n);
309
+ if (n.toString !== Object.prototype.toString && !n.toString.toString().includes("[native code]"))
310
+ return n.toString();
311
311
  var d = "";
312
- for (var u in s)
313
- o.call(s, u) && s[u] && (d = l(d, u));
312
+ for (var i in n)
313
+ t.call(n, i) && n[i] && (d = o(d, i));
314
314
  return d;
315
315
  }
316
- function l(s, d) {
317
- return d ? s ? s + " " + d : s + d : s;
316
+ function o(n, d) {
317
+ return d ? n ? n + " " + d : n + d : n;
318
318
  }
319
- a.exports ? (n.default = n, a.exports = n) : window.classNames = n;
319
+ r.exports ? (a.default = a, r.exports = a) : window.classNames = a;
320
320
  })();
321
- }(F)), F.exports;
321
+ }(D)), D.exports;
322
322
  }
323
- var be = ve();
324
- const O = /* @__PURE__ */ fe(be), _e = "https://api.useadmesh.com/track";
325
- let B = {
326
- apiBaseUrl: _e,
323
+ var ke = ve();
324
+ const N = /* @__PURE__ */ fe(ke), je = "https://api.useadmesh.com/track";
325
+ let q = {
326
+ apiBaseUrl: je,
327
327
  enabled: !0,
328
328
  debug: !1,
329
329
  retryAttempts: 3,
330
330
  retryDelay: 1e3
331
331
  };
332
- const Ce = (a) => {
333
- B = { ...B, ...a };
334
- }, ke = (a) => {
335
- const [o, n] = K(!1), [m, l] = K(null), s = { ...B, ...a }, d = E((c, h) => {
336
- s.debug && console.log(`[AdMesh Tracker] ${c}`, h);
337
- }, [s.debug]), u = E(async (c, h) => {
338
- if (!s.enabled) {
332
+ const Le = (r) => {
333
+ q = { ...q, ...r };
334
+ }, _e = (r) => {
335
+ const [t, a] = I(!1), [m, o] = I(null), n = { ...q, ...r }, d = R((c, h) => {
336
+ n.debug && console.log(`[AdMesh Tracker] ${c}`, h);
337
+ }, [n.debug]), i = R(async (c, h) => {
338
+ if (!n.enabled) {
339
339
  d("Tracking disabled, skipping event", { eventType: c, data: h });
340
340
  return;
341
341
  }
342
342
  if (!h.adId || !h.admeshLink) {
343
- const k = "Missing required tracking data: adId and admeshLink are required";
344
- d(k, h), l(k);
343
+ const _ = "Missing required tracking data: adId and admeshLink are required";
344
+ d(_, h), o(_);
345
345
  return;
346
346
  }
347
- n(!0), l(null);
347
+ a(!0), o(null);
348
348
  const y = {
349
349
  event_type: c,
350
350
  ad_id: h.adId,
@@ -361,10 +361,10 @@ const Ce = (a) => {
361
361
  page_url: window.location.href
362
362
  };
363
363
  d(`Sending ${c} event`, y);
364
- let f = null;
365
- for (let k = 1; k <= (s.retryAttempts || 3); k++)
364
+ let x = null;
365
+ for (let _ = 1; _ <= (n.retryAttempts || 3); _++)
366
366
  try {
367
- const w = await fetch(`${s.apiBaseUrl}/events`, {
367
+ const w = await fetch(`${n.apiBaseUrl}/events`, {
368
368
  method: "POST",
369
369
  headers: {
370
370
  "Content-Type": "application/json"
@@ -373,58 +373,58 @@ const Ce = (a) => {
373
373
  });
374
374
  if (!w.ok)
375
375
  throw new Error(`HTTP ${w.status}: ${w.statusText}`);
376
- const A = await w.json();
377
- d(`${c} event tracked successfully`, A), n(!1);
376
+ const C = await w.json();
377
+ d(`${c} event tracked successfully`, C), a(!1);
378
378
  return;
379
379
  } catch (w) {
380
- f = w, d(`Attempt ${k} failed for ${c} event`, w), k < (s.retryAttempts || 3) && await new Promise(
381
- (A) => setTimeout(A, (s.retryDelay || 1e3) * k)
380
+ x = w, d(`Attempt ${_} failed for ${c} event`, w), _ < (n.retryAttempts || 3) && await new Promise(
381
+ (C) => setTimeout(C, (n.retryDelay || 1e3) * _)
382
382
  );
383
383
  }
384
- const _ = `Failed to track ${c} event after ${s.retryAttempts} attempts: ${f == null ? void 0 : f.message}`;
385
- d(_, f), l(_), n(!1);
386
- }, [s, d]), v = E(async (c) => u("click", c), [u]), b = E(async (c) => u("view", c), [u]), t = E(async (c) => (!c.revenue && !c.conversionType && d("Warning: Conversion tracking without revenue or conversion type", c), u("conversion", c)), [u]);
384
+ const b = `Failed to track ${c} event after ${n.retryAttempts} attempts: ${x == null ? void 0 : x.message}`;
385
+ d(b, x), o(b), a(!1);
386
+ }, [n, d]), f = R(async (c) => i("click", c), [i]), p = R(async (c) => i("view", c), [i]), l = R(async (c) => (!c.revenue && !c.conversionType && d("Warning: Conversion tracking without revenue or conversion type", c), i("conversion", c)), [i]);
387
387
  return {
388
- trackClick: v,
389
- trackView: b,
390
- trackConversion: t,
391
- isTracking: o,
388
+ trackClick: f,
389
+ trackView: p,
390
+ trackConversion: l,
391
+ isTracking: t,
392
392
  error: m
393
393
  };
394
- }, Se = (a, o, n) => {
394
+ }, Pe = (r, t, a) => {
395
395
  try {
396
- const m = new URL(a);
397
- return m.searchParams.set("ad_id", o), m.searchParams.set("utm_source", "admesh"), m.searchParams.set("utm_medium", "recommendation"), n && Object.entries(n).forEach(([l, s]) => {
398
- m.searchParams.set(l, s);
396
+ const m = new URL(r);
397
+ return m.searchParams.set("ad_id", t), m.searchParams.set("utm_source", "admesh"), m.searchParams.set("utm_medium", "recommendation"), a && Object.entries(a).forEach(([o, n]) => {
398
+ m.searchParams.set(o, n);
399
399
  }), m.toString();
400
400
  } catch {
401
- return console.warn("[AdMesh] Invalid URL provided to buildAdMeshLink:", a), a;
401
+ return console.warn("[AdMesh] Invalid URL provided to buildAdMeshLink:", r), r;
402
402
  }
403
- }, Oe = (a, o) => ({
404
- adId: a.ad_id,
405
- admeshLink: a.admesh_link,
406
- productId: a.product_id,
407
- ...o
408
- }), W = ({
409
- adId: a,
410
- admeshLink: o,
411
- productId: n,
403
+ }, Oe = (r, t) => ({
404
+ adId: r.ad_id,
405
+ admeshLink: r.admesh_link,
406
+ productId: r.product_id,
407
+ ...t
408
+ }), B = ({
409
+ adId: r,
410
+ admeshLink: t,
411
+ productId: a,
412
412
  children: m,
413
- onClick: l,
414
- trackingData: s,
413
+ onClick: o,
414
+ trackingData: n,
415
415
  className: d
416
416
  }) => {
417
- const { trackClick: u, trackView: v } = ke(), b = X(null), t = X(!1);
418
- ae(() => {
419
- if (!b.current || t.current) return;
417
+ const { trackClick: i, trackView: f } = _e(), p = ae(null), l = ae(!1);
418
+ J(() => {
419
+ if (!p.current || l.current) return;
420
420
  const h = new IntersectionObserver(
421
421
  (y) => {
422
- y.forEach((f) => {
423
- f.isIntersecting && !t.current && (t.current = !0, v({
424
- adId: a,
425
- admeshLink: o,
426
- productId: n,
427
- ...s
422
+ y.forEach((x) => {
423
+ x.isIntersecting && !l.current && (l.current = !0, f({
424
+ adId: r,
425
+ admeshLink: t,
426
+ productId: a,
427
+ ...n
428
428
  }).catch(console.error));
429
429
  });
430
430
  },
@@ -434,27 +434,27 @@ const Ce = (a) => {
434
434
  rootMargin: "0px"
435
435
  }
436
436
  );
437
- return h.observe(b.current), () => {
437
+ return h.observe(p.current), () => {
438
438
  h.disconnect();
439
439
  };
440
- }, [a, o, n, s, v]);
441
- const c = E(async (h) => {
440
+ }, [r, t, a, n, f]);
441
+ const c = R(async (h) => {
442
442
  try {
443
- await u({
444
- adId: a,
445
- admeshLink: o,
446
- productId: n,
447
- ...s
443
+ await i({
444
+ adId: r,
445
+ admeshLink: t,
446
+ productId: a,
447
+ ...n
448
448
  });
449
- } catch (_) {
450
- console.error("Failed to track click:", _);
449
+ } catch (b) {
450
+ console.error("Failed to track click:", b);
451
451
  }
452
- l && l(), h.target.closest("a") || window.open(o, "_blank", "noopener,noreferrer");
453
- }, [a, o, n, s, u, l]);
452
+ o && o(), h.target.closest("a") || window.open(t, "_blank", "noopener,noreferrer");
453
+ }, [r, t, a, n, i, o]);
454
454
  return /* @__PURE__ */ e.jsx(
455
455
  "div",
456
456
  {
457
- ref: b,
457
+ ref: p,
458
458
  className: d,
459
459
  onClick: c,
460
460
  style: { cursor: "pointer" },
@@ -462,66 +462,66 @@ const Ce = (a) => {
462
462
  }
463
463
  );
464
464
  };
465
- W.displayName = "AdMeshLinkTracker";
466
- const se = ({
467
- recommendation: a,
468
- theme: o,
469
- showMatchScore: n = !0,
465
+ B.displayName = "AdMeshLinkTracker";
466
+ const G = ({
467
+ recommendation: r,
468
+ theme: t,
469
+ showMatchScore: a = !0,
470
470
  showBadges: m = !0,
471
- onClick: l,
472
- className: s
471
+ onClick: o,
472
+ className: n
473
473
  }) => {
474
- const d = S(() => {
474
+ const d = z(() => {
475
475
  var y;
476
- const t = [];
477
- a.intent_match_score >= 0.8 && t.push("Top Match"), a.has_free_tier && t.push("Free Tier"), a.trial_days && a.trial_days > 0 && t.push("Trial Available");
476
+ const l = [];
477
+ r.intent_match_score >= 0.8 && l.push("Top Match"), r.has_free_tier && l.push("Free Tier"), r.trial_days && r.trial_days > 0 && l.push("Trial Available");
478
478
  const c = ["ai", "artificial intelligence", "machine learning", "ml", "automation"];
479
- return (((y = a.keywords) == null ? void 0 : y.some(
480
- (f) => c.some((_) => f.toLowerCase().includes(_))
481
- )) || a.title.toLowerCase().includes("ai")) && t.push("AI Powered"), t;
482
- }, [a]), u = Math.round(a.intent_match_score * 100), v = O(
479
+ return (((y = r.keywords) == null ? void 0 : y.some(
480
+ (x) => c.some((b) => x.toLowerCase().includes(b))
481
+ )) || r.title.toLowerCase().includes("ai")) && l.push("AI Powered"), l;
482
+ }, [r]), i = Math.round(r.intent_match_score * 100), f = N(
483
483
  "admesh-component",
484
484
  "admesh-card",
485
485
  "relative p-3 rounded-lg bg-white dark:bg-slate-800 border border-gray-200 dark:border-slate-700 shadow-sm hover:shadow transition-shadow cursor-pointer",
486
- s
487
- ), b = o != null && o.accentColor ? {
488
- "--admesh-primary": o.accentColor,
489
- "--admesh-primary-hover": o.accentColor + "dd"
486
+ n
487
+ ), p = t != null && t.accentColor ? {
488
+ "--admesh-primary": t.accentColor,
489
+ "--admesh-primary-hover": t.accentColor + "dd"
490
490
  // Add some transparency for hover
491
491
  } : void 0;
492
492
  return /* @__PURE__ */ e.jsx(
493
- W,
493
+ B,
494
494
  {
495
- adId: a.ad_id,
496
- admeshLink: a.admesh_link,
497
- productId: a.product_id,
498
- onClick: () => l == null ? void 0 : l(a.ad_id, a.admesh_link),
495
+ adId: r.ad_id,
496
+ admeshLink: r.admesh_link,
497
+ productId: r.product_id,
498
+ onClick: () => o == null ? void 0 : o(r.ad_id, r.admesh_link),
499
499
  trackingData: {
500
- title: a.title,
501
- matchScore: a.intent_match_score
500
+ title: r.title,
501
+ matchScore: r.intent_match_score
502
502
  },
503
- className: v,
503
+ className: f,
504
504
  children: /* @__PURE__ */ e.jsxs(
505
505
  "div",
506
506
  {
507
507
  className: "h-full flex flex-col",
508
- style: b,
509
- "data-admesh-theme": o == null ? void 0 : o.mode,
508
+ style: p,
509
+ "data-admesh-theme": t == null ? void 0 : t.mode,
510
510
  children: [
511
511
  /* @__PURE__ */ e.jsx("div", { className: "flex justify-between items-start mb-2", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
512
512
  m && d.includes("Top Match") && /* @__PURE__ */ e.jsx("span", { className: "text-xs font-semibold text-white bg-black px-2 py-0.5 rounded-full", children: "Top Match" }),
513
- /* @__PURE__ */ e.jsx("h4", { className: "font-semibold text-gray-800 dark:text-gray-200", children: a.title }),
513
+ /* @__PURE__ */ e.jsx("h4", { className: "font-semibold text-gray-800 dark:text-gray-200", children: r.title }),
514
514
  /* @__PURE__ */ e.jsx("div", { className: "flex gap-2", children: /* @__PURE__ */ e.jsxs("button", { className: "text-xs px-2 py-1 rounded-full bg-black text-white hover:bg-gray-800 flex items-center", children: [
515
515
  "Visit",
516
516
  /* @__PURE__ */ e.jsx("svg", { className: "ml-1 h-3 w-3", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14" }) })
517
517
  ] }) })
518
518
  ] }) }),
519
- /* @__PURE__ */ e.jsx("p", { className: "text-sm text-gray-700 dark:text-gray-300 mb-3", children: a.reason }),
520
- n && typeof a.intent_match_score == "number" && /* @__PURE__ */ e.jsxs("div", { className: "mb-3", children: [
519
+ /* @__PURE__ */ e.jsx("p", { className: "text-sm text-gray-700 dark:text-gray-300 mb-3", children: r.reason }),
520
+ a && typeof r.intent_match_score == "number" && /* @__PURE__ */ e.jsxs("div", { className: "mb-3", children: [
521
521
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between text-xs text-gray-500 dark:text-gray-400 mb-1", children: [
522
522
  /* @__PURE__ */ e.jsx("span", { children: "Confidence" }),
523
523
  /* @__PURE__ */ e.jsxs("span", { children: [
524
- u,
524
+ i,
525
525
  "%"
526
526
  ] })
527
527
  ] }),
@@ -529,54 +529,54 @@ const se = ({
529
529
  "div",
530
530
  {
531
531
  className: "bg-black h-1.5",
532
- style: { width: `${u}%` }
532
+ style: { width: `${i}%` }
533
533
  }
534
534
  ) })
535
535
  ] }),
536
536
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-wrap gap-2 text-xs mb-2", children: [
537
- a.pricing && /* @__PURE__ */ e.jsxs("span", { className: "flex items-center text-gray-600 dark:text-gray-400", children: [
537
+ r.pricing && /* @__PURE__ */ e.jsxs("span", { className: "flex items-center text-gray-600 dark:text-gray-400", children: [
538
538
  /* @__PURE__ */ e.jsx("svg", { className: "h-3 w-3 mr-1", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1" }) }),
539
- a.pricing
539
+ r.pricing
540
540
  ] }),
541
- a.has_free_tier && /* @__PURE__ */ e.jsxs("span", { className: "flex items-center px-1.5 py-0.5 bg-gray-100 dark:bg-gray-900/30 text-gray-700 dark:text-gray-400 rounded-full", children: [
541
+ r.has_free_tier && /* @__PURE__ */ e.jsxs("span", { className: "flex items-center px-1.5 py-0.5 bg-gray-100 dark:bg-gray-900/30 text-gray-700 dark:text-gray-400 rounded-full", children: [
542
542
  /* @__PURE__ */ e.jsx("svg", { className: "h-3 w-3 mr-1", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 8v13m0-13V6a2 2 0 112 2h-2zm0 0V5.5A2.5 2.5 0 109.5 8H12zm-7 4h14M5 12a2 2 0 110-4h14a2 2 0 110 4M5 12v7a2 2 0 002 2h10a2 2 0 002-2v-7" }) }),
543
543
  "Free Tier"
544
544
  ] }),
545
- a.trial_days && a.trial_days > 0 && /* @__PURE__ */ e.jsxs("span", { className: "flex items-center text-gray-600 dark:text-gray-400", children: [
545
+ r.trial_days && r.trial_days > 0 && /* @__PURE__ */ e.jsxs("span", { className: "flex items-center text-gray-600 dark:text-gray-400", children: [
546
546
  /* @__PURE__ */ e.jsx("svg", { className: "h-3 w-3 mr-1", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M8 7V3a2 2 0 012-2h4a2 2 0 012 2v4m-6 4v10m6-10v10m-6 0h6" }) }),
547
- a.trial_days,
547
+ r.trial_days,
548
548
  "-day trial"
549
549
  ] })
550
550
  ] }),
551
- a.features && a.features.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "mb-2", children: [
551
+ r.features && r.features.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "mb-2", children: [
552
552
  /* @__PURE__ */ e.jsx("div", { className: "text-xs text-gray-500 dark:text-gray-400 mb-1", children: "Features:" }),
553
- /* @__PURE__ */ e.jsx("div", { className: "flex flex-wrap gap-1.5", children: a.features.map((t, c) => /* @__PURE__ */ e.jsxs(
553
+ /* @__PURE__ */ e.jsx("div", { className: "flex flex-wrap gap-1.5", children: r.features.map((l, c) => /* @__PURE__ */ e.jsxs(
554
554
  "span",
555
555
  {
556
556
  className: "text-xs px-2 py-0.5 rounded-full bg-gray-100 dark:bg-slate-700 text-gray-700 dark:text-gray-300",
557
557
  children: [
558
558
  /* @__PURE__ */ e.jsx("svg", { className: "h-3 w-3 mr-0.5 inline text-gray-500", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" }) }),
559
- t
559
+ l
560
560
  ]
561
561
  },
562
562
  c
563
563
  )) })
564
564
  ] }),
565
- a.integrations && a.integrations.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "mb-2", children: [
565
+ r.integrations && r.integrations.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "mb-2", children: [
566
566
  /* @__PURE__ */ e.jsx("div", { className: "text-xs text-gray-500 dark:text-gray-400 mb-1", children: "Integrates with:" }),
567
- /* @__PURE__ */ e.jsx("div", { className: "flex flex-wrap gap-1.5", children: a.integrations.map((t, c) => /* @__PURE__ */ e.jsxs(
567
+ /* @__PURE__ */ e.jsx("div", { className: "flex flex-wrap gap-1.5", children: r.integrations.map((l, c) => /* @__PURE__ */ e.jsxs(
568
568
  "span",
569
569
  {
570
570
  className: "text-xs px-2 py-0.5 rounded-full bg-gray-100 dark:bg-gray-900/30 text-gray-700 dark:text-gray-300",
571
571
  children: [
572
572
  /* @__PURE__ */ e.jsx("svg", { className: "h-3 w-3 mr-0.5 inline", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10" }) }),
573
- t
573
+ l
574
574
  ]
575
575
  },
576
576
  c
577
577
  )) })
578
578
  ] }),
579
- a.reviews_summary && /* @__PURE__ */ e.jsx("div", { className: "text-xs text-gray-600 dark:text-gray-400 mt-2", children: a.reviews_summary }),
579
+ r.reviews_summary && /* @__PURE__ */ e.jsx("div", { className: "text-xs text-gray-600 dark:text-gray-400 mt-2", children: r.reviews_summary }),
580
580
  /* @__PURE__ */ e.jsx("div", { className: "flex justify-end mt-auto pt-2", children: /* @__PURE__ */ e.jsx("span", { className: "text-xs text-gray-400 dark:text-gray-500", children: "Powered by AdMesh" }) })
581
581
  ]
582
582
  }
@@ -584,29 +584,29 @@ const se = ({
584
584
  }
585
585
  );
586
586
  };
587
- se.displayName = "AdMeshProductCard";
588
- const te = ({
589
- recommendations: a,
590
- theme: o,
591
- maxProducts: n = 3,
587
+ G.displayName = "AdMeshProductCard";
588
+ const oe = ({
589
+ recommendations: r,
590
+ theme: t,
591
+ maxProducts: a = 3,
592
592
  showMatchScores: m = !0,
593
- showFeatures: l = !0,
594
- onProductClick: s,
593
+ showFeatures: o = !0,
594
+ onProductClick: n,
595
595
  className: d
596
596
  }) => {
597
- const u = S(() => a.slice(0, n), [a, n]), v = O(
597
+ const i = z(() => r.slice(0, a), [r, a]), f = N(
598
598
  "admesh-component",
599
599
  "admesh-compare-layout",
600
600
  d
601
- ), b = o != null && o.accentColor ? {
602
- "--admesh-primary": o.accentColor
601
+ ), p = t != null && t.accentColor ? {
602
+ "--admesh-primary": t.accentColor
603
603
  } : void 0;
604
- return u.length === 0 ? /* @__PURE__ */ e.jsx("div", { className: v, children: /* @__PURE__ */ e.jsx("div", { className: "p-8 text-center text-gray-500 dark:text-gray-400", children: /* @__PURE__ */ e.jsx("p", { children: "No products to compare" }) }) }) : /* @__PURE__ */ e.jsx(
604
+ return i.length === 0 ? /* @__PURE__ */ e.jsx("div", { className: f, children: /* @__PURE__ */ e.jsx("div", { className: "p-8 text-center text-gray-500 dark:text-gray-400", children: /* @__PURE__ */ e.jsx("p", { children: "No products to compare" }) }) }) : /* @__PURE__ */ e.jsx(
605
605
  "div",
606
606
  {
607
- className: v,
608
- style: b,
609
- "data-admesh-theme": o == null ? void 0 : o.mode,
607
+ className: f,
608
+ style: p,
609
+ "data-admesh-theme": t == null ? void 0 : t.mode,
610
610
  children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-6", children: [
611
611
  /* @__PURE__ */ e.jsxs("div", { className: "text-center", children: [
612
612
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-center gap-2 mb-2", children: [
@@ -614,17 +614,17 @@ const te = ({
614
614
  /* @__PURE__ */ e.jsx("h3", { className: "text-lg font-semibold text-gray-800 dark:text-gray-200", children: "Smart Comparison" })
615
615
  ] }),
616
616
  /* @__PURE__ */ e.jsxs("p", { className: "text-sm text-gray-600 dark:text-gray-400", children: [
617
- u.length,
617
+ i.length,
618
618
  " intelligent matches found"
619
619
  ] })
620
620
  ] }),
621
- /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4", children: u.map((t, c) => /* @__PURE__ */ e.jsxs(
622
- W,
621
+ /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4", children: i.map((l, c) => /* @__PURE__ */ e.jsxs(
622
+ B,
623
623
  {
624
- adId: t.ad_id,
625
- admeshLink: t.admesh_link,
626
- productId: t.product_id,
627
- onClick: () => s == null ? void 0 : s(t.ad_id, t.admesh_link),
624
+ adId: l.ad_id,
625
+ admeshLink: l.admesh_link,
626
+ productId: l.product_id,
627
+ onClick: () => n == null ? void 0 : n(l.ad_id, l.admesh_link),
628
628
  className: "relative p-4 rounded-lg bg-white dark:bg-slate-800 border border-gray-200 dark:border-slate-700 shadow-sm hover:shadow transition-shadow",
629
629
  children: [
630
630
  /* @__PURE__ */ e.jsxs("div", { className: "flex justify-between items-start mb-3", children: [
@@ -636,16 +636,16 @@ const te = ({
636
636
  ] })
637
637
  ] }),
638
638
  m && /* @__PURE__ */ e.jsxs("div", { className: "text-xs text-gray-500 dark:text-gray-400", children: [
639
- Math.round(t.intent_match_score * 100),
639
+ Math.round(l.intent_match_score * 100),
640
640
  "% match"
641
641
  ] })
642
642
  ] }),
643
- /* @__PURE__ */ e.jsx("h4", { className: "font-semibold text-gray-800 dark:text-gray-200 mb-2", children: t.title }),
643
+ /* @__PURE__ */ e.jsx("h4", { className: "font-semibold text-gray-800 dark:text-gray-200 mb-2", children: l.title }),
644
644
  m && /* @__PURE__ */ e.jsxs("div", { className: "mb-3", children: [
645
645
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between text-xs text-gray-500 dark:text-gray-400 mb-1", children: [
646
646
  /* @__PURE__ */ e.jsx("span", { children: "Confidence" }),
647
647
  /* @__PURE__ */ e.jsxs("span", { children: [
648
- Math.round(t.intent_match_score * 100),
648
+ Math.round(l.intent_match_score * 100),
649
649
  "%"
650
650
  ] })
651
651
  ] }),
@@ -653,29 +653,29 @@ const te = ({
653
653
  "div",
654
654
  {
655
655
  className: "bg-black h-1.5",
656
- style: { width: `${Math.round(t.intent_match_score * 100)}%` }
656
+ style: { width: `${Math.round(l.intent_match_score * 100)}%` }
657
657
  }
658
658
  ) })
659
659
  ] }),
660
660
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-wrap gap-2 text-xs mb-3", children: [
661
- t.pricing && /* @__PURE__ */ e.jsxs("span", { className: "flex items-center text-gray-600 dark:text-gray-400", children: [
661
+ l.pricing && /* @__PURE__ */ e.jsxs("span", { className: "flex items-center text-gray-600 dark:text-gray-400", children: [
662
662
  /* @__PURE__ */ e.jsx("svg", { className: "h-3 w-3 mr-1", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1" }) }),
663
- t.pricing
663
+ l.pricing
664
664
  ] }),
665
- t.has_free_tier && /* @__PURE__ */ e.jsxs("span", { className: "flex items-center px-1.5 py-0.5 bg-gray-100 dark:bg-gray-900/30 text-gray-700 dark:text-gray-400 rounded-full", children: [
665
+ l.has_free_tier && /* @__PURE__ */ e.jsxs("span", { className: "flex items-center px-1.5 py-0.5 bg-gray-100 dark:bg-gray-900/30 text-gray-700 dark:text-gray-400 rounded-full", children: [
666
666
  /* @__PURE__ */ e.jsx("svg", { className: "h-3 w-3 mr-1", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 8v13m0-13V6a2 2 0 112 2h-2zm0 0V5.5A2.5 2.5 0 109.5 8H12zm-7 4h14M5 12a2 2 0 110-4h14a2 2 0 110 4M5 12v7a2 2 0 002 2h10a2 2 0 002-2v-7" }) }),
667
667
  "Free Tier"
668
668
  ] }),
669
- t.trial_days && t.trial_days > 0 && /* @__PURE__ */ e.jsxs("span", { className: "flex items-center text-gray-600 dark:text-gray-400", children: [
669
+ l.trial_days && l.trial_days > 0 && /* @__PURE__ */ e.jsxs("span", { className: "flex items-center text-gray-600 dark:text-gray-400", children: [
670
670
  /* @__PURE__ */ e.jsx("svg", { className: "h-3 w-3 mr-1", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M8 7V3a2 2 0 012-2h4a2 2 0 012 2v4m-6 4v10m6-10v10m-6 0h6" }) }),
671
- t.trial_days,
671
+ l.trial_days,
672
672
  "-day trial"
673
673
  ] })
674
674
  ] }),
675
- l && t.features && t.features.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "mb-3", children: [
675
+ o && l.features && l.features.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "mb-3", children: [
676
676
  /* @__PURE__ */ e.jsx("div", { className: "text-xs text-gray-500 dark:text-gray-400 mb-1", children: "Key Features:" }),
677
677
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-wrap gap-1.5", children: [
678
- t.features.slice(0, 4).map((h, y) => /* @__PURE__ */ e.jsxs(
678
+ l.features.slice(0, 4).map((h, y) => /* @__PURE__ */ e.jsxs(
679
679
  "span",
680
680
  {
681
681
  className: "text-xs px-2 py-0.5 rounded-full bg-gray-100 dark:bg-slate-700 text-gray-700 dark:text-gray-300",
@@ -686,9 +686,9 @@ const te = ({
686
686
  },
687
687
  y
688
688
  )),
689
- (t.features.length || 0) > 4 && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-gray-500 dark:text-gray-400 italic", children: [
689
+ (l.features.length || 0) > 4 && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-gray-500 dark:text-gray-400 italic", children: [
690
690
  "+",
691
- t.features.length - 4,
691
+ l.features.length - 4,
692
692
  " more"
693
693
  ] })
694
694
  ] })
@@ -699,7 +699,7 @@ const te = ({
699
699
  ] })
700
700
  ]
701
701
  },
702
- t.product_id || c
702
+ l.product_id || c
703
703
  )) }),
704
704
  /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-center mt-6 pt-4 border-t border-gray-200/50 dark:border-gray-700/50", children: /* @__PURE__ */ e.jsxs("span", { className: "flex items-center gap-1.5 text-xs text-gray-400 dark:text-gray-500", children: [
705
705
  /* @__PURE__ */ e.jsx("svg", { className: "w-3 h-3 text-indigo-500", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ e.jsx("path", { fillRule: "evenodd", d: "M11.3 1.046A1 1 0 0112 2v5h4a1 1 0 01.82 1.573l-7 10A1 1 0 018 18v-5H4a1 1 0 01-.82-1.573l7-10a1 1 0 011.12-.38z", clipRule: "evenodd" }) }),
@@ -710,40 +710,40 @@ const te = ({
710
710
  }
711
711
  );
712
712
  };
713
- te.displayName = "AdMeshCompareTable";
714
- const je = {
713
+ oe.displayName = "AdMeshCompareTable";
714
+ const we = {
715
715
  "Top Match": "primary",
716
716
  "Free Tier": "success",
717
717
  "AI Powered": "secondary",
718
718
  Popular: "warning",
719
719
  New: "primary",
720
720
  "Trial Available": "success"
721
- }, we = {
721
+ }, Ne = {
722
722
  "Top Match": "★",
723
723
  "Free Tier": "◆",
724
724
  "AI Powered": "◉",
725
725
  Popular: "▲",
726
726
  New: "●",
727
727
  "Trial Available": "◈"
728
- }, Ne = ({
729
- type: a,
730
- variant: o,
731
- size: n = "md",
728
+ }, Me = ({
729
+ type: r,
730
+ variant: t,
731
+ size: a = "md",
732
732
  className: m
733
733
  }) => {
734
- const l = o || je[a] || "secondary", s = we[a], d = O(
734
+ const o = t || we[r] || "secondary", n = Ne[r], d = N(
735
735
  "admesh-component",
736
736
  "admesh-badge",
737
- `admesh-badge--${l}`,
738
- `admesh-badge--${n}`,
737
+ `admesh-badge--${o}`,
738
+ `admesh-badge--${a}`,
739
739
  m
740
740
  );
741
741
  return /* @__PURE__ */ e.jsxs("span", { className: d, children: [
742
- s && /* @__PURE__ */ e.jsx("span", { className: "admesh-badge__icon", children: s }),
743
- /* @__PURE__ */ e.jsx("span", { className: "admesh-badge__text", children: a })
742
+ n && /* @__PURE__ */ e.jsx("span", { className: "admesh-badge__icon", children: n }),
743
+ /* @__PURE__ */ e.jsx("span", { className: "admesh-badge__text", children: r })
744
744
  ] });
745
745
  };
746
- Ne.displayName = "AdMeshBadge";
746
+ Me.displayName = "AdMeshBadge";
747
747
  const Te = `
748
748
  /* AdMesh UI SDK Scoped Styles - Smart Recommendations Design */
749
749
  .admesh-component {
@@ -995,19 +995,19 @@ const Te = `
995
995
  }
996
996
  }
997
997
  `;
998
- let V = !1;
999
- const Ee = () => {
1000
- ae(() => {
1001
- if (V) return;
1002
- const a = document.createElement("style");
1003
- return a.id = "admesh-ui-sdk-styles", a.textContent = Te, document.getElementById("admesh-ui-sdk-styles") || (document.head.appendChild(a), V = !0), () => {
1004
- const o = document.getElementById("admesh-ui-sdk-styles");
1005
- o && document.head.contains(o) && (document.head.removeChild(o), V = !1);
998
+ let H = !1;
999
+ const Ae = () => {
1000
+ J(() => {
1001
+ if (H) return;
1002
+ const r = document.createElement("style");
1003
+ return r.id = "admesh-ui-sdk-styles", r.textContent = Te, document.getElementById("admesh-ui-sdk-styles") || (document.head.appendChild(r), H = !0), () => {
1004
+ const t = document.getElementById("admesh-ui-sdk-styles");
1005
+ t && document.head.contains(t) && (document.head.removeChild(t), H = !1);
1006
1006
  };
1007
1007
  }, []);
1008
- }, Ae = (a, o, n) => {
1009
- if (!n && o)
1010
- switch (o) {
1008
+ }, Ce = (r, t, a) => {
1009
+ if (!a && t)
1010
+ switch (t) {
1011
1011
  case "compare_products":
1012
1012
  return "compare";
1013
1013
  case "best_for_use_case":
@@ -1017,38 +1017,33 @@ const Ee = () => {
1017
1017
  default:
1018
1018
  return "cards";
1019
1019
  }
1020
- const m = a.length;
1020
+ const m = r.length;
1021
1021
  if (m >= 2 && m <= 4) {
1022
- const l = a.some((d) => d.features && d.features.length > 0), s = a.some((d) => d.pricing);
1023
- if (l || s)
1022
+ const o = r.some((d) => d.features && d.features.length > 0), n = r.some((d) => d.pricing);
1023
+ if (o || n)
1024
1024
  return "compare";
1025
1025
  }
1026
1026
  return "cards";
1027
- }, Re = ({
1028
- recommendations: a,
1029
- intentType: o,
1030
- theme: n,
1027
+ }, Ee = ({
1028
+ recommendations: r,
1029
+ intentType: t,
1030
+ theme: a,
1031
1031
  maxDisplayed: m = 6,
1032
- showMatchScores: l = !0,
1033
- showFeatures: s = !0,
1032
+ showMatchScores: o = !0,
1033
+ showFeatures: n = !0,
1034
1034
  autoLayout: d = !0,
1035
- onProductClick: u,
1036
- onTrackView: v,
1037
- className: b
1035
+ onProductClick: i,
1036
+ onTrackView: f,
1037
+ className: p
1038
1038
  }) => {
1039
- Ee();
1040
- const t = S(() => a.slice(0, m), [a, m]), c = S(() => Ae(t, o, d), [t, o, d]), h = O(
1039
+ Ae();
1040
+ const l = z(() => r.slice(0, m), [r, m]), c = z(() => Ce(l, t, d), [l, t, d]), h = N(
1041
1041
  "admesh-component",
1042
- "admesh-layout",
1043
- `admesh-layout--${c}`,
1044
- {
1045
- [`admesh-layout--${n == null ? void 0 : n.mode}`]: n == null ? void 0 : n.mode
1046
- },
1047
- b
1048
- ), y = n != null && n.accentColor ? {
1049
- "--admesh-primary": n.accentColor
1042
+ p
1043
+ ), y = a != null && a.accentColor ? {
1044
+ "--admesh-primary": a.accentColor
1050
1045
  } : void 0;
1051
- return t.length === 0 ? /* @__PURE__ */ e.jsx("div", { className: h, children: /* @__PURE__ */ e.jsx("div", { className: "admesh-layout__empty", children: /* @__PURE__ */ e.jsxs("div", { className: "admesh-layout__empty-content", children: [
1046
+ return l.length === 0 ? /* @__PURE__ */ e.jsx("div", { className: h, children: /* @__PURE__ */ e.jsx("div", { className: "admesh-layout__empty", children: /* @__PURE__ */ e.jsxs("div", { className: "admesh-layout__empty-content", children: [
1052
1047
  /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-center mb-3", children: /* @__PURE__ */ e.jsx("svg", { className: "w-8 h-8 text-indigo-500", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ e.jsx("path", { fillRule: "evenodd", d: "M11.3 1.046A1 1 0 0112 2v5h4a1 1 0 01.82 1.573l-7 10A1 1 0 018 18v-5H4a1 1 0 01-.82-1.573l7-10a1 1 0 011.12-.38z", clipRule: "evenodd" }) }) }),
1053
1048
  /* @__PURE__ */ e.jsx("h3", { className: "admesh-text-lg admesh-font-semibold admesh-text-muted", children: "No smart recommendations found" }),
1054
1049
  /* @__PURE__ */ e.jsx("p", { className: "admesh-text-sm admesh-text-muted", children: "Try refining your search or check back later for new matches." })
@@ -1057,50 +1052,381 @@ const Ee = () => {
1057
1052
  {
1058
1053
  className: h,
1059
1054
  style: y,
1060
- "data-admesh-theme": n == null ? void 0 : n.mode,
1055
+ "data-admesh-theme": a == null ? void 0 : a.mode,
1061
1056
  children: c === "compare" ? /* @__PURE__ */ e.jsx(
1062
- te,
1057
+ oe,
1063
1058
  {
1064
- recommendations: t,
1065
- theme: n,
1066
- maxProducts: Math.min(t.length, 4),
1067
- showMatchScores: l,
1068
- showFeatures: s,
1069
- onProductClick: u
1059
+ recommendations: l,
1060
+ theme: a,
1061
+ maxProducts: Math.min(l.length, 4),
1062
+ showMatchScores: o,
1063
+ showFeatures: n,
1064
+ onProductClick: i
1070
1065
  }
1071
- ) : /* @__PURE__ */ e.jsxs("div", { className: "admesh-layout__cards-container", children: [
1072
- /* @__PURE__ */ e.jsx("div", { className: "admesh-layout__header", children: /* @__PURE__ */ e.jsxs("p", { className: "admesh-layout__subtitle admesh-text-sm admesh-text-muted", children: [
1073
- t.length,
1074
- " intelligent match",
1075
- t.length !== 1 ? "es" : "",
1076
- " found"
1077
- ] }) }),
1078
- /* @__PURE__ */ e.jsx("div", { className: "space-y-4", children: t.map((f, _) => /* @__PURE__ */ e.jsx(
1079
- se,
1066
+ ) : /* @__PURE__ */ e.jsx("div", { className: "space-y-4", children: l.map((x, b) => /* @__PURE__ */ e.jsx(
1067
+ G,
1068
+ {
1069
+ recommendation: x,
1070
+ theme: a,
1071
+ showMatchScore: o,
1072
+ showBadges: !0,
1073
+ maxKeywords: 3,
1074
+ onClick: i,
1075
+ onTrackView: f
1076
+ },
1077
+ x.product_id || x.ad_id || b
1078
+ )) })
1079
+ }
1080
+ );
1081
+ };
1082
+ Ee.displayName = "AdMeshLayout";
1083
+ const O = ({
1084
+ recommendation: r,
1085
+ theme: t,
1086
+ compact: a = !1,
1087
+ showReason: m = !0,
1088
+ onClick: o,
1089
+ className: n
1090
+ }) => {
1091
+ const d = Math.round(r.intent_match_score * 100), i = N(
1092
+ "admesh-inline-recommendation",
1093
+ "group cursor-pointer transition-all duration-200",
1094
+ {
1095
+ "p-2 rounded-md bg-gray-50 dark:bg-slate-800/50 hover:bg-gray-100 dark:hover:bg-slate-800 border border-gray-200 dark:border-slate-700": !a,
1096
+ "p-1.5 rounded hover:bg-gray-50 dark:hover:bg-slate-800/30": a
1097
+ },
1098
+ n
1099
+ ), f = t != null && t.accentColor ? {
1100
+ "--admesh-primary": t.accentColor
1101
+ } : void 0;
1102
+ return /* @__PURE__ */ e.jsx(
1103
+ B,
1104
+ {
1105
+ adId: r.ad_id,
1106
+ admeshLink: r.admesh_link,
1107
+ productId: r.product_id,
1108
+ onClick: () => o == null ? void 0 : o(r.ad_id, r.admesh_link),
1109
+ trackingData: {
1110
+ title: r.title,
1111
+ matchScore: r.intent_match_score
1112
+ },
1113
+ className: i,
1114
+ children: /* @__PURE__ */ e.jsxs(
1115
+ "div",
1116
+ {
1117
+ className: "flex items-start gap-3",
1118
+ style: f,
1119
+ "data-admesh-theme": t == null ? void 0 : t.mode,
1120
+ children: [
1121
+ /* @__PURE__ */ e.jsx("div", { className: "flex-shrink-0 mt-0.5", children: r.intent_match_score >= 0.8 ? /* @__PURE__ */ e.jsx("div", { className: "w-2 h-2 bg-green-500 rounded-full" }) : /* @__PURE__ */ e.jsx("div", { className: "w-2 h-2 bg-blue-500 rounded-full" }) }),
1122
+ /* @__PURE__ */ e.jsxs("div", { className: "flex-1 min-w-0", children: [
1123
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 mb-1", children: [
1124
+ /* @__PURE__ */ e.jsx("h4", { className: N(
1125
+ "font-medium text-gray-900 dark:text-gray-100 truncate",
1126
+ a ? "text-sm" : "text-base"
1127
+ ), children: r.title }),
1128
+ r.intent_match_score >= 0.7 && /* @__PURE__ */ e.jsxs("span", { className: N(
1129
+ "inline-flex items-center px-1.5 py-0.5 rounded-full text-xs font-medium",
1130
+ r.intent_match_score >= 0.8 ? "bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400" : "bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400"
1131
+ ), children: [
1132
+ d,
1133
+ "% match"
1134
+ ] })
1135
+ ] }),
1136
+ m && r.reason && /* @__PURE__ */ e.jsx("p", { className: N(
1137
+ "text-gray-600 dark:text-gray-400 line-clamp-2",
1138
+ a ? "text-xs" : "text-sm"
1139
+ ), children: r.reason }),
1140
+ !a && r.keywords && r.keywords.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-wrap gap-1 mt-2", children: [
1141
+ r.keywords.slice(0, 3).map((p, l) => /* @__PURE__ */ e.jsx(
1142
+ "span",
1143
+ {
1144
+ className: "inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-gray-100 text-gray-800 dark:bg-slate-700 dark:text-gray-300",
1145
+ children: p
1146
+ },
1147
+ l
1148
+ )),
1149
+ r.keywords.length > 3 && /* @__PURE__ */ e.jsxs("span", { className: "text-xs text-gray-500 dark:text-gray-400", children: [
1150
+ "+",
1151
+ r.keywords.length - 3,
1152
+ " more"
1153
+ ] })
1154
+ ] }),
1155
+ !a && (r.has_free_tier || r.trial_days) && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 mt-2", children: [
1156
+ r.has_free_tier && /* @__PURE__ */ e.jsx("span", { className: "inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400", children: "Free tier" }),
1157
+ r.trial_days && r.trial_days > 0 && /* @__PURE__ */ e.jsxs("span", { className: "inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400", children: [
1158
+ r.trial_days,
1159
+ "-day trial"
1160
+ ] })
1161
+ ] })
1162
+ ] }),
1163
+ /* @__PURE__ */ e.jsx("div", { className: "flex-shrink-0 opacity-0 group-hover:opacity-100 transition-opacity", children: /* @__PURE__ */ e.jsx(
1164
+ "svg",
1165
+ {
1166
+ className: "w-4 h-4 text-gray-400 dark:text-gray-500",
1167
+ fill: "none",
1168
+ stroke: "currentColor",
1169
+ viewBox: "0 0 24 24",
1170
+ children: /* @__PURE__ */ e.jsx(
1171
+ "path",
1172
+ {
1173
+ strokeLinecap: "round",
1174
+ strokeLinejoin: "round",
1175
+ strokeWidth: 2,
1176
+ d: "M9 5l7 7-7 7"
1177
+ }
1178
+ )
1179
+ }
1180
+ ) })
1181
+ ]
1182
+ }
1183
+ )
1184
+ }
1185
+ );
1186
+ }, Re = ({
1187
+ recommendations: r,
1188
+ conversationSummary: t,
1189
+ theme: a,
1190
+ showTopRecommendations: m = 3,
1191
+ onRecommendationClick: o,
1192
+ onStartNewConversation: n,
1193
+ className: d
1194
+ }) => {
1195
+ const i = r.sort((l, c) => c.intent_match_score - l.intent_match_score).slice(0, m), f = N(
1196
+ "admesh-conversation-summary",
1197
+ "bg-gradient-to-br from-slate-50 to-blue-50 dark:from-slate-900 dark:to-slate-800",
1198
+ "rounded-lg border border-gray-200 dark:border-slate-700 p-6",
1199
+ d
1200
+ ), p = a != null && a.accentColor ? {
1201
+ "--admesh-primary": a.accentColor
1202
+ } : void 0;
1203
+ return /* @__PURE__ */ e.jsxs(
1204
+ "div",
1205
+ {
1206
+ className: f,
1207
+ style: p,
1208
+ "data-admesh-theme": a == null ? void 0 : a.mode,
1209
+ children: [
1210
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3 mb-4", children: [
1211
+ /* @__PURE__ */ e.jsx("div", { className: "flex-shrink-0", children: /* @__PURE__ */ e.jsx("div", { className: "w-10 h-10 bg-gradient-to-br from-blue-500 to-indigo-600 rounded-full flex items-center justify-center", children: /* @__PURE__ */ e.jsx("svg", { className: "w-5 h-5 text-white", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" }) }) }) }),
1212
+ /* @__PURE__ */ e.jsxs("div", { children: [
1213
+ /* @__PURE__ */ e.jsx("h3", { className: "text-lg font-semibold text-gray-900 dark:text-gray-100", children: "Conversation Summary" }),
1214
+ /* @__PURE__ */ e.jsx("p", { className: "text-sm text-gray-600 dark:text-gray-400", children: "Here's what we discussed and found for you" })
1215
+ ] })
1216
+ ] }),
1217
+ /* @__PURE__ */ e.jsx("div", { className: "mb-6", children: /* @__PURE__ */ e.jsx("div", { className: "bg-white dark:bg-slate-800 rounded-lg p-4 border border-gray-100 dark:border-slate-700", children: /* @__PURE__ */ e.jsx("p", { className: "text-gray-700 dark:text-gray-300 leading-relaxed", children: t }) }) }),
1218
+ i.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "mb-6", children: [
1219
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 mb-3", children: [
1220
+ /* @__PURE__ */ e.jsx("svg", { className: "w-5 h-5 text-blue-600 dark:text-blue-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 10V3L4 14h7v7l9-11h-7z" }) }),
1221
+ /* @__PURE__ */ e.jsx("h4", { className: "font-medium text-gray-900 dark:text-gray-100", children: "Top Recommendations" })
1222
+ ] }),
1223
+ /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: i.map((l, c) => /* @__PURE__ */ e.jsxs("div", { className: "relative", children: [
1224
+ /* @__PURE__ */ e.jsx("div", { className: "absolute -left-2 top-2 z-10", children: /* @__PURE__ */ e.jsx("div", { className: N(
1225
+ "w-6 h-6 rounded-full flex items-center justify-center text-xs font-bold text-white",
1226
+ c === 0 ? "bg-yellow-500" : c === 1 ? "bg-gray-400" : "bg-orange-400"
1227
+ ), children: c + 1 }) }),
1228
+ /* @__PURE__ */ e.jsx("div", { className: "ml-4", children: /* @__PURE__ */ e.jsx(
1229
+ O,
1230
+ {
1231
+ recommendation: l,
1232
+ theme: a,
1233
+ compact: !1,
1234
+ showReason: !0,
1235
+ onClick: o
1236
+ }
1237
+ ) })
1238
+ ] }, l.ad_id || c)) })
1239
+ ] }),
1240
+ r.length > m && /* @__PURE__ */ e.jsx("div", { className: "mb-6", children: /* @__PURE__ */ e.jsx("div", { className: "bg-blue-50 dark:bg-blue-900/20 rounded-lg p-3 border border-blue-200 dark:border-blue-800", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
1241
+ /* @__PURE__ */ e.jsx("svg", { className: "w-4 h-4 text-blue-600 dark:text-blue-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }),
1242
+ /* @__PURE__ */ e.jsxs("span", { className: "text-sm font-medium text-blue-800 dark:text-blue-300", children: [
1243
+ r.length - m,
1244
+ " additional recommendation",
1245
+ r.length - m > 1 ? "s" : "",
1246
+ " available"
1247
+ ] })
1248
+ ] }) }) }),
1249
+ /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col sm:flex-row gap-3", children: [
1250
+ n && /* @__PURE__ */ e.jsxs(
1251
+ "button",
1252
+ {
1253
+ onClick: n,
1254
+ className: "flex-1 bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-700 hover:to-indigo-700 text-white font-medium py-2.5 px-4 rounded-lg transition-all duration-200 flex items-center justify-center gap-2",
1255
+ children: [
1256
+ /* @__PURE__ */ e.jsx("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }),
1257
+ "Start New Conversation"
1258
+ ]
1259
+ }
1260
+ ),
1261
+ /* @__PURE__ */ e.jsxs(
1262
+ "button",
1263
+ {
1264
+ onClick: () => {
1265
+ i.length > 0 && (o == null || o(i[0].ad_id, i[0].admesh_link));
1266
+ },
1267
+ className: "flex-1 bg-white dark:bg-slate-800 hover:bg-gray-50 dark:hover:bg-slate-700 text-gray-700 dark:text-gray-300 font-medium py-2.5 px-4 rounded-lg border border-gray-300 dark:border-slate-600 transition-all duration-200 flex items-center justify-center gap-2",
1268
+ children: [
1269
+ /* @__PURE__ */ e.jsx("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14" }) }),
1270
+ "View Top Pick"
1271
+ ]
1272
+ }
1273
+ )
1274
+ ] }),
1275
+ /* @__PURE__ */ e.jsx("div", { className: "flex justify-center mt-4 pt-4 border-t border-gray-200 dark:border-slate-700", children: /* @__PURE__ */ e.jsx("span", { className: "text-xs text-gray-500 dark:text-gray-400", children: "Powered by AdMesh" }) })
1276
+ ]
1277
+ }
1278
+ );
1279
+ }, Ie = ({
1280
+ recommendations: r,
1281
+ config: t,
1282
+ theme: a,
1283
+ conversationSummary: m,
1284
+ userQuery: o,
1285
+ sessionId: n,
1286
+ onRecommendationClick: d,
1287
+ onDismiss: i,
1288
+ className: f
1289
+ }) => {
1290
+ const [p, l] = I(t.autoShow !== !1), [c, h] = I(!1);
1291
+ if (J(() => {
1292
+ if (t.delayMs && t.delayMs > 0) {
1293
+ const j = setTimeout(() => {
1294
+ l(!0), h(!0);
1295
+ }, t.delayMs);
1296
+ return () => clearTimeout(j);
1297
+ } else
1298
+ h(!0);
1299
+ }, [t.delayMs]), !p || r.length === 0)
1300
+ return null;
1301
+ const y = t.maxRecommendations || 3, x = r.slice(0, y), b = (j, T) => {
1302
+ d == null || d(j, T);
1303
+ }, _ = () => {
1304
+ l(!1), i == null || i();
1305
+ }, w = () => {
1306
+ switch (t.displayMode) {
1307
+ case "summary":
1308
+ return m ? /* @__PURE__ */ e.jsx(
1309
+ Re,
1310
+ {
1311
+ recommendations: x,
1312
+ conversationSummary: m,
1313
+ theme: a,
1314
+ showTopRecommendations: y,
1315
+ onRecommendationClick: b,
1316
+ onStartNewConversation: i
1317
+ }
1318
+ ) : null;
1319
+ case "inline":
1320
+ return /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: x.map((j, T) => /* @__PURE__ */ e.jsx(
1321
+ O,
1322
+ {
1323
+ recommendation: j,
1324
+ theme: a,
1325
+ compact: !0,
1326
+ showReason: !0,
1327
+ onClick: b
1328
+ },
1329
+ j.ad_id || T
1330
+ )) });
1331
+ case "minimal":
1332
+ return x.length > 0 ? /* @__PURE__ */ e.jsxs("div", { className: "admesh-minimal-unit", children: [
1333
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 mb-2", children: [
1334
+ /* @__PURE__ */ e.jsx("div", { className: "w-2 h-2 bg-blue-500 rounded-full" }),
1335
+ /* @__PURE__ */ e.jsxs("span", { className: "text-sm font-medium text-gray-700 dark:text-gray-300", children: [
1336
+ x.length,
1337
+ " intelligent match",
1338
+ x.length > 1 ? "es" : "",
1339
+ " found"
1340
+ ] })
1341
+ ] }),
1342
+ /* @__PURE__ */ e.jsx(
1343
+ O,
1344
+ {
1345
+ recommendation: x[0],
1346
+ theme: a,
1347
+ compact: !0,
1348
+ showReason: !1,
1349
+ onClick: b
1350
+ }
1351
+ ),
1352
+ x.length > 1 && /* @__PURE__ */ e.jsxs("div", { className: "text-xs text-gray-500 dark:text-gray-400 mt-1", children: [
1353
+ "+",
1354
+ x.length - 1,
1355
+ " more recommendation",
1356
+ x.length > 2 ? "s" : ""
1357
+ ] })
1358
+ ] }) : null;
1359
+ case "floating":
1360
+ return /* @__PURE__ */ e.jsxs("div", { className: "admesh-floating-unit bg-white dark:bg-slate-800 rounded-lg shadow-lg border border-gray-200 dark:border-slate-700 p-4", children: [
1361
+ /* @__PURE__ */ e.jsxs("div", { className: "flex justify-between items-start mb-3", children: [
1362
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
1363
+ /* @__PURE__ */ e.jsx("div", { className: "w-2 h-2 bg-blue-500 rounded-full" }),
1364
+ /* @__PURE__ */ e.jsx("span", { className: "text-sm font-semibold text-gray-800 dark:text-gray-200", children: "Recommended for you" })
1365
+ ] }),
1366
+ i && /* @__PURE__ */ e.jsx(
1367
+ "button",
1368
+ {
1369
+ onClick: _,
1370
+ className: "text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors",
1371
+ "aria-label": "Dismiss recommendations",
1372
+ children: /* @__PURE__ */ e.jsx("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) })
1373
+ }
1374
+ )
1375
+ ] }),
1376
+ /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: x.map((j, T) => /* @__PURE__ */ e.jsx(
1377
+ O,
1378
+ {
1379
+ recommendation: j,
1380
+ theme: a,
1381
+ compact: !0,
1382
+ showReason: !1,
1383
+ onClick: b
1384
+ },
1385
+ j.ad_id || T
1386
+ )) })
1387
+ ] });
1388
+ default:
1389
+ return /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: x.map((j, T) => /* @__PURE__ */ e.jsx(
1390
+ G,
1080
1391
  {
1081
- recommendation: f,
1082
- theme: n,
1083
- showMatchScore: l,
1392
+ recommendation: j,
1393
+ theme: a,
1394
+ showMatchScore: !1,
1084
1395
  showBadges: !0,
1085
- maxKeywords: 3,
1086
- onClick: u,
1087
- onTrackView: v
1396
+ onClick: b
1088
1397
  },
1089
- f.product_id || f.ad_id || _
1090
- )) }),
1091
- a.length > m && /* @__PURE__ */ e.jsx("div", { className: "admesh-layout__more-indicator", children: /* @__PURE__ */ e.jsxs("p", { className: "admesh-text-sm admesh-text-muted", children: [
1092
- "Showing ",
1093
- m,
1094
- " of ",
1095
- a.length,
1096
- " smart recommendations"
1097
- ] }) })
1098
- ] })
1398
+ j.ad_id || T
1399
+ )) });
1400
+ }
1401
+ }, C = N(
1402
+ "admesh-conversational-unit",
1403
+ "transition-all duration-300 ease-in-out",
1404
+ {
1405
+ "opacity-0 translate-y-2": !c,
1406
+ "opacity-100 translate-y-0": c,
1407
+ "fixed bottom-4 right-4 max-w-sm z-50": t.displayMode === "floating",
1408
+ "my-3": t.displayMode === "inline",
1409
+ "mt-4 pt-4 border-t border-gray-200 dark:border-slate-700": t.displayMode === "summary"
1410
+ },
1411
+ f
1412
+ ), V = a != null && a.accentColor ? {
1413
+ "--admesh-primary": a.accentColor
1414
+ } : void 0;
1415
+ return /* @__PURE__ */ e.jsxs(
1416
+ "div",
1417
+ {
1418
+ className: C,
1419
+ style: V,
1420
+ "data-admesh-theme": a == null ? void 0 : a.mode,
1421
+ "data-admesh-context": t.context,
1422
+ "data-session-id": n,
1423
+ children: [
1424
+ w(),
1425
+ t.showPoweredBy !== !1 && /* @__PURE__ */ e.jsx("div", { className: "flex justify-end mt-2", children: /* @__PURE__ */ e.jsx("span", { className: "text-xs text-gray-400 dark:text-gray-500", children: "Powered by AdMesh" }) })
1426
+ ]
1099
1427
  }
1100
1428
  );
1101
- };
1102
- Re.displayName = "AdMeshLayout";
1103
- const Pe = "0.2.1", Le = {
1429
+ }, ze = "0.2.1", Be = {
1104
1430
  trackingEnabled: !0,
1105
1431
  debug: !1,
1106
1432
  theme: {
@@ -1109,17 +1435,20 @@ const Pe = "0.2.1", Le = {
1109
1435
  }
1110
1436
  };
1111
1437
  export {
1112
- Ne as AdMeshBadge,
1113
- te as AdMeshCompareTable,
1114
- Re as AdMeshLayout,
1115
- W as AdMeshLinkTracker,
1116
- se as AdMeshProductCard,
1117
- Le as DEFAULT_CONFIG,
1118
- Pe as VERSION,
1119
- Se as buildAdMeshLink,
1438
+ Me as AdMeshBadge,
1439
+ oe as AdMeshCompareTable,
1440
+ Re as AdMeshConversationSummary,
1441
+ Ie as AdMeshConversationalUnit,
1442
+ O as AdMeshInlineRecommendation,
1443
+ Ee as AdMeshLayout,
1444
+ B as AdMeshLinkTracker,
1445
+ G as AdMeshProductCard,
1446
+ Be as DEFAULT_CONFIG,
1447
+ ze as VERSION,
1448
+ Pe as buildAdMeshLink,
1120
1449
  Oe as extractTrackingData,
1121
- Ce as setAdMeshTrackerConfig,
1122
- Ee as useAdMeshStyles,
1123
- ke as useAdMeshTracker
1450
+ Le as setAdMeshTrackerConfig,
1451
+ Ae as useAdMeshStyles,
1452
+ _e as useAdMeshTracker
1124
1453
  };
1125
1454
  //# sourceMappingURL=index.mjs.map