@forgerock/login-widget 1.2.0-beta.9 → 1.2.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.
package/index.cjs CHANGED
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  * @forgerock/login-widget
3
3
  *
4
- * Copyright (c) 2023 ForgeRock. All rights reserved.
4
+ * Copyright (c) 2024 ForgeRock. All rights reserved.
5
5
  * This software may be modified and distributed under the terms
6
6
  * of the MIT license.
7
7
  *
8
8
  * MIT License
9
9
  *
10
- * Copyright (c) 2023
10
+ * Copyright (c) 2024
11
11
  *
12
12
  * Permission is hereby granted, free of charge, to any person obtaining a copy
13
13
  * of this software and associated documentation files (the "Software"), to deal
@@ -69,14 +69,6 @@ function is_function(thing) {
69
69
  function safe_not_equal(a, b) {
70
70
  return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
71
71
  }
72
- let src_url_equal_anchor;
73
- function src_url_equal(element_src, url) {
74
- if (!src_url_equal_anchor) {
75
- src_url_equal_anchor = document.createElement('a');
76
- }
77
- src_url_equal_anchor.href = url;
78
- return element_src === src_url_equal_anchor.href;
79
- }
80
72
  function is_empty(obj) {
81
73
  return Object.keys(obj).length === 0;
82
74
  }
@@ -11944,6 +11936,7 @@ const journeyStore = writable({
11944
11936
  step: null,
11945
11937
  successful: false,
11946
11938
  response: null,
11939
+ recaptchaAction: null,
11947
11940
  });
11948
11941
  /**
11949
11942
  * @function initialize - Initializes the journey store
@@ -11953,7 +11946,7 @@ const journeyStore = writable({
11953
11946
  function initialize$4(initOptions) {
11954
11947
  const stack = initializeStack();
11955
11948
  let stepNumber = 0;
11956
- async function next(prevStep = null, nextOptions, resumeUrl) {
11949
+ async function next(prevStep, nextOptions, resumeUrl) {
11957
11950
  if (!Config.get().serverConfig?.baseUrl) {
11958
11951
  logErrorAndThrow('missingBaseUrl');
11959
11952
  }
@@ -11983,6 +11976,7 @@ function initialize$4(initOptions) {
11983
11976
  step: prevStep,
11984
11977
  successful: false,
11985
11978
  response: null,
11979
+ recaptchaAction: nextOptions?.recaptchaAction,
11986
11980
  });
11987
11981
  try {
11988
11982
  if (resumeUrl) {
@@ -12045,6 +12039,7 @@ function initialize$4(initOptions) {
12045
12039
  step: nextStep,
12046
12040
  successful: false,
12047
12041
  response: null,
12042
+ recaptchaAction: nextOptions?.recaptchaAction,
12048
12043
  });
12049
12044
  }
12050
12045
  else if (nextStep.type === StepType.LoginSuccess) {
@@ -12061,6 +12056,7 @@ function initialize$4(initOptions) {
12061
12056
  step: null,
12062
12057
  successful: true,
12063
12058
  response: nextStep.payload,
12059
+ recaptchaAction: nextOptions?.recaptchaAction,
12064
12060
  });
12065
12061
  }
12066
12062
  else if (nextStep.type === StepType.LoginFailure) {
@@ -12163,6 +12159,7 @@ function initialize$4(initOptions) {
12163
12159
  step: restartedStep,
12164
12160
  successful: false,
12165
12161
  response: null,
12162
+ recaptchaAction: null,
12166
12163
  });
12167
12164
  }
12168
12165
  else if (restartedStep.type === StepType.LoginSuccess) {
@@ -12174,6 +12171,7 @@ function initialize$4(initOptions) {
12174
12171
  step: null,
12175
12172
  successful: true,
12176
12173
  response: restartedStep.payload,
12174
+ recaptchaAction: null,
12177
12175
  });
12178
12176
  }
12179
12177
  else {
@@ -12190,6 +12188,7 @@ function initialize$4(initOptions) {
12190
12188
  step: null,
12191
12189
  successful: false,
12192
12190
  response: restartedStep.payload,
12191
+ recaptchaAction: null,
12193
12192
  });
12194
12193
  }
12195
12194
  }
@@ -12221,6 +12220,9 @@ function initialize$4(initOptions) {
12221
12220
  };
12222
12221
  }
12223
12222
  }
12223
+ if (!startOptions?.recaptchaAction && startOptions?.tree) {
12224
+ startOptions.recaptchaAction = startOptions.tree;
12225
+ }
12224
12226
  await stack.push(startOptions);
12225
12227
  await next(undefined, startOptions);
12226
12228
  }
@@ -12233,6 +12235,7 @@ function initialize$4(initOptions) {
12233
12235
  step: null,
12234
12236
  successful: false,
12235
12237
  response: null,
12238
+ recaptchaAction: null,
12236
12239
  });
12237
12240
  }
12238
12241
  return {
@@ -12455,6 +12458,7 @@ const styleSchema = z
12455
12458
  .object({
12456
12459
  checksAndRadios: z.union([z.literal('animated'), z.literal('standard')]).optional(),
12457
12460
  labels: z.union([z.literal('floating').optional(), z.literal('stacked')]).optional(),
12461
+ showPassword: z.union([z.literal('none'), z.literal('button'), z.literal('checkbox')]).optional(),
12458
12462
  logo: logoSchema.optional(),
12459
12463
  sections: z
12460
12464
  .object({
@@ -12474,6 +12478,7 @@ styleSchema.partial();
12474
12478
  const fallbackStyles = {
12475
12479
  checksAndRadios: 'animated',
12476
12480
  labels: 'floating',
12481
+ showPassword: 'button',
12477
12482
  logo: undefined,
12478
12483
  sections: undefined,
12479
12484
  stage: undefined,
@@ -12487,8 +12492,19 @@ const styleStore = writable(fallbackStyles);
12487
12492
  */
12488
12493
  function initialize(customStyle) {
12489
12494
  if (customStyle) {
12490
- styleSchema.parse(customStyle);
12491
- styleStore.set(customStyle);
12495
+ /*
12496
+ Helper function to safely assign keys to strict object
12497
+ */
12498
+ const accessStrictType = (str) => {
12499
+ return customStyle[str];
12500
+ };
12501
+ const newStyleConfig = Object.keys(customStyle).reduce((acc, key) => {
12502
+ if (accessStrictType(key) === undefined || accessStrictType(key) === null) {
12503
+ return acc;
12504
+ }
12505
+ return { ...acc, [key]: accessStrictType(key) };
12506
+ }, fallbackStyles);
12507
+ styleStore.set(newStyleConfig);
12492
12508
  }
12493
12509
  else {
12494
12510
  styleStore.set(fallbackStyles);
@@ -12650,6 +12666,7 @@ function widgetApiFactory(componentApi) {
12650
12666
  }
12651
12667
  else {
12652
12668
  journeyStore.start({
12669
+ recaptchaAction: startOptions?.recaptchaAction,
12653
12670
  ...startOptions?.forgerock,
12654
12671
  // Only include a `tree` property if the `journey` options prop is truthy
12655
12672
  ...(startOptions?.journey && { tree: startOptions?.journey }),
@@ -12837,7 +12854,7 @@ function create_else_block$d(ctx) {
12837
12854
  }
12838
12855
 
12839
12856
  // (11:0) {#if html}
12840
- function create_if_block$v(ctx) {
12857
+ function create_if_block$w(ctx) {
12841
12858
  let current;
12842
12859
  const default_slot_template = /*#slots*/ ctx[5].default;
12843
12860
  const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[4], null);
@@ -12939,7 +12956,7 @@ function create_fragment$18(ctx) {
12939
12956
  let if_block;
12940
12957
  let if_block_anchor;
12941
12958
  let current;
12942
- const if_block_creators = [create_if_block$v, create_else_block$d];
12959
+ const if_block_creators = [create_if_block$w, create_else_block$d];
12943
12960
  const if_blocks = [];
12944
12961
 
12945
12962
  function select_block_type(ctx, dirty) {
@@ -13154,7 +13171,7 @@ function create_else_block$c(ctx) {
13154
13171
  }
13155
13172
  });
13156
13173
 
13157
- let if_block = /*$styleStore*/ ctx[5]?.logo && create_if_block_1$f(ctx);
13174
+ let if_block = /*$styleStore*/ ctx[5]?.logo && create_if_block_1$h(ctx);
13158
13175
 
13159
13176
  return {
13160
13177
  c() {
@@ -13200,7 +13217,7 @@ function create_else_block$c(ctx) {
13200
13217
  if (if_block) {
13201
13218
  if_block.p(ctx, dirty);
13202
13219
  } else {
13203
- if_block = create_if_block_1$f(ctx);
13220
+ if_block = create_if_block_1$h(ctx);
13204
13221
  if_block.c();
13205
13222
  if_block.m(div, null);
13206
13223
  }
@@ -13235,7 +13252,7 @@ function create_else_block$c(ctx) {
13235
13252
  }
13236
13253
 
13237
13254
  // (39:2) {#if withHeader}
13238
- function create_if_block$u(ctx) {
13255
+ function create_if_block$v(ctx) {
13239
13256
  let div1;
13240
13257
  let div0;
13241
13258
  let div0_style_value;
@@ -13357,7 +13374,7 @@ function create_default_slot_1$i(ctx) {
13357
13374
  }
13358
13375
 
13359
13376
  // (77:6) {#if $styleStore?.logo}
13360
- function create_if_block_1$f(ctx) {
13377
+ function create_if_block_1$h(ctx) {
13361
13378
  let div;
13362
13379
  let div_style_value;
13363
13380
 
@@ -13419,7 +13436,7 @@ function create_fragment$16(ctx) {
13419
13436
  let div;
13420
13437
  let dialog_class_value;
13421
13438
  let current;
13422
- const if_block_creators = [create_if_block$u, create_else_block$c];
13439
+ const if_block_creators = [create_if_block$v, create_else_block$c];
13423
13440
  const if_blocks = [];
13424
13441
 
13425
13442
  function select_block_type(ctx, dirty) {
@@ -13947,7 +13964,7 @@ function create_else_block$b(ctx) {
13947
13964
  }
13948
13965
 
13949
13966
  // (44:33)
13950
- function create_if_block_1$e(ctx) {
13967
+ function create_if_block_1$g(ctx) {
13951
13968
  let warningicon;
13952
13969
  let current;
13953
13970
  warningicon = new Warning_icon({});
@@ -13976,7 +13993,7 @@ function create_if_block_1$e(ctx) {
13976
13993
  }
13977
13994
 
13978
13995
  // (42:4) {#if type === 'error'}
13979
- function create_if_block$t(ctx) {
13996
+ function create_if_block$u(ctx) {
13980
13997
  let alerticon;
13981
13998
  let current;
13982
13999
  alerticon = new Alert_icon({});
@@ -14014,7 +14031,7 @@ function create_fragment$12(ctx) {
14014
14031
  let div_class_value;
14015
14032
  let div_role_value;
14016
14033
  let current;
14017
- const if_block_creators = [create_if_block$t, create_if_block_1$e, create_else_block$b];
14034
+ const if_block_creators = [create_if_block$u, create_if_block_1$g, create_else_block$b];
14018
14035
  const if_blocks = [];
14019
14036
 
14020
14037
  function select_block_type(ctx, dirty) {
@@ -14254,7 +14271,7 @@ class Spinner extends SvelteComponent {
14254
14271
 
14255
14272
  /* src/lib/components/primitives/button/button.svelte generated by Svelte v3.59.2 */
14256
14273
 
14257
- function create_if_block$s(ctx) {
14274
+ function create_if_block$t(ctx) {
14258
14275
  let spinner;
14259
14276
  let current;
14260
14277
 
@@ -14312,7 +14329,7 @@ function create_fragment$10(ctx) {
14312
14329
  let current;
14313
14330
  let mounted;
14314
14331
  let dispose;
14315
- let if_block = /*busy*/ ctx[0] && create_if_block$s();
14332
+ let if_block = /*busy*/ ctx[0] && create_if_block$t();
14316
14333
  const default_slot_template = /*#slots*/ ctx[7].default;
14317
14334
  const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[6], null);
14318
14335
  const default_slot_or_fallback = default_slot || fallback_block$1();
@@ -14354,7 +14371,7 @@ function create_fragment$10(ctx) {
14354
14371
  transition_in(if_block, 1);
14355
14372
  }
14356
14373
  } else {
14357
- if_block = create_if_block$s();
14374
+ if_block = create_if_block$t();
14358
14375
  if_block.c();
14359
14376
  transition_in(if_block, 1);
14360
14377
  if_block.m(button, t);
@@ -14757,7 +14774,7 @@ function create_else_block$a(ctx) {
14757
14774
  }
14758
14775
 
14759
14776
  // (10:0) {#if html}
14760
- function create_if_block$r(ctx) {
14777
+ function create_if_block$s(ctx) {
14761
14778
  let current;
14762
14779
  const default_slot_template = /*#slots*/ ctx[4].default;
14763
14780
  const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[3], null);
@@ -14859,7 +14876,7 @@ function create_fragment$_(ctx) {
14859
14876
  let if_block;
14860
14877
  let if_block_anchor;
14861
14878
  let current;
14862
- const if_block_creators = [create_if_block$r, create_else_block$a];
14879
+ const if_block_creators = [create_if_block$s, create_else_block$a];
14863
14880
  const if_blocks = [];
14864
14881
 
14865
14882
  function select_block_type(ctx, dirty) {
@@ -15054,7 +15071,7 @@ class Shield_icon extends SvelteComponent {
15054
15071
 
15055
15072
  /* src/lib/journey/stages/_utilities/back-to.svelte generated by Svelte v3.59.2 */
15056
15073
 
15057
- function create_if_block$q(ctx) {
15074
+ function create_if_block$r(ctx) {
15058
15075
  let p;
15059
15076
  let button;
15060
15077
  let t_value = interpolate(/*string*/ ctx[1]) + "";
@@ -15092,7 +15109,7 @@ function create_if_block$q(ctx) {
15092
15109
 
15093
15110
  function create_fragment$Y(ctx) {
15094
15111
  let if_block_anchor;
15095
- let if_block = /*$stack*/ ctx[2].length > 1 && create_if_block$q(ctx);
15112
+ let if_block = /*$stack*/ ctx[2].length > 1 && create_if_block$r(ctx);
15096
15113
 
15097
15114
  return {
15098
15115
  c() {
@@ -15108,7 +15125,7 @@ function create_fragment$Y(ctx) {
15108
15125
  if (if_block) {
15109
15126
  if_block.p(ctx, dirty);
15110
15127
  } else {
15111
- if_block = create_if_block$q(ctx);
15128
+ if_block = create_if_block$r(ctx);
15112
15129
  if_block.c();
15113
15130
  if_block.m(if_block_anchor.parentNode, if_block_anchor);
15114
15131
  }
@@ -15631,7 +15648,7 @@ function getAttributeValidationFailureText(callback) {
15631
15648
 
15632
15649
  /* src/lib/components/primitives/message/input-message.svelte generated by Svelte v3.59.2 */
15633
15650
 
15634
- function create_if_block$p(ctx) {
15651
+ function create_if_block$q(ctx) {
15635
15652
  let p;
15636
15653
  let p_class_value;
15637
15654
  let p_id_value;
@@ -15664,7 +15681,7 @@ function create_if_block$p(ctx) {
15664
15681
 
15665
15682
  function create_fragment$X(ctx) {
15666
15683
  let if_block_anchor;
15667
- let if_block = /*dirtyMessage*/ ctx[1] && create_if_block$p(ctx);
15684
+ let if_block = /*dirtyMessage*/ ctx[1] && create_if_block$q(ctx);
15668
15685
 
15669
15686
  return {
15670
15687
  c() {
@@ -15680,7 +15697,7 @@ function create_fragment$X(ctx) {
15680
15697
  if (if_block) {
15681
15698
  if_block.p(ctx, dirty);
15682
15699
  } else {
15683
- if_block = create_if_block$p(ctx);
15700
+ if_block = create_if_block$q(ctx);
15684
15701
  if_block.c();
15685
15702
  if_block.m(if_block_anchor.parentNode, if_block_anchor);
15686
15703
  }
@@ -17588,7 +17605,7 @@ function get_each_context$a(ctx, list, i) {
17588
17605
  }
17589
17606
 
17590
17607
  // (39:0) {#if labelOrder === 'first'}
17591
- function create_if_block_1$d(ctx) {
17608
+ function create_if_block_1$f(ctx) {
17592
17609
  let label_1;
17593
17610
  let current;
17594
17611
 
@@ -17697,7 +17714,7 @@ function create_each_block$a(ctx) {
17697
17714
  }
17698
17715
 
17699
17716
  // (61:0) {#if labelOrder === 'last'}
17700
- function create_if_block$o(ctx) {
17717
+ function create_if_block$p(ctx) {
17701
17718
  let label_1;
17702
17719
  let current;
17703
17720
 
@@ -17779,7 +17796,7 @@ function create_fragment$O(ctx) {
17779
17796
  let current;
17780
17797
  let mounted;
17781
17798
  let dispose;
17782
- let if_block0 = /*labelOrder*/ ctx[7] === 'first' && create_if_block_1$d(ctx);
17799
+ let if_block0 = /*labelOrder*/ ctx[7] === 'first' && create_if_block_1$f(ctx);
17783
17800
  let each_value = /*options*/ ctx[8];
17784
17801
  let each_blocks = [];
17785
17802
 
@@ -17787,7 +17804,7 @@ function create_fragment$O(ctx) {
17787
17804
  each_blocks[i] = create_each_block$a(get_each_context$a(ctx, each_value, i));
17788
17805
  }
17789
17806
 
17790
- let if_block1 = /*labelOrder*/ ctx[7] === 'last' && create_if_block$o(ctx);
17807
+ let if_block1 = /*labelOrder*/ ctx[7] === 'last' && create_if_block$p(ctx);
17791
17808
 
17792
17809
  return {
17793
17810
  c() {
@@ -17843,7 +17860,7 @@ function create_fragment$O(ctx) {
17843
17860
  transition_in(if_block0, 1);
17844
17861
  }
17845
17862
  } else {
17846
- if_block0 = create_if_block_1$d(ctx);
17863
+ if_block0 = create_if_block_1$f(ctx);
17847
17864
  if_block0.c();
17848
17865
  transition_in(if_block0, 1);
17849
17866
  if_block0.m(t0.parentNode, t0);
@@ -17911,7 +17928,7 @@ function create_fragment$O(ctx) {
17911
17928
  transition_in(if_block1, 1);
17912
17929
  }
17913
17930
  } else {
17914
- if_block1 = create_if_block$o(ctx);
17931
+ if_block1 = create_if_block$p(ctx);
17915
17932
  if_block1.c();
17916
17933
  transition_in(if_block1, 1);
17917
17934
  if_block1.m(if_block1_anchor.parentNode, if_block1_anchor);
@@ -18417,7 +18434,7 @@ function create_else_block$9(ctx) {
18417
18434
  }
18418
18435
 
18419
18436
  // (52:0) {#if callbackMetadata?.platform?.displayType === 'radio'}
18420
- function create_if_block$n(ctx) {
18437
+ function create_if_block$o(ctx) {
18421
18438
  let radio;
18422
18439
  let current;
18423
18440
 
@@ -18472,7 +18489,7 @@ function create_fragment$L(ctx) {
18472
18489
  let if_block;
18473
18490
  let if_block_anchor;
18474
18491
  let current;
18475
- const if_block_creators = [create_if_block$n, create_else_block$9];
18492
+ const if_block_creators = [create_if_block$o, create_else_block$9];
18476
18493
  const if_blocks = [];
18477
18494
 
18478
18495
  function select_block_type(ctx, dirty) {
@@ -18794,12 +18811,12 @@ function create_else_block_1(ctx) {
18794
18811
  }
18795
18812
 
18796
18813
  // (80:0) {#if !stepMetadata?.derived.isStepSelfSubmittable()}
18797
- function create_if_block$m(ctx) {
18814
+ function create_if_block$n(ctx) {
18798
18815
  let current_block_type_index;
18799
18816
  let if_block;
18800
18817
  let if_block_anchor;
18801
18818
  let current;
18802
- const if_block_creators = [create_if_block_1$c, create_else_block$8];
18819
+ const if_block_creators = [create_if_block_1$e, create_else_block$8];
18803
18820
  const if_blocks = [];
18804
18821
 
18805
18822
  function select_block_type_1(ctx, dirty) {
@@ -18864,7 +18881,7 @@ function create_if_block$m(ctx) {
18864
18881
  }
18865
18882
 
18866
18883
  // (104:6) <Button style={options.length > 1 && defaultChoice === Number(opt.value) ? 'primary' : buttonStyle} type="button" width="auto" onClick={() => setBtnValue(Number(opt.value))} >
18867
- function create_default_slot_2$6(ctx) {
18884
+ function create_default_slot_2$8(ctx) {
18868
18885
  let t0_value = /*opt*/ ctx[15].text + "";
18869
18886
  let t0;
18870
18887
  let t1;
@@ -18905,7 +18922,7 @@ function create_each_block$9(ctx) {
18905
18922
  type: "button",
18906
18923
  width: "auto",
18907
18924
  onClick: func,
18908
- $$slots: { default: [create_default_slot_2$6] },
18925
+ $$slots: { default: [create_default_slot_2$8] },
18909
18926
  $$scope: { ctx }
18910
18927
  }
18911
18928
  });
@@ -19087,7 +19104,7 @@ function create_else_block$8(ctx) {
19087
19104
  }
19088
19105
 
19089
19106
  // (81:2) {#if options.length > 1}
19090
- function create_if_block_1$c(ctx) {
19107
+ function create_if_block_1$e(ctx) {
19091
19108
  let select;
19092
19109
  let current;
19093
19110
 
@@ -19160,7 +19177,7 @@ function create_fragment$J(ctx) {
19160
19177
  let if_block;
19161
19178
  let if_block_anchor;
19162
19179
  let current;
19163
- const if_block_creators = [create_if_block$m, create_else_block_1];
19180
+ const if_block_creators = [create_if_block$n, create_else_block_1];
19164
19181
  const if_blocks = [];
19165
19182
 
19166
19183
  function select_block_type(ctx, dirty) {
@@ -19794,7 +19811,7 @@ function create_if_block_3$8(ctx) {
19794
19811
  }
19795
19812
 
19796
19813
  // (97:0) {#if type === 'phone'}
19797
- function create_if_block_2$9(ctx) {
19814
+ function create_if_block_2$a(ctx) {
19798
19815
  let input;
19799
19816
  let input_aria_describedby_value;
19800
19817
  let input_class_value;
@@ -19874,7 +19891,7 @@ function create_if_block_2$9(ctx) {
19874
19891
  }
19875
19892
 
19876
19893
  // (113:0) {#if type === 'text'}
19877
- function create_if_block_1$b(ctx) {
19894
+ function create_if_block_1$d(ctx) {
19878
19895
  let input;
19879
19896
  let input_aria_describedby_value;
19880
19897
  let input_class_value;
@@ -19954,7 +19971,7 @@ function create_if_block_1$b(ctx) {
19954
19971
  }
19955
19972
 
19956
19973
  // (129:0) {#if labelOrder === 'last'}
19957
- function create_if_block$l(ctx) {
19974
+ function create_if_block$m(ctx) {
19958
19975
  let label_1;
19959
19976
  let current;
19960
19977
 
@@ -20036,9 +20053,9 @@ function create_fragment$I(ctx) {
20036
20053
  let if_block2 = /*type*/ ctx[11] === 'email' && create_if_block_5$2(ctx);
20037
20054
  let if_block3 = /*type*/ ctx[11] === 'number' && create_if_block_4$5(ctx);
20038
20055
  let if_block4 = /*type*/ ctx[11] === 'password' && create_if_block_3$8(ctx);
20039
- let if_block5 = /*type*/ ctx[11] === 'phone' && create_if_block_2$9(ctx);
20040
- let if_block6 = /*type*/ ctx[11] === 'text' && create_if_block_1$b(ctx);
20041
- let if_block7 = /*labelOrder*/ ctx[6] === 'last' && create_if_block$l(ctx);
20056
+ let if_block5 = /*type*/ ctx[11] === 'phone' && create_if_block_2$a(ctx);
20057
+ let if_block6 = /*type*/ ctx[11] === 'text' && create_if_block_1$d(ctx);
20058
+ let if_block7 = /*labelOrder*/ ctx[6] === 'last' && create_if_block$m(ctx);
20042
20059
 
20043
20060
  return {
20044
20061
  c() {
@@ -20158,7 +20175,7 @@ function create_fragment$I(ctx) {
20158
20175
  if (if_block5) {
20159
20176
  if_block5.p(ctx, dirty);
20160
20177
  } else {
20161
- if_block5 = create_if_block_2$9(ctx);
20178
+ if_block5 = create_if_block_2$a(ctx);
20162
20179
  if_block5.c();
20163
20180
  if_block5.m(t5.parentNode, t5);
20164
20181
  }
@@ -20171,7 +20188,7 @@ function create_fragment$I(ctx) {
20171
20188
  if (if_block6) {
20172
20189
  if_block6.p(ctx, dirty);
20173
20190
  } else {
20174
- if_block6 = create_if_block_1$b(ctx);
20191
+ if_block6 = create_if_block_1$d(ctx);
20175
20192
  if_block6.c();
20176
20193
  if_block6.m(t6.parentNode, t6);
20177
20194
  }
@@ -20188,7 +20205,7 @@ function create_fragment$I(ctx) {
20188
20205
  transition_in(if_block7, 1);
20189
20206
  }
20190
20207
  } else {
20191
- if_block7 = create_if_block$l(ctx);
20208
+ if_block7 = create_if_block$m(ctx);
20192
20209
  if_block7.c();
20193
20210
  transition_in(if_block7, 1);
20194
20211
  if_block7.m(if_block7_anchor.parentNode, if_block7_anchor);
@@ -21047,7 +21064,7 @@ class Lock_icon extends SvelteComponent {
21047
21064
 
21048
21065
  /* src/lib/journey/callbacks/kba/kba-create.svelte generated by Svelte v3.59.2 */
21049
21066
 
21050
- function create_if_block$k(ctx) {
21067
+ function create_if_block$l(ctx) {
21051
21068
  let input;
21052
21069
  let current;
21053
21070
 
@@ -21128,7 +21145,7 @@ function create_fragment$E(ctx) {
21128
21145
  }
21129
21146
  });
21130
21147
 
21131
- let if_block = /*displayCustomQuestionInput*/ ctx[3] && create_if_block$k(ctx);
21148
+ let if_block = /*displayCustomQuestionInput*/ ctx[3] && create_if_block$l(ctx);
21132
21149
 
21133
21150
  function input_value_binding(value) {
21134
21151
  /*input_value_binding*/ ctx[21](value);
@@ -21207,7 +21224,7 @@ function create_fragment$E(ctx) {
21207
21224
  transition_in(if_block, 1);
21208
21225
  }
21209
21226
  } else {
21210
- if_block = create_if_block$k(ctx);
21227
+ if_block = create_if_block$l(ctx);
21211
21228
  if_block.c();
21212
21229
  transition_in(if_block, 1);
21213
21230
  if_block.m(fieldset, t6);
@@ -21693,7 +21710,7 @@ function create_else_block$7(ctx) {
21693
21710
  }
21694
21711
 
21695
21712
  // (6:0) {#if !visible}
21696
- function create_if_block$j(ctx) {
21713
+ function create_if_block$k(ctx) {
21697
21714
  let svg;
21698
21715
  let path0;
21699
21716
  let path1;
@@ -21779,7 +21796,7 @@ function create_fragment$C(ctx) {
21779
21796
  let if_block;
21780
21797
  let if_block_anchor;
21781
21798
  let current;
21782
- const if_block_creators = [create_if_block$j, create_else_block$7];
21799
+ const if_block_creators = [create_if_block$k, create_else_block$7];
21783
21800
  const if_blocks = [];
21784
21801
 
21785
21802
  function select_block_type(ctx, dirty) {
@@ -21868,10 +21885,10 @@ class Eye_icon extends SvelteComponent {
21868
21885
 
21869
21886
  /* src/lib/journey/callbacks/password/confirm-input.svelte generated by Svelte v3.59.2 */
21870
21887
 
21871
- function create_default_slot_1$e(ctx) {
21888
+ function create_default_slot_2$7(ctx) {
21872
21889
  let current;
21873
- const default_slot_template = /*#slots*/ ctx[15].default;
21874
- const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[16], null);
21890
+ const default_slot_template = /*#slots*/ ctx[17].default;
21891
+ const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[18], null);
21875
21892
 
21876
21893
  return {
21877
21894
  c() {
@@ -21886,15 +21903,15 @@ function create_default_slot_1$e(ctx) {
21886
21903
  },
21887
21904
  p(ctx, dirty) {
21888
21905
  if (default_slot) {
21889
- if (default_slot.p && (!current || dirty & /*$$scope*/ 65536)) {
21906
+ if (default_slot.p && (!current || dirty & /*$$scope*/ 262144)) {
21890
21907
  update_slot_base(
21891
21908
  default_slot,
21892
21909
  default_slot_template,
21893
21910
  ctx,
21894
- /*$$scope*/ ctx[16],
21911
+ /*$$scope*/ ctx[18],
21895
21912
  !current
21896
- ? get_all_dirty_from_scope(/*$$scope*/ ctx[16])
21897
- : get_slot_changes(default_slot_template, /*$$scope*/ ctx[16], dirty, null),
21913
+ ? get_all_dirty_from_scope(/*$$scope*/ ctx[18])
21914
+ : get_slot_changes(default_slot_template, /*$$scope*/ ctx[18], dirty, null),
21898
21915
  null
21899
21916
  );
21900
21917
  }
@@ -21915,8 +21932,70 @@ function create_default_slot_1$e(ctx) {
21915
21932
  };
21916
21933
  }
21917
21934
 
21918
- // (69:4) <EyeIcon classes="tw_password-icon dark:tw_password-icon_dark" visible={isVisible}>
21919
- function create_default_slot$k(ctx) {
21935
+ // (66:6) {#if showPassword === "button"}
21936
+ function create_if_block_1$c(ctx) {
21937
+ let button;
21938
+ let eyeicon;
21939
+ let current;
21940
+ let mounted;
21941
+ let dispose;
21942
+
21943
+ eyeicon = new Eye_icon({
21944
+ props: {
21945
+ classes: "tw_password-icon dark:tw_password-icon_dark",
21946
+ visible: /*isVisible*/ ctx[8],
21947
+ $$slots: { default: [create_default_slot_1$e] },
21948
+ $$scope: { ctx }
21949
+ }
21950
+ });
21951
+
21952
+ return {
21953
+ c() {
21954
+ button = element("button");
21955
+ create_component(eyeicon.$$.fragment);
21956
+ attr(button, "class", `tw_password-button dark:tw_password-button_dark tw_focusable-element tw_input-base dark:tw_input-base_dark`);
21957
+ attr(button, "type", "button");
21958
+ },
21959
+ m(target, anchor) {
21960
+ insert(target, button, anchor);
21961
+ mount_component(eyeicon, button, null);
21962
+ current = true;
21963
+
21964
+ if (!mounted) {
21965
+ dispose = listen(button, "click", /*toggleVisibility*/ ctx[14]);
21966
+ mounted = true;
21967
+ }
21968
+ },
21969
+ p(ctx, dirty) {
21970
+ const eyeicon_changes = {};
21971
+ if (dirty & /*isVisible*/ 256) eyeicon_changes.visible = /*isVisible*/ ctx[8];
21972
+
21973
+ if (dirty & /*$$scope*/ 262144) {
21974
+ eyeicon_changes.$$scope = { dirty, ctx };
21975
+ }
21976
+
21977
+ eyeicon.$set(eyeicon_changes);
21978
+ },
21979
+ i(local) {
21980
+ if (current) return;
21981
+ transition_in(eyeicon.$$.fragment, local);
21982
+ current = true;
21983
+ },
21984
+ o(local) {
21985
+ transition_out(eyeicon.$$.fragment, local);
21986
+ current = false;
21987
+ },
21988
+ d(detaching) {
21989
+ if (detaching) detach(button);
21990
+ destroy_component(eyeicon);
21991
+ mounted = false;
21992
+ dispose();
21993
+ }
21994
+ };
21995
+ }
21996
+
21997
+ // (72:10) <EyeIcon classes="tw_password-icon dark:tw_password-icon_dark" visible={isVisible}>
21998
+ function create_default_slot_1$e(ctx) {
21920
21999
  let t;
21921
22000
  let current;
21922
22001
  t = new Locale_strings({ props: { key: "showPassword" } });
@@ -21945,18 +22024,54 @@ function create_default_slot$k(ctx) {
21945
22024
  };
21946
22025
  }
21947
22026
 
21948
- // (63:2)
22027
+ // (65:1) <svelte:fragment slot="input-button">
21949
22028
  function create_input_button_slot$1(ctx) {
21950
- let button;
21951
- let eyeicon;
22029
+ let if_block_anchor;
21952
22030
  let current;
21953
- let mounted;
21954
- let dispose;
22031
+ let if_block = /*showPassword*/ ctx[12] === "button" && create_if_block_1$c(ctx);
21955
22032
 
21956
- eyeicon = new Eye_icon({
22033
+ return {
22034
+ c() {
22035
+ if (if_block) if_block.c();
22036
+ if_block_anchor = empty();
22037
+ },
22038
+ m(target, anchor) {
22039
+ if (if_block) if_block.m(target, anchor);
22040
+ insert(target, if_block_anchor, anchor);
22041
+ current = true;
22042
+ },
22043
+ p(ctx, dirty) {
22044
+ if (/*showPassword*/ ctx[12] === "button") if_block.p(ctx, dirty);
22045
+ },
22046
+ i(local) {
22047
+ if (current) return;
22048
+ transition_in(if_block);
22049
+ current = true;
22050
+ },
22051
+ o(local) {
22052
+ transition_out(if_block);
22053
+ current = false;
22054
+ },
22055
+ d(detaching) {
22056
+ if (if_block) if_block.d(detaching);
22057
+ if (detaching) detach(if_block_anchor);
22058
+ }
22059
+ };
22060
+ }
22061
+
22062
+ // (80:0) {#if showPassword === "checkbox"}
22063
+ function create_if_block$j(ctx) {
22064
+ let div;
22065
+ let checkbox;
22066
+ let current;
22067
+
22068
+ checkbox = new Checkbox({
21957
22069
  props: {
21958
- classes: "tw_password-icon dark:tw_password-icon_dark",
21959
- visible: /*isVisible*/ ctx[6],
22070
+ isFirstInvalidInput: /*isFirstInvalidInput*/ ctx[5],
22071
+ isInvalid: false,
22072
+ key: /*key*/ ctx[3] + /*style*/ ctx[4].showPassword,
22073
+ onChange: /*toggleVisibility*/ ctx[14],
22074
+ value: false,
21960
22075
  $$slots: { default: [create_default_slot$k] },
21961
22076
  $$scope: { ctx }
21962
22077
  }
@@ -21964,117 +22079,149 @@ function create_input_button_slot$1(ctx) {
21964
22079
 
21965
22080
  return {
21966
22081
  c() {
21967
- button = element("button");
21968
- create_component(eyeicon.$$.fragment);
21969
- attr(button, "class", `tw_password-button dark:tw_password-button_dark tw_focusable-element tw_input-base dark:tw_input-base_dark`);
21970
- attr(button, "slot", "input-button");
21971
- attr(button, "type", "button");
22082
+ div = element("div");
22083
+ create_component(checkbox.$$.fragment);
22084
+ attr(div, "class", "tw_w-full tw_input-spacing");
21972
22085
  },
21973
22086
  m(target, anchor) {
21974
- insert(target, button, anchor);
21975
- mount_component(eyeicon, button, null);
22087
+ insert(target, div, anchor);
22088
+ mount_component(checkbox, div, null);
21976
22089
  current = true;
21977
-
21978
- if (!mounted) {
21979
- dispose = listen(button, "click", /*toggleVisibility*/ ctx[11]);
21980
- mounted = true;
21981
- }
21982
22090
  },
21983
22091
  p(ctx, dirty) {
21984
- const eyeicon_changes = {};
21985
- if (dirty & /*isVisible*/ 64) eyeicon_changes.visible = /*isVisible*/ ctx[6];
22092
+ const checkbox_changes = {};
22093
+ if (dirty & /*isFirstInvalidInput*/ 32) checkbox_changes.isFirstInvalidInput = /*isFirstInvalidInput*/ ctx[5];
22094
+ if (dirty & /*key, style*/ 24) checkbox_changes.key = /*key*/ ctx[3] + /*style*/ ctx[4].showPassword;
21986
22095
 
21987
- if (dirty & /*$$scope*/ 65536) {
21988
- eyeicon_changes.$$scope = { dirty, ctx };
22096
+ if (dirty & /*$$scope*/ 262144) {
22097
+ checkbox_changes.$$scope = { dirty, ctx };
21989
22098
  }
21990
22099
 
21991
- eyeicon.$set(eyeicon_changes);
22100
+ checkbox.$set(checkbox_changes);
21992
22101
  },
21993
22102
  i(local) {
21994
22103
  if (current) return;
21995
- transition_in(eyeicon.$$.fragment, local);
22104
+ transition_in(checkbox.$$.fragment, local);
21996
22105
  current = true;
21997
22106
  },
21998
22107
  o(local) {
21999
- transition_out(eyeicon.$$.fragment, local);
22108
+ transition_out(checkbox.$$.fragment, local);
22000
22109
  current = false;
22001
22110
  },
22002
22111
  d(detaching) {
22003
- if (detaching) detach(button);
22004
- destroy_component(eyeicon);
22005
- mounted = false;
22006
- dispose();
22112
+ if (detaching) detach(div);
22113
+ destroy_component(checkbox);
22114
+ }
22115
+ };
22116
+ }
22117
+
22118
+ // (82:6) <Checkbox {isFirstInvalidInput} isInvalid={false} key = {key + style.showPassword} onChange={toggleVisibility} value={false} >
22119
+ function create_default_slot$k(ctx) {
22120
+ let t;
22121
+
22122
+ return {
22123
+ c() {
22124
+ t = text("Show Password");
22125
+ },
22126
+ m(target, anchor) {
22127
+ insert(target, t, anchor);
22128
+ },
22129
+ d(detaching) {
22130
+ if (detaching) detach(t);
22007
22131
  }
22008
22132
  };
22009
22133
  }
22010
22134
 
22011
22135
  function create_fragment$B(ctx) {
22012
22136
  let input;
22137
+ let t;
22138
+ let if_block_anchor;
22013
22139
  let current;
22014
22140
 
22015
- input = new /*Input*/ ctx[9]({
22141
+ input = new /*Input*/ ctx[11]({
22016
22142
  props: {
22017
22143
  forceValidityFailure: /*forceValidityFailure*/ ctx[0],
22018
22144
  isFirstInvalidInput: false,
22019
- hasRightIcon: true,
22145
+ hasRightIcon: /*style*/ ctx[4].showPassword === 'button'
22146
+ ? true
22147
+ : false,
22020
22148
  key: `${/*key*/ ctx[3]}-confirm`,
22021
22149
  label: interpolate('confirmPassword', null, 'Confirm Password'),
22022
- message: /*message*/ ctx[8],
22023
- onChange: /*onChangeWrapper*/ ctx[10],
22150
+ message: /*message*/ ctx[10],
22151
+ onChange: /*onChangeWrapper*/ ctx[13],
22024
22152
  isInvalid: /*passwordsDoNotMatch*/ ctx[1],
22025
22153
  isRequired: /*isRequired*/ ctx[2],
22026
- showMessage: /*showMessage*/ ctx[4],
22027
- type: /*type*/ ctx[7],
22028
- value: typeof /*value*/ ctx[5] === 'string'
22029
- ? /*value*/ ctx[5]
22154
+ showMessage: /*showMessage*/ ctx[6],
22155
+ type: /*type*/ ctx[9],
22156
+ value: typeof /*value*/ ctx[7] === 'string'
22157
+ ? /*value*/ ctx[7]
22030
22158
  : '',
22031
22159
  $$slots: {
22032
22160
  "input-button": [create_input_button_slot$1],
22033
- default: [create_default_slot_1$e]
22161
+ default: [create_default_slot_2$7]
22034
22162
  },
22035
22163
  $$scope: { ctx }
22036
22164
  }
22037
22165
  });
22038
22166
 
22167
+ let if_block = /*showPassword*/ ctx[12] === "checkbox" && create_if_block$j(ctx);
22168
+
22039
22169
  return {
22040
22170
  c() {
22041
22171
  create_component(input.$$.fragment);
22172
+ t = space();
22173
+ if (if_block) if_block.c();
22174
+ if_block_anchor = empty();
22042
22175
  },
22043
22176
  m(target, anchor) {
22044
22177
  mount_component(input, target, anchor);
22178
+ insert(target, t, anchor);
22179
+ if (if_block) if_block.m(target, anchor);
22180
+ insert(target, if_block_anchor, anchor);
22045
22181
  current = true;
22046
22182
  },
22047
22183
  p(ctx, [dirty]) {
22048
22184
  const input_changes = {};
22049
22185
  if (dirty & /*forceValidityFailure*/ 1) input_changes.forceValidityFailure = /*forceValidityFailure*/ ctx[0];
22186
+
22187
+ if (dirty & /*style*/ 16) input_changes.hasRightIcon = /*style*/ ctx[4].showPassword === 'button'
22188
+ ? true
22189
+ : false;
22190
+
22050
22191
  if (dirty & /*key*/ 8) input_changes.key = `${/*key*/ ctx[3]}-confirm`;
22051
- if (dirty & /*message*/ 256) input_changes.message = /*message*/ ctx[8];
22192
+ if (dirty & /*message*/ 1024) input_changes.message = /*message*/ ctx[10];
22052
22193
  if (dirty & /*passwordsDoNotMatch*/ 2) input_changes.isInvalid = /*passwordsDoNotMatch*/ ctx[1];
22053
22194
  if (dirty & /*isRequired*/ 4) input_changes.isRequired = /*isRequired*/ ctx[2];
22054
- if (dirty & /*showMessage*/ 16) input_changes.showMessage = /*showMessage*/ ctx[4];
22055
- if (dirty & /*type*/ 128) input_changes.type = /*type*/ ctx[7];
22195
+ if (dirty & /*showMessage*/ 64) input_changes.showMessage = /*showMessage*/ ctx[6];
22196
+ if (dirty & /*type*/ 512) input_changes.type = /*type*/ ctx[9];
22056
22197
 
22057
- if (dirty & /*value*/ 32) input_changes.value = typeof /*value*/ ctx[5] === 'string'
22058
- ? /*value*/ ctx[5]
22198
+ if (dirty & /*value*/ 128) input_changes.value = typeof /*value*/ ctx[7] === 'string'
22199
+ ? /*value*/ ctx[7]
22059
22200
  : '';
22060
22201
 
22061
- if (dirty & /*$$scope, isVisible*/ 65600) {
22202
+ if (dirty & /*$$scope, isVisible*/ 262400) {
22062
22203
  input_changes.$$scope = { dirty, ctx };
22063
22204
  }
22064
22205
 
22065
22206
  input.$set(input_changes);
22207
+ if (/*showPassword*/ ctx[12] === "checkbox") if_block.p(ctx, dirty);
22066
22208
  },
22067
22209
  i(local) {
22068
22210
  if (current) return;
22069
22211
  transition_in(input.$$.fragment, local);
22212
+ transition_in(if_block);
22070
22213
  current = true;
22071
22214
  },
22072
22215
  o(local) {
22073
22216
  transition_out(input.$$.fragment, local);
22217
+ transition_out(if_block);
22074
22218
  current = false;
22075
22219
  },
22076
22220
  d(detaching) {
22077
22221
  destroy_component(input, detaching);
22222
+ if (detaching) detach(t);
22223
+ if (if_block) if_block.d(detaching);
22224
+ if (detaching) detach(if_block_anchor);
22078
22225
  }
22079
22226
  };
22080
22227
  }
@@ -22088,7 +22235,9 @@ function instance$C($$self, $$props, $$invalidate) {
22088
22235
  let { onChange } = $$props;
22089
22236
  let { resetValue } = $$props;
22090
22237
  let { style = {} } = $$props;
22238
+ let { isFirstInvalidInput } = $$props;
22091
22239
  const Input = style.labels === 'stacked' ? Stacked_label : Floating_label;
22240
+ const showPassword = style.showPassword;
22092
22241
  let { showMessage = undefined } = $$props;
22093
22242
  let isVisible = false;
22094
22243
  let type = 'password';
@@ -22096,7 +22245,7 @@ function instance$C($$self, $$props, $$invalidate) {
22096
22245
  let message = '';
22097
22246
 
22098
22247
  function onChangeWrapper(event) {
22099
- $$invalidate(5, value = event.target?.value);
22248
+ $$invalidate(7, value = event.target?.value);
22100
22249
 
22101
22250
  // TODO: revisit this logic to avoid unnecessary ternary
22102
22251
  onChange(typeof value === 'string' ? value : undefined);
@@ -22106,8 +22255,8 @@ function instance$C($$self, $$props, $$invalidate) {
22106
22255
  * @function toggleVisibility - toggles the password from masked to plaintext
22107
22256
  */
22108
22257
  function toggleVisibility() {
22109
- $$invalidate(6, isVisible = !isVisible);
22110
- $$invalidate(7, type = isVisible ? 'text' : 'password');
22258
+ $$invalidate(8, isVisible = !isVisible);
22259
+ $$invalidate(9, type = isVisible ? 'text' : 'password');
22111
22260
  }
22112
22261
 
22113
22262
  $$self.$$set = $$props => {
@@ -22115,27 +22264,28 @@ function instance$C($$self, $$props, $$invalidate) {
22115
22264
  if ('passwordsDoNotMatch' in $$props) $$invalidate(1, passwordsDoNotMatch = $$props.passwordsDoNotMatch);
22116
22265
  if ('isRequired' in $$props) $$invalidate(2, isRequired = $$props.isRequired);
22117
22266
  if ('key' in $$props) $$invalidate(3, key = $$props.key);
22118
- if ('onChange' in $$props) $$invalidate(12, onChange = $$props.onChange);
22119
- if ('resetValue' in $$props) $$invalidate(13, resetValue = $$props.resetValue);
22120
- if ('style' in $$props) $$invalidate(14, style = $$props.style);
22121
- if ('showMessage' in $$props) $$invalidate(4, showMessage = $$props.showMessage);
22122
- if ('$$scope' in $$props) $$invalidate(16, $$scope = $$props.$$scope);
22267
+ if ('onChange' in $$props) $$invalidate(15, onChange = $$props.onChange);
22268
+ if ('resetValue' in $$props) $$invalidate(16, resetValue = $$props.resetValue);
22269
+ if ('style' in $$props) $$invalidate(4, style = $$props.style);
22270
+ if ('isFirstInvalidInput' in $$props) $$invalidate(5, isFirstInvalidInput = $$props.isFirstInvalidInput);
22271
+ if ('showMessage' in $$props) $$invalidate(6, showMessage = $$props.showMessage);
22272
+ if ('$$scope' in $$props) $$invalidate(18, $$scope = $$props.$$scope);
22123
22273
  };
22124
22274
 
22125
22275
  $$self.$$.update = () => {
22126
- if ($$self.$$.dirty & /*resetValue, onChange, value, passwordsDoNotMatch, isRequired*/ 12326) {
22276
+ if ($$self.$$.dirty & /*resetValue, onChange, value, passwordsDoNotMatch, isRequired*/ 98438) {
22127
22277
  {
22128
22278
  if (resetValue) {
22129
- $$invalidate(5, value = undefined);
22279
+ $$invalidate(7, value = undefined);
22130
22280
  onChange(value);
22131
22281
  }
22132
22282
 
22133
22283
  if (passwordsDoNotMatch) {
22134
- $$invalidate(8, message = interpolate('passwordConfirmationError', null, 'Passwords do not match'));
22284
+ $$invalidate(10, message = interpolate('passwordConfirmationError', null, 'Passwords do not match'));
22135
22285
  } else if (isRequired) {
22136
- $$invalidate(8, message = interpolate('requiredField', null, 'This field is required'));
22286
+ $$invalidate(10, message = interpolate('requiredField', null, 'This field is required'));
22137
22287
  } else {
22138
- $$invalidate(8, message = '');
22288
+ $$invalidate(10, message = '');
22139
22289
  }
22140
22290
  }
22141
22291
  }
@@ -22146,17 +22296,19 @@ function instance$C($$self, $$props, $$invalidate) {
22146
22296
  passwordsDoNotMatch,
22147
22297
  isRequired,
22148
22298
  key,
22299
+ style,
22300
+ isFirstInvalidInput,
22149
22301
  showMessage,
22150
22302
  value,
22151
22303
  isVisible,
22152
22304
  type,
22153
22305
  message,
22154
22306
  Input,
22307
+ showPassword,
22155
22308
  onChangeWrapper,
22156
22309
  toggleVisibility,
22157
22310
  onChange,
22158
22311
  resetValue,
22159
- style,
22160
22312
  slots,
22161
22313
  $$scope
22162
22314
  ];
@@ -22171,20 +22323,21 @@ class Confirm_input extends SvelteComponent {
22171
22323
  passwordsDoNotMatch: 1,
22172
22324
  isRequired: 2,
22173
22325
  key: 3,
22174
- onChange: 12,
22175
- resetValue: 13,
22176
- style: 14,
22177
- showMessage: 4
22326
+ onChange: 15,
22327
+ resetValue: 16,
22328
+ style: 4,
22329
+ isFirstInvalidInput: 5,
22330
+ showMessage: 6
22178
22331
  });
22179
22332
  }
22180
22333
  }
22181
22334
 
22182
22335
  /* src/lib/journey/callbacks/password/base.svelte generated by Svelte v3.59.2 */
22183
22336
 
22184
- function create_default_slot_1$d(ctx) {
22337
+ function create_default_slot_2$6(ctx) {
22185
22338
  let current;
22186
- const default_slot_template = /*#slots*/ ctx[21].default;
22187
- const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[22], null);
22339
+ const default_slot_template = /*#slots*/ ctx[22].default;
22340
+ const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[23], null);
22188
22341
 
22189
22342
  return {
22190
22343
  c() {
@@ -22199,15 +22352,15 @@ function create_default_slot_1$d(ctx) {
22199
22352
  },
22200
22353
  p(ctx, dirty) {
22201
22354
  if (default_slot) {
22202
- if (default_slot.p && (!current || dirty & /*$$scope*/ 4194304)) {
22355
+ if (default_slot.p && (!current || dirty & /*$$scope*/ 8388608)) {
22203
22356
  update_slot_base(
22204
22357
  default_slot,
22205
22358
  default_slot_template,
22206
22359
  ctx,
22207
- /*$$scope*/ ctx[22],
22360
+ /*$$scope*/ ctx[23],
22208
22361
  !current
22209
- ? get_all_dirty_from_scope(/*$$scope*/ ctx[22])
22210
- : get_slot_changes(default_slot_template, /*$$scope*/ ctx[22], dirty, null),
22362
+ ? get_all_dirty_from_scope(/*$$scope*/ ctx[23])
22363
+ : get_slot_changes(default_slot_template, /*$$scope*/ ctx[23], dirty, null),
22211
22364
  null
22212
22365
  );
22213
22366
  }
@@ -22228,15 +22381,77 @@ function create_default_slot_1$d(ctx) {
22228
22381
  };
22229
22382
  }
22230
22383
 
22231
- // (95:6) <EyeIcon classes="tw_password-icon dark:tw_password-icon_dark" visible={isVisible}>
22232
- function create_default_slot$j(ctx) {
22233
- let t;
22384
+ // (92:6) {#if showPassword === "button"}
22385
+ function create_if_block_2$9(ctx) {
22386
+ let button;
22387
+ let eyeicon;
22234
22388
  let current;
22235
- t = new Locale_strings({ props: { key: "showPassword" } });
22389
+ let mounted;
22390
+ let dispose;
22391
+
22392
+ eyeicon = new Eye_icon({
22393
+ props: {
22394
+ classes: "tw_password-icon dark:tw_password-icon_dark",
22395
+ visible: /*isVisible*/ ctx[11],
22396
+ $$slots: { default: [create_default_slot_1$d] },
22397
+ $$scope: { ctx }
22398
+ }
22399
+ });
22236
22400
 
22237
22401
  return {
22238
22402
  c() {
22239
- create_component(t.$$.fragment);
22403
+ button = element("button");
22404
+ create_component(eyeicon.$$.fragment);
22405
+ attr(button, "class", `tw_password-button dark:tw_password-button_dark tw_focusable-element tw_input-base dark:tw_input-base_dark`);
22406
+ attr(button, "type", "button");
22407
+ },
22408
+ m(target, anchor) {
22409
+ insert(target, button, anchor);
22410
+ mount_component(eyeicon, button, null);
22411
+ current = true;
22412
+
22413
+ if (!mounted) {
22414
+ dispose = listen(button, "click", /*toggleVisibility*/ ctx[19]);
22415
+ mounted = true;
22416
+ }
22417
+ },
22418
+ p(ctx, dirty) {
22419
+ const eyeicon_changes = {};
22420
+ if (dirty & /*isVisible*/ 2048) eyeicon_changes.visible = /*isVisible*/ ctx[11];
22421
+
22422
+ if (dirty & /*$$scope*/ 8388608) {
22423
+ eyeicon_changes.$$scope = { dirty, ctx };
22424
+ }
22425
+
22426
+ eyeicon.$set(eyeicon_changes);
22427
+ },
22428
+ i(local) {
22429
+ if (current) return;
22430
+ transition_in(eyeicon.$$.fragment, local);
22431
+ current = true;
22432
+ },
22433
+ o(local) {
22434
+ transition_out(eyeicon.$$.fragment, local);
22435
+ current = false;
22436
+ },
22437
+ d(detaching) {
22438
+ if (detaching) detach(button);
22439
+ destroy_component(eyeicon);
22440
+ mounted = false;
22441
+ dispose();
22442
+ }
22443
+ };
22444
+ }
22445
+
22446
+ // (98:10) <EyeIcon classes="tw_password-icon dark:tw_password-icon_dark" visible={isVisible}>
22447
+ function create_default_slot_1$d(ctx) {
22448
+ let t;
22449
+ let current;
22450
+ t = new Locale_strings({ props: { key: "showPassword" } });
22451
+
22452
+ return {
22453
+ c() {
22454
+ create_component(t.$$.fragment);
22240
22455
  },
22241
22456
  m(target, anchor) {
22242
22457
  mount_component(t, target, anchor);
@@ -22258,18 +22473,54 @@ function create_default_slot$j(ctx) {
22258
22473
  };
22259
22474
  }
22260
22475
 
22261
- // (89:4)
22476
+ // (91:4) <svelte:fragment slot="input-button">
22262
22477
  function create_input_button_slot(ctx) {
22263
- let button;
22264
- let eyeicon;
22478
+ let if_block_anchor;
22265
22479
  let current;
22266
- let mounted;
22267
- let dispose;
22480
+ let if_block = /*showPassword*/ ctx[16] === "button" && create_if_block_2$9(ctx);
22268
22481
 
22269
- eyeicon = new Eye_icon({
22482
+ return {
22483
+ c() {
22484
+ if (if_block) if_block.c();
22485
+ if_block_anchor = empty();
22486
+ },
22487
+ m(target, anchor) {
22488
+ if (if_block) if_block.m(target, anchor);
22489
+ insert(target, if_block_anchor, anchor);
22490
+ current = true;
22491
+ },
22492
+ p(ctx, dirty) {
22493
+ if (/*showPassword*/ ctx[16] === "button") if_block.p(ctx, dirty);
22494
+ },
22495
+ i(local) {
22496
+ if (current) return;
22497
+ transition_in(if_block);
22498
+ current = true;
22499
+ },
22500
+ o(local) {
22501
+ transition_out(if_block);
22502
+ current = false;
22503
+ },
22504
+ d(detaching) {
22505
+ if (if_block) if_block.d(detaching);
22506
+ if (detaching) detach(if_block_anchor);
22507
+ }
22508
+ };
22509
+ }
22510
+
22511
+ // (107:2) {#if showPassword === "checkbox"}
22512
+ function create_if_block_1$b(ctx) {
22513
+ let div;
22514
+ let checkbox;
22515
+ let current;
22516
+
22517
+ checkbox = new Checkbox({
22270
22518
  props: {
22271
- classes: "tw_password-icon dark:tw_password-icon_dark",
22272
- visible: /*isVisible*/ ctx[11],
22519
+ isFirstInvalidInput: /*callbackMetadata*/ ctx[2]?.derived.isFirstInvalidInput || false,
22520
+ isInvalid: false,
22521
+ key: /*key*/ ctx[0] + /*style*/ ctx[5].showPassword,
22522
+ onChange: /*toggleVisibility*/ ctx[19],
22523
+ value: false,
22273
22524
  $$slots: { default: [create_default_slot$j] },
22274
22525
  $$scope: { ctx }
22275
22526
  }
@@ -22277,51 +22528,60 @@ function create_input_button_slot(ctx) {
22277
22528
 
22278
22529
  return {
22279
22530
  c() {
22280
- button = element("button");
22281
- create_component(eyeicon.$$.fragment);
22282
- attr(button, "class", `tw_password-button dark:tw_password-button_dark tw_focusable-element tw_input-base dark:tw_input-base_dark`);
22283
- attr(button, "slot", "input-button");
22284
- attr(button, "type", "button");
22531
+ div = element("div");
22532
+ create_component(checkbox.$$.fragment);
22533
+ attr(div, "class", "tw_w-full tw_input-spacing");
22285
22534
  },
22286
22535
  m(target, anchor) {
22287
- insert(target, button, anchor);
22288
- mount_component(eyeicon, button, null);
22536
+ insert(target, div, anchor);
22537
+ mount_component(checkbox, div, null);
22289
22538
  current = true;
22290
-
22291
- if (!mounted) {
22292
- dispose = listen(button, "click", /*toggleVisibility*/ ctx[18]);
22293
- mounted = true;
22294
- }
22295
22539
  },
22296
22540
  p(ctx, dirty) {
22297
- const eyeicon_changes = {};
22298
- if (dirty & /*isVisible*/ 2048) eyeicon_changes.visible = /*isVisible*/ ctx[11];
22541
+ const checkbox_changes = {};
22542
+ if (dirty & /*callbackMetadata*/ 4) checkbox_changes.isFirstInvalidInput = /*callbackMetadata*/ ctx[2]?.derived.isFirstInvalidInput || false;
22543
+ if (dirty & /*key, style*/ 33) checkbox_changes.key = /*key*/ ctx[0] + /*style*/ ctx[5].showPassword;
22299
22544
 
22300
- if (dirty & /*$$scope*/ 4194304) {
22301
- eyeicon_changes.$$scope = { dirty, ctx };
22545
+ if (dirty & /*$$scope*/ 8388608) {
22546
+ checkbox_changes.$$scope = { dirty, ctx };
22302
22547
  }
22303
22548
 
22304
- eyeicon.$set(eyeicon_changes);
22549
+ checkbox.$set(checkbox_changes);
22305
22550
  },
22306
22551
  i(local) {
22307
22552
  if (current) return;
22308
- transition_in(eyeicon.$$.fragment, local);
22553
+ transition_in(checkbox.$$.fragment, local);
22309
22554
  current = true;
22310
22555
  },
22311
22556
  o(local) {
22312
- transition_out(eyeicon.$$.fragment, local);
22557
+ transition_out(checkbox.$$.fragment, local);
22313
22558
  current = false;
22314
22559
  },
22315
22560
  d(detaching) {
22316
- if (detaching) detach(button);
22317
- destroy_component(eyeicon);
22318
- mounted = false;
22319
- dispose();
22561
+ if (detaching) detach(div);
22562
+ destroy_component(checkbox);
22320
22563
  }
22321
22564
  };
22322
22565
  }
22323
22566
 
22324
- // (102:2) {#if callbackMetadata?.platform?.confirmPassword}
22567
+ // (109:6) <Checkbox isFirstInvalidInput={callbackMetadata?.derived.isFirstInvalidInput || false} isInvalid={false} key = {key + style.showPassword} onChange={toggleVisibility} value={false} >
22568
+ function create_default_slot$j(ctx) {
22569
+ let t;
22570
+
22571
+ return {
22572
+ c() {
22573
+ t = text("Show Password");
22574
+ },
22575
+ m(target, anchor) {
22576
+ insert(target, t, anchor);
22577
+ },
22578
+ d(detaching) {
22579
+ if (detaching) detach(t);
22580
+ }
22581
+ };
22582
+ }
22583
+
22584
+ // (119:2) {#if callbackMetadata?.platform?.confirmPassword}
22325
22585
  function create_if_block$i(ctx) {
22326
22586
  let confirminput;
22327
22587
  let current;
@@ -22332,10 +22592,11 @@ function create_if_block$i(ctx) {
22332
22592
  passwordsDoNotMatch: /*doPasswordsMatch*/ ctx[10] === false,
22333
22593
  key: /*key*/ ctx[0],
22334
22594
  isRequired: /*value*/ ctx[8].length > 0,
22335
- onChange: /*confirmInput*/ ctx[16],
22595
+ onChange: /*confirmInput*/ ctx[17],
22336
22596
  resetValue: /*resetValue*/ ctx[12],
22337
22597
  showMessage: /*doPasswordsMatch*/ ctx[10] === false,
22338
- style: /*style*/ ctx[5]
22598
+ style: /*style*/ ctx[5],
22599
+ isFirstInvalidInput: /*callbackMetadata*/ ctx[2]?.derived.isFirstInvalidInput || false
22339
22600
  }
22340
22601
  });
22341
22602
 
@@ -22356,6 +22617,7 @@ function create_if_block$i(ctx) {
22356
22617
  if (dirty & /*resetValue*/ 4096) confirminput_changes.resetValue = /*resetValue*/ ctx[12];
22357
22618
  if (dirty & /*doPasswordsMatch*/ 1024) confirminput_changes.showMessage = /*doPasswordsMatch*/ ctx[10] === false;
22358
22619
  if (dirty & /*style*/ 32) confirminput_changes.style = /*style*/ ctx[5];
22620
+ if (dirty & /*callbackMetadata*/ 4) confirminput_changes.isFirstInvalidInput = /*callbackMetadata*/ ctx[2]?.derived.isFirstInvalidInput || false;
22359
22621
  confirminput.$set(confirminput_changes);
22360
22622
  },
22361
22623
  i(local) {
@@ -22373,23 +22635,26 @@ function create_if_block$i(ctx) {
22373
22635
  };
22374
22636
  }
22375
22637
 
22376
- // (75:0) {#key callback}
22638
+ // (77:0) {#key callback}
22377
22639
  function create_key_block$3(ctx) {
22378
22640
  let input;
22379
- let t;
22380
- let if_block_anchor;
22641
+ let t0;
22642
+ let t1;
22643
+ let if_block1_anchor;
22381
22644
  let current;
22382
22645
 
22383
22646
  input = new /*Input*/ ctx[15]({
22384
22647
  props: {
22385
22648
  isFirstInvalidInput: /*callbackMetadata*/ ctx[2]?.derived.isFirstInvalidInput || false,
22386
- hasRightIcon: true,
22649
+ hasRightIcon: /*style*/ ctx[5].showPassword === 'button'
22650
+ ? true
22651
+ : false,
22387
22652
  key: /*key*/ ctx[0],
22388
22653
  label: interpolate(textToKey(/*callbackType*/ ctx[9]), null, /*textInputLabel*/ ctx[13]),
22389
22654
  message: /*validationFailure*/ ctx[7] || (/*isRequired*/ ctx[4]
22390
22655
  ? interpolate('inputRequiredError')
22391
22656
  : undefined),
22392
- onChange: /*setValue*/ ctx[17],
22657
+ onChange: /*setValue*/ ctx[18],
22393
22658
  isInvalid: /*isInvalid*/ ctx[3],
22394
22659
  isRequired: /*isRequired*/ ctx[4],
22395
22660
  showMessage: /*showMessage*/ ctx[6],
@@ -22399,31 +22664,41 @@ function create_key_block$3(ctx) {
22399
22664
  : '',
22400
22665
  $$slots: {
22401
22666
  "input-button": [create_input_button_slot],
22402
- default: [create_default_slot_1$d]
22667
+ default: [create_default_slot_2$6]
22403
22668
  },
22404
22669
  $$scope: { ctx }
22405
22670
  }
22406
22671
  });
22407
22672
 
22408
- let if_block = /*callbackMetadata*/ ctx[2]?.platform?.confirmPassword && create_if_block$i(ctx);
22673
+ let if_block0 = /*showPassword*/ ctx[16] === "checkbox" && create_if_block_1$b(ctx);
22674
+ let if_block1 = /*callbackMetadata*/ ctx[2]?.platform?.confirmPassword && create_if_block$i(ctx);
22409
22675
 
22410
22676
  return {
22411
22677
  c() {
22412
22678
  create_component(input.$$.fragment);
22413
- t = space();
22414
- if (if_block) if_block.c();
22415
- if_block_anchor = empty();
22679
+ t0 = space();
22680
+ if (if_block0) if_block0.c();
22681
+ t1 = space();
22682
+ if (if_block1) if_block1.c();
22683
+ if_block1_anchor = empty();
22416
22684
  },
22417
22685
  m(target, anchor) {
22418
22686
  mount_component(input, target, anchor);
22419
- insert(target, t, anchor);
22420
- if (if_block) if_block.m(target, anchor);
22421
- insert(target, if_block_anchor, anchor);
22687
+ insert(target, t0, anchor);
22688
+ if (if_block0) if_block0.m(target, anchor);
22689
+ insert(target, t1, anchor);
22690
+ if (if_block1) if_block1.m(target, anchor);
22691
+ insert(target, if_block1_anchor, anchor);
22422
22692
  current = true;
22423
22693
  },
22424
22694
  p(ctx, dirty) {
22425
22695
  const input_changes = {};
22426
22696
  if (dirty & /*callbackMetadata*/ 4) input_changes.isFirstInvalidInput = /*callbackMetadata*/ ctx[2]?.derived.isFirstInvalidInput || false;
22697
+
22698
+ if (dirty & /*style*/ 32) input_changes.hasRightIcon = /*style*/ ctx[5].showPassword === 'button'
22699
+ ? true
22700
+ : false;
22701
+
22427
22702
  if (dirty & /*key*/ 1) input_changes.key = /*key*/ ctx[0];
22428
22703
  if (dirty & /*callbackType, textInputLabel*/ 8704) input_changes.label = interpolate(textToKey(/*callbackType*/ ctx[9]), null, /*textInputLabel*/ ctx[13]);
22429
22704
 
@@ -22440,30 +22715,31 @@ function create_key_block$3(ctx) {
22440
22715
  ? /*value*/ ctx[8]
22441
22716
  : '';
22442
22717
 
22443
- if (dirty & /*$$scope, isVisible*/ 4196352) {
22718
+ if (dirty & /*$$scope, isVisible*/ 8390656) {
22444
22719
  input_changes.$$scope = { dirty, ctx };
22445
22720
  }
22446
22721
 
22447
22722
  input.$set(input_changes);
22723
+ if (/*showPassword*/ ctx[16] === "checkbox") if_block0.p(ctx, dirty);
22448
22724
 
22449
22725
  if (/*callbackMetadata*/ ctx[2]?.platform?.confirmPassword) {
22450
- if (if_block) {
22451
- if_block.p(ctx, dirty);
22726
+ if (if_block1) {
22727
+ if_block1.p(ctx, dirty);
22452
22728
 
22453
22729
  if (dirty & /*callbackMetadata*/ 4) {
22454
- transition_in(if_block, 1);
22730
+ transition_in(if_block1, 1);
22455
22731
  }
22456
22732
  } else {
22457
- if_block = create_if_block$i(ctx);
22458
- if_block.c();
22459
- transition_in(if_block, 1);
22460
- if_block.m(if_block_anchor.parentNode, if_block_anchor);
22733
+ if_block1 = create_if_block$i(ctx);
22734
+ if_block1.c();
22735
+ transition_in(if_block1, 1);
22736
+ if_block1.m(if_block1_anchor.parentNode, if_block1_anchor);
22461
22737
  }
22462
- } else if (if_block) {
22738
+ } else if (if_block1) {
22463
22739
  group_outros();
22464
22740
 
22465
- transition_out(if_block, 1, 1, () => {
22466
- if_block = null;
22741
+ transition_out(if_block1, 1, 1, () => {
22742
+ if_block1 = null;
22467
22743
  });
22468
22744
 
22469
22745
  check_outros();
@@ -22472,19 +22748,23 @@ function create_key_block$3(ctx) {
22472
22748
  i(local) {
22473
22749
  if (current) return;
22474
22750
  transition_in(input.$$.fragment, local);
22475
- transition_in(if_block);
22751
+ transition_in(if_block0);
22752
+ transition_in(if_block1);
22476
22753
  current = true;
22477
22754
  },
22478
22755
  o(local) {
22479
22756
  transition_out(input.$$.fragment, local);
22480
- transition_out(if_block);
22757
+ transition_out(if_block0);
22758
+ transition_out(if_block1);
22481
22759
  current = false;
22482
22760
  },
22483
22761
  d(detaching) {
22484
22762
  destroy_component(input, detaching);
22485
- if (detaching) detach(t);
22486
- if (if_block) if_block.d(detaching);
22487
- if (detaching) detach(if_block_anchor);
22763
+ if (detaching) detach(t0);
22764
+ if (if_block0) if_block0.d(detaching);
22765
+ if (detaching) detach(t1);
22766
+ if (if_block1) if_block1.d(detaching);
22767
+ if (detaching) detach(if_block1_anchor);
22488
22768
  }
22489
22769
  };
22490
22770
  }
@@ -22543,6 +22823,7 @@ function instance$B($$self, $$props, $$invalidate) {
22543
22823
  let { isRequired = false } = $$props;
22544
22824
  let { style = {} } = $$props;
22545
22825
  const Input = style.labels === 'stacked' ? Stacked_label : Floating_label;
22826
+ const showPassword = style.showPassword;
22546
22827
  let { showMessage = undefined } = $$props;
22547
22828
  let { validationFailure = '' } = $$props;
22548
22829
  let confirmValue;
@@ -22560,7 +22841,7 @@ function instance$B($$self, $$props, $$invalidate) {
22560
22841
  * @param event
22561
22842
  */
22562
22843
  function confirmInput(val) {
22563
- $$invalidate(19, confirmValue = val);
22844
+ $$invalidate(20, confirmValue = val);
22564
22845
  }
22565
22846
 
22566
22847
  /**
@@ -22579,7 +22860,7 @@ function instance$B($$self, $$props, $$invalidate) {
22579
22860
  *********************************************************************** */
22580
22861
  callback.setInputValue(value);
22581
22862
 
22582
- $$invalidate(20, savedValue = String(value));
22863
+ $$invalidate(21, savedValue = String(value));
22583
22864
  }
22584
22865
 
22585
22866
  /**
@@ -22599,11 +22880,11 @@ function instance$B($$self, $$props, $$invalidate) {
22599
22880
  if ('style' in $$props) $$invalidate(5, style = $$props.style);
22600
22881
  if ('showMessage' in $$props) $$invalidate(6, showMessage = $$props.showMessage);
22601
22882
  if ('validationFailure' in $$props) $$invalidate(7, validationFailure = $$props.validationFailure);
22602
- if ('$$scope' in $$props) $$invalidate(22, $$scope = $$props.$$scope);
22883
+ if ('$$scope' in $$props) $$invalidate(23, $$scope = $$props.$$scope);
22603
22884
  };
22604
22885
 
22605
22886
  $$self.$$.update = () => {
22606
- if ($$self.$$.dirty & /*callback, callbackMetadata, savedValue, value, confirmValue*/ 1573126) {
22887
+ if ($$self.$$.dirty & /*callback, callbackMetadata, savedValue, value, confirmValue*/ 3145990) {
22607
22888
  {
22608
22889
  $$invalidate(9, callbackType = callback.getType());
22609
22890
  $$invalidate(0, key = callback?.payload?.input?.[0].name || `password-${callbackMetadata?.idx}`);
@@ -22645,6 +22926,7 @@ function instance$B($$self, $$props, $$invalidate) {
22645
22926
  textInputLabel,
22646
22927
  type,
22647
22928
  Input,
22929
+ showPassword,
22648
22930
  confirmInput,
22649
22931
  setValue,
22650
22932
  toggleVisibility,
@@ -26318,61 +26600,96 @@ class Device_profile extends SvelteComponent {
26318
26600
  }
26319
26601
  }
26320
26602
 
26603
+ /*
26604
+ * Because hcaptch and grecaptcha would
26605
+ * both be loaded on the page, we need to just leverage
26606
+ * the classnames to determine which one is being rendered.
26607
+ * This is retrieved from the step
26608
+ */
26609
+ function checkForHCaptcha(captchaClassname) {
26610
+ return captchaClassname.match('h-captcha');
26611
+ }
26612
+ function renderCaptcha({ nameOfCaptcha, siteKey, }) {
26613
+ if (nameOfCaptcha === 'hcaptcha' && window.hcaptcha) {
26614
+ return window.hcaptcha.render('fr-recaptcha', {
26615
+ sitekey: siteKey,
26616
+ callback: 'frHandleCaptcha',
26617
+ 'expired-callback': 'frHandleExpiredCallback',
26618
+ 'chalexpired-callback': 'frHandleExpiredCallback',
26619
+ 'error-callback': 'frHandleErrorCallback',
26620
+ });
26621
+ }
26622
+ if (nameOfCaptcha === 'grecaptcha' && window.grecaptcha) {
26623
+ return window.grecaptcha.render('fr-recaptcha', {
26624
+ sitekey: siteKey,
26625
+ callback: window.frHandleCaptcha,
26626
+ 'expired-callback': window.frHandleExpiredCallback,
26627
+ });
26628
+ }
26629
+ }
26630
+ function handleCaptchaError(callback) {
26631
+ const siteKey = callback?.getSiteKey() ?? '';
26632
+ const className = callback?.getOutputByName('captchaDivClass', 'h-captcha') ?? 'h-captcha';
26633
+ if (checkForHCaptcha(className)) {
26634
+ return () => renderCaptcha({ nameOfCaptcha: 'hcaptcha', siteKey });
26635
+ }
26636
+ else {
26637
+ return () => renderCaptcha({ nameOfCaptcha: 'grecaptcha', siteKey });
26638
+ }
26639
+ }
26640
+ function handleCaptchaToken(callback) {
26641
+ return (token) => {
26642
+ callback?.setResult(token);
26643
+ };
26644
+ }
26645
+
26321
26646
  /* src/lib/journey/callbacks/recaptcha/recaptcha.svelte generated by Svelte v3.59.2 */
26322
26647
 
26323
26648
  function create_if_block$b(ctx) {
26324
- let script;
26325
- let script_src_value;
26649
+ let div;
26326
26650
 
26327
26651
  return {
26328
26652
  c() {
26329
- script = element("script");
26330
- if (!src_url_equal(script.src, script_src_value = /*recaptchaApi*/ ctx[1])) attr(script, "src", script_src_value);
26331
- script.async = true;
26332
- script.defer = true;
26653
+ div = element("div");
26654
+ attr(div, "id", "fr-recaptcha");
26655
+ attr(div, "class", `${/*recaptchaClass*/ ctx[2]} tw_flex-1 tw_w-full tw_input-spacing`);
26656
+ attr(div, "data-sitekey", /*siteKey*/ ctx[0]);
26657
+ attr(div, "data-expired-callback", "frHandleExpiredCallback");
26658
+ attr(div, "data-chalexpired-callback", "frHandleExpiredCallback");
26659
+ attr(div, "data-error-callback", "frHandleErrorCallback");
26660
+ attr(div, "data-callback", "frHandleCaptcha");
26333
26661
  },
26334
26662
  m(target, anchor) {
26335
- insert(target, script, anchor);
26663
+ insert(target, div, anchor);
26336
26664
  },
26337
26665
  p: noop,
26338
26666
  d(detaching) {
26339
- if (detaching) detach(script);
26667
+ if (detaching) detach(div);
26340
26668
  }
26341
26669
  };
26342
26670
  }
26343
26671
 
26344
26672
  function create_fragment$i(ctx) {
26345
- let t;
26346
- let div;
26347
- let if_block = /*recaptchaApi*/ ctx[1].length && create_if_block$b(ctx);
26673
+ let if_block_anchor;
26674
+ let if_block = /*isV3*/ ctx[1] === false && create_if_block$b(ctx);
26348
26675
 
26349
26676
  return {
26350
26677
  c() {
26351
26678
  if (if_block) if_block.c();
26352
- t = space();
26353
- div = element("div");
26354
- attr(div, "id", "fr-recaptcha");
26355
- attr(div, "class", `${/*recaptchaClass*/ ctx[2]} tw_flex-1 tw_w-full tw_input-spacing`);
26356
- attr(div, "data-sitekey", /*siteKey*/ ctx[0]);
26357
- attr(div, "data-expired-callback", "frHandleExpiredCallback");
26358
- attr(div, "data-chalexpired-callback", "frHandleExpiredCallback");
26359
- attr(div, "data-error-callback", "frHandleErrorCallback");
26360
- attr(div, "data-callback", "frHandleCaptcha");
26679
+ if_block_anchor = empty();
26361
26680
  },
26362
26681
  m(target, anchor) {
26363
26682
  if (if_block) if_block.m(target, anchor);
26364
- insert(target, t, anchor);
26365
- insert(target, div, anchor);
26683
+ insert(target, if_block_anchor, anchor);
26366
26684
  },
26367
26685
  p(ctx, [dirty]) {
26368
- if (/*recaptchaApi*/ ctx[1].length) if_block.p(ctx, dirty);
26686
+ if (/*isV3*/ ctx[1] === false) if_block.p(ctx, dirty);
26369
26687
  },
26370
26688
  i: noop,
26371
26689
  o: noop,
26372
26690
  d(detaching) {
26373
26691
  if (if_block) if_block.d(detaching);
26374
- if (detaching) detach(t);
26375
- if (detaching) detach(div);
26692
+ if (detaching) detach(if_block_anchor);
26376
26693
  }
26377
26694
  };
26378
26695
  }
@@ -26382,8 +26699,19 @@ function instance$j($$self, $$props, $$invalidate) {
26382
26699
  const selfSubmitFunction = null;
26383
26700
  const stepMetadata = null;
26384
26701
  const style = {};
26702
+
26703
+ /**
26704
+ * This is a component level variable that is set from the journey store
26705
+ * If it isn't passed in via journey.start, we
26706
+ * default to the journey.tree value. However, journey.tree won't
26707
+ * necessarily be set on mount. It is async, so we
26708
+ * have to wait for it to resolve. Therefore, defaulting to
26709
+ * an empty string so its falsey.
26710
+ */
26711
+ let recaptchaAction = '';
26712
+
26385
26713
  const siteKey = callback?.getSiteKey() ?? '';
26386
- let recaptchaApi = `${callback?.getOutputByName('captchaApiUri', '') ?? ''}`;
26714
+ let isV3 = callback?.getOutputByName('reCaptchaV3', false);
26387
26715
 
26388
26716
  /**
26389
26717
  * AM defaults the class name to g-captcha which is wrong
@@ -26393,63 +26721,71 @@ function instance$j($$self, $$props, $$invalidate) {
26393
26721
  const recaptchaClass = callback?.getOutputByName('captchaDivClass', 'h-captcha') ?? 'h-captcha';
26394
26722
 
26395
26723
  onMount(() => {
26396
- window.frHandleCaptchaError = function handleCaptchaError() {
26397
- callback?.setResult('');
26398
-
26399
- if (recaptchaClass.startsWith('h')) {
26400
- window.hcaptcha.render(recaptchaClass, {
26401
- sitekey: siteKey,
26402
- callback: 'frHandleCaptcha',
26403
- 'expired-callback': 'frHandleExpiredCallback',
26404
- 'chalexpired-callback': 'frHandleExpiredCallback',
26405
- 'error-callback': 'frHandleErrorCallback'
26406
- });
26407
- } else {
26408
- window.grecaptcha.render(recaptchaClass, {
26409
- sitekey: siteKey,
26410
- callback: window.frHandleCaptcha,
26411
- 'expired-callback': window.frHandleExpiredCallback
26412
- });
26413
- }
26414
- };
26724
+ if (isV3) {
26725
+ // If ReCaptcha v3, do nothing and return early
26726
+ return;
26727
+ }
26415
26728
 
26416
- window.frHandleCaptcha = function handleCaptchaToken(token) {
26417
- callback?.setResult(token);
26418
- };
26729
+ if (callback) {
26730
+ window.frHandleCaptchaError = handleCaptchaError(callback);
26731
+ window.frHandleCaptcha = handleCaptchaToken(callback);
26419
26732
 
26420
- window.frHandleExpiredCallback = function handleExpiredCallback() {
26421
- callback?.setResult('');
26733
+ window.frHandleExpiredCallback = function handleExpiredCallback() {
26734
+ callback?.setResult('');
26735
+ renderCaptcha({ nameOfCaptcha: 'hcaptcha', siteKey });
26736
+ };
26422
26737
 
26423
- if (recaptchaClass.startsWith('h')) {
26424
- window.hcaptcha.render(recaptchaClass, {
26425
- sitekey: siteKey,
26426
- callback: 'frHandleCaptcha',
26427
- 'expired-callback': 'frHandleExpiredCallback',
26428
- 'chalexpired-callback': 'frHandleExpiredCallback',
26429
- 'error-callback': 'frHandleErrorCallback'
26430
- });
26431
- } else {
26432
- window.grecaptcha.render(recaptchaClass, {
26433
- sitekey: siteKey,
26434
- callback: window.frHandleCaptcha,
26435
- 'expired-callback': window.frHandleExpiredCallback
26738
+ renderCaptcha({
26739
+ nameOfCaptcha: recaptchaClass === 'g-recaptcha'
26740
+ ? 'grecaptcha'
26741
+ : 'hcaptcha',
26742
+ siteKey
26743
+ });
26744
+ }
26745
+ });
26746
+
26747
+ // defining this outside of the reactive block and guarding it with a isV3 check so it only runs when v3
26748
+ // is defined as true and we have a recaptcha action to assign.
26749
+ function executeV3Captcha() {
26750
+ if (isV3 && recaptchaAction.length) {
26751
+ try {
26752
+ window.grecaptcha.ready(async function () {
26753
+ const value = await window.grecaptcha.execute(siteKey, { action: recaptchaAction });
26754
+ callback?.setResult(value);
26436
26755
  });
26756
+ } catch(err) {
26757
+ throw new Error(`Error executing recaptcha. Please make sure you have passed a siteKey and you have loaded the google recaptcha script in your app prior to this Error: ${err}`);
26437
26758
  }
26438
- };
26759
+ }
26760
+ }
26761
+
26762
+ journeyStore.subscribe(value => {
26763
+ $$invalidate(7, recaptchaAction = value?.recaptchaAction ?? '');
26439
26764
  });
26440
26765
 
26441
26766
  $$self.$$set = $$props => {
26442
26767
  if ('callback' in $$props) $$invalidate(3, callback = $$props.callback);
26443
26768
  };
26444
26769
 
26770
+ $$self.$$.update = () => {
26771
+ if ($$self.$$.dirty & /*recaptchaAction*/ 128) {
26772
+ {
26773
+ if (recaptchaAction.length) {
26774
+ executeV3Captcha();
26775
+ }
26776
+ }
26777
+ }
26778
+ };
26779
+
26445
26780
  return [
26446
26781
  siteKey,
26447
- recaptchaApi,
26782
+ isV3,
26448
26783
  recaptchaClass,
26449
26784
  callback,
26450
26785
  selfSubmitFunction,
26451
26786
  stepMetadata,
26452
- style
26787
+ style,
26788
+ recaptchaAction
26453
26789
  ];
26454
26790
  }
26455
26791
 
@@ -29791,7 +30127,7 @@ function get_each_context$4(ctx, list, i) {
29791
30127
  return child_ctx;
29792
30128
  }
29793
30129
 
29794
- // (50:2) {#if componentStyle !== 'inline'}
30130
+ // (45:2) {#if componentStyle !== 'inline'}
29795
30131
  function create_if_block_2$4(ctx) {
29796
30132
  let t0;
29797
30133
  let h1;
@@ -29878,7 +30214,7 @@ function create_if_block_2$4(ctx) {
29878
30214
  };
29879
30215
  }
29880
30216
 
29881
- // (51:4) {#if form?.icon}
30217
+ // (46:4) {#if form?.icon}
29882
30218
  function create_if_block_3$3(ctx) {
29883
30219
  let div;
29884
30220
  let newusericon;
@@ -29918,7 +30254,7 @@ function create_if_block_3$3(ctx) {
29918
30254
  };
29919
30255
  }
29920
30256
 
29921
- // (67:2) {#if form.message}
30257
+ // (62:2) {#if form.message}
29922
30258
  function create_if_block_1$5(ctx) {
29923
30259
  let alert;
29924
30260
  let current;
@@ -29966,7 +30302,7 @@ function create_if_block_1$5(ctx) {
29966
30302
  };
29967
30303
  }
29968
30304
 
29969
- // (68:4) <Alert id="formFailureMessageAlert" needsFocus={alertNeedsFocus} type="error">
30305
+ // (63:4) <Alert id="formFailureMessageAlert" needsFocus={alertNeedsFocus} type="error">
29970
30306
  function create_default_slot_2$2(ctx) {
29971
30307
  let t_value = interpolate(/*formMessageKey*/ ctx[7], null, /*form*/ ctx[2]?.message) + "";
29972
30308
  let t;
@@ -29987,7 +30323,7 @@ function create_default_slot_2$2(ctx) {
29987
30323
  };
29988
30324
  }
29989
30325
 
29990
- // (73:2) {#each step?.callbacks as callback, idx}
30326
+ // (68:2) {#each step?.callbacks as callback, idx}
29991
30327
  function create_each_block$4(ctx) {
29992
30328
  let callbackmapper;
29993
30329
  let current;
@@ -30040,7 +30376,7 @@ function create_each_block$4(ctx) {
30040
30376
  };
30041
30377
  }
30042
30378
 
30043
- // (85:2) {#if metadata?.step?.derived.isUserInputOptional || !metadata?.step?.derived.isStepSelfSubmittable()}
30379
+ // (80:2) {#if metadata?.step?.derived.isUserInputOptional || !metadata?.step?.derived.isStepSelfSubmittable()}
30044
30380
  function create_if_block$7(ctx) {
30045
30381
  let button;
30046
30382
  let current;
@@ -30089,7 +30425,7 @@ function create_if_block$7(ctx) {
30089
30425
  };
30090
30426
  }
30091
30427
 
30092
- // (86:4) <Button busy={journey?.loading} style="primary" type="submit" width="full">
30428
+ // (81:4) <Button busy={journey?.loading} style="primary" type="submit" width="full">
30093
30429
  function create_default_slot_1$6(ctx) {
30094
30430
  let t;
30095
30431
  let current;
@@ -30119,7 +30455,7 @@ function create_default_slot_1$6(ctx) {
30119
30455
  };
30120
30456
  }
30121
30457
 
30122
- // (49:0) <Form bind:formEl ariaDescribedBy="formFailureMessageAlert" onSubmitWhenValid={form?.submit}>
30458
+ // (44:0) <Form bind:formEl ariaDescribedBy="formFailureMessageAlert" onSubmitWhenValid={form?.submit}>
30123
30459
  function create_default_slot$7(ctx) {
30124
30460
  let t0;
30125
30461
  let t1;
@@ -30404,12 +30740,6 @@ function instance$c($$self, $$props, $$invalidate) {
30404
30740
  }
30405
30741
  });
30406
30742
 
30407
- onMount(() => {
30408
- if (componentStyle === 'modal') {
30409
- captureLinks(linkWrapper, journey);
30410
- }
30411
- });
30412
-
30413
30743
  function p_binding($$value) {
30414
30744
  binding_callbacks[$$value ? 'unshift' : 'push'](() => {
30415
30745
  linkWrapper = $$value;