@alviere/ui 0.16.1 → 0.16.3

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/index.js CHANGED
@@ -5773,14 +5773,10 @@ const manager = AlviereCoreManager.getInstance();
5773
5773
  function getAlviereCore(config) {
5774
5774
  return manager.getOrCreate(config);
5775
5775
  }
5776
- function updateAlviereCore(config) {
5777
- return manager.updateOrCreate(config);
5778
- }
5779
5776
  const alviereCoreManager = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5780
5777
  __proto__: null,
5781
5778
  AlviereCoreManager,
5782
- getAlviereCore,
5783
- updateAlviereCore
5779
+ getAlviereCore
5784
5780
  }, Symbol.toStringTag, { value: "Module" }));
5785
5781
  const validator = AlviereCore.createValidator();
5786
5782
  function createEnhancedBaseInputMixin(config) {
@@ -7979,12 +7975,12 @@ var root_1$h = /* @__PURE__ */ from_html(`<label class="alviere-text-input__labe
7979
7975
  var root_2$c = /* @__PURE__ */ from_html(`<textarea class="alviere-text-input__textarea svelte-1auzwdn" spellcheck="true"></textarea>`);
7980
7976
  var root_3$c = /* @__PURE__ */ from_html(`<input class="alviere-text-input__input svelte-1auzwdn" spellcheck="true"/>`);
7981
7977
  var root_5$7 = /* @__PURE__ */ from_html(`<button type="button" class="alviere-text-input__action-button svelte-1auzwdn"><span class="alviere-text-input__action-icon svelte-1auzwdn">?</span></button>`);
7982
- var root_7$2 = /* @__PURE__ */ from_svg(`<svg height="1.5em" width="1.5em" viewBox="0 0 24 24" class="IconStyle_currentColor__sdo2n67" style="font-size: 1em;"><path d="m2.707 1.293 7.17 7.17.002.002 1.504 1.504 7.21 7.21-.001-.001 4.115 4.115-1.414 1.414-4.297-4.296C15.485 19.434 13.82 20 12 20c-2.959 0-5.461-1.46-7.51-3.85a16.59 16.59 0 0 1-1.796-2.56 12.546 12.546 0 0 1-.613-1.197L1.91 12l.17-.395c.11-.252.315-.668.618-1.195.5-.872 1.1-1.743 1.803-2.56.3-.349.614-.68.94-.993l-4.15-4.149zM6.856 8.27l-.256.252c-.199.2-.393.411-.581.63a14.7 14.7 0 0 0-1.843 2.718l-.069.13.145.275.179.322c.439.768.966 1.538 1.578 2.252C7.711 16.835 9.71 18 12 18c1.222 0 2.358-.334 3.426-.962l.123-.076-1.517-1.516A4 4 0 0 1 8.553 9.97zM12 4c2.959 0 5.461 1.46 7.51 3.849a16.59 16.59 0 0 1 1.796 2.56l.208.375c.126.234.228.437.306.603l.1.219.169.395-.17.395a12.7 12.7 0 0 1-.548 1.073c-.37.655-.8 1.318-1.292 1.963l-.302.385-1.553-1.26a14.947 14.947 0 0 0 1.404-2.07l.16-.289.104-.201-.144-.273-.178-.322a14.613 14.613 0 0 0-1.58-2.252C16.289 7.165 14.291 6 12.001 6c-.478 0-.942.05-1.395.151l-.337.085-.537-1.927A8.409 8.409 0 0 1 12 4zm-1.933 7.482-.036.166a2 2 0 0 0 2.321 2.321l.164-.038z" fill="currentcolor" fill-rule="evenodd"></path></svg>`);
7978
+ var root_7$3 = /* @__PURE__ */ from_svg(`<svg height="1.5em" width="1.5em" viewBox="0 0 24 24" class="IconStyle_currentColor__sdo2n67" style="font-size: 1em;"><path d="m2.707 1.293 7.17 7.17.002.002 1.504 1.504 7.21 7.21-.001-.001 4.115 4.115-1.414 1.414-4.297-4.296C15.485 19.434 13.82 20 12 20c-2.959 0-5.461-1.46-7.51-3.85a16.59 16.59 0 0 1-1.796-2.56 12.546 12.546 0 0 1-.613-1.197L1.91 12l.17-.395c.11-.252.315-.668.618-1.195.5-.872 1.1-1.743 1.803-2.56.3-.349.614-.68.94-.993l-4.15-4.149zM6.856 8.27l-.256.252c-.199.2-.393.411-.581.63a14.7 14.7 0 0 0-1.843 2.718l-.069.13.145.275.179.322c.439.768.966 1.538 1.578 2.252C7.711 16.835 9.71 18 12 18c1.222 0 2.358-.334 3.426-.962l.123-.076-1.517-1.516A4 4 0 0 1 8.553 9.97zM12 4c2.959 0 5.461 1.46 7.51 3.849a16.59 16.59 0 0 1 1.796 2.56l.208.375c.126.234.228.437.306.603l.1.219.169.395-.17.395a12.7 12.7 0 0 1-.548 1.073c-.37.655-.8 1.318-1.292 1.963l-.302.385-1.553-1.26a14.947 14.947 0 0 0 1.404-2.07l.16-.289.104-.201-.144-.273-.178-.322a14.613 14.613 0 0 0-1.58-2.252C16.289 7.165 14.291 6 12.001 6c-.478 0-.942.05-1.395.151l-.337.085-.537-1.927A8.409 8.409 0 0 1 12 4zm-1.933 7.482-.036.166a2 2 0 0 0 2.321 2.321l.164-.038z" fill="currentcolor" fill-rule="evenodd"></path></svg>`);
7983
7979
  var root_8$4 = /* @__PURE__ */ from_svg(`<svg height="1.5em" width="1.5em" viewBox="0 0 24 24" class="IconStyle_currentColor__sdo2n67" style="font-size: 1em;"><path d="M12 4c4.278 0 7.61 2.667 10 8-2.39 5.333-5.722 8-10 8s-7.61-2.667-10-8c2.39-5.333 5.722-8 10-8zm0 2c-4.41 0-6.707 4.479-7.699 5.999C5.295 13.518 7.604 18 12 18c4.41 0 6.707-4.479 7.699-5.999C18.705 10.482 16.396 6 12 6zm0 2c2.176 0 3.945 1.794 3.945 4s-1.77 4-3.945 4c-2.176 0-3.945-1.794-3.945-4S9.825 8 12 8zm0 2c-1.088 0-1.973.897-1.973 2s.885 2 1.973 2 1.973-.897 1.973-2-.885-2-1.973-2z" fill="currentcolor" fill-rule="evenodd"></path></svg>`);
7984
7980
  var root_6$6 = /* @__PURE__ */ from_html(`<button type="button" class="alviere-text-input__reveal-button svelte-1auzwdn"><!></button>`);
7985
7981
  var root_4$b = /* @__PURE__ */ from_html(`<div class="alviere-text-input__actions svelte-1auzwdn"><!> <!></div>`);
7986
- var root_9$3 = /* @__PURE__ */ from_html(`<div class="alviere-text-input__character-count svelte-1auzwdn"> </div>`);
7987
- var root_10$2 = /* @__PURE__ */ from_html(`<div class="alviere-text-input__required svelte-1auzwdn">Required</div>`);
7982
+ var root_9$4 = /* @__PURE__ */ from_html(`<div class="alviere-text-input__character-count svelte-1auzwdn"> </div>`);
7983
+ var root_10$3 = /* @__PURE__ */ from_html(`<div class="alviere-text-input__required svelte-1auzwdn">Required</div>`);
7988
7984
  var root_11$3 = /* @__PURE__ */ from_html(`<div class="alviere-text-input__help svelte-1auzwdn"><!> </div>`);
7989
7985
  var root_12$4 = /* @__PURE__ */ from_html(`<div class="alviere-text-input__error svelte-1auzwdn" role="alert"><svg height="1rem" width="1rem" viewBox="0 0 24 24" class="IconStyle_currentColor__sdo2n67" style="font-size: 1em;"><g fill="none"><path d="M2 12c0 5.523 4.477 10 10 10s10-4.477 10-10S17.523 2 12 2 2 6.477 2 12zm5.293-3.293 1.414-1.414 8 8-1.414 1.414z" fill="currentcolor"></path></g></svg> </div>`);
7990
7986
  var root_13$3 = /* @__PURE__ */ from_html(`<div class="alviere-text-input__warning svelte-1auzwdn" role="status"><!> </div>`);
@@ -8627,7 +8623,7 @@ function TextInput($$anchor, $$props) {
8627
8623
  var node_5 = child(button_1);
8628
8624
  {
8629
8625
  var consequent_3 = ($$anchor4) => {
8630
- var svg = root_7$2();
8626
+ var svg = root_7$3();
8631
8627
  append($$anchor4, svg);
8632
8628
  };
8633
8629
  var alternate_1 = ($$anchor4) => {
@@ -8656,7 +8652,7 @@ function TextInput($$anchor, $$props) {
8656
8652
  var node_6 = sibling(node_2, 2);
8657
8653
  {
8658
8654
  var consequent_6 = ($$anchor2) => {
8659
- var div_3 = root_9$3();
8655
+ var div_3 = root_9$4();
8660
8656
  var text_1 = child(div_3);
8661
8657
  reset(div_3);
8662
8658
  template_effect(() => set_text(text_1, `${get$1(characterCount) ?? ""}/${maxlength() ?? ""}`));
@@ -8669,7 +8665,7 @@ function TextInput($$anchor, $$props) {
8669
8665
  var node_7 = sibling(node_6, 2);
8670
8666
  {
8671
8667
  var consequent_7 = ($$anchor2) => {
8672
- var div_4 = root_10$2();
8668
+ var div_4 = root_10$3();
8673
8669
  append($$anchor2, div_4);
8674
8670
  };
8675
8671
  if_block(node_7, ($$render) => {
@@ -11819,7 +11815,7 @@ var root_3$7 = /* @__PURE__ */ from_html(`<button type="button" class="alviere-s
11819
11815
  var root_4$6 = /* @__PURE__ */ from_html(`<div class="alviere-search-select__required svelte-roni7d">Required</div>`);
11820
11816
  var root_6$4 = /* @__PURE__ */ from_html(`<div class="alviere-search-select__loading-message svelte-roni7d"> </div>`);
11821
11817
  var root_8$3 = /* @__PURE__ */ from_html(`<div class="alviere-search-select__no-options-message svelte-roni7d"> </div>`);
11822
- var root_10$1 = /* @__PURE__ */ from_html(`<div role="option" tabindex="0"> </div>`);
11818
+ var root_10$2 = /* @__PURE__ */ from_html(`<div role="option" tabindex="0"> </div>`);
11823
11819
  var root_5$5 = /* @__PURE__ */ from_html(`<div id="search-select-dropdown" class="alviere-search-select__dropdown svelte-roni7d" role="listbox"><div class="alviere-search-select__options-list svelte-roni7d"><!></div></div>`);
11824
11820
  var root_11$2 = /* @__PURE__ */ from_html(`<div class="alviere-search-select__help svelte-roni7d"> </div>`);
11825
11821
  var root_12$3 = /* @__PURE__ */ from_html(`<div class="alviere-search-select__error svelte-roni7d" role="alert"><svg height="1rem" width="1rem" viewBox="0 0 24 24" class="IconStyle_currentColor__sdo2n67" style="font-size: 1em;"><g fill="none"><path d="M2 12c0 5.523 4.477 10 10 10s10-4.477 10-10S17.523 2 12 2 2 6.477 2 12zm5.293-3.293 1.414-1.414 8 8-1.414 1.414z" fill="currentcolor"></path></g></svg> </div>`);
@@ -12451,7 +12447,7 @@ function SearchSelect($$anchor, $$props) {
12451
12447
  var fragment_1 = comment();
12452
12448
  var node_9 = first_child(fragment_1);
12453
12449
  each(node_9, 17, () => get$1(filteredOptions)(), index, ($$anchor5, option, index2) => {
12454
- var div_10 = root_10$1();
12450
+ var div_10 = root_10$2();
12455
12451
  let classes_2;
12456
12452
  div_10.__pointerdown = (e) => e.preventDefault();
12457
12453
  div_10.__click = () => selectOption(get$1(option));
@@ -12755,13 +12751,13 @@ const createFlowCoreStore = () => {
12755
12751
  const debug = state2.config.debug || false;
12756
12752
  debug && uiLogger.info("🔄 Updating JWT in shared AlviereCore instance (store)...");
12757
12753
  const newConfig = { ...state2.config, jwt: newJwt };
12758
- const newCore = updateAlviereCore(newConfig);
12754
+ state2.core.configure(newConfig);
12759
12755
  debug && uiLogger.info("✅ Shared AlviereCore updated with new JWT (store):", {
12760
- accountUuid: newCore.getAccountUuid(),
12761
- businessUuid: newCore.getBusinessUuid(),
12762
- isFirstTimeUser: newCore.isFirstTimeUser()
12756
+ accountUuid: state2.core.getAccountUuid(),
12757
+ businessUuid: state2.core.getBusinessUuid(),
12758
+ isFirstTimeUser: state2.core.isFirstTimeUser()
12763
12759
  });
12764
- return { ...state2, core: newCore, config: newConfig };
12760
+ return { ...state2, config: newConfig };
12765
12761
  });
12766
12762
  },
12767
12763
  /**
@@ -16173,12 +16169,12 @@ const accountNumberHelpSvg = '<svg xmlns="http://www.w3.org/2000/svg" width="640
16173
16169
  var root_1$8 = /* @__PURE__ */ from_html(`<div class="spinner-container svelte-t9z8bl"><alviere-spinner></alviere-spinner></div>`, 2);
16174
16170
  var root_4$5 = /* @__PURE__ */ from_html(`<alviere-badge> </alviere-badge>`, 2);
16175
16171
  var root_6$3 = /* @__PURE__ */ from_html(`<div class="bank-accounts-section__card-content__info-row svelte-t9z8bl"><span class="label svelte-t9z8bl"> </span> <span class="value svelte-t9z8bl"> </span></div>`);
16176
- var root_7$1 = /* @__PURE__ */ from_html(`<div class="bank-accounts-section__card-content__info-row svelte-t9z8bl"><span class="label svelte-t9z8bl"> </span> <span class="value description svelte-t9z8bl"> </span></div>`);
16172
+ var root_7$2 = /* @__PURE__ */ from_html(`<div class="bank-accounts-section__card-content__info-row svelte-t9z8bl"><span class="label svelte-t9z8bl"> </span> <span class="value description svelte-t9z8bl"> </span></div>`);
16177
16173
  var root_5$4 = /* @__PURE__ */ from_html(`<div class="bank-accounts-section__card-content__info-row svelte-t9z8bl"><span class="label svelte-t9z8bl"> </span> <span class="value svelte-t9z8bl"> </span></div> <!> <!>`, 1);
16178
16174
  var root_8$2 = /* @__PURE__ */ from_html(`<div class="bank-accounts-section__card-content__info-row svelte-t9z8bl"><span class="label svelte-t9z8bl"> </span> <span class="value svelte-t9z8bl"> </span></div>`);
16179
16175
  var root_3$6 = /* @__PURE__ */ from_html(`<alviere-list-item><div slot="leading"><alviere-badge> </alviere-badge></div> <div slot="primary-text"><span> </span></div> <div slot="badges"><!></div> <div slot="actions"><alviere-button></alviere-button> <alviere-button></alviere-button></div> <div slot="expanded-content"><div class="bank-accounts-section__card-content svelte-t9z8bl"><div class="bank-accounts-section__card-content__info-row svelte-t9z8bl"><span class="label svelte-t9z8bl"> </span> <span class="value svelte-t9z8bl"> </span></div> <div class="bank-accounts-section__card-content__info-row svelte-t9z8bl"><span class="label svelte-t9z8bl"> </span> <span class="value svelte-t9z8bl"> </span></div> <!> <!></div></div></alviere-list-item>`, 2);
16180
- var root_9$2 = /* @__PURE__ */ from_html(`<div class="form-status svelte-t9z8bl"><span class="validation-error svelte-t9z8bl" role="alert"> </span></div>`);
16181
- var root_10 = /* @__PURE__ */ from_html(`<div class="alviere-add-bank-account__notice svelte-t9z8bl"><!></div>`);
16176
+ var root_9$3 = /* @__PURE__ */ from_html(`<div class="form-status svelte-t9z8bl"><span class="validation-error svelte-t9z8bl" role="alert"> </span></div>`);
16177
+ var root_10$1 = /* @__PURE__ */ from_html(`<div class="alviere-add-bank-account__notice svelte-t9z8bl"><!></div>`);
16182
16178
  var root_2$4 = /* @__PURE__ */ from_html(`<div class="bank-accounts-section svelte-t9z8bl"><div class="alviere-add-bank-account__header svelte-t9z8bl"><h2 class="svelte-t9z8bl"> </h2> <alviere-button> </alviere-button></div> <alviere-list></alviere-list> <div class="alviere-add-bank-account__footer svelte-t9z8bl"><!> <!> <alviere-button> </alviere-button></div></div>`, 2);
16183
16179
  var root_12$1 = /* @__PURE__ */ from_html(`<alviere-button><span class="alviere-add-bank-account__button__label"> </span></alviere-button>`, 2);
16184
16180
  var root_15$1 = /* @__PURE__ */ from_html(`<div class="routing-info svelte-t9z8bl"><div class="routing-info-header svelte-t9z8bl"><span class="bank-name svelte-t9z8bl"> </span></div></div>`);
@@ -16303,14 +16299,9 @@ function AddBankAccount($$anchor, $$props) {
16303
16299
  },
16304
16300
  ach_account_number: {
16305
16301
  required: "Account number is required",
16306
- numeric: "Account number must contain only digits",
16307
- minLength: {
16308
- value: 3,
16309
- message: "Account number must be at least 3 digits"
16310
- },
16311
- maxLength: {
16312
- value: 17,
16313
- message: "Account number must be at most 17 digits"
16302
+ pattern: {
16303
+ regex: /^\d{3,17}$/,
16304
+ message: "Account number must be 3–17 digits"
16314
16305
  }
16315
16306
  }
16316
16307
  };
@@ -16340,14 +16331,9 @@ function AddBankAccount($$anchor, $$props) {
16340
16331
  },
16341
16332
  confirm_account_number: {
16342
16333
  required: "Please confirm your account number",
16343
- numeric: "Account number must contain only digits",
16344
- minLength: {
16345
- value: 3,
16346
- message: "Account number must be at least 3 digits"
16347
- },
16348
- maxLength: {
16349
- value: 17,
16350
- message: "Account number must be at most 17 digits"
16334
+ pattern: {
16335
+ regex: /^\d{3,17}$/,
16336
+ message: "Account number must be 3–17 digits"
16351
16337
  }
16352
16338
  }
16353
16339
  }) : baseSchemas;
@@ -16462,16 +16448,17 @@ function AddBankAccount($$anchor, $$props) {
16462
16448
  });
16463
16449
  user_effect(() => {
16464
16450
  const routingNumber = baseForm.state.formData.ach_details.routing_number;
16465
- const invalidRoutingNumberMessage = getFieldErrorMessage("ach_routing_number", "pattern", INVALID_ROUTING_NUMBER_MESSAGE);
16466
- if (routingNumber && routingNumber.length === 9 && baseForm.state.alviereCore) {
16451
+ const currentFieldError = untrack$1(() => baseForm.state.validationErrors.ach_routing_number);
16452
+ const fieldPassesSchema = !currentFieldError || currentFieldError === INVALID_ROUTING_NUMBER_MESSAGE;
16453
+ if (routingNumber && routingNumber.length === 9 && fieldPassesSchema && baseForm.state.alviereCore) {
16467
16454
  set(isLoadingBankInfo, true);
16468
16455
  lookupRoutingNumber(routingNumber, baseForm.state.alviereCore).then((info) => {
16469
16456
  set(bankInfo, info, true);
16470
16457
  if (!info) {
16471
- baseForm.actions.setFieldError("ach_routing_number", invalidRoutingNumberMessage);
16458
+ baseForm.actions.setFieldError("ach_routing_number", INVALID_ROUTING_NUMBER_MESSAGE);
16472
16459
  return;
16473
16460
  }
16474
- if (baseForm.state.validationErrors.ach_routing_number === invalidRoutingNumberMessage) {
16461
+ if (baseForm.state.validationErrors.ach_routing_number === INVALID_ROUTING_NUMBER_MESSAGE) {
16475
16462
  baseForm.actions.clearFieldError("ach_routing_number");
16476
16463
  }
16477
16464
  }).catch(async (error) => {
@@ -16482,7 +16469,7 @@ function AddBankAccount($$anchor, $$props) {
16482
16469
  } else if (result.kind === "critical") {
16483
16470
  dispatchCriticalError(result.error, result.errorCode);
16484
16471
  } else {
16485
- baseForm.actions.setFieldError("ach_routing_number", invalidRoutingNumberMessage);
16472
+ baseForm.actions.setFieldError("ach_routing_number", INVALID_ROUTING_NUMBER_MESSAGE);
16486
16473
  uiLogger.warn("Failed to lookup bank info:", error);
16487
16474
  }
16488
16475
  }).finally(() => {
@@ -16490,8 +16477,8 @@ function AddBankAccount($$anchor, $$props) {
16490
16477
  });
16491
16478
  } else {
16492
16479
  set(bankInfo, null);
16493
- if (baseForm.state.validationErrors.ach_routing_number === invalidRoutingNumberMessage) {
16494
- baseForm.actions.clearFieldError("ach_routing_number");
16480
+ if (currentFieldError === INVALID_ROUTING_NUMBER_MESSAGE) {
16481
+ baseForm.actions.validateField("ach_routing_number");
16495
16482
  }
16496
16483
  }
16497
16484
  });
@@ -16520,7 +16507,6 @@ function AddBankAccount($$anchor, $$props) {
16520
16507
  return (_b2 = (_a4 = account.bank_account_details) === null || _a4 === void 0 ? void 0 : _a4.ach_details) === null || _b2 === void 0 ? void 0 : _b2.routing_number;
16521
16508
  }).filter((routing) => typeof routing === "string" && routing.length > 0);
16522
16509
  routingNumbers.forEach((routingNumber) => {
16523
- const invalidRoutingNumberMessage = getFieldErrorMessage("ach_routing_number", "pattern", INVALID_ROUTING_NUMBER_MESSAGE);
16524
16510
  if (get$1(bankInfoByRouting)[routingNumber] !== void 0) {
16525
16511
  return;
16526
16512
  }
@@ -16528,15 +16514,15 @@ function AddBankAccount($$anchor, $$props) {
16528
16514
  lookupRoutingNumber(routingNumber, baseForm.state.alviereCore || void 0).then((info) => {
16529
16515
  set(bankInfoByRouting, Object.assign(Object.assign({}, get$1(bankInfoByRouting)), { [routingNumber]: info }), true);
16530
16516
  const currentRouting = baseForm.state.formData.ach_details.routing_number;
16531
- if (currentRouting === routingNumber && !info && baseForm.state.validationErrors.ach_routing_number !== invalidRoutingNumberMessage) {
16532
- baseForm.actions.setFieldError("ach_routing_number", invalidRoutingNumberMessage);
16517
+ if (currentRouting === routingNumber && !info && baseForm.state.validationErrors.ach_routing_number !== INVALID_ROUTING_NUMBER_MESSAGE) {
16518
+ baseForm.actions.setFieldError("ach_routing_number", INVALID_ROUTING_NUMBER_MESSAGE);
16533
16519
  }
16534
16520
  }).catch((error) => {
16535
16521
  uiLogger.warn("Failed to lookup bank info for routing number:", routingNumber, error);
16536
16522
  set(bankInfoByRouting, Object.assign(Object.assign({}, get$1(bankInfoByRouting)), { [routingNumber]: null }), true);
16537
16523
  const currentRouting = baseForm.state.formData.ach_details.routing_number;
16538
16524
  if (currentRouting === routingNumber) {
16539
- baseForm.actions.setFieldError("ach_routing_number", invalidRoutingNumberMessage);
16525
+ baseForm.actions.setFieldError("ach_routing_number", INVALID_ROUTING_NUMBER_MESSAGE);
16540
16526
  }
16541
16527
  });
16542
16528
  });
@@ -16611,7 +16597,7 @@ function AddBankAccount($$anchor, $$props) {
16611
16597
  baseForm.actions.validateAllFields();
16612
16598
  const routingOnSubmit = baseForm.state.formData.ach_details.routing_number;
16613
16599
  if (baseForm.state.alviereCore && (routingOnSubmit === null || routingOnSubmit === void 0 ? void 0 : routingOnSubmit.length) === 9 && !get$1(isLoadingBankInfo) && get$1(bankInfo) === null) {
16614
- baseForm.actions.setFieldError("ach_routing_number", getFieldErrorMessage("ach_routing_number", "pattern", INVALID_ROUTING_NUMBER_MESSAGE));
16600
+ baseForm.actions.setFieldError("ach_routing_number", INVALID_ROUTING_NUMBER_MESSAGE);
16615
16601
  }
16616
16602
  if (!baseForm.computed.canSubmit) {
16617
16603
  uiLogger.debug("Cannot submit: form validation failed");
@@ -16726,20 +16712,16 @@ function AddBankAccount($$anchor, $$props) {
16726
16712
  return true;
16727
16713
  }
16728
16714
  function validateAccountConfirmation() {
16729
- const original = normalizeComparableValue(baseForm.state.formData.ach_details.account_number || baseForm.state.formData.ach_account_number);
16730
- const confirmation = normalizeComparableValue(baseForm.state.formData.confirm_account_number);
16731
- if (!confirmation) {
16715
+ const rawConfirmation = String(baseForm.state.formData.confirm_account_number || "");
16716
+ const rawOriginal = String(baseForm.state.formData.ach_details.account_number || baseForm.state.formData.ach_account_number || "");
16717
+ if (!rawConfirmation.trim()) {
16732
16718
  return true;
16733
16719
  }
16734
- if (!/^\d+$/.test(confirmation)) {
16735
- baseForm.actions.setFieldError("confirm_account_number", getFieldErrorMessage("confirm_account_number", "numeric", "Account number must contain only digits"));
16736
- return false;
16737
- }
16738
- if (confirmation.length < 3) {
16739
- baseForm.actions.setFieldError("confirm_account_number", getFieldErrorMessage("confirm_account_number", "minLength", "Account number must be at least 3 digits"));
16720
+ if (!/^\d{3,17}$/.test(rawConfirmation)) {
16721
+ baseForm.actions.setFieldError("confirm_account_number", getFieldErrorMessage("confirm_account_number", "pattern", "Account number must be 3–17 digits"));
16740
16722
  return false;
16741
16723
  }
16742
- if (!original || confirmation !== original) {
16724
+ if (!rawOriginal || rawConfirmation !== rawOriginal) {
16743
16725
  baseForm.actions.setFieldError("confirm_account_number", getFieldErrorMessage("confirm_account_number", "match", "Account number confirmation does not match"));
16744
16726
  return false;
16745
16727
  }
@@ -17017,7 +16999,7 @@ function AddBankAccount($$anchor, $$props) {
17017
16999
  var node_5 = sibling(node_4, 2);
17018
17000
  {
17019
17001
  var consequent_3 = ($$anchor5) => {
17020
- var div_14 = root_7$1();
17002
+ var div_14 = root_7$2();
17021
17003
  var span_9 = child(div_14);
17022
17004
  var text_13 = child(span_9);
17023
17005
  reset(span_9);
@@ -17100,7 +17082,7 @@ function AddBankAccount($$anchor, $$props) {
17100
17082
  var node_7 = child(div_16);
17101
17083
  {
17102
17084
  var consequent_6 = ($$anchor3) => {
17103
- var div_17 = root_9$2();
17085
+ var div_17 = root_9$3();
17104
17086
  var span_13 = child(div_17);
17105
17087
  var text_17 = child(span_13, true);
17106
17088
  reset(span_13);
@@ -17115,7 +17097,7 @@ function AddBankAccount($$anchor, $$props) {
17115
17097
  var node_8 = sibling(node_7, 2);
17116
17098
  {
17117
17099
  var consequent_7 = ($$anchor3) => {
17118
- var div_18 = root_10();
17100
+ var div_18 = root_10$1();
17119
17101
  var node_9 = child(div_18);
17120
17102
  {
17121
17103
  let $0 = /* @__PURE__ */ user_derived(() => get$1(proceedPrenoteMessage) || "");
@@ -17385,7 +17367,7 @@ function AddBankAccount($$anchor, $$props) {
17385
17367
  baseForm.handlers.handleFieldBlur("ach_routing_number");
17386
17368
  const routing = baseForm.state.formData.ach_details.routing_number;
17387
17369
  if (baseForm.state.alviereCore && (routing == null ? void 0 : routing.length) === 9 && !get$1(isLoadingBankInfo) && get$1(bankInfo) === null) {
17388
- baseForm.actions.setFieldError("ach_routing_number", getFieldErrorMessage("ach_routing_number", "pattern", INVALID_ROUTING_NUMBER_MESSAGE));
17370
+ baseForm.actions.setFieldError("ach_routing_number", INVALID_ROUTING_NUMBER_MESSAGE);
17389
17371
  }
17390
17372
  }
17391
17373
  });
@@ -17782,20 +17764,31 @@ customElements.define("alviere-add-bank-account", create_custom_element(
17782
17764
  [],
17783
17765
  true
17784
17766
  ));
17767
+ function subscribeToOnlineEvent(callback) {
17768
+ if (typeof window === "undefined") return () => {
17769
+ };
17770
+ window.addEventListener("online", callback);
17771
+ return () => window.removeEventListener("online", callback);
17772
+ }
17785
17773
  function createLegalTextsResolver({ getDocumentTypes, getCore }) {
17786
17774
  let resolvedDocuments = /* @__PURE__ */ state(proxy([]));
17787
17775
  let isLoading = /* @__PURE__ */ state(false);
17788
17776
  let hasResolved = /* @__PURE__ */ state(false);
17789
17777
  let error = /* @__PURE__ */ state(null);
17790
17778
  let lastSignature = null;
17779
+ let lastRetryCount = 0;
17780
+ let retryCount = /* @__PURE__ */ state(0);
17791
17781
  const getKey = (doc) => `${doc.type}:${doc.version || "latest"}`;
17792
17782
  user_effect(() => {
17793
17783
  const core = getCore();
17794
17784
  const documentTypes = getDocumentTypes();
17795
17785
  const signature = documentTypes.map(getKey).join("|");
17786
+ const currentRetry = get$1(retryCount);
17796
17787
  if (!core) return;
17797
- if (signature === lastSignature) return;
17788
+ const isRetry = currentRetry !== lastRetryCount;
17789
+ if (signature === lastSignature && !isRetry) return;
17798
17790
  lastSignature = signature;
17791
+ lastRetryCount = currentRetry;
17799
17792
  if (!signature) {
17800
17793
  set(resolvedDocuments, [], true);
17801
17794
  set(hasResolved, true);
@@ -17803,6 +17796,24 @@ function createLegalTextsResolver({ getDocumentTypes, getCore }) {
17803
17796
  }
17804
17797
  void fetchLegalTexts(core, documentTypes);
17805
17798
  });
17799
+ user_effect(() => {
17800
+ let debounceTimer = null;
17801
+ const unsubscribe = subscribeToOnlineEvent(() => {
17802
+ if (!get$1(error)) return;
17803
+ if (debounceTimer) clearTimeout(debounceTimer);
17804
+ debounceTimer = setTimeout(retry, 1e3);
17805
+ });
17806
+ return () => {
17807
+ unsubscribe();
17808
+ if (debounceTimer) clearTimeout(debounceTimer);
17809
+ };
17810
+ });
17811
+ function retry() {
17812
+ if (get$1(isLoading)) return;
17813
+ set(error, null);
17814
+ set(hasResolved, false);
17815
+ update(retryCount);
17816
+ }
17806
17817
  async function fetchLegalTexts(core, documentTypes) {
17807
17818
  set(isLoading, true);
17808
17819
  set(error, null);
@@ -17840,7 +17851,8 @@ function createLegalTextsResolver({ getDocumentTypes, getCore }) {
17840
17851
  },
17841
17852
  get error() {
17842
17853
  return get$1(error);
17843
- }
17854
+ },
17855
+ retry
17844
17856
  };
17845
17857
  }
17846
17858
  var root_1$7 = /* @__PURE__ */ from_html(`<div class="spinner-container svelte-1l48sab"><alviere-spinner></alviere-spinner></div>`, 2);
@@ -17849,10 +17861,13 @@ var root_4$4 = /* @__PURE__ */ from_html(`<div class="alviere-checkout-confirm__
17849
17861
  var root_3$5 = /* @__PURE__ */ from_html(`<section class="alviere-checkout-confirm__summary svelte-1l48sab"><div class="alviere-checkout-confirm__summary-row svelte-1l48sab"><span class="alviere-checkout-confirm__summary-label svelte-1l48sab"> </span> <span class="alviere-checkout-confirm__summary-value svelte-1l48sab"> </span></div> <div class="alviere-checkout-confirm__summary-row svelte-1l48sab"><span class="alviere-checkout-confirm__summary-label svelte-1l48sab"> </span> <span class="alviere-checkout-confirm__summary-value svelte-1l48sab"> </span></div> <!> <div class="alviere-checkout-confirm__summary-divider svelte-1l48sab" aria-hidden="true"></div> <div class="alviere-checkout-confirm__summary-row alviere-checkout-confirm__summary-row--total svelte-1l48sab"><span class="alviere-checkout-confirm__summary-label svelte-1l48sab"> </span> <span class="alviere-checkout-confirm__summary-value svelte-1l48sab"> </span></div></section>`);
17850
17862
  var root_5$3 = /* @__PURE__ */ from_html(`<div class="alviere-checkout-confirm__terms-and-conditions"><p> </p> <alviere-legal-text-consent></alviere-legal-text-consent></div>`, 2);
17851
17863
  var root_6$2 = /* @__PURE__ */ from_html(`<div class="alviere-checkout-confirm__timing-info svelte-1l48sab"><!></div>`);
17852
- var root$7 = /* @__PURE__ */ from_html(`<div class="alviere-checkout-confirm svelte-1l48sab"><!> <div class="alviere-checkout-confirm__payment-info svelte-1l48sab"><!> <!> <!> <alviere-button> </alviere-button></div></div>`, 2);
17864
+ var root_7$1 = /* @__PURE__ */ from_html(`<div class="alviere-checkout-confirm__legal-texts-loading svelte-1l48sab"><alviere-spinner></alviere-spinner></div>`, 2);
17865
+ var root_9$2 = /* @__PURE__ */ from_html(`<div class="alviere-checkout-confirm__legal-texts-error svelte-1l48sab"><!> <alviere-button> </alviere-button></div>`, 2);
17866
+ var root_10 = /* @__PURE__ */ from_html(`<alviere-button> </alviere-button>`, 2);
17867
+ var root$7 = /* @__PURE__ */ from_html(`<div class="alviere-checkout-confirm svelte-1l48sab"><!> <div class="alviere-checkout-confirm__payment-info svelte-1l48sab"><!> <!> <!> <!></div></div>`);
17853
17868
  const $$css$a = {
17854
17869
  hash: "svelte-1l48sab",
17855
- code: ":root {--alv-color-primary: #227e9e;--alv-color-primary-hover: #1b6680;--alv-color-primary-active: #145164;--alv-color-primary-light: #e8f4f8;--alv-color-primary-light-hover: #d1e8f0;--alv-color-on-primary: #ffffff;--alv-color-success: #436b1d;--alv-color-success-light: #d4edda;--alv-color-success-border: #c3e6cb;--alv-color-success-text: #155724;--alv-color-on-success: #ffffff;--alv-color-success-rgb: 67, 107, 29;--alv-color-error: #b3311f;--alv-color-error-light: #f8d7da;--alv-color-error-border: #f5c6cb;--alv-color-error-text: #721c24;--alv-color-on-error: #ffffff;--alv-color-error-rgb: 179, 49, 31;--alv-color-warning: #ffc107;--alv-color-warning-light: #fff3cd;--alv-color-warning-border: #ffeaa7;--alv-color-warning-text: #856404;--alv-color-on-warning: #000000;--alv-color-info: #175db8;--alv-color-info-light: #d1ecf1;--alv-color-info-border: #bee5eb;--alv-color-info-text: #0c5460;--alv-color-on-info: #ffffff;--alv-color-gray-50: #fafafa;--alv-color-gray-100: #f4f4f5;--alv-color-gray-200: #e4e4e7;--alv-color-gray-300: #d4d4d8;--alv-color-gray-400: #a1a1aa;--alv-color-gray-500: #71717a;--alv-color-gray-600: #52525b;--alv-color-gray-700: #3f3f46;--alv-color-gray-800: #27272a;--alv-color-gray-900: #18181b;--alv-color-surface: #ffffff;--alv-color-surface-secondary: #f9fafb;--alv-color-surface-tertiary: #f4f4f5;--alv-color-surface-elevated: #ffffff;--alv-color-text-primary: #18181b;--alv-color-text-secondary: #52525b;--alv-color-text-tertiary: #71717a;--alv-color-text-disabled: #a1a1aa;--alv-color-text-on-primary: #ffffff;--alv-color-text-on-surface: #18181b;--alv-color-border: #e4e4e7;--alv-color-border-hover: #d4d4d8;--alv-color-border-focus: #227e9e;--alv-color-border-error: #b3311f;--alv-color-border-success: #436b1d;--alv-color-background: #ffffff;--alv-color-background-disabled: #f4f4f5;--alv-color-background-hover: #f9fafb;--alv-color-background-active: #f4f4f5;}:root {--alv-font-family-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;--alv-font-family-grotesque: 'Darker Grotesque', sans-serif;--alv-font-family-mono: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;--alv-font-size-3xs: 0.625rem;--alv-font-size-2xs: 0.75rem;--alv-font-size-xs: 1rem;--alv-font-size-sm: 1.125rem;--alv-font-size-base: 1.25rem;--alv-font-size-lg: 1.5rem;--alv-font-size-xl: 1.75rem;--alv-font-weight-light: 300;--alv-font-weight-normal: 400;--alv-font-weight-medium: 500;--alv-font-weight-semibold: 600;--alv-font-weight-bold: 700;--alv-line-height-tight: 1.25;--alv-line-height-normal: 1.5;--alv-line-height-relaxed: 1.75;}:root {--alv-spacing-xs: 0.25rem;--alv-spacing-sm: 0.5rem;--alv-spacing-md: 1rem;--alv-spacing-lg: 1.5rem;--alv-spacing-xl: 2rem;--alv-spacing-2xl: 3rem;--alv-spacing-3xl: 4rem;}:root {--alv-border-radius-none: 0;--alv-border-radius-sm: 0.125rem;--alv-border-radius: 0.25rem;--alv-border-radius-md: 0.375rem;--alv-border-radius-lg: 0.5rem;--alv-border-radius-xl: 0.75rem;--alv-border-radius-2xl: 1rem;--alv-border-radius-full: 9999px;}:root {--alv-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);--alv-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);--alv-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);--alv-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);--alv-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);--alv-shadow-none: none;}:root {--alv-transition-fast: 150ms ease-in-out;--alv-transition-normal: 250ms ease-in-out;--alv-transition-slow: 350ms ease-in-out;--alv-transition-none: none;}:root {--alv-input-height-sm: 2.5rem;--alv-input-height: 3.25rem;--alv-input-height-lg: 3.75rem;--alv-input-padding-x: 0.75rem;--alv-input-padding-y: 0.5rem;--alv-input-border-color: var(--alv-color-border);--alv-input-border-hover: var(--alv-color-border-hover);--alv-input-border-focus: var(--alv-color-border-focus);--alv-input-bg: var(--alv-color-background);--alv-input-bg-disabled: var(--alv-color-background-disabled);}:root {--alv-z-dropdown: 1000;--alv-z-sticky: 1020;--alv-z-fixed: 1030;--alv-z-modal-backdrop: 1040;--alv-z-modal: 1050;--alv-z-popover: 1060;--alv-z-tooltip: 1070;}:root {--alv-button-primary-bg: var(--alv-color-primary);--alv-button-primary-bg-hover: var(--alv-color-primary-hover);--alv-button-primary-bg-active: var(--alv-color-primary-active);--alv-button-primary-text: var(--alv-color-on-primary);--alv-button-primary-border: var(--alv-color-primary);--alv-button-secondary-bg: transparent;--alv-button-secondary-bg-hover: var(--alv-color-primary-light);--alv-button-secondary-bg-active: var(--alv-color-primary-light-hover);--alv-button-secondary-text: var(--alv-color-primary);--alv-button-secondary-border: var(--alv-color-primary);--alv-button-tertiary-bg: transparent;--alv-button-tertiary-bg-hover: var(--alv-color-gray-100);--alv-button-tertiary-bg-active: var(--alv-color-gray-200);--alv-button-tertiary-text: var(--alv-color-text-primary);--alv-button-tertiary-border: transparent;--alv-button-link-bg: transparent;--alv-button-link-bg-hover: transparent;--alv-button-link-bg-active: transparent;--alv-button-link-text: var(--alv-color-primary);--alv-button-link-text-hover: var(--alv-color-primary-hover);--alv-button-link-border: transparent;}:root {--alv-spinner-color: var(--alv-color-text-primary);--alv-spinner-size-sm: 1rem;--alv-spinner-size-md: 1.5rem;--alv-spinner-size-lg: 4rem;--alv-spinner-stroke-width: 2px;}:root {--alv-timeline-color: var(--alv-color-gray-600);--alv-timeline-completed-color: var(--alv-color-success);--alv-timeline-error-color: var(--alv-color-error);--alv-timeline-pending-color: var(--alv-color-gray-400);--alv-timeline-step-size-sm: 1.25rem;--alv-timeline-step-size-md: 2rem;--alv-timeline-step-size-lg: 2.5rem;--alv-timeline-connector-width: 3px;--alv-timeline-font-size: var(--alv-font-size-base);}:root {--alv-badge-primary-bg: var(--alv-color-primary);--alv-badge-primary-text: var(--alv-color-on-primary);--alv-badge-secondary-bg: var(--alv-color-gray-200);--alv-badge-secondary-text: var(--alv-color-text-primary);--alv-badge-success-bg: var(--alv-color-success);--alv-badge-success-text: var(--alv-color-on-success);--alv-badge-error-bg: var(--alv-color-error);--alv-badge-error-text: var(--alv-color-on-error);--alv-badge-warning-bg: var(--alv-color-warning);--alv-badge-warning-text: var(--alv-color-on-warning);--alv-badge-info-bg: var(--alv-color-info);--alv-badge-info-text: var(--alv-color-on-info);}:root {--alv-list-bg: var(--alv-color-surface);--alv-list-border: var(--alv-color-border);--alv-list-item-bg: transparent;--alv-list-item-bg-hover: var(--alv-color-background-hover);--alv-list-item-bg-active: var(--alv-color-background-active);--alv-list-item-text: var(--alv-color-text-primary);--alv-list-item-text-secondary: var(--alv-color-text-secondary);}:root {--alv-radio-border: var(--alv-color-border);--alv-radio-border-hover: var(--alv-color-border-hover);--alv-radio-border-focus: var(--alv-color-border-focus);--alv-radio-bg: var(--alv-color-background);--alv-radio-checked-bg: var(--alv-color-primary);--alv-radio-checked-border: var(--alv-color-primary);--alv-radio-text: var(--alv-color-text-primary);--alv-radio-text-disabled: var(--alv-color-text-disabled);}.alviere-checkout-confirm.svelte-1l48sab {display:flex;flex-direction:column;gap:1rem;position:relative;padding:1rem 0;}.alviere-checkout-confirm__payment-info.svelte-1l48sab {display:flex;flex-direction:column;gap:2rem;}.alviere-checkout-confirm__payment-info.svelte-1l48sab alviere-button:where(.svelte-1l48sab) {align-self:center;}.alviere-checkout-confirm__summary.svelte-1l48sab {width:100%;display:flex;flex-direction:column;gap:0.5rem;}.alviere-checkout-confirm__summary-row.svelte-1l48sab {display:flex;align-items:baseline;justify-content:space-between;gap:1rem;}.alviere-checkout-confirm__summary-row--total.svelte-1l48sab {font-weight:600;color:#000000;}.alviere-checkout-confirm__summary-label.svelte-1l48sab {color:#000000;font-size:1rem;}.alviere-checkout-confirm__summary-value.svelte-1l48sab {color:#000000;font-size:1rem;font-weight:400;text-align:right;overflow-wrap:anywhere;}.alviere-checkout-confirm__summary-divider.svelte-1l48sab {border-top:1px dashed #000000;margin:0.25rem 0;}.alviere-checkout-confirm__timing-info.svelte-1l48sab {width:100%;}.alviere-checkout-confirm.svelte-1l48sab .spinner-container:where(.svelte-1l48sab) {position:absolute;display:flex;justify-content:center;align-items:center;height:100%;width:100%;background-color:rgba(255, 255, 255, 0.2);backdrop-filter:blur(3px);z-index:1000;}"
17870
+ code: ":root {--alv-color-primary: #227e9e;--alv-color-primary-hover: #1b6680;--alv-color-primary-active: #145164;--alv-color-primary-light: #e8f4f8;--alv-color-primary-light-hover: #d1e8f0;--alv-color-on-primary: #ffffff;--alv-color-success: #436b1d;--alv-color-success-light: #d4edda;--alv-color-success-border: #c3e6cb;--alv-color-success-text: #155724;--alv-color-on-success: #ffffff;--alv-color-success-rgb: 67, 107, 29;--alv-color-error: #b3311f;--alv-color-error-light: #f8d7da;--alv-color-error-border: #f5c6cb;--alv-color-error-text: #721c24;--alv-color-on-error: #ffffff;--alv-color-error-rgb: 179, 49, 31;--alv-color-warning: #ffc107;--alv-color-warning-light: #fff3cd;--alv-color-warning-border: #ffeaa7;--alv-color-warning-text: #856404;--alv-color-on-warning: #000000;--alv-color-info: #175db8;--alv-color-info-light: #d1ecf1;--alv-color-info-border: #bee5eb;--alv-color-info-text: #0c5460;--alv-color-on-info: #ffffff;--alv-color-gray-50: #fafafa;--alv-color-gray-100: #f4f4f5;--alv-color-gray-200: #e4e4e7;--alv-color-gray-300: #d4d4d8;--alv-color-gray-400: #a1a1aa;--alv-color-gray-500: #71717a;--alv-color-gray-600: #52525b;--alv-color-gray-700: #3f3f46;--alv-color-gray-800: #27272a;--alv-color-gray-900: #18181b;--alv-color-surface: #ffffff;--alv-color-surface-secondary: #f9fafb;--alv-color-surface-tertiary: #f4f4f5;--alv-color-surface-elevated: #ffffff;--alv-color-text-primary: #18181b;--alv-color-text-secondary: #52525b;--alv-color-text-tertiary: #71717a;--alv-color-text-disabled: #a1a1aa;--alv-color-text-on-primary: #ffffff;--alv-color-text-on-surface: #18181b;--alv-color-border: #e4e4e7;--alv-color-border-hover: #d4d4d8;--alv-color-border-focus: #227e9e;--alv-color-border-error: #b3311f;--alv-color-border-success: #436b1d;--alv-color-background: #ffffff;--alv-color-background-disabled: #f4f4f5;--alv-color-background-hover: #f9fafb;--alv-color-background-active: #f4f4f5;}:root {--alv-font-family-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;--alv-font-family-grotesque: 'Darker Grotesque', sans-serif;--alv-font-family-mono: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;--alv-font-size-3xs: 0.625rem;--alv-font-size-2xs: 0.75rem;--alv-font-size-xs: 1rem;--alv-font-size-sm: 1.125rem;--alv-font-size-base: 1.25rem;--alv-font-size-lg: 1.5rem;--alv-font-size-xl: 1.75rem;--alv-font-weight-light: 300;--alv-font-weight-normal: 400;--alv-font-weight-medium: 500;--alv-font-weight-semibold: 600;--alv-font-weight-bold: 700;--alv-line-height-tight: 1.25;--alv-line-height-normal: 1.5;--alv-line-height-relaxed: 1.75;}:root {--alv-spacing-xs: 0.25rem;--alv-spacing-sm: 0.5rem;--alv-spacing-md: 1rem;--alv-spacing-lg: 1.5rem;--alv-spacing-xl: 2rem;--alv-spacing-2xl: 3rem;--alv-spacing-3xl: 4rem;}:root {--alv-border-radius-none: 0;--alv-border-radius-sm: 0.125rem;--alv-border-radius: 0.25rem;--alv-border-radius-md: 0.375rem;--alv-border-radius-lg: 0.5rem;--alv-border-radius-xl: 0.75rem;--alv-border-radius-2xl: 1rem;--alv-border-radius-full: 9999px;}:root {--alv-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);--alv-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);--alv-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);--alv-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);--alv-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);--alv-shadow-none: none;}:root {--alv-transition-fast: 150ms ease-in-out;--alv-transition-normal: 250ms ease-in-out;--alv-transition-slow: 350ms ease-in-out;--alv-transition-none: none;}:root {--alv-input-height-sm: 2.5rem;--alv-input-height: 3.25rem;--alv-input-height-lg: 3.75rem;--alv-input-padding-x: 0.75rem;--alv-input-padding-y: 0.5rem;--alv-input-border-color: var(--alv-color-border);--alv-input-border-hover: var(--alv-color-border-hover);--alv-input-border-focus: var(--alv-color-border-focus);--alv-input-bg: var(--alv-color-background);--alv-input-bg-disabled: var(--alv-color-background-disabled);}:root {--alv-z-dropdown: 1000;--alv-z-sticky: 1020;--alv-z-fixed: 1030;--alv-z-modal-backdrop: 1040;--alv-z-modal: 1050;--alv-z-popover: 1060;--alv-z-tooltip: 1070;}:root {--alv-button-primary-bg: var(--alv-color-primary);--alv-button-primary-bg-hover: var(--alv-color-primary-hover);--alv-button-primary-bg-active: var(--alv-color-primary-active);--alv-button-primary-text: var(--alv-color-on-primary);--alv-button-primary-border: var(--alv-color-primary);--alv-button-secondary-bg: transparent;--alv-button-secondary-bg-hover: var(--alv-color-primary-light);--alv-button-secondary-bg-active: var(--alv-color-primary-light-hover);--alv-button-secondary-text: var(--alv-color-primary);--alv-button-secondary-border: var(--alv-color-primary);--alv-button-tertiary-bg: transparent;--alv-button-tertiary-bg-hover: var(--alv-color-gray-100);--alv-button-tertiary-bg-active: var(--alv-color-gray-200);--alv-button-tertiary-text: var(--alv-color-text-primary);--alv-button-tertiary-border: transparent;--alv-button-link-bg: transparent;--alv-button-link-bg-hover: transparent;--alv-button-link-bg-active: transparent;--alv-button-link-text: var(--alv-color-primary);--alv-button-link-text-hover: var(--alv-color-primary-hover);--alv-button-link-border: transparent;}:root {--alv-spinner-color: var(--alv-color-text-primary);--alv-spinner-size-sm: 1rem;--alv-spinner-size-md: 1.5rem;--alv-spinner-size-lg: 4rem;--alv-spinner-stroke-width: 2px;}:root {--alv-timeline-color: var(--alv-color-gray-600);--alv-timeline-completed-color: var(--alv-color-success);--alv-timeline-error-color: var(--alv-color-error);--alv-timeline-pending-color: var(--alv-color-gray-400);--alv-timeline-step-size-sm: 1.25rem;--alv-timeline-step-size-md: 2rem;--alv-timeline-step-size-lg: 2.5rem;--alv-timeline-connector-width: 3px;--alv-timeline-font-size: var(--alv-font-size-base);}:root {--alv-badge-primary-bg: var(--alv-color-primary);--alv-badge-primary-text: var(--alv-color-on-primary);--alv-badge-secondary-bg: var(--alv-color-gray-200);--alv-badge-secondary-text: var(--alv-color-text-primary);--alv-badge-success-bg: var(--alv-color-success);--alv-badge-success-text: var(--alv-color-on-success);--alv-badge-error-bg: var(--alv-color-error);--alv-badge-error-text: var(--alv-color-on-error);--alv-badge-warning-bg: var(--alv-color-warning);--alv-badge-warning-text: var(--alv-color-on-warning);--alv-badge-info-bg: var(--alv-color-info);--alv-badge-info-text: var(--alv-color-on-info);}:root {--alv-list-bg: var(--alv-color-surface);--alv-list-border: var(--alv-color-border);--alv-list-item-bg: transparent;--alv-list-item-bg-hover: var(--alv-color-background-hover);--alv-list-item-bg-active: var(--alv-color-background-active);--alv-list-item-text: var(--alv-color-text-primary);--alv-list-item-text-secondary: var(--alv-color-text-secondary);}:root {--alv-radio-border: var(--alv-color-border);--alv-radio-border-hover: var(--alv-color-border-hover);--alv-radio-border-focus: var(--alv-color-border-focus);--alv-radio-bg: var(--alv-color-background);--alv-radio-checked-bg: var(--alv-color-primary);--alv-radio-checked-border: var(--alv-color-primary);--alv-radio-text: var(--alv-color-text-primary);--alv-radio-text-disabled: var(--alv-color-text-disabled);}.alviere-checkout-confirm.svelte-1l48sab {display:flex;flex-direction:column;gap:1rem;position:relative;padding:1rem 0;}.alviere-checkout-confirm__payment-info.svelte-1l48sab {display:flex;flex-direction:column;gap:2rem;}.alviere-checkout-confirm__payment-info.svelte-1l48sab alviere-button:where(.svelte-1l48sab) {align-self:center;}.alviere-checkout-confirm__summary.svelte-1l48sab {width:100%;display:flex;flex-direction:column;gap:0.5rem;}.alviere-checkout-confirm__summary-row.svelte-1l48sab {display:flex;align-items:baseline;justify-content:space-between;gap:1rem;}.alviere-checkout-confirm__summary-row--total.svelte-1l48sab {font-weight:600;color:#000000;}.alviere-checkout-confirm__summary-label.svelte-1l48sab {color:#000000;font-size:1rem;}.alviere-checkout-confirm__summary-value.svelte-1l48sab {color:#000000;font-size:1rem;font-weight:400;text-align:right;overflow-wrap:anywhere;}.alviere-checkout-confirm__summary-divider.svelte-1l48sab {border-top:1px dashed #000000;margin:0.25rem 0;}.alviere-checkout-confirm__timing-info.svelte-1l48sab {width:100%;}.alviere-checkout-confirm__legal-texts-loading.svelte-1l48sab {display:flex;justify-content:center;padding:1rem 0;}.alviere-checkout-confirm__legal-texts-error.svelte-1l48sab {display:flex;flex-direction:column;align-items:center;gap:0.5rem;}.alviere-checkout-confirm.svelte-1l48sab .spinner-container:where(.svelte-1l48sab) {position:absolute;display:flex;justify-content:center;align-items:center;height:100%;width:100%;background-color:rgba(255, 255, 255, 0.2);backdrop-filter:blur(3px);z-index:1000;}"
17856
17871
  };
17857
17872
  function CheckoutConfirm($$anchor, $$props) {
17858
17873
  push($$props, true);
@@ -17983,7 +17998,7 @@ function CheckoutConfirm($$anchor, $$props) {
17983
17998
  set(selfAmount, amount());
17984
17999
  }
17985
18000
  });
17986
- const canPay = /* @__PURE__ */ user_derived(() => () => !legalTextsResolver.requiresLegalTexts || get$1(legalTextsAccepted));
18001
+ const canPay = /* @__PURE__ */ user_derived(() => () => legalTextsResolver.hasResolved && !legalTextsResolver.error && (!legalTextsResolver.requiresLegalTexts || get$1(legalTextsAccepted)));
17987
18002
  async function handlePay() {
17988
18003
  if (!get$1(canPay)() || get$1(isSending)) return;
17989
18004
  set(isSending, true);
@@ -18254,18 +18269,74 @@ function CheckoutConfirm($$anchor, $$props) {
18254
18269
  if (get$1(paymentTimingMessage)) $$render(consequent_4);
18255
18270
  });
18256
18271
  }
18257
- var alviere_button = sibling(node_4, 2);
18258
- set_custom_element_data(alviere_button, "variant", "primary");
18259
- set_custom_element_data(alviere_button, "size", "md");
18260
- set_custom_element_data(alviere_button, "handler", handlePay);
18261
- template_effect(() => set_custom_element_data(alviere_button, "disabled", !get$1(canPay)()));
18262
- set_class(alviere_button, 1, "svelte-1l48sab");
18263
- var text_9 = child(alviere_button, true);
18264
- reset(alviere_button);
18272
+ var node_6 = sibling(node_4, 2);
18273
+ {
18274
+ var consequent_5 = ($$anchor2) => {
18275
+ var div_9 = root_7$1();
18276
+ var alviere_spinner_1 = child(div_9);
18277
+ set_custom_element_data(alviere_spinner_1, "size", "sm");
18278
+ set_custom_element_data(alviere_spinner_1, "variant", "circular");
18279
+ reset(div_9);
18280
+ append($$anchor2, div_9);
18281
+ };
18282
+ var alternate_2 = ($$anchor2) => {
18283
+ var fragment = comment();
18284
+ var node_7 = first_child(fragment);
18285
+ {
18286
+ var consequent_6 = ($$anchor3) => {
18287
+ var div_10 = root_9$2();
18288
+ var node_8 = child(div_10);
18289
+ {
18290
+ let $0 = /* @__PURE__ */ user_derived(() => getLabel("legalTextsErrorLabel", "Unable to load required agreements. Check your connection and try again."));
18291
+ Callout(node_8, {
18292
+ variant: "warning",
18293
+ get message() {
18294
+ return get$1($0);
18295
+ }
18296
+ });
18297
+ }
18298
+ var alviere_button = sibling(node_8, 2);
18299
+ set_custom_element_data(alviere_button, "variant", "secondary");
18300
+ set_custom_element_data(alviere_button, "size", "md");
18301
+ template_effect(() => set_custom_element_data(alviere_button, "handler", legalTextsResolver.retry));
18302
+ set_class(alviere_button, 1, "svelte-1l48sab");
18303
+ var text_9 = child(alviere_button, true);
18304
+ reset(alviere_button);
18305
+ reset(div_10);
18306
+ template_effect(($0) => set_text(text_9, $0), [() => getLabel("legalTextsRetryLabel", "Retry")]);
18307
+ append($$anchor3, div_10);
18308
+ };
18309
+ var alternate_1 = ($$anchor3) => {
18310
+ var alviere_button_1 = root_10();
18311
+ set_custom_element_data(alviere_button_1, "variant", "primary");
18312
+ set_custom_element_data(alviere_button_1, "size", "md");
18313
+ set_custom_element_data(alviere_button_1, "handler", handlePay);
18314
+ template_effect(() => set_custom_element_data(alviere_button_1, "disabled", !get$1(canPay)()));
18315
+ set_class(alviere_button_1, 1, "svelte-1l48sab");
18316
+ var text_10 = child(alviere_button_1, true);
18317
+ reset(alviere_button_1);
18318
+ template_effect(($0) => set_text(text_10, $0), [() => getLabel("payButtonLabel", "Pay")]);
18319
+ append($$anchor3, alviere_button_1);
18320
+ };
18321
+ if_block(
18322
+ node_7,
18323
+ ($$render) => {
18324
+ if (legalTextsResolver.error) $$render(consequent_6);
18325
+ else $$render(alternate_1, false);
18326
+ },
18327
+ true
18328
+ );
18329
+ }
18330
+ append($$anchor2, fragment);
18331
+ };
18332
+ if_block(node_6, ($$render) => {
18333
+ if (!legalTextsResolver.hasResolved) $$render(consequent_5);
18334
+ else $$render(alternate_2, false);
18335
+ });
18336
+ }
18265
18337
  reset(div_2);
18266
18338
  reset(div);
18267
18339
  bind_this(div, ($$value) => set(hostElement, $$value), () => get$1(hostElement));
18268
- template_effect(($0) => set_text(text_9, $0), [() => getLabel("payButtonLabel", "Pay")]);
18269
18340
  append($$anchor, div);
18270
18341
  var $$pop = pop($$exports);
18271
18342
  $$cleanup();
@@ -20578,6 +20649,7 @@ function MultiStepFlow($$anchor, $$props) {
20578
20649
  const accumulatedResults2 = flowManager.getAccumulatedResults();
20579
20650
  eventDispatcher.dispatchStepComplete(stepIndex, accumulatedResults2);
20580
20651
  flowManager.flowState.isComplete = true;
20652
+ jwtManager.cancelRefreshTimer();
20581
20653
  eventDispatcher.dispatchFlowComplete(accumulatedResults2);
20582
20654
  return;
20583
20655
  }
@@ -20591,6 +20663,7 @@ function MultiStepFlow($$anchor, $$props) {
20591
20663
  const accumulatedResults = flowManager.getAccumulatedResults();
20592
20664
  if (!flowManager.canGoNext()) {
20593
20665
  flowManager.flowState.isComplete = true;
20666
+ jwtManager.cancelRefreshTimer();
20594
20667
  debug() && uiLogger.info("⚡️ Flow reached completion state, dispatching flow-complete event");
20595
20668
  eventDispatcher.dispatchFlowComplete(accumulatedResults);
20596
20669
  } else {
@@ -20611,6 +20684,7 @@ function MultiStepFlow($$anchor, $$props) {
20611
20684
  if (error2 instanceof AlcoreApiError && isCriticalError(error2.errorCode)) {
20612
20685
  debug() && uiLogger.error(`🚨 Critical error - halting flow: ${error2.errorCode}`);
20613
20686
  set(flowBarrier, null);
20687
+ jwtManager.cancelRefreshTimer();
20614
20688
  set(
20615
20689
  flowError,
20616
20690
  {
@@ -20632,6 +20706,7 @@ function MultiStepFlow($$anchor, $$props) {
20632
20706
  const detail = customEvent.detail || {};
20633
20707
  debug() && uiLogger.info("⛔ Flow barrier triggered:", detail);
20634
20708
  set(flowError, null);
20709
+ jwtManager.cancelRefreshTimer();
20635
20710
  flowManager.markStepInfoBlocked(stepIndex);
20636
20711
  const commonBarrierTitle = resolveFlowLabel(["barrierTitleLabel", "barrierTitle"]);
20637
20712
  const commonBarrierMessage = resolveFlowLabel(["barrierMessageLabel", "barrierMessage"]);