@visma-swno/customer-onboarding-wizard 1.0.14 → 1.0.16
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/README.md +3 -1
- package/dist/core/http.service.d.ts +7 -4
- package/dist/index.js +99 -96
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -28,7 +28,9 @@ npm install @visma-swno/customer-onboarding-wizard
|
|
|
28
28
|
taskId="task-12345"
|
|
29
29
|
locale="en-US"
|
|
30
30
|
step="welcome"
|
|
31
|
-
adminUrl="https://admin.example.com/customer/user-access"
|
|
31
|
+
adminUrl="https://admin.example.com/customer/user-access"
|
|
32
|
+
user-name="Joe Doe"
|
|
33
|
+
user-email="joe.doe@gmail.com">
|
|
32
34
|
</vsn-customer-onboarding-wizard>
|
|
33
35
|
```
|
|
34
36
|
|
|
@@ -204,10 +204,11 @@ export declare class HttpService {
|
|
|
204
204
|
*/
|
|
205
205
|
saveProgress(taskId: string, step: 'welcome' | 'company' | 'administrators' | 'partner-access'): Promise<void>;
|
|
206
206
|
/**
|
|
207
|
-
*
|
|
207
|
+
* Complete an onboarding task
|
|
208
|
+
* POST /api/v1/onboarding/tasks/{taskId}/complete
|
|
208
209
|
* @param taskId - The onboarding task ID
|
|
209
210
|
*/
|
|
210
|
-
|
|
211
|
+
completeTask(taskId: string): Promise<void>;
|
|
211
212
|
/**
|
|
212
213
|
* Look up a user by email address.
|
|
213
214
|
* Returns null when the user does not exist (404), without triggering the
|
|
@@ -223,11 +224,13 @@ export declare class HttpService {
|
|
|
223
224
|
*/
|
|
224
225
|
addCustomerAdministrators(customerId: string, admins: AddAdministratorRequest[]): Promise<unknown>;
|
|
225
226
|
/**
|
|
226
|
-
* Get consultants for a partner
|
|
227
|
+
* Get consultants for a partner, scoped to a customer
|
|
228
|
+
* GET /api/v1/partners/{partnerId}/customer/{customerId}/consultants
|
|
227
229
|
* @param partnerId - The partner ID
|
|
230
|
+
* @param customerId - The customer ID the consultants are scoped to
|
|
228
231
|
* @returns Promise with paginated list of consultants
|
|
229
232
|
*/
|
|
230
|
-
getPartnerConsultants(partnerId: string): Promise<ConsultantsResponse>;
|
|
233
|
+
getPartnerConsultants(partnerId: string, customerId: string): Promise<ConsultantsResponse>;
|
|
231
234
|
/**
|
|
232
235
|
* Add consultants to a customer
|
|
233
236
|
* POST /api/v1/customers/{customerId}/partners/{partnerId}/consultants
|
package/dist/index.js
CHANGED
|
@@ -100,7 +100,7 @@ const N = S`:host{--ga-color-black:#000;--ga-color-blue-10:#edf4fe;--ga-color-in
|
|
|
100
100
|
<path d="m21 21-4.3-4.3"/>
|
|
101
101
|
</svg>
|
|
102
102
|
`
|
|
103
|
-
},
|
|
103
|
+
}, I = {
|
|
104
104
|
"en-US": {
|
|
105
105
|
wizard: {
|
|
106
106
|
title: "Set up your company"
|
|
@@ -791,7 +791,7 @@ class U {
|
|
|
791
791
|
*/
|
|
792
792
|
setLocale(t) {
|
|
793
793
|
const a = t === "en-GB" ? "en-US" : t;
|
|
794
|
-
return Object.prototype.hasOwnProperty.call(
|
|
794
|
+
return Object.prototype.hasOwnProperty.call(I, a) ? (this.currentLocale = a, !0) : (console.warn(`Locale "${t}" not supported. Falling back to en-US.`), this.currentLocale = "en-US", !1);
|
|
795
795
|
}
|
|
796
796
|
/**
|
|
797
797
|
* Get the current locale
|
|
@@ -804,20 +804,20 @@ class U {
|
|
|
804
804
|
* Get translations for the current locale
|
|
805
805
|
*/
|
|
806
806
|
getTranslations() {
|
|
807
|
-
return
|
|
807
|
+
return I[this.currentLocale];
|
|
808
808
|
}
|
|
809
809
|
/**
|
|
810
810
|
* Get a translation by key path
|
|
811
811
|
*/
|
|
812
812
|
t(t) {
|
|
813
813
|
const a = t.split(".");
|
|
814
|
-
let i =
|
|
814
|
+
let i = I[this.currentLocale];
|
|
815
815
|
for (const r of a)
|
|
816
816
|
i = i == null ? void 0 : i[r];
|
|
817
817
|
return typeof i == "string" ? i : t;
|
|
818
818
|
}
|
|
819
819
|
}
|
|
820
|
-
class
|
|
820
|
+
class q extends Error {
|
|
821
821
|
constructor(t, a) {
|
|
822
822
|
super(`HTTP ${t}: ${a}`), this.status = t, this.name = "HttpError";
|
|
823
823
|
}
|
|
@@ -864,12 +864,12 @@ class F {
|
|
|
864
864
|
endpoint: i,
|
|
865
865
|
method: r,
|
|
866
866
|
retry: s
|
|
867
|
-
},
|
|
867
|
+
}, v = new CustomEvent("http-error", {
|
|
868
868
|
detail: o,
|
|
869
869
|
bubbles: !0,
|
|
870
870
|
composed: !0
|
|
871
871
|
});
|
|
872
|
-
(L = this.eventTarget) == null || L.dispatchEvent(
|
|
872
|
+
(L = this.eventTarget) == null || L.dispatchEvent(v);
|
|
873
873
|
}
|
|
874
874
|
/**
|
|
875
875
|
* Emit error message event for internal error handling
|
|
@@ -881,7 +881,7 @@ class F {
|
|
|
881
881
|
* @param method - HTTP method
|
|
882
882
|
*/
|
|
883
883
|
emitErrorMessage(t, a, i, r) {
|
|
884
|
-
var
|
|
884
|
+
var v;
|
|
885
885
|
const s = {
|
|
886
886
|
status: t,
|
|
887
887
|
errorKey: a,
|
|
@@ -892,10 +892,10 @@ class F {
|
|
|
892
892
|
bubbles: !0,
|
|
893
893
|
composed: !0
|
|
894
894
|
});
|
|
895
|
-
(
|
|
895
|
+
(v = this.eventTarget) == null || v.dispatchEvent(o);
|
|
896
896
|
}
|
|
897
897
|
async request(t, a = {}) {
|
|
898
|
-
const { method: i = "GET", headers: r = {}, body: s, timeout: o = 3e4 } = a,
|
|
898
|
+
const { method: i = "GET", headers: r = {}, body: s, timeout: o = 3e4 } = a, v = new AbortController(), L = setTimeout(() => v.abort(), o), z = {
|
|
899
899
|
...this.defaultHeaders,
|
|
900
900
|
...r
|
|
901
901
|
};
|
|
@@ -905,7 +905,7 @@ class F {
|
|
|
905
905
|
method: i,
|
|
906
906
|
headers: z,
|
|
907
907
|
body: s ? JSON.stringify(s) : void 0,
|
|
908
|
-
signal:
|
|
908
|
+
signal: v.signal
|
|
909
909
|
});
|
|
910
910
|
if (clearTimeout(L), !g.ok) {
|
|
911
911
|
if (g.status === 401 || g.status === 403)
|
|
@@ -921,11 +921,11 @@ class F {
|
|
|
921
921
|
const T = this.getErrorKey(g.status);
|
|
922
922
|
this.emitErrorMessage(g.status, T, t, i);
|
|
923
923
|
}
|
|
924
|
-
throw new
|
|
924
|
+
throw new q(g.status, g.statusText);
|
|
925
925
|
}
|
|
926
926
|
return g.status === 204 ? void 0 : await g.json();
|
|
927
927
|
} catch (g) {
|
|
928
|
-
if (clearTimeout(L), g instanceof
|
|
928
|
+
if (clearTimeout(L), g instanceof q)
|
|
929
929
|
throw g;
|
|
930
930
|
if (g instanceof Error) {
|
|
931
931
|
const k = g.message.includes("aborted") ? "requestTimeout" : "networkError";
|
|
@@ -1000,11 +1000,12 @@ class F {
|
|
|
1000
1000
|
return this.patch(`/api/v1/onboarding/tasks/${t}`, { step: a });
|
|
1001
1001
|
}
|
|
1002
1002
|
/**
|
|
1003
|
-
*
|
|
1003
|
+
* Complete an onboarding task
|
|
1004
|
+
* POST /api/v1/onboarding/tasks/{taskId}/complete
|
|
1004
1005
|
* @param taskId - The onboarding task ID
|
|
1005
1006
|
*/
|
|
1006
|
-
|
|
1007
|
-
return this.
|
|
1007
|
+
completeTask(t) {
|
|
1008
|
+
return this.request(`/api/v1/onboarding/tasks/${t}/complete`, { method: "POST" });
|
|
1008
1009
|
}
|
|
1009
1010
|
/**
|
|
1010
1011
|
* Look up a user by email address.
|
|
@@ -1019,7 +1020,7 @@ class F {
|
|
|
1019
1020
|
{ suppressErrorStatuses: [404] }
|
|
1020
1021
|
);
|
|
1021
1022
|
} catch (a) {
|
|
1022
|
-
if (a instanceof
|
|
1023
|
+
if (a instanceof q && a.status === 404)
|
|
1023
1024
|
return null;
|
|
1024
1025
|
throw a;
|
|
1025
1026
|
}
|
|
@@ -1034,12 +1035,14 @@ class F {
|
|
|
1034
1035
|
return this.post(`/api/v1/customers/${t}/administrators`, a);
|
|
1035
1036
|
}
|
|
1036
1037
|
/**
|
|
1037
|
-
* Get consultants for a partner
|
|
1038
|
+
* Get consultants for a partner, scoped to a customer
|
|
1039
|
+
* GET /api/v1/partners/{partnerId}/customer/{customerId}/consultants
|
|
1038
1040
|
* @param partnerId - The partner ID
|
|
1041
|
+
* @param customerId - The customer ID the consultants are scoped to
|
|
1039
1042
|
* @returns Promise with paginated list of consultants
|
|
1040
1043
|
*/
|
|
1041
|
-
getPartnerConsultants(t) {
|
|
1042
|
-
return this.get(`/api/v1/partners/${t}/consultants`);
|
|
1044
|
+
getPartnerConsultants(t, a) {
|
|
1045
|
+
return this.get(`/api/v1/partners/${t}/customer/${a}/consultants`);
|
|
1043
1046
|
}
|
|
1044
1047
|
/**
|
|
1045
1048
|
* Add consultants to a customer
|
|
@@ -1056,7 +1059,7 @@ class F {
|
|
|
1056
1059
|
}
|
|
1057
1060
|
}
|
|
1058
1061
|
const P = S`:host{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden;}.step-content{text-align:left;flex:1;min-height:0;overflow-y:auto;}.step-content h2{font-size:var(--ga-text-2xl-size);line-height:var(--ga-text-2xl-line-height);letter-spacing:var(--ga-text-2xl-tracking);font-weight:var(--ga-font-weight-normal);margin:0 0 var(--ga-size-spacing-03);color:var(--ga-color-text-headings);}.wizard-actions{display:flex;justify-content:flex-end;align-items:center;margin-top:var(--ga-size-spacing-05);padding-top:var(--ga-size-spacing-05);border-top:var(--ga-size-border-width-sm) solid var(--ga-color-neutral-30);gap:var(--ga-size-spacing-05);flex-shrink:0;}.field-error{display:flex;align-items:center;gap:var(--ga-size-spacing-02);margin-top:var(--ga-size-spacing-01);color:var(--ga-color-icon-error);font-size:var(--ga-text-sm-size);font-family:var(--vsn-customer-onboarding-wizard-font-family);line-height:var(--ga-text-sm-line-height);}.field-error svg{width:var(--ga-size-spacing-04);height:var(--ga-size-spacing-04);flex-shrink:0;}.field-error-text{color:var(--ga-color-text-body);}.field-error--empty{visibility:hidden;}`;
|
|
1059
|
-
var M = Object.defineProperty, V = Object.getOwnPropertyDescriptor,
|
|
1062
|
+
var M = Object.defineProperty, V = Object.getOwnPropertyDescriptor, D = (e, t, a, i) => {
|
|
1060
1063
|
for (var r = i > 1 ? void 0 : i ? V(t, a) : t, s = e.length - 1, o; s >= 0; s--)
|
|
1061
1064
|
(o = e[s]) && (r = (i ? o(t, a, r) : o(r)) || r);
|
|
1062
1065
|
return i && r && M(t, a, r), r;
|
|
@@ -1110,22 +1113,22 @@ j.styles = [
|
|
|
1110
1113
|
P,
|
|
1111
1114
|
S`.wizard-content{display:flex;flex-direction:column;gap:var(--ga-size-spacing-06);flex:1 1 270px;min-height:0;text-align:left;align-self:center;width:100%;max-width:var(--ga-size-content-sm);padding:0;overflow-y:auto;}.wizard-content p{font-size:var(--ga-text-md-size);line-height:var(--ga-text-md-line-height);letter-spacing:var(--ga-text-md-tracking);color:var(--ga-color-text-body);margin:0;}.wizard-content h2.welcome-message{font-size:var(--ga-text-2xl-size);line-height:var(--ga-text-2xl-line-height);letter-spacing:var(--ga-text-2xl-tracking);font-weight:var(--ga-font-weight-normal);margin:0;color:var(--ga-color-text-headings);}.wizard-actions{border-top:none;padding-top:0;margin-top:0;}h2[tabindex="-1"]:focus{outline:none;}`
|
|
1112
1115
|
];
|
|
1113
|
-
|
|
1116
|
+
D([
|
|
1114
1117
|
d({ type: String })
|
|
1115
1118
|
], j.prototype, "userName", 2);
|
|
1116
|
-
|
|
1119
|
+
D([
|
|
1117
1120
|
d({ type: Object })
|
|
1118
1121
|
], j.prototype, "translations", 2);
|
|
1119
|
-
j =
|
|
1122
|
+
j = D([
|
|
1120
1123
|
A("wizard-step-welcome")
|
|
1121
1124
|
], j);
|
|
1122
|
-
var _ = Object.defineProperty, K = Object.getOwnPropertyDescriptor,
|
|
1125
|
+
var _ = Object.defineProperty, K = Object.getOwnPropertyDescriptor, h = (e, t, a, i) => {
|
|
1123
1126
|
for (var r = i > 1 ? void 0 : i ? K(t, a) : t, s = e.length - 1, o; s >= 0; s--)
|
|
1124
1127
|
(o = e[s]) && (r = (i ? o(t, a, r) : o(r)) || r);
|
|
1125
1128
|
return i && r && _(t, a, r), r;
|
|
1126
1129
|
};
|
|
1127
1130
|
const C = ["NO", "SE", "DK", "FI", "NL"];
|
|
1128
|
-
let
|
|
1131
|
+
let m = class extends E {
|
|
1129
1132
|
constructor() {
|
|
1130
1133
|
super(...arguments), this.locale = "en-GB", this.customer = null, this.subscriptions = { content: [], totalNumberOfRecords: 0 }, this.editingContact = !1, this.countryDropdownOpen = !1, this.fieldErrors = {}, this.editName = "", this.editAddress1 = "", this.editAddress2 = "", this.editPostalCode = "", this.editCity = "", this.editCountryCode = "", this.editWebUrl = "", this.editContactEmail = "", this.localCustomer = null;
|
|
1131
1134
|
}
|
|
@@ -1238,15 +1241,15 @@ let u = class extends E {
|
|
|
1238
1241
|
e.preventDefault();
|
|
1239
1242
|
const r = C.indexOf(t), s = C[Math.min(r + 1, C.length - 1)];
|
|
1240
1243
|
this.editCountryCode = s, this.updateComplete.then(() => {
|
|
1241
|
-
var o,
|
|
1242
|
-
(
|
|
1244
|
+
var o, v;
|
|
1245
|
+
(v = (o = this.shadowRoot) == null ? void 0 : o.querySelector(`[data-country-code="${s}"]`)) == null || v.focus();
|
|
1243
1246
|
});
|
|
1244
1247
|
} else if (e.key === "ArrowUp") {
|
|
1245
1248
|
e.preventDefault();
|
|
1246
1249
|
const r = C.indexOf(t), s = C[Math.max(r - 1, 0)];
|
|
1247
1250
|
this.editCountryCode = s, this.updateComplete.then(() => {
|
|
1248
|
-
var o,
|
|
1249
|
-
(
|
|
1251
|
+
var o, v;
|
|
1252
|
+
(v = (o = this.shadowRoot) == null ? void 0 : o.querySelector(`[data-country-code="${s}"]`)) == null || v.focus();
|
|
1250
1253
|
});
|
|
1251
1254
|
} else e.key === "Escape" && (e.stopPropagation(), (i = (a = this.shadowRoot) == null ? void 0 : a.querySelector(".select-trigger")) == null || i.focus(), this.countryDropdownOpen = !1);
|
|
1252
1255
|
}
|
|
@@ -1542,63 +1545,63 @@ let u = class extends E {
|
|
|
1542
1545
|
`;
|
|
1543
1546
|
}
|
|
1544
1547
|
};
|
|
1545
|
-
|
|
1548
|
+
m.styles = [
|
|
1546
1549
|
N,
|
|
1547
1550
|
R,
|
|
1548
1551
|
P,
|
|
1549
1552
|
S`:host{--avatar-size:var(--ga-size-spacing-09);}.step-content > p{font-size:var(--ga-text-md-size);line-height:var(--ga-text-md-line-height);letter-spacing:var(--ga-text-md-tracking);color:var(--ga-color-text-body);margin:0 0 var(--ga-size-spacing-06);}.section-divider{border:none;border-top:var(--ga-size-border-width-sm) solid var(--ga-color-neutral-30);margin:0 0 var(--ga-size-spacing-06);}.loading-placeholder{padding:var(--ga-size-spacing-05);background:var(--ga-color-neutral-10);border-radius:var(--ga-radius);color:var(--ga-color-neutral-60);font-size:var(--ga-text-md-size);line-height:var(--ga-text-md-line-height);}.company-header{display:flex;align-items:center;gap:var(--ga-size-spacing-05);margin-bottom:var(--ga-size-spacing-07);}.company-header--editing{margin-bottom:var(--ga-size-spacing-05);}.company-avatar{width:var(--avatar-size);height:var(--avatar-size);border-radius:var(--ga-radius-round);background:transparent;border:var(--ga-size-border-width-sm) solid var(--ga-color-text-headings);color:var(--ga-color-text-headings);display:flex;align-items:center;justify-content:center;font-size:var(--ga-text-md-size);font-weight:600;flex-shrink:0;}.company-name{font-size:var(--ga-text-xl-size);line-height:var(--ga-text-xl-line-height);letter-spacing:var(--ga-text-xl-tracking);font-weight:400;margin:0;color:var(--ga-color-text-headings);}.company-columns{display:flex;gap:var(--ga-size-spacing-07);align-items:flex-start;padding-bottom:var(--ga-size-spacing-04);padding-left:var(--ga-size-spacing-10);padding-right:var(--ga-size-spacing-10);}.contact-column{width:var(--ga-size-content-xs);flex-shrink:0;display:flex;flex-direction:column;gap:var(--ga-size-spacing-05);}.edit-form{display:flex;flex-direction:column;gap:var(--ga-size-spacing-05);}.form-field{display:flex;flex-direction:column;}.form-input{width:100%;padding:var(--ga-size-spacing-03) var(--ga-size-spacing-04);border:var(--ga-size-border-width-sm) solid var(--ga-color-border-primary);border-radius:var(--ga-radius);font-size:var(--ga-text-md-size);font-family:var(--ga-font-family-primary);line-height:var(--ga-text-md-line-height);letter-spacing:var(--ga-text-md-tracking);color:var(--ga-color-text-action);background:var(--ga-color-white);box-sizing:border-box;outline:none;transition:border-color 0.2s;}.form-input:focus{border-color:var(--ga-color-border-focus);box-shadow:0 0 0 var(--ga-size-border-width-md) var(--ga-color-white),0 0 0 var(--ga-size-border-width-lg) var(--ga-color-border-focus);}.form-input.has-error{border-color:var(--ga-color-border-error);background:var(--ga-color-surface-error);}.form-input.has-error:focus{border-color:var(--ga-color-border-error);box-shadow:0 0 0 var(--ga-size-border-width-md) var(--ga-color-white),0 0 0 var(--ga-size-border-width-lg) var(--ga-color-border-error);}.postal-city-row{display:flex;gap:var(--ga-size-spacing-03);}.input-postal{width:var(--ga-size-spacing-10);flex-shrink:0;}.input-city{flex:1;}.input-country{max-width:var(--ga-size-content-2xs);}.select-wrapper{position:relative;max-width:var(--ga-size-content-2xs);}.select-trigger{display:flex;align-items:center;justify-content:space-between;text-align:left;cursor:pointer;width:100%;padding-right:var(--ga-size-spacing-04);}.select-trigger svg{width:var(--ga-size-spacing-05);height:var(--ga-size-spacing-05);flex-shrink:0;color:var(--ga-color-text-action);}.dropdown-menu{position:absolute;top:calc(100% + var(--ga-size-spacing-01));left:0;right:0;background:var(--ga-color-surface-primary);border:var(--ga-size-border-width-sm) solid var(--ga-color-border-primary);border-radius:var(--ga-radius);box-shadow:var(--ga-shadow-dropdown);list-style:none;margin:0;padding:0;z-index:10;overflow:hidden;}.dropdown-option{display:flex;align-items:center;gap:var(--ga-size-spacing-03);padding:var(--ga-size-spacing-03) var(--ga-size-spacing-04);font-size:var(--ga-text-md-size);font-family:var(--ga-font-family-primary);line-height:var(--ga-text-md-line-height);letter-spacing:var(--ga-text-md-tracking);color:var(--ga-color-text-body);cursor:pointer;list-style:none;outline:none;position:relative;}.dropdown-option[aria-selected='true']{background:var(--ga-color-surface-selected);}.dropdown-option:hover{background:var(--ga-color-surface-action-hover-2);color:var(--ga-color-text-action-hover);}.dropdown-option:focus{box-shadow:inset 0 0 0 var(--ga-size-border-width-md) var(--ga-color-border-focus);}.dropdown-option-icon{width:var(--ga-size-spacing-05);height:var(--ga-size-spacing-05);flex-shrink:0;display:flex;align-items:center;justify-content:center;color:var(--ga-color-text-body);}.dropdown-option-icon svg{width:var(--ga-size-spacing-05);height:var(--ga-size-spacing-05);}.company-name-wrapper{flex:1;min-width:0;display:flex;flex-direction:column;gap:var(--ga-size-spacing-03);}.org-number{font-size:var(--ga-text-sm-size);line-height:var(--ga-text-sm-line-height);color:var(--ga-color-text-subtle);}.form-input--readonly{background:var(--ga-color-neutral-10);cursor:default;color:var(--ga-color-text-body);}.form-input--readonly.org-number{font-size:var(--ga-text-md-size);line-height:var(--ga-text-md-line-height);color:var(--ga-color-text-body);}.field-label-text{margin:0 0 var(--ga-size-spacing-01);font-size:var(--ga-text-md-size);line-height:var(--ga-text-md-line-height);letter-spacing:var(--ga-text-md-tracking);color:var(--ga-color-text-body);}.company-name-input{width:var(--ga-size-content-xs);box-sizing:border-box;}.edit-actions{display:flex;gap:var(--ga-size-spacing-05);align-items:center;margin-top:var(--ga-size-spacing-03);}.subscription-card{flex:1;border-radius:var(--ga-radius);background:var(--ga-color-surface-page);padding:var(--ga-size-spacing-03) var(--ga-size-spacing-03) var(--ga-size-spacing-03) var(--ga-size-spacing-05);display:flex;flex-direction:column;gap:var(--ga-size-spacing-03);}.subscription-title{font-size:var(--ga-text-md-size);line-height:var(--ga-text-md-line-height);letter-spacing:var(--ga-text-md-tracking);font-weight:700;color:var(--ga-color-text-body);margin:0;}.contact-info{display:flex;flex-direction:column;gap:var(--ga-size-spacing-05);}.contact-group{display:flex;flex-direction:column;gap:var(--ga-size-spacing-01);}.contact-info p{margin:0;font-size:var(--ga-text-md-size);line-height:var(--ga-text-md-line-height);letter-spacing:var(--ga-text-md-tracking);color:var(--ga-color-text-body);}.subscription-list{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:var(--ga-size-spacing-03);}.subscription-list li{display:flex;align-items:center;gap:var(--ga-size-spacing-03);font-size:var(--ga-text-md-size);line-height:var(--ga-text-md-line-height);letter-spacing:var(--ga-text-md-tracking);color:var(--ga-color-text-body);}.subscription-list li svg{width:var(--ga-size-spacing-05);height:var(--ga-size-spacing-05);color:var(--ga-color-text-body);flex-shrink:0;}.plan-notification{display:flex;align-items:flex-start;gap:var(--ga-size-spacing-05);padding:var(--ga-size-spacing-03) var(--ga-size-spacing-03) var(--ga-size-spacing-03) var(--ga-size-spacing-05);background:var(--ga-color-surface-information);border:var(--ga-size-border-width-sm) solid var(--ga-color-border-information);border-radius:var(--ga-radius);}.plan-notification-icon{color:var(--ga-color-icon-information);flex-shrink:0;padding-top:var(--ga-size-spacing-03);}.plan-notification-icon svg{width:var(--ga-size-spacing-05);height:var(--ga-size-spacing-05);}.plan-notification-text{font-size:var(--ga-text-md-size);line-height:var(--ga-text-md-line-height);color:var(--ga-color-text-body);margin:var(--ga-size-spacing-03) 0;}.wizard-actions{margin-top:0;}.sr-only{position:absolute;width:var(--ga-size-border-width-sm);height:var(--ga-size-border-width-sm);padding:0;margin:calc(var(--ga-size-border-width-sm) * -1);overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0;}.edit-contact-btn{all:unset;display:inline-flex;align-items:center;align-self:flex-start;height:var(--ga-size-40);padding:0 var(--ga-size-spacing-05);border:var(--ga-size-border-width-sm) solid var(--ga-color-cyan-80);border-radius:var(--ga-radius);background:var(--ga-color-white);color:var(--ga-color-text-body);font-size:var(--ga-text-md-size);font-weight:var(--ga-font-weight-medium);font-family:var(--vsn-customer-onboarding-wizard-font-family);cursor:pointer;white-space:nowrap;box-sizing:border-box;}.edit-contact-btn:hover{background:var(--ga-color-secondary-10);}.edit-contact-btn:focus-visible{outline:var(--ga-size-border-width-md) solid var(--ga-color-border-focus);outline-offset:var(--ga-size-border-width-md);}h2[tabindex="-1"]:focus{outline:none;}`
|
|
1550
1553
|
];
|
|
1551
|
-
|
|
1554
|
+
h([
|
|
1552
1555
|
d({ type: Object })
|
|
1553
|
-
],
|
|
1554
|
-
|
|
1556
|
+
], m.prototype, "translations", 2);
|
|
1557
|
+
h([
|
|
1555
1558
|
d({ type: String })
|
|
1556
|
-
],
|
|
1557
|
-
|
|
1559
|
+
], m.prototype, "locale", 2);
|
|
1560
|
+
h([
|
|
1558
1561
|
d({ type: Object })
|
|
1559
|
-
],
|
|
1560
|
-
|
|
1562
|
+
], m.prototype, "customer", 2);
|
|
1563
|
+
h([
|
|
1561
1564
|
d({ type: Object })
|
|
1562
|
-
],
|
|
1563
|
-
|
|
1565
|
+
], m.prototype, "subscriptions", 2);
|
|
1566
|
+
h([
|
|
1564
1567
|
l()
|
|
1565
|
-
],
|
|
1566
|
-
|
|
1568
|
+
], m.prototype, "editingContact", 2);
|
|
1569
|
+
h([
|
|
1567
1570
|
l()
|
|
1568
|
-
],
|
|
1569
|
-
|
|
1571
|
+
], m.prototype, "countryDropdownOpen", 2);
|
|
1572
|
+
h([
|
|
1570
1573
|
l()
|
|
1571
|
-
],
|
|
1572
|
-
|
|
1574
|
+
], m.prototype, "fieldErrors", 2);
|
|
1575
|
+
h([
|
|
1573
1576
|
l()
|
|
1574
|
-
],
|
|
1575
|
-
|
|
1577
|
+
], m.prototype, "editName", 2);
|
|
1578
|
+
h([
|
|
1576
1579
|
l()
|
|
1577
|
-
],
|
|
1578
|
-
|
|
1580
|
+
], m.prototype, "editAddress1", 2);
|
|
1581
|
+
h([
|
|
1579
1582
|
l()
|
|
1580
|
-
],
|
|
1581
|
-
|
|
1583
|
+
], m.prototype, "editAddress2", 2);
|
|
1584
|
+
h([
|
|
1582
1585
|
l()
|
|
1583
|
-
],
|
|
1584
|
-
|
|
1586
|
+
], m.prototype, "editPostalCode", 2);
|
|
1587
|
+
h([
|
|
1585
1588
|
l()
|
|
1586
|
-
],
|
|
1587
|
-
|
|
1589
|
+
], m.prototype, "editCity", 2);
|
|
1590
|
+
h([
|
|
1588
1591
|
l()
|
|
1589
|
-
],
|
|
1590
|
-
|
|
1592
|
+
], m.prototype, "editCountryCode", 2);
|
|
1593
|
+
h([
|
|
1591
1594
|
l()
|
|
1592
|
-
],
|
|
1593
|
-
|
|
1595
|
+
], m.prototype, "editWebUrl", 2);
|
|
1596
|
+
h([
|
|
1594
1597
|
l()
|
|
1595
|
-
],
|
|
1596
|
-
|
|
1598
|
+
], m.prototype, "editContactEmail", 2);
|
|
1599
|
+
h([
|
|
1597
1600
|
l()
|
|
1598
|
-
],
|
|
1599
|
-
|
|
1601
|
+
], m.prototype, "localCustomer", 2);
|
|
1602
|
+
m = h([
|
|
1600
1603
|
A("wizard-step1-company")
|
|
1601
|
-
],
|
|
1604
|
+
], m);
|
|
1602
1605
|
var W = Object.defineProperty, G = Object.getOwnPropertyDescriptor, x = (e, t, a, i) => {
|
|
1603
1606
|
for (var r = i > 1 ? void 0 : i ? G(t, a) : t, s = e.length - 1, o; s >= 0; s--)
|
|
1604
1607
|
(o = e[s]) && (r = (i ? o(t, a, r) : o(r)) || r);
|
|
@@ -1725,7 +1728,7 @@ let f = class extends E {
|
|
|
1725
1728
|
return e;
|
|
1726
1729
|
}
|
|
1727
1730
|
async lookupUser(e) {
|
|
1728
|
-
var i, r, s, o,
|
|
1731
|
+
var i, r, s, o, v, L;
|
|
1729
1732
|
const t = this.rows.find((z) => z.id === e);
|
|
1730
1733
|
if (!t || !this.httpService) return;
|
|
1731
1734
|
if (!this.validateRowEmail(e, t.email)) {
|
|
@@ -1741,7 +1744,7 @@ let f = class extends E {
|
|
|
1741
1744
|
(k) => k.id === e ? { ...k, state: "found", firstName: z.firstName, lastName: z.lastName } : k
|
|
1742
1745
|
), await this.updateComplete, (o = (s = this.shadowRoot) == null ? void 0 : s.querySelector(`button[data-done-row-id="${e}"]`)) == null || o.focus()) : (this.rows = this.rows.map(
|
|
1743
1746
|
(k) => k.id === e ? { ...k, state: "not-found", firstName: "", lastName: "" } : k
|
|
1744
|
-
), await this.updateComplete, (L = (
|
|
1747
|
+
), await this.updateComplete, (L = (v = this.shadowRoot) == null ? void 0 : v.querySelector(`input[data-row-id="${e}"]`)) == null || L.focus());
|
|
1745
1748
|
} catch {
|
|
1746
1749
|
} finally {
|
|
1747
1750
|
const z = new Set(this.lookingUpIds);
|
|
@@ -2146,17 +2149,17 @@ let w = class extends E {
|
|
|
2146
2149
|
});
|
|
2147
2150
|
}
|
|
2148
2151
|
willUpdate(e) {
|
|
2149
|
-
(e.has("httpService") || e.has("partnerId")) && this.loadConsultants();
|
|
2152
|
+
(e.has("httpService") || e.has("partnerId") || e.has("customerId")) && this.loadConsultants();
|
|
2150
2153
|
}
|
|
2151
2154
|
async loadConsultants() {
|
|
2152
|
-
if (!this.httpService || !this.partnerId) {
|
|
2155
|
+
if (!this.httpService || !this.partnerId || !this.customerId) {
|
|
2153
2156
|
++this._loadSequence, this.consultants = [], this.selectedIds = /* @__PURE__ */ new Set(), this.searchTerm = "", this.isLoading = !1;
|
|
2154
2157
|
return;
|
|
2155
2158
|
}
|
|
2156
2159
|
const e = ++this._loadSequence;
|
|
2157
2160
|
this.isLoading = !0, this.consultants = [], this.selectedIds = /* @__PURE__ */ new Set(), this.searchTerm = "";
|
|
2158
2161
|
try {
|
|
2159
|
-
const t = await this.httpService.getPartnerConsultants(this.partnerId);
|
|
2162
|
+
const t = await this.httpService.getPartnerConsultants(this.partnerId, this.customerId);
|
|
2160
2163
|
if (e !== this._loadSequence) return;
|
|
2161
2164
|
this.consultants = t.content;
|
|
2162
2165
|
} catch {
|
|
@@ -2366,7 +2369,7 @@ var Q = Object.defineProperty, X = Object.getOwnPropertyDescriptor, b = (e, t, a
|
|
|
2366
2369
|
(o = e[s]) && (r = (i ? o(t, a, r) : o(r)) || r);
|
|
2367
2370
|
return i && r && Q(t, a, r), r;
|
|
2368
2371
|
};
|
|
2369
|
-
let
|
|
2372
|
+
let u = class extends E {
|
|
2370
2373
|
constructor() {
|
|
2371
2374
|
super(...arguments), this.locale = "en-US", this.baseUrl = "", this.adminUrl = "", this.taskId = "", this.customerId = "", this.step = "welcome", this.userName = "User", this.userEmail = "", this.currentStep = 0, this.completedSteps = /* @__PURE__ */ new Set(), this.errorState = null, this.customer = null, this.customerSubscriptions = { content: [], totalNumberOfRecords: 0 }, this.visible = !0, this.i18n = new U(), this.httpService = null, this.pendingAuthToken = void 0, this.errorMessageListener = null;
|
|
2372
2375
|
}
|
|
@@ -2379,7 +2382,7 @@ let h = class extends E {
|
|
|
2379
2382
|
];
|
|
2380
2383
|
}
|
|
2381
2384
|
connectedCallback() {
|
|
2382
|
-
super.connectedCallback(), this.currentStep =
|
|
2385
|
+
super.connectedCallback(), this.currentStep = u.stepMap[this.step] ?? 0, this.i18n.setLocale(this.locale), this.setupErrorMessageListener();
|
|
2383
2386
|
}
|
|
2384
2387
|
firstUpdated() {
|
|
2385
2388
|
this.updateComplete.then(() => {
|
|
@@ -2536,21 +2539,21 @@ let h = class extends E {
|
|
|
2536
2539
|
window.location.href = e;
|
|
2537
2540
|
}
|
|
2538
2541
|
handleClose(e) {
|
|
2539
|
-
var r
|
|
2542
|
+
var r;
|
|
2540
2543
|
const a = ((r = e.detail) == null ? void 0 : r.redirect) === !0 ? this.adminUrl : "";
|
|
2541
2544
|
this.dispatchEvent(new CustomEvent("wizard-closed", {
|
|
2542
2545
|
detail: { completed: !0 },
|
|
2543
2546
|
bubbles: !0,
|
|
2544
2547
|
composed: !0
|
|
2545
2548
|
}));
|
|
2546
|
-
const i = (
|
|
2549
|
+
const i = (s) => {
|
|
2547
2550
|
try {
|
|
2548
|
-
const { protocol:
|
|
2549
|
-
(
|
|
2551
|
+
const { protocol: o } = new URL(s);
|
|
2552
|
+
(o === "https:" || o === "http:") && this.navigate(s);
|
|
2550
2553
|
} catch {
|
|
2551
2554
|
}
|
|
2552
2555
|
};
|
|
2553
|
-
this.taskId
|
|
2556
|
+
this.taskId && this.httpService ? this.httpService.completeTask(this.taskId).then(() => {
|
|
2554
2557
|
this.visible = !1, a && i(a);
|
|
2555
2558
|
}).catch(() => {
|
|
2556
2559
|
this.visible = !1;
|
|
@@ -2692,64 +2695,64 @@ let h = class extends E {
|
|
|
2692
2695
|
`;
|
|
2693
2696
|
}
|
|
2694
2697
|
};
|
|
2695
|
-
|
|
2698
|
+
u.stepMap = {
|
|
2696
2699
|
welcome: 0,
|
|
2697
2700
|
company: 1,
|
|
2698
2701
|
administrators: 2,
|
|
2699
2702
|
"partner-access": 3,
|
|
2700
2703
|
complete: 4
|
|
2701
2704
|
};
|
|
2702
|
-
|
|
2705
|
+
u.styles = [
|
|
2703
2706
|
N,
|
|
2704
2707
|
R,
|
|
2705
2708
|
S`:host{display:block;font-family:var(--vsn-customer-onboarding-wizard-font-family);}.overlay{position:fixed;inset:var(--vsn-customer-onboarding-wizard-navbar-height,var(--vsn-co-navbar-height,0px)) 0 0 0;background:var(--vsn-customer-onboarding-wizard-overlay-bg,var(--ga-color-miscellaneous-overlay));display:flex;align-items:center;justify-content:center;z-index:1000;}.wizard-container{background:var(--ga-color-white);width:780px;max-height:90vh;box-sizing:border-box;padding:var(--ga-size-spacing-05);border-radius:var(--ga-radius);border:1px solid var(--ga-color-cyan-80);display:flex;flex-direction:column;overflow:hidden;}.wizard-body{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden;}h1.wizard-title{font-size:var(--ga-text-xl-size);line-height:var(--ga-text-xl-line-height);font-weight:var(--ga-font-weight-semibold);margin:0;padding-bottom:var(--ga-size-spacing-06);color:var(--ga-color-text-headings);text-align:left;letter-spacing:var(--ga-text-xl-tracking);}.error-actions{display:flex;justify-content:flex-end;padding-top:var(--ga-size-spacing-05);border-top:var(--ga-size-border-width-sm) solid var(--ga-color-neutral-30);margin-top:var(--ga-size-spacing-05);}.error-banner{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--ga-size-spacing-04);padding:var(--ga-size-spacing-05);margin-bottom:var(--ga-size-spacing-06);background-color:var(--ga-color-surface-error);border:var(--ga-size-border-width-sm) solid var(--ga-color-border-error);border-radius:var(--ga-radius);animation:slideDown 0.3s ease-out;}@keyframes slideDown{from{opacity:0;transform:translateY(-10px);}to{opacity:1;transform:translateY(0);}}.error-content{display:flex;align-items:flex-start;gap:var(--ga-size-spacing-04);flex:1;}.error-icon{width:24px;height:24px;color:var(--ga-color-error);flex-shrink:0;}.error-icon svg{width:24px;height:24px;}.error-text-container{display:flex;flex-direction:column;gap:var(--ga-size-spacing-01);flex:1;}.error-title{font-size:var(--ga-text-sm-size);line-height:var(--ga-text-sm-line-height);color:var(--ga-color-cyan-90);font-weight:600;margin:0;}.error-message{font-size:var(--ga-text-sm-size);line-height:var(--ga-text-sm-line-height);color:var(--ga-color-cyan-90);font-weight:400;margin:0;}.error-dismiss{background:none;border:none;padding:0;cursor:pointer;color:var(--ga-color-red-60);width:24px;height:24px;flex-shrink:0;display:flex;align-items:center;justify-content:center;opacity:0.7;transition:opacity 0.2s;}.error-dismiss:hover{opacity:1;}.error-dismiss:focus-visible{outline:var(--ga-size-border-width-md) solid var(--ga-color-border-focus);outline-offset:var(--ga-size-border-width-md);border-radius:var(--ga-radius);}.error-dismiss svg{width:20px;height:20px;}.step-indicators{display:flex;height:82px;align-items:flex-end;}.step-wrapper{flex:1;display:flex;align-items:flex-start;height:100%;box-sizing:border-box;padding:var(--ga-size-spacing-03) var(--ga-size-spacing-02) var(--ga-size-spacing-03) 0;border-top:var(--ga-size-border-width-md) solid var(--ga-color-surface-disabled);}.step-wrapper.active{border-top-width:var(--ga-size-border-width-lg);border-top-color:var(--ga-color-primary);}.step-wrapper.completed{border-top-color:var(--ga-color-success);}.step-indicator{display:flex;align-items:center;gap:var(--ga-size-spacing-02);padding-left:var(--ga-size-spacing-03);}.step-icon{width:24px;height:24px;border-radius:var(--ga-radius-round);background:transparent;display:flex;align-items:center;justify-content:center;flex-shrink:0;color:var(--ga-color-primary);}.step-indicator.active .step-icon{color:var(--ga-color-primary);}.step-indicator.completed .step-icon{color:var(--ga-color-success);}.step-label{font-size:var(--ga-text-md-size);font-weight:500;color:var(--ga-color-primary);white-space:nowrap;letter-spacing:-0.1px}.step-indicator.active .step-label{color:var(--ga-color-text-headings);font-weight:500;}`
|
|
2706
2709
|
];
|
|
2707
2710
|
b([
|
|
2708
2711
|
d({ type: String })
|
|
2709
|
-
],
|
|
2712
|
+
], u.prototype, "locale", 2);
|
|
2710
2713
|
b([
|
|
2711
2714
|
d({ type: String })
|
|
2712
|
-
],
|
|
2715
|
+
], u.prototype, "baseUrl", 2);
|
|
2713
2716
|
b([
|
|
2714
2717
|
d({ type: String })
|
|
2715
|
-
],
|
|
2718
|
+
], u.prototype, "adminUrl", 2);
|
|
2716
2719
|
b([
|
|
2717
2720
|
d({ type: String })
|
|
2718
|
-
],
|
|
2721
|
+
], u.prototype, "taskId", 2);
|
|
2719
2722
|
b([
|
|
2720
2723
|
d({ type: String })
|
|
2721
|
-
],
|
|
2724
|
+
], u.prototype, "customerId", 2);
|
|
2722
2725
|
b([
|
|
2723
2726
|
d({ type: String })
|
|
2724
|
-
],
|
|
2727
|
+
], u.prototype, "step", 2);
|
|
2725
2728
|
b([
|
|
2726
2729
|
d({ attribute: "user-name" })
|
|
2727
|
-
],
|
|
2730
|
+
], u.prototype, "userName", 2);
|
|
2728
2731
|
b([
|
|
2729
2732
|
d({ attribute: "user-email" })
|
|
2730
|
-
],
|
|
2733
|
+
], u.prototype, "userEmail", 2);
|
|
2731
2734
|
b([
|
|
2732
2735
|
l()
|
|
2733
|
-
],
|
|
2736
|
+
], u.prototype, "currentStep", 2);
|
|
2734
2737
|
b([
|
|
2735
2738
|
l()
|
|
2736
|
-
],
|
|
2739
|
+
], u.prototype, "completedSteps", 2);
|
|
2737
2740
|
b([
|
|
2738
2741
|
l()
|
|
2739
|
-
],
|
|
2742
|
+
], u.prototype, "errorState", 2);
|
|
2740
2743
|
b([
|
|
2741
2744
|
l()
|
|
2742
|
-
],
|
|
2745
|
+
], u.prototype, "customer", 2);
|
|
2743
2746
|
b([
|
|
2744
2747
|
l()
|
|
2745
|
-
],
|
|
2748
|
+
], u.prototype, "customerSubscriptions", 2);
|
|
2746
2749
|
b([
|
|
2747
2750
|
l()
|
|
2748
|
-
],
|
|
2749
|
-
|
|
2751
|
+
], u.prototype, "visible", 2);
|
|
2752
|
+
u = b([
|
|
2750
2753
|
A("vsn-customer-onboarding-wizard")
|
|
2751
|
-
],
|
|
2754
|
+
], u);
|
|
2752
2755
|
export {
|
|
2753
|
-
|
|
2756
|
+
u as CustomerOnboardingWizard,
|
|
2754
2757
|
F as HttpService
|
|
2755
2758
|
};
|