@usgb/forms 1.0.1 → 1.0.3
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/README.md +139 -104
- package/dist/forms-manifest.1.0.3.json +439 -0
- package/dist/forms-manifest.json +252 -64
- package/dist/index.js +747 -670
- package/dist/src/contract/createIdempotencyKey.d.ts +2 -0
- package/dist/src/contract/createIdempotencyKey.d.ts.map +1 -0
- package/dist/src/contract/createStubAdapter.d.ts.map +1 -1
- package/dist/src/contract/types.d.ts +21 -25
- package/dist/src/contract/types.d.ts.map +1 -1
- package/dist/src/definitions/consents.d.ts +63 -20
- package/dist/src/definitions/consents.d.ts.map +1 -1
- package/dist/src/definitions/index.d.ts +5 -4
- package/dist/src/definitions/index.d.ts.map +1 -1
- package/dist/src/definitions/manifest.d.ts +14 -1
- package/dist/src/definitions/manifest.d.ts.map +1 -1
- package/dist/src/definitions/types.d.ts +44 -9
- package/dist/src/definitions/types.d.ts.map +1 -1
- package/dist/src/form/FormShell.d.ts +2 -1
- package/dist/src/form/FormShell.d.ts.map +1 -1
- package/dist/src/form/UsgbForm.d.ts +5 -4
- package/dist/src/form/UsgbForm.d.ts.map +1 -1
- package/dist/src/form/chunkFields.d.ts +1 -1
- package/dist/src/form/kinds/LeadKindForm.d.ts +1 -1
- package/dist/src/form/kinds/LeadKindForm.d.ts.map +1 -1
- package/dist/src/form/kinds/NewsletterKindForm.d.ts +1 -1
- package/dist/src/form/kinds/NewsletterKindForm.d.ts.map +1 -1
- package/dist/src/form/kinds/types.d.ts +3 -1
- package/dist/src/form/kinds/types.d.ts.map +1 -1
- package/dist/src/form/useUsgbFormSession.d.ts +7 -8
- package/dist/src/form/useUsgbFormSession.d.ts.map +1 -1
- package/dist/src/index.d.ts +5 -5
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/ui/Button.d.ts.map +1 -1
- package/dist/src/ui/ConsentField.d.ts.map +1 -1
- package/dist/usgb-forms.1.0.3.js +44 -0
- package/dist/usgb-forms.css +98 -15
- package/dist/usgb-forms.js +11 -11
- package/forms-manifest.json +252 -64
- package/package.json +2 -2
- package/dist/src/contract/collectContext.d.ts +0 -9
- package/dist/src/contract/collectContext.d.ts.map +0 -1
- package/dist/usgb-forms.1.0.1.js +0 -44
package/dist/index.js
CHANGED
|
@@ -1,68 +1,126 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { useForm as
|
|
5
|
-
import
|
|
6
|
-
const se = "1.0.0", ae = { version: "1.0.0", transport: "server-proxy", payloadShape: "data-and-context" }, le = { page_url: { destination: "form_submission_url", category: "page", collection: "server", required: !0, states: ["collected", "unavailable"], description: "Canonical landing-page URL at submission time" }, page_title: { destination: "pageName", category: "page", collection: "server", required: !1, states: ["collected", "unavailable"] }, referrer: { destination: "referrer", category: "page", collection: "browser", required: !1, states: ["collected", "unavailable"] }, first_touch_url: { destination: "crossDomain_landing_url", category: "attribution", collection: "host-adapter", required: !1, states: ["collected", "unavailable"] }, utm_source: { destination: "utm_source", category: "attribution", collection: "host-adapter", required: !1, states: ["collected", "unavailable"] }, utm_medium: { destination: "utm_medium", category: "attribution", collection: "host-adapter", required: !1, states: ["collected", "unavailable"] }, utm_campaign: { destination: "utm_campaign", category: "attribution", collection: "host-adapter", required: !1, states: ["collected", "unavailable"] }, utm_term: { destination: "utm_term", category: "attribution", collection: "host-adapter", required: !1, states: ["collected", "unavailable"] }, utm_content: { destination: "utm_content", category: "attribution", collection: "host-adapter", required: !1, states: ["collected", "unavailable"] }, gclid: { destination: "gclid", category: "click-id", collection: "host-adapter", required: !1, states: ["collected", "unavailable"] }, msclkid: { destination: "msclkid", category: "click-id", collection: "host-adapter", required: !1, states: ["collected", "unavailable"] }, gbraid: { destination: "gbraid", category: "click-id", collection: "host-adapter", required: !1, states: ["collected", "unavailable"] }, wbraid: { destination: "wbraid", category: "click-id", collection: "host-adapter", required: !1, states: ["collected", "unavailable"] }, hubspot_utk: { destination: "hubspot_utk", category: "identity", collection: "host-adapter", required: !1, states: ["collected", "unavailable", "consent-withheld"] }, ga_client_id: { destination: "ga_client_id", category: "analytics", collection: "host-adapter", required: !1, states: ["collected", "unavailable", "consent-withheld"] }, ga_session_id: { destination: "session_id_start", category: "analytics", collection: "host-adapter", required: !1, states: ["collected", "unavailable", "consent-withheld"] }, snowplow_id: { destination: "snowplow_id", category: "analytics", collection: "host-adapter", required: !1, states: ["collected", "unavailable", "consent-withheld"] }, vwo_uuid: { destination: "vwo_uuid", category: "experiment", collection: "host-adapter", required: !1, states: ["collected", "unavailable", "consent-withheld"] }, user_agent: { destination: "header_http_client_details", category: "technical", collection: "server", required: !1, states: ["collected", "unavailable"] }, ip_address: { destination: "ipAddress", category: "technical", collection: "server", required: !1, states: ["collected", "unavailable"] } }, ce = { "main-investors-kit": { definitionVersion: "1", kind: "lead", flow: { type: "single" }, supportedHosts: ["pwa", "wordpress"], fields: [{ name: "firstname", required: !0, group: "name" }, { name: "lastname", required: !0, group: "name" }, { name: "email", required: !0 }, { name: "phone", required: !1 }], trackingFields: ["page_url", "page_title", "referrer", "first_touch_url", "utm_source", "utm_medium", "utm_campaign", "utm_term", "utm_content", "gclid", "msclkid", "gbraid", "wbraid", "hubspot_utk", "ga_client_id", "ga_session_id", "snowplow_id", "vwo_uuid", "user_agent", "ip_address"], ctaLabel: "GET MY FREE GUIDE", consent: { definitionId: "lead-tcpa", definitionVersion: "1", required: !0, submitFields: ["tcpa_form_consent_granted", "tcpa_form_opt_in_date"] }, editor: { label: "Main Investors Kit", description: "Standard lead form: name, email, phone, TCPA consent. Use on full-width landing pages and PWA kit/sidebar placements.", whenToUse: "Default kit request. Do not use for affiliate landers or IRA-specific leads.", whenNotToUse: "Affiliate pages (separate definition). IRA kit (separate definition when added).", supportedAppearances: ["on-light", "on-dark"], supportedVariants: ["dense", "large", "sidebar", "two-column"] } }, newsletter: { definitionVersion: "1", kind: "newsletter", flow: { type: "single" }, supportedHosts: ["pwa"], fields: [{ name: "email", required: !0 }], trackingFields: ["page_url", "page_title", "referrer", "utm_source", "utm_medium", "utm_campaign", "utm_term", "utm_content"], ctaLabel: "SUBSCRIBE", editor: { label: "Newsletter", description: "Email-only newsletter signup. No TCPA consent.", whenToUse: "Footer or landing newsletter capture where only an email is required.", whenNotToUse: "Lead kits that need name, phone, or TCPA consent.", supportedAppearances: ["on-light", "on-dark"], supportedVariants: [] } } }, de = { hosts: ["pwa", "wordpress"], mayProvide: ["browser cookies", "URL parameters", "page and placement context", "host/store identity"], mustNotDefine: ["new tracking keys", "destination property names", "consent definitions", "form fields", "submission endpoints"] }, ue = {
|
|
7
|
-
schemaVersion:
|
|
8
|
-
package: { name: "@usgb/forms", compatiblePackageVersions: "^1.0.
|
|
9
|
-
submissionContract:
|
|
10
|
-
trackingRegistry:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { jsx as s, Fragment as ee, jsxs as h } from "react/jsx-runtime";
|
|
2
|
+
import { useId as K, useMemo as D, useState as te, useRef as G, useEffect as j, forwardRef as R } from "react";
|
|
3
|
+
import { validate as ne } from "email-validator";
|
|
4
|
+
import { useForm as re } from "react-hook-form";
|
|
5
|
+
import A from "classnames";
|
|
6
|
+
const ie = "1.1.0", oe = { version: "1.0.0", transport: "server-proxy" }, ae = { page_url: { destination: "form_submission_url", category: "page", collection: "server", required: !0, states: ["collected", "unavailable"], description: "Canonical landing-page URL at submission time" }, page_title: { destination: "pageName", category: "page", collection: "server", required: !1, states: ["collected", "unavailable"] }, referrer: { destination: "referrer", category: "page", collection: "browser", required: !1, states: ["collected", "unavailable"] }, first_touch_url: { destination: "crossDomain_landing_url", category: "attribution", collection: "host-adapter", required: !1, states: ["collected", "unavailable"] }, utm_source: { destination: "utm_source", category: "attribution", collection: "host-adapter", required: !1, states: ["collected", "unavailable"] }, utm_medium: { destination: "utm_medium", category: "attribution", collection: "host-adapter", required: !1, states: ["collected", "unavailable"] }, utm_campaign: { destination: "utm_campaign", category: "attribution", collection: "host-adapter", required: !1, states: ["collected", "unavailable"] }, utm_term: { destination: "utm_term", category: "attribution", collection: "host-adapter", required: !1, states: ["collected", "unavailable"] }, utm_content: { destination: "utm_content", category: "attribution", collection: "host-adapter", required: !1, states: ["collected", "unavailable"] }, gclid: { destination: "gclid", category: "click-id", collection: "host-adapter", required: !1, states: ["collected", "unavailable"] }, msclkid: { destination: "msclkid", category: "click-id", collection: "host-adapter", required: !1, states: ["collected", "unavailable"] }, gbraid: { destination: "gbraid", category: "click-id", collection: "host-adapter", required: !1, states: ["collected", "unavailable"] }, wbraid: { destination: "wbraid", category: "click-id", collection: "host-adapter", required: !1, states: ["collected", "unavailable"] }, hubspot_utk: { destination: "hubspot_utk", category: "identity", collection: "host-adapter", required: !1, states: ["collected", "unavailable", "consent-withheld"] }, ga_client_id: { destination: "ga_client_id", category: "analytics", collection: "host-adapter", required: !1, states: ["collected", "unavailable", "consent-withheld"] }, ga_session_id: { destination: "session_id_start", category: "analytics", collection: "host-adapter", required: !1, states: ["collected", "unavailable", "consent-withheld"] }, snowplow_id: { destination: "snowplow_id", category: "analytics", collection: "host-adapter", required: !1, states: ["collected", "unavailable", "consent-withheld"] }, vwo_uuid: { destination: "vwo_uuid", category: "experiment", collection: "host-adapter", required: !1, states: ["collected", "unavailable", "consent-withheld"] }, user_agent: { destination: "header_http_client_details", category: "technical", collection: "server", required: !1, states: ["collected", "unavailable"] }, ip_address: { destination: "ipAddress", category: "technical", collection: "server", required: !1, states: ["collected", "unavailable"] } }, se = { appearance: { label: "Appearance", control: "select", reactProp: "appearance", attribute: "appearance", required: !1, default: "on-light", valuesFrom: "supportedAppearances", description: "Recolors the form for a light or dark host surface. It never paints a background, padding, or radius — the host container owns those." }, variant: { label: "Size variant", control: "select", reactProp: "variant", attribute: "variant", required: !1, default: "dense", valuesFrom: "supportedVariants", description: "Select exactly one size treatment: `dense`, `large`, or `sidebar`." }, twoColumn: { label: "Two-column name row", control: "checkbox", reactProp: "twoColumn", attribute: "two-column", required: !1, default: !1, description: "Places grouped name fields in two columns when the form container is wide enough." }, heading: { label: "Heading", control: "text", reactProp: "heading", attribute: "heading", required: !1, description: "Placement copy above the fields. Omit to render no heading." }, subheading: { label: "Subheading", control: "text", reactProp: "subheading", attribute: "subheading", required: !1, description: "Supporting copy under the heading. Omit to render none." }, ctaLabel: { label: "Button label", control: "text", reactProp: "ctaLabel", attribute: "cta", required: !1, defaultFrom: "ctaLabel", description: "Overrides the catalog submit label for this placement." }, legalUrls: { label: "Legal document URLs", control: "url-group", reactProp: "legalUrls", attributes: { clientAgreement: "client-agreement-url", privacyPolicy: "privacy-policy-url", userAgreement: "user-agreement-url", marketLossPolicy: "market-loss-policy-url", electronicDisclaimer: "electronic-disclaimer-url", termsOfSale: "terms-of-sale-url" }, required: !0, valuesFrom: "requiredLegalUrls", description: "Host CMS hrefs for the documents named in this form's consent copy. Every key in `requiredLegalUrls` must be a non-empty URL or the form does not render." }, successMessage: { label: "Thank-you message", control: "text", reactProp: "successMessage", attribute: "success-message", required: !1, description: "Inline copy shown after accept. Ignored when a thank-you URL is set; omitted values fall back to a package default line." }, successUrl: { label: "Thank-you URL", control: "url", reactProp: "successUrl", attribute: "success-url", required: !1, description: "Redirect after accept. A full navigation can cut off analytics beacons — prefer measuring the conversion on the thank-you page." } }, le = { "magento-fik": { definitionVersion: "1", kind: "lead", flow: { type: "single" }, fields: [{ name: "firstname", required: !0, group: "name" }, { name: "lastname", required: !0, group: "name" }, { name: "email", required: !0 }, { name: "phone", required: !1 }], ctaLabel: "GET MY FREE GUIDE", consents: [{ definitionId: "lead-tcpa", definitionVersion: "1", required: !1 }, { definitionId: "lead-sms", definitionVersion: "1", required: !1 }, { definitionId: "lead-tospp", definitionVersion: "1", required: !1 }], editor: { label: "Magento FIK", description: "First name, last name, and email required; phone optional. Optional checkboxes: transactional SMS (lead-tcpa v1), marketing SMS (lead-sms v1), and terms and privacy (lead-tospp v1).", whenToUse: "TBD", whenNotToUse: "TBD", options: ["appearance", "variant", "twoColumn", "heading", "subheading", "ctaLabel", "legalUrls", "successMessage", "successUrl"], supportedAppearances: ["on-light", "on-dark"], supportedVariants: ["dense", "large", "sidebar"], requiredLegalUrls: ["userAgreement", "privacyPolicy"] } }, "magento-ira-kick-article": { definitionVersion: "1", kind: "lead", flow: { type: "single" }, fields: [{ name: "firstname", required: !0, group: "name" }, { name: "lastname", required: !0, group: "name" }, { name: "email", required: !0 }, { name: "phone", required: !0 }], ctaLabel: "GET MY FREE GUIDE", consents: [{ definitionId: "lead-tcpa", definitionVersion: "2", required: !1 }], editor: { label: "Magento IRA Kick Article", description: "First name, last name, email, and phone required. Optional telephone and SMS consent checkbox with linked terms and privacy (lead-tcpa v2).", whenToUse: "TBD", whenNotToUse: "TBD", options: ["appearance", "variant", "twoColumn", "heading", "subheading", "ctaLabel", "legalUrls", "successMessage", "successUrl"], supportedAppearances: ["on-light", "on-dark"], supportedVariants: ["dense", "large", "sidebar"], requiredLegalUrls: ["userAgreement", "privacyPolicy"] } }, "magento-fik-blog-rail": { definitionVersion: "1", kind: "lead", flow: { type: "single" }, fields: [{ name: "firstname", required: !0, group: "name" }, { name: "lastname", required: !0, group: "name" }, { name: "email", required: !0 }, { name: "phone", required: !0 }], ctaLabel: "GET MY FREE GUIDE", consents: [{ definitionId: "lead-tcpa", definitionVersion: "2", required: !1 }], editor: { label: "Magento FIK Blog Rail", description: "First name, last name, email, and phone required. Optional telephone and SMS consent checkbox with linked terms and privacy (lead-tcpa v2).", whenToUse: "TBD", whenNotToUse: "TBD", options: ["appearance", "variant", "twoColumn", "heading", "subheading", "ctaLabel", "legalUrls", "successMessage", "successUrl"], supportedAppearances: ["on-light", "on-dark"], supportedVariants: ["dense", "large", "sidebar"], requiredLegalUrls: ["userAgreement", "privacyPolicy"] } }, "main-investors-kit-notice": { definitionVersion: "1", kind: "lead", flow: { type: "single" }, fields: [{ name: "firstname", required: !0, group: "name" }, { name: "lastname", required: !0, group: "name" }, { name: "email", required: !0 }, { name: "phone", required: !1 }], ctaLabel: "CLAIM YOUR OFFER", consents: [{ definitionId: "lead-clickwrap", definitionVersion: "2" }], editor: { label: "Main Investors Kit (clickwrap)", description: "First name, last name, and email required; phone optional. Clickwrap notice only (lead-clickwrap v2); no consent checkboxes.", whenToUse: "TBD", whenNotToUse: "TBD", options: ["appearance", "variant", "twoColumn", "heading", "subheading", "ctaLabel", "legalUrls", "successMessage", "successUrl"], supportedAppearances: ["on-light", "on-dark"], supportedVariants: ["dense", "large", "sidebar"], requiredLegalUrls: ["privacyPolicy", "userAgreement"] } }, newsletter: { definitionVersion: "1", kind: "newsletter", flow: { type: "single" }, fields: [{ name: "email", required: !0 }], ctaLabel: "SUBSCRIBE", editor: { label: "Newsletter", description: "Email only. No consent.", whenToUse: "TBD", whenNotToUse: "TBD", options: ["appearance", "heading", "subheading", "ctaLabel", "successMessage", "successUrl"], supportedAppearances: ["on-light", "on-dark"], supportedVariants: [], requiredLegalUrls: [] } } }, ce = { hosts: ["pwa", "wordpress"], mayProvide: ["legal document URLs", "host/store identity"], mustNotDefine: ["consent definitions", "form fields", "submission endpoints"] }, de = {
|
|
7
|
+
schemaVersion: ie,
|
|
8
|
+
package: { name: "@usgb/forms", compatiblePackageVersions: "^1.0.2" },
|
|
9
|
+
submissionContract: oe,
|
|
10
|
+
trackingRegistry: ae,
|
|
11
|
+
editorOptions: se,
|
|
12
|
+
forms: le,
|
|
13
|
+
hostAdapterContract: ce
|
|
14
|
+
}, N = de;
|
|
15
|
+
function z(t) {
|
|
16
|
+
return N.forms[t];
|
|
16
17
|
}
|
|
17
|
-
function
|
|
18
|
-
return Object.entries(
|
|
18
|
+
function je() {
|
|
19
|
+
return Object.entries(N.forms).map(([t, e]) => ({
|
|
19
20
|
formId: t,
|
|
20
21
|
definition: e
|
|
21
22
|
}));
|
|
22
23
|
}
|
|
23
|
-
function
|
|
24
|
-
|
|
24
|
+
function ze(t) {
|
|
25
|
+
const e = z(t);
|
|
26
|
+
if (!e)
|
|
27
|
+
return [];
|
|
28
|
+
const n = [];
|
|
29
|
+
for (const i of e.editor.options) {
|
|
30
|
+
const o = N.editorOptions[i];
|
|
31
|
+
if (!o)
|
|
32
|
+
continue;
|
|
33
|
+
const r = o.valuesFrom ? [...e.editor[o.valuesFrom]] : void 0;
|
|
34
|
+
r && !r.length || n.push({
|
|
35
|
+
...o,
|
|
36
|
+
key: i,
|
|
37
|
+
values: r,
|
|
38
|
+
defaultValue: o.defaultFrom ? e[o.defaultFrom] : o.default
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return n;
|
|
42
|
+
}
|
|
43
|
+
function W(t, e) {
|
|
44
|
+
return typeof t == "string" ? { content: t, language: t } : t(e);
|
|
45
|
+
}
|
|
46
|
+
function Y(t, e) {
|
|
47
|
+
return `${t}@${e}`;
|
|
25
48
|
}
|
|
26
|
-
|
|
49
|
+
function x(t) {
|
|
50
|
+
return (e) => ({
|
|
51
|
+
language: t.map(
|
|
52
|
+
(n) => typeof n == "string" ? n : `${n.label} (${e[n.href] ?? ""})`
|
|
53
|
+
).join(""),
|
|
54
|
+
content: /* @__PURE__ */ s(ee, { children: t.map(
|
|
55
|
+
(n, i) => typeof n == "string" ? n : /* @__PURE__ */ h(
|
|
56
|
+
"a",
|
|
57
|
+
{
|
|
58
|
+
href: e[n.href],
|
|
59
|
+
target: "_blank",
|
|
60
|
+
rel: "noreferrer",
|
|
61
|
+
children: [
|
|
62
|
+
n.label,
|
|
63
|
+
/* @__PURE__ */ h("span", { className: "usgb-field-label--sr-only", children: [
|
|
64
|
+
" ",
|
|
65
|
+
"(opens in a new tab)"
|
|
66
|
+
] })
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
`${n.href}-${i}`
|
|
70
|
+
)
|
|
71
|
+
) })
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
const ue = {
|
|
27
75
|
definitionId: "lead-tcpa",
|
|
28
76
|
definitionVersion: "1",
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
77
|
+
type: "checkbox",
|
|
78
|
+
name: "tcpa_form_consent_granted",
|
|
79
|
+
grantDateField: "tcpa_form_opt_in_date",
|
|
80
|
+
requiredLegalUrls: [],
|
|
81
|
+
languageKey: "tcpa_consent_language",
|
|
82
|
+
copy: "By checking, you are allowing to receive transactional/informational SMS communications regarding account notifications, customer care, etc, from U.S. Gold Bureau. Messages frequency may vary. Data rates may apply, reply STOP to opt-out"
|
|
83
|
+
}, me = {
|
|
84
|
+
definitionId: "lead-tcpa",
|
|
85
|
+
definitionVersion: "2",
|
|
86
|
+
type: "checkbox",
|
|
87
|
+
name: "tcpa_form_consent_granted",
|
|
88
|
+
grantDateField: "tcpa_form_opt_in_date",
|
|
89
|
+
requiredLegalUrls: ["userAgreement", "privacyPolicy"],
|
|
90
|
+
languageKey: "tcpa_consent_language",
|
|
91
|
+
copy: x([
|
|
92
|
+
"By checking the box you authorize United States Gold Bureau to provide you with telephone calls or SMS messages at the phone number provided, including the use of automatic telephone dialing systems, and you agree to our ",
|
|
93
|
+
{ href: "userAgreement", label: "terms and conditions" },
|
|
94
|
+
" and ",
|
|
95
|
+
{ href: "privacyPolicy", label: "privacy policy" },
|
|
96
|
+
". Calls are recorded and may be monitored."
|
|
97
|
+
])
|
|
98
|
+
}, pe = {
|
|
99
|
+
definitionId: "lead-sms",
|
|
100
|
+
definitionVersion: "1",
|
|
101
|
+
type: "checkbox",
|
|
102
|
+
name: "sms_form_consent_granted",
|
|
103
|
+
requiredLegalUrls: [],
|
|
104
|
+
languageKey: "sms_consent_language",
|
|
105
|
+
copy: "By checking, you are allowing to receive promotional/marketing SMS communications from U.S. Gold Bureau. Frequency may vary. Data rates may apply. Reply HELP for help or STOP to opt-out."
|
|
106
|
+
}, fe = {
|
|
107
|
+
definitionId: "lead-tospp",
|
|
108
|
+
definitionVersion: "1",
|
|
109
|
+
type: "checkbox",
|
|
110
|
+
name: "tospp_form_consent_granted",
|
|
111
|
+
requiredLegalUrls: ["userAgreement", "privacyPolicy"],
|
|
112
|
+
languageKey: "tospp_consent_language",
|
|
113
|
+
copy: x([
|
|
114
|
+
"By checking, I accept ",
|
|
115
|
+
{ href: "userAgreement", label: "Terms of Conditions" },
|
|
116
|
+
" & ",
|
|
117
|
+
{ href: "privacyPolicy", label: "Privacy Policy" },
|
|
118
|
+
"."
|
|
119
|
+
])
|
|
120
|
+
}, ge = {
|
|
64
121
|
definitionId: "lead-clickwrap",
|
|
65
122
|
definitionVersion: "1",
|
|
123
|
+
type: "notice",
|
|
66
124
|
requiredLegalUrls: [
|
|
67
125
|
"privacyPolicy",
|
|
68
126
|
"userAgreement",
|
|
@@ -70,99 +128,123 @@ const D = {
|
|
|
70
128
|
"electronicDisclaimer",
|
|
71
129
|
"termsOfSale"
|
|
72
130
|
],
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
" ",
|
|
101
|
-
/* @__PURE__ */ s(
|
|
102
|
-
"a",
|
|
103
|
-
{
|
|
104
|
-
href: t.marketLossPolicy,
|
|
105
|
-
target: "_blank",
|
|
106
|
-
rel: "noreferrer",
|
|
107
|
-
children: "Market Loss Policy"
|
|
108
|
-
}
|
|
109
|
-
),
|
|
110
|
-
",",
|
|
111
|
-
" ",
|
|
112
|
-
/* @__PURE__ */ s(
|
|
113
|
-
"a",
|
|
114
|
-
{
|
|
115
|
-
href: t.electronicDisclaimer,
|
|
116
|
-
target: "_blank",
|
|
117
|
-
rel: "noreferrer",
|
|
118
|
-
children: "Electronic Disclaimer"
|
|
119
|
-
}
|
|
120
|
-
),
|
|
121
|
-
" ",
|
|
122
|
-
"and",
|
|
123
|
-
" ",
|
|
124
|
-
/* @__PURE__ */ s("a", { href: t.termsOfSale, target: "_blank", rel: "noreferrer", children: "Terms & Conditions of Sale" }),
|
|
125
|
-
"."
|
|
126
|
-
] })
|
|
127
|
-
}
|
|
128
|
-
]
|
|
129
|
-
}, ge = {
|
|
130
|
-
[`${D.definitionId}@${D.definitionVersion}`]: D,
|
|
131
|
-
[`${$.definitionId}@${$.definitionVersion}`]: $
|
|
131
|
+
languageKey: "clickwrap_consent_language",
|
|
132
|
+
copy: x([
|
|
133
|
+
"By clicking the button, I agree to be bound by your ",
|
|
134
|
+
{ href: "privacyPolicy", label: "Privacy Policy" },
|
|
135
|
+
", ",
|
|
136
|
+
{ href: "userAgreement", label: "User Agreement" },
|
|
137
|
+
", ",
|
|
138
|
+
{ href: "marketLossPolicy", label: "Market Loss Policy" },
|
|
139
|
+
", ",
|
|
140
|
+
{ href: "electronicDisclaimer", label: "Electronic Disclaimer" },
|
|
141
|
+
" and ",
|
|
142
|
+
{ href: "termsOfSale", label: "Terms & Conditions of Sale" },
|
|
143
|
+
"."
|
|
144
|
+
])
|
|
145
|
+
}, he = {
|
|
146
|
+
definitionId: "lead-clickwrap",
|
|
147
|
+
definitionVersion: "2",
|
|
148
|
+
type: "notice",
|
|
149
|
+
requiredLegalUrls: ["privacyPolicy", "userAgreement"],
|
|
150
|
+
languageKey: "clickwrap_consent_language",
|
|
151
|
+
copy: x([
|
|
152
|
+
"By submitting, you agree to United States Gold Bureau’s ",
|
|
153
|
+
{ href: "privacyPolicy", label: "Privacy Policy" },
|
|
154
|
+
" and ",
|
|
155
|
+
{ href: "userAgreement", label: "Terms & Conditions" },
|
|
156
|
+
", including dispute resolution, and consent to receive texts and calls for informational, marketing and sales purposes, even if your number is on a do not call list, using automated dialing, voice or AI tech. Consent not required for purchase. Msg & data rates may apply. Calls may be recorded and monitored. Opt out anytime."
|
|
157
|
+
])
|
|
132
158
|
};
|
|
133
|
-
function
|
|
134
|
-
return
|
|
159
|
+
function be(...t) {
|
|
160
|
+
return Object.fromEntries(
|
|
161
|
+
t.map((e) => [
|
|
162
|
+
Y(e.definitionId, e.definitionVersion),
|
|
163
|
+
e
|
|
164
|
+
])
|
|
165
|
+
);
|
|
135
166
|
}
|
|
136
|
-
|
|
167
|
+
const ye = be(
|
|
168
|
+
ue,
|
|
169
|
+
me,
|
|
170
|
+
pe,
|
|
171
|
+
fe,
|
|
172
|
+
ge,
|
|
173
|
+
he
|
|
174
|
+
);
|
|
175
|
+
function ve(t, e) {
|
|
176
|
+
return ye[Y(t, e)];
|
|
177
|
+
}
|
|
178
|
+
function H(t) {
|
|
179
|
+
if (!(t != null && t.length))
|
|
180
|
+
return [];
|
|
181
|
+
const e = [];
|
|
182
|
+
for (const n of t) {
|
|
183
|
+
const i = ve(
|
|
184
|
+
n.definitionId,
|
|
185
|
+
n.definitionVersion
|
|
186
|
+
);
|
|
187
|
+
if (!i)
|
|
188
|
+
return null;
|
|
189
|
+
e.push(
|
|
190
|
+
i.type === "checkbox" ? { ...i, required: !!n.required } : i
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
return e;
|
|
194
|
+
}
|
|
195
|
+
function ke(t, e, n, i) {
|
|
196
|
+
if (!t.length)
|
|
197
|
+
return;
|
|
198
|
+
const o = {};
|
|
199
|
+
for (const r of t) {
|
|
200
|
+
const { language: l } = W(r.copy, n);
|
|
201
|
+
if (o[r.languageKey] = l, r.type === "checkbox") {
|
|
202
|
+
const a = !!e[r.name];
|
|
203
|
+
o[r.name] = a, a && r.grantDateField && (o[r.grantDateField] = i);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
return o;
|
|
207
|
+
}
|
|
208
|
+
function we(t) {
|
|
209
|
+
const e = /* @__PURE__ */ new Set();
|
|
210
|
+
for (const n of t)
|
|
211
|
+
for (const i of n.requiredLegalUrls)
|
|
212
|
+
e.add(i);
|
|
213
|
+
return [...e];
|
|
214
|
+
}
|
|
215
|
+
function qe(t) {
|
|
216
|
+
return t.type === "checkbox";
|
|
217
|
+
}
|
|
218
|
+
function $(t) {
|
|
137
219
|
return (e, n) => n ? e.trim().length > 0 || `${t} is required` : !0;
|
|
138
220
|
}
|
|
139
|
-
const
|
|
140
|
-
function
|
|
221
|
+
const _e = /^[2-9]\d{2}[2-9]\d{6}$/;
|
|
222
|
+
function Z(t) {
|
|
141
223
|
let e = t.replace(/\D/g, "");
|
|
142
|
-
return e.length === 11 && e.startsWith("1") && (e = e.slice(1)), e.length !== 10 || !
|
|
224
|
+
return e.length === 11 && e.startsWith("1") && (e = e.slice(1)), e.length !== 10 || !_e.test(e) ? null : e;
|
|
143
225
|
}
|
|
144
|
-
function
|
|
226
|
+
function Le(t) {
|
|
145
227
|
const e = t.trim();
|
|
146
228
|
if (!e) return "";
|
|
147
|
-
const n =
|
|
229
|
+
const n = Z(e);
|
|
148
230
|
if (!n) return e;
|
|
149
|
-
const
|
|
150
|
-
return
|
|
231
|
+
const i = e.replace(/\D/g, "");
|
|
232
|
+
return i.length === 11 && i.startsWith("1") ? `1${n}` : n;
|
|
151
233
|
}
|
|
152
|
-
const
|
|
234
|
+
const Se = {
|
|
153
235
|
firstname: {
|
|
154
236
|
name: "firstname",
|
|
155
237
|
control: "text",
|
|
156
238
|
label: "First name",
|
|
157
239
|
autoComplete: "given-name",
|
|
158
|
-
validate:
|
|
240
|
+
validate: $("First name")
|
|
159
241
|
},
|
|
160
242
|
lastname: {
|
|
161
243
|
name: "lastname",
|
|
162
244
|
control: "text",
|
|
163
245
|
label: "Last name",
|
|
164
246
|
autoComplete: "family-name",
|
|
165
|
-
validate:
|
|
247
|
+
validate: $("Last name")
|
|
166
248
|
},
|
|
167
249
|
email: {
|
|
168
250
|
name: "email",
|
|
@@ -171,7 +253,7 @@ const be = {
|
|
|
171
253
|
autoComplete: "email",
|
|
172
254
|
validate: (t, e) => {
|
|
173
255
|
const n = t.trim();
|
|
174
|
-
return n ?
|
|
256
|
+
return n ? ne(n) || "Enter a valid email" : e ? "Email is required" : !0;
|
|
175
257
|
}
|
|
176
258
|
},
|
|
177
259
|
phone: {
|
|
@@ -181,20 +263,21 @@ const be = {
|
|
|
181
263
|
autoComplete: "tel",
|
|
182
264
|
validate: (t, e) => {
|
|
183
265
|
const n = t.trim();
|
|
184
|
-
return n ?
|
|
266
|
+
return n ? Z(n) ? !0 : "Enter a valid phone number" : e ? "Phone is required" : !0;
|
|
185
267
|
},
|
|
186
|
-
serialize:
|
|
268
|
+
serialize: Le
|
|
187
269
|
}
|
|
188
270
|
};
|
|
189
|
-
function
|
|
190
|
-
return
|
|
271
|
+
function B(t) {
|
|
272
|
+
return Se[t];
|
|
191
273
|
}
|
|
192
|
-
function
|
|
274
|
+
function J({
|
|
193
275
|
className: t,
|
|
194
276
|
appearance: e,
|
|
195
277
|
variantValue: n,
|
|
278
|
+
twoColumn: i,
|
|
196
279
|
kind: o,
|
|
197
|
-
children:
|
|
280
|
+
children: r
|
|
198
281
|
}) {
|
|
199
282
|
return /* @__PURE__ */ s(
|
|
200
283
|
"div",
|
|
@@ -202,196 +285,137 @@ function R({
|
|
|
202
285
|
className: `usgb-form ${t ?? ""}`,
|
|
203
286
|
"data-appearance": e,
|
|
204
287
|
...n ? { "data-variant": n } : {},
|
|
288
|
+
...i ? { "data-layout": "two-column" } : {},
|
|
205
289
|
"data-kind": o,
|
|
206
|
-
children:
|
|
290
|
+
children: r
|
|
207
291
|
}
|
|
208
292
|
);
|
|
209
293
|
}
|
|
210
|
-
|
|
211
|
-
"hubspot_utk",
|
|
212
|
-
"ga_client_id",
|
|
213
|
-
"ga_session_id",
|
|
214
|
-
"snowplow_id",
|
|
215
|
-
"vwo_uuid"
|
|
216
|
-
];
|
|
217
|
-
function L(t, e) {
|
|
218
|
-
return t === "collected" && e != null && e !== "" ? { status: "collected", value: e } : { status: t };
|
|
219
|
-
}
|
|
220
|
-
function ke(t) {
|
|
221
|
-
const { trackingFields: e, trackingRegistry: n, adapter: o } = t, l = o.getTrackingHints(), a = {};
|
|
222
|
-
for (const i of e) {
|
|
223
|
-
const r = n[i];
|
|
224
|
-
if (!r) continue;
|
|
225
|
-
const c = new Set(r.states);
|
|
226
|
-
if (r.collection === "server") {
|
|
227
|
-
a[i] = L("unavailable");
|
|
228
|
-
continue;
|
|
229
|
-
}
|
|
230
|
-
if (r.collection === "browser") {
|
|
231
|
-
if (i === "referrer" && typeof document < "u") {
|
|
232
|
-
const f = document.referrer;
|
|
233
|
-
a[i] = f ? L("collected", f) : L("unavailable");
|
|
234
|
-
} else
|
|
235
|
-
a[i] = L("unavailable");
|
|
236
|
-
continue;
|
|
237
|
-
}
|
|
238
|
-
const d = l[i];
|
|
239
|
-
if (d != null && d !== "") {
|
|
240
|
-
a[i] = L("collected", d);
|
|
241
|
-
continue;
|
|
242
|
-
}
|
|
243
|
-
if (_e.includes(i) && c.has("consent-withheld")) {
|
|
244
|
-
a[i] = L("unavailable");
|
|
245
|
-
continue;
|
|
246
|
-
}
|
|
247
|
-
a[i] = L("unavailable");
|
|
248
|
-
}
|
|
249
|
-
return a;
|
|
250
|
-
}
|
|
251
|
-
function we() {
|
|
294
|
+
function Ce() {
|
|
252
295
|
return typeof crypto < "u" && "randomUUID" in crypto ? crypto.randomUUID() : `usgb-${Date.now()}-${Math.random().toString(36).slice(2, 10)}`;
|
|
253
296
|
}
|
|
254
|
-
function
|
|
297
|
+
function Ue(t, e) {
|
|
255
298
|
const n = {};
|
|
256
|
-
for (const
|
|
257
|
-
n[
|
|
258
|
-
for (const
|
|
259
|
-
n[
|
|
299
|
+
for (const i of t)
|
|
300
|
+
n[i.name] = "";
|
|
301
|
+
for (const i of e)
|
|
302
|
+
n[i] = !1;
|
|
260
303
|
return n;
|
|
261
304
|
}
|
|
262
305
|
function M(t) {
|
|
263
306
|
const e = t == null ? void 0 : t.trim();
|
|
264
307
|
return e || void 0;
|
|
265
308
|
}
|
|
266
|
-
function
|
|
309
|
+
function Pe({
|
|
267
310
|
formId: t,
|
|
268
311
|
definition: e,
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
successUrl: a,
|
|
273
|
-
adapter: i,
|
|
312
|
+
legalUrls: n,
|
|
313
|
+
successUrl: i,
|
|
314
|
+
adapter: o,
|
|
274
315
|
analytics: r,
|
|
275
|
-
onAccepted:
|
|
276
|
-
onFailed:
|
|
316
|
+
onAccepted: l,
|
|
317
|
+
onFailed: a
|
|
277
318
|
}) {
|
|
278
|
-
const
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
)
|
|
282
|
-
() => (
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
() => g.map((_) => _.name),
|
|
288
|
-
[g]
|
|
289
|
-
), m = P(
|
|
290
|
-
() => ye(e.fields, w),
|
|
291
|
-
[e.fields, w]
|
|
319
|
+
const d = K(), u = D(
|
|
320
|
+
() => H(e.consents) ?? [],
|
|
321
|
+
[e.consents]
|
|
322
|
+
), f = D(
|
|
323
|
+
() => u.filter(qe).map((p) => p.name),
|
|
324
|
+
[u]
|
|
325
|
+
), b = D(
|
|
326
|
+
() => Ue(e.fields, f),
|
|
327
|
+
[e.fields, f]
|
|
292
328
|
), {
|
|
293
|
-
register:
|
|
294
|
-
handleSubmit:
|
|
295
|
-
formState: { errors:
|
|
296
|
-
} =
|
|
297
|
-
defaultValues:
|
|
298
|
-
}), [
|
|
299
|
-
|
|
329
|
+
register: g,
|
|
330
|
+
handleSubmit: C,
|
|
331
|
+
formState: { errors: w }
|
|
332
|
+
} = re({
|
|
333
|
+
defaultValues: b
|
|
334
|
+
}), [m, _] = te({ kind: "idle" }), y = G(!1);
|
|
335
|
+
j(() => {
|
|
300
336
|
r == null || r({ type: "view", formId: t });
|
|
301
337
|
}, [r, t]);
|
|
302
|
-
const
|
|
303
|
-
const
|
|
304
|
-
for (const
|
|
305
|
-
|
|
306
|
-
for (const
|
|
307
|
-
|
|
308
|
-
return
|
|
309
|
-
}, [
|
|
310
|
-
const
|
|
311
|
-
|
|
338
|
+
const c = D(() => {
|
|
339
|
+
const p = {};
|
|
340
|
+
for (const k of e.fields)
|
|
341
|
+
p[k.name] = `${d}-${k.name}`;
|
|
342
|
+
for (const k of f)
|
|
343
|
+
p[k] = `${d}-${k}`;
|
|
344
|
+
return p;
|
|
345
|
+
}, [d, e.fields, f]), v = D(() => {
|
|
346
|
+
const p = {};
|
|
347
|
+
for (const k of u)
|
|
348
|
+
k.type === "notice" && (p[k.definitionId] = `${d}-notice-${k.definitionId}`);
|
|
349
|
+
return p;
|
|
350
|
+
}, [d, u]), U = C(
|
|
351
|
+
async (p) => {
|
|
352
|
+
if (y.current)
|
|
353
|
+
return;
|
|
354
|
+
y.current = !0, _({ kind: "submitting" }), r == null || r({ type: "submit_attempt", formId: t });
|
|
355
|
+
const q = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), P = {};
|
|
356
|
+
for (const L of e.fields) {
|
|
357
|
+
const S = p[L.name];
|
|
358
|
+
if (typeof S != "string") {
|
|
359
|
+
P[L.name] = !!S;
|
|
360
|
+
continue;
|
|
361
|
+
}
|
|
362
|
+
const F = B(L.name);
|
|
363
|
+
P[L.name] = F != null && F.serialize ? F.serialize(S) : S.trim();
|
|
364
|
+
}
|
|
365
|
+
const E = ke(
|
|
366
|
+
u,
|
|
367
|
+
p,
|
|
368
|
+
n ?? {},
|
|
369
|
+
q
|
|
370
|
+
), I = {
|
|
371
|
+
formId: t,
|
|
372
|
+
definitionVersion: e.definitionVersion,
|
|
373
|
+
submissionContractVersion: N.submissionContract.version,
|
|
374
|
+
idempotencyKey: Ce(),
|
|
375
|
+
data: P,
|
|
376
|
+
consents: E
|
|
377
|
+
};
|
|
378
|
+
try {
|
|
379
|
+
const L = await o.submit(I);
|
|
380
|
+
if (L.status === "accepted") {
|
|
381
|
+
r == null || r({ type: "success", formId: t, status: "accepted" }), l == null || l(I), _({ kind: "accepted" });
|
|
382
|
+
const S = M(i);
|
|
383
|
+
S && typeof window < "u" && window.location.assign(S);
|
|
384
|
+
} else
|
|
385
|
+
y.current = !1, _({
|
|
386
|
+
kind: "failed",
|
|
387
|
+
message: L.message ?? "Submission failed"
|
|
388
|
+
}), r == null || r({
|
|
389
|
+
type: "failure",
|
|
390
|
+
formId: t,
|
|
391
|
+
message: L.message
|
|
392
|
+
}), a == null || a(I, L.message);
|
|
393
|
+
} catch (L) {
|
|
394
|
+
y.current = !1;
|
|
395
|
+
const S = L instanceof Error ? L.message : "Submission failed";
|
|
396
|
+
_({ kind: "failed", message: S }), r == null || r({ type: "failure", formId: t, message: S }), a == null || a(I, S);
|
|
397
|
+
}
|
|
398
|
+
},
|
|
399
|
+
(p) => {
|
|
312
400
|
r == null || r({
|
|
313
401
|
type: "validation_failure",
|
|
314
402
|
formId: t,
|
|
315
|
-
fields:
|
|
403
|
+
fields: Object.keys(p)
|
|
316
404
|
});
|
|
317
|
-
return;
|
|
318
|
-
}
|
|
319
|
-
r == null || r({ type: "submit_attempt", formId: t }), C({ kind: "submitting" });
|
|
320
|
-
const W = /* @__PURE__ */ new Date(), G = W.toISOString().slice(0, 10), ee = ke({
|
|
321
|
-
trackingFields: e.trackingFields,
|
|
322
|
-
trackingRegistry: A.trackingRegistry,
|
|
323
|
-
adapter: i
|
|
324
|
-
}), E = {};
|
|
325
|
-
for (const y of e.fields) {
|
|
326
|
-
const v = _[y.name];
|
|
327
|
-
if (typeof v != "string") {
|
|
328
|
-
E[y.name] = !!v;
|
|
329
|
-
continue;
|
|
330
|
-
}
|
|
331
|
-
const V = j(y.name);
|
|
332
|
-
E[y.name] = V != null && V.serialize ? V.serialize(v) : v.trim();
|
|
333
|
-
}
|
|
334
|
-
let H;
|
|
335
|
-
if (h && k) {
|
|
336
|
-
const y = {};
|
|
337
|
-
for (const v of g)
|
|
338
|
-
y[v.name] = !!_[v.name], E[v.name] = !!_[v.name];
|
|
339
|
-
h.submitFields.includes("tcpa_form_opt_in_date") && (y.tcpa_form_opt_in_date = G, E.tcpa_form_opt_in_date = G), H = {
|
|
340
|
-
definitionId: h.definitionId,
|
|
341
|
-
definitionVersion: h.definitionVersion,
|
|
342
|
-
values: y,
|
|
343
|
-
timestamp: W.toISOString(),
|
|
344
|
-
source: o,
|
|
345
|
-
placement: n || e.kind
|
|
346
|
-
};
|
|
347
|
-
}
|
|
348
|
-
const U = {
|
|
349
|
-
formId: t,
|
|
350
|
-
definitionVersion: e.definitionVersion,
|
|
351
|
-
submissionContractVersion: A.submissionContract.version,
|
|
352
|
-
idempotencyKey: we(),
|
|
353
|
-
data: E,
|
|
354
|
-
consent: H,
|
|
355
|
-
context: {
|
|
356
|
-
host: i.host,
|
|
357
|
-
source: o,
|
|
358
|
-
campaign: l,
|
|
359
|
-
page: typeof window < "u" ? window.location.href : void 0,
|
|
360
|
-
tracking: ee
|
|
361
|
-
}
|
|
362
|
-
};
|
|
363
|
-
try {
|
|
364
|
-
const y = await i.submit(U);
|
|
365
|
-
if (y.status === "accepted") {
|
|
366
|
-
r == null || r({ type: "success", formId: t, status: "accepted" }), c == null || c(U), C({ kind: "accepted" });
|
|
367
|
-
const v = M(a);
|
|
368
|
-
v && typeof window < "u" && window.location.assign(v);
|
|
369
|
-
} else
|
|
370
|
-
C({
|
|
371
|
-
kind: "failed",
|
|
372
|
-
message: y.message ?? "Submission failed"
|
|
373
|
-
}), r == null || r({
|
|
374
|
-
type: "failure",
|
|
375
|
-
formId: t,
|
|
376
|
-
message: y.message
|
|
377
|
-
}), d == null || d(U, y.message);
|
|
378
|
-
} catch (y) {
|
|
379
|
-
const v = y instanceof Error ? y.message : "Submission failed";
|
|
380
|
-
C({ kind: "failed", message: v }), r == null || r({ type: "failure", formId: t, message: v }), d == null || d(U, v);
|
|
381
405
|
}
|
|
382
|
-
|
|
406
|
+
);
|
|
383
407
|
return {
|
|
384
|
-
register:
|
|
385
|
-
errors:
|
|
386
|
-
fieldIds:
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
uiState:
|
|
390
|
-
onSubmit:
|
|
408
|
+
register: g,
|
|
409
|
+
errors: w,
|
|
410
|
+
fieldIds: c,
|
|
411
|
+
noticeIds: v,
|
|
412
|
+
consentDefs: u,
|
|
413
|
+
uiState: m,
|
|
414
|
+
onSubmit: U
|
|
391
415
|
};
|
|
392
416
|
}
|
|
393
|
-
function
|
|
394
|
-
return /* @__PURE__ */
|
|
417
|
+
function De() {
|
|
418
|
+
return /* @__PURE__ */ h(
|
|
395
419
|
"svg",
|
|
396
420
|
{
|
|
397
421
|
className: "usgb-field-error-icon",
|
|
@@ -423,7 +447,7 @@ function Ce() {
|
|
|
423
447
|
}
|
|
424
448
|
);
|
|
425
449
|
}
|
|
426
|
-
function
|
|
450
|
+
function Te() {
|
|
427
451
|
return /* @__PURE__ */ s(
|
|
428
452
|
"svg",
|
|
429
453
|
{
|
|
@@ -448,189 +472,201 @@ function Se() {
|
|
|
448
472
|
}
|
|
449
473
|
);
|
|
450
474
|
}
|
|
451
|
-
function
|
|
475
|
+
function O({
|
|
452
476
|
id: t,
|
|
453
477
|
message: e,
|
|
454
478
|
className: n
|
|
455
479
|
}) {
|
|
456
|
-
return e ? /* @__PURE__ */
|
|
480
|
+
return e ? /* @__PURE__ */ h(
|
|
457
481
|
"span",
|
|
458
482
|
{
|
|
459
483
|
id: t,
|
|
460
484
|
role: "alert",
|
|
461
|
-
className:
|
|
485
|
+
className: A("usgb-field-error", n),
|
|
462
486
|
children: [
|
|
463
|
-
/* @__PURE__ */ s(
|
|
487
|
+
/* @__PURE__ */ s(De, {}),
|
|
464
488
|
e
|
|
465
489
|
]
|
|
466
490
|
}
|
|
467
491
|
) : null;
|
|
468
492
|
}
|
|
469
|
-
const
|
|
470
|
-
function({ id: e, label: n, errorMessage:
|
|
471
|
-
const
|
|
472
|
-
return /* @__PURE__ */
|
|
473
|
-
/* @__PURE__ */
|
|
474
|
-
/* @__PURE__ */
|
|
493
|
+
const Ae = R(
|
|
494
|
+
function({ id: e, label: n, errorMessage: i, required: o, className: r, ...l }, a) {
|
|
495
|
+
const d = i ? `${e}-error` : void 0;
|
|
496
|
+
return /* @__PURE__ */ h("div", { className: "usgb-form-group", children: [
|
|
497
|
+
/* @__PURE__ */ h("div", { className: "usgb-consent-row", children: [
|
|
498
|
+
/* @__PURE__ */ h("span", { className: "usgb-form-checkbox-wrap", children: [
|
|
475
499
|
/* @__PURE__ */ s(
|
|
476
500
|
"input",
|
|
477
501
|
{
|
|
478
|
-
|
|
502
|
+
...l,
|
|
503
|
+
ref: a,
|
|
479
504
|
id: e,
|
|
480
505
|
type: "checkbox",
|
|
481
|
-
className:
|
|
482
|
-
"aria-invalid":
|
|
483
|
-
"aria-describedby":
|
|
484
|
-
"aria-required":
|
|
485
|
-
...i
|
|
506
|
+
className: A("usgb-form-checkbox", r),
|
|
507
|
+
"aria-invalid": i ? !0 : void 0,
|
|
508
|
+
"aria-describedby": d,
|
|
509
|
+
"aria-required": o || void 0
|
|
486
510
|
}
|
|
487
511
|
),
|
|
488
|
-
/* @__PURE__ */ s(
|
|
512
|
+
/* @__PURE__ */ s(Te, {})
|
|
489
513
|
] }),
|
|
490
|
-
/* @__PURE__ */
|
|
514
|
+
/* @__PURE__ */ h("label", { htmlFor: e, className: "usgb-consent-copy", children: [
|
|
515
|
+
n,
|
|
516
|
+
o ? /* @__PURE__ */ s(
|
|
517
|
+
"span",
|
|
518
|
+
{
|
|
519
|
+
className: "usgb-field-label-asterisk",
|
|
520
|
+
"aria-hidden": "true",
|
|
521
|
+
children: "*"
|
|
522
|
+
}
|
|
523
|
+
) : null
|
|
524
|
+
] })
|
|
491
525
|
] }),
|
|
492
|
-
/* @__PURE__ */ s(
|
|
526
|
+
/* @__PURE__ */ s(O, { id: d, message: i })
|
|
493
527
|
] });
|
|
494
528
|
}
|
|
495
|
-
), Q =
|
|
529
|
+
), Q = R(
|
|
496
530
|
function({
|
|
497
531
|
className: e,
|
|
498
532
|
variant: n = "primary",
|
|
499
|
-
loading:
|
|
500
|
-
disabled:
|
|
501
|
-
children:
|
|
502
|
-
|
|
503
|
-
|
|
533
|
+
loading: i = !1,
|
|
534
|
+
disabled: o = !1,
|
|
535
|
+
children: r,
|
|
536
|
+
onClick: l,
|
|
537
|
+
type: a = "button",
|
|
538
|
+
...d
|
|
539
|
+
}, u) {
|
|
540
|
+
const f = o || i, b = o && !i ? !0 : void 0;
|
|
504
541
|
return /* @__PURE__ */ s(
|
|
505
542
|
"button",
|
|
506
543
|
{
|
|
507
|
-
ref:
|
|
508
|
-
type:
|
|
509
|
-
className:
|
|
544
|
+
ref: u,
|
|
545
|
+
type: a,
|
|
546
|
+
className: A(
|
|
510
547
|
"usgb-btn",
|
|
511
548
|
n === "primary" && "usgb-btn-primary",
|
|
512
549
|
e
|
|
513
550
|
),
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
551
|
+
...d,
|
|
552
|
+
disabled: b,
|
|
553
|
+
"aria-disabled": f || void 0,
|
|
554
|
+
"aria-busy": i || void 0,
|
|
555
|
+
onClick: (g) => {
|
|
556
|
+
if (f) {
|
|
557
|
+
g.preventDefault();
|
|
558
|
+
return;
|
|
559
|
+
}
|
|
560
|
+
l == null || l(g);
|
|
561
|
+
},
|
|
562
|
+
children: i ? "Submitting…" : r
|
|
518
563
|
}
|
|
519
564
|
);
|
|
520
565
|
}
|
|
521
|
-
)
|
|
522
|
-
|
|
523
|
-
privacyPolicy: "/content/privacy-policy"
|
|
524
|
-
};
|
|
525
|
-
function Ne(t, e = ["clientAgreement", "privacyPolicy"]) {
|
|
526
|
-
return e.every((n) => {
|
|
527
|
-
var o;
|
|
528
|
-
return !!((o = t == null ? void 0 : t[n]) != null && o.trim());
|
|
529
|
-
});
|
|
530
|
-
}
|
|
531
|
-
function Le(t) {
|
|
566
|
+
);
|
|
567
|
+
function Ee(t) {
|
|
532
568
|
const e = [];
|
|
533
569
|
let n = 0;
|
|
534
570
|
for (; n < t.length; ) {
|
|
535
|
-
const
|
|
536
|
-
if (
|
|
537
|
-
const
|
|
538
|
-
for (; n < t.length && t[n].group ===
|
|
539
|
-
|
|
540
|
-
e.push({ type: "group", group:
|
|
571
|
+
const i = t[n];
|
|
572
|
+
if (i.group) {
|
|
573
|
+
const o = i.group, r = [];
|
|
574
|
+
for (; n < t.length && t[n].group === o; )
|
|
575
|
+
r.push(t[n]), n += 1;
|
|
576
|
+
e.push({ type: "group", group: o, fields: r });
|
|
541
577
|
continue;
|
|
542
578
|
}
|
|
543
|
-
e.push({ type: "field", field:
|
|
579
|
+
e.push({ type: "field", field: i }), n += 1;
|
|
544
580
|
}
|
|
545
581
|
return e;
|
|
546
582
|
}
|
|
547
|
-
function
|
|
583
|
+
function Ie({
|
|
548
584
|
htmlFor: t,
|
|
549
585
|
children: e,
|
|
550
586
|
className: n,
|
|
551
|
-
required:
|
|
587
|
+
required: i
|
|
552
588
|
}) {
|
|
553
|
-
return /* @__PURE__ */
|
|
589
|
+
return /* @__PURE__ */ h("label", { htmlFor: t, className: A("usgb-field-label", n), children: [
|
|
554
590
|
e,
|
|
555
|
-
|
|
591
|
+
i ? /* @__PURE__ */ s("span", { className: "usgb-field-label-asterisk", "aria-hidden": "true", children: "*" }) : null
|
|
556
592
|
] });
|
|
557
593
|
}
|
|
558
594
|
function Fe(t) {
|
|
559
595
|
return t.replace(/\b\w/g, (e) => e.toUpperCase());
|
|
560
596
|
}
|
|
561
|
-
const
|
|
597
|
+
const Ne = R(
|
|
562
598
|
function({
|
|
563
599
|
id: e,
|
|
564
600
|
label: n,
|
|
565
|
-
type:
|
|
566
|
-
errorMessage:
|
|
567
|
-
required:
|
|
568
|
-
hideLabel:
|
|
569
|
-
placeholderCase:
|
|
570
|
-
showError:
|
|
571
|
-
className:
|
|
601
|
+
type: i = "text",
|
|
602
|
+
errorMessage: o,
|
|
603
|
+
required: r,
|
|
604
|
+
hideLabel: l = !1,
|
|
605
|
+
placeholderCase: a = "upper",
|
|
606
|
+
showError: d = !0,
|
|
607
|
+
className: u,
|
|
572
608
|
placeholder: f,
|
|
573
|
-
...
|
|
574
|
-
},
|
|
575
|
-
const
|
|
576
|
-
return /* @__PURE__ */
|
|
609
|
+
...b
|
|
610
|
+
}, g) {
|
|
611
|
+
const C = o ? `${e}-error` : void 0, w = l ? `${n}${r ? "*" : ""}` : f, m = l && w ? a === "title" ? Fe(w) : w.toUpperCase() : w;
|
|
612
|
+
return /* @__PURE__ */ h("div", { className: "usgb-form-group", children: [
|
|
577
613
|
/* @__PURE__ */ s(
|
|
578
|
-
|
|
614
|
+
Ie,
|
|
579
615
|
{
|
|
580
616
|
htmlFor: e,
|
|
581
|
-
required:
|
|
582
|
-
className:
|
|
617
|
+
required: r,
|
|
618
|
+
className: l ? "usgb-field-label--sr-only" : void 0,
|
|
583
619
|
children: n
|
|
584
620
|
}
|
|
585
621
|
),
|
|
586
622
|
/* @__PURE__ */ s(
|
|
587
623
|
"input",
|
|
588
624
|
{
|
|
589
|
-
ref:
|
|
625
|
+
ref: g,
|
|
590
626
|
id: e,
|
|
591
|
-
type:
|
|
592
|
-
className:
|
|
627
|
+
type: i,
|
|
628
|
+
className: A(
|
|
593
629
|
"usgb-field-control",
|
|
594
|
-
|
|
595
|
-
|
|
630
|
+
o && "usgb-field-invalid",
|
|
631
|
+
u
|
|
596
632
|
),
|
|
597
633
|
placeholder: m,
|
|
598
|
-
"aria-invalid":
|
|
599
|
-
"aria-describedby":
|
|
600
|
-
"aria-required":
|
|
601
|
-
...
|
|
634
|
+
"aria-invalid": o ? !0 : void 0,
|
|
635
|
+
"aria-describedby": C,
|
|
636
|
+
"aria-required": r || void 0,
|
|
637
|
+
...b
|
|
602
638
|
}
|
|
603
639
|
),
|
|
604
|
-
|
|
640
|
+
d ? /* @__PURE__ */ s(O, { id: C, message: o }) : null
|
|
605
641
|
] });
|
|
606
642
|
}
|
|
607
643
|
);
|
|
608
|
-
function
|
|
644
|
+
function V({
|
|
609
645
|
fieldRef: t,
|
|
610
646
|
fieldIds: e,
|
|
611
647
|
register: n,
|
|
612
|
-
errors:
|
|
613
|
-
hideLabel:
|
|
614
|
-
placeholderCase:
|
|
615
|
-
showError:
|
|
648
|
+
errors: i,
|
|
649
|
+
hideLabel: o,
|
|
650
|
+
placeholderCase: r,
|
|
651
|
+
showError: l = !0
|
|
616
652
|
}) {
|
|
617
|
-
const
|
|
618
|
-
if (!
|
|
619
|
-
const
|
|
653
|
+
const a = B(t.name);
|
|
654
|
+
if (!a) return null;
|
|
655
|
+
const d = i[t.name], u = typeof (d == null ? void 0 : d.message) == "string" ? d.message : void 0;
|
|
620
656
|
return /* @__PURE__ */ s(
|
|
621
|
-
|
|
657
|
+
Ne,
|
|
622
658
|
{
|
|
623
659
|
id: e[t.name],
|
|
624
|
-
label:
|
|
625
|
-
type:
|
|
660
|
+
label: a.label,
|
|
661
|
+
type: a.control,
|
|
626
662
|
required: t.required,
|
|
627
|
-
hideLabel:
|
|
628
|
-
placeholderCase:
|
|
629
|
-
showError:
|
|
630
|
-
autoComplete:
|
|
631
|
-
errorMessage:
|
|
663
|
+
hideLabel: o,
|
|
664
|
+
placeholderCase: r,
|
|
665
|
+
showError: l,
|
|
666
|
+
autoComplete: a.autoComplete,
|
|
667
|
+
errorMessage: u,
|
|
632
668
|
...n(t.name, {
|
|
633
|
-
validate: (f) =>
|
|
669
|
+
validate: (f) => a.validate(
|
|
634
670
|
typeof f == "string" ? f : "",
|
|
635
671
|
t.required
|
|
636
672
|
)
|
|
@@ -640,398 +676,439 @@ function B({
|
|
|
640
676
|
}
|
|
641
677
|
function xe({
|
|
642
678
|
definition: t,
|
|
643
|
-
|
|
679
|
+
variant: e,
|
|
644
680
|
ctaLabel: n,
|
|
645
|
-
legalUrls:
|
|
646
|
-
session:
|
|
681
|
+
legalUrls: i,
|
|
682
|
+
session: o,
|
|
683
|
+
headingId: r
|
|
647
684
|
}) {
|
|
648
|
-
const {
|
|
649
|
-
|
|
685
|
+
const {
|
|
686
|
+
register: l,
|
|
687
|
+
errors: a,
|
|
688
|
+
fieldIds: d,
|
|
689
|
+
noticeIds: u,
|
|
690
|
+
consentDefs: f,
|
|
691
|
+
uiState: b,
|
|
692
|
+
onSubmit: g
|
|
693
|
+
} = o, C = D(
|
|
694
|
+
() => Ee(t.fields),
|
|
650
695
|
[t.fields]
|
|
651
|
-
),
|
|
652
|
-
return /* @__PURE__ */
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
696
|
+
), w = e === "sidebar", m = e === "dense" || w, _ = w ? "title" : "upper", y = Object.values(u).join(" ");
|
|
697
|
+
return /* @__PURE__ */ h(
|
|
698
|
+
"form",
|
|
699
|
+
{
|
|
700
|
+
onSubmit: g,
|
|
701
|
+
noValidate: !0,
|
|
702
|
+
...r ? { "aria-labelledby": r } : {},
|
|
703
|
+
children: [
|
|
704
|
+
C.map((c) => c.type === "group" ? /* @__PURE__ */ s(
|
|
705
|
+
"div",
|
|
659
706
|
{
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
707
|
+
className: "usgb-form-grid",
|
|
708
|
+
children: c.fields.map((v) => /* @__PURE__ */ s(
|
|
709
|
+
V,
|
|
710
|
+
{
|
|
711
|
+
fieldRef: v,
|
|
712
|
+
fieldIds: d,
|
|
713
|
+
register: l,
|
|
714
|
+
errors: a,
|
|
715
|
+
hideLabel: m,
|
|
716
|
+
placeholderCase: _
|
|
717
|
+
},
|
|
718
|
+
v.name
|
|
719
|
+
))
|
|
666
720
|
},
|
|
667
|
-
|
|
668
|
-
)
|
|
669
|
-
|
|
670
|
-
`group-${m.group}-${m.fields.map((u) => u.name).join("-")}`
|
|
671
|
-
) : /* @__PURE__ */ s(
|
|
672
|
-
B,
|
|
673
|
-
{
|
|
674
|
-
fieldRef: m.field,
|
|
675
|
-
fieldIds: r,
|
|
676
|
-
register: a,
|
|
677
|
-
errors: i,
|
|
678
|
-
hideLabel: g,
|
|
679
|
-
placeholderCase: w
|
|
680
|
-
},
|
|
681
|
-
m.field.name
|
|
682
|
-
)),
|
|
683
|
-
c && Ne(o, c.requiredLegalUrls) ? c.items.map((m, u) => {
|
|
684
|
-
const N = fe(
|
|
685
|
-
m.content,
|
|
686
|
-
o
|
|
687
|
-
);
|
|
688
|
-
if (m.type === "notice")
|
|
689
|
-
return /* @__PURE__ */ s(
|
|
690
|
-
"p",
|
|
721
|
+
`group-${c.group}-${c.fields.map((v) => v.name).join("-")}`
|
|
722
|
+
) : /* @__PURE__ */ s(
|
|
723
|
+
V,
|
|
691
724
|
{
|
|
692
|
-
|
|
693
|
-
|
|
725
|
+
fieldRef: c.field,
|
|
726
|
+
fieldIds: d,
|
|
727
|
+
register: l,
|
|
728
|
+
errors: a,
|
|
729
|
+
hideLabel: m,
|
|
730
|
+
placeholderCase: _
|
|
694
731
|
},
|
|
695
|
-
|
|
696
|
-
)
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
732
|
+
c.field.name
|
|
733
|
+
)),
|
|
734
|
+
f.map((c) => {
|
|
735
|
+
const { content: v } = W(
|
|
736
|
+
c.copy,
|
|
737
|
+
i ?? {}
|
|
738
|
+
);
|
|
739
|
+
if (c.type === "notice")
|
|
740
|
+
return /* @__PURE__ */ s(
|
|
741
|
+
"p",
|
|
742
|
+
{
|
|
743
|
+
id: u[c.definitionId],
|
|
744
|
+
className: "usgb-consent-copy usgb-consent-notice",
|
|
745
|
+
children: v
|
|
746
|
+
},
|
|
747
|
+
c.definitionId
|
|
748
|
+
);
|
|
749
|
+
const U = a[c.name], p = typeof (U == null ? void 0 : U.message) == "string" ? U.message : void 0;
|
|
750
|
+
return /* @__PURE__ */ s(
|
|
751
|
+
Ae,
|
|
752
|
+
{
|
|
753
|
+
id: d[c.name],
|
|
754
|
+
label: v,
|
|
755
|
+
required: c.required,
|
|
756
|
+
errorMessage: p,
|
|
757
|
+
...l(c.name, {
|
|
758
|
+
required: c.required ? "This field is required" : !1
|
|
759
|
+
})
|
|
760
|
+
},
|
|
761
|
+
c.name
|
|
762
|
+
);
|
|
763
|
+
}),
|
|
764
|
+
/* @__PURE__ */ s(
|
|
765
|
+
Q,
|
|
766
|
+
{
|
|
767
|
+
type: "submit",
|
|
768
|
+
loading: b.kind === "submitting",
|
|
769
|
+
"aria-describedby": y || void 0,
|
|
770
|
+
children: n
|
|
771
|
+
}
|
|
772
|
+
),
|
|
773
|
+
b.kind === "failed" ? /* @__PURE__ */ s(
|
|
774
|
+
"p",
|
|
775
|
+
{
|
|
776
|
+
className: "usgb-form-status usgb-form-status-error",
|
|
777
|
+
role: "alert",
|
|
778
|
+
children: b.message ?? "Something went wrong. Please try again."
|
|
779
|
+
}
|
|
780
|
+
) : null
|
|
781
|
+
]
|
|
782
|
+
}
|
|
783
|
+
);
|
|
722
784
|
}
|
|
723
|
-
function
|
|
785
|
+
function Me({
|
|
724
786
|
definition: t,
|
|
725
787
|
ctaLabel: e,
|
|
726
|
-
session: n
|
|
788
|
+
session: n,
|
|
789
|
+
headingId: i
|
|
727
790
|
}) {
|
|
728
|
-
var
|
|
729
|
-
const { register: o, errors:
|
|
730
|
-
return
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
791
|
+
var b;
|
|
792
|
+
const { register: o, errors: r, fieldIds: l, uiState: a, onSubmit: d } = n, u = t.fields.find((g) => g.name === "email"), f = typeof ((b = r.email) == null ? void 0 : b.message) == "string" ? r.email.message : void 0;
|
|
793
|
+
return u ? /* @__PURE__ */ h(
|
|
794
|
+
"form",
|
|
795
|
+
{
|
|
796
|
+
onSubmit: d,
|
|
797
|
+
noValidate: !0,
|
|
798
|
+
...i ? { "aria-labelledby": i } : {},
|
|
799
|
+
children: [
|
|
800
|
+
/* @__PURE__ */ h("div", { className: "usgb-form-inline", children: [
|
|
801
|
+
/* @__PURE__ */ s(
|
|
802
|
+
V,
|
|
803
|
+
{
|
|
804
|
+
fieldRef: u,
|
|
805
|
+
fieldIds: l,
|
|
806
|
+
register: o,
|
|
807
|
+
errors: r,
|
|
808
|
+
hideLabel: !0,
|
|
809
|
+
placeholderCase: "upper",
|
|
810
|
+
showError: !1
|
|
811
|
+
}
|
|
812
|
+
),
|
|
813
|
+
/* @__PURE__ */ s(Q, { type: "submit", loading: a.kind === "submitting", children: e })
|
|
814
|
+
] }),
|
|
815
|
+
/* @__PURE__ */ s(
|
|
816
|
+
O,
|
|
817
|
+
{
|
|
818
|
+
id: f ? `${l.email}-error` : void 0,
|
|
819
|
+
message: f
|
|
820
|
+
}
|
|
821
|
+
),
|
|
822
|
+
a.kind === "failed" ? /* @__PURE__ */ s(
|
|
823
|
+
"p",
|
|
824
|
+
{
|
|
825
|
+
className: "usgb-form-status usgb-form-status-error",
|
|
826
|
+
role: "alert",
|
|
827
|
+
children: a.message ?? "Something went wrong. Please try again."
|
|
828
|
+
}
|
|
829
|
+
) : null
|
|
830
|
+
]
|
|
831
|
+
}
|
|
832
|
+
) : /* @__PURE__ */ s("p", { className: "usgb-form-status usgb-form-status-error", role: "alert", children: "Newsletter kind requires an email field" });
|
|
762
833
|
}
|
|
763
834
|
const X = {
|
|
764
835
|
lead: xe,
|
|
765
|
-
newsletter:
|
|
766
|
-
},
|
|
767
|
-
function
|
|
836
|
+
newsletter: Me
|
|
837
|
+
}, Ve = "Thank you. Your request has been accepted and is being processed.";
|
|
838
|
+
function T({
|
|
768
839
|
className: t,
|
|
769
840
|
appearance: e,
|
|
770
841
|
variantValue: n,
|
|
842
|
+
twoColumn: i,
|
|
771
843
|
kind: o,
|
|
772
|
-
children:
|
|
844
|
+
children: r
|
|
773
845
|
}) {
|
|
774
846
|
return /* @__PURE__ */ s(
|
|
775
|
-
|
|
847
|
+
J,
|
|
776
848
|
{
|
|
777
849
|
className: t,
|
|
778
850
|
appearance: e,
|
|
779
851
|
variantValue: n,
|
|
852
|
+
twoColumn: i,
|
|
780
853
|
kind: o,
|
|
781
|
-
children: /* @__PURE__ */ s("p", { className: "usgb-form-status usgb-form-status-error", role: "alert", children:
|
|
854
|
+
children: /* @__PURE__ */ s("p", { className: "usgb-form-status usgb-form-status-error", role: "alert", children: r })
|
|
782
855
|
}
|
|
783
856
|
);
|
|
784
857
|
}
|
|
785
|
-
function
|
|
858
|
+
function Re({
|
|
786
859
|
formId: t,
|
|
787
860
|
definition: e,
|
|
788
861
|
appearance: n,
|
|
789
|
-
|
|
790
|
-
variantValue:
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
successUrl: k,
|
|
862
|
+
variant: i,
|
|
863
|
+
variantValue: o,
|
|
864
|
+
twoColumn: r,
|
|
865
|
+
heading: l,
|
|
866
|
+
subheading: a,
|
|
867
|
+
ctaLabel: d,
|
|
868
|
+
legalUrls: u,
|
|
869
|
+
successMessage: f,
|
|
870
|
+
successUrl: b,
|
|
799
871
|
adapter: g,
|
|
800
|
-
analytics:
|
|
801
|
-
className:
|
|
802
|
-
onAccepted:
|
|
803
|
-
onFailed:
|
|
872
|
+
analytics: C,
|
|
873
|
+
className: w,
|
|
874
|
+
onAccepted: m,
|
|
875
|
+
onFailed: _
|
|
804
876
|
}) {
|
|
805
|
-
const
|
|
877
|
+
const y = K(), c = l ? `${y}-heading` : void 0, v = G(null), U = Pe({
|
|
806
878
|
formId: t,
|
|
807
879
|
definition: e,
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
campaign: d,
|
|
811
|
-
successUrl: k,
|
|
880
|
+
legalUrls: u,
|
|
881
|
+
successUrl: b,
|
|
812
882
|
adapter: g,
|
|
813
|
-
analytics:
|
|
814
|
-
onAccepted:
|
|
815
|
-
onFailed:
|
|
816
|
-
});
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
variantValue: l,
|
|
825
|
-
kind: e.kind,
|
|
826
|
-
children: [
|
|
827
|
-
a ? /* @__PURE__ */ s("h2", { className: "usgb-form-heading", children: a }) : null,
|
|
828
|
-
C ? null : /* @__PURE__ */ s(
|
|
829
|
-
"p",
|
|
830
|
-
{
|
|
831
|
-
className: "usgb-form-status usgb-form-status-success",
|
|
832
|
-
role: "status",
|
|
833
|
-
children: M(h) ?? Te
|
|
834
|
-
}
|
|
835
|
-
)
|
|
836
|
-
]
|
|
837
|
-
}
|
|
838
|
-
);
|
|
839
|
-
}
|
|
840
|
-
const q = X[e.kind];
|
|
841
|
-
return /* @__PURE__ */ p(
|
|
842
|
-
R,
|
|
883
|
+
analytics: C,
|
|
884
|
+
onAccepted: m,
|
|
885
|
+
onFailed: _
|
|
886
|
+
}), p = U.uiState.kind === "accepted", k = p && !!M(b), q = p && !k ? M(f) ?? Ve : "";
|
|
887
|
+
j(() => {
|
|
888
|
+
var E;
|
|
889
|
+
q && ((E = v.current) == null || E.focus());
|
|
890
|
+
}, [q]);
|
|
891
|
+
const P = X[e.kind];
|
|
892
|
+
return /* @__PURE__ */ h(
|
|
893
|
+
J,
|
|
843
894
|
{
|
|
844
|
-
className:
|
|
895
|
+
className: w,
|
|
845
896
|
appearance: n,
|
|
846
|
-
variantValue:
|
|
897
|
+
variantValue: o,
|
|
898
|
+
twoColumn: r,
|
|
847
899
|
kind: e.kind,
|
|
848
900
|
children: [
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
/* @__PURE__ */ s(
|
|
852
|
-
|
|
901
|
+
l ? /* @__PURE__ */ s("h2", { id: c, className: "usgb-form-heading", children: l }) : null,
|
|
902
|
+
!p && a ? /* @__PURE__ */ s("p", { className: "usgb-form-subheading", children: a }) : null,
|
|
903
|
+
p ? null : /* @__PURE__ */ s(
|
|
904
|
+
P,
|
|
853
905
|
{
|
|
854
906
|
definition: e,
|
|
855
|
-
|
|
856
|
-
ctaLabel:
|
|
857
|
-
legalUrls:
|
|
858
|
-
session:
|
|
907
|
+
variant: i,
|
|
908
|
+
ctaLabel: d,
|
|
909
|
+
legalUrls: u,
|
|
910
|
+
session: U,
|
|
911
|
+
headingId: c
|
|
912
|
+
}
|
|
913
|
+
),
|
|
914
|
+
/* @__PURE__ */ s(
|
|
915
|
+
"p",
|
|
916
|
+
{
|
|
917
|
+
ref: v,
|
|
918
|
+
className: q ? "usgb-form-status usgb-form-status-success" : "usgb-field-label--sr-only",
|
|
919
|
+
role: "status",
|
|
920
|
+
"aria-live": "polite",
|
|
921
|
+
tabIndex: q ? -1 : void 0,
|
|
922
|
+
children: q
|
|
859
923
|
}
|
|
860
924
|
)
|
|
861
925
|
]
|
|
862
926
|
}
|
|
863
927
|
);
|
|
864
928
|
}
|
|
865
|
-
function
|
|
929
|
+
function We({
|
|
866
930
|
formId: t,
|
|
867
931
|
appearance: e = "on-light",
|
|
868
|
-
|
|
932
|
+
variant: n = "dense",
|
|
933
|
+
twoColumn: i = !1,
|
|
869
934
|
heading: o,
|
|
870
|
-
subheading:
|
|
871
|
-
ctaLabel:
|
|
872
|
-
|
|
873
|
-
campaign: r,
|
|
874
|
-
legalUrls: c,
|
|
935
|
+
subheading: r,
|
|
936
|
+
ctaLabel: l,
|
|
937
|
+
legalUrls: a,
|
|
875
938
|
successMessage: d,
|
|
876
|
-
successUrl:
|
|
877
|
-
adapter:
|
|
878
|
-
analytics:
|
|
939
|
+
successUrl: u,
|
|
940
|
+
adapter: f,
|
|
941
|
+
analytics: b,
|
|
879
942
|
className: g,
|
|
880
|
-
onAccepted:
|
|
881
|
-
onFailed:
|
|
943
|
+
onAccepted: C,
|
|
944
|
+
onFailed: w
|
|
882
945
|
}) {
|
|
883
|
-
const
|
|
884
|
-
if (!
|
|
885
|
-
return /* @__PURE__ */
|
|
886
|
-
|
|
946
|
+
const m = z(t), _ = (m == null ? void 0 : m.kind) === "newsletter", y = _ ? "" : n, c = !_ && i;
|
|
947
|
+
if (!m)
|
|
948
|
+
return /* @__PURE__ */ h(
|
|
949
|
+
T,
|
|
887
950
|
{
|
|
888
951
|
className: g,
|
|
889
952
|
appearance: e,
|
|
890
|
-
variantValue:
|
|
953
|
+
variantValue: y,
|
|
954
|
+
twoColumn: c,
|
|
891
955
|
children: [
|
|
892
956
|
"Unknown form definition: ",
|
|
893
957
|
t
|
|
894
958
|
]
|
|
895
959
|
}
|
|
896
960
|
);
|
|
897
|
-
const
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
if (q && !C)
|
|
902
|
-
return /* @__PURE__ */ p(
|
|
903
|
-
F,
|
|
961
|
+
const v = H(m.consents);
|
|
962
|
+
if (v === null)
|
|
963
|
+
return /* @__PURE__ */ h(
|
|
964
|
+
T,
|
|
904
965
|
{
|
|
905
966
|
className: g,
|
|
906
967
|
appearance: e,
|
|
907
|
-
variantValue:
|
|
908
|
-
|
|
968
|
+
variantValue: y,
|
|
969
|
+
twoColumn: c,
|
|
970
|
+
kind: m.kind,
|
|
909
971
|
children: [
|
|
910
972
|
"Missing consent definition for ",
|
|
911
973
|
t
|
|
912
974
|
]
|
|
913
975
|
}
|
|
914
976
|
);
|
|
915
|
-
const
|
|
916
|
-
(
|
|
917
|
-
var
|
|
918
|
-
return !((
|
|
977
|
+
const p = we(v).filter(
|
|
978
|
+
(q) => {
|
|
979
|
+
var P;
|
|
980
|
+
return !((P = a == null ? void 0 : a[q]) != null && P.trim());
|
|
919
981
|
}
|
|
920
|
-
)
|
|
921
|
-
if (
|
|
922
|
-
return /* @__PURE__ */
|
|
923
|
-
|
|
982
|
+
);
|
|
983
|
+
if (p.length)
|
|
984
|
+
return /* @__PURE__ */ h(
|
|
985
|
+
T,
|
|
924
986
|
{
|
|
925
987
|
className: g,
|
|
926
988
|
appearance: e,
|
|
927
|
-
variantValue:
|
|
928
|
-
|
|
989
|
+
variantValue: y,
|
|
990
|
+
twoColumn: c,
|
|
991
|
+
kind: m.kind,
|
|
929
992
|
children: [
|
|
930
993
|
"Missing legal URL(s) for ",
|
|
931
994
|
t,
|
|
932
995
|
": ",
|
|
933
|
-
|
|
996
|
+
p.join(", ")
|
|
934
997
|
]
|
|
935
998
|
}
|
|
936
999
|
);
|
|
937
|
-
const
|
|
938
|
-
(
|
|
1000
|
+
const k = m.fields.filter(
|
|
1001
|
+
(q) => !B(q.name)
|
|
939
1002
|
);
|
|
940
|
-
return
|
|
941
|
-
|
|
1003
|
+
return k.length ? /* @__PURE__ */ h(
|
|
1004
|
+
T,
|
|
942
1005
|
{
|
|
943
1006
|
className: g,
|
|
944
1007
|
appearance: e,
|
|
945
|
-
variantValue:
|
|
946
|
-
|
|
1008
|
+
variantValue: y,
|
|
1009
|
+
twoColumn: c,
|
|
1010
|
+
kind: m.kind,
|
|
947
1011
|
children: [
|
|
948
1012
|
"Unknown field(s) in ",
|
|
949
1013
|
t,
|
|
950
1014
|
":",
|
|
951
1015
|
" ",
|
|
952
|
-
|
|
1016
|
+
k.map((q) => q.name).join(", ")
|
|
953
1017
|
]
|
|
954
1018
|
}
|
|
955
|
-
) :
|
|
956
|
-
|
|
1019
|
+
) : m.kind in X ? /* @__PURE__ */ s(
|
|
1020
|
+
Re,
|
|
957
1021
|
{
|
|
958
1022
|
formId: t,
|
|
959
|
-
definition:
|
|
1023
|
+
definition: m,
|
|
960
1024
|
appearance: e,
|
|
961
|
-
|
|
962
|
-
variantValue:
|
|
1025
|
+
variant: n,
|
|
1026
|
+
variantValue: y,
|
|
1027
|
+
twoColumn: c,
|
|
963
1028
|
heading: o,
|
|
964
|
-
subheading:
|
|
965
|
-
ctaLabel:
|
|
966
|
-
|
|
967
|
-
campaign: r,
|
|
968
|
-
legalUrls: c,
|
|
1029
|
+
subheading: r,
|
|
1030
|
+
ctaLabel: l ?? m.ctaLabel,
|
|
1031
|
+
legalUrls: a,
|
|
969
1032
|
successMessage: d,
|
|
970
|
-
successUrl:
|
|
971
|
-
adapter:
|
|
972
|
-
analytics:
|
|
1033
|
+
successUrl: u,
|
|
1034
|
+
adapter: f,
|
|
1035
|
+
analytics: b,
|
|
973
1036
|
className: g,
|
|
974
|
-
onAccepted:
|
|
975
|
-
onFailed:
|
|
1037
|
+
onAccepted: C,
|
|
1038
|
+
onFailed: w
|
|
976
1039
|
}
|
|
977
|
-
) : /* @__PURE__ */
|
|
978
|
-
|
|
1040
|
+
) : /* @__PURE__ */ h(
|
|
1041
|
+
T,
|
|
979
1042
|
{
|
|
980
1043
|
className: g,
|
|
981
1044
|
appearance: e,
|
|
982
|
-
variantValue:
|
|
983
|
-
|
|
1045
|
+
variantValue: y,
|
|
1046
|
+
twoColumn: c,
|
|
1047
|
+
kind: m.kind,
|
|
984
1048
|
children: [
|
|
985
1049
|
"Missing renderer for kind: ",
|
|
986
|
-
|
|
1050
|
+
m.kind
|
|
987
1051
|
]
|
|
988
1052
|
}
|
|
989
1053
|
);
|
|
990
1054
|
}
|
|
991
|
-
function
|
|
992
|
-
const e = typeof t == "string" ? { host: t } : t, n = e.host ?? "pwa",
|
|
1055
|
+
function Ye(t = {}) {
|
|
1056
|
+
const e = typeof t == "string" ? { host: t } : t, n = e.host ?? "pwa", i = e.delayMs ?? 400, o = e.result ?? { status: "accepted" };
|
|
993
1057
|
return {
|
|
994
1058
|
host: n,
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
return {
|
|
999
|
-
utm_source: i("utm_source"),
|
|
1000
|
-
utm_medium: i("utm_medium"),
|
|
1001
|
-
utm_campaign: i("utm_campaign"),
|
|
1002
|
-
utm_term: i("utm_term"),
|
|
1003
|
-
utm_content: i("utm_content"),
|
|
1004
|
-
gclid: i("gclid"),
|
|
1005
|
-
msclkid: i("msclkid"),
|
|
1006
|
-
gbraid: i("gbraid"),
|
|
1007
|
-
wbraid: i("wbraid")
|
|
1008
|
-
};
|
|
1009
|
-
},
|
|
1010
|
-
async submit(a) {
|
|
1011
|
-
var i;
|
|
1012
|
-
return (i = e.onSubmit) == null || i.call(e, a), await new Promise((r) => setTimeout(r, o)), l;
|
|
1059
|
+
async submit(r) {
|
|
1060
|
+
var l;
|
|
1061
|
+
return (l = e.onSubmit) == null || l.call(e, r), await new Promise((a) => setTimeout(a, i)), o;
|
|
1013
1062
|
}
|
|
1014
1063
|
};
|
|
1015
1064
|
}
|
|
1065
|
+
const He = {
|
|
1066
|
+
clientAgreement: "client-agreement-url",
|
|
1067
|
+
privacyPolicy: "privacy-policy-url",
|
|
1068
|
+
userAgreement: "user-agreement-url",
|
|
1069
|
+
marketLossPolicy: "market-loss-policy-url",
|
|
1070
|
+
electronicDisclaimer: "electronic-disclaimer-url",
|
|
1071
|
+
termsOfSale: "terms-of-sale-url"
|
|
1072
|
+
}, Ze = {
|
|
1073
|
+
clientAgreement: "/content/client-agreement",
|
|
1074
|
+
privacyPolicy: "/content/privacy-policy",
|
|
1075
|
+
userAgreement: "/content/user-agreement",
|
|
1076
|
+
marketLossPolicy: "/content/market-loss-policy",
|
|
1077
|
+
electronicDisclaimer: "/content/electronic-disclaimer",
|
|
1078
|
+
termsOfSale: "/content/terms-of-sale"
|
|
1079
|
+
};
|
|
1080
|
+
function Je(t, e) {
|
|
1081
|
+
return e.every((n) => {
|
|
1082
|
+
var i;
|
|
1083
|
+
return !!((i = t == null ? void 0 : t[n]) != null && i.trim());
|
|
1084
|
+
});
|
|
1085
|
+
}
|
|
1016
1086
|
export {
|
|
1017
1087
|
Q as Button,
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1088
|
+
Ae as ConsentField,
|
|
1089
|
+
Se as FIELD_REGISTRY,
|
|
1090
|
+
O as FieldError,
|
|
1091
|
+
Ie as FieldLabel,
|
|
1092
|
+
ge as LEAD_CLICKWRAP,
|
|
1093
|
+
he as LEAD_CLICKWRAP_V2,
|
|
1094
|
+
pe as LEAD_SMS,
|
|
1095
|
+
ue as LEAD_TCPA,
|
|
1096
|
+
me as LEAD_TCPA_V2,
|
|
1097
|
+
fe as LEAD_TOSPP,
|
|
1098
|
+
He as LEGAL_URL_ATTRS,
|
|
1099
|
+
Ze as PWA_LEGAL_URLS,
|
|
1100
|
+
Ne as TextField,
|
|
1101
|
+
We as UsgbForm,
|
|
1102
|
+
we as collectRequiredLegalUrls,
|
|
1103
|
+
Ce as createIdempotencyKey,
|
|
1104
|
+
Ye as createStubAdapter,
|
|
1105
|
+
N as formsManifest,
|
|
1106
|
+
ve as getConsentDefinition,
|
|
1107
|
+
B as getFieldDefinition,
|
|
1108
|
+
z as getFormDefinition,
|
|
1109
|
+
Je as isCompleteLegalUrls,
|
|
1110
|
+
ze as listEditorOptions,
|
|
1111
|
+
je as listFormDefinitions,
|
|
1112
|
+
W as resolveConsentCopy,
|
|
1113
|
+
H as resolveFormConsents
|
|
1037
1114
|
};
|