@simplybusiness/services 1.2.7 → 1.2.9

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.
package/dist/esm/index.js CHANGED
@@ -241,6 +241,298 @@ var baseEventDefinitions = [
241
241
  }
242
242
  ];
243
243
 
244
+ // src/snowplow/event-definitions/intervention.ts
245
+ var interventionEventDefinitions = [
246
+ {
247
+ name: "interventionInteractionCompleted",
248
+ type: "unstructured",
249
+ makePayload: (params) => {
250
+ const {
251
+ interventionName,
252
+ userUniqueIdentifier,
253
+ userUniqueIdentifierType,
254
+ action,
255
+ site
256
+ } = params;
257
+ return {
258
+ schema: "iglu:com.simplybusiness/intervention_interaction_completed/jsonschema/2-1-0",
259
+ data: {
260
+ intervention_name: interventionName,
261
+ user_unique_identifier: userUniqueIdentifier,
262
+ user_unique_identifier_type: userUniqueIdentifierType,
263
+ action,
264
+ site
265
+ }
266
+ };
267
+ }
268
+ }
269
+ ];
270
+
271
+ // src/snowplow/constants.ts
272
+ var DELIMITER = "|";
273
+
274
+ // src/snowplow/event-definitions/questionnaire/redaction.ts
275
+ var PII_ANSWER = [
276
+ "customer_title",
277
+ "customer_first_name",
278
+ "customer_last_name",
279
+ "customer_email_address",
280
+ "preapp_email_address",
281
+ "customer_telephone_number",
282
+ "customer_alternative_telephone_number",
283
+ "uk_address_lookup",
284
+ "uk_correspondence_address_lookup",
285
+ "customer_address_1_pre_quote",
286
+ "customer_address_2_pre_quote",
287
+ "customer_town_pre_quote",
288
+ "customer_postcode_pre_quote",
289
+ "customer_address_1",
290
+ "customer_address_2",
291
+ "customer_town",
292
+ "customer_postcode",
293
+ "address_1_pre_quote",
294
+ "address_2_pre_quote",
295
+ "uk_postcode_pre_quote",
296
+ "town_pre_quote",
297
+ "owner_first_name",
298
+ "owner_last_name",
299
+ "beneficiary_first_name",
300
+ "beneficiary_last_name",
301
+ "gender",
302
+ "dynamic_ssn_fein",
303
+ "ssn",
304
+ "fein",
305
+ "sof_county_court_judgement_online_yes",
306
+ "sof_county_court_judgement_online_no",
307
+ "sof_ccj_count",
308
+ "sof_ccj_value",
309
+ "sof_ccj_date",
310
+ "sof_court_judgement_yes",
311
+ "sof_court_judgement_no",
312
+ "ccj_date",
313
+ "sof_single_ccj_no",
314
+ "sof_single_ccj_yes",
315
+ "sof_ccj_yes",
316
+ "sof_ccj_no",
317
+ "ccj_count",
318
+ "sof_bankrupt_yes",
319
+ "sof_bankrupt_no",
320
+ "sof_multiple_bankruptcies_yes",
321
+ "sof_multiple_bankruptcies_no",
322
+ "bankruptcy_date",
323
+ "sof_single_bankruptcy_no",
324
+ "sof_single_bankruptcy_yes",
325
+ "sof_bankruptcy_yes",
326
+ "sof_bankruptcy_no",
327
+ "bankruptcy_discharged",
328
+ "sof_liquidation_yes",
329
+ "sof_liquidation_no",
330
+ "sof_multiple_liquidations",
331
+ "liquidation_date",
332
+ "sof_criminal_offence_yes",
333
+ "sof_criminal_offence_no",
334
+ "sof_criminal_yes",
335
+ "sof_criminal_no",
336
+ "hcp_date_of_birth_1",
337
+ "hcp_date_of_birth_2",
338
+ "hcp_date_of_birth_3",
339
+ "hcp_date_of_birth_4",
340
+ "hcp_date_of_birth_5",
341
+ "hcp_date_of_birth_6",
342
+ "hcp_date_of_birth_7",
343
+ "hcp_date_of_birth_8",
344
+ "hcp_date_of_birth_9",
345
+ "hcp_date_of_birth_10",
346
+ "sof_previous_claims_yes",
347
+ "sof_previous_claims_no",
348
+ "sof_claims_yes",
349
+ "sof_claims_no",
350
+ "sof_property_claims_in_the_last_5_years_yes",
351
+ "sof_property_claims_in_the_last_5_years_no",
352
+ "sof_property_claims_in_the_last_0_to_4_years_yes",
353
+ "sof_property_claims_in_the_last_0_to_4_years_no",
354
+ "claim_count",
355
+ "sof_number_of_claims",
356
+ "number_of_claims_in_last_5_years",
357
+ "number_of_claims_in_time_owned",
358
+ "date_of_incident_1",
359
+ "date_of_incident_2",
360
+ "date_of_incident_3",
361
+ "date_of_incident_4",
362
+ "date_of_incident_5",
363
+ "type_of_incident_1",
364
+ "type_of_incident_2",
365
+ "type_of_incident_3",
366
+ "type_of_incident_4",
367
+ "type_of_incident_5",
368
+ "incident_value_1",
369
+ "incident_value_2",
370
+ "incident_value_3",
371
+ "incident_value_4",
372
+ "incident_value_5",
373
+ "sof_pollution_disease_claims_yes",
374
+ "sof_pollution_disease_claims_no",
375
+ "sof_potential_claims_yes",
376
+ "sof_potential_claims_no",
377
+ "sof_previous_circumstances_yes",
378
+ "sof_previous_circumstances_no",
379
+ "sof_possible_claims_yes",
380
+ "sof_possible_claims_no",
381
+ "date_of_possible_incident",
382
+ "type_of_possible_incident",
383
+ "possible_incident_value",
384
+ "sof_property_claims_yes",
385
+ "sof_property_claims_no",
386
+ "sof_liability_claims_yes",
387
+ "sof_liability_claims_no",
388
+ "van_registration",
389
+ "sof_disqualified_director_yes",
390
+ "sof_disqualified_director_no",
391
+ "sof_insurance_refused_yes",
392
+ "sof_insurance_refused_no",
393
+ "sof_insurance_declined_yes",
394
+ "sof_insurance_declined_no",
395
+ "insurance_refused"
396
+ ];
397
+ var RADIO_ANSWER_FROM_QUESTIONS = [
398
+ "have_secondary_trade_yes",
399
+ "have_secondary_trade_no"
400
+ ];
401
+ var ANSWER_SUFFIX_PATTERN = /_(yes|no)$/;
402
+ var redact = (params) => {
403
+ let { question, answer } = params;
404
+ const piiAnswer = new Set(PII_ANSWER);
405
+ const radioAnswerFromQuestions = new Set(RADIO_ANSWER_FROM_QUESTIONS);
406
+ if (piiAnswer.has(question)) {
407
+ answer = "REDACTED";
408
+ question = question?.replace(ANSWER_SUFFIX_PATTERN, "");
409
+ } else if (radioAnswerFromQuestions.has(question)) {
410
+ question = question?.replace(ANSWER_SUFFIX_PATTERN, "");
411
+ }
412
+ return { question, answer };
413
+ };
414
+
415
+ // src/snowplow/event-definitions/personalised_cover.ts
416
+ var personalisedCoverEventDefinitions = [
417
+ {
418
+ name: "seeMoreClicked",
419
+ type: "structured",
420
+ makePayload: (_) => ({
421
+ category: "personalised_cover",
422
+ action: "see_more_clicked",
423
+ label: "page",
424
+ property: "personalised_cover"
425
+ })
426
+ },
427
+ {
428
+ name: "selectPackageClicked",
429
+ type: "structured",
430
+ makePayload: (_) => ({
431
+ category: "personalised_cover",
432
+ action: "select_package_clicked",
433
+ label: "page",
434
+ property: "personalised_cover"
435
+ })
436
+ },
437
+ {
438
+ name: "validationShown",
439
+ type: "structured",
440
+ makePayload: (params) => {
441
+ const { cover, question } = params;
442
+ return {
443
+ category: "personalised_cover",
444
+ action: "validation_shown",
445
+ label: "cover_question",
446
+ property: `${snakeCase(cover)}_${snakeCase(question)}`
447
+ };
448
+ }
449
+ },
450
+ {
451
+ name: "coverQuestionAnswered",
452
+ type: "unstructured",
453
+ makePayload: (params) => {
454
+ const { context } = params;
455
+ const { question, answer } = redact(params);
456
+ const flatAnswer = Array.isArray(answer) ? answer.join(DELIMITER) : answer;
457
+ return {
458
+ schema: "iglu:com.simplybusiness/form_question_answered/jsonschema/1-0-1",
459
+ data: {
460
+ site: context.site,
461
+ page_name: "personalised_cover",
462
+ section_name: "Personalised Cover Questions",
463
+ question,
464
+ answer: flatAnswer
465
+ }
466
+ };
467
+ }
468
+ },
469
+ {
470
+ name: "limitLinkClicked",
471
+ type: "structured",
472
+ makePayload: (params) => {
473
+ const { label } = params;
474
+ return {
475
+ category: "personalised_cover",
476
+ action: "limit_link_clicked",
477
+ label,
478
+ property: "link_clicked"
479
+ };
480
+ }
481
+ },
482
+ {
483
+ name: "limitChanged",
484
+ type: "structured",
485
+ makePayload: (params) => {
486
+ const { label, limit } = params;
487
+ return {
488
+ category: "personalised_cover",
489
+ action: "limit_changed",
490
+ label,
491
+ property: limit
492
+ };
493
+ }
494
+ },
495
+ {
496
+ name: "coverPresented",
497
+ type: "structured",
498
+ makePayload: (params) => {
499
+ const { property } = params;
500
+ return {
501
+ category: "personalised_cover",
502
+ action: "cover_presented",
503
+ label: "cover_name",
504
+ property
505
+ };
506
+ }
507
+ },
508
+ {
509
+ name: "additionalQuestionsClicked",
510
+ type: "structured",
511
+ makePayload: (params) => {
512
+ const { property } = params;
513
+ return {
514
+ category: "personalised_cover",
515
+ action: "additional_questions_clicked",
516
+ label: "cover_name",
517
+ property
518
+ };
519
+ }
520
+ },
521
+ {
522
+ name: "chatbotPromptClicked",
523
+ type: "structured",
524
+ makePayload: (params) => {
525
+ const { label, property } = params;
526
+ return {
527
+ category: "personalised_cover",
528
+ action: "chatbot_prompt_clicked",
529
+ label: property,
530
+ property: label
531
+ };
532
+ }
533
+ }
534
+ ];
535
+
244
536
  // src/snowplow/event-definitions/qcp.ts
