@asgardeo/react 0.14.3 → 0.15.0
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/cjs/index.js +438 -363
- package/dist/cjs/index.js.map +4 -4
- package/dist/components/presentation/auth/InviteUser/v2/BaseInviteUser.d.ts +4 -0
- package/dist/components/presentation/auth/SignIn/v2/BaseSignIn.d.ts +0 -12
- package/dist/contexts/Asgardeo/AsgardeoContext.d.ts +4 -4
- package/dist/index.js +183 -107
- package/dist/index.js.map +4 -4
- package/package.json +9 -9
package/dist/cjs/index.js
CHANGED
|
@@ -35,7 +35,7 @@ __export(index_exports, {
|
|
|
35
35
|
Alert: () => Alert_default,
|
|
36
36
|
AsgardeoContext: () => AsgardeoContext_default,
|
|
37
37
|
AsgardeoProvider: () => AsgardeoProvider_default,
|
|
38
|
-
AsgardeoRuntimeError: () =>
|
|
38
|
+
AsgardeoRuntimeError: () => import_browser92.AsgardeoRuntimeError,
|
|
39
39
|
BaseAcceptInvite: () => BaseAcceptInvite_default,
|
|
40
40
|
BaseCreateOrganization: () => BaseCreateOrganization,
|
|
41
41
|
BaseInviteUser: () => BaseInviteUser_default,
|
|
@@ -67,12 +67,12 @@ __export(index_exports, {
|
|
|
67
67
|
DatePicker: () => DatePicker_default,
|
|
68
68
|
Divider: () => Divider_default,
|
|
69
69
|
EmailOtp: () => EmailOtp_default,
|
|
70
|
-
EmbeddedFlowActionVariant: () =>
|
|
71
|
-
EmbeddedFlowComponentType: () =>
|
|
72
|
-
EmbeddedFlowEventType: () =>
|
|
73
|
-
EmbeddedFlowTextVariant: () =>
|
|
74
|
-
EmbeddedSignInFlowStatus: () =>
|
|
75
|
-
EmbeddedSignInFlowType: () =>
|
|
70
|
+
EmbeddedFlowActionVariant: () => import_browser92.EmbeddedFlowActionVariantV2,
|
|
71
|
+
EmbeddedFlowComponentType: () => import_browser92.EmbeddedFlowComponentTypeV2,
|
|
72
|
+
EmbeddedFlowEventType: () => import_browser92.EmbeddedFlowEventTypeV2,
|
|
73
|
+
EmbeddedFlowTextVariant: () => import_browser92.EmbeddedFlowTextVariantV2,
|
|
74
|
+
EmbeddedSignInFlowStatus: () => import_browser92.EmbeddedSignInFlowStatusV2,
|
|
75
|
+
EmbeddedSignInFlowType: () => import_browser92.EmbeddedSignInFlowTypeV2,
|
|
76
76
|
Eye: () => Eye_default,
|
|
77
77
|
EyeOff: () => EyeOff_default,
|
|
78
78
|
FacebookButton: () => FacebookButton_default,
|
|
@@ -133,18 +133,18 @@ __export(index_exports, {
|
|
|
133
133
|
UsernamePassword: () => UsernamePassword_default,
|
|
134
134
|
createField: () => createField,
|
|
135
135
|
createOrganization: () => createOrganization_default,
|
|
136
|
-
createPatchOperations: () =>
|
|
136
|
+
createPatchOperations: () => import_browser89.createPatchOperations,
|
|
137
137
|
createSignInOption: () => createSignInOption,
|
|
138
138
|
createSignInOptionFromAuthenticator: () => createSignInOptionFromAuthenticator,
|
|
139
|
-
getActiveTheme: () =>
|
|
139
|
+
getActiveTheme: () => import_browser92.getActiveTheme,
|
|
140
140
|
getAllOrganizations: () => getAllOrganizations_default,
|
|
141
141
|
getConsentOptionalKey: () => getConsentOptionalKey,
|
|
142
142
|
getMeOrganizations: () => getMeOrganizations_default,
|
|
143
143
|
getMeProfile: () => getScim2Me_default,
|
|
144
144
|
getOrganization: () => getOrganization_default,
|
|
145
145
|
getSchemas: () => getSchemas_default,
|
|
146
|
-
http: () =>
|
|
147
|
-
navigate: () =>
|
|
146
|
+
http: () => import_browser92.http,
|
|
147
|
+
navigate: () => import_browser92.navigate,
|
|
148
148
|
updateMeProfile: () => updateMeProfile_default,
|
|
149
149
|
updateOrganization: () => updateOrganization_default,
|
|
150
150
|
useAsgardeo: () => useAsgardeo_default,
|
|
@@ -192,7 +192,7 @@ var AsgardeoContext = (0, import_react.createContext)({
|
|
|
192
192
|
organizationHandle: void 0,
|
|
193
193
|
platform: void 0,
|
|
194
194
|
reInitialize: null,
|
|
195
|
-
|
|
195
|
+
resolveFlowTemplateLiterals: (text) => text ?? "",
|
|
196
196
|
signIn: () => Promise.resolve({}),
|
|
197
197
|
signInOptions: {},
|
|
198
198
|
signInSilently: () => Promise.resolve({}),
|
|
@@ -1257,7 +1257,7 @@ var useAsgardeo = () => {
|
|
|
1257
1257
|
return {
|
|
1258
1258
|
...context,
|
|
1259
1259
|
meta,
|
|
1260
|
-
|
|
1260
|
+
resolveFlowTemplateLiterals: (text) => (0, import_browser9.resolveFlowTemplateLiterals)(text, {
|
|
1261
1261
|
meta,
|
|
1262
1262
|
t: i18nContext?.t ?? ((key) => key)
|
|
1263
1263
|
})
|
|
@@ -3768,7 +3768,7 @@ var OrganizationContext2 = ({
|
|
|
3768
3768
|
var OrganizationContext_default2 = OrganizationContext2;
|
|
3769
3769
|
|
|
3770
3770
|
// src/components/presentation/auth/SignIn/BaseSignIn.tsx
|
|
3771
|
-
var
|
|
3771
|
+
var import_browser53 = require("@asgardeo/browser");
|
|
3772
3772
|
|
|
3773
3773
|
// src/components/presentation/auth/SignIn/v1/BaseSignIn.tsx
|
|
3774
3774
|
var import_browser48 = require("@asgardeo/browser");
|
|
@@ -7730,7 +7730,7 @@ var BaseSignIn = ({ showLogo = true, ...rest }) => {
|
|
|
7730
7730
|
var BaseSignIn_default = BaseSignIn;
|
|
7731
7731
|
|
|
7732
7732
|
// src/components/presentation/auth/SignIn/v2/BaseSignIn.tsx
|
|
7733
|
-
var
|
|
7733
|
+
var import_browser52 = require("@asgardeo/browser");
|
|
7734
7734
|
var import_css37 = require("@emotion/css");
|
|
7735
7735
|
var import_react64 = require("react");
|
|
7736
7736
|
|
|
@@ -7740,7 +7740,7 @@ var resolveTranslationsInObject = (obj, t, properties = ["label", "placeholder",
|
|
|
7740
7740
|
const resolved = { ...obj };
|
|
7741
7741
|
properties.forEach((prop) => {
|
|
7742
7742
|
if (resolved[prop] && typeof resolved[prop] === "string") {
|
|
7743
|
-
resolved[prop] = (0, import_browser49.
|
|
7743
|
+
resolved[prop] = (0, import_browser49.resolveFlowTemplateLiterals)(resolved[prop], { meta, t });
|
|
7744
7744
|
}
|
|
7745
7745
|
});
|
|
7746
7746
|
return resolved;
|
|
@@ -7859,68 +7859,8 @@ var normalizeFlowResponse = (response, t, options = {}, meta) => {
|
|
|
7859
7859
|
};
|
|
7860
7860
|
};
|
|
7861
7861
|
|
|
7862
|
-
// src/utils/v2/getAuthComponentHeadings.ts
|
|
7863
|
-
var getAuthComponentHeadings = (components, flowTitle, flowSubtitle, defaultTitle, defaultSubtitle) => {
|
|
7864
|
-
let heading = null;
|
|
7865
|
-
let subheading = null;
|
|
7866
|
-
const findHeadings = (comps) => {
|
|
7867
|
-
for (const component of comps) {
|
|
7868
|
-
if (component.type === "TEXT" && component.variant && component.variant.startsWith("HEADING_")) {
|
|
7869
|
-
if (!heading) {
|
|
7870
|
-
heading = component;
|
|
7871
|
-
} else if (!subheading) {
|
|
7872
|
-
subheading = component;
|
|
7873
|
-
break;
|
|
7874
|
-
}
|
|
7875
|
-
}
|
|
7876
|
-
if (component.components && component.components.length > 0) {
|
|
7877
|
-
findHeadings(component.components);
|
|
7878
|
-
if (heading && subheading) break;
|
|
7879
|
-
}
|
|
7880
|
-
}
|
|
7881
|
-
};
|
|
7882
|
-
const filterComponents = (comps) => {
|
|
7883
|
-
let foundHeadings = 0;
|
|
7884
|
-
const maxHeadings = 2;
|
|
7885
|
-
const filter = (items) => items.reduce((acc, component) => {
|
|
7886
|
-
if (foundHeadings < maxHeadings && component.type === "TEXT" && component.variant && component.variant.startsWith("HEADING_")) {
|
|
7887
|
-
foundHeadings += 1;
|
|
7888
|
-
return acc;
|
|
7889
|
-
}
|
|
7890
|
-
if (component.components && component.components.length > 0) {
|
|
7891
|
-
const filteredNestedComponents = filter(component.components);
|
|
7892
|
-
if (filteredNestedComponents.length > 0) {
|
|
7893
|
-
acc.push({
|
|
7894
|
-
...component,
|
|
7895
|
-
components: filteredNestedComponents
|
|
7896
|
-
});
|
|
7897
|
-
}
|
|
7898
|
-
} else {
|
|
7899
|
-
acc.push(component);
|
|
7900
|
-
}
|
|
7901
|
-
return acc;
|
|
7902
|
-
}, []);
|
|
7903
|
-
return filter(comps);
|
|
7904
|
-
};
|
|
7905
|
-
const getComponentText = (component) => {
|
|
7906
|
-
if (!component) return "";
|
|
7907
|
-
return component.label || "";
|
|
7908
|
-
};
|
|
7909
|
-
findHeadings(components);
|
|
7910
|
-
const headingText = getComponentText(heading);
|
|
7911
|
-
const subheadingText = getComponentText(subheading);
|
|
7912
|
-
const result = {
|
|
7913
|
-
componentsWithoutHeadings: filterComponents(components),
|
|
7914
|
-
headingComponents: { heading, subheading },
|
|
7915
|
-
subtitle: flowSubtitle || subheadingText || defaultSubtitle || "",
|
|
7916
|
-
title: flowTitle || headingText || defaultTitle || ""
|
|
7917
|
-
};
|
|
7918
|
-
return result;
|
|
7919
|
-
};
|
|
7920
|
-
var getAuthComponentHeadings_default = getAuthComponentHeadings;
|
|
7921
|
-
|
|
7922
7862
|
// src/components/presentation/auth/AuthOptionFactory.tsx
|
|
7923
|
-
var
|
|
7863
|
+
var import_browser51 = require("@asgardeo/browser");
|
|
7924
7864
|
var import_css36 = require("@emotion/css");
|
|
7925
7865
|
var import_dompurify = __toESM(require("dompurify"), 1);
|
|
7926
7866
|
var import_react63 = require("react");
|
|
@@ -8074,7 +8014,9 @@ var FlowTimer = ({
|
|
|
8074
8014
|
var FlowTimer_default = FlowTimer;
|
|
8075
8015
|
|
|
8076
8016
|
// src/components/adapters/ImageComponent.tsx
|
|
8017
|
+
var import_browser50 = require("@asgardeo/browser");
|
|
8077
8018
|
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
8019
|
+
var DEFAULT_EMOJI_CONTAINER_HEIGHT = "4em";
|
|
8078
8020
|
var ImageComponent = ({ component }) => {
|
|
8079
8021
|
const { theme } = useTheme_default();
|
|
8080
8022
|
const config = component.config || {};
|
|
@@ -8091,6 +8033,34 @@ var ImageComponent = ({ component }) => {
|
|
|
8091
8033
|
if (!src) {
|
|
8092
8034
|
return null;
|
|
8093
8035
|
}
|
|
8036
|
+
if ((0, import_browser50.isEmojiUri)(src)) {
|
|
8037
|
+
const toCSSLength = (value) => /^\d+(\.\d+)?$/.test(value) ? `${value}px` : value;
|
|
8038
|
+
const cssWidth = toCSSLength(width);
|
|
8039
|
+
const cssHeight = toCSSLength(height);
|
|
8040
|
+
const isConcrete = (v) => v !== "auto" && !v.endsWith("%");
|
|
8041
|
+
let containerHeight;
|
|
8042
|
+
if (isConcrete(cssHeight)) {
|
|
8043
|
+
containerHeight = cssHeight;
|
|
8044
|
+
} else if (isConcrete(cssWidth)) {
|
|
8045
|
+
containerHeight = cssWidth;
|
|
8046
|
+
} else {
|
|
8047
|
+
containerHeight = DEFAULT_EMOJI_CONTAINER_HEIGHT;
|
|
8048
|
+
}
|
|
8049
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { style: { textAlign: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
8050
|
+
"span",
|
|
8051
|
+
{
|
|
8052
|
+
style: {
|
|
8053
|
+
...imageStyle,
|
|
8054
|
+
containerType: "size",
|
|
8055
|
+
display: "inline-grid",
|
|
8056
|
+
height: containerHeight,
|
|
8057
|
+
placeItems: "center",
|
|
8058
|
+
width: cssWidth
|
|
8059
|
+
},
|
|
8060
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { "aria-label": alt, role: "img", style: { fontSize: "100cqmin", lineHeight: 1 }, children: (0, import_browser50.extractEmojiFromUri)(src) })
|
|
8061
|
+
}
|
|
8062
|
+
) }, component.id);
|
|
8063
|
+
}
|
|
8094
8064
|
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { style: { textAlign: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
8095
8065
|
"img",
|
|
8096
8066
|
{
|
|
@@ -8197,26 +8167,63 @@ var flowIconRegistry_default = flowIconRegistry;
|
|
|
8197
8167
|
|
|
8198
8168
|
// src/components/presentation/auth/AuthOptionFactory.tsx
|
|
8199
8169
|
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
8200
|
-
var logger5 = (0,
|
|
8170
|
+
var logger5 = (0, import_browser51.createPackageComponentLogger)(
|
|
8201
8171
|
"@asgardeo/react",
|
|
8202
8172
|
"AuthOptionFactory"
|
|
8203
8173
|
);
|
|
8174
|
+
var resolveEmojiUrisInHtml = (html) => {
|
|
8175
|
+
const withEmojiImages = html.replace(
|
|
8176
|
+
/<img([^>]*)src="(emoji:[^"]+)"([^>]*)\/?>/gi,
|
|
8177
|
+
(_match, pre, src, post) => {
|
|
8178
|
+
const emoji = (0, import_browser51.extractEmojiFromUri)(src);
|
|
8179
|
+
if (!emoji) {
|
|
8180
|
+
return _match;
|
|
8181
|
+
}
|
|
8182
|
+
const altMatch = (pre + post).match(/alt="([^"]*)"/i);
|
|
8183
|
+
const label = altMatch ? altMatch[1] : emoji;
|
|
8184
|
+
return `<span role="img" aria-label="${label}">${emoji}</span>`;
|
|
8185
|
+
}
|
|
8186
|
+
);
|
|
8187
|
+
return withEmojiImages.replace(
|
|
8188
|
+
/emoji:([^\s"<>&]+)/g,
|
|
8189
|
+
(_, rest) => (0, import_browser51.isEmojiUri)(`emoji:${rest}`) ? rest : `emoji:${rest}`
|
|
8190
|
+
);
|
|
8191
|
+
};
|
|
8204
8192
|
var richTextClass = import_css36.css`
|
|
8205
8193
|
overflow-wrap: anywhere;
|
|
8206
8194
|
& * {
|
|
8207
8195
|
overflow-wrap: anywhere;
|
|
8208
8196
|
word-break: break-word;
|
|
8209
8197
|
}
|
|
8198
|
+
& .rich-text-align-left {
|
|
8199
|
+
text-align: left;
|
|
8200
|
+
}
|
|
8201
|
+
& .rich-text-align-center {
|
|
8202
|
+
text-align: center;
|
|
8203
|
+
}
|
|
8204
|
+
& .rich-text-align-right {
|
|
8205
|
+
text-align: right;
|
|
8206
|
+
}
|
|
8207
|
+
& .rich-text-align-justify {
|
|
8208
|
+
text-align: justify;
|
|
8209
|
+
}
|
|
8210
|
+
& a,
|
|
8211
|
+
& .rich-text-link {
|
|
8212
|
+
text-decoration: underline;
|
|
8213
|
+
}
|
|
8214
|
+
& span[role='img'] {
|
|
8215
|
+
display: inline-block;
|
|
8216
|
+
}
|
|
8210
8217
|
`;
|
|
8211
8218
|
var getFieldType = (variant) => {
|
|
8212
8219
|
switch (variant) {
|
|
8213
|
-
case
|
|
8214
|
-
return
|
|
8215
|
-
case
|
|
8216
|
-
return
|
|
8217
|
-
case
|
|
8220
|
+
case import_browser51.EmbeddedFlowComponentTypeV2.EmailInput:
|
|
8221
|
+
return import_browser51.FieldType.Email;
|
|
8222
|
+
case import_browser51.EmbeddedFlowComponentTypeV2.PasswordInput:
|
|
8223
|
+
return import_browser51.FieldType.Password;
|
|
8224
|
+
case import_browser51.EmbeddedFlowComponentTypeV2.TextInput:
|
|
8218
8225
|
default:
|
|
8219
|
-
return
|
|
8226
|
+
return import_browser51.FieldType.Text;
|
|
8220
8227
|
}
|
|
8221
8228
|
};
|
|
8222
8229
|
var getTypographyVariant = (variant) => {
|
|
@@ -8254,12 +8261,12 @@ var createAuthComponentFromFlow = (component, formValues, touchedFields, formErr
|
|
|
8254
8261
|
if (!text || !options.t && !options.meta) {
|
|
8255
8262
|
return text || "";
|
|
8256
8263
|
}
|
|
8257
|
-
return (0,
|
|
8264
|
+
return (0, import_browser51.resolveFlowTemplateLiterals)(text, { meta: options.meta, t: options.t || ((k) => k) });
|
|
8258
8265
|
};
|
|
8259
8266
|
switch (component.type) {
|
|
8260
|
-
case
|
|
8261
|
-
case
|
|
8262
|
-
case
|
|
8267
|
+
case import_browser51.EmbeddedFlowComponentTypeV2.TextInput:
|
|
8268
|
+
case import_browser51.EmbeddedFlowComponentTypeV2.PasswordInput:
|
|
8269
|
+
case import_browser51.EmbeddedFlowComponentTypeV2.EmailInput: {
|
|
8263
8270
|
const identifier = component.ref;
|
|
8264
8271
|
const value = formValues[identifier] || "";
|
|
8265
8272
|
const isTouched = touchedFields[identifier] || false;
|
|
@@ -8279,12 +8286,12 @@ var createAuthComponentFromFlow = (component, formValues, touchedFields, formErr
|
|
|
8279
8286
|
});
|
|
8280
8287
|
return (0, import_react63.cloneElement)(field, { key });
|
|
8281
8288
|
}
|
|
8282
|
-
case
|
|
8289
|
+
case import_browser51.EmbeddedFlowComponentTypeV2.Action: {
|
|
8283
8290
|
const actionId = component.id;
|
|
8284
8291
|
const eventType = component.eventType || "";
|
|
8285
8292
|
const buttonText = resolve(component.label);
|
|
8286
8293
|
const componentVariant = component.variant || "";
|
|
8287
|
-
const shouldSkipValidation = eventType.toUpperCase() ===
|
|
8294
|
+
const shouldSkipValidation = eventType.toUpperCase() === import_browser51.EmbeddedFlowEventTypeV2.Trigger;
|
|
8288
8295
|
const handleClick = () => {
|
|
8289
8296
|
if (options.onSubmit) {
|
|
8290
8297
|
const formData = {};
|
|
@@ -8292,7 +8299,7 @@ var createAuthComponentFromFlow = (component, formValues, touchedFields, formErr
|
|
|
8292
8299
|
formData[field] = formValues[field];
|
|
8293
8300
|
});
|
|
8294
8301
|
const consentPrompt = options.additionalData?.["consentPrompt"];
|
|
8295
|
-
if (consentPrompt && eventType.toUpperCase() ===
|
|
8302
|
+
if (consentPrompt && eventType.toUpperCase() === import_browser51.EmbeddedFlowEventTypeV2.Submit) {
|
|
8296
8303
|
const isDeny = componentVariant.toLowerCase() !== "primary";
|
|
8297
8304
|
const decisions = {
|
|
8298
8305
|
purposes: consentPrompt.purposes.map(
|
|
@@ -8372,14 +8379,25 @@ var createAuthComponentFromFlow = (component, formValues, touchedFields, formErr
|
|
|
8372
8379
|
key
|
|
8373
8380
|
);
|
|
8374
8381
|
}
|
|
8375
|
-
case
|
|
8382
|
+
case import_browser51.EmbeddedFlowComponentTypeV2.Text: {
|
|
8376
8383
|
const variant = getTypographyVariant(component.variant);
|
|
8377
|
-
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
8384
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
8385
|
+
Typography_default,
|
|
8386
|
+
{
|
|
8387
|
+
variant,
|
|
8388
|
+
style: {
|
|
8389
|
+
marginBottom: 2,
|
|
8390
|
+
textAlign: typeof component?.["align"] === "string" ? component["align"] : "left"
|
|
8391
|
+
},
|
|
8392
|
+
children: resolve(component.label)
|
|
8393
|
+
},
|
|
8394
|
+
key
|
|
8395
|
+
);
|
|
8378
8396
|
}
|
|
8379
|
-
case
|
|
8397
|
+
case import_browser51.EmbeddedFlowComponentTypeV2.Divider: {
|
|
8380
8398
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Divider_default, { children: resolve(component.label) || "" }, key);
|
|
8381
8399
|
}
|
|
8382
|
-
case
|
|
8400
|
+
case import_browser51.EmbeddedFlowComponentTypeV2.Select: {
|
|
8383
8401
|
const identifier = component.ref;
|
|
8384
8402
|
const value = formValues[identifier] || "";
|
|
8385
8403
|
const isTouched = touchedFields[identifier] || false;
|
|
@@ -8405,7 +8423,7 @@ var createAuthComponentFromFlow = (component, formValues, touchedFields, formErr
|
|
|
8405
8423
|
key
|
|
8406
8424
|
);
|
|
8407
8425
|
}
|
|
8408
|
-
case
|
|
8426
|
+
case import_browser51.EmbeddedFlowComponentTypeV2.Block: {
|
|
8409
8427
|
if (component.components && component.components.length > 0) {
|
|
8410
8428
|
const blockComponents = component.components.map(
|
|
8411
8429
|
(childComponent, index) => createAuthComponentFromFlow(
|
|
@@ -8427,17 +8445,17 @@ var createAuthComponentFromFlow = (component, formValues, touchedFields, formErr
|
|
|
8427
8445
|
}
|
|
8428
8446
|
return null;
|
|
8429
8447
|
}
|
|
8430
|
-
case
|
|
8448
|
+
case import_browser51.EmbeddedFlowComponentTypeV2.RichText: {
|
|
8431
8449
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
8432
8450
|
"div",
|
|
8433
8451
|
{
|
|
8434
8452
|
className: richTextClass,
|
|
8435
|
-
dangerouslySetInnerHTML: { __html: import_dompurify.default.sanitize(resolve(component.label)) }
|
|
8453
|
+
dangerouslySetInnerHTML: { __html: import_dompurify.default.sanitize(resolveEmojiUrisInHtml(resolve(component.label))) }
|
|
8436
8454
|
},
|
|
8437
8455
|
key
|
|
8438
8456
|
);
|
|
8439
8457
|
}
|
|
8440
|
-
case
|
|
8458
|
+
case import_browser51.EmbeddedFlowComponentTypeV2.Image: {
|
|
8441
8459
|
const explicitHeight = resolve(component.height?.toString());
|
|
8442
8460
|
const explicitWidth = resolve(component.width?.toString());
|
|
8443
8461
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
@@ -8463,7 +8481,7 @@ var createAuthComponentFromFlow = (component, formValues, touchedFields, formErr
|
|
|
8463
8481
|
key
|
|
8464
8482
|
);
|
|
8465
8483
|
}
|
|
8466
|
-
case
|
|
8484
|
+
case import_browser51.EmbeddedFlowComponentTypeV2.Icon: {
|
|
8467
8485
|
const iconName = component.name || "";
|
|
8468
8486
|
const IconComponent = flowIconRegistry_default[iconName];
|
|
8469
8487
|
if (!IconComponent) {
|
|
@@ -8472,7 +8490,7 @@ var createAuthComponentFromFlow = (component, formValues, touchedFields, formErr
|
|
|
8472
8490
|
}
|
|
8473
8491
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(IconComponent, { size: component.size || 24, color: component.color || "currentColor" }, key);
|
|
8474
8492
|
}
|
|
8475
|
-
case
|
|
8493
|
+
case import_browser51.EmbeddedFlowComponentTypeV2.Stack: {
|
|
8476
8494
|
const direction = component.direction || "row";
|
|
8477
8495
|
const gap = component.gap ?? 2;
|
|
8478
8496
|
const align = component.align || "center";
|
|
@@ -8504,7 +8522,7 @@ var createAuthComponentFromFlow = (component, formValues, touchedFields, formErr
|
|
|
8504
8522
|
) : [];
|
|
8505
8523
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { style: stackStyle, children: stackChildren }, key);
|
|
8506
8524
|
}
|
|
8507
|
-
case
|
|
8525
|
+
case import_browser51.EmbeddedFlowComponentTypeV2.Consent: {
|
|
8508
8526
|
const consentPromptRawData = options.additionalData?.["consentPrompt"];
|
|
8509
8527
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
8510
8528
|
Consent_default,
|
|
@@ -8516,7 +8534,7 @@ var createAuthComponentFromFlow = (component, formValues, touchedFields, formErr
|
|
|
8516
8534
|
key
|
|
8517
8535
|
);
|
|
8518
8536
|
}
|
|
8519
|
-
case
|
|
8537
|
+
case import_browser51.EmbeddedFlowComponentTypeV2.Timer: {
|
|
8520
8538
|
const textTemplate = resolve(component.label) || "Time remaining: {time}";
|
|
8521
8539
|
const timeoutMs = Number(options.additionalData?.["stepTimeout"]) || 0;
|
|
8522
8540
|
const expiresIn = timeoutMs > 0 ? Math.max(0, Math.floor((timeoutMs - Date.now()) / 1e3)) : 0;
|
|
@@ -8591,8 +8609,6 @@ var BaseSignInContent2 = ({
|
|
|
8591
8609
|
variant = "outlined",
|
|
8592
8610
|
isLoading: externalIsLoading,
|
|
8593
8611
|
children,
|
|
8594
|
-
showTitle = true,
|
|
8595
|
-
showSubtitle = true,
|
|
8596
8612
|
additionalData = {},
|
|
8597
8613
|
isTimeoutDisabled = false
|
|
8598
8614
|
}) => {
|
|
@@ -8708,29 +8724,29 @@ var BaseSignInContent2 = ({
|
|
|
8708
8724
|
};
|
|
8709
8725
|
const containerClasses = (0, import_css37.cx)(
|
|
8710
8726
|
[
|
|
8711
|
-
(0,
|
|
8712
|
-
(0,
|
|
8713
|
-
(0,
|
|
8727
|
+
(0, import_browser52.withVendorCSSClassPrefix)("signin"),
|
|
8728
|
+
(0, import_browser52.withVendorCSSClassPrefix)(`signin--${size}`),
|
|
8729
|
+
(0, import_browser52.withVendorCSSClassPrefix)(`signin--${variant}`)
|
|
8714
8730
|
],
|
|
8715
8731
|
className
|
|
8716
8732
|
);
|
|
8717
8733
|
const inputClasses = (0, import_css37.cx)(
|
|
8718
8734
|
[
|
|
8719
|
-
(0,
|
|
8720
|
-
size === "small" && (0,
|
|
8721
|
-
size === "large" && (0,
|
|
8735
|
+
(0, import_browser52.withVendorCSSClassPrefix)("signin__input"),
|
|
8736
|
+
size === "small" && (0, import_browser52.withVendorCSSClassPrefix)("signin__input--small"),
|
|
8737
|
+
size === "large" && (0, import_browser52.withVendorCSSClassPrefix)("signin__input--large")
|
|
8722
8738
|
],
|
|
8723
8739
|
inputClassName
|
|
8724
8740
|
);
|
|
8725
8741
|
const buttonClasses = (0, import_css37.cx)(
|
|
8726
8742
|
[
|
|
8727
|
-
(0,
|
|
8728
|
-
size === "small" && (0,
|
|
8729
|
-
size === "large" && (0,
|
|
8743
|
+
(0, import_browser52.withVendorCSSClassPrefix)("signin__button"),
|
|
8744
|
+
size === "small" && (0, import_browser52.withVendorCSSClassPrefix)("signin__button--small"),
|
|
8745
|
+
size === "large" && (0, import_browser52.withVendorCSSClassPrefix)("signin__button--large")
|
|
8730
8746
|
],
|
|
8731
8747
|
buttonClassName
|
|
8732
8748
|
);
|
|
8733
|
-
const messageClasses = (0, import_css37.cx)([(0,
|
|
8749
|
+
const messageClasses = (0, import_css37.cx)([(0, import_browser52.withVendorCSSClassPrefix)("signin__messages")], messageClassName);
|
|
8734
8750
|
const renderComponents = (0, import_react64.useCallback)(
|
|
8735
8751
|
(flowComponents) => renderSignInComponents(
|
|
8736
8752
|
flowComponents,
|
|
@@ -8800,40 +8816,22 @@ var BaseSignInContent2 = ({
|
|
|
8800
8816
|
if (!components || components.length === 0) {
|
|
8801
8817
|
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Card_default, { className: (0, import_css37.cx)(containerClasses, styles.card), "data-testid": "asgardeo-signin", variant, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Card_default.Content, { children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Alert_default, { variant: "warning", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Typography_default, { variant: "body1", children: t("errors.signin.components.not.available") }) }) }) });
|
|
8802
8818
|
}
|
|
8803
|
-
|
|
8804
|
-
|
|
8805
|
-
|
|
8806
|
-
|
|
8807
|
-
|
|
8808
|
-
|
|
8809
|
-
|
|
8810
|
-
|
|
8811
|
-
|
|
8812
|
-
|
|
8813
|
-
|
|
8814
|
-
|
|
8815
|
-
|
|
8816
|
-
externalError && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: styles.flowMessagesContainer, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Alert_default, { variant: "error", className: (0, import_css37.cx)(styles.flowMessageItem, messageClasses), children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Alert_default.Description, { children: externalError.message }) }) }),
|
|
8817
|
-
flowMessages && flowMessages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: styles.flowMessagesContainer, children: flowMessages.map((message, index) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
8818
|
-
Alert_default,
|
|
8819
|
-
{
|
|
8820
|
-
variant: message.type === "error" ? "error" : "info",
|
|
8821
|
-
className: (0, import_css37.cx)(styles.flowMessageItem, messageClasses),
|
|
8822
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Alert_default.Description, { children: message.message })
|
|
8823
|
-
},
|
|
8824
|
-
index
|
|
8825
|
-
)) }),
|
|
8826
|
-
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: styles.contentContainer, children: componentsWithoutHeadings && renderComponents(componentsWithoutHeadings) })
|
|
8827
|
-
] })
|
|
8828
|
-
] });
|
|
8819
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Card_default, { className: (0, import_css37.cx)(containerClasses, styles.card), "data-testid": "asgardeo-signin", variant, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(Card_default.Content, { children: [
|
|
8820
|
+
externalError && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: styles.flowMessagesContainer, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Alert_default, { variant: "error", className: (0, import_css37.cx)(styles.flowMessageItem, messageClasses), children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Alert_default.Description, { children: externalError.message }) }) }),
|
|
8821
|
+
flowMessages && flowMessages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: styles.flowMessagesContainer, children: flowMessages.map((message, index) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
8822
|
+
Alert_default,
|
|
8823
|
+
{
|
|
8824
|
+
variant: message.type === "error" ? "error" : "info",
|
|
8825
|
+
className: (0, import_css37.cx)(styles.flowMessageItem, messageClasses),
|
|
8826
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Alert_default.Description, { children: message.message })
|
|
8827
|
+
},
|
|
8828
|
+
index
|
|
8829
|
+
)) }),
|
|
8830
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: styles.contentContainer, children: renderComponents(components) })
|
|
8831
|
+
] }) });
|
|
8829
8832
|
};
|
|
8830
|
-
var BaseSignIn2 = ({ preferences,
|
|
8831
|
-
const {
|
|
8832
|
-
const styles = BaseSignIn_styles_default(theme, theme.vars.colors.text.primary);
|
|
8833
|
-
const content = /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { children: [
|
|
8834
|
-
showLogo && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: styles.logoContainer, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Logo_default, { size: "large" }) }),
|
|
8835
|
-
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(FlowProvider_default, { children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(BaseSignInContent2, { showLogo, ...rest }) })
|
|
8836
|
-
] });
|
|
8833
|
+
var BaseSignIn2 = ({ preferences, ...rest }) => {
|
|
8834
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(FlowProvider_default, { children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(BaseSignInContent2, { ...rest }) });
|
|
8837
8835
|
if (!preferences) return content;
|
|
8838
8836
|
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(ComponentPreferencesContext_default.Provider, { value: preferences, children: content });
|
|
8839
8837
|
};
|
|
@@ -8843,7 +8841,7 @@ var BaseSignIn_default2 = BaseSignIn2;
|
|
|
8843
8841
|
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
8844
8842
|
var BaseSignIn3 = (props) => {
|
|
8845
8843
|
const { platform } = useAsgardeo_default();
|
|
8846
|
-
if (platform ===
|
|
8844
|
+
if (platform === import_browser53.Platform.AsgardeoV2) {
|
|
8847
8845
|
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(BaseSignIn_default2, { ...props });
|
|
8848
8846
|
}
|
|
8849
8847
|
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(BaseSignIn_default, { ...props });
|
|
@@ -8851,10 +8849,10 @@ var BaseSignIn3 = (props) => {
|
|
|
8851
8849
|
var BaseSignIn_default3 = BaseSignIn3;
|
|
8852
8850
|
|
|
8853
8851
|
// src/components/presentation/auth/SignIn/SignIn.tsx
|
|
8854
|
-
var
|
|
8852
|
+
var import_browser57 = require("@asgardeo/browser");
|
|
8855
8853
|
|
|
8856
8854
|
// src/components/presentation/auth/SignIn/v2/SignIn.tsx
|
|
8857
|
-
var
|
|
8855
|
+
var import_browser56 = require("@asgardeo/browser");
|
|
8858
8856
|
var import_react66 = require("react");
|
|
8859
8857
|
|
|
8860
8858
|
// src/hooks/v2/useOAuthCallback.ts
|
|
@@ -8964,7 +8962,7 @@ function useOAuthCallback({
|
|
|
8964
8962
|
}
|
|
8965
8963
|
|
|
8966
8964
|
// src/utils/oauth.ts
|
|
8967
|
-
var
|
|
8965
|
+
var import_browser54 = require("@asgardeo/browser");
|
|
8968
8966
|
function initiateOAuthRedirect(redirectURL) {
|
|
8969
8967
|
const basePath = document.querySelector("base")?.getAttribute("href") || "";
|
|
8970
8968
|
let returnPath = window.location.pathname;
|
|
@@ -8981,14 +8979,14 @@ function initiateOAuthRedirect(redirectURL) {
|
|
|
8981
8979
|
);
|
|
8982
8980
|
const redirectUrlObj = new URL(redirectURL);
|
|
8983
8981
|
redirectUrlObj.searchParams.set("state", state);
|
|
8984
|
-
(0,
|
|
8982
|
+
(0, import_browser54.navigate)(redirectUrlObj.toString());
|
|
8985
8983
|
}
|
|
8986
8984
|
|
|
8987
8985
|
// src/utils/v2/passkey.ts
|
|
8988
|
-
var
|
|
8986
|
+
var import_browser55 = require("@asgardeo/browser");
|
|
8989
8987
|
var handlePasskeyRegistration = async (challengeData) => {
|
|
8990
8988
|
if (!window.navigator.credentials || !window.navigator.credentials.create) {
|
|
8991
|
-
throw new
|
|
8989
|
+
throw new import_browser55.AsgardeoRuntimeError(
|
|
8992
8990
|
"WebAuthn is not supported in this browser.",
|
|
8993
8991
|
"browser-webauthn-not-supported",
|
|
8994
8992
|
"browser",
|
|
@@ -8999,15 +8997,15 @@ var handlePasskeyRegistration = async (challengeData) => {
|
|
|
8999
8997
|
const creationOptions = JSON.parse(challengeData);
|
|
9000
8998
|
const publicKey = {
|
|
9001
8999
|
...creationOptions,
|
|
9002
|
-
challenge: (0,
|
|
9000
|
+
challenge: (0, import_browser55.base64urlToArrayBuffer)(creationOptions.challenge),
|
|
9003
9001
|
user: {
|
|
9004
9002
|
...creationOptions.user,
|
|
9005
|
-
id: (0,
|
|
9003
|
+
id: (0, import_browser55.base64urlToArrayBuffer)(creationOptions.user.id)
|
|
9006
9004
|
},
|
|
9007
9005
|
...creationOptions.excludeCredentials && {
|
|
9008
9006
|
excludeCredentials: creationOptions.excludeCredentials.map((cred) => ({
|
|
9009
9007
|
...cred,
|
|
9010
|
-
id: (0,
|
|
9008
|
+
id: (0, import_browser55.base64urlToArrayBuffer)(cred.id)
|
|
9011
9009
|
}))
|
|
9012
9010
|
}
|
|
9013
9011
|
};
|
|
@@ -9015,7 +9013,7 @@ var handlePasskeyRegistration = async (challengeData) => {
|
|
|
9015
9013
|
publicKey
|
|
9016
9014
|
});
|
|
9017
9015
|
if (!credential) {
|
|
9018
|
-
throw new
|
|
9016
|
+
throw new import_browser55.AsgardeoRuntimeError(
|
|
9019
9017
|
"No credential returned from WebAuthn registration.",
|
|
9020
9018
|
"browser-webauthn-no-credential",
|
|
9021
9019
|
"browser",
|
|
@@ -9025,10 +9023,10 @@ var handlePasskeyRegistration = async (challengeData) => {
|
|
|
9025
9023
|
const response = credential.response;
|
|
9026
9024
|
const registrationResponse = {
|
|
9027
9025
|
id: credential.id,
|
|
9028
|
-
rawId: (0,
|
|
9026
|
+
rawId: (0, import_browser55.arrayBufferToBase64url)(credential.rawId),
|
|
9029
9027
|
response: {
|
|
9030
|
-
attestationObject: (0,
|
|
9031
|
-
clientDataJSON: (0,
|
|
9028
|
+
attestationObject: (0, import_browser55.arrayBufferToBase64url)(response.attestationObject),
|
|
9029
|
+
clientDataJSON: (0, import_browser55.arrayBufferToBase64url)(response.clientDataJSON),
|
|
9032
9030
|
...response.getTransports && {
|
|
9033
9031
|
transports: response.getTransports()
|
|
9034
9032
|
}
|
|
@@ -9040,18 +9038,18 @@ var handlePasskeyRegistration = async (challengeData) => {
|
|
|
9040
9038
|
};
|
|
9041
9039
|
return JSON.stringify(registrationResponse);
|
|
9042
9040
|
} catch (error) {
|
|
9043
|
-
if (error instanceof
|
|
9041
|
+
if (error instanceof import_browser55.AsgardeoRuntimeError) {
|
|
9044
9042
|
throw error;
|
|
9045
9043
|
}
|
|
9046
9044
|
if (error instanceof Error) {
|
|
9047
|
-
throw new
|
|
9045
|
+
throw new import_browser55.AsgardeoRuntimeError(
|
|
9048
9046
|
`Passkey registration failed: ${error.message}`,
|
|
9049
9047
|
"browser-webauthn-registration-error",
|
|
9050
9048
|
"browser",
|
|
9051
9049
|
`WebAuthn registration failed with error: ${error.name}`
|
|
9052
9050
|
);
|
|
9053
9051
|
}
|
|
9054
|
-
throw new
|
|
9052
|
+
throw new import_browser55.AsgardeoRuntimeError(
|
|
9055
9053
|
"Passkey registration failed due to an unexpected error.",
|
|
9056
9054
|
"browser-webauthn-unexpected-error",
|
|
9057
9055
|
"browser",
|
|
@@ -9061,7 +9059,7 @@ var handlePasskeyRegistration = async (challengeData) => {
|
|
|
9061
9059
|
};
|
|
9062
9060
|
var handlePasskeyAuthentication = async (challengeData) => {
|
|
9063
9061
|
if (!window.navigator.credentials || !window.navigator.credentials.get) {
|
|
9064
|
-
throw new
|
|
9062
|
+
throw new import_browser55.AsgardeoRuntimeError(
|
|
9065
9063
|
"WebAuthn is not supported in this browser.",
|
|
9066
9064
|
"browser-webauthn-not-supported",
|
|
9067
9065
|
"browser",
|
|
@@ -9072,11 +9070,11 @@ var handlePasskeyAuthentication = async (challengeData) => {
|
|
|
9072
9070
|
const requestOptions = JSON.parse(challengeData);
|
|
9073
9071
|
const publicKey = {
|
|
9074
9072
|
...requestOptions,
|
|
9075
|
-
challenge: (0,
|
|
9073
|
+
challenge: (0, import_browser55.base64urlToArrayBuffer)(requestOptions.challenge),
|
|
9076
9074
|
...requestOptions.allowCredentials && {
|
|
9077
9075
|
allowCredentials: requestOptions.allowCredentials.map((cred) => ({
|
|
9078
9076
|
...cred,
|
|
9079
|
-
id: (0,
|
|
9077
|
+
id: (0, import_browser55.base64urlToArrayBuffer)(cred.id)
|
|
9080
9078
|
}))
|
|
9081
9079
|
}
|
|
9082
9080
|
};
|
|
@@ -9084,7 +9082,7 @@ var handlePasskeyAuthentication = async (challengeData) => {
|
|
|
9084
9082
|
publicKey
|
|
9085
9083
|
});
|
|
9086
9084
|
if (!credential) {
|
|
9087
|
-
throw new
|
|
9085
|
+
throw new import_browser55.AsgardeoRuntimeError(
|
|
9088
9086
|
"No credential returned from WebAuthn authentication.",
|
|
9089
9087
|
"browser-webauthn-no-credential",
|
|
9090
9088
|
"browser",
|
|
@@ -9094,13 +9092,13 @@ var handlePasskeyAuthentication = async (challengeData) => {
|
|
|
9094
9092
|
const response = credential.response;
|
|
9095
9093
|
const authenticationResponse = {
|
|
9096
9094
|
id: credential.id,
|
|
9097
|
-
rawId: (0,
|
|
9095
|
+
rawId: (0, import_browser55.arrayBufferToBase64url)(credential.rawId),
|
|
9098
9096
|
response: {
|
|
9099
|
-
authenticatorData: (0,
|
|
9100
|
-
clientDataJSON: (0,
|
|
9101
|
-
signature: (0,
|
|
9097
|
+
authenticatorData: (0, import_browser55.arrayBufferToBase64url)(response.authenticatorData),
|
|
9098
|
+
clientDataJSON: (0, import_browser55.arrayBufferToBase64url)(response.clientDataJSON),
|
|
9099
|
+
signature: (0, import_browser55.arrayBufferToBase64url)(response.signature),
|
|
9102
9100
|
...response.userHandle && {
|
|
9103
|
-
userHandle: (0,
|
|
9101
|
+
userHandle: (0, import_browser55.arrayBufferToBase64url)(response.userHandle)
|
|
9104
9102
|
}
|
|
9105
9103
|
},
|
|
9106
9104
|
type: credential.type,
|
|
@@ -9110,18 +9108,18 @@ var handlePasskeyAuthentication = async (challengeData) => {
|
|
|
9110
9108
|
};
|
|
9111
9109
|
return JSON.stringify(authenticationResponse);
|
|
9112
9110
|
} catch (error) {
|
|
9113
|
-
if (error instanceof
|
|
9111
|
+
if (error instanceof import_browser55.AsgardeoRuntimeError) {
|
|
9114
9112
|
throw error;
|
|
9115
9113
|
}
|
|
9116
9114
|
if (error instanceof Error) {
|
|
9117
|
-
throw new
|
|
9115
|
+
throw new import_browser55.AsgardeoRuntimeError(
|
|
9118
9116
|
`Passkey authentication failed: ${error.message}`,
|
|
9119
9117
|
"browser-webauthn-authentication-error",
|
|
9120
9118
|
"browser",
|
|
9121
9119
|
`WebAuthn authentication failed with error: ${error.name}`
|
|
9122
9120
|
);
|
|
9123
9121
|
}
|
|
9124
|
-
throw new
|
|
9122
|
+
throw new import_browser55.AsgardeoRuntimeError(
|
|
9125
9123
|
"Passkey authentication failed due to an unexpected error.",
|
|
9126
9124
|
"browser-webauthn-unexpected-error",
|
|
9127
9125
|
"browser",
|
|
@@ -9222,12 +9220,12 @@ var SignIn = ({
|
|
|
9222
9220
|
const handleOAuthError = (error, errorDescription) => {
|
|
9223
9221
|
clearFlowState();
|
|
9224
9222
|
const errorMessage = errorDescription || `OAuth error: ${error}`;
|
|
9225
|
-
const err = new
|
|
9223
|
+
const err = new import_browser56.AsgardeoRuntimeError(errorMessage, "SIGN_IN_ERROR", "react");
|
|
9226
9224
|
setError(err);
|
|
9227
9225
|
cleanupOAuthUrlParams(true);
|
|
9228
9226
|
};
|
|
9229
9227
|
const handleRedirection = (response) => {
|
|
9230
|
-
if (response.type ===
|
|
9228
|
+
if (response.type === import_browser56.EmbeddedSignInFlowTypeV2.Redirection) {
|
|
9231
9229
|
const redirectURL = response.data?.redirectURL || response?.redirectURL;
|
|
9232
9230
|
if (redirectURL && window?.location) {
|
|
9233
9231
|
if (response.flowId) {
|
|
@@ -9247,7 +9245,7 @@ var SignIn = ({
|
|
|
9247
9245
|
handleAuthId(urlParams.authId);
|
|
9248
9246
|
const effectiveApplicationId = applicationId || urlParams.applicationId;
|
|
9249
9247
|
if (!urlParams.flowId && !effectiveApplicationId) {
|
|
9250
|
-
const error = new
|
|
9248
|
+
const error = new import_browser56.AsgardeoRuntimeError(
|
|
9251
9249
|
"Either flowId or applicationId is required for authentication",
|
|
9252
9250
|
"SIGN_IN_ERROR",
|
|
9253
9251
|
"react"
|
|
@@ -9265,7 +9263,7 @@ var SignIn = ({
|
|
|
9265
9263
|
} else {
|
|
9266
9264
|
response = await signIn({
|
|
9267
9265
|
applicationId: effectiveApplicationId,
|
|
9268
|
-
flowType:
|
|
9266
|
+
flowType: import_browser56.EmbeddedFlowType.Authentication
|
|
9269
9267
|
});
|
|
9270
9268
|
}
|
|
9271
9269
|
if (handleRedirection(response)) {
|
|
@@ -9428,7 +9426,7 @@ var SignIn = ({
|
|
|
9428
9426
|
},
|
|
9429
9427
|
meta
|
|
9430
9428
|
);
|
|
9431
|
-
if (response.flowStatus ===
|
|
9429
|
+
if (response.flowStatus === import_browser56.EmbeddedSignInFlowStatusV2.Error) {
|
|
9432
9430
|
clearFlowState();
|
|
9433
9431
|
const failureReason = response?.failureReason;
|
|
9434
9432
|
const errorMessage = failureReason || "Authentication flow failed. Please try again.";
|
|
@@ -9437,7 +9435,7 @@ var SignIn = ({
|
|
|
9437
9435
|
cleanupFlowUrlParams();
|
|
9438
9436
|
throw err;
|
|
9439
9437
|
}
|
|
9440
|
-
if (response.flowStatus ===
|
|
9438
|
+
if (response.flowStatus === import_browser56.EmbeddedSignInFlowStatusV2.Complete) {
|
|
9441
9439
|
const redirectUrl = response?.redirectUrl || response?.redirect_uri;
|
|
9442
9440
|
const finalRedirectUrl = redirectUrl || afterSignInUrl;
|
|
9443
9441
|
setIsSubmitting(false);
|
|
@@ -9594,7 +9592,7 @@ var SignIn2 = ({ className, size = "medium", children, preferences, ...rest }) =
|
|
|
9594
9592
|
window.location.href = url.toString();
|
|
9595
9593
|
}
|
|
9596
9594
|
};
|
|
9597
|
-
if (platform ===
|
|
9595
|
+
if (platform === import_browser57.Platform.AsgardeoV2) {
|
|
9598
9596
|
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
9599
9597
|
SignIn_default,
|
|
9600
9598
|
{
|
|
@@ -9629,18 +9627,18 @@ var SignIn2 = ({ className, size = "medium", children, preferences, ...rest }) =
|
|
|
9629
9627
|
var SignIn_default2 = SignIn2;
|
|
9630
9628
|
|
|
9631
9629
|
// src/components/presentation/auth/SignUp/BaseSignUp.tsx
|
|
9632
|
-
var
|
|
9630
|
+
var import_browser68 = require("@asgardeo/browser");
|
|
9633
9631
|
|
|
9634
9632
|
// src/components/presentation/auth/SignUp/v1/BaseSignUp.tsx
|
|
9635
|
-
var
|
|
9633
|
+
var import_browser66 = require("@asgardeo/browser");
|
|
9636
9634
|
var import_css39 = require("@emotion/css");
|
|
9637
9635
|
var import_react68 = require("react");
|
|
9638
9636
|
|
|
9639
9637
|
// src/components/presentation/auth/SignUp/v1/SignUpOptionFactory.tsx
|
|
9640
|
-
var
|
|
9638
|
+
var import_browser65 = require("@asgardeo/browser");
|
|
9641
9639
|
|
|
9642
9640
|
// src/components/adapters/CheckboxInput.tsx
|
|
9643
|
-
var
|
|
9641
|
+
var import_browser58 = require("@asgardeo/browser");
|
|
9644
9642
|
var CheckboxInput = ({
|
|
9645
9643
|
component,
|
|
9646
9644
|
formValues,
|
|
@@ -9661,14 +9659,14 @@ var CheckboxInput = ({
|
|
|
9661
9659
|
onChange: (newValue) => onInputChange(fieldName, newValue),
|
|
9662
9660
|
placeholder: config["placeholder"] || "",
|
|
9663
9661
|
required: config["required"] || false,
|
|
9664
|
-
type:
|
|
9662
|
+
type: import_browser58.FieldType.Checkbox,
|
|
9665
9663
|
value
|
|
9666
9664
|
});
|
|
9667
9665
|
};
|
|
9668
9666
|
var CheckboxInput_default = CheckboxInput;
|
|
9669
9667
|
|
|
9670
9668
|
// src/components/adapters/DateInput.tsx
|
|
9671
|
-
var
|
|
9669
|
+
var import_browser59 = require("@asgardeo/browser");
|
|
9672
9670
|
var DateInput = ({
|
|
9673
9671
|
component,
|
|
9674
9672
|
formValues,
|
|
@@ -9689,7 +9687,7 @@ var DateInput = ({
|
|
|
9689
9687
|
onChange: (newValue) => onInputChange(fieldName, newValue),
|
|
9690
9688
|
placeholder: config["placeholder"] || "",
|
|
9691
9689
|
required: config["required"] || false,
|
|
9692
|
-
type:
|
|
9690
|
+
type: import_browser59.FieldType.Date,
|
|
9693
9691
|
value
|
|
9694
9692
|
});
|
|
9695
9693
|
};
|
|
@@ -9715,7 +9713,7 @@ var DividerComponent = ({ component }) => {
|
|
|
9715
9713
|
var DividerComponent_default = DividerComponent;
|
|
9716
9714
|
|
|
9717
9715
|
// src/components/adapters/EmailInput.tsx
|
|
9718
|
-
var
|
|
9716
|
+
var import_browser60 = require("@asgardeo/browser");
|
|
9719
9717
|
var EmailInput = ({
|
|
9720
9718
|
component,
|
|
9721
9719
|
formValues,
|
|
@@ -9736,7 +9734,7 @@ var EmailInput = ({
|
|
|
9736
9734
|
onChange: (newValue) => onInputChange(fieldName, newValue),
|
|
9737
9735
|
placeholder: config["placeholder"] || "Enter your email",
|
|
9738
9736
|
required: config["required"] || false,
|
|
9739
|
-
type:
|
|
9737
|
+
type: import_browser60.FieldType.Email,
|
|
9740
9738
|
value
|
|
9741
9739
|
});
|
|
9742
9740
|
};
|
|
@@ -9768,7 +9766,7 @@ var FormContainer = (props) => {
|
|
|
9768
9766
|
var FormContainer_default = FormContainer;
|
|
9769
9767
|
|
|
9770
9768
|
// src/components/adapters/NumberInput.tsx
|
|
9771
|
-
var
|
|
9769
|
+
var import_browser61 = require("@asgardeo/browser");
|
|
9772
9770
|
var NumberInput = ({
|
|
9773
9771
|
component,
|
|
9774
9772
|
formValues,
|
|
@@ -9789,14 +9787,14 @@ var NumberInput = ({
|
|
|
9789
9787
|
onChange: (newValue) => onInputChange(fieldName, newValue),
|
|
9790
9788
|
placeholder: config["placeholder"] || "",
|
|
9791
9789
|
required: config["required"] || false,
|
|
9792
|
-
type:
|
|
9790
|
+
type: import_browser61.FieldType.Number,
|
|
9793
9791
|
value
|
|
9794
9792
|
});
|
|
9795
9793
|
};
|
|
9796
9794
|
var NumberInput_default = NumberInput;
|
|
9797
9795
|
|
|
9798
9796
|
// src/components/adapters/PasswordInput.tsx
|
|
9799
|
-
var
|
|
9797
|
+
var import_browser62 = require("@asgardeo/browser");
|
|
9800
9798
|
var PasswordInput = ({
|
|
9801
9799
|
component,
|
|
9802
9800
|
formValues,
|
|
@@ -9848,14 +9846,14 @@ var PasswordInput = ({
|
|
|
9848
9846
|
onChange: (newValue) => onInputChange(fieldName, newValue),
|
|
9849
9847
|
placeholder: config["placeholder"] || "Enter your password",
|
|
9850
9848
|
required: config["required"] || false,
|
|
9851
|
-
type:
|
|
9849
|
+
type: import_browser62.FieldType.Password,
|
|
9852
9850
|
value
|
|
9853
9851
|
});
|
|
9854
9852
|
};
|
|
9855
9853
|
var PasswordInput_default = PasswordInput;
|
|
9856
9854
|
|
|
9857
9855
|
// src/components/adapters/SelectInput.tsx
|
|
9858
|
-
var
|
|
9856
|
+
var import_browser63 = require("@asgardeo/browser");
|
|
9859
9857
|
var SelectInput = ({
|
|
9860
9858
|
component,
|
|
9861
9859
|
formValues,
|
|
@@ -9882,7 +9880,7 @@ var SelectInput = ({
|
|
|
9882
9880
|
options,
|
|
9883
9881
|
placeholder: config["placeholder"] || "",
|
|
9884
9882
|
required: config["required"] || false,
|
|
9885
|
-
type:
|
|
9883
|
+
type: import_browser63.FieldType.Select,
|
|
9886
9884
|
value
|
|
9887
9885
|
});
|
|
9888
9886
|
};
|
|
@@ -9975,7 +9973,7 @@ var TelephoneInput = ({
|
|
|
9975
9973
|
var TelephoneInput_default = TelephoneInput;
|
|
9976
9974
|
|
|
9977
9975
|
// src/components/adapters/TextInput.tsx
|
|
9978
|
-
var
|
|
9976
|
+
var import_browser64 = require("@asgardeo/browser");
|
|
9979
9977
|
var TextInput = ({
|
|
9980
9978
|
component,
|
|
9981
9979
|
formValues,
|
|
@@ -9996,7 +9994,7 @@ var TextInput = ({
|
|
|
9996
9994
|
onChange: (newValue) => onInputChange(fieldName, newValue),
|
|
9997
9995
|
placeholder: config["placeholder"] || "",
|
|
9998
9996
|
required: config["required"] || false,
|
|
9999
|
-
type:
|
|
9997
|
+
type: import_browser64.FieldType.Text,
|
|
10000
9998
|
value
|
|
10001
9999
|
});
|
|
10002
10000
|
};
|
|
@@ -10060,9 +10058,9 @@ var Typography_default2 = TypographyComponent;
|
|
|
10060
10058
|
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
10061
10059
|
var createSignUpComponent = ({ component, onSubmit, ...rest }) => {
|
|
10062
10060
|
switch (component.type) {
|
|
10063
|
-
case
|
|
10061
|
+
case import_browser65.EmbeddedFlowComponentType.Typography:
|
|
10064
10062
|
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Typography_default2, { component, onSubmit, ...rest });
|
|
10065
|
-
case
|
|
10063
|
+
case import_browser65.EmbeddedFlowComponentType.Input: {
|
|
10066
10064
|
const inputVariant = component.variant?.toUpperCase();
|
|
10067
10065
|
const inputType = component.config["type"]?.toLowerCase();
|
|
10068
10066
|
if (inputVariant === "EMAIL" || inputType === "email") {
|
|
@@ -10085,7 +10083,7 @@ var createSignUpComponent = ({ component, onSubmit, ...rest }) => {
|
|
|
10085
10083
|
}
|
|
10086
10084
|
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(TextInput_default, { component, onSubmit, ...rest });
|
|
10087
10085
|
}
|
|
10088
|
-
case
|
|
10086
|
+
case import_browser65.EmbeddedFlowComponentType.Button: {
|
|
10089
10087
|
const buttonVariant = component.variant?.toUpperCase();
|
|
10090
10088
|
const buttonText = component.config["text"] || component.config["label"] || "";
|
|
10091
10089
|
if (buttonVariant === "SOCIAL") {
|
|
@@ -10110,13 +10108,13 @@ var createSignUpComponent = ({ component, onSubmit, ...rest }) => {
|
|
|
10110
10108
|
}
|
|
10111
10109
|
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(SubmitButton_default, { component, onSubmit, ...rest });
|
|
10112
10110
|
}
|
|
10113
|
-
case
|
|
10111
|
+
case import_browser65.EmbeddedFlowComponentType.Form:
|
|
10114
10112
|
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(FormContainer_default, { component, onSubmit, ...rest });
|
|
10115
|
-
case
|
|
10113
|
+
case import_browser65.EmbeddedFlowComponentType.Select:
|
|
10116
10114
|
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(SelectInput_default, { component, onSubmit, ...rest });
|
|
10117
|
-
case
|
|
10115
|
+
case import_browser65.EmbeddedFlowComponentType.Divider:
|
|
10118
10116
|
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(DividerComponent_default, { component, onSubmit, ...rest });
|
|
10119
|
-
case
|
|
10117
|
+
case import_browser65.EmbeddedFlowComponentType.Image:
|
|
10120
10118
|
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(ImageComponent_default, { component, onSubmit, ...rest });
|
|
10121
10119
|
default:
|
|
10122
10120
|
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("div", {});
|
|
@@ -10289,7 +10287,7 @@ var BaseSignUp_styles_default = useStyles17;
|
|
|
10289
10287
|
|
|
10290
10288
|
// src/components/presentation/auth/SignUp/v1/BaseSignUp.tsx
|
|
10291
10289
|
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
10292
|
-
var logger6 = (0,
|
|
10290
|
+
var logger6 = (0, import_browser66.createPackageComponentLogger)(
|
|
10293
10291
|
"@asgardeo/react",
|
|
10294
10292
|
"BaseSignUp"
|
|
10295
10293
|
);
|
|
@@ -10359,7 +10357,7 @@ var BaseSignUpContent = ({
|
|
|
10359
10357
|
const fields = [];
|
|
10360
10358
|
const processComponents = (comps) => {
|
|
10361
10359
|
comps.forEach((component) => {
|
|
10362
|
-
if (component.type ===
|
|
10360
|
+
if (component.type === import_browser66.EmbeddedFlowComponentType.Input) {
|
|
10363
10361
|
const config = component.config || {};
|
|
10364
10362
|
fields.push({
|
|
10365
10363
|
initialValue: config.defaultValue || "",
|
|
@@ -10426,7 +10424,7 @@ var BaseSignUpContent = ({
|
|
|
10426
10424
|
setFormTouched(name, true);
|
|
10427
10425
|
};
|
|
10428
10426
|
const handleRedirectionIfNeeded = (response) => {
|
|
10429
|
-
if (response?.type ===
|
|
10427
|
+
if (response?.type === import_browser66.EmbeddedFlowResponseType.Redirection && response?.data?.redirectURL) {
|
|
10430
10428
|
const redirectUrl = response.data.redirectURL;
|
|
10431
10429
|
const popup = window.open(redirectUrl, "oauth_popup", "width=500,height=600,scrollbars=yes,resizable=yes");
|
|
10432
10430
|
if (!popup) {
|
|
@@ -10464,9 +10462,9 @@ var BaseSignUpContent = ({
|
|
|
10464
10462
|
try {
|
|
10465
10463
|
const continueResponse = await onSubmit(payload);
|
|
10466
10464
|
onFlowChange?.(continueResponse);
|
|
10467
|
-
if (continueResponse.flowStatus ===
|
|
10465
|
+
if (continueResponse.flowStatus === import_browser66.EmbeddedFlowStatus.Complete) {
|
|
10468
10466
|
onComplete?.(continueResponse);
|
|
10469
|
-
} else if (continueResponse.flowStatus ===
|
|
10467
|
+
} else if (continueResponse.flowStatus === import_browser66.EmbeddedFlowStatus.Incomplete) {
|
|
10470
10468
|
setCurrentFlow(continueResponse);
|
|
10471
10469
|
setupFormFields(continueResponse);
|
|
10472
10470
|
}
|
|
@@ -10517,9 +10515,9 @@ var BaseSignUpContent = ({
|
|
|
10517
10515
|
try {
|
|
10518
10516
|
const continueResponse = await onSubmit(payload);
|
|
10519
10517
|
onFlowChange?.(continueResponse);
|
|
10520
|
-
if (continueResponse.flowStatus ===
|
|
10518
|
+
if (continueResponse.flowStatus === import_browser66.EmbeddedFlowStatus.Complete) {
|
|
10521
10519
|
onComplete?.(continueResponse);
|
|
10522
|
-
} else if (continueResponse.flowStatus ===
|
|
10520
|
+
} else if (continueResponse.flowStatus === import_browser66.EmbeddedFlowStatus.Incomplete) {
|
|
10523
10521
|
setCurrentFlow(continueResponse);
|
|
10524
10522
|
setupFormFields(continueResponse);
|
|
10525
10523
|
}
|
|
@@ -10565,11 +10563,11 @@ var BaseSignUpContent = ({
|
|
|
10565
10563
|
};
|
|
10566
10564
|
const response = await onSubmit(payload);
|
|
10567
10565
|
onFlowChange?.(response);
|
|
10568
|
-
if (response.flowStatus ===
|
|
10566
|
+
if (response.flowStatus === import_browser66.EmbeddedFlowStatus.Complete) {
|
|
10569
10567
|
onComplete?.(response);
|
|
10570
10568
|
return;
|
|
10571
10569
|
}
|
|
10572
|
-
if (response.flowStatus ===
|
|
10570
|
+
if (response.flowStatus === import_browser66.EmbeddedFlowStatus.Incomplete) {
|
|
10573
10571
|
if (handleRedirectionIfNeeded(response)) {
|
|
10574
10572
|
return;
|
|
10575
10573
|
}
|
|
@@ -10585,30 +10583,30 @@ var BaseSignUpContent = ({
|
|
|
10585
10583
|
};
|
|
10586
10584
|
const containerClasses = (0, import_css39.cx)(
|
|
10587
10585
|
[
|
|
10588
|
-
(0,
|
|
10589
|
-
(0,
|
|
10590
|
-
(0,
|
|
10586
|
+
(0, import_browser66.withVendorCSSClassPrefix)("signup"),
|
|
10587
|
+
(0, import_browser66.withVendorCSSClassPrefix)(`signup--${size}`),
|
|
10588
|
+
(0, import_browser66.withVendorCSSClassPrefix)(`signup--${variant}`)
|
|
10591
10589
|
],
|
|
10592
10590
|
className
|
|
10593
10591
|
);
|
|
10594
10592
|
const inputClasses = (0, import_css39.cx)(
|
|
10595
10593
|
[
|
|
10596
|
-
(0,
|
|
10597
|
-
size === "small" && (0,
|
|
10598
|
-
size === "large" && (0,
|
|
10594
|
+
(0, import_browser66.withVendorCSSClassPrefix)("signup__input"),
|
|
10595
|
+
size === "small" && (0, import_browser66.withVendorCSSClassPrefix)("signup__input--small"),
|
|
10596
|
+
size === "large" && (0, import_browser66.withVendorCSSClassPrefix)("signup__input--large")
|
|
10599
10597
|
],
|
|
10600
10598
|
inputClassName
|
|
10601
10599
|
);
|
|
10602
10600
|
const buttonClasses = (0, import_css39.cx)(
|
|
10603
10601
|
[
|
|
10604
|
-
(0,
|
|
10605
|
-
size === "small" && (0,
|
|
10606
|
-
size === "large" && (0,
|
|
10602
|
+
(0, import_browser66.withVendorCSSClassPrefix)("signup__button"),
|
|
10603
|
+
size === "small" && (0, import_browser66.withVendorCSSClassPrefix)("signup__button--small"),
|
|
10604
|
+
size === "large" && (0, import_browser66.withVendorCSSClassPrefix)("signup__button--large")
|
|
10607
10605
|
],
|
|
10608
10606
|
buttonClassName
|
|
10609
10607
|
);
|
|
10610
|
-
const errorClasses = (0, import_css39.cx)([(0,
|
|
10611
|
-
const messageClasses = (0, import_css39.cx)([(0,
|
|
10608
|
+
const errorClasses = (0, import_css39.cx)([(0, import_browser66.withVendorCSSClassPrefix)("signup__error")], errorClassName);
|
|
10609
|
+
const messageClasses = (0, import_css39.cx)([(0, import_browser66.withVendorCSSClassPrefix)("signup__messages")], messageClassName);
|
|
10612
10610
|
const renderComponents = (0, import_react68.useCallback)(
|
|
10613
10611
|
(components) => renderSignUpComponents2(
|
|
10614
10612
|
components,
|
|
@@ -10650,11 +10648,11 @@ var BaseSignUpContent = ({
|
|
|
10650
10648
|
setCurrentFlow(response);
|
|
10651
10649
|
setIsFlowInitialized(true);
|
|
10652
10650
|
onFlowChange?.(response);
|
|
10653
|
-
if (response.flowStatus ===
|
|
10651
|
+
if (response.flowStatus === import_browser66.EmbeddedFlowStatus.Complete) {
|
|
10654
10652
|
onComplete?.(response);
|
|
10655
10653
|
return;
|
|
10656
10654
|
}
|
|
10657
|
-
if (response.flowStatus ===
|
|
10655
|
+
if (response.flowStatus === import_browser66.EmbeddedFlowStatus.Incomplete) {
|
|
10658
10656
|
setupFormFields(response);
|
|
10659
10657
|
}
|
|
10660
10658
|
} catch (err) {
|
|
@@ -10732,11 +10730,73 @@ var BaseSignUp = ({ showLogo = true, ...rest }) => {
|
|
|
10732
10730
|
var BaseSignUp_default = BaseSignUp;
|
|
10733
10731
|
|
|
10734
10732
|
// src/components/presentation/auth/SignUp/v2/BaseSignUp.tsx
|
|
10735
|
-
var
|
|
10733
|
+
var import_browser67 = require("@asgardeo/browser");
|
|
10736
10734
|
var import_css40 = require("@emotion/css");
|
|
10737
10735
|
var import_react69 = require("react");
|
|
10736
|
+
|
|
10737
|
+
// src/utils/v2/getAuthComponentHeadings.ts
|
|
10738
|
+
var getAuthComponentHeadings = (components, flowTitle, flowSubtitle, defaultTitle, defaultSubtitle) => {
|
|
10739
|
+
let heading = null;
|
|
10740
|
+
let subheading = null;
|
|
10741
|
+
const findHeadings = (comps) => {
|
|
10742
|
+
for (const component of comps) {
|
|
10743
|
+
if (component.type === "TEXT" && component.variant && component.variant.startsWith("HEADING_")) {
|
|
10744
|
+
if (!heading) {
|
|
10745
|
+
heading = component;
|
|
10746
|
+
} else if (!subheading) {
|
|
10747
|
+
subheading = component;
|
|
10748
|
+
break;
|
|
10749
|
+
}
|
|
10750
|
+
}
|
|
10751
|
+
if (component.components && component.components.length > 0) {
|
|
10752
|
+
findHeadings(component.components);
|
|
10753
|
+
if (heading && subheading) break;
|
|
10754
|
+
}
|
|
10755
|
+
}
|
|
10756
|
+
};
|
|
10757
|
+
const filterComponents = (comps) => {
|
|
10758
|
+
let foundHeadings = 0;
|
|
10759
|
+
const maxHeadings = 2;
|
|
10760
|
+
const filter = (items) => items.reduce((acc, component) => {
|
|
10761
|
+
if (foundHeadings < maxHeadings && component.type === "TEXT" && component.variant && component.variant.startsWith("HEADING_")) {
|
|
10762
|
+
foundHeadings += 1;
|
|
10763
|
+
return acc;
|
|
10764
|
+
}
|
|
10765
|
+
if (component.components && component.components.length > 0) {
|
|
10766
|
+
const filteredNestedComponents = filter(component.components);
|
|
10767
|
+
if (filteredNestedComponents.length > 0) {
|
|
10768
|
+
acc.push({
|
|
10769
|
+
...component,
|
|
10770
|
+
components: filteredNestedComponents
|
|
10771
|
+
});
|
|
10772
|
+
}
|
|
10773
|
+
} else {
|
|
10774
|
+
acc.push(component);
|
|
10775
|
+
}
|
|
10776
|
+
return acc;
|
|
10777
|
+
}, []);
|
|
10778
|
+
return filter(comps);
|
|
10779
|
+
};
|
|
10780
|
+
const getComponentText = (component) => {
|
|
10781
|
+
if (!component) return "";
|
|
10782
|
+
return component.label || "";
|
|
10783
|
+
};
|
|
10784
|
+
findHeadings(components);
|
|
10785
|
+
const headingText = getComponentText(heading);
|
|
10786
|
+
const subheadingText = getComponentText(subheading);
|
|
10787
|
+
const result = {
|
|
10788
|
+
componentsWithoutHeadings: filterComponents(components),
|
|
10789
|
+
headingComponents: { heading, subheading },
|
|
10790
|
+
subtitle: flowSubtitle || subheadingText || defaultSubtitle || "",
|
|
10791
|
+
title: flowTitle || headingText || defaultTitle || ""
|
|
10792
|
+
};
|
|
10793
|
+
return result;
|
|
10794
|
+
};
|
|
10795
|
+
var getAuthComponentHeadings_default = getAuthComponentHeadings;
|
|
10796
|
+
|
|
10797
|
+
// src/components/presentation/auth/SignUp/v2/BaseSignUp.tsx
|
|
10738
10798
|
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
10739
|
-
var logger7 = (0,
|
|
10799
|
+
var logger7 = (0, import_browser67.createPackageComponentLogger)(
|
|
10740
10800
|
"@asgardeo/react",
|
|
10741
10801
|
"BaseSignUp"
|
|
10742
10802
|
);
|
|
@@ -10822,7 +10882,7 @@ var BaseSignUpContent2 = ({
|
|
|
10822
10882
|
const fields = [];
|
|
10823
10883
|
const processComponents = (comps) => {
|
|
10824
10884
|
comps.forEach((component) => {
|
|
10825
|
-
if (component.type ===
|
|
10885
|
+
if (component.type === import_browser67.EmbeddedFlowComponentTypeV2.TextInput || component.type === import_browser67.EmbeddedFlowComponentTypeV2.PasswordInput || component.type === import_browser67.EmbeddedFlowComponentTypeV2.EmailInput || component.type === import_browser67.EmbeddedFlowComponentTypeV2.Select) {
|
|
10826
10886
|
const fieldName = component.ref || component.id;
|
|
10827
10887
|
fields.push({
|
|
10828
10888
|
initialValue: "",
|
|
@@ -10832,7 +10892,7 @@ var BaseSignUpContent2 = ({
|
|
|
10832
10892
|
if (component.required && (!value || value.trim() === "")) {
|
|
10833
10893
|
return t("validations.required.field.error");
|
|
10834
10894
|
}
|
|
10835
|
-
if ((component.type ===
|
|
10895
|
+
if ((component.type === import_browser67.EmbeddedFlowComponentTypeV2.EmailInput || component.variant === "EMAIL") && value && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value)) {
|
|
10836
10896
|
return t("field.email.invalid");
|
|
10837
10897
|
}
|
|
10838
10898
|
return null;
|
|
@@ -10889,7 +10949,7 @@ var BaseSignUpContent2 = ({
|
|
|
10889
10949
|
setFormTouched(name, true);
|
|
10890
10950
|
};
|
|
10891
10951
|
const handleRedirectionIfNeeded = (response) => {
|
|
10892
|
-
if (response?.type ===
|
|
10952
|
+
if (response?.type === import_browser67.EmbeddedFlowResponseType.Redirection && response?.data?.redirectURL) {
|
|
10893
10953
|
const redirectUrl = response.data.redirectURL;
|
|
10894
10954
|
const popup = window.open(redirectUrl, "oauth_popup", "width=500,height=600,scrollbars=yes,resizable=yes");
|
|
10895
10955
|
if (!popup) {
|
|
@@ -10929,9 +10989,9 @@ var BaseSignUpContent2 = ({
|
|
|
10929
10989
|
try {
|
|
10930
10990
|
const continueResponse = await onSubmit(payload);
|
|
10931
10991
|
onFlowChange?.(continueResponse);
|
|
10932
|
-
if (continueResponse.flowStatus ===
|
|
10992
|
+
if (continueResponse.flowStatus === import_browser67.EmbeddedFlowStatus.Complete) {
|
|
10933
10993
|
onComplete?.(continueResponse);
|
|
10934
|
-
} else if (continueResponse.flowStatus ===
|
|
10994
|
+
} else if (continueResponse.flowStatus === import_browser67.EmbeddedFlowStatus.Incomplete) {
|
|
10935
10995
|
setCurrentFlow(continueResponse);
|
|
10936
10996
|
setupFormFields(continueResponse);
|
|
10937
10997
|
}
|
|
@@ -10982,9 +11042,9 @@ var BaseSignUpContent2 = ({
|
|
|
10982
11042
|
try {
|
|
10983
11043
|
const continueResponse = await onSubmit(payload);
|
|
10984
11044
|
onFlowChange?.(continueResponse);
|
|
10985
|
-
if (continueResponse.flowStatus ===
|
|
11045
|
+
if (continueResponse.flowStatus === import_browser67.EmbeddedFlowStatus.Complete) {
|
|
10986
11046
|
onComplete?.(continueResponse);
|
|
10987
|
-
} else if (continueResponse.flowStatus ===
|
|
11047
|
+
} else if (continueResponse.flowStatus === import_browser67.EmbeddedFlowStatus.Incomplete) {
|
|
10988
11048
|
setCurrentFlow(continueResponse);
|
|
10989
11049
|
setupFormFields(continueResponse);
|
|
10990
11050
|
}
|
|
@@ -11038,11 +11098,11 @@ var BaseSignUpContent2 = ({
|
|
|
11038
11098
|
const rawResponse = await onSubmit(payload);
|
|
11039
11099
|
const response = normalizeFlowResponseLocal(rawResponse);
|
|
11040
11100
|
onFlowChange?.(response);
|
|
11041
|
-
if (response.flowStatus ===
|
|
11101
|
+
if (response.flowStatus === import_browser67.EmbeddedFlowStatus.Complete) {
|
|
11042
11102
|
onComplete?.(response);
|
|
11043
11103
|
return;
|
|
11044
11104
|
}
|
|
11045
|
-
if (response.flowStatus ===
|
|
11105
|
+
if (response.flowStatus === import_browser67.EmbeddedFlowStatus.Incomplete) {
|
|
11046
11106
|
if (handleRedirectionIfNeeded(response)) {
|
|
11047
11107
|
return;
|
|
11048
11108
|
}
|
|
@@ -11095,7 +11155,7 @@ var BaseSignUpContent2 = ({
|
|
|
11095
11155
|
const nextResponse = await onSubmit(payload);
|
|
11096
11156
|
const processedResponse = normalizeFlowResponseLocal(nextResponse);
|
|
11097
11157
|
onFlowChange?.(processedResponse);
|
|
11098
|
-
if (processedResponse.flowStatus ===
|
|
11158
|
+
if (processedResponse.flowStatus === import_browser67.EmbeddedFlowStatus.Complete) {
|
|
11099
11159
|
onComplete?.(processedResponse);
|
|
11100
11160
|
} else {
|
|
11101
11161
|
setCurrentFlow(processedResponse);
|
|
@@ -11112,30 +11172,30 @@ var BaseSignUpContent2 = ({
|
|
|
11112
11172
|
}, [passkeyState.isActive, passkeyState.creationOptions, passkeyState.flowId]);
|
|
11113
11173
|
const containerClasses = (0, import_css40.cx)(
|
|
11114
11174
|
[
|
|
11115
|
-
(0,
|
|
11116
|
-
(0,
|
|
11117
|
-
(0,
|
|
11175
|
+
(0, import_browser67.withVendorCSSClassPrefix)("signup"),
|
|
11176
|
+
(0, import_browser67.withVendorCSSClassPrefix)(`signup--${size}`),
|
|
11177
|
+
(0, import_browser67.withVendorCSSClassPrefix)(`signup--${variant}`)
|
|
11118
11178
|
],
|
|
11119
11179
|
className
|
|
11120
11180
|
);
|
|
11121
11181
|
const inputClasses = (0, import_css40.cx)(
|
|
11122
11182
|
[
|
|
11123
|
-
(0,
|
|
11124
|
-
size === "small" && (0,
|
|
11125
|
-
size === "large" && (0,
|
|
11183
|
+
(0, import_browser67.withVendorCSSClassPrefix)("signup__input"),
|
|
11184
|
+
size === "small" && (0, import_browser67.withVendorCSSClassPrefix)("signup__input--small"),
|
|
11185
|
+
size === "large" && (0, import_browser67.withVendorCSSClassPrefix)("signup__input--large")
|
|
11126
11186
|
],
|
|
11127
11187
|
inputClassName
|
|
11128
11188
|
);
|
|
11129
11189
|
const buttonClasses = (0, import_css40.cx)(
|
|
11130
11190
|
[
|
|
11131
|
-
(0,
|
|
11132
|
-
size === "small" && (0,
|
|
11133
|
-
size === "large" && (0,
|
|
11191
|
+
(0, import_browser67.withVendorCSSClassPrefix)("signup__button"),
|
|
11192
|
+
size === "small" && (0, import_browser67.withVendorCSSClassPrefix)("signup__button--small"),
|
|
11193
|
+
size === "large" && (0, import_browser67.withVendorCSSClassPrefix)("signup__button--large")
|
|
11134
11194
|
],
|
|
11135
11195
|
buttonClassName
|
|
11136
11196
|
);
|
|
11137
|
-
const errorClasses = (0, import_css40.cx)([(0,
|
|
11138
|
-
const messageClasses = (0, import_css40.cx)([(0,
|
|
11197
|
+
const errorClasses = (0, import_css40.cx)([(0, import_browser67.withVendorCSSClassPrefix)("signup__error")], errorClassName);
|
|
11198
|
+
const messageClasses = (0, import_css40.cx)([(0, import_browser67.withVendorCSSClassPrefix)("signup__messages")], messageClassName);
|
|
11139
11199
|
const renderComponents = (0, import_react69.useCallback)(
|
|
11140
11200
|
(components) => renderSignUpComponents(
|
|
11141
11201
|
components,
|
|
@@ -11193,11 +11253,11 @@ var BaseSignUpContent2 = ({
|
|
|
11193
11253
|
setCurrentFlow(response);
|
|
11194
11254
|
setIsFlowInitialized(true);
|
|
11195
11255
|
onFlowChange?.(response);
|
|
11196
|
-
if (response.flowStatus ===
|
|
11256
|
+
if (response.flowStatus === import_browser67.EmbeddedFlowStatus.Complete) {
|
|
11197
11257
|
onComplete?.(response);
|
|
11198
11258
|
return;
|
|
11199
11259
|
}
|
|
11200
|
-
if (response.flowStatus ===
|
|
11260
|
+
if (response.flowStatus === import_browser67.EmbeddedFlowStatus.Incomplete) {
|
|
11201
11261
|
setupFormFields(response);
|
|
11202
11262
|
}
|
|
11203
11263
|
} catch (err) {
|
|
@@ -11294,7 +11354,7 @@ var BaseSignUp_default2 = BaseSignUp2;
|
|
|
11294
11354
|
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
11295
11355
|
var BaseSignUp3 = (props) => {
|
|
11296
11356
|
const { platform } = useAsgardeo_default();
|
|
11297
|
-
if (platform ===
|
|
11357
|
+
if (platform === import_browser68.Platform.AsgardeoV2) {
|
|
11298
11358
|
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(BaseSignUp_default2, { ...props });
|
|
11299
11359
|
}
|
|
11300
11360
|
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(BaseSignUp_default, { ...props });
|
|
@@ -11302,10 +11362,10 @@ var BaseSignUp3 = (props) => {
|
|
|
11302
11362
|
var BaseSignUp_default3 = BaseSignUp3;
|
|
11303
11363
|
|
|
11304
11364
|
// src/components/presentation/auth/SignUp/SignUp.tsx
|
|
11305
|
-
var
|
|
11365
|
+
var import_browser71 = require("@asgardeo/browser");
|
|
11306
11366
|
|
|
11307
11367
|
// src/components/presentation/auth/SignUp/v1/SignUp.tsx
|
|
11308
|
-
var
|
|
11368
|
+
var import_browser69 = require("@asgardeo/browser");
|
|
11309
11369
|
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
11310
11370
|
var SignUp = ({
|
|
11311
11371
|
className,
|
|
@@ -11320,17 +11380,17 @@ var SignUp = ({
|
|
|
11320
11380
|
const { signUp, isInitialized } = useAsgardeo_default();
|
|
11321
11381
|
const handleInitialize = async (payload) => {
|
|
11322
11382
|
const initialPayload = payload || {
|
|
11323
|
-
flowType:
|
|
11383
|
+
flowType: import_browser69.EmbeddedFlowType.Registration
|
|
11324
11384
|
};
|
|
11325
11385
|
return await signUp(initialPayload);
|
|
11326
11386
|
};
|
|
11327
11387
|
const handleOnSubmit = async (payload) => await signUp(payload);
|
|
11328
11388
|
const handleComplete = (response) => {
|
|
11329
11389
|
onComplete?.(response);
|
|
11330
|
-
if (shouldRedirectAfterSignUp && response?.type !==
|
|
11390
|
+
if (shouldRedirectAfterSignUp && response?.type !== import_browser69.EmbeddedFlowResponseType.Redirection && afterSignUpUrl) {
|
|
11331
11391
|
window.location.href = afterSignUpUrl;
|
|
11332
11392
|
}
|
|
11333
|
-
if (shouldRedirectAfterSignUp && response?.type ===
|
|
11393
|
+
if (shouldRedirectAfterSignUp && response?.type === import_browser69.EmbeddedFlowResponseType.Redirection && response?.data?.redirectURL && !response.data.redirectURL.includes("oauth") && // Not a social provider redirect
|
|
11334
11394
|
!response.data.redirectURL.includes("auth")) {
|
|
11335
11395
|
window.location.href = response.data.redirectURL;
|
|
11336
11396
|
}
|
|
@@ -11357,7 +11417,7 @@ var SignUp = ({
|
|
|
11357
11417
|
var SignUp_default = SignUp;
|
|
11358
11418
|
|
|
11359
11419
|
// src/components/presentation/auth/SignUp/v2/SignUp.tsx
|
|
11360
|
-
var
|
|
11420
|
+
var import_browser70 = require("@asgardeo/browser");
|
|
11361
11421
|
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
11362
11422
|
var SignUp2 = ({
|
|
11363
11423
|
className,
|
|
@@ -11375,7 +11435,7 @@ var SignUp2 = ({
|
|
|
11375
11435
|
const applicationIdFromUrl = urlParams.get("applicationId");
|
|
11376
11436
|
const effectiveApplicationId = applicationId || applicationIdFromUrl;
|
|
11377
11437
|
const initialPayload = payload || {
|
|
11378
|
-
flowType:
|
|
11438
|
+
flowType: import_browser70.EmbeddedFlowType.Registration,
|
|
11379
11439
|
...effectiveApplicationId && { applicationId: effectiveApplicationId }
|
|
11380
11440
|
};
|
|
11381
11441
|
return await signUp(initialPayload);
|
|
@@ -11388,10 +11448,10 @@ var SignUp2 = ({
|
|
|
11388
11448
|
window.location.href = oauthRedirectUrl;
|
|
11389
11449
|
return;
|
|
11390
11450
|
}
|
|
11391
|
-
if (shouldRedirectAfterSignUp && response?.type !==
|
|
11451
|
+
if (shouldRedirectAfterSignUp && response?.type !== import_browser70.EmbeddedFlowResponseType.Redirection && afterSignUpUrl) {
|
|
11392
11452
|
window.location.href = afterSignUpUrl;
|
|
11393
11453
|
}
|
|
11394
|
-
if (shouldRedirectAfterSignUp && response?.type ===
|
|
11454
|
+
if (shouldRedirectAfterSignUp && response?.type === import_browser70.EmbeddedFlowResponseType.Redirection && response?.data?.redirectURL && !response.data.redirectURL.includes("oauth") && // Not a social provider redirect
|
|
11395
11455
|
!response.data.redirectURL.includes("auth")) {
|
|
11396
11456
|
window.location.href = response.data.redirectURL;
|
|
11397
11457
|
}
|
|
@@ -11408,7 +11468,6 @@ var SignUp2 = ({
|
|
|
11408
11468
|
size,
|
|
11409
11469
|
isInitialized,
|
|
11410
11470
|
children,
|
|
11411
|
-
showLogo: true,
|
|
11412
11471
|
showTitle: true,
|
|
11413
11472
|
showSubtitle: true,
|
|
11414
11473
|
...rest
|
|
@@ -11421,7 +11480,7 @@ var SignUp_default2 = SignUp2;
|
|
|
11421
11480
|
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
11422
11481
|
var SignUp3 = (props) => {
|
|
11423
11482
|
const { platform } = useAsgardeo_default();
|
|
11424
|
-
if (platform ===
|
|
11483
|
+
if (platform === import_browser71.Platform.AsgardeoV2) {
|
|
11425
11484
|
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(SignUp_default2, { ...props });
|
|
11426
11485
|
}
|
|
11427
11486
|
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(SignUp_default, { ...props });
|
|
@@ -11429,10 +11488,10 @@ var SignUp3 = (props) => {
|
|
|
11429
11488
|
var SignUp_default3 = SignUp3;
|
|
11430
11489
|
|
|
11431
11490
|
// src/components/presentation/auth/InviteUser/v2/InviteUser.tsx
|
|
11432
|
-
var
|
|
11491
|
+
var import_browser73 = require("@asgardeo/browser");
|
|
11433
11492
|
|
|
11434
11493
|
// src/components/presentation/auth/InviteUser/v2/BaseInviteUser.tsx
|
|
11435
|
-
var
|
|
11494
|
+
var import_browser72 = require("@asgardeo/browser");
|
|
11436
11495
|
var import_css42 = require("@emotion/css");
|
|
11437
11496
|
var import_react71 = require("react");
|
|
11438
11497
|
|
|
@@ -11506,6 +11565,7 @@ var BaseInviteUser = ({
|
|
|
11506
11565
|
const [touchedFields, setTouchedFields] = (0, import_react71.useState)({});
|
|
11507
11566
|
const [inviteLink, setInviteLink] = (0, import_react71.useState)();
|
|
11508
11567
|
const [inviteLinkCopied, setInviteLinkCopied] = (0, import_react71.useState)(false);
|
|
11568
|
+
const [emailSent, setEmailSent] = (0, import_react71.useState)(false);
|
|
11509
11569
|
const [isFormValid, setIsFormValid] = (0, import_react71.useState)(true);
|
|
11510
11570
|
const initializationAttemptedRef = (0, import_react71.useRef)(false);
|
|
11511
11571
|
const handleError = (0, import_react71.useCallback)(
|
|
@@ -11617,6 +11677,9 @@ var BaseInviteUser = ({
|
|
|
11617
11677
|
setInviteLink(inviteLinkValue);
|
|
11618
11678
|
onInviteLinkGenerated?.(inviteLinkValue, response.flowId);
|
|
11619
11679
|
}
|
|
11680
|
+
if (response.data?.additionalData?.["emailSent"] === "true") {
|
|
11681
|
+
setEmailSent(true);
|
|
11682
|
+
}
|
|
11620
11683
|
if (response.flowStatus === "ERROR") {
|
|
11621
11684
|
handleError(response);
|
|
11622
11685
|
return;
|
|
@@ -11668,6 +11731,7 @@ var BaseInviteUser = ({
|
|
|
11668
11731
|
setTouchedFields({});
|
|
11669
11732
|
setInviteLink(void 0);
|
|
11670
11733
|
setInviteLinkCopied(false);
|
|
11734
|
+
setEmailSent(false);
|
|
11671
11735
|
initializationAttemptedRef.current = false;
|
|
11672
11736
|
}, []);
|
|
11673
11737
|
(0, import_react71.useEffect)(() => {
|
|
@@ -11678,7 +11742,7 @@ var BaseInviteUser = ({
|
|
|
11678
11742
|
setApiError(null);
|
|
11679
11743
|
try {
|
|
11680
11744
|
const payload = {
|
|
11681
|
-
flowType:
|
|
11745
|
+
flowType: import_browser72.EmbeddedFlowType.UserOnboarding,
|
|
11682
11746
|
verbose: true
|
|
11683
11747
|
};
|
|
11684
11748
|
const rawResponse = await onInitialize(payload);
|
|
@@ -11759,6 +11823,7 @@ var BaseInviteUser = ({
|
|
|
11759
11823
|
const { title, subtitle } = extractHeadings(components);
|
|
11760
11824
|
const componentsWithoutHeadings = filterHeadings(components);
|
|
11761
11825
|
const isInviteGenerated = !!inviteLink;
|
|
11826
|
+
const isEmailSent = emailSent;
|
|
11762
11827
|
const renderProps = {
|
|
11763
11828
|
components,
|
|
11764
11829
|
copyInviteLink,
|
|
@@ -11770,6 +11835,7 @@ var BaseInviteUser = ({
|
|
|
11770
11835
|
handleSubmit,
|
|
11771
11836
|
inviteLink,
|
|
11772
11837
|
inviteLinkCopied,
|
|
11838
|
+
isEmailSent,
|
|
11773
11839
|
isInviteGenerated,
|
|
11774
11840
|
isLoading,
|
|
11775
11841
|
isValid: isFormValid,
|
|
@@ -11795,6 +11861,15 @@ var BaseInviteUser = ({
|
|
|
11795
11861
|
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Alert_default.Description, { children: apiError.message })
|
|
11796
11862
|
] }) }) });
|
|
11797
11863
|
}
|
|
11864
|
+
if (isInviteGenerated && isEmailSent) {
|
|
11865
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(Card_default, { className: (0, import_css42.cx)(className, styles.card), variant, children: [
|
|
11866
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Card_default.Header, { className: styles.header, children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Card_default.Title, { level: 2, className: styles.title, children: "Invite Email Sent!" }) }),
|
|
11867
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(Card_default.Content, { children: [
|
|
11868
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Alert_default, { variant: "success", children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Alert_default.Description, { children: "An invitation email has been sent successfully. The user can complete their registration using the link in the email." }) }),
|
|
11869
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)("div", { style: { display: "flex", gap: "0.5rem", marginTop: "1.5rem" }, children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Button_default, { variant: "outline", onClick: resetFlow, children: "Invite Another User" }) })
|
|
11870
|
+
] })
|
|
11871
|
+
] });
|
|
11872
|
+
}
|
|
11798
11873
|
if (isInviteGenerated && inviteLink) {
|
|
11799
11874
|
return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(Card_default, { className: (0, import_css42.cx)(className, styles.card), variant, children: [
|
|
11800
11875
|
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Card_default.Header, { className: styles.header, children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Card_default.Title, { level: 2, className: styles.title, children: "Invite Link Generated!" }) }),
|
|
@@ -11859,7 +11934,7 @@ var InviteUser = ({
|
|
|
11859
11934
|
const response = await http2.request({
|
|
11860
11935
|
data: {
|
|
11861
11936
|
...payload,
|
|
11862
|
-
flowType:
|
|
11937
|
+
flowType: import_browser73.EmbeddedFlowType.UserOnboarding,
|
|
11863
11938
|
verbose: true
|
|
11864
11939
|
},
|
|
11865
11940
|
headers: {
|
|
@@ -12412,7 +12487,7 @@ var AcceptInvite = ({
|
|
|
12412
12487
|
var AcceptInvite_default = AcceptInvite;
|
|
12413
12488
|
|
|
12414
12489
|
// src/components/auth/Callback/Callback.tsx
|
|
12415
|
-
var
|
|
12490
|
+
var import_browser74 = require("@asgardeo/browser");
|
|
12416
12491
|
var import_react75 = require("react");
|
|
12417
12492
|
var Callback = ({ onNavigate, onError }) => {
|
|
12418
12493
|
const processingRef = (0, import_react75.useRef)(false);
|
|
@@ -12420,7 +12495,7 @@ var Callback = ({ onNavigate, onError }) => {
|
|
|
12420
12495
|
if (onNavigate) {
|
|
12421
12496
|
onNavigate(path);
|
|
12422
12497
|
} else {
|
|
12423
|
-
(0,
|
|
12498
|
+
(0, import_browser74.navigate)(path);
|
|
12424
12499
|
}
|
|
12425
12500
|
};
|
|
12426
12501
|
(0, import_react75.useEffect)(() => {
|
|
@@ -12545,12 +12620,12 @@ Organization5.displayName = "Organization";
|
|
|
12545
12620
|
var Organization_default = Organization5;
|
|
12546
12621
|
|
|
12547
12622
|
// src/components/presentation/UserProfile/BaseUserProfile.tsx
|
|
12548
|
-
var
|
|
12623
|
+
var import_browser80 = require("@asgardeo/browser");
|
|
12549
12624
|
var import_css52 = require("@emotion/css");
|
|
12550
12625
|
var import_react84 = require("react");
|
|
12551
12626
|
|
|
12552
12627
|
// src/components/presentation/UserProfile/BaseUserProfile.styles.ts
|
|
12553
|
-
var
|
|
12628
|
+
var import_browser75 = require("@asgardeo/browser");
|
|
12554
12629
|
var import_css45 = require("@emotion/css");
|
|
12555
12630
|
var import_react76 = require("react");
|
|
12556
12631
|
var useStyles20 = (theme, colorScheme) => {
|
|
@@ -12689,7 +12764,7 @@ var useStyles20 = (theme, colorScheme) => {
|
|
|
12689
12764
|
max-width: 350px;
|
|
12690
12765
|
text-align: start;
|
|
12691
12766
|
|
|
12692
|
-
.${(0,
|
|
12767
|
+
.${(0, import_browser75.withVendorCSSClassPrefix)("form-control")} {
|
|
12693
12768
|
margin-bottom: 0;
|
|
12694
12769
|
}
|
|
12695
12770
|
|
|
@@ -12754,20 +12829,20 @@ var useStyles20 = (theme, colorScheme) => {
|
|
|
12754
12829
|
var BaseUserProfile_styles_default = useStyles20;
|
|
12755
12830
|
|
|
12756
12831
|
// src/utils/getMappedUserProfileValue.ts
|
|
12757
|
-
var
|
|
12832
|
+
var import_browser76 = require("@asgardeo/browser");
|
|
12758
12833
|
var getMappedUserProfileValue = (key, mappings, user) => {
|
|
12759
12834
|
if (!key || !mappings || !user) {
|
|
12760
12835
|
return void 0;
|
|
12761
12836
|
}
|
|
12762
12837
|
const mapping = mappings[key];
|
|
12763
12838
|
if (!mapping) {
|
|
12764
|
-
return (0,
|
|
12839
|
+
return (0, import_browser76.get)(user, key);
|
|
12765
12840
|
}
|
|
12766
12841
|
if (Array.isArray(mapping)) {
|
|
12767
12842
|
let foundValue;
|
|
12768
12843
|
let found = false;
|
|
12769
12844
|
mapping.some((path) => {
|
|
12770
|
-
const value = (0,
|
|
12845
|
+
const value = (0, import_browser76.get)(user, path);
|
|
12771
12846
|
if (value !== void 0 && value !== null && value !== "") {
|
|
12772
12847
|
foundValue = value;
|
|
12773
12848
|
found = true;
|
|
@@ -12777,7 +12852,7 @@ var getMappedUserProfileValue = (key, mappings, user) => {
|
|
|
12777
12852
|
});
|
|
12778
12853
|
return found ? foundValue : void 0;
|
|
12779
12854
|
}
|
|
12780
|
-
return (0,
|
|
12855
|
+
return (0, import_browser76.get)(user, mapping);
|
|
12781
12856
|
};
|
|
12782
12857
|
var getMappedUserProfileValue_default = getMappedUserProfileValue;
|
|
12783
12858
|
|
|
@@ -12807,7 +12882,7 @@ var getDisplayName = (mergedMappings, user, displayAttributes) => {
|
|
|
12807
12882
|
var getDisplayName_default = getDisplayName;
|
|
12808
12883
|
|
|
12809
12884
|
// src/components/primitives/Avatar/Avatar.tsx
|
|
12810
|
-
var
|
|
12885
|
+
var import_browser77 = require("@asgardeo/browser");
|
|
12811
12886
|
var import_css47 = require("@emotion/css");
|
|
12812
12887
|
var import_react78 = require("react");
|
|
12813
12888
|
|
|
@@ -12930,7 +13005,7 @@ var Avatar = ({
|
|
|
12930
13005
|
{
|
|
12931
13006
|
src: imageUrl,
|
|
12932
13007
|
alt,
|
|
12933
|
-
className: (0, import_css47.cx)((0,
|
|
13008
|
+
className: (0, import_css47.cx)((0, import_browser77.withVendorCSSClassPrefix)((0, import_browser77.bem)("avatar", "image")), styles["image"])
|
|
12934
13009
|
}
|
|
12935
13010
|
);
|
|
12936
13011
|
}
|
|
@@ -12938,14 +13013,14 @@ var Avatar = ({
|
|
|
12938
13013
|
return getInitials(name);
|
|
12939
13014
|
}
|
|
12940
13015
|
if (isLoading) {
|
|
12941
|
-
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: (0, import_css47.cx)((0,
|
|
13016
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: (0, import_css47.cx)((0, import_browser77.withVendorCSSClassPrefix)((0, import_browser77.bem)("avatar", "skeleton")), styles["skeleton"]) });
|
|
12942
13017
|
}
|
|
12943
13018
|
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
12944
13019
|
"svg",
|
|
12945
13020
|
{
|
|
12946
13021
|
xmlns: "http://www.w3.org/2000/svg",
|
|
12947
13022
|
viewBox: "0 0 640 640",
|
|
12948
|
-
className: (0, import_css47.cx)((0,
|
|
13023
|
+
className: (0, import_css47.cx)((0, import_browser77.withVendorCSSClassPrefix)((0, import_browser77.bem)("avatar", "icon")), styles["icon"]),
|
|
12949
13024
|
children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("path", { d: "M240 192C240 147.8 275.8 112 320 112C364.2 112 400 147.8 400 192C400 236.2 364.2 272 320 272C275.8 272 240 236.2 240 192zM448 192C448 121.3 390.7 64 320 64C249.3 64 192 121.3 192 192C192 262.7 249.3 320 320 320C390.7 320 448 262.7 448 192zM144 544C144 473.3 201.3 416 272 416L368 416C438.7 416 496 473.3 496 544L496 552C496 565.3 506.7 576 520 576C533.3 576 544 565.3 544 552L544 544C544 446.8 465.2 368 368 368L272 368C174.8 368 96 446.8 96 544L96 552C96 565.3 106.7 576 120 576C133.3 576 144 565.3 144 552L144 544z" })
|
|
12950
13025
|
}
|
|
12951
13026
|
);
|
|
@@ -12954,11 +13029,11 @@ var Avatar = ({
|
|
|
12954
13029
|
"div",
|
|
12955
13030
|
{
|
|
12956
13031
|
className: (0, import_css47.cx)(
|
|
12957
|
-
(0,
|
|
13032
|
+
(0, import_browser77.withVendorCSSClassPrefix)((0, import_browser77.bem)("avatar")),
|
|
12958
13033
|
styles["avatar"],
|
|
12959
13034
|
styles["variant"],
|
|
12960
|
-
(0,
|
|
12961
|
-
isDefaultState && (0,
|
|
13035
|
+
(0, import_browser77.withVendorCSSClassPrefix)((0, import_browser77.bem)("avatar", null, variant)),
|
|
13036
|
+
isDefaultState && (0, import_browser77.withVendorCSSClassPrefix)((0, import_browser77.bem)("avatar", "default")),
|
|
12962
13037
|
className
|
|
12963
13038
|
),
|
|
12964
13039
|
children: renderContent()
|
|
@@ -12967,7 +13042,7 @@ var Avatar = ({
|
|
|
12967
13042
|
};
|
|
12968
13043
|
|
|
12969
13044
|
// src/components/primitives/Dialog/Dialog.tsx
|
|
12970
|
-
var
|
|
13045
|
+
var import_browser78 = require("@asgardeo/browser");
|
|
12971
13046
|
var import_css49 = require("@emotion/css");
|
|
12972
13047
|
var import_react80 = require("@floating-ui/react");
|
|
12973
13048
|
var import_react81 = require("react");
|
|
@@ -13207,13 +13282,13 @@ var DialogContent = (0, import_react81.forwardRef)(
|
|
|
13207
13282
|
return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_react80.FloatingPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
13208
13283
|
import_react80.FloatingOverlay,
|
|
13209
13284
|
{
|
|
13210
|
-
className: (0, import_css49.cx)((0,
|
|
13285
|
+
className: (0, import_css49.cx)((0, import_browser78.withVendorCSSClassPrefix)((0, import_browser78.bem)("dialog", "overlay")), styles["overlay"]),
|
|
13211
13286
|
lockScroll: true,
|
|
13212
13287
|
children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_react80.FloatingFocusManager, { context: floatingContext, initialFocus: -1, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
13213
13288
|
"div",
|
|
13214
13289
|
{
|
|
13215
13290
|
ref,
|
|
13216
|
-
className: (0, import_css49.cx)((0,
|
|
13291
|
+
className: (0, import_css49.cx)((0, import_browser78.withVendorCSSClassPrefix)((0, import_browser78.bem)("dialog", "content")), styles["content"], props.className),
|
|
13217
13292
|
"aria-labelledby": context.labelId,
|
|
13218
13293
|
"aria-describedby": context.descriptionId,
|
|
13219
13294
|
...context.getFloatingProps(props),
|
|
@@ -13236,14 +13311,14 @@ var DialogHeading = (0, import_react81.forwardRef)(
|
|
|
13236
13311
|
context.setLabelId(void 0);
|
|
13237
13312
|
};
|
|
13238
13313
|
}, [id, context.setLabelId]);
|
|
13239
|
-
return /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("div", { className: (0, import_css49.cx)((0,
|
|
13314
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("div", { className: (0, import_css49.cx)((0, import_browser78.withVendorCSSClassPrefix)((0, import_browser78.bem)("dialog", "header")), styles["header"]), children: [
|
|
13240
13315
|
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
13241
13316
|
"h2",
|
|
13242
13317
|
{
|
|
13243
13318
|
...props,
|
|
13244
13319
|
ref,
|
|
13245
13320
|
id,
|
|
13246
|
-
className: (0, import_css49.cx)((0,
|
|
13321
|
+
className: (0, import_css49.cx)((0, import_browser78.withVendorCSSClassPrefix)((0, import_browser78.bem)("dialog", "title")), styles["headerTitle"]),
|
|
13247
13322
|
children
|
|
13248
13323
|
}
|
|
13249
13324
|
),
|
|
@@ -13282,7 +13357,7 @@ var DialogDescription = (0, import_react81.forwardRef)(
|
|
|
13282
13357
|
...props,
|
|
13283
13358
|
ref,
|
|
13284
13359
|
id,
|
|
13285
|
-
className: (0, import_css49.cx)((0,
|
|
13360
|
+
className: (0, import_css49.cx)((0, import_browser78.withVendorCSSClassPrefix)((0, import_browser78.bem)("dialog", "description")), styles["description"], props.className),
|
|
13286
13361
|
children
|
|
13287
13362
|
}
|
|
13288
13363
|
);
|
|
@@ -13311,7 +13386,7 @@ var DialogClose = (0, import_react81.forwardRef)(
|
|
|
13311
13386
|
...props,
|
|
13312
13387
|
ref,
|
|
13313
13388
|
onClick: handleClick,
|
|
13314
|
-
className: (0, import_css49.cx)((0,
|
|
13389
|
+
className: (0, import_css49.cx)((0, import_browser78.withVendorCSSClassPrefix)((0, import_browser78.bem)("dialog", "close")), props.className),
|
|
13315
13390
|
variant: "text",
|
|
13316
13391
|
children
|
|
13317
13392
|
}
|
|
@@ -13331,7 +13406,7 @@ Dialog.Close = DialogClose;
|
|
|
13331
13406
|
var Dialog_default = Dialog;
|
|
13332
13407
|
|
|
13333
13408
|
// src/components/primitives/MultiInput/MultiInput.tsx
|
|
13334
|
-
var
|
|
13409
|
+
var import_browser79 = require("@asgardeo/browser");
|
|
13335
13410
|
var import_css51 = require("@emotion/css");
|
|
13336
13411
|
var import_react83 = require("react");
|
|
13337
13412
|
|
|
@@ -13524,26 +13599,26 @@ var MultiInput = ({
|
|
|
13524
13599
|
{
|
|
13525
13600
|
error,
|
|
13526
13601
|
helperText,
|
|
13527
|
-
className: (0, import_css51.cx)((0,
|
|
13602
|
+
className: (0, import_css51.cx)((0, import_browser79.withVendorCSSClassPrefix)((0, import_browser79.bem)("multi-input")), className),
|
|
13528
13603
|
style,
|
|
13529
13604
|
children: [
|
|
13530
13605
|
label && /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(InputLabel_default, { required, error: !!error, children: label }),
|
|
13531
|
-
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: (0, import_css51.cx)((0,
|
|
13532
|
-
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: (0, import_css51.cx)((0,
|
|
13606
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: (0, import_css51.cx)((0, import_browser79.withVendorCSSClassPrefix)((0, import_browser79.bem)("multi-input", "container")), styles["container"]), children: [
|
|
13607
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: (0, import_css51.cx)((0, import_browser79.withVendorCSSClassPrefix)((0, import_browser79.bem)("multi-input", "input-row")), styles["inputRow"]), children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: (0, import_css51.cx)((0, import_browser79.withVendorCSSClassPrefix)((0, import_browser79.bem)("multi-input", "input-wrapper")), styles["inputWrapper"]), children: renderInputField(
|
|
13533
13608
|
currentInputValue,
|
|
13534
13609
|
setCurrentInputValue,
|
|
13535
13610
|
canAddMore ? /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(PlusIcon, { iconClassName: styles["plusIcon"] }) : void 0,
|
|
13536
13611
|
canAddMore ? handleInputSubmit : void 0
|
|
13537
13612
|
) }) }),
|
|
13538
|
-
values.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: (0, import_css51.cx)((0,
|
|
13613
|
+
values.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: (0, import_css51.cx)((0, import_browser79.withVendorCSSClassPrefix)((0, import_browser79.bem)("multi-input", "list-container")), styles["listContainer"]), children: values.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(
|
|
13539
13614
|
"div",
|
|
13540
13615
|
{
|
|
13541
|
-
className: (0, import_css51.cx)((0,
|
|
13616
|
+
className: (0, import_css51.cx)((0, import_browser79.withVendorCSSClassPrefix)((0, import_browser79.bem)("multi-input", "list-item")), styles["listItem"]),
|
|
13542
13617
|
children: [
|
|
13543
13618
|
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
13544
13619
|
"span",
|
|
13545
13620
|
{
|
|
13546
|
-
className: (0, import_css51.cx)((0,
|
|
13621
|
+
className: (0, import_css51.cx)((0, import_browser79.withVendorCSSClassPrefix)((0, import_browser79.bem)("multi-input", "list-item-text")), styles["listItemText"]),
|
|
13547
13622
|
children: value
|
|
13548
13623
|
}
|
|
13549
13624
|
),
|
|
@@ -13554,7 +13629,7 @@ var MultiInput = ({
|
|
|
13554
13629
|
onClick: () => handleRemoveValue(index),
|
|
13555
13630
|
disabled,
|
|
13556
13631
|
className: (0, import_css51.cx)(
|
|
13557
|
-
(0,
|
|
13632
|
+
(0, import_browser79.withVendorCSSClassPrefix)((0, import_browser79.bem)("multi-input", "remove-button")),
|
|
13558
13633
|
styles["removeButton"]
|
|
13559
13634
|
),
|
|
13560
13635
|
title: "Remove value",
|
|
@@ -13715,7 +13790,7 @@ var BaseUserProfile = ({
|
|
|
13715
13790
|
fieldValue = fieldValue.filter((v) => v !== void 0 && v !== null && v !== "");
|
|
13716
13791
|
}
|
|
13717
13792
|
let payload = {};
|
|
13718
|
-
if (schema.schemaId && schema.schemaId !==
|
|
13793
|
+
if (schema.schemaId && schema.schemaId !== import_browser80.WellKnownSchemaIds.User) {
|
|
13719
13794
|
payload = {
|
|
13720
13795
|
[schema.schemaId]: {
|
|
13721
13796
|
[fieldName]: fieldValue
|
|
@@ -13981,7 +14056,7 @@ var BaseUserProfile = ({
|
|
|
13981
14056
|
const containerClasses = (0, import_css52.cx)(
|
|
13982
14057
|
styles.root,
|
|
13983
14058
|
cardLayout ? styles.card : "",
|
|
13984
|
-
(0,
|
|
14059
|
+
(0, import_browser80.withVendorCSSClassPrefix)("user-profile"),
|
|
13985
14060
|
className
|
|
13986
14061
|
);
|
|
13987
14062
|
const currentUser = flattenedProfile || profile;
|
|
@@ -14022,7 +14097,7 @@ var BaseUserProfile = ({
|
|
|
14022
14097
|
Alert_default,
|
|
14023
14098
|
{
|
|
14024
14099
|
variant: "error",
|
|
14025
|
-
className: (0, import_css52.cx)((0,
|
|
14100
|
+
className: (0, import_css52.cx)((0, import_browser80.withVendorCSSClassPrefix)((0, import_browser80.bem)("user-profile", "alert")), styles.alert),
|
|
14026
14101
|
children: [
|
|
14027
14102
|
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(Alert_default.Title, { children: t("errors.heading") || "Error" }),
|
|
14028
14103
|
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(Alert_default.Description, { children: error })
|
|
@@ -14070,14 +14145,14 @@ var BaseUserProfile = ({
|
|
|
14070
14145
|
var BaseUserProfile_default = BaseUserProfile;
|
|
14071
14146
|
|
|
14072
14147
|
// src/components/presentation/UserProfile/UserProfile.tsx
|
|
14073
|
-
var
|
|
14148
|
+
var import_browser82 = require("@asgardeo/browser");
|
|
14074
14149
|
var import_react85 = require("react");
|
|
14075
14150
|
|
|
14076
14151
|
// src/api/updateMeProfile.ts
|
|
14077
|
-
var
|
|
14152
|
+
var import_browser81 = require("@asgardeo/browser");
|
|
14078
14153
|
var updateMeProfile = async ({ fetcher, instanceId = 0, ...requestConfig }) => {
|
|
14079
14154
|
const defaultFetcher = async (url, config) => {
|
|
14080
|
-
const client =
|
|
14155
|
+
const client = import_browser81.AsgardeoSPAClient.getInstance(instanceId);
|
|
14081
14156
|
const httpClient = client.httpRequest.bind(client);
|
|
14082
14157
|
const response = await httpClient({
|
|
14083
14158
|
data: config.body ? JSON.parse(config.body) : void 0,
|
|
@@ -14093,7 +14168,7 @@ var updateMeProfile = async ({ fetcher, instanceId = 0, ...requestConfig }) => {
|
|
|
14093
14168
|
text: () => Promise.resolve(typeof response.data === "string" ? response.data : JSON.stringify(response.data))
|
|
14094
14169
|
};
|
|
14095
14170
|
};
|
|
14096
|
-
return (0,
|
|
14171
|
+
return (0, import_browser81.updateMeProfile)({
|
|
14097
14172
|
...requestConfig,
|
|
14098
14173
|
fetcher: fetcher || defaultFetcher
|
|
14099
14174
|
});
|
|
@@ -14114,7 +14189,7 @@ var UserProfile3 = ({ preferences, ...rest }) => {
|
|
|
14114
14189
|
onUpdateProfile(response);
|
|
14115
14190
|
} catch (caughtError) {
|
|
14116
14191
|
let message = t("user.profile.update.generic.error");
|
|
14117
|
-
if (caughtError instanceof
|
|
14192
|
+
if (caughtError instanceof import_browser82.AsgardeoError) {
|
|
14118
14193
|
message = caughtError?.message;
|
|
14119
14194
|
}
|
|
14120
14195
|
setError(message);
|
|
@@ -14136,7 +14211,7 @@ var UserProfile3 = ({ preferences, ...rest }) => {
|
|
|
14136
14211
|
var UserProfile_default = UserProfile3;
|
|
14137
14212
|
|
|
14138
14213
|
// src/components/presentation/UserDropdown/BaseUserDropdown.tsx
|
|
14139
|
-
var
|
|
14214
|
+
var import_browser83 = require("@asgardeo/browser");
|
|
14140
14215
|
var import_css54 = require("@emotion/css");
|
|
14141
14216
|
var import_react87 = require("@floating-ui/react");
|
|
14142
14217
|
var import_react88 = require("react");
|
|
@@ -14402,12 +14477,12 @@ var BaseUserDropdown = ({
|
|
|
14402
14477
|
}
|
|
14403
14478
|
allMenuItems.push(...defaultMenuItems);
|
|
14404
14479
|
}
|
|
14405
|
-
return /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: (0, import_css54.cx)((0,
|
|
14480
|
+
return /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: (0, import_css54.cx)((0, import_browser83.withVendorCSSClassPrefix)("user-dropdown"), className), children: [
|
|
14406
14481
|
/* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(
|
|
14407
14482
|
Button_default,
|
|
14408
14483
|
{
|
|
14409
14484
|
ref: refs.setReference,
|
|
14410
|
-
className: (0, import_css54.cx)((0,
|
|
14485
|
+
className: (0, import_css54.cx)((0, import_browser83.withVendorCSSClassPrefix)("user-dropdown__trigger"), styles["trigger"]),
|
|
14411
14486
|
color: "tertiary",
|
|
14412
14487
|
variant: "text",
|
|
14413
14488
|
size: "medium",
|
|
@@ -14427,7 +14502,7 @@ var BaseUserDropdown = ({
|
|
|
14427
14502
|
Typography_default,
|
|
14428
14503
|
{
|
|
14429
14504
|
variant: "body2",
|
|
14430
|
-
className: (0, import_css54.cx)((0,
|
|
14505
|
+
className: (0, import_css54.cx)((0, import_browser83.withVendorCSSClassPrefix)("user-dropdown__trigger-label"), styles["userName"]),
|
|
14431
14506
|
children: getDisplayName_default(mergedMappings, user)
|
|
14432
14507
|
}
|
|
14433
14508
|
)
|
|
@@ -14438,7 +14513,7 @@ var BaseUserDropdown = ({
|
|
|
14438
14513
|
"div",
|
|
14439
14514
|
{
|
|
14440
14515
|
ref: refs.setFloating,
|
|
14441
|
-
className: (0, import_css54.cx)((0,
|
|
14516
|
+
className: (0, import_css54.cx)((0, import_browser83.withVendorCSSClassPrefix)("user-dropdown__content"), styles["dropdownContent"]),
|
|
14442
14517
|
style: {
|
|
14443
14518
|
...floatingStyles,
|
|
14444
14519
|
// Floating UI doesn't set a z-index by default, so we set a high value to ensure the dropdown appears above other elements.
|
|
@@ -14447,7 +14522,7 @@ var BaseUserDropdown = ({
|
|
|
14447
14522
|
},
|
|
14448
14523
|
...getFloatingProps(),
|
|
14449
14524
|
children: [
|
|
14450
|
-
/* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: (0, import_css54.cx)((0,
|
|
14525
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: (0, import_css54.cx)((0, import_browser83.withVendorCSSClassPrefix)("user-dropdown__header"), styles["dropdownHeader"]), children: [
|
|
14451
14526
|
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
14452
14527
|
Avatar,
|
|
14453
14528
|
{
|
|
@@ -14457,12 +14532,12 @@ var BaseUserDropdown = ({
|
|
|
14457
14532
|
alt: `${getDisplayName_default(mergedMappings, user)}'s avatar`
|
|
14458
14533
|
}
|
|
14459
14534
|
),
|
|
14460
|
-
/* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: (0, import_css54.cx)((0,
|
|
14535
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: (0, import_css54.cx)((0, import_browser83.withVendorCSSClassPrefix)("user-dropdown__header-info"), styles["headerInfo"]), children: [
|
|
14461
14536
|
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
14462
14537
|
Typography_default,
|
|
14463
14538
|
{
|
|
14464
14539
|
noWrap: true,
|
|
14465
|
-
className: (0,
|
|
14540
|
+
className: (0, import_browser83.withVendorCSSClassPrefix)("user-dropdown__header-name"),
|
|
14466
14541
|
variant: "body1",
|
|
14467
14542
|
fontWeight: "medium",
|
|
14468
14543
|
children: getDisplayName_default(mergedMappings, user)
|
|
@@ -14472,7 +14547,7 @@ var BaseUserDropdown = ({
|
|
|
14472
14547
|
Typography_default,
|
|
14473
14548
|
{
|
|
14474
14549
|
noWrap: true,
|
|
14475
|
-
className: (0,
|
|
14550
|
+
className: (0, import_browser83.withVendorCSSClassPrefix)("user-dropdown__header-email"),
|
|
14476
14551
|
variant: "caption",
|
|
14477
14552
|
color: "secondary",
|
|
14478
14553
|
children: getMappedUserProfileValue_default("username", mergedMappings, user) || getMappedUserProfileValue_default("email", mergedMappings, user)
|
|
@@ -14480,12 +14555,12 @@ var BaseUserDropdown = ({
|
|
|
14480
14555
|
)
|
|
14481
14556
|
] })
|
|
14482
14557
|
] }),
|
|
14483
|
-
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: (0, import_css54.cx)((0,
|
|
14558
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: (0, import_css54.cx)((0, import_browser83.withVendorCSSClassPrefix)("user-dropdown__menu"), styles["dropdownMenu"]), children: allMenuItems.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { children: (() => {
|
|
14484
14559
|
if (item.label === "") {
|
|
14485
14560
|
return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
14486
14561
|
"div",
|
|
14487
14562
|
{
|
|
14488
|
-
className: (0, import_css54.cx)((0,
|
|
14563
|
+
className: (0, import_css54.cx)((0, import_browser83.withVendorCSSClassPrefix)("user-dropdown__menu-divider"), styles["divider"])
|
|
14489
14564
|
}
|
|
14490
14565
|
);
|
|
14491
14566
|
}
|
|
@@ -14498,7 +14573,7 @@ var BaseUserDropdown = ({
|
|
|
14498
14573
|
backgroundColor: hoveredItemIndex === index ? theme.vars.colors.action?.hover : "transparent"
|
|
14499
14574
|
},
|
|
14500
14575
|
className: (0, import_css54.cx)(
|
|
14501
|
-
(0,
|
|
14576
|
+
(0, import_browser83.withVendorCSSClassPrefix)("user-dropdown__menu-item"),
|
|
14502
14577
|
styles["menuItemAnchor"]
|
|
14503
14578
|
),
|
|
14504
14579
|
onMouseEnter: () => setHoveredItemIndex(index),
|
|
@@ -14519,7 +14594,7 @@ var BaseUserDropdown = ({
|
|
|
14519
14594
|
style: {
|
|
14520
14595
|
backgroundColor: hoveredItemIndex === index ? theme.vars.colors.action?.hover : "transparent"
|
|
14521
14596
|
},
|
|
14522
|
-
className: (0, import_css54.cx)((0,
|
|
14597
|
+
className: (0, import_css54.cx)((0, import_browser83.withVendorCSSClassPrefix)("user-dropdown__menu-item"), styles["menuItem"]),
|
|
14523
14598
|
color: "tertiary",
|
|
14524
14599
|
variant: "text",
|
|
14525
14600
|
size: "small",
|
|
@@ -15179,7 +15254,7 @@ var BuildingAlt_default = BuildingAlt;
|
|
|
15179
15254
|
var import_react95 = require("react");
|
|
15180
15255
|
|
|
15181
15256
|
// src/components/presentation/CreateOrganization/BaseCreateOrganization.tsx
|
|
15182
|
-
var
|
|
15257
|
+
var import_browser84 = require("@asgardeo/browser");
|
|
15183
15258
|
var import_css58 = require("@emotion/css");
|
|
15184
15259
|
var import_react94 = require("react");
|
|
15185
15260
|
|
|
@@ -15323,7 +15398,7 @@ var BaseCreateOrganization_styles_default = useStyles26;
|
|
|
15323
15398
|
|
|
15324
15399
|
// src/components/presentation/CreateOrganization/BaseCreateOrganization.tsx
|
|
15325
15400
|
var import_jsx_runtime107 = require("react/jsx-runtime");
|
|
15326
|
-
var logger8 = (0,
|
|
15401
|
+
var logger8 = (0, import_browser84.createPackageComponentLogger)(
|
|
15327
15402
|
"@asgardeo/react",
|
|
15328
15403
|
"BaseCreateOrganization"
|
|
15329
15404
|
);
|
|
@@ -15476,14 +15551,14 @@ var BaseCreateOrganization = ({
|
|
|
15476
15551
|
};
|
|
15477
15552
|
|
|
15478
15553
|
// src/api/createOrganization.ts
|
|
15479
|
-
var
|
|
15554
|
+
var import_browser85 = require("@asgardeo/browser");
|
|
15480
15555
|
var createOrganization = async ({
|
|
15481
15556
|
fetcher,
|
|
15482
15557
|
instanceId = 0,
|
|
15483
15558
|
...requestConfig
|
|
15484
15559
|
}) => {
|
|
15485
15560
|
const defaultFetcher = async (url, config) => {
|
|
15486
|
-
const client =
|
|
15561
|
+
const client = import_browser85.AsgardeoSPAClient.getInstance(instanceId);
|
|
15487
15562
|
const httpClient = client.httpRequest.bind(client);
|
|
15488
15563
|
const response = await httpClient({
|
|
15489
15564
|
data: config.body ? JSON.parse(config.body) : void 0,
|
|
@@ -15499,7 +15574,7 @@ var createOrganization = async ({
|
|
|
15499
15574
|
text: () => Promise.resolve(typeof response.data === "string" ? response.data : JSON.stringify(response.data))
|
|
15500
15575
|
};
|
|
15501
15576
|
};
|
|
15502
|
-
return (0,
|
|
15577
|
+
return (0, import_browser85.createOrganization)({
|
|
15503
15578
|
...requestConfig,
|
|
15504
15579
|
fetcher: fetcher || defaultFetcher
|
|
15505
15580
|
});
|
|
@@ -16055,11 +16130,11 @@ var OrganizationList = (props) => {
|
|
|
16055
16130
|
var OrganizationList_default = OrganizationList;
|
|
16056
16131
|
|
|
16057
16132
|
// src/components/presentation/OrganizationProfile/OrganizationProfile.tsx
|
|
16058
|
-
var
|
|
16133
|
+
var import_browser90 = require("@asgardeo/browser");
|
|
16059
16134
|
var import_react104 = require("react");
|
|
16060
16135
|
|
|
16061
16136
|
// src/components/presentation/OrganizationProfile/BaseOrganizationProfile.tsx
|
|
16062
|
-
var
|
|
16137
|
+
var import_browser87 = require("@asgardeo/browser");
|
|
16063
16138
|
var import_css66 = require("@emotion/css");
|
|
16064
16139
|
var import_react103 = require("react");
|
|
16065
16140
|
|
|
@@ -16220,7 +16295,7 @@ var useStyles29 = (theme, colorScheme) => (0, import_react100.useMemo)(
|
|
|
16220
16295
|
var BaseOrganizationProfile_styles_default = useStyles29;
|
|
16221
16296
|
|
|
16222
16297
|
// src/components/primitives/KeyValueInput/KeyValueInput.tsx
|
|
16223
|
-
var
|
|
16298
|
+
var import_browser86 = require("@asgardeo/browser");
|
|
16224
16299
|
var import_css65 = require("@emotion/css");
|
|
16225
16300
|
var import_react102 = require("react");
|
|
16226
16301
|
|
|
@@ -16456,21 +16531,21 @@ var KeyValueInput = ({
|
|
|
16456
16531
|
const isAddDisabled = disabled || readOnly || !canAddMore || !newKey.trim() || !newValue.trim();
|
|
16457
16532
|
const renderReadOnlyContent = () => {
|
|
16458
16533
|
if (pairs.length === 0) {
|
|
16459
|
-
return /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("div", { className: (0, import_css65.cx)((0,
|
|
16534
|
+
return /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("div", { className: (0, import_css65.cx)((0, import_browser86.withVendorCSSClassPrefix)((0, import_browser86.bem)("key-value-input", "empty-state")), styles["emptyState"]), children: "No attributes defined" });
|
|
16460
16535
|
}
|
|
16461
16536
|
return pairs.map((pair, index) => /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(
|
|
16462
16537
|
"div",
|
|
16463
16538
|
{
|
|
16464
|
-
className: (0, import_css65.cx)((0,
|
|
16539
|
+
className: (0, import_css65.cx)((0, import_browser86.withVendorCSSClassPrefix)((0, import_browser86.bem)("key-value-input", "readonly-pair")), styles["readOnlyPair"]),
|
|
16465
16540
|
children: [
|
|
16466
|
-
/* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("span", { className: (0, import_css65.cx)((0,
|
|
16541
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("span", { className: (0, import_css65.cx)((0, import_browser86.withVendorCSSClassPrefix)((0, import_browser86.bem)("key-value-input", "readonly-key")), styles["readOnlyKey"]), children: [
|
|
16467
16542
|
pair.key,
|
|
16468
16543
|
":"
|
|
16469
16544
|
] }),
|
|
16470
16545
|
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
16471
16546
|
"span",
|
|
16472
16547
|
{
|
|
16473
|
-
className: (0, import_css65.cx)((0,
|
|
16548
|
+
className: (0, import_css65.cx)((0, import_browser86.withVendorCSSClassPrefix)((0, import_browser86.bem)("key-value-input", "readonly-value")), styles["readOnlyValue"]),
|
|
16474
16549
|
children: pair.value
|
|
16475
16550
|
}
|
|
16476
16551
|
)
|
|
@@ -16479,22 +16554,22 @@ var KeyValueInput = ({
|
|
|
16479
16554
|
`${pair.key}-${index}`
|
|
16480
16555
|
));
|
|
16481
16556
|
};
|
|
16482
|
-
return /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("div", { className: (0, import_css65.cx)((0,
|
|
16483
|
-
label && /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("label", { className: (0, import_css65.cx)((0,
|
|
16557
|
+
return /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("div", { className: (0, import_css65.cx)((0, import_browser86.withVendorCSSClassPrefix)((0, import_browser86.bem)("key-value-input")), styles["container"], className), children: [
|
|
16558
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("label", { className: (0, import_css65.cx)((0, import_browser86.withVendorCSSClassPrefix)((0, import_browser86.bem)("key-value-input", "label")), styles["label"]), children: [
|
|
16484
16559
|
label,
|
|
16485
16560
|
required && /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
16486
16561
|
"span",
|
|
16487
16562
|
{
|
|
16488
|
-
className: (0, import_css65.cx)((0,
|
|
16563
|
+
className: (0, import_css65.cx)((0, import_browser86.withVendorCSSClassPrefix)((0, import_browser86.bem)("key-value-input", "required")), styles["requiredIndicator"]),
|
|
16489
16564
|
children: " *"
|
|
16490
16565
|
}
|
|
16491
16566
|
)
|
|
16492
16567
|
] }),
|
|
16493
|
-
/* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("div", { className: (0, import_css65.cx)((0,
|
|
16568
|
+
/* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("div", { className: (0, import_css65.cx)((0, import_browser86.withVendorCSSClassPrefix)((0, import_browser86.bem)("key-value-input", "pairs-list")), styles["pairsList"]), children: [
|
|
16494
16569
|
readOnly ? renderReadOnlyContent() : pairs.map((pair, index) => /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(
|
|
16495
16570
|
"div",
|
|
16496
16571
|
{
|
|
16497
|
-
className: (0, import_css65.cx)((0,
|
|
16572
|
+
className: (0, import_css65.cx)((0, import_browser86.withVendorCSSClassPrefix)((0, import_browser86.bem)("key-value-input", "pair-row")), styles["pairRow"]),
|
|
16498
16573
|
children: [
|
|
16499
16574
|
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
16500
16575
|
TextField_default,
|
|
@@ -16503,7 +16578,7 @@ var KeyValueInput = ({
|
|
|
16503
16578
|
value: pair.key,
|
|
16504
16579
|
onChange: (e) => handleUpdatePair(index, "key", e.target.value),
|
|
16505
16580
|
disabled: disabled || readOnly,
|
|
16506
|
-
className: (0, import_css65.cx)((0,
|
|
16581
|
+
className: (0, import_css65.cx)((0, import_browser86.withVendorCSSClassPrefix)((0, import_browser86.bem)("key-value-input", "pair-input")), styles["pairInput"]),
|
|
16507
16582
|
"aria-label": `${keyLabel} ${index + 1}`
|
|
16508
16583
|
}
|
|
16509
16584
|
),
|
|
@@ -16514,7 +16589,7 @@ var KeyValueInput = ({
|
|
|
16514
16589
|
value: pair.value,
|
|
16515
16590
|
onChange: (e) => handleUpdatePair(index, "value", e.target.value),
|
|
16516
16591
|
disabled: disabled || readOnly,
|
|
16517
|
-
className: (0, import_css65.cx)((0,
|
|
16592
|
+
className: (0, import_css65.cx)((0, import_browser86.withVendorCSSClassPrefix)((0, import_browser86.bem)("key-value-input", "pair-input")), styles["pairInput"]),
|
|
16518
16593
|
"aria-label": `${valueLabel} ${index + 1}`
|
|
16519
16594
|
}
|
|
16520
16595
|
),
|
|
@@ -16525,7 +16600,7 @@ var KeyValueInput = ({
|
|
|
16525
16600
|
onClick: () => handleRemovePair(index),
|
|
16526
16601
|
disabled,
|
|
16527
16602
|
className: (0, import_css65.cx)(
|
|
16528
|
-
(0,
|
|
16603
|
+
(0, import_browser86.withVendorCSSClassPrefix)((0, import_browser86.bem)("key-value-input", "remove-button")),
|
|
16529
16604
|
styles["removeButton"]
|
|
16530
16605
|
),
|
|
16531
16606
|
"aria-label": `${removeButtonText} ${pair.key}`,
|
|
@@ -16536,7 +16611,7 @@ var KeyValueInput = ({
|
|
|
16536
16611
|
},
|
|
16537
16612
|
`${pair.key}-${index}`
|
|
16538
16613
|
)),
|
|
16539
|
-
!readOnly && /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("div", { className: (0, import_css65.cx)((0,
|
|
16614
|
+
!readOnly && /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("div", { className: (0, import_css65.cx)((0, import_browser86.withVendorCSSClassPrefix)((0, import_browser86.bem)("key-value-input", "add-row")), styles["addRow"]), children: [
|
|
16540
16615
|
/* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
16541
16616
|
TextField_default,
|
|
16542
16617
|
{
|
|
@@ -16544,7 +16619,7 @@ var KeyValueInput = ({
|
|
|
16544
16619
|
value: newKey,
|
|
16545
16620
|
onChange: (e) => setNewKey(e.target.value),
|
|
16546
16621
|
disabled,
|
|
16547
|
-
className: (0, import_css65.cx)((0,
|
|
16622
|
+
className: (0, import_css65.cx)((0, import_browser86.withVendorCSSClassPrefix)((0, import_browser86.bem)("key-value-input", "pair-input")), styles["pairInput"]),
|
|
16548
16623
|
"aria-label": "New key"
|
|
16549
16624
|
}
|
|
16550
16625
|
),
|
|
@@ -16555,7 +16630,7 @@ var KeyValueInput = ({
|
|
|
16555
16630
|
value: newValue,
|
|
16556
16631
|
onChange: (e) => setNewValue(e.target.value),
|
|
16557
16632
|
disabled,
|
|
16558
|
-
className: (0, import_css65.cx)((0,
|
|
16633
|
+
className: (0, import_css65.cx)((0, import_browser86.withVendorCSSClassPrefix)((0, import_browser86.bem)("key-value-input", "pair-input")), styles["pairInput"]),
|
|
16559
16634
|
"aria-label": "New value",
|
|
16560
16635
|
onKeyPress: (e) => {
|
|
16561
16636
|
if (e.key === "Enter" && !isAddDisabled) {
|
|
@@ -16570,15 +16645,15 @@ var KeyValueInput = ({
|
|
|
16570
16645
|
type: "button",
|
|
16571
16646
|
onClick: handleAddPair,
|
|
16572
16647
|
disabled: isAddDisabled,
|
|
16573
|
-
className: (0, import_css65.cx)((0,
|
|
16648
|
+
className: (0, import_css65.cx)((0, import_browser86.withVendorCSSClassPrefix)((0, import_browser86.bem)("key-value-input", "add-button")), styles["addButton"]),
|
|
16574
16649
|
"aria-label": "Add new key-value pair",
|
|
16575
16650
|
children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(Plus_default, { width: 16, height: 16 })
|
|
16576
16651
|
}
|
|
16577
16652
|
)
|
|
16578
16653
|
] })
|
|
16579
16654
|
] }),
|
|
16580
|
-
(helperText || error) && /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("div", { className: (0, import_css65.cx)((0,
|
|
16581
|
-
maxPairs && /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("div", { className: (0, import_css65.cx)((0,
|
|
16655
|
+
(helperText || error) && /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("div", { className: (0, import_css65.cx)((0, import_browser86.withVendorCSSClassPrefix)((0, import_browser86.bem)("key-value-input", "helper-text")), styles["helperText"]), children: error || helperText }),
|
|
16656
|
+
maxPairs && /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("div", { className: (0, import_css65.cx)((0, import_browser86.withVendorCSSClassPrefix)((0, import_browser86.bem)("key-value-input", "counter")), styles["counterText"]), children: [
|
|
16582
16657
|
pairs.length,
|
|
16583
16658
|
" of ",
|
|
16584
16659
|
maxPairs,
|
|
@@ -16624,13 +16699,13 @@ var BaseOrganizationProfile = ({
|
|
|
16624
16699
|
editable: false,
|
|
16625
16700
|
key: "created",
|
|
16626
16701
|
label: "Created Date",
|
|
16627
|
-
render: (value) => (0,
|
|
16702
|
+
render: (value) => (0, import_browser87.formatDate)(value)
|
|
16628
16703
|
},
|
|
16629
16704
|
{
|
|
16630
16705
|
editable: false,
|
|
16631
16706
|
key: "lastModified",
|
|
16632
16707
|
label: "Last Modified Date",
|
|
16633
|
-
render: (value) => (0,
|
|
16708
|
+
render: (value) => (0, import_browser87.formatDate)(value)
|
|
16634
16709
|
}
|
|
16635
16710
|
]
|
|
16636
16711
|
}) => {
|
|
@@ -16874,14 +16949,14 @@ var BaseOrganizationProfile = ({
|
|
|
16874
16949
|
var BaseOrganizationProfile_default = BaseOrganizationProfile;
|
|
16875
16950
|
|
|
16876
16951
|
// src/api/getOrganization.ts
|
|
16877
|
-
var
|
|
16952
|
+
var import_browser88 = require("@asgardeo/browser");
|
|
16878
16953
|
var getOrganization = async ({
|
|
16879
16954
|
fetcher,
|
|
16880
16955
|
instanceId = 0,
|
|
16881
16956
|
...requestConfig
|
|
16882
16957
|
}) => {
|
|
16883
16958
|
const defaultFetcher = async (url, config) => {
|
|
16884
|
-
const client =
|
|
16959
|
+
const client = import_browser88.AsgardeoSPAClient.getInstance(instanceId);
|
|
16885
16960
|
const httpClient = client.httpRequest.bind(client);
|
|
16886
16961
|
const response = await httpClient({
|
|
16887
16962
|
headers: config.headers,
|
|
@@ -16896,7 +16971,7 @@ var getOrganization = async ({
|
|
|
16896
16971
|
text: () => Promise.resolve(typeof response.data === "string" ? response.data : JSON.stringify(response.data))
|
|
16897
16972
|
};
|
|
16898
16973
|
};
|
|
16899
|
-
return (0,
|
|
16974
|
+
return (0, import_browser88.getOrganization)({
|
|
16900
16975
|
...requestConfig,
|
|
16901
16976
|
fetcher: fetcher || defaultFetcher
|
|
16902
16977
|
});
|
|
@@ -16904,14 +16979,14 @@ var getOrganization = async ({
|
|
|
16904
16979
|
var getOrganization_default = getOrganization;
|
|
16905
16980
|
|
|
16906
16981
|
// src/api/updateOrganization.ts
|
|
16907
|
-
var
|
|
16982
|
+
var import_browser89 = require("@asgardeo/browser");
|
|
16908
16983
|
var updateOrganization = async ({
|
|
16909
16984
|
fetcher,
|
|
16910
16985
|
instanceId = 0,
|
|
16911
16986
|
...requestConfig
|
|
16912
16987
|
}) => {
|
|
16913
16988
|
const defaultFetcher = async (url, config) => {
|
|
16914
|
-
const client =
|
|
16989
|
+
const client = import_browser89.AsgardeoSPAClient.getInstance(instanceId);
|
|
16915
16990
|
const httpClient = client.httpRequest.bind(client);
|
|
16916
16991
|
const response = await httpClient({
|
|
16917
16992
|
data: config.body ? JSON.parse(config.body) : void 0,
|
|
@@ -16927,7 +17002,7 @@ var updateOrganization = async ({
|
|
|
16927
17002
|
text: () => Promise.resolve(typeof response.data === "string" ? response.data : JSON.stringify(response.data))
|
|
16928
17003
|
};
|
|
16929
17004
|
};
|
|
16930
|
-
return (0,
|
|
17005
|
+
return (0, import_browser89.updateOrganization)({
|
|
16931
17006
|
...requestConfig,
|
|
16932
17007
|
fetcher: fetcher || defaultFetcher
|
|
16933
17008
|
});
|
|
@@ -16936,7 +17011,7 @@ var updateOrganization_default = updateOrganization;
|
|
|
16936
17011
|
|
|
16937
17012
|
// src/components/presentation/OrganizationProfile/OrganizationProfile.tsx
|
|
16938
17013
|
var import_jsx_runtime113 = require("react/jsx-runtime");
|
|
16939
|
-
var logger9 = (0,
|
|
17014
|
+
var logger9 = (0, import_browser90.createPackageComponentLogger)(
|
|
16940
17015
|
"@asgardeo/react",
|
|
16941
17016
|
"OrganizationProfile"
|
|
16942
17017
|
);
|
|
@@ -16977,7 +17052,7 @@ var OrganizationProfile = ({
|
|
|
16977
17052
|
const handleOrganizationUpdate = async (payload) => {
|
|
16978
17053
|
if (!baseUrl || !organizationId) return;
|
|
16979
17054
|
try {
|
|
16980
|
-
const operations = (0,
|
|
17055
|
+
const operations = (0, import_browser89.createPatchOperations)(payload);
|
|
16981
17056
|
await updateOrganization_default({
|
|
16982
17057
|
baseUrl,
|
|
16983
17058
|
instanceId,
|
|
@@ -17327,7 +17402,7 @@ var BaseLanguageSwitcher = ({
|
|
|
17327
17402
|
var BaseLanguageSwitcher_default = BaseLanguageSwitcher;
|
|
17328
17403
|
|
|
17329
17404
|
// src/components/presentation/LanguageSwitcher/LanguageSwitcher.tsx
|
|
17330
|
-
var
|
|
17405
|
+
var import_browser91 = require("@asgardeo/browser");
|
|
17331
17406
|
var import_react110 = require("react");
|
|
17332
17407
|
|
|
17333
17408
|
// src/contexts/FlowMeta/useFlowMeta.ts
|
|
@@ -17355,8 +17430,8 @@ var LanguageSwitcher = ({ children, className }) => {
|
|
|
17355
17430
|
() => effectiveLanguageCodes.map((code) => ({
|
|
17356
17431
|
code,
|
|
17357
17432
|
// Resolve each label in its own locale so option names stay stable across UI language switches.
|
|
17358
|
-
displayName: (0,
|
|
17359
|
-
emoji: (0,
|
|
17433
|
+
displayName: (0, import_browser91.resolveLocaleDisplayName)(code, code) || code,
|
|
17434
|
+
emoji: (0, import_browser91.resolveLocaleEmoji)(code)
|
|
17360
17435
|
})),
|
|
17361
17436
|
[effectiveLanguageCodes]
|
|
17362
17437
|
);
|
|
@@ -17380,5 +17455,5 @@ var LanguageSwitcher = ({ children, className }) => {
|
|
|
17380
17455
|
var LanguageSwitcher_default = LanguageSwitcher;
|
|
17381
17456
|
|
|
17382
17457
|
// src/index.ts
|
|
17383
|
-
var
|
|
17458
|
+
var import_browser92 = require("@asgardeo/browser");
|
|
17384
17459
|
//# sourceMappingURL=index.js.map
|