@usgb/forms 1.0.2 → 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.
Files changed (43) hide show
  1. package/README.md +128 -142
  2. package/dist/forms-manifest.1.0.3.json +439 -0
  3. package/dist/forms-manifest.json +218 -84
  4. package/dist/index.js +642 -582
  5. package/dist/src/contract/createIdempotencyKey.d.ts +2 -0
  6. package/dist/src/contract/createIdempotencyKey.d.ts.map +1 -0
  7. package/dist/src/contract/createStubAdapter.d.ts.map +1 -1
  8. package/dist/src/contract/types.d.ts +15 -15
  9. package/dist/src/contract/types.d.ts.map +1 -1
  10. package/dist/src/definitions/consents.d.ts +10 -0
  11. package/dist/src/definitions/consents.d.ts.map +1 -1
  12. package/dist/src/definitions/index.d.ts +4 -3
  13. package/dist/src/definitions/index.d.ts.map +1 -1
  14. package/dist/src/definitions/manifest.d.ts +14 -1
  15. package/dist/src/definitions/manifest.d.ts.map +1 -1
  16. package/dist/src/definitions/types.d.ts +35 -5
  17. package/dist/src/definitions/types.d.ts.map +1 -1
  18. package/dist/src/form/FormShell.d.ts +2 -1
  19. package/dist/src/form/FormShell.d.ts.map +1 -1
  20. package/dist/src/form/UsgbForm.d.ts +5 -4
  21. package/dist/src/form/UsgbForm.d.ts.map +1 -1
  22. package/dist/src/form/chunkFields.d.ts +1 -1
  23. package/dist/src/form/kinds/LeadKindForm.d.ts +1 -1
  24. package/dist/src/form/kinds/LeadKindForm.d.ts.map +1 -1
  25. package/dist/src/form/kinds/NewsletterKindForm.d.ts +1 -1
  26. package/dist/src/form/kinds/NewsletterKindForm.d.ts.map +1 -1
  27. package/dist/src/form/kinds/types.d.ts +3 -1
  28. package/dist/src/form/kinds/types.d.ts.map +1 -1
  29. package/dist/src/form/useUsgbFormSession.d.ts +3 -4
  30. package/dist/src/form/useUsgbFormSession.d.ts.map +1 -1
  31. package/dist/src/index.d.ts +5 -5
  32. package/dist/src/index.d.ts.map +1 -1
  33. package/dist/src/ui/Button.d.ts.map +1 -1
  34. package/dist/src/ui/ConsentField.d.ts.map +1 -1
  35. package/dist/usgb-forms.1.0.3.js +44 -0
  36. package/dist/usgb-forms.css +98 -15
  37. package/dist/usgb-forms.js +11 -11
  38. package/forms-manifest.json +218 -84
  39. package/package.json +1 -1
  40. package/dist/forms-manifest.1.0.2.json +0 -305
  41. package/dist/src/contract/collectContext.d.ts +0 -9
  42. package/dist/src/contract/collectContext.d.ts.map +0 -1
  43. package/dist/usgb-forms.1.0.2.js +0 -44
package/dist/index.js CHANGED
@@ -1,51 +1,77 @@
1
- import { jsx as l, Fragment as X, jsxs as g } from "react/jsx-runtime";
2
- import { validate as ee } from "email-validator";
3
- import { useId as te, useMemo as D, useState as ne, useEffect as ie, forwardRef as $ } from "react";
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
4
  import { useForm as re } from "react-hook-form";
5
- import P from "classnames";
6
- const oe = "1.0.0", se = { version: "1.0.0", transport: "server-proxy", payloadShape: "data-and-context" }, 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"] } }, le = { "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", consents: [{ definitionId: "lead-tcpa", definitionVersion: "1", required: !1 }, { definitionId: "lead-sms", definitionVersion: "1", required: !1 }, { definitionId: "lead-tospp", definitionVersion: "1", required: !1 }], editor: { label: "Main Investors Kit", description: "Standard lead form: name, email, phone, plus optional TCPA, marketing SMS, and terms/privacy checkboxes. Use on full-width landing pages and PWA kit/sidebar placements.", whenToUse: "Default kit request with optional consent checkboxes. Do not use for affiliate landers or IRA-specific leads.", whenNotToUse: "Affiliate pages (separate definition). IRA kit (separate definition when added). Clickwrap-only kit (`main-investors-kit-notice`).", supportedAppearances: ["on-light", "on-dark"], supportedVariants: ["dense", "large", "sidebar", "two-column"] } }, "main-investors-kit-notice": { 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", consents: [{ definitionId: "lead-clickwrap", definitionVersion: "1" }], editor: { label: "Main Investors Kit (clickwrap)", description: "Same fields as Main Investors Kit with a clickwrap notice only — no consent checkboxes.", whenToUse: "Kit request where submit acknowledges legal docs via notice copy instead of checkboxes.", whenNotToUse: "Placements that need TCPA / marketing SMS / terms checkboxes (`main-investors-kit`).", 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: [] } } }, ce = { 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"] }, de = {
7
- schemaVersion: oe,
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
8
  package: { name: "@usgb/forms", compatiblePackageVersions: "^1.0.2" },
9
- submissionContract: se,
9
+ submissionContract: oe,
10
10
  trackingRegistry: ae,
11
+ editorOptions: se,
11
12
  forms: le,
12
13
  hostAdapterContract: ce
13
- }, I = de;
14
- function ue(t) {
15
- return I.forms[t];
14
+ }, N = de;
15
+ function z(t) {
16
+ return N.forms[t];
16
17
  }
