@articles-media/articles-dev-box 1.0.5 → 1.0.6

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/Ad.js CHANGED
@@ -1,100 +1,100 @@
1
1
  import { j as s } from "./jsx-runtime-tc70JA_2.js";
2
2
  import * as w from "react";
3
- import { lazy as q, memo as K, useState as p, useEffect as R } from "react";
4
- import { u as W, a as M } from "./index-CsgQIn35.js";
5
- import { A as G } from "./Button-B5nVYPMZ.js";
6
- var $ = /* @__PURE__ */ new Map(), k = /* @__PURE__ */ new WeakMap(), P = 0, H;
7
- function J(e) {
8
- return e ? (k.has(e) || (P += 1, k.set(e, P.toString())), k.get(e)) : "0";
3
+ import { lazy as X, memo as G, useState as p, useEffect as I } from "react";
4
+ import { u as W, a as D, t as V, m as z, L as H } from "./toDate-CDo8dBwb.js";
5
+ import { A as J } from "./Button-B5nVYPMZ.js";
6
+ var S = /* @__PURE__ */ new Map(), R = /* @__PURE__ */ new WeakMap(), O = 0, Q;
7
+ function Y(e) {
8
+ return e ? (R.has(e) || (O += 1, R.set(e, O.toString())), R.get(e)) : "0";
9
9
  }
10
- function Q(e) {
10
+ function Z(e) {
11
11
  return Object.keys(e).sort().filter(
12
12
  (t) => e[t] !== void 0
13
- ).map((t) => `${t}_${t === "root" ? J(e.root) : e[t]}`).toString();
13
+ ).map((t) => `${t}_${t === "root" ? Y(e.root) : e[t]}`).toString();
14
14
  }
15
- function Y(e) {
16
- const t = Q(e);
17
- let a = $.get(t);
15
+ function ee(e) {
16
+ const t = Z(e);
17
+ let a = S.get(t);
18
18
  if (!a) {
19
- const o = /* @__PURE__ */ new Map();
20
- let l;
21
- const n = new IntersectionObserver((c) => {
19
+ const n = /* @__PURE__ */ new Map();
20
+ let d;
21
+ const o = new IntersectionObserver((c) => {
22
22
  c.forEach((i) => {
23
- var u;
24
- const N = i.isIntersecting && l.some((v) => i.intersectionRatio >= v);
25
- e.trackVisibility && typeof i.isVisible > "u" && (i.isVisible = N), (u = o.get(i.target)) == null || u.forEach((v) => {
26
- v(N, i);
23
+ var f;
24
+ const b = i.isIntersecting && d.some((x) => i.intersectionRatio >= x);
25
+ e.trackVisibility && typeof i.isVisible > "u" && (i.isVisible = b), (f = n.get(i.target)) == null || f.forEach((x) => {
26
+ x(b, i);
27
27
  });
28
28
  });
29
29
  }, e);
30
- l = n.thresholds || (Array.isArray(e.threshold) ? e.threshold : [e.threshold || 0]), a = {
30
+ d = o.thresholds || (Array.isArray(e.threshold) ? e.threshold : [e.threshold || 0]), a = {
31
31
  id: t,
32
- observer: n,
33
- elements: o
34
- }, $.set(t, a);
32
+ observer: o,
33
+ elements: n
34
+ }, S.set(t, a);
35
35
  }
36
36
  return a;
37
37
  }
38
- function Z(e, t, a = {}, o = H) {
39
- if (typeof window.IntersectionObserver > "u" && o !== void 0) {
40
- const u = e.getBoundingClientRect();
41
- return t(o, {
42
- isIntersecting: o,
38
+ function se(e, t, a = {}, n = Q) {
39
+ if (typeof window.IntersectionObserver > "u" && n !== void 0) {
40
+ const f = e.getBoundingClientRect();
41
+ return t(n, {
42
+ isIntersecting: n,
43
43
  target: e,
44
44
  intersectionRatio: typeof a.threshold == "number" ? a.threshold : 0,
45
45
  time: 0,
46
- boundingClientRect: u,
47
- intersectionRect: u,
48
- rootBounds: u
46
+ boundingClientRect: f,
47
+ intersectionRect: f,
48
+ rootBounds: f
49
49
  }), () => {
50
50
  };
51
51
  }
52
- const { id: l, observer: n, elements: c } = Y(a), i = c.get(e) || [];
53
- return c.has(e) || c.set(e, i), i.push(t), n.observe(e), function() {
54
- i.splice(i.indexOf(t), 1), i.length === 0 && (c.delete(e), n.unobserve(e)), c.size === 0 && (n.disconnect(), $.delete(l));
52
+ const { id: d, observer: o, elements: c } = ee(a), i = c.get(e) || [];
53
+ return c.has(e) || c.set(e, i), i.push(t), o.observe(e), function() {
54
+ i.splice(i.indexOf(t), 1), i.length === 0 && (c.delete(e), o.unobserve(e)), c.size === 0 && (o.disconnect(), S.delete(d));
55
55
  };
56
56
  }
57
- function ee({
57
+ function te({
58
58
  threshold: e,
59
59
  delay: t,
60
60
  trackVisibility: a,
61
- rootMargin: o,
62
- root: l,
63
- triggerOnce: n,
61
+ rootMargin: n,
62
+ root: d,
63
+ triggerOnce: o,
64
64
  skip: c,
65
65
  initialInView: i,
66
- fallbackInView: u,
67
- onChange: N
66
+ fallbackInView: f,
67
+ onChange: b
68
68
  } = {}) {
69
- var v;
70
- const [_, x] = w.useState(null), y = w.useRef(N), d = w.useRef(i), [g, E] = w.useState({
69
+ var x;
70
+ const [_, j] = w.useState(null), y = w.useRef(b), u = w.useRef(i), [g, k] = w.useState({
71
71
  inView: !!i,
72
72
  entry: void 0
73
73
  });
74
- y.current = N, w.useEffect(
74
+ y.current = b, w.useEffect(
75
75
  () => {
76
- if (d.current === void 0 && (d.current = i), c || !_) return;
77
- let j;
78
- return j = Z(
76
+ if (u.current === void 0 && (u.current = i), c || !_) return;
77
+ let v;
78
+ return v = se(
79
79
  _,
80
- (I, b) => {
81
- const C = d.current;
82
- d.current = I, !(C === void 0 && !I) && (E({
83
- inView: I,
84
- entry: b
85
- }), y.current && y.current(I, b), b.isIntersecting && n && j && (j(), j = void 0));
80
+ (N, E) => {
81
+ const $ = u.current;
82
+ u.current = N, !($ === void 0 && !N) && (k({
83
+ inView: N,
84
+ entry: E
85
+ }), y.current && y.current(N, E), E.isIntersecting && o && v && (v(), v = void 0));
86
86
  },
87
87
  {
88
- root: l,
89
- rootMargin: o,
88
+ root: d,
89
+ rootMargin: n,
90
90
  threshold: e,
91
91
  // @ts-expect-error
92
92
  trackVisibility: a,
93
93
  delay: t
94
94
  },
95
- u
95
+ f
96
96
  ), () => {
97
- j && j();
97
+ v && v();
98
98
  };
99
99
  },
100
100
  // We break the rule here, because we aren't including the actual `threshold` variable
@@ -103,91 +103,85 @@ function ee({
103
103
  // If the threshold is an array, convert it to a string, so it won't change between renders.
104
104
  Array.isArray(e) ? e.toString() : e,
105
105
  _,
106
- l,
107
- o,
106
+ d,
108
107
  n,
108
+ o,
109
109
  c,
110
110
  a,
111
- u,
111
+ f,
112
112
  t
113
113
  ]
114
114
  );
115
- const D = (v = g.entry) == null ? void 0 : v.target, A = w.useRef(void 0);
116
- !_ && D && !n && !c && A.current !== D && (A.current = D, E({
115
+ const A = (x = g.entry) == null ? void 0 : x.target, M = w.useRef(void 0);
116
+ !_ && A && !o && !c && M.current !== A && (M.current = A, k({
117
117
  inView: !!i,
118
118
  entry: void 0
119
- }), d.current = i);
120
- const h = [x, g.inView, g.entry];
119
+ }), u.current = i);
120
+ const h = [j, g.inView, g.entry];
121
121
  return h.ref = h[0], h.inView = h[1], h.entry = h[2], h;
122
122
  }
123
- const se = async (e) => {
123
+ const re = async (e) => {
124
124
  if (process.env.NODE_ENV === "development")
125
125
  try {
126
- return (await M.get(`http://localhost:3001/api/ads/${e.ad_id}`, {
126
+ return (await D.get(`http://localhost:3001/api/ads/${e.ad_id}`, {
127
127
  params: {
128
128
  ad_id: e.ad_id
129
129
  }
130
130
  })).data.result;
131
131
  } catch {
132
132
  }
133
- return M.get(e.url, {
133
+ return D.get(e.url, {
134
134
  params: {
135
135
  ad_id: e.ad_id
136
136
  }
137
137
  }).then((t) => t.data.result);
138
- }, te = 60, re = {
139
- dedupingInterval: 1e3 * 60 * te
138
+ }, oe = 60, ne = {
139
+ dedupingInterval: 1e3 * 60 * oe
140
140
  // keepPreviousData: true,
141
141
  // fallbackData: []
142
- }, ne = (e) => {
143
- const { data: t, error: a, isLoading: o, mutate: l } = W(
142
+ }, ae = (e) => {
143
+ const { data: t, error: a, isLoading: n, mutate: d } = W(
144
144
  e ? {
145
145
  url: `https://articles.media/api/ads/${e}`,
146
146
  ad_id: e
147
147
  } : null,
148
- se,
149
- re
148
+ re,
149
+ ne
150
150
  );
151
151
  return {
152
152
  data: t,
153
153
  error: a,
154
- isLoading: o,
155
- mutate: l
154
+ isLoading: n,
155
+ mutate: d
156
156
  };
157
- }, X = 6e4, T = /* @__PURE__ */ Symbol.for("constructDateFrom");
158
- function oe(e, t) {
159
- return typeof e == "function" ? e(t) : e && typeof e == "object" && T in e ? e[T](t) : e instanceof Date ? new e.constructor(t) : new Date(t);
160
- }
161
- function L(e, t) {
162
- return oe(e, e);
163
- }
164
- function ae(e) {
157
+ };
158
+ function ie(e) {
165
159
  return (t) => {
166
- const o = (e ? Math[e] : Math.trunc)(t);
167
- return o === 0 ? 0 : o;
160
+ const n = (e ? Math[e] : Math.trunc)(t);
161
+ return n === 0 ? 0 : n;
168
162
  };
169
163
  }
170
- function ie(e, t) {
171
- return +L(e) - +L(t);
164
+ function ce(e, t) {
165
+ return +V(e) - +V(t);
172
166
  }
173
- function O(e, t, a) {
174
- const o = ie(e, t) / X;
175
- return ae(a?.roundingMethod)(o);
167
+ function T(e, t, a) {
168
+ const n = ce(e, t) / z;
169
+ return ie(a?.roundingMethod)(n);
176
170
  }
177
171
  function B(e) {
178
- return Math.trunc(e * X);
172
+ return Math.trunc(e * z);
179
173
  }
180
- const ce = async (e) => {
174
+ const de = async (e) => {
181
175
  if (process.env.NODE_ENV === "development")
182
176
  try {
183
- return (await M.get("http://localhost:3001/api/ads", {
177
+ return (await D.get("http://localhost:3001/api/ads", {
184
178
  params: {
185
179
  // ad_id: data.ad_id
186
180
  }
187
181
  })).data;
188
182
  } catch {
189
183
  }
190
- return M.get(e.url, {
184
+ return D.get(e.url, {
191
185
  params: {
192
186
  // ad_id: data.ad_id
193
187
  }
@@ -197,97 +191,105 @@ const ce = async (e) => {
197
191
  focusThrottleInterval: B(U)
198
192
  // keepPreviousData: true,
199
193
  // fallbackData: []
200
- }, de = (e) => {
201
- const { data: t, error: a, isLoading: o, mutate: l } = W(
194
+ }, ue = (e) => {
195
+ const { data: t, error: a, isLoading: n, mutate: d } = W(
202
196
  {
203
197
  url: "https://articles.media/api/ads"
204
198
  // ad_id
205
199
  },
206
- ce,
200
+ de,
207
201
  le
208
202
  );
209
203
  return {
210
204
  data: t,
211
205
  error: a,
212
- isLoading: o,
213
- mutate: l
206
+ isLoading: n,
207
+ mutate: d
214
208
  };
215
- }, ue = q(() => import("./AdDetailsModal-BOLzA3ZL.js"));
216
- function fe(e, t) {
209
+ }, fe = X(() => import("./AdDetailsModal-C3ytLQho.js")), me = X(() => import("./AdConfirmExitModal-TTHQo9Ou.js"));
210
+ function he(e, t) {
217
211
  return Math.floor(Math.random() * (t - e + 1)) + e;
218
212
  }
219
- function me(e) {
213
+ function pe(e) {
220
214
  const a = [], {
221
- data: o
222
- } = de();
223
- let { previewMode: l } = e, n = e.previewData || {};
224
- const [c, i] = p(null), [u, N] = p(null), [v, _] = p(null), [x, y] = p(null), [d, g] = p(0), [E, D] = p(!1), [A, h] = p(!1), [j, I] = p(/* @__PURE__ */ new Date()), [b, C] = p([]), { data: r } = ne(c);
225
- R(() => {
226
- o && o?.length > 0 && !c && (console.log("Ad Mounted or reduxAds changed"), i(e.ad_id || o[fe(0, o?.length - 1)]?._id));
227
- }, [o]), R(() => {
228
- }, [r]), R(() => {
229
- r?.populated_promos && d >= 0 && y(r?.populated_promos[d]);
230
- }, [d, r]);
231
- function F() {
232
- h(!A);
215
+ data: n
216
+ } = ue();
217
+ let { previewMode: d } = e, o = e.previewData || {};
218
+ const [c, i] = p(null), [f, b] = p(null), [x, _] = p(null), [j, y] = p(null), [u, g] = p(0), [k, A] = p(!1), [M, h] = p(!1), [v, N] = p(!1), [E, $] = p(/* @__PURE__ */ new Date()), [L, q] = p([]), { data: r } = ae(c);
219
+ I(() => {
220
+ n && n?.length > 0 && !c && (console.log("Ad Mounted or reduxAds changed"), i(e.ad_id || n[he(0, n?.length - 1)]?._id));
221
+ }, [n]), I(() => {
222
+ }, [r]), I(() => {
223
+ r?.populated_promos && u >= 0 && y(r?.populated_promos[u]);
224
+ }, [u, r]);
225
+ function K() {
226
+ h(!M);
233
227
  }
234
- const { ref: z, inView: S } = ee({
228
+ const { ref: F, inView: C } = te({
235
229
  /* Optional options */
236
230
  threshold: 0,
237
231
  triggerOnce: !0
238
232
  });
239
- function V(f) {
240
- if (l && console.log("Preventing this event from being logged as this ad is being shown in preview mode."), b.find((m) => m == f)) {
233
+ function P(l) {
234
+ if (d && console.log("Preventing this event from being logged as this ad is being shown in preview mode."), L.find((m) => m == l)) {
241
235
  console.log("Already logged this event");
242
236
  return;
243
237
  }
244
- M.get("/api/ads/event", {
238
+ D.get("/api/ads/event", {
245
239
  params: {
246
240
  ad_id: r?._id,
247
- event: f
241
+ event: l
248
242
  }
249
243
  }).then(function(m) {
250
- C([...b, f]), console.log(m.data);
244
+ q([...L, l]), console.log(m.data);
251
245
  }).catch(function(m) {
252
246
  console.log(m);
253
247
  });
254
248
  }
255
- return R(() => {
256
- if (!l && (console.log("inView", S), S && c)) {
257
- let f = [
249
+ return I(() => {
250
+ if (!d && (console.log("inView", C), C && c)) {
251
+ let l = [
258
252
  {
259
253
  ad_id: c,
260
254
  date: (/* @__PURE__ */ new Date()).toString()
261
255
  },
262
256
  ...a.filter((m) => {
263
257
  if (console.log(
264
- O(/* @__PURE__ */ new Date(), new Date(m.date))
265
- ), O(/* @__PURE__ */ new Date(), new Date(m.date)) > 5) {
258
+ T(/* @__PURE__ */ new Date(), new Date(m.date))
259
+ ), T(/* @__PURE__ */ new Date(), new Date(m.date)) > 5) {
266
260
  console.log("adsViewed - Remove Old Ad View Object");
267
261
  return;
268
262
  } else
269
263
  return console.log("adsViewed - Keep Ad View Object"), m;
270
264
  })
271
265
  ];
272
- console.log("unexpiredRecentViews", f);
266
+ console.log("unexpiredRecentViews", l);
273
267
  }
274
- }, [S, c]), /* @__PURE__ */ s.jsxs(
268
+ }, [C, c]), /* @__PURE__ */ s.jsxs(
275
269
  "div",
276
270
  {
277
- ref: z,
271
+ ref: F,
278
272
  className: "ad-wrap",
279
273
  style: {
280
- "--articles-ad-background-color": n.background_color || r?.background_color,
281
- "--articles-ad-font-color": n.font_color || r?.font_color,
282
- "--articles-ad-border-color": n.border_color || r?.border_color
274
+ "--articles-ad-background-color": o.background_color || r?.background_color,
275
+ "--articles-ad-font-color": o.font_color || r?.font_color,
276
+ "--articles-ad-border-color": o.border_color || r?.border_color
283
277
  },
284
278
  children: [
285
- A && /* @__PURE__ */ s.jsx(
286
- ue,
279
+ M && /* @__PURE__ */ s.jsx(
280
+ fe,
287
281
  {
288
282
  setModalShow: h,
289
283
  ad: r,
290
- previewData: n
284
+ previewData: o
285
+ }
286
+ ),
287
+ v && /* @__PURE__ */ s.jsx(
288
+ me,
289
+ {
290
+ setModalShow: N,
291
+ ad: r,
292
+ previewData: o
291
293
  }
292
294
  ),
293
295
  /* @__PURE__ */ s.jsx(
@@ -305,10 +307,10 @@ function me(e) {
305
307
  ] }) }),
306
308
  /* @__PURE__ */ s.jsxs("div", { className: "content-wrap", children: [
307
309
  /* @__PURE__ */ s.jsxs("div", { className: "photo-banner", children: [
308
- /* @__PURE__ */ s.jsx("div", { className: "logo", children: (n.logo?.location || r?.logo?.location) && /* @__PURE__ */ s.jsx(
310
+ /* @__PURE__ */ s.jsx("div", { className: "logo", children: (o.logo?.location || r?.logo?.location) && /* @__PURE__ */ s.jsx(
309
311
  "img",
310
312
  {
311
- src: n?.logo?.key ? `${process.env.NEXT_PUBLIC_CDN}${n?.logo?.key}` : `${process.env.NEXT_PUBLIC_CDN}${r?.logo?.key}`,
313
+ src: o?.logo?.key ? `${process.env.NEXT_PUBLIC_CDN}${o?.logo?.key}` : `${process.env.NEXT_PUBLIC_CDN}${r?.logo?.key}`,
312
314
  alt: ""
313
315
  }
314
316
  ) }),
@@ -317,14 +319,14 @@ function me(e) {
317
319
  "img",
318
320
  {
319
321
  className: "photo",
320
- src: n?.background?.key ? `${process.env.NEXT_PUBLIC_CDN}${n.background?.key}` : `${process.env.NEXT_PUBLIC_CDN}${r?.background?.key}`,
322
+ src: o?.background?.key ? `${process.env.NEXT_PUBLIC_CDN}${o.background?.key}` : `${process.env.NEXT_PUBLIC_CDN}${r?.background?.key}`,
321
323
  alt: ""
322
324
  }
323
325
  )
324
326
  ] }),
325
327
  /* @__PURE__ */ s.jsxs("div", { className: "details-wrap", children: [
326
328
  /* @__PURE__ */ s.jsxs("div", { className: "detail-title", children: [
327
- /* @__PURE__ */ s.jsx("div", { className: "detail", children: /* @__PURE__ */ s.jsx("span", { className: "h4", children: n?.business || r?.business }) }),
329
+ /* @__PURE__ */ s.jsx("div", { className: "detail", children: /* @__PURE__ */ s.jsx("span", { className: "h4", children: o?.business || r?.business }) }),
328
330
  /* @__PURE__ */ s.jsxs("div", { className: "flex flex-column d-none", children: [
329
331
  /* @__PURE__ */ s.jsxs("div", { className: "detail", children: [
330
332
  /* @__PURE__ */ s.jsx("span", { className: "icon", children: /* @__PURE__ */ s.jsx("i", { className: "fas fa-search-location" }) }),
@@ -341,33 +343,33 @@ function me(e) {
341
343
  ] })
342
344
  ] }),
343
345
  r?.city && /* @__PURE__ */ s.jsx("div", { className: "details mb-3 d-none" }),
344
- /* @__PURE__ */ s.jsx("div", { className: "short-description", children: n?.description || r?.description })
346
+ /* @__PURE__ */ s.jsx("div", { className: "short-description", children: o?.description || r?.description })
345
347
  ] })
346
348
  ] }),
347
349
  (!1)?.roles?.isDev && r?.populated_promos?.length > 0 && /* @__PURE__ */ s.jsxs("div", { children: [
348
- x && /* @__PURE__ */ s.jsx("div", { className: "promos-wrap", children: x && /* @__PURE__ */ s.jsxs(
350
+ j && /* @__PURE__ */ s.jsx("div", { className: "promos-wrap", children: j && /* @__PURE__ */ s.jsxs(
349
351
  "div",
350
352
  {
351
353
  className: "promo-wrap d-flex justify-content-between align-items-center mx-2 p-1 px-2 border border-2 border-light mb-0",
352
354
  children: [
353
355
  /* @__PURE__ */ s.jsxs("div", { className: "", children: [
354
- /* @__PURE__ */ s.jsx("div", { children: x.title }),
355
- /* @__PURE__ */ s.jsx("div", { className: "small", children: /* @__PURE__ */ s.jsx("div", { className: "small", children: x.details }) })
356
+ /* @__PURE__ */ s.jsx("div", { children: j.title }),
357
+ /* @__PURE__ */ s.jsx("div", { className: "small", children: /* @__PURE__ */ s.jsx("div", { className: "small", children: j.details }) })
356
358
  ] }),
357
359
  /* @__PURE__ */ s.jsx(
358
- G,
360
+ J,
359
361
  {
360
362
  className: "px-3",
361
363
  small: !0,
362
364
  onClick: () => {
363
- console.log("Load Save Modal"), D(!0);
365
+ console.log("Load Save Modal"), A(!0);
364
366
  },
365
367
  children: "Save"
366
368
  }
367
369
  )
368
370
  ]
369
371
  },
370
- x._id
372
+ j._id
371
373
  ) }),
372
374
  /* @__PURE__ */ s.jsxs("div", { className: "d-flex justify-content-between", children: [
373
375
  /* @__PURE__ */ s.jsxs("div", { className: "px-2", children: [
@@ -381,17 +383,17 @@ function me(e) {
381
383
  className: "fad fa-arrow-circle-left",
382
384
  type: "button",
383
385
  onClick: () => {
384
- d == 0 ? g(r?.populated_promos?.length - 1) : g((f) => f - 1);
386
+ u == 0 ? g(r?.populated_promos?.length - 1) : g((l) => l - 1);
385
387
  }
386
388
  }
387
389
  ),
388
390
  r?.populated_promos?.map(
389
- (f, m) => /* @__PURE__ */ s.jsx(
391
+ (l, m) => /* @__PURE__ */ s.jsx(
390
392
  "i",
391
393
  {
392
- className: `fa-square ${m == d ? "fad" : "fas"}`
394
+ className: `fa-square ${m == u ? "fad" : "fas"}`
393
395
  },
394
- f._id
396
+ l._id
395
397
  )
396
398
  ),
397
399
  /* @__PURE__ */ s.jsx(
@@ -400,7 +402,7 @@ function me(e) {
400
402
  className: "fad fa-arrow-circle-right",
401
403
  type: "button",
402
404
  onClick: () => {
403
- d == r?.populated_promos?.length - 1 ? g(0) : g((f) => f + 1);
405
+ u == r?.populated_promos?.length - 1 ? g(0) : g((l) => l + 1);
404
406
  }
405
407
  }
406
408
  )
@@ -413,7 +415,7 @@ function me(e) {
413
415
  "div",
414
416
  {
415
417
  onClick: () => {
416
- F(), V("Details");
418
+ K(), P("Details");
417
419
  },
418
420
  className: "action flex-grow-1 flex-shrink-0",
419
421
  children: "Details"
@@ -427,7 +429,9 @@ function me(e) {
427
429
  href: r?.website,
428
430
  target: "_blank",
429
431
  rel: "noreferrer",
430
- onClick: () => V("Website"),
432
+ onClick: (l) => {
433
+ l.preventDefault(), N(!0), P("Confirm Exit Modal Opened");
434
+ },
431
435
  children: /* @__PURE__ */ s.jsx("div", { children: "Website" })
432
436
  }
433
437
  )
@@ -437,20 +441,22 @@ function me(e) {
437
441
  )
438
442
  }
439
443
  ),
440
- !l && /* @__PURE__ */ s.jsx(
444
+ !d && /* @__PURE__ */ s.jsx(
441
445
  "div",
442
446
  {
443
447
  className: "advertise-with-us p-1",
444
448
  style: {
445
449
  // ...(props.previewData ? props.previewData.background_color : ad?.background_color),
446
- backgroundColor: n.background_color || r?.background_color,
447
- color: n.font_color || r?.font_color,
448
- borderColor: n.border_color || r?.border_color
450
+ backgroundColor: o.background_color || r?.background_color,
451
+ color: o.font_color || r?.font_color,
452
+ borderColor: o.border_color || r?.border_color
449
453
  },
450
454
  children: /* @__PURE__ */ s.jsxs(
451
- "div",
455
+ H,
452
456
  {
453
457
  className: "small d-block w-100 text-center",
458
+ href: "https://articles.media/advertising",
459
+ newPage: !0,
454
460
  children: [
455
461
  /* @__PURE__ */ s.jsx("i", { className: "fas fa-share me-1" }),
456
462
  "Advertise with Articles Media!"
@@ -463,7 +469,7 @@ function me(e) {
463
469
  }
464
470
  );
465
471
  }
466
- const xe = K(me);
472
+ const Ne = G(pe);
467
473
  export {
468
- xe as default
474
+ Ne as default
469
475
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-nZSsnGb7.cjs"),n=require("react"),l=require("./toDate-CzgAa_PT.cjs"),s=require("./Modal-Cr0uB770.cjs"),a=require("./Button-BVYvDTtH.cjs");function d(i){let{setModalShow:o,ad:r,previewData:c}=i;n.useEffect(()=>{console.log("Mounted")},[]);const t=()=>{o(!1)};return e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsxs(s.Modal,{show:!0,backdropClassName:"ad-details-modal-backdrop",className:"articles-modal",centered:!0,onHide:t,size:"md",children:[e.jsxRuntimeExports.jsx(s.Modal.Header,{className:"align-items-center",closeButton:!0,children:e.jsxRuntimeExports.jsx(s.Modal.Title,{children:"Confirm Exit"})}),e.jsxRuntimeExports.jsxs(s.Modal.Body,{className:"",children:[e.jsxRuntimeExports.jsx("div",{className:"ratio ratio-16x9 bg-black mb-2"}),e.jsxRuntimeExports.jsx("p",{className:"mb-1",children:"This advertiser has been approved and verified to display ads but always be cautious when interacting with ads. Any offsite interactions are at your own risk and should be approached with caution. We can not be held responsible for any issues that may arise."})]}),e.jsxRuntimeExports.jsxs(s.Modal.Footer,{className:"d-flex justify-content-between",children:[e.jsxRuntimeExports.jsxs(a.ArticlesButton,{variant:"articles",onClick:t,children:[e.jsxRuntimeExports.jsx("i",{className:"fad fa-times"}),"Close"]}),e.jsxRuntimeExports.jsx(l.Link,{href:r?.website,newPage:!0,children:e.jsxRuntimeExports.jsxs(a.ArticlesButton,{variant:"articles",onClick:t,children:[e.jsxRuntimeExports.jsx("i",{className:"fad fa-link"}),"Proceed"]})})]})]})})}exports.default=d;
@@ -0,0 +1,72 @@
1
+ import { j as e } from "./jsx-runtime-tc70JA_2.js";
2
+ import { useEffect as l } from "react";
3
+ import { L as n } from "./toDate-CDo8dBwb.js";
4
+ import { M as s } from "./Modal-CZ77qLgM.js";
5
+ import { A as i } from "./Button-B5nVYPMZ.js";
6
+ function x(t) {
7
+ let { setModalShow: r, ad: o, previewData: d } = t;
8
+ l(() => {
9
+ console.log("Mounted");
10
+ }, []);
11
+ const a = () => {
12
+ r(!1);
13
+ };
14
+ return /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsxs(
15
+ s,
16
+ {
17
+ show: !0,
18
+ backdropClassName: "ad-details-modal-backdrop",
19
+ className: "articles-modal",
20
+ centered: !0,
21
+ onHide: a,
22
+ size: "md",
23
+ children: [
24
+ /* @__PURE__ */ e.jsx(s.Header, { className: "align-items-center", closeButton: !0, children: /* @__PURE__ */ e.jsx(s.Title, { children: "Confirm Exit" }) }),
25
+ /* @__PURE__ */ e.jsxs(
26
+ s.Body,
27
+ {
28
+ className: "",
29
+ children: [
30
+ /* @__PURE__ */ e.jsx("div", { className: "ratio ratio-16x9 bg-black mb-2" }),
31
+ /* @__PURE__ */ e.jsx("p", { className: "mb-1", children: "This advertiser has been approved and verified to display ads but always be cautious when interacting with ads. Any offsite interactions are at your own risk and should be approached with caution. We can not be held responsible for any issues that may arise." })
32
+ ]
33
+ }
34
+ ),
35
+ /* @__PURE__ */ e.jsxs(s.Footer, { className: "d-flex justify-content-between", children: [
36
+ /* @__PURE__ */ e.jsxs(
37
+ i,
38
+ {
39
+ variant: "articles",
40
+ onClick: a,
41
+ children: [
42
+ /* @__PURE__ */ e.jsx("i", { className: "fad fa-times" }),
43
+ "Close"
44
+ ]
45
+ }
46
+ ),
47
+ /* @__PURE__ */ e.jsx(
48
+ n,
49
+ {
50
+ href: o?.website,
51
+ newPage: !0,
52
+ children: /* @__PURE__ */ e.jsxs(
53
+ i,
54
+ {
55
+ variant: "articles",
56
+ onClick: a,
57
+ children: [
58
+ /* @__PURE__ */ e.jsx("i", { className: "fad fa-link" }),
59
+ "Proceed"
60
+ ]
61
+ }
62
+ )
63
+ }
64
+ )
65
+ ] })
66
+ ]
67
+ }
68
+ ) });
69
+ }
70
+ export {
71
+ x as default
72
+ };