@drawbridge/components 0.1.34 → 0.1.36
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 +68 -355
- package/dist/advertisement.js +15 -20
- package/dist/advertisement.mjs +15 -20
- package/dist/bridge/advertisements.js +4 -2
- package/dist/bridge/advertisements.mjs +5 -3
- package/dist/bridge/fields.js +89 -6
- package/dist/bridge/fields.mjs +89 -7
- package/dist/bridge/form-subdomain-agreement.js +165 -0
- package/dist/bridge/form-subdomain-agreement.mjs +132 -0
- package/dist/bridge/form-subdomain-embed.js +5 -1
- package/dist/bridge/form-subdomain-embed.mjs +5 -1
- package/dist/bridge/form-subdomain-header.js +21 -14
- package/dist/bridge/form-subdomain-header.mjs +20 -14
- package/dist/bridge/form-subdomain-issue.js +17 -8
- package/dist/bridge/form-subdomain-issue.mjs +17 -8
- package/dist/bridge/form-subdomain-missions.js +58 -52
- package/dist/bridge/form-subdomain-missions.mjs +60 -54
- package/dist/bridge/form-subdomain.js +223 -94
- package/dist/bridge/form-subdomain.mjs +222 -96
- package/dist/bridge/lib/entry.js +61 -6
- package/dist/bridge/lib/entry.mjs +51 -5
- package/dist/bridge/lib/order.js +23 -0
- package/dist/bridge/lib/order.mjs +20 -0
- package/dist/bridge/template-layout.js +5 -2
- package/dist/bridge/template-layout.mjs +6 -3
- package/dist/bridge/template-modal.js +82 -15
- package/dist/bridge/template-modal.mjs +83 -16
- package/dist/bridge/template-subdomain-gallery.js +126 -75
- package/dist/bridge/template-subdomain-gallery.mjs +122 -75
- package/dist/bridge/template-subdomain.js +16 -14
- package/dist/bridge/template-subdomain.mjs +17 -15
- package/dist/dashboard/avatar.js +5 -0
- package/dist/dashboard/avatar.mjs +5 -0
- package/dist/dashboard/campaign-form.js +1798 -0
- package/dist/dashboard/campaign-form.mjs +1769 -0
- package/dist/dashboard/card-affiliate.js +3 -2
- package/dist/dashboard/card-affiliate.mjs +3 -2
- package/dist/dashboard/card-campaign-agreement.js +172 -0
- package/dist/dashboard/card-campaign-agreement.mjs +139 -0
- package/dist/dashboard/card-campaign-switch.js +34 -9
- package/dist/dashboard/card-campaign-switch.mjs +32 -8
- package/dist/dashboard/card-order.js +6 -14
- package/dist/dashboard/card-order.mjs +6 -14
- package/dist/dashboard/card-section.js +69 -26
- package/dist/dashboard/card-section.mjs +65 -26
- package/dist/dashboard/card-shortcut.js +181 -0
- package/dist/dashboard/card-shortcut.mjs +152 -0
- package/dist/dashboard/card-tile.js +3 -35
- package/dist/dashboard/card-tile.mjs +3 -34
- package/dist/dashboard/document-blocks.js +305 -0
- package/dist/dashboard/document-blocks.mjs +270 -0
- package/dist/dashboard/drawer-subscription.js +52 -14
- package/dist/dashboard/drawer-subscription.mjs +52 -14
- package/dist/dashboard/drawer.js +20 -3
- package/dist/dashboard/drawer.mjs +21 -4
- package/dist/dashboard/dropdown.js +6 -2
- package/dist/dashboard/dropdown.mjs +6 -2
- package/dist/dashboard/form-admin-subscription-custom.js +72 -8
- package/dist/dashboard/form-admin-subscription-custom.mjs +72 -8
- package/dist/dashboard/form-ai.js +0 -148
- package/dist/dashboard/form-ai.mjs +1 -148
- package/dist/dashboard/form-filters-analytics.js +88 -37
- package/dist/dashboard/form-filters-analytics.mjs +85 -38
- package/dist/dashboard/form-organization-brand.js +30 -13
- package/dist/dashboard/form-organization-brand.mjs +30 -13
- package/dist/dashboard/form-organization-campaign-advertisement.js +38 -112
- package/dist/dashboard/form-organization-campaign-advertisement.mjs +38 -112
- package/dist/dashboard/form-organization-campaign-advertisements.js +374 -0
- package/dist/dashboard/form-organization-campaign-advertisements.mjs +345 -0
- package/dist/dashboard/form-organization-campaign-agreement.js +402 -210
- package/dist/dashboard/form-organization-campaign-agreement.mjs +398 -211
- package/dist/dashboard/form-organization-campaign-design.js +258 -0
- package/dist/dashboard/form-organization-campaign-design.mjs +223 -0
- package/dist/dashboard/form-organization-campaign-field-item.js +585 -0
- package/dist/dashboard/form-organization-campaign-field-item.mjs +552 -0
- package/dist/dashboard/form-organization-campaign-field-number.js +48 -7
- package/dist/dashboard/form-organization-campaign-field-number.mjs +48 -7
- package/dist/dashboard/form-organization-campaign-field-select.js +15 -4
- package/dist/dashboard/form-organization-campaign-field-select.mjs +15 -4
- package/dist/dashboard/form-organization-campaign-field-skill.js +359 -0
- package/dist/dashboard/form-organization-campaign-field-skill.mjs +330 -0
- package/dist/dashboard/form-organization-campaign-field-text.js +46 -6
- package/dist/dashboard/form-organization-campaign-field-text.mjs +46 -6
- package/dist/dashboard/form-organization-campaign-field-textarea.js +22 -13
- package/dist/dashboard/form-organization-campaign-field-textarea.mjs +22 -13
- package/dist/dashboard/form-organization-campaign-footer.js +178 -0
- package/dist/dashboard/form-organization-campaign-footer.mjs +149 -0
- package/dist/dashboard/form-organization-campaign-integration-age.js +2 -35
- package/dist/dashboard/form-organization-campaign-integration-age.mjs +2 -35
- package/dist/dashboard/form-organization-campaign-integration-geocode.js +4 -1
- package/dist/dashboard/form-organization-campaign-integration-geocode.mjs +4 -1
- 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 +1 -2
- package/dist/dashboard/form-organization-campaign-page-preview.mjs +1 -2
- 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 +2 -3
- package/dist/dashboard/form-organization-campaign-page-slug.mjs +2 -3
- package/dist/dashboard/form-organization-campaign-page.js +168 -265
- package/dist/dashboard/form-organization-campaign-page.mjs +170 -266
- package/dist/dashboard/form-organization-campaign-section.js +125 -107
- package/dist/dashboard/form-organization-campaign-section.mjs +121 -107
- package/dist/dashboard/form-organization-campaign.js +119 -9
- package/dist/dashboard/form-organization-campaign.mjs +118 -9
- package/dist/dashboard/form-organization-file-frame.js +7 -1
- package/dist/dashboard/form-organization-file-frame.mjs +7 -1
- package/dist/dashboard/form-organization-workflow.js +587 -530
- package/dist/dashboard/form-organization-workflow.mjs +588 -531
- package/dist/dashboard/form-organization.js +22 -0
- package/dist/dashboard/form-organization.mjs +22 -0
- package/dist/dashboard/form-reposition.js +396 -0
- package/dist/dashboard/form-reposition.mjs +359 -0
- package/dist/dashboard/form-support.js +189 -0
- package/dist/dashboard/form-support.mjs +160 -0
- package/dist/dashboard/form-tests.js +683 -0
- package/dist/dashboard/form-tests.mjs +646 -0
- package/dist/dashboard/form-verify-prize.js +114 -34
- package/dist/dashboard/form-verify-prize.mjs +111 -34
- package/dist/dashboard/google.js +8 -1
- package/dist/dashboard/google.mjs +8 -1
- package/dist/dashboard/input-array.js +2 -0
- package/dist/dashboard/input-array.mjs +2 -0
- package/dist/dashboard/input-editor.js +17 -6
- package/dist/dashboard/input-editor.mjs +17 -6
- package/dist/dashboard/input-fields.js +287 -437
- package/dist/dashboard/input-fields.mjs +287 -436
- package/dist/dashboard/input-file.js +70 -2
- package/dist/dashboard/input-file.mjs +70 -2
- package/dist/dashboard/input-font.js +64 -55
- package/dist/dashboard/input-font.mjs +64 -55
- package/dist/dashboard/input-resource.js +4 -1
- package/dist/dashboard/input-resource.mjs +4 -1
- package/dist/dashboard/lib/ab-tests.js +130 -0
- package/dist/dashboard/lib/ab-tests.mjs +94 -0
- package/dist/dashboard/lib/features.js +1 -1
- package/dist/dashboard/lib/features.mjs +1 -1
- package/dist/dashboard/lib/focus.js +93 -0
- package/dist/dashboard/lib/focus.mjs +69 -0
- package/dist/dashboard/lib/form-page.js +203 -0
- package/dist/dashboard/lib/form-page.mjs +155 -0
- package/dist/dashboard/lib/item-list.js +0 -15
- package/dist/dashboard/lib/item-list.mjs +0 -14
- package/dist/dashboard/lib/rail.js +16 -17
- package/dist/dashboard/lib/rail.mjs +15 -16
- package/dist/dashboard/lib/sms.js +8 -2
- package/dist/dashboard/lib/sms.mjs +6 -1
- package/dist/dashboard/list-resource.js +2 -0
- package/dist/dashboard/list-resource.mjs +2 -0
- package/dist/dashboard/menu.js +54 -5
- package/dist/dashboard/menu.mjs +53 -5
- package/dist/dashboard/modal.js +19 -4
- package/dist/dashboard/modal.mjs +20 -5
- package/dist/dashboard/order-sections.js +4 -0
- package/dist/dashboard/order-sections.mjs +4 -0
- package/dist/dashboard/preview.js +838 -324
- package/dist/dashboard/preview.mjs +826 -324
- package/dist/dashboard/provider-ui.js +20 -12
- package/dist/dashboard/provider-ui.mjs +21 -13
- package/dist/dashboard/recharts.js +53 -28
- package/dist/dashboard/recharts.mjs +53 -28
- package/dist/dashboard/swatch.js +35 -0
- package/dist/dashboard/swatch.mjs +31 -0
- package/dist/dashboard/table-contacts.js +6 -10
- package/dist/dashboard/table-contacts.mjs +6 -10
- package/dist/dashboard/table.js +10 -3
- package/dist/dashboard/table.mjs +9 -3
- package/dist/dashboard/template-dashboard.js +12 -7
- package/dist/dashboard/template-dashboard.mjs +11 -7
- package/dist/dashboard/template-design.js +564 -0
- package/dist/dashboard/template-design.mjs +531 -0
- package/dist/dashboard/template-rail.js +198 -126
- package/dist/dashboard/template-rail.mjs +196 -125
- package/dist/dashboard/template-socket.js +0 -3
- package/dist/dashboard/template-socket.mjs +0 -3
- package/dist/dashboard/template-test-page.js +436 -0
- package/dist/dashboard/template-test-page.mjs +407 -0
- package/dist/dashboard/template-tests.js +141 -0
- package/dist/dashboard/template-tests.mjs +112 -0
- package/dist/dashboard/template-ui.js +20 -11
- package/dist/dashboard/template-ui.mjs +22 -13
- package/dist/dashboard/template-variant.js +185 -0
- package/dist/dashboard/template-variant.mjs +156 -0
- package/dist/icons/arrow-down-long.js +47 -0
- package/dist/icons/arrow-down-long.mjs +28 -0
- package/dist/icons/arrows-pointing-out.js +46 -0
- package/dist/icons/arrows-pointing-out.mjs +27 -0
- package/dist/icons/beaker.js +46 -0
- package/dist/icons/beaker.mjs +27 -0
- package/dist/icons/identification.js +46 -0
- package/dist/icons/identification.mjs +27 -0
- package/dist/icons/lifebuoy.js +46 -0
- package/dist/icons/lifebuoy.mjs +27 -0
- package/dist/icons/rectangle-group.js +46 -0
- package/dist/icons/rectangle-group.mjs +27 -0
- package/dist/icons/rectangle-stack.js +46 -0
- package/dist/icons/rectangle-stack.mjs +27 -0
- package/dist/icons/shopping-bag.js +46 -0
- package/dist/icons/shopping-bag.mjs +27 -0
- package/dist/icons/swatch.js +46 -0
- package/dist/icons/swatch.mjs +27 -0
- package/dist/icons/window.js +46 -0
- package/dist/icons/window.mjs +27 -0
- package/dist/icons/zoom-in.js +46 -0
- package/dist/icons/zoom-in.mjs +27 -0
- package/dist/input-answer.js +60 -0
- package/dist/input-answer.mjs +27 -0
- package/dist/input-checkbox.js +7 -1
- package/dist/input-checkbox.mjs +7 -1
- package/dist/input-name.js +3 -3
- package/dist/input-name.mjs +3 -3
- package/dist/input-select.js +3 -1
- package/dist/input-select.mjs +3 -1
- package/dist/provider-font.js +4 -3
- package/dist/provider-font.mjs +4 -3
- package/dist/shared/badge.js +15 -0
- package/dist/shared/badge.mjs +11 -0
- package/dist/shared/carousel.js +11 -7
- package/dist/shared/carousel.mjs +11 -7
- package/dist/shared/document-pieces.js +295 -0
- package/dist/shared/document-pieces.mjs +260 -0
- package/dist/shared/lib/campaign.js +3 -9
- package/dist/shared/lib/campaign.mjs +3 -9
- package/dist/shared/lib/helpers.js +24 -0
- package/dist/shared/lib/helpers.mjs +22 -0
- package/dist/shared/lib/video.js +6 -0
- package/dist/shared/lib/video.mjs +5 -0
- package/dist/shared/sortable.js +27 -10
- package/dist/shared/sortable.mjs +27 -10
- package/dist/shared/tabs.js +1 -1
- package/dist/shared/tabs.mjs +1 -1
- package/dist/video.js +127 -9
- package/dist/video.mjs +125 -11
- package/package.json +176 -20
- package/types/bridge/fields.d.ts +6 -1
- package/types/bridge/form-subdomain-agreement.d.ts +27 -0
- package/types/bridge/form-subdomain-missions.d.ts +2 -0
- package/types/bridge/form-subdomain.d.ts +62 -3
- package/types/bridge/lib/entry.d.ts +44 -7
- package/types/bridge/lib/order.d.ts +13 -2
- package/types/bridge/subdomain-content.d.ts +1 -0
- package/types/bridge/template-subdomain-gallery.d.ts +13 -1
- package/types/dashboard/campaign-form.d.ts +42 -0
- package/types/dashboard/card-campaign-agreement.d.ts +26 -0
- package/types/dashboard/card-campaign-switch.d.ts +20 -1
- package/types/dashboard/card-order.d.ts +2 -2
- package/types/dashboard/card-section.d.ts +9 -1
- package/types/dashboard/card-shortcut.d.ts +38 -0
- package/types/dashboard/card-tile.d.ts +4 -9
- package/types/dashboard/document-blocks.d.ts +14 -0
- package/types/dashboard/drawer.d.ts +3 -0
- package/types/dashboard/form-ai.d.ts +0 -17
- package/types/dashboard/form-organization-brand.d.ts +3 -0
- package/types/dashboard/form-organization-campaign-advertisements.d.ts +15 -0
- package/types/dashboard/form-organization-campaign-agreement.d.ts +53 -10
- package/types/dashboard/form-organization-campaign-design.d.ts +46 -0
- package/types/dashboard/form-organization-campaign-field-item.d.ts +36 -0
- package/types/dashboard/form-organization-campaign-field-number.d.ts +4 -1
- package/types/dashboard/form-organization-campaign-field-select.d.ts +6 -1
- package/types/dashboard/form-organization-campaign-field-skill.d.ts +36 -0
- package/types/dashboard/form-organization-campaign-field-text.d.ts +5 -1
- package/types/dashboard/form-organization-campaign-field-textarea.d.ts +4 -1
- package/types/dashboard/form-organization-campaign-footer.d.ts +23 -0
- package/types/dashboard/form-organization-campaign-integration-age.d.ts +2 -1
- package/types/dashboard/form-organization-campaign-integration-geocode.d.ts +2 -0
- package/types/dashboard/form-organization-campaign-page.d.ts +9 -15
- package/types/dashboard/form-organization-campaign-section.d.ts +24 -8
- package/types/dashboard/form-organization-campaign.d.ts +3 -0
- package/types/dashboard/form-organization-workflow.d.ts +3 -0
- package/types/dashboard/form-organization.d.ts +2 -2
- package/types/dashboard/form-reposition.d.ts +29 -0
- package/types/dashboard/form-support.d.ts +14 -0
- package/types/dashboard/form-tests.d.ts +78 -0
- package/types/dashboard/form-verify-prize.d.ts +30 -3
- package/types/dashboard/input-editor.d.ts +9 -0
- package/types/dashboard/input-fields.d.ts +8 -5
- package/types/dashboard/input-file.d.ts +4 -0
- package/types/dashboard/input-resource.d.ts +1 -0
- package/types/dashboard/lib/ab-tests.d.ts +50 -0
- package/types/dashboard/lib/escape.d.ts +4 -0
- package/types/dashboard/lib/focus.d.ts +16 -0
- package/types/dashboard/lib/form-page.d.ts +25 -0
- package/types/dashboard/lib/item-list.d.ts +10 -5
- package/types/dashboard/lib/rail.d.ts +0 -1
- package/types/dashboard/lib/sms.d.ts +7 -0
- package/types/dashboard/modal.d.ts +3 -1
- package/types/dashboard/preview.d.ts +65 -10
- package/types/dashboard/recharts.d.ts +3 -0
- package/types/dashboard/swatch.d.ts +4 -0
- package/types/dashboard/template-dashboard.d.ts +3 -0
- package/types/dashboard/template-design.d.ts +30 -0
- package/types/dashboard/template-test-page.d.ts +69 -0
- package/types/dashboard/template-tests.d.ts +30 -0
- package/types/dashboard/template-variant.d.ts +18 -0
- package/types/icons/arrow-down-long.d.ts +5 -0
- package/types/icons/arrows-pointing-out.d.ts +5 -0
- package/types/icons/beaker.d.ts +5 -0
- package/types/icons/identification.d.ts +5 -0
- package/types/icons/lifebuoy.d.ts +5 -0
- package/types/icons/rectangle-group.d.ts +5 -0
- package/types/icons/rectangle-stack.d.ts +5 -0
- package/types/icons/shopping-bag.d.ts +5 -0
- package/types/icons/swatch.d.ts +5 -0
- package/types/icons/window.d.ts +5 -0
- package/types/icons/zoom-in.d.ts +5 -0
- package/types/input-answer.d.ts +15 -0
- package/types/input-select.d.ts +2 -0
- package/types/shared/button.d.ts +1 -1
- package/types/shared/document-pieces.d.ts +34 -0
- package/types/shared/lib/helpers.d.ts +22 -1
- package/types/shared/lib/motion.d.ts +2 -0
- package/types/shared/lib/video.d.ts +3 -0
- package/types/shared/sortable.d.ts +6 -0
- package/types/video.d.ts +18 -2
- package/dist/bridge/template-preview.js +0 -208
- package/dist/bridge/template-preview.mjs +0 -173
- package/dist/dashboard/device.js +0 -95
- package/dist/dashboard/device.mjs +0 -72
- package/dist/dashboard/form-organization-campaign-field-list.js +0 -425
- package/dist/dashboard/form-organization-campaign-field-list.mjs +0 -396
- package/dist/dashboard/item-row.js +0 -92
- package/dist/dashboard/item-row.mjs +0 -63
- package/types/bridge/template-preview.d.ts +0 -10
- package/types/dashboard/device.d.ts +0 -12
- package/types/dashboard/form-organization-campaign-field-list.d.ts +0 -36
- package/types/dashboard/item-row.d.ts +0 -25
|
@@ -28,6 +28,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
var form_subdomain_exports = {};
|
|
30
30
|
__export(form_subdomain_exports, {
|
|
31
|
+
FormSubdomainAge: () => FormSubdomainAge,
|
|
32
|
+
FormSubdomainGeocode: () => FormSubdomainGeocode,
|
|
33
|
+
FormSubdomainItemList: () => FormSubdomainItemList,
|
|
31
34
|
FormSubdomainMessage: () => FormSubdomainMessage,
|
|
32
35
|
FormSubdomainSubmission: () => FormSubdomainSubmission,
|
|
33
36
|
default: () => form_subdomain_default
|
|
@@ -49,6 +52,7 @@ var import_react_google_recaptcha_v3 = require("react-google-recaptcha-v3");
|
|
|
49
52
|
var import_recaptcha = require("./lib/recaptcha");
|
|
50
53
|
var import_url = require("./lib/url");
|
|
51
54
|
var import_entry = require("./lib/entry");
|
|
55
|
+
var import_form_subdomain_agreement = __toESM(require("./form-subdomain-agreement"));
|
|
52
56
|
var import_location = require("./lib/location");
|
|
53
57
|
var import_order = require("./lib/order");
|
|
54
58
|
var import_form = __toESM(require("../shared/form"));
|
|
@@ -79,6 +83,7 @@ const scrollToCentre = (node) => {
|
|
|
79
83
|
};
|
|
80
84
|
const FormSubdomainSubmission = ({
|
|
81
85
|
affiliate,
|
|
86
|
+
after = import_entry.AFTER,
|
|
82
87
|
button,
|
|
83
88
|
checkout,
|
|
84
89
|
giveaway,
|
|
@@ -183,6 +188,7 @@ const FormSubdomainSubmission = ({
|
|
|
183
188
|
{
|
|
184
189
|
...{
|
|
185
190
|
advertisements,
|
|
191
|
+
after,
|
|
186
192
|
button,
|
|
187
193
|
contact: data == null ? void 0 : data.contact,
|
|
188
194
|
message,
|
|
@@ -196,6 +202,10 @@ const FormSubdomainSubmission = ({
|
|
|
196
202
|
}
|
|
197
203
|
}
|
|
198
204
|
);
|
|
205
|
+
const parts = {
|
|
206
|
+
advertisements,
|
|
207
|
+
message: message && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormSubdomainMessage, { ...{ message, style } })
|
|
208
|
+
};
|
|
199
209
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
200
210
|
"div",
|
|
201
211
|
{
|
|
@@ -208,16 +218,13 @@ const FormSubdomainSubmission = ({
|
|
|
208
218
|
{
|
|
209
219
|
...{
|
|
210
220
|
button,
|
|
211
|
-
title,
|
|
212
221
|
preview,
|
|
213
222
|
style,
|
|
214
|
-
|
|
215
|
-
message
|
|
216
|
-
}
|
|
223
|
+
title
|
|
217
224
|
}
|
|
218
225
|
}
|
|
219
226
|
),
|
|
220
|
-
|
|
227
|
+
after.map((key) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Fragment, { children: parts[key] }, key))
|
|
221
228
|
]
|
|
222
229
|
}
|
|
223
230
|
);
|
|
@@ -321,10 +328,11 @@ const FormSubdomainGeocode = ({
|
|
|
321
328
|
disabled,
|
|
322
329
|
callback,
|
|
323
330
|
preview,
|
|
331
|
+
still,
|
|
324
332
|
style,
|
|
325
333
|
values
|
|
326
334
|
}) => {
|
|
327
|
-
const [state, setState] = (0, import_react.useState)(disabled ? { message: "Campaign is not currently active", status: "inactive" } : { status: "checking" });
|
|
335
|
+
const [state, setState] = (0, import_react.useState)(still ? { status: "asking" } : disabled ? { message: "Campaign is not currently active", status: "inactive" } : { status: "checking" });
|
|
328
336
|
const [attempt, setAttempt] = (0, import_react.useState)(0);
|
|
329
337
|
const searchParams = (0, import_navigation.useSearchParams)();
|
|
330
338
|
const token = searchParams.get("drwbrdg_pre");
|
|
@@ -333,7 +341,7 @@ const FormSubdomainGeocode = ({
|
|
|
333
341
|
(0, import_react.useEffect)(
|
|
334
342
|
() => {
|
|
335
343
|
var _a, _b;
|
|
336
|
-
if (disabled) return;
|
|
344
|
+
if (disabled || still) return;
|
|
337
345
|
if (!navigator.geolocation) {
|
|
338
346
|
setState({ status: "unsupported" });
|
|
339
347
|
return;
|
|
@@ -371,7 +379,7 @@ const FormSubdomainGeocode = ({
|
|
|
371
379
|
live = false;
|
|
372
380
|
};
|
|
373
381
|
},
|
|
374
|
-
[attempt, disabled, preview, token, values == null ? void 0 : values.slug, values == null ? void 0 : values.subdomain]
|
|
382
|
+
[attempt, disabled, preview, still, token, values == null ? void 0 : values.slug, values == null ? void 0 : values.subdomain]
|
|
375
383
|
);
|
|
376
384
|
if (["denied", "inactive", "missing", "outside", "unsupported"].includes(state.status)) {
|
|
377
385
|
const retry = ["denied", "missing"].includes(state.status);
|
|
@@ -511,7 +519,8 @@ const FormSubdomainAge = ({
|
|
|
511
519
|
{
|
|
512
520
|
...{
|
|
513
521
|
button,
|
|
514
|
-
|
|
522
|
+
description: values == null ? void 0 : values.description,
|
|
523
|
+
title: (values == null ? void 0 : values.title) || "Confirm your age",
|
|
515
524
|
style
|
|
516
525
|
}
|
|
517
526
|
}
|
|
@@ -558,7 +567,7 @@ const FormSubdomainAge = ({
|
|
|
558
567
|
className: "space-y-2 w-full"
|
|
559
568
|
},
|
|
560
569
|
children: [
|
|
561
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: "Month" }),
|
|
570
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: "Month *" }),
|
|
562
571
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
563
572
|
import_input_text.default,
|
|
564
573
|
{
|
|
@@ -586,7 +595,7 @@ const FormSubdomainAge = ({
|
|
|
586
595
|
className: "space-y-2 w-full"
|
|
587
596
|
},
|
|
588
597
|
children: [
|
|
589
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: "Day" }),
|
|
598
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: "Day *" }),
|
|
590
599
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
591
600
|
import_input_text.default,
|
|
592
601
|
{
|
|
@@ -614,7 +623,7 @@ const FormSubdomainAge = ({
|
|
|
614
623
|
className: "space-y-2 w-full"
|
|
615
624
|
},
|
|
616
625
|
children: [
|
|
617
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: "Year" }),
|
|
626
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: "Year *" }),
|
|
618
627
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
619
628
|
import_input_text.default,
|
|
620
629
|
{
|
|
@@ -655,7 +664,8 @@ const FormSubdomainAge = ({
|
|
|
655
664
|
...{
|
|
656
665
|
disabled,
|
|
657
666
|
style,
|
|
658
|
-
submitting: formState == null ? void 0 : formState.isSubmitting
|
|
667
|
+
submitting: formState == null ? void 0 : formState.isSubmitting,
|
|
668
|
+
text: (values == null ? void 0 : values.button) || "Next"
|
|
659
669
|
}
|
|
660
670
|
}
|
|
661
671
|
)
|
|
@@ -671,11 +681,11 @@ const FormSubdomainItemList = ({
|
|
|
671
681
|
currency,
|
|
672
682
|
field,
|
|
673
683
|
onChange,
|
|
674
|
-
prices,
|
|
684
|
+
prices = true,
|
|
675
685
|
style,
|
|
676
686
|
value
|
|
677
687
|
}) => {
|
|
678
|
-
var _a;
|
|
688
|
+
var _a, _b;
|
|
679
689
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
680
690
|
"div",
|
|
681
691
|
{
|
|
@@ -683,8 +693,8 @@ const FormSubdomainItemList = ({
|
|
|
683
693
|
className: "space-y-2"
|
|
684
694
|
},
|
|
685
695
|
children: [
|
|
686
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
687
|
-
"
|
|
696
|
+
(((_a = field == null ? void 0 : field.settings) == null ? void 0 : _a.items) || []).length !== 1 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
697
|
+
"h5",
|
|
688
698
|
{
|
|
689
699
|
...{
|
|
690
700
|
className: "text-xs uppercase tracking-wide opacity-60"
|
|
@@ -698,8 +708,8 @@ const FormSubdomainItemList = ({
|
|
|
698
708
|
...{
|
|
699
709
|
className: "space-y-4"
|
|
700
710
|
},
|
|
701
|
-
children: (((
|
|
702
|
-
var _a2,
|
|
711
|
+
children: (((_b = field == null ? void 0 : field.settings) == null ? void 0 : _b.items) || []).map((item) => {
|
|
712
|
+
var _a2, _b2;
|
|
703
713
|
const quantity = Number(value == null ? void 0 : value[item.id]) || 0;
|
|
704
714
|
const src = (0, import_cdn.cdnSrc)(item.image, "200x200", (_a2 = item.image) == null ? void 0 : _a2.updatedAt);
|
|
705
715
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -725,7 +735,7 @@ const FormSubdomainItemList = ({
|
|
|
725
735
|
{
|
|
726
736
|
...{
|
|
727
737
|
// The image's own description, else its file name, as every image slot.
|
|
728
|
-
alt: item.description || ((
|
|
738
|
+
alt: item.description || ((_b2 = item.image) == null ? void 0 : _b2.filename) || "",
|
|
729
739
|
className: "object-cover",
|
|
730
740
|
fill: true,
|
|
731
741
|
sizes: "56px",
|
|
@@ -759,7 +769,7 @@ const FormSubdomainItemList = ({
|
|
|
759
769
|
className: "text-xs opacity-60"
|
|
760
770
|
},
|
|
761
771
|
children: (0, import_drawbridge_utils.formatCurrency)({
|
|
762
|
-
code: currency.toUpperCase(),
|
|
772
|
+
code: (currency || "usd").toUpperCase(),
|
|
763
773
|
display: "parts",
|
|
764
774
|
value: item.price
|
|
765
775
|
})
|
|
@@ -813,20 +823,28 @@ const FormSubdomainSection = ({
|
|
|
813
823
|
focus,
|
|
814
824
|
initial,
|
|
815
825
|
last,
|
|
826
|
+
onAgreement,
|
|
816
827
|
preview,
|
|
828
|
+
refused,
|
|
817
829
|
section,
|
|
818
830
|
slugs = [],
|
|
819
831
|
style,
|
|
820
832
|
values
|
|
821
833
|
}) => {
|
|
822
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
834
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
|
|
823
835
|
const fields = (section == null ? void 0 : section.fields) || [];
|
|
824
836
|
const lists = fields.filter((field) => (field == null ? void 0 : field.slug) === "list");
|
|
825
|
-
const prices = (
|
|
826
|
-
const currency = ((
|
|
827
|
-
const
|
|
828
|
-
|
|
829
|
-
|
|
837
|
+
const prices = (0, import_order.priced)(lists);
|
|
838
|
+
const currency = ((_a = section == null ? void 0 : section.settings) == null ? void 0 : _a.currency) || "usd";
|
|
839
|
+
const opens = (key) => {
|
|
840
|
+
var _a2;
|
|
841
|
+
return (0, import_entry.agreementContent)((_a2 = values == null ? void 0 : values.agreements) == null ? void 0 : _a2[key]);
|
|
842
|
+
};
|
|
843
|
+
const optOutLine = (0, import_entry.termsOptOut)(values);
|
|
844
|
+
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");
|
|
845
|
+
const marketingConsent = Boolean(last) && Boolean((_e = (_d = values == null ? void 0 : values.agreements) == null ? void 0 : _d.marketing) == null ? void 0 : _e.enabled) && (0, import_entry.agreementShown)((_f = values == null ? void 0 : values.agreements) == null ? void 0 : _f.marketing);
|
|
846
|
+
const termsConsent = Boolean(last) && Boolean((_h = (_g = values == null ? void 0 : values.agreements) == null ? void 0 : _g.terms) == null ? void 0 : _h.enabled) && (0, import_entry.agreementShown)((_i = values == null ? void 0 : values.agreements) == null ? void 0 : _i.terms);
|
|
847
|
+
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"));
|
|
830
848
|
const schema = (0, import_react.useMemo)(
|
|
831
849
|
() => {
|
|
832
850
|
var _a2;
|
|
@@ -866,10 +884,17 @@ const FormSubdomainSection = ({
|
|
|
866
884
|
},
|
|
867
885
|
[marketingConsent, section, smsConsent, termsConsent, values]
|
|
868
886
|
);
|
|
869
|
-
const { control, getValues, handleSubmit, formState } = (0, import_react_hook_form.useForm)({
|
|
887
|
+
const { control, getValues, handleSubmit, formState, setError } = (0, import_react_hook_form.useForm)({
|
|
870
888
|
defaultValues: initial || {},
|
|
871
889
|
resolver: (0, import_yup.resolver)(schema)
|
|
872
890
|
});
|
|
891
|
+
(0, import_react.useEffect)(
|
|
892
|
+
() => Object.entries(refused || {}).forEach(([id, message]) => {
|
|
893
|
+
if (fields.some((field) => (field == null ? void 0 : field.id) === id)) setError("fields." + id, { message });
|
|
894
|
+
}),
|
|
895
|
+
[refused]
|
|
896
|
+
// eslint-disable-line react-hooks/exhaustive-deps
|
|
897
|
+
);
|
|
873
898
|
const answers = (0, import_react_hook_form.useWatch)({
|
|
874
899
|
control,
|
|
875
900
|
name: "fields"
|
|
@@ -886,19 +911,34 @@ const FormSubdomainSection = ({
|
|
|
886
911
|
{
|
|
887
912
|
...{
|
|
888
913
|
labelId: "checkbox-" + key,
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
914
|
+
// @story public-entry/read-agreement
|
|
915
|
+
// A link opens in a new tab; a document opens over the form, with Back.
|
|
916
|
+
label: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [
|
|
917
|
+
opens(key) === "link" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
918
|
+
import_button.default,
|
|
919
|
+
{
|
|
920
|
+
...{
|
|
921
|
+
element: import_link.default,
|
|
922
|
+
href: (_b2 = (_a2 = values == null ? void 0 : values.agreements) == null ? void 0 : _a2[key]) == null ? void 0 : _b2.link,
|
|
923
|
+
inline: true,
|
|
924
|
+
target: "_blank",
|
|
925
|
+
variant: "link"
|
|
926
|
+
},
|
|
927
|
+
children: ((_d2 = (_c2 = values == null ? void 0 : values.agreements) == null ? void 0 : _c2[key]) == null ? void 0 : _d2.label) || fallback
|
|
928
|
+
}
|
|
929
|
+
) : opens(key) === "document" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
930
|
+
import_button.default,
|
|
931
|
+
{
|
|
932
|
+
...{
|
|
933
|
+
inline: true,
|
|
934
|
+
onClick: () => onAgreement == null ? void 0 : onAgreement(key),
|
|
935
|
+
variant: "link"
|
|
936
|
+
},
|
|
937
|
+
children: ((_f2 = (_e2 = values == null ? void 0 : values.agreements) == null ? void 0 : _e2[key]) == null ? void 0 : _f2.label) || fallback
|
|
938
|
+
}
|
|
939
|
+
) : ((_h2 = (_g2 = values == null ? void 0 : values.agreements) == null ? void 0 : _g2[key]) == null ? void 0 : _h2.label) || fallback,
|
|
940
|
+
key === "terms" && " *"
|
|
941
|
+
] }),
|
|
902
942
|
onChange,
|
|
903
943
|
style,
|
|
904
944
|
value
|
|
@@ -907,7 +947,7 @@ const FormSubdomainSection = ({
|
|
|
907
947
|
);
|
|
908
948
|
};
|
|
909
949
|
const count = (0, import_order.itemCount)(lists, answers);
|
|
910
|
-
const itemsError = (
|
|
950
|
+
const itemsError = (_m = (_l = formState == null ? void 0 : formState.errors) == null ? void 0 : _l.items) == null ? void 0 : _m.message;
|
|
911
951
|
const totalBlock = (prices || itemsError) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
912
952
|
"div",
|
|
913
953
|
{
|
|
@@ -922,7 +962,7 @@ const FormSubdomainSection = ({
|
|
|
922
962
|
className: "flex items-center justify-between text-sm"
|
|
923
963
|
},
|
|
924
964
|
children: [
|
|
925
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "
|
|
965
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "TOTAL \xB7 " + count + " " + (count === 1 ? "ITEM" : "ITEMS") }),
|
|
926
966
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: (0, import_drawbridge_utils.formatCurrency)({
|
|
927
967
|
code: currency.toUpperCase(),
|
|
928
968
|
display: "parts",
|
|
@@ -943,6 +983,38 @@ const FormSubdomainSection = ({
|
|
|
943
983
|
]
|
|
944
984
|
}
|
|
945
985
|
);
|
|
986
|
+
const drawn = (field) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
987
|
+
import_react_hook_form.Controller,
|
|
988
|
+
{
|
|
989
|
+
...{
|
|
990
|
+
control,
|
|
991
|
+
name: "fields." + field.id,
|
|
992
|
+
render: ({ field: { onChange, value } }) => {
|
|
993
|
+
var _a2, _b2;
|
|
994
|
+
return (field == null ? void 0 : field.slug) === "list" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
995
|
+
FormSubdomainItemList,
|
|
996
|
+
{
|
|
997
|
+
...{
|
|
998
|
+
currency,
|
|
999
|
+
field,
|
|
1000
|
+
onChange,
|
|
1001
|
+
prices,
|
|
1002
|
+
style,
|
|
1003
|
+
value
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
) : import_fields.components[drawnAs[field == null ? void 0 : field.slug] || (field == null ? void 0 : field.slug)]({
|
|
1007
|
+
error: (_b2 = (_a2 = formState == null ? void 0 : formState.errors) == null ? void 0 : _a2.fields) == null ? void 0 : _b2[field == null ? void 0 : field.id],
|
|
1008
|
+
field,
|
|
1009
|
+
onChange,
|
|
1010
|
+
style,
|
|
1011
|
+
value
|
|
1012
|
+
});
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
},
|
|
1016
|
+
field == null ? void 0 : field.id
|
|
1017
|
+
);
|
|
946
1018
|
const consent = [
|
|
947
1019
|
termsConsent && ["terms"],
|
|
948
1020
|
marketingConsent && ["marketing", import_entry.agreementWording.marketing],
|
|
@@ -1018,40 +1090,21 @@ const FormSubdomainSection = ({
|
|
|
1018
1090
|
...{
|
|
1019
1091
|
className: (lists.length > 0 ? "space-y-6 " : "space-y-4 ") + faded()
|
|
1020
1092
|
},
|
|
1021
|
-
children: fields.map((
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
FormSubdomainItemList,
|
|
1032
|
-
{
|
|
1033
|
-
...{
|
|
1034
|
-
currency,
|
|
1035
|
-
field,
|
|
1036
|
-
onChange,
|
|
1037
|
-
prices,
|
|
1038
|
-
style,
|
|
1039
|
-
value
|
|
1040
|
-
}
|
|
1041
|
-
}
|
|
1042
|
-
) : import_fields.components[drawnAs[field == null ? void 0 : field.slug] || (field == null ? void 0 : field.slug)]({
|
|
1043
|
-
error: (_b2 = (_a2 = formState == null ? void 0 : formState.errors) == null ? void 0 : _a2.fields) == null ? void 0 : _b2[field == null ? void 0 : field.id],
|
|
1044
|
-
field,
|
|
1045
|
-
onChange,
|
|
1046
|
-
style,
|
|
1047
|
-
value
|
|
1048
|
-
});
|
|
1049
|
-
}
|
|
1093
|
+
children: (0, import_order.itemRuns)(fields).map((run) => {
|
|
1094
|
+
var _a2;
|
|
1095
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [
|
|
1096
|
+
run.fields.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1097
|
+
"div",
|
|
1098
|
+
{
|
|
1099
|
+
...{
|
|
1100
|
+
className: "space-y-4"
|
|
1101
|
+
},
|
|
1102
|
+
children: run.fields.map(drawn)
|
|
1050
1103
|
}
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1104
|
+
) : drawn(run.fields[0]),
|
|
1105
|
+
run.fields.some((field) => (0, import_order.isLastList)(fields, field == null ? void 0 : field.id)) && totalBlock
|
|
1106
|
+
] }, (_a2 = run.fields[0]) == null ? void 0 : _a2.id);
|
|
1107
|
+
})
|
|
1055
1108
|
}
|
|
1056
1109
|
),
|
|
1057
1110
|
consent.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -1082,6 +1135,11 @@ const FormSubdomainSection = ({
|
|
|
1082
1135
|
{
|
|
1083
1136
|
...{
|
|
1084
1137
|
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,
|
|
1138
|
+
// @story public-entry/read-agreement
|
|
1139
|
+
// The organizer's own rules may not say it; our document does, in Opting out.
|
|
1140
|
+
...key === "terms" && opens("terms") === "link" && optOutLine && {
|
|
1141
|
+
message: optOutLine
|
|
1142
|
+
},
|
|
1085
1143
|
input: checkbox({
|
|
1086
1144
|
fallback,
|
|
1087
1145
|
key,
|
|
@@ -1117,11 +1175,41 @@ const FormSubdomainSection = ({
|
|
|
1117
1175
|
disabled,
|
|
1118
1176
|
style,
|
|
1119
1177
|
submitting: formState == null ? void 0 : formState.isSubmitting,
|
|
1120
|
-
|
|
1178
|
+
// @story public-entry/submit
|
|
1179
|
+
// The step's own Next text; the last step's is the form's one Submit text.
|
|
1180
|
+
text: last ? (values == null ? void 0 : values.submit) || "Submit" : (section == null ? void 0 : section.button) || "Next"
|
|
1121
1181
|
}
|
|
1122
1182
|
}
|
|
1123
1183
|
)
|
|
1124
1184
|
}
|
|
1185
|
+
),
|
|
1186
|
+
privacy && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1187
|
+
"p",
|
|
1188
|
+
{
|
|
1189
|
+
...{
|
|
1190
|
+
className: "text-center text-xs " + faded("privacy"),
|
|
1191
|
+
...focus === "privacy" && {
|
|
1192
|
+
ref: focused
|
|
1193
|
+
}
|
|
1194
|
+
},
|
|
1195
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1196
|
+
import_button.default,
|
|
1197
|
+
{
|
|
1198
|
+
...{
|
|
1199
|
+
inline: true,
|
|
1200
|
+
variant: "link",
|
|
1201
|
+
...opens("privacy") === "link" ? {
|
|
1202
|
+
element: import_link.default,
|
|
1203
|
+
href: (_o = (_n = values == null ? void 0 : values.agreements) == null ? void 0 : _n.privacy) == null ? void 0 : _o.link,
|
|
1204
|
+
target: "_blank"
|
|
1205
|
+
} : {
|
|
1206
|
+
onClick: () => onAgreement == null ? void 0 : onAgreement("privacy")
|
|
1207
|
+
}
|
|
1208
|
+
},
|
|
1209
|
+
children: ((_q = (_p = values == null ? void 0 : values.agreements) == null ? void 0 : _p.privacy) == null ? void 0 : _q.label) || "Privacy policy"
|
|
1210
|
+
}
|
|
1211
|
+
)
|
|
1212
|
+
}
|
|
1125
1213
|
)
|
|
1126
1214
|
]
|
|
1127
1215
|
}
|
|
@@ -1131,6 +1219,7 @@ const FormSubdomain = ({
|
|
|
1131
1219
|
agreements,
|
|
1132
1220
|
button,
|
|
1133
1221
|
disabled,
|
|
1222
|
+
documents,
|
|
1134
1223
|
fields,
|
|
1135
1224
|
focus,
|
|
1136
1225
|
integrations,
|
|
@@ -1141,20 +1230,29 @@ const FormSubdomain = ({
|
|
|
1141
1230
|
},
|
|
1142
1231
|
params,
|
|
1143
1232
|
preview,
|
|
1233
|
+
// @story public-entry/read-agreement
|
|
1234
|
+
// False while the campaign's giveaway is off ( lib/entry giveawayOn ).
|
|
1235
|
+
giveaway,
|
|
1144
1236
|
// The share payload's `sms` : false while texts are off on the platform.
|
|
1145
1237
|
sms,
|
|
1146
1238
|
step: start = 0,
|
|
1147
1239
|
style,
|
|
1240
|
+
// @story public-entry/submit
|
|
1241
|
+
// The form's one Submit text, on the last step ( `defaults.submit` ).
|
|
1242
|
+
submit,
|
|
1148
1243
|
tracking
|
|
1149
1244
|
}) => {
|
|
1150
|
-
var _a, _b, _c;
|
|
1245
|
+
var _a, _b, _c, _d, _e;
|
|
1151
1246
|
const { executeRecaptcha } = (0, import_react_google_recaptcha_v3.useGoogleReCaptcha)();
|
|
1152
1247
|
const searchParams = (0, import_navigation.useSearchParams)();
|
|
1153
1248
|
const token = searchParams.get("drwbrdg_pre");
|
|
1154
1249
|
const [data, setData] = (0, import_react.useState)({});
|
|
1155
1250
|
const [step, setStep] = (0, import_react.useState)(start);
|
|
1251
|
+
const [reading, setReading] = (0, import_react.useState)(null);
|
|
1252
|
+
const [refused, setRefused] = (0, import_react.useState)(null);
|
|
1156
1253
|
const sections = (0, import_order.sectionsOf)(fields);
|
|
1157
1254
|
const slugs = sections.flatMap((section) => ((section == null ? void 0 : section.fields) || []).map((field) => field == null ? void 0 : field.slug));
|
|
1255
|
+
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));
|
|
1158
1256
|
const merge = (object = {}) => ({
|
|
1159
1257
|
...data,
|
|
1160
1258
|
...object,
|
|
@@ -1165,7 +1263,7 @@ const FormSubdomain = ({
|
|
|
1165
1263
|
});
|
|
1166
1264
|
const onSubmit = (0, import_react.useCallback)(
|
|
1167
1265
|
async (values) => {
|
|
1168
|
-
var _a2, _b2;
|
|
1266
|
+
var _a2, _b2, _c2;
|
|
1169
1267
|
try {
|
|
1170
1268
|
let recaptcha;
|
|
1171
1269
|
if (Boolean((_a2 = integrations == null ? void 0 : integrations.recaptcha) == null ? void 0 : _a2.enabled)) {
|
|
@@ -1202,13 +1300,21 @@ const FormSubdomain = ({
|
|
|
1202
1300
|
);
|
|
1203
1301
|
}
|
|
1204
1302
|
} catch (error) {
|
|
1303
|
+
const index = (0, import_order.refusedSection)(sections, (_c2 = error == null ? void 0 : error.data) == null ? void 0 : _c2.fields);
|
|
1304
|
+
if (index >= 0) {
|
|
1305
|
+
setData(values);
|
|
1306
|
+
setRefused(error.data.fields);
|
|
1307
|
+
setStep(before + index);
|
|
1308
|
+
return;
|
|
1309
|
+
}
|
|
1310
|
+
;
|
|
1205
1311
|
onError(error);
|
|
1206
1312
|
}
|
|
1207
1313
|
},
|
|
1208
|
-
[executeRecaptcha, integrations, onError, onSuccess, params, preview, token, tracking]
|
|
1314
|
+
[before, executeRecaptcha, integrations, onError, onSuccess, params, preview, sections, token, tracking]
|
|
1209
1315
|
);
|
|
1210
1316
|
const forms = [
|
|
1211
|
-
...Boolean((
|
|
1317
|
+
...Boolean((_c = integrations == null ? void 0 : integrations.geocode) == null ? void 0 : _c.enabled) ? [
|
|
1212
1318
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1213
1319
|
FormSubdomainGeocode,
|
|
1214
1320
|
{
|
|
@@ -1232,7 +1338,7 @@ const FormSubdomain = ({
|
|
|
1232
1338
|
"form-subdomain-geocode"
|
|
1233
1339
|
)
|
|
1234
1340
|
] : [],
|
|
1235
|
-
...Boolean((
|
|
1341
|
+
...Boolean((_d = integrations == null ? void 0 : integrations.age) == null ? void 0 : _d.enabled) ? [
|
|
1236
1342
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1237
1343
|
FormSubdomainAge,
|
|
1238
1344
|
{
|
|
@@ -1257,7 +1363,7 @@ const FormSubdomain = ({
|
|
|
1257
1363
|
disabled,
|
|
1258
1364
|
preview,
|
|
1259
1365
|
style,
|
|
1260
|
-
values: (
|
|
1366
|
+
values: (_e = integrations == null ? void 0 : integrations.age) == null ? void 0 : _e.settings
|
|
1261
1367
|
}
|
|
1262
1368
|
},
|
|
1263
1369
|
"form-subdomain-age"
|
|
@@ -1275,6 +1381,7 @@ const FormSubdomain = ({
|
|
|
1275
1381
|
button,
|
|
1276
1382
|
callback: async (object) => {
|
|
1277
1383
|
const merged = merge(object);
|
|
1384
|
+
setRefused(null);
|
|
1278
1385
|
if (index < sections.length - 1) {
|
|
1279
1386
|
setData(merged);
|
|
1280
1387
|
setStep(step + 1);
|
|
@@ -1286,40 +1393,62 @@ const FormSubdomain = ({
|
|
|
1286
1393
|
focus,
|
|
1287
1394
|
initial: data,
|
|
1288
1395
|
last: index === sections.length - 1,
|
|
1396
|
+
onAgreement: setReading,
|
|
1289
1397
|
preview,
|
|
1398
|
+
refused,
|
|
1290
1399
|
section,
|
|
1291
1400
|
slugs,
|
|
1292
1401
|
style,
|
|
1293
1402
|
values: {
|
|
1294
1403
|
agreements,
|
|
1295
|
-
|
|
1404
|
+
giveaway,
|
|
1405
|
+
sms,
|
|
1406
|
+
submit
|
|
1296
1407
|
}
|
|
1297
1408
|
}
|
|
1298
1409
|
},
|
|
1299
1410
|
"form-subdomain-section-" + section.id
|
|
1300
1411
|
))
|
|
1301
1412
|
];
|
|
1302
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.
|
|
1413
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
1303
1414
|
"div",
|
|
1304
1415
|
{
|
|
1305
1416
|
...{
|
|
1306
1417
|
className: "space-y-6"
|
|
1307
1418
|
},
|
|
1308
|
-
children:
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1419
|
+
children: [
|
|
1420
|
+
reading && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1421
|
+
import_form_subdomain_agreement.default,
|
|
1422
|
+
{
|
|
1423
|
+
...{
|
|
1424
|
+
agreement: agreements == null ? void 0 : agreements[reading],
|
|
1425
|
+
back: () => setReading(null),
|
|
1426
|
+
button,
|
|
1427
|
+
data: documents,
|
|
1428
|
+
style,
|
|
1429
|
+
title: import_entry.agreementTitles[reading]
|
|
1430
|
+
}
|
|
1431
|
+
}
|
|
1432
|
+
),
|
|
1433
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1434
|
+
"div",
|
|
1435
|
+
{
|
|
1436
|
+
...{
|
|
1437
|
+
className: "relative w-full space-y-6" + (reading ? " hidden" : "")
|
|
1438
|
+
},
|
|
1439
|
+
children: forms == null ? void 0 : forms[step]
|
|
1440
|
+
}
|
|
1441
|
+
)
|
|
1442
|
+
]
|
|
1317
1443
|
}
|
|
1318
1444
|
);
|
|
1319
1445
|
};
|
|
1320
1446
|
var form_subdomain_default = FormSubdomain;
|
|
1321
1447
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1322
1448
|
0 && (module.exports = {
|
|
1449
|
+
FormSubdomainAge,
|
|
1450
|
+
FormSubdomainGeocode,
|
|
1451
|
+
FormSubdomainItemList,
|
|
1323
1452
|
FormSubdomainMessage,
|
|
1324
1453
|
FormSubdomainSubmission
|
|
1325
1454
|
});
|