bhl-forms 0.7.3 → 0.7.4

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 +1459 -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 +1432 -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 +1327 -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 +1526 -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 +1998 -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 +1347 -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 +1830 -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 +1539 -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 +1831 -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 +1361 -1971
  39. package/dist/forms/generalHomeImprovement.iife.js +1 -1
  40. package/dist/forms/generalHomeImprovement.json +1 -1
  41. package/dist/forms/generalHomeImprovementThankYou.es.js +1361 -1971
  42. package/dist/forms/generalHomeImprovementThankYou.iife.js +1 -1
  43. package/dist/forms/generalHomeImprovementThankYou.json +1 -1
  44. package/dist/forms/generalLegal.es.js +3035 -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 +3214 -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 +3035 -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 +3214 -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 +3214 -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 +2823 -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 +3214 -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 +1423 -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 +1393 -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 +1529 -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 +701 -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 +1828 -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 +2850 -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 +1566 -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 +420 -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 +1426 -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
@@ -10,32 +10,64 @@ const radio = (updates) => {
10
10
  if (updates.name && !updates.id) {
11
11
  updates.id = updates.name;
12
12
  }
13
- return merge({
14
- $formkit: 'radio',
15
- validation: 'required',
16
- validationMessages: {
17
- required: 'Field is required'
13
+ return merge(
14
+ {
15
+ $formkit: "radio",
16
+ validation: "required",
17
+ validationMessages: {
18
+ required: "Field is required",
19
+ },
20
+ optionsClass: "t-pt-3 t-pl-1",
21
+ legendClass: "required",
18
22
  },
19
- optionsClass: 't-pt-3 t-pl-1',
20
- legendClass: 'required'
21
- }, updates)
23
+ updates
24
+ )
22
25
  };
23
26
 
24
27
  const col2Radio = (updates) => {
25
- updates.legendClass = 'required';
26
- updates.fieldsetClass = '$reset';
27
- updates.optionsClass = 't-pl-2 t-pt-3 t-grid t-grid-cols-1 md:t-grid-cols-2';
28
- updates.innerClass = 't-items-start';
29
- updates.wrapperClass = '$reset t-flex t-cursor-pointer t-mb-3';
28
+ updates.legendClass = "required";
29
+ updates.fieldsetClass = "$reset";
30
+ updates.optionsClass = "t-pl-2 t-pt-3 t-grid t-grid-cols-1 md:t-grid-cols-2";
31
+ updates.innerClass = "t-items-start";
32
+ updates.wrapperClass = "$reset t-flex t-cursor-pointer t-mb-3";
33
+ return radio(updates)
34
+ };
35
+
36
+ const col2RadioCenter = (updates) => {
37
+ updates.legendClass = "required t-w-[100%] t-text-center";
38
+ if (typeof updates.fieldsetClass === "undefined") {
39
+ updates.fieldsetClass = "$reset t-flex t-justify-center";
40
+ }
41
+ updates.optionsClass = "t-pl-4 t-pt-3 t-grid t-grid-cols-1 md:t-grid-cols-2";
42
+ updates.innerClass = "t-items-start";
43
+ updates.wrapperClass = "$reset t-flex t-cursor-pointer t-mb-3";
44
+ updates.optionClass = "t-pl-4 md:t-pl-8 md:t-min-w-[200px]";
45
+ updates.messagesClass = "t-flex t-justify-center";
46
+ updates.helpClass = "t-mt-0 t-mb-4 !t-text-sm t-text-center";
30
47
  return radio(updates)
31
48
  };
32
49
 
33
50
  const sbs2ItemRadio = (updates) => {
34
- updates.legendClass = 'legend-left t-pb-1 required';
35
- updates.fieldsetClass = '$reset side-by-side t-items-center';
36
- updates.optionsClass = 't-mt-1 t-grid t-grid-cols-1 md:t-grid-cols-2-125 t-items-center';
37
- updates.innerClass = 't-flex t-items-center';
38
- updates.optionClass = 't-pr-1';
51
+ updates.legendClass = "legend-left t-pb-1 required";
52
+ updates.fieldsetClass = "$reset side-by-side t-items-center";
53
+ updates.optionsClass = "t-mt-1 t-grid t-grid-cols-1 md:t-grid-cols-2-125 t-items-center";
54
+ updates.innerClass = "t-flex t-items-center";
55
+ updates.optionClass = "t-pr-1";
56
+ return radio(updates)
57
+ };
58
+
59
+ const verticalButtonRadio = (updates) => {
60
+ updates.legendClass = "legend-left";
61
+ updates.fieldsetClass = "$reset t-flex t-justify-center t-flex-col-reverse t-items-center";
62
+ if (typeof updates.optionsClass === "undefined") {
63
+ updates.optionsClass = "t-flex t-flex-col sm:t-flex-row t-justify-center t-my-3";
64
+ }
65
+ updates.optionClass = "radiobtn t-my-2 sm:t-my-0 t-mx-2 md:t-mx-5";
66
+ updates.wrapperClass = "$reset formkit-wrapper t-mb-0 t-flex t-items-center t-h-[100%]";
67
+ updates.labelClass = "t-font-semibold t-text-[#1e448f] t-w-[100%]";
68
+ updates.decoratorIcon = false;
69
+ updates.messagesClass = "t-flex t-justify-center";
70
+ updates.helpClass = "t-mt-2.5 !t-text-sm t-text-center";
39
71
  return radio(updates)
40
72
  };
41
73
 
@@ -43,23 +75,35 @@ const select = (updates) => {
43
75
  if (updates.name && !updates.id) {
44
76
  updates.id = updates.name;
45
77
  }
46
- return merge({
47
- $formkit: 'select',
48
- placeholder: "Please Select",
49
- validation: 'required',
50
- validationMessages: {
51
- required: 'Field is required'
78
+ return merge(
79
+ {
80
+ $formkit: "select",
81
+ placeholder: "Please Select",
82
+ validation: "required",
83
+ validationMessages: {
84
+ required: "Field is required",
85
+ },
86
+ inputClass: "t-bg-white",
87
+ labelClass: "required",
52
88
  },
53
- inputClass: 't-bg-white',
54
- labelClass: 'required'
55
- }, updates)
89
+ updates
90
+ )
56
91
  };
57
92
 
58
93
  const sbsSelect = (updates) => {
59
- updates.labelClass = 'required';
60
- updates.wrapperClass = 'side-by-side t-items-center';
61
- updates.innerClass = 'select-height-content';
62
- updates.helpClass = 't-mt-2.5 md:t-text-right md:t-mt-[-5px]';
94
+ updates.labelClass = "required";
95
+ updates.wrapperClass = "side-by-side t-items-center";
96
+ updates.innerClass = "select-height-content";
97
+ updates.helpClass = "t-mt-2.5 md:t-text-right md:t-mt-[-5px]";
98
+ return select(updates)
99
+ };
100
+
101
+ const verticalSelect = (updates) => {
102
+ updates.labelClass = "required";
103
+ updates.wrapperClass = "t-flex t-justify-center";
104
+ updates.messagesClass = "t-flex t-justify-center";
105
+ updates.inputClass = "t-min-w-[150px] t-bg-white";
106
+ updates.helpClass = "t-mt-2.5 t-text-center";
63
107
  return select(updates)
64
108
  };
65
109
 
@@ -67,221 +111,290 @@ const text = (updates) => {
67
111
  if (updates.name && !updates.id) {
68
112
  updates.id = updates.name;
69
113
  }
70
- return merge({
71
- $formkit: 'text',
72
- validation: 'required',
73
- validationMessages: {
74
- required: 'Field is required'
114
+ return merge(
115
+ {
116
+ $formkit: "text",
117
+ validation: "required",
118
+ validationMessages: {
119
+ required: "Field is required",
120
+ },
121
+ labelClass: "required",
75
122
  },
76
- labelClass: 'required'
77
- }, updates)
123
+ updates
124
+ )
78
125
  };
79
126
 
80
127
  const sbsText = (updates) => {
81
- updates.wrapperClass = 'side-by-side t-items-center';
128
+ updates.wrapperClass = "side-by-side t-items-center";
82
129
  return text(updates)
83
130
  };
84
131
 
85
132
  const verticalText = (updates) => {
86
- updates.wrapperClass = 't-flex t-justify-center';
87
- updates.messagesClass = 't-flex t-justify-center';
88
- updates.inputClass = 't-text-center';
89
- updates.helpClass = 't-mt-2.5 !t-text-sm t-text-center';
133
+ updates.wrapperClass = "t-flex t-justify-center";
134
+ updates.messagesClass = "t-flex t-justify-center";
135
+ updates.inputClass = "t-text-center";
136
+ updates.helpClass = "t-mt-2.5 !t-text-sm t-text-center";
90
137
  return text(updates)
91
138
  };
92
139
 
93
-
94
140
  const zipcode = (scope, vertical, updates = {}) => {
95
141
  const func = vertical ? verticalText : sbsText;
96
- const label = vertical ? (updates.label) : 'Zip Code:';
97
- const help = vertical ? (updates.help ?? "We try to match you with local help") : null;
142
+ const label = vertical ? updates.label : "Zip Code:";
143
+ const help = vertical ? updates.help ?? "We try to match you with local help" : null;
98
144
  return func({
99
145
  label,
100
146
  help,
101
- placeholder: '#####',
102
- name: scope ? scope + ':' + 'Zip' : 'Zip',
147
+ placeholder: "#####",
148
+ name: scope ? scope + ":" + "Zip" : "Zip",
103
149
  maxlength: 5,
104
150
  inputmode: "numeric",
105
- autocomplete: 'postal-code',
106
- validation: 'required|matches:/^[0-9]{5}$/',
151
+ autocomplete: "postal-code",
152
+ validation: "required|matches:/^[0-9]{5}$/",
107
153
  validationMessages: {
108
- required: 'Zip Code is required',
109
- matches: 'Invalid Zip Code'
154
+ required: "Zip Code is required",
155
+ matches: "Invalid Zip Code",
110
156
  },
111
- ...updates
157
+ ...updates,
112
158
  })
113
159
  };
114
160
 
115
- const civilDefense = (updates) => sbs2ItemRadio(merge({
116
- name: 'Civil_Defense',
117
- id: 'Civil_Defense',
118
- if: '$get(Type_Of_Legal_Problem).value == "Civil Lawsuit"',
119
- label: 'Do You Need Representation to File a Lawsuit or Defend One?',
120
- options: {
121
- Yes: 'Defend a Lawsuit',
122
- No: 'File a Lawsuit'
123
- }
124
- }, updates));
125
-
126
- const civilLawsuitTOLPDisplay = (updates) => col2Radio(merge({
127
- name: 'Type_Of_Legal_Problem_Display',
128
- if: '$get(Type_Of_Legal_Problem).value == "Civil Lawsuit" && $get(Civil_Defense).value == "No"',
129
- label: 'Select The Type of Lawsuit You Would Like to File:',
130
- options: [
131
- 'Automobile Accident',
132
- 'Contract Disputes',
133
- 'Defamation and Slander',
134
- 'Dog Bite',
135
- 'Employment and Workplace',
136
- 'Fraud',
137
- 'Medical Malpractice',
138
- 'Personal Injury',
139
- 'Property Damage',
140
- 'Small Claims',
141
- 'Real Estate',
142
- 'Not Sure or Other'
143
- ]
144
- }, updates));
145
-
146
- const employmentAndWorkplaceTOLPDisplay = (updates) => col2Radio(merge({
147
- name: 'Type_Of_Legal_Problem_Display',
148
- if: '$get(Type_Of_Legal_Problem).value == "Employment and Workplace"',
149
- label: 'Select The Workplace Issue:',
150
- options: [
151
- 'Workplace Harassment',
152
- 'Workplace Discrimination',
153
- 'Wrongful Termination',
154
- 'Payment Disputes',
155
- 'Workers Compensation',
156
- 'Personal Injury',
157
- 'Unemployment',
158
- 'Other Workplace Issues'
159
- ]
160
- }, updates));
161
+ const civilDefense = (scope, vertical, updates = {}) => {
162
+ const func = vertical ? verticalButtonRadio : sbs2ItemRadio;
163
+ const label = vertical ? updates.label : "Do You Need Representation to File a Lawsuit or Defend One?";
164
+ const _if = vertical ? updates.if : '$get(Type_Of_Legal_Problem).value == "Civil Lawsuit"';
165
+ return func(
166
+ merge(
167
+ {
168
+ label,
169
+ if: _if,
170
+ name: scope ? scope + ":" + "Civil_Defense" : "Civil_Defense",
171
+ options: ["Defend a Lawsuit", "File a Lawsuit"],
172
+ },
173
+ updates
174
+ )
175
+ )
176
+ };
161
177
 
178
+ const civilLawsuitTOLPDisplay = (scope, vertical, updates = {}) => {
179
+ const func = vertical ? col2RadioCenter : col2Radio;
180
+ const label = vertical ? updates.label : "Select The Type of Lawsuit You Would Like to File:";
181
+ const _if = vertical
182
+ ? null
183
+ : '$get(Type_Of_Legal_Problem).value == "Civil Lawsuit" && $get(Civil_Defense).value == "File a Lawsuit"';
184
+ return func(
185
+ merge(
186
+ {
187
+ label,
188
+ if: _if,
189
+ name: scope ? scope + ":" + "Type_Of_Legal_Problem_Display" : "Type_Of_Legal_Problem_Display",
190
+ options: [
191
+ "Automobile Accident",
192
+ "Contract Disputes",
193
+ "Defamation and Slander",
194
+ "Dog Bite",
195
+ "Employment and Workplace",
196
+ "Fraud",
197
+ "Medical Malpractice",
198
+ "Personal Injury",
199
+ "Property Damage",
200
+ "Small Claims",
201
+ "Real Estate",
202
+ "Not Sure or Other",
203
+ ],
204
+ },
205
+ updates
206
+ )
207
+ )
208
+ };
209
+
210
+ const employmentAndWorkplaceTOLPDisplay = (scope, vertical, updates = {}) => {
211
+ const func = vertical ? col2RadioCenter : col2Radio;
212
+ const label = vertical ? updates.label : "Select The Workplace Issue:";
213
+ return func(
214
+ merge(
215
+ {
216
+ label,
217
+ if: '$get(Type_Of_Legal_Problem).value == "Employment and Workplace"',
218
+ name: scope ? scope + ":" + "Type_Of_Legal_Problem_Display" : "Type_Of_Legal_Problem_Display",
219
+ options: [
220
+ "Workplace Harassment",
221
+ "Workplace Discrimination",
222
+ "Wrongful Termination",
223
+ "Payment Disputes",
224
+ "Workers Compensation",
225
+ "Personal Injury",
226
+ "Unemployment",
227
+ "Other Workplace Issues",
228
+ ],
229
+ },
230
+ updates
231
+ )
232
+ )
233
+ };
162
234
 
163
235
  const TOLPOptions = [
164
- 'Adoption',
165
- 'Asbestos and Mesothelioma',
166
- 'Auto and Car Accidents',
167
- 'Bankruptcy',
168
- 'Birth Certificate and Name Change',
169
- 'Business Lawyers',
170
- 'Child Custody',
171
- 'Child Support',
172
- 'Civil Rights and Discrimination',
173
- 'Consumer Lawyers',
174
- 'Copyrights and Trademarks',
175
- 'Criminal and Felony',
176
- 'Debt and Collections',
177
- 'Defend a Lawsuit',
178
- 'Divorce and Separation',
179
- 'DUI and DWI',
180
- 'Elder Law',
181
- 'Employment and Workplace',
182
- 'Expungement',
183
- 'Family Issues',
184
- 'File a Lawsuit',
185
- 'Foreclosure',
186
- 'Guardianship',
187
- 'Harassment and Discrimination',
188
- 'Identity Theft',
189
- 'Immigration and Visas',
190
- 'Insurance',
191
- 'Landlord and Tenant',
192
- 'Lemon Law',
193
- 'Long Term Disability',
194
- 'Medical Malpractice',
195
- 'Non-Workplace Discrimination',
196
- 'Non-Workplace Harassment',
197
- 'Patents and Intellectual Property',
198
- 'Personal Injury',
199
- 'Power of Attorney',
200
- 'Probate and Estates',
201
- 'Product Liability',
202
- 'Property Damage',
203
- 'Real Estate',
204
- 'Sexual Harassment',
205
- 'Social Security Disability and Insurance',
206
- 'Tax and IRS',
207
- 'Traffic and Tickets',
208
- 'Unemployment',
209
- 'Victim of a Crime',
210
- 'Wills and Trusts',
211
- 'Workers Compensation',
212
- 'Workplace Discrimination',
213
- 'Workplace Harassment',
214
- 'Wrongful Death',
215
- 'Wrongful Termination',
216
- 'Not Sure or Other'
236
+ "Adoption",
237
+ "Asbestos and Mesothelioma",
238
+ "Auto and Car Accidents",
239
+ "Bankruptcy",
240
+ "Birth Certificate and Name Change",
241
+ "Business Lawyers",
242
+ "Child Custody",
243
+ "Child Support",
244
+ "Civil Rights and Discrimination",
245
+ "Consumer Lawyers",
246
+ "Copyrights and Trademarks",
247
+ "Criminal and Felony",
248
+ "Debt and Collections",
249
+ "Defend a Lawsuit",
250
+ "Divorce and Separation",
251
+ "DUI and DWI",
252
+ "Elder Law",
253
+ "Employment and Workplace",
254
+ "Expungement",
255
+ "Family Issues",
256
+ "File a Lawsuit",
257
+ "Foreclosure",
258
+ "Guardianship",
259
+ "Harassment and Discrimination",
260
+ "Identity Theft",
261
+ "Immigration and Visas",
262
+ "Insurance",
263
+ "Landlord and Tenant",
264
+ "Lemon Law",
265
+ "Long Term Disability",
266
+ "Medical Malpractice",
267
+ "Non-Workplace Discrimination",
268
+ "Non-Workplace Harassment",
269
+ "Patents and Intellectual Property",
270
+ "Personal Injury",
271
+ "Power of Attorney",
272
+ "Probate and Estates",
273
+ "Product Liability",
274
+ "Property Damage",
275
+ "Real Estate",
276
+ "Sexual Harassment",
277
+ "Social Security Disability and Insurance",
278
+ "Tax and IRS",
279
+ "Traffic and Tickets",
280
+ "Unemployment",
281
+ "Victim of a Crime",
282
+ "Wills and Trusts",
283
+ "Workers Compensation",
284
+ "Workplace Discrimination",
285
+ "Workplace Harassment",
286
+ "Wrongful Death",
287
+ "Wrongful Termination",
288
+ "Not Sure or Other",
217
289
  ];
218
290
 
219
- const generalTOLP = (updates) => sbsSelect(merge({
220
- label: 'Type of Help Needed:',
221
- name: 'Type_Of_Legal_Problem',
222
- id: 'Type_Of_Legal_Problem',
223
- options: TOLPOptions,
224
- }, updates));
225
-
226
- const landlordTenantIssueRadio = () => col2Radio({
227
- label: 'What is the Landlord / Tenant Issue?',
228
- if: '$get(Type_Of_Legal_Problem).value == "Landlord and Tenant"',
229
- id: 'Landlord_Tenant_Issue',
230
- name: 'Landlord_Tenant_Issue',
231
- options: [
232
- "Eviction",
233
- "Repairs and Maintenance",
234
- "Lease and Rental Agreements",
235
- "Discrimination",
236
- "Right of Entry and Privacy",
237
- "Screening and Applications",
238
- "Environmental Hazards",
239
- "Other Dispute"
240
- ]
241
- });
291
+ const generalTOLP = (scope, vertical, updates = {}) => {
292
+ const func = vertical ? verticalSelect : sbsSelect;
293
+ const label = vertical ? updates.label : "Type of Help Needed:";
294
+ return func(
295
+ merge(
296
+ {
297
+ label,
298
+ name: scope ? scope + ":" + "Type_Of_Legal_Problem" : "Type_Of_Legal_Problem",
299
+ id: scope ? scope + ":" + "Type_Of_Legal_Problem" : "Type_Of_Legal_Problem",
300
+ options: TOLPOptions,
301
+ },
302
+ updates
303
+ )
304
+ )
305
+ };
306
+
307
+ const landlordTenantIssueRadio = (scope, vertical, updates = {}) => {
308
+ const func = vertical ? col2RadioCenter : col2Radio;
309
+ const label = vertical ? updates.label : "What is the Landlord / Tenant Issue?";
310
+ const _if = vertical ? updates.if : '$get(Type_Of_Legal_Problem).value == "Landlord and Tenant"';
311
+ return func(
312
+ merge(
313
+ {
314
+ label,
315
+ if: _if,
316
+ id: scope ? scope + ":" + "Landlord_Tenant_Issue" : "Landlord_Tenant_Issue",
317
+ name: scope ? scope + ":" + "Landlord_Tenant_Issue" : "Landlord_Tenant_Issue",
318
+ options: [
319
+ "Eviction",
320
+ "Repairs and Maintenance",
321
+ "Lease and Rental Agreements",
322
+ "Discrimination",
323
+ "Right of Entry and Privacy",
324
+ "Screening and Applications",
325
+ "Environmental Hazards",
326
+ "Other Dispute",
327
+ ],
328
+ },
329
+ updates
330
+ )
331
+ )
332
+ };
333
+
334
+ const realEstateTOLPDisplay = (scope, vertical, updates = {}) => {
335
+ const func = vertical ? col2RadioCenter : col2Radio;
336
+ const label = vertical ? updates.label : "Select The Real Estate Issue:";
337
+ const _if = vertical ? updates.if : '$get(Type_Of_Legal_Problem).value == "Real Estate"';
338
+ return func(
339
+ merge(
340
+ {
341
+ label,
342
+ if: _if,
343
+ name: scope ? scope + ":" + "Type_Of_Legal_Problem_Display" : "Type_Of_Legal_Problem_Display",
344
+ options: [
345
+ "Contracts and Agreements",
346
+ "Deeds, Liens, and Titles",
347
+ "Foreclosure",
348
+ "Insurance",
349
+ "Landlord and Tenant",
350
+ "Loans and Mortgages",
351
+ "Wills, Trusts, and Estates",
352
+ "Property Damage",
353
+ "Not Sure or Other",
354
+ ],
355
+ },
356
+ updates
357
+ )
358
+ )
359
+ };
360
+
361
+ const criminalTOLPDisplay = (scope, vertical, updates = {}) => {
362
+ const func = vertical ? col2RadioCenter : col2Radio;
363
+ const label = vertical ? updates.label : "Select The Criminal Issue:";
364
+ const _if = vertical ? updates.if : '$get(Type_Of_Legal_Problem).value == "Criminal and Felony"';
365
+ return func(
366
+ merge(
367
+ {
368
+ label,
369
+ if: _if,
370
+ name: scope ? scope + ":" + "Type_Of_Legal_Problem_Display" : "Type_Of_Legal_Problem_Display",
371
+ options: [
372
+ "Criminal Defense",
373
+ "Victim of a Crime",
374
+ "DUI and DWI",
375
+ "Expungement",
376
+ "Harassment",
377
+ "Not Sure or Other",
378
+ ],
379
+ },
380
+ updates
381
+ )
382
+ )
383
+ };
384
+
385
+ const NEXT_ON_ENTER = "$onEnter($setNextStep($fireStepEvent($get(form)), $preStepFunc($get(form))))";
386
+ const NEXT_ON_INPUT = "$onInput($setNextStep($fireStepEvent($get(form)), $preStepFunc($get(form))))";
242
387
 
243
- const realEstateTOLPDisplay = (updates) => col2Radio(merge({
244
- name: 'Type_Of_Legal_Problem_Display',
245
- if: '$get(Type_Of_Legal_Problem).value == "Real Estate"',
246
- label: 'Select The Type of Real Estate Issue:',
247
- options: [
248
- 'Contracts and Agreements',
249
- 'Deeds, Liens, and Titles',
250
- 'Foreclosure',
251
- 'Insurance',
252
- 'Landlord and Tenant',
253
- 'Loans and Mortgages',
254
- 'Wills, Trusts, and Estates',
255
- 'Property Damage',
256
- 'Not Sure or Other'
257
- ]
258
- }, updates));
259
-
260
- const criminalTOLPDisplay = (updates) => col2Radio(merge({
261
- name: 'Type_Of_Legal_Problem_Display',
262
- if: '$get(Type_Of_Legal_Problem).value == "Criminal and Felony"',
263
- label: 'Which Type of Criminal Issue?',
264
- options: [
265
- 'Criminal Defense',
266
- 'Victim of a Crime',
267
- 'DUI and DWI',
268
- 'Expungement',
269
- 'Harassment',
270
- 'Not Sure or Other',
271
- ]
272
- }, updates));
273
-
274
- const NEXT_ON_ENTER = '$onEnter($setNextStep($fireStepEvent($get(form)), $preStepFunc($get(form))))';
275
- const NEXT_ON_INPUT = '$onInput($setNextStep($fireStepEvent($get(form)), $preStepFunc($get(form))))';
276
-
277
- const isInput = (n) => { return (n.type !== 'group' && n.type !== 'section' && n.type !== 'form' && n.$formkit !== 'hidden' && !n.children) };
388
+ const isInput = (n) => {
389
+ return n.type !== "group" && n.type !== "section" && n.type !== "form" && n.$formkit !== "hidden" && !n.children
390
+ };
278
391
 
279
392
  const findLastInput = (n) => {
280
393
  if (isInput(n)) {
281
394
  return n
282
395
  }
283
396
  for (var i = n.children.length - 1; i >= 0; i--) {
284
- if (typeof n.children === 'string') {
397
+ if (typeof n.children === "string") {
285
398
  continue
286
399
  }
287
400
  const child = n.children[i];
@@ -297,12 +410,12 @@ const findLastInput = (n) => {
297
410
  };
298
411
 
299
412
  const stepDefaults = (step, stepKey) => ({
300
- $el: 'section',
413
+ $el: "section",
301
414
  if: '$stepEnabled("' + step + '")',
302
415
  attrs: {
303
416
  hidden: '$activeStep !== "' + step + '"',
304
- key: stepKey ? stepKey : step
305
- }
417
+ key: stepKey ? stepKey : step,
418
+ },
306
419
  });
307
420
 
308
421
  function step(name, inputs, updates = {}) {
@@ -325,27 +438,24 @@ function step(name, inputs, updates = {}) {
325
438
  }
326
439
  }
327
440
 
328
- return merge(
329
- stepDefaults(name, stepKey),
330
- {
331
- children: [
332
- {
333
- $formkit: 'group',
334
- id: name,
335
- name: name,
336
- nextStepMap: nextStepMap,
337
- triggerRedirectMap: triggerRedirectMap,
338
- autoFocus: autoFocus,
339
- children: inputs
340
- }
341
- ]
342
- }
343
- )
441
+ return merge(stepDefaults(name, stepKey), {
442
+ children: [
443
+ {
444
+ $formkit: "group",
445
+ id: name,
446
+ name: name,
447
+ nextStepMap: nextStepMap,
448
+ triggerRedirectMap: triggerRedirectMap,
449
+ autoFocus: autoFocus,
450
+ children: inputs,
451
+ },
452
+ ],
453
+ })
344
454
  }
345
455
 
346
456
  function generalLegalTOLPAndZip(updates = {}) {
347
457
  return step(
348
- 'generalLegalTOLPAndZip',
458
+ "generalLegalTOLPAndZip",
349
459
  [
350
460
  generalTOLP(),
351
461
  civilDefense(),
@@ -354,7 +464,7 @@ function generalLegalTOLPAndZip(updates = {}) {
354
464
  employmentAndWorkplaceTOLPDisplay(),
355
465
  landlordTenantIssueRadio(),
356
466
  realEstateTOLPDisplay(),
357
- zipcode()
467
+ zipcode(),
358
468
  ],
359
469
  updates
360
470
  )
@@ -362,87 +472,87 @@ function generalLegalTOLPAndZip(updates = {}) {
362
472
 
363
473
  function formNavigationOnlySubmit(updates = {}) {
364
474
  return {
365
- $el: 'div',
475
+ $el: "div",
366
476
  attrs: {
367
- class: 'step-nav'
477
+ class: "step-nav",
368
478
  },
369
479
  children: [
370
480
  {
371
- $formkit: 'button',
372
- name: 'hidden_button',
373
- children: 'Hidden',
481
+ $formkit: "button",
482
+ name: "hidden_button",
483
+ children: "Hidden",
374
484
  style: {
375
- if: '$activeStep === $firstStep()',
376
- then: 'visibility: hidden;'
377
- }
485
+ if: "$activeStep === $firstStep()",
486
+ then: "visibility: hidden;",
487
+ },
378
488
  },
379
489
  {
380
- $formkit: 'submit',
381
- name: 'submit_button',
382
- label: updates.submitLabel || 'Chat Now'
383
- }
384
- ]
490
+ $formkit: "submit",
491
+ name: "submit_button",
492
+ label: updates.submitLabel || "Chat Now",
493
+ },
494
+ ],
385
495
  }
386
496
  }
387
497
 
388
498
  const formDetails = () => ({
389
- $el: 'pre',
499
+ $el: "pre",
390
500
  if: '$urlParam("fdbg", "") == 1',
391
501
  children: [
392
502
  {
393
- $el: 'pre',
394
- children: '$stringify( $get(form).value )',
503
+ $el: "pre",
504
+ children: "$stringify( $get(form).value )",
395
505
  attrs: {
396
- class: 't-text-xs',
397
- style: 'overflow: scroll'
398
- }
506
+ class: "t-text-xs",
507
+ style: "overflow: scroll",
508
+ },
399
509
  },
400
510
  {
401
- $el: 'pre',
402
- children: ['activeStep: ', '$activeStep'],
511
+ $el: "pre",
512
+ children: ["activeStep: ", "$activeStep"],
403
513
  attrs: {
404
- class: 't-text-xs',
405
- style: 'overflow: scroll'
406
- }
514
+ class: "t-text-xs",
515
+ style: "overflow: scroll",
516
+ },
407
517
  },
408
518
  {
409
- $el: 'pre',
410
- children: ['stepHistory: ', '$stepHistory'],
519
+ $el: "pre",
520
+ children: ["stepHistory: ", "$stepHistory"],
411
521
  attrs: {
412
- class: 't-text-xs',
413
- style: 'overflow: scroll'
414
- }
522
+ class: "t-text-xs",
523
+ style: "overflow: scroll",
524
+ },
415
525
  },
416
526
  {
417
- $el: 'pre',
418
- children: ['stepQueue: ', '$stepQueue'],
527
+ $el: "pre",
528
+ children: ["stepQueue: ", "$stepQueue"],
419
529
  attrs: {
420
- class: 't-text-xs',
421
- style: 'overflow: scroll'
422
- }
530
+ class: "t-text-xs",
531
+ style: "overflow: scroll",
532
+ },
423
533
  },
424
534
  {
425
- $el: 'pre',
426
- children: ['steps: ', '$stepKeys()'],
535
+ $el: "pre",
536
+ children: ["steps: ", "$stepKeys()"],
427
537
  attrs: {
428
- class: 't-text-xs',
429
- style: 'overflow: scroll'
430
- }
431
- }
432
- ]
538
+ class: "t-text-xs",
539
+ style: "overflow: scroll",
540
+ },
541
+ },
542
+ ],
433
543
  });
