@vio-live/web-sdk 0.11.0 → 0.19.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.
@@ -1,4 +1,4 @@
1
- import '../chunk-QYQQ5J6E.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, Vio, VioApi, VioApiError, addItem, checkApplePayAvailability, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, executeCartGraphQL, formatPrice, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, primaryImageUrl, showApplePaySheet, updateCheckout, updateItem, updateShippingsBySupplier } from '../chunk-U2QG4IVJ.js';
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, showApplePaySheet, updateCheckout, updateItem, updateShippingsBySupplier, vippsButtonAttributes } from '../chunk-CMNTHF66.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, BootstrapResponse, 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, 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, Vio, VioApi, VioApiError, VioConfig, VippsPaymentState, VippsStatusResult, addItem, checkApplePayAvailability, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, executeCartGraphQL, formatPrice, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, primaryImageUrl, showApplePaySheet, updateCheckout, updateItem, updateShippingsBySupplier } from './core/index.js';
1
+ export { ADD_ITEM_MUTATION, AddManualOptions, AddProductOptions, AnalyticsCommerce, AnalyticsContext, AnalyticsEventName, AnalyticsItemInput, AnalyticsManager, AnalyticsStartOptions, ApplePayConfig, ApplePayResult, BootstrapResponse, 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, 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, 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-QYQQ5J6E.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, Vio, VioApi, VioApiError, addItem, checkApplePayAvailability, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, executeCartGraphQL, formatPrice, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, primaryImageUrl, showApplePaySheet, updateCheckout, updateItem, updateShippingsBySupplier } from './chunk-U2QG4IVJ.js';
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, showApplePaySheet, updateCheckout, updateItem, updateShippingsBySupplier, vippsButtonAttributes } from './chunk-CMNTHF66.js';
3
3
  //# sourceMappingURL=index.js.map
4
4
  //# sourceMappingURL=index.js.map
@@ -1,6 +1,6 @@
1
1
  import * as _lit_react from '@lit/react';
2
- import { V as VioCart$1, a as VioCheckout$1, b as VioProduct$1, c as VioProductCarousel$1, d as VioProductDetail$1 } from '../tokens-D6PBisUm.js';
3
- export { e as VioThemeOverrides, f as VioTokens, g as applyVioTheme } from '../tokens-D6PBisUm.js';
2
+ import { V as VioCart$1, a as VioCheckout$1, b as VioProduct$1, c as VioProductCarousel$1, d as VioProductDetail$1 } from '../tokens-IrVSMVcA.js';
3
+ export { e as VioThemeOverrides, f as VioTokens, g as applyVioTheme } from '../tokens-IrVSMVcA.js';
4
4
  import 'lit-html';
5
5
  import 'lit';
6
6
 
@@ -1,6 +1,6 @@
1
- import { registerVioElements, VioProduct, VioProductCarousel, VioProductDetail, VioCart, VioCheckout } from '../chunk-XU5LGUBU.js';
2
- export { VioTokens, applyVioTheme } from '../chunk-XU5LGUBU.js';
3
- import '../chunk-U2QG4IVJ.js';
1
+ import { registerVioElements, VioProduct, VioProductCarousel, VioProductDetail, VioCart, VioCheckout } from '../chunk-NUNGU6LL.js';
2
+ export { VioTokens, applyVioTheme } from '../chunk-NUNGU6LL.js';
3
+ import '../chunk-CMNTHF66.js';
4
4
  import * as React from 'react';
5
5
 
6
6
  // node_modules/@lit/react/node/create-component.js
