@appfunnel-dev/sdk 2.0.0-canary.8 → 2.0.0-canary.9

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.
Files changed (37) hide show
  1. package/dist/{capabilities-CsnkVwna.d.cts → capabilities-Dq22RCr_.d.cts} +34 -1
  2. package/dist/{capabilities-CsnkVwna.d.ts → capabilities-Dq22RCr_.d.ts} +34 -1
  3. package/dist/{checkout-3PkKwPd7.d.ts → checkout-ClaO5IYV.d.ts} +17 -4
  4. package/dist/{checkout-Cg20l53c.d.cts → checkout-DBp4bCpC.d.cts} +17 -4
  5. package/dist/{chunk-RY3LOSVZ.cjs → chunk-7JLOF6CJ.cjs} +27 -5
  6. package/dist/chunk-7JLOF6CJ.cjs.map +1 -0
  7. package/dist/{chunk-PWXMQGO6.js → chunk-JAO6AA4R.js} +3 -3
  8. package/dist/{chunk-PWXMQGO6.js.map → chunk-JAO6AA4R.js.map} +1 -1
  9. package/dist/{chunk-RVJLR4RS.js → chunk-OXQBEKZ5.js} +25 -6
  10. package/dist/chunk-OXQBEKZ5.js.map +1 -0
  11. package/dist/{chunk-FY3TMSRU.cjs → chunk-VV7TFC64.cjs} +7 -7
  12. package/dist/{chunk-FY3TMSRU.cjs.map → chunk-VV7TFC64.cjs.map} +1 -1
  13. package/dist/driver-paddle.cjs +26 -24
  14. package/dist/driver-paddle.cjs.map +1 -1
  15. package/dist/driver-paddle.d.cts +2 -2
  16. package/dist/driver-paddle.d.ts +2 -2
  17. package/dist/driver-paddle.js +6 -4
  18. package/dist/driver-paddle.js.map +1 -1
  19. package/dist/driver-stripe.cjs +32 -26
  20. package/dist/driver-stripe.cjs.map +1 -1
  21. package/dist/driver-stripe.d.cts +2 -2
  22. package/dist/driver-stripe.d.ts +2 -2
  23. package/dist/driver-stripe.js +10 -4
  24. package/dist/driver-stripe.js.map +1 -1
  25. package/dist/index.cjs +48 -21
  26. package/dist/index.cjs.map +1 -1
  27. package/dist/index.d.cts +3 -3
  28. package/dist/index.d.ts +3 -3
  29. package/dist/index.js +18 -3
  30. package/dist/index.js.map +1 -1
  31. package/dist/manifest-entry.cjs +24 -12
  32. package/dist/manifest-entry.d.cts +2 -2
  33. package/dist/manifest-entry.d.ts +2 -2
  34. package/dist/manifest-entry.js +1 -1
  35. package/package.json +1 -1
  36. package/dist/chunk-RVJLR4RS.js.map +0 -1
  37. package/dist/chunk-RY3LOSVZ.cjs.map +0 -1
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkY4YNJ2EX_cjs = require('./chunk-Y4YNJ2EX.cjs');
4
- var chunkRY3LOSVZ_cjs = require('./chunk-RY3LOSVZ.cjs');
4
+ var chunk7JLOF6CJ_cjs = require('./chunk-7JLOF6CJ.cjs');
5
5
  require('./chunk-EMMSS5I5.cjs');
6
6
 
7
7
  // src/manifest/offering-refs.ts
@@ -345,47 +345,59 @@ Object.defineProperty(exports, "weightsOf", {
345
345
  });
346
346
  Object.defineProperty(exports, "INLINE_SURFACES", {
347
347
  enumerable: true,
348
- get: function () { return chunkRY3LOSVZ_cjs.INLINE_SURFACES; }
348
+ get: function () { return chunk7JLOF6CJ_cjs.INLINE_SURFACES; }
349
349
  });
350
350
  Object.defineProperty(exports, "PROVIDER_PROFILES", {
351
351
  enumerable: true,
352
- get: function () { return chunkRY3LOSVZ_cjs.PROVIDER_PROFILES; }
352
+ get: function () { return chunk7JLOF6CJ_cjs.PROVIDER_PROFILES; }
353
353
  });
354
354
  Object.defineProperty(exports, "checkoutError", {
355
355
  enumerable: true,
356
- get: function () { return chunkRY3LOSVZ_cjs.checkoutError; }
356
+ get: function () { return chunk7JLOF6CJ_cjs.checkoutError; }
357
357
  });
358
358
  Object.defineProperty(exports, "isInlineSurface", {
359
359
  enumerable: true,
360
- get: function () { return chunkRY3LOSVZ_cjs.isInlineSurface; }
360
+ get: function () { return chunk7JLOF6CJ_cjs.isInlineSurface; }
361
361
  });
362
362
  Object.defineProperty(exports, "isMerchantOfRecord", {
363
363
  enumerable: true,
364
- get: function () { return chunkRY3LOSVZ_cjs.isMerchantOfRecord; }
364
+ get: function () { return chunk7JLOF6CJ_cjs.isMerchantOfRecord; }
365
365
  });
366
366
  Object.defineProperty(exports, "isOrchestrator", {
367
367
  enumerable: true,
368
- get: function () { return chunkRY3LOSVZ_cjs.isOrchestrator; }
368
+ get: function () { return chunk7JLOF6CJ_cjs.isOrchestrator; }
369
+ });
370
+ Object.defineProperty(exports, "isRenderableSurface", {
371
+ enumerable: true,
372
+ get: function () { return chunk7JLOF6CJ_cjs.isRenderableSurface; }
373
+ });
374
+ Object.defineProperty(exports, "renderableSurfaces", {
375
+ enumerable: true,
376
+ get: function () { return chunk7JLOF6CJ_cjs.renderableSurfaces; }
377
+ });
378
+ Object.defineProperty(exports, "resolveSurface", {
379
+ enumerable: true,
380
+ get: function () { return chunk7JLOF6CJ_cjs.resolveSurface; }
369
381
  });
370
382
  Object.defineProperty(exports, "surfacesFor", {
371
383
  enumerable: true,
372
- get: function () { return chunkRY3LOSVZ_cjs.surfacesFor; }
384
+ get: function () { return chunk7JLOF6CJ_cjs.surfacesFor; }
373
385
  });
374
386
  Object.defineProperty(exports, "trialShapesFor", {
375
387
  enumerable: true,
376
- get: function () { return chunkRY3LOSVZ_cjs.trialShapesFor; }
388
+ get: function () { return chunk7JLOF6CJ_cjs.trialShapesFor; }
377
389
  });
378
390
  Object.defineProperty(exports, "validateCheckout", {
379
391
  enumerable: true,
380
- get: function () { return chunkRY3LOSVZ_cjs.validateCheckout; }
392
+ get: function () { return chunk7JLOF6CJ_cjs.validateCheckout; }
381
393
  });
