@churnkey/react 0.7.0 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-SWEPUHIN.cjs → chunk-ER6YITYC.cjs} +12 -2
- package/dist/chunk-ER6YITYC.cjs.map +1 -0
- package/dist/{chunk-4ZAJYXG2.cjs → chunk-FK4AJOX6.cjs} +6 -6
- package/dist/{chunk-4ZAJYXG2.cjs.map → chunk-FK4AJOX6.cjs.map} +1 -1
- package/dist/{chunk-KS3RWFRH.js → chunk-GNRS7V7H.js} +3 -3
- package/dist/{chunk-KS3RWFRH.js.map → chunk-GNRS7V7H.js.map} +1 -1
- package/dist/{chunk-BODEVZ3K.js → chunk-RFKW3LWM.js} +12 -2
- package/dist/chunk-RFKW3LWM.js.map +1 -0
- package/dist/core.cjs +14 -14
- package/dist/core.d.cts +2 -2
- package/dist/core.d.ts +2 -2
- package/dist/core.js +1 -1
- package/dist/headless.cjs +3 -3
- package/dist/headless.d.cts +1 -1
- package/dist/headless.d.ts +1 -1
- package/dist/headless.js +2 -2
- package/dist/index.cjs +125 -124
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +21 -20
- package/dist/index.js.map +1 -1
- package/dist/{step-graph-s1L1wV-P.d.cts → step-graph-C7JC8Umv.d.cts} +18 -0
- package/dist/{step-graph-s1L1wV-P.d.ts → step-graph-C7JC8Umv.d.ts} +18 -0
- package/dist/styles.css +64 -6
- package/package.json +1 -1
- package/dist/chunk-BODEVZ3K.js.map +0 -1
- package/dist/chunk-SWEPUHIN.cjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkFK4AJOX6_cjs = require('./chunk-FK4AJOX6.cjs');
|
|
4
4
|
var chunkM6Z3BHEH_cjs = require('./chunk-M6Z3BHEH.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunkER6YITYC_cjs = require('./chunk-ER6YITYC.cjs');
|
|
6
6
|
var react = require('react');
|
|
7
7
|
var jsxRuntime = require('react/jsx-runtime');
|
|
8
8
|
|
|
@@ -12,7 +12,7 @@ function RichText({ html, as = "p", className }) {
|
|
|
12
12
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
13
13
|
Tag,
|
|
14
14
|
{
|
|
15
|
-
className,
|
|
15
|
+
className: chunkER6YITYC_cjs.cn("ck-rich-text", className),
|
|
16
16
|
dangerouslySetInnerHTML: { __html: html }
|
|
17
17
|
}
|
|
18
18
|
);
|
|
@@ -31,30 +31,30 @@ function DefaultConfirm({
|
|
|
31
31
|
classNames,
|
|
32
32
|
messages
|
|
33
33
|
}) {
|
|
34
|
-
const m = messages ??
|
|
34
|
+
const m = messages ?? chunkER6YITYC_cjs.defaultMessages;
|
|
35
35
|
const hasLosses = Array.isArray(losses) && losses.length > 0;
|
|
36
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
37
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { className:
|
|
38
|
-
description && /* @__PURE__ */ jsxRuntime.jsx(RichText, { as: "div", html: description, className:
|
|
39
|
-
hasLosses && /* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
40
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
41
|
-
/* @__PURE__ */ jsxRuntime.jsx("ul", { className: "ck-loss-list", children: losses.map((item) => /* @__PURE__ */ jsxRuntime.jsxs("li", { className:
|
|
42
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, className:
|
|
36
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkER6YITYC_cjs.cn("ck-step ck-step-confirm", classNames?.root), children: [
|
|
37
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: chunkER6YITYC_cjs.cn("ck-step-title", classNames?.title), children: title }),
|
|
38
|
+
description && /* @__PURE__ */ jsxRuntime.jsx(RichText, { as: "div", html: description, className: chunkER6YITYC_cjs.cn("ck-step-description", classNames?.description) }),
|
|
39
|
+
hasLosses && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkER6YITYC_cjs.cn("ck-loss-block", classNames?.lossList), children: [
|
|
40
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: chunkER6YITYC_cjs.cn("ck-loss-label", classNames?.lossLabel), children: lossesLabel ?? m.confirm.lossesLabel }),
|
|
41
|
+
/* @__PURE__ */ jsxRuntime.jsx("ul", { className: "ck-loss-list", children: losses.map((item) => /* @__PURE__ */ jsxRuntime.jsxs("li", { className: chunkER6YITYC_cjs.cn("ck-loss-item", classNames?.lossItem), children: [
|
|
42
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, className: chunkER6YITYC_cjs.cn("ck-loss-bullet", classNames?.lossBullet), children: "\u25CF" }),
|
|
43
43
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: item })
|
|
44
44
|
] }, item)) })
|
|
45
45
|
] }),
|
|
46
|
-
periodEndNotice && /* @__PURE__ */ jsxRuntime.jsx("p", { className:
|
|
46
|
+
periodEndNotice && /* @__PURE__ */ jsxRuntime.jsx("p", { className: chunkER6YITYC_cjs.cn("ck-period-end", classNames?.periodEndNotice), children: periodEndNotice }),
|
|
47
47
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
48
48
|
"button",
|
|
49
49
|
{
|
|
50
50
|
type: "button",
|
|
51
|
-
className:
|
|
51
|
+
className: chunkER6YITYC_cjs.cn("ck-button ck-button-danger", classNames?.confirmButton),
|
|
52
52
|
onClick: onConfirm,
|
|
53
53
|
disabled: isProcessing,
|
|
54
54
|
children: isProcessing ? m.common.processing : confirmLabel
|
|
55
55
|
}
|
|
56
56
|
),
|
|
57
|
-
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className:
|
|
57
|
+
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: chunkER6YITYC_cjs.cn("ck-button-link", classNames?.goBackButton), onClick: onGoBack, children: goBackLabel })
|
|
58
58
|
] });
|
|
59
59
|
}
|
|
60
60
|
function DefaultFeedback({
|
|
@@ -69,19 +69,19 @@ function DefaultFeedback({
|
|
|
69
69
|
classNames,
|
|
70
70
|
messages
|
|
71
71
|
}) {
|
|
72
|
-
const m = messages ??
|
|
72
|
+
const m = messages ?? chunkER6YITYC_cjs.defaultMessages;
|
|
73
73
|
const [focused, setFocused] = react.useState(false);
|
|
74
74
|
const hasMin = minLength > 0;
|
|
75
75
|
const isUnderMin = hasMin && value.length > 0 && value.length < minLength;
|
|
76
76
|
const isValid = !required || value.length >= minLength;
|
|
77
|
-
const placeholderText = placeholder ?? (hasMin ?
|
|
78
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
79
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { className:
|
|
80
|
-
description && /* @__PURE__ */ jsxRuntime.jsx(RichText, { as: "div", html: description, className:
|
|
77
|
+
const placeholderText = placeholder ?? (hasMin ? chunkER6YITYC_cjs.formatMessage(m.feedback.placeholderWithMin, { minLength }) : m.feedback.placeholder);
|
|
78
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkER6YITYC_cjs.cn("ck-step ck-step-feedback", classNames?.root), children: [
|
|
79
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: chunkER6YITYC_cjs.cn("ck-step-title", classNames?.title), children: title }),
|
|
80
|
+
description && /* @__PURE__ */ jsxRuntime.jsx(RichText, { as: "div", html: description, className: chunkER6YITYC_cjs.cn("ck-step-description", classNames?.description) }),
|
|
81
81
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
82
82
|
"div",
|
|
83
83
|
{
|
|
84
|
-
className:
|
|
84
|
+
className: chunkER6YITYC_cjs.cn(
|
|
85
85
|
"ck-feedback-field",
|
|
86
86
|
focused && "ck-feedback-field--focused",
|
|
87
87
|
isUnderMin && "ck-feedback-field--invalid"
|
|
@@ -90,7 +90,7 @@ function DefaultFeedback({
|
|
|
90
90
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
91
91
|
"textarea",
|
|
92
92
|
{
|
|
93
|
-
className:
|
|
93
|
+
className: chunkER6YITYC_cjs.cn("ck-textarea", classNames?.textarea),
|
|
94
94
|
placeholder: placeholderText,
|
|
95
95
|
value,
|
|
96
96
|
onChange: (e) => onChange(e.target.value),
|
|
@@ -102,7 +102,7 @@ function DefaultFeedback({
|
|
|
102
102
|
hasMin && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
103
103
|
"div",
|
|
104
104
|
{
|
|
105
|
-
className:
|
|
105
|
+
className: chunkER6YITYC_cjs.cn(
|
|
106
106
|
"ck-character-count",
|
|
107
107
|
isUnderMin && "ck-character-count--invalid",
|
|
108
108
|
classNames?.characterCount
|
|
@@ -121,7 +121,7 @@ function DefaultFeedback({
|
|
|
121
121
|
"button",
|
|
122
122
|
{
|
|
123
123
|
type: "button",
|
|
124
|
-
className:
|
|
124
|
+
className: chunkER6YITYC_cjs.cn("ck-button ck-button-primary", classNames?.submitButton),
|
|
125
125
|
onClick: onSubmit,
|
|
126
126
|
disabled: !isValid,
|
|
127
127
|
children: m.common.continue
|
|
@@ -139,24 +139,24 @@ function DefaultContactOffer({
|
|
|
139
139
|
classNames,
|
|
140
140
|
messages
|
|
141
141
|
}) {
|
|
142
|
-
const msg = messages ??
|
|
142
|
+
const msg = messages ?? chunkER6YITYC_cjs.defaultMessages;
|
|
143
143
|
const headline = title ?? offer.copy.headline;
|
|
144
144
|
const body = description ?? offer.copy.body;
|
|
145
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
146
|
-
headline && /* @__PURE__ */ jsxRuntime.jsx("h2", { className:
|
|
147
|
-
body && /* @__PURE__ */ jsxRuntime.jsx(RichText, { as: "div", html: body, className:
|
|
148
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
145
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkER6YITYC_cjs.cn("ck-step ck-step-offer", classNames?.root), children: [
|
|
146
|
+
headline && /* @__PURE__ */ jsxRuntime.jsx("h2", { className: chunkER6YITYC_cjs.cn("ck-step-title", classNames?.title), children: headline }),
|
|
147
|
+
body && /* @__PURE__ */ jsxRuntime.jsx(RichText, { as: "div", html: body, className: chunkER6YITYC_cjs.cn("ck-step-description", classNames?.description) }),
|
|
148
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkER6YITYC_cjs.cn("ck-offer-card", classNames?.card), children: [
|
|
149
149
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
150
150
|
"button",
|
|
151
151
|
{
|
|
152
152
|
type: "button",
|
|
153
|
-
className:
|
|
153
|
+
className: chunkER6YITYC_cjs.cn("ck-button ck-button-primary", classNames?.acceptButton),
|
|
154
154
|
onClick: () => onAccept(),
|
|
155
155
|
disabled: isProcessing,
|
|
156
|
-
children: isProcessing ? msg.common.processing : offer.copy.cta
|
|
156
|
+
children: isProcessing ? msg.common.processing : msg.offer.acceptCta.contact || offer.copy.cta
|
|
157
157
|
}
|
|
158
158
|
),
|
|
159
|
-
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className:
|
|
159
|
+
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: chunkER6YITYC_cjs.cn("ck-button-link", classNames?.declineButton), onClick: onDecline, children: msg.offer.declineCta || offer.copy.declineCta })
|
|
160
160
|
] })
|
|
161
161
|
] });
|
|
162
162
|
}
|
|
@@ -170,15 +170,15 @@ function DefaultDiscountOffer({
|
|
|
170
170
|
classNames,
|
|
171
171
|
messages
|
|
172
172
|
}) {
|
|
173
|
-
const msg = messages ??
|
|
173
|
+
const msg = messages ?? chunkER6YITYC_cjs.defaultMessages;
|
|
174
174
|
const o = offer;
|
|
175
175
|
const headline = title ?? offer.copy.headline;
|
|
176
176
|
const body = description ?? offer.copy.body;
|
|
177
177
|
const phrase = chunkM6Z3BHEH_cjs.discountPhrase(o);
|
|
178
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
179
|
-
headline && /* @__PURE__ */ jsxRuntime.jsx("h2", { className:
|
|
180
|
-
body && /* @__PURE__ */ jsxRuntime.jsx(RichText, { as: "div", html: body, className:
|
|
181
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
178
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkER6YITYC_cjs.cn("ck-step ck-step-offer", classNames?.root), children: [
|
|
179
|
+
headline && /* @__PURE__ */ jsxRuntime.jsx("h2", { className: chunkER6YITYC_cjs.cn("ck-step-title", classNames?.title), children: headline }),
|
|
180
|
+
body && /* @__PURE__ */ jsxRuntime.jsx(RichText, { as: "div", html: body, className: chunkER6YITYC_cjs.cn("ck-step-description", classNames?.description) }),
|
|
181
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkER6YITYC_cjs.cn("ck-offer-card", classNames?.card), children: [
|
|
182
182
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ck-offer-details ck-offer-discount", children: [
|
|
183
183
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "ck-offer-discount-eyebrow", children: msg.offer.limitedTimeEyebrow }),
|
|
184
184
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "ck-offer-discount-phrase", children: phrase })
|
|
@@ -187,13 +187,13 @@ function DefaultDiscountOffer({
|
|
|
187
187
|
"button",
|
|
188
188
|
{
|
|
189
189
|
type: "button",
|
|
190
|
-
className:
|
|
190
|
+
className: chunkER6YITYC_cjs.cn("ck-button ck-button-primary", classNames?.acceptButton),
|
|
191
191
|
onClick: () => onAccept(),
|
|
192
192
|
disabled: isProcessing,
|
|
193
|
-
children: isProcessing ? msg.common.processing : offer.copy.cta
|
|
193
|
+
children: isProcessing ? msg.common.processing : msg.offer.acceptCta.discount || offer.copy.cta
|
|
194
194
|
}
|
|
195
195
|
),
|
|
196
|
-
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className:
|
|
196
|
+
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: chunkER6YITYC_cjs.cn("ck-button-link", classNames?.declineButton), onClick: onDecline, children: msg.offer.declineCta || offer.copy.declineCta })
|
|
197
197
|
] })
|
|
198
198
|
] });
|
|
199
199
|
}
|
|
@@ -207,7 +207,7 @@ function DefaultPauseOffer({
|
|
|
207
207
|
classNames,
|
|
208
208
|
messages
|
|
209
209
|
}) {
|
|
210
|
-
const msg = messages ??
|
|
210
|
+
const msg = messages ?? chunkER6YITYC_cjs.defaultMessages;
|
|
211
211
|
const o = offer;
|
|
212
212
|
const max = Math.max(1, o.months);
|
|
213
213
|
const [months, setMonths] = react.useState(1);
|
|
@@ -216,18 +216,18 @@ function DefaultPauseOffer({
|
|
|
216
216
|
const resume = /* @__PURE__ */ new Date();
|
|
217
217
|
resume.setMonth(resume.getMonth() + months);
|
|
218
218
|
const resumeDate = chunkM6Z3BHEH_cjs.formatMonthDayLong(resume);
|
|
219
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
220
|
-
headline && /* @__PURE__ */ jsxRuntime.jsx("h2", { className:
|
|
221
|
-
body && /* @__PURE__ */ jsxRuntime.jsx(RichText, { as: "div", html: body, className:
|
|
222
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
219
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkER6YITYC_cjs.cn("ck-step ck-step-offer", classNames?.root), children: [
|
|
220
|
+
headline && /* @__PURE__ */ jsxRuntime.jsx("h2", { className: chunkER6YITYC_cjs.cn("ck-step-title", classNames?.title), children: headline }),
|
|
221
|
+
body && /* @__PURE__ */ jsxRuntime.jsx(RichText, { as: "div", html: body, className: chunkER6YITYC_cjs.cn("ck-step-description", classNames?.description) }),
|
|
222
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkER6YITYC_cjs.cn("ck-offer-card ck-pause-card", classNames?.card), children: [
|
|
223
223
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "ck-pause-eyebrow", children: msg.offer.pauseEyebrow }),
|
|
224
224
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "ck-pause-date", children: resumeDate }),
|
|
225
|
-
max > 1 && /* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
225
|
+
max > 1 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: chunkER6YITYC_cjs.cn("ck-pause-chips", classNames?.pauseSlider), children: Array.from({ length: max }, (_, i) => i + 1).map((m) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
226
226
|
"button",
|
|
227
227
|
{
|
|
228
228
|
type: "button",
|
|
229
229
|
onClick: () => setMonths(m),
|
|
230
|
-
className:
|
|
230
|
+
className: chunkER6YITYC_cjs.cn("ck-pause-chip", m === months && "ck-pause-chip--selected"),
|
|
231
231
|
"aria-pressed": m === months,
|
|
232
232
|
children: [
|
|
233
233
|
m,
|
|
@@ -242,13 +242,13 @@ function DefaultPauseOffer({
|
|
|
242
242
|
"button",
|
|
243
243
|
{
|
|
244
244
|
type: "button",
|
|
245
|
-
className:
|
|
245
|
+
className: chunkER6YITYC_cjs.cn("ck-button ck-button-primary", classNames?.acceptButton),
|
|
246
246
|
onClick: () => onAccept({ months }),
|
|
247
247
|
disabled: isProcessing,
|
|
248
|
-
children: isProcessing ? msg.common.processing : offer.copy.cta
|
|
248
|
+
children: isProcessing ? msg.common.processing : msg.offer.acceptCta.pause || offer.copy.cta
|
|
249
249
|
}
|
|
250
250
|
),
|
|
251
|
-
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className:
|
|
251
|
+
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: chunkER6YITYC_cjs.cn("ck-button-link", classNames?.declineButton), onClick: onDecline, children: msg.offer.declineCta || offer.copy.declineCta })
|
|
252
252
|
] });
|
|
253
253
|
}
|
|
254
254
|
function Checkmark({ color = "currentColor", size = 14 }) {
|
|
@@ -265,7 +265,7 @@ function DefaultPlanChangeOffer({
|
|
|
265
265
|
classNames,
|
|
266
266
|
messages
|
|
267
267
|
}) {
|
|
268
|
-
const msg = messages ??
|
|
268
|
+
const msg = messages ?? chunkER6YITYC_cjs.defaultMessages;
|
|
269
269
|
const o = offer;
|
|
270
270
|
const plans = o.plans ?? [];
|
|
271
271
|
const currentPlanId = subscriptions[0]?.items[0]?.price.id;
|
|
@@ -274,11 +274,11 @@ function DefaultPlanChangeOffer({
|
|
|
274
274
|
const selectedPlan = plans.find((p) => p.id === selectedPlanId) ?? null;
|
|
275
275
|
const headline = title ?? offer.copy.headline;
|
|
276
276
|
const body = description ?? offer.copy.body;
|
|
277
|
-
const ctaLabel = isProcessing ? msg.common.processing : selectedPlan?.name ?
|
|
278
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
279
|
-
headline && /* @__PURE__ */ jsxRuntime.jsx("h2", { className:
|
|
280
|
-
body && /* @__PURE__ */ jsxRuntime.jsx(RichText, { as: "div", html: body, className:
|
|
281
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
277
|
+
const ctaLabel = isProcessing ? msg.common.processing : selectedPlan?.name ? chunkER6YITYC_cjs.formatMessage(msg.offer.switchToCta, { planName: selectedPlan.name }) : msg.offer.acceptCta.plan_change || offer.copy.cta;
|
|
278
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkER6YITYC_cjs.cn("ck-step ck-step-offer", classNames?.root), children: [
|
|
279
|
+
headline && /* @__PURE__ */ jsxRuntime.jsx("h2", { className: chunkER6YITYC_cjs.cn("ck-step-title", classNames?.title), children: headline }),
|
|
280
|
+
body && /* @__PURE__ */ jsxRuntime.jsx(RichText, { as: "div", html: body, className: chunkER6YITYC_cjs.cn("ck-step-description", classNames?.description) }),
|
|
281
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkER6YITYC_cjs.cn("ck-offer-card", classNames?.card), children: [
|
|
282
282
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "ck-offer-details ck-plan-grid", children: plans.map((plan) => {
|
|
283
283
|
const interval = plan.duration?.interval ?? "month";
|
|
284
284
|
const currency = plan.amount.currency ?? "USD";
|
|
@@ -290,7 +290,7 @@ function DefaultPlanChangeOffer({
|
|
|
290
290
|
type: "button",
|
|
291
291
|
onClick: () => setSelectedPlanId(plan.id),
|
|
292
292
|
disabled: isCurrent,
|
|
293
|
-
className:
|
|
293
|
+
className: chunkER6YITYC_cjs.cn(
|
|
294
294
|
"ck-plan-card",
|
|
295
295
|
isSelected && "ck-plan-card--selected",
|
|
296
296
|
isCurrent && "ck-plan-card--current"
|
|
@@ -323,13 +323,13 @@ function DefaultPlanChangeOffer({
|
|
|
323
323
|
"button",
|
|
324
324
|
{
|
|
325
325
|
type: "button",
|
|
326
|
-
className:
|
|
326
|
+
className: chunkER6YITYC_cjs.cn("ck-button ck-button-primary", classNames?.acceptButton),
|
|
327
327
|
onClick: () => selectedPlanId && onAccept({ planId: selectedPlanId }),
|
|
328
328
|
disabled: isProcessing || !selectedPlanId,
|
|
329
329
|
children: ctaLabel
|
|
330
330
|
}
|
|
331
331
|
),
|
|
332
|
-
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className:
|
|
332
|
+
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: chunkER6YITYC_cjs.cn("ck-button-link", classNames?.declineButton), onClick: onDecline, children: msg.offer.declineCta || offer.copy.declineCta })
|
|
333
333
|
] })
|
|
334
334
|
] });
|
|
335
335
|
}
|
|
@@ -343,7 +343,7 @@ function DefaultRebateOffer({
|
|
|
343
343
|
classNames,
|
|
344
344
|
messages
|
|
345
345
|
}) {
|
|
346
|
-
const msg = messages ??
|
|
346
|
+
const msg = messages ?? chunkER6YITYC_cjs.defaultMessages;
|
|
347
347
|
const o = offer;
|
|
348
348
|
const headline = title ?? offer.copy.headline;
|
|
349
349
|
const body = description ?? offer.copy.body;
|
|
@@ -351,10 +351,10 @@ function DefaultRebateOffer({
|
|
|
351
351
|
const amount = o.amountMinor ?? 0;
|
|
352
352
|
const refund = o.amountPaidMinor != null && o.netAfterRebateMinor != null ? o.amountPaidMinor - o.netAfterRebateMinor : amount;
|
|
353
353
|
const taxRefunded = refund - amount;
|
|
354
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
355
|
-
headline && /* @__PURE__ */ jsxRuntime.jsx("h2", { className:
|
|
356
|
-
body && /* @__PURE__ */ jsxRuntime.jsx(RichText, { as: "div", html: body, className:
|
|
357
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
354
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkER6YITYC_cjs.cn("ck-step ck-step-offer", classNames?.root), children: [
|
|
355
|
+
headline && /* @__PURE__ */ jsxRuntime.jsx("h2", { className: chunkER6YITYC_cjs.cn("ck-step-title", classNames?.title), children: headline }),
|
|
356
|
+
body && /* @__PURE__ */ jsxRuntime.jsx(RichText, { as: "div", html: body, className: chunkER6YITYC_cjs.cn("ck-step-description", classNames?.description) }),
|
|
357
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkER6YITYC_cjs.cn("ck-offer-card", classNames?.card), children: [
|
|
358
358
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ck-offer-rebate", children: [
|
|
359
359
|
o.amountPaidMinor != null && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ck-offer-rebate-row", children: [
|
|
360
360
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: msg.offer.rebate.paidLabel }),
|
|
@@ -365,7 +365,7 @@ function DefaultRebateOffer({
|
|
|
365
365
|
msg.offer.rebate.moneyBackLabel,
|
|
366
366
|
taxRefunded > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "ck-offer-rebate-tax", children: [
|
|
367
367
|
" ",
|
|
368
|
-
|
|
368
|
+
chunkER6YITYC_cjs.formatMessage(msg.offer.rebate.inclTax, { amount: chunkM6Z3BHEH_cjs.formatPriceFromMinor(taxRefunded, currency) })
|
|
369
369
|
] })
|
|
370
370
|
] }),
|
|
371
371
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
@@ -382,29 +382,30 @@ function DefaultRebateOffer({
|
|
|
382
382
|
"button",
|
|
383
383
|
{
|
|
384
384
|
type: "button",
|
|
385
|
-
className:
|
|
385
|
+
className: chunkER6YITYC_cjs.cn("ck-button ck-button-primary", classNames?.acceptButton),
|
|
386
386
|
onClick: () => onAccept(),
|
|
387
387
|
disabled: isProcessing,
|
|
388
|
-
children: isProcessing ? msg.common.processing : offer.copy.cta
|
|
388
|
+
children: isProcessing ? msg.common.processing : msg.offer.acceptCta.rebate || offer.copy.cta
|
|
389
389
|
}
|
|
390
390
|
),
|
|
391
|
-
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className:
|
|
391
|
+
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: chunkER6YITYC_cjs.cn("ck-button-link", classNames?.declineButton), onClick: onDecline, children: msg.offer.declineCta || offer.copy.declineCta })
|
|
392
392
|
] })
|
|
393
393
|
] });
|
|
394
394
|
}
|
|
395
|
-
function DefaultRedirectOffer({ title, description, offer, onDecline, classNames }) {
|
|
395
|
+
function DefaultRedirectOffer({ title, description, offer, onDecline, classNames, messages }) {
|
|
396
|
+
const msg = messages ?? chunkER6YITYC_cjs.defaultMessages;
|
|
396
397
|
const url = offer.url;
|
|
397
398
|
const headline = title ?? offer.copy.headline;
|
|
398
399
|
const body = description ?? offer.copy.body;
|
|
399
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
400
|
-
headline && /* @__PURE__ */ jsxRuntime.jsx("h2", { className:
|
|
401
|
-
body && /* @__PURE__ */ jsxRuntime.jsx(RichText, { as: "div", html: body, className:
|
|
402
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
400
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkER6YITYC_cjs.cn("ck-step ck-step-offer", classNames?.root), children: [
|
|
401
|
+
headline && /* @__PURE__ */ jsxRuntime.jsx("h2", { className: chunkER6YITYC_cjs.cn("ck-step-title", classNames?.title), children: headline }),
|
|
402
|
+
body && /* @__PURE__ */ jsxRuntime.jsx(RichText, { as: "div", html: body, className: chunkER6YITYC_cjs.cn("ck-step-description", classNames?.description) }),
|
|
403
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkER6YITYC_cjs.cn("ck-offer-card", classNames?.card), children: [
|
|
403
404
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "ck-offer-details", children: /* @__PURE__ */ jsxRuntime.jsxs("a", { href: url, target: "_blank", rel: "noopener noreferrer", className: "ck-redirect-link", children: [
|
|
404
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: offer.copy.cta }),
|
|
405
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: msg.offer.acceptCta.redirect || offer.copy.cta }),
|
|
405
406
|
/* @__PURE__ */ jsxRuntime.jsx(ExternalIcon, {})
|
|
406
407
|
] }) }),
|
|
407
|
-
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className:
|
|
408
|
+
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: chunkER6YITYC_cjs.cn("ck-button-link", classNames?.declineButton), onClick: onDecline, children: msg.offer.declineCta || offer.copy.declineCta })
|
|
408
409
|
] })
|
|
409
410
|
] });
|
|
410
411
|
}
|
|
@@ -440,17 +441,17 @@ function DefaultTrialExtensionOffer({
|
|
|
440
441
|
classNames,
|
|
441
442
|
messages
|
|
442
443
|
}) {
|
|
443
|
-
const msg = messages ??
|
|
444
|
+
const msg = messages ?? chunkER6YITYC_cjs.defaultMessages;
|
|
444
445
|
const o = offer;
|
|
445
446
|
const headline = title ?? offer.copy.headline;
|
|
446
447
|
const body = description ?? offer.copy.body;
|
|
447
448
|
const end = /* @__PURE__ */ new Date();
|
|
448
449
|
end.setDate(end.getDate() + o.days);
|
|
449
450
|
const newEnd = chunkM6Z3BHEH_cjs.formatMonthDay(end);
|
|
450
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
451
|
-
headline && /* @__PURE__ */ jsxRuntime.jsx("h2", { className:
|
|
452
|
-
body && /* @__PURE__ */ jsxRuntime.jsx(RichText, { as: "div", html: body, className:
|
|
453
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
451
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkER6YITYC_cjs.cn("ck-step ck-step-offer", classNames?.root), children: [
|
|
452
|
+
headline && /* @__PURE__ */ jsxRuntime.jsx("h2", { className: chunkER6YITYC_cjs.cn("ck-step-title", classNames?.title), children: headline }),
|
|
453
|
+
body && /* @__PURE__ */ jsxRuntime.jsx(RichText, { as: "div", html: body, className: chunkER6YITYC_cjs.cn("ck-step-description", classNames?.description) }),
|
|
454
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkER6YITYC_cjs.cn("ck-offer-card", classNames?.card), children: [
|
|
454
455
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ck-offer-details ck-trial-block", children: [
|
|
455
456
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ck-trial-badge", children: [
|
|
456
457
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ck-trial-days", children: [
|
|
@@ -468,13 +469,13 @@ function DefaultTrialExtensionOffer({
|
|
|
468
469
|
"button",
|
|
469
470
|
{
|
|
470
471
|
type: "button",
|
|
471
|
-
className:
|
|
472
|
+
className: chunkER6YITYC_cjs.cn("ck-button ck-button-primary", classNames?.acceptButton),
|
|
472
473
|
onClick: () => onAccept(),
|
|
473
474
|
disabled: isProcessing,
|
|
474
|
-
children: isProcessing ? msg.common.processing : offer.copy.cta
|
|
475
|
+
children: isProcessing ? msg.common.processing : msg.offer.acceptCta.trial_extension || offer.copy.cta
|
|
475
476
|
}
|
|
476
477
|
),
|
|
477
|
-
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className:
|
|
478
|
+
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: chunkER6YITYC_cjs.cn("ck-button-link", classNames?.declineButton), onClick: onDecline, children: msg.offer.declineCta || offer.copy.declineCta })
|
|
478
479
|
] })
|
|
479
480
|
] });
|
|
480
481
|
}
|
|
@@ -511,12 +512,12 @@ function pickOfferComponent(type, components) {
|
|
|
511
512
|
}
|
|
512
513
|
}
|
|
513
514
|
function DefaultSuccess({ title, description, onClose, classNames, messages }) {
|
|
514
|
-
const m = messages ??
|
|
515
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
516
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
517
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { className:
|
|
518
|
-
description && /* @__PURE__ */ jsxRuntime.jsx(RichText, { as: "div", html: description, className:
|
|
519
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "ck-success-actions", children: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className:
|
|
515
|
+
const m = messages ?? chunkER6YITYC_cjs.defaultMessages;
|
|
516
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkER6YITYC_cjs.cn("ck-step ck-step-success", classNames?.root), children: [
|
|
517
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: chunkER6YITYC_cjs.cn("ck-success-icon", classNames?.icon), children: /* @__PURE__ */ jsxRuntime.jsx(Checkmark, { color: "currentColor", size: 26 }) }),
|
|
518
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: chunkER6YITYC_cjs.cn("ck-step-title", classNames?.title), children: title }),
|
|
519
|
+
description && /* @__PURE__ */ jsxRuntime.jsx(RichText, { as: "div", html: description, className: chunkER6YITYC_cjs.cn("ck-step-description", classNames?.description) }),
|
|
520
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "ck-success-actions", children: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: chunkER6YITYC_cjs.cn("ck-button ck-button-primary", classNames?.closeButton), onClick: onClose, children: m.common.done }) })
|
|
520
521
|
] });
|
|
521
522
|
}
|
|
522
523
|
function DefaultReasonButton({ reason, index, isSelected, onSelect }) {
|
|
@@ -528,7 +529,7 @@ function DefaultReasonButton({ reason, index, isSelected, onSelect }) {
|
|
|
528
529
|
role: "radio",
|
|
529
530
|
"aria-checked": isSelected,
|
|
530
531
|
onClick: () => onSelect(reason.id),
|
|
531
|
-
className:
|
|
532
|
+
className: chunkER6YITYC_cjs.cn("ck-reason-button", isSelected && "ck-reason-button--selected"),
|
|
532
533
|
children: [
|
|
533
534
|
/* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, className: "ck-reason-badge", children: isSelected ? /* @__PURE__ */ jsxRuntime.jsx(Checkmark, { color: "#fff", size: 12 }) : letter }),
|
|
534
535
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "ck-reason-label", children: reason.label })
|
|
@@ -549,14 +550,14 @@ function DefaultSurvey({
|
|
|
549
550
|
components,
|
|
550
551
|
messages
|
|
551
552
|
}) {
|
|
552
|
-
const m = messages ??
|
|
553
|
+
const m = messages ?? chunkER6YITYC_cjs.defaultMessages;
|
|
553
554
|
const ReasonButton = components?.ReasonButton ?? DefaultReasonButton;
|
|
554
555
|
const selected = reasons.find((r) => r.id === selectedReason);
|
|
555
556
|
const showFollowup = selected?.freeform === true;
|
|
556
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
557
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { className:
|
|
558
|
-
description && /* @__PURE__ */ jsxRuntime.jsx(RichText, { as: "div", html: description, className:
|
|
559
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
557
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkER6YITYC_cjs.cn("ck-step ck-step-survey", classNames?.root), children: [
|
|
558
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: chunkER6YITYC_cjs.cn("ck-step-title", classNames?.title), children: title }),
|
|
559
|
+
description && /* @__PURE__ */ jsxRuntime.jsx(RichText, { as: "div", html: description, className: chunkER6YITYC_cjs.cn("ck-step-description", classNames?.description) }),
|
|
560
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: chunkER6YITYC_cjs.cn("ck-reason-list", classNames?.reasonList), role: "radiogroup", "aria-label": title, children: reasons.map((reason, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
560
561
|
ReasonButton,
|
|
561
562
|
{
|
|
562
563
|
reason,
|
|
@@ -569,7 +570,7 @@ function DefaultSurvey({
|
|
|
569
570
|
showFollowup && /* @__PURE__ */ jsxRuntime.jsx(
|
|
570
571
|
"textarea",
|
|
571
572
|
{
|
|
572
|
-
className:
|
|
573
|
+
className: chunkER6YITYC_cjs.cn("ck-reason-followup", classNames?.followupInput),
|
|
573
574
|
placeholder: m.survey.followupPlaceholder,
|
|
574
575
|
rows: 3,
|
|
575
576
|
value: followupResponse,
|
|
@@ -581,7 +582,7 @@ function DefaultSurvey({
|
|
|
581
582
|
"button",
|
|
582
583
|
{
|
|
583
584
|
type: "button",
|
|
584
|
-
className:
|
|
585
|
+
className: chunkER6YITYC_cjs.cn("ck-button ck-button-primary", classNames?.continueButton),
|
|
585
586
|
onClick: onNext,
|
|
586
587
|
disabled: !selectedReason,
|
|
587
588
|
children: m.common.continue
|
|
@@ -590,7 +591,7 @@ function DefaultSurvey({
|
|
|
590
591
|
] });
|
|
591
592
|
}
|
|
592
593
|
function DefaultBackButton({ onBack, className, label }) {
|
|
593
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", className:
|
|
594
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", className: chunkER6YITYC_cjs.cn("ck-back-button", className), onClick: onBack, children: [
|
|
594
595
|
/* @__PURE__ */ jsxRuntime.jsx("svg", { width: "14", height: "14", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
595
596
|
"path",
|
|
596
597
|
{
|
|
@@ -605,7 +606,7 @@ function DefaultBackButton({ onBack, className, label }) {
|
|
|
605
606
|
] });
|
|
606
607
|
}
|
|
607
608
|
function DefaultCloseButton({ onClose, className, label }) {
|
|
608
|
-
return /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className:
|
|
609
|
+
return /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: chunkER6YITYC_cjs.cn("ck-close-button", className), onClick: onClose, "aria-label": label ?? "Close", children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M15 5L5 15M5 5l10 10", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) }) });
|
|
609
610
|
}
|
|
610
611
|
function trapFocus(container) {
|
|
611
612
|
const focusableSelector = [
|
|
@@ -665,7 +666,7 @@ function DefaultModal({ open, onClose, children, className, overlayClassName })
|
|
|
665
666
|
"div",
|
|
666
667
|
{
|
|
667
668
|
ref: overlayRef,
|
|
668
|
-
className:
|
|
669
|
+
className: chunkER6YITYC_cjs.cn("ck-overlay", overlayClassName),
|
|
669
670
|
onClick: (e) => {
|
|
670
671
|
if (e.target === overlayRef.current) onClose();
|
|
671
672
|
},
|
|
@@ -677,7 +678,7 @@ function DefaultModal({ open, onClose, children, className, overlayClassName })
|
|
|
677
678
|
"aria-modal": "true",
|
|
678
679
|
"aria-labelledby": "ck-dialog-title",
|
|
679
680
|
tabIndex: -1,
|
|
680
|
-
className:
|
|
681
|
+
className: chunkER6YITYC_cjs.cn("ck-modal", className),
|
|
681
682
|
children
|
|
682
683
|
}
|
|
683
684
|
)
|
|
@@ -703,7 +704,7 @@ function useColorScheme(preference) {
|
|
|
703
704
|
return system;
|
|
704
705
|
}
|
|
705
706
|
function CancelFlow(props) {
|
|
706
|
-
const { machine, state, isLoading, loadError, retry } =
|
|
707
|
+
const { machine, state, isLoading, loadError, retry } = chunkFK4AJOX6_cjs.useCancelFlowMachine(props);
|
|
707
708
|
if (isLoading || loadError) {
|
|
708
709
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
709
710
|
LoadStatus,
|
|
@@ -742,7 +743,7 @@ function LoadStatus({
|
|
|
742
743
|
messages
|
|
743
744
|
}) {
|
|
744
745
|
const scheme = useColorScheme(appearance?.colorScheme);
|
|
745
|
-
const appearanceStyle =
|
|
746
|
+
const appearanceStyle = chunkER6YITYC_cjs.appearanceToStyle(appearance);
|
|
746
747
|
const Modal = components?.Modal ?? DefaultModal;
|
|
747
748
|
const CloseButton = components?.CloseButton ?? DefaultCloseButton;
|
|
748
749
|
const handleClose = onClose ?? (() => {
|
|
@@ -795,7 +796,7 @@ function LoadStatus({
|
|
|
795
796
|
}
|
|
796
797
|
function FlowShell({ machine, state, appearance, classNames, components, customComponents }) {
|
|
797
798
|
const scheme = useColorScheme(appearance?.colorScheme);
|
|
798
|
-
const appearanceStyle =
|
|
799
|
+
const appearanceStyle = chunkER6YITYC_cjs.appearanceToStyle(appearance);
|
|
799
800
|
const messages = machine.messages;
|
|
800
801
|
const Modal = components?.Modal ?? DefaultModal;
|
|
801
802
|
const CloseButton = components?.CloseButton ?? DefaultCloseButton;
|
|
@@ -857,7 +858,7 @@ function StepRenderer({
|
|
|
857
858
|
}
|
|
858
859
|
);
|
|
859
860
|
}
|
|
860
|
-
if (!
|
|
861
|
+
if (!chunkER6YITYC_cjs.BUILT_IN_OFFER_TYPES.includes(offer.type)) {
|
|
861
862
|
return /* @__PURE__ */ jsxRuntime.jsx(UnregisteredOfferFallback, { offerType: offer.type, onSkip: machine.decline });
|
|
862
863
|
}
|
|
863
864
|
const Offer = components?.Offer ?? DefaultOffer;
|
|
@@ -912,7 +913,7 @@ function StepRenderer({
|
|
|
912
913
|
subscriptions: state.subscriptions,
|
|
913
914
|
losses: config?.losses,
|
|
914
915
|
lossesLabel: config?.lossesLabel,
|
|
915
|
-
confirmLabel: config?.confirmLabel ??
|
|
916
|
+
confirmLabel: config?.confirmLabel ?? chunkER6YITYC_cjs.selectTiming(messages.confirm.cta, state.cancelAtPeriodEnd),
|
|
916
917
|
goBackLabel: config?.goBackLabel ?? messages.confirm.goBack,
|
|
917
918
|
periodEndNotice: resolvePeriodEndNotice(state, messages),
|
|
918
919
|
onConfirm: machine.cancel,
|
|
@@ -934,8 +935,8 @@ function StepRenderer({
|
|
|
934
935
|
outcome: state.outcome ?? "cancelled",
|
|
935
936
|
offer: machine.currentOffer ?? void 0,
|
|
936
937
|
acceptedOffer: state.acceptedOffer ?? void 0,
|
|
937
|
-
title: isSaved ? config?.savedTitle ?? perOffer?.title ?? messages.success.saved.title : config?.cancelledTitle ??
|
|
938
|
-
description: isSaved ? config?.savedDescription ?? pauseResumeDescription(messages, state.acceptedOffer) ?? perOffer?.description ?? messages.success.saved.description : config?.cancelledDescription ??
|
|
938
|
+
title: isSaved ? config?.savedTitle ?? perOffer?.title ?? messages.success.saved.title : config?.cancelledTitle ?? chunkER6YITYC_cjs.selectTiming(messages.success.cancelled.title, state.cancelAtPeriodEnd),
|
|
939
|
+
description: isSaved ? config?.savedDescription ?? pauseResumeDescription(messages, state.acceptedOffer) ?? perOffer?.description ?? messages.success.saved.description : config?.cancelledDescription ?? chunkER6YITYC_cjs.selectTiming(messages.success.cancelled.description, state.cancelAtPeriodEnd),
|
|
939
940
|
customer: state.customer,
|
|
940
941
|
subscriptions: state.subscriptions,
|
|
941
942
|
onClose: machine.close,
|
|
@@ -984,15 +985,15 @@ function pauseResumeDescription(messages, offer) {
|
|
|
984
985
|
} else {
|
|
985
986
|
resume.setMonth(resume.getMonth() + months);
|
|
986
987
|
}
|
|
987
|
-
return
|
|
988
|
+
return chunkER6YITYC_cjs.formatMessage(messages.success.saved.pause.resumeDescription, { resumeDate: chunkM6Z3BHEH_cjs.formatShortDate(resume) });
|
|
988
989
|
}
|
|
989
990
|
function resolvePeriodEndNotice(state, messages) {
|
|
990
991
|
if (state.cancelAtPeriodEnd !== true) return void 0;
|
|
991
|
-
const template =
|
|
992
|
+
const template = chunkER6YITYC_cjs.selectTiming(messages.confirm.periodEndNotice, state.cancelAtPeriodEnd);
|
|
992
993
|
if (!template) return void 0;
|
|
993
994
|
const periodEnd = chunkM6Z3BHEH_cjs.formatPeriodEnd(state.subscriptions);
|
|
994
995
|
if (!periodEnd) return void 0;
|
|
995
|
-
return
|
|
996
|
+
return chunkER6YITYC_cjs.formatMessage(template, { periodEnd });
|
|
996
997
|
}
|
|
997
998
|
function UnregisteredStepFallback({ step, onSkip }) {
|
|
998
999
|
react.useEffect(() => {
|
|
@@ -1011,7 +1012,7 @@ function UnregisteredOfferFallback({ offerType, onSkip }) {
|
|
|
1011
1012
|
|
|
1012
1013
|
Object.defineProperty(exports, "useCancelFlow", {
|
|
1013
1014
|
enumerable: true,
|
|
1014
|
-
get: function () { return
|
|
1015
|
+
get: function () { return chunkFK4AJOX6_cjs.useCancelFlow; }
|
|
1015
1016
|
});
|
|
1016
1017
|
Object.defineProperty(exports, "calculateDiscountedPrice", {
|
|
1017
1018
|
enumerable: true,
|
|
@@ -1027,55 +1028,55 @@ Object.defineProperty(exports, "formatPrice", {
|
|
|
1027
1028
|
});
|
|
1028
1029
|
Object.defineProperty(exports, "AnalyticsClient", {
|
|
1029
1030
|
enumerable: true,
|
|
1030
|
-
get: function () { return
|
|
1031
|
+
get: function () { return chunkER6YITYC_cjs.AnalyticsClient; }
|
|
1031
1032
|
});
|
|
1032
1033
|
Object.defineProperty(exports, "BUILT_IN_OFFER_TYPES", {
|
|
1033
1034
|
enumerable: true,
|
|
1034
|
-
get: function () { return
|
|
1035
|
+
get: function () { return chunkER6YITYC_cjs.BUILT_IN_OFFER_TYPES; }
|
|
1035
1036
|
});
|
|
1036
1037
|
Object.defineProperty(exports, "BUILT_IN_STEP_TYPES", {
|
|
1037
1038
|
enumerable: true,
|
|
1038
|
-
get: function () { return
|
|
1039
|
+
get: function () { return chunkER6YITYC_cjs.BUILT_IN_STEP_TYPES; }
|
|
1039
1040
|
});
|
|
1040
1041
|
Object.defineProperty(exports, "CancelFlowMachine", {
|
|
1041
1042
|
enumerable: true,
|
|
1042
|
-
get: function () { return
|
|
1043
|
+
get: function () { return chunkER6YITYC_cjs.CancelFlowMachine; }
|
|
1043
1044
|
});
|
|
1044
1045
|
Object.defineProperty(exports, "ChurnkeyApi", {
|
|
1045
1046
|
enumerable: true,
|
|
1046
|
-
get: function () { return
|
|
1047
|
+
get: function () { return chunkER6YITYC_cjs.ChurnkeyApi; }
|
|
1047
1048
|
});
|
|
1048
1049
|
Object.defineProperty(exports, "appearanceToStyle", {
|
|
1049
1050
|
enumerable: true,
|
|
1050
|
-
get: function () { return
|
|
1051
|
+
get: function () { return chunkER6YITYC_cjs.appearanceToStyle; }
|
|
1051
1052
|
});
|
|
1052
1053
|
Object.defineProperty(exports, "buildMessages", {
|
|
1053
1054
|
enumerable: true,
|
|
1054
|
-
get: function () { return
|
|
1055
|
+
get: function () { return chunkER6YITYC_cjs.buildMessages; }
|
|
1055
1056
|
});
|
|
1056
1057
|
Object.defineProperty(exports, "cn", {
|
|
1057
1058
|
enumerable: true,
|
|
1058
|
-
get: function () { return
|
|
1059
|
+
get: function () { return chunkER6YITYC_cjs.cn; }
|
|
1059
1060
|
});
|
|
1060
1061
|
Object.defineProperty(exports, "decodeSessionToken", {
|
|
1061
1062
|
enumerable: true,
|
|
1062
|
-
get: function () { return
|
|
1063
|
+
get: function () { return chunkER6YITYC_cjs.decodeSessionToken; }
|
|
1063
1064
|
});
|
|
1064
1065
|
Object.defineProperty(exports, "defaultMessages", {
|
|
1065
1066
|
enumerable: true,
|
|
1066
|
-
get: function () { return
|
|
1067
|
+
get: function () { return chunkER6YITYC_cjs.defaultMessages; }
|
|
1067
1068
|
});
|
|
1068
1069
|
Object.defineProperty(exports, "defaultTitles", {
|
|
1069
1070
|
enumerable: true,
|
|
1070
|
-
get: function () { return
|
|
1071
|
+
get: function () { return chunkER6YITYC_cjs.defaultTitles; }
|
|
1071
1072
|
});
|
|
1072
1073
|
Object.defineProperty(exports, "formatMessage", {
|
|
1073
1074
|
enumerable: true,
|
|
1074
|
-
get: function () { return
|
|
1075
|
+
get: function () { return chunkER6YITYC_cjs.formatMessage; }
|
|
1075
1076
|
});
|
|
1076
1077
|
Object.defineProperty(exports, "selectTiming", {
|
|
1077
1078
|
enumerable: true,
|
|
1078
|
-
get: function () { return
|
|
1079
|
+
get: function () { return chunkER6YITYC_cjs.selectTiming; }
|
|
1079
1080
|
});
|
|
1080
1081
|
exports.CancelFlow = CancelFlow;
|
|
1081
1082
|
exports.DefaultBackButton = DefaultBackButton;
|