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.
@@ -17914,22 +17914,30 @@ var flattenObj = (obj) => {
17914
17914
  return flattened;
17915
17915
  };
17916
17916
  function prepData(formData) {
17917
- var props2 = flattenObj(formData);
17918
- props2.vid = "";
17919
- if (typeof window.zar !== "undefined") {
17920
- props2.vid = window.zar.getVID();
17921
- }
17922
- var tf = document.getElementsByName("xxTrustedFormCertUrl");
17923
- if (tf.length > 0) {
17924
- props2.Trusted_Form_URL = tf[0].value;
17925
- dbg("TrustedFormCertUrl", props2.TrustedFormCertUrl);
17926
- }
17927
- var data2 = {
17928
- post_source: window.location.hostname,
17929
- vertical: props2.vertical,
17930
- properties: props2
17931
- };
17932
- return data2;
17917
+ try {
17918
+ var props2 = flattenObj(formData);
17919
+ props2.vid = "";
17920
+ if (typeof window.zar !== "undefined") {
17921
+ props2.vid = window.zar.getVID();
17922
+ }
17923
+ var tf = document.getElementsByName("xxTrustedFormCertUrl");
17924
+ if (tf.length > 0) {
17925
+ props2.Trusted_Form_URL = tf[0].value;
17926
+ dbg("TrustedFormCertUrl", props2.TrustedFormCertUrl);
17927
+ }
17928
+ props2.Domain_Abbrev = window.location.hostname.match(/\b(\w)/g).join("").toUpperCase();
17929
+ var data2 = {
17930
+ post_source: window.location.hostname,
17931
+ vertical: props2.vertical,
17932
+ properties: props2
17933
+ };
17934
+ return data2;
17935
+ } catch (err) {
17936
+ var msg = "failed to prep data: " + err.toString();
17937
+ console.error(msg);
17938
+ rollbar("error", msg);
17939
+ throw err;
17940
+ }
17933
17941
  }
17934
17942
  function applyOverrides(overrides) {
17935
17943
  for (var key of Object.keys(overrides)) {