bhl-forms 0.6.15 → 0.7.1

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 (97) hide show
  1. package/dist/bhl-forms.es.js +1757 -1759
  2. package/dist/bhl-forms.iife.js +4 -4
  3. package/dist/bhl-forms.modern.es.js +2804 -2811
  4. package/dist/bhl-forms.modern.iife.js +6 -6
  5. package/dist/bhl-forms.modern.umd.js +6 -6
  6. package/dist/bhl-forms.umd.js +4 -4
  7. package/dist/forms/accidentsAndInjuries.es.js +314 -228
  8. package/dist/forms/accidentsAndInjuries.iife.js +1 -1
  9. package/dist/forms/accidentsAndInjuries.json +1 -1
  10. package/dist/forms/appraisals.es.js +16 -7
  11. package/dist/forms/appraisals.iife.js +1 -1
  12. package/dist/forms/business.es.js +317 -236
  13. package/dist/forms/business.iife.js +1 -1
  14. package/dist/forms/business.json +1 -1
  15. package/dist/forms/childAndFamily.es.js +303 -224
  16. package/dist/forms/childAndFamily.iife.js +1 -1
  17. package/dist/forms/childAndFamily.json +1 -1
  18. package/dist/forms/childAndFamilySingle.es.js +643 -555
  19. package/dist/forms/childAndFamilySingle.iife.js +1 -1
  20. package/dist/forms/childAndFamilySingle.json +1 -1
  21. package/dist/forms/civilLawsuit.es.js +637 -551
  22. package/dist/forms/civilLawsuit.iife.js +1 -1
  23. package/dist/forms/civilLawsuit.json +1 -1
  24. package/dist/forms/coins.es.js +16 -7
  25. package/dist/forms/coins.iife.js +1 -1
  26. package/dist/forms/contracts.es.js +307 -227
  27. package/dist/forms/contracts.iife.js +1 -1
  28. package/dist/forms/contracts.json +1 -1
  29. package/dist/forms/criminal.es.js +660 -572
  30. package/dist/forms/criminal.iife.js +1 -1
  31. package/dist/forms/criminal.json +1 -1
  32. package/dist/forms/divorce.es.js +643 -555
  33. package/dist/forms/divorce.iife.js +1 -1
  34. package/dist/forms/divorce.json +1 -1
  35. package/dist/forms/employmentAndWorkplace.es.js +584 -506
  36. package/dist/forms/employmentAndWorkplace.iife.js +1 -1
  37. package/dist/forms/employmentAndWorkplace.json +1 -1
  38. package/dist/forms/generalHomeImprovement.es.js +3015 -0
  39. package/dist/forms/generalHomeImprovement.iife.js +1 -0
  40. package/dist/forms/generalHomeImprovement.json +1 -0
  41. package/dist/forms/generalLegal.es.js +341 -244
  42. package/dist/forms/generalLegal.iife.js +1 -1
  43. package/dist/forms/generalLegal.json +1 -1
  44. package/dist/forms/generalLegalJustAnswer.es.js +4542 -0
  45. package/dist/forms/generalLegalJustAnswer.iife.js +1 -0
  46. package/dist/forms/generalLegalJustAnswer.json +1 -0
  47. package/dist/forms/generalLegalPopUnder.es.js +342 -245
  48. package/dist/forms/generalLegalPopUnder.iife.js +1 -1
  49. package/dist/forms/generalLegalPopUnder.json +1 -1
  50. package/dist/forms/generalLegalPopUnderSingle.es.js +692 -612
  51. package/dist/forms/generalLegalPopUnderSingle.iife.js +1 -1
  52. package/dist/forms/generalLegalPopUnderSingle.json +1 -1
  53. package/dist/forms/generalLegalSingle.es.js +692 -612
  54. package/dist/forms/generalLegalSingle.iife.js +1 -1
  55. package/dist/forms/generalLegalSingle.json +1 -1
  56. package/dist/forms/generalLegalThankYou.es.js +204 -158
  57. package/dist/forms/generalLegalThankYou.iife.js +1 -1
  58. package/dist/forms/generalLegalThankYou.json +1 -1
  59. package/dist/forms/generalLegalThankYouConsultation.es.js +692 -612
  60. package/dist/forms/generalLegalThankYouConsultation.iife.js +1 -1
  61. package/dist/forms/generalLegalThankYouConsultation.json +1 -1
  62. package/dist/forms/harassmentAndDiscrimination.es.js +303 -224
  63. package/dist/forms/harassmentAndDiscrimination.iife.js +1 -1
  64. package/dist/forms/harassmentAndDiscrimination.json +1 -1
  65. package/dist/forms/landlordTenant.es.js +316 -240
  66. package/dist/forms/landlordTenant.iife.js +1 -1
  67. package/dist/forms/landlordTenant.json +1 -1
  68. package/dist/forms/malpractice.es.js +308 -227
  69. package/dist/forms/malpractice.iife.js +1 -1
  70. package/dist/forms/malpractice.json +1 -1
  71. package/dist/forms/mechanics.es.js +184 -166
  72. package/dist/forms/mechanics.iife.js +1 -1
  73. package/dist/forms/mechanics.json +1 -1
  74. package/dist/forms/patentsAndIP.es.js +646 -558
  75. package/dist/forms/patentsAndIP.iife.js +1 -1
  76. package/dist/forms/patentsAndIP.json +1 -1
  77. package/dist/forms/realEstate.es.js +339 -243
  78. package/dist/forms/realEstate.iife.js +1 -1
  79. package/dist/forms/realEstate.json +1 -1
  80. package/dist/forms/repossession.es.js +307 -227
  81. package/dist/forms/repossession.iife.js +1 -1
  82. package/dist/forms/repossession.json +1 -1
  83. package/dist/forms/ssdi.es.js +156 -140
  84. package/dist/forms/ssdi.iife.js +1 -1
  85. package/dist/forms/ssdi.json +1 -1
  86. package/dist/forms/testForm.es.js +69 -51
  87. package/dist/forms/testForm.iife.js +1 -1
  88. package/dist/forms/testForm.json +1 -1
  89. package/dist/forms/testRedirects.es.js +43 -22
  90. package/dist/forms/testRedirects.iife.js +1 -1
  91. package/dist/forms/testRedirects.json +1 -1
  92. package/dist/forms/vets.es.js +16 -7
  93. package/dist/forms/vets.iife.js +1 -1
  94. package/dist/forms/willsAndTrusts.es.js +304 -223
  95. package/dist/forms/willsAndTrusts.iife.js +1 -1
  96. package/dist/forms/willsAndTrusts.json +1 -1
  97. package/package.json +3 -3