@@ -119,6 +119,14 @@ declare class VioProductDetail extends LitElement {
119
119
  autoOpen: boolean;
120
120
  currency: string;
121
121
  private product;
122
+ /**
123
+ * The header: the seller's Company name (Settings → Company), not the
124
+ * product's brand, which the body already shows (Angelo, 2026-10-08).
125
+ * Asked on its own after the product; until it answers the header waits,
126
+ * and if there is none it falls back to the brand.
127
+ */
128
+ private sellerName;
129
+ private sellerSettled;
122
130
  private isLoading;
123
131
  private fetchError;
124
132
  private selectedOptions;
@@ -130,6 +138,7 @@ declare class VioProductDetail extends LitElement {
130
138
  /** Payment method names enabled for the sponsor (backend-configured).
131
139
  * null = not loaded yet → all buy buttons render; [] = none enabled. */
132
140
  private availableMethods;
141
+ private vippsOfficial;
133
142
  /** Race guard: only the latest fetch may write state (two quick taps on
134
143
  * different cards would otherwise let the slow response win). */
135
144
  private fetchSeq;
@@ -196,7 +205,31 @@ declare class VioProductDetail extends LitElement {
196
205
  */
197
206
  private buyWithKlarna;
198
207
  /** Buy with Vipps — opens the checkout with Vipps preselected. */
208
+ /**
209
+ * Buy now with an embedded checkout (Kustom, Qliro, Walley).
210
+ *
211
+ * Those three have no express path of their own, so the product page showed
212
+ * a "Kjøp nå" for Apple Pay, Stripe, Klarna and Vipps and nothing at all for
213
+ * them — the same structural gap the cart footer had. Opens the checkout
214
+ * without preselecting: with a single method the checkout selects it itself,
215
+ * with several the shopper picks.
216
+ *
217
+ * Like every other "Kjøp nå" here, it adds to the cart first — so a cart
218
+ * that already had items buys those too. Isolating a single-product purchase
219
+ * needs a checkout that is not bound to the sponsor's cart, which is a
220
+ * separate piece of work and deliberately not done here.
221
+ */
222
+ private buyNow;
223
+ /**
224
+ * Buy with Vipps — Express: the app opens with address and delivery
225
+ * already there, nothing to fill in here (Vipps' own recommendation,
226
+ * 2026-09-29). When this cart cannot have Express, or Vipps cannot be
227
+ * started, the checkout opens with Vipps preselected, as before.
228
+ */
229
+ /** Vipps' own button when its script answers; our orange one otherwise. */
230
+ private loadVippsButton;
199
231
  private buyWithVipps;
232
+ private startVippsExpressOrCheckout;
200
233
  /** Buy with Stripe — opens the checkout with Stripe preselected. */
201
234
  private buyWithStripe;
202
235
  /**
@@ -206,6 +239,9 @@ declare class VioProductDetail extends LitElement {
206
239
  * confirmation drawer (same path as the in-checkout Apple Pay button).
207
240
  */
208
241
  private buyWithApplePay;
242
+ /** The seller's Company name; the brand when there is none; nothing while asking. */
243
+ private headerName;
244
+ private loadSeller;
209
245
  render(): lit_html.TemplateResult<1>;
210
246
  private renderBody;
211
247
  private renderOptionPickers;
@@ -231,6 +267,9 @@ declare class VioCart extends LitElement {
231
267
  /** Payment method names enabled for the sponsor (backend-configured).
232
268
  * null = not loaded yet → all buttons render; [] = none enabled. */
233
269
  private availableMethods;
270
+ private vippsOfficial;
271
+ /** Whether the method lookup has been attempted — see boundOnCartChange. */
272
+ private paymentMethodsAttempted;
234
273
  /** Set after an Apple Pay express purchase — switches the drawer to the
235
274
  * confirmation screen (so the rest of the cart/checkout is not shown). */
236
275
  private confirmedOrder;
@@ -264,7 +303,25 @@ declare class VioCart extends LitElement {
264
303
  * opens <vio-checkout> in express mode with Klarna preselected. */
265
304
  private onKlarnaExpress;
266
305
  /** Vipps — opens the checkout with Vipps preselected. */
306
+ /**
307
+ * Open the checkout without preselecting a method.
308
+ *
309
+ * The footer used to be express-only — Apple Pay, Stripe, Klarna, Vipps —
310
+ * so a channel offering just an embedded checkout (Kustom, Qliro, Walley)
311
+ * had NO button at all and the cart was a dead end. Even with an express
312
+ * method present the others were unreachable from here.
313
+ */
314
+ private onCheckout;
315
+ /**
316
+ * Vipps — Express: the app collects address and delivery, so the cart
317
+ * goes straight to Vipps. When this cart cannot have Express (several
318
+ * suppliers, digital goods, no rate) or Vipps cannot be started, the
319
+ * checkout opens with Vipps preselected, as before.
320
+ */
267
321
  private onVipps;
322
+ /** Vipps' own button when its script answers; our orange one otherwise. */
323
+ private loadVippsButton;
324
+ private startVippsExpressOrCheckout;
268
325
  /** Stripe — opens the checkout with Stripe preselected. */
269
326
  private onStripe;
270
327
  private get totalAcrossSponsors();
@@ -293,10 +350,26 @@ declare class VioCheckout extends LitElement {
293
350
  private applePayInProgress;
294
351
  private klarnaAvailable;
295
352
  private orderConfirmed;
353
+ /**
354
+ * The embedded provider whose OWN receipt is on screen after a completed
355
+ * purchase (Qliro, Walley). Set instead of `orderConfirmed`: when the
356
+ * provider renders a receipt, that is the one the shopper sees, not ours
357
+ * (Angelo, 2026-09-15). See showProviderReceipt.
358
+ */
359
+ private providerReceipt;
296
360
  private confirmedMethod;
297
361
  private paymentError;
298
362
  /** Neutral (non-error) status line: "verifying payment…" / "still processing". */
299
363
  private paymentNotice;
364
+ /**
365
+ * Back from a payment page and asking whether it was paid. While set, the
366
+ * drawer shows only this — never the checkout behind it: a form you can
367
+ * type into, and a "Betal" you can press, for a purchase that may already
368
+ * be paid (Angelo, 2026-10-08; Vipps can take two minutes to answer).
369
+ */
370
+ private verifyingReturn;
371
+ /** The checkout whose confirmation is on screen — see fillOrderNumber. */
372
+ private confirmedCheckoutId;
300
373
  /** Snapshot of the placed order, for the confirmation screen. */
301
374
  private confirmedOrder;
302
375
  /** Active Klarna Payments widget handle + the subtotal it was mounted for. */
@@ -315,22 +388,130 @@ declare class VioCheckout extends LitElement {
315
388
  /** Payment method names enabled for the sponsor (backend-configured).
316
389
  * null = not loaded yet → all buttons render; [] = none enabled. */
317
390
  private availableMethods;
391
+ private vippsOfficial;
318
392
  private kustomMounting;
393
+ /** The widget is being told about a cart change (suspend → sync → resume). */
394
+ private kustomSyncing;
395
+ /** What the widget shows: the rate picked inside it and its total (major). */
396
+ private kustomShipping;
397
+ private kustomTotal;
398
+ private kustomNotice;
399
+ /** The cart the mounted Kustom order describes — see kustomCartKey. */
400
+ private kustomMountedKey;
319
401
  private kustomMountedOrderId;
402
+ /** The checkout session (see embedSession) each embedded widget's order belongs to. */
403
+ private kustomMountedFor;
404
+ private qliroMountedFor;
405
+ private walleyMountedFor;
406
+ private nexiMountedFor;
320
407
  private qliroMounting;
321
408
  private qliroMountedOrderId;
322
409
  private walleyMounting;
323
410
  private walleyMountedOrderId;
411
+ private nexiMounting;
412
+ private nexiMountedOrderId;
413
+ /** What Nexi's shipping re-pricing last said, shown under the widget. */
414
+ private nexiShippingNotice;
415
+ /** Nexi's last re-pricing: the rate on the payment and the ones to pick from. */
416
+ private nexiShipping;
417
+ /** A picked rate is being pushed to the payment. */
418
+ private nexiPicking;
419
+ /** The Nexi payment to resume on the next mount — set only by the ?paymentId= return. */
420
+ private nexiResumePaymentId;
421
+ private adyenMounting;
422
+ /**
423
+ * The shopper ASKED for the payment step (chose the method, or pressed the
424
+ * panel's button). Adyen needs our form first, so nothing creates a session
425
+ * while they are still typing: a session is a photo of a finished form.
426
+ */
427
+ private adyenRequested;
428
+ /** Drop-in is on screen. */
429
+ private adyenMounted;
430
+ /** The form, the shipping or the cart changed under a mounted session. */
431
+ private adyenStale;
432
+ /** Paid or pending in this opening: never offer to pay again. */
433
+ private adyenSettled;
434
+ /** The checkout session (see embedSession) and the purchase the mounted photo is of. */
435
+ private adyenMountedFor;
436
+ private adyenMountedKey;
437
+ /**
438
+ * Which Stripe this channel offers: `native` pays with Stripe's Payment
439
+ * Element on THIS page, `link` sends the shopper to a page hosted by
440
+ * Stripe. It travels in the method's config and is resolved with the
441
+ * method list; null means "not known yet", and the pay button asks.
442
+ */
443
+ private stripeMode;
444
+ /** The shopper asked for the payment step (see adyenRequested). */
445
+ private stripeRequested;
446
+ private stripeMounting;
447
+ /** The Payment Element is on screen. */
448
+ private stripeMounted;
449
+ /** The form, the shipping or the cart changed under a mounted Element. */
450
+ private stripeStale;
451
+ /** Paid or pending in this opening: never offer to pay again. */
452
+ private stripeSettled;
453
+ /** Stripe is confirming right now — one press, not two. */
454
+ private stripePaying;
455
+ /** Stripe has PAINTED its form: until then the panel says it is loading. */
456
+ private stripeReady;
457
+ private stripeMountedFor;
458
+ private stripeMountedKey;
459
+ /** The checkout the mounted PaymentIntent pays for. */
460
+ private stripeCheckoutId;
461
+ private stripeElement;
462
+ /**
463
+ * The shipping the customer picked INSIDE the Qliro widget, as Qliro
464
+ * reports it. Qliro owns that choice in the modes where it shows a picker,
465
+ * so while Qliro is the method the summary follows it instead of our own
466
+ * preselected rate. Null until Qliro reports one — in `Vio rate as an order
467
+ * line` it never does, and our rate is the one Qliro charges.
468
+ */
469
+ private qliroShipping;
470
+ /**
471
+ * Set while this page load is showing the outcome of an embedded checkout's
472
+ * confirmation redirect (Kustom, Qliro, Walley). While set, nothing may start
473
+ * a new payment.
474
+ *
475
+ * The return handler selects the method so the panel has something to show,
476
+ * and only THEN asks the provider whether the order was paid. Selecting is a
477
+ * state change; the render it schedules runs `updated()` → `mount*IfNeeded()`
478
+ * long before the provider answers, and in a fresh page load there is no
479
+ * mounted order to stop it — so every return created a new backend checkout
480
+ * and a new provider order for a cart that had just been paid. Not a race
481
+ * that needs a slow network: a microtask always beats a round trip.
482
+ * Reproduced in `vio-checkout.return.dom.test.ts` before this existed.
483
+ *
484
+ * Cleared when the checkout closes: reopening it is a fresh checkout.
485
+ */
486
+ private returningFrom;
324
487
  /** Redirecting to the Stripe / Vipps hosted page. */
325
488
  private stripeLoading;
326
489
  private vippsLoading;
327
490
  private form;
328
491
  /** In-flight guard for loadAvailablePaymentMethods. */
329
492
  private loadingPaymentMethods;
493
+ /**
494
+ * Whether a load has COMPLETED, either way. `availableMethods === null`
495
+ * cannot tell "not asked yet" from "asked and failed", and rendering every
496
+ * button while we still do not know shows methods the channel may not have
497
+ * enabled — a shopper can click one that is not there.
498
+ */
499
+ private paymentMethodsResolved;
500
+ /** Guards `autoSelectSoleMethod` to ONE attempt per opening — see there. */
501
+ private autoSelectAttempted;
330
502
  /** In-flight + attempted guards for loadAvailableShippings (change events
331
503
  * fire per keystroke — without these, typing an address hammers the API). */
332
504
  private loadingShippings;
333
505
  private shippingsAttempted;
506
+ /**
507
+ * The cart's products cannot ship together (see `someLineShipsOnItsOwn`).
508
+ * While set, no payment can start and the payment step says why.
509
+ */
510
+ private shippingBlocked;
511
+ /** The opening whose shippings have been answered for — see
512
+ * `shippingsSettled`. */
513
+ private shippingsReadyFor;
514
+ private boundOnQliroEvent;
334
515
  private boundOnCheckoutChange;
335
516
  private boundOnPaymentComplete;
336
517
  private boundOnPaymentError;
@@ -346,6 +527,14 @@ declare class VioCheckout extends LitElement {
346
527
  private static readonly PAID_STATUSES;
347
528
  /** Statuses that mean the payment definitively did NOT go through. */
348
529
  private static readonly FAILED_STATUSES;
530
+ /**
531
+ * Shown instead of the payment step when the cart's products cannot ship
532
+ * together. Angelo, 2026-09-16: block the purchase rather than sell it
533
+ * without shipping, or with a rate that does not fit every product.
534
+ */
535
+ private static readonly SHIPPING_BLOCKED_MESSAGE;
536
+ /** The payment may or may not have gone through, and we could not find out. */
537
+ private static readonly RETURN_UNVERIFIED_MESSAGE;
349
538
  /** Waits between GetCheckout attempts — PSP webhooks (Vipps especially) can
350
539
  * land seconds after the shopper is redirected back, so a single immediate
351
540
  * check misreads a successful charge as unpaid. ~20s total. */
@@ -362,6 +551,8 @@ declare class VioCheckout extends LitElement {
362
551
  * anything else (including an unrecognized state) is treated as failed —
363
552
  * fail-closed by default rather than guessing.
364
553
  */
554
+ /** Vipps' own button when its script answers; our orange one otherwise. */
555
+ private loadVippsButton;
365
556
  private pollVippsStatus;
366
557
  /** Shared outcome handler for both the generic (GetCheckout) and the
367
558
  * Vipps-specific (GetVippsStatus) return-verification paths. */
@@ -373,16 +564,55 @@ declare class VioCheckout extends LitElement {
373
564
  updated(changed: Map<string, unknown>): void;
374
565
  close(): void;
375
566
  show(): void;
376
- /** Fetch the real per-supplier shippings and preselect + persist the first. */
567
+ /**
568
+ * Fetch the real per-supplier shippings and preselect + persist the first.
569
+ *
570
+ * Also decides whether the cart can ship at all (`shippingBlocked`), and
571
+ * records which opening the answer belongs to (`shippingsReadyFor`).
572
+ */
377
573
  private loadAvailableShippings;
574
+ /**
575
+ * Whether some product in the cart has shipping rates of its own. With no
576
+ * rate shared by all of them, that means they cannot ship TOGETHER. A cart
577
+ * where no line has rates is left alone: digital products have none, and
578
+ * shopcart refuses the physical case on its side.
579
+ */
580
+ private someLineShipsOnItsOwn;
378
581
  /** Whether all mandatory Leveringsadresse fields are filled. */
379
582
  private get isAddressValid();
380
583
  /** Whether a valid shipping option is selected (when shippings exist). */
381
584
  private get hasSelectedShipping();
382
585
  /** Which payment buttons to render — backend-configured per sponsor. */
383
586
  private loadAvailablePaymentMethods;
587
+ /**
588
+ * With exactly one payment method there is no choice to make, so making the
589
+ * shopper click it is a step that can only have one outcome. Select it —
590
+ * and since the checkout asks for the method first (2026-09-22), this is
591
+ * what skips that step: the form, or the provider's widget, comes straight
592
+ * up.
593
+ *
594
+ * Deliberately narrow:
595
+ * - never overrides a method the shopper already picked;
596
+ * - only for methods usable RIGHT NOW — Apple Pay and Klarna depend on the
597
+ * browser and on their script loading, and auto-selecting an unusable one
598
+ * would strand the shopper on a panel that cannot pay (see `updated`: a
599
+ * late "available" gets one more try);
600
+ * - selecting never pays: Stripe and Vipps still wait for their own button.
601
+ */
602
+ private autoSelectSoleMethod;
384
603
  /** Backend names arrive as e.g. "Apple Pay" — compare letters only. */
385
604
  private methodEnabled;
605
+ /**
606
+ * Stripe's Payment Element shows the wallets of the account that charges —
607
+ * Apple Pay and Google Pay among them. Offering our own Apple Pay button
608
+ * next to it is the same wallet twice, on the same screen, paying through
609
+ * the same account: when Stripe pays on our page, Stripe owns the wallets
610
+ * (Angelo, 2026-09-24). The cart's express button is another surface and
611
+ * keeps its own Apple Pay — the Element does not exist there.
612
+ */
613
+ private stripeOwnsWallets;
614
+ /** The methods the shopper actually sees (see stripeOwnsWallets). */
615
+ private offeredMethods;
386
616
  private refreshApplePay;
387
617
  private refreshKlarna;
388
618
  /** Mount (or re-mount on amount change) the Klarna Payments widget. */
@@ -400,6 +630,17 @@ declare class VioCheckout extends LitElement {
400
630
  /** Authorize the selected Klarna method → backend creates the order. */
401
631
  private onKlarnaAuthorize;
402
632
  private onFieldChange;
633
+ /** After choosing a method that needs our form, bring the form into view. */
634
+ private revealAddressForm;
635
+ /**
636
+ * Vipps from the checkout: Express when the channel allows it, so the
637
+ * shopper picks the delivery inside the app — our rate on the cart is the
638
+ * one preselected there — and never silently keeps the default our form
639
+ * chose for them. When the cart cannot have Express (several suppliers)
640
+ * the backend says so without creating a payment, and the plain payment
641
+ * follows: profile shared, the rate already on the cart.
642
+ */
643
+ private startVippsFromCheckout;
403
644
  private onApplePay;
404
645
  private onPay;
405
646
  /**
@@ -415,6 +656,16 @@ declare class VioCheckout extends LitElement {
415
656
  * paid sponsor's cart so the badge + drawer reflect the purchase.
416
657
  */
417
658
  private confirmOrder;
659
+ /** Waits between asks for the Vio order number: the order is often born a
660
+ * moment after the payment (Vipps and Stripe through their webhook). */
661
+ private static readonly ORDER_NUMBER_DELAYS_MS;
662
+ /**
663
+ * Puts the Vio order number (#4497) on the confirmation once the order
664
+ * exists. Until then the line is simply not there — never the checkout's
665
+ * uuid in its place, which is what it used to print. Stops if the shopper
666
+ * closes the drawer or another confirmation takes its place.
667
+ */
668
+ private fillOrderNumber;
418
669
  private methodLabel;
419
670
  /** True for methods that complete via a separate sheet/widget, not the CTA. */
420
671
  private isExpressMethod;
@@ -423,13 +674,84 @@ declare class VioCheckout extends LitElement {
423
674
  * express always has one; the normal flow has one once the backend
424
675
  * shippings loaded (the choice IS persisted on the cart and charged). */
425
676
  private shippingMajor;
677
+ /** The rate the summary names — Qliro's own pick while Qliro is the method. */
678
+ private summaryShippingName;
426
679
  /** Total to charge — items + shipping (express). */
427
680
  private payTotalLabel;
428
681
  render(): lit_html.TemplateResult<1>;
682
+ /**
683
+ * The provider's receipt on its own. It must not depend on the cart: the
684
+ * payment step is rendered from the cart, and clearing the cart after a
685
+ * purchase is what took Qliro's receipt away on 2026-09-08 and brought back
686
+ * "how do you want to pay". The provider's container lives in the light DOM
687
+ * and is projected here, untouched.
688
+ */
689
+ private renderProviderReceipt;
690
+ /**
691
+ * A completed purchase whose receipt the PROVIDER shows. Same side effects as
692
+ * confirmOrder — `vio:payment-success` for the host and analytics, the
693
+ * sponsor's cart cleared — but the screen is the provider's receipt, not our
694
+ * "Takk!": two receipts for one purchase is one too many.
695
+ */
696
+ private showProviderReceipt;
697
+ /** Back from the payment page, asking whether it was paid — and nothing
698
+ * else on screen while we do. */
699
+ private renderVerifying;
429
700
  private renderConfirmation;
701
+ /**
702
+ * Whether mounting an embedded checkout now would be starting a payment the
703
+ * shopper asked for. Mounting CREATES an order at the provider (and a backend
704
+ * checkout if there is none), so it must not happen on a confirmation return,
705
+ * once this checkout's order is confirmed, or for a cart that cannot ship.
706
+ */
707
+ private mayStartEmbeddedPayment;
708
+ /**
709
+ * Whether we know enough about shipping to create an order. The provider
710
+ * prices the order when it is created, so a first opening waits for the
711
+ * shippings to answer: the cart may turn out unable to ship at all. A list
712
+ * already on screen counts, and a later answer that blocks the cart takes
713
+ * the widget down again (see `updated`).
714
+ */
715
+ private shippingsSettled;
716
+ /** Why nothing can be paid: the cart's products cannot ship together. */
717
+ private renderShippingBlocked;
718
+ /**
719
+ * The checkout an embedded widget's order belongs to. Kustom, Qliro and
720
+ * Walley price the order when it is created, so a widget kept into a NEW
721
+ * checkout shows — and charges — the cart it was created for.
722
+ *
723
+ * Closing drops the widgets, but a checkout can start again without a
724
+ * close: in Vev the cart view opens on top of the checkout and "Til kassen"
725
+ * calls `Vio.checkout.open()` again (Angelo, 2026-09-14: quantities raised
726
+ * in the cart view, Qliro kept the old total). Every `open()` is a new
727
+ * session, so a widget from an earlier one starts over.
728
+ *
729
+ * 0.11.3 compared the cart LINES instead, and that was wrong: within one
730
+ * session the backend rewrites them (saving the shipping re-reads the cart),
731
+ * so the first Qliro event after that — the customer picking a shipping —
732
+ * tore the widget down mid-purchase (Alan, 2026-09-14). The session does
733
+ * not change under the customer's hands.
734
+ */
735
+ private embedSession;
430
736
  /** Klarna Payments widget panel: shipping + category chips + widget + pay button. */
737
+ /**
738
+ * The cart a Kustom order describes. When it changes under a mounted
739
+ * widget, the order is UPDATED in place (Kustom's rule) — see
740
+ * syncKustomIfStale. The order is a photo of the lines, not of the form:
741
+ * address and shipping live inside the widget.
742
+ */
743
+ private kustomCartKey;
431
744
  /** Mount the Kustom embedded checkout once it's the chosen method. */
432
745
  private mountKustomIfNeeded;
746
+ /** What the widget tells us, kept only to show — never acted on server-side. */
747
+ private kustomHandlers;
748
+ /**
749
+ * The cart changed under a mounted Kustom widget: suspend it, push the
750
+ * cart into the same order, resume it. Never a second order, never a
751
+ * widget showing a total the backend will not charge (the validation
752
+ * callback would refuse it). A failed sync takes the widget down.
753
+ */
754
+ private syncKustomIfStale;
433
755
  private unmountKustom;
434
756
  private renderKustomPanel;
435
757
  /** Mount the Qliro embedded checkout once it's the chosen method. */
@@ -458,6 +780,67 @@ declare class VioCheckout extends LitElement {
458
780
  private mountWalleyIfNeeded;
459
781
  private unmountWalley;
460
782
  private renderWalleyPanel;
783
+ /**
784
+ * Mount the Nexi embedded checkout once it's the chosen method. Nexi's own
785
+ * JS SDK renders into a LIGHT-DOM container (it refuses a shadow root);
786
+ * completion is its `payment-completed` event — Nexi neither redirects nor
787
+ * shows a receipt, so success lands in Vio's confirmation drawer. Shipping
788
+ * is re-priced on `address-changed` (see the manager).
789
+ */
790
+ private mountNexiIfNeeded;
791
+ /** payment-completed: the reservation exists — confirm like the redirect methods do. */
792
+ private onNexiCompleted;
793
+ /**
794
+ * How it was paid and where the receipt goes — Nexi knows, we ask. Its
795
+ * payment details can lag the completion event by a moment, hence the
796
+ * few retries. Best effort: the confirmation stands without them.
797
+ */
798
+ private addNexiPaymentDetails;
799
+ private static readonly NEXI_DETAILS_DELAYS_MS;
800
+ private unmountNexi;
801
+ /**
802
+ * Nexi has no shipping picker: once an address is typed in the widget, the
803
+ * rates that reach it are listed here and the pick is pushed to the payment.
804
+ * With a single rate there is nothing to choose, so nothing is shown.
805
+ */
806
+ private renderNexiShippingChoice;
807
+ private onPickNexiShipping;
808
+ /**
809
+ * What an embedded payment is a photo OF — an Adyen session, a Stripe
810
+ * PaymentIntent. When any of it changes underneath, that photo no longer
811
+ * describes the purchase: it is dropped, and the shopper asks for the
812
+ * payment step again.
813
+ */
814
+ private embedPurchaseKey;
815
+ /** The part of the photo the shopper types and picks. */
816
+ private embedFormKey;
817
+ /** A mounted session whose purchase changed is taken down — never patched. */
818
+ private dropStaleAdyen;
819
+ private mountAdyenIfNeeded;
820
+ private onAdyenCompleted;
821
+ /** What Adyen told us about the payment, on Vio's confirmation. */
822
+ private addAdyenPaymentDetails;
823
+ private unmountAdyen;
824
+ private renderAdyenPanel;
825
+ /** A mounted Element whose purchase changed is taken down — never patched. */
826
+ private dropStaleStripe;
827
+ private mountStripeIfNeeded;
828
+ /**
829
+ * Pay with the mounted Element. Stripe answers the BROWSER; the order is
830
+ * created server-side by the `payment_intent.succeeded` webhook, so a
831
+ * success is then waited for on the checkout itself.
832
+ */
833
+ private onStripePay;
834
+ /**
835
+ * Wait for Stripe's webhook to make the checkout paid — the same window the
836
+ * redirect return uses, and ONLY the status: a Stripe checkout carries
837
+ * `origin_payment_id` from the moment the intent is created, so that
838
+ * pointer would read as paid before anyone paid.
839
+ */
840
+ private waitForStripeOrder;
841
+ private unmountStripe;
842
+ private renderStripePanel;
843
+ private renderNexiPanel;
461
844
  private renderKlarnaPanel;
462
845
  /** Express layout — only the Klarna widget + a compact order summary. */
463
846
  private renderKlarnaExpress;
@@ -1,4 +1,4 @@
1
- export { V as VioCart, a as VioCheckout, b as VioProduct, c as VioProductCarousel, d as VioProductDetail, e as VioThemeOverrides, f as VioTokens, g as applyVioTheme } from '../tokens-D6PBisUm.js';
1
+ export { V as VioCart, a as VioCheckout, b as VioProduct, c as VioProductCarousel, d as VioProductDetail, e as VioThemeOverrides, f as VioTokens, g as applyVioTheme } from '../tokens-IrVSMVcA.js';
2
2
  import 'lit-html';
3
3
  import 'lit';
4
4
 
package/dist/ui/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { registerVioElements } from '../chunk-XU5LGUBU.js';
2
- export { VioCart, VioCheckout, VioProduct, VioProductCarousel, VioProductDetail, VioTokens, applyVioTheme, registerVioElements } from '../chunk-XU5LGUBU.js';
3
- import '../chunk-U2QG4IVJ.js';
1
+ import { registerVioElements } from '../chunk-NUNGU6LL.js';
2
+ export { VioCart, VioCheckout, VioProduct, VioProductCarousel, VioProductDetail, VioTokens, applyVioTheme, registerVioElements } from '../chunk-NUNGU6LL.js';
3
+ import '../chunk-CMNTHF66.js';
4
4
 
5
5
  // src/ui/index.ts
6
6
  registerVioElements();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vio-live/web-sdk",
3
- "version": "0.11.0",
3
+ "version": "0.19.0",
4
4
  "description": "Vio Web SDK — in-site shoppable + native checkout, designed for editorial commerce sites",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -57,6 +57,7 @@
57
57
  "@lit/react": "^1.0.8",
58
58
  "@types/node": "^22.10.0",
59
59
  "@types/react": "^19.2.17",
60
+ "jsdom": "^25.0.1",
60
61
  "tsup": "^8.5.1",
61
62
  "typescript": "^5.6.3",
62
63
  "vite": "^6.0.0",
@@ -1,3 +0,0 @@
1
-
2
- //# sourceMappingURL=chunk-QYQQ5J6E.js.map
3
- //# sourceMappingURL=chunk-QYQQ5J6E.js.map