17
- function He() {
18
- return Object.entries(I.forms).map(([t, e]) => ({
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 j(t, e) {
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) {
24
44
  return typeof t == "string" ? { content: t, language: t } : t(e);
25
45
  }
26
- function G(t, e) {
46
+ function Y(t, e) {
27
47
  return `${t}@${e}`;
28
48
  }
29
- function H(t) {
49
+ function x(t) {
30
50
  return (e) => ({
31
51
  language: t.map(
32
52
  (n) => typeof n == "string" ? n : `${n.label} (${e[n.href] ?? ""})`
33
53
  ).join(""),
34
- content: /* @__PURE__ */ l(X, { children: t.map(
35
- (n, i) => typeof n == "string" ? n : /* @__PURE__ */ l(
54
+ content: /* @__PURE__ */ s(ee, { children: t.map(
55
+ (n, i) => typeof n == "string" ? n : /* @__PURE__ */ h(
36
56
  "a",
37
57
  {
38
58
  href: e[n.href],
39
59
  target: "_blank",
40
60
  rel: "noreferrer",
41
- children: n.label
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
+ ]
42
68
  },
43
69
  `${n.href}-${i}`
44
70
  )
45
71
  ) })
46
72
  });
47
73
  }
48
- const me = {
74
+ const ue = {
49
75
  definitionId: "lead-tcpa",
50
76
  definitionVersion: "1",
51
77
  type: "checkbox",
@@ -54,7 +80,22 @@ const me = {
54
80
  requiredLegalUrls: [],
55
81
  languageKey: "tcpa_consent_language",
56
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"
57
- }, fe = {
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 = {
58
99
  definitionId: "lead-sms",
59
100
  definitionVersion: "1",
60
101
  type: "checkbox",
@@ -62,21 +103,21 @@ const me = {
62
103
  requiredLegalUrls: [],
63
104
  languageKey: "sms_consent_language",
64
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."
65
- }, ge = {
106
+ }, fe = {
66
107
  definitionId: "lead-tospp",
67
108
  definitionVersion: "1",
68
109
  type: "checkbox",
69
110
  name: "tospp_form_consent_granted",
70
111
  requiredLegalUrls: ["userAgreement", "privacyPolicy"],
71
112
  languageKey: "tospp_consent_language",
72
- copy: H([
113
+ copy: x([
73
114
  "By checking, I accept ",
74
115
  { href: "userAgreement", label: "Terms of Conditions" },
75
116
  " & ",
76
117
  { href: "privacyPolicy", label: "Privacy Policy" },
77
118
  "."
78
119
  ])
79
- }, pe = {
120
+ }, ge = {
80
121
  definitionId: "lead-clickwrap",
81
122
  definitionVersion: "1",
82
123
  type: "notice",
@@ -88,7 +129,7 @@ const me = {
88
129
  "termsOfSale"
89
130
  ],
90
131
  languageKey: "clickwrap_consent_language",
91
- copy: H([
132
+ copy: x([
92
133
  "By clicking the button, I agree to be bound by your ",
93
134
  { href: "privacyPolicy", label: "Privacy Policy" },
94
135
  ", ",
@@ -101,30 +142,45 @@ const me = {
101
142
  { href: "termsOfSale", label: "Terms & Conditions of Sale" },
102
143
  "."
103
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
+ ])
104
158
  };
105
- function he(...t) {
159
+ function be(...t) {
106
160
  return Object.fromEntries(
107
161
  t.map((e) => [
108
- G(e.definitionId, e.definitionVersion),
162
+ Y(e.definitionId, e.definitionVersion),
109
163
  e
110
164
  ])
111
165
  );
112
166
  }
113
- const be = he(
167
+ const ye = be(
168
+ ue,
114
169
  me,
170
+ pe,
115
171
  fe,
116
172
  ge,
117
- pe
173
+ he
118
174
  );
119
- function ye(t, e) {
120
- return be[G(t, e)];
175
+ function ve(t, e) {
176
+ return ye[Y(t, e)];
121
177
  }
122
- function W(t) {
178
+ function H(t) {
123
179
  if (!(t != null && t.length))
124
180
  return [];
125
181
  const e = [];
126
182
  for (const n of t) {
127
- const i = ye(
183
+ const i = ve(
128
184
  n.definitionId,
129
185
  n.definitionVersion
130
186
  );
@@ -136,59 +192,59 @@ function W(t) {
136
192
  }
137
193
  return e;
138
194
  }
139
- function _e(t, e, n, i) {
195
+ function ke(t, e, n, i) {
140
196
  if (!t.length)
141
197
  return;
142
- const a = {};
143
- for (const s of t) {
144
- const { language: r } = j(s.copy, n);
145
- if (a[s.languageKey] = r, s.type === "checkbox") {
146
- const o = !!e[s.name];
147
- a[s.name] = o, o && s.grantDateField && (a[s.grantDateField] = i);
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);
148
204
  }
149
205
  }
150
- return a;
206
+ return o;
151
207
  }
152
- function ke(t) {
208
+ function we(t) {
153
209
  const e = /* @__PURE__ */ new Set();
154
210
  for (const n of t)
155
211
  for (const i of n.requiredLegalUrls)
156
212
  e.add(i);
157
213
  return [...e];
158
214
  }
159
- function we(t) {
215
+ function qe(t) {
160
216
  return t.type === "checkbox";
161
217
  }
162
- function O(t) {
218
+ function $(t) {
163
219
  return (e, n) => n ? e.trim().length > 0 || `${t} is required` : !0;
164
220
  }
165
- const ve = /^[2-9]\d{2}[2-9]\d{6}$/;
166
- function z(t) {
221
+ const _e = /^[2-9]\d{2}[2-9]\d{6}$/;
222
+ function Z(t) {
167
223
  let e = t.replace(/\D/g, "");
168
- return e.length === 11 && e.startsWith("1") && (e = e.slice(1)), e.length !== 10 || !ve.test(e) ? null : e;
224
+ return e.length === 11 && e.startsWith("1") && (e = e.slice(1)), e.length !== 10 || !_e.test(e) ? null : e;
169
225
  }
170
- function Se(t) {
226
+ function Le(t) {
171
227
  const e = t.trim();
172
228
  if (!e) return "";
173
- const n = z(e);
229
+ const n = Z(e);
174
230
  if (!n) return e;
175
231
  const i = e.replace(/\D/g, "");
176
232
  return i.length === 11 && i.startsWith("1") ? `1${n}` : n;
177
233
  }
178
- const qe = {
234
+ const Se = {
179
235
  firstname: {
180
236
  name: "firstname",
181
237
  control: "text",
182
238
  label: "First name",
183
239
  autoComplete: "given-name",
184
- validate: O("First name")
240
+ validate: $("First name")
185
241
  },
186
242
  lastname: {
187
243
  name: "lastname",
188
244
  control: "text",
189
245
  label: "Last name",
190
246
  autoComplete: "family-name",
191
- validate: O("Last name")
247
+ validate: $("Last name")
192
248
  },
193
249
  email: {
194
250
  name: "email",
@@ -197,7 +253,7 @@ const qe = {
197
253
  autoComplete: "email",
198
254
  validate: (t, e) => {
199
255
  const n = t.trim();
200
- return n ? ee(n) || "Enter a valid email" : e ? "Email is required" : !0;
256
+ return n ? ne(n) || "Enter a valid email" : e ? "Email is required" : !0;
201
257
  }
202
258
  },
203
259
  phone: {
@@ -207,77 +263,38 @@ const qe = {
207
263
  autoComplete: "tel",
208
264
  validate: (t, e) => {
209
265
  const n = t.trim();
210
- return n ? z(n) ? !0 : "Enter a valid phone number" : e ? "Phone is required" : !0;
266
+ return n ? Z(n) ? !0 : "Enter a valid phone number" : e ? "Phone is required" : !0;
211
267
  },
212
- serialize: Se
268
+ serialize: Le
213
269
  }
214
270
  };
215
271
  function B(t) {
216
- return qe[t];
272
+ return Se[t];
217
273
  }
218
- function V({
274
+ function J({
219
275
  className: t,
220
276
  appearance: e,
221
277
  variantValue: n,
222
- kind: i,
223
- children: a
278
+ twoColumn: i,
279
+ kind: o,
280
+ children: r
224
281
  }) {
225
- return /* @__PURE__ */ l(
282
+ return /* @__PURE__ */ s(
226
283
  "div",
227
284
  {
228
285
  className: `usgb-form ${t ?? ""}`,
229
286
  "data-appearance": e,
230
287
  ...n ? { "data-variant": n } : {},
231
- "data-kind": i,
232
- children: a
288
+ ...i ? { "data-layout": "two-column" } : {},
289
+ "data-kind": o,
290
+ children: r
233
291
  }
234
292
  );
235
293
  }
236
- const Ce = [
237
- "hubspot_utk",
238
- "ga_client_id",
239
- "ga_session_id",
240
- "snowplow_id",
241
- "vwo_uuid"
242
- ];
243
- function C(t, e) {
244
- return t === "collected" && e != null && e !== "" ? { status: "collected", value: e } : { status: t };
245
- }
246
- function Le(t) {
247
- const { trackingFields: e, trackingRegistry: n, adapter: i } = t, a = i.getTrackingHints(), s = {};
248
- for (const r of e) {
249
- const o = n[r];
250
- if (!o) continue;
251
- const c = new Set(o.states);
252
- if (o.collection === "server") {
253
- s[r] = C("unavailable");
254
- continue;
255
- }
256
- if (o.collection === "browser") {
257
- if (r === "referrer" && typeof document < "u") {
258
- const f = document.referrer;
259
- s[r] = f ? C("collected", f) : C("unavailable");
260
- } else
261
- s[r] = C("unavailable");
262
- continue;
263
- }
264
- const u = a[r];
265
- if (u != null && u !== "") {
266
- s[r] = C("collected", u);
267
- continue;
268
- }
269
- if (Ce.includes(r) && c.has("consent-withheld")) {
270
- s[r] = C("unavailable");
271
- continue;
272
- }
273
- s[r] = C("unavailable");
274
- }
275
- return s;
276
- }
277
- function Ne() {
294
+ function Ce() {
278
295
  return typeof crypto < "u" && "randomUUID" in crypto ? crypto.randomUUID() : `usgb-${Date.now()}-${Math.random().toString(36).slice(2, 10)}`;
279
296
  }
280
- function Ee(t, e) {
297
+ function Ue(t, e) {
281
298
  const n = {};
282
299
  for (const i of t)
283
300
  n[i.name] = "";
@@ -285,124 +302,120 @@ function Ee(t, e) {
285
302
  n[i] = !1;
286
303
  return n;
287
304
  }
288
- function R(t) {
305
+ function M(t) {
289
306
  const e = t == null ? void 0 : t.trim();
290
307
  return e || void 0;
291
308
  }
292
- function De({
309
+ function Pe({
293
310
  formId: t,
294
311
  definition: e,
295
- source: n,
296
- campaign: i,
297
- legalUrls: a,
298
- successUrl: s,
299
- adapter: r,
300
- analytics: o,
301
- onAccepted: c,
302
- onFailed: u
312
+ legalUrls: n,
313
+ successUrl: i,
314
+ adapter: o,
315
+ analytics: r,
316
+ onAccepted: l,
317
+ onFailed: a
303
318
  }) {
304
- const f = te(), b = D(
305
- () => W(e.consents) ?? [],
319
+ const d = K(), u = D(
320
+ () => H(e.consents) ?? [],
306
321
  [e.consents]
307
- ), y = D(
308
- () => b.filter(we).map((w) => w.name),
309
- [b]
310
- ), p = D(
311
- () => Ee(e.fields, y),
312
- [e.fields, y]
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]
313
328
  ), {
314
- register: _,
315
- handleSubmit: m,
316
- formState: { errors: d }
329
+ register: g,
330
+ handleSubmit: C,
331
+ formState: { errors: w }
317
332
  } = re({
318
- defaultValues: p
319
- }), [q, h] = ne({ kind: "idle" });
320
- ie(() => {
321
- o == null || o({ type: "view", formId: t });
322
- }, [o, t]);
323
- const L = D(() => {
324
- const w = {};
325
- for (const v of e.fields)
326
- w[v.name] = `${f}-${v.name}`;
327
- for (const v of y)
328
- w[v] = `${f}-${v}`;
329
- return w;
330
- }, [f, e.fields, y]), x = m(async (w) => {
331
- const v = Object.keys(d);
332
- if (v.length) {
333
- o == null || o({
333
+ defaultValues: b
334
+ }), [m, _] = te({ kind: "idle" }), y = G(!1);
335
+ j(() => {
336
+ r == null || r({ type: "view", formId: t });
337
+ }, [r, t]);
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) => {
400
+ r == null || r({
334
401
  type: "validation_failure",
335
402
  formId: t,
336
- fields: v
403
+ fields: Object.keys(p)
337
404
  });
338
- return;
339
- }
340
- o == null || o({ type: "submit_attempt", formId: t }), h({ kind: "submitting" });
341
- const F = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), J = Le({
342
- trackingFields: e.trackingFields,
343
- trackingRegistry: I.trackingRegistry,
344
- adapter: r
345
- }), A = {};
346
- for (const k of e.fields) {
347
- const S = w[k.name];
348
- if (typeof S != "string") {
349
- A[k.name] = !!S;
350
- continue;
351
- }
352
- const U = B(k.name);
353
- A[k.name] = U != null && U.serialize ? U.serialize(S) : S.trim();
354
- }
355
- const Q = _e(
356
- b,
357
- w,
358
- a ?? {},
359
- F
360
- ), T = {
361
- formId: t,
362
- definitionVersion: e.definitionVersion,
363
- submissionContractVersion: I.submissionContract.version,
364
- idempotencyKey: Ne(),
365
- data: A,
366
- consents: Q,
367
- context: {
368
- host: r.host,
369
- source: n,
370
- campaign: i,
371
- page: typeof window < "u" ? window.location.href : void 0,
372
- tracking: J
373
- }
374
- };
375
- try {
376
- const k = await r.submit(T);
377
- if (k.status === "accepted") {
378
- o == null || o({ type: "success", formId: t, status: "accepted" }), c == null || c(T), h({ kind: "accepted" });
379
- const S = R(s);
380
- S && typeof window < "u" && window.location.assign(S);
381
- } else
382
- h({
383
- kind: "failed",
384
- message: k.message ?? "Submission failed"
385
- }), o == null || o({
386
- type: "failure",
387
- formId: t,
388
- message: k.message
389
- }), u == null || u(T, k.message);
390
- } catch (k) {
391
- const S = k instanceof Error ? k.message : "Submission failed";
392
- h({ kind: "failed", message: S }), o == null || o({ type: "failure", formId: t, message: S }), u == null || u(T, S);
393
405
  }
394
- });
406
+ );
395
407
  return {
396
- register: _,
397
- errors: d,
398
- fieldIds: L,
399
- consentDefs: b,
400
- uiState: q,
401
- onSubmit: x
408
+ register: g,
409
+ errors: w,
410
+ fieldIds: c,
411
+ noticeIds: v,
412
+ consentDefs: u,
413
+ uiState: m,
414
+ onSubmit: U
402
415
  };
403
416
  }
404
- function Pe() {
405
- return /* @__PURE__ */ g(
417
+ function De() {
418
+ return /* @__PURE__ */ h(
406
419
  "svg",
407
420
  {
408
421
  className: "usgb-field-error-icon",
@@ -414,7 +427,7 @@ function Pe() {
414
427
  "aria-hidden": "true",
415
428
  focusable: "false",
416
429
  children: [
417
- /* @__PURE__ */ l(
430
+ /* @__PURE__ */ s(
418
431
  "path",
419
432
  {
420
433
  d: "M7 13C10.3137 13 13 10.3137 13 7C13 3.68629 10.3137 1 7 1C3.68629 1 1 3.68629 1 7C1 10.3137 3.68629 13 7 13Z",
@@ -423,7 +436,7 @@ function Pe() {
423
436
  strokeWidth: "0.7"
424
437
  }
425
438
  ),
426
- /* @__PURE__ */ l(
439
+ /* @__PURE__ */ s(
427
440
  "path",
428
441
  {
429
442
  d: "M6.31724 3.75816L6.42662 8.16962H7.57506L7.68444 3.75816H6.31724ZM7.00084 10.4483C7.41555 10.4483 7.74367 10.1338 7.74367 9.73277C7.74367 9.33173 7.41555 9.01727 7.00084 9.01727C6.58613 9.01727 6.258 9.33173 6.258 9.73277C6.258 10.1338 6.58613 10.4483 7.00084 10.4483Z",
@@ -434,8 +447,8 @@ function Pe() {
434
447
  }
435
448
  );
436
449
  }
437
- function xe() {
438
- return /* @__PURE__ */ l(
450
+ function Te() {
451
+ return /* @__PURE__ */ s(
439
452
  "svg",
440
453
  {
441
454
  className: "usgb-form-checkbox-mark",
@@ -446,7 +459,7 @@ function xe() {
446
459
  xmlns: "http://www.w3.org/2000/svg",
447
460
  "aria-hidden": "true",
448
461
  focusable: "false",
449
- children: /* @__PURE__ */ l(
462
+ children: /* @__PURE__ */ s(
450
463
  "path",
451
464
  {
452
465
  d: "M1 3.5L2.33333 4.75L3.66667 6L9 1",
@@ -459,180 +472,201 @@ function xe() {
459
472
  }
460
473
  );
461
474
  }
462
- function K({
475
+ function O({
463
476
  id: t,
464
477
  message: e,
465
478
  className: n
466
479
  }) {
467
- return e ? /* @__PURE__ */ g(
480
+ return e ? /* @__PURE__ */ h(
468
481
  "span",
469
482
  {
470
483
  id: t,
471
484
  role: "alert",
472
- className: P("usgb-field-error", n),
485
+ className: A("usgb-field-error", n),
473
486
  children: [
474
- /* @__PURE__ */ l(Pe, {}),
487
+ /* @__PURE__ */ s(De, {}),
475
488
  e
476
489
  ]
477
490
  }
478
491
  ) : null;
479
492
  }
480
- const Fe = $(
481
- function({ id: e, label: n, errorMessage: i, required: a, className: s, ...r }, o) {
482
- const c = i ? `${e}-error` : void 0;
483
- return /* @__PURE__ */ g("div", { className: "usgb-form-group", children: [
484
- /* @__PURE__ */ g("div", { className: "usgb-consent-row", children: [
485
- /* @__PURE__ */ g("span", { className: "usgb-form-checkbox-wrap", children: [
486
- /* @__PURE__ */ l(
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: [
499
+ /* @__PURE__ */ s(
487
500
  "input",
488
501
  {
489
- ref: o,
502
+ ...l,
503
+ ref: a,
490
504
  id: e,
491
505
  type: "checkbox",
492
- className: P("usgb-form-checkbox", s),
506
+ className: A("usgb-form-checkbox", r),
493
507
  "aria-invalid": i ? !0 : void 0,
494
- "aria-describedby": c,
495
- "aria-required": a || void 0,
496
- ...r
508
+ "aria-describedby": d,
509
+ "aria-required": o || void 0
497
510
  }
498
511
  ),
499
- /* @__PURE__ */ l(xe, {})
512
+ /* @__PURE__ */ s(Te, {})
500
513
  ] }),
501
- /* @__PURE__ */ l("label", { htmlFor: e, className: "usgb-consent-copy", children: n })
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
+ ] })
502
525
  ] }),
503
- /* @__PURE__ */ l(K, { id: c, message: i })
526
+ /* @__PURE__ */ s(O, { id: d, message: i })
504
527
  ] });
505
528
  }
506
- ), Y = $(
529
+ ), Q = R(
507
530
  function({
508
531
  className: e,
509
532
  variant: n = "primary",
510
533
  loading: i = !1,
511
- disabled: a = !1,
512
- children: s,
513
- ...r
514
- }, o) {
515
- return /* @__PURE__ */ l(
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;
541
+ return /* @__PURE__ */ s(
516
542
  "button",
517
543
  {
518
- ref: o,
519
- type: r.type ?? "button",
520
- className: P(
544
+ ref: u,
545
+ type: a,
546
+ className: A(
521
547
  "usgb-btn",
522
548
  n === "primary" && "usgb-btn-primary",
523
549
  e
524
550
  ),
525
- disabled: a || i,
551
+ ...d,
552
+ disabled: b,
553
+ "aria-disabled": f || void 0,
526
554
  "aria-busy": i || void 0,
527
- ...r,
528
- children: i ? "Submitting…" : s
555
+ onClick: (g) => {
556
+ if (f) {
557
+ g.preventDefault();
558
+ return;
559
+ }
560
+ l == null || l(g);
561
+ },
562
+ children: i ? "Submitting…" : r
529
563
  }
530
564
  );
531
565
  }
532
566
  );
533
- function Te(t) {
567
+ function Ee(t) {
534
568
  const e = [];
535
569
  let n = 0;
536
570
  for (; n < t.length; ) {
537
571
  const i = t[n];
538
572
  if (i.group) {
539
- const a = i.group, s = [];
540
- for (; n < t.length && t[n].group === a; )
541
- s.push(t[n]), n += 1;
542
- e.push({ type: "group", group: a, fields: s });
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 });
543
577
  continue;
544
578
  }
545
579
  e.push({ type: "field", field: i }), n += 1;
546
580
  }
547
581
  return e;
548
582
  }
549
- function Ue({
583
+ function Ie({
550
584
  htmlFor: t,
551
585
  children: e,
552
586
  className: n,
553
587
  required: i
554
588
  }) {
555
- return /* @__PURE__ */ g("label", { htmlFor: t, className: P("usgb-field-label", n), children: [
589
+ return /* @__PURE__ */ h("label", { htmlFor: t, className: A("usgb-field-label", n), children: [
556
590
  e,
557
- i ? /* @__PURE__ */ l("span", { className: "usgb-field-label-asterisk", "aria-hidden": "true", children: "*" }) : null
591
+ i ? /* @__PURE__ */ s("span", { className: "usgb-field-label-asterisk", "aria-hidden": "true", children: "*" }) : null
558
592
  ] });
559
593
  }
560
- function Ie(t) {
594
+ function Fe(t) {
561
595
  return t.replace(/\b\w/g, (e) => e.toUpperCase());
562
596
  }
563
- const Ae = $(
597
+ const Ne = R(
564
598
  function({
565
599
  id: e,
566
600
  label: n,
567
601
  type: i = "text",
568
- errorMessage: a,
569
- required: s,
570
- hideLabel: r = !1,
571
- placeholderCase: o = "upper",
572
- showError: c = !0,
602
+ errorMessage: o,
603
+ required: r,
604
+ hideLabel: l = !1,
605
+ placeholderCase: a = "upper",
606
+ showError: d = !0,
573
607
  className: u,
574
608
  placeholder: f,
575
609
  ...b
576
- }, y) {
577
- const p = a ? `${e}-error` : void 0, _ = r ? `${n}${s ? "*" : ""}` : f, m = r && _ ? o === "title" ? Ie(_) : _.toUpperCase() : _;
578
- return /* @__PURE__ */ g("div", { className: "usgb-form-group", children: [
579
- /* @__PURE__ */ l(
580
- Ue,
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: [
613
+ /* @__PURE__ */ s(
614
+ Ie,
581
615
  {
582
616
  htmlFor: e,
583
- required: s,
584
- className: r ? "usgb-field-label--sr-only" : void 0,
617
+ required: r,
618
+ className: l ? "usgb-field-label--sr-only" : void 0,
585
619
  children: n
586
620
  }
587
621
  ),
588
- /* @__PURE__ */ l(
622
+ /* @__PURE__ */ s(
589
623
  "input",
590
624
  {
591
- ref: y,
625
+ ref: g,
592
626
  id: e,
593
627
  type: i,
594
- className: P(
628
+ className: A(
595
629
  "usgb-field-control",
596
- a && "usgb-field-invalid",
630
+ o && "usgb-field-invalid",
597
631
  u
598
632
  ),
599
633
  placeholder: m,
600
- "aria-invalid": a ? !0 : void 0,
601
- "aria-describedby": p,
602
- "aria-required": s || void 0,
634
+ "aria-invalid": o ? !0 : void 0,
635
+ "aria-describedby": C,
636
+ "aria-required": r || void 0,
603
637
  ...b
604
638
  }
605
639
  ),
606
- c ? /* @__PURE__ */ l(K, { id: p, message: a }) : null
640
+ d ? /* @__PURE__ */ s(O, { id: C, message: o }) : null
607
641
  ] });
608
642
  }
609
643
  );
610
- function M({
644
+ function V({
611
645
  fieldRef: t,
612
646
  fieldIds: e,
613
647
  register: n,
614
648
  errors: i,
615
- hideLabel: a,
616
- placeholderCase: s,
617
- showError: r = !0
649
+ hideLabel: o,
650
+ placeholderCase: r,
651
+ showError: l = !0
618
652
  }) {
619
- const o = B(t.name);
620
- if (!o) return null;
621
- const c = i[t.name], u = typeof (c == null ? void 0 : c.message) == "string" ? c.message : void 0;
622
- return /* @__PURE__ */ l(
623
- Ae,
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;
656
+ return /* @__PURE__ */ s(
657
+ Ne,
624
658
  {
625
659
  id: e[t.name],
626
- label: o.label,
627
- type: o.control,
660
+ label: a.label,
661
+ type: a.control,
628
662
  required: t.required,
629
- hideLabel: a,
630
- placeholderCase: s,
631
- showError: r,
632
- autoComplete: o.autoComplete,
663
+ hideLabel: o,
664
+ placeholderCase: r,
665
+ showError: l,
666
+ autoComplete: a.autoComplete,
633
667
  errorMessage: u,
634
668
  ...n(t.name, {
635
- validate: (f) => o.validate(
669
+ validate: (f) => a.validate(
636
670
  typeof f == "string" ? f : "",
637
671
  t.required
638
672
  )
@@ -640,225 +674,252 @@ function M({
640
674
  }
641
675
  );
642
676
  }
643
- function Ve({
677
+ function xe({
644
678
  definition: t,
645
- variants: e,
679
+ variant: e,
646
680
  ctaLabel: n,
647
681
  legalUrls: i,
648
- session: a
682
+ session: o,
683
+ headingId: r
649
684
  }) {
650
- const { register: s, errors: r, fieldIds: o, consentDefs: c, uiState: u, onSubmit: f } = a, b = D(
651
- () => Te(t.fields),
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),
652
695
  [t.fields]
653
- ), y = e.includes("sidebar"), p = e.includes("dense") || y, _ = y ? "title" : "upper";
654
- return /* @__PURE__ */ g("form", { onSubmit: f, noValidate: !0, children: [
655
- b.map((m) => m.type === "group" ? /* @__PURE__ */ l(
656
- "div",
657
- {
658
- className: "usgb-form-grid",
659
- children: m.fields.map((d) => /* @__PURE__ */ l(
660
- M,
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",
706
+ {
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
+ ))
720
+ },
721
+ `group-${c.group}-${c.fields.map((v) => v.name).join("-")}`
722
+ ) : /* @__PURE__ */ s(
723
+ V,
661
724
  {
662
- fieldRef: d,
663
- fieldIds: o,
664
- register: s,
665
- errors: r,
666
- hideLabel: p,
725
+ fieldRef: c.field,
726
+ fieldIds: d,
727
+ register: l,
728
+ errors: a,
729
+ hideLabel: m,
667
730
  placeholderCase: _
668
731
  },
669
- d.name
670
- ))
671
- },
672
- `group-${m.group}-${m.fields.map((d) => d.name).join("-")}`
673
- ) : /* @__PURE__ */ l(
674
- M,
675
- {
676
- fieldRef: m.field,
677
- fieldIds: o,
678
- register: s,
679
- errors: r,
680
- hideLabel: p,
681
- placeholderCase: _
682
- },
683
- m.field.name
684
- )),
685
- c.map((m) => {
686
- const { content: d } = j(
687
- m.copy,
688
- i ?? {}
689
- );
690
- if (m.type === "notice")
691
- return /* @__PURE__ */ l(
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(
692
774
  "p",
693
775
  {
694
- className: "usgb-consent-copy usgb-consent-notice",
695
- children: d
696
- },
697
- m.definitionId
698
- );
699
- const q = r[m.name], h = typeof (q == null ? void 0 : q.message) == "string" ? q.message : void 0;
700
- return /* @__PURE__ */ l(
701
- Fe,
702
- {
703
- id: o[m.name],
704
- label: d,
705
- required: m.required,
706
- errorMessage: h,
707
- ...s(m.name, {
708
- required: m.required ? "This field is required" : !1
709
- })
710
- },
711
- m.name
712
- );
713
- }),
714
- /* @__PURE__ */ l(Y, { type: "submit", loading: u.kind === "submitting", children: n }),
715
- u.kind === "failed" ? /* @__PURE__ */ l(
716
- "p",
717
- {
718
- className: "usgb-form-status usgb-form-status-error",
719
- role: "alert",
720
- children: u.message ?? "Something went wrong. Please try again."
721
- }
722
- ) : null
723
- ] });
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
+ );
724
784
  }
725
- function Re({
785
+ function Me({
726
786
  definition: t,
727
787
  ctaLabel: e,
728
- session: n
788
+ session: n,
789
+ headingId: i
729
790
  }) {
730
- var f;
731
- const { register: i, errors: a, fieldIds: s, uiState: r, onSubmit: o } = n, c = t.fields.find((b) => b.name === "email"), u = typeof ((f = a.email) == null ? void 0 : f.message) == "string" ? a.email.message : void 0;
732
- return c ? /* @__PURE__ */ g("form", { onSubmit: o, noValidate: !0, children: [
733
- /* @__PURE__ */ g("div", { className: "usgb-form-inline", children: [
734
- /* @__PURE__ */ l(
735
- M,
736
- {
737
- fieldRef: c,
738
- fieldIds: s,
739
- register: i,
740
- errors: a,
741
- hideLabel: !0,
742
- placeholderCase: "upper",
743
- showError: !1
744
- }
745
- ),
746
- /* @__PURE__ */ l(Y, { type: "submit", loading: r.kind === "submitting", children: e })
747
- ] }),
748
- /* @__PURE__ */ l(
749
- K,
750
- {
751
- id: u ? `${s.email}-error` : void 0,
752
- message: u
753
- }
754
- ),
755
- r.kind === "failed" ? /* @__PURE__ */ l(
756
- "p",
757
- {
758
- className: "usgb-form-status usgb-form-status-error",
759
- role: "alert",
760
- children: r.message ?? "Something went wrong. Please try again."
761
- }
762
- ) : null
763
- ] }) : /* @__PURE__ */ l("p", { className: "usgb-form-status usgb-form-status-error", role: "alert", children: "Newsletter kind requires an email field" });
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" });
764
833
  }
765
- const Z = {
766
- lead: Ve,
767
- newsletter: Re
768
- }, Me = "Thank you. Your request has been accepted and is being processed.";
769
- function E({
834
+ const X = {
835
+ lead: xe,
836
+ newsletter: Me
837
+ }, Ve = "Thank you. Your request has been accepted and is being processed.";
838
+ function T({
770
839
  className: t,
771
840
  appearance: e,
772
841
  variantValue: n,
773
- kind: i,
774
- children: a
842
+ twoColumn: i,
843
+ kind: o,
844
+ children: r
775
845
  }) {
776
- return /* @__PURE__ */ l(
777
- V,
846
+ return /* @__PURE__ */ s(
847
+ J,
778
848
  {
779
849
  className: t,
780
850
  appearance: e,
781
851
  variantValue: n,
782
- kind: i,
783
- children: /* @__PURE__ */ l("p", { className: "usgb-form-status usgb-form-status-error", role: "alert", children: a })
852
+ twoColumn: i,
853
+ kind: o,
854
+ children: /* @__PURE__ */ s("p", { className: "usgb-form-status usgb-form-status-error", role: "alert", children: r })
784
855
  }
785
856
  );
786
857
  }
787
- function $e({
858
+ function Re({
788
859
  formId: t,
789
860
  definition: e,
790
861
  appearance: n,
791
- variants: i,
792
- variantValue: a,
793
- heading: s,
794
- subheading: r,
795
- ctaLabel: o,
796
- source: c,
797
- campaign: u,
798
- legalUrls: f,
799
- successMessage: b,
800
- successUrl: y,
801
- adapter: p,
802
- analytics: _,
803
- className: m,
804
- onAccepted: d,
805
- onFailed: q
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,
871
+ adapter: g,
872
+ analytics: C,
873
+ className: w,
874
+ onAccepted: m,
875
+ onFailed: _
806
876
  }) {
807
- const h = De({
877
+ const y = K(), c = l ? `${y}-heading` : void 0, v = G(null), U = Pe({
808
878
  formId: t,
809
879
  definition: e,
810
- variantValue: a,
811
- source: c,
812
- campaign: u,
813
- legalUrls: f,
814
- successUrl: y,
815
- adapter: p,
816
- analytics: _,
817
- onAccepted: d,
818
- onFailed: q
819
- });
820
- if (h.uiState.kind === "accepted") {
821
- const x = !!R(y);
822
- return /* @__PURE__ */ g(
823
- V,
824
- {
825
- className: m,
826
- appearance: n,
827
- variantValue: a,
828
- kind: e.kind,
829
- children: [
830
- s ? /* @__PURE__ */ l("h2", { className: "usgb-form-heading", children: s }) : null,
831
- x ? null : /* @__PURE__ */ l(
832
- "p",
833
- {
834
- className: "usgb-form-status usgb-form-status-success",
835
- role: "status",
836
- children: R(b) ?? Me
837
- }
838
- )
839
- ]
840
- }
841
- );
842
- }
843
- const L = Z[e.kind];
844
- return /* @__PURE__ */ g(
845
- V,
880
+ legalUrls: u,
881
+ successUrl: b,
882
+ adapter: g,
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,
846
894
  {
847
- className: m,
895
+ className: w,
848
896
  appearance: n,
849
- variantValue: a,
897
+ variantValue: o,
898
+ twoColumn: r,
850
899
  kind: e.kind,
851
900
  children: [
852
- s ? /* @__PURE__ */ l("h2", { className: "usgb-form-heading", children: s }) : null,
853
- r ? /* @__PURE__ */ l("p", { className: "usgb-form-subheading", children: r }) : null,
854
- /* @__PURE__ */ l(
855
- L,
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,
856
905
  {
857
906
  definition: e,
858
- variants: i,
859
- ctaLabel: o,
860
- legalUrls: f,
861
- session: h
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
862
923
  }
863
924
  )
864
925
  ]
@@ -868,152 +929,147 @@ function $e({
868
929
  function We({
869
930
  formId: t,
870
931
  appearance: e = "on-light",
871
- variants: n = ["dense"],
872
- heading: i,
873
- subheading: a,
874
- ctaLabel: s,
875
- source: r,
876
- campaign: o,
877
- legalUrls: c,
878
- successMessage: u,
879
- successUrl: f,
880
- adapter: b,
881
- analytics: y,
882
- className: p,
883
- onAccepted: _,
884
- onFailed: m
932
+ variant: n = "dense",
933
+ twoColumn: i = !1,
934
+ heading: o,
935
+ subheading: r,
936
+ ctaLabel: l,
937
+ legalUrls: a,
938
+ successMessage: d,
939
+ successUrl: u,
940
+ adapter: f,
941
+ analytics: b,
942
+ className: g,
943
+ onAccepted: C,
944
+ onFailed: w
885
945
  }) {
886
- const d = ue(t), h = (d == null ? void 0 : d.kind) === "newsletter" ? "" : n.join(" ");
887
- if (!d)
888
- return /* @__PURE__ */ g(
889
- E,
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,
890
950
  {
891
- className: p,
951
+ className: g,
892
952
  appearance: e,
893
- variantValue: h,
953
+ variantValue: y,
954
+ twoColumn: c,
894
955
  children: [
895
956
  "Unknown form definition: ",
896
957
  t
897
958
  ]
898
959
  }
899
960
  );
900
- const L = W(d.consents);
901
- if (L === null)
902
- return /* @__PURE__ */ g(
903
- E,
961
+ const v = H(m.consents);
962
+ if (v === null)
963
+ return /* @__PURE__ */ h(
964
+ T,
904
965
  {
905
- className: p,
966
+ className: g,
906
967
  appearance: e,
907
- variantValue: h,
908
- kind: d.kind,
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 w = ke(L).filter(
916
- (N) => {
917
- var F;
918
- return !((F = c == null ? void 0 : c[N]) != null && F.trim());
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
982
  );
921
- if (w.length)
922
- return /* @__PURE__ */ g(
923
- E,
983
+ if (p.length)
984
+ return /* @__PURE__ */ h(
985
+ T,
924
986
  {
925
- className: p,
987
+ className: g,
926
988
  appearance: e,
927
- variantValue: h,
928
- kind: d.kind,
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
- w.join(", ")
996
+ p.join(", ")
934
997
  ]
935
998
  }
936
999
  );
937
- const v = d.fields.filter(
938
- (N) => !B(N.name)
1000
+ const k = m.fields.filter(
1001
+ (q) => !B(q.name)
939
1002
  );
940
- return v.length ? /* @__PURE__ */ g(
941
- E,
1003
+ return k.length ? /* @__PURE__ */ h(
1004
+ T,
942
1005
  {
943
- className: p,
1006
+ className: g,
944
1007
  appearance: e,
945
- variantValue: h,
946
- kind: d.kind,
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
- v.map((N) => N.name).join(", ")
1016
+ k.map((q) => q.name).join(", ")
953
1017
  ]
954
1018
  }
955
- ) : d.kind in Z ? /* @__PURE__ */ l(
956
- $e,
1019
+ ) : m.kind in X ? /* @__PURE__ */ s(
1020
+ Re,
957
1021
  {
958
1022
  formId: t,
959
- definition: d,
1023
+ definition: m,
960
1024
  appearance: e,
961
- variants: n,
962
- variantValue: h,
963
- heading: i,
964
- subheading: a,
965
- ctaLabel: s ?? d.ctaLabel,
966
- source: r,
967
- campaign: o,
968
- legalUrls: c,
969
- successMessage: u,
970
- successUrl: f,
971
- adapter: b,
972
- analytics: y,
973
- className: p,
974
- onAccepted: _,
975
- onFailed: m
1025
+ variant: n,
1026
+ variantValue: y,
1027
+ twoColumn: c,
1028
+ heading: o,
1029
+ subheading: r,
1030
+ ctaLabel: l ?? m.ctaLabel,
1031
+ legalUrls: a,
1032
+ successMessage: d,
1033
+ successUrl: u,
1034
+ adapter: f,
1035
+ analytics: b,
1036
+ className: g,
1037
+ onAccepted: C,
1038
+ onFailed: w
976
1039
  }
977
- ) : /* @__PURE__ */ g(
978
- E,
1040
+ ) : /* @__PURE__ */ h(
1041
+ T,
979
1042
  {
980
- className: p,
1043
+ className: g,
981
1044
  appearance: e,
982
- variantValue: h,
983
- kind: d.kind,
1045
+ variantValue: y,
1046
+ twoColumn: c,
1047
+ kind: m.kind,
984
1048
  children: [
985
1049
  "Missing renderer for kind: ",
986
- d.kind
1050
+ m.kind
987
1051
  ]
988
1052
  }
989
1053
  );
990
1054
  }
991
- function ze(t = {}) {
992
- const e = typeof t == "string" ? { host: t } : t, n = e.host ?? "pwa", i = e.delayMs ?? 400, a = e.result ?? { status: "accepted" };
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
- getTrackingHints() {
996
- if (typeof window > "u") return {};
997
- const s = new URLSearchParams(window.location.search), r = (o) => s.get(o) ?? void 0;
998
- return {
999
- utm_source: r("utm_source"),
1000
- utm_medium: r("utm_medium"),
1001
- utm_campaign: r("utm_campaign"),
1002
- utm_term: r("utm_term"),
1003
- utm_content: r("utm_content"),
1004
- gclid: r("gclid"),
1005
- msclkid: r("msclkid"),
1006
- gbraid: r("gbraid"),
1007
- wbraid: r("wbraid")
1008
- };
1009
- },
1010
- async submit(s) {
1011
- var r;
1012
- return (r = e.onSubmit) == null || r.call(e, s), await new Promise((o) => setTimeout(o, i)), a;
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
  }
1016
- const Ye = {
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 = {
1017
1073
  clientAgreement: "/content/client-agreement",
1018
1074
  privacyPolicy: "/content/privacy-policy",
1019
1075
  userAgreement: "/content/user-agreement",
@@ -1021,34 +1077,38 @@ const Ye = {
1021
1077
  electronicDisclaimer: "/content/electronic-disclaimer",
1022
1078
  termsOfSale: "/content/terms-of-sale"
1023
1079
  };
1024
- function Ze(t, e) {
1080
+ function Je(t, e) {
1025
1081
  return e.every((n) => {
1026
1082
  var i;
1027
1083
  return !!((i = t == null ? void 0 : t[n]) != null && i.trim());
1028
1084
  });
1029
1085
  }
1030
1086
  export {
1031
- Y as Button,
1032
- Fe as ConsentField,
1033
- qe as FIELD_REGISTRY,
1034
- K as FieldError,
1035
- Ue as FieldLabel,
1036
- pe as LEAD_CLICKWRAP,
1037
- fe as LEAD_SMS,
1038
- me as LEAD_TCPA,
1039
- ge as LEAD_TOSPP,
1040
- Ye as PWA_LEGAL_URLS,
1041
- Ae as TextField,
1087
+ Q as Button,
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,
1042
1101
  We as UsgbForm,
1043
- Le as collectTrackingContext,
1044
- Ne as createIdempotencyKey,
1045
- ze as createStubAdapter,
1046
- I as formsManifest,
1047
- ye as getConsentDefinition,
1102
+ we as collectRequiredLegalUrls,
1103
+ Ce as createIdempotencyKey,
1104
+ Ye as createStubAdapter,
1105
+ N as formsManifest,
1106
+ ve as getConsentDefinition,
1048
1107
  B as getFieldDefinition,
1049
- ue as getFormDefinition,
1050
- Ze as isCompleteLegalUrls,
1051
- He as listFormDefinitions,
1052
- j as resolveConsentCopy,
1053
- W as resolveFormConsents
1108
+ z as getFormDefinition,
1109
+ Je as isCompleteLegalUrls,
1110
+ ze as listEditorOptions,
1111
+ je as listFormDefinitions,
1112
+ W as resolveConsentCopy,
1113
+ H as resolveFormConsents
1054
1114
  };