@@ -6,14 +6,97 @@ 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
- var TCPA_LANGUAGE = "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.";
10
-
11
- const DEFAULT_COMMENTS_PLACEHOLDER_DYNAMIC = '$getKey($meta, "commentsPlaceholders." + $get(Type_Of_Legal_Problem).value, $meta.defaultCommentsPlaceholder)';
12
- const DEFAULT_COMMENTS_LABEL = 'Please briefly describe your legal issue in a few words:';
13
- const DEFAULT_FINAL_HEADLINE = 'Submit Your Case';
14
- const DEFAULT_FINAL_HEADLINE_DYNAMIC = '$getKey($meta, "finalHeadlines." + $get(Type_Of_Legal_Problem).value, $meta.defaultFinalHeadline)';
15
- const DEFAULT_FINAL_SUBHEADLINE = 'You may benefit from speaking with a legal professional. Please verify your contact information.';
16
- const DEFAULT_FINAL_SUBHEADLINE_DYNAMIC = '$getKey($meta, "finalSubHeadlines." + $get(Type_Of_Legal_Problem).value, $meta.defaultFinalSubHeadline)';
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.";
16
+ 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',
23
+ };
24
+ const CROSS_SELL_OPTION_MAP_LEGAL = {
25
+ // 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',
33
+ },
34
+ "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
+ // TODO add one more?
41
+ },
42
+ "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
+ // TODO add one more?
49
+ },
50
+ "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',
57
+ },
58
+ "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',
65
+ },
66
+ "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',
73
+ },
74
+ "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',
81
+ },
82
+ "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',
89
+ },
90
+ "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',
97
+ },
98
+ '*': defaultLegalImprovementCrossSells,
99
+ };
17
100
 
18
101
  // ------ Common Base Settings
19
102
 
@@ -140,6 +223,14 @@ const sbsText = (updates) => {
140
223
  return text(updates)
141
224
  };
142
225
 
226
+ 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';
231
+ return text(updates)
232
+ };
233
+
143
234
  const textArea = (updates) => {
144
235
  if (updates.name && !updates.id) {
145
236
  updates.id = updates.name;
@@ -177,20 +268,101 @@ const sbsDate = (updates) => {
177
268
  return date(updates)
178
269
  };
179
270
 
180
- const applicantAge = (scope) => sbsText({
181
- name: scope ? scope + ':' + 'Applicant_Age' : 'Applicant_Age',
182
- label: 'Age of Applicant?',
183
- placeholder: 'Age between 18 and 65',
184
- maxlength: 2,
185
- inputmode: "numeric",
186
- validation: "required|min:18,max:65",
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
+ });
284
+
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
+ });
294
+
295
+ const lastName = (scope) => sbsText({
296
+ label: 'Last Name:',
297
+ placeholder: 'Last',
298
+ name: scope ? scope + ':' + 'Last_Name' : 'Last_Name',
299
+ autocomplete: "family-name",
187
300
  validationMessages: {
188
- required: 'Applicant Age is required',
189
- min: 'Invalid Age - must be between 18 and 65',
190
- max: 'Invalid Age - must be between 18 and 65',
301
+ required: 'Last Name is required'
191
302
  }
192
303
  });
