@alviere/ui 0.15.1 → 0.15.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.d.ts +1 -0
- package/dist/index.js +408 -139
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/index.umd.cjs.map +1 -1
- package/dist/web-components.js +1 -1
- package/dist/web-components.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
|
|
|
10
10
|
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
11
11
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
12
12
|
var _a, _commit_callbacks, _discard_callbacks, _pending, _blocking_pending, _deferred, _dirty_effects, _maybe_dirty_effects, _Batch_instances, traverse_effect_tree_fn, defer_effects_fn, clear_marked_fn, resolve_fn, commit_fn, _pending2, _anchor, _hydrate_open, _props, _children, _effect, _main_effect, _pending_effect, _failed_effect, _offscreen_fragment, _pending_anchor, _local_pending_count, _pending_count, _is_creating_fallback, _effect_pending, _effect_pending_subscriber, _Boundary_instances, hydrate_resolved_content_fn, hydrate_pending_content_fn, get_anchor_fn, run_fn, show_pending_snippet_fn, update_pending_count_fn, _batches, _onscreen, _offscreen, _outroing, _transition, _commit, _discard, _events, _instance;
|
|
13
|
-
import { AlviereCore, AlcoreApiError, AlcoreErrorCodes, isCriticalError } from "@alviere/core";
|
|
13
|
+
import { AlviereCore, AlcoreApiError, AlcoreErrorCodes, isCriticalError, getJWTRefreshTime } from "@alviere/core";
|
|
14
14
|
import { onMount, createEventDispatcher, untrack as untrack$1 } from "svelte";
|
|
15
15
|
const PUBLIC_VERSION = "5";
|
|
16
16
|
if (typeof window !== "undefined") {
|
|
@@ -5786,12 +5786,12 @@ function createEnhancedBaseInputMixin(config) {
|
|
|
5786
5786
|
let internalValidationState = /* @__PURE__ */ state("neutral");
|
|
5787
5787
|
let internalErrorMessage = /* @__PURE__ */ state("");
|
|
5788
5788
|
const effectiveValidationState = /* @__PURE__ */ user_derived(() => () => {
|
|
5789
|
-
if (!get$1(hasInteracted)) {
|
|
5790
|
-
return "neutral";
|
|
5791
|
-
}
|
|
5792
5789
|
if (config.validationState && config.validationState !== "neutral") {
|
|
5793
5790
|
return config.validationState;
|
|
5794
5791
|
}
|
|
5792
|
+
if (!get$1(hasInteracted)) {
|
|
5793
|
+
return "neutral";
|
|
5794
|
+
}
|
|
5795
5795
|
return get$1(internalValidationState);
|
|
5796
5796
|
});
|
|
5797
5797
|
const effectiveErrorMessage = /* @__PURE__ */ user_derived(() => () => {
|
|
@@ -5838,11 +5838,11 @@ function createEnhancedBaseInputMixin(config) {
|
|
|
5838
5838
|
}
|
|
5839
5839
|
function handleInput(event2) {
|
|
5840
5840
|
set(hasInteracted, true);
|
|
5841
|
-
|
|
5842
|
-
|
|
5843
|
-
|
|
5844
|
-
|
|
5845
|
-
|
|
5841
|
+
const target = event2.target;
|
|
5842
|
+
const liveValue = target.type === "checkbox" ? target.checked : target.value;
|
|
5843
|
+
const validation = validateValue(liveValue);
|
|
5844
|
+
set(internalValidationState, validation.isValid ? "valid" : "invalid", true);
|
|
5845
|
+
set(internalErrorMessage, validation.error || "", true);
|
|
5846
5846
|
if (config.onInput) {
|
|
5847
5847
|
config.onInput(event2);
|
|
5848
5848
|
}
|
|
@@ -7975,11 +7975,11 @@ var root_1$h = /* @__PURE__ */ from_html(`<label class="alviere-text-input__labe
|
|
|
7975
7975
|
var root_2$c = /* @__PURE__ */ from_html(`<textarea class="alviere-text-input__textarea svelte-1auzwdn" spellcheck="true"></textarea>`);
|
|
7976
7976
|
var root_3$c = /* @__PURE__ */ from_html(`<input class="alviere-text-input__input svelte-1auzwdn" spellcheck="true"/>`);
|
|
7977
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>`);
|
|
7978
|
-
var root_7$
|
|
7979
|
-
var root_8$
|
|
7980
|
-
var root_6$
|
|
7978
|
+
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>`);
|
|
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>`);
|
|
7980
|
+
var root_6$6 = /* @__PURE__ */ from_html(`<button type="button" class="alviere-text-input__reveal-button svelte-1auzwdn"><!></button>`);
|
|
7981
7981
|
var root_4$b = /* @__PURE__ */ from_html(`<div class="alviere-text-input__actions svelte-1auzwdn"><!> <!></div>`);
|
|
7982
|
-
var root_9$
|
|
7982
|
+
var root_9$3 = /* @__PURE__ */ from_html(`<div class="alviere-text-input__character-count svelte-1auzwdn"> </div>`);
|
|
7983
7983
|
var root_10$2 = /* @__PURE__ */ from_html(`<div class="alviere-text-input__required svelte-1auzwdn">Required</div>`);
|
|
7984
7984
|
var root_11$3 = /* @__PURE__ */ from_html(`<div class="alviere-text-input__help svelte-1auzwdn"><!> </div>`);
|
|
7985
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>`);
|
|
@@ -8615,7 +8615,7 @@ function TextInput($$anchor, $$props) {
|
|
|
8615
8615
|
var node_4 = sibling(node_3, 2);
|
|
8616
8616
|
{
|
|
8617
8617
|
var consequent_4 = ($$anchor3) => {
|
|
8618
|
-
var button_1 = root_6$
|
|
8618
|
+
var button_1 = root_6$6();
|
|
8619
8619
|
button_1.__click = (e) => {
|
|
8620
8620
|
e.stopPropagation();
|
|
8621
8621
|
set(reveal, !get$1(reveal));
|
|
@@ -8623,11 +8623,11 @@ function TextInput($$anchor, $$props) {
|
|
|
8623
8623
|
var node_5 = child(button_1);
|
|
8624
8624
|
{
|
|
8625
8625
|
var consequent_3 = ($$anchor4) => {
|
|
8626
|
-
var svg = root_7$
|
|
8626
|
+
var svg = root_7$2();
|
|
8627
8627
|
append($$anchor4, svg);
|
|
8628
8628
|
};
|
|
8629
8629
|
var alternate_1 = ($$anchor4) => {
|
|
8630
|
-
var svg_1 = root_8$
|
|
8630
|
+
var svg_1 = root_8$4();
|
|
8631
8631
|
append($$anchor4, svg_1);
|
|
8632
8632
|
};
|
|
8633
8633
|
if_block(node_5, ($$render) => {
|
|
@@ -8652,7 +8652,7 @@ function TextInput($$anchor, $$props) {
|
|
|
8652
8652
|
var node_6 = sibling(node_2, 2);
|
|
8653
8653
|
{
|
|
8654
8654
|
var consequent_6 = ($$anchor2) => {
|
|
8655
|
-
var div_3 = root_9$
|
|
8655
|
+
var div_3 = root_9$3();
|
|
8656
8656
|
var text_1 = child(div_3);
|
|
8657
8657
|
reset(div_3);
|
|
8658
8658
|
template_effect(() => set_text(text_1, `${get$1(characterCount) ?? ""}/${maxlength() ?? ""}`));
|
|
@@ -9579,7 +9579,7 @@ var root_2$a = /* @__PURE__ */ from_html(`<span class="alviere-phone-input__char
|
|
|
9579
9579
|
var root_3$b = /* @__PURE__ */ from_html(`<div class="alviere-phone-input__required svelte-15yozux">Required</div>`);
|
|
9580
9580
|
var root_4$a = /* @__PURE__ */ from_html(`<div class="alviere-phone-input__help svelte-15yozux"><!> </div>`);
|
|
9581
9581
|
var root_5$6 = /* @__PURE__ */ from_html(`<div class="alviere-phone-input__error svelte-15yozux" 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>`);
|
|
9582
|
-
var root_6$
|
|
9582
|
+
var root_6$5 = /* @__PURE__ */ from_html(`<div class="alviere-phone-input__warning svelte-15yozux" role="status"><!> </div>`);
|
|
9583
9583
|
var root$e = /* @__PURE__ */ from_html(`<div><div><!> <input type="tel"/> <!> <!></div> <div class="alviere-phone-input__validation-messages svelte-15yozux"><!> <!> <!></div></div>`);
|
|
9584
9584
|
const $$css$i = {
|
|
9585
9585
|
hash: "svelte-15yozux",
|
|
@@ -10028,7 +10028,7 @@ function PhoneInput($$anchor, $$props) {
|
|
|
10028
10028
|
var node_6 = sibling(node_5, 2);
|
|
10029
10029
|
{
|
|
10030
10030
|
var consequent_5 = ($$anchor2) => {
|
|
10031
|
-
var div_6 = root_6$
|
|
10031
|
+
var div_6 = root_6$5();
|
|
10032
10032
|
var node_7 = child(div_6);
|
|
10033
10033
|
html(node_7, () => infoIcon.outerHTML);
|
|
10034
10034
|
var text_4 = sibling(node_7);
|
|
@@ -11812,21 +11812,21 @@ customElements.define("alviere-ein-input", create_custom_element(
|
|
|
11812
11812
|
var root_1$b = /* @__PURE__ */ from_html(`<label class="alviere-search-select__label svelte-roni7d"> </label>`);
|
|
11813
11813
|
var root_2$6 = /* @__PURE__ */ from_html(`<div class="alviere-search-select__display-value svelte-roni7d"> </div>`);
|
|
11814
11814
|
var root_3$7 = /* @__PURE__ */ from_html(`<button type="button" class="alviere-search-select__clear-button svelte-roni7d" aria-label="Clear selection"><!></button>`);
|
|
11815
|
-
var
|
|
11816
|
-
var
|
|
11817
|
-
var
|
|
11818
|
-
var
|
|
11819
|
-
var
|
|
11815
|
+
var root_4$6 = /* @__PURE__ */ from_html(`<div class="alviere-search-select__required svelte-roni7d">Required</div>`);
|
|
11816
|
+
var root_6$4 = /* @__PURE__ */ from_html(`<div class="alviere-search-select__loading-message svelte-roni7d"> </div>`);
|
|
11817
|
+
var root_8$3 = /* @__PURE__ */ from_html(`<div class="alviere-search-select__no-options-message svelte-roni7d"> </div>`);
|
|
11818
|
+
var root_10$1 = /* @__PURE__ */ from_html(`<div role="option" tabindex="0"> </div>`);
|
|
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>`);
|
|
11820
11820
|
var root_11$2 = /* @__PURE__ */ from_html(`<div class="alviere-search-select__help svelte-roni7d"> </div>`);
|
|
11821
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>`);
|
|
11822
11822
|
var root_13$2 = /* @__PURE__ */ from_html(`<div class="alviere-search-select__warning svelte-roni7d" role="status"><!> </div>`);
|
|
11823
|
-
var root$a = /* @__PURE__ */ from_html(`<div><div class="alviere-search-select__container svelte-roni7d"><div><!> <input type="text" class="alviere-search-select__input svelte-roni7d"
|
|
11823
|
+
var root$a = /* @__PURE__ */ from_html(`<div><div class="alviere-search-select__container svelte-roni7d"><div><!> <input type="text" class="alviere-search-select__input svelte-roni7d" role="combobox" aria-haspopup="listbox" aria-controls="search-select-dropdown"/> <!> <div class="alviere-search-select__actions svelte-roni7d"><!> <button type="button" tabindex="-1" aria-hidden="true"><!></button></div> <!></div> <!></div> <div class="alviere-search-select__validation-messages svelte-roni7d"><!> <!> <!></div></div>`);
|
|
11824
11824
|
const $$css$e = {
|
|
11825
11825
|
hash: "svelte-roni7d",
|
|
11826
11826
|
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-search-select.svelte-roni7d {position:relative;width:100%;}.alviere-search-select__label.svelte-roni7d {position:absolute;max-width:calc(100% - 1.5rem);inset-inline-start:0.75rem;top:calc(50% + 1px);transform:translateY(-50%);transition:all 250ms ease-in-out;transition-delay:0.1s;display:block;font-size:1rem;font-weight:500;color:#3f3f46;line-height:1.25;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.alviere-search-select__required.svelte-roni7d {font-size:0.75rem;color:#3f3f46;text-align:end;position:absolute;right:1rem;top:calc(50% + 1px);transform:translateY(-50%);pointer-events:none;}.alviere-search-select__error.svelte-roni7d {display:flex;align-items:center;gap:0.25rem;font-size:0.75rem;color:#b3311f;line-height:1.25;}.alviere-search-select__warning.svelte-roni7d {display:flex;align-items:center;gap:0.25rem;font-size:0.75rem;color:#856404;line-height:1.25;}.alviere-search-select__warning.svelte-roni7d svg {width:1rem;height:1rem;}.alviere-search-select__wrapper.svelte-roni7d {position:relative;display:flex;align-items:center;background:#ffffff;border:1px solid #52525b;border-radius:0.25rem;transition:border-color 150ms ease-in-out, box-shadow 150ms ease-in-out;}.alviere-search-select__wrapper--focused.svelte-roni7d {border-color:#227e9e;box-shadow:0 0 0 1px #227e9e inset;}
|
|
11827
11827
|
.alviere-search-select__wrapper--focused.svelte-roni7d:not([class*="--disabled"]):not([class*="--readonly"]) .alviere-search-select__label:where(.svelte-roni7d) {transform:translateY(calc(-50% - 0.75rem));font-size:0.75rem;}
|
|
11828
11828
|
.alviere-search-select__wrapper--focused.svelte-roni7d:not([class*="--disabled"]):not([class*="--readonly"]) .alviere-search-select__input:where(.svelte-roni7d)::placeholder {opacity:1;}
|
|
11829
|
-
.alviere-search-select__wrapper--dirty.svelte-roni7d .alviere-search-select__label:where(.svelte-roni7d) {transform:translateY(calc(-50% - 0.75rem));font-size:0.75rem;}.alviere-search-select__wrapper--disabled.svelte-roni7d {background:#f4f4f5;cursor:not-allowed;}.alviere-search-select__wrapper--readonly.svelte-roni7d {background:#f4f4f5;opacity:0.6;pointer-events:none;cursor:default;}.alviere-search-select__wrapper--valid.svelte-roni7d {border-color:#436b1d;}.alviere-search-select__wrapper--invalid.svelte-roni7d {border-color:#b3311f;}.alviere-search-select__wrapper--warning.svelte-roni7d {border-color:#ffc107;}.alviere-search-select__input.svelte-roni7d {flex:1;width:100%;height:100%;min-height:2.25rem;padding:1rem 0.75rem 0;border:none;background:transparent;font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;font-size:1.25rem;line-height:1.5rem;color:#18181b;outline:none;}.alviere-search-select__input.svelte-roni7d::placeholder {color:#71717a;opacity:0;transition:opacity 150ms ease-in-out;transition-delay:0.15s;font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;}.alviere-search-select__input.svelte-roni7d:disabled {cursor:not-allowed;color:#52525b;}.alviere-search-select__input.svelte-roni7d:read-only {cursor:default;color:#3f3f46;}.alviere-search-select__validation-messages.svelte-roni7d {min-height:1.40625rem;display:flex;justify-content:space-between;align-items:center;padding-top:0.25rem;}.alviere-search-select--sm.svelte-roni7d .alviere-search-select__wrapper:where(.svelte-roni7d) {min-height:2.5rem;}.alviere-search-select--sm.svelte-roni7d .alviere-search-select__input:where(.svelte-roni7d) {font-size:1.125rem;padding:0.25rem 0.75rem;}.alviere-search-select--sm.svelte-roni7d .alviere-search-select__label:where(.svelte-roni7d) {font-size:1rem;}.alviere-search-select--md.svelte-roni7d .alviere-search-select__wrapper:where(.svelte-roni7d) {min-height:3.25rem;}.alviere-search-select--md.svelte-roni7d .alviere-search-select__input:where(.svelte-roni7d) {font-size:1rem;}.alviere-search-select--lg.svelte-roni7d .alviere-search-select__wrapper:where(.svelte-roni7d) {min-height:3.75rem;}.alviere-search-select--lg.svelte-roni7d .alviere-search-select__input:where(.svelte-roni7d) {font-size:1.5rem;padding:0.875rem 0.75rem;}.alviere-search-select--lg.svelte-roni7d .alviere-search-select__label:where(.svelte-roni7d) {font-size:1.25rem;}.alviere-search-select.svelte-roni7d:focus-within .alviere-search-select__wrapper:where(.svelte-roni7d):not(--disabled):not(--readonly) {border-color:#227e9e;box-shadow:0 0 0 1px #227e9e inset;}.alviere-search-select__container.svelte-roni7d {position:relative;}.alviere-search-select__wrapper.svelte-roni7d {position:relative;display:flex;align-items:center;}.alviere-search-select__wrapper.svelte-roni7d:hover:not(.alviere-search-select__wrapper--disabled):not(.alviere-search-select__wrapper--readonly) {border-color:#3f3f46;}.alviere-search-select__wrapper--focused.svelte-roni7d {border-color:#227e9e;box-shadow:0 0 0 2px rgba(34, 126, 158, 0.15);}.alviere-search-select__wrapper--disabled.svelte-roni7d {cursor:not-allowed;opacity:0.7;}.alviere-search-select__wrapper--disabled.alviere-search-select__wrapper--valid.svelte-roni7d {border-color:#52525b;}.alviere-search-select__input.svelte-roni7d {flex:1;width:100%;height:100%;min-height:2.25rem;padding:1rem 0.75rem 0;border:none;background:transparent;font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;font-size:1.25rem;line-height:1.5rem;color:#18181b;outline:none;}.alviere-search-select__input.svelte-roni7d::placeholder {color:#71717a;opacity:0;transition:opacity 150ms ease-in-out;transition-delay:0.15s;font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;}.alviere-search-select__input.svelte-roni7d:disabled {cursor:not-allowed;color:#52525b;}.alviere-search-select__input.svelte-roni7d:read-only {cursor:default;color:#3f3f46;}.alviere-search-select__input.svelte-roni7d {flex:1;border:none;outline:none;background:transparent;margin:0;width:100%;height:100%;}.alviere-search-select__input.svelte-roni7d::placeholder {color:#71717a;opacity:0;transition:opacity 0.2s ease;}.alviere-search-select__input.svelte-roni7d:focus::placeholder {opacity:1;}.alviere-search-select__input.svelte-roni7d:disabled {cursor:not-allowed;color:#52525b;}.alviere-search-select__display-value.svelte-roni7d {position:absolute;left:0.75rem;right:3rem;padding-top:1rem;top:50%;transform:translateY(-50%);color:#18181b;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none;z-index:1;font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;}.alviere-search-select__actions.svelte-roni7d {position:absolute;right:0.75rem;top:50%;transform:translateY(-50%);display:flex;align-items:center;gap:0.25rem;z-index:2;}.alviere-search-select__clear-button.svelte-roni7d {display:flex;align-items:center;justify-content:center;padding:0.25rem 0.5rem;margin-right:1.5rem;background:#e4e4e7;border-radius:0.125rem;font-size:1rem;font-weight:500;color:#3f3f46;min-width:24px;min-height:24px;padding:0;border-radius:50%;cursor:pointer;transition:all 150ms ease-in-out;margin-right:0.5rem;appearance:none;border:none;}.alviere-search-select__clear-button.svelte-roni7d svg {width:0.75rem;height:0.75rem;}.alviere-search-select__clear-button.svelte-roni7d:hover {background-color:#d4d4d8;color:#27272a;}.alviere-search-select__clear-button.svelte-roni7d:focus {outline:none;box-shadow:0 0 0 2px rgba(34, 126, 158, 0.25);}.alviere-search-select__dropdown-arrow.svelte-roni7d {color:#71717a;font-size:1rem;transition:transform 150ms ease-in-out;display:flex;flex-direction:column;align-items:center;justify-content:center;background:none;border:none;padding:0;cursor:pointer;}.alviere-search-select__dropdown-arrow.svelte-roni7d:disabled {cursor:not-allowed;}.alviere-search-select__dropdown-arrow.open.svelte-roni7d {transform:rotate(180deg);}.alviere-search-select__dropdown.svelte-roni7d {position:absolute;top:100%;left:0;right:0;z-index:1000;background-color:#ffffff;border:1px solid #52525b;border-top:none;border-radius:0 0 0.25rem 0.25rem;box-shadow:0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);overflow:hidden;
|
|
11829
|
+
.alviere-search-select__wrapper--dirty.svelte-roni7d .alviere-search-select__label:where(.svelte-roni7d) {transform:translateY(calc(-50% - 0.75rem));font-size:0.75rem;}.alviere-search-select__wrapper--disabled.svelte-roni7d {background:#f4f4f5;cursor:not-allowed;}.alviere-search-select__wrapper--readonly.svelte-roni7d {background:#f4f4f5;opacity:0.6;pointer-events:none;cursor:default;}.alviere-search-select__wrapper--valid.svelte-roni7d {border-color:#436b1d;}.alviere-search-select__wrapper--invalid.svelte-roni7d {border-color:#b3311f;}.alviere-search-select__wrapper--warning.svelte-roni7d {border-color:#ffc107;}.alviere-search-select__input.svelte-roni7d {flex:1;width:100%;height:100%;min-height:2.25rem;padding:1rem 0.75rem 0;border:none;background:transparent;font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;font-size:1.25rem;line-height:1.5rem;color:#18181b;outline:none;}.alviere-search-select__input.svelte-roni7d::placeholder {color:#71717a;opacity:0;transition:opacity 150ms ease-in-out;transition-delay:0.15s;font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;}.alviere-search-select__input.svelte-roni7d:disabled {cursor:not-allowed;color:#52525b;}.alviere-search-select__input.svelte-roni7d:read-only {cursor:default;color:#3f3f46;}.alviere-search-select__validation-messages.svelte-roni7d {min-height:1.40625rem;display:flex;justify-content:space-between;align-items:center;padding-top:0.25rem;}.alviere-search-select--sm.svelte-roni7d .alviere-search-select__wrapper:where(.svelte-roni7d) {min-height:2.5rem;}.alviere-search-select--sm.svelte-roni7d .alviere-search-select__input:where(.svelte-roni7d) {font-size:1.125rem;padding:0.25rem 0.75rem;}.alviere-search-select--sm.svelte-roni7d .alviere-search-select__label:where(.svelte-roni7d) {font-size:1rem;}.alviere-search-select--md.svelte-roni7d .alviere-search-select__wrapper:where(.svelte-roni7d) {min-height:3.25rem;}.alviere-search-select--md.svelte-roni7d .alviere-search-select__input:where(.svelte-roni7d) {font-size:1rem;}.alviere-search-select--lg.svelte-roni7d .alviere-search-select__wrapper:where(.svelte-roni7d) {min-height:3.75rem;}.alviere-search-select--lg.svelte-roni7d .alviere-search-select__input:where(.svelte-roni7d) {font-size:1.5rem;padding:0.875rem 0.75rem;}.alviere-search-select--lg.svelte-roni7d .alviere-search-select__label:where(.svelte-roni7d) {font-size:1.25rem;}.alviere-search-select.svelte-roni7d:focus-within .alviere-search-select__wrapper:where(.svelte-roni7d):not(--disabled):not(--readonly) {border-color:#227e9e;box-shadow:0 0 0 1px #227e9e inset;}.alviere-search-select__container.svelte-roni7d {position:relative;}.alviere-search-select__wrapper.svelte-roni7d {position:relative;display:flex;align-items:center;}.alviere-search-select__wrapper.svelte-roni7d:hover:not(.alviere-search-select__wrapper--disabled):not(.alviere-search-select__wrapper--readonly) {border-color:#3f3f46;}.alviere-search-select__wrapper--focused.svelte-roni7d {border-color:#227e9e;box-shadow:0 0 0 2px rgba(34, 126, 158, 0.15);}.alviere-search-select__wrapper--disabled.svelte-roni7d {cursor:not-allowed;opacity:0.7;}.alviere-search-select__wrapper--disabled.alviere-search-select__wrapper--valid.svelte-roni7d {border-color:#52525b;}.alviere-search-select__input.svelte-roni7d {flex:1;width:100%;height:100%;min-height:2.25rem;padding:1rem 0.75rem 0;border:none;background:transparent;font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;font-size:1.25rem;line-height:1.5rem;color:#18181b;outline:none;}.alviere-search-select__input.svelte-roni7d::placeholder {color:#71717a;opacity:0;transition:opacity 150ms ease-in-out;transition-delay:0.15s;font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;}.alviere-search-select__input.svelte-roni7d:disabled {cursor:not-allowed;color:#52525b;}.alviere-search-select__input.svelte-roni7d:read-only {cursor:default;color:#3f3f46;}.alviere-search-select__input.svelte-roni7d {flex:1;border:none;outline:none;background:transparent;margin:0;width:100%;height:100%;}.alviere-search-select__input.svelte-roni7d::placeholder {color:#71717a;opacity:0;transition:opacity 0.2s ease;}.alviere-search-select__input.svelte-roni7d:focus::placeholder {opacity:1;}.alviere-search-select__input.svelte-roni7d:disabled {cursor:not-allowed;color:#52525b;}.alviere-search-select__display-value.svelte-roni7d {position:absolute;left:0.75rem;right:3rem;padding-top:1rem;top:50%;transform:translateY(-50%);color:#18181b;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none;z-index:1;font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;}.alviere-search-select__actions.svelte-roni7d {position:absolute;right:0.75rem;top:50%;transform:translateY(-50%);display:flex;align-items:center;gap:0.25rem;z-index:2;}.alviere-search-select__required.svelte-roni7d {right:2.5rem;}.alviere-search-select__clear-button.svelte-roni7d {display:flex;align-items:center;justify-content:center;padding:0.25rem 0.5rem;margin-right:1.5rem;background:#e4e4e7;border-radius:0.125rem;font-size:1rem;font-weight:500;color:#3f3f46;min-width:24px;min-height:24px;padding:0;border-radius:50%;cursor:pointer;transition:all 150ms ease-in-out;margin-right:0.5rem;appearance:none;border:none;}.alviere-search-select__clear-button.svelte-roni7d svg {width:0.75rem;height:0.75rem;}.alviere-search-select__clear-button.svelte-roni7d:hover {background-color:#d4d4d8;color:#27272a;}.alviere-search-select__clear-button.svelte-roni7d:focus {outline:none;box-shadow:0 0 0 2px rgba(34, 126, 158, 0.25);}.alviere-search-select__dropdown-arrow.svelte-roni7d {color:#71717a;font-size:1rem;transition:transform 150ms ease-in-out;display:flex;flex-direction:column;align-items:center;justify-content:center;background:none;border:none;padding:0;cursor:pointer;}.alviere-search-select__dropdown-arrow.svelte-roni7d:disabled {cursor:not-allowed;}.alviere-search-select__dropdown-arrow.open.svelte-roni7d {transform:rotate(180deg);}.alviere-search-select__dropdown.svelte-roni7d {position:absolute;top:100%;left:0;right:0;z-index:1000;background-color:#ffffff;border:1px solid #52525b;border-top:none;border-radius:0 0 0.25rem 0.25rem;box-shadow:0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);overflow:hidden;
|
|
11830
11830
|
animation: svelte-roni7d-dropdownFadeIn 150ms ease-in-out ease;}.alviere-search-select__options-list.svelte-roni7d {max-height:12.5rem;overflow-y:auto;}.alviere-search-select__option-item.svelte-roni7d {padding:0.5rem 1rem;cursor:pointer;transition:background-color 150ms ease-in-out;border-bottom:1px solid #f4f4f5;}.alviere-search-select__option-item.svelte-roni7d:hover {background-color:#fafafa;}.alviere-search-select__option-item.selected.svelte-roni7d {background-color:rgba(34, 126, 158, 0.1);color:#227e9e;font-weight:500;}.alviere-search-select__option-item.highlighted.svelte-roni7d {background-color:rgba(34, 126, 158, 0.1);}.alviere-search-select__option-item.svelte-roni7d:last-child {border-bottom:none;}.alviere-search-select__loading-message.svelte-roni7d, .alviere-search-select__no-options-message.svelte-roni7d {padding:1.5rem 1rem;text-align:center;color:#71717a;font-style:italic;}.alviere-search-select__help.svelte-roni7d {margin-top:0.25rem;font-size:0.75rem;color:#71717a;line-height:1.25;display:flex;align-items:flex-start;gap:0.25rem;}.alviere-search-select__help.svelte-roni7d svg {width:1rem;height:1rem;}.alviere-search-select__error.svelte-roni7d {display:flex;align-items:center;gap:0.25rem;font-size:0.75rem;color:#b3311f;line-height:1.25;}
|
|
11831
11831
|
|
|
11832
11832
|
@keyframes svelte-roni7d-dropdownFadeIn {
|
|
@@ -11845,7 +11845,7 @@ const $$css$e = {
|
|
|
11845
11845
|
function SearchSelect($$anchor, $$props) {
|
|
11846
11846
|
push($$props, true);
|
|
11847
11847
|
append_styles$1($$anchor, $$css$e);
|
|
11848
|
-
let value = prop($$props, "value", 15, ""), options = prop($$props, "options", 31, () => proxy([])), placeholder = prop($$props, "placeholder", 15, "Search..."), disabled = prop($$props, "disabled", 15, false), required = prop($$props, "required", 15, false), readonly = prop($$props, "readonly", 15, false), size = prop($$props, "size", 15, "md"), id = prop($$props, "id", 15, ""), name = prop($$props, "name", 15, ""), validationState = prop($$props, "validationState", 15, "neutral"), errorMessage = prop($$props, "errorMessage", 15, ""), helpText = prop($$props, "helpText", 15, ""), label = prop($$props, "label", 15, ""), searchPlaceholder = prop($$props, "searchPlaceholder", 15, ""), noOptionsMessage = prop($$props, "noOptionsMessage", 15, "No options found"), loadingMessage = prop($$props, "loadingMessage", 15, "Loading..."), isLoading = prop($$props, "isLoading", 15, false), maxHeight = prop($$props, "maxHeight", 15, "300px"), validationSchema = prop($$props, "validationSchema", 31, () => proxy({})), onchange = prop($$props, "onchange", 15), onfocus = prop($$props, "onfocus", 15), onblur = prop($$props, "onblur", 15);
|
|
11848
|
+
let value = prop($$props, "value", 15, ""), options = prop($$props, "options", 31, () => proxy([])), placeholder = prop($$props, "placeholder", 15, "Search..."), disabled = prop($$props, "disabled", 15, false), required = prop($$props, "required", 15, false), readonly = prop($$props, "readonly", 15, false), size = prop($$props, "size", 15, "md"), id = prop($$props, "id", 15, ""), name = prop($$props, "name", 15, ""), validationState = prop($$props, "validationState", 15, "neutral"), errorMessage = prop($$props, "errorMessage", 15, ""), helpText = prop($$props, "helpText", 15, ""), label = prop($$props, "label", 15, ""), searchPlaceholder = prop($$props, "searchPlaceholder", 15, ""), noOptionsMessage = prop($$props, "noOptionsMessage", 15, "No options found"), loadingMessage = prop($$props, "loadingMessage", 15, "Loading..."), isLoading = prop($$props, "isLoading", 15, false), maxHeight = prop($$props, "maxHeight", 15, "300px"), validationSchema = prop($$props, "validationSchema", 31, () => proxy({})), onchange = prop($$props, "onchange", 15), onfocus = prop($$props, "onfocus", 15), onblur = prop($$props, "onblur", 15), autocomplete = prop($$props, "autocomplete", 15, "off");
|
|
11849
11849
|
const dispatch = createEventDispatcher();
|
|
11850
11850
|
const ChevronDownIcon = createElement(ChevronDown);
|
|
11851
11851
|
const CrossIcon = createElement(X);
|
|
@@ -11889,6 +11889,7 @@ function SearchSelect($$anchor, $$props) {
|
|
|
11889
11889
|
let isOpen = /* @__PURE__ */ state(false);
|
|
11890
11890
|
let searchTerm = /* @__PURE__ */ state("");
|
|
11891
11891
|
let selectedIndex = /* @__PURE__ */ state(-1);
|
|
11892
|
+
let pendingFocusTimer = null;
|
|
11892
11893
|
let eventDispatcher = /* @__PURE__ */ user_derived(() => useEventDispatcher(get$1(containerElement)));
|
|
11893
11894
|
function createEventDetail() {
|
|
11894
11895
|
const selectedOption = options().find((option) => option.value === value());
|
|
@@ -11918,8 +11919,9 @@ function SearchSelect($$anchor, $$props) {
|
|
|
11918
11919
|
if (disabled() || readonly()) return;
|
|
11919
11920
|
set(isOpen, true);
|
|
11920
11921
|
set(selectedIndex, -1);
|
|
11921
|
-
setTimeout(
|
|
11922
|
+
pendingFocusTimer = setTimeout(
|
|
11922
11923
|
() => {
|
|
11924
|
+
pendingFocusTimer = null;
|
|
11923
11925
|
get$1(searchInputElement) === null || get$1(searchInputElement) === void 0 ? void 0 : get$1(searchInputElement).focus();
|
|
11924
11926
|
},
|
|
11925
11927
|
0
|
|
@@ -11928,6 +11930,10 @@ function SearchSelect($$anchor, $$props) {
|
|
|
11928
11930
|
}
|
|
11929
11931
|
function closeDropdown() {
|
|
11930
11932
|
uiLogger.info("SearchSelect: closeDropdown", disabled(), readonly());
|
|
11933
|
+
if (pendingFocusTimer !== null) {
|
|
11934
|
+
clearTimeout(pendingFocusTimer);
|
|
11935
|
+
pendingFocusTimer = null;
|
|
11936
|
+
}
|
|
11931
11937
|
set(isOpen, false);
|
|
11932
11938
|
set(searchTerm, "");
|
|
11933
11939
|
set(selectedIndex, -1);
|
|
@@ -11986,6 +11992,15 @@ function SearchSelect($$anchor, $$props) {
|
|
|
11986
11992
|
set(selectedIndex, -1);
|
|
11987
11993
|
get$1(eventDispatcher).dispatch(ComponentEvents.SEARCH_SELECT_INPUT, createEventDetail());
|
|
11988
11994
|
}
|
|
11995
|
+
function handleNativeChange(event2) {
|
|
11996
|
+
const target = event2.target;
|
|
11997
|
+
const inputValue = target.value.trim();
|
|
11998
|
+
if (!inputValue) return;
|
|
11999
|
+
const match = options().find((option) => option.label.toLowerCase() === inputValue.toLowerCase());
|
|
12000
|
+
if (match) {
|
|
12001
|
+
selectOption(match);
|
|
12002
|
+
}
|
|
12003
|
+
}
|
|
11989
12004
|
function handleInputFocus(event2) {
|
|
11990
12005
|
baseInput.handlers.handleFocus(event2);
|
|
11991
12006
|
openDropdown();
|
|
@@ -12312,6 +12327,13 @@ function SearchSelect($$anchor, $$props) {
|
|
|
12312
12327
|
set onblur($$value) {
|
|
12313
12328
|
onblur($$value);
|
|
12314
12329
|
flushSync();
|
|
12330
|
+
},
|
|
12331
|
+
get autocomplete() {
|
|
12332
|
+
return autocomplete();
|
|
12333
|
+
},
|
|
12334
|
+
set autocomplete($$value = "off") {
|
|
12335
|
+
autocomplete($$value);
|
|
12336
|
+
flushSync();
|
|
12315
12337
|
}
|
|
12316
12338
|
};
|
|
12317
12339
|
var div = root$a();
|
|
@@ -12337,6 +12359,7 @@ function SearchSelect($$anchor, $$props) {
|
|
|
12337
12359
|
var input = sibling(node, 2);
|
|
12338
12360
|
remove_input_defaults(input);
|
|
12339
12361
|
input.__input = handleSearchInput;
|
|
12362
|
+
input.__change = handleNativeChange;
|
|
12340
12363
|
input.__keydown = handleKeydown;
|
|
12341
12364
|
bind_this(input, ($$value) => set(searchInputElement, $$value), () => get$1(searchInputElement));
|
|
12342
12365
|
var node_1 = sibling(input, 2);
|
|
@@ -12384,66 +12407,76 @@ function SearchSelect($$anchor, $$props) {
|
|
|
12384
12407
|
html(node_4, () => ChevronDownIcon.outerHTML);
|
|
12385
12408
|
reset(button_1);
|
|
12386
12409
|
reset(div_4);
|
|
12387
|
-
|
|
12388
|
-
var node_5 = sibling(div_2, 2);
|
|
12410
|
+
var node_5 = sibling(div_4, 2);
|
|
12389
12411
|
{
|
|
12390
|
-
var
|
|
12412
|
+
var consequent_3 = ($$anchor2) => {
|
|
12391
12413
|
var div_5 = root_4$6();
|
|
12392
|
-
|
|
12393
|
-
|
|
12414
|
+
append($$anchor2, div_5);
|
|
12415
|
+
};
|
|
12416
|
+
if_block(node_5, ($$render) => {
|
|
12417
|
+
if (required() && baseInput.state.validationState === "neutral" && !value()) $$render(consequent_3);
|
|
12418
|
+
});
|
|
12419
|
+
}
|
|
12420
|
+
reset(div_2);
|
|
12421
|
+
var node_6 = sibling(div_2, 2);
|
|
12422
|
+
{
|
|
12423
|
+
var consequent_6 = ($$anchor2) => {
|
|
12424
|
+
var div_6 = root_5$5();
|
|
12425
|
+
var div_7 = child(div_6);
|
|
12426
|
+
var node_7 = child(div_7);
|
|
12394
12427
|
{
|
|
12395
|
-
var
|
|
12396
|
-
var
|
|
12397
|
-
var text_2 = child(
|
|
12398
|
-
reset(
|
|
12428
|
+
var consequent_4 = ($$anchor3) => {
|
|
12429
|
+
var div_8 = root_6$4();
|
|
12430
|
+
var text_2 = child(div_8, true);
|
|
12431
|
+
reset(div_8);
|
|
12399
12432
|
template_effect(() => set_text(text_2, loadingMessage()));
|
|
12400
|
-
append($$anchor3,
|
|
12433
|
+
append($$anchor3, div_8);
|
|
12401
12434
|
};
|
|
12402
12435
|
var alternate_1 = ($$anchor3) => {
|
|
12403
12436
|
var fragment = comment();
|
|
12404
|
-
var
|
|
12437
|
+
var node_8 = first_child(fragment);
|
|
12405
12438
|
{
|
|
12406
|
-
var
|
|
12407
|
-
var
|
|
12408
|
-
var text_3 = child(
|
|
12409
|
-
reset(
|
|
12439
|
+
var consequent_5 = ($$anchor4) => {
|
|
12440
|
+
var div_9 = root_8$3();
|
|
12441
|
+
var text_3 = child(div_9, true);
|
|
12442
|
+
reset(div_9);
|
|
12410
12443
|
template_effect(() => set_text(text_3, noOptionsMessage()));
|
|
12411
|
-
append($$anchor4,
|
|
12444
|
+
append($$anchor4, div_9);
|
|
12412
12445
|
};
|
|
12413
12446
|
var alternate = ($$anchor4) => {
|
|
12414
12447
|
var fragment_1 = comment();
|
|
12415
|
-
var
|
|
12416
|
-
each(
|
|
12417
|
-
var
|
|
12448
|
+
var node_9 = first_child(fragment_1);
|
|
12449
|
+
each(node_9, 17, () => get$1(filteredOptions)(), index, ($$anchor5, option, index2) => {
|
|
12450
|
+
var div_10 = root_10$1();
|
|
12418
12451
|
let classes_2;
|
|
12419
|
-
|
|
12420
|
-
|
|
12421
|
-
|
|
12452
|
+
div_10.__pointerdown = (e) => e.preventDefault();
|
|
12453
|
+
div_10.__click = () => selectOption(get$1(option));
|
|
12454
|
+
div_10.__keydown = (e) => {
|
|
12422
12455
|
if (e.key === "Enter" || e.key === " ") {
|
|
12423
12456
|
e.preventDefault();
|
|
12424
12457
|
selectOption(get$1(option));
|
|
12425
12458
|
}
|
|
12426
12459
|
};
|
|
12427
|
-
var text_4 = child(
|
|
12428
|
-
reset(
|
|
12460
|
+
var text_4 = child(div_10, true);
|
|
12461
|
+
reset(div_10);
|
|
12429
12462
|
template_effect(() => {
|
|
12430
|
-
classes_2 = set_class(
|
|
12463
|
+
classes_2 = set_class(div_10, 1, "alviere-search-select__option-item svelte-roni7d", null, classes_2, {
|
|
12431
12464
|
selected: get$1(option).value === value(),
|
|
12432
12465
|
highlighted: index2 === get$1(selectedIndex)
|
|
12433
12466
|
});
|
|
12434
|
-
set_attribute(
|
|
12435
|
-
set_attribute(
|
|
12467
|
+
set_attribute(div_10, "aria-selected", get$1(option).value === value());
|
|
12468
|
+
set_attribute(div_10, "aria-label", get$1(option).label);
|
|
12436
12469
|
set_text(text_4, get$1(option).label);
|
|
12437
12470
|
});
|
|
12438
|
-
event$1("mouseenter",
|
|
12439
|
-
append($$anchor5,
|
|
12471
|
+
event$1("mouseenter", div_10, () => set(selectedIndex, index2, true));
|
|
12472
|
+
append($$anchor5, div_10);
|
|
12440
12473
|
});
|
|
12441
12474
|
append($$anchor4, fragment_1);
|
|
12442
12475
|
};
|
|
12443
12476
|
if_block(
|
|
12444
|
-
|
|
12477
|
+
node_8,
|
|
12445
12478
|
($$render) => {
|
|
12446
|
-
if (get$1(filteredOptions)().length === 0) $$render(
|
|
12479
|
+
if (get$1(filteredOptions)().length === 0) $$render(consequent_5);
|
|
12447
12480
|
else $$render(alternate, false);
|
|
12448
12481
|
},
|
|
12449
12482
|
true
|
|
@@ -12451,34 +12484,24 @@ function SearchSelect($$anchor, $$props) {
|
|
|
12451
12484
|
}
|
|
12452
12485
|
append($$anchor3, fragment);
|
|
12453
12486
|
};
|
|
12454
|
-
if_block(
|
|
12455
|
-
if (isLoading()) $$render(
|
|
12487
|
+
if_block(node_7, ($$render) => {
|
|
12488
|
+
if (isLoading()) $$render(consequent_4);
|
|
12456
12489
|
else $$render(alternate_1, false);
|
|
12457
12490
|
});
|
|
12458
12491
|
}
|
|
12492
|
+
reset(div_7);
|
|
12493
|
+
bind_this(div_7, ($$value) => set(optionsListElement, $$value), () => get$1(optionsListElement));
|
|
12459
12494
|
reset(div_6);
|
|
12460
|
-
|
|
12461
|
-
|
|
12462
|
-
template_effect(() => set_style(div_5, `max-height: ${maxHeight() ?? ""}`));
|
|
12463
|
-
append($$anchor2, div_5);
|
|
12495
|
+
template_effect(() => set_style(div_6, `max-height: ${maxHeight() ?? ""}`));
|
|
12496
|
+
append($$anchor2, div_6);
|
|
12464
12497
|
};
|
|
12465
|
-
if_block(
|
|
12466
|
-
if (get$1(isOpen)) $$render(
|
|
12498
|
+
if_block(node_6, ($$render) => {
|
|
12499
|
+
if (get$1(isOpen)) $$render(consequent_6);
|
|
12467
12500
|
});
|
|
12468
12501
|
}
|
|
12469
12502
|
reset(div_1);
|
|
12470
|
-
var
|
|
12471
|
-
var
|
|
12472
|
-
{
|
|
12473
|
-
var consequent_6 = ($$anchor2) => {
|
|
12474
|
-
var div_11 = root_10$1();
|
|
12475
|
-
append($$anchor2, div_11);
|
|
12476
|
-
};
|
|
12477
|
-
if_block(node_9, ($$render) => {
|
|
12478
|
-
if (required() && baseInput.state.validationState === "neutral") $$render(consequent_6);
|
|
12479
|
-
});
|
|
12480
|
-
}
|
|
12481
|
-
var node_10 = sibling(node_9, 2);
|
|
12503
|
+
var div_11 = sibling(div_1, 2);
|
|
12504
|
+
var node_10 = child(div_11);
|
|
12482
12505
|
{
|
|
12483
12506
|
var consequent_7 = ($$anchor2) => {
|
|
12484
12507
|
var div_12 = root_11$2();
|
|
@@ -12525,7 +12548,7 @@ function SearchSelect($$anchor, $$props) {
|
|
|
12525
12548
|
if (baseInput.state.validationState === "warning") $$render(consequent_9);
|
|
12526
12549
|
});
|
|
12527
12550
|
}
|
|
12528
|
-
reset(
|
|
12551
|
+
reset(div_11);
|
|
12529
12552
|
reset(div);
|
|
12530
12553
|
bind_this(div, ($$value) => set(containerElement, $$value), () => get$1(containerElement));
|
|
12531
12554
|
template_effect(
|
|
@@ -12537,6 +12560,7 @@ function SearchSelect($$anchor, $$props) {
|
|
|
12537
12560
|
set_attribute(input, "name", name());
|
|
12538
12561
|
input.disabled = disabled();
|
|
12539
12562
|
input.readOnly = readonly();
|
|
12563
|
+
set_attribute(input, "autocomplete", autocomplete());
|
|
12540
12564
|
set_attribute(input, "aria-expanded", get$1(isOpen));
|
|
12541
12565
|
classes_1 = set_class(button_1, 1, "alviere-search-select__dropdown-arrow svelte-roni7d", null, classes_1, { open: get$1(isOpen) });
|
|
12542
12566
|
button_1.disabled = disabled() || readonly();
|
|
@@ -12559,7 +12583,7 @@ function SearchSelect($$anchor, $$props) {
|
|
|
12559
12583
|
append($$anchor, div);
|
|
12560
12584
|
return pop($$exports);
|
|
12561
12585
|
}
|
|
12562
|
-
delegate(["input", "keydown", "click", "pointerdown"]);
|
|
12586
|
+
delegate(["input", "change", "keydown", "click", "pointerdown"]);
|
|
12563
12587
|
customElements.define("alviere-search-select", create_custom_element(
|
|
12564
12588
|
SearchSelect,
|
|
12565
12589
|
{
|
|
@@ -12584,7 +12608,8 @@ customElements.define("alviere-search-select", create_custom_element(
|
|
|
12584
12608
|
validationSchema: {},
|
|
12585
12609
|
onchange: {},
|
|
12586
12610
|
onfocus: {},
|
|
12587
|
-
onblur: {}
|
|
12611
|
+
onblur: {},
|
|
12612
|
+
autocomplete: {}
|
|
12588
12613
|
},
|
|
12589
12614
|
[],
|
|
12590
12615
|
[
|
|
@@ -12680,7 +12705,12 @@ function Callout($$anchor, $$props) {
|
|
|
12680
12705
|
}
|
|
12681
12706
|
customElements.define("alviere-callout", create_custom_element(Callout, { message: {}, variant: {}, role: {}, ariaLive: {} }, [], [], true));
|
|
12682
12707
|
const createFlowCoreStore = () => {
|
|
12683
|
-
const { subscribe, set: set2, update: update2 } = writable({
|
|
12708
|
+
const { subscribe, set: set2, update: update2 } = writable({
|
|
12709
|
+
core: null,
|
|
12710
|
+
isInitialized: false,
|
|
12711
|
+
config: null,
|
|
12712
|
+
jwtManager: null
|
|
12713
|
+
});
|
|
12684
12714
|
return {
|
|
12685
12715
|
subscribe,
|
|
12686
12716
|
set: set2,
|
|
@@ -12729,11 +12759,22 @@ const createFlowCoreStore = () => {
|
|
|
12729
12759
|
return { ...state2, config: { ...state2.config, jwt: newJwt } };
|
|
12730
12760
|
});
|
|
12731
12761
|
},
|
|
12762
|
+
/**
|
|
12763
|
+
* Register the JwtManager so child components can call attemptReAuth()
|
|
12764
|
+
*/
|
|
12765
|
+
setJwtManager: (manager2) => {
|
|
12766
|
+
update2((state2) => ({ ...state2, jwtManager: manager2 }));
|
|
12767
|
+
},
|
|
12732
12768
|
/**
|
|
12733
12769
|
* Reset the store (cleanup)
|
|
12734
12770
|
*/
|
|
12735
12771
|
reset: () => {
|
|
12736
|
-
set2({
|
|
12772
|
+
set2({
|
|
12773
|
+
core: null,
|
|
12774
|
+
isInitialized: false,
|
|
12775
|
+
config: null,
|
|
12776
|
+
jwtManager: null
|
|
12777
|
+
});
|
|
12737
12778
|
},
|
|
12738
12779
|
/**
|
|
12739
12780
|
* Get the current core instance (for non-reactive access)
|
|
@@ -12923,8 +12964,17 @@ function createBaseFormMixin(options) {
|
|
|
12923
12964
|
const isValid = /* @__PURE__ */ user_derived(() => () => {
|
|
12924
12965
|
return get$1(allFieldsValid)() && !get$1(hasErrors)();
|
|
12925
12966
|
});
|
|
12967
|
+
const allRequiredFieldsFilled = /* @__PURE__ */ user_derived(() => () => {
|
|
12968
|
+
const schemas = resolveFieldSchemas();
|
|
12969
|
+
return Object.keys(schemas).every((name) => {
|
|
12970
|
+
var _a2;
|
|
12971
|
+
if (!((_a2 = schemas[name]) == null ? void 0 : _a2.required)) return true;
|
|
12972
|
+
const val = get$1(formData)[name];
|
|
12973
|
+
return val !== void 0 && val !== null && val !== "" && val !== false;
|
|
12974
|
+
});
|
|
12975
|
+
});
|
|
12926
12976
|
const canSubmit = /* @__PURE__ */ user_derived(() => () => {
|
|
12927
|
-
return !get$1(isLoading) && !get$1(isSubmitting) && !disabled && !readonly && get$1(isValid)();
|
|
12977
|
+
return !get$1(isLoading) && !get$1(isSubmitting) && !disabled && !readonly && get$1(isValid)() && get$1(allRequiredFieldsFilled)();
|
|
12928
12978
|
});
|
|
12929
12979
|
const submitProgress = /* @__PURE__ */ user_derived(() => () => {
|
|
12930
12980
|
if (get$1(totalSubmissions) === 0) return 0;
|
|
@@ -12936,7 +12986,26 @@ function createBaseFormMixin(options) {
|
|
|
12936
12986
|
const validFields = Object.values(get$1(fields)).filter((field) => field.isValid).length;
|
|
12937
12987
|
return validFields / totalFields * 100;
|
|
12938
12988
|
});
|
|
12989
|
+
function markAllFieldsAsInteracted() {
|
|
12990
|
+
const schemas = resolveFieldSchemas();
|
|
12991
|
+
for (const name of Object.keys(schemas)) {
|
|
12992
|
+
if (!get$1(fields)[name]) {
|
|
12993
|
+
get$1(fields)[name] = {
|
|
12994
|
+
name,
|
|
12995
|
+
value: get$1(formData)[name],
|
|
12996
|
+
isValid: true,
|
|
12997
|
+
errorMessage: "",
|
|
12998
|
+
hasInteracted: true,
|
|
12999
|
+
validationSchema: schemas[name]
|
|
13000
|
+
};
|
|
13001
|
+
} else {
|
|
13002
|
+
get$1(fields)[name].hasInteracted = true;
|
|
13003
|
+
}
|
|
13004
|
+
}
|
|
13005
|
+
}
|
|
12939
13006
|
async function submit() {
|
|
13007
|
+
markAllFieldsAsInteracted();
|
|
13008
|
+
validateAllFields();
|
|
12940
13009
|
if (!get$1(canSubmit)()) {
|
|
12941
13010
|
uiLogger.warn(`[${formName}] Cannot submit: form validation failed or is disabled`);
|
|
12942
13011
|
return;
|
|
@@ -13145,6 +13214,11 @@ function createBaseFormMixin(options) {
|
|
|
13145
13214
|
}
|
|
13146
13215
|
validateField(name);
|
|
13147
13216
|
}
|
|
13217
|
+
function getFieldDisplayState(name) {
|
|
13218
|
+
var _a2;
|
|
13219
|
+
if (get$1(validationErrors)[name] && ((_a2 = get$1(fields)[name]) == null ? void 0 : _a2.hasInteracted)) return "invalid";
|
|
13220
|
+
return "neutral";
|
|
13221
|
+
}
|
|
13148
13222
|
const eventDispatcher = /* @__PURE__ */ user_derived(() => useEventDispatcher(get$1(formElement)));
|
|
13149
13223
|
return {
|
|
13150
13224
|
state: {
|
|
@@ -13210,6 +13284,9 @@ function createBaseFormMixin(options) {
|
|
|
13210
13284
|
get hasErrors() {
|
|
13211
13285
|
return get$1(hasErrors)();
|
|
13212
13286
|
},
|
|
13287
|
+
get allRequiredFieldsFilled() {
|
|
13288
|
+
return get$1(allRequiredFieldsFilled)();
|
|
13289
|
+
},
|
|
13213
13290
|
get canSubmit() {
|
|
13214
13291
|
return get$1(canSubmit)();
|
|
13215
13292
|
},
|
|
@@ -13229,6 +13306,7 @@ function createBaseFormMixin(options) {
|
|
|
13229
13306
|
clearFieldError,
|
|
13230
13307
|
validateField,
|
|
13231
13308
|
validateAllFields,
|
|
13309
|
+
markAllFieldsAsInteracted,
|
|
13232
13310
|
clearAllErrors,
|
|
13233
13311
|
setFormData,
|
|
13234
13312
|
getFormData,
|
|
@@ -13243,7 +13321,8 @@ function createBaseFormMixin(options) {
|
|
|
13243
13321
|
handleSubmit,
|
|
13244
13322
|
handleReset,
|
|
13245
13323
|
handleFieldChange,
|
|
13246
|
-
handleFieldBlur
|
|
13324
|
+
handleFieldBlur,
|
|
13325
|
+
getFieldDisplayState
|
|
13247
13326
|
},
|
|
13248
13327
|
get eventDispatcher() {
|
|
13249
13328
|
return get$1(eventDispatcher);
|
|
@@ -13386,9 +13465,9 @@ function createAccountStatusGuard(config) {
|
|
|
13386
13465
|
notifyBarrier
|
|
13387
13466
|
};
|
|
13388
13467
|
}
|
|
13389
|
-
const INDIVIDUAL_PAYER = { "profileId": "INDIVIDUAL_PAYER", "config": { "labels": { "finalText": "Payment in process" } }, "steps": [{ "type": "CREATE_CONSUMER_ACCOUNT", "fields": { "first_name": { "required": "First Name is required", "alphabetic": true }, "last_name": { "required": "Last Name is required", "alphabetic": true }, "email_address": { "required": "Email Address is required", "email": true } }, "fieldMeta": { "first_name": { "label": "First Name" }, "last_name": { "label": "Last Name" }, "email_address": { "label": "Email Address" }, "line_1": { "label": "Address Line 1" }, "line_2": { "label": "Address Line 2" }, "city": { "label": "City" }, "state": { "label": "State/Province" }, "postal_code": { "label": "Postal Code" }, "country": { "label": "Country" } }, "config": { "groups": { "information": "consumer_information" }, "layout": [{ "label": "Personal Information", "group": "consumer_information", "rows": [{ "fields": ["first_name", "last_name"] }, { "fields": ["email_address"] }] }], "statusPolicy": { "allowedStatusesForNextStep": ["ACTIVE"], "polling": { "enabled": true, "intervalMs": 2e3, "maxRetries": 5, "terminalStatuses": ["FAILED", "REJECTED"], "onTerminal": "error" } } } }, { "type": "ADD_BANK_ACCOUNT", "fields": { "ach_routing_number": {}, "ach_account_number": {}, "ach_account_type": {} }, "fieldMeta": { "ach_routing_number": { "label": "Routing Number", "helpText": "You can find your routing number on your check or bank statement." }, "ach_account_number": { "label": "Account Number" }, "ach_account_type": { "label": "Account Type" } }, "config": { "requireRoutingAndAccountConfirmation": true, "metadata": { "payee_uuid": "{{businessUuid}}" }, "labels": { "prenoteInfoLabel": false, "prenotePendingInfoLabel": "Bank account validation and payment is expected to be completed within 5–7 business days." } } }, { "type": "CHECKOUT_CONFIRM", "config": { "labels": { "paymentTimingInfoLabel": "Payment is expected to be completed within 3–5 business days.", "paymentTimingPendingInfoLabel": "Bank account validation and payment is expected to be completed within 5–7 business days." }, "amountEditable": false, "legalTexts": { "required": true, "documents": [{ "type": "ACH_AUTHORIZATION_INDIVIDUAL_PAYER" }] } } }] };
|
|
13390
|
-
const BUSINESS_PAYER = { "profileId": "BUSINESS_PAYER", "config": { "labels": { "finalText": "Payment in process" } }, "steps": [{ "type": "CREATE_BUSINESS_ACCOUNT", "fields": { "business_name": { "required": "Business Name is required", "alphabetic": true }, "business_type": { "required": "Business Type is required" }, "country_of_incorporation": { "required": "Country of Incorporation is required" }, "state_of_incorporation": { "required": "State of Incorporation is required" }, "ein": {} }, "fieldMeta": { "business_name": { "label": "Business Name" }, "business_type": { "label": "Business Type" }, "country_of_incorporation": { "label": "Country of Incorporation" }, "state_of_incorporation": { "label": "State of Incorporation" }, "ein": { "label": "EIN" }, "email_address": { "label": "Email Address" }, "line_1": { "label": "Address Line 1" }, "line_2": { "label": "Address Line 2" }, "city": { "label": "City" }, "state": { "label": "State/Province" }, "postal_code": { "label": "Postal Code" }, "country": { "label": "Country" } }, "config": { "groups": { "information": "business_information" }, "layout": [{ "label": "Business Information", "group": "business_information", "rows": [{ "fields": ["business_name", "business_type"] }, { "fields": ["country_of_incorporation", "state_of_incorporation"] }, { "fields": ["ein"] }] }], "statusPolicy": { "allowedStatusesForNextStep": ["ACTIVE"], "polling": { "enabled": true, "intervalMs": 3e3, "maxRetries": 5, "terminalStatuses": ["FAILED", "REJECTED"], "onTerminal": "error" } } } }, { "type": "ADD_BANK_ACCOUNT", "fields": { "ach_routing_number": {}, "ach_account_number": {}, "ach_account_type": {} }, "fieldMeta": { "ach_routing_number": { "label": "Routing Number", "helpText": "You can find your routing number on your check or bank statement." }, "ach_account_number": { "label": "Account Number" }, "ach_account_type": { "label": "Account Type" } }, "config": { "requireRoutingAndAccountConfirmation": true, "metadata": { "payee_uuid": "{{businessUuid}}" }, "labels": { "prenoteInfoLabel": "New bank accounts go through prenote verification. It can take up to 3-5 business days for the account to become ACTIVE and for payments to finish processing.", "prenotePendingInfoLabel": "This bank account is still in prenote verification (PENDING). It can take up to 3-5 business days before it becomes ACTIVE and payments are processed." } } }, { "type": "CHECKOUT_CONFIRM", "config": { "labels": { "paymentTimingInfoLabel": "If this is a newly added bank account, prenote verification can take up to 3-5 business days before the account becomes ACTIVE and the payment is fully processed.", "paymentTimingPendingInfoLabel": "This bank account is still in prenote verification (PENDING). It can take up to 3-5 business days before the account becomes ACTIVE and payment processing completes." }, "amountEditable": false, "legalTexts": { "required": true, "documents": [{ "type": "ACH_AUTHORIZATION_BUSINESS_PAYER" }] } } }] };
|
|
13391
|
-
const PAYEE = { "profileId": "PAYEE", "config": { "labels": { "finalText": "Process complete" } }, "steps": [{ "type": "CREATE_BUSINESS_ACCOUNT", "fields": { "business_type": { "required": "Business Type is required" }, "business_name": { "required": "Business Name is required" }, "country_of_incorporation": { "required": "Country of Incorporation is required" }, "state_of_incorporation": { "required": "State of Incorporation is required" }, "nature_of_business": { "required": "Nature of Business is required", "numeric": "Nature of Business must only contain numbers", "minValue": { "value": 11, "message": "Nature of Business must be between 11 and 999999" }, "maxValue": { "value": 999999, "message": "Nature of Business must be between 11 and 999999" } }, "ein": { "required": "EIN is required", "numeric": "EIN must only contain numbers" }, "email_address": { "email": true }, "phone_number": { "required": "Phone Number is required", "phone": true }, "website": { "url": true }, "line_1": { "required": "Address Line 1 is required", "pattern": { "regex": "^.{2,40}$", "message": "Address Line 1 must be between 2 and 40 characters" } }, "line_2": { "pattern": { "regex": "^.{1,30}$", "message": "Address Line 2 must be between 1 and 30 characters" } }, "city": { "required": "City is required" }, "state": { "required": "State is required" }, "postal_code": { "required": "Postal Code is required", "pattern": { "regex": "^.{5,9}$", "message": "Postal Code must be between 5 and 9 characters" } } }, "fieldMeta": { "business_name": { "label": "Business Name" }, "business_type": { "label": "Business Type" }, "country_of_incorporation": { "label": "Country of Incorporation" }, "state_of_incorporation": { "label": "State of Incorporation" }, "nature_of_business": { "label": "Nature of Business (NAICS)" }, "ein": { "label": "EIN" }, "email_address": { "label": "Email Address" }, "phone_number": { "label": "Phone Number" }, "website": { "label": "Website" }, "line_1": { "label": "Address Line 1" }, "line_2": { "label": "Address Line 2" }, "city": { "label": "City" }, "state": { "label": "State" }, "postal_code": { "label": "Postal Code" } }, "config": { "labels": { "createAccountLabel": "Create Account", "creatingAccountLabel": "Creating Account...", "updateAccountLabel": "Update Account", "updatingAccountLabel": "Updating Account..." }, "groups": { "information": "business_information", "primary_address": "primary_address" }, "layout": [{ "label": "Business Information", "group": "business_information", "rows": [{ "fields": ["business_name", "business_type"] }, { "fields": ["country_of_incorporation", "state_of_incorporation"] }, { "fields": ["nature_of_business", "ein"] }, { "fields": ["email_address", "phone_number"] }, { "fields": ["website"] }] }, { "label": "Address", "group": "primary_address", "rows": [{ "fields": ["line_1"] }, { "fields": ["line_2"] }, { "fields": ["city", "state"] }, { "fields": ["postal_code"] }] }], "statusPolicy": { "allowedStatusesForNextStep": ["ACTIVE", "CREATED"], "barrierStatuses": ["MANUAL_REVIEW"], "barrierTitle": "Review in progress", "barrierMessage": "Your account is currently under review. <br />You will be able to continue once the review is complete.", "polling": { "enabled": true, "intervalMs": 3e3, "maxRetries": 5, "terminalStatuses": ["FAILED", "REJECTED"], "onTerminal": "error" } } } }, { "type": "START_ONBOARDING", "config": { "legalTexts": { "required": true, "documents": [{ "type": "TERMS_AND_CONDITIONS" }, { "type": "PRIVACY_POLICY" }] }, "statusPolicy": { "allowedStatusesForNextStep": ["ACTIVE"], "barrierStatuses": ["MANUAL_REVIEW"], "barrierTitle": "Manual review in progress", "barrierMessage": "Your account is currently under review. <br />You will be able to continue once the review is complete.", "polling": { "enabled": true, "intervalMs": 3e3, "maxRetries": 5, "terminalStatuses": ["FAILED", "REJECTED"], "onTerminal": "error" } } } }, { "type": "ADD_BANK_ACCOUNT", "fields": { "ach_routing_number": {}, "ach_account_number": {} }, "fieldMeta": { "ach_routing_number": { "label": "Routing Number", "helpText": "You can find your routing number on your check or bank statement." }, "ach_account_number": { "label": "Account Number" } }, "config": { "labels": { "finalizeButton": "Finalize Onboarding", "prenotePendingInfoLabel": "Bank account validation and payment is expected to be completed within 5–7 business days." }, "requireRoutingAndAccountConfirmation": true } }] };
|
|
13468
|
+
const INDIVIDUAL_PAYER = { "profileId": "INDIVIDUAL_PAYER", "config": { "maxReAuths": 3, "labels": { "finalText": "Payment in process" } }, "steps": [{ "type": "CREATE_CONSUMER_ACCOUNT", "fields": { "first_name": { "required": "First Name is required", "alphabetic": true }, "last_name": { "required": "Last Name is required", "alphabetic": true }, "email_address": { "required": "Email Address is required", "email": true } }, "fieldMeta": { "first_name": { "label": "First Name" }, "last_name": { "label": "Last Name" }, "email_address": { "label": "Email Address" }, "line_1": { "label": "Address Line 1" }, "line_2": { "label": "Address Line 2" }, "city": { "label": "City" }, "state": { "label": "State/Province" }, "postal_code": { "label": "Postal Code" }, "country": { "label": "Country" } }, "config": { "groups": { "information": "consumer_information" }, "layout": [{ "label": "Personal Information", "group": "consumer_information", "rows": [{ "fields": ["first_name", "last_name"] }, { "fields": ["email_address"] }] }], "statusPolicy": { "allowedStatusesForNextStep": ["ACTIVE"], "polling": { "enabled": true, "intervalMs": 2e3, "maxRetries": 5, "terminalStatuses": ["FAILED", "REJECTED"], "onTerminal": "error" } } } }, { "type": "ADD_BANK_ACCOUNT", "fields": { "ach_routing_number": {}, "ach_account_number": {}, "ach_account_type": {} }, "fieldMeta": { "ach_routing_number": { "label": "Routing Number", "helpText": "You can find your routing number on your check or bank statement." }, "ach_account_number": { "label": "Account Number" }, "ach_account_type": { "label": "Account Type" } }, "config": { "requireRoutingAndAccountConfirmation": true, "metadata": { "payee_uuid": "{{businessUuid}}" }, "labels": { "prenoteInfoLabel": false, "prenotePendingInfoLabel": "Bank account validation and payment is expected to be completed within 5–7 business days." } } }, { "type": "CHECKOUT_CONFIRM", "config": { "labels": { "paymentTimingInfoLabel": "Payment is expected to be completed within 3–5 business days.", "paymentTimingPendingInfoLabel": "Bank account validation and payment is expected to be completed within 5–7 business days." }, "amountEditable": false, "legalTexts": { "required": true, "documents": [{ "type": "ACH_AUTHORIZATION_INDIVIDUAL_PAYER" }] } } }] };
|
|
13469
|
+
const BUSINESS_PAYER = { "profileId": "BUSINESS_PAYER", "config": { "maxReAuths": 3, "labels": { "finalText": "Payment in process" } }, "steps": [{ "type": "CREATE_BUSINESS_ACCOUNT", "fields": { "business_name": { "required": "Business Name is required", "alphabetic": true }, "business_type": { "required": "Business Type is required" }, "country_of_incorporation": { "required": "Country of Incorporation is required" }, "state_of_incorporation": { "required": "State of Incorporation is required" }, "ein": {} }, "fieldMeta": { "business_name": { "label": "Business Name" }, "business_type": { "label": "Business Type" }, "country_of_incorporation": { "label": "Country of Incorporation" }, "state_of_incorporation": { "label": "State of Incorporation" }, "ein": { "label": "EIN" }, "email_address": { "label": "Email Address" }, "line_1": { "label": "Address Line 1" }, "line_2": { "label": "Address Line 2" }, "city": { "label": "City" }, "state": { "label": "State/Province" }, "postal_code": { "label": "Postal Code" }, "country": { "label": "Country" } }, "config": { "groups": { "information": "business_information" }, "layout": [{ "label": "Business Information", "group": "business_information", "rows": [{ "fields": ["business_name", "business_type"] }, { "fields": ["country_of_incorporation", "state_of_incorporation"] }, { "fields": ["ein"] }] }], "statusPolicy": { "allowedStatusesForNextStep": ["ACTIVE"], "polling": { "enabled": true, "intervalMs": 3e3, "maxRetries": 5, "terminalStatuses": ["FAILED", "REJECTED"], "onTerminal": "error" } } } }, { "type": "ADD_BANK_ACCOUNT", "fields": { "ach_routing_number": {}, "ach_account_number": {}, "ach_account_type": {} }, "fieldMeta": { "ach_routing_number": { "label": "Routing Number", "helpText": "You can find your routing number on your check or bank statement." }, "ach_account_number": { "label": "Account Number" }, "ach_account_type": { "label": "Account Type" } }, "config": { "requireRoutingAndAccountConfirmation": true, "metadata": { "payee_uuid": "{{businessUuid}}" }, "labels": { "prenoteInfoLabel": "New bank accounts go through prenote verification. It can take up to 3-5 business days for the account to become ACTIVE and for payments to finish processing.", "prenotePendingInfoLabel": "This bank account is still in prenote verification (PENDING). It can take up to 3-5 business days before it becomes ACTIVE and payments are processed." } } }, { "type": "CHECKOUT_CONFIRM", "config": { "labels": { "paymentTimingInfoLabel": "If this is a newly added bank account, prenote verification can take up to 3-5 business days before the account becomes ACTIVE and the payment is fully processed.", "paymentTimingPendingInfoLabel": "This bank account is still in prenote verification (PENDING). It can take up to 3-5 business days before the account becomes ACTIVE and payment processing completes." }, "amountEditable": false, "legalTexts": { "required": true, "documents": [{ "type": "ACH_AUTHORIZATION_BUSINESS_PAYER" }] } } }] };
|
|
13470
|
+
const PAYEE = { "profileId": "PAYEE", "config": { "maxReAuths": 3, "labels": { "finalText": "Process complete" } }, "steps": [{ "type": "CREATE_BUSINESS_ACCOUNT", "fields": { "business_type": { "required": "Business Type is required" }, "business_name": { "required": "Business Name is required" }, "country_of_incorporation": { "required": "Country of Incorporation is required" }, "state_of_incorporation": { "required": "State of Incorporation is required" }, "nature_of_business": { "required": "Nature of Business is required", "numeric": "Nature of Business must only contain numbers", "minValue": { "value": 11, "message": "Nature of Business must be between 11 and 999999" }, "maxValue": { "value": 999999, "message": "Nature of Business must be between 11 and 999999" } }, "ein": { "required": "EIN is required", "numeric": "EIN must only contain numbers" }, "email_address": { "email": true }, "phone_number": { "required": "Phone Number is required", "phone": true }, "website": { "url": true }, "line_1": { "required": "Address Line 1 is required", "pattern": { "regex": "^.{2,40}$", "message": "Address Line 1 must be between 2 and 40 characters" } }, "line_2": { "pattern": { "regex": "^.{1,30}$", "message": "Address Line 2 must be between 1 and 30 characters" } }, "city": { "required": "City is required" }, "state": { "required": "State is required" }, "postal_code": { "required": "Postal Code is required", "pattern": { "regex": "^.{5,9}$", "message": "Postal Code must be between 5 and 9 characters" } } }, "fieldMeta": { "business_name": { "label": "Business Name" }, "business_type": { "label": "Business Type" }, "country_of_incorporation": { "label": "Country of Incorporation" }, "state_of_incorporation": { "label": "State of Incorporation" }, "nature_of_business": { "label": "Nature of Business (NAICS)" }, "ein": { "label": "EIN" }, "email_address": { "label": "Email Address" }, "phone_number": { "label": "Phone Number" }, "website": { "label": "Website" }, "line_1": { "label": "Address Line 1" }, "line_2": { "label": "Address Line 2" }, "city": { "label": "City" }, "state": { "label": "State" }, "postal_code": { "label": "Postal Code" } }, "config": { "labels": { "createAccountLabel": "Create Account", "creatingAccountLabel": "Creating Account...", "updateAccountLabel": "Update Account", "updatingAccountLabel": "Updating Account..." }, "groups": { "information": "business_information", "primary_address": "primary_address" }, "layout": [{ "label": "Business Information", "group": "business_information", "rows": [{ "fields": ["business_name", "business_type"] }, { "fields": ["country_of_incorporation", "state_of_incorporation"] }, { "fields": ["nature_of_business", "ein"] }, { "fields": ["email_address", "phone_number"] }, { "fields": ["website"] }] }, { "label": "Address", "group": "primary_address", "rows": [{ "fields": ["line_1"] }, { "fields": ["line_2"] }, { "fields": ["city", "state"] }, { "fields": ["postal_code"] }] }], "statusPolicy": { "allowedStatusesForNextStep": ["ACTIVE", "CREATED"], "barrierStatuses": ["MANUAL_REVIEW"], "barrierTitle": "Review in progress", "barrierMessage": "Your account is currently under review. <br />You will be able to continue once the review is complete.", "polling": { "enabled": true, "intervalMs": 3e3, "maxRetries": 5, "terminalStatuses": ["FAILED", "REJECTED"], "onTerminal": "error" } } } }, { "type": "START_ONBOARDING", "config": { "legalTexts": { "required": true, "documents": [{ "type": "TERMS_AND_CONDITIONS" }, { "type": "PRIVACY_POLICY" }] }, "statusPolicy": { "allowedStatusesForNextStep": ["ACTIVE"], "barrierStatuses": ["MANUAL_REVIEW"], "barrierTitle": "Manual review in progress", "barrierMessage": "Your account is currently under review. <br />You will be able to continue once the review is complete.", "polling": { "enabled": true, "intervalMs": 3e3, "maxRetries": 5, "terminalStatuses": ["FAILED", "REJECTED"], "onTerminal": "error" } } } }, { "type": "ADD_BANK_ACCOUNT", "fields": { "ach_routing_number": {}, "ach_account_number": {} }, "fieldMeta": { "ach_routing_number": { "label": "Routing Number", "helpText": "You can find your routing number on your check or bank statement." }, "ach_account_number": { "label": "Account Number" } }, "config": { "labels": { "finalizeButton": "Finalize Onboarding", "prenotePendingInfoLabel": "Bank account validation and payment is expected to be completed within 5–7 business days." }, "requireRoutingAndAccountConfirmation": true } }] };
|
|
13392
13471
|
const recipesJson = {
|
|
13393
13472
|
INDIVIDUAL_PAYER,
|
|
13394
13473
|
BUSINESS_PAYER,
|
|
@@ -13631,21 +13710,21 @@ const accountConfigs = {
|
|
|
13631
13710
|
},
|
|
13632
13711
|
fieldRenderRegistry: {
|
|
13633
13712
|
business_type: { component: "select", options: businessTypeOptions },
|
|
13634
|
-
business_name: { component: "text" },
|
|
13713
|
+
business_name: { component: "text", autocomplete: "organization" },
|
|
13635
13714
|
country_of_incorporation: { component: "select", options: countryOptions },
|
|
13636
13715
|
state_of_incorporation: { component: "select", options: usStates },
|
|
13637
13716
|
nature_of_business: { component: "text" },
|
|
13638
13717
|
ein: { component: "ein" },
|
|
13639
|
-
email_address: { component: "text", email: true },
|
|
13640
|
-
phone_number: { component: "phone" },
|
|
13641
|
-
website: { component: "text" },
|
|
13718
|
+
email_address: { component: "text", email: true, autocomplete: "email" },
|
|
13719
|
+
phone_number: { component: "phone", autocomplete: "tel" },
|
|
13720
|
+
website: { component: "text", autocomplete: "url" },
|
|
13642
13721
|
incorporation_date: { component: "dob" },
|
|
13643
|
-
line_1: { component: "text" },
|
|
13644
|
-
line_2: { component: "text" },
|
|
13645
|
-
city: { component: "text" },
|
|
13646
|
-
state: { component: "select", options: usStates },
|
|
13647
|
-
postal_code: { component: "text" },
|
|
13648
|
-
country: { component: "select", options: countryOptions }
|
|
13722
|
+
line_1: { component: "text", autocomplete: "address-line1" },
|
|
13723
|
+
line_2: { component: "text", autocomplete: "address-line2" },
|
|
13724
|
+
city: { component: "text", autocomplete: "address-level2" },
|
|
13725
|
+
state: { component: "select", options: usStates, autocomplete: "address-level1" },
|
|
13726
|
+
postal_code: { component: "text", autocomplete: "postal-code" },
|
|
13727
|
+
country: { component: "select", options: countryOptions, autocomplete: "country-name" }
|
|
13649
13728
|
}
|
|
13650
13729
|
},
|
|
13651
13730
|
consumer: {
|
|
@@ -13686,19 +13765,19 @@ const accountConfigs = {
|
|
|
13686
13765
|
country: "Enter country"
|
|
13687
13766
|
},
|
|
13688
13767
|
fieldRenderRegistry: {
|
|
13689
|
-
first_name: { component: "text" },
|
|
13690
|
-
last_name: { component: "text" },
|
|
13691
|
-
email_address: { component: "text", inputType: "email" },
|
|
13692
|
-
phone_number: { component: "phone" },
|
|
13768
|
+
first_name: { component: "text", autocomplete: "given-name" },
|
|
13769
|
+
last_name: { component: "text", autocomplete: "family-name" },
|
|
13770
|
+
email_address: { component: "text", inputType: "email", autocomplete: "email" },
|
|
13771
|
+
phone_number: { component: "phone", autocomplete: "tel" },
|
|
13693
13772
|
date_of_birth: { component: "dob" },
|
|
13694
13773
|
ssn: { component: "text" },
|
|
13695
13774
|
occupation: { component: "select", options: professionOptions },
|
|
13696
|
-
line_1: { component: "text" },
|
|
13697
|
-
line_2: { component: "text" },
|
|
13698
|
-
city: { component: "text" },
|
|
13699
|
-
state: { component: "select", options: usStates },
|
|
13700
|
-
postal_code: { component: "text" },
|
|
13701
|
-
country: { component: "select", options: countryOptions }
|
|
13775
|
+
line_1: { component: "text", autocomplete: "address-line1" },
|
|
13776
|
+
line_2: { component: "text", autocomplete: "address-line2" },
|
|
13777
|
+
city: { component: "text", autocomplete: "address-level2" },
|
|
13778
|
+
state: { component: "select", options: usStates, autocomplete: "address-level1" },
|
|
13779
|
+
postal_code: { component: "text", autocomplete: "postal-code" },
|
|
13780
|
+
country: { component: "select", options: countryOptions, autocomplete: "country-name" }
|
|
13702
13781
|
}
|
|
13703
13782
|
}
|
|
13704
13783
|
};
|
|
@@ -14133,6 +14212,7 @@ function CreateAccount($$anchor, $$props) {
|
|
|
14133
14212
|
component: renderer.component,
|
|
14134
14213
|
options: renderer.options,
|
|
14135
14214
|
inputType: renderer.inputType,
|
|
14215
|
+
autocomplete: renderer.autocomplete,
|
|
14136
14216
|
label,
|
|
14137
14217
|
placeholder,
|
|
14138
14218
|
required,
|
|
@@ -14799,9 +14879,8 @@ function CreateAccount($$anchor, $$props) {
|
|
|
14799
14879
|
}
|
|
14800
14880
|
const getFieldValidationState = (fieldKey) => {
|
|
14801
14881
|
if (!fieldKey) return "neutral";
|
|
14802
|
-
if (baseForm.state.validationErrors[fieldKey]) return "invalid";
|
|
14803
14882
|
if (get$1(alertFields)[fieldKey]) return "warning";
|
|
14804
|
-
return
|
|
14883
|
+
return baseForm.handlers.getFieldDisplayState(fieldKey);
|
|
14805
14884
|
};
|
|
14806
14885
|
const getFieldValidationMessage = (fieldKey) => {
|
|
14807
14886
|
if (!fieldKey) return "";
|
|
@@ -15356,9 +15435,13 @@ function CreateAccount($$anchor, $$props) {
|
|
|
15356
15435
|
});
|
|
15357
15436
|
let $7 = /* @__PURE__ */ user_derived(() => {
|
|
15358
15437
|
var _a3;
|
|
15359
|
-
return
|
|
15438
|
+
return ((_a3 = getField(get$1(fieldKey))) == null ? void 0 : _a3.autocomplete) || "";
|
|
15360
15439
|
});
|
|
15361
15440
|
let $8 = /* @__PURE__ */ user_derived(() => {
|
|
15441
|
+
var _a3;
|
|
15442
|
+
return getFieldValidationState((_a3 = getField(get$1(fieldKey))) == null ? void 0 : _a3.key);
|
|
15443
|
+
});
|
|
15444
|
+
let $9 = /* @__PURE__ */ user_derived(() => {
|
|
15362
15445
|
var _a3;
|
|
15363
15446
|
return getFieldValidationMessage((_a3 = getField(get$1(fieldKey))) == null ? void 0 : _a3.key);
|
|
15364
15447
|
});
|
|
@@ -15384,6 +15467,9 @@ function CreateAccount($$anchor, $$props) {
|
|
|
15384
15467
|
get type() {
|
|
15385
15468
|
return get$1($6);
|
|
15386
15469
|
},
|
|
15470
|
+
get autocomplete() {
|
|
15471
|
+
return get$1($7);
|
|
15472
|
+
},
|
|
15387
15473
|
oninput: (e) => {
|
|
15388
15474
|
var _a3;
|
|
15389
15475
|
return handleFieldChangeWithDebug((_a3 = getField(get$1(fieldKey))) == null ? void 0 : _a3.key, e.target.value);
|
|
@@ -15393,10 +15479,10 @@ function CreateAccount($$anchor, $$props) {
|
|
|
15393
15479
|
return baseForm.handlers.handleFieldBlur((_a3 = getField(get$1(fieldKey))) == null ? void 0 : _a3.key);
|
|
15394
15480
|
},
|
|
15395
15481
|
get validationState() {
|
|
15396
|
-
return get$1($
|
|
15482
|
+
return get$1($8);
|
|
15397
15483
|
},
|
|
15398
15484
|
get errorMessage() {
|
|
15399
|
-
return get$1($
|
|
15485
|
+
return get$1($9);
|
|
15400
15486
|
}
|
|
15401
15487
|
});
|
|
15402
15488
|
}
|
|
@@ -15425,17 +15511,25 @@ function CreateAccount($$anchor, $$props) {
|
|
|
15425
15511
|
});
|
|
15426
15512
|
let $4 = /* @__PURE__ */ user_derived(() => {
|
|
15427
15513
|
var _a3;
|
|
15428
|
-
return
|
|
15514
|
+
return (_a3 = getField(get$1(fieldKey))) == null ? void 0 : _a3.required;
|
|
15429
15515
|
});
|
|
15430
15516
|
let $5 = /* @__PURE__ */ user_derived(() => {
|
|
15431
15517
|
var _a3;
|
|
15432
|
-
return
|
|
15518
|
+
return isFieldReadOnly((_a3 = getField(get$1(fieldKey))) == null ? void 0 : _a3.key);
|
|
15433
15519
|
});
|
|
15434
15520
|
let $6 = /* @__PURE__ */ user_derived(() => {
|
|
15435
15521
|
var _a3;
|
|
15436
|
-
return
|
|
15522
|
+
return ((_a3 = getField(get$1(fieldKey))) == null ? void 0 : _a3.autocomplete) || "off";
|
|
15437
15523
|
});
|
|
15438
15524
|
let $7 = /* @__PURE__ */ user_derived(() => {
|
|
15525
|
+
var _a3;
|
|
15526
|
+
return getFieldValidationState((_a3 = getField(get$1(fieldKey))) == null ? void 0 : _a3.key);
|
|
15527
|
+
});
|
|
15528
|
+
let $8 = /* @__PURE__ */ user_derived(() => {
|
|
15529
|
+
var _a3;
|
|
15530
|
+
return getFieldValidationMessage((_a3 = getField(get$1(fieldKey))) == null ? void 0 : _a3.key);
|
|
15531
|
+
});
|
|
15532
|
+
let $9 = /* @__PURE__ */ user_derived(() => {
|
|
15439
15533
|
var _a3;
|
|
15440
15534
|
return (_a3 = getField(get$1(fieldKey))) == null ? void 0 : _a3.helpText;
|
|
15441
15535
|
});
|
|
@@ -15452,9 +15546,15 @@ function CreateAccount($$anchor, $$props) {
|
|
|
15452
15546
|
get placeholder() {
|
|
15453
15547
|
return get$1($3);
|
|
15454
15548
|
},
|
|
15455
|
-
get
|
|
15549
|
+
get required() {
|
|
15456
15550
|
return get$1($4);
|
|
15457
15551
|
},
|
|
15552
|
+
get readonly() {
|
|
15553
|
+
return get$1($5);
|
|
15554
|
+
},
|
|
15555
|
+
get autocomplete() {
|
|
15556
|
+
return get$1($6);
|
|
15557
|
+
},
|
|
15458
15558
|
onchange: (e) => {
|
|
15459
15559
|
var _a3;
|
|
15460
15560
|
return handleFieldChangeWithDebug((_a3 = getField(get$1(fieldKey))) == null ? void 0 : _a3.key, e.detail.value);
|
|
@@ -15464,13 +15564,13 @@ function CreateAccount($$anchor, $$props) {
|
|
|
15464
15564
|
return baseForm.handlers.handleFieldBlur((_a3 = getField(get$1(fieldKey))) == null ? void 0 : _a3.key);
|
|
15465
15565
|
},
|
|
15466
15566
|
get validationState() {
|
|
15467
|
-
return get$1($
|
|
15567
|
+
return get$1($7);
|
|
15468
15568
|
},
|
|
15469
15569
|
get errorMessage() {
|
|
15470
|
-
return get$1($
|
|
15570
|
+
return get$1($8);
|
|
15471
15571
|
},
|
|
15472
15572
|
get helpText() {
|
|
15473
|
-
return get$1($
|
|
15573
|
+
return get$1($9);
|
|
15474
15574
|
}
|
|
15475
15575
|
});
|
|
15476
15576
|
}
|
|
@@ -15984,6 +16084,34 @@ customElements.define("alviere-create-consumer-account", create_custom_element(
|
|
|
15984
16084
|
[],
|
|
15985
16085
|
true
|
|
15986
16086
|
));
|
|
16087
|
+
function getErrorCode(error) {
|
|
16088
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h;
|
|
16089
|
+
if (!error || typeof error !== "object") return void 0;
|
|
16090
|
+
const parsed = error;
|
|
16091
|
+
const parsedMessageCode = typeof parsed.message === "string" ? (_a2 = parsed.message.match(/Alcore API Error\s+(\d+)/)) == null ? void 0 : _a2[1] : void 0;
|
|
16092
|
+
return parsed.errorCode || parsed.error_code || parsed.code || ((_b = parsed.cause) == null ? void 0 : _b.errorCode) || ((_c = parsed.cause) == null ? void 0 : _c.error_code) || ((_d = parsed.cause) == null ? void 0 : _d.code) || ((_f = (_e = parsed.response) == null ? void 0 : _e.data) == null ? void 0 : _f.errorCode) || ((_h = (_g = parsed.response) == null ? void 0 : _g.data) == null ? void 0 : _h.error_code) || parsedMessageCode || void 0;
|
|
16093
|
+
}
|
|
16094
|
+
async function classifyApiError(error, jwtManager) {
|
|
16095
|
+
const errorCode = getErrorCode(error);
|
|
16096
|
+
if (errorCode === AlcoreErrorCodes.INVALID_JWT) {
|
|
16097
|
+
if (jwtManager == null ? void 0 : jwtManager.canReAuth()) {
|
|
16098
|
+
const success = await jwtManager.attemptReAuth();
|
|
16099
|
+
if (success) return { kind: "reauth-success" };
|
|
16100
|
+
}
|
|
16101
|
+
return { kind: "critical", error, errorCode };
|
|
16102
|
+
}
|
|
16103
|
+
if (errorCode && isCriticalError(errorCode)) {
|
|
16104
|
+
return { kind: "critical", error, errorCode };
|
|
16105
|
+
}
|
|
16106
|
+
return { kind: "non-critical", errorCode };
|
|
16107
|
+
}
|
|
16108
|
+
function toAlcoreApiError(error, errorCode) {
|
|
16109
|
+
if (error instanceof AlcoreApiError) return error;
|
|
16110
|
+
return new AlcoreApiError(
|
|
16111
|
+
errorCode || "000000",
|
|
16112
|
+
error instanceof Error ? error.message : "An unexpected error occurred"
|
|
16113
|
+
);
|
|
16114
|
+
}
|
|
15987
16115
|
const bankInfoCache = /* @__PURE__ */ new Map();
|
|
15988
16116
|
async function lookupRoutingNumber(routingNumber, alviereCore) {
|
|
15989
16117
|
const cleanRouting = routingNumber.replace(/[-\s]/g, "");
|
|
@@ -16073,6 +16201,7 @@ function AddBankAccount($$anchor, $$props) {
|
|
|
16073
16201
|
push($$props, true);
|
|
16074
16202
|
append_styles$1($$anchor, $$css$b);
|
|
16075
16203
|
const $flowRecipeStore = () => store_get(flowRecipeStore, "$flowRecipeStore", $$stores);
|
|
16204
|
+
const $flowCoreStore = () => store_get(flowCoreStore, "$flowCoreStore", $$stores);
|
|
16076
16205
|
const [$$stores, $$cleanup] = setup_stores();
|
|
16077
16206
|
var _a2;
|
|
16078
16207
|
var _b;
|
|
@@ -16340,10 +16469,17 @@ function AddBankAccount($$anchor, $$props) {
|
|
|
16340
16469
|
if (baseForm.state.validationErrors.ach_routing_number === invalidRoutingNumberMessage) {
|
|
16341
16470
|
baseForm.actions.clearFieldError("ach_routing_number");
|
|
16342
16471
|
}
|
|
16343
|
-
}).catch((error) => {
|
|
16472
|
+
}).catch(async (error) => {
|
|
16344
16473
|
set(bankInfo, null);
|
|
16345
|
-
|
|
16346
|
-
|
|
16474
|
+
const result = await classifyApiError(error, $flowCoreStore().jwtManager);
|
|
16475
|
+
if (result.kind === "reauth-success") {
|
|
16476
|
+
baseForm.actions.clearFieldError("ach_routing_number");
|
|
16477
|
+
} else if (result.kind === "critical") {
|
|
16478
|
+
dispatchCriticalError(result.error, result.errorCode);
|
|
16479
|
+
} else {
|
|
16480
|
+
baseForm.actions.setFieldError("ach_routing_number", invalidRoutingNumberMessage);
|
|
16481
|
+
uiLogger.warn("Failed to lookup bank info:", error);
|
|
16482
|
+
}
|
|
16347
16483
|
}).finally(() => {
|
|
16348
16484
|
set(isLoadingBankInfo, false);
|
|
16349
16485
|
});
|
|
@@ -16433,12 +16569,14 @@ function AddBankAccount($$anchor, $$props) {
|
|
|
16433
16569
|
set(isSubmitting, false);
|
|
16434
16570
|
}
|
|
16435
16571
|
}
|
|
16436
|
-
function
|
|
16437
|
-
|
|
16438
|
-
|
|
16439
|
-
|
|
16440
|
-
|
|
16441
|
-
|
|
16572
|
+
function dispatchCriticalError(error, errorCode) {
|
|
16573
|
+
if (get$1(hostElement)) {
|
|
16574
|
+
get$1(hostElement).dispatchEvent(new CustomEvent(ComponentEvents.FORM_ERROR, {
|
|
16575
|
+
detail: { error: toAlcoreApiError(error, errorCode), stepType },
|
|
16576
|
+
bubbles: true,
|
|
16577
|
+
composed: true
|
|
16578
|
+
}));
|
|
16579
|
+
}
|
|
16442
16580
|
}
|
|
16443
16581
|
function getAddBankAccountErrorMessage(errorCode) {
|
|
16444
16582
|
if (errorCode === "340029") {
|
|
@@ -16461,6 +16599,15 @@ function AddBankAccount($$anchor, $$props) {
|
|
|
16461
16599
|
async function handleAddBankAccount(event2) {
|
|
16462
16600
|
var _a3, _b2;
|
|
16463
16601
|
event2.preventDefault();
|
|
16602
|
+
if (get$1(isLoadingBankInfo)) {
|
|
16603
|
+
return;
|
|
16604
|
+
}
|
|
16605
|
+
baseForm.actions.markAllFieldsAsInteracted();
|
|
16606
|
+
baseForm.actions.validateAllFields();
|
|
16607
|
+
const routingOnSubmit = baseForm.state.formData.ach_details.routing_number;
|
|
16608
|
+
if (baseForm.state.alviereCore && (routingOnSubmit === null || routingOnSubmit === void 0 ? void 0 : routingOnSubmit.length) === 9 && !get$1(isLoadingBankInfo) && get$1(bankInfo) === null) {
|
|
16609
|
+
baseForm.actions.setFieldError("ach_routing_number", getFieldErrorMessage("ach_routing_number", "pattern", INVALID_ROUTING_NUMBER_MESSAGE));
|
|
16610
|
+
}
|
|
16464
16611
|
if (!baseForm.computed.canSubmit) {
|
|
16465
16612
|
uiLogger.debug("Cannot submit: form validation failed");
|
|
16466
16613
|
return;
|
|
@@ -16540,8 +16687,14 @@ function AddBankAccount($$anchor, $$props) {
|
|
|
16540
16687
|
set(showAddForm, false);
|
|
16541
16688
|
} catch (error) {
|
|
16542
16689
|
uiLogger.error("❌ Error adding bank account:", error);
|
|
16543
|
-
const
|
|
16544
|
-
|
|
16690
|
+
const result = await classifyApiError(error, $flowCoreStore().jwtManager);
|
|
16691
|
+
if (result.kind === "reauth-success") {
|
|
16692
|
+
set(formError, "Your session has been refreshed. Please try again.");
|
|
16693
|
+
} else if (result.kind === "critical") {
|
|
16694
|
+
dispatchCriticalError(result.error, result.errorCode);
|
|
16695
|
+
} else {
|
|
16696
|
+
set(formError, getAddBankAccountErrorMessage(result.errorCode), true);
|
|
16697
|
+
}
|
|
16545
16698
|
} finally {
|
|
16546
16699
|
set(isSubmitting, false);
|
|
16547
16700
|
}
|
|
@@ -17125,7 +17278,7 @@ function AddBankAccount($$anchor, $$props) {
|
|
|
17125
17278
|
{
|
|
17126
17279
|
let $0 = /* @__PURE__ */ user_derived(() => getFieldLabel("ach_account_type"));
|
|
17127
17280
|
let $1 = /* @__PURE__ */ user_derived(() => getFieldPlaceholder("ach_account_type"));
|
|
17128
|
-
let $2 = /* @__PURE__ */ user_derived(() => baseForm.
|
|
17281
|
+
let $2 = /* @__PURE__ */ user_derived(() => baseForm.handlers.getFieldDisplayState("ach_account_type"));
|
|
17129
17282
|
let $3 = /* @__PURE__ */ user_derived(() => baseForm.state.validationErrors.ach_account_type || "");
|
|
17130
17283
|
let $4 = /* @__PURE__ */ user_derived(() => getFieldHelpText("ach_account_type"));
|
|
17131
17284
|
SearchSelect(node_17, {
|
|
@@ -17147,6 +17300,7 @@ function AddBankAccount($$anchor, $$props) {
|
|
|
17147
17300
|
baseForm.state.formData.ach_details.type = newValue;
|
|
17148
17301
|
baseForm.handlers.handleFieldChange("ach_account_type", newValue);
|
|
17149
17302
|
},
|
|
17303
|
+
onblur: () => baseForm.handlers.handleFieldBlur("ach_account_type"),
|
|
17150
17304
|
get validationSchema() {
|
|
17151
17305
|
return get$1(fieldSchemas).ach_account_type;
|
|
17152
17306
|
},
|
|
@@ -17178,7 +17332,7 @@ function AddBankAccount($$anchor, $$props) {
|
|
|
17178
17332
|
let $0 = /* @__PURE__ */ user_derived(() => getFieldLabel("ach_routing_number"));
|
|
17179
17333
|
let $1 = /* @__PURE__ */ user_derived(() => getFieldPlaceholder("ach_routing_number"));
|
|
17180
17334
|
let $2 = /* @__PURE__ */ user_derived(() => getFieldHelpText("ach_routing_number"));
|
|
17181
|
-
let $3 = /* @__PURE__ */ user_derived(() => baseForm.
|
|
17335
|
+
let $3 = /* @__PURE__ */ user_derived(() => baseForm.handlers.getFieldDisplayState("ach_routing_number"));
|
|
17182
17336
|
let $4 = /* @__PURE__ */ user_derived(() => baseForm.state.validationErrors.ach_routing_number || "");
|
|
17183
17337
|
let $5 = /* @__PURE__ */ user_derived(() => getLabel("routingHelpAriaLabel", "Where to find your routing number"));
|
|
17184
17338
|
TextInput(node_19, {
|
|
@@ -17221,6 +17375,13 @@ function AddBankAccount($$anchor, $$props) {
|
|
|
17221
17375
|
if (get$1(requireRoutingAndAccountConfirmation) && baseForm.state.formData.confirm_routing_number) {
|
|
17222
17376
|
validateRoutingConfirmation();
|
|
17223
17377
|
}
|
|
17378
|
+
},
|
|
17379
|
+
onblur: () => {
|
|
17380
|
+
baseForm.handlers.handleFieldBlur("ach_routing_number");
|
|
17381
|
+
const routing = baseForm.state.formData.ach_details.routing_number;
|
|
17382
|
+
if (baseForm.state.alviereCore && (routing == null ? void 0 : routing.length) === 9 && !get$1(isLoadingBankInfo) && get$1(bankInfo) === null) {
|
|
17383
|
+
baseForm.actions.setFieldError("ach_routing_number", getFieldErrorMessage("ach_routing_number", "pattern", INVALID_ROUTING_NUMBER_MESSAGE));
|
|
17384
|
+
}
|
|
17224
17385
|
}
|
|
17225
17386
|
});
|
|
17226
17387
|
}
|
|
@@ -17231,7 +17392,7 @@ function AddBankAccount($$anchor, $$props) {
|
|
|
17231
17392
|
let $0 = /* @__PURE__ */ user_derived(() => getFieldLabel("confirm_routing_number"));
|
|
17232
17393
|
let $1 = /* @__PURE__ */ user_derived(() => getFieldPlaceholder("confirm_routing_number"));
|
|
17233
17394
|
let $2 = /* @__PURE__ */ user_derived(() => getFieldHelpText("confirm_routing_number"));
|
|
17234
|
-
let $3 = /* @__PURE__ */ user_derived(() => baseForm.
|
|
17395
|
+
let $3 = /* @__PURE__ */ user_derived(() => baseForm.handlers.getFieldDisplayState("confirm_routing_number"));
|
|
17235
17396
|
let $4 = /* @__PURE__ */ user_derived(() => baseForm.state.validationErrors.confirm_routing_number || "");
|
|
17236
17397
|
TextInput($$anchor5, {
|
|
17237
17398
|
get value() {
|
|
@@ -17266,6 +17427,10 @@ function AddBankAccount($$anchor, $$props) {
|
|
|
17266
17427
|
validateRoutingConfirmation();
|
|
17267
17428
|
}
|
|
17268
17429
|
},
|
|
17430
|
+
onblur: () => {
|
|
17431
|
+
baseForm.handlers.handleFieldBlur("confirm_routing_number");
|
|
17432
|
+
validateRoutingConfirmation();
|
|
17433
|
+
},
|
|
17269
17434
|
blockPaste: true
|
|
17270
17435
|
});
|
|
17271
17436
|
}
|
|
@@ -17290,7 +17455,7 @@ function AddBankAccount($$anchor, $$props) {
|
|
|
17290
17455
|
let $0 = /* @__PURE__ */ user_derived(() => getFieldLabel("ach_account_number"));
|
|
17291
17456
|
let $1 = /* @__PURE__ */ user_derived(() => getFieldPlaceholder("ach_account_number"));
|
|
17292
17457
|
let $2 = /* @__PURE__ */ user_derived(() => getFieldHelpText("ach_account_number"));
|
|
17293
|
-
let $3 = /* @__PURE__ */ user_derived(() => baseForm.
|
|
17458
|
+
let $3 = /* @__PURE__ */ user_derived(() => baseForm.handlers.getFieldDisplayState("ach_account_number"));
|
|
17294
17459
|
let $4 = /* @__PURE__ */ user_derived(() => baseForm.state.validationErrors.ach_account_number || "");
|
|
17295
17460
|
let $5 = /* @__PURE__ */ user_derived(() => getLabel("accountHelpAriaLabel", "Where to find your account number"));
|
|
17296
17461
|
TextInput(node_22, {
|
|
@@ -17334,7 +17499,8 @@ function AddBankAccount($$anchor, $$props) {
|
|
|
17334
17499
|
if (get$1(requireRoutingAndAccountConfirmation) && baseForm.state.formData.confirm_account_number) {
|
|
17335
17500
|
validateAccountConfirmation();
|
|
17336
17501
|
}
|
|
17337
|
-
}
|
|
17502
|
+
},
|
|
17503
|
+
onblur: () => baseForm.handlers.handleFieldBlur("ach_account_number")
|
|
17338
17504
|
});
|
|
17339
17505
|
}
|
|
17340
17506
|
var node_23 = sibling(node_22, 2);
|
|
@@ -17344,7 +17510,7 @@ function AddBankAccount($$anchor, $$props) {
|
|
|
17344
17510
|
let $0 = /* @__PURE__ */ user_derived(() => getFieldLabel("confirm_account_number"));
|
|
17345
17511
|
let $1 = /* @__PURE__ */ user_derived(() => getFieldPlaceholder("confirm_account_number"));
|
|
17346
17512
|
let $2 = /* @__PURE__ */ user_derived(() => getFieldHelpText("confirm_account_number"));
|
|
17347
|
-
let $3 = /* @__PURE__ */ user_derived(() => baseForm.
|
|
17513
|
+
let $3 = /* @__PURE__ */ user_derived(() => baseForm.handlers.getFieldDisplayState("confirm_account_number"));
|
|
17348
17514
|
let $4 = /* @__PURE__ */ user_derived(() => baseForm.state.validationErrors.confirm_account_number || "");
|
|
17349
17515
|
TextInput($$anchor5, {
|
|
17350
17516
|
get value() {
|
|
@@ -17380,6 +17546,10 @@ function AddBankAccount($$anchor, $$props) {
|
|
|
17380
17546
|
validateAccountConfirmation();
|
|
17381
17547
|
}
|
|
17382
17548
|
},
|
|
17549
|
+
onblur: () => {
|
|
17550
|
+
baseForm.handlers.handleFieldBlur("confirm_account_number");
|
|
17551
|
+
validateAccountConfirmation();
|
|
17552
|
+
},
|
|
17383
17553
|
blockPaste: true
|
|
17384
17554
|
});
|
|
17385
17555
|
}
|
|
@@ -17810,6 +17980,7 @@ function CheckoutConfirm($$anchor, $$props) {
|
|
|
17810
17980
|
});
|
|
17811
17981
|
const canPay = /* @__PURE__ */ user_derived(() => () => !legalTextsResolver.requiresLegalTexts || get$1(legalTextsAccepted));
|
|
17812
17982
|
async function handlePay() {
|
|
17983
|
+
if (!get$1(canPay)() || get$1(isSending)) return;
|
|
17813
17984
|
set(isSending, true);
|
|
17814
17985
|
await new Promise((resolve) => setTimeout(resolve, 500));
|
|
17815
17986
|
set(isSending, false);
|
|
@@ -19519,13 +19690,20 @@ delegate(["click"]);
|
|
|
19519
19690
|
create_custom_element(FormErrorBoundary, { onError: {}, allowRetry: {}, children: {} }, [], ["handleError", "reset"], true);
|
|
19520
19691
|
function createJwtFlowManager(options) {
|
|
19521
19692
|
const { getJwt, getCore, getDebug, onJwtUpdate } = options;
|
|
19693
|
+
const getMaxReAuths = () => {
|
|
19694
|
+
var _a2;
|
|
19695
|
+
return ((_a2 = options.getMaxReAuths) == null ? void 0 : _a2.call(options)) ?? 3;
|
|
19696
|
+
};
|
|
19522
19697
|
let effectiveJwt = /* @__PURE__ */ state(proxy(getJwt()));
|
|
19523
19698
|
let pendingJwt = /* @__PURE__ */ state(null);
|
|
19524
19699
|
let stepJwtSnapshot = /* @__PURE__ */ state(proxy(getJwt()));
|
|
19700
|
+
let reAuthCount = 0;
|
|
19701
|
+
let refreshTimer = null;
|
|
19525
19702
|
user_effect(() => {
|
|
19526
19703
|
const currentJwt = getJwt();
|
|
19527
19704
|
if (currentJwt) {
|
|
19528
19705
|
set(effectiveJwt, currentJwt, true);
|
|
19706
|
+
scheduleRefresh(currentJwt);
|
|
19529
19707
|
}
|
|
19530
19708
|
});
|
|
19531
19709
|
user_effect(() => {
|
|
@@ -19536,7 +19714,7 @@ function createJwtFlowManager(options) {
|
|
|
19536
19714
|
set(pendingJwt, null);
|
|
19537
19715
|
const debug = getDebug();
|
|
19538
19716
|
if (debug) {
|
|
19539
|
-
uiLogger.info("✅ JWT
|
|
19717
|
+
uiLogger.info("✅ JWT update successful - updated flow JWT");
|
|
19540
19718
|
uiLogger.info("🔐 Old JWT (first 50 chars):", oldJwt == null ? void 0 : oldJwt.substring(0, 50));
|
|
19541
19719
|
uiLogger.info("🔐 New JWT (first 50 chars):", (_a2 = get$1(effectiveJwt)) == null ? void 0 : _a2.substring(0, 50));
|
|
19542
19720
|
uiLogger.info("🔐 New JWT will be used in all subsequent steps");
|
|
@@ -19544,11 +19722,72 @@ function createJwtFlowManager(options) {
|
|
|
19544
19722
|
onJwtUpdate == null ? void 0 : onJwtUpdate(get$1(effectiveJwt));
|
|
19545
19723
|
}
|
|
19546
19724
|
});
|
|
19725
|
+
function scheduleRefresh(jwt) {
|
|
19726
|
+
if (refreshTimer !== null) {
|
|
19727
|
+
clearTimeout(refreshTimer);
|
|
19728
|
+
refreshTimer = null;
|
|
19729
|
+
}
|
|
19730
|
+
const refreshAtMs = getJWTRefreshTime(jwt);
|
|
19731
|
+
if (!refreshAtMs) return;
|
|
19732
|
+
const delay = refreshAtMs - Date.now();
|
|
19733
|
+
if (delay <= 0) {
|
|
19734
|
+
getDebug() && uiLogger.warn("⏰ JWT refresh time already passed — triggering immediately");
|
|
19735
|
+
attemptReAuth().then((success) => {
|
|
19736
|
+
var _a2;
|
|
19737
|
+
if (!success) (_a2 = options.onReAuthExhausted) == null ? void 0 : _a2.call(options);
|
|
19738
|
+
});
|
|
19739
|
+
return;
|
|
19740
|
+
}
|
|
19741
|
+
getDebug() && uiLogger.info(`⏰ JWT refresh scheduled in ${Math.round(delay / 1e3)}s (at ${new Date(refreshAtMs).toISOString()})`);
|
|
19742
|
+
refreshTimer = setTimeout(
|
|
19743
|
+
async () => {
|
|
19744
|
+
var _a2;
|
|
19745
|
+
refreshTimer = null;
|
|
19746
|
+
getDebug() && uiLogger.info("⏰ JWT refresh timer fired — attempting re-auth");
|
|
19747
|
+
const success = await attemptReAuth();
|
|
19748
|
+
if (!success) {
|
|
19749
|
+
(_a2 = options.onReAuthExhausted) == null ? void 0 : _a2.call(options);
|
|
19750
|
+
}
|
|
19751
|
+
},
|
|
19752
|
+
delay
|
|
19753
|
+
);
|
|
19754
|
+
}
|
|
19755
|
+
async function attemptReAuth() {
|
|
19756
|
+
const maxReAuths = getMaxReAuths();
|
|
19757
|
+
if (reAuthCount >= maxReAuths) {
|
|
19758
|
+
getDebug() && uiLogger.warn(`🔐 Re-auth limit reached (${reAuthCount}/${maxReAuths}) — cannot re-authenticate`);
|
|
19759
|
+
return false;
|
|
19760
|
+
}
|
|
19761
|
+
const core = getCore();
|
|
19762
|
+
if (!core) {
|
|
19763
|
+
getDebug() && uiLogger.warn("⚠️ Cannot re-auth — AlviereCore not initialized");
|
|
19764
|
+
return false;
|
|
19765
|
+
}
|
|
19766
|
+
try {
|
|
19767
|
+
const accountUuid = core.getAccountUuid();
|
|
19768
|
+
if (!accountUuid) {
|
|
19769
|
+
getDebug() && uiLogger.warn("⚠️ Cannot re-auth — account UUID not available in JWT");
|
|
19770
|
+
return false;
|
|
19771
|
+
}
|
|
19772
|
+
getDebug() && uiLogger.info(`🔐 Attempting re-auth (${reAuthCount + 1}/${maxReAuths}) for account: ${accountUuid}`);
|
|
19773
|
+
const newJwt = await core.generateScopedToken(accountUuid, false);
|
|
19774
|
+
reAuthCount++;
|
|
19775
|
+
getDebug() && uiLogger.info(`✅ Re-auth successful (${reAuthCount}/${maxReAuths})`);
|
|
19776
|
+
set(pendingJwt, newJwt, true);
|
|
19777
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
19778
|
+
scheduleRefresh(newJwt);
|
|
19779
|
+
return true;
|
|
19780
|
+
} catch (error) {
|
|
19781
|
+
uiLogger.warn("⚠️ Re-auth attempt failed:", error);
|
|
19782
|
+
return false;
|
|
19783
|
+
}
|
|
19784
|
+
}
|
|
19547
19785
|
return {
|
|
19548
19786
|
getJwtForStep: () => get$1(stepJwtSnapshot),
|
|
19549
19787
|
getEffectiveJwt: () => get$1(effectiveJwt),
|
|
19550
19788
|
updateJwt: (newJwt) => {
|
|
19551
19789
|
set(effectiveJwt, newJwt, true);
|
|
19790
|
+
scheduleRefresh(newJwt);
|
|
19552
19791
|
},
|
|
19553
19792
|
downgradeJwt: async (accountUuid) => {
|
|
19554
19793
|
const core = getCore();
|
|
@@ -19572,12 +19811,22 @@ function createJwtFlowManager(options) {
|
|
|
19572
19811
|
set(pendingJwt, newJwt, true);
|
|
19573
19812
|
debug && uiLogger.info("🔐 Pending JWT set (first 50 chars):", newJwt == null ? void 0 : newJwt.substring(0, 50));
|
|
19574
19813
|
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
19814
|
+
scheduleRefresh(newJwt);
|
|
19575
19815
|
} catch (error) {
|
|
19576
19816
|
uiLogger.warn("⚠️ Failed to perform JWT downgrade:", error);
|
|
19577
19817
|
}
|
|
19578
19818
|
},
|
|
19579
19819
|
updateStepSnapshot: () => {
|
|
19580
19820
|
set(stepJwtSnapshot, untrack$1(() => get$1(effectiveJwt)), true);
|
|
19821
|
+
},
|
|
19822
|
+
canReAuth: () => reAuthCount < getMaxReAuths(),
|
|
19823
|
+
attemptReAuth,
|
|
19824
|
+
cancelRefreshTimer: () => {
|
|
19825
|
+
if (refreshTimer !== null) {
|
|
19826
|
+
clearTimeout(refreshTimer);
|
|
19827
|
+
refreshTimer = null;
|
|
19828
|
+
getDebug() && uiLogger.info("⏰ JWT refresh timer cancelled");
|
|
19829
|
+
}
|
|
19581
19830
|
}
|
|
19582
19831
|
};
|
|
19583
19832
|
}
|
|
@@ -20060,8 +20309,27 @@ function MultiStepFlow($$anchor, $$props) {
|
|
|
20060
20309
|
onJwtUpdate: (newJwt) => {
|
|
20061
20310
|
flowCoreStore.updateJwt(newJwt);
|
|
20062
20311
|
jwt(newJwt);
|
|
20312
|
+
},
|
|
20313
|
+
// maxReAuths is read reactively from the resolved recipe config (or FlowConfig prop)
|
|
20314
|
+
getMaxReAuths: () => {
|
|
20315
|
+
var _a3, _b2, _c;
|
|
20316
|
+
return (_c = (_a3 = config() === null || config() === void 0 ? void 0 : config().maxReAuths) !== null && _a3 !== void 0 ? _a3 : (_b2 = get$1(profileRecipe) === null || get$1(profileRecipe) === void 0 ? void 0 : get$1(profileRecipe).config) === null || _b2 === void 0 ? void 0 : _b2.maxReAuths) !== null && _c !== void 0 ? _c : 3;
|
|
20317
|
+
},
|
|
20318
|
+
onReAuthExhausted: () => {
|
|
20319
|
+
debug() && uiLogger.warn("🔐 Re-auth exhausted — halting flow with critical error");
|
|
20320
|
+
set(flowBarrier, null);
|
|
20321
|
+
set(
|
|
20322
|
+
flowError,
|
|
20323
|
+
{
|
|
20324
|
+
message: get$1(criticalErrorMessage),
|
|
20325
|
+
errorCode: "100305",
|
|
20326
|
+
description: "Authentication session expired and could not be renewed."
|
|
20327
|
+
},
|
|
20328
|
+
true
|
|
20329
|
+
);
|
|
20063
20330
|
}
|
|
20064
20331
|
});
|
|
20332
|
+
flowCoreStore.setJwtManager(jwtManager);
|
|
20065
20333
|
const flowManager = createFlowStateManager(() => config());
|
|
20066
20334
|
const eventDispatcher = createFlowEventDispatcher({
|
|
20067
20335
|
getFlowElement: () => get$1(
|
|
@@ -20270,6 +20538,7 @@ function MultiStepFlow($$anchor, $$props) {
|
|
|
20270
20538
|
}
|
|
20271
20539
|
return () => {
|
|
20272
20540
|
debug() && uiLogger.info("🧹 Cleaning up flow - resetting AlviereCore store");
|
|
20541
|
+
jwtManager.cancelRefreshTimer();
|
|
20273
20542
|
resetFlowCore();
|
|
20274
20543
|
resetFlowRecipe();
|
|
20275
20544
|
};
|