434
544
 
435
545
  const formPropDefaults = {
436
- type: 'form',
437
- id: 'form',
438
- config: { validationVisibility: 'submit' },
546
+ type: "form",
547
+ id: "form",
548
+ config: { validationVisibility: "submit" },
439
549
  onSubmit: '$submit($submitUrl, $prepData, $handleRedirect, "text/plain; charset=UTF-8")',
440
- plugins: '$plugins',
550
+ plugins: "$plugins",
441
551
  actions: false,
442
- anchorElement: 'form-anchor',
552
+ anchorElement: "form-anchor",
443
553
  useLocalStorage: true,
444
554
  prepop: {
445
- fromURL: true
555
+ fromURL: true,
446
556
  },
447
557
  errorCodes: {
448
558
  403: { message: "An Error Occurred", abort: false },
@@ -450,7 +560,7 @@ const formPropDefaults = {
450
560
  429: "An Error Occurred",
451
561
  504: { message: "An Error Occurred", abort: false },
452
562
  },
453
- formClass: '!t-max-w-[40rem]'
563
+ formClass: "!t-max-w-[40rem]",
454
564
  };
455
565
 
456
566
  // export function filteredNextStepsMapLegal(keyList) {
@@ -460,10 +570,7 @@ const formPropDefaults = {
460
570
  // }
461
571
 
462
572
  function formProps(updates) {
463
- const props = merge(
464
- formPropDefaults,
465
- updates
466
- );
573
+ const props = merge(formPropDefaults, updates);
467
574
  if (props.formId && !props.name) {
468
575
  props.name = props.formId;
469
576
  }
@@ -471,76 +578,73 @@ function formProps(updates) {
471
578
  }
472
579
 
473
580
  const formAnchorDefaults = {
474
- $el: 'div',
581
+ $el: "div",
475
582
  children: [
476
583
  {
477
- $el: 'div',
584
+ $el: "div",
478
585
  attrs: {
479
- id: 'form-anchor',
480
- class: 't-absolute',
481
- style: { top: '-30px', left: 0 }
482
- }
483
- }
586
+ id: "form-anchor",
587
+ class: "t-absolute",
588
+ style: { top: "-30px", left: 0 },
589
+ },
590
+ },
484
591
  ],
485
592
  attrs: {
486
- class: 't-relative'
487
- }
593
+ class: "t-relative",
594
+ },
488
595
  };
