@smooai/chat-widget 0.6.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { Citation } from "@smooai/smooth-operator";
2
+ import { StoreApi } from "zustand/vanilla";
2
3
 
3
4
  //#region src/config.d.ts
4
5
  /**
@@ -68,6 +69,17 @@ interface ChatWidgetConfig {
68
69
  userEmail?: string;
69
70
  /** Optional phone number for the user participant (passed via session metadata). */
70
71
  userPhone?: string;
72
+ /**
73
+ * Optional pre-auth HMAC context. When the host page has a shared secret with
74
+ * the agent, it can sign `{ userId, signature, timestamp }` so the chat-ws
75
+ * wrapper's `/internal/*` identity routes (and the WS create path) verify the
76
+ * caller without an OTP round-trip (ADR-046/ADR-048). Passed through verbatim.
77
+ */
78
+ authContext?: {
79
+ userId: string;
80
+ signature: string;
81
+ timestamp: number;
82
+ };
71
83
  /** Placeholder text for the message input. */
72
84
  placeholder?: string;
73
85
  /** Greeting rendered when the conversation opens (before any messages). */
@@ -87,6 +99,24 @@ interface ChatWidgetConfig {
87
99
  requireEmail?: boolean;
88
100
  /** Require the visitor's phone before chatting. */
89
101
  requirePhone?: boolean;
102
+ /**
103
+ * Show the phone field on the pre-chat form (optional unless {@link requirePhone}).
104
+ * Defaults to `true` for this widget — phone rides the session metadata as
105
+ * `userPhone` so the agent can follow up by SMS. Set `false` to hide it.
106
+ */
107
+ collectPhone?: boolean;
108
+ /**
109
+ * Show the email + SMS marketing-consent checkboxes on the pre-chat form.
110
+ * Explicit opt-in, default UNCHECKED; a `consentAt` timestamp is stamped when
111
+ * a box is ticked. Defaults to `true`. The consent record is threaded into the
112
+ * session metadata (ADR-048).
113
+ */
114
+ collectConsent?: boolean;
115
+ /**
116
+ * Offer the cross-device "Restore my chats" affordance — an explicit link that
117
+ * runs the identity-OTP → resolve → replay flow. Defaults to `true`.
118
+ */
119
+ allowChatRestore?: boolean;
90
120
  /**
91
121
  * Let visitors chat without providing any identity. When `true`, the
92
122
  * `require*` flags are ignored and the pre-chat form is skipped.
@@ -118,6 +148,12 @@ declare class SmoothAgentChatElement extends HTMLElement {
118
148
  /** Current mid-turn interrupt (OTP / tool-confirmation), or null. */
119
149
  private interrupt;
120
150
  private interruptEl;
151
+ /** Cross-device "restore my chats" flow state (ADR-048 §c). */
152
+ private identityRestore;
153
+ /** Whether the cross-device restore affordance is offered (config). */
154
+ private allowChatRestore;
155
+ /** True while the pre-chat identity gate is showing (blocks premature connect). */
156
+ private gating;
121
157
  private panelEl;
122
158
  private launcherEl;
123
159
  private messagesEl;
@@ -155,7 +191,31 @@ declare class SmoothAgentChatElement extends HTMLElement {
155
191
  * set via `textContent` (never innerHTML); only static icons use innerHTML.
156
192
  */
157
193
  private renderInterrupt;
158
- /** Collect identity from the pre-chat form, then drop into the chat view. */
194
+ /**
195
+ * Build the cross-device "Restore my chats" card (ADR-048 §c). Reuses the
196
+ * same overlay slot + visual language as the OTP interrupt. All server-supplied
197
+ * strings (masked destination, conversation previews) are set via `textContent`
198
+ * — never innerHTML — so they can't inject markup; only the static lock icon
199
+ * uses innerHTML.
200
+ */
201
+ private buildRestoreCard;
202
+ /** Format an ISO timestamp as a short, locale-aware label (best-effort). */
203
+ private formatWhen;
204
+ /**
205
+ * Wire as-you-type formatting + an inline validity hint onto the pre-chat
206
+ * phone input (libphonenumber-js, US default region). Autofill is preserved:
207
+ * the input keeps its `type="tel"` + `autocomplete="tel"` + implicit <label>,
208
+ * and we also reformat on `change` so a browser-autofilled value gets
209
+ * formatted/validated too.
210
+ *
211
+ * As-you-type caret note: `AsYouType` reformats the entire string, which
212
+ * moves the caret to the end on a mid-string edit. To avoid fighting the
213
+ * user, we only rewrite the value when the caret is at the end (the typical
214
+ * append-a-digit case) and never on a deletion — so backspacing the
215
+ * formatting characters works naturally.
216
+ */
217
+ private wirePhoneField;
218
+ /** Collect identity + consent from the pre-chat form, then drop into the chat view. */
159
219
  private handlePrechatSubmit;
160
220
  /** Send a starter prompt (from a chip click). */
161
221
  private submitPrompt;
@@ -279,7 +339,86 @@ declare function mountFullPageChat(config: Omit<ChatWidgetConfig, 'mode'>, targe
279
339
  */
280
340
  declare function initChatWidgetLoader(): void;
281
341
  //#endregion
342
+ //#region src/persistence.d.ts
343
+ /** Current persisted-shape version. Bump when the shape below changes incompatibly. */
344
+ declare const PERSIST_VERSION: 1;
345
+ /** Marketing-consent record captured at the pre-chat form. */
346
+ interface ConsentState {
347
+ emailOptIn: boolean;
348
+ smsOptIn: boolean;
349
+ /** Where the consent was captured. The widget always stamps `chat-widget-prechat`. */
350
+ consentSource?: string;
351
+ /** ISO 8601 timestamp stamped when the visitor ticked a consent box. */
352
+ consentAt?: string;
353
+ }
354
+ /** Visitor identity collected from config or the pre-chat form. */
355
+ interface IdentityState {
356
+ name?: string;
357
+ email?: string;
358
+ phone?: string;
359
+ }
360
+ /**
361
+ * The exact persisted shape (ADR-048 §d). Only the pointer + identity + consent
362
+ * persist — never the transcript.
363
+ */
364
+ interface PersistedWidgetState {
365
+ version: typeof PERSIST_VERSION;
366
+ /** Pointer to the active conversation session; cleared on ended/404. */
367
+ sessionId: string | null;
368
+ identity: IdentityState;
369
+ consent: ConsentState;
370
+ /**
371
+ * Email proven via OTP for the CURRENT session. Session-scoped: cleared on
372
+ * `clearSession()` so it can't leak across visitors on a shared browser, and
373
+ * only threaded into session metadata when {@link verifiedEmailSessionId}
374
+ * matches the live session (i.e. on resume of the verified session) — never
375
+ * auto-stamped onto a brand-new session.
376
+ */
377
+ verifiedEmail: string | null;
378
+ /** The sessionId the {@link verifiedEmail} was proven against (binds the proof to one session). */
379
+ verifiedEmailSessionId: string | null;
380
+ /** Stable per-browser correlation token (see fingerprint.ts). */
381
+ browserFingerprint: string | null;
382
+ }
383
+ /** Store actions layered on top of the persisted state. */
384
+ interface WidgetStoreActions {
385
+ setSessionId: (sessionId: string | null) => void;
386
+ /** Merge identity fields (undefined values don't clobber existing ones). */
387
+ mergeIdentity: (identity: IdentityState) => void;
388
+ /** Replace consent wholesale (the pre-chat form computes the full record). */
389
+ setConsent: (consent: ConsentState) => void;
390
+ /** Record an OTP-proven email bound to a specific session. */
391
+ setVerifiedEmail: (email: string | null, sessionId?: string | null) => void;
392
+ setBrowserFingerprint: (fp: string) => void;
393
+ /**
394
+ * Clear the session pointer (and the session-scoped `verifiedEmail` proof) but
395
+ * KEEP identity / consent / fingerprint — used when a persisted session has
396
+ * ended or 404s so the next turn starts a fresh session for a known visitor.
397
+ * `verifiedEmail` is deliberately cleared here: it is a per-session OTP proof,
398
+ * not a durable identity, so it must NOT survive onto a new session (which on a
399
+ * shared browser could be a different visitor).
400
+ */
401
+ clearSession: () => void;
402
+ }
403
+ type WidgetStore = PersistedWidgetState & WidgetStoreActions;
404
+ /** localStorage key for an agent's persisted widget state. */
405
+ declare function storageKey(agentId: string): string;
406
+ /**
407
+ * Create the per-agent persisted Zustand store. The `partialize` step ensures
408
+ * only the persisted shape (never any future transient action/UI state) is
409
+ * written to localStorage.
410
+ */
411
+ declare function createWidgetStore(agentId: string): StoreApi<WidgetStore>;
412
+ //#endregion
282
413
  //#region src/conversation.d.ts
414
+ /**
415
+ * Derive the HTTP base for the chat-ws wrapper's `/internal/*` REST routes from
416
+ * the WS endpoint: `wss://ai.smoo.ai/ws` → `https://ai.smoo.ai`. The engine
417
+ * (smooth-operator 1.8.0) owns the `/ws` dispatch and REJECTS unknown verbs, so
418
+ * the cross-device identity flow + fingerprint resume are HTTP POST routes on the
419
+ * wrapper (origin-allowlisted + authContext, per ADR-046/ADR-048) — NOT WS frames.
420
+ */
421
+ declare function httpBaseFromWsEndpoint(endpoint: string): string | null;
283
422
  type Role = 'user' | 'assistant';
284
423
  interface ChatMessage {
285
424
  id: string;
@@ -325,7 +464,56 @@ interface UserInfo {
325
464
  name?: string;
326
465
  email?: string;
327
466
  phone?: string;
467
+ /** Marketing-consent opt-ins captured at the pre-chat form (ADR-048). */
468
+ consent?: {
469
+ emailOptIn: boolean;
470
+ smsOptIn: boolean;
471
+ };
472
+ }
473
+ /** One conversation surfaced by `resolve_identity` for the cross-device picker. */
474
+ interface RestorableConversation {
475
+ conversationId: string;
476
+ sessionId: string;
477
+ lastActivityAt?: string;
478
+ preview?: string;
328
479
  }
480
+ /**
481
+ * State machine for the cross-device "restore my chats" flow. Driven by the three
482
+ * HTTP POST routes on the chat-ws wrapper — `/internal/identity/request-otp` →
483
+ * `/internal/identity/verify-otp` → `/internal/identity/resolve` (ADR-048 §c).
484
+ * The view renders a panel off this.
485
+ */
486
+ type IdentityRestore = {
487
+ phase: 'idle';
488
+ } /** UI-local: the email-entry step before any request is sent. */ | {
489
+ phase: 'awaiting_email';
490
+ error?: string;
491
+ } | {
492
+ phase: 'requesting';
493
+ email: string;
494
+ channel: 'email' | 'sms';
495
+ } | {
496
+ phase: 'awaiting_code';
497
+ email: string;
498
+ channel: 'email' | 'sms';
499
+ maskedDestination?: string;
500
+ error?: string;
501
+ attemptsRemaining?: number;
502
+ } | {
503
+ phase: 'verifying';
504
+ email: string;
505
+ channel: 'email' | 'sms';
506
+ } | {
507
+ phase: 'resolving';
508
+ email: string;
509
+ } | {
510
+ phase: 'resolved';
511
+ email: string;
512
+ conversations: RestorableConversation[];
513
+ } | {
514
+ phase: 'error';
515
+ message: string;
516
+ };
329
517
  interface ConversationEvents {
330
518
  /** Fired whenever the message list changes (append, token delta, finalize). */
331
519
  onMessages: (messages: ChatMessage[]) => void;
@@ -333,25 +521,51 @@ interface ConversationEvents {
333
521
  onStatus: (status: ConnectionStatus, detail?: string) => void;
334
522
  /** Fired when a turn pauses for OTP / tool-confirmation, and `null` when it clears. */
335
523
  onInterrupt?: (interrupt: Interrupt | null) => void;
524
+ /** Fired on cross-device identity-restore state transitions. */
525
+ onIdentityRestore?: (state: IdentityRestore) => void;
336
526
  }
337
527
  declare class ConversationController {
338
528
  private readonly config;
339
529
  private readonly events;
530
+ private readonly store;
340
531
  private client;
341
532
  private sessionId;
342
533
  private readonly messages;
343
534
  private status;
344
535
  private seq;
345
- /** Visitor identity, seeded from config and updated by the pre-chat form. */
346
- private identity;
347
536
  /** requestId of the in-flight turn — used to resume OTP / tool confirmations. */
348
537
  private activeRequestId;
349
538
  private interrupt;
350
- constructor(config: ChatWidgetConfig, events: ConversationEvents);
539
+ private identityRestore;
540
+ /**
541
+ * True once the resume probe (persisted-pointer get_session OR the
542
+ * `/internal/resume-by-fingerprint` POST) has run for this controller. Makes
543
+ * `connect()` idempotent: re-entering after a transient `error` status (e.g. a
544
+ * retried `send()`) creates a fresh session rather than re-running the resume
545
+ * probe — which would fire another `resumeByFingerprint` POST and could adopt a
546
+ * session we already decided not to resume.
547
+ */
548
+ private resumeAttempted;
549
+ /**
550
+ * HTTP base for the chat-ws wrapper's `/internal/*` REST routes. `null` when
551
+ * the configured WS endpoint could not be parsed into an absolute origin — in
552
+ * that case the `/internal/*` routes are refused (rather than mis-targeted at
553
+ * the host page origin). See {@link httpBaseFromWsEndpoint}.
554
+ */
555
+ private readonly httpBase;
556
+ constructor(config: ChatWidgetConfig, events: ConversationEvents, store?: StoreApi<WidgetStore>);
351
557
  get connectionStatus(): ConnectionStatus;
352
- /** Merge in visitor identity (from the pre-chat form). Applied on next connect. */
558
+ /** The persisted store, exposed so the view can read identity for the pre-chat gate. */
559
+ getStore(): StoreApi<WidgetStore>;
560
+ /** True when a persisted session pointer exists (drives the resume path). */
561
+ hasPersistedSession(): boolean;
562
+ /** True when persisted identity exists (lets the view skip the pre-chat form). */
563
+ hasPersistedIdentity(): boolean;
564
+ /** Merge in visitor identity + consent (from the pre-chat form). Applied on next connect. */
353
565
  setUserInfo(info: UserInfo): void;
354
566
  private setInterrupt;
567
+ private setIdentityRestore;
568
+ get currentIdentityRestore(): IdentityRestore;
355
569
  /** Submit an OTP code to resume the paused turn. No-op if not awaiting OTP. */
356
570
  verifyOtp(code: string): void;
357
571
  /** Approve or reject a pending tool write to resume the paused turn. */
@@ -359,8 +573,68 @@ declare class ConversationController {
359
573
  private nextId;
360
574
  private setStatus;
361
575
  private emitMessages;
362
- /** Open the transport and create a conversation session. Idempotent. */
576
+ /** Compute (once) + return the persisted browser fingerprint. */
577
+ private fingerprint;
578
+ /**
579
+ * Build the `metadata` payload threaded into `create_conversation_session`:
580
+ * phone (no first-class engine field) and consent.
581
+ *
582
+ * NOTE: `verifiedEmail` is deliberately NOT stamped here. It is a per-session
583
+ * OTP proof bound to the session it was verified against
584
+ * (`verifiedEmailSessionId`), and the server only treats an actual OTP `verify`
585
+ * as proof — metadata `verifiedEmail` is just a hint. Auto-stamping it onto
586
+ * every brand-new `create_conversation_session` would mislabel a fresh
587
+ * visitor's session with a prior (possibly different) visitor's email on a
588
+ * shared browser. The verified email is only used when RESUMING the exact
589
+ * session it was proven for — see {@link verifiedEmailForSession}.
590
+ */
591
+ private sessionMetadata;
592
+ /**
593
+ * The verified-email hint, but ONLY when the OTP proof is bound to the session
594
+ * being resumed (`verifiedEmailSessionId === sessionId`). Returns null
595
+ * otherwise so a stale/cross-visitor proof is never threaded onto a session it
596
+ * wasn't proven for.
597
+ */
598
+ private verifiedEmailForSession;
599
+ /** Lazily open the WS client (default transport). Idempotent within a connect. */
600
+ private ensureClient;
601
+ /**
602
+ * Open the connection and either RESUME or create a session.
603
+ *
604
+ * 1. Persisted pointer (ADR-048 §b): `get_session` → if not `ended`, reuse +
605
+ * hydrate from `get_messages` (newest-first, reversed). On ended/404 clear
606
+ * ONLY the pointer (identity/consent survive).
607
+ * 2. No persisted pointer: POST `/internal/resume-by-fingerprint` FIRST; if
608
+ * `resumable`, adopt the returned session (the wrapper has primed the
609
+ * operator registry), reuse the sessionId, and hydrate via get_session/
610
+ * get_messages — rather than relying on createConversationSession to resume.
611
+ * 3. Otherwise create a fresh session.
612
+ */
363
613
  connect(): Promise<void>;
614
+ /**
615
+ * Build the auth fields every `/internal/*` route shares: `agentId` (required
616
+ * for the agent-policy lookup), `agentName` (used as the OTP email sender), and
617
+ * the optional pre-auth `authContext` the host page may have configured. The
618
+ * `Origin` header is sent automatically by the browser and checked server-side.
619
+ */
620
+ private authBody;
621
+ /** POST JSON to a `/internal/*` route; returns the parsed body (or throws). */
622
+ private postInternal;
623
+ /**
624
+ * POST `/internal/resume-by-fingerprint`. Returns the resumable sessionId when
625
+ * the wrapper found (and primed) a recent session for this fingerprint, else
626
+ * null. Network/route failures are swallowed → null (fall through to create).
627
+ */
628
+ private resumeByFingerprint;
629
+ /** `create_conversation_session` with fingerprint + identity + consent metadata. */
630
+ private createSession;
631
+ /**
632
+ * Attempt to resume `sessionId`: returns true and hydrates the transcript when
633
+ * the session is live, false when it has ended / can't be fetched.
634
+ */
635
+ private tryResume;
636
+ /** Page recent history (newest-first), reverse to chronological, and render. */
637
+ private hydrateHistory;
364
638
  /**
365
639
  * Submit a user message. Appends the user bubble immediately, then streams the
366
640
  * assistant reply token-by-token, finalizing on `eventual_response`.
@@ -368,9 +642,73 @@ declare class ConversationController {
368
642
  send(text: string): Promise<void>;
369
643
  /** Map a non-token turn event (OTP / tool-confirmation lifecycle) to interrupt state. */
370
644
  private handleTurnEvent;
645
+ /**
646
+ * Begin the cross-device restore: POST `/internal/identity/request-otp` for
647
+ * `email` over `channel`. The view collects the email via an explicit affordance.
648
+ */
649
+ requestIdentityOtp(email: string, channel?: 'email' | 'sms'): Promise<void>;
650
+ /** Submit the code: POST `/internal/identity/verify-otp`, then resolve on success. */
651
+ verifyIdentityOtp(code: string): Promise<void>;
652
+ /** Resolve the verified identity → restorable conversations via POST `/internal/identity/resolve`. */
653
+ private resolveIdentity;
654
+ /**
655
+ * Replay a chosen restorable conversation: point the live session at its
656
+ * sessionId, hydrate its transcript (get_session + get_messages), and persist
657
+ * the new pointer so the next `sendMessage` continues it.
658
+ */
659
+ restoreConversation(sessionId: string): Promise<void>;
660
+ /** Dismiss the cross-device restore panel. */
661
+ cancelIdentityRestore(): void;
371
662
  /** Tear down the underlying client. */
372
663
  disconnect(): void;
373
664
  }
374
665
  //#endregion
375
- export { type ChatMessage, type ChatWidgetConfig, type ChatWidgetMode, type ChatWidgetTheme, type Citation, type ConnectionStatus, ConversationController, type ConversationEvents, ELEMENT_TAG, type Role, SmoothAgentChatElement, defineChatWidget, initChatWidgetLoader, mountChatWidget, mountFullPageChat };
666
+ //#region src/fingerprint.d.ts
667
+ /**
668
+ * Browser fingerprint — a stable, privacy-light identifier used by the
669
+ * smooth-operator server to correlate an anonymous visitor's sessions across
670
+ * page loads (and, server-side, to match an anonymous fingerprint to a known
671
+ * CRM contact). It rides every `create_conversation_session` as
672
+ * `browserFingerprint` (see ADR-048).
673
+ *
674
+ * ## Why not ThumbmarkJS
675
+ *
676
+ * The ADR floats ThumbmarkJS as the reference implementation. For an *embed*
677
+ * that is injected onto arbitrary host pages, ThumbmarkJS is too heavy: its
678
+ * full build pulls in extensive device-detection tables and async
679
+ * component collection, adding tens of kilobytes (and async surface) to a
680
+ * bundle whose whole selling point is staying out of the host page's
681
+ * LCP/TBT budget. The fingerprint here is a few hundred bytes.
682
+ *
683
+ * ## What this is (and the tradeoff)
684
+ *
685
+ * The correlation that actually matters — "is this the same browser as last
686
+ * time?" — is carried by a **persisted random UUID** (the `browserFingerprint`
687
+ * field in the persisted store). That UUID is generated once and reused for
688
+ * the life of the localStorage entry, so same-browser resume is exact and
689
+ * deterministic. The signal hash below is a best-effort entropy *supplement*
690
+ * mixed into that UUID's derivation seed on first generation — it gives the
691
+ * server-side resolver a soft signal for the (rare) cross-storage case where
692
+ * the UUID was cleared but the device is unchanged. It is intentionally NOT a
693
+ * high-entropy device fingerprint: no canvas/WebGL/audio probes, no font
694
+ * enumeration, nothing that reads as invasive tracking. The tradeoff is weaker
695
+ * cross-storage matching in exchange for a tiny, transparent, no-network,
696
+ * XSS-safe implementation. The server's resolver (SMOODEV-2129d) is the source
697
+ * of truth for any fuzzy matching; the client just supplies a stable token.
698
+ */
699
+ /**
700
+ * Compute a fresh fingerprint token: a stable random UUID, suffixed with the
701
+ * FNV hash of the device signals so the server can recover a soft device
702
+ * signal even if it only has the token. Called ONCE per browser (the result is
703
+ * persisted and reused) — see {@link getOrCreateFingerprint}.
704
+ */
705
+ declare function computeFingerprint(): string;
706
+ /**
707
+ * Return the cached fingerprint if one was already computed for this browser,
708
+ * otherwise compute + persist a new one via the provided accessors. The
709
+ * persistence layer owns storage; this function owns the "compute once" policy.
710
+ */
711
+ declare function getOrCreateFingerprint(get: () => string | null, set: (fp: string) => void): string;
712
+ //#endregion
713
+ export { type ChatMessage, type ChatWidgetConfig, type ChatWidgetMode, type ChatWidgetTheme, type Citation, type ConnectionStatus, type ConsentState, ConversationController, type ConversationEvents, ELEMENT_TAG, type IdentityRestore, type IdentityState, PERSIST_VERSION, type PersistedWidgetState, type RestorableConversation, type Role, SmoothAgentChatElement, type UserInfo, type WidgetStore, computeFingerprint, createWidgetStore, defineChatWidget, getOrCreateFingerprint, httpBaseFromWsEndpoint, initChatWidgetLoader, mountChatWidget, mountFullPageChat, storageKey };
376
714
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/config.ts","../src/element.ts","../src/loader-core.ts","../src/conversation.ts"],"mappings":";;;;;;AAOA;;;;UAAiB,eAAA;EAIb;EAFA,IAAA;EAMA;EAJA,UAAA;EAQA;EANA,OAAA;EAUA;EARA,WAAA;EAYA;EAVA,SAAA;EAkBA;EAhBA,eAAA;EAoBA;EAlBA,mBAAA;EAkBsB;EAhBtB,UAAA;EA2BsB;EAzBtB,cAAA;EAyBsB;EAvBtB,MAAA;EAyBa;EAnBb,iBAAA;;EAEA,qBAAA;EAsBA;EApBA,kBAAA;EAyBO;EAvBP,sBAAA;AAAA;;;;;;;;;KAWQ,cAAA;AAAA,UAEK,gBAAA;EAuCb;;;;EAlCA,QAAA;EAyCuB;;;;EApCvB,IAAA,GAAO,cAAA;ECvCa;EDyCpB,OAAA;ECzCoB;ED2CpB,SAAA;ECdS;EDgBT,QAAA;;EAEA,SAAA;ECwDkB;EDt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EiBR,WAAA,IAAe,SAAA,EAAW,SAAA;AAAA;AAAA,cAyCjB,sBAAA;EAAA,iBACQ,MAAA;EAAA,iBACA,MAAA;EAAA,QACT,MAAA;EAAA,QACA,SAAA;EAAA,iBACS,QAAA;EAAA,QACT,MAAA;EAAA,QACA,GAAA;EF/CA;EAAA,QEiDA,QAAA;EF/CA;EAAA,QEiDA,eAAA;EAAA,QACA,SAAA;cAEI,MAAA,EAAQ,gBAAA,EAAkB,MAAA,EAAQ,kBAAA;EAAA,IAM1C,gBAAA,IAAoB,gBAAA;EF7ChB;EEkDR,WAAA,CAAY,IAAA,EAAM,QAAA;EAAA,QAIV,YAAA;EFhDA;EEsDR,SAAA,CAAU,IAAA;;EAMV,WAAA,CAAY,QAAA;EAAA,QAMJ,MAAA;EAAA,QAKA,SAAA;EAAA,QAKA,YAAA;EFhDU;EEsDZ,OAAA,IAAW,OAAA;EFtDP;;;;EE+EJ,IAAA,CAAK,IAAA,WAAe,OAAA;EF8HlB;EAAA,QE1DA,eAAA;EFiKA;EE1HR,UAAA;AAAA"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/config.ts","../src/element.ts","../src/loader-core.ts","../src/persistence.ts","../src/conversation.ts","../src/fingerprint.ts"],"mappings":";;;;;;;;AAOA;;;UAAiB,eAAA;EAEb;EAAA,IAAA;EAIA;EAFA,UAAA;EAMA;EAJA,OAAA;EAQA;EANA,WAAA;EAUA;EARA,SAAA;EAgBA;EAdA,eAAA;EAkBA;EAhBA,mBAAA;EAkBsB;EAhBtB,UAAA;EA2BQ;EAzBR,cAAA;;EAEA,MAAA;EAuBsB;EAjBtB,iBAAA;EAmB6B;EAjB7B,qBAAA;EAwFuB;EAtFvB,kBAAA;EAyBA;EAvBA,sBAAA;AAAA;;;;;;;;;KAWQ,cAAA;AAAA,UAEK,gBAAA;EAiCb;;;;EA5BA,QAAA;EAyCA;;;;EApCA,IAAA,GAAO,cAAA;EA6DP;EA3DA,OAAA;EA2DuB;EAzDvB,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