@sentientui/react 0.40.1 → 0.41.1

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.
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/server.ts"],"sourcesContent":["/**\n * Server-only helpers for Next.js / SSR. No React or DOM APIs.\n */\nimport {\n preloadAssignments,\n preloadAssignmentsDetailed,\n readSessionCookie,\n trackServerGoal,\n type ServerAssignConfig,\n type ServerAssignments,\n} from '@sentientui/core/server';\n\nexport { preloadAssignments, readSessionCookie, trackServerGoal };\nexport type { ServerAssignConfig, ServerAssignments };\n\n/** Return value of `loadAdaptiveAssignments` — includes the session ID used for SSR. */\nexport type LoadAdaptiveAssignmentsResult = {\n assignments: ServerAssignments;\n /** The session ID used for SSR assignment. Pass as `ssrSessionId` to `<AdaptiveProvider>`. */\n sessionId: string;\n /** Components the operator moved onto the shared track: not in\n * `assignments`. Pass as `initialUnified` to `<AdaptiveProvider>`. */\n unified: string[];\n};\n\nexport type LoadAdaptiveAssignmentsOptions = {\n /** Next.js `cookies()` return value, or any object with `get(name)`. */\n cookies: { get(name: string): { value: string } | undefined };\n apiKey: string;\n baseUrl: string;\n /** Used when `_snt_uid` is absent (e.g. first visit, many crawlers). */\n createSessionId?: () => string;\n /** Must match a value in the project's `allowed_origins` (e.g. `http://localhost:3001`). */\n origin?: string;\n /** From Next.js `headers().get('user-agent')` — aligns SSR segment with the client. */\n userAgent?: string;\n /** From Next.js `headers().get('referer')`. */\n referer?: string;\n /**\n * `utm_*` params from the landing URL. The Referer header never carries the\n * page's OWN query string, so without this the SSR-minted session has no\n * campaign attribution until the client SDK hydrates and re-upserts.\n * Derive with `extractTrackedParams(searchParams)` from `@sentientui/core/server`.\n */\n utmParams?: Record<string, string>;\n /** Ad-platform click IDs (gclid, fbclid, ttclid, …) from the landing URL — same derivation as `utmParams`. */\n clickIds?: Record<string, string>;\n /** The landing page's path (no query string) — recognises a paid click to a product page or a `/discount/` link on the first decision. */\n landingPath?: string;\n /** Set true when the request carries `DNT: 1` or `Sec-GPC: 1` — skips the SSR session upsert + assignment so no session is minted for an opted-out visitor (audit P4). `AdaptiveRoot` sets this automatically from the request headers. */\n doNotTrack?: boolean;\n /** Milliseconds to wait for the API before returning default variants. Defaults to 1000 (typical decide is well under 150 ms; the full budget is only reached on a cold start or a distant API). */\n timeoutMs?: number;\n /**\n * Declared persona — the role your app already knows for this visitor (e.g.\n * from your auth context: 'admin', 'evaluator'). Must be a key in the\n * project's persona vocabulary; unrecognized values are ignored server-side.\n * Never a user id or email.\n */\n persona?: string;\n};\n\nfunction defaultSessionId(): string {\n if (typeof crypto !== 'undefined' && typeof crypto.randomUUID === 'function') {\n return crypto.randomUUID();\n }\n return `snt-${Date.now()}-${Math.random().toString(36).slice(2, 11)}`;\n}\n\n/**\n * Fetches bandit assignments on the server for SEO-safe HTML.\n * Pass `assignments` as `initialAssignments` and `sessionId` as `ssrSessionId`\n * on `<AdaptiveProvider>` so the client adopts the same session on first visit.\n */\nexport async function loadAdaptiveAssignments(\n components: Array<{ id: string; variantIds: string[] }>,\n options: LoadAdaptiveAssignmentsOptions,\n): Promise<LoadAdaptiveAssignmentsResult> {\n // apiKey is not optional here: the client writes the per-project suffixed\n // cookie, so an un-keyed read missed every returning visitor and minted a\n // fresh orphan session per SSR request (see readSessionCookie in core).\n const sessionId =\n readSessionCookie(options.cookies, options.apiKey) ??\n options.createSessionId?.() ??\n defaultSessionId();\n\n // With the unified cap: a moved component is not assigned (nothing is\n // recorded) and comes back in `unified`, so the page renders it on the\n // shared track instead of seeding the frozen variant it would otherwise get.\n const { assignments, unified } = await preloadAssignmentsDetailed(components, sessionId, {\n apiKey: options.apiKey,\n baseUrl: options.baseUrl,\n origin: options.origin,\n userAgent: options.userAgent,\n referer: options.referer,\n utmParams: options.utmParams,\n clickIds: options.clickIds,\n landingPath: options.landingPath,\n doNotTrack: options.doNotTrack,\n timeoutMs: options.timeoutMs,\n persona: options.persona,\n }, { unified: true });\n\n return { assignments, sessionId, unified };\n}\n\nexport { preloadDecisions } from '@sentientui/core/server';\nexport type { DecideResult, SlotDeclInput, SlotResult } from '@sentientui/core/server';\n\n/** Return value of `loadAdaptiveDecision` — includes the session ID used for SSR. */\nexport type LoadAdaptiveDecisionResult = import('@sentientui/core/server').DecideResult & {\n sessionId: string;\n};\n\nexport type LoadAdaptiveDecisionOptions = LoadAdaptiveAssignmentsOptions & {\n /**\n * Section IDs in default order. Passed to /v1/decide as the candidate\n * layout. Optional since 0.13.0 — slot-only pages may omit it (at least\n * one of `sections`/`components`/`slots` must be non-empty).\n */\n sections?: string[];\n /** Components to assign in the same decide call. */\n components?: Array<{ id: string; variantIds?: string[] }>;\n /** Adaptive-slot declarations (useAdaptiveTokens / AdaptiveGroup) to decide server-side. */\n slots?: import('@sentientui/core/server').SlotDeclInput[];\n /** 'registry' serves the project's published slot definitions (`<Adaptive id>`)\n * and is the only way `slotConfig`/`palette` come back. Default 'request'.\n * Requires `registrySlotIds`. */\n slotsFrom?: 'request' | 'registry';\n /**\n * Registry mode: the `<Adaptive id>`s THIS page renders — the decide is\n * scoped to exactly these. Required with `slotsFrom: 'registry'`; without it\n * the call downgrades to request mode (with a console.error) instead of\n * recording a close-out trial for every published slot on every page.\n */\n registrySlotIds?: string[];\n /**\n * Registry mode: what each slot on this page can render, keyed by slot id\n * (see `preloadDecisions`). Ids without an entry get core's default caps.\n * A hybrid `<Adaptive variants>{children}</Adaptive>` needs its entry: the\n * server draws `authored.<key>` only for keys the page declares here.\n */\n renderCaps?: Record<string, Omit<import('@sentientui/core').RenderCaps, 'fp'>>;\n};\n\n/**\n * SSR helper for pages with a declared section layout and/or adaptive slots.\n * Calls `/v1/decide` instead of multiple `/v1/assign` round trips.\n * Pass `sessionId` as `ssrSessionId` on `<AdaptiveProvider>` so the client\n * adopts the same session on first visit.\n *\n * Keyless: with no valid `pk_` key this never fetches (no timeout burn).\n * Under the `development` export condition the decision is computed by the\n * deterministic local engine with the same sessionId the client will adopt —\n * server and client agree by construction. In production the engine resolves\n * to a stub and defaults are returned with one console.error.\n */\nexport async function loadAdaptiveDecision(\n options: LoadAdaptiveDecisionOptions,\n): Promise<LoadAdaptiveDecisionResult> {\n const { preloadDecisions, readSessionCookie } = await import('@sentientui/core/server');\n\n // Keyed read — the client's cookie name is suffixed per project (see\n // loadAdaptiveAssignments above). Works for keyless too: with no pk_ key the\n // client writes the bare legacy name, which the un-suffixed read falls back to.\n const sessionId =\n readSessionCookie(options.cookies, options.apiKey) ??\n options.createSessionId?.() ??\n defaultSessionId();\n\n const keyValid = typeof options.apiKey === 'string' && options.apiKey.startsWith('pk_');\n if (!keyValid) {\n const fallback: LoadAdaptiveDecisionResult = {\n layoutOrder: options.sections ?? [],\n assignments: {},\n slots: {},\n persona: 'unknown',\n confidence: 0,\n sessionId,\n };\n try {\n const mod = (await import('@sentientui/core/local')) as unknown as {\n LOCAL_ENGINE_AVAILABLE: boolean;\n createLocalEngine(opts: { sessionId: string }): {\n decide(input: {\n sections?: string[];\n components?: Array<{ id: string; variantIds?: string[] }>;\n slots?: LoadAdaptiveDecisionOptions['slots'];\n }): {\n layoutOrder: string[] | null;\n assignments: Record<string, string>;\n slots: Record<string, string | Record<string, string>>;\n persona: string;\n confidence: number;\n };\n };\n };\n if (!mod.LOCAL_ENGINE_AVAILABLE) {\n // Pinned message — must byte-match PROD_KEYLESS_ERROR in @sentientui/core.\n console.error(\n '[sentient] No API key configured — nothing is being learned. Set NEXT_PUBLIC_SENTIENT_API_KEY or pass localMode: true for local development.',\n );\n return fallback;\n }\n const outcome = mod.createLocalEngine({ sessionId }).decide({\n sections: options.sections,\n components: options.components ?? [],\n slots: options.slots ?? [],\n });\n return {\n layoutOrder: outcome.layoutOrder ?? options.sections ?? [],\n assignments: outcome.assignments,\n slots: outcome.slots,\n persona: outcome.persona,\n confidence: outcome.confidence,\n sessionId,\n };\n } catch {\n return fallback;\n }\n }\n\n const result = await preloadDecisions(\n {\n sections: options.sections,\n components: options.components ?? [],\n slots: options.slots ?? [],\n slotsFrom: options.slotsFrom,\n registrySlotIds: options.registrySlotIds,\n ...(options.renderCaps ? { renderCaps: options.renderCaps } : {}),\n // Moved components come back in `unified`, not as assignments (see\n // loadAdaptiveAssignments). Pass them as `initialUnified`.\n unifiedCaps: true,\n },\n sessionId,\n {\n apiKey: options.apiKey,\n baseUrl: options.baseUrl,\n origin: options.origin,\n userAgent: options.userAgent,\n referer: options.referer,\n utmParams: options.utmParams,\n clickIds: options.clickIds,\n landingPath: options.landingPath,\n doNotTrack: options.doNotTrack,\n timeoutMs: options.timeoutMs,\n persona: options.persona,\n },\n );\n\n return { ...result, sessionId };\n}\n"],"mappings":"6aAGA,OACE,sBAAAA,EACA,8BAAAC,EACA,qBAAAC,EACA,mBAAAC,MAGK,0BAgGP,OAAS,oBAAAC,MAAwB,0BA5CjC,SAASC,GAA2B,CAClC,OAAI,OAAO,QAAW,aAAe,OAAO,OAAO,YAAe,WACzD,OAAO,WAAW,EAEpB,OAAO,KAAK,IAAI,CAAC,IAAI,KAAK,OAAO,EAAE,SAAS,EAAE,EAAE,MAAM,EAAG,EAAE,CAAC,EACrE,CAOA,eAAsBC,EACpBC,EACAC,EACwC,CA7E1C,IAAAC,EAAAC,EAAAC,EAiFE,IAAMC,GACJD,GAAAD,EAAAG,EAAkBL,EAAQ,QAASA,EAAQ,MAAM,IAAjD,KAAAE,GACAD,EAAAD,EAAQ,kBAAR,YAAAC,EAAA,KAAAD,KADA,KAAAG,EAEAN,EAAiB,EAKb,CAAE,YAAAS,EAAa,QAAAC,CAAQ,EAAI,MAAMC,EAA2BT,EAAYK,EAAW,CACvF,OAAQJ,EAAQ,OAChB,QAASA,EAAQ,QACjB,OAAQA,EAAQ,OAChB,UAAWA,EAAQ,UACnB,QAASA,EAAQ,QACjB,UAAWA,EAAQ,UACnB,SAAUA,EAAQ,SAClB,YAAaA,EAAQ,YACrB,WAAYA,EAAQ,WACpB,UAAWA,EAAQ,UACnB,QAASA,EAAQ,OACnB,EAAG,CAAE,QAAS,EAAK,CAAC,EAEpB,MAAO,CAAE,YAAAM,EAAa,UAAAF,EAAW,QAAAG,CAAQ,CAC3C,CAqDA,eAAsBE,EACpBT,EACqC,CA/JvC,IAAAC,EAAAC,EAAAC,EAAAO,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAgKE,GAAM,CAAE,iBAAAC,EAAkB,kBAAAZ,CAAkB,EAAI,KAAM,QAAO,yBAAyB,EAKhFD,GACJD,GAAAD,EAAAG,EAAkBL,EAAQ,QAASA,EAAQ,MAAM,IAAjD,KAAAE,GACAD,EAAAD,EAAQ,kBAAR,YAAAC,EAAA,KAAAD,KADA,KAAAG,EAEAN,EAAiB,EAGnB,GAAI,EADa,OAAOG,EAAQ,QAAW,UAAYA,EAAQ,OAAO,WAAW,KAAK,GACvE,CACb,IAAMkB,EAAuC,CAC3C,aAAaR,EAAAV,EAAQ,WAAR,KAAAU,EAAoB,CAAC,EAClC,YAAa,CAAC,EACd,MAAO,CAAC,EACR,QAAS,UACT,WAAY,EACZ,UAAAN,CACF,EACA,GAAI,CACF,IAAMe,EAAO,KAAM,QAAO,wBAAwB,EAgBlD,GAAI,CAACA,EAAI,uBAEP,eAAQ,MACN,mJACF,EACOD,EAET,IAAME,EAAUD,EAAI,kBAAkB,CAAE,UAAAf,CAAU,CAAC,EAAE,OAAO,CAC1D,SAAUJ,EAAQ,SAClB,YAAYW,EAAAX,EAAQ,aAAR,KAAAW,EAAsB,CAAC,EACnC,OAAOC,EAAAZ,EAAQ,QAAR,KAAAY,EAAiB,CAAC,CAC3B,CAAC,EACD,MAAO,CACL,aAAaE,GAAAD,EAAAO,EAAQ,cAAR,KAAAP,EAAuBb,EAAQ,WAA/B,KAAAc,EAA2C,CAAC,EACzD,YAAaM,EAAQ,YACrB,MAAOA,EAAQ,MACf,QAASA,EAAQ,QACjB,WAAYA,EAAQ,WACpB,UAAAhB,CACF,CACF,OAAQiB,EAAA,CACN,OAAOH,CACT,CACF,CAEA,IAAMI,EAAS,MAAML,EACnBM,EAAAC,EAAA,CACE,SAAUxB,EAAQ,SAClB,YAAYe,EAAAf,EAAQ,aAAR,KAAAe,EAAsB,CAAC,EACnC,OAAOC,EAAAhB,EAAQ,QAAR,KAAAgB,EAAiB,CAAC,EACzB,UAAWhB,EAAQ,UACnB,gBAAiBA,EAAQ,iBACrBA,EAAQ,WAAa,CAAE,WAAYA,EAAQ,UAAW,EAAI,CAAC,GANjE,CASE,YAAa,EACf,GACAI,EACA,CACE,OAAQJ,EAAQ,OAChB,QAASA,EAAQ,QACjB,OAAQA,EAAQ,OAChB,UAAWA,EAAQ,UACnB,QAASA,EAAQ,QACjB,UAAWA,EAAQ,UACnB,SAAUA,EAAQ,SACpB,YAAaA,EAAQ,YACnB,WAAYA,EAAQ,WACpB,UAAWA,EAAQ,UACnB,QAASA,EAAQ,OACnB,CACF,EAEA,OAAOuB,EAAAC,EAAA,GAAKF,GAAL,CAAa,UAAAlB,CAAU,EAChC","names":["preloadAssignments","preloadAssignmentsDetailed","readSessionCookie","trackServerGoal","preloadDecisions","defaultSessionId","loadAdaptiveAssignments","components","options","_a","_b","_c","sessionId","readSessionCookie","assignments","unified","preloadAssignmentsDetailed","loadAdaptiveDecision","_d","_e","_f","_g","_h","_i","_j","preloadDecisions","fallback","mod","outcome","e","result","__spreadProps","__spreadValues"]}
1
+ {"version":3,"sources":["../src/server.ts"],"sourcesContent":["/**\n * Server-only helpers for Next.js / SSR. No React or DOM APIs.\n */\nimport {\n preloadAssignments,\n preloadAssignmentsDetailed,\n readSessionCookie,\n signUserId,\n trackServerGoal,\n type ServerAssignConfig,\n type ServerAssignments,\n} from '@sentientui/core/server';\n\nexport { preloadAssignments, readSessionCookie, signUserId, trackServerGoal };\nexport type { ServerAssignConfig, ServerAssignments };\n\n/** Return value of `loadAdaptiveAssignments` — includes the session ID used for SSR. */\nexport type LoadAdaptiveAssignmentsResult = {\n assignments: ServerAssignments;\n /** The session ID used for SSR assignment. Pass as `ssrSessionId` to `<AdaptiveProvider>`. */\n sessionId: string;\n /** Components the operator moved onto the shared track: not in\n * `assignments`. Pass as `initialUnified` to `<AdaptiveProvider>`. */\n unified: string[];\n};\n\nexport type LoadAdaptiveAssignmentsOptions = {\n /** Next.js `cookies()` return value, or any object with `get(name)`. */\n cookies: { get(name: string): { value: string } | undefined };\n apiKey: string;\n baseUrl: string;\n /** Used when `_snt_uid` is absent (e.g. first visit, many crawlers). */\n createSessionId?: () => string;\n /** Must match a value in the project's `allowed_origins` (e.g. `http://localhost:3001`). */\n origin?: string;\n /** From Next.js `headers().get('user-agent')` — aligns SSR segment with the client. */\n userAgent?: string;\n /** From Next.js `headers().get('referer')`. */\n referer?: string;\n /**\n * `utm_*` params from the landing URL. The Referer header never carries the\n * page's OWN query string, so without this the SSR-minted session has no\n * campaign attribution until the client SDK hydrates and re-upserts.\n * Derive with `extractTrackedParams(searchParams)` from `@sentientui/core/server`.\n */\n utmParams?: Record<string, string>;\n /** Ad-platform click IDs (gclid, fbclid, ttclid, …) from the landing URL — same derivation as `utmParams`. */\n clickIds?: Record<string, string>;\n /** The landing page's path (no query string) — recognises a paid click to a product page or a `/discount/` link on the first decision. */\n landingPath?: string;\n /** Set true when the request carries `DNT: 1` or `Sec-GPC: 1` — skips the SSR session upsert + assignment so no session is minted for an opted-out visitor (audit P4). `AdaptiveRoot` sets this automatically from the request headers. */\n doNotTrack?: boolean;\n /** Milliseconds to wait for the API before returning default variants. Defaults to 1000 (typical decide is well under 150 ms; the full budget is only reached on a cold start or a distant API). */\n timeoutMs?: number;\n /**\n * Declared persona — the role your app already knows for this visitor (e.g.\n * from your auth context: 'admin', 'evaluator'). Must be a key in the\n * project's persona vocabulary; unrecognized values are ignored server-side.\n * Never a user id or email.\n */\n persona?: string;\n};\n\nfunction defaultSessionId(): string {\n if (typeof crypto !== 'undefined' && typeof crypto.randomUUID === 'function') {\n return crypto.randomUUID();\n }\n return `snt-${Date.now()}-${Math.random().toString(36).slice(2, 11)}`;\n}\n\n/**\n * Fetches bandit assignments on the server for SEO-safe HTML.\n * Pass `assignments` as `initialAssignments` and `sessionId` as `ssrSessionId`\n * on `<AdaptiveProvider>` so the client adopts the same session on first visit.\n */\nexport async function loadAdaptiveAssignments(\n components: Array<{ id: string; variantIds: string[] }>,\n options: LoadAdaptiveAssignmentsOptions,\n): Promise<LoadAdaptiveAssignmentsResult> {\n // apiKey is not optional here: the client writes the per-project suffixed\n // cookie, so an un-keyed read missed every returning visitor and minted a\n // fresh orphan session per SSR request (see readSessionCookie in core).\n const sessionId =\n readSessionCookie(options.cookies, options.apiKey) ??\n options.createSessionId?.() ??\n defaultSessionId();\n\n // With the unified cap: a moved component is not assigned (nothing is\n // recorded) and comes back in `unified`, so the page renders it on the\n // shared track instead of seeding the frozen variant it would otherwise get.\n const { assignments, unified } = await preloadAssignmentsDetailed(components, sessionId, {\n apiKey: options.apiKey,\n baseUrl: options.baseUrl,\n origin: options.origin,\n userAgent: options.userAgent,\n referer: options.referer,\n utmParams: options.utmParams,\n clickIds: options.clickIds,\n landingPath: options.landingPath,\n doNotTrack: options.doNotTrack,\n timeoutMs: options.timeoutMs,\n persona: options.persona,\n }, { unified: true });\n\n return { assignments, sessionId, unified };\n}\n\nexport { preloadDecisions } from '@sentientui/core/server';\nexport type { DecideResult, SlotDeclInput, SlotResult } from '@sentientui/core/server';\n\n/** Return value of `loadAdaptiveDecision` — includes the session ID used for SSR. */\nexport type LoadAdaptiveDecisionResult = import('@sentientui/core/server').DecideResult & {\n sessionId: string;\n};\n\nexport type LoadAdaptiveDecisionOptions = LoadAdaptiveAssignmentsOptions & {\n /**\n * Section IDs in default order. Passed to /v1/decide as the candidate\n * layout. Optional since 0.13.0 — slot-only pages may omit it (at least\n * one of `sections`/`components`/`slots` must be non-empty).\n */\n sections?: string[];\n /** Components to assign in the same decide call. */\n components?: Array<{ id: string; variantIds?: string[] }>;\n /** Adaptive-slot declarations (useAdaptiveTokens / AdaptiveGroup) to decide server-side. */\n slots?: import('@sentientui/core/server').SlotDeclInput[];\n /** 'registry' serves the project's published slot definitions (`<Adaptive id>`)\n * and is the only way `slotConfig`/`palette` come back. Default 'request'.\n * Requires `registrySlotIds`. */\n slotsFrom?: 'request' | 'registry';\n /**\n * Registry mode: the `<Adaptive id>`s THIS page renders — the decide is\n * scoped to exactly these. Required with `slotsFrom: 'registry'`; without it\n * the call downgrades to request mode (with a console.error) instead of\n * recording a close-out trial for every published slot on every page.\n */\n registrySlotIds?: string[];\n /**\n * Registry mode: what each slot on this page can render, keyed by slot id\n * (see `preloadDecisions`). Ids without an entry get core's default caps.\n * A hybrid `<Adaptive variants>{children}</Adaptive>` needs its entry: the\n * server draws `authored.<key>` only for keys the page declares here.\n */\n renderCaps?: Record<string, Omit<import('@sentientui/core').RenderCaps, 'fp'>>;\n};\n\n/**\n * SSR helper for pages with a declared section layout and/or adaptive slots.\n * Calls `/v1/decide` instead of multiple `/v1/assign` round trips.\n * Pass `sessionId` as `ssrSessionId` on `<AdaptiveProvider>` so the client\n * adopts the same session on first visit.\n *\n * Keyless: with no valid `pk_` key this never fetches (no timeout burn).\n * Under the `development` export condition the decision is computed by the\n * deterministic local engine with the same sessionId the client will adopt —\n * server and client agree by construction. In production the engine resolves\n * to a stub and defaults are returned with one console.error.\n */\nexport async function loadAdaptiveDecision(\n options: LoadAdaptiveDecisionOptions,\n): Promise<LoadAdaptiveDecisionResult> {\n const { preloadDecisions, readSessionCookie } = await import('@sentientui/core/server');\n\n // Keyed read — the client's cookie name is suffixed per project (see\n // loadAdaptiveAssignments above). Works for keyless too: with no pk_ key the\n // client writes the bare legacy name, which the un-suffixed read falls back to.\n const sessionId =\n readSessionCookie(options.cookies, options.apiKey) ??\n options.createSessionId?.() ??\n defaultSessionId();\n\n const keyValid = typeof options.apiKey === 'string' && options.apiKey.startsWith('pk_');\n if (!keyValid) {\n const fallback: LoadAdaptiveDecisionResult = {\n layoutOrder: options.sections ?? [],\n assignments: {},\n slots: {},\n persona: 'unknown',\n confidence: 0,\n sessionId,\n };\n try {\n const mod = (await import('@sentientui/core/local')) as unknown as {\n LOCAL_ENGINE_AVAILABLE: boolean;\n createLocalEngine(opts: { sessionId: string }): {\n decide(input: {\n sections?: string[];\n components?: Array<{ id: string; variantIds?: string[] }>;\n slots?: LoadAdaptiveDecisionOptions['slots'];\n }): {\n layoutOrder: string[] | null;\n assignments: Record<string, string>;\n slots: Record<string, string | Record<string, string>>;\n persona: string;\n confidence: number;\n };\n };\n };\n if (!mod.LOCAL_ENGINE_AVAILABLE) {\n // Pinned message — must byte-match PROD_KEYLESS_ERROR in @sentientui/core.\n console.error(\n '[sentient] No API key configured — nothing is being learned. Set NEXT_PUBLIC_SENTIENT_API_KEY or pass localMode: true for local development.',\n );\n return fallback;\n }\n const outcome = mod.createLocalEngine({ sessionId }).decide({\n sections: options.sections,\n components: options.components ?? [],\n slots: options.slots ?? [],\n });\n return {\n layoutOrder: outcome.layoutOrder ?? options.sections ?? [],\n assignments: outcome.assignments,\n slots: outcome.slots,\n persona: outcome.persona,\n confidence: outcome.confidence,\n sessionId,\n };\n } catch {\n return fallback;\n }\n }\n\n const result = await preloadDecisions(\n {\n sections: options.sections,\n components: options.components ?? [],\n slots: options.slots ?? [],\n slotsFrom: options.slotsFrom,\n registrySlotIds: options.registrySlotIds,\n ...(options.renderCaps ? { renderCaps: options.renderCaps } : {}),\n // Moved components come back in `unified`, not as assignments (see\n // loadAdaptiveAssignments). Pass them as `initialUnified`.\n unifiedCaps: true,\n },\n sessionId,\n {\n apiKey: options.apiKey,\n baseUrl: options.baseUrl,\n origin: options.origin,\n userAgent: options.userAgent,\n referer: options.referer,\n utmParams: options.utmParams,\n clickIds: options.clickIds,\n landingPath: options.landingPath,\n doNotTrack: options.doNotTrack,\n timeoutMs: options.timeoutMs,\n persona: options.persona,\n },\n );\n\n return { ...result, sessionId };\n}\n"],"mappings":"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","names":["preloadAssignments","preloadAssignmentsDetailed","readSessionCookie","signUserId","trackServerGoal","preloadDecisions","defaultSessionId","loadAdaptiveAssignments","components","options","_a","_b","_c","sessionId","readSessionCookie","assignments","unified","preloadAssignmentsDetailed","loadAdaptiveDecision","_d","_e","_f","_g","_h","_i","_j","preloadDecisions","fallback","mod","outcome","e","result","__spreadProps","__spreadValues"]}
@@ -1,3 +1,3 @@
1
1
  'use client';
2
- "use strict";var Ae=Object.create;var F=Object.defineProperty,Oe=Object.defineProperties,Ie=Object.getOwnPropertyDescriptor,Te=Object.getOwnPropertyDescriptors,Ve=Object.getOwnPropertyNames,ie=Object.getOwnPropertySymbols,De=Object.getPrototypeOf,oe=Object.prototype.hasOwnProperty,Le=Object.prototype.propertyIsEnumerable;var re=(e,t,n)=>t in e?F(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,v=(e,t)=>{for(var n in t||(t={}))oe.call(t,n)&&re(e,n,t[n]);if(ie)for(var n of ie(t))Le.call(t,n)&&re(e,n,t[n]);return e},M=(e,t)=>Oe(e,Te(t));var Ne=(e,t)=>{for(var n in t)F(e,n,{get:t[n],enumerable:!0})},se=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Ve(t))!oe.call(e,a)&&a!==n&&F(e,a,{get:()=>t[a],enumerable:!(i=Ie(t,a))||i.enumerable});return e};var $=(e,t,n)=>(n=e!=null?Ae(De(e)):{},se(t||!e||!e.__esModule?F(n,"default",{value:e,enumerable:!0}):n,e)),Fe=e=>se(F({},"__esModule",{value:!0}),e);var tt={};Ne(tt,{renderWithSentient:()=>et});module.exports=Fe(tt);var Ee=require("@testing-library/react");var o=require("react"),B=require("@sentientui/core");var Ge=new Map,We=new Map;function ae(e,t){Ge.set(e,t);let n=We.get(e);if(n)for(let i of n)try{i(t)}catch(a){}}var Ue={on:!1,listeners:new Set};function le(){if(typeof window=="undefined")return Ue;let e=window;return e.__sentient_preview||(e.__sentient_preview={on:!1,listeners:new Set}),e.__sentient_preview}function j(){return le().on}function ce(e){let t=le().listeners;return t.add(e),()=>{t.delete(e)}}function de(e){return{isLocal:e.isLocal,track:()=>{},goal:()=>{},componentGoal:()=>{},identify:()=>{},fetchWeights:()=>Promise.resolve([]),getAssignment:(t,n)=>e.getAssignment(t,n),isUnified:t=>{var n,i;return(i=(n=e.isUnified)==null?void 0:n.call(e,t))!=null?i:!1},assign:(t,n,i,a,d)=>e.assign(t,n,i,a,d),decide:()=>Promise.resolve(null),getSlotResult:t=>e.getSlotResult(t),getSlotConfig:t=>e.getSlotConfig(t),getSitePalette:()=>e.getSitePalette(),reportSlots:t=>e.reportSlots(t),getPersona:()=>e.getPersona(),getGraph:()=>e.getGraph(),flush:()=>e.flush(),dispose:()=>e.dispose(),destroy:()=>e.destroy()}}var Me="sentient:overrides-changed";function G(){var t;if(typeof window=="undefined")return;let e=window;e.__sentient_overrides_version=((t=e.__sentient_overrides_version)!=null?t:0)+1,window.dispatchEvent(new Event(Me))}function ue(e){typeof window!="undefined"&&(window.__sentient_devtools_config=e)}function W(){var e;return typeof process=="undefined"||((e=process.env)==null?void 0:e.NODE_ENV)!=="production"}var $e={components:new Map,slots:new Map,sections:[],listeners:new Set,version:0};function H(){if(typeof window=="undefined")return $e;let e=window;return e.__sentient_registry||(e.__sentient_registry={components:new Map,slots:new Map,sections:[],listeners:new Set,version:0}),e.__sentient_registry}function Ke(){H().version+=1;for(let e of H().listeners)e()}function z(e){W()&&(H().sections=[...e],Ke())}var fe="0.40.1",J=fe!=="0.0.0-dev"?{name:"react",version:fe}:void 0;function Be(){let e=window;return e.__sentient_slot_config_overrides||(e.__sentient_slot_config_overrides={}),e.__sentient_slot_config_overrides}function T(e,t){Be()[e]=t}function ge(e){window.__sentient_vocabulary_override=e}function je(){let e=window;return e.__sentient_slot_overrides||(e.__sentient_slot_overrides={}),e.__sentient_slot_overrides}function V(e,t){je()[e]=t}function pe(e){let t=null;try{let n=location.hash.slice(1),i=RegExp("(^|[?&])"+e+"=([^&]*)").exec(n);if(i){t=i[2];let a=n.slice(i.index+i[0].length);i[1]!="&"&&a[0]=="&"&&(a=i[1]+a.slice(1));let d=n.slice(0,i.index)+a;history.replaceState(history.state,"",d?"#"+d:location.pathname+location.search)}}catch(n){}return t}var X="__snt_editor_token",D=null,q=!1;function me(){return q}function He(){try{return sessionStorage.getItem(X)}catch(e){return null}}function K(e){if(D)return D;let t=typeof window=="undefined"?null:pe("sentient_editor_code");if(!t){let n=typeof window=="undefined"?null:He();return q=!!n,D=Promise.resolve(n?{token:n,fresh:!1}:null),D}return q=!0,D=fetch(`${e}/editor/exchange`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({code:t})}).then(async n=>{let i=n.ok?(await n.json()).token:void 0;if(!i)return{error:n.ok?500:n.status};try{sessionStorage.setItem(X,i)}catch(a){}return{token:i,fresh:!0}}).catch(()=>({error:0})),D}function ye(){try{sessionStorage.removeItem(X)}catch(e){}}var ve="sentient_preview_cell",_e="sentient_refresh_region",Y="sentient-cell-preview-bar",A="__preview__",ze=null;function Se(e){if(typeof window=="undefined"||typeof document=="undefined"||document.getElementById(Y))return;let t,n;try{let l=new URLSearchParams(window.location.search);t=l.get(ve),n=l.get(_e)}catch(l){return}if(!t&&!n)return;let i=(e!=null?e:"https://api.sentient-ui.com/v1").replace(/\/$/,""),a=K(i);if(!me())return;if(n){ze={slotId:n,session:a,base:i},T(n,{kind:"arms"}),V(n,A),G();return}if(!t)return;let d=t.lastIndexOf("~");if(d<=0)return;let g=t.slice(0,d),O=t.slice(d+1);a.then(l=>l?"token"in l?fetch(`${i}/editor/cell-preview?slotId=${encodeURIComponent(g)}&persona=${encodeURIComponent(O)}`,{headers:{authorization:`Bearer ${l.token}`}}):(U(l.error===401?"This preview link has expired \u2014 reopen it from your dashboard.":"Couldn\u2019t load this preview \u2014 reopen it from your dashboard."),null):null).then(async l=>{if(!l)return;if(!l.ok){U(l.status===401?"This preview link has expired \u2014 reopen it from your dashboard.":"Couldn\u2019t load this preview \u2014 reopen it from your dashboard.");return}let c=await l.json();if(c.vocabulary&&Array.isArray(c.vocabulary.entries)&&ge(c.vocabulary),c.compose!=null)T(g,{kind:"arms",compose:{[A]:c.compose}}),V(g,A);else if(c.edits!=null&&typeof c.skeletonFp=="string"&&Array.isArray(c.leafToNode))T(g,{kind:"arms",edits:{edits:c.edits,fp:c.skeletonFp,leafToNode:c.leafToNode}}),V(g,A);else if(c.blocks!=null)T(g,{kind:"arms",blocks:{[A]:c.blocks}}),V(g,A);else if(c.content!=null)T(g,{kind:"arms",content:c.content}),V(g,A);else{U("Nothing to preview in that square yet.");return}G(),U(`Previewing \u201C${c.slotName}\u201D for ${c.personaDisplay}${c.status==="review"?" \u2014 waiting for your approval":""}. Nothing is being tracked.`),setTimeout(()=>{var p;try{(p=document.querySelector(`[data-sentient-slot="${g}"]`))==null||p.scrollIntoView({block:"center"})}catch(y){}},300)}).catch(()=>U("Couldn\u2019t load this preview \u2014 check your connection and reopen it from your dashboard."))}function U(e){var a;if(document.getElementById(Y))return;let t=document.createElement("div");t.id=Y,Object.assign(t.style,{position:"fixed",bottom:"16px",left:"50%",transform:"translateX(-50%)",zIndex:"2147483647",display:"flex",alignItems:"center",gap:"10px",padding:"10px 14px",borderRadius:"12px",maxWidth:"90vw",background:"#111827",color:"#fff",font:"13px system-ui, sans-serif",border:"1px solid rgba(139,92,246,0.6)",boxShadow:"0 10px 34px rgba(0,0,0,0.45)"});let n=document.createElement("span");n.textContent=e;let i=document.createElement("button");i.textContent="Exit preview",Object.assign(i.style,{padding:"4px 10px",borderRadius:"999px",border:"1px solid rgba(255,255,255,0.35)",background:"transparent",color:"#fff",font:"12px system-ui, sans-serif",cursor:"pointer"}),i.onclick=()=>{ye();let d=new URL(window.location.href);d.searchParams.delete(ve),d.searchParams.delete(_e),window.location.assign(d.toString())},t.append(n,i),((a=document.body)!=null?a:document.documentElement).append(t)}var he=!1;function we(e){if(he||typeof window=="undefined")return;he=!0;let t=(e!=null?e:"https://api.sentient-ui.com/v1").replace(/\/$/,"");K(t).then(n=>{!n||!("token"in n)||!n.fresh||Je(t,n.token)})}function Je(e,t){let n=()=>{window.setTimeout(()=>{import("@sentientui/core/style-sample").then(({sampleStyleVocabulary:i})=>fetch(`${e}/editor/style-vocabulary`,{method:"POST",headers:{authorization:`Bearer ${t}`,"content-type":"application/json"},body:JSON.stringify(i(document))})).catch(()=>{})},1e3)};document.readyState==="complete"?n():window.addEventListener("load",n,{once:!0})}var Re=require("react/jsx-runtime");function qe(){var e,t;if(typeof window=="undefined")return"desktop:direct";try{return(0,B.deriveSessionSegment)({userAgent:(e=navigator.userAgent)!=null?e:"",referer:(t=document.referrer)!=null?t:"",appOrigin:window.location.origin})}catch(n){return"desktop:direct"}}var Ce="https://api.sentient-ui.com/v1",Xe=(0,o.createContext)({client:null,apiKey:"",initialAssignments:{},initialUnified:[],sessionSegment:"desktop:direct",ssrFallback:"first",onAssignment:void 0,initialLayoutOrder:null,initialSlots:{},initialSlotConfig:{},initialPalette:null,initialVocabulary:null,initialPersona:null,apiBaseUrl:Ce,debug:!1}),be=!1,Q=new Set;function Ye(e,t,n){let i=(0,o.useRef)(n);i.current=n;let[a,d]=(0,o.useState)(null),[g,O]=(0,o.useState)(!1),l=(0,o.useRef)(e);l.current=e;let c=e===void 0?"":typeof e=="string"?e:JSON.stringify(M(v({},e),{check:typeof e.check,refused:typeof e.refused}));return(0,o.useEffect)(()=>{let p=l.current;if(p===void 0||typeof window=="undefined")return;let y,k=!1;return import("@sentientui/core/consent").then(({consentWatcher:x,forgetVisitor:I})=>{if(k)return;let E=x(typeof p=="object"&&p.cmp===void 0&&p.check?v(M(v({},p),{check:()=>l.current.check()}),p.refused?{refused:()=>{var h,w;return((w=(h=l.current).refused)==null?void 0:w.call(h))===!0}}:{}):p),S=!1,L=()=>{let h=E.refused()&&E.read()!==!0;h&&!S&&(I(t),i.current()),S=h,O(h);let w=E.read();w!==null&&Q.add(t),d(w!=null?w:Q.has(t)?!1:null)};L(),y=E.subscribe(L)}),()=>{k=!0,y==null||y()}},[c,t]),{granted:a,refused:g}}function xe(e){var Z,ee,te;let[t,n]=(0,o.useState)(null),[i]=(0,o.useState)(()=>{var r;return(r=e.sessionSegment)!=null?r:qe()}),[a,d]=(0,o.useState)(j());(0,o.useEffect)(()=>ce(()=>d(j())),[]),(0,o.useEffect)(()=>{Se(e.apiBaseUrl),we(e.apiBaseUrl)},[]);let g=(0,o.useRef)(()=>{}),O=Ye(e.consentFrom,e.apiKey,()=>g.current()),l=e.consentFrom?(Z=O.granted)!=null?Z:Q.has(e.apiKey)?!1:e.consent===!0:e.consent,c=e.consentFrom?O.refused:!0,p=(0,o.useRef)(c);p.current=c;let y=(0,o.useRef)(null),k=(0,o.useRef)(!1),x=(0,o.useRef)([]),I=(0,o.useRef)(!1);g.current=()=>{var f;x.current=[],I.current=!0;let r=y.current;r!=null&&r.gated?r.dispose():(f=r==null?void 0:r.takeHeld)==null||f.call(r)},(0,o.useEffect)(()=>{var N,ne;if(p.current&&l===!1&&(x.current=[]),l===!1&&k.current&&(p.current&&((N=y.current)==null||N.destroy()),y.current=null,k.current=!1),l===!1&&!e.preConsentBehavior){p.current&&((ne=y.current)==null||ne.destroy()),y.current=null,n(null);return}let r=l!==!1;r&&(I.current=!1);let f=_=>{!r&&I.current&&_.gated&&_.dispose()},m=v({apiKey:e.apiKey,context:e.context,debug:e.debug,initialAssignments:e.initialAssignments,initialUnified:e.initialUnified,sessionSegment:i,consent:l,preConsentBehavior:e.preConsentBehavior,respectDoNotTrack:e.respectDoNotTrack,ssrSessionId:e.ssrSessionId,country:e.country,persona:e.persona,stageAttributes:e.stageAttributes,localMode:e.localMode,initialSlots:e.initialSlots,initialSlotConfig:e.initialSlotConfig,initialPalette:e.initialPalette,initialVocabulary:e.initialVocabulary,initialPersona:e.initialPersona,ingestUrl:e.apiBaseUrl?`${e.apiBaseUrl.replace(/\/$/,"")}/events`:void 0,nonce:e.nonce},J?{sdk:J}:{}),u=!1,s=null,b=null,C=_=>{for(let P of x.current.splice(0))setTimeout(()=>{if(y.current!==_){I.current||x.current.push(P);return}try{P(_)}catch(nt){}},0)},R=_=>{e.engagement===!1||!r||import("@sentientui/core/engagement").then(({startEngagementCapture:P})=>{u||(b=P(_,{apiKey:e.apiKey,sectionTypes:e.sectionTypes,apiBase:e.apiBaseUrl?e.apiBaseUrl.replace(/\/$/,""):void 0}))})};return e.enableGraph!==!1?import("@sentientui/core/graph").then(({init:_})=>{u||(s=_(M(v({},m),{graph:!0,captureDomText:e.captureDomText===!0,sectionTypes:e.sectionTypes})),f(s),y.current=s,k.current=r,C(s),n(s),R(s))}):(s=(0,B.init)(m),f(s),y.current=s,k.current=r,C(s),n(s),R(s)),()=>{var _,P;u=!0,b==null||b(),x.current=x.current.concat((P=(_=s==null?void 0:s.takeHeld)==null?void 0:_.call(s))!=null?P:[]),s==null||s.dispose()}},[l]),(0,o.useEffect)(()=>{if(!t)return;let r=!1,f=async()=>{if(r)return;let u;try{u=await t.fetchWeights()}catch(s){return}if(!r)for(let s of u){let b={componentId:s.componentId,updatedAt:s.updatedAt,variants:s.variants.map(C=>{var R;return{variantId:C.variantId,pulls:C.pulls,avgReward:(R=C.avgReward)!=null?R:0}})};ae(s.componentId,b)}};f();let m=setInterval(()=>{f()},6e4);return()=>{r=!0,clearInterval(m)}},[t]);let E=(ee=e.ssrFallback)!=null?ee:"first",S=((te=e.apiBaseUrl)!=null?te:Ce).replace(/\/$/,""),L=(0,o.useRef)(null);(0,o.useEffect)(()=>{var m;if(typeof process!="undefined"&&((m=process.env)==null?void 0:m.NODE_ENV)==="production")return;let r={apiKey:e.apiKey,context:e.context,country:e.country,persona:e.persona,apiBaseUrl:S},f=L.current;if(L.current=r,f!==null)for(let u of["apiKey","context","country","persona","apiBaseUrl"])Object.is(f[u],r[u])||console.warn(`[sentient] AdaptiveProvider: \`${u}\` changed after initialisation, but the SDK client is stable for the session and only re-inits on \`consent\` \u2014 the new value is ignored. Remount the provider (e.g. via a changing \`key\` prop) to apply it.`)},[e.apiKey,e.context,e.country,e.persona,S]),(0,o.useEffect)(()=>{var r;typeof process!="undefined"&&((r=process.env)==null?void 0:r.NODE_ENV)==="production"||ue({apiKey:e.apiKey,apiBaseUrl:S,isLocal:(t==null?void 0:t.isLocal)===!0})},[t,e.apiKey,S]),(0,o.useEffect)(()=>{let r=e.initialLayoutOrder;if(r&&r.length>0){z(r);return}e.declaredSections&&e.declaredSections.length>0&&z(e.declaredSections)},[e.initialLayoutOrder,e.declaredSections]),(0,o.useEffect)(()=>{!W()||e.consent!==void 0||e.consentFrom!==void 0||be||(be=!0,console.warn('[SentientUI] No consent gate: every visitor is tracked from first paint. Pass consentFrom="<your CMP>" (or consent={true} to silence). https://sentient-ui.com/docs#consent'))},[]),(0,o.useEffect)(()=>{if(!W())return;let r=e.declaredSections;if(!r||r.length===0||typeof document=="undefined")return;let f=new Set(Array.from(document.querySelectorAll("[data-sentient-id]"),u=>u.getAttribute("data-sentient-id"))),m=r.filter(u=>!f.has(u));m.length>0&&console.warn(`[SentientUI] Declared section${m.length>1?"s":""} ${m.map(u=>`"${u}"`).join(", ")} ${m.length>1?"have":"has"} no matching data-sentient-id element, so the layout engine cannot learn what they are and will serve the same order to every persona. Add data-sentient-id="<sectionId>" to each section's element.`)},[e.declaredSections]);let h=(0,o.useMemo)(()=>t&&a?de(t):t,[t,a]),w=(0,o.useMemo)(()=>{var r,f,m,u,s,b,C,R,N;return{client:h,apiKey:e.apiKey,initialAssignments:(r=e.initialAssignments)!=null?r:{},initialUnified:(f=e.initialUnified)!=null?f:Qe,sessionSegment:i,ssrFallback:E,onAssignment:e.onAssignment,initialLayoutOrder:(m=e.initialLayoutOrder)!=null?m:null,initialSlots:(u=e.initialSlots)!=null?u:{},initialSlotConfig:(s=e.initialSlotConfig)!=null?s:{},initialPalette:(b=e.initialPalette)!=null?b:null,initialVocabulary:(C=e.initialVocabulary)!=null?C:null,initialPersona:(R=e.initialPersona)!=null?R:null,apiBaseUrl:S,debug:(N=e.debug)!=null?N:!1}},[h,e.apiKey,e.initialAssignments,e.initialUnified,i,E,e.onAssignment,e.initialLayoutOrder,e.initialSlots,e.initialSlotConfig,e.initialPalette,e.initialVocabulary,e.initialPersona,S,e.debug]);return(0,Re.jsx)(Xe.Provider,{value:w,children:e.children})}var Qe=[];function Ze(e){return e<.3?"low":e<.7?"medium":"high"}function ke(e={}){var n,i,a;let t=window;if(t.__sentient_overrides=v({},(n=e.variants)!=null?n:{}),e.layout?t.__sentient_layout_override=e.layout:delete t.__sentient_layout_override,e.slots?t.__sentient_slot_overrides=v({},e.slots):delete t.__sentient_slot_overrides,e.slotConfig?t.__sentient_slot_config_overrides=v({},e.slotConfig):delete t.__sentient_slot_config_overrides,e.persona){t.__sentient_persona_override={persona:e.persona,confidence:(i=e.confidence)!=null?i:1};try{let d=document.documentElement;d.setAttribute("data-sentient-persona",e.persona),d.setAttribute("data-sentient-confidence",Ze((a=e.confidence)!=null?a:1))}catch(d){}}else delete t.__sentient_persona_override;G()}var Pe=require("react/jsx-runtime");function et(e,t={},n){return ke(t),(0,Ee.render)((0,Pe.jsx)(xe,{apiKey:"pk_test",consent:!1,children:e}),n)}0&&(module.exports={renderWithSentient});
2
+ "use strict";var Ve=Object.create;var G=Object.defineProperty,De=Object.defineProperties,Le=Object.getOwnPropertyDescriptor,Ne=Object.getOwnPropertyDescriptors,Ge=Object.getOwnPropertyNames,se=Object.getOwnPropertySymbols,Fe=Object.getPrototypeOf,le=Object.prototype.hasOwnProperty,We=Object.prototype.propertyIsEnumerable;var ae=(e,t,n)=>t in e?G(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,v=(e,t)=>{for(var n in t||(t={}))le.call(t,n)&&ae(e,n,t[n]);if(se)for(var n of se(t))We.call(t,n)&&ae(e,n,t[n]);return e},$=(e,t)=>De(e,Ne(t));var Ue=(e,t)=>{for(var n in t)G(e,n,{get:t[n],enumerable:!0})},ce=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Ge(t))!le.call(e,a)&&a!==n&&G(e,a,{get:()=>t[a],enumerable:!(i=Le(t,a))||i.enumerable});return e};var M=(e,t,n)=>(n=e!=null?Ve(Fe(e)):{},ce(t||!e||!e.__esModule?G(n,"default",{value:e,enumerable:!0}):n,e)),$e=e=>ce(G({},"__esModule",{value:!0}),e);var ot={};Ue(ot,{renderWithSentient:()=>rt});module.exports=$e(ot);var Oe=require("@testing-library/react");var o=require("react"),B=require("@sentientui/core");var Me=new Map,Ke=new Map;function de(e,t){Me.set(e,t);let n=Ke.get(e);if(n)for(let i of n)try{i(t)}catch(a){}}var Be={on:!1,listeners:new Set};function ue(){if(typeof window=="undefined")return Be;let e=window;return e.__sentient_preview||(e.__sentient_preview={on:!1,listeners:new Set}),e.__sentient_preview}function H(){return ue().on}function fe(e){let t=ue().listeners;return t.add(e),()=>{t.delete(e)}}function ge(e){return{isLocal:e.isLocal,track:()=>{},goal:()=>{},componentGoal:()=>{},identify:()=>{},fetchWeights:()=>Promise.resolve([]),getAssignment:(t,n)=>e.getAssignment(t,n),isUnified:t=>{var n,i;return(i=(n=e.isUnified)==null?void 0:n.call(e,t))!=null?i:!1},assign:(t,n,i,a,d)=>e.assign(t,n,i,a,d),decide:()=>Promise.resolve(null),getSlotResult:t=>e.getSlotResult(t),getSlotConfig:t=>e.getSlotConfig(t),getSitePalette:()=>e.getSitePalette(),reportSlots:t=>e.reportSlots(t),getPersona:()=>e.getPersona(),getGraph:()=>e.getGraph(),flush:()=>e.flush(),dispose:()=>e.dispose(),destroy:()=>e.destroy()}}var He="sentient:overrides-changed";function F(){var t;if(typeof window=="undefined")return;let e=window;e.__sentient_overrides_version=((t=e.__sentient_overrides_version)!=null?t:0)+1,window.dispatchEvent(new Event(He))}function pe(e){typeof window!="undefined"&&(window.__sentient_devtools_config=e)}function W(){var e;return typeof process=="undefined"||((e=process.env)==null?void 0:e.NODE_ENV)!=="production"}var je={components:new Map,slots:new Map,sections:[],listeners:new Set,version:0};function j(){if(typeof window=="undefined")return je;let e=window;return e.__sentient_registry||(e.__sentient_registry={components:new Map,slots:new Map,sections:[],listeners:new Set,version:0}),e.__sentient_registry}function ze(){j().version+=1;for(let e of j().listeners)e()}function z(e){W()&&(j().sections=[...e],ze())}var me="0.41.1",J=me!=="0.0.0-dev"?{name:"react",version:me}:void 0;function Je(){let e=window;return e.__sentient_slot_config_overrides||(e.__sentient_slot_config_overrides={}),e.__sentient_slot_config_overrides}function T(e,t){Je()[e]=t}function ye(e){window.__sentient_vocabulary_override=e}function Xe(){let e=window;return e.__sentient_slot_overrides||(e.__sentient_slot_overrides={}),e.__sentient_slot_overrides}function V(e,t){Xe()[e]=t}function ve(e){let t=null;try{let n=location.hash.slice(1),i=RegExp("(^|[?&])"+e+"=([^&]*)").exec(n);if(i){t=i[2];let a=n.slice(i.index+i[0].length);i[1]!="&"&&a[0]=="&"&&(a=i[1]+a.slice(1));let d=n.slice(0,i.index)+a;history.replaceState(history.state,"",d?"#"+d:location.pathname+location.search)}}catch(n){}return t}var q="__snt_editor_token",D=null,X=!1;function he(){return X}function qe(){try{return sessionStorage.getItem(q)}catch(e){return null}}function K(e){if(D)return D;let t=typeof window=="undefined"?null:ve("sentient_editor_code");if(!t){let n=typeof window=="undefined"?null:qe();return X=!!n,D=Promise.resolve(n?{token:n,fresh:!1}:null),D}return X=!0,D=fetch(`${e}/editor/exchange`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({code:t})}).then(async n=>{let i=n.ok?(await n.json()).token:void 0;if(!i)return{error:n.ok?500:n.status};try{sessionStorage.setItem(q,i)}catch(a){}return{token:i,fresh:!0}}).catch(()=>({error:0})),D}function _e(){try{sessionStorage.removeItem(q)}catch(e){}}var Se="sentient_preview_cell",we="sentient_refresh_region",Y="sentient-cell-preview-bar",P="__preview__",Ye=null;function be(e){if(typeof window=="undefined"||typeof document=="undefined"||document.getElementById(Y))return;let t,n;try{let l=new URLSearchParams(window.location.search);t=l.get(Se),n=l.get(we)}catch(l){return}if(!t&&!n)return;let i=(e!=null?e:"https://api.sentient-ui.com/v1").replace(/\/$/,""),a=K(i);if(!he())return;if(n){Ye={slotId:n,session:a,base:i},T(n,{kind:"arms"}),V(n,P),F();return}if(!t)return;let d=t.lastIndexOf("~");if(d<=0)return;let g=t.slice(0,d),O=t.slice(d+1);a.then(l=>l?"token"in l?fetch(`${i}/editor/cell-preview?slotId=${encodeURIComponent(g)}&persona=${encodeURIComponent(O)}`,{headers:{authorization:`Bearer ${l.token}`}}):(U(l.error===401?"This preview link has expired \u2014 reopen it from your dashboard.":"Couldn\u2019t load this preview \u2014 reopen it from your dashboard."),null):null).then(async l=>{if(!l)return;if(!l.ok){U(l.status===401?"This preview link has expired \u2014 reopen it from your dashboard.":"Couldn\u2019t load this preview \u2014 reopen it from your dashboard.");return}let c=await l.json();if(c.vocabulary&&Array.isArray(c.vocabulary.entries)&&ye(c.vocabulary),c.compose!=null)T(g,{kind:"arms",compose:{[P]:c.compose}}),V(g,P);else if(c.edits!=null&&typeof c.skeletonFp=="string"&&Array.isArray(c.leafToNode))T(g,{kind:"arms",edits:{edits:c.edits,fp:c.skeletonFp,leafToNode:c.leafToNode}}),V(g,P);else if(c.blocks!=null)T(g,{kind:"arms",blocks:{[P]:c.blocks}}),V(g,P);else if(c.content!=null)T(g,{kind:"arms",content:c.content}),V(g,P);else{U("Nothing to preview in that square yet.");return}F(),U(`Previewing \u201C${c.slotName}\u201D for ${c.personaDisplay}${c.status==="review"?" \u2014 waiting for your approval":""}. Nothing is being tracked.`),setTimeout(()=>{var p;try{(p=document.querySelector(`[data-sentient-slot="${g}"]`))==null||p.scrollIntoView({block:"center"})}catch(y){}},300)}).catch(()=>U("Couldn\u2019t load this preview \u2014 check your connection and reopen it from your dashboard."))}function U(e){var a;if(document.getElementById(Y))return;let t=document.createElement("div");t.id=Y,Object.assign(t.style,{position:"fixed",bottom:"16px",left:"50%",transform:"translateX(-50%)",zIndex:"2147483647",display:"flex",alignItems:"center",gap:"10px",padding:"10px 14px",borderRadius:"12px",maxWidth:"90vw",background:"#111827",color:"#fff",font:"13px system-ui, sans-serif",border:"1px solid rgba(139,92,246,0.6)",boxShadow:"0 10px 34px rgba(0,0,0,0.45)"});let n=document.createElement("span");n.textContent=e;let i=document.createElement("button");i.textContent="Exit preview",Object.assign(i.style,{padding:"4px 10px",borderRadius:"999px",border:"1px solid rgba(255,255,255,0.35)",background:"transparent",color:"#fff",font:"12px system-ui, sans-serif",cursor:"pointer"}),i.onclick=()=>{_e();let d=new URL(window.location.href);d.searchParams.delete(Se),d.searchParams.delete(we),window.location.assign(d.toString())},t.append(n,i),((a=document.body)!=null?a:document.documentElement).append(t)}var Ce=!1;function xe(e){if(Ce||typeof window=="undefined")return;Ce=!0;let t=(e!=null?e:"https://api.sentient-ui.com/v1").replace(/\/$/,"");K(t).then(n=>{!n||!("token"in n)||!n.fresh||Qe(t,n.token)})}function Qe(e,t){let n=()=>{window.setTimeout(()=>{import("@sentientui/core/style-sample").then(({sampleStyleVocabulary:i})=>fetch(`${e}/editor/style-vocabulary`,{method:"POST",headers:{authorization:`Bearer ${t}`,"content-type":"application/json"},body:JSON.stringify(i(document))})).catch(()=>{})},1e3)};document.readyState==="complete"?n():window.addEventListener("load",n,{once:!0})}var Ae=require("react/jsx-runtime");function Ze(){var e,t;if(typeof window=="undefined")return"desktop:direct";try{return(0,B.deriveSessionSegment)({userAgent:(e=navigator.userAgent)!=null?e:"",referer:(t=document.referrer)!=null?t:"",appOrigin:window.location.origin})}catch(n){return"desktop:direct"}}var Re="https://api.sentient-ui.com/v1",et=(0,o.createContext)({client:null,apiKey:"",initialAssignments:{},initialUnified:[],sessionSegment:"desktop:direct",ssrFallback:"first",onAssignment:void 0,initialLayoutOrder:null,initialSlots:{},initialSlotConfig:{},initialPalette:null,initialVocabulary:null,initialPersona:null,apiBaseUrl:Re,debug:!1}),ke=!1,Q=new Set;function tt(e,t,n){let i=(0,o.useRef)(n);i.current=n;let[a,d]=(0,o.useState)(null),[g,O]=(0,o.useState)(!1),l=(0,o.useRef)(e);l.current=e;let c=e===void 0?"":typeof e=="string"?e:JSON.stringify($(v({},e),{check:typeof e.check,refused:typeof e.refused}));return(0,o.useEffect)(()=>{let p=l.current;if(p===void 0||typeof window=="undefined")return;let y,R=!1;return import("@sentientui/core/consent").then(({consentWatcher:x,forgetVisitor:I})=>{if(R)return;let E=x(typeof p=="object"&&p.cmp===void 0&&p.check?v($(v({},p),{check:()=>l.current.check()}),p.refused?{refused:()=>{var _,S;return((S=(_=l.current).refused)==null?void 0:S.call(_))===!0}}:{}):p),w=!1,L=()=>{let _=E.refused()&&E.read()!==!0;_&&!w&&(I(t),i.current()),w=_,O(_);let S=E.read();S!==null&&Q.add(t),d(S!=null?S:Q.has(t)?!1:null)};L(),y=E.subscribe(L)}),()=>{R=!0,y==null||y()}},[c,t]),{granted:a,refused:g}}function Ee(e){var ee,te,ne,ie,re;let[t,n]=(0,o.useState)(null),[i]=(0,o.useState)(()=>{var r;return(r=e.sessionSegment)!=null?r:Ze()}),[a,d]=(0,o.useState)(H());(0,o.useEffect)(()=>fe(()=>d(H())),[]),(0,o.useEffect)(()=>{be(e.apiBaseUrl),xe(e.apiBaseUrl)},[]);let g=(0,o.useRef)(()=>{}),O=tt(e.consentFrom,e.apiKey,()=>g.current()),l=e.consentFrom?(ee=O.granted)!=null?ee:Q.has(e.apiKey)?!1:e.consent===!0:e.consent,c=e.consentFrom?O.refused:!0,p=(0,o.useRef)(c);p.current=c;let y=(0,o.useRef)(null),R=(0,o.useRef)(!1),x=(0,o.useRef)([]),I=(0,o.useRef)(!1);g.current=()=>{var f;x.current=[],I.current=!0;let r=y.current;r!=null&&r.gated?r.dispose():(f=r==null?void 0:r.takeHeld)==null||f.call(r)},(0,o.useEffect)(()=>{var N,oe;if(p.current&&l===!1&&(x.current=[]),l===!1&&R.current&&(p.current&&((N=y.current)==null||N.destroy()),y.current=null,R.current=!1),l===!1&&!e.preConsentBehavior){p.current&&((oe=y.current)==null||oe.destroy()),y.current=null,n(null);return}let r=l!==!1;r&&(I.current=!1);let f=h=>{!r&&I.current&&h.gated&&h.dispose()},m=v({apiKey:e.apiKey,context:e.context,debug:e.debug,initialAssignments:e.initialAssignments,initialUnified:e.initialUnified,sessionSegment:i,consent:l,preConsentBehavior:e.preConsentBehavior,respectDoNotTrack:e.respectDoNotTrack,ssrSessionId:e.ssrSessionId,cookieDomain:e.cookieDomain,country:e.country,persona:e.persona,stageAttributes:e.stageAttributes,localMode:e.localMode,initialSlots:e.initialSlots,initialSlotConfig:e.initialSlotConfig,initialPalette:e.initialPalette,initialVocabulary:e.initialVocabulary,initialPersona:e.initialPersona,ingestUrl:e.apiBaseUrl?`${e.apiBaseUrl.replace(/\/$/,"")}/events`:void 0,nonce:e.nonce},J?{sdk:J}:{}),u=!1,s=null,b=null,C=h=>{for(let A of x.current.splice(0))setTimeout(()=>{if(y.current!==h){I.current||x.current.push(A);return}try{A(h)}catch(st){}},0)},k=h=>{e.engagement===!1||!r||import("@sentientui/core/engagement").then(({startEngagementCapture:A})=>{u||(b=A(h,{apiKey:e.apiKey,sectionTypes:e.sectionTypes,apiBase:e.apiBaseUrl?e.apiBaseUrl.replace(/\/$/,""):void 0}))})};return e.enableGraph!==!1?import("@sentientui/core/graph").then(({init:h})=>{u||(s=h($(v({},m),{graph:!0,captureDomText:e.captureDomText===!0,sectionTypes:e.sectionTypes})),f(s),y.current=s,R.current=r,C(s),n(s),k(s))}):(s=(0,B.init)(m),f(s),y.current=s,R.current=r,C(s),n(s),k(s)),()=>{var h,A;u=!0,b==null||b(),x.current=x.current.concat((A=(h=s==null?void 0:s.takeHeld)==null?void 0:h.call(s))!=null?A:[]),s==null||s.dispose()}},[l]),(0,o.useEffect)(()=>{if(!t)return;let r=!1,f=async()=>{if(r)return;let u;try{u=await t.fetchWeights()}catch(s){return}if(!r)for(let s of u){let b={componentId:s.componentId,updatedAt:s.updatedAt,variants:s.variants.map(C=>{var k;return{variantId:C.variantId,pulls:C.pulls,avgReward:(k=C.avgReward)!=null?k:0}})};de(s.componentId,b)}};f();let m=setInterval(()=>{f()},6e4);return()=>{r=!0,clearInterval(m)}},[t]);let E=(te=e.ssrFallback)!=null?te:"first",w=((ne=e.apiBaseUrl)!=null?ne:Re).replace(/\/$/,""),L=(0,o.useRef)(null);(0,o.useEffect)(()=>{var m;if(typeof process!="undefined"&&((m=process.env)==null?void 0:m.NODE_ENV)==="production")return;let r={apiKey:e.apiKey,context:e.context,country:e.country,persona:e.persona,apiBaseUrl:w},f=L.current;if(L.current=r,f!==null)for(let u of["apiKey","context","country","persona","apiBaseUrl"])Object.is(f[u],r[u])||console.warn(`[sentient] AdaptiveProvider: \`${u}\` changed after initialisation, but the SDK client is stable for the session and only re-inits on \`consent\` \u2014 the new value is ignored. Remount the provider (e.g. via a changing \`key\` prop) to apply it.`)},[e.apiKey,e.context,e.country,e.persona,w]),(0,o.useEffect)(()=>{var r;typeof process!="undefined"&&((r=process.env)==null?void 0:r.NODE_ENV)==="production"||pe({apiKey:e.apiKey,apiBaseUrl:w,isLocal:(t==null?void 0:t.isLocal)===!0})},[t,e.apiKey,w]);let _=(ie=e.identity)==null?void 0:ie.userId,S=(re=e.identity)==null?void 0:re.userHash;(0,o.useEffect)(()=>{t&&_&&t.identify(_,{userHash:S})},[t,_,S]),(0,o.useEffect)(()=>{let r=e.initialLayoutOrder;if(r&&r.length>0){z(r);return}e.declaredSections&&e.declaredSections.length>0&&z(e.declaredSections)},[e.initialLayoutOrder,e.declaredSections]),(0,o.useEffect)(()=>{!W()||e.consent!==void 0||e.consentFrom!==void 0||ke||(ke=!0,console.warn('[SentientUI] No consent gate: every visitor is tracked from first paint. Pass consentFrom="<your CMP>" (or consent={true} to silence). https://sentient-ui.com/docs#consent'))},[]),(0,o.useEffect)(()=>{if(!W())return;let r=e.declaredSections;if(!r||r.length===0||typeof document=="undefined")return;let f=new Set(Array.from(document.querySelectorAll("[data-sentient-id]"),u=>u.getAttribute("data-sentient-id"))),m=r.filter(u=>!f.has(u));m.length>0&&console.warn(`[SentientUI] Declared section${m.length>1?"s":""} ${m.map(u=>`"${u}"`).join(", ")} ${m.length>1?"have":"has"} no matching data-sentient-id element, so the layout engine cannot learn what they are and will serve the same order to every persona. Add data-sentient-id="<sectionId>" to each section's element.`)},[e.declaredSections]);let Z=(0,o.useMemo)(()=>t&&a?ge(t):t,[t,a]),Te=(0,o.useMemo)(()=>{var r,f,m,u,s,b,C,k,N;return{client:Z,apiKey:e.apiKey,initialAssignments:(r=e.initialAssignments)!=null?r:{},initialUnified:(f=e.initialUnified)!=null?f:nt,sessionSegment:i,ssrFallback:E,onAssignment:e.onAssignment,initialLayoutOrder:(m=e.initialLayoutOrder)!=null?m:null,initialSlots:(u=e.initialSlots)!=null?u:{},initialSlotConfig:(s=e.initialSlotConfig)!=null?s:{},initialPalette:(b=e.initialPalette)!=null?b:null,initialVocabulary:(C=e.initialVocabulary)!=null?C:null,initialPersona:(k=e.initialPersona)!=null?k:null,apiBaseUrl:w,debug:(N=e.debug)!=null?N:!1}},[Z,e.apiKey,e.initialAssignments,e.initialUnified,i,E,e.onAssignment,e.initialLayoutOrder,e.initialSlots,e.initialSlotConfig,e.initialPalette,e.initialVocabulary,e.initialPersona,w,e.debug]);return(0,Ae.jsx)(et.Provider,{value:Te,children:e.children})}var nt=[];function it(e){return e<.3?"low":e<.7?"medium":"high"}function Pe(e={}){var n,i,a;let t=window;if(t.__sentient_overrides=v({},(n=e.variants)!=null?n:{}),e.layout?t.__sentient_layout_override=e.layout:delete t.__sentient_layout_override,e.slots?t.__sentient_slot_overrides=v({},e.slots):delete t.__sentient_slot_overrides,e.slotConfig?t.__sentient_slot_config_overrides=v({},e.slotConfig):delete t.__sentient_slot_config_overrides,e.persona){t.__sentient_persona_override={persona:e.persona,confidence:(i=e.confidence)!=null?i:1};try{let d=document.documentElement;d.setAttribute("data-sentient-persona",e.persona),d.setAttribute("data-sentient-confidence",it((a=e.confidence)!=null?a:1))}catch(d){}}else delete t.__sentient_persona_override;F()}var Ie=require("react/jsx-runtime");function rt(e,t={},n){return Pe(t),(0,Oe.render)((0,Ie.jsx)(Ee,{apiKey:"pk_test",consent:!1,children:e}),n)}0&&(module.exports={renderWithSentient});
3
3
  //# sourceMappingURL=react.js.map