@owlmeans/web-payment 0.1.18-rc.30 → 0.1.18-rc.32

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 (218) hide show
  1. package/README.md +4 -3
  2. package/agent-meta/manifest.json +2 -2
  3. package/agent-meta/skills/web-payment/SKILL.md +44 -31
  4. package/build/amount/types.d.ts +10 -0
  5. package/build/amount/types.d.ts.map +1 -0
  6. package/build/amount/types.js +2 -0
  7. package/build/amount/types.js.map +1 -0
  8. package/build/amount.d.ts +3 -4
  9. package/build/amount.d.ts.map +1 -1
  10. package/build/amount.js +24 -21
  11. package/build/amount.js.map +1 -1
  12. package/build/checkout-limit.d.ts.map +1 -1
  13. package/build/checkout-limit.js +4 -5
  14. package/build/checkout-limit.js.map +1 -1
  15. package/build/consts.d.ts +3 -0
  16. package/build/consts.d.ts.map +1 -0
  17. package/build/consts.js +3 -0
  18. package/build/consts.js.map +1 -0
  19. package/build/consts.local.d.ts +8 -0
  20. package/build/consts.local.d.ts.map +1 -0
  21. package/build/consts.local.js +17 -0
  22. package/build/consts.local.js.map +1 -0
  23. package/build/consumer/cancellation.d.ts.map +1 -1
  24. package/build/consumer/cancellation.js +5 -5
  25. package/build/consumer/cancellation.js.map +1 -1
  26. package/build/consumer/consts.d.ts +3 -0
  27. package/build/consumer/consts.d.ts.map +1 -0
  28. package/build/consumer/consts.js +3 -0
  29. package/build/consumer/consts.js.map +1 -0
  30. package/build/consumer/consts.local.d.ts +7 -0
  31. package/build/consumer/consts.local.d.ts.map +1 -0
  32. package/build/consumer/consts.local.js +7 -0
  33. package/build/consumer/consts.local.js.map +1 -0
  34. package/build/consumer/copy/types.d.ts +20 -0
  35. package/build/consumer/copy/types.d.ts.map +1 -0
  36. package/build/consumer/copy/types.js +2 -0
  37. package/build/consumer/copy/types.js.map +1 -0
  38. package/build/consumer/copy.d.ts +7 -21
  39. package/build/consumer/copy.d.ts.map +1 -1
  40. package/build/consumer/copy.js +55 -64
  41. package/build/consumer/copy.js.map +1 -1
  42. package/build/consumer/ensure.d.ts +1 -42
  43. package/build/consumer/ensure.d.ts.map +1 -1
  44. package/build/consumer/ensure.js +3 -2
  45. package/build/consumer/ensure.js.map +1 -1
  46. package/build/consumer/errors.d.ts +13 -0
  47. package/build/consumer/errors.d.ts.map +1 -0
  48. package/build/consumer/errors.js +26 -0
  49. package/build/consumer/errors.js.map +1 -0
  50. package/build/consumer/fields.d.ts +1 -32
  51. package/build/consumer/fields.d.ts.map +1 -1
  52. package/build/consumer/fields.js +1 -2
  53. package/build/consumer/fields.js.map +1 -1
  54. package/build/consumer/hooks.d.ts +7 -86
  55. package/build/consumer/hooks.d.ts.map +1 -1
  56. package/build/consumer/hooks.js +13 -8
  57. package/build/consumer/hooks.js.map +1 -1
  58. package/build/consumer/index.d.ts +4 -1
  59. package/build/consumer/index.d.ts.map +1 -1
  60. package/build/consumer/index.js +1 -0
  61. package/build/consumer/index.js.map +1 -1
  62. package/build/consumer/legal.d.ts +2 -25
  63. package/build/consumer/legal.d.ts.map +1 -1
  64. package/build/consumer/legal.js +7 -6
  65. package/build/consumer/legal.js.map +1 -1
  66. package/build/consumer/performance-consent-dialog.d.ts +4 -2
  67. package/build/consumer/performance-consent-dialog.d.ts.map +1 -1
  68. package/build/consumer/performance-consent-dialog.js +15 -11
  69. package/build/consumer/performance-consent-dialog.js.map +1 -1
  70. package/build/consumer/provider.d.ts +3 -17
  71. package/build/consumer/provider.d.ts.map +1 -1
  72. package/build/consumer/provider.js.map +1 -1
  73. package/build/consumer/refusal/types.d.ts +29 -0
  74. package/build/consumer/refusal/types.d.ts.map +1 -0
  75. package/build/consumer/refusal/types.js +2 -0
  76. package/build/consumer/refusal/types.js.map +1 -0
  77. package/build/consumer/refusal.d.ts +6 -32
  78. package/build/consumer/refusal.d.ts.map +1 -1
  79. package/build/consumer/refusal.js +53 -90
  80. package/build/consumer/refusal.js.map +1 -1
  81. package/build/consumer/subscription-start-dialog.d.ts +7 -4
  82. package/build/consumer/subscription-start-dialog.d.ts.map +1 -1
  83. package/build/consumer/subscription-start-dialog.js +12 -9
  84. package/build/consumer/subscription-start-dialog.js.map +1 -1
  85. package/build/consumer/types.d.ts +198 -2
  86. package/build/consumer/types.d.ts.map +1 -1
  87. package/build/consumer/types.local.d.ts +21 -0
  88. package/build/consumer/types.local.d.ts.map +1 -0
  89. package/build/consumer/types.local.js +2 -0
  90. package/build/consumer/types.local.js.map +1 -0
  91. package/build/consumer/withdrawal.d.ts.map +1 -1
  92. package/build/consumer/withdrawal.js +12 -11
  93. package/build/consumer/withdrawal.js.map +1 -1
  94. package/build/copy.d.ts +1 -5
  95. package/build/copy.d.ts.map +1 -1
  96. package/build/copy.js +2 -2
  97. package/build/copy.js.map +1 -1
  98. package/build/dialog.d.ts.map +1 -1
  99. package/build/dialog.js +25 -17
  100. package/build/dialog.js.map +1 -1
  101. package/build/entitlement.d.ts +2 -3
  102. package/build/entitlement.d.ts.map +1 -1
  103. package/build/entitlement.js +5 -5
  104. package/build/entitlement.js.map +1 -1
  105. package/build/estimate-summary.d.ts +1 -33
  106. package/build/estimate-summary.d.ts.map +1 -1
  107. package/build/estimate-summary.js +5 -5
  108. package/build/estimate-summary.js.map +1 -1
  109. package/build/estimate.d.ts +1 -15
  110. package/build/estimate.d.ts.map +1 -1
  111. package/build/estimate.js +1 -1
  112. package/build/estimate.js.map +1 -1
  113. package/build/format/types.d.ts +18 -0
  114. package/build/format/types.d.ts.map +1 -0
  115. package/build/format/types.js +2 -0
  116. package/build/format/types.js.map +1 -0
  117. package/build/format.d.ts +3 -14
  118. package/build/format.d.ts.map +1 -1
  119. package/build/format.js +61 -66
  120. package/build/format.js.map +1 -1
  121. package/build/hooks.d.ts +1 -2
  122. package/build/hooks.d.ts.map +1 -1
  123. package/build/hooks.js.map +1 -1
  124. package/build/i18n/be.json +1 -1
  125. package/build/i18n/de.json +1 -1
  126. package/build/i18n/en.json +1 -1
  127. package/build/i18n/es.json +1 -1
  128. package/build/i18n/fr.json +1 -1
  129. package/build/i18n/pl.json +1 -1
  130. package/build/i18n/ru.json +1 -1
  131. package/build/i18n/uk.json +1 -1
  132. package/build/i18n.d.ts +1 -2
  133. package/build/i18n.d.ts.map +1 -1
  134. package/build/i18n.js +10 -11
  135. package/build/i18n.js.map +1 -1
  136. package/build/index.d.ts +4 -1
  137. package/build/index.d.ts.map +1 -1
  138. package/build/index.js +1 -1
  139. package/build/index.js.map +1 -1
  140. package/build/limit-meter.js +2 -2
  141. package/build/limit-meter.js.map +1 -1
  142. package/build/plan-card.d.ts.map +1 -1
  143. package/build/plan-card.js +3 -8
  144. package/build/plan-card.js.map +1 -1
  145. package/build/selectors/types.d.ts +21 -0
  146. package/build/selectors/types.d.ts.map +1 -0
  147. package/build/selectors/types.js +2 -0
  148. package/build/selectors/types.js.map +1 -0
  149. package/build/selectors.d.ts +8 -12
  150. package/build/selectors.d.ts.map +1 -1
  151. package/build/selectors.js +72 -76
  152. package/build/selectors.js.map +1 -1
  153. package/build/service.d.ts +1 -1
  154. package/build/service.d.ts.map +1 -1
  155. package/build/service.js +0 -1
  156. package/build/service.js.map +1 -1
  157. package/build/types.d.ts +53 -2
  158. package/build/types.d.ts.map +1 -1
  159. package/package.json +25 -25
  160. package/src/amount/types.ts +9 -0
  161. package/src/amount.ts +25 -18
  162. package/src/checkout-limit.tsx +4 -6
  163. package/src/consts.local.ts +21 -0
  164. package/src/consts.ts +2 -0
  165. package/src/consumer/cancellation.tsx +8 -9
  166. package/src/consumer/consts.local.ts +9 -0
  167. package/src/consumer/consts.ts +2 -0
  168. package/src/consumer/copy/types.ts +20 -0
  169. package/src/consumer/copy.ts +56 -68
  170. package/src/consumer/ensure.ts +4 -48
  171. package/src/consumer/errors.ts +30 -0
  172. package/src/consumer/fields.tsx +2 -36
  173. package/src/consumer/hooks.ts +19 -108
  174. package/src/consumer/index.ts +4 -1
  175. package/src/consumer/legal.tsx +8 -33
  176. package/src/consumer/performance-consent-dialog.tsx +17 -12
  177. package/src/consumer/provider.tsx +6 -17
  178. package/src/consumer/refusal/types.ts +29 -0
  179. package/src/consumer/refusal.ts +56 -95
  180. package/src/consumer/subscription-start-dialog.tsx +14 -10
  181. package/src/consumer/types.local.ts +23 -0
  182. package/src/consumer/types.ts +216 -6
  183. package/src/consumer/withdrawal.tsx +15 -26
  184. package/src/copy.tsx +3 -8
  185. package/src/dialog.tsx +62 -44
  186. package/src/entitlement.ts +7 -8
  187. package/src/estimate-summary.tsx +7 -41
  188. package/src/estimate.ts +2 -18
  189. package/src/format/types.ts +17 -0
  190. package/src/format.ts +56 -58
  191. package/src/hooks.ts +2 -2
  192. package/src/i18n/be.json +1 -1
  193. package/src/i18n/de.json +1 -1
  194. package/src/i18n/en.json +1 -1
  195. package/src/i18n/es.json +1 -1
  196. package/src/i18n/fr.json +1 -1
  197. package/src/i18n/pl.json +1 -1
  198. package/src/i18n/ru.json +1 -1
  199. package/src/i18n/uk.json +1 -1
  200. package/src/i18n.ts +11 -12
  201. package/src/index.ts +4 -1
  202. package/src/limit-meter.tsx +2 -2
  203. package/src/plan-card.tsx +4 -10
  204. package/src/selectors/types.ts +21 -0
  205. package/src/selectors.ts +83 -79
  206. package/src/service.ts +2 -1
  207. package/src/types.ts +61 -1
  208. package/tests/amount.spec.ts +6 -6
  209. package/tests/consent-refusal.spec.ts +31 -32
  210. package/tests/consumer-hooks.spec.ts +1 -1
  211. package/tests/consumer.spec.ts +83 -2
  212. package/tests/dialog.spec.ts +17 -3
  213. package/tests/entitlement.spec.ts +19 -19
  214. package/tests/harness/consumer-fixtures.ts +5 -4
  215. package/tests/harness/consumer.tsx +6 -5
  216. package/tests/harness/entitlement.tsx +4 -5
  217. package/tests/harness/mount.tsx +4 -0
  218. package/tests/pieces.spec.ts +2 -2