245
537
  var qcpEventDefinitions = [
246
538
  {
@@ -402,395 +694,206 @@ var qcpEventDefinitions = [
402
694
  })
403
695
  },
404
696
  {
405
- name: "priceDetailsPopUpOpened",
406
- type: "structured",
407
- makePayload: () => ({
408
- category: "price_details",
409
- action: "price_details_popup_opened",
410
- label: "Price details",
411
- property: window.location.href
412
- })
413
- },
414
- {
415
- name: "editLimitButtonClicked",
416
- type: "structured",
417
- makePayload: () => ({
418
- category: "cover_limit_changes",
419
- action: "edit_limit_button_clicked",
420
- label: "Edit Limit",
421
- property: window.location.href
422
- })
423
- },
424
- {
425
- name: "applyButtonClicked",
426
- type: "structured",
427
- makePayload: () => ({
428
- category: "cover_limit_changes",
429
- action: "apply_button_clicked",
430
- label: "Apply Button Clicked",
431
- property: window.location.href
432
- })
433
- },
434
- {
435
- name: "coverageInfoClicked",
436
- type: "structured",
437
- makePayload: (params) => {
438
- const { deviceType, open = true } = params;
439
- return {
440
- action: "show_coverage_info_clicked",
441
- category: `uk-qcp-react-${deviceType}-show-coverage-info-toggle`,
442
- label: `${open ? "show" : "hide"}_coverage_info_clicked`,
443
- property: window.location.href
444
- };
445
- }
446
- },
447
- {
448
- name: "backToApplication",
449
- type: "unstructured",
450
- makePayload: (params) => {
451
- const { journeyId, vertical } = params;
452
- return {
453
- schema: "iglu:com.simplybusiness/qcp_back_to_application/jsonschema/1-0-0",
454
- data: {
455
- journey_id: journeyId,
456
- vertical
457
- }
458
- };
459
- },
460
- contexts: ["serviceChannelContext"]
461
- },
462
- // No quotes referral
463
- {
464
- name: "coverOptionsLinkClicked",
465
- type: "structured",
466
- makePayload: () => ({
467
- category: "uk-qcp-react-cover-options-link",
468
- action: "cover_options_link_clicked",
469
- label: "cover_options_link_clicked",
470
- property: window.location.href
471
- })
472
- },
473
- {
474
- name: "referralReasonsVariantBCoverOptionsLinkClicked",
475
- type: "structured",
476
- makePayload: () => ({
477
- category: "uk-24-12-qcp-mvt-referral-reasons",
478
- action: "cover_options_link_clicked_variant_b",
479
- label: "cover_options_link_clicked_variant_b",
480
- property: window.location.href
481
- })
482
- },
483
- {
484
- name: "referralReasonsVariantCCoverOptionsLinkClicked",
485
- type: "structured",
486
- makePayload: () => ({
487
- category: "uk-24-12-qcp-mvt-referral-reasons",
488
- action: "cover_options_link_clicked_variant_c",
489
- label: "cover_options_link_clicked_variant_c",
490
- property: window.location.href
491
- })
492
- },
493
- {
494
- name: "phoneNumberLinkClicked",
495
- type: "structured",
496
- makePayload: () => ({
497
- category: "uk-qcp-react-phone-number-link",
498
- action: "phone_number_link_clicked",
499
- label: "phone_number_link_clicked",
500
- property: window.location.href
501
- })
502
- },
503
- {
504
- name: "linkClicked",
505
- type: "unstructured",
506
- makePayload: (params) => {
507
- const { targetUrl, elementContent } = params;
508
- return {
509
- schema: "iglu:com.snowplowanalytics.snowplow/link_click/jsonschema/1-0-1",
510
- data: {
511
- targetUrl,
512
- elementContent
513
- }
514
- };
515
- }
516
- },
517
- {
518
- name: "qcpUpsellAccordionClicked",
519
- type: "structured",
520
- makePayload: (params) => ({
521
- category: "us-qcp-upsells",
522
- action: "accordion_clicked_qcp",
523
- label: params?.label,
524
- property: window.location.href
525
- })
526
- },
527
- {
528
- name: "qdsUpsellAccordionClicked",
529
- type: "structured",
530
- makePayload: (params) => ({
531
- category: "us-qcp-upsells",
532
- action: "accordion_clicked_slider",
533
- label: params?.label,
534
- property: window.location.href
535
- })
536
- },
537
- {
538
- name: "qcpUpsellTooltipHelperClicked",
697
+ name: "priceDetailsPopUpOpened",
539
698
  type: "structured",
540
- makePayload: (params) => ({
541
- category: "us-qcp-upsells",
542
- action: "tooltip_helper_clicked_qcp",
543
- label: params?.label,
699
+ makePayload: () => ({
700
+ category: "price_details",
701
+ action: "price_details_popup_opened",
702
+ label: "Price details",
544
703
  property: window.location.href
545
704
  })
546
705
  },
547
706
  {
548
- name: "qdsUpsellTooltipHelperClicked",
707
+ name: "editLimitButtonClicked",
549
708
  type: "structured",
550
- makePayload: (params) => ({
551
- category: "us-qcp-upsells",
552
- action: "tooltip_helper_clicked_slider",
553
- label: params?.label,
709
+ makePayload: () => ({
710
+ category: "cover_limit_changes",
711
+ action: "edit_limit_button_clicked",
712
+ label: "Edit Limit",
554
713
  property: window.location.href
555
714
  })
556
715
  },
557
716
  {
558
- name: "qcpQuoteButtonClicked",
717
+ name: "applyButtonClicked",
559
718
  type: "structured",
560
- makePayload: (payload) => ({
561
- category: "quote-buttons",
562
- action: "button-clicked",
563
- label: payload?.label,
719
+ makePayload: () => ({
720
+ category: "cover_limit_changes",
721
+ action: "apply_button_clicked",
722
+ label: "Apply Button Clicked",
564
723
  property: window.location.href
565
724
  })
566
725
  },
567
726
  {
568
- name: "layoutToggleClickedExperiment",
727
+ name: "coverageInfoClicked",
569
728
  type: "structured",
570
729
  makePayload: (params) => {
571
- const { layout } = params;
572
- return {
573
- category: "uk-25-04-16-gridview_layout",
574
- action: "layout_toggle_clicked",
575
- label: layout,
576
- property: window.location.href
577
- };
578
- }
579
- },
580
- {
581
- name: "selectCoverOptionsClicked",
582
- type: "structured",
583
- makePayload: (payload) => {
730
+ const { deviceType, open = true } = params;
584
731
  return {
585
- category: "uk-25-09-qcp-covers-demand-test",
586
- action: "cover_options_clicked",
587
- label: payload?.label,
732
+ action: "show_coverage_info_clicked",
733
+ category: `uk-qcp-react-${deviceType}-show-coverage-info-toggle`,
734
+ label: `${open ? "show" : "hide"}_coverage_info_clicked`,
588
735
  property: window.location.href
589
736
  };
590
737
  }
591
738
  },
592
739
  {
593
- name: "voucherClaimClicked",
594
- type: "structured",
595
- makePayload: () => ({
596
- category: "uk-25-06-hyrdra-voucher-intervention-qcp-page",
597
- action: "voucher_claim_clicked",
598
- label: "voucher_claim_clicked",
599
- property: window.location.href
600
- })
601
- }
602
- ];
603
-
604
- // src/snowplow/event-definitions/referral.ts
605
- var referralEventDefinitions = [
606
- {
607
- name: "nextCoverageClicked",
608
- type: "structured",
609
- makePayload: (params) => {
610
- const { url } = params;
611
- const eventName = "post_referral_workers_compensation_continuation_link";
612
- return {
613
- category: eventName,
614
- action: "link_click",
615
- label: eventName,
616
- property: url
617
- };
618
- }
619
- }
620
- ];
621
-
622
- // src/snowplow/event-definitions/intervention.ts
623
- var interventionEventDefinitions = [
624
- {
625
- name: "interventionInteractionCompleted",
740
+ name: "backToApplication",
626
741
  type: "unstructured",
627
742
  makePayload: (params) => {
628
- const {
629
- interventionName,
630
- userUniqueIdentifier,
631
- userUniqueIdentifierType,
632
- action,
633
- site
634
- } = params;
743
+ const { journeyId, vertical } = params;
635
744
  return {
636
- schema: "iglu:com.simplybusiness/intervention_interaction_completed/jsonschema/2-1-0",
745
+ schema: "iglu:com.simplybusiness/qcp_back_to_application/jsonschema/1-0-0",
637
746
  data: {
638
- intervention_name: interventionName,
639
- user_unique_identifier: userUniqueIdentifier,
640
- user_unique_identifier_type: userUniqueIdentifierType,
641
- action,
642
- site
747
+ journey_id: journeyId,
748
+ vertical
643
749
  }
644
750
  };
645
- }
646
- }
647
- ];
648
-
649
- // src/snowplow/constants.ts
650
- var DELIMITER = "|";
651
-
652
- // src/snowplow/event-definitions/redaction.ts
653
- var PII_ANSWER = [
654
- "customer_title",
655
- "customer_first_name",
656
- "customer_last_name",
657
- "customer_email_address",
658
- "preapp_email_address",
659
- "customer_telephone_number",
660
- "customer_alternative_telephone_number",
661
- "uk_address_lookup",
662
- "uk_correspondence_address_lookup",
663
- "customer_address_1_pre_quote",
664
- "customer_address_2_pre_quote",
665
- "customer_town_pre_quote",
666
- "customer_postcode_pre_quote",
667
- "customer_address_1",
668
- "customer_address_2",
669
- "customer_town",
670
- "customer_postcode",
671
- "address_1_pre_quote",
672
- "address_2_pre_quote",
673
- "uk_postcode_pre_quote",
674
- "town_pre_quote",
675
- "owner_first_name",
676
- "owner_last_name",
677
- "beneficiary_first_name",
678
- "beneficiary_last_name",
679
- "gender",
680
- "dynamic_ssn_fein",
681
- "ssn",
682
- "fein",
683
- "sof_county_court_judgement_online_yes",
684
- "sof_county_court_judgement_online_no",
685
- "sof_ccj_count",
686
- "sof_ccj_value",
687
- "sof_ccj_date",
688
- "sof_court_judgement_yes",
689
- "sof_court_judgement_no",
690
- "ccj_date",
691
- "sof_single_ccj_no",
692
- "sof_single_ccj_yes",
693
- "sof_ccj_yes",
694
- "sof_ccj_no",
695
- "ccj_count",
696
- "sof_bankrupt_yes",
697
- "sof_bankrupt_no",
698
- "sof_multiple_bankruptcies_yes",
699
- "sof_multiple_bankruptcies_no",
700
- "bankruptcy_date",
701
- "sof_single_bankruptcy_no",
702
- "sof_single_bankruptcy_yes",
703
- "sof_bankruptcy_yes",
704
- "sof_bankruptcy_no",
705
- "bankruptcy_discharged",
706
- "sof_liquidation_yes",
707
- "sof_liquidation_no",
708
- "sof_multiple_liquidations",
709
- "liquidation_date",
710
- "sof_criminal_offence_yes",
711
- "sof_criminal_offence_no",
712
- "sof_criminal_yes",
713
- "sof_criminal_no",
714
- "hcp_date_of_birth_1",
715
- "hcp_date_of_birth_2",
716
- "hcp_date_of_birth_3",
717
- "hcp_date_of_birth_4",
718
- "hcp_date_of_birth_5",
719
- "hcp_date_of_birth_6",
720
- "hcp_date_of_birth_7",
721
- "hcp_date_of_birth_8",
722
- "hcp_date_of_birth_9",
723
- "hcp_date_of_birth_10",
724
- "sof_previous_claims_yes",
725
- "sof_previous_claims_no",
726
- "sof_claims_yes",
727
- "sof_claims_no",
728
- "sof_property_claims_in_the_last_5_years_yes",
729
- "sof_property_claims_in_the_last_5_years_no",
730
- "sof_property_claims_in_the_last_0_to_4_years_yes",
731
- "sof_property_claims_in_the_last_0_to_4_years_no",
732
- "claim_count",
733
- "sof_number_of_claims",
734
- "number_of_claims_in_last_5_years",
735
- "number_of_claims_in_time_owned",
736
- "date_of_incident_1",
737
- "date_of_incident_2",
738
- "date_of_incident_3",
739
- "date_of_incident_4",
740
- "date_of_incident_5",
741
- "type_of_incident_1",
742
- "type_of_incident_2",
743
- "type_of_incident_3",
744
- "type_of_incident_4",
745
- "type_of_incident_5",
746
- "incident_value_1",
747
- "incident_value_2",
748
- "incident_value_3",
749
- "incident_value_4",
750
- "incident_value_5",
751
- "sof_pollution_disease_claims_yes",
752
- "sof_pollution_disease_claims_no",
753
- "sof_potential_claims_yes",
754
- "sof_potential_claims_no",
755
- "sof_previous_circumstances_yes",
756
- "sof_previous_circumstances_no",
757
- "sof_possible_claims_yes",
758
- "sof_possible_claims_no",
759
- "date_of_possible_incident",
760
- "type_of_possible_incident",
761
- "possible_incident_value",
762
- "sof_property_claims_yes",
763
- "sof_property_claims_no",
764
- "sof_liability_claims_yes",
765
- "sof_liability_claims_no",
766
- "van_registration",
767
- "sof_disqualified_director_yes",
768
- "sof_disqualified_director_no",
769
- "sof_insurance_refused_yes",
770
- "sof_insurance_refused_no",
771
- "sof_insurance_declined_yes",
772
- "sof_insurance_declined_no",
773
- "insurance_refused"
774
- ];
775
- var RADIO_ANSWER_FROM_QUESTIONS = [
776
- "have_secondary_trade_yes",
777
- "have_secondary_trade_no"
778
- ];
779
- var ANSWER_SUFFIX_PATTERN = /_(yes|no)$/;
780
- var redact = (params) => {
781
- let { question, answer } = params;
782
- const piiAnswer = new Set(PII_ANSWER);
783
- const radioAnswerFromQuestions = new Set(RADIO_ANSWER_FROM_QUESTIONS);
784
- if (piiAnswer.has(question)) {
785
- answer = "REDACTED";
786
- question = question?.replace(ANSWER_SUFFIX_PATTERN, "");
787
- } else if (radioAnswerFromQuestions.has(question)) {
788
- question = question?.replace(ANSWER_SUFFIX_PATTERN, "");
751
+ },
752
+ contexts: ["serviceChannelContext"]
753
+ },
754
+ // No quotes referral
755
+ {
756
+ name: "coverOptionsLinkClicked",
757
+ type: "structured",
758
+ makePayload: () => ({
759
+ category: "uk-qcp-react-cover-options-link",
760
+ action: "cover_options_link_clicked",
761
+ label: "cover_options_link_clicked",
762
+ property: window.location.href
763
+ })
764
+ },
765
+ {
766
+ name: "referralReasonsVariantBCoverOptionsLinkClicked",
767
+ type: "structured",
768
+ makePayload: () => ({
769
+ category: "uk-24-12-qcp-mvt-referral-reasons",
770
+ action: "cover_options_link_clicked_variant_b",
771
+ label: "cover_options_link_clicked_variant_b",
772
+ property: window.location.href
773
+ })
774
+ },
775
+ {
776
+ name: "referralReasonsVariantCCoverOptionsLinkClicked",
777
+ type: "structured",
778
+ makePayload: () => ({
779
+ category: "uk-24-12-qcp-mvt-referral-reasons",
780
+ action: "cover_options_link_clicked_variant_c",
781
+ label: "cover_options_link_clicked_variant_c",
782
+ property: window.location.href
783
+ })
784
+ },
785
+ {
786
+ name: "phoneNumberLinkClicked",
787
+ type: "structured",
788
+ makePayload: () => ({
789
+ category: "uk-qcp-react-phone-number-link",
790
+ action: "phone_number_link_clicked",
791
+ label: "phone_number_link_clicked",
792
+ property: window.location.href
793
+ })
794
+ },
795
+ {
796
+ name: "linkClicked",
797
+ type: "unstructured",
798
+ makePayload: (params) => {
799
+ const { targetUrl, elementContent } = params;
800
+ return {
801
+ schema: "iglu:com.snowplowanalytics.snowplow/link_click/jsonschema/1-0-1",
802
+ data: {
803
+ targetUrl,
804
+ elementContent
805
+ }
806
+ };
807
+ }
808
+ },
809
+ {
810
+ name: "qcpUpsellAccordionClicked",
811
+ type: "structured",
812
+ makePayload: (params) => ({
813
+ category: "us-qcp-upsells",
814
+ action: "accordion_clicked_qcp",
815
+ label: params?.label,
816
+ property: window.location.href
817
+ })
818
+ },
819
+ {
820
+ name: "qdsUpsellAccordionClicked",
821
+ type: "structured",
822
+ makePayload: (params) => ({
823
+ category: "us-qcp-upsells",
824
+ action: "accordion_clicked_slider",
825
+ label: params?.label,
826
+ property: window.location.href
827
+ })
828
+ },
829
+ {
830
+ name: "qcpUpsellTooltipHelperClicked",
831
+ type: "structured",
832
+ makePayload: (params) => ({
833
+ category: "us-qcp-upsells",
834
+ action: "tooltip_helper_clicked_qcp",
835
+ label: params?.label,
836
+ property: window.location.href
837
+ })
838
+ },
839
+ {
840
+ name: "qdsUpsellTooltipHelperClicked",
841
+ type: "structured",
842
+ makePayload: (params) => ({
843
+ category: "us-qcp-upsells",
844
+ action: "tooltip_helper_clicked_slider",
845
+ label: params?.label,
846
+ property: window.location.href
847
+ })
848
+ },
849
+ {
850
+ name: "qcpQuoteButtonClicked",
851
+ type: "structured",
852
+ makePayload: (payload) => ({
853
+ category: "quote-buttons",
854
+ action: "button-clicked",
855
+ label: payload?.label,
856
+ property: window.location.href
857
+ })
858
+ },
859
+ {
860
+ name: "layoutToggleClickedExperiment",
861
+ type: "structured",
862
+ makePayload: (params) => {
863
+ const { layout } = params;
864
+ return {
865
+ category: "uk-25-04-16-gridview_layout",
866
+ action: "layout_toggle_clicked",
867
+ label: layout,
868
+ property: window.location.href
869
+ };
870
+ }
871
+ },
872
+ {
873
+ name: "selectCoverOptionsClicked",
874
+ type: "structured",
875
+ makePayload: (payload) => {
876
+ return {
877
+ category: "uk-25-09-qcp-covers-demand-test",
878
+ action: "cover_options_clicked",
879
+ label: payload?.label,
880
+ property: window.location.href
881
+ };
882
+ }
883
+ },
884
+ {
885
+ name: "voucherClaimClicked",
886
+ type: "structured",
887
+ makePayload: () => ({
888
+ category: "uk-25-06-hyrdra-voucher-intervention-qcp-page",
889
+ action: "voucher_claim_clicked",
890
+ label: "voucher_claim_clicked",
891
+ property: window.location.href
892
+ })
789
893
  }
790
- return { question, answer };
791
- };
894
+ ];
792
895
 
793
- // src/snowplow/event-definitions/questionnaire.ts
896
+ // src/snowplow/event-definitions/questionnaire/questionnaire.ts
794
897
  var questionnaireEventDefinitions = [
795
898
  {
796
899
  name: "questionAnswered",
@@ -800,7 +903,7 @@ var questionnaireEventDefinitions = [
800
903
  const { question, answer } = redact(params);
801
904
  const flatAnswer = Array.isArray(answer) ? answer.join(DELIMITER) : answer;
802
905
  return {
803
- schema: "iglu:com.simplybusiness/form_question_answered/jsonschema/1-0-3",
906
+ schema: "iglu:com.simplybusiness/form_question_answered/jsonschema/1-0-4",
804
907
  data: {
805
908
  site: context.site,
806
909
  page_index: 1,
@@ -940,122 +1043,19 @@ var questionnaireEventDefinitions = [
940
1043
  }
941
1044
  ];
942
1045
 
943
- // src/snowplow/event-definitions/personalised_cover.ts
944
- var personalisedCoverEventDefinitions = [
945
- {
946
- name: "seeMoreClicked",
947
- type: "structured",
948
- makePayload: (_) => ({
949
- category: "personalised_cover",
950
- action: "see_more_clicked",
951
- label: "page",
952
- property: "personalised_cover"
953
- })
954
- },
955
- {
956
- name: "selectPackageClicked",
957
- type: "structured",
958
- makePayload: (_) => ({
959
- category: "personalised_cover",
960
- action: "select_package_clicked",
961
- label: "page",
962
- property: "personalised_cover"
963
- })
964
- },
965
- {
966
- name: "validationShown",
967
- type: "structured",
968
- makePayload: (params) => {
969
- const { cover, question } = params;
970
- return {
971
- category: "personalised_cover",
972
- action: "validation_shown",
973
- label: "cover_question",
974
- property: `${snakeCase(cover)}_${snakeCase(question)}`
975
- };
976
- }
977
- },
978
- {
979
- name: "coverQuestionAnswered",
980
- type: "unstructured",
981
- makePayload: (params) => {
982
- const { context } = params;
983
- const { question, answer } = redact(params);
984
- const flatAnswer = Array.isArray(answer) ? answer.join(DELIMITER) : answer;
985
- return {
986
- schema: "iglu:com.simplybusiness/form_question_answered/jsonschema/1-0-1",
987
- data: {
988
- site: context.site,
989
- page_name: "personalised_cover",
990
- section_name: "Personalised Cover Questions",
991
- question,
992
- answer: flatAnswer
993
- }
994
- };
995
- }
996
- },
997
- {
998
- name: "limitLinkClicked",
999
- type: "structured",
1000
- makePayload: (params) => {
1001
- const { label } = params;
1002
- return {
1003
- category: "personalised_cover",
1004
- action: "limit_link_clicked",
1005
- label,
1006
- property: "link_clicked"
1007
- };
1008
- }
1009
- },
1010
- {
1011
- name: "limitChanged",
1012
- type: "structured",
1013
- makePayload: (params) => {
1014
- const { label, limit } = params;
1015
- return {
1016
- category: "personalised_cover",
1017
- action: "limit_changed",
1018
- label,
1019
- property: limit
1020
- };
1021
- }
1022
- },
1023
- {
1024
- name: "coverPresented",
1025
- type: "structured",
1026
- makePayload: (params) => {
1027
- const { property } = params;
1028
- return {
1029
- category: "personalised_cover",
1030
- action: "cover_presented",
1031
- label: "cover_name",
1032
- property
1033
- };
1034
- }
1035
- },
1036
- {
1037
- name: "additionalQuestionsClicked",
1038
- type: "structured",
1039
- makePayload: (params) => {
1040
- const { property } = params;
1041
- return {
1042
- category: "personalised_cover",
1043
- action: "additional_questions_clicked",
1044
- label: "cover_name",
1045
- property
1046
- };
1047
- }
1048
- },
1046
+ // src/snowplow/event-definitions/referral.ts
1047
+ var referralEventDefinitions = [
1049
1048
  {
1050
- name: "chatbotPromptClicked",
1049
+ name: "nextCoverageClicked",
1051
1050
  type: "structured",
1052
1051
  makePayload: (params) => {
1053
- const { label, property } = params;
1052
+ const { url } = params;
1053
+ const eventName = "post_referral_workers_compensation_continuation_link";
1054
1054
  return {
1055
- category: "personalised_cover",
1056
- action: "chatbot_prompt_clicked",
1057
- label: property,
1058
- property: label
1055
+ category: eventName,
1056
+ action: "link_click",
1057
+ label: eventName,
1058
+ property: url
1059
1059
  };
1060
1060
  }
1061
1061
  }