bhl-forms 0.7.3 → 0.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/dist/bhl-forms.es.js +551 -543
  2. package/dist/bhl-forms.iife.js +4 -4
  3. package/dist/bhl-forms.modern.es.js +649 -649
  4. package/dist/bhl-forms.modern.iife.js +7 -7
  5. package/dist/bhl-forms.modern.umd.js +7 -7
  6. package/dist/bhl-forms.umd.js +4 -4
  7. package/dist/forms/accidentsAndInjuries.es.js +1461 -1151
  8. package/dist/forms/accidentsAndInjuries.iife.js +1 -1
  9. package/dist/forms/accidentsAndInjuries.json +1 -1
  10. package/dist/forms/appraisals.es.js +138 -137
  11. package/dist/forms/appraisals.iife.js +1 -1
  12. package/dist/forms/business.es.js +1434 -1149
  13. package/dist/forms/business.iife.js +1 -1
  14. package/dist/forms/business.json +1 -1
  15. package/dist/forms/childAndFamily.es.js +1329 -1043
  16. package/dist/forms/childAndFamily.iife.js +1 -1
  17. package/dist/forms/childAndFamily.json +1 -1
  18. package/dist/forms/childAndFamilySingle.es.js +1528 -1378
  19. package/dist/forms/childAndFamilySingle.iife.js +1 -1
  20. package/dist/forms/childAndFamilySingle.json +1 -1
  21. package/dist/forms/civilLawsuit.es.js +2000 -1807
  22. package/dist/forms/civilLawsuit.iife.js +1 -1
  23. package/dist/forms/civilLawsuit.json +1 -1
  24. package/dist/forms/coins.es.js +138 -137
  25. package/dist/forms/coins.iife.js +1 -1
  26. package/dist/forms/contracts.es.js +1349 -1050
  27. package/dist/forms/contracts.iife.js +1 -1
  28. package/dist/forms/contracts.json +1 -1
  29. package/dist/forms/criminal.es.js +1832 -1711
  30. package/dist/forms/criminal.iife.js +1 -1
  31. package/dist/forms/criminal.json +1 -1
  32. package/dist/forms/divorce.es.js +1541 -1385
  33. package/dist/forms/divorce.iife.js +1 -1
  34. package/dist/forms/divorce.json +1 -1
  35. package/dist/forms/employmentAndWorkplace.es.js +1833 -1678
  36. package/dist/forms/employmentAndWorkplace.iife.js +1 -1
  37. package/dist/forms/employmentAndWorkplace.json +1 -1
  38. package/dist/forms/generalHomeImprovement.es.js +2381 -2010
  39. package/dist/forms/generalHomeImprovement.iife.js +1 -1
  40. package/dist/forms/generalHomeImprovement.json +1 -1
  41. package/dist/forms/generalHomeImprovementThankYou.es.js +1795 -2008
  42. package/dist/forms/generalHomeImprovementThankYou.iife.js +1 -1
  43. package/dist/forms/generalHomeImprovementThankYou.json +1 -1
  44. package/dist/forms/generalLegal.es.js +3037 -2535
  45. package/dist/forms/generalLegal.iife.js +1 -1
  46. package/dist/forms/generalLegal.json +1 -1
  47. package/dist/forms/generalLegalJustAnswer.es.js +3216 -2872
  48. package/dist/forms/generalLegalJustAnswer.iife.js +1 -1
  49. package/dist/forms/generalLegalJustAnswer.json +1 -1
  50. package/dist/forms/generalLegalPopUnder.es.js +3037 -2535
  51. package/dist/forms/generalLegalPopUnder.iife.js +1 -1
  52. package/dist/forms/generalLegalPopUnder.json +1 -1
  53. package/dist/forms/generalLegalPopUnderSingle.es.js +3216 -2872
  54. package/dist/forms/generalLegalPopUnderSingle.iife.js +1 -1
  55. package/dist/forms/generalLegalPopUnderSingle.json +1 -1
  56. package/dist/forms/generalLegalSingle.es.js +3216 -2872
  57. package/dist/forms/generalLegalSingle.iife.js +1 -1
  58. package/dist/forms/generalLegalSingle.json +1 -1
  59. package/dist/forms/generalLegalThankYou.es.js +2825 -2303
  60. package/dist/forms/generalLegalThankYou.iife.js +1 -1
  61. package/dist/forms/generalLegalThankYou.json +1 -1
  62. package/dist/forms/generalLegalThankYouConsultation.es.js +3216 -2872
  63. package/dist/forms/generalLegalThankYouConsultation.iife.js +1 -1
  64. package/dist/forms/generalLegalThankYouConsultation.json +1 -1
  65. package/dist/forms/harassmentAndDiscrimination.es.js +1425 -1120
  66. package/dist/forms/harassmentAndDiscrimination.iife.js +1 -1
  67. package/dist/forms/harassmentAndDiscrimination.json +1 -1
  68. package/dist/forms/landlordTenant.es.js +1395 -1106
  69. package/dist/forms/landlordTenant.iife.js +1 -1
  70. package/dist/forms/landlordTenant.json +1 -1
  71. package/dist/forms/malpractice.es.js +1531 -1223
  72. package/dist/forms/malpractice.iife.js +1 -1
  73. package/dist/forms/malpractice.json +1 -1
  74. package/dist/forms/mechanics.es.js +702 -530
  75. package/dist/forms/mechanics.iife.js +1 -1
  76. package/dist/forms/mechanics.json +1 -1
  77. package/dist/forms/patentsAndIP.es.js +1830 -1652
  78. package/dist/forms/patentsAndIP.iife.js +1 -1
  79. package/dist/forms/patentsAndIP.json +1 -1
  80. package/dist/forms/realEstate.es.js +2852 -2405
  81. package/dist/forms/realEstate.iife.js +1 -1
  82. package/dist/forms/realEstate.json +1 -1
  83. package/dist/forms/repossession.es.js +1568 -1251
  84. package/dist/forms/repossession.iife.js +1 -1
  85. package/dist/forms/repossession.json +1 -1
  86. package/dist/forms/ssdi.es.js +635 -520
  87. package/dist/forms/ssdi.iife.js +1 -1
  88. package/dist/forms/ssdi.json +1 -1
  89. package/dist/forms/testForm.es.js +409 -371
  90. package/dist/forms/testForm.iife.js +1 -1
  91. package/dist/forms/testForm.json +1 -1
  92. package/dist/forms/testRedirects.es.js +421 -316
  93. package/dist/forms/testRedirects.iife.js +1 -1
  94. package/dist/forms/testRedirects.json +1 -1
  95. package/dist/forms/vets.es.js +138 -137
  96. package/dist/forms/vets.iife.js +1 -1
  97. package/dist/forms/willsAndTrusts.es.js +1428 -1112
  98. package/dist/forms/willsAndTrusts.iife.js +1 -1
  99. package/dist/forms/willsAndTrusts.json +1 -1
  100. package/dist/main.css +1 -1
  101. package/package.json +1 -1
@@ -6,96 +6,101 @@ function LegalRedirectUrl() {
6
6
  return 'https://listings.ziplawyer.com/api/v1/redirect?zone_id=4&vertical=Legal&category=${properties.Type_Of_Legal_Problem}&Degree_Of_Interest=${properties.Degree_Of_Interest}&zip_code=${properties.Zip}&sub_id=${properties.vid}'
7
7
  }
8
8
 
9
- const DEFAULT_COMMENTS_PLACEHOLDER_DYNAMIC_LEGAL = '$getKey($meta, "commentsPlaceholders." + $get(Type_Of_Legal_Problem).value, $meta.defaultCommentsPlaceholder)';
10
- const DEFAULT_COMMENTS_LABEL_LEGAL = 'Please briefly describe your legal issue in a few words:';
11
- const DEFAULT_FINAL_HEADLINE_LEGAL = 'Submit Your Case';
12
- const DEFAULT_FINAL_HEADLINE_DYNAMIC_LEGAL = '$getKey($meta, "finalHeadlines." + $get(Type_Of_Legal_Problem).value, $meta.defaultFinalHeadline)';
13
- const DEFAULT_FINAL_SUBHEADLINE_LEGAL = 'You may benefit from speaking with a legal professional. Please verify your contact information.';
14
- const DEFAULT_FINAL_SUBHEADLINE_DYNAMIC_LEGAL = '$getKey($meta, "finalSubHeadlines." + $get(Type_Of_Legal_Problem).value, $meta.defaultFinalSubHeadline)';
15
- const TCPA_LANGUAGE_LEGAL = "By checking this box, I a) agree to the Terms of Use, and b) consent to be contacted by lawyers, lawyer networks, and partners of this website using live, autodialed, pre-recorded, or artificial voice calls, as well as text messages. Your consent is not required as a condition of purchasing any goods or services. To submit this request without this consent, call 878-213-4937.";
9
+ const DEFAULT_COMMENTS_PLACEHOLDER_DYNAMIC_LEGAL =
10
+ '$getKey($meta, "commentsPlaceholders." + $get(Type_Of_Legal_Problem).value, $meta.defaultCommentsPlaceholder)';
11
+ const DEFAULT_COMMENTS_LABEL_LEGAL = "Please briefly describe your legal issue in a few words:";
12
+ const DEFAULT_FINAL_HEADLINE_LEGAL = "Submit Your Case";
13
+ const DEFAULT_FINAL_HEADLINE_DYNAMIC_LEGAL =
14
+ '$getKey($meta, "finalHeadlines." + $get(Type_Of_Legal_Problem).value, $meta.defaultFinalHeadline)';
15
+ const DEFAULT_FINAL_SUBHEADLINE_LEGAL =
16
+ "You may benefit from speaking with a legal professional. Please verify your contact information.";
17
+ const DEFAULT_FINAL_SUBHEADLINE_DYNAMIC_LEGAL =
18
+ '$getKey($meta, "finalSubHeadlines." + $get(Type_Of_Legal_Problem).value, $meta.defaultFinalSubHeadline)';
19
+ const TCPA_LANGUAGE_LEGAL =
20
+ "By checking this box, I a) agree to the Terms of Use, and b) consent to be contacted by lawyers, lawyer networks, and partners of this website using live, autodialed, pre-recorded, or artificial voice calls, as well as text messages. Your consent is not required as a condition of purchasing any goods or services. To submit this request without this consent, call 878-213-4937.";
16
21
  const defaultLegalImprovementCrossSells = {
17
- 'Auto and Car Accidents': 'Injured in a Car Accident',
18
- 'Personal Injury': 'Personal or Workplace Injury',
19
- 'DUI and DWI': 'Involved in a DUI/DWI',
20
- 'Wills and Trusts': 'Need a Will or Trust',
21
- 'Power of Attorney': 'Update Power of Attorney',
22
- 'Social Security Disability and Insurance': 'Interest in Disability Benefits',
22
+ "Auto and Car Accidents": "Injured in a Car Accident",
23
+ "Personal Injury": "Personal or Workplace Injury",
24
+ "DUI and DWI": "Involved in a DUI/DWI",
25
+ "Wills and Trusts": "Need a Will or Trust",
26
+ "Power of Attorney": "Update Power of Attorney",
27
+ "Social Security Disability and Insurance": "Interest in Disability Benefits",
23
28
  };
