@usgb/forms 1.0.3 → 1.0.4
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 +7 -4
- package/dist/{forms-manifest.1.0.3.json → forms-manifest.1.0.4.json} +3 -3
- package/dist/forms-manifest.json +3 -3
- package/dist/index.js +212 -195
- package/dist/src/definitions/consents.d.ts +5 -0
- package/dist/src/definitions/consents.d.ts.map +1 -1
- package/dist/src/definitions/index.d.ts +1 -1
- package/dist/src/definitions/index.d.ts.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/{usgb-forms.1.0.3.js → usgb-forms.1.0.4.js} +9 -9
- package/dist/usgb-forms.css +46 -33
- package/dist/usgb-forms.js +9 -9
- package/forms-manifest.json +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2,40 +2,40 @@ import { jsx as s, Fragment as ee, jsxs as h } from "react/jsx-runtime";
|
|
|
2
2
|
import { useId as K, useMemo as D, useState as te, useRef as G, useEffect as j, forwardRef as R } from "react";
|
|
3
3
|
import { validate as ne } from "email-validator";
|
|
4
4
|
import { useForm as re } from "react-hook-form";
|
|
5
|
-
import
|
|
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 = {
|
|
5
|
+
import T from "classnames";
|
|
6
|
+
const ie = "1.1.0", ae = { version: "1.0.0", transport: "server-proxy" }, oe = { 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: "3", required: !0 }], editor: { label: "Magento FIK Blog Rail", description: "First name, last name, email, and phone required. Required automated text-message consent checkbox with linked terms of service and privacy policy (lead-tcpa v3).", 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
7
|
schemaVersion: ie,
|
|
8
8
|
package: { name: "@usgb/forms", compatiblePackageVersions: "^1.0.2" },
|
|
9
|
-
submissionContract:
|
|
10
|
-
trackingRegistry:
|
|
9
|
+
submissionContract: ae,
|
|
10
|
+
trackingRegistry: oe,
|
|
11
11
|
editorOptions: se,
|
|
12
12
|
forms: le,
|
|
13
13
|
hostAdapterContract: ce
|
|
14
|
-
},
|
|
14
|
+
}, x = de;
|
|
15
15
|
function z(t) {
|
|
16
|
-
return
|
|
16
|
+
return x.forms[t];
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
return Object.entries(
|
|
18
|
+
function ze() {
|
|
19
|
+
return Object.entries(x.forms).map(([t, e]) => ({
|
|
20
20
|
formId: t,
|
|
21
21
|
definition: e
|
|
22
22
|
}));
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function We(t) {
|
|
25
25
|
const e = z(t);
|
|
26
26
|
if (!e)
|
|
27
27
|
return [];
|
|
28
28
|
const n = [];
|
|
29
29
|
for (const i of e.editor.options) {
|
|
30
|
-
const
|
|
31
|
-
if (!
|
|
30
|
+
const a = x.editorOptions[i];
|
|
31
|
+
if (!a)
|
|
32
32
|
continue;
|
|
33
|
-
const r =
|
|
33
|
+
const r = a.valuesFrom ? [...e.editor[a.valuesFrom]] : void 0;
|
|
34
34
|
r && !r.length || n.push({
|
|
35
|
-
...
|
|
35
|
+
...a,
|
|
36
36
|
key: i,
|
|
37
37
|
values: r,
|
|
38
|
-
defaultValue:
|
|
38
|
+
defaultValue: a.defaultFrom ? e[a.defaultFrom] : a.default
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
return n;
|
|
@@ -43,10 +43,10 @@ function ze(t) {
|
|
|
43
43
|
function W(t, e) {
|
|
44
44
|
return typeof t == "string" ? { content: t, language: t } : t(e);
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function H(t, e) {
|
|
47
47
|
return `${t}@${e}`;
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function E(t) {
|
|
50
50
|
return (e) => ({
|
|
51
51
|
language: t.map(
|
|
52
52
|
(n) => typeof n == "string" ? n : `${n.label} (${e[n.href] ?? ""})`
|
|
@@ -88,7 +88,7 @@ const ue = {
|
|
|
88
88
|
grantDateField: "tcpa_form_opt_in_date",
|
|
89
89
|
requiredLegalUrls: ["userAgreement", "privacyPolicy"],
|
|
90
90
|
languageKey: "tcpa_consent_language",
|
|
91
|
-
copy:
|
|
91
|
+
copy: E([
|
|
92
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
93
|
{ href: "userAgreement", label: "terms and conditions" },
|
|
94
94
|
" and ",
|
|
@@ -96,6 +96,21 @@ const ue = {
|
|
|
96
96
|
". Calls are recorded and may be monitored."
|
|
97
97
|
])
|
|
98
98
|
}, pe = {
|
|
99
|
+
definitionId: "lead-tcpa",
|
|
100
|
+
definitionVersion: "3",
|
|
101
|
+
type: "checkbox",
|
|
102
|
+
name: "tcpa_form_consent_granted",
|
|
103
|
+
grantDateField: "tcpa_form_opt_in_date",
|
|
104
|
+
requiredLegalUrls: ["userAgreement", "privacyPolicy"],
|
|
105
|
+
languageKey: "tcpa_consent_language",
|
|
106
|
+
copy: E([
|
|
107
|
+
"I agree to receive automated text messages from the US Gold Bureau at the phone number provided. Msg & data rates may apply. Msg frequency varies. Reply HELP for help and STOP to cancel. View our ",
|
|
108
|
+
{ href: "userAgreement", label: "Terms of Service" },
|
|
109
|
+
" and ",
|
|
110
|
+
{ href: "privacyPolicy", label: "Privacy Policy" },
|
|
111
|
+
"."
|
|
112
|
+
])
|
|
113
|
+
}, fe = {
|
|
99
114
|
definitionId: "lead-sms",
|
|
100
115
|
definitionVersion: "1",
|
|
101
116
|
type: "checkbox",
|
|
@@ -103,21 +118,21 @@ const ue = {
|
|
|
103
118
|
requiredLegalUrls: [],
|
|
104
119
|
languageKey: "sms_consent_language",
|
|
105
120
|
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
|
-
},
|
|
121
|
+
}, ge = {
|
|
107
122
|
definitionId: "lead-tospp",
|
|
108
123
|
definitionVersion: "1",
|
|
109
124
|
type: "checkbox",
|
|
110
125
|
name: "tospp_form_consent_granted",
|
|
111
126
|
requiredLegalUrls: ["userAgreement", "privacyPolicy"],
|
|
112
127
|
languageKey: "tospp_consent_language",
|
|
113
|
-
copy:
|
|
128
|
+
copy: E([
|
|
114
129
|
"By checking, I accept ",
|
|
115
130
|
{ href: "userAgreement", label: "Terms of Conditions" },
|
|
116
131
|
" & ",
|
|
117
132
|
{ href: "privacyPolicy", label: "Privacy Policy" },
|
|
118
133
|
"."
|
|
119
134
|
])
|
|
120
|
-
},
|
|
135
|
+
}, he = {
|
|
121
136
|
definitionId: "lead-clickwrap",
|
|
122
137
|
definitionVersion: "1",
|
|
123
138
|
type: "notice",
|
|
@@ -129,7 +144,7 @@ const ue = {
|
|
|
129
144
|
"termsOfSale"
|
|
130
145
|
],
|
|
131
146
|
languageKey: "clickwrap_consent_language",
|
|
132
|
-
copy:
|
|
147
|
+
copy: E([
|
|
133
148
|
"By clicking the button, I agree to be bound by your ",
|
|
134
149
|
{ href: "privacyPolicy", label: "Privacy Policy" },
|
|
135
150
|
", ",
|
|
@@ -142,13 +157,13 @@ const ue = {
|
|
|
142
157
|
{ href: "termsOfSale", label: "Terms & Conditions of Sale" },
|
|
143
158
|
"."
|
|
144
159
|
])
|
|
145
|
-
},
|
|
160
|
+
}, be = {
|
|
146
161
|
definitionId: "lead-clickwrap",
|
|
147
162
|
definitionVersion: "2",
|
|
148
163
|
type: "notice",
|
|
149
164
|
requiredLegalUrls: ["privacyPolicy", "userAgreement"],
|
|
150
165
|
languageKey: "clickwrap_consent_language",
|
|
151
|
-
copy:
|
|
166
|
+
copy: E([
|
|
152
167
|
"By submitting, you agree to United States Gold Bureau’s ",
|
|
153
168
|
{ href: "privacyPolicy", label: "Privacy Policy" },
|
|
154
169
|
" and ",
|
|
@@ -156,31 +171,32 @@ const ue = {
|
|
|
156
171
|
", 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
172
|
])
|
|
158
173
|
};
|
|
159
|
-
function
|
|
174
|
+
function ye(...t) {
|
|
160
175
|
return Object.fromEntries(
|
|
161
176
|
t.map((e) => [
|
|
162
|
-
|
|
177
|
+
H(e.definitionId, e.definitionVersion),
|
|
163
178
|
e
|
|
164
179
|
])
|
|
165
180
|
);
|
|
166
181
|
}
|
|
167
|
-
const
|
|
182
|
+
const ve = ye(
|
|
168
183
|
ue,
|
|
169
184
|
me,
|
|
170
185
|
pe,
|
|
171
186
|
fe,
|
|
172
187
|
ge,
|
|
173
|
-
he
|
|
188
|
+
he,
|
|
189
|
+
be
|
|
174
190
|
);
|
|
175
|
-
function
|
|
176
|
-
return
|
|
191
|
+
function ke(t, e) {
|
|
192
|
+
return ve[H(t, e)];
|
|
177
193
|
}
|
|
178
|
-
function
|
|
194
|
+
function Y(t) {
|
|
179
195
|
if (!(t != null && t.length))
|
|
180
196
|
return [];
|
|
181
197
|
const e = [];
|
|
182
198
|
for (const n of t) {
|
|
183
|
-
const i =
|
|
199
|
+
const i = ke(
|
|
184
200
|
n.definitionId,
|
|
185
201
|
n.definitionVersion
|
|
186
202
|
);
|
|
@@ -192,20 +208,20 @@ function H(t) {
|
|
|
192
208
|
}
|
|
193
209
|
return e;
|
|
194
210
|
}
|
|
195
|
-
function
|
|
211
|
+
function we(t, e, n, i) {
|
|
196
212
|
if (!t.length)
|
|
197
213
|
return;
|
|
198
|
-
const
|
|
214
|
+
const a = {};
|
|
199
215
|
for (const r of t) {
|
|
200
216
|
const { language: l } = W(r.copy, n);
|
|
201
|
-
if (
|
|
202
|
-
const
|
|
203
|
-
|
|
217
|
+
if (a[r.languageKey] = l, r.type === "checkbox") {
|
|
218
|
+
const o = !!e[r.name];
|
|
219
|
+
a[r.name] = o, o && r.grantDateField && (a[r.grantDateField] = i);
|
|
204
220
|
}
|
|
205
221
|
}
|
|
206
|
-
return
|
|
222
|
+
return a;
|
|
207
223
|
}
|
|
208
|
-
function
|
|
224
|
+
function _e(t) {
|
|
209
225
|
const e = /* @__PURE__ */ new Set();
|
|
210
226
|
for (const n of t)
|
|
211
227
|
for (const i of n.requiredLegalUrls)
|
|
@@ -218,12 +234,12 @@ function qe(t) {
|
|
|
218
234
|
function $(t) {
|
|
219
235
|
return (e, n) => n ? e.trim().length > 0 || `${t} is required` : !0;
|
|
220
236
|
}
|
|
221
|
-
const
|
|
237
|
+
const Le = /^[2-9]\d{2}[2-9]\d{6}$/;
|
|
222
238
|
function Z(t) {
|
|
223
239
|
let e = t.replace(/\D/g, "");
|
|
224
|
-
return e.length === 11 && e.startsWith("1") && (e = e.slice(1)), e.length !== 10 || !
|
|
240
|
+
return e.length === 11 && e.startsWith("1") && (e = e.slice(1)), e.length !== 10 || !Le.test(e) ? null : e;
|
|
225
241
|
}
|
|
226
|
-
function
|
|
242
|
+
function Se(t) {
|
|
227
243
|
const e = t.trim();
|
|
228
244
|
if (!e) return "";
|
|
229
245
|
const n = Z(e);
|
|
@@ -231,7 +247,7 @@ function Le(t) {
|
|
|
231
247
|
const i = e.replace(/\D/g, "");
|
|
232
248
|
return i.length === 11 && i.startsWith("1") ? `1${n}` : n;
|
|
233
249
|
}
|
|
234
|
-
const
|
|
250
|
+
const Ce = {
|
|
235
251
|
firstname: {
|
|
236
252
|
name: "firstname",
|
|
237
253
|
control: "text",
|
|
@@ -249,34 +265,34 @@ const Se = {
|
|
|
249
265
|
email: {
|
|
250
266
|
name: "email",
|
|
251
267
|
control: "email",
|
|
252
|
-
label: "Email",
|
|
268
|
+
label: "Email address",
|
|
253
269
|
autoComplete: "email",
|
|
254
270
|
validate: (t, e) => {
|
|
255
271
|
const n = t.trim();
|
|
256
|
-
return n ? ne(n) || "Enter a valid email" : e ? "Email is required" : !0;
|
|
272
|
+
return n ? ne(n) || "Enter a valid email address" : e ? "Email address is required" : !0;
|
|
257
273
|
}
|
|
258
274
|
},
|
|
259
275
|
phone: {
|
|
260
276
|
name: "phone",
|
|
261
277
|
control: "tel",
|
|
262
|
-
label: "Phone",
|
|
278
|
+
label: "Phone number",
|
|
263
279
|
autoComplete: "tel",
|
|
264
280
|
validate: (t, e) => {
|
|
265
281
|
const n = t.trim();
|
|
266
|
-
return n ? Z(n) ? !0 : "Enter a valid phone number" : e ? "Phone is required" : !0;
|
|
282
|
+
return n ? Z(n) ? !0 : "Enter a valid phone number" : e ? "Phone number is required" : !0;
|
|
267
283
|
},
|
|
268
|
-
serialize:
|
|
284
|
+
serialize: Se
|
|
269
285
|
}
|
|
270
286
|
};
|
|
271
287
|
function B(t) {
|
|
272
|
-
return
|
|
288
|
+
return Ce[t];
|
|
273
289
|
}
|
|
274
290
|
function J({
|
|
275
291
|
className: t,
|
|
276
292
|
appearance: e,
|
|
277
293
|
variantValue: n,
|
|
278
294
|
twoColumn: i,
|
|
279
|
-
kind:
|
|
295
|
+
kind: a,
|
|
280
296
|
children: r
|
|
281
297
|
}) {
|
|
282
298
|
return /* @__PURE__ */ s(
|
|
@@ -286,15 +302,15 @@ function J({
|
|
|
286
302
|
"data-appearance": e,
|
|
287
303
|
...n ? { "data-variant": n } : {},
|
|
288
304
|
...i ? { "data-layout": "two-column" } : {},
|
|
289
|
-
"data-kind":
|
|
305
|
+
"data-kind": a,
|
|
290
306
|
children: r
|
|
291
307
|
}
|
|
292
308
|
);
|
|
293
309
|
}
|
|
294
|
-
function
|
|
310
|
+
function Ue() {
|
|
295
311
|
return typeof crypto < "u" && "randomUUID" in crypto ? crypto.randomUUID() : `usgb-${Date.now()}-${Math.random().toString(36).slice(2, 10)}`;
|
|
296
312
|
}
|
|
297
|
-
function
|
|
313
|
+
function Pe(t, e) {
|
|
298
314
|
const n = {};
|
|
299
315
|
for (const i of t)
|
|
300
316
|
n[i.name] = "";
|
|
@@ -306,24 +322,24 @@ function M(t) {
|
|
|
306
322
|
const e = t == null ? void 0 : t.trim();
|
|
307
323
|
return e || void 0;
|
|
308
324
|
}
|
|
309
|
-
function
|
|
325
|
+
function De({
|
|
310
326
|
formId: t,
|
|
311
327
|
definition: e,
|
|
312
328
|
legalUrls: n,
|
|
313
329
|
successUrl: i,
|
|
314
|
-
adapter:
|
|
330
|
+
adapter: a,
|
|
315
331
|
analytics: r,
|
|
316
332
|
onAccepted: l,
|
|
317
|
-
onFailed:
|
|
333
|
+
onFailed: o
|
|
318
334
|
}) {
|
|
319
335
|
const d = K(), u = D(
|
|
320
|
-
() =>
|
|
336
|
+
() => Y(e.consents) ?? [],
|
|
321
337
|
[e.consents]
|
|
322
338
|
), f = D(
|
|
323
339
|
() => u.filter(qe).map((p) => p.name),
|
|
324
340
|
[u]
|
|
325
341
|
), b = D(
|
|
326
|
-
() =>
|
|
342
|
+
() => Pe(e.fields, f),
|
|
327
343
|
[e.fields, f]
|
|
328
344
|
), {
|
|
329
345
|
register: g,
|
|
@@ -331,7 +347,7 @@ function Pe({
|
|
|
331
347
|
formState: { errors: w }
|
|
332
348
|
} = re({
|
|
333
349
|
defaultValues: b
|
|
334
|
-
}), [m,
|
|
350
|
+
}), [m, q] = te({ kind: "idle" }), y = G(!1);
|
|
335
351
|
j(() => {
|
|
336
352
|
r == null || r({ type: "view", formId: t });
|
|
337
353
|
}, [r, t]);
|
|
@@ -351,49 +367,49 @@ function Pe({
|
|
|
351
367
|
async (p) => {
|
|
352
368
|
if (y.current)
|
|
353
369
|
return;
|
|
354
|
-
y.current = !0,
|
|
355
|
-
const
|
|
370
|
+
y.current = !0, q({ kind: "submitting" }), r == null || r({ type: "submit_attempt", formId: t });
|
|
371
|
+
const _ = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), P = {};
|
|
356
372
|
for (const L of e.fields) {
|
|
357
373
|
const S = p[L.name];
|
|
358
374
|
if (typeof S != "string") {
|
|
359
375
|
P[L.name] = !!S;
|
|
360
376
|
continue;
|
|
361
377
|
}
|
|
362
|
-
const
|
|
363
|
-
P[L.name] =
|
|
378
|
+
const N = B(L.name);
|
|
379
|
+
P[L.name] = N != null && N.serialize ? N.serialize(S) : S.trim();
|
|
364
380
|
}
|
|
365
|
-
const
|
|
381
|
+
const I = we(
|
|
366
382
|
u,
|
|
367
383
|
p,
|
|
368
384
|
n ?? {},
|
|
369
|
-
|
|
370
|
-
),
|
|
385
|
+
_
|
|
386
|
+
), F = {
|
|
371
387
|
formId: t,
|
|
372
388
|
definitionVersion: e.definitionVersion,
|
|
373
|
-
submissionContractVersion:
|
|
374
|
-
idempotencyKey:
|
|
389
|
+
submissionContractVersion: x.submissionContract.version,
|
|
390
|
+
idempotencyKey: Ue(),
|
|
375
391
|
data: P,
|
|
376
|
-
consents:
|
|
392
|
+
consents: I
|
|
377
393
|
};
|
|
378
394
|
try {
|
|
379
|
-
const L = await
|
|
395
|
+
const L = await a.submit(F);
|
|
380
396
|
if (L.status === "accepted") {
|
|
381
|
-
r == null || r({ type: "success", formId: t, status: "accepted" }), l == null || l(
|
|
397
|
+
r == null || r({ type: "success", formId: t, status: "accepted" }), l == null || l(F), q({ kind: "accepted" });
|
|
382
398
|
const S = M(i);
|
|
383
399
|
S && typeof window < "u" && window.location.assign(S);
|
|
384
400
|
} else
|
|
385
|
-
y.current = !1,
|
|
401
|
+
y.current = !1, q({
|
|
386
402
|
kind: "failed",
|
|
387
403
|
message: L.message ?? "Submission failed"
|
|
388
404
|
}), r == null || r({
|
|
389
405
|
type: "failure",
|
|
390
406
|
formId: t,
|
|
391
407
|
message: L.message
|
|
392
|
-
}),
|
|
408
|
+
}), o == null || o(F, L.message);
|
|
393
409
|
} catch (L) {
|
|
394
410
|
y.current = !1;
|
|
395
411
|
const S = L instanceof Error ? L.message : "Submission failed";
|
|
396
|
-
|
|
412
|
+
q({ kind: "failed", message: S }), r == null || r({ type: "failure", formId: t, message: S }), o == null || o(F, S);
|
|
397
413
|
}
|
|
398
414
|
},
|
|
399
415
|
(p) => {
|
|
@@ -414,7 +430,7 @@ function Pe({
|
|
|
414
430
|
onSubmit: U
|
|
415
431
|
};
|
|
416
432
|
}
|
|
417
|
-
function
|
|
433
|
+
function Ae() {
|
|
418
434
|
return /* @__PURE__ */ h(
|
|
419
435
|
"svg",
|
|
420
436
|
{
|
|
@@ -482,38 +498,38 @@ function O({
|
|
|
482
498
|
{
|
|
483
499
|
id: t,
|
|
484
500
|
role: "alert",
|
|
485
|
-
className:
|
|
501
|
+
className: T("usgb-field-error", n),
|
|
486
502
|
children: [
|
|
487
|
-
/* @__PURE__ */ s(
|
|
503
|
+
/* @__PURE__ */ s(Ae, {}),
|
|
488
504
|
e
|
|
489
505
|
]
|
|
490
506
|
}
|
|
491
507
|
) : null;
|
|
492
508
|
}
|
|
493
|
-
const
|
|
494
|
-
function({ id: e, label: n, errorMessage: i, required:
|
|
509
|
+
const Ee = R(
|
|
510
|
+
function({ id: e, label: n, errorMessage: i, required: a, className: r, ...l }, o) {
|
|
495
511
|
const d = i ? `${e}-error` : void 0;
|
|
496
|
-
return /* @__PURE__ */ h("div", { className: "usgb-form-group", children: [
|
|
512
|
+
return /* @__PURE__ */ h("div", { className: "usgb-form-group usgb-consent", children: [
|
|
497
513
|
/* @__PURE__ */ h("div", { className: "usgb-consent-row", children: [
|
|
498
514
|
/* @__PURE__ */ h("span", { className: "usgb-form-checkbox-wrap", children: [
|
|
499
515
|
/* @__PURE__ */ s(
|
|
500
516
|
"input",
|
|
501
517
|
{
|
|
502
518
|
...l,
|
|
503
|
-
ref:
|
|
519
|
+
ref: o,
|
|
504
520
|
id: e,
|
|
505
521
|
type: "checkbox",
|
|
506
|
-
className:
|
|
522
|
+
className: T("usgb-form-checkbox", r),
|
|
507
523
|
"aria-invalid": i ? !0 : void 0,
|
|
508
524
|
"aria-describedby": d,
|
|
509
|
-
"aria-required":
|
|
525
|
+
"aria-required": a || void 0
|
|
510
526
|
}
|
|
511
527
|
),
|
|
512
528
|
/* @__PURE__ */ s(Te, {})
|
|
513
529
|
] }),
|
|
514
530
|
/* @__PURE__ */ h("label", { htmlFor: e, className: "usgb-consent-copy", children: [
|
|
515
531
|
n,
|
|
516
|
-
|
|
532
|
+
a ? /* @__PURE__ */ s(
|
|
517
533
|
"span",
|
|
518
534
|
{
|
|
519
535
|
className: "usgb-field-label-asterisk",
|
|
@@ -531,19 +547,19 @@ const Ae = R(
|
|
|
531
547
|
className: e,
|
|
532
548
|
variant: n = "primary",
|
|
533
549
|
loading: i = !1,
|
|
534
|
-
disabled:
|
|
550
|
+
disabled: a = !1,
|
|
535
551
|
children: r,
|
|
536
552
|
onClick: l,
|
|
537
|
-
type:
|
|
553
|
+
type: o = "button",
|
|
538
554
|
...d
|
|
539
555
|
}, u) {
|
|
540
|
-
const f =
|
|
556
|
+
const f = a || i, b = a && !i ? !0 : void 0;
|
|
541
557
|
return /* @__PURE__ */ s(
|
|
542
558
|
"button",
|
|
543
559
|
{
|
|
544
560
|
ref: u,
|
|
545
|
-
type:
|
|
546
|
-
className:
|
|
561
|
+
type: o,
|
|
562
|
+
className: T(
|
|
547
563
|
"usgb-btn",
|
|
548
564
|
n === "primary" && "usgb-btn-primary",
|
|
549
565
|
e
|
|
@@ -564,54 +580,54 @@ const Ae = R(
|
|
|
564
580
|
);
|
|
565
581
|
}
|
|
566
582
|
);
|
|
567
|
-
function
|
|
583
|
+
function Ie(t) {
|
|
568
584
|
const e = [];
|
|
569
585
|
let n = 0;
|
|
570
586
|
for (; n < t.length; ) {
|
|
571
587
|
const i = t[n];
|
|
572
588
|
if (i.group) {
|
|
573
|
-
const
|
|
574
|
-
for (; n < t.length && t[n].group ===
|
|
589
|
+
const a = i.group, r = [];
|
|
590
|
+
for (; n < t.length && t[n].group === a; )
|
|
575
591
|
r.push(t[n]), n += 1;
|
|
576
|
-
e.push({ type: "group", group:
|
|
592
|
+
e.push({ type: "group", group: a, fields: r });
|
|
577
593
|
continue;
|
|
578
594
|
}
|
|
579
595
|
e.push({ type: "field", field: i }), n += 1;
|
|
580
596
|
}
|
|
581
597
|
return e;
|
|
582
598
|
}
|
|
583
|
-
function
|
|
599
|
+
function Fe({
|
|
584
600
|
htmlFor: t,
|
|
585
601
|
children: e,
|
|
586
602
|
className: n,
|
|
587
603
|
required: i
|
|
588
604
|
}) {
|
|
589
|
-
return /* @__PURE__ */ h("label", { htmlFor: t, className:
|
|
605
|
+
return /* @__PURE__ */ h("label", { htmlFor: t, className: T("usgb-field-label", n), children: [
|
|
590
606
|
e,
|
|
591
607
|
i ? /* @__PURE__ */ s("span", { className: "usgb-field-label-asterisk", "aria-hidden": "true", children: "*" }) : null
|
|
592
608
|
] });
|
|
593
609
|
}
|
|
594
|
-
function
|
|
610
|
+
function Ne(t) {
|
|
595
611
|
return t.replace(/\b\w/g, (e) => e.toUpperCase());
|
|
596
612
|
}
|
|
597
|
-
const
|
|
613
|
+
const xe = R(
|
|
598
614
|
function({
|
|
599
615
|
id: e,
|
|
600
616
|
label: n,
|
|
601
617
|
type: i = "text",
|
|
602
|
-
errorMessage:
|
|
618
|
+
errorMessage: a,
|
|
603
619
|
required: r,
|
|
604
620
|
hideLabel: l = !1,
|
|
605
|
-
placeholderCase:
|
|
621
|
+
placeholderCase: o = "upper",
|
|
606
622
|
showError: d = !0,
|
|
607
623
|
className: u,
|
|
608
624
|
placeholder: f,
|
|
609
625
|
...b
|
|
610
626
|
}, g) {
|
|
611
|
-
const C =
|
|
627
|
+
const C = a ? `${e}-error` : void 0, w = l ? `${n}${r ? "*" : ""}` : f, m = l && w ? o === "title" ? Ne(w) : w.toUpperCase() : w;
|
|
612
628
|
return /* @__PURE__ */ h("div", { className: "usgb-form-group", children: [
|
|
613
629
|
/* @__PURE__ */ s(
|
|
614
|
-
|
|
630
|
+
Fe,
|
|
615
631
|
{
|
|
616
632
|
htmlFor: e,
|
|
617
633
|
required: r,
|
|
@@ -625,19 +641,19 @@ const Ne = R(
|
|
|
625
641
|
ref: g,
|
|
626
642
|
id: e,
|
|
627
643
|
type: i,
|
|
628
|
-
className:
|
|
644
|
+
className: T(
|
|
629
645
|
"usgb-field-control",
|
|
630
|
-
|
|
646
|
+
a && "usgb-field-invalid",
|
|
631
647
|
u
|
|
632
648
|
),
|
|
633
649
|
placeholder: m,
|
|
634
|
-
"aria-invalid":
|
|
650
|
+
"aria-invalid": a ? !0 : void 0,
|
|
635
651
|
"aria-describedby": C,
|
|
636
652
|
"aria-required": r || void 0,
|
|
637
653
|
...b
|
|
638
654
|
}
|
|
639
655
|
),
|
|
640
|
-
d ? /* @__PURE__ */ s(O, { id: C, message:
|
|
656
|
+
d ? /* @__PURE__ */ s(O, { id: C, message: a }) : null
|
|
641
657
|
] });
|
|
642
658
|
}
|
|
643
659
|
);
|
|
@@ -646,27 +662,27 @@ function V({
|
|
|
646
662
|
fieldIds: e,
|
|
647
663
|
register: n,
|
|
648
664
|
errors: i,
|
|
649
|
-
hideLabel:
|
|
665
|
+
hideLabel: a,
|
|
650
666
|
placeholderCase: r,
|
|
651
667
|
showError: l = !0
|
|
652
668
|
}) {
|
|
653
|
-
const
|
|
654
|
-
if (!
|
|
669
|
+
const o = B(t.name);
|
|
670
|
+
if (!o) return null;
|
|
655
671
|
const d = i[t.name], u = typeof (d == null ? void 0 : d.message) == "string" ? d.message : void 0;
|
|
656
672
|
return /* @__PURE__ */ s(
|
|
657
|
-
|
|
673
|
+
xe,
|
|
658
674
|
{
|
|
659
675
|
id: e[t.name],
|
|
660
|
-
label:
|
|
661
|
-
type:
|
|
676
|
+
label: o.label,
|
|
677
|
+
type: o.control,
|
|
662
678
|
required: t.required,
|
|
663
|
-
hideLabel:
|
|
679
|
+
hideLabel: a,
|
|
664
680
|
placeholderCase: r,
|
|
665
681
|
showError: l,
|
|
666
|
-
autoComplete:
|
|
682
|
+
autoComplete: o.autoComplete,
|
|
667
683
|
errorMessage: u,
|
|
668
684
|
...n(t.name, {
|
|
669
|
-
validate: (f) =>
|
|
685
|
+
validate: (f) => o.validate(
|
|
670
686
|
typeof f == "string" ? f : "",
|
|
671
687
|
t.required
|
|
672
688
|
)
|
|
@@ -674,26 +690,26 @@ function V({
|
|
|
674
690
|
}
|
|
675
691
|
);
|
|
676
692
|
}
|
|
677
|
-
function
|
|
693
|
+
function Me({
|
|
678
694
|
definition: t,
|
|
679
695
|
variant: e,
|
|
680
696
|
ctaLabel: n,
|
|
681
697
|
legalUrls: i,
|
|
682
|
-
session:
|
|
698
|
+
session: a,
|
|
683
699
|
headingId: r
|
|
684
700
|
}) {
|
|
685
701
|
const {
|
|
686
702
|
register: l,
|
|
687
|
-
errors:
|
|
703
|
+
errors: o,
|
|
688
704
|
fieldIds: d,
|
|
689
705
|
noticeIds: u,
|
|
690
706
|
consentDefs: f,
|
|
691
707
|
uiState: b,
|
|
692
708
|
onSubmit: g
|
|
693
|
-
} =
|
|
694
|
-
() =>
|
|
709
|
+
} = a, C = D(
|
|
710
|
+
() => Ie(t.fields),
|
|
695
711
|
[t.fields]
|
|
696
|
-
), w = e === "sidebar", m = e === "dense" || w,
|
|
712
|
+
), w = e === "sidebar", m = e === "dense" || w, q = w ? "title" : "upper", y = Object.values(u).join(" ");
|
|
697
713
|
return /* @__PURE__ */ h(
|
|
698
714
|
"form",
|
|
699
715
|
{
|
|
@@ -711,9 +727,9 @@ function xe({
|
|
|
711
727
|
fieldRef: v,
|
|
712
728
|
fieldIds: d,
|
|
713
729
|
register: l,
|
|
714
|
-
errors:
|
|
730
|
+
errors: o,
|
|
715
731
|
hideLabel: m,
|
|
716
|
-
placeholderCase:
|
|
732
|
+
placeholderCase: q
|
|
717
733
|
},
|
|
718
734
|
v.name
|
|
719
735
|
))
|
|
@@ -725,9 +741,9 @@ function xe({
|
|
|
725
741
|
fieldRef: c.field,
|
|
726
742
|
fieldIds: d,
|
|
727
743
|
register: l,
|
|
728
|
-
errors:
|
|
744
|
+
errors: o,
|
|
729
745
|
hideLabel: m,
|
|
730
|
-
placeholderCase:
|
|
746
|
+
placeholderCase: q
|
|
731
747
|
},
|
|
732
748
|
c.field.name
|
|
733
749
|
)),
|
|
@@ -741,14 +757,14 @@ function xe({
|
|
|
741
757
|
"p",
|
|
742
758
|
{
|
|
743
759
|
id: u[c.definitionId],
|
|
744
|
-
className: "usgb-consent-copy usgb-consent-notice",
|
|
760
|
+
className: "usgb-consent usgb-consent-copy usgb-consent-notice",
|
|
745
761
|
children: v
|
|
746
762
|
},
|
|
747
763
|
c.definitionId
|
|
748
764
|
);
|
|
749
|
-
const U =
|
|
765
|
+
const U = o[c.name], p = typeof (U == null ? void 0 : U.message) == "string" ? U.message : void 0;
|
|
750
766
|
return /* @__PURE__ */ s(
|
|
751
|
-
|
|
767
|
+
Ee,
|
|
752
768
|
{
|
|
753
769
|
id: d[c.name],
|
|
754
770
|
label: v,
|
|
@@ -782,14 +798,14 @@ function xe({
|
|
|
782
798
|
}
|
|
783
799
|
);
|
|
784
800
|
}
|
|
785
|
-
function
|
|
801
|
+
function Ve({
|
|
786
802
|
definition: t,
|
|
787
803
|
ctaLabel: e,
|
|
788
804
|
session: n,
|
|
789
805
|
headingId: i
|
|
790
806
|
}) {
|
|
791
807
|
var b;
|
|
792
|
-
const { register:
|
|
808
|
+
const { register: a, errors: r, fieldIds: l, uiState: o, 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
809
|
return u ? /* @__PURE__ */ h(
|
|
794
810
|
"form",
|
|
795
811
|
{
|
|
@@ -803,14 +819,14 @@ function Me({
|
|
|
803
819
|
{
|
|
804
820
|
fieldRef: u,
|
|
805
821
|
fieldIds: l,
|
|
806
|
-
register:
|
|
822
|
+
register: a,
|
|
807
823
|
errors: r,
|
|
808
824
|
hideLabel: !0,
|
|
809
825
|
placeholderCase: "upper",
|
|
810
826
|
showError: !1
|
|
811
827
|
}
|
|
812
828
|
),
|
|
813
|
-
/* @__PURE__ */ s(Q, { type: "submit", loading:
|
|
829
|
+
/* @__PURE__ */ s(Q, { type: "submit", loading: o.kind === "submitting", children: e })
|
|
814
830
|
] }),
|
|
815
831
|
/* @__PURE__ */ s(
|
|
816
832
|
O,
|
|
@@ -819,12 +835,12 @@ function Me({
|
|
|
819
835
|
message: f
|
|
820
836
|
}
|
|
821
837
|
),
|
|
822
|
-
|
|
838
|
+
o.kind === "failed" ? /* @__PURE__ */ s(
|
|
823
839
|
"p",
|
|
824
840
|
{
|
|
825
841
|
className: "usgb-form-status usgb-form-status-error",
|
|
826
842
|
role: "alert",
|
|
827
|
-
children:
|
|
843
|
+
children: o.message ?? "Something went wrong. Please try again."
|
|
828
844
|
}
|
|
829
845
|
) : null
|
|
830
846
|
]
|
|
@@ -832,15 +848,15 @@ function Me({
|
|
|
832
848
|
) : /* @__PURE__ */ s("p", { className: "usgb-form-status usgb-form-status-error", role: "alert", children: "Newsletter kind requires an email field" });
|
|
833
849
|
}
|
|
834
850
|
const X = {
|
|
835
|
-
lead:
|
|
836
|
-
newsletter:
|
|
837
|
-
},
|
|
838
|
-
function
|
|
851
|
+
lead: Me,
|
|
852
|
+
newsletter: Ve
|
|
853
|
+
}, Re = "Thank you. Your request has been accepted and is being processed.";
|
|
854
|
+
function A({
|
|
839
855
|
className: t,
|
|
840
856
|
appearance: e,
|
|
841
857
|
variantValue: n,
|
|
842
858
|
twoColumn: i,
|
|
843
|
-
kind:
|
|
859
|
+
kind: a,
|
|
844
860
|
children: r
|
|
845
861
|
}) {
|
|
846
862
|
return /* @__PURE__ */ s(
|
|
@@ -850,20 +866,20 @@ function T({
|
|
|
850
866
|
appearance: e,
|
|
851
867
|
variantValue: n,
|
|
852
868
|
twoColumn: i,
|
|
853
|
-
kind:
|
|
869
|
+
kind: a,
|
|
854
870
|
children: /* @__PURE__ */ s("p", { className: "usgb-form-status usgb-form-status-error", role: "alert", children: r })
|
|
855
871
|
}
|
|
856
872
|
);
|
|
857
873
|
}
|
|
858
|
-
function
|
|
874
|
+
function Be({
|
|
859
875
|
formId: t,
|
|
860
876
|
definition: e,
|
|
861
877
|
appearance: n,
|
|
862
878
|
variant: i,
|
|
863
|
-
variantValue:
|
|
879
|
+
variantValue: a,
|
|
864
880
|
twoColumn: r,
|
|
865
881
|
heading: l,
|
|
866
|
-
subheading:
|
|
882
|
+
subheading: o,
|
|
867
883
|
ctaLabel: d,
|
|
868
884
|
legalUrls: u,
|
|
869
885
|
successMessage: f,
|
|
@@ -872,9 +888,9 @@ function Re({
|
|
|
872
888
|
analytics: C,
|
|
873
889
|
className: w,
|
|
874
890
|
onAccepted: m,
|
|
875
|
-
onFailed:
|
|
891
|
+
onFailed: q
|
|
876
892
|
}) {
|
|
877
|
-
const y = K(), c = l ? `${y}-heading` : void 0, v = G(null), U =
|
|
893
|
+
const y = K(), c = l ? `${y}-heading` : void 0, v = G(null), U = De({
|
|
878
894
|
formId: t,
|
|
879
895
|
definition: e,
|
|
880
896
|
legalUrls: u,
|
|
@@ -882,24 +898,24 @@ function Re({
|
|
|
882
898
|
adapter: g,
|
|
883
899
|
analytics: C,
|
|
884
900
|
onAccepted: m,
|
|
885
|
-
onFailed:
|
|
886
|
-
}), p = U.uiState.kind === "accepted", k = p && !!M(b),
|
|
901
|
+
onFailed: q
|
|
902
|
+
}), p = U.uiState.kind === "accepted", k = p && !!M(b), _ = p && !k ? M(f) ?? Re : "";
|
|
887
903
|
j(() => {
|
|
888
|
-
var
|
|
889
|
-
|
|
890
|
-
}, [
|
|
904
|
+
var I;
|
|
905
|
+
_ && ((I = v.current) == null || I.focus());
|
|
906
|
+
}, [_]);
|
|
891
907
|
const P = X[e.kind];
|
|
892
908
|
return /* @__PURE__ */ h(
|
|
893
909
|
J,
|
|
894
910
|
{
|
|
895
911
|
className: w,
|
|
896
912
|
appearance: n,
|
|
897
|
-
variantValue:
|
|
913
|
+
variantValue: a,
|
|
898
914
|
twoColumn: r,
|
|
899
915
|
kind: e.kind,
|
|
900
916
|
children: [
|
|
901
917
|
l ? /* @__PURE__ */ s("h2", { id: c, className: "usgb-form-heading", children: l }) : null,
|
|
902
|
-
!p &&
|
|
918
|
+
!p && o ? /* @__PURE__ */ s("p", { className: "usgb-form-subheading", children: o }) : null,
|
|
903
919
|
p ? null : /* @__PURE__ */ s(
|
|
904
920
|
P,
|
|
905
921
|
{
|
|
@@ -915,26 +931,26 @@ function Re({
|
|
|
915
931
|
"p",
|
|
916
932
|
{
|
|
917
933
|
ref: v,
|
|
918
|
-
className:
|
|
934
|
+
className: _ ? "usgb-form-status usgb-form-status-success" : "usgb-field-label--sr-only",
|
|
919
935
|
role: "status",
|
|
920
936
|
"aria-live": "polite",
|
|
921
|
-
tabIndex:
|
|
922
|
-
children:
|
|
937
|
+
tabIndex: _ ? -1 : void 0,
|
|
938
|
+
children: _
|
|
923
939
|
}
|
|
924
940
|
)
|
|
925
941
|
]
|
|
926
942
|
}
|
|
927
943
|
);
|
|
928
944
|
}
|
|
929
|
-
function
|
|
945
|
+
function He({
|
|
930
946
|
formId: t,
|
|
931
947
|
appearance: e = "on-light",
|
|
932
948
|
variant: n = "dense",
|
|
933
949
|
twoColumn: i = !1,
|
|
934
|
-
heading:
|
|
950
|
+
heading: a,
|
|
935
951
|
subheading: r,
|
|
936
952
|
ctaLabel: l,
|
|
937
|
-
legalUrls:
|
|
953
|
+
legalUrls: o,
|
|
938
954
|
successMessage: d,
|
|
939
955
|
successUrl: u,
|
|
940
956
|
adapter: f,
|
|
@@ -943,10 +959,10 @@ function We({
|
|
|
943
959
|
onAccepted: C,
|
|
944
960
|
onFailed: w
|
|
945
961
|
}) {
|
|
946
|
-
const m = z(t),
|
|
962
|
+
const m = z(t), q = (m == null ? void 0 : m.kind) === "newsletter", y = q ? "" : n, c = !q && i;
|
|
947
963
|
if (!m)
|
|
948
964
|
return /* @__PURE__ */ h(
|
|
949
|
-
|
|
965
|
+
A,
|
|
950
966
|
{
|
|
951
967
|
className: g,
|
|
952
968
|
appearance: e,
|
|
@@ -958,10 +974,10 @@ function We({
|
|
|
958
974
|
]
|
|
959
975
|
}
|
|
960
976
|
);
|
|
961
|
-
const v =
|
|
977
|
+
const v = Y(m.consents);
|
|
962
978
|
if (v === null)
|
|
963
979
|
return /* @__PURE__ */ h(
|
|
964
|
-
|
|
980
|
+
A,
|
|
965
981
|
{
|
|
966
982
|
className: g,
|
|
967
983
|
appearance: e,
|
|
@@ -974,15 +990,15 @@ function We({
|
|
|
974
990
|
]
|
|
975
991
|
}
|
|
976
992
|
);
|
|
977
|
-
const p =
|
|
978
|
-
(
|
|
993
|
+
const p = _e(v).filter(
|
|
994
|
+
(_) => {
|
|
979
995
|
var P;
|
|
980
|
-
return !((P =
|
|
996
|
+
return !((P = o == null ? void 0 : o[_]) != null && P.trim());
|
|
981
997
|
}
|
|
982
998
|
);
|
|
983
999
|
if (p.length)
|
|
984
1000
|
return /* @__PURE__ */ h(
|
|
985
|
-
|
|
1001
|
+
A,
|
|
986
1002
|
{
|
|
987
1003
|
className: g,
|
|
988
1004
|
appearance: e,
|
|
@@ -998,10 +1014,10 @@ function We({
|
|
|
998
1014
|
}
|
|
999
1015
|
);
|
|
1000
1016
|
const k = m.fields.filter(
|
|
1001
|
-
(
|
|
1017
|
+
(_) => !B(_.name)
|
|
1002
1018
|
);
|
|
1003
1019
|
return k.length ? /* @__PURE__ */ h(
|
|
1004
|
-
|
|
1020
|
+
A,
|
|
1005
1021
|
{
|
|
1006
1022
|
className: g,
|
|
1007
1023
|
appearance: e,
|
|
@@ -1013,11 +1029,11 @@ function We({
|
|
|
1013
1029
|
t,
|
|
1014
1030
|
":",
|
|
1015
1031
|
" ",
|
|
1016
|
-
k.map((
|
|
1032
|
+
k.map((_) => _.name).join(", ")
|
|
1017
1033
|
]
|
|
1018
1034
|
}
|
|
1019
1035
|
) : m.kind in X ? /* @__PURE__ */ s(
|
|
1020
|
-
|
|
1036
|
+
Be,
|
|
1021
1037
|
{
|
|
1022
1038
|
formId: t,
|
|
1023
1039
|
definition: m,
|
|
@@ -1025,10 +1041,10 @@ function We({
|
|
|
1025
1041
|
variant: n,
|
|
1026
1042
|
variantValue: y,
|
|
1027
1043
|
twoColumn: c,
|
|
1028
|
-
heading:
|
|
1044
|
+
heading: a,
|
|
1029
1045
|
subheading: r,
|
|
1030
1046
|
ctaLabel: l ?? m.ctaLabel,
|
|
1031
|
-
legalUrls:
|
|
1047
|
+
legalUrls: o,
|
|
1032
1048
|
successMessage: d,
|
|
1033
1049
|
successUrl: u,
|
|
1034
1050
|
adapter: f,
|
|
@@ -1038,7 +1054,7 @@ function We({
|
|
|
1038
1054
|
onFailed: w
|
|
1039
1055
|
}
|
|
1040
1056
|
) : /* @__PURE__ */ h(
|
|
1041
|
-
|
|
1057
|
+
A,
|
|
1042
1058
|
{
|
|
1043
1059
|
className: g,
|
|
1044
1060
|
appearance: e,
|
|
@@ -1053,23 +1069,23 @@ function We({
|
|
|
1053
1069
|
);
|
|
1054
1070
|
}
|
|
1055
1071
|
function Ye(t = {}) {
|
|
1056
|
-
const e = typeof t == "string" ? { host: t } : t, n = e.host ?? "pwa", i = e.delayMs ?? 400,
|
|
1072
|
+
const e = typeof t == "string" ? { host: t } : t, n = e.host ?? "pwa", i = e.delayMs ?? 400, a = e.result ?? { status: "accepted" };
|
|
1057
1073
|
return {
|
|
1058
1074
|
host: n,
|
|
1059
1075
|
async submit(r) {
|
|
1060
1076
|
var l;
|
|
1061
|
-
return (l = e.onSubmit) == null || l.call(e, r), await new Promise((
|
|
1077
|
+
return (l = e.onSubmit) == null || l.call(e, r), await new Promise((o) => setTimeout(o, i)), a;
|
|
1062
1078
|
}
|
|
1063
1079
|
};
|
|
1064
1080
|
}
|
|
1065
|
-
const
|
|
1081
|
+
const Ze = {
|
|
1066
1082
|
clientAgreement: "client-agreement-url",
|
|
1067
1083
|
privacyPolicy: "privacy-policy-url",
|
|
1068
1084
|
userAgreement: "user-agreement-url",
|
|
1069
1085
|
marketLossPolicy: "market-loss-policy-url",
|
|
1070
1086
|
electronicDisclaimer: "electronic-disclaimer-url",
|
|
1071
1087
|
termsOfSale: "terms-of-sale-url"
|
|
1072
|
-
},
|
|
1088
|
+
}, Je = {
|
|
1073
1089
|
clientAgreement: "/content/client-agreement",
|
|
1074
1090
|
privacyPolicy: "/content/privacy-policy",
|
|
1075
1091
|
userAgreement: "/content/user-agreement",
|
|
@@ -1077,7 +1093,7 @@ const He = {
|
|
|
1077
1093
|
electronicDisclaimer: "/content/electronic-disclaimer",
|
|
1078
1094
|
termsOfSale: "/content/terms-of-sale"
|
|
1079
1095
|
};
|
|
1080
|
-
function
|
|
1096
|
+
function Qe(t, e) {
|
|
1081
1097
|
return e.every((n) => {
|
|
1082
1098
|
var i;
|
|
1083
1099
|
return !!((i = t == null ? void 0 : t[n]) != null && i.trim());
|
|
@@ -1085,30 +1101,31 @@ function Je(t, e) {
|
|
|
1085
1101
|
}
|
|
1086
1102
|
export {
|
|
1087
1103
|
Q as Button,
|
|
1088
|
-
|
|
1089
|
-
|
|
1104
|
+
Ee as ConsentField,
|
|
1105
|
+
Ce as FIELD_REGISTRY,
|
|
1090
1106
|
O as FieldError,
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1107
|
+
Fe as FieldLabel,
|
|
1108
|
+
he as LEAD_CLICKWRAP,
|
|
1109
|
+
be as LEAD_CLICKWRAP_V2,
|
|
1110
|
+
fe as LEAD_SMS,
|
|
1095
1111
|
ue as LEAD_TCPA,
|
|
1096
1112
|
me as LEAD_TCPA_V2,
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
Ze as
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1113
|
+
pe as LEAD_TCPA_V3,
|
|
1114
|
+
ge as LEAD_TOSPP,
|
|
1115
|
+
Ze as LEGAL_URL_ATTRS,
|
|
1116
|
+
Je as PWA_LEGAL_URLS,
|
|
1117
|
+
xe as TextField,
|
|
1118
|
+
He as UsgbForm,
|
|
1119
|
+
_e as collectRequiredLegalUrls,
|
|
1120
|
+
Ue as createIdempotencyKey,
|
|
1104
1121
|
Ye as createStubAdapter,
|
|
1105
|
-
|
|
1106
|
-
|
|
1122
|
+
x as formsManifest,
|
|
1123
|
+
ke as getConsentDefinition,
|
|
1107
1124
|
B as getFieldDefinition,
|
|
1108
1125
|
z as getFormDefinition,
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1126
|
+
Qe as isCompleteLegalUrls,
|
|
1127
|
+
We as listEditorOptions,
|
|
1128
|
+
ze as listFormDefinitions,
|
|
1112
1129
|
W as resolveConsentCopy,
|
|
1113
|
-
|
|
1130
|
+
Y as resolveFormConsents
|
|
1114
1131
|
};
|