@active-reach/web-sdk 1.54.0 → 1.55.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/aegis-boot.min.js.map +1 -1
- package/dist/aegis.min.js +1 -1
- package/dist/aegis.min.js.map +1 -1
- package/dist/boot.js +1 -1
- package/dist/{fetch-abort-Bs-Stg-I.mjs → fetch-abort-CKX4cEDN.mjs} +4 -5
- package/dist/fetch-abort-CKX4cEDN.mjs.map +1 -0
- package/dist/inapp/AegisInAppManager.d.ts +0 -1
- package/dist/inapp/AegisInAppManager.d.ts.map +1 -1
- package/dist/inapp/renderers/hero.d.ts +5 -2
- package/dist/inapp/renderers/hero.d.ts.map +1 -1
- package/dist/index.js +36 -20
- package/dist/index.js.map +1 -1
- package/dist/utils/visitor.d.ts +6 -3
- package/dist/utils/visitor.d.ts.map +1 -1
- package/dist/widgets/AegisWidgetManager.d.ts +0 -1
- package/dist/widgets/AegisWidgetManager.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/fetch-abort-Bs-Stg-I.mjs.map +0 -1
package/dist/utils/visitor.d.ts
CHANGED
|
@@ -2,9 +2,12 @@
|
|
|
2
2
|
* New-visitor verdict — the ONE reader and writer of the returning-visitor
|
|
3
3
|
* marker (2026-09-13).
|
|
4
4
|
*
|
|
5
|
-
* `/v1/in-app/active` and `/v1/sdk/prefetch-bundle` both take `is_new_user
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* `/v1/in-app/active` and `/v1/sdk/prefetch-bundle` both take `is_new_user`.
|
|
6
|
+
* Since the 2026-11-22 ruling ("not signed in = new customer") the SDK still
|
|
7
|
+
* sends it but the server ignores it as a gate: `show_to_new_users_only` is decided by the
|
|
8
|
+
* cell's `in_app/new_customer` predicate from identity and the order ledger
|
|
9
|
+
* (2026-09-13 history below: when the server did gate on it, the bug it fixed
|
|
10
|
+
* hid every new-users-only campaign). The SDK used to write `aegis_returning_user=1`
|
|
8
11
|
* at the top of `AegisInAppManager.initialize()` and read it afterwards, inside
|
|
9
12
|
* the fetch — so the read always saw its own write, every fetch said
|
|
10
13
|
* `is_new_user=false`, and a new-users-only campaign could never be served.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visitor.d.ts","sourceRoot":"","sources":["../../src/utils/visitor.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"visitor.d.ts","sourceRoot":"","sources":["../../src/utils/visitor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAqCH;;;;GAIG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAUtC;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAQ3C;AAED,2EAA2E;AAC3E,wBAAgB,gCAAgC,IAAI,IAAI,CAEvD"}
|
|
@@ -192,7 +192,6 @@ export declare class AegisWidgetManager {
|
|
|
192
192
|
private sendCartAbandonmentBeacon;
|
|
193
193
|
private renderWidget;
|
|
194
194
|
private renderChatBubble;
|
|
195
|
-
private getUTMParams;
|
|
196
195
|
private renderToast;
|
|
197
196
|
private renderFeedbackForm;
|
|
198
197
|
private renderExitIntentPopup;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AegisWidgetManager.d.ts","sourceRoot":"","sources":["../../src/widgets/AegisWidgetManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAqB1D,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,aAAa,GAAG,OAAO,GAAG,eAAe,GAAG,mBAAmB,CAAC;IAC7E,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAA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;;;;OAKG;IACH,OAAO,IAAI,IAAI;IAuBf;;;;;OAKG;IACH,OAAO,CAAC,SAAS;IAUX,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAuBjC,WAAW,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;IAOrC,OAAO,CAAC,kBAAkB;IAqB1B,OAAO,CAAC,oBAAoB;IA4C5B,OAAO,CAAC,gBAAgB;IA4BxB,OAAO,CAAC,oBAAoB;IA6B5B,OAAO,CAAC,mBAAmB;YAgBb,oBAAoB;YA+BpB,YAAY;IAiC1B,OAAO,CAAC,sBAAsB;IAQ9B,OAAO,CAAC,qBAAqB;IA4C7B,OAAO,CAAC,2BAA2B;IAoFnC,OAAO,CAAC,yBAAyB;IAiDjC,OAAO,CAAC,YAAY;IA4BpB,OAAO,CAAC,gBAAgB;IA8DxB,OAAO,CAAC,WAAW;IA0DnB,OAAO,CAAC,kBAAkB;IA4I1B,OAAO,CAAC,qBAAqB;YAuHf,cAAc;YAmCd,UAAU;IAiCxB,OAAO,CAAC,WAAW;IAgBnB,OAAO,CAAC,aAAa;IAgBrB,OAAO,CAAC,aAAa;IAWrB,OAAO,CAAC,cAAc;IAKtB,OAAO,CAAC,kBAAkB;IA8C1B,OAAO,CAAC,uBAAuB;IAgJ/B,OAAO,CAAC,kBAAkB;IA6I1B,OAAO,CAAC,wBAAwB;IAShC,OAAO,CAAC,GAAG;CAMZ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@active-reach/web-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.55.0",
|
|
4
4
|
"description": "Web SDK for Active Reach Intelligence — event tracking, identity resolution, in-app messaging, web push, and placements",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fetch-abort-Bs-Stg-I.mjs","sources":["../src/utils/visitor.ts","../src/inapp/active-request.ts","../src/utils/fetch-abort.ts"],"sourcesContent":["/**\n * New-visitor verdict — the ONE reader and writer of the returning-visitor\n * marker (2026-09-13).\n *\n * `/v1/in-app/active` and `/v1/sdk/prefetch-bundle` both take `is_new_user`,\n * and the server drops any campaign whose `display_rules.show_to_new_users_only`\n * is set when it arrives false. The SDK used to write `aegis_returning_user=1`\n * at the top of `AegisInAppManager.initialize()` and read it afterwards, inside\n * the fetch — so the read always saw its own write, every fetch said\n * `is_new_user=false`, and a new-users-only campaign could never be served.\n *\n * The rule this module enforces: the marker is read ONCE, before anything\n * writes it, and the verdict is held for the whole browsing session.\n *\n * - `isNewVisitor()` resolves the verdict on first call and caches it in\n * memory (this page load) and in sessionStorage (later page loads in the\n * same tab session), so every fetch in a session sends the same value and\n * the verdict does not flip after the marker is written.\n * - `markReturningVisitor()` is the only writer. It resolves the verdict\n * first, so no call order can make the read see the write.\n *\n * Storage unavailable (SSR, blocked site data, a browser that throws on\n * access): the verdict is RETURNING (`false`). \"New\" is a positive claim that\n * unlocks first-visit-only messages; when the SDK cannot remember a visit it\n * cannot prove one never happened, and because the marker can never be saved,\n * answering \"new\" would re-show a first-visit message on every page of every\n * visit forever. `false` is also what the server assumes when the parameter is\n * absent, so an unknown visitor reads the same on both sides.\n */\n\nconst RETURNING_MARKER_KEY = 'aegis_returning_user';\nconst SESSION_VERDICT_KEY = 'aegis_new_visitor_session';\n\nlet cachedVerdict: boolean | null = null;\n\nfunction readSessionVerdict(): boolean | null {\n try {\n if (typeof sessionStorage === 'undefined') return null;\n const stored = sessionStorage.getItem(SESSION_VERDICT_KEY);\n if (stored === '1') return true;\n if (stored === '0') return false;\n return null;\n } catch {\n return null;\n }\n}\n\nfunction writeSessionVerdict(verdict: boolean): void {\n try {\n if (typeof sessionStorage === 'undefined') return;\n sessionStorage.setItem(SESSION_VERDICT_KEY, verdict ? '1' : '0');\n } catch {\n // sessionStorage blocked — the in-memory cache still holds this page load\n }\n}\n\nfunction readMarkerVerdict(): boolean {\n try {\n if (typeof localStorage === 'undefined') return false;\n return localStorage.getItem(RETURNING_MARKER_KEY) === null;\n } catch {\n return false;\n }\n}\n\n/**\n * Whether this browsing session belongs to a visitor the SDK has never seen\n * before. Stable for the whole session; see the module doc for the default\n * when storage is unavailable.\n */\nexport function isNewVisitor(): boolean {\n if (cachedVerdict !== null) return cachedVerdict;\n const sessionVerdict = readSessionVerdict();\n if (sessionVerdict !== null) {\n cachedVerdict = sessionVerdict;\n return cachedVerdict;\n }\n cachedVerdict = readMarkerVerdict();\n writeSessionVerdict(cachedVerdict);\n return cachedVerdict;\n}\n\n/**\n * Record that this visitor has now been seen, so the NEXT session reads as\n * returning. Resolves the current session's verdict before writing.\n */\nexport function markReturningVisitor(): void {\n isNewVisitor();\n try {\n if (typeof localStorage === 'undefined') return;\n localStorage.setItem(RETURNING_MARKER_KEY, '1');\n } catch {\n // storage blocked — nothing to remember; the verdict stays as resolved\n }\n}\n\n/** Test seam: forget the in-memory verdict, as a fresh page load would. */\nexport function resetVisitorVerdictCacheForTests(): void {\n cachedVerdict = null;\n}\n","/**\n * The ONE builder for the `/v1/in-app/active` request (Aman 2026-11-19).\n *\n * `AegisInAppManager.refreshCampaigns()` and the early-boot script\n * (`@active-reach/web-sdk/boot`, src/boot.ts) build the SAME URL, headers and\n * request key through this module, so a response the boot script started\n * before the SDK loaded is exactly the one the manager would have asked for,\n * and the manager adopts it instead of asking again. Never a second builder.\n *\n * The request key (`activeRequestKey`) is the page context the answer is for:\n * redacted page URL + surface + screen + outlet + cart ids. Identity and the\n * write key travel in headers and are matched separately when a boot answer is\n * adopted (`takeActiveBoot`).\n */\nimport { redactUrl } from '../utils/redact-url';\nimport { isNewVisitor } from '../utils/visitor';\nimport { previewAsOfToken } from '../utils/preview-as-of';\nimport { Storage } from '../utils/storage';\n\n/** The logical surfaces a host may declare (aegis.page(name) / config.surface). */\nexport const KNOWN_SURFACES: ReadonlySet<string> = new Set([\n 'bill',\n 'storefront_catalog',\n 'storefront_rewards',\n 'storefront_feedback',\n 'storefront_reviews',\n 'storefront_members',\n 'storefront_orders',\n 'storefront_account',\n 'storefront_referrals',\n 'external_website',\n 'external_mobile_screen',\n]);\n\nexport interface ActiveRequestContext {\n apiHost: string;\n writeKey: string;\n /** The visitor's anonymous id (analytics `anon_id`) or the host's user id. */\n userId?: string;\n contactId?: string;\n contactToken?: string;\n organizationId?: string;\n propertyId?: string;\n surface: string | null;\n screen: string | null;\n locationId: string | null;\n /** `null` = no cart known (param omitted); `[]` = an empty cart (sent empty). */\n cartProductIds: string[] | null;\n previewOnly: boolean;\n}\n\nexport interface ActiveRequest {\n url: string;\n headers: Record<string, string>;\n key: string;\n}\n\n/** The page context a host declares before init, normalised exactly as the\n * manager's constructor records it: only a known surface sets the surface,\n * the screen falls back to the surface, and `page_view` is no screen. */\nexport function normalizePageContext(\n surface: string | null | undefined,\n screen: string | null | undefined,\n): { surface: string | null; screen: string | null } {\n const s = surface && KNOWN_SURFACES.has(surface) ? surface : null;\n const sc = screen || surface || null;\n return { surface: s, screen: sc && sc !== 'page_view' ? sc : null };\n}\n\n/** The visitor's anonymous id as the analytics SDK stores it (`anon_id`). */\nexport function readAnonIdFromStorage(): string | undefined {\n if (typeof document === 'undefined') return undefined;\n try {\n const storage = new Storage();\n return storage.get('anon_id') ?? undefined;\n } catch {\n return undefined;\n }\n}\n\nexport function detectDeviceType(): 'mobile' | 'desktop' | 'tablet' {\n if (typeof navigator === 'undefined') return 'desktop';\n const ua = navigator.userAgent;\n if (/Mobi|Android/i.test(ua)) return 'mobile';\n if (/iPad|Tablet/i.test(ua)) return 'tablet';\n return 'desktop';\n}\n\nexport function readABAssignments(): Record<string, string> {\n try {\n if (typeof localStorage === 'undefined') return {};\n return JSON.parse(localStorage.getItem('aegis_ab_assignments') || '{}');\n } catch {\n return {};\n }\n}\n\n/** The redacted page URL the request sends as `page_url` (null outside a window). */\nexport function currentPageUrl(): string | null {\n if (typeof window === 'undefined' || !window.location) return null;\n return redactUrl((window.location.pathname || '') + (window.location.search || ''));\n}\n\n/** The cart ids as a request-key part: sorted + deduped so a reorder is not a\n * change; `-` = no cart known, distinct from `` = an empty cart. */\nexport function cartKeyPartOf(ids: string[] | null): string {\n return ids === null ? '-' : [...ids].sort().join(',');\n}\n\nexport function activeRequestKey(\n ctx: Pick<ActiveRequestContext, 'surface' | 'screen' | 'locationId' | 'cartProductIds'>,\n): string {\n const url = currentPageUrl() ?? '/';\n return [url, ctx.surface ?? '', ctx.screen ?? '', ctx.locationId ?? '', cartKeyPartOf(ctx.cartProductIds)].join('|');\n}\n\n/** The api host without a trailing slash (one spelling for the request URL). */\nexport function normalizeApiHost(apiHost: string): string {\n return apiHost.replace(/\\/+$/, '');\n}\n\nexport function buildActiveRequest(ctx: ActiveRequestContext): ActiveRequest {\n const context = new URLSearchParams({\n device_type: detectDeviceType(),\n page_url: currentPageUrl() ?? '/',\n });\n // Geo is resolved server-side from IP. The new-visitor verdict is fixed for\n // the session (utils/visitor.ts), so every request in a session sends the\n // same value, the boot script's included.\n context.set('is_new_user', isNewVisitor() ? 'true' : 'false');\n if (ctx.surface) context.set('current_surface', ctx.surface);\n if (ctx.screen) context.set('current_screen', ctx.screen);\n if (ctx.locationId) context.set('location_id', ctx.locationId);\n if (ctx.cartProductIds !== null) context.set('cart_product_ids', ctx.cartProductIds.join(','));\n const previewAsOf = previewAsOfToken();\n if (previewAsOf) context.set('preview_as_of', previewAsOf);\n if (ctx.previewOnly) context.set('preview', '1');\n\n const headers: Record<string, string> = {\n 'X-Aegis-Write-Key': ctx.writeKey,\n 'Content-Type': 'application/json',\n };\n if (ctx.userId) headers['X-User-ID'] = ctx.userId;\n if (ctx.contactId) headers['X-Contact-ID'] = ctx.contactId;\n if (ctx.contactId && ctx.contactToken) headers['X-Contact-Token'] = ctx.contactToken;\n if (ctx.organizationId) headers['X-Organization-ID'] = ctx.organizationId;\n if (ctx.propertyId) headers['X-Property-Id'] = ctx.propertyId;\n const abAssignments = readABAssignments();\n if (Object.keys(abAssignments).length > 0) {\n headers['X-AB-Assignments'] = btoa(JSON.stringify(abAssignments));\n }\n // The host is normalised HERE, for the manager and the boot script alike: a\n // configured `https://api.example/` and `https://api.example` build the same\n // URL, so a boot answer is adopted either way (portal audit 2026-11-20).\n return {\n url: `${normalizeApiHost(ctx.apiHost)}/v1/in-app/active?${context.toString()}`,\n headers,\n key: activeRequestKey(ctx),\n };\n}\n\n/** What the early-boot script leaves on `window.__aegisActiveBoot`. */\nexport interface ActiveBootHandle {\n key: string;\n url: string;\n headers: Record<string, string>;\n promise: Promise<Response>;\n}\n\nexport const ACTIVE_BOOT_GLOBAL = '__aegisActiveBoot';\n\ntype BootWindow = Window & { [ACTIVE_BOOT_GLOBAL]?: ActiveBootHandle };\n\nexport function readActiveBoot(): ActiveBootHandle | undefined {\n if (typeof window === 'undefined') return undefined;\n return (window as BootWindow)[ACTIVE_BOOT_GLOBAL];\n}\n\nexport function storeActiveBoot(handle: ActiveBootHandle): void {\n if (typeof window === 'undefined') return;\n (window as BootWindow)[ACTIVE_BOOT_GLOBAL] = handle;\n}\n\nexport function clearActiveBoot(): void {\n if (typeof window === 'undefined') return;\n delete (window as BootWindow)[ACTIVE_BOOT_GLOBAL];\n}\n\n/** A boot answer is the manager's own when it asked the same URL with the same\n * headers. The one header the manager may ADD is `X-User-ID`: on a first\n * visit the analytics SDK mints the anonymous id after the boot script ran,\n * and the server holds no state for a brand-new id, so the answer is the same. */\nexport function bootMatches(boot: Pick<ActiveBootHandle, 'key' | 'url' | 'headers'>, req: ActiveRequest): boolean {\n if (boot.key !== req.key || boot.url !== req.url) return false;\n for (const [name, value] of Object.entries(boot.headers)) {\n if (req.headers[name] !== value) return false;\n }\n for (const name of Object.keys(req.headers)) {\n if (!(name in boot.headers) && name !== 'X-User-ID') return false;\n }\n return true;\n}\n\n/** Adopt the early-boot answer for `req` (the global is cleared either way:\n * a boot answer is for the page's FIRST request only). */\nexport function takeActiveBoot(req: ActiveRequest): Promise<Response> | null {\n const boot = readActiveBoot();\n if (!boot) return null;\n clearActiveBoot();\n return bootMatches(boot, req) ? boot.promise : null;\n}\n","/**\n * The SDK's client abort (Aman 11-01, Q3 speed ruling / WP17 L14): SDK and\n * rail reads answer p95 < 300 ms, and the client gives up at 800 ms so a slow\n * gateway never holds the host page. Each caller then falls back (last config,\n * last bundle, last good rail; bootstrap raises) and never blocks render or\n * checkout.\n *\n * The timer keeps running after the headers arrive, so the BODY read is inside\n * the same 800 ms budget: a body still streaming at 800 ms rejects with an\n * AbortError, which every caller already treats as a failed fetch. An abort\n * after the body was read is a no-op.\n *\n * Uses an AbortController + setTimeout rather than `AbortSignal.timeout`\n * (Safari < 16 lacks it). A caller-supplied signal still aborts the request.\n *\n * Guard: tests/drift-sdk-fetch-abort.test.ts (every listed SDK read passes\n * through here with a budget <= 800 ms).\n */\nexport const SDK_FETCH_ABORT_MS = 800;\n\nexport function fetchWithAbort(\n input: string,\n init: RequestInit = {},\n timeoutMs: number = SDK_FETCH_ABORT_MS\n): Promise<Response> {\n const budget = Math.min(timeoutMs, SDK_FETCH_ABORT_MS);\n if (typeof AbortController === 'undefined') {\n return fetch(input, init);\n }\n const controller = new AbortController();\n const outer = init.signal;\n if (outer) {\n if (outer.aborted) controller.abort();\n else outer.addEventListener('abort', () => controller.abort(), { once: true });\n }\n const timer = setTimeout(() => controller.abort(), budget);\n return fetch(input, { ...init, signal: controller.signal }).catch((err: unknown) => {\n clearTimeout(timer);\n throw err;\n });\n}\n\n/**\n * A BOOT read: the first answer a page gets from an endpoint, with nothing to\n * fall back on (no last bundle, no saved rails, no cookie). On a cold\n * connection the 800 ms budget is spent on DNS + TCP + TLS + the CORS\n * preflight, and the browser aborts before the real request ever leaves\n * (measured on the Cake House store 2026-11-19: two `OPTIONS /v1/in-app/active`\n * reached the gateway, no GET followed, and the page stayed empty until a\n * reload). The second try rides the warm connection and lands in 100-250 ms,\n * so one retry on an ABORT (never on an HTTP status or a network error) is\n * the whole fix. Budget: 800 ms per try, one retry on abort only (Aman\n * 2026-11-20; the 11-01 ruling reads \"per try\", no cap on the total). A\n * caller's own aborted signal is honoured and never retried. Readers that already hold an answer\n * (a later poll) keep using fetchWithAbort: a stale answer beats a late one.\n *\n * Guard: tests/drift-sdk-fetch-abort.test.ts (the boot reads use this helper).\n */\nexport async function fetchWithAbortRetry(\n input: string,\n init: RequestInit = {},\n timeoutMs: number = SDK_FETCH_ABORT_MS\n): Promise<Response> {\n try {\n return await fetchWithAbort(input, init, timeoutMs);\n } catch (err) {\n if (!isAbortError(err) || init.signal?.aborted) throw err;\n return fetchWithAbort(input, init, timeoutMs);\n }\n}\n\n/** True when `err` is the abort raised by fetchWithAbort's budget (or any abort). */\nexport function isAbortError(err: unknown): boolean {\n return (\n !!err &&\n typeof err === 'object' &&\n ((err as { name?: string }).name === 'AbortError' || (err as { name?: string }).name === 'TimeoutError')\n );\n}\n"],"names":[],"mappings":";AA8BA,MAAM,uBAAuB;AAC7B,MAAM,sBAAsB;AAE5B,IAAI,gBAAgC;AAEpC,SAAS,qBAAqC;AAC5C,MAAI;AACF,QAAI,OAAO,mBAAmB,YAAa,QAAO;AAClD,UAAM,SAAS,eAAe,QAAQ,mBAAmB;AACzD,QAAI,WAAW,IAAK,QAAO;AAC3B,QAAI,WAAW,IAAK,QAAO;AAC3B,WAAO;AAAA,EACT,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEA,SAAS,oBAAoB,SAAwB;AACnD,MAAI;AACF,QAAI,OAAO,mBAAmB,YAAa;AAC3C,mBAAe,QAAQ,qBAAqB,UAAU,MAAM,GAAG;AAAA,EACjE,QAAQ;AAAA,EAER;AACF;AAEA,SAAS,oBAA6B;AACpC,MAAI;AACF,QAAI,OAAO,iBAAiB,YAAa,QAAO;AAChD,WAAO,aAAa,QAAQ,oBAAoB,MAAM;AAAA,EACxD,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAOO,SAAS,eAAwB;AACtC,MAAI,kBAAkB,KAAM,QAAO;AACnC,QAAM,iBAAi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