24
29
  const CROSS_SELL_OPTION_MAP_LEGAL = {
25
30
  // Values can be a list or a map of value -> display value
26
- 'Auto and Car Accidents': {
27
- 'Social Security Disability and Insurance': 'Interest in Disability Benefits',
28
- 'Wills and Trusts': 'Need a Will or Trust',
29
- 'Workers Compensation': 'Workplace Injury',
30
- 'Power of Attorney': 'Update Power of Attorney',
31
- 'Divorce and Separation': 'Need a Divorce or Separation',
32
- 'Child Custody': 'Need help with Child Custody',
31
+ "Auto and Car Accidents": {
32
+ "Social Security Disability and Insurance": "Interest in Disability Benefits",
33
+ "Wills and Trusts": "Need a Will or Trust",
34
+ "Workers Compensation": "Workplace Injury",
35
+ "Power of Attorney": "Update Power of Attorney",
36
+ "Divorce and Separation": "Need a Divorce or Separation",
37
+ "Child Custody": "Need help with Child Custody",
33
38
  },
34
39
  "Personal Injury": {
35
- 'DUI and DWI': 'Involved in a DUI/DWI',
36
- 'Wills and Trusts': 'Need a Will or Trust',
37
- 'Power of Attorney': 'Update Power of Attorney',
38
- 'Divorce and Separation': 'Need a Divorce or Separation',
39
- 'Child Custody': 'Need help with Child Custody',
40
+ "DUI and DWI": "Involved in a DUI/DWI",
41
+ "Wills and Trusts": "Need a Will or Trust",
42
+ "Power of Attorney": "Update Power of Attorney",
43
+ "Divorce and Separation": "Need a Divorce or Separation",
44
+ "Child Custody": "Need help with Child Custody",
40
45
  // TODO add one more?
41
46
  },
42
47
  "Workers Compensation": {
43
- 'DUI and DWI': 'Involved in a DUI/DWI',
44
- 'Wills and Trusts': 'Need a Will or Trust',
45
- 'Power of Attorney': 'Update Power of Attorney',
46
- 'Divorce and Separation': 'Need a Divorce or Separation',
47
- 'Child Custody': 'Need help with Child Custody',
48
+ "DUI and DWI": "Involved in a DUI/DWI",
49
+ "Wills and Trusts": "Need a Will or Trust",
50
+ "Power of Attorney": "Update Power of Attorney",
51
+ "Divorce and Separation": "Need a Divorce or Separation",
52
+ "Child Custody": "Need help with Child Custody",
48
53
  // TODO add one more?
49
54
  },
50
55
  "DUI and DWI": {
51
- 'Personal Injury': 'Personal or Workplace Injury',
52
- 'Wills and Trusts': 'Need a Will or Trust',
53
- 'Social Security Disability and Insurance': 'Interest in Disability Benefits',
54
- 'Power of Attorney': 'Update Power of Attorney',
55
- 'Divorce and Separation': 'Need a Divorce or Separation',
56
- 'Child Custody': 'Need help with Child Custody',
56
+ "Personal Injury": "Personal or Workplace Injury",
57
+ "Wills and Trusts": "Need a Will or Trust",
58
+ "Social Security Disability and Insurance": "Interest in Disability Benefits",
59
+ "Power of Attorney": "Update Power of Attorney",
60
+ "Divorce and Separation": "Need a Divorce or Separation",
61
+ "Child Custody": "Need help with Child Custody",
57
62
  },
58
63
  "Wills and Trusts": {
59
- 'Auto and Car Accidents': 'Injured in a Car Accident',
60
- 'Personal Injury': 'Personal or Workplace Injury',
61
- 'DUI and DWI': 'Involved in a DUI/DWI',
62
- 'Social Security Disability and Insurance': 'Interest in Disability Benefits',
63
- 'Divorce and Separation': 'Need a Divorce or Separation',
64
- 'Child Custody': 'Need help with Child Custody',
64
+ "Auto and Car Accidents": "Injured in a Car Accident",
65
+ "Personal Injury": "Personal or Workplace Injury",
66
+ "DUI and DWI": "Involved in a DUI/DWI",
67
+ "Social Security Disability and Insurance": "Interest in Disability Benefits",
68
+ "Divorce and Separation": "Need a Divorce or Separation",
69
+ "Child Custody": "Need help with Child Custody",
65
70
  },
66
71
  "Probate and Estates": {
67
- 'Auto and Car Accidents': 'Injured in a Car Accident',
68
- 'Personal Injury': 'Personal or Workplace Injury',
69
- 'DUI and DWI': 'Involved in a DUI/DWI',
70
- 'Social Security Disability and Insurance': 'Interest in Disability Benefits',
71
- 'Divorce and Separation': 'Need a Divorce or Separation',
72
- 'Child Custody': 'Need help with Child Custody',
72
+ "Auto and Car Accidents": "Injured in a Car Accident",
73
+ "Personal Injury": "Personal or Workplace Injury",
74
+ "DUI and DWI": "Involved in a DUI/DWI",
75
+ "Social Security Disability and Insurance": "Interest in Disability Benefits",
76
+ "Divorce and Separation": "Need a Divorce or Separation",
77
+ "Child Custody": "Need help with Child Custody",
73
78
  },
74
79
  "Power of Attorney": {
75
- 'Auto and Car Accidents': 'Injured in a Car Accident',
76
- 'Personal Injury': 'Personal or Workplace Injury',
77
- 'DUI and DWI': 'Involved in a DUI/DWI',
78
- 'Social Security Disability and Insurance': 'Interest in Disability Benefits',
79
- 'Divorce and Separation': 'Need a Divorce or Separation',
80
- 'Child Custody': 'Need help with Child Custody',
80
+ "Auto and Car Accidents": "Injured in a Car Accident",
81
+ "Personal Injury": "Personal or Workplace Injury",
82
+ "DUI and DWI": "Involved in a DUI/DWI",
83
+ "Social Security Disability and Insurance": "Interest in Disability Benefits",
84
+ "Divorce and Separation": "Need a Divorce or Separation",
85
+ "Child Custody": "Need help with Child Custody",
81
86
  },
82
87
  "Long Term Disability": {
83
- 'Auto and Car Accidents': 'Injured in a Car Accident',
84
- 'DUI and DWI': 'Involved in a DUI/DWI',
85
- 'Wills and Trusts': 'Need a Will or Trust',
86
- 'Power of Attorney': 'Update Power of Attorney',
87
- 'Divorce and Separation': 'Need a Divorce or Separation',
88
- 'Child Custody': 'Need help with Child Custody',
88
+ "Auto and Car Accidents": "Injured in a Car Accident",
89
+ "DUI and DWI": "Involved in a DUI/DWI",
90
+ "Wills and Trusts": "Need a Will or Trust",
91
+ "Power of Attorney": "Update Power of Attorney",
92
+ "Divorce and Separation": "Need a Divorce or Separation",
93
+ "Child Custody": "Need help with Child Custody",
89
94
  },
90
95
  "Social Security Disability and Insurance": {
91
- 'Auto and Car Accidents': 'Injured in a Car Accident',
92
- 'DUI and DWI': 'Involved in a DUI/DWI',
93
- 'Wills and Trusts': 'Need a Will or Trust',
94
- 'Power of Attorney': 'Update Power of Attorney',
95
- 'Divorce and Separation': 'Need a Divorce or Separation',
96
- 'Child Custody': 'Need help with Child Custody',
96
+ "Auto and Car Accidents": "Injured in a Car Accident",
97
+ "DUI and DWI": "Involved in a DUI/DWI",
98
+ "Wills and Trusts": "Need a Will or Trust",
99
+ "Power of Attorney": "Update Power of Attorney",
100
+ "Divorce and Separation": "Need a Divorce or Separation",
101
+ "Child Custody": "Need help with Child Custody",
97
102
  },
98
- '*': defaultLegalImprovementCrossSells,
103
+ "*": defaultLegalImprovementCrossSells,
99
104
  };
100
105
 
101
106
  // ------ Common Base Settings
@@ -104,32 +109,49 @@ const checkbox = (updates) => {
104
109
  if (updates.name && !updates.id) {
105
110
  updates.id = updates.name;
106
111
  }
107
- return merge({
108
- $formkit: 'checkbox',
109
- validation: 'required',
110
- validationMessages: {
111
- required: 'Field is required'
112
- }
113
- }, updates)
112
+ return merge(
113
+ {
114
+ $formkit: "checkbox",
115
+ validation: "required",
116
+ validationMessages: {
117
+ required: "Field is required",
118
+ },
119
+ },
120
+ updates
121
+ )
114
122
  };
115
123
 
116
124
  const sbsCheckbox = (updates) => {
117
- updates.legendClass = 'legend-left required';
118
- updates.fieldsetClass = '$reset side-by-side';
119
- updates.optionsClass = 't-pl-1';
120
- updates.innerClass = 't-flex t-items-center';
121
- updates.wrapperClass = 't-mb-3';
125
+ updates.legendClass = "legend-left required";
126
+ updates.fieldsetClass = "$reset side-by-side";
127
+ updates.optionsClass = "t-pl-1";
128
+ updates.innerClass = "t-flex t-items-center";
129
+ updates.wrapperClass = "t-mb-3";
122
130
  return checkbox(updates)
123
131
  };
124
132
 
125
133
  const col2Checkbox = (updates) => {
126
134
  if (!updates || !updates.legendClass) {
127
- updates.legendClass = 'required';
135
+ updates.legendClass = "required";
128
136
  }
129
- updates.fieldsetClass = '$reset';
130
- updates.optionsClass = 't-pl-8 md:t-pl-2 t-pt-3 t-grid t-grid-cols-1 md:t-grid-cols-2';
131
- updates.innerClass = 't-items-start';
132
- updates.wrapperClass = '$reset t-flex t-cursor-pointer t-mb-3';
137
+ updates.fieldsetClass = "$reset";
138
+ updates.optionsClass = "t-pl-8 md:t-pl-2 t-pt-3 t-grid t-grid-cols-1 md:t-grid-cols-2";
139
+ updates.innerClass = "t-items-start";
140
+ updates.wrapperClass = "$reset t-flex t-cursor-pointer t-mb-3";
141
+ return checkbox(updates)
142
+ };
143
+
144
+ const verticalCol2Checkbox = (updates) => {
145
+ if (!updates || !updates.legendClass) {
146
+ updates.legendClass = "required t-w-[100%] t-text-center";
147
+ }
148
+ updates.fieldsetClass = "$reset t-flex t-justify-center t-flex-col";
149
+ updates.innerClass = "t-items-start";
150
+ updates.wrapperClass = "$reset t-flex t-cursor-pointer t-mb-3";
151
+ updates.optionClass = "t-pl-4 md:t-pl-16 md:t-min-w-[200px]";
152
+ updates.optionsClass = "t-pl-4 t-pt-3 t-grid t-grid-cols-1 md:t-grid-cols-2";
153
+ updates.messagesClass = "t-flex t-justify-center";
154
+ updates.helpClass = "t-mt-0 t-mb-4 !t-text-sm t-text-center";
133
155
  return checkbox(updates)
134
156
  };
135
157
 
@@ -137,70 +159,121 @@ const radio = (updates) => {
137
159
  if (updates.name && !updates.id) {
138
160
  updates.id = updates.name;
139
161
  }
140
- return merge({
141
- $formkit: 'radio',
142
- validation: 'required',
143
- validationMessages: {
144
- required: 'Field is required'
162
+ return merge(
163
+ {
164
+ $formkit: "radio",
165
+ validation: "required",
166
+ validationMessages: {
167
+ required: "Field is required",
168
+ },
169
+ optionsClass: "t-pt-3 t-pl-1",
170
+ legendClass: "required",
145
171
  },
146
- optionsClass: 't-pt-3 t-pl-1',
147
- legendClass: 'required'
148
- }, updates)
172
+ updates
173
+ )
149
174
  };
150
175
 
151
176
  const col2Radio = (updates) => {
152
- updates.legendClass = 'required';
153
- updates.fieldsetClass = '$reset';
154
- updates.optionsClass = 't-pl-2 t-pt-3 t-grid t-grid-cols-1 md:t-grid-cols-2';
155
- updates.innerClass = 't-items-start';
156
- updates.wrapperClass = '$reset t-flex t-cursor-pointer t-mb-3';
177
+ updates.legendClass = "required";
178
+ updates.fieldsetClass = "$reset";
179
+ updates.optionsClass = "t-pl-2 t-pt-3 t-grid t-grid-cols-1 md:t-grid-cols-2";
180
+ updates.innerClass = "t-items-start";
181
+ updates.wrapperClass = "$reset t-flex t-cursor-pointer t-mb-3";
182
+ return radio(updates)
183
+ };
184
+
185
+ // TODO: rename
186
+ const col2RadioCenter = (updates) => {
187
+ updates.legendClass = "required t-w-[100%] t-text-center";
188
+ if (typeof updates.fieldsetClass === "undefined") {
189
+ updates.fieldsetClass = "$reset t-flex t-justify-center";
190
+ }
191
+ updates.innerClass = "t-items-start";
192
+ updates.wrapperClass = "$reset t-flex t-cursor-pointer t-mb-3";
193
+ updates.optionClass = "t-pl-4 md:t-pl-8 md:t-min-w-[200px]";
194
+ updates.optionsClass = "t-pl-4 t-pt-3 t-grid t-grid-cols-1 md:t-grid-cols-2";
195
+ updates.messagesClass = "t-flex t-justify-center";
196
+ updates.helpClass = "t-mt-0 t-mb-4 !t-text-sm t-text-center";
157
197
  return radio(updates)
158
198
  };
159
199
 
160
200
  const sbs2ColRadio = (updates) => {
161
- updates.legendClass = 'legend-left-flex md:t-max-w-[40%] required';
162
- updates.fieldsetClass = '$reset side-by-side-flex';
163
- updates.optionsClass = 'md:t-ml-4 md:t-mt-2 t-grid t-grid-cols-1 md:t-grid-cols-2-125';
164
- updates.innerClass = 't-flex t-items-start';
165
- updates.wrapperClass = '$reset t-flex t-cursor-pointer t-mb-3';
201
+ updates.legendClass = "legend-left-flex md:t-max-w-[40%] required";
202
+ updates.fieldsetClass = "$reset side-by-side-flex";
203
+ updates.optionsClass = "md:t-ml-4 md:t-mt-2 t-grid t-grid-cols-1 md:t-grid-cols-2-125";
204
+ updates.innerClass = "t-flex t-items-start";
205
+ updates.wrapperClass = "$reset t-flex t-cursor-pointer t-mb-3";
166
206
  return radio(updates)
167
207
  };
168
208
 
169
209
  const sbs2ItemRadio = (updates) => {
170
- updates.legendClass = 'legend-left t-pb-1 required';
171
- updates.fieldsetClass = '$reset side-by-side t-items-center';
172
- updates.optionsClass = 't-mt-1 t-grid t-grid-cols-1 md:t-grid-cols-2-125 t-items-center';
173
- updates.innerClass = 't-flex t-items-center';
174
- updates.optionClass = 't-pr-1';
210
+ updates.legendClass = "legend-left t-pb-1 required";
211
+ updates.fieldsetClass = "$reset side-by-side t-items-center";
212
+ updates.optionsClass = "t-mt-1 t-grid t-grid-cols-1 md:t-grid-cols-2-125 t-items-center";
213
+ updates.innerClass = "t-flex t-items-center";
214
+ updates.optionClass = "t-pr-1";
175
215
  return radio(updates)
176
216
  };
177
217
 
178
218
  const sbsYesNoRadio = (updates) => {
179
- updates.options = ['Yes', 'No'];
219
+ updates.options = ["Yes", "No"];
180
220
  return sbs2ItemRadio(updates)
181
221
  };
182
222
 
223
+ const verticalButtonRadio = (updates) => {
224
+ updates.legendClass = "legend-left";
225
+ updates.fieldsetClass = "$reset t-flex t-justify-center t-flex-col-reverse t-items-center";
226
+ if (typeof updates.optionsClass === "undefined") {
227
+ updates.optionsClass = "t-flex t-flex-col sm:t-flex-row t-justify-center t-my-3";
228
+ }
229
+ updates.optionClass = "radiobtn t-my-2 sm:t-my-0 t-mx-2 md:t-mx-5";
230
+ updates.wrapperClass = "$reset formkit-wrapper t-mb-0 t-flex t-items-center t-h-[100%]";
231
+ updates.labelClass = "t-font-semibold t-text-[#1e448f] t-w-[100%]";
232
+ updates.decoratorIcon = false;
233
+ updates.messagesClass = "t-flex t-justify-center";
234
+ updates.helpClass = "t-mt-2.5 !t-text-sm t-text-center";
235
+ return radio(updates)
236
+ };
237
+
238
+ const verticalYesNoRadio = (updates) => {
239
+ updates.options = ["Yes", "No"];
240
+ updates.optionsClass = "t-flex t-justify-center t-my-3";
241
+ return verticalButtonRadio(updates)
242
+ };
243
+
183
244
  const select = (updates) => {
184
245
  if (updates.name && !updates.id) {
185
246
  updates.id = updates.name;
186
247
  }
187
- return merge({
188
- $formkit: 'select',
189
- placeholder: "Please Select",
190
- validation: 'required',
191
- validationMessages: {
192
- required: 'Field is required'
248
+ return merge(
249
+ {
250
+ $formkit: "select",
251
+ placeholder: "Please Select",
252
+ validation: "required",
253
+ validationMessages: {
254
+ required: "Field is required",
255
+ },
256
+ inputClass: "t-bg-white",
257
+ labelClass: "required",
193
258
  },
194
- inputClass: 't-bg-white',
195
- labelClass: 'required'
196
- }, updates)
259
+ updates
260
+ )
197
261
  };
198
262
 
199
263
  const sbsSelect = (updates) => {
200
- updates.labelClass = 'required';
201
- updates.wrapperClass = 'side-by-side t-items-center';
202
- updates.innerClass = 'select-height-content';
203
- updates.helpClass = 't-mt-2.5 md:t-text-right md:t-mt-[-5px]';
264
+ updates.labelClass = "required";
265
+ updates.wrapperClass = "side-by-side t-items-center";
266
+ updates.innerClass = "select-height-content";
267
+ updates.helpClass = "t-mt-2.5 md:t-text-right md:t-mt-[-5px]";
268
+ return select(updates)
269
+ };
270
+
271
+ const verticalSelect = (updates) => {
272
+ updates.labelClass = "required";
273
+ updates.wrapperClass = "t-flex t-justify-center";
274
+ updates.messagesClass = "t-flex t-justify-center";
275
+ updates.inputClass = "t-min-w-[150px] t-bg-white";
276
+ updates.helpClass = "t-mt-2.5 t-text-center";
204
277
  return select(updates)
205
278
  };
206
279
 
@@ -208,26 +281,29 @@ const text = (updates) => {
208
281
  if (updates.name && !updates.id) {
209
282
  updates.id = updates.name;
210
283
  }
211
- return merge({
212
- $formkit: 'text',
213
- validation: 'required',
214
- validationMessages: {
215
- required: 'Field is required'
284
+ return merge(
285
+ {
286
+ $formkit: "text",
287
+ validation: "required",
288
+ validationMessages: {
289
+ required: "Field is required",
290
+ },
291
+ labelClass: "required",
216
292
  },
217
- labelClass: 'required'
218
- }, updates)
293
+ updates
294
+ )
219
295
  };
220
296
 
221
297
  const sbsText = (updates) => {
222
- updates.wrapperClass = 'side-by-side t-items-center';
298
+ updates.wrapperClass = "side-by-side t-items-center";
223
299
  return text(updates)
224
300
  };
225
301
 
226
302
  const verticalText = (updates) => {
227
- updates.wrapperClass = 't-flex t-justify-center';
228
- updates.messagesClass = 't-flex t-justify-center';
229
- updates.inputClass = 't-text-center';
230
- updates.helpClass = 't-mt-2.5 !t-text-sm t-text-center';
303
+ updates.wrapperClass = "t-flex t-justify-center";
304
+ updates.messagesClass = "t-flex t-justify-center";
305
+ updates.inputClass = "t-text-center";
306
+ updates.helpClass = "t-mt-2.5 !t-text-sm t-text-center";
231
307
  return text(updates)
232
308
  };
233
309
 
@@ -235,509 +311,758 @@ const textArea = (updates) => {
235
311
  if (updates.name && !updates.id) {
236
312
  updates.id = updates.name;
237
313
  }
238
- return merge({
239
- $formkit: 'textarea',
240
- rows: 5,
241
- maxlength: 500,
242
- validation: 'required',
243
- validationMessages: {
244
- required: 'Field is required'
314
+ return merge(
315
+ {
316
+ $formkit: "textarea",
317
+ rows: 5,
318
+ maxlength: 500,
319
+ validation: "required",
320
+ validationMessages: {
321
+ required: "Field is required",
322
+ },
323
+ innerClass: "t-max-w-xl",
324
+ labelClass: "required",
245
325
  },
246
- innerClass: 't-max-w-xl',
247
- labelClass: 'required'
248
- }, updates)
326
+ updates
327
+ )
249
328
  };
250
329
 
251
330
  const date = (updates) => {
252
331
  if (updates.name && !updates.id) {
253
332
  updates.id = updates.name;
254
333
  }
255
- return merge({
256
- $formkit: 'DatePicker',
257
- validation: 'required',
258
- validationMessages: {
259
- required: 'Field is required'
334
+ return merge(
335
+ {
336
+ $formkit: "DatePicker",
337
+ validation: "required",
338
+ validationMessages: {
339
+ required: "Field is required",
340
+ },
341
+ labelClass: "required t-block t-mb-3 t-font-semibold t-text-base formkit-invalid:t-text-red-500",
342
+ innerClass:
343
+ "t-border t-border-gray-400 formkit-invalid:t-border-red-500 t-rounded t-mb-1 focus-within:t-border-blue-500",
260
344
  },
261
- labelClass: 'required t-block t-mb-3 t-font-semibold t-text-base formkit-invalid:t-text-red-500',
262
- innerClass: 't-border t-border-gray-400 formkit-invalid:t-border-red-500 t-rounded t-mb-1 focus-within:t-border-blue-500'
263
- }, updates)
345
+ updates
346
+ )
264
347
  };
265
348
 
266
349
  const sbsDate = (updates) => {
267
- updates.wrapperClass = 'side-by-side t-items-center';
350
+ updates.wrapperClass = "side-by-side t-items-center";
268
351
  return date(updates)
269
352
  };
270
353
 
271
- const email = (scope) => sbsText({
272
- $formkit: 'email',
273
- name: scope ? scope + ':' + 'Email' : 'Email',
274
- label: 'Email Address:',
275
- placeholder: 'email@domain.com',
276
- autocomplete: 'email',
277
- 'data-tf-sensitive': 'false',
278
- validation: 'required|email',
279
- validationMessages: {
280
- required: 'Email is required',
281
- email: 'Invalid Email'
282
- }
283
- });
354
+ const verticalDate = (updates) => {
355
+ updates.wrapperClass = "t-flex t-justify-center";
356
+ updates.inputClass = "t-text-center";
357
+ updates.messagesClass = "t-flex t-justify-center";
358
+ return date(updates)
359
+ };
284
360
 
285
- const firstName = (scope) => sbsText({
286
- label: 'First Name:',
287
- placeholder: 'First',
288
- name: scope ? scope + ':' + 'First_Name' : 'First_Name',
289
- autocomplete: "given-name",
290
- validationMessages: {
291
- required: 'First Name is required'
292
- }
293
- });
361
+ const email = (scope, vertical, updates = {}) => {
362
+ const func = vertical ? verticalText : sbsText;
363
+ const label = vertical ? updates.label : "Email Address:";
364
+ return func({
365
+ $formkit: "email",
366
+ name: scope ? scope + ":" + "Email" : "Email",
367
+ label,
368
+ placeholder: "email@domain.com",
369
+ autocomplete: "email",
370
+ "data-tf-sensitive": "false",
371
+ validation: "required|email",
372
+ validationMessages: {
373
+ required: "Email is required",
374
+ email: "Invalid Email",
375
+ },
376
+ ...updates,
377
+ })
378
+ };
294
379
 
295
- const lastName = (scope) => sbsText({
296
- label: 'Last Name:',
297
- placeholder: 'Last',
298
- name: scope ? scope + ':' + 'Last_Name' : 'Last_Name',
299
- autocomplete: "family-name",
300
- validationMessages: {
301
- required: 'Last Name is required'
302
- }
303
- });
380
+ const firstName = (scope, vertical, updates = {}) => {
381
+ const func = vertical ? verticalText : sbsText;
382
+ const label = vertical ? updates.label : "First Name:";
383
+ return func({
384
+ label,
385
+ placeholder: "First",
386
+ name: scope ? scope + ":" + "First_Name" : "First_Name",
387
+ autocomplete: "given-name",
388
+ validationMessages: {
389
+ required: "First Name is required",
390
+ },
391
+ ...updates,
392
+ })
393
+ };
304
394
 
305
- const phone = (scope) => sbsText({
306
- $formkit: 'tel',
307
- name: scope ? scope + ':' + 'Primary_Phone' : 'Primary_Phone',
308
- label: 'Phone Number:',
309
- placeholder: '###-###-####',
310
- maxlength: 12,
311
- help: '10-digit phone number, hyphens optional',
312
- autocomplete: 'tel-national',
313
- 'data-tf-sensitive': 'false',
314
- validation: 'required|matches:/^[0-9]{3}-?[0-9]{3}-?[0-9]{4}$/|valid_phone',
315
- validationMessages: {
316
- required: 'Field is required',
317
- matches: 'Invalid Phone Format, use ###-###-####',
318
- valid_phone: 'Invalid Phone Number'
319
- },
320
- helpClass: "t-mt-2.5 md:t-text-right md:t-mt-[-2px]"
321
- });
395
+ const lastName = (scope, vertical, updates = {}) => {
396
+ const func = vertical ? verticalText : sbsText;
397
+ const label = vertical ? updates.label : "Last Name:";
398
+ return func({
399
+ label,
400
+ placeholder: "Last",
401
+ name: scope ? scope + ":" + "Last_Name" : "Last_Name",
402
+ autocomplete: "family-name",
403
+ validationMessages: {
404
+ required: "Last Name is required",
405
+ },
406
+ ...updates,
407
+ })
408
+ };
322
409
 
410
+ const phone = (scope, vertical, updates = {}) => {
411
+ const func = vertical ? verticalText : sbsText;
412
+ const label = vertical ? updates.label : "Phone Number:";
413
+ return func({
414
+ $formkit: "tel",
415
+ name: scope ? scope + ":" + "Primary_Phone" : "Primary_Phone",
416
+ label,
417
+ placeholder: "###-###-####",
418
+ maxlength: 12,
419
+ help: "10-digit phone number, hyphens optional",
420
+ autocomplete: "tel-national",
421
+ "data-tf-sensitive": "false",
422
+ validation: "required|matches:/^[0-9]{3}-?[0-9]{3}-?[0-9]{4}$/|valid_phone",
423
+ validationMessages: {
424
+ required: "Phone Number is required",
425
+ matches: "Invalid Phone Format, use ###-###-####",
426
+ valid_phone: "Invalid Phone Number",
427
+ },
428
+ helpClass: "t-mt-2.5 md:t-text-right md:t-mt-[-2px]",
429
+ ...updates,
430
+ })
431
+ };
323
432
 
324
433
  const zipcode = (scope, vertical, updates = {}) => {
325
434
  const func = vertical ? verticalText : sbsText;
326
- const label = vertical ? (updates.label) : 'Zip Code:';
327
- const help = vertical ? (updates.help ?? "We try to match you with local help") : null;
435
+ const label = vertical ? updates.label : "Zip Code:";
436
+ const help = vertical ? updates.help ?? "We try to match you with local help" : null;
328
437
  return func({
329
438
  label,
330
439
  help,
331
- placeholder: '#####',
332
- name: scope ? scope + ':' + 'Zip' : 'Zip',
440
+ placeholder: "#####",
441
+ name: scope ? scope + ":" + "Zip" : "Zip",
333
442
  maxlength: 5,
334
443
  inputmode: "numeric",
335
- autocomplete: 'postal-code',
336
- validation: 'required|matches:/^[0-9]{5}$/',
444
+ autocomplete: "postal-code",
445
+ validation: "required|matches:/^[0-9]{5}$/",
337
446
  validationMessages: {
338
- required: 'Zip Code is required',
339
- matches: 'Invalid Zip Code'
447
+ required: "Zip Code is required",
448
+ matches: "Invalid Zip Code",
340
449
  },
341
- ...updates
450
+ ...updates,
342
451
  })
343
452
  };
344
453
 
345
454
  const applicantAge = (scope, vertical, updates = {}) => {
346
455
  const func = vertical ? verticalText : sbsText;
347
- const label = vertical ? (updates.label) : 'Age of Applicant?';
348
- const value = vertical ? (updates.value ?? "50") : null;
349
- return func(merge({
350
- label,
351
- placeholder: 'Age between 18 and 65',
352
- name: scope ? scope + ':' + 'Applicant_Age' : 'Applicant_Age',
353
- value,
354
- maxlength: 2,
355
- inputmode: "numeric",
356
- validation: "required|min:18,max:65",
357
- validationMessages: {
358
- required: 'Applicant Age is required',
359
- min: 'Invalid Age - must be between 18 and 65',
360
- max: 'Invalid Age - must be between 18 and 65',
361
- },
362
- ...updates
363
- }))
456
+ const label = vertical ? updates.label : "Age of Applicant?";
457
+ const value = vertical ? updates.value ?? "50" : null;
458
+ return func(
459
+ merge({
460
+ label,
461
+ placeholder: "Age between 18 and 65",
462
+ name: scope ? scope + ":" + "Applicant_Age" : "Applicant_Age",
463
+ value,
464
+ maxlength: 2,
465
+ inputmode: "numeric",
466
+ validation: "required|min:18,max:65",
467
+ validationMessages: {
468
+ required: "Applicant Age is required",
469
+ min: "Invalid Age - must be between 18 and 65",
470
+ max: "Invalid Age - must be between 18 and 65",
471
+ },
472
+ ...updates,
473
+ })
474
+ )
364
475
  };
365
476
 
366
- const atFault = (scope) => sbsYesNoRadio({
367
- name: scope ? scope + ':' + 'At_Fault' : 'At_Fault',
368
- label: 'Were You at Fault?'
369
- });
477
+ const atFault = (scope, vertical, updates = {}) => {
478
+ const func = vertical ? verticalYesNoRadio : sbsYesNoRadio;
479
+ const label = vertical ? updates.label : "Were You at Fault?";
480
+ return func(
481
+ merge(
482
+ {
483
+ label,
484
+ name: scope ? scope + ":" + "At_Fault" : "At_Fault",
485
+ },
486
+ updates
487
+ )
488
+ )
489
+ };
370
490
 
371
- const bankruptcyCrossSell = () => sbsCheckbox({
372
- label: "I'd also like a consult for bankruptcy or debt elimination (optional)",
373
- help: "Note: you will be contacted separately by a bankruptcy/debt expert",
374
- name: 'CrossSell_Bankruptcy',
375
- id: 'CrossSell_Bankruptcy',
376
- if: '$getVal($get(form), "Type_Of_Legal_Problem") != "Bankruptcy" && ($getVal($get(form), "Degree_Of_Interest") == "Absolutely Can\'t Afford" || $getVal($get(form), "Degree_Of_Interest") == "Maybe" || $getVal($get(form), "Degree_Of_Interest") == "Probably")',
377
- validation: null,
378
- helpClass: "!t-text-sm"
379
- });
491
+ const bankruptcyCrossSell = (scope) =>
492
+ sbsCheckbox({
493
+ label: "I'd also like a consult for bankruptcy or debt elimination (optional)",
494
+ help: "Note: you will be contacted separately by a bankruptcy/debt expert",
495
+ name: scope ? scope + ":CrossSell_Bankruptcy" : "CrossSell_Bankruptcy",
496
+ id: scope ? scope + ":CrossSell_Bankruptcy" : "CrossSell_Bankruptcy",
497
+ if: '$getVal($get(form), "Type_Of_Legal_Problem") != "Bankruptcy" && ($getVal($get(form), "Degree_Of_Interest") == "Absolutely Can\'t Afford" || $getVal($get(form), "Degree_Of_Interest") == "Maybe" || $getVal($get(form), "Degree_Of_Interest") == "Probably")',
498
+ validation: null,
499
+ helpClass: "!t-text-sm",
500
+ });
501
+
502
+ const bloodContentAlcoholTest = (scope, vertical, updates = {}) => {
503
+ const func = vertical ? verticalSelect : sbsSelect;
504
+ const label = vertical ? updates.label : "Blood Alcohol Content Measured by Test:";
505
+ return func(
506
+ merge(
507
+ {
508
+ label,
509
+ name: scope ? scope + ":" + "Blood_Alcohol_Content_Test" : "Blood_Alcohol_Content_Test",
510
+ options: [
511
+ "No Test",
512
+ "0.00% - 0.04%",
513
+ "0.05% - 0.08%",
514
+ "0.09% - 0.12%",
515
+ "0.13% - 0.16%",
516
+ "0.17% - 0.20%",
517
+ "More than 0.20%",
518
+ "Don't know",
519
+ ],
520
+ },
521
+ updates
522
+ )
523
+ )
524
+ };
380
525
 
381
- const bloodContentAlcoholTest = (scope) => sbsSelect({
382
- name: scope ? scope + ':' + 'Blood_Alcohol_Content_Test' : 'Blood_Alcohol_Content_Test',
383
- label: 'Blood Alcohol Content Measured by Test:',
384
- options: [
385
- "No Test",
386
- "0.00% - 0.04%",
387
- "0.05% - 0.08%",
388
- "0.09% - 0.12%",
389
- "0.13% - 0.16%",
390
- "0.17% - 0.20%",
391
- "More than 0.20%",
392
- "Don't know"
393
- ]
394
- });
526
+ const causeOfInjury = (scope, vertical, updates = {}) => {
527
+ const func = vertical ? col2RadioCenter : sbsSelect;
528
+ const label = vertical ? updates.label : "Cause of Injury:";
529
+ return func(
530
+ merge(
531
+ {
532
+ label,
533
+ name: scope ? scope + ":" + "Cause_Of_Injury" : "Cause_Of_Injury",
534
+ options: [
535
+ "Traumatic Physical Injury (Accident)",
536
+ "Repeated Trauma Injury",
537
+ "Mental Injury",
538
+ "Occupational Disease",
539
+ "Not Sure",
540
+ ],
541
+ },
542
+ updates
543
+ )
544
+ )
545
+ };
395
546
 
396
- const causeOfInjury = (scope) => sbsSelect({
397
- name: scope ? scope + ':' + 'Cause_Of_Injury' : 'Cause_Of_Injury',
398
- label: 'Cause of Injury:',
399
- options: [
400
- "Traumatic Physical Injury (Accident)",
401
- "Repeated Trauma Injury",
402
- "Mental Injury",
403
- "Occupational Disease",
404
- "Not Sure"
405
- ]
406
- });
547
+ const childHome = (scope, vertical, updates = {}) => {
548
+ const func = vertical ? col2RadioCenter : sbsSelect;
549
+ const label = vertical ? updates.label : "With Whom Do the Children Currently Live?";
550
+ return func(
551
+ merge(
552
+ {
553
+ label,
554
+ name: scope ? scope + ":" + "Child_Home" : "Child_Home",
555
+ options: ["Mother", "Father", "Grandparents", "Other"],
556
+ },
557
+ updates
558
+ )
559
+ )
560
+ };
407
561
 
408
- const childHome = (scope) => sbsSelect({
409
- name: scope ? scope + ':' + 'Child_Home' : 'Child_Home',
410
- label: 'With Whom Do the Children Currently Live?',
411
- options: [
412
- 'Mother',
413
- 'Father',
414
- 'Grandparents',
415
- 'Other'
416
- ]
417
- });
562
+ const childPrimaryCaregiver = (scope, vertical, updates = {}) => {
563
+ const func = vertical ? verticalButtonRadio : sbsSelect;
564
+ const label = vertical ? updates.label : "Who is the Primary Caregiver?";
565
+ return func(
566
+ merge(
567
+ {
568
+ label,
569
+ name: scope ? scope + ":" + "Child_Primary_Caregiver" : "Child_Primary_Caregiver",
570
+ options: ["Mother", "Father", "Other"],
571
+ },
572
+ updates
573
+ )
574
+ )
575
+ };
418
576
 
419
- const childPrimaryCaregiver = (scope) => sbsSelect({
420
- name: scope ? scope + ':' + 'Child_Primary_Caregiver' : 'Child_Primary_Caregiver',
421
- label: 'Who is the Primary Caregiver?',
422
- options: [
423
- 'Mother',
424
- 'Father',
425
- 'Other'
426
- ]
427
- });
577
+ const childRelationship = (scope, vertical, updates = {}) => {
578
+ const func = vertical ? col2RadioCenter : sbsSelect;
579
+ const label = vertical ? updates.label : "Your Relationship to Child(ren):";
580
+ return func(
581
+ merge(
582
+ {
583
+ label,
584
+ name: scope ? scope + ":" + "Child_Relationship" : "Child_Relationship",
585
+ options: ["Father", "Mother", "Grandparent", "Aunt/Uncle", "Other"],
586
+ },
587
+ updates
588
+ )
589
+ )
590
+ };
428
591
 
429
- const childRelationship = (scope) => sbsSelect({
430
- name: scope ? scope + ':' + 'Child_Relationship' : 'Child_Relationship',
431
- label: 'Your Relationship to Child(ren):',
432
- options: [
433
- 'Father',
434
- 'Mother',
435
- 'Grandparent',
436
- 'Aunt/Uncle',
437
- 'Other'
438
- ]
439
- });
592
+ const claimStatus = (scope, vertical, updates = {}) => {
593
+ const func = vertical ? col2RadioCenter : sbsSelect;
594
+ const label = vertical ? updates.label : "Status of Claim:";
595
+ return func(
596
+ merge(
597
+ {
598
+ label,
599
+ name: scope ? scope + ":" + "Claim_Status" : "Claim_Status",
600
+ options: ["No action taken yet", "Demand for compensation made", "Lawsuit filed", "Other"],
601
+ },
602
+ updates
603
+ )
604
+ )
605
+ };
440
606
 
441
- const claimStatus = (scope) => sbsSelect({
442
- name: scope ? scope + ':' + 'Claim_Status' : 'Claim_Status',
443
- label: "Status of Claim:",
444
- options: [
445
- "No action taken yet",
446
- "Demand for compensation made",
447
- "Lawsuit filed",
448
- "Other"
449
- ]
450
- });
607
+ // TODO: vertical not supported yet
608
+ const comments = (scope, vertical, updates) =>
609
+ textArea(
610
+ merge(
611
+ {
612
+ name: scope ? scope + ":" + "Comments" : "Comments",
613
+ label: "Please briefly describe your situation in a few words:",
614
+ placeholder:
615
+ 'For Example: "I would like help with child support payments" or "I need help with visitation rights"',
616
+ },
617
+ updates
618
+ )
619
+ );
451
620
 
452
- const comments = (updates, scope) => textArea(
453
- merge({
454
- name: scope ? scope + ':' + 'Comments' : 'Comments',
455
- label: 'Please briefly describe your situation in a few words:',
456
- placeholder: 'For Example: "I would like help with child support payments" or "I need help with visitation rights"'
457
- }, updates)
458
- );
459
-
460
- const contractsTOLPDisplay = (updates) => col2Radio(merge({
461
- name: 'Type_Of_Legal_Problem_Display',
462
- label: 'Select The Contract Issue:',
463
- options: [
464
- 'Contract Creation',
465
- 'Contract Enforcement',
466
- 'Contract Cancellation',
467
- 'Contract Fraud',
468
- 'Breach of Contract',
469
- 'Other Contract Issues'
470
- ]
471
- }, updates));
472
-
473
- const degreeOfInterest = (scope, help) => sbsSelect({
474
- name: scope ? scope + ':' + 'Degree_Of_Interest' : 'Degree_Of_Interest',
475
- id: scope ? scope + ':' + 'Degree_Of_Interest' : 'Degree_Of_Interest',
476
- label: 'How Likely Are You to Pay if Your Issue Could be Resolved?',
477
- help: help,
478
- options: [
479
- 'Definitely',
480
- 'Probably',
481
- 'Maybe',
482
- "Absolutely Can't Afford"
483
- ]
484
- });
621
+ const contractsTOLPDisplay = (scope, vertical, updates = {}) => {
622
+ const func = vertical ? col2RadioCenter : col2Radio;
623
+ const label = vertical ? updates.label : "Select The Contract Issue:";
624
+ return func(
625
+ merge(
626
+ {
627
+ label,
628
+ name: scope ? scope + ":" + "Type_Of_Legal_Problem_Display" : "Type_Of_Legal_Problem_Display",
629
+ options: [
630
+ "Contract Creation",
631
+ "Contract Enforcement",
632
+ "Contract Cancellation",
633
+ "Contract Fraud",
634
+ "Breach of Contract",
635
+ "Other Contract Issues",
636
+ ],
637
+ },
638
+ updates
639
+ )
640
+ )
641
+ };
485
642
 
486
- const degreeOfInterestHelp = (scope) => degreeOfInterest(scope, 'No payment necessary to speak with lawyers.');
643
+ const degreeOfInterest = (scope, vertical, updates = {}) => {
644
+ const func = vertical ? col2RadioCenter : sbsSelect;
645
+ const label = vertical ? updates.label : "How Likely Are You to Pay if Your Issue Could be Resolved?";
646
+ const help = vertical ? updates.help : "No payment necessary to speak with lawyers.";
647
+ return func(
648
+ merge(
649
+ {
650
+ name: scope ? scope + ":" + "Degree_Of_Interest" : "Degree_Of_Interest",
651
+ id: scope ? scope + ":" + "Degree_Of_Interest" : "Degree_Of_Interest",
652
+ label,
653
+ help,
654
+ options: ["Definitely", "Probably", "Maybe", "Absolutely Can't Afford"],
655
+ },
656
+ updates
657
+ )
658
+ )
659
+ };
487
660
 
488
- const disabilityConditionStopWork = (scope) => sbsYesNoRadio({
489
- name: scope ? scope + ':' + 'Disability_Condition_Stop_Work' : 'Disability_Condition_Stop_Work',
490
- label: 'Do You Expect To Be Out Of Work For At Least a Year Due To Your Health?'
491
- });
661
+ const degreeOfInterestHelp = (scope, vertical, updates = {}) =>
662
+ degreeOfInterest(scope, vertical, merge(updates, { help: "No payment necessary to speak with lawyers." }));
492
663
 
493
- const disabilityWorkHistory = (scope) => sbsYesNoRadio({
494
- name: scope ? scope + ':' + 'Disability_Work_History' : 'Disability_Work_History',
495
- label: 'Have You Had a Full-Time Job Within the Past 5 Years?'
496
- });
664
+ const disabilityConditionStopWork = (scope, vertical, updates = {}) => {
665
+ const func = vertical ? verticalYesNoRadio : sbsYesNoRadio;
666
+ const label = vertical
667
+ ? updates.label
668
+ : "Do You Expect To Be Out Of Work For At Least a Year Due To Your Health?";
669
+ return func(
670
+ merge(
671
+ {
672
+ name: scope ? scope + ":" + "Disability_Condition_Stop_Work" : "Disability_Condition_Stop_Work",
673
+ label,
674
+ },
675
+ updates
676
+ )
677
+ )
678
+ };
497
679
 
498
- const doctorTreatment = (scope) => sbsYesNoRadio({
499
- name: scope ? scope + ':' + 'Doctor_Treatment' : 'Doctor_Treatment',
500
- label: 'Have You Recently Been Treated by a Doctor, Hospital or Clinic?',
501
- });
680
+ const disabilityWorkHistory = (scope, vertical, updates = {}) => {
681
+ const func = vertical ? verticalYesNoRadio : sbsYesNoRadio;
682
+ const label = vertical ? updates.label : "Have You Had a Full-Time Job Within the Past 5 Years?";
683
+ return func(
684
+ merge(
685
+ {
686
+ name: scope ? scope + ":" + "Disability_Work_History" : "Disability_Work_History",
687
+ label,
688
+ },
689
+ updates
690
+ )
691
+ )
692
+ };
502
693
 
503
- const estateLegalServicesNeeded = (scope) => sbsSelect({
504
- name: scope ? scope + ':' + 'Estate_Legal_Services_Needed' : 'Estate_Legal_Services_Needed',
505
- label: "Legal Services Needed for Your Estate:",
506
- options: [
507
- "Charitable Giving",
508
- "Contested Wills",
509
- "Drafting Wills or Trust",
510
- "Estate Administration",
511
- "Asset Protection",
512
- "Other"
513
- ]
514
- });
694
+ const doctorTreatment = (scope, vertical, updates = {}) => {
695
+ const func = vertical ? verticalYesNoRadio : sbsYesNoRadio;
696
+ const label = vertical ? updates.label : "Have You Recently Been Treated by a Doctor, Hospital or Clinic?";
697
+ return func(
698
+ merge(
699
+ {
700
+ name: scope ? scope + ":" + "Doctor_Treatment" : "Doctor_Treatment",
701
+ label,
702
+ },
703
+ updates
704
+ )
705
+ )
706
+ };
515
707
 
516
- const haveAttorney = (scope) => sbsYesNoRadio({
517
- name: scope ? scope + ':' + 'Have_Attorney' : 'Have_Attorney',
518
- label: 'Already Working with An Attorney?'
519
- });
708
+ const estateLegalServicesNeeded = (scope, vertical, updates = {}) => {
709
+ const func = vertical ? col2RadioCenter : sbsSelect;
710
+ const label = vertical ? updates.label : "Legal Services Needed for Your Estate:";
711
+ return func(
712
+ merge(
713
+ {
714
+ name: scope ? scope + ":" + "Estate_Legal_Services_Needed" : "Estate_Legal_Services_Needed",
715
+ label,
716
+ options: [
717
+ "Charitable Giving",
718
+ "Contested Wills",
719
+ "Drafting Wills or Trust",
720
+ "Estate Administration",
721
+ "Asset Protection",
722
+ "Other",
723
+ ],
724
+ },
725
+ updates
726
+ )
727
+ )
728
+ };
520
729
 
521
- const haveChildren = (scope) => sbsYesNoRadio({
522
- name: scope ? scope + ':' + 'Have_Children' : 'Have_Children',
523
- label: 'Do You Have Children?'
524
- });
730
+ const haveAttorney = (scope, vertical, updates = {}) => {
731
+ const func = vertical ? verticalYesNoRadio : sbsYesNoRadio;
732
+ const label = vertical ? updates.label : "Already Working with An Attorney?";
733
+ return func(
734
+ merge(
735
+ {
736
+ label,
737
+ name: scope ? scope + ":" + "Have_Attorney" : "Have_Attorney",
738
+ },
739
+ updates
740
+ )
741
+ )
742
+ };
525
743
 
526
- const incidentDate = (scope) => sbsDate({
527
- name: scope ? scope + ':' + 'Incident_Date' : 'Incident_Date',
528
- label: 'Date of Incident:',
529
- });
744
+ const haveChildren = (scope, vertical, updates = {}) => {
745
+ const func = vertical ? verticalYesNoRadio : sbsYesNoRadio;
746
+ const label = vertical ? updates.label : "Do You Have Children?";
747
+ return func(
748
+ merge(
749
+ {
750
+ name: scope ? scope + ":" + "Have_Children" : "Have_Children",
751
+ label,
752
+ },
753
+ updates
754
+ )
755
+ )
756
+ };
530
757
 
531
- const lawyerPaymentMethod = (scope) => sbsSelect({
532
- name: scope ? scope + ':' + 'Lawyer_Payment_Method' : 'Lawyer_Payment_Method',
533
- label: 'How Will You Pay for Legal Fees if You Hire a Lawyer?',
534
- help: 'No payment necessary to speak with lawyers.',
535
- options: [
536
- 'Cash',
537
- 'Check',
538
- 'Credit Card',
539
- 'Friend',
540
- 'Family',
541
- 'Other'
542
- ]
543
- });
758
+ const incidentDate = (scope, vertical, updates = {}) => {
759
+ const func = vertical ? verticalDate : sbsDate;
760
+ const label = vertical ? updates.label : "Date of Incident:";
761
+ return func(
762
+ merge(
763
+ {
764
+ label,
765
+ name: scope ? scope + ":" + "Incident_Date" : "Incident_Date",
766
+ },
767
+ updates
768
+ )
769
+ )
770
+ };
544
771
 
545
- const legalCrossSells$1 = () => col2Checkbox({
546
- id: 'Legal_CrossSells',
547
- name: 'Legal_CrossSells',
548
- help: 'Just hit "Next" if none apply',
549
- helpClass: 't-text-center !t-text-sm',
550
- validation: null,
551
- options: '$getCrossSellOptions($get(form), $getVal($get(form), "Type_Of_Legal_Problem"))',
552
- });
772
+ const lawyerPaymentMethod = (scope, vertical, updates = {}) => {
773
+ const func = vertical ? col2RadioCenter : sbsSelect;
774
+ const label = vertical ? updates.label : "How Will You Pay for Legal Fees if You Hire a Lawyer?";
775
+ const help = vertical ? updates.help : "No payment necessary to start a consultation.";
776
+ const options = vertical
777
+ ? {
778
+ Cash: "Cash",
779
+ "Credit Card": "Credit Card",
780
+ Family: "Family or Friend",
781
+ Other: "Other",
782
+ }
783
+ : ["Cash", "Check", "Credit Card", "Friend", "Family", "Other"];
784
+ return func(
785
+ merge(
786
+ {
787
+ label,
788
+ help,
789
+ name: scope ? scope + ":" + "Lawyer_Payment_Method" : "Lawyer_Payment_Method",
790
+ options,
791
+ fieldsetClass: vertical ? "$reset t-flex t-flex-col t-items-center" : undefined,
792
+ },
793
+ updates
794
+ )
795
+ )
796
+ };
553
797
 
554
- const maritalStatus = (scope) => sbsSelect({
555
- name: scope ? scope + ':' + 'Marital_Status' : 'Marital_Status',
556
- label: 'Marital Status:',
557
- options: [
558
- 'Unmarried, Living Together',
559
- 'Unmarried, Do Not Live Together',
560
- 'Married, Living Together',
561
- 'Separated',
562
- 'Divorced',
563
- 'Other'
564
- ]
565
- });
798
+ const legalCrossSells$1 = () =>
799
+ col2Checkbox({
800
+ id: "Legal_CrossSells",
801
+ name: "Legal_CrossSells",
802
+ help: 'Just hit "Next" if none apply',
803
+ helpClass: "t-text-center !t-text-sm",
804
+ validation: null,
805
+ options: '$getCrossSellOptions($get(form), $getVal($get(form), "Type_Of_Legal_Problem"))',
806
+ });
807
+
808
+ const maritalStatus = (scope, vertical, updates = {}) => {
809
+ const func = vertical ? col2RadioCenter : sbsSelect;
810
+ const label = vertical ? updates.label : "Marital Status:";
811
+ return func(
812
+ merge(
813
+ {
814
+ label,
815
+ name: scope ? scope + ":" + "Marital_Status" : "Marital_Status",
816
+ options: [
817
+ "Unmarried, Living Together",
818
+ "Unmarried, Do Not Live Together",
819
+ "Married, Living Together",
820
+ "Separated",
821
+ "Divorced",
822
+ "Other",
823
+ ],
824
+ },
825
+ updates
826
+ )
827
+ )
828
+ };
566
829
 
567
- const pendingCharges = (scope) => sbsYesNoRadio({
568
- name: scope ? scope + ':' + 'Pending_Charges' : 'Pending_Charges',
569
- label: 'Do you currently have any pending charges?'
570
- });
830
+ // XXX HERE
571
831
 
572
- const primaryInjury = (scope) => sbs2ColRadio({
573
- name: scope ? scope + ':' + 'Primary_Injury' : 'Primary_Injury',
574
- label: 'Primary Injury:',
575
- options: [
576
- "Anxiety",
577
- "Back or Neck Pain",
578
- "Broken Bones",
579
- "Cuts and Bruises",
580
- "Headaches",
581
- "Memory Loss",
582
- "Loss of Limb",
583
- "Not Sure or Other"
584
- ]
585
- });
832
+ const pendingCharges = (scope, vertical, updates = {}) => {
833
+ const func = vertical ? verticalYesNoRadio : sbsYesNoRadio;
834
+ const label = vertical ? updates.label : "Do you currently have any pending charges?";
835
+ return func(
836
+ merge(
837
+ {
838
+ name: scope ? scope + ":" + "Pending_Charges" : "Pending_Charges",
839
+ label,
840
+ },
841
+ updates
842
+ )
843
+ )
844
+ };
586
845
 
587
- const priorAlcoholOffenses = (scope) => sbsYesNoRadio({
588
- name: scope ? scope + ':' + 'Prior_Alcohol_Offenses' : 'Prior_Alcohol_Offenses',
589
- label: 'Any Prior Alcohol Related Offenses?'
590
- });
846
+ const primaryInjury = (scope, vertical, updates = {}) => {
847
+ const func = vertical ? col2RadioCenter : sbs2ColRadio;
848
+ const label = vertical ? updates.label : "Primary Injury:";
849
+ return func(
850
+ merge(
851
+ {
852
+ label,
853
+ name: scope ? scope + ":" + "Primary_Injury" : "Primary_Injury",
854
+ options: [
855
+ "Anxiety",
856
+ "Back or Neck Pain",
857
+ "Broken Bones",
858
+ "Cuts and Bruises",
859
+ "Headaches",
860
+ "Memory Loss",
861
+ "Loss of Limb",
862
+ "Not Sure or Other",
863
+ ],
864
+ },
865
+ updates
866
+ )
867
+ )
868
+ };
591
869
 
592
- const policeReportFiled = (scope) => sbsYesNoRadio({
593
- name: scope ? scope + ':' + 'Police_Report_Filed' : 'Police_Report_Filed',
594
- label: 'Was a Police Report Filed?'
595
- });
870
+ const priorAlcoholOffenses = (scope, vertical, updates = {}) => {
871
+ const func = vertical ? verticalYesNoRadio : sbsYesNoRadio;
872
+ const label = vertical ? updates.label : "Any Prior Alcohol Related Offenses?";
873
+ return func(
874
+ merge(
875
+ {
876
+ name: scope ? scope + ":" + "Prior_Alcohol_Offenses" : "Prior_Alcohol_Offenses",
877
+ label,
878
+ },
879
+ updates
880
+ )
881
+ )
882
+ };
596
883
 
597
- const roleInMatterProbate = (scope) => sbsSelect({
598
- name: scope ? scope + ':' + 'Role_In_Matter_Probate' : 'Role_In_Matter_Probate',
599
- label: "What Is Your Role in this Matter?",
600
- options: [
601
- "Preparing My Will",
602
- "Executor",
603
- "Heir",
604
- "Other"
605
- ]
606
- });
884
+ const policeReportFiled = (scope, vertical, updates = {}) => {
885
+ const func = vertical ? verticalYesNoRadio : sbsYesNoRadio;
886
+ const label = vertical ? updates.label : "Was a Police Report Filed?";
887
+ return func(
888
+ merge(
889
+ {
890
+ name: scope ? scope + ":" + "Police_Report_Filed" : "Police_Report_Filed",
891
+ label,
892
+ },
893
+ updates
894
+ )
895
+ )
896
+ };
607
897
 
608
- const socialSecurityDisabilityReceivingBenefits = (scope) => sbsYesNoRadio({
609
- name: scope ? scope + ':' + 'Social_Security_Disability_Receiving_Benefits' : 'Social_Security_Disability_Receiving_Benefits',
610
- label: 'Are You Currently Receiving Social Security Disability Benefits?'
611
- });
898
+ const roleInMatterProbate = (scope, vertical, updates = {}) => {
899
+ const func = vertical ? col2RadioCenter : sbsSelect;
900
+ const label = vertical ? updates.label : "What is Your Role in this Matter?";
901
+ return func(
902
+ merge(
903
+ {
904
+ label,
905
+ name: scope ? scope + ":" + "Role_In_Matter_Probate" : "Role_In_Matter_Probate",
906
+ options: ["Preparing My Will", "Executor", "Heir", "Other"],
907
+ },
908
+ updates
909
+ )
910
+ )
911
+ };
912
+
913
+ const socialSecurityDisabilityReceivingBenefits = (scope, vertical, updates = {}) => {
914
+ const func = vertical ? verticalYesNoRadio : sbsYesNoRadio;
915
+ const label = vertical ? updates.label : "Are You Currently Receiving Social Security Disability Benefits?";
916
+ return func(
917
+ merge(
918
+ {
919
+ name: scope
920
+ ? scope + ":" + "Social_Security_Disability_Receiving_Benefits"
921
+ : "Social_Security_Disability_Receiving_Benefits",
922
+ label,
923
+ },
924
+ updates
925
+ )
926
+ )
927
+ };
612
928
 
613
929
  const TCPAConsent = (scope) => ({
614
- $formkit: 'checkbox',
615
- label: '$meta.tcpaLanguage',
616
- name: scope ? scope + ':' + 'TCPA_Opt_In' : 'TCPA_Opt_In',
617
- 'data-tf-sensitive': 'false',
618
- validation: 'required|accepted',
930
+ $formkit: "checkbox",
931
+ label: "$meta.tcpaLanguage",
932
+ // Necessary to get links to work in the tcpa language
933
+ __raw__sectionsSchema: {
934
+ label: { attrs: { innerHTML: "$label" } },
935
+ },
936
+ name: scope ? scope + ":" + "TCPA_Opt_In" : "TCPA_Opt_In",
937
+ "data-tf-sensitive": "false",
938
+ validation: "required|accepted",
619
939
  validationMessages: {
620
- required: 'Consent is required',
621
- accepted: 'Consent is required'
940
+ required: "Consent is required",
941
+ accepted: "Consent is required",
622
942
  },
623
943
  classes: {
624
- label: "t-text-xs t-text-slate-500 t-font-normal"
625
- }
944
+ label: "t-text-xs t-text-slate-500 t-font-normal",
945
+ },
626
946
  });
627
947
 
628
- const typeOfAlcoholTest = (scope) => sbsSelect({
629
- name: scope ? scope + ':' + 'Type_Of_Alcohol_Test' : 'Type_Of_Alcohol_Test',
630
- label: 'Type of Alcohol Test Performed?',
631
- options: [
632
- "No Test",
633
- "Refused Test",
634
- "Breath Test",
635
- "Blood Test",
636
- "Urine Test",
637
- "Don't Know"
638
- ]
639
- });
948
+ const typeOfAlcoholTest = (scope, vertical, updates = {}) => {
949
+ const func = vertical ? col2RadioCenter : sbsSelect;
950
+ const label = vertical ? updates.label : "Type of Alcohol Test Performed?";
951
+ return func(
952
+ merge(
953
+ {
954
+ label,
955
+ name: scope ? scope + ":" + "Type_Of_Alcohol_Test" : "Type_Of_Alcohol_Test",
956
+ options: ["No Test", "Refused Test", "Breath Test", "Blood Test", "Urine Test", "Don't Know"],
957
+ },
958
+ updates
959
+ )
960
+ )
961
+ };
640
962
 
641
- const typeOfAssets = (scope) => col2Checkbox({
642
- name: scope ? scope + ':' + 'Type_Of_Assets' : 'Type_Of_Assets',
643
- label: 'Type of Assets:',
644
- options: [
645
- "Business Interests",
646
- "Cash",
647
- "Life Insurance Policies",
648
- "Pensions/Retirement",
649
- "Personal Possessions",
650
- "Property",
651
- "Stock/Bonds"
652
- ]
653
- });
963
+ const typeOfAssets = (scope, vertical, updates = {}) => {
964
+ const func = vertical ? verticalCol2Checkbox : col2Checkbox;
965
+ const label = vertical ? updates.label : "Type of Assets:";
966
+ return func(
967
+ merge(
968
+ {
969
+ label,
970
+ name: scope ? scope + ":" + "Type_Of_Assets" : "Type_Of_Assets",
971
+ options: [
972
+ "Business Interests",
973
+ "Cash",
974
+ "Life Insurance Policies",
975
+ "Pensions/Retirement",
976
+ "Personal Possessions",
977
+ "Property",
978
+ "Stock/Bonds",
979
+ ],
980
+ },
981
+ updates
982
+ )
983
+ )
984
+ };
654
985
 
655
- const valueOfAssets = (scope) => sbsSelect({
656
- name: scope ? scope + ':' + 'Value_Of_Assets' : 'Value_Of_Assets',
657
- label: 'Value of Your Assets?',
658
- options: [
659
- "Less than 50K",
660
- "50K to 100K",
661
- "100K to 250K",
662
- "250K to 500K",
663
- "500K to 1M",
664
- "More than 1M"
665
- ]
666
- });
986
+ const valueOfAssets = (scope, vertical, updates = {}) => {
987
+ const func = vertical ? col2RadioCenter : sbsSelect;
988
+ const label = vertical ? updates.label : "Value of Your Assets?";
989
+ return func(
990
+ merge(
991
+ {
992
+ label,
993
+ name: scope ? scope + ":" + "Value_Of_Assets" : "Value_Of_Assets",
994
+ options: ["Less than 50K", "50K to 100K", "100K to 250K", "250K to 500K", "500K to 1M", "More than 1M"],
995
+ },
996
+ updates
997
+ )
998
+ )
999
+ };
667
1000
 
668
- // ------ Question Groups
1001
+ // ------ Question Groups - TODO: move these go separate file groups.js
669
1002
 
670
1003
  // NOTE: name must be unique within a form!
671
1004
  const group = (name, updates) => {
672
- return merge({
673
- $cmp: 'FormKit',
674
- props: {
675
- type: 'group',
676
- key: name,
677
- id: name,
678
- name: name
679
- }
680
- }, updates)
1005
+ return merge(
1006
+ {
1007
+ $cmp: "FormKit",
1008
+ props: {
1009
+ type: "group",
1010
+ key: name,
1011
+ id: name,
1012
+ name: name,
1013
+ },
1014
+ },
1015
+ updates
1016
+ )
681
1017
  };
682
1018
 
683
- const AutoAndCarAccidentsQuestions = (condition, scope) => group(
684
- 'AutoAndCarAccidentsQuestions',
685
- {
686
- if: (condition || '$get(Type_Of_Legal_Problem).value == "Auto and Car Accidents"'),
1019
+ const AutoAndCarAccidentsQuestions = (condition, scope) =>
1020
+ group("AutoAndCarAccidentsQuestions", {
1021
+ if: condition || '$get(Type_Of_Legal_Problem).value == "Auto and Car Accidents"',
687
1022
  children: [
688
1023
  haveAttorney(scope),
689
1024
  incidentDate(scope),
690
1025
  atFault(scope),
691
1026
  primaryInjury(scope),
692
1027
  doctorTreatment(scope),
693
- policeReportFiled(scope)
694
- ]
695
- }
696
- );
1028
+ policeReportFiled(scope),
1029
+ ],
1030
+ });
697
1031
 
698
- const ContractsQuestions = () => group(
699
- 'ContractsQuestions',
700
- {
701
- children: [
702
- haveAttorney(),
703
- degreeOfInterestHelp()
704
- ]
705
- }
706
- );
1032
+ const ContractsQuestions = (condition, scope) =>
1033
+ group("ContractsQuestions", {
1034
+ if: condition || '$get(Type_Of_Legal_Problem).value == "Contracts"',
1035
+ children: [haveAttorney(scope), degreeOfInterestHelp(scope)],
1036
+ });
707
1037
 
708
- const ChildCustodyQuestions = (condition, scope) => group(
709
- 'ChildCustodyQuestions',
710
- {
711
- if: (condition || '$get(Type_Of_Legal_Problem).value == "Child Custody"'),
1038
+ const ChildCustodyQuestions = (condition, scope) =>
1039
+ group("ChildCustodyQuestions", {
1040
+ if: condition || '$get(Type_Of_Legal_Problem).value == "Child Custody"',
712
1041
  children: [
713
1042
  haveAttorney(scope),
714
1043
  childRelationship(scope),
715
1044
  childHome(scope),
716
1045
  childPrimaryCaregiver(scope),
717
1046
  degreeOfInterest(scope),
718
- lawyerPaymentMethod(scope)
719
- ]
720
- }
721
- );
1047
+ lawyerPaymentMethod(scope),
1048
+ ],
1049
+ });
722
1050
 
723
- const DivorceQuestions = (condition, scope) => group(
724
- 'DivorceQuestions',
725
- {
726
- if: (condition || '$get(Type_Of_Legal_Problem).value == "Divorce and Separation"'),
1051
+ const DivorceQuestions = (condition, scope) =>
1052
+ group("DivorceQuestions", {
1053
+ if: condition || '$get(Type_Of_Legal_Problem).value == "Divorce and Separation"',
727
1054
  children: [
728
1055
  haveAttorney(scope),
729
1056
  maritalStatus(scope),
730
1057
  haveChildren(scope),
731
1058
  degreeOfInterest(scope),
732
- lawyerPaymentMethod(scope)
733
- ]
734
- }
735
- );
1059
+ lawyerPaymentMethod(scope),
1060
+ ],
1061
+ });
736
1062
 
737
- const DUIAndDWIQuestions = (condition, scope) => group(
738
- 'DUIAndDWIQuestions',
739
- {
740
- if: (condition || '$get(Type_Of_Legal_Problem).value == "DUI and DWI"'),
1063
+ const DUIAndDWIQuestions = (condition, scope) =>
1064
+ group("DUIAndDWIQuestions", {
1065
+ if: condition || '$get(Type_Of_Legal_Problem).value == "DUI and DWI"',
741
1066
  children: [
742
1067
  haveAttorney(scope),
743
1068
  incidentDate(scope),
@@ -745,104 +1070,87 @@ const DUIAndDWIQuestions = (condition, scope) => group(
745
1070
  typeOfAlcoholTest(scope),
746
1071
  bloodContentAlcoholTest(scope),
747
1072
  pendingCharges(scope),
748
- degreeOfInterestHelp(scope)
749
- ]
750
- }
751
- );
1073
+ degreeOfInterestHelp(scope),
1074
+ ],
1075
+ });
752
1076
 
753
- const PersonalInjuryQuestions = (condition, scope) => group(
754
- 'PersonalInjuryQuestions',
755
- {
756
- if: (condition || '$get(Type_Of_Legal_Problem).value == "Personal Injury"'),
1077
+ const PersonalInjuryQuestions = (condition, scope) =>
1078
+ group("PersonalInjuryQuestions", {
1079
+ if: condition || '$get(Type_Of_Legal_Problem).value == "Personal Injury"',
757
1080
  children: [
758
1081
  haveAttorney(scope),
759
1082
  incidentDate(scope),
760
1083
  claimStatus(scope),
761
1084
  atFault(scope),
762
1085
  primaryInjury(scope),
763
- doctorTreatment(scope)
764
- ]
765
- }
766
- );
1086
+ doctorTreatment(scope),
1087
+ ],
1088
+ });
767
1089
 
768
- const PowerofAttorneyQuestions = (condition, scope) => group(
769
- 'PowerofAttorneyQuestions',
770
- {
771
- if: (condition || '$get(Type_Of_Legal_Problem).value == "Power of Attorney"'),
772
- children: [
773
- haveAttorney(scope),
774
- degreeOfInterestHelp(scope)
775
- ]
776
- }
777
- );
1090
+ const PowerofAttorneyQuestions = (condition, scope) =>
1091
+ group("PowerofAttorneyQuestions", {
1092
+ if: condition || '$get(Type_Of_Legal_Problem).value == "Power of Attorney"',
1093
+ children: [haveAttorney(scope), degreeOfInterestHelp(scope)],
1094
+ });
778
1095
 
779
- const SocialSecurityDisabilityAndInsuranceQuestions = (condition, scope) => group(
780
- 'SocialSecurityDisabilityAndInsuranceQuestions',
781
- {
782
- if: (condition || '$get(Type_Of_Legal_Problem).value == "Social Security Disability and Insurance"'),
1096
+ const SocialSecurityDisabilityAndInsuranceQuestions = (condition, scope) =>
1097
+ group("SocialSecurityDisabilityAndInsuranceQuestions", {
1098
+ if: condition || '$get(Type_Of_Legal_Problem).value == "Social Security Disability and Insurance"',
783
1099
  children: [
784
1100
  haveAttorney(scope),
785
1101
  applicantAge(scope),
786
1102
  disabilityConditionStopWork(scope),
787
1103
  disabilityWorkHistory(scope),
788
1104
  socialSecurityDisabilityReceivingBenefits(scope),
789
- doctorTreatment(scope)
790
- ]
791
- }
792
- );
1105
+ doctorTreatment(scope),
1106
+ ],
1107
+ });
793
1108
 