382
394
  Object.defineProperty(exports, "validateTrial", {
383
395
  enumerable: true,
384
- get: function () { return chunkRY3LOSVZ_cjs.validateTrial; }
396
+ get: function () { return chunk7JLOF6CJ_cjs.validateTrial; }
385
397
  });
386
398
  Object.defineProperty(exports, "validateUpsell", {
387
399
  enumerable: true,
388
- get: function () { return chunkRY3LOSVZ_cjs.validateUpsell; }
400
+ get: function () { return chunk7JLOF6CJ_cjs.validateUpsell; }
389
401
  });
390
402
  exports.generateDevEntry = generateDevEntry;
391
403
  exports.generateEntryClient = generateEntryClient;
@@ -1,7 +1,7 @@
1
1
  import { af as CheckoutUsageScan } from './manifest-B3Tdab0M.cjs';
2
2
  export { h as CompileInput, i as Condition, j as ConditionOp, E as EdgeCondition, l as ExperimentArm, n as FlowPage, c as FunnelDefinition, o as FunnelLocales, p as FunnelManifest, ag as FunnelPage, b as FunnelSnapshot, G as Gate, q as Interval, M as ManifestEdge, r as ManifestPage, s as ManifestValidation, t as Money, O as Offering, e as OfferingInput, ah as OfferingRefScan, ai as OfferingSlot, P as PageMeta, v as PageType, w as Predicate, x as ResolvedOffering, y as Route, R as RuntimeExperiment, H as assignVariant, J as bucketingSeed, N as buildCatalog, Q as compileManifest, T as currencyExponent, W as defineFunnel, Y as entryGuard, Z as evaluateCondition, a1 as formatMoney, a2 as formatOffering, aj as funnelCatalogKeys, a4 as isRtl, a5 as isVariantKey, ak as normalizeOfferings, a8 as pageMeta, a9 as parseSlotKey, ac as resolveLocale, ad as resolveOffering, al as scanOfferingRefs, am as weightsOf } from './manifest-B3Tdab0M.cjs';
3
- import { C as CheckoutError, b as CheckoutIntent, U as UpsellKind, d as CheckoutSurface } from './capabilities-CsnkVwna.cjs';
4
- export { a as CheckoutErrorCategory, c as CheckoutProvider, I as INLINE_SURFACES, O as OffSessionReliability, P as PROVIDER_PROFILES, e as ProviderProfile, S as SurfaceCapability, T as TrialShape, V as ValidationResult, f as checkoutError, i as isInlineSurface, g as isMerchantOfRecord, h as isOrchestrator, s as surfacesFor, t as trialShapesFor, v as validateCheckout, k as validateTrial, j as validateUpsell } from './capabilities-CsnkVwna.cjs';
3
+ import { C as CheckoutError, b as CheckoutIntent, U as UpsellKind, d as CheckoutSurface } from './capabilities-Dq22RCr_.cjs';
4
+ export { a as CheckoutErrorCategory, c as CheckoutProvider, D as DeviceClass, I as INLINE_SURFACES, O as OffSessionReliability, P as PROVIDER_PROFILES, e as ProviderProfile, S as SurfaceCapability, f as SurfacePreference, T as TrialShape, V as ValidationResult, g as checkoutError, i as isInlineSurface, h as isMerchantOfRecord, j as isOrchestrator, k as isRenderableSurface, r as renderableSurfaces, l as resolveSurface, s as surfacesFor, t as trialShapesFor, v as validateCheckout, n as validateTrial, m as validateUpsell } from './capabilities-Dq22RCr_.cjs';
5
5
  import 'react';
6
6
 
