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