794
- const WillsAndTrustsQuestions = (condition, scope) => group(
795
- 'WillsAndTrustsQuestions',
796
- {
797
- if: (condition || '$get(Type_Of_Legal_Problem).value == "Wills and Trusts"'),
1109
+ const WillsAndTrustsQuestions = (condition, scope) =>
1110
+ group("WillsAndTrustsQuestions", {
1111
+ if: condition || '$get(Type_Of_Legal_Problem).value == "Wills and Trusts"',
798
1112
  children: [
799
1113
  haveAttorney(scope),
800
1114
  valueOfAssets(scope),
801
1115
  typeOfAssets(scope),
802
1116
  roleInMatterProbate(scope),
803
1117
  estateLegalServicesNeeded(scope),
804
- degreeOfInterestHelp(scope)
805
- ]
806
- }
807
- );
1118
+ degreeOfInterestHelp(scope),
1119
+ ],
1120
+ });
808
1121
 
809
- const WorkersCompensationQuestions = (condition, scope) => group(
810
- 'WorkersCompensationQuestions',
811
- {
812
- if: (condition || '$get(Type_Of_Legal_Problem).value == "Workers Compensation"'),
1122
+ const WorkersCompensationQuestions = (condition, scope) =>
1123
+ group("WorkersCompensationQuestions", {
1124
+ if: condition || '$get(Type_Of_Legal_Problem).value == "Workers Compensation"',
813
1125
  children: [
814
1126
  haveAttorney(scope),
815
1127
  incidentDate(scope),
816
1128
  claimStatus(scope),
817
1129
  primaryInjury(scope),
818
1130
  causeOfInjury(scope),
819
- doctorTreatment(scope)
820
- ]
821
- }
822
- );
1131
+ doctorTreatment(scope),
1132
+ ],
1133
+ });
823
1134
 
