bhl-forms 0.0.78 → 0.0.80

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.
@@ -11121,22 +11121,30 @@ const flattenObj = (obj) => {
11121
11121
  return flattened;
11122
11122
  };
11123
11123
  function prepData(formData) {
11124
- const props2 = flattenObj(formData);
11125
- props2.vid = "";
11126
- if (typeof window.zar !== "undefined") {
11127
- props2.vid = window.zar.getVID();
11128
- }
11129
- var tf = document.getElementsByName("xxTrustedFormCertUrl");
11130
- if (tf.length > 0) {
11131
- props2.Trusted_Form_URL = tf[0].value;
11132
- dbg("TrustedFormCertUrl", props2.TrustedFormCertUrl);
11133
- }
11134
- const data = {
11135
- post_source: window.location.hostname,
11136
- vertical: props2.vertical,
11137
- properties: props2
11138
- };
11139
- return data;
11124
+ try {
11125
+ const props2 = flattenObj(formData);
11126
+ props2.vid = "";
11127
+ if (typeof window.zar !== "undefined") {
11128
+ props2.vid = window.zar.getVID();
11129
+ }
11130
+ var tf = document.getElementsByName("xxTrustedFormCertUrl");
11131
+ if (tf.length > 0) {
11132
+ props2.Trusted_Form_URL = tf[0].value;
11133
+ dbg("TrustedFormCertUrl", props2.TrustedFormCertUrl);
11134
+ }
11135
+ props2.Domain_Abbrev = window.location.hostname.match(/\b(\w)/g).join("").toUpperCase();
11136
+ const data = {
11137
+ post_source: window.location.hostname,
11138
+ vertical: props2.vertical,
11139
+ properties: props2
11140
+ };
11141
+ return data;
11142
+ } catch (err) {
11143
+ const msg = "failed to prep data: " + err.toString();
11144
+ console.error(msg);
11145
+ rollbar("error", msg);
11146
+ throw err;
11147
+ }
11140
11148
  }
11141
11149
  function applyOverrides(overrides) {
11142
11150
  for (var key of Object.keys(overrides)) {