7
7
  /**
@@ -1,7 +1,7 @@
1
1
  import { af as CheckoutUsageScan } from './manifest-B3Tdab0M.js';
2
2
  export { h as CompileInput, i as Condition, j as ConditionOp, E as EdgeCondition, l as ExperimentArm, n as FlowPage, c as FunnelDefinition, o as FunnelLocales, p as FunnelManifest, ag as FunnelPage, b as FunnelSnapshot, G as Gate, q as Interval, M as ManifestEdge, r as ManifestPage, s as ManifestValidation, t as Money, O as Offering, e as OfferingInput, ah as OfferingRefScan, ai as OfferingSlot, P as PageMeta, v as PageType, w as Predicate, x as ResolvedOffering, y as Route, R as RuntimeExperiment, H as assignVariant, J as bucketingSeed, N as buildCatalog, Q as compileManifest, T as currencyExponent, W as defineFunnel, Y as entryGuard, Z as evaluateCondition, a1 as formatMoney, a2 as formatOffering, aj as funnelCatalogKeys, a4 as isRtl, a5 as isVariantKey, ak as normalizeOfferings, a8 as pageMeta, a9 as parseSlotKey, ac as resolveLocale, ad as resolveOffering, al as scanOfferingRefs, am as weightsOf } from './manifest-B3Tdab0M.js';
3
- import { C as CheckoutError, b as CheckoutIntent, U as UpsellKind, d as CheckoutSurface } from './capabilities-CsnkVwna.js';
4
- export { a as CheckoutErrorCategory, c as CheckoutProvider, I as INLINE_SURFACES, O as OffSessionReliability, P as PROVIDER_PROFILES, e as ProviderProfile, S as SurfaceCapability, T as TrialShape, V as ValidationResult, f as checkoutError, i as isInlineSurface, g as isMerchantOfRecord, h as isOrchestrator, s as surfacesFor, t as trialShapesFor, v as validateCheckout, k as validateTrial, j as validateUpsell } from './capabilities-CsnkVwna.js';
3
+ import { C as CheckoutError, b as CheckoutIntent, U as UpsellKind, d as CheckoutSurface } from './capabilities-Dq22RCr_.js';
4
+ export { a as CheckoutErrorCategory, c as CheckoutProvider, D as DeviceClass, I as INLINE_SURFACES, O as OffSessionReliability, P as PROVIDER_PROFILES, e as ProviderProfile, S as SurfaceCapability, f as SurfacePreference, T as TrialShape, V as ValidationResult, g as checkoutError, i as isInlineSurface, h as isMerchantOfRecord, j as isOrchestrator, k as isRenderableSurface, r as renderableSurfaces, l as resolveSurface, s as surfacesFor, t as trialShapesFor, v as validateCheckout, n as validateTrial, m as validateUpsell } from './capabilities-Dq22RCr_.js';
5
5
  import 'react';
6
6
 
7
7
  /**
@@ -1,5 +1,5 @@
1
1
  export { assignVariant, bucketingSeed, buildCatalog, compileManifest, currencyExponent, defineFunnel, entryGuard, evaluateCondition, formatMoney, formatOffering, funnelCatalogKeys, isRtl, isVariantKey, normalizeOfferings, pageMeta, parseSlotKey, resolveLocale, resolveOffering, weightsOf } from './chunk-VW2HVPR4.js';
2
- export { INLINE_SURFACES, PROVIDER_PROFILES, checkoutError, isInlineSurface, isMerchantOfRecord, isOrchestrator, surfacesFor, trialShapesFor, validateCheckout, validateTrial, validateUpsell } from './chunk-RVJLR4RS.js';
2
+ export { INLINE_SURFACES, PROVIDER_PROFILES, checkoutError, isInlineSurface, isMerchantOfRecord, isOrchestrator, isRenderableSurface, renderableSurfaces, resolveSurface, surfacesFor, trialShapesFor, validateCheckout, validateTrial, validateUpsell } from './chunk-OXQBEKZ5.js';
3
3
  import './chunk-G3PMV62Z.js';
4
4
 
5
5
  // src/manifest/offering-refs.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appfunnel-dev/sdk",
3
- "version": "2.0.0-canary.8",
3
+ "version": "2.0.0-canary.9",
4
4
  "description": "The AppFunnel funnel framework — typed namespaces, routing, commerce, modals, i18n for React funnels",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -1 +0,0 @@
1
- {"version":3,"sources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CAAC,CAAA,CAAA,CAAA,GAAM,EAAA;AAC3G,IAAA,OAAO,EAAE,EAAA,EAAI,KAAA,EAAO,MAAA,EAAQ,CAAA,EAAG,QAAQ,CAAA,iBAAA,EAAoB,IAAI,CAAA,oBAAA,EAAuB,GAAG,CAAA,CAAA,EAAG;AAAA,EAC9F;AACA,EAAA,MAAM,GAAA,GAAM,OAAA,CAAQ,QAAA,CAAS,cAAc,CAAA;AAC3C,EAAA,IAAI,CAAC,GAAA,EAAK,OAAO,EAAE,EAAA,EAAI,KAAA,EAAO,MAAA,EAAQ,CAAA,EAAG,QAAQ,CAAA,SAAA,EAAY,cAAc,CAAA,yBAAA,CAAA,EAA4B;AACvG,EAAA,IAAI,GAAA,CAAI,eAAe,MAAA,EAAQ;AAC7B,IAAA,OAAO,EAAE,EAAA,EAAI,KAAA,EAAO,MAAA,EAAQ,CAAA,eAAA,EAAkB,cAAc,CAAA,4CAAA,CAAA,EAA+C;AAAA,EAC7G;AACA,EAAA,IAAI,GAAA,CAAI,eAAe,aAAA,EAAe;AACpC,IAAA,OAAO,EAAE,IAAI,IAAA,EAAM,IAAA,EAAM,4BAA4B,QAAQ,CAAA,EAAA,EAAK,cAAc,CAAA,6EAAA,CAAA,EAA2E;AAAA,EAC7J;AACA,EAAA,OAAO,EAAE,IAAI,IAAA,EAAK;AACpB;AA+BO,SAAS,aAAA,CACd,QAAA,EACA,OAAA,EACA,KAAA,GAAuD,EAAC,EACzC;AACf,EAAA,MAAM,YAAY,KAAA,CAAM,SAAA,KAAc,aAAa,yBAAA,IAA6B,QAAA,KAAa,6BAA6B,QAAA,KAAa,kBAAA,CAAA;AACvI,EAAA,OAAO,EAAE,QAAA,EAAU,OAAA,EAAS,WAAA,EAAa,KAAA,CAAM,aAAa,SAAA,EAAU;AACxE","file":"chunk-RVJLR4RS.js","sourcesContent":["/**\n * The provider capability matrix + checkout error taxonomy — the PURE half of the\n * checkout seam, extracted from checkout.tsx so it ships through the **manifest\n * entry** (no React): the API's publish validation, the editor, AI authoring, and\n * local dev all run the SAME checks the runtime primitives use (phase-3 §3.1b —\n * \"the SDK ships this as data\"). The React half (driver seam, `useCheckout`,\n * `<Checkout>`/`<Upsell>`) stays in ./checkout, which re-exports everything here.\n */\n\nexport type CheckoutSurface =\n | 'express' // wallet quick-buttons (Apple/Google Pay) — inline\n | 'element' // inline card form — inline\n | 'embedded' // provider-managed inline checkout — inline\n | 'sheet' // bottom-sheet popup — opens on click\n | 'popup' // provider-hosted overlay — opens on click\n | 'redirect' // provider-hosted page — opens on click\n\nexport type CheckoutProvider = 'stripe' | 'paddle' | 'whop' | 'primer' | 'solidgate'\nexport type CheckoutIntent = 'purchase' | 'upsell'\n\n/** Surfaces that render inline (vs. those that open on click). */\nexport const INLINE_SURFACES: ReadonlySet<CheckoutSurface> = new Set<CheckoutSurface>([\n 'express',\n 'element',\n 'embedded',\n])\n\nexport function isInlineSurface(surface: CheckoutSurface): boolean {\n return INLINE_SURFACES.has(surface)\n}\n\n/**\n * The kind of off-session upsell (researched against Funnelfox's changelog, which\n * ships these as distinct features). The discriminating real-world constraint is\n * **stacking a 2nd concurrent subscription** — Paddle can't, SolidGate/Stripe can.\n */\nexport type UpsellKind =\n | 'subscription' // charge a NEW, 2nd concurrent subscription off-session (stacking)\n | 'one-time' // charge a one-time add-on off-session\n | 'upgrade' // change the existing subscription's plan\n\n/** Reliability of an off-session upsell charge AFTER a purchase on a surface. */\nexport type OffSessionReliability =\n | 'reliable' // we hold the saved method (Stripe Elements / SolidGate) or the provider charges it (Paddle / Whop API)\n | 'conditional' // possible but may decline — Stripe **managed** checkout (vault charge, SCA not guaranteed) or an orchestrator's PSP-dependent routing (Primer)\n | 'none'\n\nexport interface SurfaceCapability {\n purchase: boolean\n /** Apple/Google Pay available on this surface. */\n wallets: boolean\n /** Reliability of an off-session upsell after a purchase on this surface. */\n offSession: OffSessionReliability\n /**\n * Per-surface DRIVER readiness. Absent = renderable now (the provider's driver mounts it).\n * `'planned'` = the provider genuinely ships this surface (cite it in the profile) but OUR\n * driver doesn't render it yet — publish validation FAILS CLOSED on it so we never promise a\n * surface the runtime can't produce. Mirrors the provider-level {@link ProviderProfile.status}\n * seam at surface granularity: implement the driver, drop the flag, and it flips on cleanly.\n */\n driver?: 'planned'\n}\n\n/**\n * How a provider composes a TRIAL — the scattered provider `if`s made a matrix dimension\n * (§7 item 4). Stripe trials are **composed** (a separate fee/vault step precedes the sub);\n * Paddle trials are **native** (the price itself carries the trial, MoR collects up front):\n * - `paid_composed` — Stripe: trial-fee PaymentIntent → subscription with `trial_period_days`.\n * - `free_vault` — Stripe: SetupIntent vaults the card (no charge) → trial subscription.\n * - `paid_native` — Paddle: the price carries the paid trial; one item, collected up front.\n * - `free_native` — Paddle: native free trial on the price.\n * A provider with an EMPTY `trialShapes` can't run a trial offer (planned providers → fail closed).\n */\nexport type TrialShape = 'paid_composed' | 'free_vault' | 'paid_native' | 'free_native'\n\nexport interface ProviderProfile {\n /** Merchant-of-Record (handles tax/compliance) vs. a PSP you settle through. */\n isMoR: boolean\n /** Upsell kinds this provider can charge off-session (one-click, no re-entry). */\n offSessionUpsells: UpsellKind[]\n /** Who charges the saved method off-session: you (PSP) or the provider (MoR/managed). */\n tokenModel: 'merchant' | 'provider'\n /** Routes across multiple processors (Primer; SolidGate also offers this) vs. a single acquirer. */\n orchestrator: boolean\n /**\n * Driver tier (Wave-4 decision, Simon 2026-07-02): `full` = a real driver ships\n * (Stripe, Paddle); `planned` = profile only — authoring/publish validate against\n * it, but no charge path exists yet (Whop, Primer, SolidGate). A new provider\n * becomes buildable by writing a driver; its profile already gates what authors\n * can express, so funnels written today stay valid when the driver lands.\n */\n status: 'full' | 'planned'\n /**\n * TRIAL shapes this provider can run (§7 item 4). Empty = no trial path (fail closed at\n * publish — a paid/free-trial funnel on this provider can't be produced yet).\n */\n trialShapes: TrialShape[]\n /** Supported surfaces → per-surface capabilities. **Absent = not supported.** */\n surfaces: Partial<Record<CheckoutSurface, SurfaceCapability>>\n}\n\n/** Reliable off-session after this surface (we/the provider hold a chargeable method). */\nconst ON: SurfaceCapability = { purchase: true, wallets: true, offSession: 'reliable' }\n/** Stripe-managed checkout: a purchase works, but the off-session upsell may decline. */\nconst MANAGED: SurfaceCapability = { purchase: true, wallets: true, offSession: 'conditional' }\n/** Orchestrator-routed (Primer): off-session depends on which PSP vaulted the method. */\nconst ROUTED: SurfaceCapability = { purchase: true, wallets: true, offSession: 'conditional' }\n/**\n * Paddle **Express Checkout** (Apple-Pay-first mobile variant of Paddle.js checkout, shipped\n * 2026-04-27 — https://developer.paddle.com/changelog/2026/apple-pay-express-checkout/). Paddle\n * genuinely offers it (MoR, so it's their hosted/inline frame surfaced wallet-first, NOT a raw\n * wallet element in our UI), which is why it's a distinct `express` surface here rather than only\n * the `wallets` flag already true on Paddle's embedded/popup. But our Paddle DRIVER doesn't render\n * it yet (drivers/paddle.tsx opens the standard embedded/overlay checkout regardless of surface),\n * so `driver: 'planned'` fails it closed at publish — the matrix records reality without promising\n * a wallet-first render the runtime can't produce. Off-session stays reliable (provider-token, MoR).\n */\nconst PADDLE_EXPRESS: SurfaceCapability = { purchase: true, wallets: true, offSession: 'reliable', driver: 'planned' }\nconst ALL_UPSELLS: UpsellKind[] = ['subscription', 'one-time', 'upgrade']\n\n/**\n * Provider capabilities (researched 2026-06-23 against provider docs + Funnelfox;\n * trial mechanics re-verified 2026-07-02, doc 09 §4.4).\n *\n * Three real-world corrections to the naive model:\n * 1. **Off-session upsell support is per-provider by *kind*** (`offSessionUpsells`):\n * Paddle can't stack a 2nd concurrent subscription (upgrade + one-time only);\n * Stripe/SolidGate/Whop/Primer can do all kinds.\n * 2. **Off-session *reliability* varies by the paywall surface** (`SurfaceCapability.\n * offSession`): Stripe **managed** checkout (`embedded`/`redirect`) upsells as a\n * direct charge against Stripe's vault → `conditional` (may decline); Elements\n * surfaces are `reliable`. Primer is `conditional` everywhere (PSP-dependent).\n * 3. **Surface availability is a hard constraint.** MoR/managed providers can't\n * expose a raw card field to your own UI: Paddle has no `express`/`element`/your\n * `sheet`; Whop has no raw `element`/`express`; Primer has no hosted `redirect`;\n * Stripe/SolidGate have no `popup`. A missing entry means \"not possible.\"\n */\nexport const PROVIDER_PROFILES: Record<CheckoutProvider, ProviderProfile> = {\n // PSP; you hold the PaymentMethod and fire your own off-session PaymentIntent on\n // the Elements surfaces (reliable). **Managed** Checkout (`embedded`/`redirect`)\n // upsells too, but as a direct charge against Stripe's vaulted card → conditional.\n // No provider \"popup\" surface.\n stripe: {\n isMoR: false, offSessionUpsells: ALL_UPSELLS, tokenModel: 'merchant', orchestrator: false, status: 'full',\n // Composed trials: paid = fee PaymentIntent + sub (trial_period_days); free = SetupIntent vault\n // + trial sub (services/checkout/stripe-trial.ts).\n trialShapes: ['paid_composed', 'free_vault'],\n surfaces: { express: ON, element: ON, sheet: ON, embedded: MANAGED, redirect: MANAGED },\n },\n // Merchant-of-Record; raw card entry is always Paddle's frame → no own element/sheet.\n // `express` IS now present (Apple-Pay-first Express Checkout, shipped 2026-04-27) but is\n // driver-planned (PADDLE_EXPRESS) → publish fails it closed until the driver renders it.\n // Off-session via subscription one-time charge / collection_mode, but **no 2nd concurrent\n // subscription** (upgrade + one-time only), provider-initiated.\n paddle: {\n isMoR: true, offSessionUpsells: ['one-time', 'upgrade'], tokenModel: 'provider', orchestrator: false, status: 'full',\n // Native trials: the price itself carries the trial, Paddle collects up front / vaults\n // (services/checkout/paddle-checkout.ts — \"Paddle paid trials are NATIVE\").\n trialShapes: ['paid_native', 'free_native'],\n surfaces: { embedded: ON, popup: ON, redirect: ON, express: PADDLE_EXPRESS },\n },\n // Merchant-of-Record; iframe-only (no raw card field). Off-session works\n // (provider-initiated, async via webhooks). `sheet` = our chrome hosting their embed.\n // Trial shape not yet researched → empty (fail closed until the driver + profile land).\n whop: {\n isMoR: true, offSessionUpsells: ALL_UPSELLS, tokenModel: 'provider', orchestrator: false, status: 'planned',\n trialShapes: [],\n surfaces: { embedded: ON, redirect: ON, sheet: ON },\n },\n // Pure orchestrator (PSP-side); Headless renders express/element/sheet/embedded.\n // No hosted redirect page, no popup checkout. Off-session is PSP-conditional —\n // the vault lives with whichever processor Primer routed to (data matches this\n // comment as of 2026-07-02; it previously said conditional but coded reliable).\n primer: {\n isMoR: false, offSessionUpsells: ALL_UPSELLS, tokenModel: 'merchant', orchestrator: true, status: 'planned',\n trialShapes: [],\n surfaces: { express: ROUTED, element: ROUTED, sheet: ROUTED, embedded: ROUTED },\n },\n // PSP **and** orchestrator (own acquiring + connectors routing across Stripe/Adyen/\n // PayPal). One Payment Form (element/sheet/embedded) + hosted page + wallet button.\n // Strong native off-session (Recurring API). No popup.\n solidgate: {\n isMoR: false, offSessionUpsells: ALL_UPSELLS, tokenModel: 'merchant', orchestrator: true, status: 'planned',\n trialShapes: [],\n surfaces: { express: ON, element: ON, sheet: ON, embedded: ON, redirect: ON },\n },\n}\n\nexport interface ValidationResult {\n ok: boolean\n reason?: string\n /** Non-fatal caveat (e.g. Paddle upgrade-only). */\n note?: string\n}\n\n/** Surfaces a provider supports, for the editor/AI to steer authors. */\nexport function surfacesFor(provider: CheckoutProvider): CheckoutSurface[] {\n return Object.keys(PROVIDER_PROFILES[provider]?.surfaces ?? {}) as CheckoutSurface[]\n}\n\n/** Whether a provider is a Merchant of Record (it owns tax/compliance). */\nexport function isMerchantOfRecord(provider: CheckoutProvider): boolean {\n return PROVIDER_PROFILES[provider]?.isMoR ?? false\n}\n\n/** Whether a provider routes across multiple processors (Primer, SolidGate). */\nexport function isOrchestrator(provider: CheckoutProvider): boolean {\n return PROVIDER_PROFILES[provider]?.orchestrator ?? false\n}\n\n/**\n * Validate a (provider, surface) for a **purchase**: the surface must exist for\n * the provider and accept a payment. Surface availability is the real constraint\n * (e.g. Paddle has no `element`).\n */\nexport function validateCheckout(provider: CheckoutProvider, surface: CheckoutSurface): ValidationResult {\n const cap = PROVIDER_PROFILES[provider]?.surfaces[surface]\n if (!cap) return { ok: false, reason: `${provider} has no '${surface}' surface` }\n if (!cap.purchase) return { ok: false, reason: `'${surface}' can't take a purchase on ${provider}` }\n // The provider offers this surface but our driver can't render it yet (e.g. Paddle Express\n // Checkout) → fail closed so publish never promises a surface the runtime can't produce.\n if (cap.driver === 'planned') return { ok: false, reason: `${provider} '${surface}' checkout isn't renderable yet (the provider ships it, but our driver doesn't render it)` }\n return { ok: true }\n}\n\n/** Trial shapes a provider can compose (empty = it can't run a trial offer yet). */\nexport function trialShapesFor(provider: CheckoutProvider): TrialShape[] {\n return PROVIDER_PROFILES[provider]?.trialShapes ?? []\n}\n\n/**\n * Validate that a provider can run a TRIAL (§7 item 4). Pass a specific {@link TrialShape} to\n * check that exact shape; omit it to assert the provider supports *any* trial (the cheap gate\n * check when only the offering's TRIAL-role binding existence is known). A provider with no\n * trial shapes (every planned provider) fails closed.\n */\nexport function validateTrial(provider: CheckoutProvider, shape?: TrialShape): ValidationResult {\n const profile = PROVIDER_PROFILES[provider]\n if (!profile) return { ok: false, reason: `unknown provider '${provider}'` }\n const shapes = profile.trialShapes\n if (shapes.length === 0) return { ok: false, reason: `${provider} can't run a trial offer yet` }\n if (shape && !shapes.includes(shape)) {\n return { ok: false, reason: `${provider} doesn't support a '${shape}' trial (it supports: ${shapes.join(', ')})` }\n }\n return { ok: true }\n}\n\n/**\n * Validate an **off-session upsell** of `kind` after a purchase made on\n * `paywallSurface`. Combines provider support for the kind (Paddle can't stack a\n * 2nd subscription) with the paywall surface's off-session reliability (Stripe\n * managed checkout is `conditional` — returned as a `note`, not a hard block).\n */\nexport function validateUpsell(\n provider: CheckoutProvider,\n paywallSurface: CheckoutSurface,\n kind: UpsellKind = 'subscription',\n): ValidationResult {\n const profile = PROVIDER_PROFILES[provider]\n if (!profile) return { ok: false, reason: `unknown provider '${provider}'` }\n if (!profile.offSessionUpsells.includes(kind)) {\n const can = profile.offSessionUpsells.length ? ` (it supports: ${profile.offSessionUpsells.join(', ')})` : ''\n return { ok: false, reason: `${provider} can't charge a '${kind}' upsell off-session${can}` }\n }\n const cap = profile.surfaces[paywallSurface]\n if (!cap) return { ok: false, reason: `${provider} has no '${paywallSurface}' surface to upsell after` }\n if (cap.offSession === 'none') {\n return { ok: false, reason: `a purchase on '${paywallSurface}' retains no chargeable method for an upsell` }\n }\n if (cap.offSession === 'conditional') {\n return { ok: true, note: `off-session upsell after ${provider} '${paywallSurface}' may decline — prefer a reliable surface or wire an on-session fallback` }\n }\n return { ok: true }\n}\n\n// ── Checkout error taxonomy (pure — drivers + server both normalize into it) ──\n\n/**\n * Normalized failure category — the driver/platform maps each provider's decline\n * codes into one of these so funnels can route/recover by reason. `authentication_\n * required` (3DS/SCA) and `requires_payment_method` are the cases an **off-session**\n * upsell can't satisfy → recover on-session (re-collect a card).\n */\nexport type CheckoutErrorCategory =\n | 'card_declined'\n | 'insufficient_funds'\n | 'expired_card'\n | 'prepaid_card' // card funding is prepaid — trials/subscriptions commonly decline; route to a real-card recapture page\n | 'authentication_required' // SCA/3DS needed — off-session can't challenge\n | 'requires_payment_method' // no usable saved method\n | 'processing_error'\n | 'canceled'\n | 'unknown'\n\nexport interface CheckoutError {\n category: CheckoutErrorCategory\n message: string\n /** Raw provider decline code, if any (e.g. Stripe `card_declined`/`insufficient_funds`). */\n declineCode?: string\n /** Whether re-attempting (e.g. an on-session re-collection) may succeed. */\n retryable: boolean\n}\n\n/** Build a {@link CheckoutError} (driver/test helper). */\nexport function checkoutError(\n category: CheckoutErrorCategory,\n message: string,\n extra: { declineCode?: string; retryable?: boolean } = {},\n): CheckoutError {\n const retryable = extra.retryable ?? (category === 'authentication_required' || category === 'requires_payment_method' || category === 'processing_error')\n return { category, message, declineCode: extra.declineCode, retryable }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/commerce/capabilities.ts"],"names":[],"mappings":";;;AAqBO,IAAM,eAAA,uBAAoD,GAAA,CAAqB;AAAA,EACpF,SAAA;AAAA,EACA,SAAA;AAAA,EACA;AACF,CAAC;AAEM,SAAS,gBAAgB,OAAA,EAAm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,GAAG,CAAA,CAAA,EAAG;AAAA,EAC9F;AACA,EAAA,MAAM,GAAA,GAAM,OAAA,CAAQ,QAAA,CAAS,cAAc,CAAA;AAC3C,EAAA,IAAI,CAAC,GAAA,EAAK,OAAO,EAAE,EAAA,EAAI,KAAA,EAAO,MAAA,EAAQ,CAAA,EAAG,QAAQ,CAAA,SAAA,EAAY,cAAc,CAAA,yBAAA,CAAA,EAA4B;AACvG,EAAA,IAAI,GAAA,CAAI,eAAe,MAAA,EAAQ;AAC7B,IAAA,OAAO,EAAE,EAAA,EAAI,KAAA,EAAO,MAAA,EAAQ,CAAA,eAAA,EAAkB,cAAc,CAAA,4CAAA,CAAA,EAA+C;AAAA,EAC7G;AACA,EAAA,IAAI,GAAA,CAAI,eAAe,aAAA,EAAe;AACpC,IAAA,OAAO,EAAE,IAAI,IAAA,EAAM,IAAA,EAAM,4BAA4B,QAAQ,CAAA,EAAA,EAAK,cAAc,CAAA,6EAAA,CAAA,EAA2E;AAAA,EAC7J;AACA,EAAA,OAAO,EAAE,IAAI,IAAA,EAAK;AACpB;AA+BO,SAAS,aAAA,CACd,QAAA,EACA,OAAA,EACA,KAAA,GAAuD,EAAC,EACzC;AACf,EAAA,MAAM,YAAY,KAAA,CAAM,SAAA,KAAc,aAAa,yBAAA,IAA6B,QAAA,KAAa,6BAA6B,QAAA,KAAa,kBAAA,CAAA;AACvI,EAAA,OAAO,EAAE,QAAA,EAAU,OAAA,EAAS,WAAA,EAAa,KAAA,CAAM,aAAa,SAAA,EAAU;AACxE","file":"chunk-RY3LOSVZ.cjs","sourcesContent":["/**\n * The provider capability matrix + checkout error taxonomy — the PURE half of the\n * checkout seam, extracted from checkout.tsx so it ships through the **manifest\n * entry** (no React): the API's publish validation, the editor, AI authoring, and\n * local dev all run the SAME checks the runtime primitives use (phase-3 §3.1b —\n * \"the SDK ships this as data\"). The React half (driver seam, `useCheckout`,\n * `<Checkout>`/`<Upsell>`) stays in ./checkout, which re-exports everything here.\n */\n\nexport type CheckoutSurface =\n | 'express' // wallet quick-buttons (Apple/Google Pay) — inline\n | 'element' // inline card form — inline\n | 'embedded' // provider-managed inline checkout — inline\n | 'sheet' // bottom-sheet popup — opens on click\n | 'popup' // provider-hosted overlay — opens on click\n | 'redirect' // provider-hosted page — opens on click\n\nexport type CheckoutProvider = 'stripe' | 'paddle' | 'whop' | 'primer' | 'solidgate'\nexport type CheckoutIntent = 'purchase' | 'upsell'\n\n/** Surfaces that render inline (vs. those that open on click). */\nexport const INLINE_SURFACES: ReadonlySet<CheckoutSurface> = new Set<CheckoutSurface>([\n 'express',\n 'element',\n 'embedded',\n])\n\nexport function isInlineSurface(surface: CheckoutSurface): boolean {\n return INLINE_SURFACES.has(surface)\n}\n\n/**\n * The kind of off-session upsell (researched against Funnelfox's changelog, which\n * ships these as distinct features). The discriminating real-world constraint is\n * **stacking a 2nd concurrent subscription** — Paddle can't, SolidGate/Stripe can.\n */\nexport type UpsellKind =\n | 'subscription' // charge a NEW, 2nd concurrent subscription off-session (stacking)\n | 'one-time' // charge a one-time add-on off-session\n | 'upgrade' // change the existing subscription's plan\n\n/** Reliability of an off-session upsell charge AFTER a purchase on a surface. */\nexport type OffSessionReliability =\n | 'reliable' // we hold the saved method (Stripe Elements / SolidGate) or the provider charges it (Paddle / Whop API)\n | 'conditional' // possible but may decline — Stripe **managed** checkout (vault charge, SCA not guaranteed) or an orchestrator's PSP-dependent routing (Primer)\n | 'none'\n\nexport interface SurfaceCapability {\n purchase: boolean\n /** Apple/Google Pay available on this surface. */\n wallets: boolean\n /** Reliability of an off-session upsell after a purchase on this surface. */\n offSession: OffSessionReliability\n /**\n * Per-surface DRIVER readiness. Absent = renderable now (the provider's driver mounts it).\n * `'planned'` = the provider genuinely ships this surface (cite it in the profile) but OUR\n * driver doesn't render it yet — publish validation FAILS CLOSED on it so we never promise a\n * surface the runtime can't produce. Mirrors the provider-level {@link ProviderProfile.status}\n * seam at surface granularity: implement the driver, drop the flag, and it flips on cleanly.\n */\n driver?: 'planned'\n}\n\n/**\n * How a provider composes a TRIAL — the scattered provider `if`s made a matrix dimension\n * (§7 item 4). Stripe trials are **composed** (a separate fee/vault step precedes the sub);\n * Paddle trials are **native** (the price itself carries the trial, MoR collects up front):\n * - `paid_composed` — Stripe: trial-fee PaymentIntent → subscription with `trial_period_days`.\n * - `free_vault` — Stripe: SetupIntent vaults the card (no charge) → trial subscription.\n * - `paid_native` — Paddle: the price carries the paid trial; one item, collected up front.\n * - `free_native` — Paddle: native free trial on the price.\n * A provider with an EMPTY `trialShapes` can't run a trial offer (planned providers → fail closed).\n */\nexport type TrialShape = 'paid_composed' | 'free_vault' | 'paid_native' | 'free_native'\n\nexport interface ProviderProfile {\n /** Merchant-of-Record (handles tax/compliance) vs. a PSP you settle through. */\n isMoR: boolean\n /** Upsell kinds this provider can charge off-session (one-click, no re-entry). */\n offSessionUpsells: UpsellKind[]\n /** Who charges the saved method off-session: you (PSP) or the provider (MoR/managed). */\n tokenModel: 'merchant' | 'provider'\n /** Routes across multiple processors (Primer; SolidGate also offers this) vs. a single acquirer. */\n orchestrator: boolean\n /**\n * Driver tier (Wave-4 decision, Simon 2026-07-02): `full` = a real driver ships\n * (Stripe, Paddle); `planned` = profile only — authoring/publish validate against\n * it, but no charge path exists yet (Whop, Primer, SolidGate). A new provider\n * becomes buildable by writing a driver; its profile already gates what authors\n * can express, so funnels written today stay valid when the driver lands.\n */\n status: 'full' | 'planned'\n /**\n * TRIAL shapes this provider can run (§7 item 4). Empty = no trial path (fail closed at\n * publish — a paid/free-trial funnel on this provider can't be produced yet).\n */\n trialShapes: TrialShape[]\n /** Supported surfaces → per-surface capabilities. **Absent = not supported.** */\n surfaces: Partial<Record<CheckoutSurface, SurfaceCapability>>\n}\n\n/** Reliable off-session after this surface (we/the provider hold a chargeable method). */\nconst ON: SurfaceCapability = { purchase: true, wallets: true, offSession: 'reliable' }\n/** Stripe-managed checkout: a purchase works, but the off-session upsell may decline. */\nconst MANAGED: SurfaceCapability = { purchase: true, wallets: true, offSession: 'conditional' }\n/** Orchestrator-routed (Primer): off-session depends on which PSP vaulted the method. */\nconst ROUTED: SurfaceCapability = { purchase: true, wallets: true, offSession: 'conditional' }\n/**\n * Paddle **Express Checkout** (Apple-Pay-first mobile variant of Paddle.js checkout, shipped\n * 2026-04-27 — https://developer.paddle.com/changelog/2026/apple-pay-express-checkout/). Paddle\n * genuinely offers it (MoR, so it's their hosted/inline frame surfaced wallet-first, NOT a raw\n * wallet element in our UI), which is why it's a distinct `express` surface here rather than only\n * the `wallets` flag already true on Paddle's embedded/popup. But our Paddle DRIVER doesn't render\n * it yet (drivers/paddle.tsx opens the standard embedded/overlay checkout regardless of surface),\n * so `driver: 'planned'` fails it closed at publish — the matrix records reality without promising\n * a wallet-first render the runtime can't produce. Off-session stays reliable (provider-token, MoR).\n */\nconst PADDLE_EXPRESS: SurfaceCapability = { purchase: true, wallets: true, offSession: 'reliable', driver: 'planned' }\nconst ALL_UPSELLS: UpsellKind[] = ['subscription', 'one-time', 'upgrade']\n\n/**\n * Provider capabilities (researched 2026-06-23 against provider docs + Funnelfox;\n * trial mechanics re-verified 2026-07-02, doc 09 §4.4).\n *\n * Three real-world corrections to the naive model:\n * 1. **Off-session upsell support is per-provider by *kind*** (`offSessionUpsells`):\n * Paddle can't stack a 2nd concurrent subscription (upgrade + one-time only);\n * Stripe/SolidGate/Whop/Primer can do all kinds.\n * 2. **Off-session *reliability* varies by the paywall surface** (`SurfaceCapability.\n * offSession`): Stripe **managed** checkout (`embedded`/`redirect`) upsells as a\n * direct charge against Stripe's vault → `conditional` (may decline); Elements\n * surfaces are `reliable`. Primer is `conditional` everywhere (PSP-dependent).\n * 3. **Surface availability is a hard constraint.** MoR/managed providers can't\n * expose a raw card field to your own UI: Paddle has no `express`/`element`/your\n * `sheet`; Whop has no raw `element`/`express`; Primer has no hosted `redirect`;\n * Stripe/SolidGate have no `popup`. A missing entry means \"not possible.\"\n */\nexport const PROVIDER_PROFILES: Record<CheckoutProvider, ProviderProfile> = {\n // PSP; you hold the PaymentMethod and fire your own off-session PaymentIntent on\n // the Elements surfaces (reliable). **Managed** Checkout (`embedded`/`redirect`)\n // upsells too, but as a direct charge against Stripe's vaulted card → conditional.\n // No provider \"popup\" surface.\n stripe: {\n isMoR: false, offSessionUpsells: ALL_UPSELLS, tokenModel: 'merchant', orchestrator: false, status: 'full',\n // Composed trials: paid = fee PaymentIntent + sub (trial_period_days); free = SetupIntent vault\n // + trial sub (services/checkout/stripe-trial.ts).\n trialShapes: ['paid_composed', 'free_vault'],\n surfaces: { express: ON, element: ON, sheet: ON, embedded: MANAGED, redirect: MANAGED },\n },\n // Merchant-of-Record; raw card entry is always Paddle's frame → no own element/sheet.\n // `express` IS now present (Apple-Pay-first Express Checkout, shipped 2026-04-27) but is\n // driver-planned (PADDLE_EXPRESS) → publish fails it closed until the driver renders it.\n // Off-session via subscription one-time charge / collection_mode, but **no 2nd concurrent\n // subscription** (upgrade + one-time only), provider-initiated.\n paddle: {\n isMoR: true, offSessionUpsells: ['one-time', 'upgrade'], tokenModel: 'provider', orchestrator: false, status: 'full',\n // Native trials: the price itself carries the trial, Paddle collects up front / vaults\n // (services/checkout/paddle-checkout.ts — \"Paddle paid trials are NATIVE\").\n trialShapes: ['paid_native', 'free_native'],\n surfaces: { embedded: ON, popup: ON, redirect: ON, express: PADDLE_EXPRESS },\n },\n // Merchant-of-Record; iframe-only (no raw card field). Off-session works\n // (provider-initiated, async via webhooks). `sheet` = our chrome hosting their embed.\n // Trial shape not yet researched → empty (fail closed until the driver + profile land).\n whop: {\n isMoR: true, offSessionUpsells: ALL_UPSELLS, tokenModel: 'provider', orchestrator: false, status: 'planned',\n trialShapes: [],\n surfaces: { embedded: ON, redirect: ON, sheet: ON },\n },\n // Pure orchestrator (PSP-side); Headless renders express/element/sheet/embedded.\n // No hosted redirect page, no popup checkout. Off-session is PSP-conditional —\n // the vault lives with whichever processor Primer routed to (data matches this\n // comment as of 2026-07-02; it previously said conditional but coded reliable).\n primer: {\n isMoR: false, offSessionUpsells: ALL_UPSELLS, tokenModel: 'merchant', orchestrator: true, status: 'planned',\n trialShapes: [],\n surfaces: { express: ROUTED, element: ROUTED, sheet: ROUTED, embedded: ROUTED },\n },\n // PSP **and** orchestrator (own acquiring + connectors routing across Stripe/Adyen/\n // PayPal). One Payment Form (element/sheet/embedded) + hosted page + wallet button.\n // Strong native off-session (Recurring API). No popup.\n solidgate: {\n isMoR: false, offSessionUpsells: ALL_UPSELLS, tokenModel: 'merchant', orchestrator: true, status: 'planned',\n trialShapes: [],\n surfaces: { express: ON, element: ON, sheet: ON, embedded: ON, redirect: ON },\n },\n}\n\nexport interface ValidationResult {\n ok: boolean\n reason?: string\n /** Non-fatal caveat (e.g. Paddle upgrade-only). */\n note?: string\n}\n\n/** Surfaces a provider supports, for the editor/AI to steer authors. */\nexport function surfacesFor(provider: CheckoutProvider): CheckoutSurface[] {\n return Object.keys(PROVIDER_PROFILES[provider]?.surfaces ?? {}) as CheckoutSurface[]\n}\n\n/** Whether a provider is a Merchant of Record (it owns tax/compliance). */\nexport function isMerchantOfRecord(provider: CheckoutProvider): boolean {\n return PROVIDER_PROFILES[provider]?.isMoR ?? false\n}\n\n/** Whether a provider routes across multiple processors (Primer, SolidGate). */\nexport function isOrchestrator(provider: CheckoutProvider): boolean {\n return PROVIDER_PROFILES[provider]?.orchestrator ?? false\n}\n\n/**\n * Validate a (provider, surface) for a **purchase**: the surface must exist for\n * the provider and accept a payment. Surface availability is the real constraint\n * (e.g. Paddle has no `element`).\n */\nexport function validateCheckout(provider: CheckoutProvider, surface: CheckoutSurface): ValidationResult {\n const cap = PROVIDER_PROFILES[provider]?.surfaces[surface]\n if (!cap) return { ok: false, reason: `${provider} has no '${surface}' surface` }\n if (!cap.purchase) return { ok: false, reason: `'${surface}' can't take a purchase on ${provider}` }\n // The provider offers this surface but our driver can't render it yet (e.g. Paddle Express\n // Checkout) → fail closed so publish never promises a surface the runtime can't produce.\n if (cap.driver === 'planned') return { ok: false, reason: `${provider} '${surface}' checkout isn't renderable yet (the provider ships it, but our driver doesn't render it)` }\n return { ok: true }\n}\n\n/** Trial shapes a provider can compose (empty = it can't run a trial offer yet). */\nexport function trialShapesFor(provider: CheckoutProvider): TrialShape[] {\n return PROVIDER_PROFILES[provider]?.trialShapes ?? []\n}\n\n/**\n * Validate that a provider can run a TRIAL (§7 item 4). Pass a specific {@link TrialShape} to\n * check that exact shape; omit it to assert the provider supports *any* trial (the cheap gate\n * check when only the offering's TRIAL-role binding existence is known). A provider with no\n * trial shapes (every planned provider) fails closed.\n */\nexport function validateTrial(provider: CheckoutProvider, shape?: TrialShape): ValidationResult {\n const profile = PROVIDER_PROFILES[provider]\n if (!profile) return { ok: false, reason: `unknown provider '${provider}'` }\n const shapes = profile.trialShapes\n if (shapes.length === 0) return { ok: false, reason: `${provider} can't run a trial offer yet` }\n if (shape && !shapes.includes(shape)) {\n return { ok: false, reason: `${provider} doesn't support a '${shape}' trial (it supports: ${shapes.join(', ')})` }\n }\n return { ok: true }\n}\n\n/**\n * Validate an **off-session upsell** of `kind` after a purchase made on\n * `paywallSurface`. Combines provider support for the kind (Paddle can't stack a\n * 2nd subscription) with the paywall surface's off-session reliability (Stripe\n * managed checkout is `conditional` — returned as a `note`, not a hard block).\n */\nexport function validateUpsell(\n provider: CheckoutProvider,\n paywallSurface: CheckoutSurface,\n kind: UpsellKind = 'subscription',\n): ValidationResult {\n const profile = PROVIDER_PROFILES[provider]\n if (!profile) return { ok: false, reason: `unknown provider '${provider}'` }\n if (!profile.offSessionUpsells.includes(kind)) {\n const can = profile.offSessionUpsells.length ? ` (it supports: ${profile.offSessionUpsells.join(', ')})` : ''\n return { ok: false, reason: `${provider} can't charge a '${kind}' upsell off-session${can}` }\n }\n const cap = profile.surfaces[paywallSurface]\n if (!cap) return { ok: false, reason: `${provider} has no '${paywallSurface}' surface to upsell after` }\n if (cap.offSession === 'none') {\n return { ok: false, reason: `a purchase on '${paywallSurface}' retains no chargeable method for an upsell` }\n }\n if (cap.offSession === 'conditional') {\n return { ok: true, note: `off-session upsell after ${provider} '${paywallSurface}' may decline — prefer a reliable surface or wire an on-session fallback` }\n }\n return { ok: true }\n}\n\n// ── Checkout error taxonomy (pure — drivers + server both normalize into it) ──\n\n/**\n * Normalized failure category — the driver/platform maps each provider's decline\n * codes into one of these so funnels can route/recover by reason. `authentication_\n * required` (3DS/SCA) and `requires_payment_method` are the cases an **off-session**\n * upsell can't satisfy → recover on-session (re-collect a card).\n */\nexport type CheckoutErrorCategory =\n | 'card_declined'\n | 'insufficient_funds'\n | 'expired_card'\n | 'prepaid_card' // card funding is prepaid — trials/subscriptions commonly decline; route to a real-card recapture page\n | 'authentication_required' // SCA/3DS needed — off-session can't challenge\n | 'requires_payment_method' // no usable saved method\n | 'processing_error'\n | 'canceled'\n | 'unknown'\n\nexport interface CheckoutError {\n category: CheckoutErrorCategory\n message: string\n /** Raw provider decline code, if any (e.g. Stripe `card_declined`/`insufficient_funds`). */\n declineCode?: string\n /** Whether re-attempting (e.g. an on-session re-collection) may succeed. */\n retryable: boolean\n}\n\n/** Build a {@link CheckoutError} (driver/test helper). */\nexport function checkoutError(\n category: CheckoutErrorCategory,\n message: string,\n extra: { declineCode?: string; retryable?: boolean } = {},\n): CheckoutError {\n const retryable = extra.retryable ?? (category === 'authentication_required' || category === 'requires_payment_method' || category === 'processing_error')\n return { category, message, declineCode: extra.declineCode, retryable }\n}\n"]}