824
- const NotSureOrOtherQuestions = () => group(
825
- 'NotSureOrOtherQuestions',
826
- {
827
- if: '$get(Type_Of_Legal_Problem).value == "Not Sure or Other"',
828
- children: [
829
- haveAttorney(),
830
- degreeOfInterestHelp()
831
- ]
832
- }
833
- );
1135
+ const NotSureOrOtherQuestions = (condition, scope) =>
1136
+ group("NotSureOrOtherQuestions", {
1137
+ if: condition || '$get(Type_Of_Legal_Problem).value == "Not Sure or Other"',
1138
+ children: [haveAttorney(scope), degreeOfInterestHelp(scope)],
1139
+ });
834
1140
 
835
- const NEXT_ON_ENTER = '$onEnter($setNextStep($fireStepEvent($get(form)), $preStepFunc($get(form))))';
836
- const NEXT_ON_INPUT = '$onInput($setNextStep($fireStepEvent($get(form)), $preStepFunc($get(form))))';
1141
+ const NEXT_ON_ENTER = "$onEnter($setNextStep($fireStepEvent($get(form)), $preStepFunc($get(form))))";
1142
+ const NEXT_ON_INPUT = "$onInput($setNextStep($fireStepEvent($get(form)), $preStepFunc($get(form))))";
837
1143
 