package/README.md CHANGED
@@ -34,8 +34,9 @@ tokens, integer minor units, and the packaged seven-language `web-payment` resou
34
34
  revives its ISO dates; `null` means "not known yet", so render paid controls disabled until it
35
35
  answers. Read it with `useCapability(view, param)` (`boolean | null`) and `useLimit(view, key)`
36
36
  (the limit row plus `exhausted` and a `ratio` clamped to `[0, 1]`). An application that keeps the
37
- view in its own store uses the pure selectors instead — `capabilityStateOf`, `limitStatusOf`,
38
- `planStatusLineOf`, `promoInscriptionOf` — and never polls a second time.
37
+ view in its own store uses the pure selectors instead — `entitlementSelectorHelper`'s
38
+ `capabilityStateOf`, `limitStatusOf`, `planStatusLineOf`, `promoInscriptionOf` — and never polls a
39
+ second time.
39
40
 
40
41
  ```tsx
41
42
  const view = useEntitlementView(ctx.entrypoint(account.entitlements))
@@ -65,7 +66,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
65
66
  your project's skill store (`.agents/skills/`):
66
67
 
67
68
  ```sh
68
- npx @owlmeans/agent-skills@^0.1.18-rc.46
69
+ npx @owlmeans/agent-skills@^0.1.18-rc.49
69
70
  ```
70
71
 
71
72
  The embedded files are version-matched to this package release. Do not edit them
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 2,
3
3
  "package": "@owlmeans/web-payment",
4
- "version": "0.1.18-rc.30",
5
- "generatedAt": "2026-10-03T15:33:53.024Z",
4
+ "version": "0.1.18-rc.32",
5
+ "generatedAt": "2026-10-05T21:03:06.404Z",
6
6
  "canonicalRepo": "https://github.com/owlmeans/common",
7
7
  "entries": [
8
8
  {
@@ -7,7 +7,7 @@ user-invocable: false
7
7
 
8
8
  # @owlmeans/web-payment
9
9
 
10
- **Install:** `bun add @owlmeans/web-payment@^0.1.18-rc.30`
10
+ **Install:** `bun add @owlmeans/web-payment@^0.1.18-rc.32`
11
11
 
12
12
  Public MIT web package paired with `@owlmeans/server-payment`. It incorporates checkout, balance,
13
13
  entitlement and shallow-auth helpers over the underlying `@owlmeans/client-payment` service, plus
@@ -35,7 +35,7 @@ await checkout(ctx.entrypoint(account.topUp), { body: { amountMinor } })
35
35
 
36
36
  | Hook | Answers |
37
37
  |---|---|
38
- | `useEntitlementView(entry, intervalMs = 60_000, deps = [], ...request)` | The polled `EntitlementView`, revived (`reviveEntitlementView`) so every date is a `Date`; `null` until the first answer. Trailing `request` arguments are the protocol's `CallArguments`. |
38
+ | `useEntitlementView(entry, intervalMs = 60_000, deps = [], ...request)` | The polled `EntitlementView`, revived (`entitlementViewHelper.reviveEntitlementView`) so every date is a `Date`; `null` until the first answer. Trailing `request` arguments are the protocol's `CallArguments`. |
39
39
  | `useCapability(view, param)` | `boolean \| null` — the capability predicate over granted rows; `null` for a null view. |
40
40
  | `useLimit(view, key)` | `LimitStatus \| null` — the `LimitView` plus `exhausted` and `ratio`; `null` for a null view or an undeclared key. |
41
41
  | `usePortal(flow, target = '_self')` | `{ portal(entry, request?), pending }` — calls a protocol whose body is a `PortalLinkBody` with `body.flow = flow`, then `openCheckout(url, target)`. The caller's arguments omit `flow` (a compile error otherwise); navigation is inert without a DOM. |
@@ -51,12 +51,12 @@ await checkout(ctx.entrypoint(account.topUp), { body: { amountMinor } })
51
51
 
52
52
  | Selector | Returns |
53
53
  |---|---|
54
- | `capabilityStateOf(view, param)` | `boolean \| null` — what `useCapability` memoizes |
55
- | `limitStatusOf(limitView)` | `LimitStatus \| null` — `exhausted = remaining < 1` (a `limit: 0` row is exhausted); `ratio = used / limit` clamped to `[0, 1]`, and for a `0` ceiling `1` once anything is used, else `0` |
56
- | `planStatusLineOf(planView)` | `{ kind, tone, date? }` — first match: `created`/`canceled`/`expired`/`ended` (inactive), `blocked` (critical), `paused` (a `pausedAt`, warning), `suspended` (critical), `trial` (`trialEnd`), `past-due` (warning), `cancel-scheduled` (`periodEnd`, warning), `free`, `renews` (`periodEnd`), `active` |
57
- | `promoInscriptionOf(promoView)` | `'free-until'` (active, not grandfathered) · `'grandfathered'` (active, grandfathered) · `'ended'` (inactive) · `null` |
54
+ | `entitlementSelectorHelper.capabilityStateOf(view, param)` | `boolean \| null` — what `useCapability` memoizes |
55
+ | `entitlementSelectorHelper.limitStatusOf(limitView)` | `LimitStatus \| null` — `exhausted = remaining < 1` (a `limit: 0` row is exhausted); `ratio = used / limit` clamped to `[0, 1]`, and for a `0` ceiling `1` once anything is used, else `0` |
56
+ | `entitlementSelectorHelper.planStatusLineOf(planView)` | `{ kind, tone, date? }` — first match: `created`/`canceled`/`expired`/`ended` (inactive), `blocked` (critical), `paused` (a `pausedAt`, warning), `suspended` (critical), `trial` (`trialEnd`), `past-due` (warning), `cancel-scheduled` (`periodEnd`, warning), `free`, `renews` (`periodEnd`), `active` |
57
+ | `entitlementSelectorHelper.promoInscriptionOf(promoView)` | `'free-until'` (active, not grandfathered) · `'grandfathered'` (active, grandfathered) · `'ended'` (inactive) · `null` |
58
58
 
59
- Use these, plus `capabilityOf` / `limitOf` / `hasLimitRoom` from `@owlmeans/payment`, wherever the
59
+ Use these, plus `planLimitHelper.capabilityOf` / `.limitOf` / `.hasLimitRoom` from `@owlmeans/payment`, wherever the
60
60
  browser decides something; the server gate uses the same predicates, so a disabled button and a
61
61
  403 cannot disagree.
62
62
 
@@ -88,23 +88,35 @@ and action text come from the application). Every one accepts `className`.
88
88
  The dialog takes `{ open, onOpenChange, policy, pending, disabled?, onConfirm, estimate?, limit?, legalNote?, details? }`.
89
89
  It keeps integer minor units, accepts locale decimal separators and at most two decimals, shows
90
90
  configured presets plus custom input, and reports below/above-bound errors without clamping.
91
- Confirmation is disabled when invalid or pending.
91
+ Confirmation is disabled when invalid or pending. The dialog body scrolls (`max-h-[90vh]
92
+ overflow-y-auto`, like the consent dialogs): the tier `details`, the estimate and the legal note can
93
+ outgrow a short screen, and the confirm button must stay reachable — never render it outside.
92
94
 
93
- It shows net credit value, processing adjustment and pre-tax subtotal from `chargeAmountMinor`.
95
+ It shows net credit value, processing adjustment and pre-tax subtotal from `checkoutPricingHelper.chargeAmountMinor`.
94
96
  With no `estimate`, the plain note that Stripe calculates applicable tax; with one, `PriceEstimateSummary`
95
97
  renders instead (see below) against the SAME `chargeMinor`, so the country picker and its numbers
96
98
  track whatever the buyer has typed. The policy maximum bounds net credit, not the adjusted or
97
99
  tax-inclusive debit.
98
100
 
99
101
  - **`limit`** (`AmountPolicyView.limit`, what the entity may buy NOW) narrows `policy` through
100
- `@owlmeans/payment`'s `narrowAmountPolicy` — the same computation the server refuses with
102
+ `@owlmeans/payment`'s `amountNarrowingHelper.narrowAmountPolicy` — the same computation the server refuses with
101
103
  (`CheckoutLimitExceeded`), so the control and a refusal cannot disagree. Presets above the
102
104
  maximum disappear, the default is clamped, the above-bound error names the narrowed maximum
103
105
  ("The most you can add right now is …"), and a `CheckoutLimitNote` shows above the presets.
104
106
  `policy` may be the plan's or one already narrowed (`AmountPolicyView.policy`) — narrowing is
105
107
  idempotent. **`blocked`** disables the presets, the input and the confirm button; the pinned
106
- policy `narrowAmountPolicy` returns for a block is never an offer of the minimum.
107
- - **`details`** is a reusable application-owned React slot after the limit note and before amounts.
108
+ policy `.narrowAmountPolicy` returns for a block is never an offer of the minimum.
109
+ - **`details`** is a reusable application-owned React slot (`[data-amount-details]`), the dialog's
110
+ SIDE column, holding the `CheckoutLimitNote` ("You can add up to …") above the details. With it the
111
+ dialog is sized by the window — `w-[90vw]`, `lg:w-[50vw]` from a landscape tablet up — and every
112
+ base cap is replaced by its twin (`max-w-none`, `sm:max-w-none`). The two blocks are a WRAPPING
113
+ flex row filling the content box: purchase `flex-3 min-w-60`, side `flex-2 min-w-44` (basis 0, so
114
+ side : purchase is exactly 2 : 3), `gap-x-6` (the dialog's padding) between them. The whole side
115
+ column drops under the purchase block, above the `legalNote` and the buttons, once the dialog
116
+ cannot hold both minimums — never a viewport breakpoint — so the confirm button's right edge is
117
+ the side column's, or the purchase block's when it is alone. The preset buttons answer to their
118
+ own container (`@container` + `@sm:grid-cols-4`). No `details` keeps the single narrow column with
119
+ the limit note above the presets.
108
120
  `disabled` prevents amount selection and submission while application reads are unavailable;
109
121
  cancel remains usable. Applications own loading, failed-read, retry and refreshed-limit details.
110
122
  - **`legalNote`** is a slot right above the buttons for the application's legal line (the EU
@@ -151,7 +163,7 @@ const team = usePriceEstimate(entry, { enabled, country, onCountryChange: setCou
151
163
  shares it. `disabled` (a locked country) disables it; `note` is a line under it. Selectors
152
164
  `[data-country-select]` with `data-locked` and `data-country`, `[data-country-note]`.
153
165
  - **`PriceEstimateAmount({ control, subtotalMinor, currency, suffix?, className? })`** is the
154
- numbers alone, no picker: via `estimateOf` re-derived against `subtotalMinor`, a rate row for a
166
+ numbers alone, no picker: via `priceEstimateHelper.estimateOf` re-derived against `subtotalMinor`, a rate row for a
155
167
  `taxed` status, an estimated total, and one sentence for every status that leaves no number to
156
168
  trust (reverse charge, no tax, "at checkout", "choose a country"). `data-price-estimate` /
157
169
  `data-status` are stable test hooks.
@@ -169,26 +181,27 @@ const team = usePriceEstimate(entry, { enabled, country, onCountryChange: setCou
169
181
 
170
182
  `import { … } from '@owlmeans/web-payment/consumer'` — a separate subpath, so an application that
171
183
  never renders them needs neither their checkbox primitive nor its peer. Legal text comes from
172
- `@owlmeans/payment`'s `payment-consumer-rights` copy (`consumerText`, `legalLabelsOf`,
173
- `consentStatementOf` render the same strings the server records and mails); the interface text
184
+ `@owlmeans/payment`'s `payment-consumer-rights` copy (`consumerCopyHelper.consumerText`, `.legalLabelsOf`,
185
+ `.consentStatementOf` render the same strings the server records and mails); the interface text
174
186
  comes from this package's `web-payment` resource. Neither carries product copy: the trader, the
175
187
  plan title and the price line are the view's or the application's.
176
188
 
177
189
  **The language rule.** A consent or statutory function is shown in the CONTRACT language — the
178
190
  billing country's (`view.language`, `list.language`, the `language` prop) — with a toggle to the
179
191
  interface language and back (`useShownLanguage`, `LanguageToggle`). The whole piece switches: the
180
- legal copy through `legalTextOf(lng)`, the interface strings through `paymentTextOf(lng)` (both
181
- read any language without i18next and without draining a bundle — `resolveI18nResource`), dates
192
+ legal copy through `fixedTextHelper.legalTextOf(lng)` (a `LegalText`: `(path, values?, context?)`, the context
193
+ reading the `<path>_<context>` variant first), the interface strings through `.paymentTextOf(lng)` (both
194
+ read any language without i18next and without draining a bundle — `i18nHelper.resolveI18nResource`), dates
182
195
  and amounts through `Intl` in that language. The toggle alone is phrased in the INTERFACE language
183
196
  ("Show in German") — the reader who needs it reads that one. The links follow the shown language
184
- (`links` prop: a record by language or a function such as `lng => linksOf(policy, lng)`; absent,
197
+ (`links` prop: a record by language or a function such as `lng => consumerRightsPolicyHelper.linksOf(policy, lng)`; absent,
185
198
  the view's own). What a person agrees to is what was on screen: toggling un-ticks the checkbox, and
186
199
  the recorded body names the language shown.
187
200
 
188
201
  | Piece | Props | Behaviour |
189
202
  |---|---|---|
190
- | `PerformanceConsentDialog` | `open, onOpenChange, view: PerformanceConsentView \| null, onConfirm(body: PerformanceConsentBody), onDecline?, uiLanguage?, pending?, error?, links?, onWithdraw?, formatAmount?` | Title and intro (count, last deadline), the purchases with date, amount and last withdrawal day (`performance-consent.purchase`), ONE checkbox carrying the whole statement (`performance-consent.checkbox` with `view.trader`), **unchecked by default**; confirm ("Start now" / "Jetzt beginnen" …) disabled until it is ticked; decline ("Not now"); links Billing Terms · Withdrawal information · the withdrawal function (a button when `onWithdraw`, else the links' `withdrawalFunction` page). `onConfirm` gets `{ purchaseIds, textVersion, language: <shown>, acknowledged: true, uiLanguage }`. |
191
- | `SubscriptionStartDialog` | `open, onOpenChange, view: SubscriptionStartView \| null, planTitle, price?: ReactNode, onConfirm(body: SubscriptionStartBody), onDecline?, uiLanguage?, pending?, error?, links?, onWithdraw?` | The same shape before a subscription checkout; confirm is "Continue to payment" — the step before the paygate's own order button. |
203
+ | `PerformanceConsentDialog` | `open, onOpenChange, view: PerformanceConsentView \| null, onConfirm(body: PerformanceConsentBody), onDecline?, uiLanguage?, pending?, error?, links?, onWithdraw?, formatAmount?` | Title and intro (count, last deadline), the purchases with date, amount and last withdrawal day (`performance-consent.purchase`), ONE checkbox carrying the whole statement (`performance-consent.checkbox` with `view.trader`), **unchecked by default**; a `view.context` shows the `_<context>` variants of the title, the intro and the checkbox — exactly the statement `consumerCopyHelper.consentStatementOf(lng, Performance, { trader, context })` records — and marks the dialog `data-consent-context`; confirm ("Start now" / "Jetzt beginnen" …) disabled until it is ticked; decline ("Not now"); links Billing Terms · Withdrawal information · the withdrawal function (a button when `onWithdraw`, else the links' `withdrawalFunction` page). `onConfirm` gets `{ purchaseIds, textVersion, language: <shown>, acknowledged: true, uiLanguage }`. |
204
+ | `SubscriptionStartDialog` | `open, onOpenChange, view: SubscriptionStartView \| null, planTitle, price?: ReactNode, onConfirm(body: SubscriptionStartBody), onDecline?, uiLanguage?, pending?, error?, links?, onWithdraw?` | The same shape before a subscription checkout; confirm is "Continue to payment" — the step before the paygate's own order button. The statement follows the plan's withdrawal arithmetic: a `view.context` (`consumerCopyHelper.startContextOf(plan)` on the server, `'units'`) shows the `_<context>` texts — exactly the statement `consumerCopyHelper.consentStatementOf(lng, SubscriptionStart, { trader, plan, context })` records — and marks the dialog `data-start-context`; without one the base (time-only) statement. |
192
205
  | `WithdrawalFunctionButton` | `language, onClick, uiLanguage?, disabled?, variant? = 'outline'` | The statutory entry ("Withdraw from contract here", "Vertrag widerrufen", "Renoncer au contrat ici", "Odstąp od umowy tutaj") in the contract language; the interface language's label as `title` when they differ. |
193
206
  | `WithdrawalForm` / `WithdrawalDialog` | `mode: 'in-app' \| 'public', language, onSubmit(body: WithdrawalBody), list?, defaults?, uiLanguage?, pending?, error?, receipt?, formatAmount?` (+ `open, onOpenChange` for the dialog; `onClose` for the form) | Three steps. **Form**: in-app a contract picker over `list.candidates` (bought, paid, last day, estimated refund), publicly a contract-reference field — plus name and e-mail, NOTHING else is asked (a public form also carries the honeypot). **Review**: the summary and the statutory confirm ("Confirm withdrawal", "Widerruf bestätigen", "Confirmer la rétractation", "Potwierdź odstąpienie od umowy"). **Receipt** (whenever `receipt` is set): the received sentence with date AND time in UTC, reference, status, refund. The dialog does not clear the receipt the application holds — reset it on close. |
194
207
  | `CancellationForm` | `mode, language, onSubmit(body: CancellationBody), defaults?, uiLanguage?, pending?, error?, receipt?, onPrint?, onClose?` | **Form**: kind (ordinary / extraordinary — the reason becomes required), name, contract or customer reference, effective (earliest / a date from today), e-mail, and a honeypot. **Summary** with the statutory confirm ("Cancel now", "Jetzt kündigen", "Notification de la résiliation", "Wypowiedz teraz"). **Receipt**: received date and time in UTC, the effective date when known, status, a print button (`onPrint`, default `window.print()`). |
@@ -227,7 +240,7 @@ useCancellation(cancel) → { submit, receipt, pending, error, reset, form }
227
240
  checkout's own refusal then decides), `null` on a decline.
228
241
  - **`withConsent(action)`** runs the action; on a SPEND-consent refusal it asks with
229
242
  `ensure({ force: true })` and retries exactly ONCE. A decline throws `ConsentDeclined`
230
- (`isConsentDeclined`); a second refusal and every other failure propagate unchanged. Outside a
243
+ (`consentRefusalHelper.isConsentDeclined`); a second refusal and every other failure propagate unchanged. Outside a
231
244
  provider the gate passes through (`ensure` → `true`, refusals propagate).
232
245
  - The asking state machine is `makeAsker` and the gate `makeConsentGate` (pure, React-free).
233
246
  - `dialog` / `form` objects are spread into ONE piece each; `form.error` is a boolean, the raw
@@ -235,23 +248,23 @@ useCancellation(cancel) → { submit, receipt, pending, error, reset, form }
235
248
 
236
249
  ### Recognising a consent refusal
237
250
 
238
- `isConsentRefusal(e)` — `consentRefusalOf(e) != null` (the class after the registry, or its marker
239
- in `message`/`type`) OR `httpStatusOf(e) === 428` (`@owlmeans/api/status`: a production body is only
251
+ `consentRefusalHelper.isConsentRefusal(e)` — `consentRefusalOf(e) != null` (the class after the registry, or its marker
252
+ in `message`/`type`) OR `apiStatusHelper.httpStatusOf(e) === 428` (`@owlmeans/api/status`: a production body is only
240
253
  an incident id, so the status is all that is left). Read on the error AND on what it wraps —
241
254
  `cause`, `error`, `original`, `originalError`, `inner`, `reason`, an aggregate's `errors`, and
242
255
  strings — five levels deep with a cycle guard, so a planning `CommitFailed`
243
256
  (`planning:commit-failed:<transition>:<the refusal's text>`) is recognised without depending on
