@active-reach/web-sdk 1.43.4 → 1.43.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/aegis.min.js +1 -1
- package/dist/aegis.min.js.map +1 -1
- package/dist/inapp/AegisInAppManager.d.ts +15 -0
- package/dist/inapp/AegisInAppManager.d.ts.map +1 -1
- package/dist/inapp/page-url-rules.d.ts +32 -0
- package/dist/inapp/page-url-rules.d.ts.map +1 -0
- package/dist/inapp/renderers/hero.d.ts.map +1 -1
- package/dist/index.js +135 -29
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -54,6 +54,8 @@ export interface InAppCampaign {
|
|
|
54
54
|
page_key?: 'bill' | 'rewards' | 'feedback' | 'reviews' | 'members';
|
|
55
55
|
surface?: string[];
|
|
56
56
|
target_screens?: string[];
|
|
57
|
+
page_url_match?: string | null;
|
|
58
|
+
page_url_exclude?: string | null;
|
|
57
59
|
journey_step_execution_id?: string | null;
|
|
58
60
|
}
|
|
59
61
|
/**
|
|
@@ -352,8 +354,11 @@ export declare class AegisInAppManager {
|
|
|
352
354
|
private filledSlots;
|
|
353
355
|
private slotSignatures;
|
|
354
356
|
private slotTimers;
|
|
357
|
+
private renderedSlots;
|
|
355
358
|
private slotObserver;
|
|
356
359
|
private slotRenderScheduled;
|
|
360
|
+
private slotsTornDown;
|
|
361
|
+
private lifecycleGen;
|
|
357
362
|
private slotUnfilledBeaconed;
|
|
358
363
|
private slotUnfilledSweepTimer;
|
|
359
364
|
/**
|
|
@@ -384,6 +389,16 @@ export declare class AegisInAppManager {
|
|
|
384
389
|
* - hosts that declare nothing keep the legacy render-everything default
|
|
385
390
|
*/
|
|
386
391
|
private matchesCurrentScreenOrSurface;
|
|
392
|
+
/** The page URL the server's page rules saw: what `refreshCampaigns` sends
|
|
393
|
+
* as `page_url` (pathname + search, credential values redacted). Null off
|
|
394
|
+
* the browser — no page, no filter (the server's rule too). */
|
|
395
|
+
private currentPageUrl;
|
|
396
|
+
/** The full client placement gate: screen/surface tier AND page rules, both
|
|
397
|
+
* mirroring `/v1/in-app/active`, applied to CACHED campaigns (the page may
|
|
398
|
+
* have changed since the fetch — SPA navigation). */
|
|
399
|
+
private isPlaceableHere;
|
|
400
|
+
/** Remove everything this manager injected into `slot` and stop its rotation. */
|
|
401
|
+
private clearSlotContent;
|
|
387
402
|
private ensureSlotObserver;
|
|
388
403
|
private renderIntoSlots;
|
|
389
404
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AegisInAppManager.d.ts","sourceRoot":"","sources":["../../src/inapp/AegisInAppManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAIL,KAAK,WAAW,EAEjB,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"AegisInAppManager.d.ts","sourceRoot":"","sources":["../../src/inapp/AegisInAppManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAIL,KAAK,WAAW,EAEjB,MAAM,WAAW,CAAC;AAiDnB,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EACA,OAAO,GACP,QAAQ,GACR,SAAS,GACT,aAAa,GACb,mBAAmB,GACnB,OAAO,GACP,KAAK,GACL,OAAO,GAEP,SAAS,GAET,gBAAgB,GAChB,YAAY,GACZ,cAAc,GACd,gBAAgB,GAChB,wBAAwB,GAGxB,iBAAiB,GACjB,aAAa,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAA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of the cell's `page_url_rules_pass`
|
|
5
|
+
* (apps/cell-plane/app/services/in_app/page_url_rules.py). Both read ONE
|
|
6
|
+
* fixture file, `libs/web-sdk/src/inapp/__fixtures__/page-url-rules.json`, so
|
|
7
|
+
* the two cannot drift: change the semantics in both files and the fixtures in
|
|
8
|
+
* the same commit, or in none.
|
|
9
|
+
*
|
|
10
|
+
* Semantics (the server's, kept exactly, quirks included):
|
|
11
|
+
* - Each rule is a comma-separated list of patterns. `*` becomes `.*`; every
|
|
12
|
+
* other character is a regular-expression character as written.
|
|
13
|
+
* - A pattern matches when it matches at the START of the page URL (Python
|
|
14
|
+
* `re.match`): `/p/*` matches `/p/x`, not `/s/a/p/x`. Nothing anchors the
|
|
15
|
+
* end, so a trailing query string never stops a match.
|
|
16
|
+
* - `page_url_match`: when at least one non-empty pattern is listed, the page
|
|
17
|
+
* must match one of them.
|
|
18
|
+
* - `page_url_exclude`: the page must match none. An EMPTY piece (`"*\/p/*,"`)
|
|
19
|
+
* matches every URL, so a trailing comma excludes everywhere — the server
|
|
20
|
+
* has always behaved this way and the fixtures pin it.
|
|
21
|
+
* - No page URL, or an empty rule, applies no filter.
|
|
22
|
+
* - A pattern that is not a valid regular expression matches nothing.
|
|
23
|
+
*
|
|
24
|
+
* The page URL is what the SDK sends as `page_url` to `/v1/in-app/active`:
|
|
25
|
+
* pathname + search, credential values redacted.
|
|
26
|
+
*/
|
|
27
|
+
export interface PageUrlRules {
|
|
28
|
+
page_url_match?: string | null;
|
|
29
|
+
page_url_exclude?: string | null;
|
|
30
|
+
}
|
|
31
|
+
export declare function pageUrlRulesPass(rules: PageUrlRules | null | undefined, pageUrl: string | null | undefined): boolean;
|
|
32
|
+
//# sourceMappingURL=page-url-rules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-url-rules.d.ts","sourceRoot":"","sources":["../../src/inapp/page-url-rules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,WAAW,YAAY;IAC3B,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC;AAeD,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,YAAY,GAAG,IAAI,GAAG,SAAS,EACtC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GACjC,OAAO,CAsBT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hero.d.ts","sourceRoot":"","sources":["../../../src/inapp/renderers/hero.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"hero.d.ts","sourceRoot":"","sources":["../../../src/inapp/renderers/hero.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAiF7C;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,aAAa,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAmLjF"}
|
package/dist/index.js
CHANGED
|
@@ -4028,14 +4028,20 @@ function safeColor(c, fallback) {
|
|
|
4028
4028
|
return c && HEX.test(c) ? c : fallback;
|
|
4029
4029
|
}
|
|
4030
4030
|
const ASPECT = { "16:9": "16 / 9", "4:3": "4 / 3", "21:9": "21 / 9" };
|
|
4031
|
+
const HERO_DESKTOP_RATIO = "8 / 3";
|
|
4032
|
+
const HERO_PHONE_RATIO = "1 / 1";
|
|
4033
|
+
const HERO_PHONE_MAX_WIDTH_PX = 767;
|
|
4031
4034
|
function _injectHeroResponsiveCss() {
|
|
4032
4035
|
if (typeof document === "undefined") return;
|
|
4033
4036
|
if (document.getElementById("aegis-hero-style")) return;
|
|
4034
4037
|
const style = document.createElement("style");
|
|
4035
4038
|
style.id = "aegis-hero-style";
|
|
4036
|
-
style.textContent =
|
|
4039
|
+
style.textContent = `.aegis-hero-root{border-radius:16px;}.aegis-hero-auto{min-height:300px;}@media (max-width:${HERO_PHONE_MAX_WIDTH_PX}px){.aegis-hero-auto.aegis-hero-phone-square{min-height:0;aspect-ratio:${HERO_PHONE_RATIO};}}@media (min-width:${HERO_PHONE_MAX_WIDTH_PX + 1}px){.aegis-hero-root{border-radius:0;min-height:0;max-height:70vh;aspect-ratio:${HERO_DESKTOP_RATIO} !important;}}`;
|
|
4037
4040
|
document.head.appendChild(style);
|
|
4038
4041
|
}
|
|
4042
|
+
function srcsetUrl(url) {
|
|
4043
|
+
return url.replace(/\s/g, "%20").replace(/,/g, "%2C");
|
|
4044
|
+
}
|
|
4039
4045
|
function cardHeadline(c) {
|
|
4040
4046
|
return c.headline ?? c.title ?? "";
|
|
4041
4047
|
}
|
|
@@ -4084,9 +4090,13 @@ function renderHeroInline(ctx, target) {
|
|
|
4084
4090
|
return true;
|
|
4085
4091
|
}
|
|
4086
4092
|
_injectHeroResponsiveCss();
|
|
4093
|
+
const explicitRatio = chrome.aspect_ratio ? ASPECT[chrome.aspect_ratio] : void 0;
|
|
4094
|
+
const hasPhoneImage = cards.some(
|
|
4095
|
+
(c) => !c.video_url && c.media_type !== "video" && !!c.image_url_mobile && !!sanitizeUrl(c.image_url_mobile)
|
|
4096
|
+
);
|
|
4087
4097
|
const root = document.createElement("div");
|
|
4088
|
-
root.className = "aegis-hero-root"
|
|
4089
|
-
root.style.cssText = `position:relative;width:100%;overflow:hidden;box-shadow:0 1px 2px rgba(16,24,40,0.06);${
|
|
4098
|
+
root.className = explicitRatio ? "aegis-hero-root" : `aegis-hero-root aegis-hero-auto${hasPhoneImage ? " aegis-hero-phone-square" : ""}`;
|
|
4099
|
+
root.style.cssText = `position:relative;width:100%;overflow:hidden;box-shadow:0 1px 2px rgba(16,24,40,0.06);${explicitRatio ? `aspect-ratio:${explicitRatio};` : ""}`;
|
|
4090
4100
|
root.setAttribute("data-campaign-id", campaign.id);
|
|
4091
4101
|
const track = document.createElement("div");
|
|
4092
4102
|
track.style.cssText = "display:flex;height:100%;width:100%;transition:transform 0.5s ease;";
|
|
@@ -4099,7 +4109,7 @@ function renderHeroInline(ctx, target) {
|
|
|
4099
4109
|
slide.style.cssText = "position:relative;flex:0 0 100%;width:100%;height:100%;min-height:inherit;background:#f1f5f9;";
|
|
4100
4110
|
const videoUrl = c.video_url ? sanitizeUrl(c.video_url) ?? "" : "";
|
|
4101
4111
|
const isVideo = !!videoUrl || c.media_type === "video";
|
|
4102
|
-
const mediaUrl = isVideo ? videoUrl || sanitizeUrl(c.media_url ?? "") : sanitizeUrl(c.image_url ?? c.media_url ?? "");
|
|
4112
|
+
const mediaUrl = isVideo ? videoUrl || sanitizeUrl(c.media_url ?? "") : sanitizeUrl(c.image_url ?? c.media_url ?? "") ?? (c.image_url_mobile ? sanitizeUrl(c.image_url_mobile) : null);
|
|
4103
4113
|
if (mediaUrl) {
|
|
4104
4114
|
if (isVideo) {
|
|
4105
4115
|
const v = document.createElement("video");
|
|
@@ -4111,9 +4121,21 @@ function renderHeroInline(ctx, target) {
|
|
|
4111
4121
|
v.style.cssText = "position:absolute;inset:0;width:100%;height:100%;object-fit:cover;";
|
|
4112
4122
|
slide.appendChild(v);
|
|
4113
4123
|
} else {
|
|
4114
|
-
const
|
|
4115
|
-
|
|
4116
|
-
|
|
4124
|
+
const picture = document.createElement("picture");
|
|
4125
|
+
const phoneUrl = c.image_url_mobile ? sanitizeUrl(c.image_url_mobile) : null;
|
|
4126
|
+
if (phoneUrl) {
|
|
4127
|
+
const source = document.createElement("source");
|
|
4128
|
+
source.setAttribute("media", `(max-width:${HERO_PHONE_MAX_WIDTH_PX}px)`);
|
|
4129
|
+
source.setAttribute("srcset", srcsetUrl(phoneUrl));
|
|
4130
|
+
picture.appendChild(source);
|
|
4131
|
+
}
|
|
4132
|
+
const img = document.createElement("img");
|
|
4133
|
+
img.src = mediaUrl;
|
|
4134
|
+
img.alt = "";
|
|
4135
|
+
img.decoding = "async";
|
|
4136
|
+
img.style.cssText = "position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center;display:block;";
|
|
4137
|
+
picture.appendChild(img);
|
|
4138
|
+
slide.appendChild(picture);
|
|
4117
4139
|
}
|
|
4118
4140
|
}
|
|
4119
4141
|
if (overlayCss) {
|
|
@@ -6340,6 +6362,33 @@ function scratchOutcome(resp) {
|
|
|
6340
6362
|
if (resp.won === false || (prize == null ? void 0 : prize.win) === false || (prize == null ? void 0 : prize.prize_type) === "no_prize") return false;
|
|
6341
6363
|
return void 0;
|
|
6342
6364
|
}
|
|
6365
|
+
function patternMatches(pattern, pageUrl) {
|
|
6366
|
+
let re;
|
|
6367
|
+
try {
|
|
6368
|
+
re = new RegExp(pattern.split("*").join(".*"), "y");
|
|
6369
|
+
} catch {
|
|
6370
|
+
return false;
|
|
6371
|
+
}
|
|
6372
|
+
re.lastIndex = 0;
|
|
6373
|
+
return re.test(pageUrl);
|
|
6374
|
+
}
|
|
6375
|
+
function pageUrlRulesPass(rules, pageUrl) {
|
|
6376
|
+
if (!rules || !pageUrl) return true;
|
|
6377
|
+
const match = rules.page_url_match;
|
|
6378
|
+
if (match) {
|
|
6379
|
+
const patterns = match.split(",").map((p) => p.trim()).filter((p) => p.length > 0);
|
|
6380
|
+
if (patterns.length > 0 && !patterns.some((p) => patternMatches(p, pageUrl))) {
|
|
6381
|
+
return false;
|
|
6382
|
+
}
|
|
6383
|
+
}
|
|
6384
|
+
const exclude = rules.page_url_exclude;
|
|
6385
|
+
if (exclude) {
|
|
6386
|
+
for (const piece of exclude.split(",")) {
|
|
6387
|
+
if (patternMatches(piece.trim(), pageUrl)) return false;
|
|
6388
|
+
}
|
|
6389
|
+
}
|
|
6390
|
+
return true;
|
|
6391
|
+
}
|
|
6343
6392
|
const RETURNING_MARKER_KEY = "aegis_returning_user";
|
|
6344
6393
|
const SESSION_VERDICT_KEY = "aegis_new_visitor_session";
|
|
6345
6394
|
let cachedVerdict = null;
|
|
@@ -6531,8 +6580,11 @@ const _AegisInAppManager = class _AegisInAppManager {
|
|
|
6531
6580
|
this.filledSlots = /* @__PURE__ */ new WeakSet();
|
|
6532
6581
|
this.slotSignatures = /* @__PURE__ */ new WeakMap();
|
|
6533
6582
|
this.slotTimers = /* @__PURE__ */ new WeakMap();
|
|
6583
|
+
this.renderedSlots = /* @__PURE__ */ new Set();
|
|
6534
6584
|
this.slotObserver = null;
|
|
6535
6585
|
this.slotRenderScheduled = false;
|
|
6586
|
+
this.slotsTornDown = false;
|
|
6587
|
+
this.lifecycleGen = 0;
|
|
6536
6588
|
this.slotUnfilledBeaconed = /* @__PURE__ */ new Set();
|
|
6537
6589
|
this.slotUnfilledSweepTimer = null;
|
|
6538
6590
|
this._pushOptInLoading = false;
|
|
@@ -6639,6 +6691,7 @@ const _AegisInAppManager = class _AegisInAppManager {
|
|
|
6639
6691
|
return this.register("error", handler);
|
|
6640
6692
|
}
|
|
6641
6693
|
async initialize() {
|
|
6694
|
+
this.slotsTornDown = false;
|
|
6642
6695
|
if (this.isInitialized) {
|
|
6643
6696
|
this.log("AegisInApp already initialized");
|
|
6644
6697
|
return;
|
|
@@ -7055,6 +7108,7 @@ const _AegisInAppManager = class _AegisInAppManager {
|
|
|
7055
7108
|
}, delay);
|
|
7056
7109
|
}
|
|
7057
7110
|
async refreshCampaigns() {
|
|
7111
|
+
const gen = this.lifecycleGen;
|
|
7058
7112
|
try {
|
|
7059
7113
|
const context = new URLSearchParams({
|
|
7060
7114
|
device_type: this.detectDeviceType(),
|
|
@@ -7101,10 +7155,12 @@ const _AegisInAppManager = class _AegisInAppManager {
|
|
|
7101
7155
|
headers,
|
|
7102
7156
|
credentials: "include"
|
|
7103
7157
|
});
|
|
7158
|
+
if (gen !== this.lifecycleGen) return;
|
|
7104
7159
|
if (!response.ok) {
|
|
7105
7160
|
throw new Error(`Failed to fetch campaigns: ${response.status}`);
|
|
7106
7161
|
}
|
|
7107
7162
|
const payload = await response.json();
|
|
7163
|
+
if (gen !== this.lifecycleGen) return;
|
|
7108
7164
|
this.campaigns = Array.isArray(payload) ? payload : [];
|
|
7109
7165
|
this.processABAssignments(this.campaigns);
|
|
7110
7166
|
this.rehydrateSuppressionFromStorage();
|
|
@@ -7118,6 +7174,7 @@ const _AegisInAppManager = class _AegisInAppManager {
|
|
|
7118
7174
|
this.renderIntoAnchors();
|
|
7119
7175
|
this.renderTokenAnchors();
|
|
7120
7176
|
} catch (error) {
|
|
7177
|
+
if (gen !== this.lifecycleGen) return;
|
|
7121
7178
|
this.emitError(error, { stage: "refresh-campaigns" });
|
|
7122
7179
|
this.log(`Error refreshing campaigns: ${error}`, "error");
|
|
7123
7180
|
}
|
|
@@ -7255,6 +7312,30 @@ const _AegisInAppManager = class _AegisInAppManager {
|
|
|
7255
7312
|
if (this.currentScreen !== null) return false;
|
|
7256
7313
|
return true;
|
|
7257
7314
|
}
|
|
7315
|
+
/** The page URL the server's page rules saw: what `refreshCampaigns` sends
|
|
7316
|
+
* as `page_url` (pathname + search, credential values redacted). Null off
|
|
7317
|
+
* the browser — no page, no filter (the server's rule too). */
|
|
7318
|
+
currentPageUrl() {
|
|
7319
|
+
if (typeof window === "undefined" || !window.location) return null;
|
|
7320
|
+
return redactUrl((window.location.pathname || "") + (window.location.search || ""));
|
|
7321
|
+
}
|
|
7322
|
+
/** The full client placement gate: screen/surface tier AND page rules, both
|
|
7323
|
+
* mirroring `/v1/in-app/active`, applied to CACHED campaigns (the page may
|
|
7324
|
+
* have changed since the fetch — SPA navigation). */
|
|
7325
|
+
isPlaceableHere(c) {
|
|
7326
|
+
return this.matchesCurrentScreenOrSurface(c) && pageUrlRulesPass(c, this.currentPageUrl());
|
|
7327
|
+
}
|
|
7328
|
+
/** Remove everything this manager injected into `slot` and stop its rotation. */
|
|
7329
|
+
clearSlotContent(slot) {
|
|
7330
|
+
const timer = this.slotTimers.get(slot);
|
|
7331
|
+
if (timer) {
|
|
7332
|
+
clearInterval(timer);
|
|
7333
|
+
this.slotTimers.delete(slot);
|
|
7334
|
+
}
|
|
7335
|
+
slot.querySelectorAll(
|
|
7336
|
+
":scope > [data-aegis-rotate-pane], :scope > [data-aegis-slot-rendered], :scope > [data-aegis-rotate-dots]"
|
|
7337
|
+
).forEach((n) => n.remove());
|
|
7338
|
+
}
|
|
7258
7339
|
// Re-fill slots that mount after a poll (SPA route changes). Observes the DOM
|
|
7259
7340
|
// once; when a new [data-aegis-slot] appears it re-runs renderIntoSlots from
|
|
7260
7341
|
// the cached campaigns (idempotent — already-filled slots are skipped). Does
|
|
@@ -7281,6 +7362,7 @@ const _AegisInAppManager = class _AegisInAppManager {
|
|
|
7281
7362
|
this.slotRenderScheduled = true;
|
|
7282
7363
|
const run = () => {
|
|
7283
7364
|
this.slotRenderScheduled = false;
|
|
7365
|
+
if (this.slotsTornDown) return;
|
|
7284
7366
|
this.renderIntoSlots();
|
|
7285
7367
|
};
|
|
7286
7368
|
if (typeof requestAnimationFrame === "function") requestAnimationFrame(run);
|
|
@@ -7290,15 +7372,23 @@ const _AegisInAppManager = class _AegisInAppManager {
|
|
|
7290
7372
|
}
|
|
7291
7373
|
renderIntoSlots() {
|
|
7292
7374
|
var _a, _b;
|
|
7293
|
-
if (typeof document === "undefined") return;
|
|
7375
|
+
if (typeof document === "undefined" || this.slotsTornDown) return;
|
|
7294
7376
|
this.ensureSlotObserver();
|
|
7295
7377
|
this.scheduleSlotUnfilledSweep();
|
|
7378
|
+
this.renderedSlots.forEach((slot) => {
|
|
7379
|
+
if (slot.isConnected === false) {
|
|
7380
|
+
const timer = this.slotTimers.get(slot);
|
|
7381
|
+
if (timer) clearInterval(timer);
|
|
7382
|
+
this.slotTimers.delete(slot);
|
|
7383
|
+
this.renderedSlots.delete(slot);
|
|
7384
|
+
}
|
|
7385
|
+
});
|
|
7296
7386
|
const slots = document.querySelectorAll("[data-aegis-slot]");
|
|
7297
7387
|
if (slots.length === 0) return;
|
|
7298
7388
|
const eligibleByCategory = /* @__PURE__ */ new Map();
|
|
7299
7389
|
const seenIds = /* @__PURE__ */ new Set();
|
|
7300
7390
|
for (const c of this.campaigns) {
|
|
7301
|
-
if (!this.
|
|
7391
|
+
if (!this.isPlaceableHere(c)) continue;
|
|
7302
7392
|
const modes = c.delivery_modes;
|
|
7303
7393
|
const category = c.widget_category;
|
|
7304
7394
|
if (!modes || !modes.includes("embedded_card")) continue;
|
|
@@ -7325,18 +7415,6 @@ const _AegisInAppManager = class _AegisInAppManager {
|
|
|
7325
7415
|
if (!key) return;
|
|
7326
7416
|
const list = eligibleByCategory.get(key);
|
|
7327
7417
|
if (!list || list.length === 0) return;
|
|
7328
|
-
const sig = list.map((c) => `${c.id}:${c.assigned_variant_id ?? ""}`).join(",");
|
|
7329
|
-
if (this.filledSlots.has(slot) && this.slotSignatures.get(slot) === sig) return;
|
|
7330
|
-
const oldTimer = this.slotTimers.get(slot);
|
|
7331
|
-
if (oldTimer) {
|
|
7332
|
-
clearInterval(oldTimer);
|
|
7333
|
-
this.slotTimers.delete(slot);
|
|
7334
|
-
}
|
|
7335
|
-
slot.querySelectorAll(
|
|
7336
|
-
":scope > [data-aegis-rotate-pane], :scope > [data-aegis-slot-rendered], :scope > [data-aegis-rotate-dots]"
|
|
7337
|
-
).forEach((n) => n.remove());
|
|
7338
|
-
this.slotSignatures.set(slot, sig);
|
|
7339
|
-
slot.querySelectorAll(":scope > [data-aegis-slot-default]").forEach((d) => d.remove());
|
|
7340
7418
|
const attrMs = parseInt(slot.getAttribute("data-aegis-slot-rotate") || "0", 10);
|
|
7341
7419
|
const declaredMs = list.reduce((m2, c) => {
|
|
7342
7420
|
var _a2;
|
|
@@ -7344,8 +7422,16 @@ const _AegisInAppManager = class _AegisInAppManager {
|
|
|
7344
7422
|
return Number.isFinite(v) && v > m2 ? v : m2;
|
|
7345
7423
|
}, 0);
|
|
7346
7424
|
const rotateMs = attrMs > 0 ? attrMs : declaredMs;
|
|
7425
|
+
const rotating = rotateMs > 0 && list.length > 1;
|
|
7426
|
+
const shown = rotating ? list : list.slice(0, 1);
|
|
7427
|
+
const sig = (rotating ? "rotate:" : "one:") + shown.map((c) => `${c.id}:${c.assigned_variant_id ?? ""}`).join(",");
|
|
7428
|
+
if (this.filledSlots.has(slot) && this.slotSignatures.get(slot) === sig) return;
|
|
7429
|
+
this.clearSlotContent(slot);
|
|
7430
|
+
this.slotSignatures.set(slot, sig);
|
|
7431
|
+
this.renderedSlots.add(slot);
|
|
7432
|
+
slot.querySelectorAll(":scope > [data-aegis-slot-default]").forEach((d) => d.remove());
|
|
7347
7433
|
const flush = slot.hasAttribute("data-aegis-slot-flush");
|
|
7348
|
-
if (
|
|
7434
|
+
if (rotating) {
|
|
7349
7435
|
this.renderRotatingSlot(slot, list, rotateMs, flush);
|
|
7350
7436
|
} else {
|
|
7351
7437
|
const host = document.createElement("div");
|
|
@@ -7392,7 +7478,7 @@ const _AegisInAppManager = class _AegisInAppManager {
|
|
|
7392
7478
|
});
|
|
7393
7479
|
const path = typeof window !== "undefined" ? window.location.pathname : "";
|
|
7394
7480
|
for (const c of this.campaigns) {
|
|
7395
|
-
if (!this.
|
|
7481
|
+
if (!this.isPlaceableHere(c)) continue;
|
|
7396
7482
|
if (!c.delivery_modes || !c.delivery_modes.includes("embedded_card")) continue;
|
|
7397
7483
|
const category = c.widget_category;
|
|
7398
7484
|
if (!category || present.has(category)) continue;
|
|
@@ -7487,9 +7573,13 @@ const _AegisInAppManager = class _AegisInAppManager {
|
|
|
7487
7573
|
});
|
|
7488
7574
|
};
|
|
7489
7575
|
let timer = null;
|
|
7490
|
-
const start = () =>
|
|
7491
|
-
|
|
7492
|
-
|
|
7576
|
+
const start = () => {
|
|
7577
|
+
const t = setInterval(() => {
|
|
7578
|
+
show(idx + 1);
|
|
7579
|
+
}, rotateMs);
|
|
7580
|
+
this.slotTimers.set(slot, t);
|
|
7581
|
+
return t;
|
|
7582
|
+
};
|
|
7493
7583
|
function show(i, fromClick = false) {
|
|
7494
7584
|
panes[idx].el.style.display = "none";
|
|
7495
7585
|
idx = (i % panes.length + panes.length) % panes.length;
|
|
@@ -7506,7 +7596,6 @@ const _AegisInAppManager = class _AegisInAppManager {
|
|
|
7506
7596
|
paintDots();
|
|
7507
7597
|
if (panes.length === 1) return;
|
|
7508
7598
|
timer = start();
|
|
7509
|
-
this.slotTimers.set(slot, timer);
|
|
7510
7599
|
if (typeof window !== "undefined") {
|
|
7511
7600
|
window.addEventListener("beforeunload", () => timer && clearInterval(timer), { once: true });
|
|
7512
7601
|
}
|
|
@@ -7531,7 +7620,7 @@ const _AegisInAppManager = class _AegisInAppManager {
|
|
|
7531
7620
|
var _a;
|
|
7532
7621
|
if (typeof document === "undefined") return;
|
|
7533
7622
|
for (const c of this.campaigns) {
|
|
7534
|
-
if (!this.
|
|
7623
|
+
if (!this.isPlaceableHere(c)) continue;
|
|
7535
7624
|
const modes = c.delivery_modes;
|
|
7536
7625
|
if (!modes || !modes.includes("embedded_card")) continue;
|
|
7537
7626
|
const ic = c.interactive_config;
|
|
@@ -12412,6 +12501,23 @@ const _AegisInAppManager = class _AegisInAppManager {
|
|
|
12412
12501
|
clearTimeout(this.refreshDebounceTimer);
|
|
12413
12502
|
this.refreshDebounceTimer = void 0;
|
|
12414
12503
|
}
|
|
12504
|
+
if (this.slotObserver) {
|
|
12505
|
+
this.slotObserver.disconnect();
|
|
12506
|
+
this.slotObserver = null;
|
|
12507
|
+
}
|
|
12508
|
+
this.slotRenderScheduled = false;
|
|
12509
|
+
this.slotsTornDown = true;
|
|
12510
|
+
this.lifecycleGen += 1;
|
|
12511
|
+
if (this.slotUnfilledSweepTimer) {
|
|
12512
|
+
clearTimeout(this.slotUnfilledSweepTimer);
|
|
12513
|
+
this.slotUnfilledSweepTimer = null;
|
|
12514
|
+
}
|
|
12515
|
+
this.renderedSlots.forEach((slot) => this.clearSlotContent(slot));
|
|
12516
|
+
this.renderedSlots.clear();
|
|
12517
|
+
this.filledSlots = /* @__PURE__ */ new WeakSet();
|
|
12518
|
+
this.slotSignatures = /* @__PURE__ */ new WeakMap();
|
|
12519
|
+
this.slotTimers = /* @__PURE__ */ new WeakMap();
|
|
12520
|
+
this.campaigns = [];
|
|
12415
12521
|
if (typeof document !== "undefined") {
|
|
12416
12522
|
document.querySelectorAll(
|
|
12417
12523
|
".aegis-in-app-banner, .aegis-in-app-modal-overlay, .aegis-in-app-fullscreen-overlay, .aegis-in-app-half-interstitial-overlay, .aegis-in-app-alert-overlay, .aegis-in-app-pip, .aegis-in-app-nps-overlay, .aegis-in-app-countdown-overlay, .aegis-in-app-rating-overlay, .aegis-in-app-poll-overlay, .aegis-in-app-quiz-overlay, .aegis-in-app-rating-card, .aegis-in-app-nps-card"
|
|
@@ -15055,7 +15161,7 @@ const _AegisMessageRuntime = class _AegisMessageRuntime {
|
|
|
15055
15161
|
this.initialized = false;
|
|
15056
15162
|
this.armedInAppTriggers = /* @__PURE__ */ new Set();
|
|
15057
15163
|
{
|
|
15058
|
-
const v = "1.43.
|
|
15164
|
+
const v = "1.43.6";
|
|
15059
15165
|
try {
|
|
15060
15166
|
globalThis.__AEGIS_SDK_VERSION__ = v;
|
|
15061
15167
|
} catch {
|