838
- const isInput = (n) => { return (n.type !== 'group' && n.type !== 'section' && n.type !== 'form' && n.$formkit !== 'hidden' && !n.children) };
1144
+ const isInput = (n) => {
1145
+ return n.type !== "group" && n.type !== "section" && n.type !== "form" && n.$formkit !== "hidden" && !n.children
1146
+ };
839
1147
 
840
1148
  const findLastInput = (n) => {
841
1149
  if (isInput(n)) {
842
1150
  return n
843
1151
  }
844
1152
  for (var i = n.children.length - 1; i >= 0; i--) {
845
- if (typeof n.children === 'string') {
1153
+ if (typeof n.children === "string") {
846
1154
  continue
847
1155
  }
848
1156
  const child = n.children[i];
@@ -858,126 +1166,138 @@ const findLastInput = (n) => {
858
1166
  };
859
1167
 
860
1168
  const secureIconDefault = {
861
- $el: 'div',
862
- if: '$activeStep === $lastStep()',
1169
+ $el: "div",
1170
+ if: "$activeStep === $lastStep()",
863
1171
  attrs: {
864
- class: 't-flex t-justify-center t-items-center t-text-sm t-text-gray-500'
1172
+ class: "t-flex t-justify-center t-items-center t-text-sm t-text-gray-500",
865
1173
  },
866
1174
  children: [
867
1175
  {
868
- $el: 'img',
1176
+ $el: "img",
869
1177
  attrs: {
870
- loading: 'lazy',
871
- alt: '',
1178
+ loading: "lazy",
1179
+ alt: "",
872
1180
  style: {
873
- border: 0
1181
+ border: 0,
874
1182
  },
875
- width: '25',
876
- height: '25',
877
- src: 'https://d27hmee62k45vz.cloudfront.net/lock_icon_1.jpeg',
878
- }
1183
+ width: "25",
1184
+ height: "25",
1185
+ src: "https://d27hmee62k45vz.cloudfront.net/lock_icon_1.jpeg",
1186
+ },
879
1187
  },
880
1188
  {
881
- $el: 'span',
882
- children: 'Secure & Encrypted',
1189
+ $el: "span",
1190
+ children: "Secure & Encrypted",
883
1191
  attrs: {
884
- class: 't-pl-2 t-pt-1 t-font-medium'
885
- }
886
- }
887
- ]
1192
+ class: "t-pl-2 t-pt-1 t-font-medium",
1193
+ },
1194
+ },
1195
+ ],
888
1196
  };
889
1197
 
890
1198
  function secureIcon(updates) {
891
- return merge(
892
- secureIconDefault,
893
- updates
894
- )
1199
+ return merge(secureIconDefault, updates)
895
1200
  }
896
1201
 
897
1202
  function questionsStepHeadline(updates) {
898
1203
  return {
899
- $el: 'h3',
900
- children: updates.headline || 'Tell Us About Your Situation',
1204
+ $el: "h3",
1205
+ children: updates.headline || "Tell Us About Your Situation",
901
1206
  attrs: {
902
- class: 't-flex t-justify-center t-text-center t-text-2xl t-font-bold t-text-blue-500 t-pb-5 t-pt-0 t-px-1'
903
- }
1207
+ class: "t-flex t-justify-center t-text-center t-text-2xl t-font-bold t-text-blue-500 t-pb-5 t-pt-0 t-px-1",
1208
+ },
904
1209
  }
905
1210
  }
906
1211
 
907
1212
  function crossSellQuestionsStepHeadline(updates) {
908
1213
  return {
909
- $el: 'h3',
910
- children: updates.headline || 'Tell Us About Your Situation',
1214
+ $el: "h3",
1215
+ children: updates.headline || "Tell Us About Your Situation",
911
1216
  attrs: {
912
- class: 't-flex t-justify-center t-text-center t-text-2xl t-font-bold t-text-blue-500 t-pb-5 t-pt-0 t-px-1'
913
- }
1217
+ class: "t-flex t-justify-center t-text-center t-text-2xl t-font-bold t-text-blue-500 t-pb-4 t-pt-0 t-px-1",
1218
+ },
914
1219
  }
915
1220
  }
916
1221
 
917
1222
  function crossSellQuestionsStepSubHeadline(updates) {
918
1223
  return {
919
- $el: 'h5',
920
- children: updates.subheadline || 'Tell us about your situation:',
1224
+ $el: "h5",
1225
+ children: updates.subheadline || "Tell us about your situation:",
921
1226
  attrs: {
922
- class: 't-flex t-justify-center t-text-dark t-text-center !t-text-lg t-font-semibold t-pb-4 t-pt-0 t-px-3'
923
- }
1227
+ class: "t-flex t-justify-center t-text-dark t-text-center !t-text-lg t-font-semibold t-pb-4 t-pt-0 t-px-3",
1228
+ },
924
1229
  }
925
1230
  }
926
1231
 
927
1232
  function commentsStepHeadline(updates) {
928
1233
  return {
929
- $el: 'h3',
930
- children: updates.headline || 'Additional Details',
1234
+ $el: "h3",
1235
+ children: updates.headline || "Additional Details",
931
1236
  attrs: {
932
- class: 't-flex t-justify-center t-text-center t-text-2xl t-font-bold t-text-blue-500 t-pb-5 t-pt-0 t-px-1' + ' ' + (updates.headlineClass || '')
933
- }
1237
+ class:
1238
+ "t-flex t-justify-center t-text-center t-text-2xl t-font-bold t-text-blue-500 t-pb-5 t-pt-0 t-px-1" +
1239
+ " " +
1240
+ (updates.headlineClass || ""),
1241
+ },
934
1242
  }
935
1243
  }
936
1244
 
937
1245
  function commentsStepHeadlineLegal(updates) {
938
1246
  return commentsStepHeadline({
939
- headline: updates.headline || 'Additional Case Details',
940
- headlineClass: updates.headlineClass
1247
+ headline: updates.headline || "Additional Case Details",
1248
+ headlineClass: updates.headlineClass,
941
1249
  })
942
1250
  }
943
1251
 
944
1252
  function firstAndLastStepHeadline(updates) {
945
1253
  return {
946
- $el: 'h3',
947
- children: updates.headline || 'Please Provide a Contact Name',
1254
+ $el: "h3",
1255
+ children: updates.headline || "Please Provide a Contact Name",
948
1256
  attrs: {
949
- class: 't-flex t-justify-center t-text-center t-text-2xl t-font-bold t-text-blue-500 t-pb-5 t-pt-0 t-px-1' + ' ' + (updates.headlineClass || '')
950
- }
1257
+ class:
1258
+ "t-flex t-justify-center t-text-center t-text-2xl t-font-bold t-text-blue-500 t-pb-5 t-pt-0 t-px-1" +
1259
+ " " +
1260
+ (updates.headlineClass || ""),
1261
+ },
951
1262
  }
952
1263
  }
953
1264
 
954
1265
  function legalCrossSellsStepHeadline(updates) {
955
1266
  return {
956
- $el: 'h3',
957
- children: updates.headline || 'Do any of the following situations apply?',
1267
+ $el: "h3",
1268
+ children: updates.headline || "Do any of the following situations apply?",
958
1269
  attrs: {
959
- class: 't-flex t-justify-center t-text-center t-text-2xl t-font-bold t-text-blue-500 t-pb-5 t-pt-0 t-px-1' + ' ' + (updates.headlineClass || '')
960
- }
1270
+ class:
1271
+ "t-flex t-justify-center t-text-center t-text-2xl t-font-bold t-text-blue-500 t-pb-5 t-pt-0 t-px-1" +
1272
+ " " +
1273
+ (updates.headlineClass || ""),
1274
+ },
961
1275
  }
962
1276
  }
963
1277
 
964
1278
  function contactStepHeadline(updates) {
965
1279
  return {
966
- $el: 'h3',
1280
+ $el: "h3",
967
1281
  children: updates.headline || DEFAULT_FINAL_HEADLINE_DYNAMIC_LEGAL,
968
1282
  attrs: {
969
- class: 't-flex t-justify-center t-text-center t-text-2xl t-font-bold t-text-blue-500 t-pb-3 t-pt-0 t-px-1' + ' ' + (updates.headlineClass || '')
970
- }
1283
+ class:
1284
+ "t-flex t-justify-center t-text-center t-text-2xl t-font-bold t-text-blue-500 t-pb-3 t-pt-0 t-px-1" +
1285
+ " " +
1286
+ (updates.headlineClass || ""),
1287
+ },
971
1288
  }
972
1289
  }
973
1290
 
974
1291
  function contactStepSubHeadline(updates) {
975
1292
  return {
976
- $el: 'h5',
1293
+ $el: "h5",
977
1294
  children: updates.subheadline || DEFAULT_FINAL_SUBHEADLINE_DYNAMIC_LEGAL,
978
1295
  attrs: {
979
- class: 't-flex t-justify-center t-text-center !t-text-lg t-font-semibold t-pb-7 t-pt-0 t-px-3' + ' ' + (updates.subheadlineClass || '')
980
- }
1296
+ class:
1297
+ "t-flex t-justify-center t-text-center !t-text-lg t-font-semibold t-pb-7 t-pt-0 t-px-3" +
1298
+ " " +
1299
+ (updates.subheadlineClass || ""),
1300
+ },
981
1301
  }
982
1302
  }
983
1303
 