193
304
 
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
+ });
322
+
323
+
324
+ const zipcode = (scope, vertical, updates = {}) => {
325
+ 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;
328
+ return func({
329
+ label,
330
+ help,
331
+ placeholder: '#####',
332
+ name: scope ? scope + ':' + 'Zip' : 'Zip',
333
+ maxlength: 5,
334
+ inputmode: "numeric",
335
+ autocomplete: 'postal-code',
336
+ validation: 'required|matches:/^[0-9]{5}$/',
337
+ validationMessages: {
338
+ required: 'Zip Code is required',
339
+ matches: 'Invalid Zip Code'
340
+ },
341
+ ...updates
342
+ })
343
+ };
344
+
345
+ const applicantAge = (scope, vertical, updates = {}) => {
346
+ 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
+ }))
364
+ };
365
+
194
366
  const atFault = (scope) => sbsYesNoRadio({
195
367
  name: scope ? scope + ':' + 'At_Fault' : 'At_Fault',
196
368
  label: 'Were You at Fault?'
@@ -315,20 +487,6 @@ const doctorTreatment = (scope) => sbsYesNoRadio({
315
487
  label: 'Have You Recently Been Treated by a Doctor, Hospital or Clinic?',
316
488
  });
317
489
 
318
- const email = (scope) => sbsText({
319
- $formkit: 'email',
320
- name: scope ? scope + ':' + 'Email' : 'Email',
321
- label: 'Email Address:',
322
- placeholder: 'email@domain.com',
323
- autocomplete: 'email',
324
- 'data-tf-sensitive': 'false',
325
- validation: 'required|email',
326
- validationMessages: {
327
- required: 'Email is required',
328
- email: 'Invalid Email'
329
- }
330
- });
331
-
332
490
  const estateLegalServicesNeeded = (scope) => sbsSelect({
333
491
  name: scope ? scope + ':' + 'Estate_Legal_Services_Needed' : 'Estate_Legal_Services_Needed',
334
492
  label: "Legal Services Needed for Your Estate:",
@@ -342,17 +500,6 @@ const estateLegalServicesNeeded = (scope) => sbsSelect({
342
500
  ]
343
501
  });
344
502
 
345
- const firstName = (scope) => sbsText({
346
- $formkit: 'text',
347
- label: 'First Name:',
348
- placeholder: 'First',
349
- name: scope ? scope + ':' + 'First_Name' : 'First_Name',
350
- autocomplete: "given-name",
351
- validationMessages: {
352
- required: 'First Name is required'
353
- }
354
- });
355
-
356
503
  const haveAttorney = (scope) => sbsYesNoRadio({
357
504
  name: scope ? scope + ':' + 'Have_Attorney' : 'Have_Attorney',
358
505
  label: 'Already Working with An Attorney?'
@@ -368,17 +515,6 @@ const incidentDate = (scope) => sbsDate({
368
515
  label: 'Date of Incident:',
369
516
  });
370
517
 
371
- const lastName = (scope) => sbsText({
372
- $formkit: 'text',
373
- label: 'Last Name:',
374
- placeholder: 'Last',
375
- name: scope ? scope + ':' + 'Last_Name' : 'Last_Name',
376
- autocomplete: "family-name",
377
- validationMessages: {
378
- required: 'Last Name is required'
379
- }
380
- });
381
-
382
518
  const lawsuitOtherParty = () => sbsSelect({
383
519
  label: 'The Other Party is a:',
384
520
  name: 'Lawsuit_Other_Party',
@@ -410,69 +546,7 @@ const legalCrossSells$1 = () => col2Checkbox({
410
546
  help: 'Just hit "Next" if none apply',
411
547
  helpClass: 't-text-center !t-text-sm',
412
548
  validation: null,
413
- options: {
414
- if: '$getVal($get(form), "Type_Of_Legal_Problem") === "Auto and Car Accidents"',
415
- then: {
416
- 'Social Security Disability and Insurance': 'Interest in Disability Benefits',
417
- 'Wills and Trusts': 'Need a Will or Trust',
418
- 'Workers Compensation': 'Workplace Injury',
419
- 'Power of Attorney': 'Update Power of Attorney',
420
- 'Divorce and Separation': 'Need a Divorce or Separation',
421
- 'Child Custody': 'Need help with Child Custody',
422
- },
423
- else: {
424
- if: '$getVal($get(form), "Type_Of_Legal_Problem") === "Personal Injury" || $getVal($get(form), "Type_Of_Legal_Problem") === "Workers Compensation"',
425
- then: {
426
- 'DUI and DWI': 'Involved in a DUI/DWI',
427
- 'Wills and Trusts': 'Need a Will or Trust',
428
- 'Power of Attorney': 'Update Power of Attorney',
429
- 'Divorce and Separation': 'Need a Divorce or Separation',
430
- 'Child Custody': 'Need help with Child Custody',
431
- // TODO add one more?
432
- },
433
- else: {
434
- if: '$getVal($get(form), "Type_Of_Legal_Problem") === "DUI and DWI"',
435
- then: {
436
- 'Personal Injury': 'Personal or Workplace Injury',
437
- 'Wills and Trusts': 'Need a Will or Trust',
438
- 'Social Security Disability and Insurance': 'Interest in Disability Benefits',
439
- 'Power of Attorney': 'Update Power of Attorney',
440
- 'Divorce and Separation': 'Need a Divorce or Separation',
441
- 'Child Custody': 'Need help with Child Custody',
442
- },
443
- else: {
444
- if: '$getVal($get(form), "Type_Of_Legal_Problem") === "Wills and Trusts" || $getVal($get(form), "Type_Of_Legal_Problem") === "Probate and Estates" || $getVal($get(form), "Type_Of_Legal_Problem") === "Power of Attorney"',
445
- then: {
446
- 'Auto and Car Accidents': 'Injured in a Car Accident',
447
- 'Personal Injury': 'Personal or Workplace Injury',
448
- 'DUI and DWI': 'Involved in a DUI/DWI',
449
- 'Social Security Disability and Insurance': 'Interest in Disability Benefits',
450
- 'Divorce and Separation': 'Need a Divorce or Separation',
451
- 'Child Custody': 'Need help with Child Custody',
452
- },
453
- else: {
454
- if: '$getVal($get(form), "Type_Of_Legal_Problem") === "Long Term Disability" || $getVal($get(form), "Type_Of_Legal_Problem") === "Social Security Disability and Insurance"',
455
- then: {
456
- 'Auto and Car Accidents': 'Injured in a Car Accident',
457
- 'DUI and DWI': 'Involved in a DUI/DWI',
458
- 'Wills and Trusts': 'Need a Will or Trust',
459
- 'Power of Attorney': 'Update Power of Attorney',
460
- 'Divorce and Separation': 'Need a Divorce or Separation',
461
- 'Child Custody': 'Need help with Child Custody',
462
- },
463
- else: {
464
- 'Auto and Car Accidents': 'Injured in a Car Accident',
465
- 'Personal Injury': 'Personal or Workplace Injury',
466
- 'DUI and DWI': 'Involved in a DUI/DWI',
467
- 'Wills and Trusts': 'Need a Will or Trust',
468
- 'Power of Attorney': 'Update Power of Attorney',
469
- 'Social Security Disability and Insurance': 'Interest in Disability Benefits',
470
- }
471
- }
472
- }
473
- }
474
- }
475
- }
549
+ options: '$getCrossSellOptions($get(form), $getVal($get(form), "Type_Of_Legal_Problem"))',
476
550
  });
477
551
 
478
552
  const maritalStatus = (scope) => sbsSelect({
@@ -517,24 +591,6 @@ const pendingCharges = (scope) => sbsYesNoRadio({
517
591
  label: 'Do you currently have any pending charges?'
518
592
  });
519
593
 
520
- const phone = (scope) => sbsText({
521
- $formkit: 'tel',
522
- name: scope ? scope + ':' + 'Primary_Phone' : 'Primary_Phone',
523
- label: 'Phone Number:',
524
- placeholder: '###-###-####',
525
- maxlength: 12,
526
- help: '10-digit phone number, hyphens optional',
527
- autocomplete: 'tel-national',
528
- 'data-tf-sensitive': 'false',
529
- validation: 'required|matches:/^[0-9]{3}-?[0-9]{3}-?[0-9]{4}$/|valid_phone',
530
- validationMessages: {
531
- required: 'Field is required',
532
- matches: 'Invalid Phone Format, use ###-###-####',
533
- valid_phone: 'Invalid Phone Number'
534
- },
535
- helpClass: "t-mt-2.5 md:t-text-right md:t-mt-[-2px]"
536
- });
537
-
538
594
  const primaryInjury = (scope) => sbs2ColRadio({
539
595
  name: scope ? scope + ':' + 'Primary_Injury' : 'Primary_Injury',
540
596
  label: 'Primary Injury:',
@@ -631,21 +687,6 @@ const valueOfAssets = (scope) => sbsSelect({
631
687
  ]
632
688
  });
633
689
 
634
- const zipcode = (scope) => sbsText({
635
- label: 'Zip Code:',
636
- placeholder: '#####',
637
- name: scope ? scope + ':' + 'Zip' : 'Zip',
638
- maxlength: 5,
639
- inputmode: "numeric",
640
- autocomplete: 'postal-code',
641
- validation: 'required|matches:/^[0-9]{5}$/',
642
- validationMessages: {
643
- required: 'Zip Code is required',
644
- matches: 'Invalid Zip Code'
645
- }
646
- });
647
-
648
-
649
690
  // ------ Question Groups
650
691
 
651
692
  // NOTE: name must be unique within a form!
@@ -925,13 +966,20 @@ function crossSellQuestionsStepSubHeadline(updates) {
925
966
  function commentsStepHeadline(updates) {
926
967
  return {
927
968
  $el: 'h3',
928
- children: updates.headline || 'Additional Case Details',
969
+ children: updates.headline || 'Additional Details',
929
970
  attrs: {
930
971
  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 || '')
931
972
  }
932
973
  }
933
974
  }
934
975
 
976
+ function commentsStepHeadlineLegal(updates) {
977
+ return commentsStepHeadline({
978
+ headline: updates.headline || 'Additional Case Details',
979
+ headlineClass: updates.headlineClass
980
+ })
981
+ }
982
+
935
983
  function firstAndLastStepHeadline(updates) {
936
984
  return {
937
985
  $el: 'h3',
@@ -955,7 +1003,7 @@ function legalCrossSellsStepHeadline(updates) {
955
1003
  function contactStepHeadline(updates) {
956
1004
  return {
957
1005
  $el: 'h3',
958
- children: updates.headline || DEFAULT_FINAL_HEADLINE_DYNAMIC,
1006
+ children: updates.headline || DEFAULT_FINAL_HEADLINE_DYNAMIC_LEGAL,
959
1007
  attrs: {
960
1008
  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 || '')
961
1009
  }
@@ -965,7 +1013,7 @@ function contactStepHeadline(updates) {
965
1013
  function contactStepSubHeadline(updates) {
966
1014
  return {
967
1015
  $el: 'h5',
968
- children: updates.subheadline || DEFAULT_FINAL_SUBHEADLINE_DYNAMIC,
1016
+ children: updates.subheadline || DEFAULT_FINAL_SUBHEADLINE_DYNAMIC_LEGAL,
969
1017
  attrs: {
970
1018
  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 || '')
971
1019
  }
@@ -1005,10 +1053,16 @@ const stepDefaults = (step, stepKey) => ({
1005
1053
  }
1006
1054
  });
1007
1055
 
1008
- function step(name, inputs, nextOnEnter = true, nextOnInput = false, stepKey = undefined, nextStepMap = undefined, autoFocus = undefined) {
1009
- if (typeof nextOnEnter === 'undefined') {
1010
- nextOnEnter = true;
1011
- }
1056
+ function step(name, inputs, updates = {}) {
1057
+ const {
1058
+ nextOnEnter = true,
1059
+ nextOnInput = false,
1060
+ stepKey = undefined,
1061
+ nextStepMap = undefined,
1062
+ triggerRedirectMap = undefined,
1063
+ autoFocus = undefined,
1064
+ } = updates;
1065
+
1012
1066
  if (inputs && inputs.length && (nextOnEnter || nextOnInput)) {
1013
1067
  const lastInput = findLastInput(inputs[inputs.length - 1]);
1014
1068
  if (lastInput && nextOnEnter === true) {
@@ -1028,6 +1082,7 @@ function step(name, inputs, nextOnEnter = true, nextOnInput = false, stepKey = u
1028
1082
  id: name,
1029
1083
  name: name,
1030
1084
  nextStepMap: nextStepMap,
1085
+ triggerRedirectMap: triggerRedirectMap,
1031
1086
  autoFocus: autoFocus,
1032
1087
  children: inputs
1033
1088
  }
@@ -1036,6 +1091,34 @@ function step(name, inputs, nextOnEnter = true, nextOnInput = false, stepKey = u
1036
1091
  )
1037
1092
  }
1038
1093
 
1094
+ function contactInfo(updates = {}) {
1095
+ return step(
1096
+ 'contactInfo',
1097
+ [
1098
+ contactStepHeadline(updates),
1099
+ contactStepSubHeadline(updates),
1100
+ trustedFormScript(),
1101
+ email(updates.scope),
1102
+ phone(updates.scope),
1103
+ TCPAConsent(updates.scope),
1104
+ secureIcon()
1105
+ ],
1106
+ { nextOnEnter: false }
1107
+ )
1108
+ }
1109
+
1110
+ function firstAndLastV2(updates = {}) {
1111
+ return step(
1112
+ 'firstAndLast',
1113
+ [
1114
+ firstAndLastStepHeadline(updates),
1115
+ firstName(),
1116
+ lastName()
1117
+ ],
1118
+ updates
1119
+ )
1120
+ }
1121
+
1039
1122
  function malpracticeTOLPAndZip(updates = {}) {
1040
1123
  return step(
1041
1124
  'malpracticeTOLPAndZip',
@@ -1049,10 +1132,7 @@ function malpracticeTOLPAndZip(updates = {}) {
1049
1132
  malpracticeTOLPDisplay(),
1050
1133
  zipcode()
1051
1134
  ],
1052
- updates.nextOnEnter,
1053
- updates.nextOnInput,
1054
- updates.stepKey,
1055
- updates.nextStepMap
1135
+ updates
1056
1136
  )
1057
1137
  }
1058
1138
 
@@ -1065,7 +1145,7 @@ function malpracticeTOLPQuestions(updates = {}) {
1065
1145
  CivilLawsuitQuestions(),
1066
1146
  NotSureOrOtherQuestions()
1067
1147
  ],
1068
- updates.nextOnEnter
1148
+ updates
1069
1149
  )
1070
1150
  }
1071
1151
 
@@ -1073,10 +1153,10 @@ function commentsWithBankruptcy(updates = {}) {
1073
1153
  return step(
1074
1154
  'commentsWithBankruptcy',
1075
1155
  [
1076
- commentsStepHeadline(updates),
1156
+ commentsStepHeadlineLegal(updates),
1077
1157
  comments({
1078
- label: typeof updates.label === 'undefined' ? DEFAULT_COMMENTS_LABEL : updates.label,
1079
- placeholder: updates.placeholder || DEFAULT_COMMENTS_PLACEHOLDER_DYNAMIC,
1158
+ label: typeof updates.label === 'undefined' ? DEFAULT_COMMENTS_LABEL_LEGAL : updates.label,
1159
+ placeholder: updates.placeholder || DEFAULT_COMMENTS_PLACEHOLDER_DYNAMIC_LEGAL,
1080
1160
  inputClass: typeof updates.inputClass === 'undefined' ? '!t-h-32' : updates.inputClass,
1081
1161
  }, updates.scope),
1082
1162
  // TODO: needs scope support
@@ -1093,39 +1173,10 @@ function commentsWithBankruptcy(updates = {}) {
1093
1173
  ],
1094
1174
  }
1095
1175
  ],
1096
- false // nextOnEnter
1097
- )
1098
- }
1099
-
1100
- function contactInfo(updates = {}) {
1101
- return step(
1102
- 'contactInfo',
1103
- [
1104
- contactStepHeadline(updates),
1105
- contactStepSubHeadline(updates),
1106
- trustedFormScript(),
1107
- email(updates.scope),
1108
- phone(updates.scope),
1109
- TCPAConsent(updates.scope),
1110
- secureIcon()
1111
- ],
1112
- false, // nextOnEnter
1113
- )
1114
- }
1115
-
1116
- function firstAndLastV2(updates = {}) {
1117
- return step(
1118
- 'firstAndLast',
1119
- [
1120
- firstAndLastStepHeadline(updates),
1121
- firstName(),
1122
- lastName()
1123
- ],
1124
- updates.nextOnEnter
1176
+ { nextOnEnter: false }
1125
1177
  )
1126
1178
  }
1127
1179
 
1128
-
1129
1180
  function autoAndCarAccidentCrossSellQuestions(updates = {}) {
1130
1181
  return step(
1131
1182
  'autoAndCarAccidentCrossSellQuestions',
@@ -1142,7 +1193,7 @@ function autoAndCarAccidentCrossSellQuestions(updates = {}) {
1142
1193
  'CrossSell:Auto_and_Car_Accidents'
1143
1194
  )
1144
1195
  ],
1145
- updates.nextOnEnter
1196
+ updates
1146
1197
  )
1147
1198
  }
1148
1199
 
@@ -1161,7 +1212,7 @@ function childCustodyCrossSellQuestions(updates = {}) {
1161
1212
  'CrossSell:Child_Custody'
1162
1213
  )
1163
1214
  ],
1164
- updates.nextOnEnter
1215
+ updates
1165
1216
  )
1166
1217
  }
1167
1218
 
@@ -1180,7 +1231,7 @@ function divorceAndSeparationCrossSellQuestions(updates = {}) {
1180
1231
  'CrossSell:Divorce_and_Separation'
1181
1232
  )
1182
1233
  ],
1183
- updates.nextOnEnter
1234
+ updates
1184
1235
  )
1185
1236
  }
1186
1237
 
@@ -1199,7 +1250,7 @@ function duiAndDWICrossSellQuestions(updates = {}) {
1199
1250
  'CrossSell:DUI_and_DWI'
1200
1251
  )
1201
1252
  ],
1202
- updates.nextOnEnter
1253
+ updates
1203
1254
  )
1204
1255
  }
1205
1256
 
@@ -1219,7 +1270,7 @@ function ssdiCrossSellQuestions(updates = {}) {
1219
1270
  'CrossSell:Social_Security_Disability_and_Insurance'
1220
1271
  )
1221
1272
  ],
1222
- updates.nextOnEnter
1273
+ updates
1223
1274
  )
1224
1275
  }
1225
1276
 
@@ -1239,7 +1290,7 @@ function personalInjuryCrossSellQuestions(updates = {}) {
1239
1290
  'CrossSell:Personal_Injury'
1240
1291
  )
1241
1292
  ],
1242
- updates.nextOnEnter
1293
+ updates
1243
1294
  )
