@drawbridge/components 0.1.35 → 0.1.37
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/components/styles.css +355 -68
- package/dist/advertisement.js +20 -15
- package/dist/advertisement.mjs +20 -15
- package/dist/bridge/advertisements.js +2 -4
- package/dist/bridge/advertisements.mjs +3 -5
- package/dist/bridge/fields.js +6 -89
- package/dist/bridge/fields.mjs +7 -89
- package/dist/bridge/form-subdomain-embed.js +1 -5
- package/dist/bridge/form-subdomain-embed.mjs +1 -5
- package/dist/bridge/form-subdomain-header.js +14 -21
- package/dist/bridge/form-subdomain-header.mjs +14 -20
- package/dist/bridge/form-subdomain-issue.js +8 -17
- package/dist/bridge/form-subdomain-issue.mjs +8 -17
- package/dist/bridge/form-subdomain-missions.js +52 -58
- package/dist/bridge/form-subdomain-missions.mjs +54 -60
- package/dist/bridge/form-subdomain.js +94 -223
- package/dist/bridge/form-subdomain.mjs +96 -222
- package/dist/bridge/lib/entry.js +6 -61
- package/dist/bridge/lib/entry.mjs +5 -51
- package/dist/bridge/lib/order.js +0 -23
- package/dist/bridge/lib/order.mjs +0 -20
- package/dist/bridge/template-layout.js +2 -5
- package/dist/bridge/template-layout.mjs +3 -6
- package/dist/bridge/template-modal.js +15 -82
- package/dist/bridge/template-modal.mjs +16 -83
- package/dist/bridge/template-preview.js +208 -0
- package/dist/bridge/template-preview.mjs +173 -0
- package/dist/bridge/template-subdomain-gallery.js +75 -126
- package/dist/bridge/template-subdomain-gallery.mjs +75 -122
- package/dist/bridge/template-subdomain.js +14 -16
- package/dist/bridge/template-subdomain.mjs +15 -17
- package/dist/dashboard/avatar.js +0 -5
- package/dist/dashboard/avatar.mjs +0 -5
- package/dist/dashboard/card-affiliate.js +2 -3
- package/dist/dashboard/card-affiliate.mjs +2 -3
- package/dist/dashboard/card-campaign-switch.js +9 -34
- package/dist/dashboard/card-campaign-switch.mjs +8 -32
- package/dist/dashboard/card-connection.js +91 -51
- package/dist/dashboard/card-connection.mjs +89 -50
- package/dist/dashboard/card-order.js +14 -6
- package/dist/dashboard/card-order.mjs +14 -6
- package/dist/dashboard/card-section.js +26 -69
- package/dist/dashboard/card-section.mjs +26 -65
- package/dist/dashboard/card-tile.js +35 -3
- package/dist/dashboard/card-tile.mjs +34 -3
- package/dist/dashboard/device.js +95 -0
- package/dist/dashboard/device.mjs +72 -0
- package/dist/dashboard/drawer-subscription.js +14 -52
- package/dist/dashboard/drawer-subscription.mjs +14 -52
- package/dist/dashboard/drawer.js +3 -20
- package/dist/dashboard/drawer.mjs +4 -21
- package/dist/dashboard/dropdown.js +2 -6
- package/dist/dashboard/dropdown.mjs +2 -6
- package/dist/dashboard/form-admin-subscription-custom.js +8 -72
- package/dist/dashboard/form-admin-subscription-custom.mjs +8 -72
- package/dist/dashboard/form-ai.js +148 -0
- package/dist/dashboard/form-ai.mjs +148 -1
- package/dist/dashboard/form-filters-analytics.js +62 -85
- package/dist/dashboard/form-filters-analytics.mjs +61 -85
- package/dist/dashboard/form-organization-brand.js +13 -30
- package/dist/dashboard/form-organization-brand.mjs +13 -30
- package/dist/dashboard/form-organization-campaign-advertisement.js +112 -38
- package/dist/dashboard/form-organization-campaign-advertisement.mjs +112 -38
- package/dist/dashboard/form-organization-campaign-agreement.js +210 -414
- package/dist/dashboard/form-organization-campaign-agreement.mjs +212 -411
- package/dist/dashboard/form-organization-campaign-field-list.js +425 -0
- package/dist/dashboard/form-organization-campaign-field-list.mjs +396 -0
- package/dist/dashboard/form-organization-campaign-field-number.js +7 -48
- package/dist/dashboard/form-organization-campaign-field-number.mjs +7 -48
- package/dist/dashboard/form-organization-campaign-field-select.js +4 -15
- package/dist/dashboard/form-organization-campaign-field-select.mjs +4 -15
- package/dist/dashboard/form-organization-campaign-field-text.js +6 -46
- package/dist/dashboard/form-organization-campaign-field-text.mjs +6 -46
- package/dist/dashboard/form-organization-campaign-field-textarea.js +13 -22
- package/dist/dashboard/form-organization-campaign-field-textarea.mjs +13 -22
- package/dist/dashboard/form-organization-campaign-integration-age.js +35 -2
- package/dist/dashboard/form-organization-campaign-integration-age.mjs +35 -2
- package/dist/dashboard/form-organization-campaign-integration-geocode.js +1 -4
- package/dist/dashboard/form-organization-campaign-integration-geocode.mjs +1 -4
- package/dist/dashboard/form-organization-campaign-page-embed.js +1 -1
- package/dist/dashboard/form-organization-campaign-page-embed.mjs +1 -1
- package/dist/dashboard/form-organization-campaign-page-preview.js +2 -1
- package/dist/dashboard/form-organization-campaign-page-preview.mjs +2 -1
- package/dist/dashboard/form-organization-campaign-page-qr.js +2 -2
- package/dist/dashboard/form-organization-campaign-page-qr.mjs +2 -2
- package/dist/dashboard/form-organization-campaign-page-share.js +5 -5
- package/dist/dashboard/form-organization-campaign-page-share.mjs +5 -5
- package/dist/dashboard/form-organization-campaign-page-slug.js +3 -2
- package/dist/dashboard/form-organization-campaign-page-slug.mjs +3 -2
- package/dist/dashboard/form-organization-campaign-page.js +265 -168
- package/dist/dashboard/form-organization-campaign-page.mjs +266 -170
- package/dist/dashboard/form-organization-campaign-section.js +107 -125
- package/dist/dashboard/form-organization-campaign-section.mjs +107 -121
- package/dist/dashboard/form-organization-campaign.js +9 -119
- package/dist/dashboard/form-organization-campaign.mjs +9 -118
- package/dist/dashboard/form-organization-file-frame.js +1 -7
- package/dist/dashboard/form-organization-file-frame.mjs +1 -7
- package/dist/dashboard/form-organization-workflow.js +545 -589
- package/dist/dashboard/form-organization-workflow.mjs +545 -590
- package/dist/dashboard/form-organization.js +0 -22
- package/dist/dashboard/form-organization.mjs +0 -22
- package/dist/dashboard/form-verify-prize.js +34 -114
- package/dist/dashboard/form-verify-prize.mjs +34 -111
- package/dist/dashboard/google.js +1 -8
- package/dist/dashboard/google.mjs +1 -8
- package/dist/dashboard/input-array.js +0 -2
- package/dist/dashboard/input-array.mjs +0 -2
- package/dist/dashboard/input-combobox.js +9 -0
- package/dist/dashboard/input-combobox.mjs +9 -0
- package/dist/dashboard/input-date.js +8 -3
- package/dist/dashboard/input-date.mjs +8 -3
- package/dist/dashboard/input-editor.js +6 -17
- package/dist/dashboard/input-editor.mjs +6 -17
- package/dist/dashboard/input-fields.js +437 -287
- package/dist/dashboard/input-fields.mjs +436 -287
- package/dist/dashboard/input-file.js +2 -70
- package/dist/dashboard/input-file.mjs +2 -70
- package/dist/dashboard/input-font.js +55 -64
- package/dist/dashboard/input-font.mjs +55 -64
- package/dist/dashboard/input-resource.js +1 -4
- package/dist/dashboard/input-resource.mjs +1 -4
- package/dist/dashboard/item-row.js +92 -0
- package/dist/dashboard/item-row.mjs +63 -0
- package/dist/dashboard/lib/features.js +1 -1
- package/dist/dashboard/lib/features.mjs +1 -1
- package/dist/dashboard/lib/item-list.js +15 -0
- package/dist/dashboard/lib/item-list.mjs +14 -0
- package/dist/dashboard/lib/rail.js +17 -16
- package/dist/dashboard/lib/rail.mjs +16 -15
- package/dist/dashboard/lib/sms.js +2 -8
- package/dist/dashboard/lib/sms.mjs +1 -6
- package/dist/dashboard/list-resource.js +0 -2
- package/dist/dashboard/list-resource.mjs +0 -2
- package/dist/dashboard/menu.js +5 -54
- package/dist/dashboard/menu.mjs +5 -53
- package/dist/dashboard/modal.js +4 -19
- package/dist/dashboard/modal.mjs +5 -20
- package/dist/dashboard/order-sections.js +0 -4
- package/dist/dashboard/order-sections.mjs +0 -4
- package/dist/dashboard/preview.js +324 -838
- package/dist/dashboard/preview.mjs +324 -826
- package/dist/dashboard/provider-ui.js +12 -20
- package/dist/dashboard/provider-ui.mjs +13 -21
- package/dist/dashboard/recharts.js +28 -53
- package/dist/dashboard/recharts.mjs +28 -53
- package/dist/dashboard/swatch.js +0 -35
- package/dist/dashboard/swatch.mjs +0 -31
- package/dist/dashboard/table-contacts.js +10 -6
- package/dist/dashboard/table-contacts.mjs +10 -6
- package/dist/dashboard/table.js +3 -10
- package/dist/dashboard/table.mjs +3 -9
- package/dist/dashboard/template-dashboard.js +21 -13
- package/dist/dashboard/template-dashboard.mjs +21 -12
- package/dist/dashboard/template-rail.js +126 -198
- package/dist/dashboard/template-rail.mjs +125 -196
- package/dist/dashboard/template-socket.js +12 -0
- package/dist/dashboard/template-socket.mjs +12 -0
- package/dist/dashboard/template-ui.js +11 -20
- package/dist/dashboard/template-ui.mjs +13 -22
- package/dist/input-checkbox.js +1 -7
- package/dist/input-checkbox.mjs +1 -7
- package/dist/input-name.js +3 -3
- package/dist/input-name.mjs +3 -3
- package/dist/input-select.js +1 -3
- package/dist/input-select.mjs +1 -3
- package/dist/provider-font.js +3 -4
- package/dist/provider-font.mjs +3 -4
- package/dist/shared/badge.js +0 -15
- package/dist/shared/badge.mjs +0 -11
- package/dist/shared/carousel.js +7 -11
- package/dist/shared/carousel.mjs +7 -11
- package/dist/shared/lib/campaign.js +9 -3
- package/dist/shared/lib/campaign.mjs +9 -3
- package/dist/shared/lib/helpers.js +0 -24
- package/dist/shared/lib/helpers.mjs +0 -22
- package/dist/shared/lib/video.js +0 -6
- package/dist/shared/lib/video.mjs +0 -5
- package/dist/shared/sortable.js +10 -27
- package/dist/shared/sortable.mjs +10 -27
- package/dist/shared/tabs.js +1 -1
- package/dist/shared/tabs.mjs +1 -1
- package/dist/video.js +9 -127
- package/dist/video.mjs +11 -125
- package/package.json +20 -176
- package/types/bridge/fields.d.ts +1 -6
- package/types/bridge/form-subdomain-missions.d.ts +0 -2
- package/types/bridge/form-subdomain.d.ts +3 -62
- package/types/bridge/lib/entry.d.ts +7 -44
- package/types/bridge/lib/order.d.ts +2 -13
- package/types/bridge/subdomain-content.d.ts +0 -1
- package/types/bridge/template-preview.d.ts +10 -0
- package/types/bridge/template-subdomain-gallery.d.ts +1 -13
- package/types/dashboard/card-campaign-switch.d.ts +1 -20
- package/types/dashboard/card-connection.d.ts +8 -0
- package/types/dashboard/card-order.d.ts +2 -2
- package/types/dashboard/card-section.d.ts +1 -9
- package/types/dashboard/card-tile.d.ts +9 -4
- package/types/dashboard/device.d.ts +12 -0
- package/types/dashboard/drawer.d.ts +0 -3
- package/types/dashboard/form-ai.d.ts +17 -0
- package/types/dashboard/form-filters-analytics.d.ts +14 -0
- package/types/dashboard/form-organization-brand.d.ts +0 -3
- package/types/dashboard/form-organization-campaign-agreement.d.ts +10 -53
- package/types/dashboard/form-organization-campaign-field-list.d.ts +36 -0
- package/types/dashboard/form-organization-campaign-field-number.d.ts +1 -4
- package/types/dashboard/form-organization-campaign-field-select.d.ts +1 -6
- package/types/dashboard/form-organization-campaign-field-text.d.ts +1 -5
- package/types/dashboard/form-organization-campaign-field-textarea.d.ts +1 -4
- package/types/dashboard/form-organization-campaign-integration-age.d.ts +1 -2
- package/types/dashboard/form-organization-campaign-integration-geocode.d.ts +0 -2
- package/types/dashboard/form-organization-campaign-page.d.ts +15 -9
- package/types/dashboard/form-organization-campaign-section.d.ts +8 -24
- package/types/dashboard/form-organization-campaign.d.ts +0 -3
- package/types/dashboard/form-organization-workflow.d.ts +4 -3
- package/types/dashboard/form-organization.d.ts +2 -2
- package/types/dashboard/form-verify-prize.d.ts +3 -30
- package/types/dashboard/input-combobox.d.ts +2 -0
- package/types/dashboard/input-date.d.ts +2 -0
- package/types/dashboard/input-editor.d.ts +0 -9
- package/types/dashboard/input-fields.d.ts +5 -8
- package/types/dashboard/input-file.d.ts +0 -4
- package/types/dashboard/input-resource.d.ts +0 -1
- package/types/dashboard/item-row.d.ts +25 -0
- package/types/dashboard/lib/item-list.d.ts +5 -10
- package/types/dashboard/lib/rail.d.ts +1 -0
- package/types/dashboard/lib/sms.d.ts +0 -7
- package/types/dashboard/modal.d.ts +1 -3
- package/types/dashboard/preview.d.ts +10 -65
- package/types/dashboard/recharts.d.ts +0 -3
- package/types/dashboard/swatch.d.ts +0 -4
- package/types/dashboard/template-dashboard.d.ts +2 -3
- package/types/input-select.d.ts +0 -2
- package/types/shared/button.d.ts +1 -1
- package/types/shared/lib/helpers.d.ts +1 -22
- package/types/shared/lib/video.d.ts +0 -3
- package/types/shared/sortable.d.ts +0 -6
- package/types/video.d.ts +2 -18
- package/dist/bridge/form-subdomain-agreement.js +0 -165
- package/dist/bridge/form-subdomain-agreement.mjs +0 -132
- package/dist/dashboard/campaign-form.js +0 -1798
- package/dist/dashboard/campaign-form.mjs +0 -1769
- package/dist/dashboard/card-campaign-agreement.js +0 -172
- package/dist/dashboard/card-campaign-agreement.mjs +0 -139
- package/dist/dashboard/card-shortcut.js +0 -181
- package/dist/dashboard/card-shortcut.mjs +0 -152
- package/dist/dashboard/document-blocks.js +0 -305
- package/dist/dashboard/document-blocks.mjs +0 -270
- package/dist/dashboard/form-organization-campaign-advertisements.js +0 -374
- package/dist/dashboard/form-organization-campaign-advertisements.mjs +0 -345
- package/dist/dashboard/form-organization-campaign-design.js +0 -258
- package/dist/dashboard/form-organization-campaign-design.mjs +0 -223
- package/dist/dashboard/form-organization-campaign-field-item.js +0 -585
- package/dist/dashboard/form-organization-campaign-field-item.mjs +0 -552
- package/dist/dashboard/form-organization-campaign-field-skill.js +0 -359
- package/dist/dashboard/form-organization-campaign-field-skill.mjs +0 -330
- package/dist/dashboard/form-organization-campaign-footer.js +0 -178
- package/dist/dashboard/form-organization-campaign-footer.mjs +0 -149
- package/dist/dashboard/form-reposition.js +0 -396
- package/dist/dashboard/form-reposition.mjs +0 -359
- package/dist/dashboard/form-support.js +0 -189
- package/dist/dashboard/form-support.mjs +0 -160
- package/dist/dashboard/form-tests.js +0 -683
- package/dist/dashboard/form-tests.mjs +0 -646
- package/dist/dashboard/lib/ab-tests.js +0 -130
- package/dist/dashboard/lib/ab-tests.mjs +0 -94
- package/dist/dashboard/lib/focus.js +0 -93
- package/dist/dashboard/lib/focus.mjs +0 -69
- package/dist/dashboard/lib/form-page.js +0 -203
- package/dist/dashboard/lib/form-page.mjs +0 -155
- package/dist/dashboard/template-design.js +0 -564
- package/dist/dashboard/template-design.mjs +0 -531
- package/dist/dashboard/template-test-page.js +0 -436
- package/dist/dashboard/template-test-page.mjs +0 -407
- package/dist/dashboard/template-tests.js +0 -141
- package/dist/dashboard/template-tests.mjs +0 -112
- package/dist/dashboard/template-variant.js +0 -185
- package/dist/dashboard/template-variant.mjs +0 -156
- package/dist/icons/arrow-down-long.js +0 -47
- package/dist/icons/arrow-down-long.mjs +0 -28
- package/dist/icons/arrows-pointing-out.js +0 -46
- package/dist/icons/arrows-pointing-out.mjs +0 -27
- package/dist/icons/beaker.js +0 -46
- package/dist/icons/beaker.mjs +0 -27
- package/dist/icons/identification.js +0 -46
- package/dist/icons/identification.mjs +0 -27
- package/dist/icons/lifebuoy.js +0 -46
- package/dist/icons/lifebuoy.mjs +0 -27
- package/dist/icons/rectangle-group.js +0 -46
- package/dist/icons/rectangle-group.mjs +0 -27
- package/dist/icons/rectangle-stack.js +0 -46
- package/dist/icons/rectangle-stack.mjs +0 -27
- package/dist/icons/shopping-bag.js +0 -46
- package/dist/icons/shopping-bag.mjs +0 -27
- package/dist/icons/swatch.js +0 -46
- package/dist/icons/swatch.mjs +0 -27
- package/dist/icons/window.js +0 -46
- package/dist/icons/window.mjs +0 -27
- package/dist/icons/zoom-in.js +0 -46
- package/dist/icons/zoom-in.mjs +0 -27
- package/dist/input-answer.js +0 -60
- package/dist/input-answer.mjs +0 -27
- package/dist/shared/document-pieces.js +0 -295
- package/dist/shared/document-pieces.mjs +0 -260
- package/types/bridge/form-subdomain-agreement.d.ts +0 -27
- package/types/dashboard/campaign-form.d.ts +0 -42
- package/types/dashboard/card-campaign-agreement.d.ts +0 -26
- package/types/dashboard/card-shortcut.d.ts +0 -38
- package/types/dashboard/document-blocks.d.ts +0 -14
- package/types/dashboard/form-organization-campaign-advertisements.d.ts +0 -15
- package/types/dashboard/form-organization-campaign-design.d.ts +0 -46
- package/types/dashboard/form-organization-campaign-field-item.d.ts +0 -36
- package/types/dashboard/form-organization-campaign-field-skill.d.ts +0 -36
- package/types/dashboard/form-organization-campaign-footer.d.ts +0 -23
- package/types/dashboard/form-reposition.d.ts +0 -29
- package/types/dashboard/form-support.d.ts +0 -14
- package/types/dashboard/form-tests.d.ts +0 -78
- package/types/dashboard/lib/ab-tests.d.ts +0 -50
- package/types/dashboard/lib/escape.d.ts +0 -4
- package/types/dashboard/lib/focus.d.ts +0 -16
- package/types/dashboard/lib/form-page.d.ts +0 -25
- package/types/dashboard/template-design.d.ts +0 -30
- package/types/dashboard/template-test-page.d.ts +0 -69
- package/types/dashboard/template-tests.d.ts +0 -30
- package/types/dashboard/template-variant.d.ts +0 -18
- package/types/icons/arrow-down-long.d.ts +0 -5
- package/types/icons/arrows-pointing-out.d.ts +0 -5
- package/types/icons/beaker.d.ts +0 -5
- package/types/icons/identification.d.ts +0 -5
- package/types/icons/lifebuoy.d.ts +0 -5
- package/types/icons/rectangle-group.d.ts +0 -5
- package/types/icons/rectangle-stack.d.ts +0 -5
- package/types/icons/shopping-bag.d.ts +0 -5
- package/types/icons/swatch.d.ts +0 -5
- package/types/icons/window.d.ts +0 -5
- package/types/icons/zoom-in.d.ts +0 -5
- package/types/input-answer.d.ts +0 -15
- package/types/shared/document-pieces.d.ts +0 -34
- package/types/shared/lib/motion.d.ts +0 -2
|
@@ -14,10 +14,9 @@ import { ageFor, ageGateSchema } from "./lib/age-gate.mjs";
|
|
|
14
14
|
import { useGoogleReCaptcha } from "react-google-recaptcha-v3";
|
|
15
15
|
import { assertRecaptcha } from "./lib/recaptcha.mjs";
|
|
16
16
|
import { submissionEndpoint } from "./lib/url.mjs";
|
|
17
|
-
import {
|
|
18
|
-
import FormSubdomainAgreement from "./form-subdomain-agreement.mjs";
|
|
17
|
+
import { agreementWording, panelMissions } from "./lib/entry.mjs";
|
|
19
18
|
import { LOCATION_TIMEOUT, locationCopy, locationStatus } from "./lib/location.mjs";
|
|
20
|
-
import { isLastList, itemCount,
|
|
19
|
+
import { isLastList, itemCount, limitMessage, orderTotal, sectionsOf } from "./lib/order.mjs";
|
|
21
20
|
import Form from "../shared/form.mjs";
|
|
22
21
|
import Button from "../shared/button.mjs";
|
|
23
22
|
import Fieldset from "../shared/fieldset.mjs";
|
|
@@ -46,7 +45,6 @@ const scrollToCentre = (node) => {
|
|
|
46
45
|
};
|
|
47
46
|
const FormSubdomainSubmission = ({
|
|
48
47
|
affiliate,
|
|
49
|
-
after = AFTER,
|
|
50
48
|
button,
|
|
51
49
|
checkout,
|
|
52
50
|
giveaway,
|
|
@@ -151,7 +149,6 @@ const FormSubdomainSubmission = ({
|
|
|
151
149
|
{
|
|
152
150
|
...{
|
|
153
151
|
advertisements,
|
|
154
|
-
after,
|
|
155
152
|
button,
|
|
156
153
|
contact: data == null ? void 0 : data.contact,
|
|
157
154
|
message,
|
|
@@ -165,10 +162,6 @@ const FormSubdomainSubmission = ({
|
|
|
165
162
|
}
|
|
166
163
|
}
|
|
167
164
|
);
|
|
168
|
-
const parts = {
|
|
169
|
-
advertisements,
|
|
170
|
-
message: message && /* @__PURE__ */ jsx(FormSubdomainMessage, { ...{ message, style } })
|
|
171
|
-
};
|
|
172
165
|
return /* @__PURE__ */ jsxs(
|
|
173
166
|
"div",
|
|
174
167
|
{
|
|
@@ -181,13 +174,16 @@ const FormSubdomainSubmission = ({
|
|
|
181
174
|
{
|
|
182
175
|
...{
|
|
183
176
|
button,
|
|
177
|
+
title,
|
|
184
178
|
preview,
|
|
185
179
|
style,
|
|
186
|
-
|
|
180
|
+
...message && {
|
|
181
|
+
message
|
|
182
|
+
}
|
|
187
183
|
}
|
|
188
184
|
}
|
|
189
185
|
),
|
|
190
|
-
|
|
186
|
+
advertisements
|
|
191
187
|
]
|
|
192
188
|
}
|
|
193
189
|
);
|
|
@@ -291,11 +287,10 @@ const FormSubdomainGeocode = ({
|
|
|
291
287
|
disabled,
|
|
292
288
|
callback,
|
|
293
289
|
preview,
|
|
294
|
-
still,
|
|
295
290
|
style,
|
|
296
291
|
values
|
|
297
292
|
}) => {
|
|
298
|
-
const [state, setState] = useState(
|
|
293
|
+
const [state, setState] = useState(disabled ? { message: "Campaign is not currently active", status: "inactive" } : { status: "checking" });
|
|
299
294
|
const [attempt, setAttempt] = useState(0);
|
|
300
295
|
const searchParams = useSearchParams();
|
|
301
296
|
const token = searchParams.get("drwbrdg_pre");
|
|
@@ -304,7 +299,7 @@ const FormSubdomainGeocode = ({
|
|
|
304
299
|
useEffect(
|
|
305
300
|
() => {
|
|
306
301
|
var _a, _b;
|
|
307
|
-
if (disabled
|
|
302
|
+
if (disabled) return;
|
|
308
303
|
if (!navigator.geolocation) {
|
|
309
304
|
setState({ status: "unsupported" });
|
|
310
305
|
return;
|
|
@@ -342,7 +337,7 @@ const FormSubdomainGeocode = ({
|
|
|
342
337
|
live = false;
|
|
343
338
|
};
|
|
344
339
|
},
|
|
345
|
-
[attempt, disabled, preview,
|
|
340
|
+
[attempt, disabled, preview, token, values == null ? void 0 : values.slug, values == null ? void 0 : values.subdomain]
|
|
346
341
|
);
|
|
347
342
|
if (["denied", "inactive", "missing", "outside", "unsupported"].includes(state.status)) {
|
|
348
343
|
const retry = ["denied", "missing"].includes(state.status);
|
|
@@ -482,8 +477,7 @@ const FormSubdomainAge = ({
|
|
|
482
477
|
{
|
|
483
478
|
...{
|
|
484
479
|
button,
|
|
485
|
-
|
|
486
|
-
title: (values == null ? void 0 : values.title) || "Confirm your age",
|
|
480
|
+
title: "Confirm your age",
|
|
487
481
|
style
|
|
488
482
|
}
|
|
489
483
|
}
|
|
@@ -530,7 +524,7 @@ const FormSubdomainAge = ({
|
|
|
530
524
|
className: "space-y-2 w-full"
|
|
531
525
|
},
|
|
532
526
|
children: [
|
|
533
|
-
/* @__PURE__ */ jsx("p", { children: "Month
|
|
527
|
+
/* @__PURE__ */ jsx("p", { children: "Month" }),
|
|
534
528
|
/* @__PURE__ */ jsx(
|
|
535
529
|
InputText,
|
|
536
530
|
{
|
|
@@ -558,7 +552,7 @@ const FormSubdomainAge = ({
|
|
|
558
552
|
className: "space-y-2 w-full"
|
|
559
553
|
},
|
|
560
554
|
children: [
|
|
561
|
-
/* @__PURE__ */ jsx("p", { children: "Day
|
|
555
|
+
/* @__PURE__ */ jsx("p", { children: "Day" }),
|
|
562
556
|
/* @__PURE__ */ jsx(
|
|
563
557
|
InputText,
|
|
564
558
|
{
|
|
@@ -586,7 +580,7 @@ const FormSubdomainAge = ({
|
|
|
586
580
|
className: "space-y-2 w-full"
|
|
587
581
|
},
|
|
588
582
|
children: [
|
|
589
|
-
/* @__PURE__ */ jsx("p", { children: "Year
|
|
583
|
+
/* @__PURE__ */ jsx("p", { children: "Year" }),
|
|
590
584
|
/* @__PURE__ */ jsx(
|
|
591
585
|
InputText,
|
|
592
586
|
{
|
|
@@ -627,8 +621,7 @@ const FormSubdomainAge = ({
|
|
|
627
621
|
...{
|
|
628
622
|
disabled,
|
|
629
623
|
style,
|
|
630
|
-
submitting: formState == null ? void 0 : formState.isSubmitting
|
|
631
|
-
text: (values == null ? void 0 : values.button) || "Next"
|
|
624
|
+
submitting: formState == null ? void 0 : formState.isSubmitting
|
|
632
625
|
}
|
|
633
626
|
}
|
|
634
627
|
)
|
|
@@ -644,11 +637,11 @@ const FormSubdomainItemList = ({
|
|
|
644
637
|
currency,
|
|
645
638
|
field,
|
|
646
639
|
onChange,
|
|
647
|
-
prices
|
|
640
|
+
prices,
|
|
648
641
|
style,
|
|
649
642
|
value
|
|
650
643
|
}) => {
|
|
651
|
-
var _a
|
|
644
|
+
var _a;
|
|
652
645
|
return /* @__PURE__ */ jsxs(
|
|
653
646
|
"div",
|
|
654
647
|
{
|
|
@@ -656,8 +649,8 @@ const FormSubdomainItemList = ({
|
|
|
656
649
|
className: "space-y-2"
|
|
657
650
|
},
|
|
658
651
|
children: [
|
|
659
|
-
|
|
660
|
-
"
|
|
652
|
+
/* @__PURE__ */ jsx(
|
|
653
|
+
"p",
|
|
661
654
|
{
|
|
662
655
|
...{
|
|
663
656
|
className: "text-xs uppercase tracking-wide opacity-60"
|
|
@@ -671,8 +664,8 @@ const FormSubdomainItemList = ({
|
|
|
671
664
|
...{
|
|
672
665
|
className: "space-y-4"
|
|
673
666
|
},
|
|
674
|
-
children: (((
|
|
675
|
-
var _a2,
|
|
667
|
+
children: (((_a = field == null ? void 0 : field.settings) == null ? void 0 : _a.items) || []).map((item) => {
|
|
668
|
+
var _a2, _b;
|
|
676
669
|
const quantity = Number(value == null ? void 0 : value[item.id]) || 0;
|
|
677
670
|
const src = cdnSrc(item.image, "200x200", (_a2 = item.image) == null ? void 0 : _a2.updatedAt);
|
|
678
671
|
return /* @__PURE__ */ jsx(
|
|
@@ -698,7 +691,7 @@ const FormSubdomainItemList = ({
|
|
|
698
691
|
{
|
|
699
692
|
...{
|
|
700
693
|
// The image's own description, else its file name, as every image slot.
|
|
701
|
-
alt: item.description || ((
|
|
694
|
+
alt: item.description || ((_b = item.image) == null ? void 0 : _b.filename) || "",
|
|
702
695
|
className: "object-cover",
|
|
703
696
|
fill: true,
|
|
704
697
|
sizes: "56px",
|
|
@@ -732,7 +725,7 @@ const FormSubdomainItemList = ({
|
|
|
732
725
|
className: "text-xs opacity-60"
|
|
733
726
|
},
|
|
734
727
|
children: formatCurrency({
|
|
735
|
-
code:
|
|
728
|
+
code: currency.toUpperCase(),
|
|
736
729
|
display: "parts",
|
|
737
730
|
value: item.price
|
|
738
731
|
})
|
|
@@ -786,28 +779,20 @@ const FormSubdomainSection = ({
|
|
|
786
779
|
focus,
|
|
787
780
|
initial,
|
|
788
781
|
last,
|
|
789
|
-
onAgreement,
|
|
790
782
|
preview,
|
|
791
|
-
refused,
|
|
792
783
|
section,
|
|
793
784
|
slugs = [],
|
|
794
785
|
style,
|
|
795
786
|
values
|
|
796
787
|
}) => {
|
|
797
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j
|
|
788
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
798
789
|
const fields = (section == null ? void 0 : section.fields) || [];
|
|
799
790
|
const lists = fields.filter((field) => (field == null ? void 0 : field.slug) === "list");
|
|
800
|
-
const prices =
|
|
801
|
-
const currency = ((
|
|
802
|
-
const
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
};
|
|
806
|
-
const optOutLine = termsOptOut(values);
|
|
807
|
-
const smsConsent = Boolean(last) && (values == null ? void 0 : values.sms) !== false && Boolean((_c = (_b = values == null ? void 0 : values.agreements) == null ? void 0 : _b.sms) == null ? void 0 : _c.enabled) && slugs.includes("phone");
|
|
808
|
-
const marketingConsent = Boolean(last) && Boolean((_e = (_d = values == null ? void 0 : values.agreements) == null ? void 0 : _d.marketing) == null ? void 0 : _e.enabled) && agreementShown((_f = values == null ? void 0 : values.agreements) == null ? void 0 : _f.marketing);
|
|
809
|
-
const termsConsent = Boolean(last) && Boolean((_h = (_g = values == null ? void 0 : values.agreements) == null ? void 0 : _g.terms) == null ? void 0 : _h.enabled) && agreementShown((_i = values == null ? void 0 : values.agreements) == null ? void 0 : _i.terms);
|
|
810
|
-
const privacy = Boolean(last) && Boolean((_k = (_j = values == null ? void 0 : values.agreements) == null ? void 0 : _j.privacy) == null ? void 0 : _k.enabled) && Boolean(opens("privacy"));
|
|
791
|
+
const prices = ((_a = section == null ? void 0 : section.settings) == null ? void 0 : _a.prices) !== false;
|
|
792
|
+
const currency = ((_b = section == null ? void 0 : section.settings) == null ? void 0 : _b.currency) || "usd";
|
|
793
|
+
const smsConsent = Boolean(last) && (values == null ? void 0 : values.sms) !== false && (Boolean((_d = (_c = values == null ? void 0 : values.agreements) == null ? void 0 : _c.sms) == null ? void 0 : _d.enabled) || slugs.includes("phone"));
|
|
794
|
+
const marketingConsent = Boolean(last) && Boolean((_f = (_e = values == null ? void 0 : values.agreements) == null ? void 0 : _e.marketing) == null ? void 0 : _f.enabled);
|
|
795
|
+
const termsConsent = Boolean(last) && Boolean((_h = (_g = values == null ? void 0 : values.agreements) == null ? void 0 : _g.terms) == null ? void 0 : _h.enabled);
|
|
811
796
|
const schema = useMemo(
|
|
812
797
|
() => {
|
|
813
798
|
var _a2;
|
|
@@ -847,17 +832,10 @@ const FormSubdomainSection = ({
|
|
|
847
832
|
},
|
|
848
833
|
[marketingConsent, section, smsConsent, termsConsent, values]
|
|
849
834
|
);
|
|
850
|
-
const { control, getValues, handleSubmit, formState
|
|
835
|
+
const { control, getValues, handleSubmit, formState } = useForm({
|
|
851
836
|
defaultValues: initial || {},
|
|
852
837
|
resolver: resolver(schema)
|
|
853
838
|
});
|
|
854
|
-
useEffect(
|
|
855
|
-
() => Object.entries(refused || {}).forEach(([id, message]) => {
|
|
856
|
-
if (fields.some((field) => (field == null ? void 0 : field.id) === id)) setError("fields." + id, { message });
|
|
857
|
-
}),
|
|
858
|
-
[refused]
|
|
859
|
-
// eslint-disable-line react-hooks/exhaustive-deps
|
|
860
|
-
);
|
|
861
839
|
const answers = useWatch({
|
|
862
840
|
control,
|
|
863
841
|
name: "fields"
|
|
@@ -874,34 +852,19 @@ const FormSubdomainSection = ({
|
|
|
874
852
|
{
|
|
875
853
|
...{
|
|
876
854
|
labelId: "checkbox-" + key,
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
children: ((_d2 = (_c2 = values == null ? void 0 : values.agreements) == null ? void 0 : _c2[key]) == null ? void 0 : _d2.label) || fallback
|
|
891
|
-
}
|
|
892
|
-
) : opens(key) === "document" ? /* @__PURE__ */ jsx(
|
|
893
|
-
Button,
|
|
894
|
-
{
|
|
895
|
-
...{
|
|
896
|
-
inline: true,
|
|
897
|
-
onClick: () => onAgreement == null ? void 0 : onAgreement(key),
|
|
898
|
-
variant: "link"
|
|
899
|
-
},
|
|
900
|
-
children: ((_f2 = (_e2 = values == null ? void 0 : values.agreements) == null ? void 0 : _e2[key]) == null ? void 0 : _f2.label) || fallback
|
|
901
|
-
}
|
|
902
|
-
) : ((_h2 = (_g2 = values == null ? void 0 : values.agreements) == null ? void 0 : _g2[key]) == null ? void 0 : _h2.label) || fallback,
|
|
903
|
-
key === "terms" && " *"
|
|
904
|
-
] }),
|
|
855
|
+
label: /* @__PURE__ */ jsx(Fragment, { children: ((_b2 = (_a2 = values == null ? void 0 : values.agreements) == null ? void 0 : _a2[key]) == null ? void 0 : _b2.link) ? /* @__PURE__ */ jsx(
|
|
856
|
+
Button,
|
|
857
|
+
{
|
|
858
|
+
...{
|
|
859
|
+
element: Link,
|
|
860
|
+
href: (_d2 = (_c2 = values == null ? void 0 : values.agreements) == null ? void 0 : _c2[key]) == null ? void 0 : _d2.link,
|
|
861
|
+
inline: true,
|
|
862
|
+
target: "_blank",
|
|
863
|
+
variant: "link"
|
|
864
|
+
},
|
|
865
|
+
children: ((_f2 = (_e2 = values == null ? void 0 : values.agreements) == null ? void 0 : _e2[key]) == null ? void 0 : _f2.label) || fallback
|
|
866
|
+
}
|
|
867
|
+
) : ((_h2 = (_g2 = values == null ? void 0 : values.agreements) == null ? void 0 : _g2[key]) == null ? void 0 : _h2.label) || fallback }),
|
|
905
868
|
onChange,
|
|
906
869
|
style,
|
|
907
870
|
value
|
|
@@ -910,7 +873,7 @@ const FormSubdomainSection = ({
|
|
|
910
873
|
);
|
|
911
874
|
};
|
|
912
875
|
const count = itemCount(lists, answers);
|
|
913
|
-
const itemsError = (
|
|
876
|
+
const itemsError = (_j = (_i = formState == null ? void 0 : formState.errors) == null ? void 0 : _i.items) == null ? void 0 : _j.message;
|
|
914
877
|
const totalBlock = (prices || itemsError) && /* @__PURE__ */ jsxs(
|
|
915
878
|
"div",
|
|
916
879
|
{
|
|
@@ -925,7 +888,7 @@ const FormSubdomainSection = ({
|
|
|
925
888
|
className: "flex items-center justify-between text-sm"
|
|
926
889
|
},
|
|
927
890
|
children: [
|
|
928
|
-
/* @__PURE__ */ jsx("span", { children: "TOTAL \xB7 " + count + " " + (count === 1 ? "ITEM" : "ITEMS") }),
|
|
891
|
+
/* @__PURE__ */ jsx("span", { children: "ESTIMATED TOTAL \xB7 " + count + " " + (count === 1 ? "ITEM" : "ITEMS") }),
|
|
929
892
|
/* @__PURE__ */ jsx("span", { children: formatCurrency({
|
|
930
893
|
code: currency.toUpperCase(),
|
|
931
894
|
display: "parts",
|
|
@@ -946,38 +909,6 @@ const FormSubdomainSection = ({
|
|
|
946
909
|
]
|
|
947
910
|
}
|
|
948
911
|
);
|
|
949
|
-
const drawn = (field) => /* @__PURE__ */ jsx(
|
|
950
|
-
Controller,
|
|
951
|
-
{
|
|
952
|
-
...{
|
|
953
|
-
control,
|
|
954
|
-
name: "fields." + field.id,
|
|
955
|
-
render: ({ field: { onChange, value } }) => {
|
|
956
|
-
var _a2, _b2;
|
|
957
|
-
return (field == null ? void 0 : field.slug) === "list" ? /* @__PURE__ */ jsx(
|
|
958
|
-
FormSubdomainItemList,
|
|
959
|
-
{
|
|
960
|
-
...{
|
|
961
|
-
currency,
|
|
962
|
-
field,
|
|
963
|
-
onChange,
|
|
964
|
-
prices,
|
|
965
|
-
style,
|
|
966
|
-
value
|
|
967
|
-
}
|
|
968
|
-
}
|
|
969
|
-
) : components[drawnAs[field == null ? void 0 : field.slug] || (field == null ? void 0 : field.slug)]({
|
|
970
|
-
error: (_b2 = (_a2 = formState == null ? void 0 : formState.errors) == null ? void 0 : _a2.fields) == null ? void 0 : _b2[field == null ? void 0 : field.id],
|
|
971
|
-
field,
|
|
972
|
-
onChange,
|
|
973
|
-
style,
|
|
974
|
-
value
|
|
975
|
-
});
|
|
976
|
-
}
|
|
977
|
-
}
|
|
978
|
-
},
|
|
979
|
-
field == null ? void 0 : field.id
|
|
980
|
-
);
|
|
981
912
|
const consent = [
|
|
982
913
|
termsConsent && ["terms"],
|
|
983
914
|
marketingConsent && ["marketing", agreementWording.marketing],
|
|
@@ -1053,21 +984,40 @@ const FormSubdomainSection = ({
|
|
|
1053
984
|
...{
|
|
1054
985
|
className: (lists.length > 0 ? "space-y-6 " : "space-y-4 ") + faded()
|
|
1055
986
|
},
|
|
1056
|
-
children:
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
987
|
+
children: fields.map((field) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
988
|
+
/* @__PURE__ */ jsx(
|
|
989
|
+
Controller,
|
|
990
|
+
{
|
|
991
|
+
...{
|
|
992
|
+
control,
|
|
993
|
+
name: "fields." + field.id,
|
|
994
|
+
render: ({ field: { onChange, value } }) => {
|
|
995
|
+
var _a2, _b2;
|
|
996
|
+
return (field == null ? void 0 : field.slug) === "list" ? /* @__PURE__ */ jsx(
|
|
997
|
+
FormSubdomainItemList,
|
|
998
|
+
{
|
|
999
|
+
...{
|
|
1000
|
+
currency,
|
|
1001
|
+
field,
|
|
1002
|
+
onChange,
|
|
1003
|
+
prices,
|
|
1004
|
+
style,
|
|
1005
|
+
value
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
) : components[drawnAs[field == null ? void 0 : field.slug] || (field == null ? void 0 : field.slug)]({
|
|
1009
|
+
error: (_b2 = (_a2 = formState == null ? void 0 : formState.errors) == null ? void 0 : _a2.fields) == null ? void 0 : _b2[field == null ? void 0 : field.id],
|
|
1010
|
+
field,
|
|
1011
|
+
onChange,
|
|
1012
|
+
style,
|
|
1013
|
+
value
|
|
1014
|
+
});
|
|
1015
|
+
}
|
|
1066
1016
|
}
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
})
|
|
1017
|
+
}
|
|
1018
|
+
),
|
|
1019
|
+
isLastList(fields, field == null ? void 0 : field.id) && totalBlock
|
|
1020
|
+
] }, field == null ? void 0 : field.id))
|
|
1071
1021
|
}
|
|
1072
1022
|
),
|
|
1073
1023
|
consent.length > 0 && /* @__PURE__ */ jsx(
|
|
@@ -1098,11 +1048,6 @@ const FormSubdomainSection = ({
|
|
|
1098
1048
|
{
|
|
1099
1049
|
...{
|
|
1100
1050
|
error: (_c2 = (_b2 = (_a2 = formState == null ? void 0 : formState.errors) == null ? void 0 : _a2.agreements) == null ? void 0 : _b2[key]) == null ? void 0 : _c2.message,
|
|
1101
|
-
// @story public-entry/read-agreement
|
|
1102
|
-
// The organizer's own rules may not say it; our document does, in Opting out.
|
|
1103
|
-
...key === "terms" && opens("terms") === "link" && optOutLine && {
|
|
1104
|
-
message: optOutLine
|
|
1105
|
-
},
|
|
1106
1051
|
input: checkbox({
|
|
1107
1052
|
fallback,
|
|
1108
1053
|
key,
|
|
@@ -1138,41 +1083,11 @@ const FormSubdomainSection = ({
|
|
|
1138
1083
|
disabled,
|
|
1139
1084
|
style,
|
|
1140
1085
|
submitting: formState == null ? void 0 : formState.isSubmitting,
|
|
1141
|
-
|
|
1142
|
-
// The step's own Next text; the last step's is the form's one Submit text.
|
|
1143
|
-
text: last ? (values == null ? void 0 : values.submit) || "Submit" : (section == null ? void 0 : section.button) || "Next"
|
|
1086
|
+
text: last ? "Submit" : "Next"
|
|
1144
1087
|
}
|
|
1145
1088
|
}
|
|
1146
1089
|
)
|
|
1147
1090
|
}
|
|
1148
|
-
),
|
|
1149
|
-
privacy && /* @__PURE__ */ jsx(
|
|
1150
|
-
"p",
|
|
1151
|
-
{
|
|
1152
|
-
...{
|
|
1153
|
-
className: "text-center text-xs " + faded("privacy"),
|
|
1154
|
-
...focus === "privacy" && {
|
|
1155
|
-
ref: focused
|
|
1156
|
-
}
|
|
1157
|
-
},
|
|
1158
|
-
children: /* @__PURE__ */ jsx(
|
|
1159
|
-
Button,
|
|
1160
|
-
{
|
|
1161
|
-
...{
|
|
1162
|
-
inline: true,
|
|
1163
|
-
variant: "link",
|
|
1164
|
-
...opens("privacy") === "link" ? {
|
|
1165
|
-
element: Link,
|
|
1166
|
-
href: (_o = (_n = values == null ? void 0 : values.agreements) == null ? void 0 : _n.privacy) == null ? void 0 : _o.link,
|
|
1167
|
-
target: "_blank"
|
|
1168
|
-
} : {
|
|
1169
|
-
onClick: () => onAgreement == null ? void 0 : onAgreement("privacy")
|
|
1170
|
-
}
|
|
1171
|
-
},
|
|
1172
|
-
children: ((_q = (_p = values == null ? void 0 : values.agreements) == null ? void 0 : _p.privacy) == null ? void 0 : _q.label) || "Privacy policy"
|
|
1173
|
-
}
|
|
1174
|
-
)
|
|
1175
|
-
}
|
|
1176
1091
|
)
|
|
1177
1092
|
]
|
|
1178
1093
|
}
|
|
@@ -1182,7 +1097,6 @@ const FormSubdomain = ({
|
|
|
1182
1097
|
agreements,
|
|
1183
1098
|
button,
|
|
1184
1099
|
disabled,
|
|
1185
|
-
documents,
|
|
1186
1100
|
fields,
|
|
1187
1101
|
focus,
|
|
1188
1102
|
integrations,
|
|
@@ -1193,29 +1107,20 @@ const FormSubdomain = ({
|
|
|
1193
1107
|
},
|
|
1194
1108
|
params,
|
|
1195
1109
|
preview,
|
|
1196
|
-
// @story public-entry/read-agreement
|
|
1197
|
-
// False while the campaign's giveaway is off ( lib/entry giveawayOn ).
|
|
1198
|
-
giveaway,
|
|
1199
1110
|
// The share payload's `sms` : false while texts are off on the platform.
|
|
1200
1111
|
sms,
|
|
1201
1112
|
step: start = 0,
|
|
1202
1113
|
style,
|
|
1203
|
-
// @story public-entry/submit
|
|
1204
|
-
// The form's one Submit text, on the last step ( `defaults.submit` ).
|
|
1205
|
-
submit,
|
|
1206
1114
|
tracking
|
|
1207
1115
|
}) => {
|
|
1208
|
-
var _a, _b, _c
|
|
1116
|
+
var _a, _b, _c;
|
|
1209
1117
|
const { executeRecaptcha } = useGoogleReCaptcha();
|
|
1210
1118
|
const searchParams = useSearchParams();
|
|
1211
1119
|
const token = searchParams.get("drwbrdg_pre");
|
|
1212
1120
|
const [data, setData] = useState({});
|
|
1213
1121
|
const [step, setStep] = useState(start);
|
|
1214
|
-
const [reading, setReading] = useState(null);
|
|
1215
|
-
const [refused, setRefused] = useState(null);
|
|
1216
1122
|
const sections = sectionsOf(fields);
|
|
1217
1123
|
const slugs = sections.flatMap((section) => ((section == null ? void 0 : section.fields) || []).map((field) => field == null ? void 0 : field.slug));
|
|
1218
|
-
const before = Number(Boolean((_a = integrations == null ? void 0 : integrations.geocode) == null ? void 0 : _a.enabled)) + Number(Boolean((_b = integrations == null ? void 0 : integrations.age) == null ? void 0 : _b.enabled));
|
|
1219
1124
|
const merge = (object = {}) => ({
|
|
1220
1125
|
...data,
|
|
1221
1126
|
...object,
|
|
@@ -1226,7 +1131,7 @@ const FormSubdomain = ({
|
|
|
1226
1131
|
});
|
|
1227
1132
|
const onSubmit = useCallback(
|
|
1228
1133
|
async (values) => {
|
|
1229
|
-
var _a2, _b2
|
|
1134
|
+
var _a2, _b2;
|
|
1230
1135
|
try {
|
|
1231
1136
|
let recaptcha;
|
|
1232
1137
|
if (Boolean((_a2 = integrations == null ? void 0 : integrations.recaptcha) == null ? void 0 : _a2.enabled)) {
|
|
@@ -1263,21 +1168,13 @@ const FormSubdomain = ({
|
|
|
1263
1168
|
);
|
|
1264
1169
|
}
|
|
1265
1170
|
} catch (error) {
|
|
1266
|
-
const index = refusedSection(sections, (_c2 = error == null ? void 0 : error.data) == null ? void 0 : _c2.fields);
|
|
1267
|
-
if (index >= 0) {
|
|
1268
|
-
setData(values);
|
|
1269
|
-
setRefused(error.data.fields);
|
|
1270
|
-
setStep(before + index);
|
|
1271
|
-
return;
|
|
1272
|
-
}
|
|
1273
|
-
;
|
|
1274
1171
|
onError(error);
|
|
1275
1172
|
}
|
|
1276
1173
|
},
|
|
1277
|
-
[
|
|
1174
|
+
[executeRecaptcha, integrations, onError, onSuccess, params, preview, token, tracking]
|
|
1278
1175
|
);
|
|
1279
1176
|
const forms = [
|
|
1280
|
-
...Boolean((
|
|
1177
|
+
...Boolean((_a = integrations == null ? void 0 : integrations.geocode) == null ? void 0 : _a.enabled) ? [
|
|
1281
1178
|
/* @__PURE__ */ jsx(
|
|
1282
1179
|
FormSubdomainGeocode,
|
|
1283
1180
|
{
|
|
@@ -1301,7 +1198,7 @@ const FormSubdomain = ({
|
|
|
1301
1198
|
"form-subdomain-geocode"
|
|
1302
1199
|
)
|
|
1303
1200
|
] : [],
|
|
1304
|
-
...Boolean((
|
|
1201
|
+
...Boolean((_b = integrations == null ? void 0 : integrations.age) == null ? void 0 : _b.enabled) ? [
|
|
1305
1202
|
/* @__PURE__ */ jsx(
|
|
1306
1203
|
FormSubdomainAge,
|
|
1307
1204
|
{
|
|
@@ -1326,7 +1223,7 @@ const FormSubdomain = ({
|
|
|
1326
1223
|
disabled,
|
|
1327
1224
|
preview,
|
|
1328
1225
|
style,
|
|
1329
|
-
values: (
|
|
1226
|
+
values: (_c = integrations == null ? void 0 : integrations.age) == null ? void 0 : _c.settings
|
|
1330
1227
|
}
|
|
1331
1228
|
},
|
|
1332
1229
|
"form-subdomain-age"
|
|
@@ -1344,7 +1241,6 @@ const FormSubdomain = ({
|
|
|
1344
1241
|
button,
|
|
1345
1242
|
callback: async (object) => {
|
|
1346
1243
|
const merged = merge(object);
|
|
1347
|
-
setRefused(null);
|
|
1348
1244
|
if (index < sections.length - 1) {
|
|
1349
1245
|
setData(merged);
|
|
1350
1246
|
setStep(step + 1);
|
|
@@ -1356,61 +1252,39 @@ const FormSubdomain = ({
|
|
|
1356
1252
|
focus,
|
|
1357
1253
|
initial: data,
|
|
1358
1254
|
last: index === sections.length - 1,
|
|
1359
|
-
onAgreement: setReading,
|
|
1360
1255
|
preview,
|
|
1361
|
-
refused,
|
|
1362
1256
|
section,
|
|
1363
1257
|
slugs,
|
|
1364
1258
|
style,
|
|
1365
1259
|
values: {
|
|
1366
1260
|
agreements,
|
|
1367
|
-
|
|
1368
|
-
sms,
|
|
1369
|
-
submit
|
|
1261
|
+
sms
|
|
1370
1262
|
}
|
|
1371
1263
|
}
|
|
1372
1264
|
},
|
|
1373
1265
|
"form-subdomain-section-" + section.id
|
|
1374
1266
|
))
|
|
1375
1267
|
];
|
|
1376
|
-
return /* @__PURE__ */
|
|
1268
|
+
return /* @__PURE__ */ jsx(
|
|
1377
1269
|
"div",
|
|
1378
1270
|
{
|
|
1379
1271
|
...{
|
|
1380
1272
|
className: "space-y-6"
|
|
1381
1273
|
},
|
|
1382
|
-
children:
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
{
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
style,
|
|
1392
|
-
title: agreementTitles[reading]
|
|
1393
|
-
}
|
|
1394
|
-
}
|
|
1395
|
-
),
|
|
1396
|
-
/* @__PURE__ */ jsx(
|
|
1397
|
-
"div",
|
|
1398
|
-
{
|
|
1399
|
-
...{
|
|
1400
|
-
className: "relative w-full space-y-6" + (reading ? " hidden" : "")
|
|
1401
|
-
},
|
|
1402
|
-
children: forms == null ? void 0 : forms[step]
|
|
1403
|
-
}
|
|
1404
|
-
)
|
|
1405
|
-
]
|
|
1274
|
+
children: /* @__PURE__ */ jsx(
|
|
1275
|
+
"div",
|
|
1276
|
+
{
|
|
1277
|
+
...{
|
|
1278
|
+
className: "relative w-full space-y-6"
|
|
1279
|
+
},
|
|
1280
|
+
children: forms == null ? void 0 : forms[step]
|
|
1281
|
+
}
|
|
1282
|
+
)
|
|
1406
1283
|
}
|
|
1407
1284
|
);
|
|
1408
1285
|
};
|
|
1409
1286
|
var form_subdomain_default = FormSubdomain;
|
|
1410
1287
|
export {
|
|
1411
|
-
FormSubdomainAge,
|
|
1412
|
-
FormSubdomainGeocode,
|
|
1413
|
-
FormSubdomainItemList,
|
|
1414
1288
|
FormSubdomainMessage,
|
|
1415
1289
|
FormSubdomainSubmission,
|
|
1416
1290
|
form_subdomain_default as default
|