@@ -999,19 +1319,19 @@ const TRUSTED_FORM_JS = `(function() {
999
1319
 
1000
1320
  function trustedFormScript() {
1001
1321
  return {
1002
- $el: 'script',
1003
- if: '$activeStep === $lastStep()',
1004
- children: TRUSTED_FORM_JS
1322
+ $el: "script",
1323
+ if: "$activeStep === $lastStep()",
1324
+ children: TRUSTED_FORM_JS,
1005
1325
  }
1006
1326
  }
1007
1327
 
1008
1328
  const stepDefaults = (step, stepKey) => ({
1009
- $el: 'section',
1329
+ $el: "section",
1010
1330
  if: '$stepEnabled("' + step + '")',
1011
1331
  attrs: {
1012
1332
  hidden: '$activeStep !== "' + step + '"',
1013
- key: stepKey ? stepKey : step
1014
- }
1333
+ key: stepKey ? stepKey : step,
1334
+ },
1015
1335
  });
1016
1336
 
1017
1337
  function step(name, inputs, updates = {}) {
@@ -1034,27 +1354,24 @@ function step(name, inputs, updates = {}) {
1034
1354
  }
1035
1355
  }
1036
1356
 
1037
- return merge(
1038
- stepDefaults(name, stepKey),
1039
- {
1040
- children: [
1041
- {
1042
- $formkit: 'group',
1043
- id: name,
1044
- name: name,
1045
- nextStepMap: nextStepMap,
1046
- triggerRedirectMap: triggerRedirectMap,
1047
- autoFocus: autoFocus,
1048
- children: inputs
1049
- }
1050
- ]
1051
- }
1052
- )
1357
+ return merge(stepDefaults(name, stepKey), {
1358
+ children: [
1359
+ {
1360
+ $formkit: "group",
1361
+ id: name,
1362
+ name: name,
1363
+ nextStepMap: nextStepMap,
1364
+ triggerRedirectMap: triggerRedirectMap,
1365
+ autoFocus: autoFocus,
1366
+ children: inputs,
1367
+ },
1368
+ ],
1369
+ })
1053
1370
  }
1054
1371
 
1055
1372
  function contactInfo(updates = {}) {
1056
1373
  return step(
1057
- 'contactInfo',
1374
+ "contactInfo",
1058
1375
  [
1059
1376
  contactStepHeadline(updates),
1060
1377
  contactStepSubHeadline(updates),
@@ -1062,7 +1379,7 @@ function contactInfo(updates = {}) {
1062
1379
  email(updates.scope),
1063
1380
  phone(updates.scope),
1064
1381
  TCPAConsent(updates.scope),
1065
- secureIcon()
1382
+ secureIcon(),
1066
1383
  ],
1067
1384
  { nextOnEnter: false }
1068
1385
  )
@@ -1070,34 +1387,30 @@ function contactInfo(updates = {}) {
1070
1387
 
1071
1388
  function firstAndLastV2(updates = {}) {
1072
1389
  return step(
1073
- 'firstAndLast',
1074
- [
1075
- firstAndLastStepHeadline(updates),
1076
- firstName(),
1077
- lastName()
1078
- ],
1390
+ "firstAndLast",
1391
+ [firstAndLastStepHeadline(updates), firstName(updates.scope), lastName(updates.scope)],
1079
1392
  updates
1080
1393
  )
1081
1394
  }
1082
1395
 
1083
1396
  function contractsTOLPAndZip(updates = {}) {
1084
1397
  return step(
1085
- 'contractsTOLPAndZip',
1398
+ "contractsTOLPAndZip",
1086
1399
  [
1087
1400
  {
1088
- $formkit: 'hidden',
1401
+ $formkit: "hidden",
1089
1402
  name: "Type_Of_Legal_Problem",
1090
1403
  id: "Type_Of_Legal_Problem",
1091
- value: "Business Lawyers"
1404
+ value: "Business Lawyers",
1092
1405
  },
1093
1406
  {
1094
- $formkit: 'hidden',
1407
+ $formkit: "hidden",
1095
1408
  name: "Business_Services",
1096
1409
  id: "Business_Services",
1097
- value: "Contracts"
1410
+ value: "Contracts",
1098
1411
  },
1099
- contractsTOLPDisplay(),
1100
- zipcode()
1412
+ contractsTOLPDisplay(updates.scope),
1413
+ zipcode(updates.scope),
1101
1414
  ],
1102
1415
  updates
1103
1416
  )
@@ -1105,27 +1418,27 @@ function contractsTOLPAndZip(updates = {}) {
1105
1418
 
1106
1419
  function commentsWithBankruptcy(updates = {}) {
1107
1420
  return step(
1108
- 'commentsWithBankruptcy',
1421
+ "commentsWithBankruptcy",
1109
1422
  [
1110
1423
  commentsStepHeadlineLegal(updates),
1111
- comments({
1112
- label: typeof updates.label === 'undefined' ? DEFAULT_COMMENTS_LABEL_LEGAL : updates.label,
1424
+ comments(updates.scope, false, {
1425
+ label: typeof updates.label === "undefined" ? DEFAULT_COMMENTS_LABEL_LEGAL : updates.label,
1113
1426
  placeholder: updates.placeholder || DEFAULT_COMMENTS_PLACEHOLDER_DYNAMIC_LEGAL,
1114
- inputClass: typeof updates.inputClass === 'undefined' ? '!t-h-32' : updates.inputClass,
1115
- }, updates.scope),
1427
+ inputClass: typeof updates.inputClass === "undefined" ? "!t-h-32" : updates.inputClass,
1428
+ }),
1116
1429
  // TODO: needs scope support
1117
1430
  bankruptcyCrossSell(),
1118
1431
  {
1119
- $el: 'div',
1120
- if: '$get(CrossSell_Bankruptcy).value == true',
1432
+ $el: "div",
1433
+ if: "$get(CrossSell_Bankruptcy).value == true",
1121
1434
  children: [
1122
- comments({
1123
- label: 'Bankruptcy or debt details:',
1124
- placeholder: 'Please describe your bankrtupcy or debt situation in a few words...',
1125
- inputClass: '!t-h-16'
1126
- }, 'CrossSell:Bankruptcy')
1435
+ comments("CrossSell:Bankruptcy", false, {
1436
+ label: "Bankruptcy or debt details:",
1437
+ placeholder: "Please describe your bankrtupcy or debt situation in a few words...",
1438
+ inputClass: "!t-h-16",
1439
+ }),
1127
1440
  ],
1128
- }
1441
+ },
1129
1442
  ],
1130
1443
  { nextOnEnter: false }
1131
1444
  )
@@ -1133,19 +1446,20 @@ function commentsWithBankruptcy(updates = {}) {
1133
1446
 
1134
1447
  function autoAndCarAccidentCrossSellQuestions(updates = {}) {
1135
1448
  return step(
1136
- 'autoAndCarAccidentCrossSellQuestions',
1449
+ "autoAndCarAccidentCrossSellQuestions",
1137
1450
  [
1138
- crossSellQuestionsStepHeadline({ headline: 'You May Be Entitled To Compensation' }),
1139
- crossSellQuestionsStepSubHeadline({ subheadline: 'Tell us about your accident:' }),
1140
- AutoAndCarAccidentsQuestions("true", 'CrossSell:Auto_and_Car_Accidents'),
1141
- comments(
1142
- {
1143
- label: 'Accident Description:',
1144
- placeholder: 'Please describe your accident in a few words...',
1145
- inputClass: '!t-h-16'
1146
- },
1147
- 'CrossSell:Auto_and_Car_Accidents'
1148
- )
1451
+ crossSellQuestionsStepHeadline({
1452
+ headline: "You May Be Entitled To Compensation",
1453
+ }),
1454
+ crossSellQuestionsStepSubHeadline({
1455
+ subheadline: "Tell us about your accident:",
1456
+ }),
1457
+ AutoAndCarAccidentsQuestions("true", "CrossSell:Auto_and_Car_Accidents"),
1458
+ comments("CrossSell:Auto_and_Car_Accidents", false, {
1459
+ label: "Accident Description:",
1460
+ placeholder: "Please describe your accident in a few words...",
1461
+ inputClass: "!t-h-16",
1462
+ }),
1149
1463
  ],
1150
1464
  updates
1151
1465
  )
@@ -1153,18 +1467,15 @@ function autoAndCarAccidentCrossSellQuestions(updates = {}) {
1153
1467
 
1154
1468
  function childCustodyCrossSellQuestions(updates = {}) {
1155
1469
  return step(
1156
- 'childCustodyCrossSellQuestions',
1470
+ "childCustodyCrossSellQuestions",
1157
1471
  [
1158
- crossSellQuestionsStepHeadline({ headline: 'Child Custody Information' }),
1159
- ChildCustodyQuestions("true", 'CrossSell:Child_Custody'),
1160
- comments(
1161
- {
1162
- label: 'Description:',
1163
- placeholder: 'Please describe your situation in a few words...',
1164
- inputClass: '!t-h-16'
1165
- },
1166
- 'CrossSell:Child_Custody'
1167
- )
1472
+ crossSellQuestionsStepHeadline({ headline: "Child Custody Information" }),
1473
+ ChildCustodyQuestions("true", "CrossSell:Child_Custody"),
1474
+ comments("CrossSell:Child_Custody", false, {
1475
+ label: "Description:",
1476
+ placeholder: "Please describe your situation in a few words...",
1477
+ inputClass: "!t-h-16",
1478
+ }),
1168
1479
  ],
1169
1480
  updates
1170
1481
  )
@@ -1172,18 +1483,17 @@ function childCustodyCrossSellQuestions(updates = {}) {
1172
1483
 
1173
1484
  function divorceAndSeparationCrossSellQuestions(updates = {}) {
1174
1485
  return step(
1175
- 'divorceAndSeparationCrossSellQuestions',
1486
+ "divorceAndSeparationCrossSellQuestions",
1176
1487
  [
1177
- crossSellQuestionsStepHeadline({ headline: 'Divorce or Separation Information' }),
1178
- DivorceQuestions("true", 'CrossSell:Divorce_and_Separation'),
1179
- comments(
1180
- {
1181
- label: 'Description:',
1182
- placeholder: 'Please describe your situation in a few words...',
1183
- inputClass: '!t-h-16'
1184
- },
1185
- 'CrossSell:Divorce_and_Separation'
1186
- )
1488
+ crossSellQuestionsStepHeadline({
1489
+ headline: "Divorce or Separation Information",
1490
+ }),
1491
+ DivorceQuestions("true", "CrossSell:Divorce_and_Separation"),
1492
+ comments("CrossSell:Divorce_and_Separation", false, {
1493
+ label: "Description:",
1494
+ placeholder: "Please describe your situation in a few words...",
1495
+ inputClass: "!t-h-16",
1496
+ }),
1187
1497
  ],
1188
1498
  updates
1189
1499
  )
@@ -1191,18 +1501,15 @@ function divorceAndSeparationCrossSellQuestions(updates = {}) {
1191
1501
 
1192
1502
  function duiAndDWICrossSellQuestions(updates = {}) {
1193
1503
  return step(
1194
- 'duiAndDWICrossSellQuestions',
1504
+ "duiAndDWICrossSellQuestions",
1195
1505
  [
1196
- crossSellQuestionsStepHeadline({ headline: 'About Your DUI/DWI' }),
1197
- DUIAndDWIQuestions("true", 'CrossSell:DUI_and_DWI'),
1198
- comments(
1199
- {
1200
- label: 'Incident Description:',
1201
- placeholder: 'Please describe your incident in a few words...',
1202
- inputClass: '!t-h-16'
1203
- },
1204
- 'CrossSell:DUI_and_DWI'
1205
- )
1506
+ crossSellQuestionsStepHeadline({ headline: "About Your DUI/DWI" }),
1507
+ DUIAndDWIQuestions("true", "CrossSell:DUI_and_DWI"),
1508
+ comments("CrossSell:DUI_and_DWI", false, {
1509
+ label: "Incident Description:",
1510
+ placeholder: "Please describe your incident in a few words...",
1511
+ inputClass: "!t-h-16",
1512
+ }),
1206
1513
  ],
1207
1514
  updates
1208
1515
  )
@@ -1210,19 +1517,20 @@ function duiAndDWICrossSellQuestions(updates = {}) {
1210
1517
 
1211
1518
  function ssdiCrossSellQuestions(updates = {}) {
1212
1519
  return step(
1213
- 'ssdiCrossSellQuestions',
1520
+ "ssdiCrossSellQuestions",
1214
1521
  [
1215
- crossSellQuestionsStepHeadline({ headline: 'You May Be Entitled To Benefits' }),
1216
- crossSellQuestionsStepSubHeadline({ subheadline: 'Tell us about your disability:' }),
1217
- SocialSecurityDisabilityAndInsuranceQuestions("true", 'CrossSell:Social_Security_Disability_and_Insurance'),
1218
- comments(
1219
- {
1220
- label: 'Description:',
1221
- placeholder: 'Please describe your situation in a few words...',
1222
- inputClass: '!t-h-16'
1223
- },
1224
- 'CrossSell:Social_Security_Disability_and_Insurance'
1225
- )
1522
+ crossSellQuestionsStepHeadline({
1523
+ headline: "You May Be Entitled To Benefits",
1524
+ }),
1525
+ crossSellQuestionsStepSubHeadline({
1526
+ subheadline: "Tell us about your disability:",
1527
+ }),
1528
+ SocialSecurityDisabilityAndInsuranceQuestions("true", "CrossSell:Social_Security_Disability_and_Insurance"),
1529
+ comments("CrossSell:Social_Security_Disability_and_Insurance", false, {
1530
+ label: "Description:",
1531
+ placeholder: "Please describe your situation in a few words...",
1532
+ inputClass: "!t-h-16",
1533
+ }),
1226
1534
  ],
1227
1535
  updates
1228
1536
  )
@@ -1230,19 +1538,20 @@ function ssdiCrossSellQuestions(updates = {}) {
1230
1538
 
1231
1539
  function personalInjuryCrossSellQuestions(updates = {}) {
1232
1540
  return step(
1233
- 'personalInjuryCrossSellQuestions',
1541
+ "personalInjuryCrossSellQuestions",
1234
1542
  [
1235
- crossSellQuestionsStepHeadline({ headline: 'You May Be Entitled To Compensation' }),
1236
- crossSellQuestionsStepSubHeadline({ subheadline: 'Tell us about your injury:' }),
1237
- PersonalInjuryQuestions("true", 'CrossSell:Personal_Injury'),
1238
- comments(
1239
- {
1240
- label: 'Injury Description:',
1241
- placeholder: 'Please describe your injury in a few words...',
1242
- inputClass: '!t-h-16'
1243
- },
1244
- 'CrossSell:Personal_Injury'
1245
- )
1543
+ crossSellQuestionsStepHeadline({
1544
+ headline: "You May Be Entitled To Compensation",
1545
+ }),
1546
+ crossSellQuestionsStepSubHeadline({
1547
+ subheadline: "Tell us about your injury:",
1548
+ }),
1549
+ PersonalInjuryQuestions("true", "CrossSell:Personal_Injury"),
1550
+ comments("CrossSell:Personal_Injury", false, {
1551
+ label: "Injury Description:",
1552
+ placeholder: "Please describe your injury in a few words...",
1553
+ inputClass: "!t-h-16",
1554
+ }),
1246
1555
  ],
1247
1556
  updates
1248
1557
  )
@@ -1250,18 +1559,17 @@ function personalInjuryCrossSellQuestions(updates = {}) {
1250
1559
 
1251
1560
  function powerOfAttorneyCrossSellQuestions(updates = {}) {
1252
1561
  return step(
1253
- 'powerOfAttorneyCrossSellQuestions',
1562
+ "powerOfAttorneyCrossSellQuestions",
1254
1563
  [
1255
- crossSellQuestionsStepHeadline({ headline: 'Power of Attorney Information' }),
1256
- PowerofAttorneyQuestions("true", 'CrossSell:Power_of_Attorney'),
1257
- comments(
1258
- {
1259
- label: 'Description:',
1260
- placeholder: 'Please describe your situation in a few words...',
1261
- inputClass: '!t-h-16'
1262
- },
1263
- 'CrossSell:Power_of_Attorney'
1264
- )
1564
+ crossSellQuestionsStepHeadline({
1565
+ headline: "Power of Attorney Information",
1566
+ }),
1567
+ PowerofAttorneyQuestions("true", "CrossSell:Power_of_Attorney"),
1568
+ comments("CrossSell:Power_of_Attorney", false, {
1569
+ label: "Description:",
1570
+ placeholder: "Please describe your situation in a few words...",
1571
+ inputClass: "!t-h-16",
1572
+ }),
1265
1573
  ],
1266
1574
  updates
1267
1575
  )
@@ -1269,18 +1577,15 @@ function powerOfAttorneyCrossSellQuestions(updates = {}) {
1269
1577
 
1270
1578
  function willsAndTrustsCrossSellQuestions(updates = {}) {
1271
1579
  return step(
1272
- 'willsAndTrustsCrossSellQuestions',
1580
+ "willsAndTrustsCrossSellQuestions",
1273
1581
  [
1274
- crossSellQuestionsStepHeadline({ headline: 'Will or Trust Information' }),
1275
- WillsAndTrustsQuestions("true", 'CrossSell:Wills_and_Trusts'),
1276
- comments(
1277
- {
1278
- label: 'Description:',
1279
- placeholder: 'Please describe your situation in a few words...',
1280
- inputClass: '!t-h-16'
1281
- },
1282
- 'CrossSell:Wills_and_Trusts'
1283
- )
1582
+ crossSellQuestionsStepHeadline({ headline: "Will or Trust Information" }),
1583
+ WillsAndTrustsQuestions("true", "CrossSell:Wills_and_Trusts"),
1584
+ comments("CrossSell:Wills_and_Trusts", false, {
1585
+ label: "Description:",
1586
+ placeholder: "Please describe your situation in a few words...",
1587
+ inputClass: "!t-h-16",
1588
+ }),
1284
1589
  ],
1285
1590
  updates
1286
1591
  )
@@ -1288,19 +1593,20 @@ function willsAndTrustsCrossSellQuestions(updates = {}) {
1288
1593
 
1289
1594
  function workersCompensationCrossSellQuestions(updates = {}) {
1290
1595
  return step(
1291
- 'workersCompensationCrossSellQuestions',
1596
+ "workersCompensationCrossSellQuestions",
1292
1597
  [
1293
- crossSellQuestionsStepHeadline({ headline: 'You May Be Entitled To Benefits' }),
1294
- crossSellQuestionsStepSubHeadline({ subheadline: 'Tell us about your injury:' }),
1295
- WorkersCompensationQuestions("true", 'CrossSell:Workers_Compensation'),
1296
- comments(
1297
- {
1298
- label: 'Injury Description:',
1299
- placeholder: 'Please describe your injury in a few words...',
1300
- inputClass: '!t-h-16'
1301
- },
1302
- 'CrossSell:Workers_Compensation'
1303
- )
1598
+ crossSellQuestionsStepHeadline({
1599
+ headline: "You May Be Entitled To Benefits",
1600
+ }),
1601
+ crossSellQuestionsStepSubHeadline({
1602
+ subheadline: "Tell us about your injury:",
1603
+ }),
1604
+ WorkersCompensationQuestions("true", "CrossSell:Workers_Compensation"),
1605
+ comments("CrossSell:Workers_Compensation", false, {
1606
+ label: "Injury Description:",
1607
+ placeholder: "Please describe your injury in a few words...",
1608
+ inputClass: "!t-h-16",
1609
+ }),
1304
1610
  ],
1305
1611
  updates
1306
1612
  )
@@ -1308,135 +1614,124 @@ function workersCompensationCrossSellQuestions(updates = {}) {
1308
1614
 
1309
1615
  function contractsTOLPQuestions(updates = {}) {
1310
1616
  return step(
1311
- 'TOLPQuestions',
1312
- [
1313
- questionsStepHeadline(updates),
1314
- ContractsQuestions(),
1315
- NotSureOrOtherQuestions()
1316
- ],
1617
+ "TOLPQuestions",
1618
+ [questionsStepHeadline(updates), ContractsQuestions(), NotSureOrOtherQuestions()],
1317
1619
  updates
1318
1620
  )
1319
1621
  }
1320
1622
 
1321
1623
  function legalCrossSells(updates = {}) {
1322
1624
  updates.nextOnInput = false;
1323
- updates.stepKey = '$get(Type_Of_Legal_Problem).value';
1324
- return step(
1325
- 'legalCrossSells',
1326
- [
1327
- legalCrossSellsStepHeadline(updates),
1328
- legalCrossSells$1(),
1329
- ],
1330
- updates
1331
- )
1625
+ updates.stepKey = "$get(Type_Of_Legal_Problem).value";
1626
+ return step("legalCrossSells", [legalCrossSellsStepHeadline(updates), legalCrossSells$1()], updates)
1332
1627
  }
1333
1628
 
1334
1629
  const formNavigation = (updates = {}) => ({
1335
- $el: 'div',
1630
+ $el: "div",
1336
1631
  attrs: {
1337
- class: 'step-nav'
1632
+ class: "step-nav",
1338
1633
  },
1339
1634
  children: [
1340
1635
  {
1341
- $formkit: 'button',
1342
- name: 'back_button',
1343
- onClick: '$setPreviousStep($prevStepFunc($get(form)))',
1344
- children: 'Back',
1636
+ $formkit: "button",
1637
+ name: "back_button",
1638
+ onClick: "$setPreviousStep($prevStepFunc($get(form)))",
1639
+ children: "Back",
1345
1640
  style: {
1346
- if: '$activeStep === $firstStep()',
1347
- then: 'visibility: hidden;'
1348
- }
1641
+ if: "$activeStep === $firstStep()",
1642
+ then: "visibility: hidden;",
1643
+ },
1349
1644
  },
1350
1645
  {
1351
- $formkit: 'button',
1352
- name: 'next_button',
1353
- onClick: '$setNextStep($fireStepEvent($get(form)), $preStepFunc($get(form)))',
1646
+ $formkit: "button",
1647
+ name: "next_button",
1648
+ onClick: "$setNextStep($fireStepEvent($get(form)), $preStepFunc($get(form)))",
1354
1649
  children: {
1355
- if: '$activeStep === $firstStep()',
1356
- then: 'Start',
1357
- else: 'Next'
1650
+ if: "$activeStep === $firstStep()",
1651
+ then: "Start",
1652
+ else: "Next",
1358
1653
  },
1359
1654
  outerClass: {
1360
- if: '$activeStep === $lastStep()',
1361
- then: 't-hidden',
1362
- else: ''
1655
+ if: "$activeStep === $lastStep()",
1656
+ then: "t-hidden",
1657
+ else: "",
1363
1658
  },
1364
1659
  style: {
1365
- if: '$activeStep === $lastStep()',
1366
- then: 'display: none;'
1367
- }
1660
+ if: "$activeStep === $lastStep()",
1661
+ then: "display: none;",
1662
+ },
1368
1663
  },
1369
1664
  {
1370
- $formkit: 'submit',
1371
- name: 'submit_button',
1372
- label: updates.submitLabel || 'Submit',
1373
- if: '$activeStep === $lastStep()',
1665
+ $formkit: "submit",
1666
+ name: "submit_button",
1667
+ label: updates.submitLabel || "Submit",
1668
+ if: "$activeStep === $lastStep()",
1374
1669
  style: {
1375
- if: '$activeStep !== $lastStep()',
1376
- then: 'display: none;'
1377
- }
1378
- }
1379
- ]
1670
+ if: "$activeStep !== $lastStep()",
1671
+ then: "display: none;",
1672
+ },
1673
+ },
1674
+ ],
1380
1675
  });
1381
1676
 
1382
1677
  const formDetails = () => ({
1383
- $el: 'pre',
1678
+ $el: "pre",
1384
1679
  if: '$urlParam("fdbg", "") == 1',
1385
1680
  children: [
1386
1681
  {
1387
- $el: 'pre',
1388
- children: '$stringify( $get(form).value )',
1682
+ $el: "pre",
1683
+ children: "$stringify( $get(form).value )",
1389
1684
  attrs: {
1390
- class: 't-text-xs',
1391
- style: 'overflow: scroll'
1392
- }
1685
+ class: "t-text-xs",
1686
+ style: "overflow: scroll",
1687
+ },
1393
1688
  },
1394
1689
  {
1395
- $el: 'pre',
1396
- children: ['activeStep: ', '$activeStep'],
1690
+ $el: "pre",
1691
+ children: ["activeStep: ", "$activeStep"],
1397
1692
  attrs: {
1398
- class: 't-text-xs',
1399
- style: 'overflow: scroll'
1400
- }
1693
+ class: "t-text-xs",
1694
+ style: "overflow: scroll",
1695
+ },
1401
1696
  },
1402
1697
  {
1403
- $el: 'pre',
1404
- children: ['stepHistory: ', '$stepHistory'],
1698
+ $el: "pre",
1699
+ children: ["stepHistory: ", "$stepHistory"],
1405
1700
  attrs: {
1406
- class: 't-text-xs',
1407
- style: 'overflow: scroll'
1408
- }
1701
+ class: "t-text-xs",
1702
+ style: "overflow: scroll",
1703
+ },
1409
1704
  },
1410
1705
  {
1411
- $el: 'pre',
1412
- children: ['stepQueue: ', '$stepQueue'],
1706
+ $el: "pre",
1707
+ children: ["stepQueue: ", "$stepQueue"],
1413
1708
  attrs: {
1414
- class: 't-text-xs',
1415
- style: 'overflow: scroll'
1416
- }
1709
+ class: "t-text-xs",
1710
+ style: "overflow: scroll",
1711
+ },
1417
1712
  },
1418
1713
  {
1419
- $el: 'pre',
1420
- children: ['steps: ', '$stepKeys()'],
1714
+ $el: "pre",
1715
+ children: ["steps: ", "$stepKeys()"],
1421
1716
  attrs: {
1422
- class: 't-text-xs',
1423
- style: 'overflow: scroll'
1424
- }
1425
- }
1426
- ]
1717
+ class: "t-text-xs",
1718
+ style: "overflow: scroll",
1719
+ },
1720
+ },
1721
+ ],
1427
1722
  });
1428
1723
 
1429
1724
  const formPropDefaults = {
1430
- type: 'form',
1431
- id: 'form',
1432
- config: { validationVisibility: 'submit' },
1725
+ type: "form",
1726
+ id: "form",
1727
+ config: { validationVisibility: "submit" },
1433
1728
  onSubmit: '$submit($submitUrl, $prepData, $handleRedirect, "text/plain; charset=UTF-8")',
1434
- plugins: '$plugins',
1729
+ plugins: "$plugins",
1435
1730
  actions: false,
1436
- anchorElement: 'form-anchor',
1731
+ anchorElement: "form-anchor",
1437
1732
  useLocalStorage: true,
1438
1733
  prepop: {
1439
- fromURL: true
1734
+ fromURL: true,
1440
1735
  },
1441
1736
  errorCodes: {
1442
1737
  403: { message: "An Error Occurred", abort: false },
@@ -1444,13 +1739,11 @@ const formPropDefaults = {
1444
1739
  429: "An Error Occurred",
1445
1740
  504: { message: "An Error Occurred", abort: false },
1446
1741
  },
1447
- formClass: '!t-max-w-[40rem]'
1742
+ formClass: "!t-max-w-[40rem]",
1448
1743
  };
1449
1744
 
1450
1745
  function filterMapByKey(obj, keyList) {
1451
- return Object.fromEntries(
1452
- Object.entries(obj).filter(([key]) => keyList.includes(key))
1453
- );
1746
+ return Object.fromEntries(Object.entries(obj).filter(([key]) => keyList.includes(key)))
1454
1747
  }
1455
1748
 
1456
1749
  // export function filteredNextStepsMapLegal(keyList) {
@@ -1460,10 +1753,7 @@ function filterMapByKey(obj, keyList) {
1460
1753
  // }
1461
1754
 
1462
1755
  function formProps(updates) {
1463
- const props = merge(
1464
- formPropDefaults,
1465
- updates
1466
- );
1756
+ const props = merge(formPropDefaults, updates);
1467
1757
  if (props.formId && !props.name) {
1468
1758
  props.name = props.formId;
1469
1759
  }
@@ -1473,13 +1763,10 @@ function formProps(updates) {
1473
1763
  const metaDefaults = {};
1474
1764
 
1475
1765
  function metaProps(updates) {
1476
- const data = merge(
1477
- metaDefaults,
1478
- updates
1479
- );
1766
+ const data = merge(metaDefaults, updates);
1480
1767
  return {
1481
- type: 'meta',
1482
- data
1768
+ type: "meta",
1769
+ data,
1483
1770
  }
1484
1771
  }
1485
1772
 
@@ -1499,177 +1786,180 @@ function defaultMetaPropsLegal(tolps = null) {
1499
1786
  defaultFinalHeadline: DEFAULT_FINAL_HEADLINE_LEGAL,
1500
1787
  finalHeadlines: finalHeadlines,
1501
1788
  defaultFinalSubHeadline: DEFAULT_FINAL_SUBHEADLINE_LEGAL,
1502
- finalSubHeadlines: finalSubHeadlines
1789
+ finalSubHeadlines: finalSubHeadlines,
1503
1790
  })
1504
1791
  }
1505
1792
 
1506
- function dynamicSchemaNode(field = 'Type_Of_Legal_Problem') {
1793
+ function dynamicSchemaNode(field = "Type_Of_Legal_Problem") {
1507
1794
  return {
1508
- $cmp: 'FormKitSchema',
1509
- if: '$get(' + field + ').value',
1795
+ $cmp: "FormKitSchema",
1796
+ if: "$get(" + field + ").value",
1510
1797
  props: {
1511
- schema: '$meta.dynamicSchema',
1512
- data: '$buildData($meta)'
1513
- }
1798
+ schema: "$meta.dynamicSchema",
1799
+ data: "$buildData($meta)",
1800
+ },
1514
1801
  }
1515
1802
  }
1516
1803
 
1517
1804
  const formAnchorDefaults = {
1518
- $el: 'div',
1805
+ $el: "div",
1519
1806
  children: [
1520
1807
  {
1521
- $el: 'div',
1808
+ $el: "div",
1522
1809
  attrs: {
1523
- id: 'form-anchor',
1524
- class: 't-absolute',
1525
- style: { top: '-30px', left: 0 }
1526
- }
1527
- }
1810
+ id: "form-anchor",
1811
+ class: "t-absolute",
1812
+ style: { top: "-30px", left: 0 },
1813
+ },
1814
+ },
1528
1815
  ],
1529
1816
  attrs: {
1530
- class: 't-relative'
1531
- }
1817
+ class: "t-relative",
1818
+ },
1532
1819
  };
1533
1820
 
1534
1821
  function formAnchor(updates) {
1535
- return merge(
1536
- formAnchorDefaults,
1537
- updates
1538
- )
1822
+ return merge(formAnchorDefaults, updates)
1539
1823
  }
1540
1824
 
1541
1825
  function headlineDefaults(updates = {}) {
1542
1826
  return {
1543
- $el: 'h1',
1827
+ $el: "h1",
1544
1828
  attrs: {
1545
- class: 't-flex t-justify-center t-text-center !t-text-[2rem] t-font-semibold t-pt-5 t-px-7 md:t-px-3' + ' ' + (updates.headlineClass || '')
1546
- }
1829
+ class:
1830
+ "t-flex t-justify-center t-text-center !t-text-[2rem] t-font-semibold t-pt-5 t-px-7 md:t-px-3" +
1831
+ " " +
1832
+ (updates.headlineClass || ""),
1833
+ },
1547
1834
  }
1548
1835
  }
1549
1836
 
1550
1837
  function headline(updates = {}) {
1551
- return merge(
1552
- headlineDefaults(updates),
1553
- updates
1554
- )
1838
+ return merge(headlineDefaults(updates), updates)
1555
1839
  }
1556
1840
 
1557
1841
  function subHeadlineDefaults(updates = {}) {
1558
1842
  return {
1559
- $el: 'h3',
1843
+ $el: "h3",
1560
1844
  attrs: {
1561
- class: 't-flex t-justify-center t-text-center !t-text-[1.2rem] t-font-medium t-text-blue-500 t-px-10' + ' ' + (updates.subheadlineClass || '')
1562
- }
1845
+ class:
1846
+ "t-flex t-justify-center t-text-center !t-text-[1.2rem] t-font-medium t-text-blue-500 t-px-10" +
1847
+ " " +
1848
+ (updates.subheadlineClass || ""),
1849
+ },
1563
1850
  }
1564
1851
  }
1565
1852
 
1566
1853
  function subHeadline(updates = {}) {
1567
- return merge(
1568
- subHeadlineDefaults(updates),
1569
- updates
1570
- )
1854
+ return merge(subHeadlineDefaults(updates), updates)
1571
1855
  }
1572
1856
 
1573
1857
  const hiddenInputsBase = [
1574
1858
  {
1575
- $formkit: 'hidden',
1859
+ $formkit: "hidden",
1576
1860
  name: "gclid",
1577
- value: null
1861
+ value: null,
1578
1862
  },
1579
1863
  {
1580
- $formkit: 'hidden',
1864
+ $formkit: "hidden",
1581
1865
  name: "campaignid",
1582
- value: null
1866
+ value: null,
1583
1867
  },
1584
1868
  {
1585
- $formkit: 'hidden',
1869
+ $formkit: "hidden",
1586
1870
  name: "s",
1587
- value: null
1588
- }
1871
+ value: null,
1872
+ },
1589
1873
  ];
1590
1874
 
1591
1875
  const hiddenInputsLegal = [
1592
1876
  {
1593
- $formkit: 'hidden',
1877
+ $formkit: "hidden",
1594
1878
  name: "vertical",
1595
- value: "Legal"
1879
+ value: "Legal",
1596
1880
  },
1597
1881
  {
1598
- $formkit: 'hidden',
1882
+ $formkit: "hidden",
1599
1883
  name: "TCPA_Language",
1600
- value: "$meta.tcpaLanguage"
1884
+ value: "$meta.tcpaLanguage",
1601
1885
  },
1602
- ...hiddenInputsBase
1886
+ ...hiddenInputsBase,
1603
1887
  ];
1604
1888
 
1605
1889
  const legalRedirectMapDefaults = {
1606
- '*': LegalRedirectUrl()
1890
+ "*": LegalRedirectUrl(),
1607
1891
  };
1608
1892
 
1609
-
1610
1893
  function legalRedirectMap(updates) {
1611
- return merge(
1612
- legalRedirectMapDefaults,
1613
- updates
1614
- )
1894
+ return merge(legalRedirectMapDefaults, updates)
1615
1895
  }
1616
1896
 
1617
1897
  const TOLPCommentsPlaceholders = {
1618
- 'Adoption': 'Example: "I need help with adoption forms"',
1619
- 'Asbestos and Mesothelioma': 'Example: "I was exposed to asbestos at work and would like to file a claim"',
1620
- 'Auto and Car Accidents': 'Example: "A truck crashed into my car on the highway" or "I\'ve been involved in a hit and run accident"',
1621
- 'Bankruptcy': 'Example: "I need help filing for bankruptcy"',
1622
- 'Birth Certificate and Name Change': 'Example: "Just married and would like to change my last name"',
1623
- 'Business Lawyers': 'Example: "I need help incorporating a business" or "I would like a legal contract reviewed"',
1624
- 'Child Custody and Support': 'Example: "Need help getting custody" or "Issues with child support payments"',
1625
- 'Child Custody': 'Example: "Need help getting custody"',
1626
- 'Child Support': 'Example: "Issues with child support payments"',
1627
- 'Civil Rights and Discrimination': 'Example: "Police brutality" or "Coworker keeps harassing me"',
1628
- 'Civil Lawsuit': 'Example: "A contractor took my money and never completed the job" or "I am being sued by a neighbor"',
1629
- 'File a Lawsuit': 'Example: "A contractor took my money and never completed the job"',
1630
- 'Defend a Lawsuit': 'Example: "I am being sued by a neighbor"',
1631
- 'Consumer Lawyers': 'Example: "Someone committed fraud against me" or "A contractor took my money and never completed the job"',
1632
- 'Copyrights and Trademarks': 'Example: "I would like to register a trademark or copyright a name"',
1633
- 'Criminal and Felony': 'Example: "I was arrested for DUI and need legal defense" or "I am being charged with assault"',
1634
- 'Debt and Collections': 'Example: "I would like to consolidate my debt" or "A collection agency is harassing me"',
1635
- 'Divorce and Separation': 'Example: "I would like to file for an uncontested divorce"',
1636
- 'DUI and DWI': 'Example: "I was arrested for DUI and need legal defense"',
1637
- 'Elder Law': 'Example: "I would like help with Estate Planning" or "I need help with a guardianship"',
1638
- 'Employment and Workplace': 'Example: "I was injured while on the job" or "My company is discriminating against me"',
1639
- 'Expungement': 'Example: "I would like to file for an expungement and clear my record"',
1640
- 'Family Issues': 'Example: "I need help with guardianship" or "I need a simple will created"',
1641
- 'Foreclosure': 'Example: "I need help to avoid foreclosure on my house"',
1642
- 'Guardianship': 'Example: "I need help with guardianship documents"',
1643
- 'Harassment and Discrimination': 'Example: "I am being discriminated at work" or "My neighbor is harassing me"',
1644
- 'Sexual Harassment': 'Example: "I am being sexually harassed by a coworker"',
1645
- 'Workplace Harassment': 'Example: "My coworker is being aggressive towards me"',
1646
- 'Non-Workplace Harassment': 'Example: "My neighbor is harassing me"',
1647
- 'Workplace Discrimination': 'Example: "I am being discriminated at work based on my age"',
1648
- 'Non-Workplace Discrimination': 'Example: "I am being discriminated against by a local official"',
1649
- 'Identity Theft': 'Example: "Someone stole my identity and I need help fixing the issue"',
1650
- 'Immigration and Visas': 'Example: "I need help filing for a visa" or "Help with a green card"',
1651
- 'Insurance': 'Example: "I need help filing an insurance claim for damage to my house"',
1652
- 'Landlord and Tenant': 'Example: "I need help to fight an eviction" or "I would like a lawyer to review a rental contract"',
1653
- 'Lemon Law': 'Example: "I purchased a new vehicle that broke down already and seller will not assist"',
1654
- 'Long Term Disability': 'Example: "I was injured on the job and would like to file for benefits" or "I need help filing for disability benefits"',
1655
- 'Medical Malpractice': 'Example: "A doctor performed surgery on the wrong limb and I would like to file a lawsuit"',
1656
- 'Patents and Intellectual Property': 'Example: "I would like to file for a patent" or "I need to copyright a name"',
1657
- 'Personal Injury': 'Example: "I was bit by the neighbor\'s dog" or "I fell in the icy grocery store parking lot"',
1658
- 'Power of Attorney': 'Example: "I need help with a limited or general power of attorney"',
1659
- 'Probate and Estates': 'Example: "I need help with planning for my estate" or "A family member passed without a will in place"',
1660
- 'Product Liability': 'Example: "My car battery caught on fire" or "I purchased a faulty product"',
1661
- 'Property Damage': 'Example: "The neighbor\'s tree fell on my fence" or "My car was hit in the parking lot"',
1662
- 'Real Estate': 'Example: "I need help with a quitclaim deed" or "I need a lawyer to review a purchase and sales agreement"',
1663
- 'Social Security Disability and Insurance': 'Example: "I would like help filing for disability benefits" or "I\'ve been denied for SSDI and would like to appeal"',
1664
- 'Tax and IRS': 'Example: "I need help fighting an IRS tax claim" or "I need audit defense"',
1665
- 'Traffic and Tickets': 'Example: "I need help reinstating a supsended license" or "I would like to fight a traffic ticket"',
1666
- 'Unemployment': 'Example: "I need help filing for unemployment benefits"',
1667
- 'Victim of a Crime': 'Example: "I was assaulted in the store" or "I am being discriminated against at work"',
1668
- 'Wills and Trusts': 'Example: "I need a simple will created" or "I would like guidance on creating a trust fund"',
1669
- 'Workers Compensation': 'Example: "I was injured at work and would like to file for workers compensation benefits"',
1670
- 'Wrongful Death': 'Example: "A family member was killed on the job and we need legal representation"',
1671
- 'Wrongful Termination': 'Example: "I was fired by my employer without cause"',
1672
- 'Not Sure or Other': 'Example: "I was involved in a car accident" or "I need help setting up power of attorney"'
1898
+ Adoption: 'Example: "I need help with adoption forms"',
1899
+ "Asbestos and Mesothelioma": 'Example: "I was exposed to asbestos at work and would like to file a claim"',
1900
+ "Auto and Car Accidents":
1901
+ 'Example: "A truck crashed into my car on the highway" or "I\'ve been involved in a hit and run accident"',
1902
+ Bankruptcy: 'Example: "I need help filing for bankruptcy"',
1903
+ "Birth Certificate and Name Change": 'Example: "Just married and would like to change my last name"',
1904
+ "Business Lawyers": 'Example: "I need help incorporating a business" or "I would like a legal contract reviewed"',
1905
+ "Child Custody and Support": 'Example: "Need help getting custody" or "Issues with child support payments"',
1906
+ "Child Custody": 'Example: "Need help getting custody"',
1907
+ "Child Support": 'Example: "Issues with child support payments"',
1908
+ "Civil Rights and Discrimination": 'Example: "Police brutality" or "Coworker keeps harassing me"',
1909
+ "Civil Lawsuit":
1910
+ 'Example: "A contractor took my money and never completed the job" or "I am being sued by a neighbor"',
1911
+ "File a Lawsuit": 'Example: "A contractor took my money and never completed the job"',
1912
+ "Defend a Lawsuit": 'Example: "I am being sued by a neighbor"',
1913
+ "Consumer Lawyers":
1914
+ 'Example: "Someone committed fraud against me" or "A contractor took my money and never completed the job"',
1915
+ "Copyrights and Trademarks": 'Example: "I would like to register a trademark or copyright a name"',
1916
+ "Criminal and Felony":
1917
+ 'Example: "I was arrested for DUI and need legal defense" or "I am being charged with assault"',
1918
+ "Debt and Collections": 'Example: "I would like to consolidate my debt" or "A collection agency is harassing me"',
1919
+ "Divorce and Separation": 'Example: "I would like to file for an uncontested divorce"',
1920
+ "DUI and DWI": 'Example: "I was arrested for DUI and need legal defense"',
1921
+ "Elder Law": 'Example: "I would like help with Estate Planning" or "I need help with a guardianship"',
1922
+ "Employment and Workplace": 'Example: "I was injured while on the job" or "My company is discriminating against me"',
1923
+ Expungement: 'Example: "I would like to file for an expungement and clear my record"',
1924
+ "Family Issues": 'Example: "I need help with guardianship" or "I need a simple will created"',
1925
+ Foreclosure: 'Example: "I need help to avoid foreclosure on my house"',
1926
+ Guardianship: 'Example: "I need help with guardianship documents"',
1927
+ "Harassment and Discrimination": 'Example: "I am being discriminated at work" or "My neighbor is harassing me"',
1928
+ "Sexual Harassment": 'Example: "I am being sexually harassed by a coworker"',
1929
+ "Workplace Harassment": 'Example: "My coworker is being aggressive towards me"',
1930
+ "Non-Workplace Harassment": 'Example: "My neighbor is harassing me"',
1931
+ "Workplace Discrimination": 'Example: "I am being discriminated at work based on my age"',
1932
+ "Non-Workplace Discrimination": 'Example: "I am being discriminated against by a local official"',
1933
+ "Identity Theft": 'Example: "Someone stole my identity and I need help fixing the issue"',
1934
+ "Immigration and Visas": 'Example: "I need help filing for a visa" or "Help with a green card"',
1935
+ Insurance: 'Example: "I need help filing an insurance claim for damage to my house"',
1936
+ "Landlord and Tenant":
1937
+ 'Example: "I need help to fight an eviction" or "I would like a lawyer to review a rental contract"',
1938
+ "Lemon Law": 'Example: "I purchased a new vehicle that broke down already and seller will not assist"',
1939
+ "Long Term Disability":
1940
+ 'Example: "I was injured on the job and would like to file for benefits" or "I need help filing for disability benefits"',
1941
+ "Medical Malpractice": 'Example: "A doctor performed surgery on the wrong limb and I would like to file a lawsuit"',
1942
+ "Patents and Intellectual Property": 'Example: "I would like to file for a patent" or "I need to copyright a name"',
1943
+ "Personal Injury": 'Example: "I was bit by the neighbor\'s dog" or "I fell in the icy grocery store parking lot"',
1944
+ "Power of Attorney": 'Example: "I need help with a limited or general power of attorney"',
1945
+ "Probate and Estates":
1946
+ 'Example: "I need help with planning for my estate" or "A family member passed without a will in place"',
1947
+ "Product Liability": 'Example: "My car battery caught on fire" or "I purchased a faulty product"',
1948
+ "Property Damage": 'Example: "The neighbor\'s tree fell on my fence" or "My car was hit in the parking lot"',
1949
+ "Real Estate":
1950
+ 'Example: "I need help with a quitclaim deed" or "I need a lawyer to review a purchase and sales agreement"',
1951
+ "Social Security Disability and Insurance":
1952
+ 'Example: "I would like help filing for disability benefits" or "I\'ve been denied for SSDI and would like to appeal"',
1953
+ "Tax and IRS": 'Example: "I need help fighting an IRS tax claim" or "I need audit defense"',
1954
+ "Traffic and Tickets":
1955
+ 'Example: "I need help reinstating a supsended license" or "I would like to fight a traffic ticket"',
1956
+ Unemployment: 'Example: "I need help filing for unemployment benefits"',
1957
+ "Victim of a Crime": 'Example: "I was assaulted in the store" or "I am being discriminated against at work"',
1958
+ "Wills and Trusts": 'Example: "I need a simple will created" or "I would like guidance on creating a trust fund"',
1959
+ "Workers Compensation": 'Example: "I was injured at work and would like to file for workers compensation benefits"',
1960
+ "Wrongful Death": 'Example: "A family member was killed on the job and we need legal representation"',
1961
+ "Wrongful Termination": 'Example: "I was fired by my employer without cause"',
1962
+ "Not Sure or Other": 'Example: "I was involved in a car accident" or "I need help setting up power of attorney"',
1673
1963
  };
1674
1964
 
1675
1965
  const TOLPFinalHeadlines = {
@@ -1677,49 +1967,64 @@ const TOLPFinalHeadlines = {
1677
1967
  };
1678
1968
 
1679
1969
  const TOLPFinalSubHeadlines = {
1680
- 'Adoption': 'You may benefit from speaking with an adoption professional. Please verify your contact information.',
1970
+ Adoption: "You may benefit from speaking with an adoption professional. Please verify your contact information.",
1681
1971
  // 'Asbestos and Mesothelioma': '',
1682
- 'Auto and Car Accidents': 'You may benefit from speaking with an accident professional. Please verify your contact information.',
1683
- 'Bankruptcy': 'You may benefit from speaking with a bankruptcy professional. Please verify your contact information.',
1972
+ "Auto and Car Accidents":
1973
+ "You may benefit from speaking with an accident professional. Please verify your contact information.",
1974
+ Bankruptcy: "You may benefit from speaking with a bankruptcy professional. Please verify your contact information.",
1684
1975
  // 'Birth Certificate and Name Change': '',
1685
1976
  // 'Business Lawyers': '',
1686
1977
  // 'Child Custody and Support': '',
1687
1978
  // 'Civil Rights and Discrimination': '',
1688
1979
  // 'Civil Lawsuit': '',
1689
1980
  // 'Consumer Lawyers': '',
1690
- 'Copyrights and Trademarks': 'You may benefit from speaking with a copyright and trademark professional. Please verify your contact information.',
1981
+ "Copyrights and Trademarks":
1982
+ "You may benefit from speaking with a copyright and trademark professional. Please verify your contact information.",
1691
1983
  // 'Criminal and Felony': '',
1692
1984
  // 'Debt and Collections': '',
1693
- 'Divorce and Separation': 'You may benefit from speaking with a divorce professional. Please verify your contact information.',
1694
- 'DUI and DWI': 'You may benefit from speaking with a DUI professional. Please verify your contact information.',
1695
- 'Elder Law': 'You may benefit from speaking with an elder law professional. Please verify your contact information.',
1985
+ "Divorce and Separation":
1986
+ "You may benefit from speaking with a divorce professional. Please verify your contact information.",
1987
+ "DUI and DWI": "You may benefit from speaking with a DUI professional. Please verify your contact information.",
1988
+ "Elder Law": "You may benefit from speaking with an elder law professional. Please verify your contact information.",
1696
1989
  // 'Employment and Workplace': '',
1697
1990
  // 'Expungement': '',
1698
1991
  // 'Family Issues': '',
1699
- 'Foreclosure': 'You may benefit from speaking with a foreclosure professional. Please verify your contact information.',
1700
- 'Guardianship': 'You may benefit from speaking with a guardianship professional. Please verify your contact information.',
1992
+ Foreclosure: "You may benefit from speaking with a foreclosure professional. Please verify your contact information.",
1993
+ Guardianship:
1994
+ "You may benefit from speaking with a guardianship professional. Please verify your contact information.",
1701
1995
  // 'Harassment and Discrimination': '',
1702
1996
  // 'Identity Theft': '',
1703
- 'Immigration and Visas': 'You may benefit from speaking with a immigration professional. Please verify your contact information.',
1997
+ "Immigration and Visas":
1998
+ "You may benefit from speaking with a immigration professional. Please verify your contact information.",
1704
1999
  // 'Insurance': '',
1705
- 'Landlord and Tenant': 'You may benefit from speaking with a landlord and tenant legal professional. Please verify your contact information.',
2000
+ "Landlord and Tenant":
2001
+ "You may benefit from speaking with a landlord and tenant legal professional. Please verify your contact information.",
1706
2002
  // 'Lemon Law': '',
1707
- 'Long Term Disability': 'You may benefit from speaking with a disability legal professional. Please verify your contact information.',
1708
- 'Medical Malpractice': 'You may benefit from speaking with a malpractice professional. Please verify your contact information.',
1709
- 'Patents and Intellectual Property': 'You may benefit from speaking with a patent professional. Please verify your contact information.',
1710
- 'Personal Injury': 'You may benefit from speaking with a personal injury professional. Please verify your contact information.',
2003
+ "Long Term Disability":
2004
+ "You may benefit from speaking with a disability legal professional. Please verify your contact information.",
2005
+ "Medical Malpractice":
2006
+ "You may benefit from speaking with a malpractice professional. Please verify your contact information.",
2007
+ "Patents and Intellectual Property":
2008
+ "You may benefit from speaking with a patent professional. Please verify your contact information.",
2009
+ "Personal Injury":
2010
+ "You may benefit from speaking with a personal injury professional. Please verify your contact information.",
1711
2011
  // 'Power of Attorney': '',
1712
- 'Probate and Estates': 'You may benefit from speaking with a probate and estate professional. Please verify your contact information.',
2012
+ "Probate and Estates":
2013
+ "You may benefit from speaking with a probate and estate professional. Please verify your contact information.",
1713
2014
  // 'Product Liability': '',
1714
2015
  // 'Property Damage': '',
1715
- 'Real Estate': 'You may benefit from speaking with a real estate professional. Please verify your contact information.',
1716
- 'Social Security Disability and Insurance': 'You may benefit from speaking with an SSDI professional. Please verify your contact information.',
1717
- 'Tax and IRS': 'You may benefit from speaking with a tax professional. Please verify your contact information.',
2016
+ "Real Estate":
2017
+ "You may benefit from speaking with a real estate professional. Please verify your contact information.",
2018
+ "Social Security Disability and Insurance":
2019
+ "You may benefit from speaking with an SSDI professional. Please verify your contact information.",
2020
+ "Tax and IRS": "You may benefit from speaking with a tax professional. Please verify your contact information.",
1718
2021
  // 'Traffic and Tickets': '',
1719
- 'Unemployment': 'You may benefit from speaking with an unemployment professional. Please verify your contact information.',
2022
+ Unemployment:
2023
+ "You may benefit from speaking with an unemployment professional. Please verify your contact information.",
1720
2024
  // 'Victim of a Crime': '',
1721
2025
  // 'Wills and Trusts': '',
1722
- 'Workers Compensation': 'You may benefit from speaking with a workers compensation professional. Please verify your contact information.',
2026
+ "Workers Compensation":
2027
+ "You may benefit from speaking with a workers compensation professional. Please verify your contact information.",
1723
2028
  // 'Wrongful Death': '',
1724
2029
  // 'Wrongful Termination': '',
1725
2030
  // 'Not Sure or Other': ''
@@ -1732,37 +2037,31 @@ const TOLPFinalSubHeadlines = {
1732
2037
 
1733
2038
  const nextStepsMapLegalLegacy = {
1734
2039
  values: {
1735
- '*': [
1736
- 'TOLPQuestions',
1737
- 'commentsWithBankruptcy',
1738
- 'legalCrossSells',
1739
- 'firstAndLast',
1740
- 'contactInfo',
1741
- ]
1742
- }
2040
+ "*": ["TOLPQuestions", "commentsWithBankruptcy", "legalCrossSells", "firstAndLast", "contactInfo"],
2041
+ },
1743
2042
  };
1744
2043
 
1745
2044
  const nextStepsMapLegalCrossSells = {
1746
2045
  values: {
1747
- 'Legal_CrossSells': {
1748
- 'Auto and Car Accidents': ['autoAndCarAccidentCrossSellQuestions'],
1749
- 'Personal Injury': ['personalInjuryCrossSellQuestions'],
1750
- 'Workers Compensation': ['workersCompensationCrossSellQuestions'],
1751
- 'DUI and DWI': ['duiAndDWICrossSellQuestions'],
1752
- 'Long Term Disability': ['longTermDisabilityCrossSellQuestions'],
1753
- 'Social Security Disability and Insurance': ['ssdiCrossSellQuestions'],
1754
- 'Bankruptcy': ['bankruptcyCrossSellQuestions'],
1755
- 'Power of Attorney': ['powerOfAttorneyCrossSellQuestions'],
1756
- 'Wills and Trusts': ['willsAndTrustsCrossSellQuestions'],
1757
- 'Divorce and Separation': ['divorceAndSeparationCrossSellQuestions'],
1758
- 'Child Custody': ['childCustodyCrossSellQuestions'],
2046
+ Legal_CrossSells: {
2047
+ "Auto and Car Accidents": ["autoAndCarAccidentCrossSellQuestions"],
2048
+ "Personal Injury": ["personalInjuryCrossSellQuestions"],
2049
+ "Workers Compensation": ["workersCompensationCrossSellQuestions"],
2050
+ "DUI and DWI": ["duiAndDWICrossSellQuestions"],
2051
+ "Long Term Disability": ["longTermDisabilityCrossSellQuestions"],
2052
+ "Social Security Disability and Insurance": ["ssdiCrossSellQuestions"],
2053
+ Bankruptcy: ["bankruptcyCrossSellQuestions"],
2054
+ "Power of Attorney": ["powerOfAttorneyCrossSellQuestions"],
2055
+ "Wills and Trusts": ["willsAndTrustsCrossSellQuestions"],
2056
+ "Divorce and Separation": ["divorceAndSeparationCrossSellQuestions"],
2057
+ "Child Custody": ["childCustodyCrossSellQuestions"],
1759
2058
  },
1760
- '*': ['firstAndLast', 'contactInfo'],
2059
+ "*": ["firstAndLast", "contactInfo"],
1761
2060
  },
1762
-
2061
+
1763
2062
  // NOTE: this assumes a certain placement of the cross sell question
1764
2063
  // in the form flow.
1765
- appendSteps: ['firstAndLast', 'contactInfo'],
2064
+ appendSteps: ["firstAndLast", "contactInfo"],
1766
2065
  matchesAllowed: 1,
1767
2066
  };
1768
2067