@usgb/forms 1.0.5 → 1.0.6

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/dist/index.js CHANGED
@@ -1,33 +1,33 @@
1
- import { jsx as s, Fragment as ee, jsxs as h } from "react/jsx-runtime";
2
- import { useId as $, useMemo as T, useState as te, useRef as K, useEffect as H, forwardRef as M } from "react";
3
- import { validate as ne } from "email-validator";
4
- import { useForm as re } from "react-hook-form";
5
- import D from "classnames";
6
- const ae = "1.1.0", ie = { 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-10dlc": { 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 10DLC", 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-401k": { 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 401k", 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": { 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", 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"] } }, "magento-footer": { definitionVersion: "1", kind: "newsletter", flow: { type: "single" }, fields: [{ name: "email", required: !0 }], ctaLabel: "SUBSCRIBE", editor: { label: "Magento Footer", description: "Email only. No consent.", whenToUse: "TBD", whenNotToUse: "TBD", options: ["appearance", "heading", "subheading", "ctaLabel", "successMessage", "successUrl"], supportedAppearances: ["on-light", "on-dark"], supportedVariants: [], requiredLegalUrls: [] } }, "wp-full-lead": { 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: "Submit", consents: [{ definitionId: "lead-clickwrap", definitionVersion: "2" }], editor: { label: "Full Lead Form (WP GF 1)", description: "First name, last name, email, and phone required. Clickwrap notice only (lead-clickwrap v2); no consent checkboxes. GF form 1 → HubSpot 1ebf148f.", 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"] } }, "wp-request-call-back": { 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: "Submit", consents: [{ definitionId: "lead-clickwrap", definitionVersion: "2" }], editor: { label: "Request Call Back (WP GF 11)", description: "First name, last name, email, and phone required. Clickwrap notice only (lead-clickwrap v2). Host sets `requested_callback=true` as context. GF form 11 → HubSpot 25c0c6ca.", 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"] } }, "wp-investor-kit-lead-nurturing": { 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: "Submit", consents: [{ definitionId: "lead-clickwrap", definitionVersion: "2" }], editor: { label: "Investor Kit Lead Nurturing (WP GF 13)", description: "First name, last name, email, and phone required. Clickwrap notice only (lead-clickwrap v2). GF form 13 → HubSpot 1ebf148f.", 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"] } }, "wp-product-launch": { 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: "Reserve Yours Today", consents: [{ definitionId: "lead-clickwrap", definitionVersion: "2" }], editor: { label: "Product Launch (WP GF 15)", description: "First name, last name, email, and phone required. Clickwrap notice only (lead-clickwrap v2). Product IPO/pre-IPO pages. GF form 15 → HubSpot 950c50a1.", 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"] } }, "wp-ira-full-lead": { 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: "Submit", consents: [{ definitionId: "lead-clickwrap", definitionVersion: "2" }], editor: { label: "IRA Full Lead Form (WP GF 20)", description: "First name, last name, email, and phone required. Clickwrap notice only (lead-clickwrap v2). Host sets `ira_lead=true` as context. GF form 20 → HubSpot b42770ef.", 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"] } }, "wp-affiliate-ira-full-lead": { 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: "Submit", consents: [{ definitionId: "lead-clickwrap", definitionVersion: "2" }], editor: { label: "Affiliate — IRA Full Lead Form (WP GF 21)", description: "First name, last name, email, and phone required. Clickwrap notice only (lead-clickwrap v2). Host supplies affiliate_id/affiliate_offer_id/affiliate_transaction_id as context (not schema fields). GF form 21 → HubSpot 1d4e44b3.", 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"] } }, "wp-full-lead-captcha": { 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: "Submit", consents: [{ definitionId: "lead-clickwrap", definitionVersion: "2" }], editor: { label: "Full Lead Form — captcha (WP GF 22)", description: "First name, last name, email, and phone required. Clickwrap notice only (lead-clickwrap v2). reCAPTCHA is a host bot-control concern, not a schema field. GF form 22 → HubSpot 034c00e5.", 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"] } } }, ce = { hosts: ["pwa", "wordpress"], mayProvide: ["legal document URLs", "host/store identity"], mustNotDefine: ["consent definitions", "form fields", "submission endpoints"] }, de = {
7
- schemaVersion: ae,
1
+ import { jsx as s, Fragment as X, jsxs as h } from "react/jsx-runtime";
2
+ import { useId as G, useMemo as F, useState as ee, useRef as $, useEffect as K, forwardRef as B } from "react";
3
+ import { validate as te } from "email-validator";
4
+ import { useForm as ne } from "react-hook-form";
5
+ import A from "classnames";
6
+ const re = "1.1.0", ae = { version: "1.0.0", transport: "server-proxy" }, ie = { 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"] } }, oe = { 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." } }, se = { "magento-fik-10dlc": { 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 10DLC", 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-401k": { 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 401k", 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": { 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: !0 }], editor: { label: "Magento FIK", description: "First name, last name, email, and phone required. Required 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-footer": { definitionVersion: "1", kind: "newsletter", flow: { type: "single" }, fields: [{ name: "email", required: !0 }], ctaLabel: "SUBSCRIBE", editor: { label: "Magento Footer", description: "Email only. No consent.", whenToUse: "TBD", whenNotToUse: "TBD", options: ["appearance", "heading", "subheading", "ctaLabel", "successMessage", "successUrl"], supportedAppearances: ["on-light", "on-dark"], supportedVariants: [], requiredLegalUrls: [] } }, "wp-full-lead": { 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: "Submit", consents: [{ definitionId: "lead-clickwrap", definitionVersion: "2" }], editor: { label: "Full Lead Form (WP GF 1)", description: "First name, last name, email, and phone required. Clickwrap notice only (lead-clickwrap v2); no consent checkboxes. GF form 1 → HubSpot 1ebf148f.", 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"] } }, "wp-request-call-back": { 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: "Submit", consents: [{ definitionId: "lead-clickwrap", definitionVersion: "2" }], editor: { label: "Request Call Back (WP GF 11)", description: "First name, last name, email, and phone required. Clickwrap notice only (lead-clickwrap v2). Host sets `requested_callback=true` as context. GF form 11 → HubSpot 25c0c6ca.", 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"] } }, "wp-investor-kit-lead-nurturing": { 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: "Submit", consents: [{ definitionId: "lead-clickwrap", definitionVersion: "2" }], editor: { label: "Investor Kit Lead Nurturing (WP GF 13)", description: "First name, last name, email, and phone required. Clickwrap notice only (lead-clickwrap v2). GF form 13 → HubSpot 1ebf148f.", 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"] } }, "wp-product-launch": { 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: "Reserve Yours Today", consents: [{ definitionId: "lead-clickwrap", definitionVersion: "2" }], editor: { label: "Product Launch (WP GF 15)", description: "First name, last name, email, and phone required. Clickwrap notice only (lead-clickwrap v2). Product IPO/pre-IPO pages. GF form 15 → HubSpot 950c50a1.", 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"] } }, "wp-ira-full-lead": { 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: "Submit", consents: [{ definitionId: "lead-clickwrap", definitionVersion: "2" }], editor: { label: "IRA Full Lead Form (WP GF 20)", description: "First name, last name, email, and phone required. Clickwrap notice only (lead-clickwrap v2). Host sets `ira_lead=true` as context. GF form 20 → HubSpot b42770ef.", 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"] } }, "wp-affiliate-ira-full-lead": { 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: "Submit", consents: [{ definitionId: "lead-clickwrap", definitionVersion: "2" }], editor: { label: "Affiliate — IRA Full Lead Form (WP GF 21)", description: "First name, last name, email, and phone required. Clickwrap notice only (lead-clickwrap v2). Host supplies affiliate_id/affiliate_offer_id/affiliate_transaction_id as context (not schema fields). GF form 21 → HubSpot 1d4e44b3.", 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"] } }, "wp-full-lead-captcha": { 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: "Submit", consents: [{ definitionId: "lead-clickwrap", definitionVersion: "2" }], editor: { label: "Full Lead Form — captcha (WP GF 22)", description: "First name, last name, email, and phone required. Clickwrap notice only (lead-clickwrap v2). reCAPTCHA is a host bot-control concern, not a schema field. GF form 22 → HubSpot 034c00e5.", 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"] } } }, le = { hosts: ["pwa", "wordpress"], mayProvide: ["legal document URLs", "host/store identity"], mustNotDefine: ["consent definitions", "form fields", "submission endpoints"] }, ce = {
7
+ schemaVersion: re,
8
8
  package: { name: "@usgb/forms", compatiblePackageVersions: "^1.0.2" },
9
- submissionContract: ie,
10
- trackingRegistry: oe,
11
- editorOptions: se,
12
- forms: le,
13
- hostAdapterContract: ce
14
- }, E = de;
15
- function W(t) {
16
- return E.forms[t];
9
+ submissionContract: ae,
10
+ trackingRegistry: ie,
11
+ editorOptions: oe,
12
+ forms: se,
13
+ hostAdapterContract: le
14
+ }, N = ce;
15
+ function H(t) {
16
+ return N.forms[t];
17
17
  }
18
18
  function We() {
19
- return Object.entries(E.forms).map(([t, e]) => ({
19
+ return Object.entries(N.forms).map(([t, e]) => ({
20
20
  formId: t,
21
21
  definition: e
22
22
  }));
23
23
  }
24
24
  function je(t) {
25
- const e = W(t);
25
+ const e = H(t);
26
26
  if (!e)
27
27
  return [];
28
28
  const n = [];
29
29
  for (const a of e.editor.options) {
30
- const i = E.editorOptions[a];
30
+ const i = N.editorOptions[a];
31
31
  if (!i)
32
32
  continue;
33
33
  const r = i.valuesFrom ? [...e.editor[i.valuesFrom]] : void 0;
@@ -40,18 +40,18 @@ function je(t) {
40
40
  }
41
41
  return n;
42
42
  }
43
- function j(t, e) {
43
+ function W(t, e) {
44
44
  return typeof t == "string" ? { content: t, language: t } : t(e);
45
45
  }
46
- function z(t, e) {
46
+ function j(t, e) {
47
47
  return `${t}@${e}`;
48
48
  }
49
- function A(t) {
49
+ function I(t) {
50
50
  return (e) => ({
51
51
  language: t.map(
52
52
  (n) => typeof n == "string" ? n : `${n.label} (${e[n.href] ?? ""})`
53
53
  ).join(""),
54
- content: /* @__PURE__ */ s(ee, { children: t.map(
54
+ content: /* @__PURE__ */ s(X, { children: t.map(
55
55
  (n, a) => typeof n == "string" ? n : /* @__PURE__ */ h(
56
56
  "a",
57
57
  {
@@ -71,7 +71,7 @@ function A(t) {
71
71
  ) })
72
72
  });
73
73
  }
74
- const ue = {
74
+ const de = {
75
75
  definitionId: "lead-tcpa",
76
76
  definitionVersion: "1",
77
77
  type: "checkbox",
@@ -80,7 +80,7 @@ const ue = {
80
80
  requiredLegalUrls: [],
81
81
  languageKey: "tcpa_consent_language",
82
82
  copy: "By checking, you are allowing to receive transactional/informational SMS communications regarding account notifications, customer care, etc, from U.S. Gold Bureau. Messages frequency may vary. Data rates may apply, reply STOP to opt-out"
83
- }, me = {
83
+ }, ue = {
84
84
  definitionId: "lead-tcpa",
85
85
  definitionVersion: "2",
86
86
  type: "checkbox",
@@ -88,14 +88,14 @@ const ue = {
88
88
  grantDateField: "tcpa_form_opt_in_date",
89
89
  requiredLegalUrls: ["userAgreement", "privacyPolicy"],
90
90
  languageKey: "tcpa_consent_language",
91
- copy: A([
91
+ copy: I([
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 ",
95
95
  { href: "privacyPolicy", label: "privacy policy" },
96
96
  ". Calls are recorded and may be monitored."
97
97
  ])
98
- }, pe = {
98
+ }, me = {
99
99
  definitionId: "lead-tcpa",
100
100
  definitionVersion: "3",
101
101
  type: "checkbox",
@@ -103,39 +103,42 @@ const ue = {
103
103
  grantDateField: "tcpa_form_opt_in_date",
104
104
  requiredLegalUrls: ["userAgreement", "privacyPolicy"],
105
105
  languageKey: "tcpa_consent_language",
106
- copy: A([
106
+ copy: I([
107
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
108
  { href: "userAgreement", label: "Terms of Service" },
109
109
  " and ",
110
110
  { href: "privacyPolicy", label: "Privacy Policy" },
111
111
  "."
112
112
  ])
113
- }, ge = {
113
+ }, pe = {
114
114
  definitionId: "lead-sms",
115
115
  definitionVersion: "1",
116
116
  type: "checkbox",
117
117
  name: "sms_form_consent_granted",
118
+ grantDateField: "sms_form_opt_in_date",
118
119
  requiredLegalUrls: [],
119
120
  languageKey: "sms_consent_language",
120
121
  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."
121
- }, fe = {
122
+ }, ge = {
122
123
  definitionId: "lead-tospp",
123
124
  definitionVersion: "1",
124
125
  type: "checkbox",
125
126
  name: "tospp_form_consent_granted",
127
+ grantDateField: "tospp_form_opt_in_date",
126
128
  requiredLegalUrls: ["userAgreement", "privacyPolicy"],
127
129
  languageKey: "tospp_consent_language",
128
- copy: A([
130
+ copy: I([
129
131
  "By checking, I accept ",
130
132
  { href: "userAgreement", label: "Terms of Conditions" },
131
133
  " & ",
132
134
  { href: "privacyPolicy", label: "Privacy Policy" },
133
135
  "."
134
136
  ])
135
- }, he = {
137
+ }, fe = {
136
138
  definitionId: "lead-clickwrap",
137
139
  definitionVersion: "1",
138
140
  type: "notice",
141
+ optInDateField: "tcpa_form_opt_in_date",
139
142
  requiredLegalUrls: [
140
143
  "privacyPolicy",
141
144
  "userAgreement",
@@ -143,8 +146,8 @@ const ue = {
143
146
  "electronicDisclaimer",
144
147
  "termsOfSale"
145
148
  ],
146
- languageKey: "clickwrap_consent_language",
147
- copy: A([
149
+ languageKey: "tcpa_consent_language",
150
+ copy: I([
148
151
  "By clicking the button, I agree to be bound by your ",
149
152
  { href: "privacyPolicy", label: "Privacy Policy" },
150
153
  ", ",
@@ -157,13 +160,14 @@ const ue = {
157
160
  { href: "termsOfSale", label: "Terms & Conditions of Sale" },
158
161
  "."
159
162
  ])
160
- }, be = {
163
+ }, he = {
161
164
  definitionId: "lead-clickwrap",
162
165
  definitionVersion: "2",
163
166
  type: "notice",
167
+ optInDateField: "tcpa_form_opt_in_date",
164
168
  requiredLegalUrls: ["privacyPolicy", "userAgreement"],
165
- languageKey: "clickwrap_consent_language",
166
- copy: A([
169
+ languageKey: "tcpa_consent_language",
170
+ copy: I([
167
171
  "By submitting, you agree to United States Gold Bureau’s ",
168
172
  { href: "privacyPolicy", label: "Privacy Policy" },
169
173
  " and ",
@@ -171,32 +175,32 @@ const ue = {
171
175
  ", 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."
172
176
  ])
173
177
  };
174
- function ye(...t) {
178
+ function be(...t) {
175
179
  return Object.fromEntries(
176
180
  t.map((e) => [
177
- z(e.definitionId, e.definitionVersion),
181
+ j(e.definitionId, e.definitionVersion),
178
182
  e
179
183
  ])
180
184
  );
181
185
  }
182
- const ve = ye(
186
+ const ye = be(
187
+ de,
183
188
  ue,
184
189
  me,
185
190
  pe,
186
191
  ge,
187
192
  fe,
188
- he,
189
- be
193
+ he
190
194
  );
191
- function we(t, e) {
192
- return ve[z(t, e)];
195
+ function ve(t, e) {
196
+ return ye[j(t, e)];
193
197
  }
194
- function Y(t) {
198
+ function z(t) {
195
199
  if (!(t != null && t.length))
196
200
  return [];
197
201
  const e = [];
198
202
  for (const n of t) {
199
- const a = we(
203
+ const a = ve(
200
204
  n.definitionId,
201
205
  n.definitionVersion
202
206
  );
@@ -208,16 +212,20 @@ function Y(t) {
208
212
  }
209
213
  return e;
210
214
  }
215
+ function we(t = /* @__PURE__ */ new Date()) {
216
+ return t.toISOString().slice(0, 10);
217
+ }
211
218
  function ke(t, e, n, a) {
212
219
  if (!t.length)
213
220
  return;
214
- const i = {};
221
+ const i = [];
215
222
  for (const r of t) {
216
- const { language: l } = j(r.copy, n);
217
- if (i[r.languageKey] = l, r.type === "checkbox") {
223
+ const { language: l } = W(r.copy, n);
224
+ if (i.push({ name: r.languageKey, value: l }), r.type === "checkbox") {
218
225
  const o = !!e[r.name];
219
- i[r.name] = o, o && r.grantDateField && (i[r.grantDateField] = a);
220
- }
226
+ i.push({ name: r.name, value: o }), o && i.push({ name: r.grantDateField, value: a });
227
+ } else
228
+ i.push({ name: r.optInDateField, value: a });
221
229
  }
222
230
  return i;
223
231
  }
@@ -228,21 +236,21 @@ function qe(t) {
228
236
  e.add(a);
229
237
  return [...e];
230
238
  }
231
- function Le(t) {
239
+ function _e(t) {
232
240
  return t.type === "checkbox";
233
241
  }
234
242
  function O(t) {
235
243
  return (e, n) => n ? e.trim().length > 0 || `${t} is required` : !0;
236
244
  }
237
- const _e = /^[2-9]\d{2}[2-9]\d{6}$/;
238
- function Z(t) {
245
+ const Le = /^[2-9]\d{2}[2-9]\d{6}$/;
246
+ function Y(t) {
239
247
  let e = t.replace(/\D/g, "");
240
- return e.length === 11 && e.startsWith("1") && (e = e.slice(1)), e.length !== 10 || !_e.test(e) ? null : e;
248
+ return e.length === 11 && e.startsWith("1") && (e = e.slice(1)), e.length !== 10 || !Le.test(e) ? null : e;
241
249
  }
242
250
  function Ue(t) {
243
251
  const e = t.trim();
244
252
  if (!e) return "";
245
- const n = Z(e);
253
+ const n = Y(e);
246
254
  if (!n) return e;
247
255
  const a = e.replace(/\D/g, "");
248
256
  return a.length === 11 && a.startsWith("1") ? `1${n}` : n;
@@ -269,7 +277,7 @@ const Se = {
269
277
  autoComplete: "email",
270
278
  validate: (t, e) => {
271
279
  const n = t.trim();
272
- return n ? ne(n) || "Enter a valid email address" : e ? "Email address is required" : !0;
280
+ return n ? te(n) || "Enter a valid email address" : e ? "Email address is required" : !0;
273
281
  }
274
282
  },
275
283
  phone: {
@@ -279,15 +287,15 @@ const Se = {
279
287
  autoComplete: "tel",
280
288
  validate: (t, e) => {
281
289
  const n = t.trim();
282
- return n ? Z(n) ? !0 : "Enter a valid phone number" : e ? "Phone number is required" : !0;
290
+ return n ? Y(n) ? !0 : "Enter a valid phone number" : e ? "Phone number is required" : !0;
283
291
  },
284
292
  serialize: Ue
285
293
  }
286
294
  };
287
- function R(t) {
295
+ function M(t) {
288
296
  return Se[t];
289
297
  }
290
- function J({
298
+ function Z({
291
299
  className: t,
292
300
  appearance: e,
293
301
  variantValue: n,
@@ -318,7 +326,7 @@ function Pe(t, e) {
318
326
  n[a] = !1;
319
327
  return n;
320
328
  }
321
- function x(t) {
329
+ function E(t) {
322
330
  const e = t == null ? void 0 : t.trim();
323
331
  return e || void 0;
324
332
  }
@@ -332,85 +340,85 @@ function Te({
332
340
  onAccepted: l,
333
341
  onFailed: o
334
342
  }) {
335
- const d = $(), u = T(
336
- () => Y(e.consents) ?? [],
343
+ const d = G(), u = F(
344
+ () => z(e.consents) ?? [],
337
345
  [e.consents]
338
- ), g = T(
339
- () => u.filter(Le).map((p) => p.name),
346
+ ), g = F(
347
+ () => u.filter(_e).map((p) => p.name),
340
348
  [u]
341
- ), b = T(
349
+ ), b = F(
342
350
  () => Pe(e.fields, g),
343
351
  [e.fields, g]
344
352
  ), {
345
353
  register: f,
346
354
  handleSubmit: S,
347
355
  formState: { errors: k }
348
- } = re({
356
+ } = ne({
349
357
  defaultValues: b
350
- }), [m, L] = te({ kind: "idle" }), y = K(!1);
351
- H(() => {
358
+ }), [m, _] = ee({ kind: "idle" }), v = $(!1);
359
+ K(() => {
352
360
  r == null || r({ type: "view", formId: t });
353
361
  }, [r, t]);
354
- const c = T(() => {
362
+ const c = F(() => {
355
363
  const p = {};
356
- for (const w of e.fields)
357
- p[w.name] = `${d}-${w.name}`;
358
- for (const w of g)
359
- p[w] = `${d}-${w}`;
364
+ for (const y of e.fields)
365
+ p[y.name] = `${d}-${y.name}`;
366
+ for (const y of g)
367
+ p[y] = `${d}-${y}`;
360
368
  return p;
361
- }, [d, e.fields, g]), v = T(() => {
369
+ }, [d, e.fields, g]), w = F(() => {
362
370
  const p = {};
363
- for (const w of u)
364
- w.type === "notice" && (p[w.definitionId] = `${d}-notice-${w.definitionId}`);
371
+ for (const y of u)
372
+ y.type === "notice" && (p[y.definitionId] = `${d}-notice-${y.definitionId}`);
365
373
  return p;
366
374
  }, [d, u]), C = S(
367
375
  async (p) => {
368
- if (y.current)
376
+ if (v.current)
369
377
  return;
370
- y.current = !0, L({ kind: "submitting" }), r == null || r({ type: "submit_attempt", formId: t });
371
- const q = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), P = e.fields.map(
372
- (_) => {
373
- const U = p[_.name];
378
+ v.current = !0, _({ kind: "submitting" }), r == null || r({ type: "submit_attempt", formId: t });
379
+ const y = we(), q = e.fields.map(
380
+ (L) => {
381
+ const U = p[L.name];
374
382
  if (typeof U != "string")
375
- return { name: _.name, value: !!U };
376
- const N = R(_.name);
383
+ return { name: L.name, value: !!U };
384
+ const V = M(L.name);
377
385
  return {
378
- name: _.name,
379
- value: N != null && N.serialize ? N.serialize(U) : U.trim()
386
+ name: L.name,
387
+ value: V != null && V.serialize ? V.serialize(U) : U.trim()
380
388
  };
381
389
  }
382
- ), I = ke(
390
+ ), T = ke(
383
391
  u,
384
392
  p,
385
393
  n ?? {},
386
- q
387
- ), V = {
394
+ y
395
+ ), P = {
388
396
  formId: t,
389
397
  definitionVersion: e.definitionVersion,
390
- submissionContractVersion: E.submissionContract.version,
398
+ submissionContractVersion: N.submissionContract.version,
391
399
  idempotencyKey: Ce(),
392
- data: P,
393
- consents: I
400
+ data: q,
401
+ consents: T
394
402
  };
395
403
  try {
396
- const _ = await i.submit(V);
397
- if (_.status === "accepted") {
398
- r == null || r({ type: "success", formId: t, status: "accepted" }), l == null || l(V), L({ kind: "accepted" });
399
- const U = x(a);
404
+ const L = await i.submit(P);
405
+ if (L.status === "accepted") {
406
+ r == null || r({ type: "success", formId: t, status: "accepted" }), l == null || l(P), _({ kind: "accepted" });
407
+ const U = E(a);
400
408
  U && typeof window < "u" && window.location.assign(U);
401
409
  } else
402
- y.current = !1, L({
410
+ v.current = !1, _({
403
411
  kind: "failed",
404
- message: _.message ?? "Submission failed"
412
+ message: L.message ?? "Submission failed"
405
413
  }), r == null || r({
406
414
  type: "failure",
407
415
  formId: t,
408
- message: _.message
409
- }), o == null || o(V, _.message);
410
- } catch (_) {
411
- y.current = !1;
412
- const U = _ instanceof Error ? _.message : "Submission failed";
413
- L({ kind: "failed", message: U }), r == null || r({ type: "failure", formId: t, message: U }), o == null || o(V, U);
416
+ message: L.message
417
+ }), o == null || o(P, L.message);
418
+ } catch (L) {
419
+ v.current = !1;
420
+ const U = L instanceof Error ? L.message : "Submission failed";
421
+ _({ kind: "failed", message: U }), r == null || r({ type: "failure", formId: t, message: U }), o == null || o(P, U);
414
422
  }
415
423
  },
416
424
  (p) => {
@@ -425,7 +433,7 @@ function Te({
425
433
  register: f,
426
434
  errors: k,
427
435
  fieldIds: c,
428
- noticeIds: v,
436
+ noticeIds: w,
429
437
  consentDefs: u,
430
438
  uiState: m,
431
439
  onSubmit: C
@@ -489,7 +497,7 @@ function De() {
489
497
  }
490
498
  );
491
499
  }
492
- function G({
500
+ function R({
493
501
  id: t,
494
502
  message: e,
495
503
  className: n
@@ -499,7 +507,7 @@ function G({
499
507
  {
500
508
  id: t,
501
509
  role: "alert",
502
- className: D("usgb-field-error", n),
510
+ className: A("usgb-field-error", n),
503
511
  children: [
504
512
  /* @__PURE__ */ s(Fe, {}),
505
513
  e
@@ -507,7 +515,7 @@ function G({
507
515
  }
508
516
  ) : null;
509
517
  }
510
- const Ae = M(
518
+ const Ae = B(
511
519
  function({ id: e, label: n, errorMessage: a, required: i, className: r, ...l }, o) {
512
520
  const d = a ? `${e}-error` : void 0;
513
521
  return /* @__PURE__ */ h("div", { className: "usgb-form-group usgb-consent", children: [
@@ -520,7 +528,7 @@ const Ae = M(
520
528
  ref: o,
521
529
  id: e,
522
530
  type: "checkbox",
523
- className: D("usgb-form-checkbox", r),
531
+ className: A("usgb-form-checkbox", r),
524
532
  "aria-invalid": a ? !0 : void 0,
525
533
  "aria-describedby": d,
526
534
  "aria-required": i || void 0
@@ -540,10 +548,10 @@ const Ae = M(
540
548
  ) : null
541
549
  ] })
542
550
  ] }),
543
- /* @__PURE__ */ s(G, { id: d, message: a })
551
+ /* @__PURE__ */ s(R, { id: d, message: a })
544
552
  ] });
545
553
  }
546
- ), Q = M(
554
+ ), J = B(
547
555
  function({
548
556
  className: e,
549
557
  variant: n = "primary",
@@ -560,7 +568,7 @@ const Ae = M(
560
568
  {
561
569
  ref: u,
562
570
  type: o,
563
- className: D(
571
+ className: A(
564
572
  "usgb-btn",
565
573
  n === "primary" && "usgb-btn-primary",
566
574
  e
@@ -603,7 +611,7 @@ function Ve({
603
611
  className: n,
604
612
  required: a
605
613
  }) {
606
- return /* @__PURE__ */ h("label", { htmlFor: t, className: D("usgb-field-label", n), children: [
614
+ return /* @__PURE__ */ h("label", { htmlFor: t, className: A("usgb-field-label", n), children: [
607
615
  e,
608
616
  a ? /* @__PURE__ */ s("span", { className: "usgb-field-label-asterisk", "aria-hidden": "true", children: "*" }) : null
609
617
  ] });
@@ -611,7 +619,7 @@ function Ve({
611
619
  function Ne(t) {
612
620
  return t.replace(/\b\w/g, (e) => e.toUpperCase());
613
621
  }
614
- const Ee = M(
622
+ const Ee = B(
615
623
  function({
616
624
  id: e,
617
625
  label: n,
@@ -642,7 +650,7 @@ const Ee = M(
642
650
  ref: f,
643
651
  id: e,
644
652
  type: a,
645
- className: D(
653
+ className: A(
646
654
  "usgb-field-control",
647
655
  i && "usgb-field-invalid",
648
656
  u
@@ -654,11 +662,11 @@ const Ee = M(
654
662
  ...b
655
663
  }
656
664
  ),
657
- d ? /* @__PURE__ */ s(G, { id: S, message: i }) : null
665
+ d ? /* @__PURE__ */ s(R, { id: S, message: i }) : null
658
666
  ] });
659
667
  }
660
668
  );
661
- function B({
669
+ function x({
662
670
  fieldRef: t,
663
671
  fieldIds: e,
664
672
  register: n,
@@ -667,7 +675,7 @@ function B({
667
675
  placeholderCase: r,
668
676
  showError: l = !0
669
677
  }) {
670
- const o = R(t.name);
678
+ const o = M(t.name);
671
679
  if (!o) return null;
672
680
  const d = a[t.name], u = typeof (d == null ? void 0 : d.message) == "string" ? d.message : void 0;
673
681
  return /* @__PURE__ */ s(
@@ -707,10 +715,10 @@ function xe({
707
715
  consentDefs: g,
708
716
  uiState: b,
709
717
  onSubmit: f
710
- } = i, S = T(
718
+ } = i, S = F(
711
719
  () => Ie(t.fields),
712
720
  [t.fields]
713
- ), k = e === "sidebar", m = e === "dense" || k, L = k ? "title" : "upper", y = Object.values(u).join(" ");
721
+ ), k = e === "sidebar", m = e === "dense" || k, _ = k ? "title" : "upper", v = Object.values(u).join(" ");
714
722
  return /* @__PURE__ */ h(
715
723
  "form",
716
724
  {
@@ -722,34 +730,34 @@ function xe({
722
730
  "div",
723
731
  {
724
732
  className: "usgb-form-grid",
725
- children: c.fields.map((v) => /* @__PURE__ */ s(
726
- B,
733
+ children: c.fields.map((w) => /* @__PURE__ */ s(
734
+ x,
727
735
  {
728
- fieldRef: v,
736
+ fieldRef: w,
729
737
  fieldIds: d,
730
738
  register: l,
731
739
  errors: o,
732
740
  hideLabel: m,
733
- placeholderCase: L
741
+ placeholderCase: _
734
742
  },
735
- v.name
743
+ w.name
736
744
  ))
737
745
  },
738
- `group-${c.group}-${c.fields.map((v) => v.name).join("-")}`
746
+ `group-${c.group}-${c.fields.map((w) => w.name).join("-")}`
739
747
  ) : /* @__PURE__ */ s(
740
- B,
748
+ x,
741
749
  {
742
750
  fieldRef: c.field,
743
751
  fieldIds: d,
744
752
  register: l,
745
753
  errors: o,
746
754
  hideLabel: m,
747
- placeholderCase: L
755
+ placeholderCase: _
748
756
  },
749
757
  c.field.name
750
758
  )),
751
759
  g.map((c) => {
752
- const { content: v } = j(
760
+ const { content: w } = W(
753
761
  c.copy,
754
762
  a ?? {}
755
763
  );
@@ -759,7 +767,7 @@ function xe({
759
767
  {
760
768
  id: u[c.definitionId],
761
769
  className: "usgb-consent usgb-consent-copy usgb-consent-notice",
762
- children: v
770
+ children: w
763
771
  },
764
772
  c.definitionId
765
773
  );
@@ -768,7 +776,7 @@ function xe({
768
776
  Ae,
769
777
  {
770
778
  id: d[c.name],
771
- label: v,
779
+ label: w,
772
780
  required: c.required,
773
781
  errorMessage: p,
774
782
  ...l(c.name, {
@@ -779,11 +787,11 @@ function xe({
779
787
  );
780
788
  }),
781
789
  /* @__PURE__ */ s(
782
- Q,
790
+ J,
783
791
  {
784
792
  type: "submit",
785
793
  loading: b.kind === "submitting",
786
- "aria-describedby": y || void 0,
794
+ "aria-describedby": v || void 0,
787
795
  children: n
788
796
  }
789
797
  ),
@@ -816,7 +824,7 @@ function Be({
816
824
  children: [
817
825
  /* @__PURE__ */ h("div", { className: "usgb-form-inline", children: [
818
826
  /* @__PURE__ */ s(
819
- B,
827
+ x,
820
828
  {
821
829
  fieldRef: u,
822
830
  fieldIds: l,
@@ -827,10 +835,10 @@ function Be({
827
835
  showError: !1
828
836
  }
829
837
  ),
830
- /* @__PURE__ */ s(Q, { type: "submit", loading: o.kind === "submitting", children: e })
838
+ /* @__PURE__ */ s(J, { type: "submit", loading: o.kind === "submitting", children: e })
831
839
  ] }),
832
840
  /* @__PURE__ */ s(
833
- G,
841
+ R,
834
842
  {
835
843
  id: g ? `${l.email}-error` : void 0,
836
844
  message: g
@@ -848,11 +856,11 @@ function Be({
848
856
  }
849
857
  ) : /* @__PURE__ */ s("p", { className: "usgb-form-status usgb-form-status-error", role: "alert", children: "Newsletter kind requires an email field" });
850
858
  }
851
- const X = {
859
+ const Q = {
852
860
  lead: xe,
853
861
  newsletter: Be
854
862
  }, Me = "Thank you. Your request has been accepted and is being processed.";
855
- function F({
863
+ function D({
856
864
  className: t,
857
865
  appearance: e,
858
866
  variantValue: n,
@@ -861,7 +869,7 @@ function F({
861
869
  children: r
862
870
  }) {
863
871
  return /* @__PURE__ */ s(
864
- J,
872
+ Z,
865
873
  {
866
874
  className: t,
867
875
  appearance: e,
@@ -889,9 +897,9 @@ function Re({
889
897
  analytics: S,
890
898
  className: k,
891
899
  onAccepted: m,
892
- onFailed: L
900
+ onFailed: _
893
901
  }) {
894
- const y = $(), c = l ? `${y}-heading` : void 0, v = K(null), C = Te({
902
+ const v = G(), c = l ? `${v}-heading` : void 0, w = $(null), C = Te({
895
903
  formId: t,
896
904
  definition: e,
897
905
  legalUrls: u,
@@ -899,15 +907,15 @@ function Re({
899
907
  adapter: f,
900
908
  analytics: S,
901
909
  onAccepted: m,
902
- onFailed: L
903
- }), p = C.uiState.kind === "accepted", w = p && !!x(b), q = p && !w ? x(g) ?? Me : "";
904
- H(() => {
905
- var I;
906
- q && ((I = v.current) == null || I.focus());
910
+ onFailed: _
911
+ }), p = C.uiState.kind === "accepted", y = p && !!E(b), q = p && !y ? E(g) ?? Me : "";
912
+ K(() => {
913
+ var P;
914
+ q && ((P = w.current) == null || P.focus());
907
915
  }, [q]);
908
- const P = X[e.kind];
916
+ const T = Q[e.kind];
909
917
  return /* @__PURE__ */ h(
910
- J,
918
+ Z,
911
919
  {
912
920
  className: k,
913
921
  appearance: n,
@@ -918,7 +926,7 @@ function Re({
918
926
  l ? /* @__PURE__ */ s("h2", { id: c, className: "usgb-form-heading", children: l }) : null,
919
927
  !p && o ? /* @__PURE__ */ s("p", { className: "usgb-form-subheading", children: o }) : null,
920
928
  p ? null : /* @__PURE__ */ s(
921
- P,
929
+ T,
922
930
  {
923
931
  definition: e,
924
932
  variant: a,
@@ -931,7 +939,7 @@ function Re({
931
939
  /* @__PURE__ */ s(
932
940
  "p",
933
941
  {
934
- ref: v,
942
+ ref: w,
935
943
  className: q ? "usgb-form-status usgb-form-status-success" : "usgb-field-label--sr-only",
936
944
  role: "status",
937
945
  "aria-live": "polite",
@@ -960,14 +968,14 @@ function ze({
960
968
  onAccepted: S,
961
969
  onFailed: k
962
970
  }) {
963
- const m = W(t), L = (m == null ? void 0 : m.kind) === "newsletter", y = L ? "" : n, c = !L && a;
971
+ const m = H(t), _ = (m == null ? void 0 : m.kind) === "newsletter", v = _ ? "" : n, c = !_ && a;
964
972
  if (!m)
965
973
  return /* @__PURE__ */ h(
966
- F,
974
+ D,
967
975
  {
968
976
  className: f,
969
977
  appearance: e,
970
- variantValue: y,
978
+ variantValue: v,
971
979
  twoColumn: c,
972
980
  children: [
973
981
  "Unknown form definition: ",
@@ -975,14 +983,14 @@ function ze({
975
983
  ]
976
984
  }
977
985
  );
978
- const v = Y(m.consents);
979
- if (v === null)
986
+ const w = z(m.consents);
987
+ if (w === null)
980
988
  return /* @__PURE__ */ h(
981
- F,
989
+ D,
982
990
  {
983
991
  className: f,
984
992
  appearance: e,
985
- variantValue: y,
993
+ variantValue: v,
986
994
  twoColumn: c,
987
995
  kind: m.kind,
988
996
  children: [
@@ -991,19 +999,19 @@ function ze({
991
999
  ]
992
1000
  }
993
1001
  );
994
- const p = qe(v).filter(
1002
+ const p = qe(w).filter(
995
1003
  (q) => {
996
- var P;
997
- return !((P = o == null ? void 0 : o[q]) != null && P.trim());
1004
+ var T;
1005
+ return !((T = o == null ? void 0 : o[q]) != null && T.trim());
998
1006
  }
999
1007
  );
1000
1008
  if (p.length)
1001
1009
  return /* @__PURE__ */ h(
1002
- F,
1010
+ D,
1003
1011
  {
1004
1012
  className: f,
1005
1013
  appearance: e,
1006
- variantValue: y,
1014
+ variantValue: v,
1007
1015
  twoColumn: c,
1008
1016
  kind: m.kind,
1009
1017
  children: [
@@ -1014,15 +1022,15 @@ function ze({
1014
1022
  ]
1015
1023
  }
1016
1024
  );
1017
- const w = m.fields.filter(
1018
- (q) => !R(q.name)
1025
+ const y = m.fields.filter(
1026
+ (q) => !M(q.name)
1019
1027
  );
1020
- return w.length ? /* @__PURE__ */ h(
1021
- F,
1028
+ return y.length ? /* @__PURE__ */ h(
1029
+ D,
1022
1030
  {
1023
1031
  className: f,
1024
1032
  appearance: e,
1025
- variantValue: y,
1033
+ variantValue: v,
1026
1034
  twoColumn: c,
1027
1035
  kind: m.kind,
1028
1036
  children: [
@@ -1030,17 +1038,17 @@ function ze({
1030
1038
  t,
1031
1039
  ":",
1032
1040
  " ",
1033
- w.map((q) => q.name).join(", ")
1041
+ y.map((q) => q.name).join(", ")
1034
1042
  ]
1035
1043
  }
1036
- ) : m.kind in X ? /* @__PURE__ */ s(
1044
+ ) : m.kind in Q ? /* @__PURE__ */ s(
1037
1045
  Re,
1038
1046
  {
1039
1047
  formId: t,
1040
1048
  definition: m,
1041
1049
  appearance: e,
1042
1050
  variant: n,
1043
- variantValue: y,
1051
+ variantValue: v,
1044
1052
  twoColumn: c,
1045
1053
  heading: i,
1046
1054
  subheading: r,
@@ -1055,11 +1063,11 @@ function ze({
1055
1063
  onFailed: k
1056
1064
  }
1057
1065
  ) : /* @__PURE__ */ h(
1058
- F,
1066
+ D,
1059
1067
  {
1060
1068
  className: f,
1061
1069
  appearance: e,
1062
- variantValue: y,
1070
+ variantValue: v,
1063
1071
  twoColumn: c,
1064
1072
  kind: m.kind,
1065
1073
  children: [
@@ -1101,18 +1109,18 @@ function Qe(t, e) {
1101
1109
  });
1102
1110
  }
1103
1111
  export {
1104
- Q as Button,
1112
+ J as Button,
1105
1113
  Ae as ConsentField,
1106
1114
  Se as FIELD_REGISTRY,
1107
- G as FieldError,
1115
+ R as FieldError,
1108
1116
  Ve as FieldLabel,
1109
- he as LEAD_CLICKWRAP,
1110
- be as LEAD_CLICKWRAP_V2,
1111
- ge as LEAD_SMS,
1112
- ue as LEAD_TCPA,
1113
- me as LEAD_TCPA_V2,
1114
- pe as LEAD_TCPA_V3,
1115
- fe as LEAD_TOSPP,
1117
+ fe as LEAD_CLICKWRAP,
1118
+ he as LEAD_CLICKWRAP_V2,
1119
+ pe as LEAD_SMS,
1120
+ de as LEAD_TCPA,
1121
+ ue as LEAD_TCPA_V2,
1122
+ me as LEAD_TCPA_V3,
1123
+ ge as LEAD_TOSPP,
1116
1124
  Ze as LEGAL_URL_ATTRS,
1117
1125
  Je as PWA_LEGAL_URLS,
1118
1126
  Ee as TextField,
@@ -1120,13 +1128,13 @@ export {
1120
1128
  qe as collectRequiredLegalUrls,
1121
1129
  Ce as createIdempotencyKey,
1122
1130
  Ye as createStubAdapter,
1123
- E as formsManifest,
1124
- we as getConsentDefinition,
1125
- R as getFieldDefinition,
1126
- W as getFormDefinition,
1131
+ N as formsManifest,
1132
+ ve as getConsentDefinition,
1133
+ M as getFieldDefinition,
1134
+ H as getFormDefinition,
1127
1135
  Qe as isCompleteLegalUrls,
1128
1136
  je as listEditorOptions,
1129
1137
  We as listFormDefinitions,
1130
- j as resolveConsentCopy,
1131
- Y as resolveFormConsents
1138
+ W as resolveConsentCopy,
1139
+ z as resolveFormConsents
1132
1140
  };