1244
1295
  }
1245
1296
 
@@ -1258,7 +1309,7 @@ function powerOfAttorneyCrossSellQuestions(updates = {}) {
1258
1309
  'CrossSell:Power_of_Attorney'
1259
1310
  )
1260
1311
  ],
1261
- updates.nextOnEnter
1312
+ updates
1262
1313
  )
1263
1314
  }
1264
1315
 
@@ -1277,7 +1328,7 @@ function willsAndTrustsCrossSellQuestions(updates = {}) {
1277
1328
  'CrossSell:Wills_and_Trusts'
1278
1329
  )
1279
1330
  ],
1280
- updates.nextOnEnter
1331
+ updates
1281
1332
  )
1282
1333
  }
1283
1334
 
@@ -1297,21 +1348,20 @@ function workersCompensationCrossSellQuestions(updates = {}) {
1297
1348
  'CrossSell:Workers_Compensation'
1298
1349
  )
1299
1350
  ],
1300
- updates.nextOnEnter
1351
+ updates
1301
1352
  )
1302
1353
  }
1303
1354
 
1304
1355
  function legalCrossSells(updates = {}) {
1356
+ updates.nextOnInput = false;
1357
+ updates.stepKey = '$get(Type_Of_Legal_Problem).value';
1305
1358
  return step(
1306
1359
  'legalCrossSells',
1307
1360
  [
1308
1361
  legalCrossSellsStepHeadline(updates),
1309
1362
  legalCrossSells$1(),
1310
1363
  ],
1311
- updates.nextOnEnter,
1312
- false,
1313
- // Note: we should probably scope this stepKey to this step name
1314
- '$get(Type_Of_Legal_Problem).value'
1364
+ updates
1315
1365
  )
1316
1366
  }