489
596
 
490
597
  function formAnchor(updates) {
491
- return merge(
492
- formAnchorDefaults,
493
- updates
494
- )
598
+ return merge(formAnchorDefaults, updates)
495
599
  }
496
600
 
497
601
  function headlineDefaults(updates = {}) {
498
602
  return {
499
- $el: 'h1',
603
+ $el: "h1",
500
604
  attrs: {
501
- 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 || '')
502
- }
605
+ class:
606
+ "t-flex t-justify-center t-text-center !t-text-[2rem] t-font-semibold t-pt-5 t-px-7 md:t-px-3" +
607
+ " " +
608
+ (updates.headlineClass || ""),
609
+ },
503
610
  }
504
611
  }
505
612
 
506
613
  function headline(updates = {}) {
507
- return merge(
508
- headlineDefaults(updates),
509
- updates
510
- )
614
+ return merge(headlineDefaults(updates), updates)
511
615
  }
512
616
 
513
617
  const hiddenInputsBase = [
514
618
  {
515
- $formkit: 'hidden',
619
+ $formkit: "hidden",
516
620
  name: "gclid",
517
- value: null
621
+ value: null,
518
622
  },
519
623
  {
520
- $formkit: 'hidden',
624
+ $formkit: "hidden",
521
625
  name: "campaignid",
522
- value: null
626
+ value: null,
523
627
  },
524
628
  {
525
- $formkit: 'hidden',
629
+ $formkit: "hidden",
526
630
  name: "s",
527
- value: null
528
- }
631
+ value: null,
632
+ },
529
633
  ];
530
634
 
531
635
  const hiddenInputsMechanics = [
532
636
  {
533
- $formkit: 'hidden',
637
+ $formkit: "hidden",
534
638
  name: "vertical",
535
- value: "AutoRepair"
639
+ value: "AutoRepair",
536
640
  },
537
641
  {
538
- $formkit: 'hidden',
642
+ $formkit: "hidden",
539
643
  name: "Category",
540
644
  id: "Category",
541
- value: "Mechanics"
645
+ value: "Mechanics",
542
646
  },
543
- ...hiddenInputsBase
647
+ ...hiddenInputsBase,
544
648
  ];
545
649
 
546
650
  const schema = [