@vio-live/web-sdk 0.21.0 → 0.23.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.
@@ -11,11 +11,31 @@ import { GraphQLClient } from 'graphql-request';
11
11
  * them from env vars / their config and passes them to `Vio.init`.
12
12
  */
13
13
  type Environment = 'development' | 'testing' | 'production';
14
+ /**
15
+ * Platform type of the surface this page belongs to (ADR-0027). It travels
16
+ * with every slot declaration and as `?platform=` on the bootstrap, so the
17
+ * campaigns service only answers with the slot assignments of this platform.
18
+ */
19
+ type VioPlatform = 'web' | 'custom-web' | 'vev';
14
20
  interface VioConfig {
15
21
  /** Vio API key for this client app (from the Vio dashboard). */
16
22
  apiKey: string;
17
23
  /** Target environment. Defaults to 'development'. */
18
24
  environment?: Environment;
25
+ /**
26
+ * Platform type of this surface: `web` (the no-code snippet), `custom-web`
27
+ * (the SDK integrated by code) or `vev`. Defaults to `web`.
28
+ */
29
+ platform?: VioPlatform;
30
+ /**
31
+ * The host's own id for the content (article, page) this SDK instance is
32
+ * rendered in — the first choice of `Vio.content()`, ahead of the URL query,
33
+ * the `vio:content-id` meta, the canonical URL and the pathname. Goes on
34
+ * every analytics event as `content_id`.
35
+ */
36
+ contentId?: string | number;
37
+ /** Human-readable title of that content (`content_title`); see `contentId`. */
38
+ contentTitle?: string;
19
39
  /** Override REST API base. Defaults are env-aware. */
20
40
  apiBase?: string;
21
41
  /** Override GraphQL base. Defaults are env-aware. */
@@ -48,6 +68,9 @@ interface VioConfig {
48
68
  interface ResolvedConfig {
49
69
  apiKey: string;
50
70
  environment: Environment;
71
+ platform: VioPlatform;
72
+ contentId?: string | number;
73
+ contentTitle?: string;
51
74
  apiBase: string;
52
75
  graphQLBase: string;
53
76
  eventsBase: string;
@@ -209,6 +232,56 @@ interface BootstrapResponse {
209
232
  currencyCode: string;
210
233
  };
211
234
  }
235
+ /**
236
+ * A slot this page declares to the campaigns service (ADR-0027 / ADR-0034):
237
+ * `id` is the slot name (≤ 100 chars, what `vio-slot` carries and what the
238
+ * dashboard assigns a campaign to); `displayName` is only for the dashboard.
239
+ */
240
+ interface ManifestLocation {
241
+ id: string;
242
+ displayName?: string;
243
+ }
244
+ /**
245
+ * Where something happened, as `Vio.attribution(slot)` answers it — the ONE
246
+ * attribution shape the SDK elements, Vev and Replit all use: the place
247
+ * (`slot`), the campaign that place shows right now and its primary sponsor,
248
+ * and the content (article) the page is. Everything optional: `{}` before the
249
+ * bootstrap, except the content.
250
+ */
251
+ interface Attribution {
252
+ slot?: string;
253
+ campaignId?: number;
254
+ sponsorId?: number;
255
+ contentId?: string;
256
+ contentTitle?: string;
257
+ }
258
+ /** Body of `POST /v2/mobile/components/manifest`. */
259
+ interface ManifestRequest {
260
+ platform: string;
261
+ /**
262
+ * `merge` upserts the slots without deprecating those of other pages (a
263
+ * surface on the web has many pages, each knowing only its own blocks);
264
+ * `replace` (the native SDKs' mode) deprecates whatever is not listed.
265
+ */
266
+ mode: 'merge' | 'replace';
267
+ locations: ManifestLocation[];
268
+ }
269
+ /** Response of `POST /v2/mobile/components/manifest`. */
270
+ interface ManifestResult {
271
+ clientAppId: number;
272
+ platform: string;
273
+ mode: 'merge' | 'replace';
274
+ locations: Array<{
275
+ id: number | string;
276
+ locationId: string;
277
+ displayName?: string | null;
278
+ }>;
279
+ deprecatedCount: number;
280
+ warnings: Array<{
281
+ kind: string;
282
+ detail: string;
283
+ }>;
284
+ }
212
285
  /**
213
286
  * A placement component returned by `/v2/mobile/campaigns/:id/components`.
214
287
  * Used by `<vio-product-carousel campaign-id="...">` to know which products
@@ -269,14 +342,24 @@ declare class VioApi {
269
342
  /**
270
343
  * Bootstrap — fetches client app config (sponsors with commerce keys,
271
344
  * default market, campaign id). Called once at SDK init.
345
+ *
346
+ * With `platform`, `campaigns[].slots[]` only lists the assignments of that
347
+ * platform (plus the ones with no platform) — see ADR-0027.
272
348
  */
273
- bootstrap(): Promise<BootstrapResponse>;
349
+ bootstrap(platform?: string): Promise<BootstrapResponse>;
350
+ /**
351
+ * Declare the slots of this page to the campaigns service
352
+ * (`POST /v2/mobile/components/manifest`, ADR-0034). The web SDK always
353
+ * sends `mode: 'merge'`; see `Vio.declareSlots()` for the dedupe on top.
354
+ */
355
+ declareManifest(body: ManifestRequest): Promise<ManifestResult>;
274
356
  /**
275
357
  * Get placement components for a campaign. Used by the carousel auto-fetch
276
358
  * mode (`<vio-product-carousel campaign-id="36" location="news-favorites">`).
277
359
  */
278
360
  getComponents(campaignId: number | string): Promise<PlacementComponent[]>;
279
361
  private get;
362
+ private post;
280
363
  }
281
364
  declare class VioApiError extends Error {
282
365
  readonly status: number;
@@ -356,6 +439,21 @@ declare function createCommerceClient(options: CommerceClientOptions): CommerceC
356
439
  * Mirrors the iOS SDK's `SponsorCart` + `CartLineItem` structure so the
357
440
  * mental model stays consistent across platforms.
358
441
  */
442
+ /**
443
+ * Where a unit in the cart came from (ADR-0027 / ADR-0034): the campaign
444
+ * the place showed when it was added, the place (`slot`) and the content
445
+ * (article). What `Vio.attribution(slot)` answers, minus the sponsor and the
446
+ * title. The purchase is split per campaign from these.
447
+ */
448
+ interface CartOrigin {
449
+ campaignId?: number;
450
+ slot?: string;
451
+ contentId?: string;
452
+ }
453
+ /** One origin of a line and how many of its units came from it. */
454
+ interface CartLineOrigin extends CartOrigin {
455
+ quantity: number;
456
+ }
359
457
  interface CartLineItem {
360
458
  /** Unique local id for this line item (used for update/remove). */
361
459
  id: string;
@@ -379,6 +477,12 @@ interface CartLineItem {
379
477
  imageUrl: string;
380
478
  /** Quantity. */
381
479
  quantity: number;
480
+ /**
481
+ * Where the units came from, most recent last; their quantities add up to
482
+ * `quantity`. Absent on carts persisted before origins existed — read them
483
+ * through `lineOrigins()`, which fills the gap with an empty origin.
484
+ */
485
+ origins?: CartLineOrigin[];
382
486
  /** Selected shipping for this line (backend cart). */
383
487
  shipping?: unknown;
384
488
  /** Shipping options offered by the backend for this line. */
@@ -420,6 +524,8 @@ interface AddProductOptions {
420
524
  sponsorName?: string;
421
525
  quantity?: number;
422
526
  variantId?: number;
527
+ /** Where these units come from (`Vio.attribution(slot)`); see `CartOrigin`. */
528
+ origin?: CartOrigin;
423
529
  }
424
530
  /** Minimal product shape — for callers who only have e.g. mock data, not a full Product. */
425
531
  interface AddManualOptions {
@@ -433,6 +539,8 @@ interface AddManualOptions {
433
539
  imageUrl: string;
434
540
  quantity?: number;
435
541
  variantId?: number;
542
+ /** Where these units come from (`Vio.attribution(slot)`); see `CartOrigin`. */
543
+ origin?: CartOrigin;
436
544
  }
437
545
  declare class CartManager extends EventTarget {
438
546
  private cartsBySponsor;
@@ -450,18 +558,52 @@ declare class CartManager extends EventTarget {
450
558
  * landed (Alan, 2026-08-18: shippings queried before AddItem settled,
451
559
  * came back empty). */
452
560
  private inFlightMutations;
561
+ /** Per-line quantity sync with the backend: at most ONE UpdateItem /
562
+ * DeleteItem in flight per line. Targets that arrive while one is in flight
563
+ * are coalesced into `pending` (only the latest survives) and sent when the
564
+ * current request settles. Keyed by `${sponsorId}:${cartItemId}`.
565
+ * (Alan, 2026-10-15: a burst of +/− clicks fired one UpdateItem per click
566
+ * in parallel; each response re-applied the whole backend cart, so an
567
+ * older one landing after a newer optimistic change rolled the line back.) */
568
+ private qtySyncs;
453
569
  constructor();
454
570
  private nextSeq;
455
- /** Resolves once any in-flight AddItem/UpdateItem/DeleteItem for this
456
- * sponsor has settled (success or failure). No-op if nothing is pending. */
571
+ /** Resolves once every in-flight AddItem/UpdateItem/DeleteItem for this
572
+ * sponsor has settled (success or failure), including ones started while
573
+ * waiting (a quantity intent replayed by an AddItem reconcile). No-op if
574
+ * nothing is pending. */
457
575
  waitForCartMutations(sponsorId: number): Promise<void>;
458
- /** Apply a backend response only if no newer response was applied already. */
576
+ /**
577
+ * True while an AddItem/UpdateItem/DeleteItem of this sponsor OTHER than
578
+ * `except` has not settled. A mutation applying its own answer passes
579
+ * itself: its response is current for what IT sent — only the others make
580
+ * it stale.
581
+ */
582
+ private hasMutationsInFlight;
583
+ /** Register a backend mutation so `waitForCartMutations` can await it. */
584
+ private trackMutation;
585
+ private qtySyncKey;
586
+ /** The quantity a line is heading to (pending beats in flight), or
587
+ * undefined when no quantity sync is active for it. */
588
+ private intendedQuantity;
589
+ /** Apply a backend response only if no newer response was applied already.
590
+ * Returns false when it was discarded as stale. */
459
591
  private applyBackendCart;
592
+ /** The final answer of a line's sync lost the per-sponsor seq race (another
593
+ * line answered later): the cart as a whole is stale, but for THIS line it
594
+ * is the latest word. Copy its quantity (and price) so a server-side clamp
595
+ * — stock — doesn't leave the optimistic value behind for good, with the
596
+ * checkout / Apple Pay total built on it. */
597
+ private reconcileLineFromResponse;
460
598
  /** Surface a cart sync problem to hosts/UI (and the console). */
461
599
  private emitError;
462
600
  /** Ensure the sponsor cart exists server-side; returns its backend cart id. */
463
601
  ensureCartId(sponsorId: number, currency?: string, shippingCountry?: string): Promise<string | undefined>;
464
- /** Overwrite local cart state with the backend cart response (source of truth). */
602
+ /**
603
+ * Overwrite local cart state with the backend cart response (source of
604
+ * truth). `opts.settling` is the mutation whose answer this is: it does not
605
+ * count as "in flight" for the origins (see `hasMutationsInFlight`).
606
+ */
465
607
  updateFromBackendCart(sponsorId: number, backendCart: {
466
608
  cart_id?: string;
467
609
  currency?: string;
@@ -490,6 +632,8 @@ declare class CartManager extends EventTarget {
490
632
  shipping?: unknown;
491
633
  available_shippings?: unknown[];
492
634
  }>;
635
+ }, opts?: {
636
+ settling?: Promise<unknown>;
493
637
  }): void;
494
638
  /** Add a Product DTO to a sponsor's cart. Bumps quantity if already present.
495
639
  * When a variantId is given, the line uses the VARIANT's price / image / title
@@ -501,7 +645,28 @@ declare class CartManager extends EventTarget {
501
645
  * when the AddItem response reconciles (keyed by product::variant). */
502
646
  private pendingQtyIntents;
503
647
  private intentKey;
504
- updateQuantity(lineItemId: string, sponsorId: number, quantity: number): void;
648
+ private findLine;
649
+ /** Change a line's quantity by `delta`, computed on the manager's CURRENT
650
+ * quantity — not on whatever a UI rendered a moment ago. A burst of +/−
651
+ * clicks before a re-render therefore asks for 2, 3, 4… and not for the
652
+ * same target several times. Reaching 0 removes the line. */
653
+ adjustQuantity(lineItemId: string, sponsorId: number, delta: number, opts?: {
654
+ origin?: CartOrigin;
655
+ }): void;
656
+ /** Set a line's quantity (0 or less removes it). Optimistic: the local
657
+ * state and `change` update at once; the backend is synced through
658
+ * `syncQuantity`, one request in flight per line, latest target wins. */
659
+ updateQuantity(lineItemId: string, sponsorId: number, quantity: number, opts?: {
660
+ origin?: CartOrigin;
661
+ }): void;
662
+ /** Send a line's target quantity to the backend — ONE request in flight per
663
+ * line. A target that arrives while one is in flight replaces any earlier
664
+ * waiting one and goes out when the current request settles, so the server
665
+ * ends on the last intent and never sees two updates racing each other.
666
+ * While the sync is active the line keeps its optimistic quantity through
667
+ * any backend response (see `updateFromBackendCart`); a rejection drops
668
+ * what was queued and reconciles the cart from the server. */
669
+ private syncQuantity;
505
670
  removeItem(lineItemId: string, sponsorId: number): void;
506
671
  clearSponsorCart(sponsorId: number): void;
507
672
  clearAllCarts(): void;
@@ -525,6 +690,16 @@ declare class CartManager extends EventTarget {
525
690
  private loadFromStorage;
526
691
  private emit;
527
692
  }
693
+ /** Only the three attribution fields, trimmed; `{}` when nothing is known. */
694
+ declare function normalizeOrigin(origin: CartOrigin | null | undefined): CartOrigin;
695
+ /** Two origins are the same place when campaign, slot and content all match. */
696
+ declare function sameOrigin(a: CartOrigin, b: CartOrigin): boolean;
697
+ /**
698
+ * The origins of a line for reporting: what it carries, plus an empty origin
699
+ * for any units it does not account for (a cart persisted before origins
700
+ * existed, a server-side bump). Their quantities add up to the line's.
701
+ */
702
+ declare function lineOrigins(line: Pick<CartLineItem, 'origins' | 'quantity'>): CartLineOrigin[];
528
703
 
529
704
  /**
530
705
  * Vipps MobilePay Payment Adapter — GraphQL Integration & Types.
@@ -624,7 +799,8 @@ interface GraphQLEnvelope {
624
799
  }
625
800
  /** Execute a GraphQL query/mutation against the configured commerce endpoint.
626
801
  * Callers that skip `getCartGraphQLOptions()` (or pass a bare sponsorId) get
627
- * it resolved here instead of silently sending an unauthenticated request. */
802
+ * it resolved here instead of silently sending an unauthenticated request.
803
+ * Rejects after `CART_GRAPHQL_TIMEOUT_MS` (and aborts the fetch). */
628
804
  declare function executeCartGraphQL(query: string, variables: Record<string, unknown>, options?: CartQueryOptions | number | undefined): Promise<GraphQLEnvelope>;
629
805
  declare function createCart(customerSessionId: string, currency: string, shippingCountry?: string | null, options?: CartQueryOptions): Promise<any>;
630
806
  declare function addItem(cartId: string, lineItems: unknown[], options?: CartQueryOptions): Promise<any>;
@@ -1801,6 +1977,14 @@ interface AnalyticsContext {
1801
1977
  /** Código corto del fallo (`sdk_error` / `checkout_error`). */
1802
1978
  errorCode?: string;
1803
1979
  variant?: string;
1980
+ /**
1981
+ * The slot (ADR-0027) the component sits in — its `vio-slot`. Attribution
1982
+ * follows it: the event's `campaign_id` is the campaign assigned to the slot
1983
+ * right now, before the sponsor rule. On the wire it fills `location_id`
1984
+ * when no explicit `locationId` is given (a slot IS a location id to the
1985
+ * campaigns service).
1986
+ */
1987
+ slot?: string;
1804
1988
  }
1805
1989
  interface AnalyticsItemInput {
1806
1990
  productId: number | string;
@@ -1928,23 +2112,45 @@ declare class AnalyticsManager extends EventTarget {
1928
2112
  * writes ZERO tracking code for the commerce funnel.
1929
2113
  */
1930
2114
  private installAutoListeners;
2115
+ /** The lines of the cart (current, else the pre-clear snapshot), optionally one sponsor's. */
2116
+ private cartLines;
2117
+ /**
2118
+ * The cart split per campaign — the shared rule of cart/slices.ts over the
2119
+ * current cart (else the pre-clear snapshot), plus whether any unit named
2120
+ * its campaign itself (a cart without origins is reported as before).
2121
+ */
2122
+ private cartSlices;
2123
+ /**
2124
+ * The context of one of several per-campaign events: the slice's campaign,
2125
+ * slot and content — only its own; when the slice spans several slots or
2126
+ * articles the event names none rather than the one the click came from.
2127
+ */
2128
+ private sliceContext;
2129
+ /**
2130
+ * The context of a single-campaign checkout/purchase: when the cart's origins
2131
+ * say which campaign they came from, the event says it too (plus the slot /
2132
+ * content when unique) — a cart without origins is exactly as before.
2133
+ */
2134
+ private singleSliceContext;
1931
2135
  /** Current cart → commerce payload; falls back to the pre-clear snapshot. */
1932
2136
  private cartCommerce;
1933
2137
  private findLine;
1934
2138
  }
1935
2139
  /**
1936
2140
  * The `campaign_id` of an event. In order: the context's explicit id; the
1937
- * active campaign of `campaigns[]` the event's sponsor takes part in, as its
1938
- * primary or one of its secondaries — when it is in several, the surface's
1939
- * default campaign if it is one of them, else the first one the backend
1940
- * lists; the default campaign (`campaign.id`). `/v2/mobile/config` has no
1941
- * top-level `campaignId` — reading one is why every event used to leave
1942
- * with `campaign_id: 0` and the campaigns screen stayed empty.
2141
+ * campaign assigned to the context's `slot` right now (ADR-0027 — only an
2142
+ * open assignment for the init platform counts, see `findSlotAssignment`);
2143
+ * the active campaign of `campaigns[]` the event's sponsor takes part in, as
2144
+ * its primary or one of its secondaries — when it is in several, the
2145
+ * surface's default campaign if it is one of them, else the first one the
2146
+ * backend lists; the default campaign (`campaign.id`). `/v2/mobile/config`
2147
+ * has no top-level `campaignId` — reading one is why every event used to
2148
+ * leave with `campaign_id: 0` and the campaigns screen stayed empty.
1943
2149
  *
1944
2150
  * A malformed `campaigns[]` (not an array, a null entry) never breaks
1945
2151
  * `track()`: it falls back to `campaign.id`.
1946
2152
  */
1947
- declare function resolveCampaignId(ctx: Pick<AnalyticsContext, 'campaignId' | 'sponsorId'>, boot: Pick<BootstrapResponse, 'campaign' | 'campaigns'> | null | undefined): number | undefined;
2153
+ declare function resolveCampaignId(ctx: Pick<AnalyticsContext, 'campaignId' | 'sponsorId' | 'slot'>, boot: Pick<BootstrapResponse, 'campaign' | 'campaigns'> | null | undefined): number | undefined;
1948
2154
  /**
1949
2155
  * `detail` of `vio:payment-success` as the checkout emits it. Four paths,
1950
2156
  * three shapes: a redirect return (`orderId` = Vio's checkout id), the
@@ -1955,6 +2161,13 @@ declare function resolveCampaignId(ctx: Pick<AnalyticsContext, 'campaignId' | 's
1955
2161
  interface PaymentSuccessDetail {
1956
2162
  method?: string;
1957
2163
  sponsorId?: number | string;
2164
+ /** The slot the purchase started from, when the emitter knows it. */
2165
+ slot?: string;
2166
+ /** The campaign the emitter attributed the purchase to (its `Vio.attribution`). */
2167
+ campaignId?: number;
2168
+ /** Per-element content override (`vio-content-id` / `vio-content-title`), when the emitter carries one. */
2169
+ contentId?: string | number;
2170
+ contentTitle?: string;
1958
2171
  /** Redirect return: Vio's checkout id (the name predates `checkoutId`). */
1959
2172
  orderId?: string | number;
1960
2173
  /** Vio's checkout id — from the checkout state or the return URL. */
@@ -1987,6 +2200,130 @@ interface PaymentSuccessResult {
1987
2200
  */
1988
2201
  declare function purchaseFromPaymentSuccess(d: PaymentSuccessDetail): Pick<AnalyticsCommerce, 'orderId'>;
1989
2202
 
2203
+ /**
2204
+ * Content (article) attribution — the other half of "where did this happen".
2205
+ *
2206
+ * The SLOT says the place on the page (`carousel-1`, `hero`); the CONTENT says
2207
+ * the article/page the place was rendered in. One Vev design serves thousands
2208
+ * of article URLs, so the article must not leak into the slot id — it travels
2209
+ * on every analytics event as `content_id` / `content_title` instead, and this
2210
+ * module finds it without the editor doing anything.
2211
+ *
2212
+ * Pure: `resolveContent()` takes the document and location (defaults to the
2213
+ * globals) so it can be tested, never throws, and answers `{}` where there is
2214
+ * no DOM (SSR, node tests). `Vio.content()` resolves it live on every call —
2215
+ * an SPA route change or a new title is seen on the next event.
2216
+ */
2217
+ interface ContentRef {
2218
+ id?: string;
2219
+ title?: string;
2220
+ }
2221
+ interface ContentInit {
2222
+ contentId?: string | number | null;
2223
+ contentTitle?: string | null;
2224
+ }
2225
+ /**
2226
+ * Id: `Vio.init({ contentId })` → `?vio_content=` → `<meta name="vio:content-id">`
2227
+ * → `<link rel="canonical">` href or `<meta property="og:url">` (without query
2228
+ * and hash) → `location.pathname`.
2229
+ * Title: `Vio.init({ contentTitle })` → `?vio_content_title=` →
2230
+ * `<meta name="vio:content-title">` → `<meta property="og:title">` → `document.title`.
2231
+ */
2232
+ declare function resolveContent(init?: ContentInit | null, doc?: Document | null | undefined, loc?: Location | {
2233
+ href?: string;
2234
+ pathname?: string;
2235
+ search?: string;
2236
+ } | null | undefined): ContentRef;
2237
+
2238
+ /**
2239
+ * Slots — the pure half of ADR-0027 / ADR-0034 on the web.
2240
+ *
2241
+ * A slot is a NAME for a place on a page. The page declares its slots to the
2242
+ * campaigns service (`Vio.declareSlots()` / `Vio.registerSlot()` in client.ts),
2243
+ * the dashboard assigns a campaign to each one, optionally with a date window,
2244
+ * and `GET /v2/mobile/config` answers with `campaigns[].slots[]` — only the
2245
+ * assignments whose window is open NOW. Whatever no slot names shows the
2246
+ * surface's default campaign (`campaign`).
2247
+ *
2248
+ * Everything here is side-effect free and never throws on a malformed
2249
+ * bootstrap: a broken `campaigns[]` must never blank a product block or break
2250
+ * `track()`.
2251
+ */
2252
+
2253
+ /** What `Vio.declareSlots()` accepts per slot. */
2254
+ type SlotInput = string | {
2255
+ id: string;
2256
+ displayName?: string;
2257
+ };
2258
+ type BootLike = Pick<BootstrapResponse, 'campaign' | 'campaigns' | 'primarySponsor' | 'secondarySponsors'>;
2259
+ /**
2260
+ * The campaign a slot shows right now. Among the `status === 'active'`
2261
+ * entries of `campaigns[]`, the one with an assignment named `slot` for this
2262
+ * platform (`platform` null on the assignment, or equal to `platform`) whose
2263
+ * window contains `now` (`startDate <= now < endDate`, null = open). When
2264
+ * several qualify, the surface's default campaign wins, else the first the
2265
+ * backend lists.
2266
+ *
2267
+ * No slot, or no assignment → the default campaign: the `campaigns[]` entry
2268
+ * whose id is `campaign.id`, or a minimal entry built from `campaign` (+ the
2269
+ * top-level sponsors) when the list does not carry it. No bootstrap → null.
2270
+ */
2271
+ declare function resolveSlotCampaign(boot: BootLike | null | undefined, slot: string | null | undefined, now?: number, platform?: string | null): BootstrapCampaignEntry | null;
2272
+ /** The kinds of Vio element that register themselves. */
2273
+ type SlotKind = 'card' | 'carousel' | 'detail';
2274
+ /**
2275
+ * The id an element gets when the host set no `vio-slot`:
2276
+ * `${scope ? scope + '-' : ''}${kind}-${ordinal + 1}` (`carousel-1`, `card-3`,
2277
+ * `article-123-carousel-1`), `ordinal` being the element's index among the
2278
+ * same-kind Vio elements WITH THE SAME SCOPE, in document order at connect
2279
+ * time. The scope is inherited from the DOM (`vio-scope` on the element, else
2280
+ * the nearest `data-vio-scope` ancestor): a Vev page or a Replit article
2281
+ * (`<body data-vio-scope="article-123">`) gets per-page slots with one line
2282
+ * and no per-element naming; a template that wants slots shared across
2283
+ * articles simply sets no scope. On purpose there is NO page path in the id:
2284
+ * the article goes to analytics as `content_id`, not into the slot. Stable
2285
+ * across reloads while the layout is; a layout change leaves a stale entry,
2286
+ * which ADR-0034 accepts.
2287
+ */
2288
+ declare function autoSlotId(kind: SlotKind, ordinal: number, scope?: string | null): string;
2289
+ /** `"Carousel 1"`, `"Card 3"` — with ` · ${scopeName}` when the scope has a human label. */
2290
+ declare function autoSlotDisplayName(kind: SlotKind, ordinal: number, scopeName?: string | null): string;
2291
+ /** A scope value fit for an id: trimmed, inner whitespace → `-`. */
2292
+ declare function normalizeScope(scope: string | null | undefined): string;
2293
+
2294
+ /**
2295
+ * The cart split per campaign (ADR-0034) — ONE rule, shared by the SDK's own
2296
+ * `begin_checkout` / `purchase` events, by `Vio.cartSlices()` and so by any
2297
+ * host with its own analytics sink (Vev).
2298
+ *
2299
+ * Every unit of every line goes to the campaign of its origin — the one the
2300
+ * place showed when it was added — and units without one to the campaign the
2301
+ * caller's rule resolves for the line's sponsor (`resolveCampaign`). One slice
2302
+ * per campaign: its items (quantities from the origins, merged per product +
2303
+ * variant), its value with two decimals, and `slot` / `contentId` /
2304
+ * `sponsorId` only when they are the same for the whole slice. A cart with
2305
+ * one campaign is one slice. Pure; never throws on odd lines.
2306
+ */
2307
+
2308
+ /** An item of a slice — the analytics item shape (ids as given, normalized on the wire). */
2309
+ type VioItem = AnalyticsItemInput;
2310
+ /** One campaign's share of the cart. */
2311
+ interface CartSlice {
2312
+ campaignId?: number;
2313
+ sponsorId?: number;
2314
+ slot?: string;
2315
+ contentId?: string;
2316
+ items: VioItem[];
2317
+ value: number;
2318
+ currency?: string;
2319
+ /** 1-based position of this slice and how many there are. */
2320
+ slice: number;
2321
+ slices: number;
2322
+ }
2323
+ /** The campaign of a unit without an explicit one: the caller's rule (slot assignment → sponsor → default). */
2324
+ type ResolveCampaign = (slot: string | undefined, sponsorId: number) => number | undefined;
2325
+ declare function cartSlicesFrom(lines: ReadonlyArray<CartLineItem>, resolveCampaign: ResolveCampaign, fallbackCurrency?: string): CartSlice[];
2326
+
1990
2327
  declare class VioFacade {
1991
2328
  private apiInstance;
1992
2329
  private commerceClients;
@@ -1999,10 +2336,31 @@ declare class VioFacade {
1999
2336
  * (another key or environment) is still in flight after a re-init; its answer
2000
2337
  * belongs to that configuration and must not land in this one. */
2001
2338
  private generation;
2339
+ /** Slot ids present on the page (`Vio.registerSlot`): how many elements hold each + its display name. */
2340
+ private slotRegistry;
2341
+ /** Pending debounced declaration of the registry. */
2342
+ private slotDeclareTimer;
2343
+ /** A name appeared (or the key changed) since the registry was last declared. */
2344
+ private slotsDirty;
2345
+ /** Manifests POSTed by this page load (abuse / rollout guard, see declareSlots). */
2346
+ private declarationsThisLoad;
2347
+ /** Each cap warns once per page load. */
2348
+ private warnedLocationCap;
2349
+ private warnedDeclarationCap;
2002
2350
  private cartManager;
2003
2351
  private checkoutManager;
2004
2352
  private analyticsManager;
2005
2353
  init(config: VioConfig): void;
2354
+ /**
2355
+ * The content (article, page) this SDK instance is rendered in — what every
2356
+ * analytics event carries as `content_id` / `content_title` when the event
2357
+ * has no explicit one: init option → URL query → `vio:content-*` metas →
2358
+ * canonical/og:url → pathname (see `resolveContent`). Resolved LIVE on each
2359
+ * call — a few querySelectors — so an SPA route change, a new canonical or
2360
+ * a new title are seen without any re-init. Never throws; `{}` without a
2361
+ * document.
2362
+ */
2363
+ content(): ContentRef;
2006
2364
  get isInitialized(): boolean;
2007
2365
  get config(): ResolvedConfig;
2008
2366
  /** Multi-sponsor cart manager. Reactive — listen via addEventListener('change', ...). */
@@ -2034,6 +2392,63 @@ declare class VioFacade {
2034
2392
  commerceFor(sponsorId: number): CommerceClient;
2035
2393
  /** Get a CommerceClient using an explicit commerce apiKey (skip bootstrap). */
2036
2394
  commerceWithKey(commerceApiKey: string): CommerceClient;
2395
+ /**
2396
+ * Declare this page's slots to the campaigns service
2397
+ * (`POST /v2/mobile/components/manifest`, `mode: 'merge'`, the init
2398
+ * platform). Best-effort: it NEVER throws — a failure is logged and resolves
2399
+ * `null`. The same set is not re-posted from this browser for 24 h unless
2400
+ * `force` (then `null` also means "skipped, already declared"). Ids are
2401
+ * trimmed, cut at 100 chars, deduped; empties are dropped.
2402
+ */
2403
+ declareSlots(slots: ReadonlyArray<SlotInput>, opts?: {
2404
+ force?: boolean;
2405
+ }): Promise<ManifestResult | null>;
2406
+ /**
2407
+ * Register a slot present on the page (the `<vio-*>` elements call it with
2408
+ * their effective id — the host's `vio-slot` or the auto-generated one —
2409
+ * and the optional display name). The registry is declared ONCE, debounced,
2410
+ * after the first successful bootstrap — and again whenever a new id or a
2411
+ * new display name appears. A `displayName` given later for an id already
2412
+ * registered replaces the one kept; `undefined` leaves it alone. The
2413
+ * returned function unregisters; removal never re-declares.
2414
+ */
2415
+ registerSlot(name: string, displayName?: string): () => void;
2416
+ /**
2417
+ * The campaign a slot shows now, from the last bootstrap: its assigned and
2418
+ * open campaign for the init platform, else the surface's default. With no
2419
+ * slot, the default. `null` before the bootstrap. See `resolveSlotCampaign`.
2420
+ */
2421
+ campaignForSlot(slot?: string | null): BootstrapCampaignEntry | null;
2422
+ /**
2423
+ * THE attribution helper — the SDK elements, Vev and Replit all use this
2424
+ * one. For a place (`slot`): the campaign it shows right now
2425
+ * (`campaignForSlot`: its assignment, else the surface's default) as
2426
+ * `campaignId` + that campaign's primary sponsor as `sponsorId`, plus the
2427
+ * page's content (`content()`). Pure, never throws; `{}` before the
2428
+ * bootstrap, except the content.
2429
+ *
2430
+ * `hint.sponsorId` — when the caller already knows the sponsor (a card with
2431
+ * `sponsor-id`) it is kept as `sponsorId`, and the campaign follows the same
2432
+ * cascade analytics uses (slot assignment → the sponsor's active campaign →
2433
+ * default), so what the cart remembers matches what the events say.
2434
+ */
2435
+ attribution(slot?: string | null, hint?: {
2436
+ sponsorId?: number | string;
2437
+ }): Attribution;
2438
+ /**
2439
+ * The cart split per campaign — the SAME rule `begin_checkout` / `purchase`
2440
+ * use, for hosts with their own analytics sink (Vev). Every unit of every
2441
+ * line goes to the campaign of its origin; units without one to the campaign
2442
+ * the current rule resolves for the line's sponsor (slot assignment → the
2443
+ * sponsor's active campaign → default); `slot` / `contentId` / `sponsorId`
2444
+ * only when they are the same for the whole slice; `value` with two
2445
+ * decimals; `slice` / `slices` number the parts. Pure over the current cart
2446
+ * (or over `opts.items`); `[]` when there is nothing.
2447
+ */
2448
+ cartSlices(sponsorId?: number, opts?: {
2449
+ items?: CartLineItem[];
2450
+ }): CartSlice[];
2451
+ private scheduleSlotDeclaration;
2037
2452
  private findSponsor;
2038
2453
  }
2039
2454
  declare const Vio: VioFacade;
@@ -2045,7 +2460,7 @@ declare const Vio: VioFacade;
2045
2460
  *
2046
2461
  * RELEASE CHECKLIST: bump together with package.json (see CONTRIBUTING).
2047
2462
  */
2048
- declare const SDK_VERSION = "0.21.0";
2463
+ declare const SDK_VERSION = "0.23.1";
2049
2464
 
2050
2465
  /**
2051
2466
  * Vipps MobilePay's own button, the way the design guidelines ask for it.
@@ -2074,4 +2489,4 @@ declare function vippsButtonAttributes(verb?: 'buy' | 'pay' | 'express' | 'conti
2074
2489
  language?: string;
2075
2490
  }): Record<string, string>;
2076
2491
 
2077
- export { ADD_ITEM_MUTATION, type AddManualOptions, type AddProductOptions, type AnalyticsCommerce, type AnalyticsContext, type AnalyticsEventName, type AnalyticsItemInput, AnalyticsManager, type AnalyticsStartOptions, type ApplePayConfig, type ApplePayResult, type BootstrapCampaign, type BootstrapCampaignEntry, type BootstrapCampaignStatus, type BootstrapResponse, type BootstrapSlot, CREATE_CART_MUTATION, CREATE_CHECKOUT_MUTATION, CREATE_PAYMENT_STRIPE_MUTATION, CREATE_PAYMENT_VIPPS_MUTATION, type CartChangeDetail, type CartLineItem, CartManager, type CartQueryOptions, type CheckoutAddress, type CheckoutChangeDetail, CheckoutManager, type CheckoutState, CommerceClient, Configuration, type CreatePaymentVippsResponse, type CreatePaymentVippsVariables, DELETE_ITEM_MUTATION, type Environment, GET_AVAILABLE_PAYMENT_METHODS_QUERY, GET_CART_QUERY, GET_CHECKOUT_QUERY, GET_LINE_ITEMS_BY_SUPPLIER_QUERY, GET_VIPPS_STATUS_QUERY, type GetVippsStatusVariables, type ImageSize, type PaymentCompleteDetail, type PaymentMethod, type PaymentSelectDetail, type PaymentSuccessDetail, type PaymentSuccessResult, type PlacementComponent, type Product, type ProductCategory, type ProductImage, type ProductOption, type ProductPrice, type ProductVariant, type ResolvedConfig, SDK_VERSION, type Sponsor, type SponsorCartState, type SponsorCommerceBlock, type TrackOptions, UPDATE_CHECKOUT_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, VIPPS_BUTTON_SCRIPT, VIPPS_BUTTON_TAG, Vio, VioApi, VioApiError, type VioConfig, type VippsPaymentState, type VippsStatusResult, addItem, checkApplePayAvailability, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, ensureVippsButton, executeCartGraphQL, formatPrice, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, primaryImageUrl, purchaseFromPaymentSuccess, resolveCampaignId, showApplePaySheet, updateCheckout, updateItem, updateShippingsBySupplier, vippsButtonAttributes };
2492
+ export { ADD_ITEM_MUTATION, type AddManualOptions, type AddProductOptions, type AnalyticsCommerce, type AnalyticsContext, type AnalyticsEventName, type AnalyticsItemInput, AnalyticsManager, type AnalyticsStartOptions, type ApplePayConfig, type ApplePayResult, type Attribution, type BootstrapCampaign, type BootstrapCampaignEntry, type BootstrapCampaignStatus, type BootstrapResponse, type BootstrapSlot, CREATE_CART_MUTATION, CREATE_CHECKOUT_MUTATION, CREATE_PAYMENT_STRIPE_MUTATION, CREATE_PAYMENT_VIPPS_MUTATION, type CartChangeDetail, type CartLineItem, type CartLineOrigin, CartManager, type CartOrigin, type CartQueryOptions, type CartSlice, type CheckoutAddress, type CheckoutChangeDetail, CheckoutManager, type CheckoutState, CommerceClient, Configuration, type ContentRef, type CreatePaymentVippsResponse, type CreatePaymentVippsVariables, DELETE_ITEM_MUTATION, type Environment, GET_AVAILABLE_PAYMENT_METHODS_QUERY, GET_CART_QUERY, GET_CHECKOUT_QUERY, GET_LINE_ITEMS_BY_SUPPLIER_QUERY, GET_VIPPS_STATUS_QUERY, type GetVippsStatusVariables, type ImageSize, type ManifestLocation, type ManifestRequest, type ManifestResult, type PaymentCompleteDetail, type PaymentMethod, type PaymentSelectDetail, type PaymentSuccessDetail, type PaymentSuccessResult, type PlacementComponent, type Product, type ProductCategory, type ProductImage, type ProductOption, type ProductPrice, type ProductVariant, type ResolvedConfig, SDK_VERSION, type SlotInput, type SlotKind, type Sponsor, type SponsorCartState, type SponsorCommerceBlock, type TrackOptions, UPDATE_CHECKOUT_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, VIPPS_BUTTON_SCRIPT, VIPPS_BUTTON_TAG, Vio, VioApi, VioApiError, type VioConfig, type VioItem, type VioPlatform, type VippsPaymentState, type VippsStatusResult, addItem, autoSlotDisplayName, autoSlotId, cartSlicesFrom, checkApplePayAvailability, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, ensureVippsButton, executeCartGraphQL, formatPrice, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, lineOrigins, normalizeOrigin, normalizeScope, primaryImageUrl, purchaseFromPaymentSuccess, resolveCampaignId, resolveContent, resolveSlotCampaign, sameOrigin, showApplePaySheet, updateCheckout, updateItem, updateShippingsBySupplier, vippsButtonAttributes };
@@ -1,4 +1,4 @@
1
- import '../chunk-PZUOMOLF.js';
2
- export { ADD_ITEM_MUTATION, AnalyticsManager, CREATE_CART_MUTATION, CREATE_CHECKOUT_MUTATION, CREATE_PAYMENT_STRIPE_MUTATION, CREATE_PAYMENT_VIPPS_MUTATION, CartManager, CheckoutManager, CommerceClient, Configuration, DELETE_ITEM_MUTATION, GET_AVAILABLE_PAYMENT_METHODS_QUERY, GET_CART_QUERY, GET_CHECKOUT_QUERY, GET_LINE_ITEMS_BY_SUPPLIER_QUERY, GET_VIPPS_STATUS_QUERY, SDK_VERSION, UPDATE_CHECKOUT_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, VIPPS_BUTTON_SCRIPT, VIPPS_BUTTON_TAG, Vio, VioApi, VioApiError, addItem, checkApplePayAvailability, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, ensureVippsButton, executeCartGraphQL, formatPrice, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, primaryImageUrl, purchaseFromPaymentSuccess, resolveCampaignId, showApplePaySheet, updateCheckout, updateItem, updateShippingsBySupplier, vippsButtonAttributes } from '../chunk-WTVGVDZX.js';
1
+ import '../chunk-45YKS5UG.js';
2
+ export { ADD_ITEM_MUTATION, AnalyticsManager, CREATE_CART_MUTATION, CREATE_CHECKOUT_MUTATION, CREATE_PAYMENT_STRIPE_MUTATION, CREATE_PAYMENT_VIPPS_MUTATION, CartManager, CheckoutManager, CommerceClient, Configuration, DELETE_ITEM_MUTATION, GET_AVAILABLE_PAYMENT_METHODS_QUERY, GET_CART_QUERY, GET_CHECKOUT_QUERY, GET_LINE_ITEMS_BY_SUPPLIER_QUERY, GET_VIPPS_STATUS_QUERY, SDK_VERSION, UPDATE_CHECKOUT_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, VIPPS_BUTTON_SCRIPT, VIPPS_BUTTON_TAG, Vio, VioApi, VioApiError, addItem, autoSlotDisplayName, autoSlotId, cartSlicesFrom, checkApplePayAvailability, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, ensureVippsButton, executeCartGraphQL, formatPrice, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, lineOrigins, normalizeOrigin, normalizeScope, primaryImageUrl, purchaseFromPaymentSuccess, resolveCampaignId, resolveContent, resolveSlotCampaign, sameOrigin, showApplePaySheet, updateCheckout, updateItem, updateShippingsBySupplier, vippsButtonAttributes } from '../chunk-BRJMT7P4.js';
3
3
  //# sourceMappingURL=index.js.map
4
4
  //# sourceMappingURL=index.js.map
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { ADD_ITEM_MUTATION, AddManualOptions, AddProductOptions, AnalyticsCommerce, AnalyticsContext, AnalyticsEventName, AnalyticsItemInput, AnalyticsManager, AnalyticsStartOptions, ApplePayConfig, ApplePayResult, BootstrapCampaign, BootstrapCampaignEntry, BootstrapCampaignStatus, BootstrapResponse, BootstrapSlot, CREATE_CART_MUTATION, CREATE_CHECKOUT_MUTATION, CREATE_PAYMENT_STRIPE_MUTATION, CREATE_PAYMENT_VIPPS_MUTATION, CartChangeDetail, CartLineItem, CartManager, CartQueryOptions, CheckoutAddress, CheckoutChangeDetail, CheckoutManager, CheckoutState, CommerceClient, Configuration, CreatePaymentVippsResponse, CreatePaymentVippsVariables, DELETE_ITEM_MUTATION, Environment, GET_AVAILABLE_PAYMENT_METHODS_QUERY, GET_CART_QUERY, GET_CHECKOUT_QUERY, GET_LINE_ITEMS_BY_SUPPLIER_QUERY, GET_VIPPS_STATUS_QUERY, GetVippsStatusVariables, ImageSize, PaymentCompleteDetail, PaymentMethod, PaymentSelectDetail, PaymentSuccessDetail, PaymentSuccessResult, PlacementComponent, Product, ProductCategory, ProductImage, ProductOption, ProductPrice, ProductVariant, ResolvedConfig, SDK_VERSION, Sponsor, SponsorCartState, SponsorCommerceBlock, TrackOptions, UPDATE_CHECKOUT_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, VIPPS_BUTTON_SCRIPT, VIPPS_BUTTON_TAG, Vio, VioApi, VioApiError, VioConfig, VippsPaymentState, VippsStatusResult, addItem, checkApplePayAvailability, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, ensureVippsButton, executeCartGraphQL, formatPrice, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, primaryImageUrl, purchaseFromPaymentSuccess, resolveCampaignId, showApplePaySheet, updateCheckout, updateItem, updateShippingsBySupplier, vippsButtonAttributes } from './core/index.js';
1
+ export { ADD_ITEM_MUTATION, AddManualOptions, AddProductOptions, AnalyticsCommerce, AnalyticsContext, AnalyticsEventName, AnalyticsItemInput, AnalyticsManager, AnalyticsStartOptions, ApplePayConfig, ApplePayResult, Attribution, BootstrapCampaign, BootstrapCampaignEntry, BootstrapCampaignStatus, BootstrapResponse, BootstrapSlot, CREATE_CART_MUTATION, CREATE_CHECKOUT_MUTATION, CREATE_PAYMENT_STRIPE_MUTATION, CREATE_PAYMENT_VIPPS_MUTATION, CartChangeDetail, CartLineItem, CartLineOrigin, CartManager, CartOrigin, CartQueryOptions, CartSlice, CheckoutAddress, CheckoutChangeDetail, CheckoutManager, CheckoutState, CommerceClient, Configuration, ContentRef, CreatePaymentVippsResponse, CreatePaymentVippsVariables, DELETE_ITEM_MUTATION, Environment, GET_AVAILABLE_PAYMENT_METHODS_QUERY, GET_CART_QUERY, GET_CHECKOUT_QUERY, GET_LINE_ITEMS_BY_SUPPLIER_QUERY, GET_VIPPS_STATUS_QUERY, GetVippsStatusVariables, ImageSize, ManifestLocation, ManifestRequest, ManifestResult, PaymentCompleteDetail, PaymentMethod, PaymentSelectDetail, PaymentSuccessDetail, PaymentSuccessResult, PlacementComponent, Product, ProductCategory, ProductImage, ProductOption, ProductPrice, ProductVariant, ResolvedConfig, SDK_VERSION, SlotInput, SlotKind, Sponsor, SponsorCartState, SponsorCommerceBlock, TrackOptions, UPDATE_CHECKOUT_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, VIPPS_BUTTON_SCRIPT, VIPPS_BUTTON_TAG, Vio, VioApi, VioApiError, VioConfig, VioItem, VioPlatform, VippsPaymentState, VippsStatusResult, addItem, autoSlotDisplayName, autoSlotId, cartSlicesFrom, checkApplePayAvailability, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, ensureVippsButton, executeCartGraphQL, formatPrice, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, lineOrigins, normalizeOrigin, normalizeScope, primaryImageUrl, purchaseFromPaymentSuccess, resolveCampaignId, resolveContent, resolveSlotCampaign, sameOrigin, showApplePaySheet, updateCheckout, updateItem, updateShippingsBySupplier, vippsButtonAttributes } from './core/index.js';
2
2
  import 'graphql-request';
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import './chunk-PZUOMOLF.js';
2
- export { ADD_ITEM_MUTATION, AnalyticsManager, CREATE_CART_MUTATION, CREATE_CHECKOUT_MUTATION, CREATE_PAYMENT_STRIPE_MUTATION, CREATE_PAYMENT_VIPPS_MUTATION, CartManager, CheckoutManager, CommerceClient, Configuration, DELETE_ITEM_MUTATION, GET_AVAILABLE_PAYMENT_METHODS_QUERY, GET_CART_QUERY, GET_CHECKOUT_QUERY, GET_LINE_ITEMS_BY_SUPPLIER_QUERY, GET_VIPPS_STATUS_QUERY, SDK_VERSION, UPDATE_CHECKOUT_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, VIPPS_BUTTON_SCRIPT, VIPPS_BUTTON_TAG, Vio, VioApi, VioApiError, addItem, checkApplePayAvailability, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, ensureVippsButton, executeCartGraphQL, formatPrice, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, primaryImageUrl, purchaseFromPaymentSuccess, resolveCampaignId, showApplePaySheet, updateCheckout, updateItem, updateShippingsBySupplier, vippsButtonAttributes } from './chunk-WTVGVDZX.js';
1
+ import './chunk-45YKS5UG.js';
2
+ export { ADD_ITEM_MUTATION, AnalyticsManager, CREATE_CART_MUTATION, CREATE_CHECKOUT_MUTATION, CREATE_PAYMENT_STRIPE_MUTATION, CREATE_PAYMENT_VIPPS_MUTATION, CartManager, CheckoutManager, CommerceClient, Configuration, DELETE_ITEM_MUTATION, GET_AVAILABLE_PAYMENT_METHODS_QUERY, GET_CART_QUERY, GET_CHECKOUT_QUERY, GET_LINE_ITEMS_BY_SUPPLIER_QUERY, GET_VIPPS_STATUS_QUERY, SDK_VERSION, UPDATE_CHECKOUT_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, VIPPS_BUTTON_SCRIPT, VIPPS_BUTTON_TAG, Vio, VioApi, VioApiError, addItem, autoSlotDisplayName, autoSlotId, cartSlicesFrom, checkApplePayAvailability, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, ensureVippsButton, executeCartGraphQL, formatPrice, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, lineOrigins, normalizeOrigin, normalizeScope, primaryImageUrl, purchaseFromPaymentSuccess, resolveCampaignId, resolveContent, resolveSlotCampaign, sameOrigin, showApplePaySheet, updateCheckout, updateItem, updateShippingsBySupplier, vippsButtonAttributes } from './chunk-BRJMT7P4.js';
3
3
  //# sourceMappingURL=index.js.map
4
4
  //# sourceMappingURL=index.js.map