1317
1367
 
@@ -1454,9 +1504,7 @@ function formProps(updates) {
1454
1504
  return props
1455
1505
  }
1456
1506
 
1457
- const metaDefaults = {
1458
- tcpaLanguage: TCPA_LANGUAGE
1459
- };
1507
+ const metaDefaults = {};
1460
1508
 
1461
1509
  function metaProps(updates) {
1462
1510
  const data = merge(
@@ -1469,7 +1517,7 @@ function metaProps(updates) {
1469
1517
  }
1470
1518
  }
1471
1519
 
1472
- function defaultMetaProps(tolps = null) {
1520
+ function defaultMetaPropsLegal(tolps = null) {
1473
1521
  let commentsPlaceholders = TOLPCommentsPlaceholders;
1474
1522
  let finalHeadlines = TOLPFinalHeadlines;
1475
1523
  let finalSubHeadlines = TOLPFinalSubHeadlines;
@@ -1479,12 +1527,13 @@ function defaultMetaProps(tolps = null) {
1479
1527
  finalSubHeadlines = filterMapByKey(TOLPFinalSubHeadlines, tolps);
1480
1528
  }
1481
1529
  return metaProps({
1482
- defaultCommentsPlaceholder: DEFAULT_COMMENTS_PLACEHOLDER_DYNAMIC,
1530
+ tcpaLanguage: TCPA_LANGUAGE_LEGAL,
1531
+ defaultCommentsPlaceholder: DEFAULT_COMMENTS_PLACEHOLDER_DYNAMIC_LEGAL,
1483
1532
  commentsPlaceholders: commentsPlaceholders,
1484
- defaultFinalHeadline: DEFAULT_FINAL_HEADLINE,
1533
+ defaultFinalHeadline: DEFAULT_FINAL_HEADLINE_LEGAL,
1485
1534
  finalHeadlines: finalHeadlines,
1486
- defaultFinalSubHeadline: DEFAULT_FINAL_SUBHEADLINE,
1487
- finalSubHeadlines: finalSubHeadlines,
1535
+ defaultFinalSubHeadline: DEFAULT_FINAL_SUBHEADLINE_LEGAL,
1536
+ finalSubHeadlines: finalSubHeadlines
1488
1537
  })
1489
1538
  }
1490
1539
 
@@ -1950,25 +1999,55 @@ const TOLPFinalSubHeadlines = {
1950
1999
  // 'Non-Workplace Discrimination': '',
1951
2000
  };
1952
2001
 
1953
-
1954
2002
  const nextStepsMapLegalLegacy = {
1955
- '*': [
1956
- 'TOLPQuestions',
1957
- 'commentsWithBankruptcy',
1958
- 'legalCrossSells',
1959
- 'firstAndLast',
1960
- 'contactInfo',
1961
- ]
2003
+ values: {
2004
+ '*': [
2005
+ 'TOLPQuestions',
2006
+ 'commentsWithBankruptcy',
2007
+ 'legalCrossSells',
2008
+ 'firstAndLast',
2009
+ 'contactInfo',
2010
+ ]
2011
+ }
1962
2012
  };
1963
2013
 
1964
- const meta = defaultMetaProps();
2014
+ const nextStepsMapLegalCrossSells = {
2015
+ values: {
2016
+ 'Legal_CrossSells': {
2017
+ 'Auto and Car Accidents': ['autoAndCarAccidentCrossSellQuestions'],
2018
+ 'Personal Injury': ['personalInjuryCrossSellQuestions'],
2019
+ 'Workers Compensation': ['workersCompensationCrossSellQuestions'],
2020
+ 'DUI and DWI': ['duiAndDWICrossSellQuestions'],
2021
+ 'Long Term Disability': ['longTermDisabilityCrossSellQuestions'],
2022
+ 'Social Security Disability and Insurance': ['ssdiCrossSellQuestions'],
2023
+ 'Bankruptcy': ['bankruptcyCrossSellQuestions'],
2024
+ 'Power of Attorney': ['powerOfAttorneyCrossSellQuestions'],
2025
+ 'Wills and Trusts': ['willsAndTrustsCrossSellQuestions'],
2026
+ 'Divorce and Separation': ['divorceAndSeparationCrossSellQuestions'],
2027
+ 'Child Custody': ['childCustodyCrossSellQuestions'],
2028
+ },
2029
+ '*': ['firstAndLast', 'contactInfo'],
2030
+ },
2031
+
2032
+ // NOTE: this assumes a certain placement of the cross sell question
2033
+ // in the form flow.
2034
+ appendSteps: ['firstAndLast', 'contactInfo'],
2035
+ matchesAllowed: 1,
2036
+ };
2037
+
2038
+ const legalCrossSellOptionMap = CROSS_SELL_OPTION_MAP_LEGAL;
2039
+
2040
+ const meta = defaultMetaPropsLegal();
1965
2041
 
1966
2042
  meta.data.dynamicSchema = [
1967
2043
  malpracticeTOLPQuestions(),
1968
2044
  commentsWithBankruptcy({
1969
2045
  placeholder: 'Example: "My doctor or attorney was negligent in providing care."',
1970
2046
  }),
1971
- legalCrossSells(),
2047
+ legalCrossSells({
2048
+ headlineClass: '!t-text-dark',
2049
+ nextStepMap: nextStepsMapLegalCrossSells,
2050
+ }),
1972
2051
  autoAndCarAccidentCrossSellQuestions(),
1973
2052
  personalInjuryCrossSellQuestions(),
1974
2053
  workersCompensationCrossSellQuestions(),
@@ -1989,7 +2068,9 @@ const schema = [
1989
2068
  props: formProps({
1990
2069
  formId: 'malpractice',
1991
2070
  redirectMap: legalRedirectMap(),
1992
- valueOverrideMap: legalAllValueOverrideMap
2071
+ valueOverrideMap: legalAllValueOverrideMap,
2072
+ crossSellOptionMap: legalCrossSellOptionMap
2073
+
1993
2074
  }),
1994
2075
  children: [
1995
2076
  headline({