244
- planning. `consentRefusalKindOf(e)` → `'performance' | 'subscription-start' | 'unknown'` (a bare
245
- 428) `| null`; `isPerformanceConsentRefusal(e)` is what the gate retries on (performance or
257
+ planning. `consentRefusalHelper.consentRefusalKindOf(e)` → `'performance' | 'subscription-start' | 'unknown'` (a bare
258
+ 428) `| null`; `.isPerformanceConsentRefusal(e)` is what the gate retries on (performance or
246
259
  unknown — never a subscription start).
247
260
 
248
261
  ### Selectors
249
262
 
250
263
  | Piece | Selectors |
251
264
  |---|---|
252
- | Spend consent | `[data-consent-dialog]` (also `[data-performance-consent]`) with `data-language` (shown), `data-contract-language`, `data-text-version`; `[data-consent-purchase]` with `data-purchase-id`, `data-deadline` (ISO); `[data-consent-statement]`; `[data-consent-checkbox]` (Radix `data-state`); `[data-consent-confirm]`; `[data-consent-decline]`; `[data-consent-language-toggle]` (also `[data-language-toggle]` with `data-target-language`) |
265
+ | Spend consent | `[data-consent-dialog]` (also `[data-performance-consent]`) with `data-language` (shown), `data-contract-language`, `data-text-version`, `data-consent-context` (only when the view has a context); `[data-consent-purchase]` with `data-purchase-id`, `data-deadline` (ISO); `[data-consent-statement]`; `[data-consent-checkbox]` (Radix `data-state`); `[data-consent-confirm]`; `[data-consent-decline]`; `[data-consent-language-toggle]` (also `[data-language-toggle]` with `data-target-language`) |
253
266
  | Legal links (both dialogs) | `[data-legal-links]`, `[data-legal-link="billing-terms" \| "withdrawal-information" \| "withdrawal-function"]` |
254
- | Subscription start | `[data-start-dialog]` (also `[data-subscription-start]`) with `data-language`, `data-contract-language`, `data-plan-sku`; `[data-start-statement]`, `[data-start-price]`, `[data-start-checkbox]`, `[data-start-confirm]`, `[data-start-decline]`, `[data-start-language-toggle]` |
267
+ | Subscription start | `[data-start-dialog]` (also `[data-subscription-start]`) with `data-language`, `data-contract-language`, `data-plan-sku`, `data-start-context` (only when the view has a context); `[data-start-statement]`, `[data-start-price]`, `[data-start-checkbox]`, `[data-start-confirm]`, `[data-start-decline]`, `[data-start-language-toggle]` |
255
268
  | Withdrawal | `[data-withdrawal-function]` (`data-language`); `[data-withdrawal-dialog]` (`data-language`, `data-step`); `[data-withdrawal-form]` with `data-withdrawal-step="form\|review\|receipt"` (also `data-step`, `data-mode`, `data-language`); `[data-withdrawal-candidate]` (`data-purchase-id`, `data-contract-ref`) and its radio `[data-withdrawal-candidate-input="<purchaseId>"]`; `[data-withdrawal-estimate]` (`data-refund-minor`); `[data-withdrawal-field="contract\|name\|email"]`; `[data-withdrawal-continue]`, `[data-withdrawal-back]`, `[data-withdrawal-confirm]`; `[data-withdrawal-receipt]` (`data-status`, `data-declaration-id`, `data-received-at`), `[data-withdrawal-reference]`, `[data-withdrawal-received-at]`, `[data-withdrawal-refund]`; `[data-withdrawal-language-toggle]` |
256
269
  | Cancellation | `[data-cancellation-form]` with `data-cancellation-step="form\|review\|receipt"` (also `data-step`, `data-mode`, `data-language`); `[data-cancellation-field="kind\|reason\|name\|contract\|effective\|date\|email"]` (kind radios carry `data-kind`, effective radios `data-effective`); `[data-cancellation-continue]`, `[data-cancellation-back]`, `[data-cancellation-confirm]`, `[data-cancellation-summary]`; `[data-cancellation-receipt]` (`data-status`, `data-declaration-id`, `data-received-at`, `data-effective-at`), `[data-cancellation-effective]`, `[data-cancellation-print]`; `[data-cancellation-language-toggle]` |
257
270
  | Honeypot | `[data-honeypot]` |
@@ -293,13 +306,13 @@ receipt labels, validation), `withdrawal` (candidate lines, estimate, kinds, `st
293
306
  unused credits ARE reimbursed). Every `WithdrawalStatus`, `CancellationStatus` (incl. `review` —
294
307
  extraordinary and unmatched public cancellations) and `PurchaseKind` value has its string; the
295
308
  spec iterates the enums, so a new status fails it until all eight languages phrase it.
296
- - The last withdrawal day shown anywhere is `@owlmeans/payment`'s `lastWithdrawalDayOf(deadline)`
309
+ - The last withdrawal day shown anywhere is `@owlmeans/payment`'s `withdrawalDeadlineHelper.lastWithdrawalDayOf(deadline)`
297
310
  (the deadline is exclusive), formatted as a UTC date — the rule the server's e-mails use.
298
311
  - The `consumer`/`withdrawal`/`cancellation` branches take the register of the legal copy they sit
299
312
  beside (de and es formal, like `payment-consumer-rights`), while `amount-checkout` and
300
313
  `checkout-limit` keep the dialog's.
301
- - An application overrides a string with `addI18nApp(lng, 'web-payment', data, { ns: LIB_NAMESPACE })`
302
- — `paymentTextOf` reads that override too.
314
+ - An application overrides a string with `i18nHelper.addI18nApp(lng, 'web-payment', data, { ns: LIB_NAMESPACE })`
315
+ — `fixedTextHelper.paymentTextOf` reads that override too.
303
316
 
304
317
  ## Tests
305
318
 
@@ -309,7 +322,7 @@ stamped status, `cause`/`error`/aggregate nesting, a `CommitFailed`-shaped messa
309
322
  asker/gate (`consumer-hooks.spec.ts`: `makeAsker` sharing and failing open, `withConsent` retrying
310
323
  exactly once, first-render hook shapes with `react-dom/server`) specs, the 8-language parity spec,
311
324
  and drives chromium through the Vite harness, which picks a surface by `?case=` (none = the dialog,
312
- `pieces`, `hook`, `shared-estimate`; `consent`, `start`, `withdrawal`, `withdrawal-public`,
325
+ `pieces`, `hook`, `shared-estimate`; `consent` (`&context=` a consent copy variant), `start` (`&context=units`), `withdrawal`, `withdrawal-public`,
313
326
  `cancellation`, `limit` (`&blocked=true`), `country-locked`, `consent-gate`), with `?lng=` the
314
327
  contract language and `?ui=` the interface language, and for the dialog an `?estimate=<name>`
315
328
  canned `PriceEstimateControl` fixture (`tests/harness/estimate-fixtures.ts`,
@@ -0,0 +1,10 @@
1
+ /** A money input in a locale: its decimal separator, and cents read from / written to its text. */
2
+ export interface AmountInputHelper {
3
+ /** The locale's decimal separator; `.` when the locale names none. */
4
+ decimalSeparator: (locale: string) => string;
5
+ /** Parse a locale decimal directly to cents; floating-point rounding never enters the path. */
6
+ parseAmountMinor: (input: string, locale: string) => number | null;
7
+ /** Cents as the text of a money input in the locale (`12,50`). */
8
+ inputAmount: (amountMinor: number, locale: string) => string;
9
+ }
10
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/amount/types.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,MAAM,WAAW,iBAAiB;IAChC,sEAAsE;IACtE,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAA;IAC5C,+FAA+F;IAC/F,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAA;IAClE,kEAAkE;IAClE,WAAW,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,MAAM,CAAA;CAC7D"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/amount/types.ts"],"names":[],"mappings":""}
package/build/amount.d.ts CHANGED
@@ -1,5 +1,4 @@
1
- export declare const decimalSeparator: (locale: string) => string;
2
- /** Parse a locale decimal directly to cents; floating-point rounding never enters the path. */
3
- export declare const parseAmountMinor: (input: string, locale: string) => number | null;
4
- export declare const inputAmount: (amountMinor: number, locale: string) => string;
1
+ import type { AmountInputHelper } from './amount/types.js';
2
+ export declare const createAmountInputHelper: () => AmountInputHelper;
3
+ export declare const amountInputHelper: AmountInputHelper;
5
4
  //# sourceMappingURL=amount.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"amount.d.ts","sourceRoot":"","sources":["../src/amount.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,WAAY,MAAM,KAAG,MACuB,CAAA;AAEzE,+FAA+F;AAC/F,eAAO,MAAM,gBAAgB,UAAW,MAAM,UAAU,MAAM,KAAG,MAAM,GAAG,IASzE,CAAA;AAED,eAAO,MAAM,WAAW,gBAAiB,MAAM,UAAU,MAAM,KAAG,MAKjE,CAAA"}
1
+ {"version":3,"file":"amount.d.ts","sourceRoot":"","sources":["../src/amount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAE1D,eAAO,MAAM,uBAAuB,QAAO,iBAuB1C,CAAA;AAED,eAAO,MAAM,iBAAiB,mBAA4B,CAAA"}
package/build/amount.js CHANGED
@@ -1,23 +1,26 @@
1
- export const decimalSeparator = (locale) => new Intl.NumberFormat(locale)
2
- .formatToParts(1.1).find(part => part.type === 'decimal')?.value ?? '.';
3
- /** Parse a locale decimal directly to cents; floating-point rounding never enters the path. */
4
- export const parseAmountMinor = (input, locale) => {
5
- const separator = decimalSeparator(locale);
6
- let normalized = input.trim().replace(/[\s\u00a0]/g, '');
7
- if (separator === ',')
8
- normalized = normalized.replace(',', '.');
9
- else if (!normalized.includes('.') && normalized.includes(','))
10
- normalized = normalized.replace(',', '.');
11
- if (!/^\d+(?:\.\d{0,2})?$/.test(normalized))
12
- return null;
13
- const [whole, decimal = ''] = normalized.split('.');
14
- const value = Number(whole) * 100 + Number(decimal.padEnd(2, '0'));
15
- return Number.isSafeInteger(value) ? value : null;
16
- };
17
- export const inputAmount = (amountMinor, locale) => {
18
- const separator = decimalSeparator(locale);
19
- const whole = Math.floor(amountMinor / 100);
20
- const cents = String(amountMinor % 100).padStart(2, '0');
21
- return `${whole}${separator}${cents}`;
1
+ export const createAmountInputHelper = () => {
2
+ const decimalSeparator = (locale) => new Intl.NumberFormat(locale)
3
+ .formatToParts(1.1).find(part => part.type === 'decimal')?.value ?? '.';
4
+ const parseAmountMinor = (input, locale) => {
5
+ const separator = decimalSeparator(locale);
6
+ let normalized = input.trim().replace(/[\s ]/g, '');
7
+ if (separator === ',')
8
+ normalized = normalized.replace(',', '.');
9
+ else if (!normalized.includes('.') && normalized.includes(','))
10
+ normalized = normalized.replace(',', '.');
11
+ if (!/^\d+(?:\.\d{0,2})?$/.test(normalized))
12
+ return null;
13
+ const [whole, decimal = ''] = normalized.split('.');
14
+ const value = Number(whole) * 100 + Number(decimal.padEnd(2, '0'));
15
+ return Number.isSafeInteger(value) ? value : null;
16
+ };
17
+ const inputAmount = (amountMinor, locale) => {
18
+ const separator = decimalSeparator(locale);
19
+ const whole = Math.floor(amountMinor / 100);
20
+ const cents = String(amountMinor % 100).padStart(2, '0');
21
+ return `${whole}${separator}${cents}`;
22
+ };
23
+ return { decimalSeparator, parseAmountMinor, inputAmount };
22
24
  };
25
+ export const amountInputHelper = createAmountInputHelper();
23
26
  //# sourceMappingURL=amount.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"amount.js","sourceRoot":"","sources":["../src/amount.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,MAAc,EAAU,EAAE,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC;KACtF,aAAa,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,EAAE,KAAK,IAAI,GAAG,CAAA;AAEzE,+FAA+F;AAC/F,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAAa,EAAE,MAAc,EAAiB,EAAE;IAC/E,MAAM,SAAS,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAA;IAC1C,IAAI,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,CAAA;IACxD,IAAI,SAAS,KAAK,GAAG;QAAE,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;SAC3D,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;IACzG,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,UAAU,CAAC;QAAE,OAAO,IAAI,CAAA;IACxD,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,EAAE,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IACnD,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,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ts","sourceRoot":"","sources":["../src/checkout-limit.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAA;AAKxD;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,sCAAuC,sBAAsB,uCA+B1F,CAAA"}
1
+ {"version":3,"file":"checkout-limit.d.ts","sourceRoot":"","sources":["../src/checkout-limit.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAA;AAIxD;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,sCAAuC,sBAAsB,uCA+B1F,CAAA"}
@@ -1,9 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useI18nLib, useLanguage } from '@owlmeans/client-i18n';
3
3
  import { cn } from '@/lib/utils';
4
- import { money, shortMomentUtc } from './format.js';
5
- /** The reasons the package phrases itself; any other reads the generic sentence. */
6
- const KNOWN_REASONS = ['per-purchase', 'window', 'total', 'hold'];
4
+ import { KNOWN_REASONS } from './consts.local.js';
5
+ import { formatHelper } from './format.js';
7
6
  /**
8
7
  * What an amount checkout is narrowed to for this entity now: the largest amount (or that nothing
9
8
  * may be bought), why, and when it rises again — the same `CheckoutLimitView` the server refuses
@@ -25,10 +24,10 @@ export const CheckoutLimitNote = ({ limit, reasonLabel, className }) => {
25
24
  : t(`reason.${KNOWN_REASONS.includes(reason) ? reason : 'other'}`);
26
25
  const resetsAt = limit.resetsAt != null ? new Date(limit.resetsAt) : null;
27
26
  const resets = resetsAt != null && !Number.isNaN(resetsAt.getTime())
28
- ? t('resets', { date: shortMomentUtc(resetsAt, locale), interpolation: { escapeValue: false } })
27
+ ? t('resets', { date: formatHelper.shortMomentUtc(resetsAt, locale), interpolation: { escapeValue: false } })
29
28
  : null;
30
29
  return _jsxs("div", { "data-checkout-limit": "", "data-max-minor": limit.maximumMinor, "data-blocked": limit.blocked ? 'true' : 'false', "data-reason": reason, "data-resets-at": resetsAt?.toISOString(), role: limit.blocked ? 'alert' : 'note', className: cn('grid gap-1 rounded-lg border p-3 text-sm', limit.blocked ? 'border-destructive/50' : 'bg-muted/30', className), children: [_jsx("p", { className: limit.blocked ? 'text-destructive font-medium' : 'font-medium', "data-checkout-limit-headline": "", children: limit.blocked
31
30
  ? t('blocked')
32
- : t('note', { amount: money(limit.maximumMinor, limit.currency, locale), interpolation: { escapeValue: false } }) }), _jsx("p", { className: "text-muted-foreground text-xs", "data-checkout-limit-reason": "", children: explained }), resets != null && _jsx("p", { className: "text-muted-foreground text-xs", "data-checkout-limit-resets": "", children: resets })] });
31
+ : t('note', { amount: formatHelper.money(limit.maximumMinor, limit.currency, locale), interpolation: { escapeValue: false } }) }), _jsx("p", { className: "text-muted-foreground text-xs", "data-checkout-limit-reason": "", children: explained }), resets != null && _jsx("p", { className: "text-muted-foreground text-xs", "data-checkout-limit-resets": "", children: resets })] });
33
32
  };
34
33
  //# sourceMappingURL=checkout-limit.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"checkout-limit.js","sourceRoot":"","sources":["../src/checkout-limit.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAC/D,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAA;AAChC,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAGnD,oFAAoF;AACpF,MAAM,aAAa,GAAG,CAAC,cAAc,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,CAAA;AAEjE;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAA0B,EAAE,EAAE;IAC7F,MAAM,CAAC,GAAG,UAAU,CAAC,aAAa,EAAE,gBAAgB,CAAC,CAAA;IACrD,MAAM,CAAC,MAAM,CAAC,GAAG,WAAW,EAAE,CAAA;IAC9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KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,EACtC,SAAS,EAAE,EAAE,CAAC,0CAA0C,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,aAAa,EAAE,SAAS,CAAC,aAE7H,YAAG,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,8BAA8B,CAAC,CAAC,CAAC,aAAa,kCAA+B,EAAE,YAC1G,KAAK,CAAC,OAAO;oBACZ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;oBACd,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE,aAAa,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,EAAE,CAAC,GAC9H,EACJ,YAAG,SAAS,EAAC,+BAA+B,gCAA4B,EAAE,YAAE,SAAS,GAAK,EACzF,MAAM,IAAI,IAAI,IAAI,YAAG,SAAS,EAAC,+BAA+B,gCAA4B,EAAE,YAAE,MAAM,GAAK,IACtG,CAAA;AACR,CAAC,CAAA"}
@@ -0,0 +1,3 @@
1
+ /** The library resource (`lib` namespace) every interface string of this package lives in. */
2
+ export declare const WEB_PAYMENT_RESOURCE = "web-payment";
3
+ //# sourceMappingURL=consts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../src/consts.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,eAAO,MAAM,oBAAoB,gBAAgB,CAAA"}
@@ -0,0 +1,3 @@
1
+ /** The library resource (`lib` namespace) every interface string of this package lives in. */
2
+ export const WEB_PAYMENT_RESOURCE = 'web-payment';
3
+ //# sourceMappingURL=consts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consts.js","sourceRoot":"","sources":["../src/consts.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAAA"}
@@ -0,0 +1,8 @@
1
+ import type { PlanStatusTone, PlanStatusLineKind } from './types.js';
2
+ import { SubscriptionStatus } from '@owlmeans/payment';
3
+ /** The reasons the package phrases itself; any other reads the generic sentence. */
4
+ export declare const KNOWN_REASONS: string[];
5
+ export declare const DEFAULT_TTL_MS: number;
6
+ export declare const TONE_DOT: Record<PlanStatusTone, string>;
7
+ export declare const INACTIVE: Partial<Record<SubscriptionStatus, PlanStatusLineKind>>;
8
+ //# sourceMappingURL=consts.local.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consts.local.d.ts","sourceRoot":"","sources":["../src/consts.local.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAEtD,oFAAoF;AACpF,eAAO,MAAM,aAAa,UAA8C,CAAA;AAExE,eAAO,MAAM,cAAc,QAAa,CAAA;AAExC,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAKnD,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAK5E,CAAA"}
@@ -0,0 +1,17 @@
1
+ import { SubscriptionStatus } from '@owlmeans/payment';
2
+ /** The reasons the package phrases itself; any other reads the generic sentence. */
3
+ export const KNOWN_REASONS = ['per-purchase', 'window', 'total', 'hold'];
4
+ export const DEFAULT_TTL_MS = 5 * 60_000;
5
+ export const TONE_DOT = {
6
+ ok: 'bg-primary',
7
+ warning: 'bg-destructive/60',
8
+ critical: 'bg-destructive',
9
+ inactive: 'bg-muted-foreground',
10
+ };
11
+ export const INACTIVE = {
12
+ [SubscriptionStatus.Created]: 'created',
13
+ [SubscriptionStatus.Canceled]: 'canceled',
14
+ [SubscriptionStatus.Expired]: 'expired',
15
+ [SubscriptionStatus.Ended]: 'ended',
16
+ };
17
+ //# sourceMappingURL=consts.local.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consts.local.js","sourceRoot":"","sources":["../src/consts.local.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAEtD,oFAAoF;AACpF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,cAAc,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,CAAA;AAExE,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,GAAG,MAAM,CAAA;AAExC,MAAM,CAAC,MAAM,QAAQ,GAAmC;IACtD,EAAE,EAAE,YAAY;IAChB,OAAO,EAAE,mBAAmB;IAC5B,QAAQ,EAAE,gBAAgB;IAC1B,QAAQ,EAAE,qBAAqB;CAChC,CAAA;AAED,MAAM,CAAC,MAAM,QAAQ,GAA4D;IAC/E,CAAC,kBAAkB,CAAC,OAAO,CAAC,EAAE,SAAS;IACvC,CAAC,kBAAkB,CAAC,QAAQ,CAAC,EAAE,UAAU;IACzC,CAAC,kBAAkB,CAAC,OAAO,CAAC,EAAE,SAAS;IACvC,CAAC,kBAAkB,CAAC,KAAK,CAAC,EAAE,OAAO;CACpC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"cancellation.d.ts","sourceRoot":"","sources":["../../src/consumer/cancellation.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,qBAAqB,EAAmB,MAAM,YAAY,CAAA;AAOxE;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,gBAAgB,gIAG1B,qBAAqB,gCAiLvB,CAAA"}
1
+ {"version":3,"file":"cancellation.d.ts","sourceRoot":"","sources":["../../src/consumer/cancellation.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,qBAAqB,EAAmB,MAAM,YAAY,CAAA;AAQxE;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,gBAAgB,gIAG1B,qBAAqB,gCAiLvB,CAAA"}
@@ -3,10 +3,10 @@ import { useEffect, useState } from 'react';
3
3
  import { CancellationKind } from '@owlmeans/payment';
4
4
  import { cn } from '@/lib/utils';
5
5
  import { Button } from '@/components/ui/button';
6
- import { dayUtc, momentUtc } from '../format.js';
7
- import { useLegalText, usePaymentText } from './copy.js';
6
+ import { useLegalText, usePaymentText } from './hooks.js';
8
7
  import { Choice, Field, Honeypot, isEmail } from './fields.js';
9
8
  import { ErrorLine, LanguageToggle, useShownLanguage } from './legal.js';
9
+ import { formatHelper } from '../format.js';
10
10
  const isCancellationReceipt = (receipt) => 'status' in receipt;
11
11
  /** Today as a UTC calendar day, `YYYY-MM-DD` — the earliest date a termination may name. */
12
12
  const todayUtc = () => new Date().toISOString().slice(0, 10);
@@ -91,7 +91,7 @@ export const CancellationForm = ({ mode, language: contractLanguage, uiLanguage,
91
91
  const kindLabel = (value) => legal(value === CancellationKind.Extraordinary
92
92
  ? 'cancellation.kind-extraordinary' : 'cancellation.kind-ordinary');
93
93
  const effectiveLabel = (declared) => declared.effective === 'date' && declared.date != null
94
- ? dayUtc(`${declared.date}T00:00:00Z`, language.shown) : legal('cancellation.effective-earliest');
94
+ ? formatHelper.dayUtc(`${declared.date}T00:00:00Z`, language.shown) : legal('cancellation.effective-earliest');
95
95
  const summary = (declared, hook) => _jsxs("dl", { className: "grid grid-cols-[auto_1fr] gap-x-4 gap-y-1.5 rounded-lg border bg-muted/30 p-4 text-sm", ...(hook != null ? { [hook]: '' } : {}), children: [_jsx("dt", { className: "text-muted-foreground", children: legal('cancellation.kind') }), _jsx("dd", { "data-summary": "kind", children: kindLabel(declared.kind) }), declared.reason != null && _jsxs(_Fragment, { children: [_jsx("dt", { className: "text-muted-foreground", children: legal('cancellation.reason') }), _jsx("dd", { "data-summary": "reason", className: "whitespace-pre-wrap", children: declared.reason })] }), _jsx("dt", { className: "text-muted-foreground", children: legal('cancellation.name') }), _jsx("dd", { "data-summary": "name", children: declared.name }), _jsx("dt", { className: "text-muted-foreground", children: legal('cancellation.contract') }), _jsx("dd", { "data-summary": "contract", children: declared.contractRef ?? '—' }), _jsx("dt", { className: "text-muted-foreground", children: legal('cancellation.effective') }), _jsx("dd", { "data-summary": "effective", children: effectiveLabel(declared) }), _jsx("dt", { className: "text-muted-foreground", children: legal('cancellation.email') }), _jsx("dd", { "data-summary": "email", children: declared.email })] });
96
96
  let content;
97
97
  if (current === 'receipt' && receipt != null) {
@@ -101,8 +101,8 @@ export const CancellationForm = ({ mode, language: contractLanguage, uiLanguage,
101
101
  const effectiveAt = isCancellationReceipt(receipt) && receipt.effectiveAt != null ? new Date(receipt.effectiveAt) : null;
102
102
  const effectiveKnown = effectiveAt != null && !Number.isNaN(effectiveAt.getTime());
103
103
  content = _jsxs("div", { className: "grid gap-4", "data-cancellation-receipt": "", "data-status": status ?? 'received', "data-declaration-id": receipt.declarationId, "data-received-at": Number.isNaN(receivedAt.getTime()) ? undefined : receivedAt.toISOString(), "data-effective-at": effectiveKnown ? effectiveAt.toISOString() : undefined, children: [_jsx("h3", { className: "text-sm font-medium", children: text('consumer.receipt') }), _jsx("p", { className: "text-sm", children: receipt.mailed
104
- ? legal('cancellation.received', { date: momentUtc(receivedAt, language.shown), email: declared.email })
105
- : `${text('consumer.received-at')}: ${momentUtc(receivedAt, language.shown)} (UTC). ${text('consumer.not-mailed')}` }), effectiveKnown && _jsx("p", { className: "text-sm font-medium", "data-cancellation-effective": "", children: text('cancellation.effective-at', { date: dayUtc(effectiveAt, language.shown) }) }), _jsxs("dl", { className: "grid grid-cols-[auto_1fr] gap-x-4 gap-y-1.5 rounded-lg border p-4 text-sm", children: [_jsx("dt", { className: "text-muted-foreground", children: text('consumer.reference') }), _jsx("dd", { "data-cancellation-reference": "", children: receipt.declarationId }), _jsx("dt", { className: "text-muted-foreground", children: text('consumer.received-at') }), _jsxs("dd", { "data-cancellation-received-at": "", children: [momentUtc(receivedAt, language.shown), " (UTC)"] }), status != null && _jsxs(_Fragment, { children: [_jsx("dt", { className: "text-muted-foreground", children: text('consumer.status') }), _jsx("dd", { "data-cancellation-status": "", children: text(`cancellation.status.${status}`) })] })] }), summary(declared), _jsxs("div", { className: "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end print:hidden", children: [onClose != null && _jsx(Button, { type: "button", variant: "outline", onClick: onClose, children: text('consumer.close') }), _jsx(Button, { type: "button", variant: "outline", onClick: print, "data-cancellation-print": "", children: text('consumer.print') })] })] });
104
+ ? legal('cancellation.received', { date: formatHelper.momentUtc(receivedAt, language.shown), email: declared.email })
105
+ : `${text('consumer.received-at')}: ${formatHelper.momentUtc(receivedAt, language.shown)} (UTC). ${text('consumer.not-mailed')}` }), effectiveKnown && _jsx("p", { className: "text-sm font-medium", "data-cancellation-effective": "", children: text('cancellation.effective-at', { date: formatHelper.dayUtc(effectiveAt, language.shown) }) }), _jsxs("dl", { className: "grid grid-cols-[auto_1fr] gap-x-4 gap-y-1.5 rounded-lg border p-4 text-sm", children: [_jsx("dt", { className: "text-muted-foreground", children: text('consumer.reference') }), _jsx("dd", { "data-cancellation-reference": "", children: receipt.declarationId }), _jsx("dt", { className: "text-muted-foreground", children: text('consumer.received-at') }), _jsxs("dd", { "data-cancellation-received-at": "", children: [formatHelper.momentUtc(receivedAt, language.shown), " (UTC)"] }), status != null && _jsxs(_Fragment, { children: [_jsx("dt", { className: "text-muted-foreground", children: text('consumer.status') }), _jsx("dd", { "data-cancellation-status": "", children: text(`cancellation.status.${status}`) })] })] }), summary(declared), _jsxs("div", { className: "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end print:hidden", children: [onClose != null && _jsx(Button, { type: "button", variant: "outline", onClick: onClose, children: text('consumer.close') }), _jsx(Button, { type: "button", variant: "outline", onClick: print, "data-cancellation-print": "", children: text('consumer.print') })] })] });
106
106
  }
107
107
  else if (current === 'review') {
108
108
  content = _jsxs("div", { className: "grid gap-4", children: [_jsx("h3", { className: "text-sm font-medium", children: text('consumer.review') }), _jsx("p", { className: "text-sm", children: legal('cancellation.summary') }), summary(body(), 'data-cancellation-summary'), _jsx(ErrorLine, { error: error, text: text }), _jsxs("div", { className: "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", children: [_jsx(Button, { type: "button", variant: "outline", disabled: pending, onClick: () => setStep('form'), "data-cancellation-back": "", children: text('consumer.back') }), _jsx(Button, { type: "button", disabled: pending || !valid, onClick: () => void confirm(), "data-cancellation-confirm": "", children: pending ? text('consumer.pending') : legal('cancellation.confirm') })] })] });
@@ -1 +1 @@
1
- {"version":3,"file":"cancellation.js","sourceRoot":"","sources":["../../src/consumer/cancellation.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAA;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAEpD,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAA;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAChD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AACxD,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAC9D,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAGxE,MAAM,qBAAqB,GAAG,CAAC,OAAe,EAAkC,EAAE,CAAC,QAAQ,IAAI,OAAO,CAAA;AAEtG,4FAA4F;AAC5F,MAAM,QAAQ,GAAG,GAAW,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;AAEpE;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG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G,KAAC,SAAS,IAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,GAAI,EACvC,cAAK,SAAS,EAAC,kBAAkB,YAC/B,KAAC,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAC,QAAQ,EAAE,OAAO,gCAA6B,EAAE,YAAE,IAAI,CAAC,mBAAmB,CAAC,GAAU,GACvG,IACD,CAAA;IACT,CAAC;IAED,OAAO,mBAAS,SAAS,EAAE,EAAE,CAAC,YAAY,EAAE,SAAS,CAAC,+BAA4B,EAAE,mBAAgB,QAAQ,CAAC,KAAK,aAChH,kBAAQ,SAAS,EAAC,cAAc,EAAC,IAAI,EAAE,QAAQ,CAAC,KAAK,aACnD,aAAI,SAAS,EAAC,oCAAoC,YAAE,KAAK,CAAC,oBAAoB,CAAC,GAAM,EACpF,OAAO,KAAK,MAAM,IAAI,YAAG,SAAS,EAAC,+BAA+B,YAAE,KAAK,CAAC,oBAAoB,CAAC,GAAK,IAC9F,EACT,KAAC,cAAc,IAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAC,mCAAmC,GAAG,EAC/E,wCAA4B,EAAE,4BAAyB,OAAO,eAAa,OAAO,eAAa,IAAI,mBAClF,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,CAAC,KAAK,EAAE,SAAS,EAAC,YAAY,YAC1E,OAAO,GACJ,IACE,CAAA;AACZ,CAAC,CAAA"}
@@ -0,0 +1,3 @@
1
+ /** The shape the platform validates an e-mail address with (`@owlmeans/payment` `EmailSchema`). */
2
+ export declare const EMAIL_PATTERN: RegExp;
3
+ //# sourceMappingURL=consts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../src/consumer/consts.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,eAAO,MAAM,aAAa,QAAsB,CAAA"}
@@ -0,0 +1,3 @@
1
+ /** The shape the platform validates an e-mail address with (`@owlmeans/payment` `EmailSchema`). */
2
+ export const EMAIL_PATTERN = /^[^\s@]+@[^\s@]+$/;
3
+ //# sourceMappingURL=consts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consts.js","sourceRoot":"","sources":["../../src/consumer/consts.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,MAAM,CAAC,MAAM,aAAa,GAAG,mBAAmB,CAAA"}
@@ -0,0 +1,7 @@
1
+ /** Where a wrapping error keeps the one it wraps — `cause`, and the fields frameworks use for it. */
2
+ export declare const NESTED_FIELDS: readonly ['cause', 'error', 'original', 'originalError', 'inner', 'reason'];
3
+ /** How deep a wrapped chain is followed — a planning `CommitFailed` inside a transport error is two. */
4
+ export declare const MAX_DEPTH = 5;
5
+ export declare const PRECONDITION_REQUIRED = 428;
6
+ export declare const DECLINED_MARKER = "consent-declined:";
7
+ //# sourceMappingURL=consts.local.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consts.local.d.ts","sourceRoot":"","sources":["../../src/consumer/consts.local.ts"],"names":[],"mappings":"AAAA,qGAAqG;AACrG,eAAO,MAAM,aAAa,YAAI,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,OAAO,EAAE,QAAQ,CAAU,CAAA;AAExG,wGAAwG;AACxG,eAAO,MAAM,SAAS,IAAI,CAAA;AAE1B,eAAO,MAAM,qBAAqB,MAAM,CAAA;AAExC,eAAO,MAAM,eAAe,sBAAsB,CAAA"}
@@ -0,0 +1,7 @@
1
+ /** Where a wrapping error keeps the one it wraps — `cause`, and the fields frameworks use for it. */
2
+ export const NESTED_FIELDS = ['cause', 'error', 'original', 'originalError', 'inner', 'reason'];
3
+ /** How deep a wrapped chain is followed — a planning `CommitFailed` inside a transport error is two. */
4
+ export const MAX_DEPTH = 5;
5
+ export const PRECONDITION_REQUIRED = 428;
6
+ export const DECLINED_MARKER = 'consent-declined:';
7
+ //# sourceMappingURL=consts.local.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consts.local.js","sourceRoot":"","sources":["../../src/consumer/consts.local.ts"],"names":[],"mappings":"AAAA,qGAAqG;AACrG,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,OAAO,EAAE,QAAQ,CAAU,CAAA;AAExG,wGAAwG;AACxG,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAA;AAE1B,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,CAAA;AAExC,MAAM,CAAC,MAAM,eAAe,GAAG,mBAAmB,CAAA"}