@asgardeo/react 0.23.7 → 0.24.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/dist/AsgardeoReactClient.d.ts +1 -0
  2. package/dist/AsgardeoReactClient.d.ts.map +1 -1
  3. package/dist/cjs/index.js +2025 -1060
  4. package/dist/cjs/index.js.map +4 -4
  5. package/dist/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.d.ts.map +1 -1
  6. package/dist/components/presentation/auth/AuthOptionFactory.d.ts +24 -1
  7. package/dist/components/presentation/auth/AuthOptionFactory.d.ts.map +1 -1
  8. package/dist/components/presentation/auth/Recovery/BaseRecovery.d.ts +24 -0
  9. package/dist/components/presentation/auth/Recovery/BaseRecovery.d.ts.map +1 -0
  10. package/dist/components/presentation/auth/Recovery/Recovery.d.ts +57 -0
  11. package/dist/components/presentation/auth/Recovery/Recovery.d.ts.map +1 -0
  12. package/dist/components/presentation/auth/Recovery/v1/BaseRecovery.d.ts +74 -0
  13. package/dist/components/presentation/auth/Recovery/v1/BaseRecovery.d.ts.map +1 -0
  14. package/dist/components/presentation/auth/Recovery/v1/Recovery.d.ts +26 -0
  15. package/dist/components/presentation/auth/Recovery/v1/Recovery.d.ts.map +1 -0
  16. package/dist/components/presentation/auth/Recovery/v1/RecoveryOptionFactory.d.ts +46 -0
  17. package/dist/components/presentation/auth/Recovery/v1/RecoveryOptionFactory.d.ts.map +1 -0
  18. package/dist/components/presentation/auth/Recovery/v2/BaseRecovery.d.ts +83 -0
  19. package/dist/components/presentation/auth/Recovery/v2/BaseRecovery.d.ts.map +1 -0
  20. package/dist/components/presentation/auth/Recovery/v2/Recovery.d.ts +56 -0
  21. package/dist/components/presentation/auth/Recovery/v2/Recovery.d.ts.map +1 -0
  22. package/dist/contexts/Asgardeo/AsgardeoContext.d.ts +4 -0
  23. package/dist/contexts/Asgardeo/AsgardeoContext.d.ts.map +1 -1
  24. package/dist/contexts/Asgardeo/AsgardeoProvider.d.ts.map +1 -1
  25. package/dist/contexts/ComponentRenderer/ComponentRendererContext.d.ts +1 -1
  26. package/dist/contexts/ComponentRenderer/ComponentRendererContext.d.ts.map +1 -1
  27. package/dist/index.d.ts +5 -1
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +1709 -733
  30. package/dist/index.js.map +4 -4
  31. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -45,6 +45,7 @@ var AsgardeoContext = createContext({
45
45
  organizationHandle: void 0,
46
46
  platform: void 0,
47
47
  reInitialize: null,
48
+ recover: () => Promise.resolve({}),
48
49
  resolveFlowTemplateLiterals: (text) => text ?? "",
49
50
  signIn: () => Promise.resolve({}),
50
51
  signInOptions: {},
@@ -77,6 +78,7 @@ import {
77
78
  Platform,
78
79
  isEmpty,
79
80
  executeEmbeddedSignUpFlowV2,
81
+ executeEmbeddedRecoveryFlowV2,
80
82
  EmbeddedSignInFlowStatusV2
81
83
  } from "@asgardeo/browser";
82
84
 
@@ -903,6 +905,18 @@ var AsgardeoReactClient = class extends AsgardeoBrowserClient {
903
905
  navigate(getRedirectBasedSignUpUrl(config));
904
906
  return void 0;
905
907
  }
908
+ async recover(payload) {
909
+ const config = await this.asgardeo.getConfigData();
910
+ const baseUrl = config?.baseUrl;
911
+ const isV2Platform = config && config.platform === Platform.AsgardeoV2;
912
+ if (isV2Platform) {
913
+ return executeEmbeddedRecoveryFlowV2({
914
+ baseUrl,
915
+ payload: { ...payload, verbose: true }
916
+ });
917
+ }
918
+ return void 0;
919
+ }
906
920
  async getDiscoveryResponse() {
907
921
  const storageManager = await this.asgardeo.getStorageManager();
908
922
  return storageManager.loadOpenIDProviderConfiguration();
@@ -2428,6 +2442,10 @@ var AsgardeoProvider = ({
2428
2442
  async (...args) => asgardeo.signOut(...args),
2429
2443
  [asgardeo]
2430
2444
  );
2445
+ const recover = useCallback8(
2446
+ async (payload) => asgardeo.recover(payload),
2447
+ [asgardeo]
2448
+ );
2431
2449
  const signUp = useCallback8(
2432
2450
  async (...args) => asgardeo.signUp(...args),
2433
2451
  [asgardeo]
@@ -2468,6 +2486,7 @@ var AsgardeoProvider = ({
2468
2486
  organizationHandle: config?.organizationHandle,
2469
2487
  platform: config?.platform,
2470
2488
  reInitialize,
2489
+ recover,
2471
2490
  signIn,
2472
2491
  signInOptions,
2473
2492
  signInSilently,
@@ -2500,17 +2519,18 @@ var AsgardeoProvider = ({
2500
2519
  syncSession,
2501
2520
  switchOrganization,
2502
2521
  getDecodedIdToken,
2522
+ clearSession,
2523
+ exchangeToken,
2503
2524
  getAccessToken,
2504
2525
  getStorageManager,
2526
+ instanceId,
2527
+ organizationChain,
2528
+ recover,
2529
+ reInitialize,
2505
2530
  request,
2506
2531
  requestAll,
2507
- exchangeToken,
2508
2532
  signOut,
2509
- signUp,
2510
- clearSession,
2511
- reInitialize,
2512
- instanceId,
2513
- organizationChain
2533
+ signUp
2514
2534
  ]
2515
2535
  );
2516
2536
  return /* @__PURE__ */ jsx11(AsgardeoContext_default.Provider, { value, children: /* @__PURE__ */ jsx11(I18nProvider_default, { preferences: preferences?.i18n, children: /* @__PURE__ */ jsx11(FlowMetaProvider_default, { enabled: preferences?.resolveFromMeta !== false, children: /* @__PURE__ */ jsx11(
@@ -9263,6 +9283,22 @@ var renderSignUpComponents = (components, formValues, touchedFields, formErrors,
9263
9283
  }
9264
9284
  )
9265
9285
  ).filter(Boolean);
9286
+ var renderRecoveryComponents = (components, formValues, touchedFields, formErrors, isLoading, isFormValid, onInputChange, options) => components.map(
9287
+ (component, index) => createAuthComponentFromFlow(
9288
+ component,
9289
+ formValues,
9290
+ touchedFields,
9291
+ formErrors,
9292
+ isLoading,
9293
+ isFormValid,
9294
+ onInputChange,
9295
+ "recovery",
9296
+ {
9297
+ ...options,
9298
+ key: component.id || index
9299
+ }
9300
+ )
9301
+ ).filter(Boolean);
9266
9302
  var renderInviteUserComponents = (components, formValues, touchedFields, formErrors, isLoading, isFormValid, onInputChange, options) => components.map(
9267
9303
  (component, index) => createAuthComponentFromFlow(
9268
9304
  component,
@@ -12283,180 +12319,1104 @@ var SignUp3 = (props) => {
12283
12319
  };
12284
12320
  var SignUp_default3 = SignUp3;
12285
12321
 
12286
- // src/components/presentation/auth/InviteUser/v2/InviteUser.tsx
12287
- import { EmbeddedFlowType as EmbeddedFlowType5, getOrganizationUnitChildren } from "@asgardeo/browser";
12288
- import { useCallback as useCallback17 } from "react";
12322
+ // src/components/presentation/auth/Recovery/BaseRecovery.tsx
12323
+ import { Platform as Platform9 } from "@asgardeo/browser";
12289
12324
 
12290
- // src/components/presentation/auth/InviteUser/v2/BaseInviteUser.tsx
12325
+ // src/components/presentation/auth/Recovery/v1/BaseRecovery.tsx
12291
12326
  import {
12292
- EmbeddedFlowType as EmbeddedFlowType4,
12293
- logger as logger10
12327
+ EmbeddedFlowStatus as EmbeddedFlowStatus3,
12328
+ EmbeddedFlowComponentType as EmbeddedFlowComponentType6,
12329
+ withVendorCSSClassPrefix as withVendorCSSClassPrefix25
12294
12330
  } from "@asgardeo/browser";
12295
12331
  import { cx as cx26 } from "@emotion/css";
12296
- import { useCallback as useCallback16, useContext as useContext13, useEffect as useEffect21, useRef as useRef10, useState as useState23 } from "react";
12332
+ import { useEffect as useEffect21, useState as useState23, useCallback as useCallback16, useRef as useRef10 } from "react";
12297
12333
 
12298
- // src/components/presentation/auth/InviteUser/v2/BaseInviteUser.styles.ts
12299
- import { css as css23 } from "@emotion/css";
12300
- import { useMemo as useMemo30 } from "react";
12301
- var useStyles22 = (theme, colorScheme) => useMemo30(() => {
12302
- const card = css23`
12303
- background: ${theme.vars.colors.background.surface};
12304
- border-radius: ${theme.vars.borderRadius.large};
12305
- gap: calc(${theme.vars.spacing.unit} * 2);
12306
- min-width: 420px;
12307
- font-family: ${theme.vars.typography.fontFamily};
12308
- `;
12309
- const header = css23`
12310
- gap: 0;
12311
- align-items: center;
12312
- `;
12313
- const title = css23`
12314
- margin: 0 0 calc(${theme.vars.spacing.unit} * 1) 0;
12315
- color: ${theme.vars.colors.text.primary};
12316
- `;
12317
- const subtitle = css23`
12318
- margin-bottom: calc(${theme.vars.spacing.unit} * 1);
12319
- color: ${theme.vars.colors.text.secondary};
12320
- `;
12321
- return {
12322
- card,
12323
- header,
12324
- subtitle,
12325
- title
12326
- };
12327
- }, [
12328
- theme.vars.colors.background.surface,
12329
- theme.vars.colors.text.primary,
12330
- theme.vars.colors.text.secondary,
12331
- theme.vars.borderRadius.large,
12332
- theme.vars.spacing.unit,
12333
- theme.vars.typography.fontFamily,
12334
- colorScheme
12335
- ]);
12336
- var BaseInviteUser_styles_default = useStyles22;
12334
+ // src/components/presentation/auth/Recovery/v1/RecoveryOptionFactory.tsx
12335
+ import { EmbeddedFlowComponentType as EmbeddedFlowComponentType5 } from "@asgardeo/browser";
12336
+ import { jsx as jsx87 } from "react/jsx-runtime";
12337
+ var createRecoveryComponent = ({ component, onSubmit, ...rest }) => {
12338
+ switch (component.type) {
12339
+ case EmbeddedFlowComponentType5.Typography:
12340
+ return /* @__PURE__ */ jsx87(Typography_default2, { component, onSubmit, ...rest });
12341
+ case EmbeddedFlowComponentType5.Input: {
12342
+ const inputVariant = component.variant?.toUpperCase();
12343
+ const inputType = component.config["type"]?.toLowerCase();
12344
+ if (inputVariant === "EMAIL" || inputType === "email") {
12345
+ return /* @__PURE__ */ jsx87(EmailInput_default, { component, onSubmit, ...rest });
12346
+ }
12347
+ if (inputVariant === "PASSWORD" || inputType === "password") {
12348
+ return /* @__PURE__ */ jsx87(PasswordInput_default, { component, onSubmit, ...rest });
12349
+ }
12350
+ if (inputVariant === "TELEPHONE" || inputType === "tel") {
12351
+ return /* @__PURE__ */ jsx87(TelephoneInput_default, { component, onSubmit, ...rest });
12352
+ }
12353
+ if (inputVariant === "NUMBER" || inputType === "number") {
12354
+ return /* @__PURE__ */ jsx87(NumberInput_default, { component, onSubmit, ...rest });
12355
+ }
12356
+ if (inputVariant === "DATE" || inputType === "date") {
12357
+ return /* @__PURE__ */ jsx87(DateInput_default, { component, onSubmit, ...rest });
12358
+ }
12359
+ if (inputVariant === "CHECKBOX" || inputType === "checkbox") {
12360
+ return /* @__PURE__ */ jsx87(CheckboxInput_default, { component, onSubmit, ...rest });
12361
+ }
12362
+ return /* @__PURE__ */ jsx87(TextInput_default, { component, onSubmit, ...rest });
12363
+ }
12364
+ case EmbeddedFlowComponentType5.Button: {
12365
+ const buttonVariant = component.variant?.toUpperCase();
12366
+ const buttonText = component.config["text"] || component.config["label"] || "";
12367
+ if (buttonVariant === "SOCIAL") {
12368
+ if (buttonText.toLowerCase().includes("google")) {
12369
+ return /* @__PURE__ */ jsx87(GoogleButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
12370
+ }
12371
+ if (buttonText.toLowerCase().includes("github")) {
12372
+ return /* @__PURE__ */ jsx87(GitHubButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
12373
+ }
12374
+ if (buttonText.toLowerCase().includes("microsoft")) {
12375
+ return /* @__PURE__ */ jsx87(MicrosoftButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
12376
+ }
12377
+ if (buttonText.toLowerCase().includes("facebook")) {
12378
+ return /* @__PURE__ */ jsx87(FacebookButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
12379
+ }
12380
+ if (buttonText.toLowerCase().includes("linkedin")) {
12381
+ return /* @__PURE__ */ jsx87(LinkedInButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
12382
+ }
12383
+ if (buttonText.toLowerCase().includes("ethereum")) {
12384
+ return /* @__PURE__ */ jsx87(SignInWithEthereumButton_default, { onClick: () => onSubmit(component, {}), ...rest, children: buttonText });
12385
+ }
12386
+ }
12387
+ return /* @__PURE__ */ jsx87(SubmitButton_default, { component, onSubmit, ...rest });
12388
+ }
12389
+ case EmbeddedFlowComponentType5.Form:
12390
+ return /* @__PURE__ */ jsx87(FormContainer_default, { component, onSubmit, ...rest });
12391
+ case EmbeddedFlowComponentType5.Select:
12392
+ return /* @__PURE__ */ jsx87(SelectInput_default, { component, onSubmit, ...rest });
12393
+ case EmbeddedFlowComponentType5.Divider:
12394
+ return /* @__PURE__ */ jsx87(DividerComponent_default, { component, onSubmit, ...rest });
12395
+ case EmbeddedFlowComponentType5.Image:
12396
+ return /* @__PURE__ */ jsx87(ImageComponent_default, { component, onSubmit, ...rest });
12397
+ default:
12398
+ return /* @__PURE__ */ jsx87("div", {});
12399
+ }
12400
+ };
12401
+ var createRecoveryOptionFromComponent = (component, formValues, touchedFields, formErrors, isLoading, isFormValid, onInputChange, options) => createRecoveryComponent({
12402
+ component,
12403
+ formErrors,
12404
+ formValues,
12405
+ isFormValid,
12406
+ isLoading,
12407
+ onInputChange,
12408
+ touchedFields,
12409
+ ...options
12410
+ });
12411
+ var renderRecoveryComponents2 = (components, formValues, touchedFields, formErrors, isLoading, isFormValid, onInputChange, options) => components.map(
12412
+ (component, index) => createRecoveryOptionFromComponent(
12413
+ component,
12414
+ formValues,
12415
+ touchedFields,
12416
+ formErrors,
12417
+ isLoading,
12418
+ isFormValid,
12419
+ onInputChange,
12420
+ {
12421
+ ...options,
12422
+ // Use component id as key, fallback to index
12423
+ key: component.id || index
12424
+ }
12425
+ )
12426
+ ).filter(Boolean);
12337
12427
 
12338
- // src/components/presentation/auth/InviteUser/v2/BaseInviteUser.tsx
12339
- import { jsx as jsx87, jsxs as jsxs37 } from "react/jsx-runtime";
12340
- var BaseInviteUser = ({
12428
+ // src/components/presentation/auth/Recovery/v1/BaseRecovery.tsx
12429
+ import { jsx as jsx88, jsxs as jsxs37 } from "react/jsx-runtime";
12430
+ var BaseRecoveryContent = ({
12341
12431
  onInitialize,
12342
12432
  onSubmit,
12343
12433
  onError,
12344
12434
  onFlowChange,
12435
+ onComplete,
12345
12436
  className = "",
12346
- children,
12347
- fetchOrganizationUnitChildren,
12348
- isInitialized = true,
12349
- preferences,
12437
+ inputClassName = "",
12438
+ buttonClassName = "",
12439
+ errorClassName = "",
12440
+ messageClassName = "",
12350
12441
  size = "medium",
12351
12442
  variant = "outlined",
12443
+ isInitialized,
12444
+ children,
12352
12445
  showTitle = true,
12353
12446
  showSubtitle = true
12354
12447
  }) => {
12355
- const { meta, isInitialized: isSdkInitialized, getStorageManager } = useAsgardeo_default();
12356
- const { t } = useTranslation_default(preferences?.i18n);
12357
- const { theme } = useTheme_default();
12358
- const customRenderers = useContext13(ComponentRendererContext_default);
12359
- const styles = BaseInviteUser_styles_default(theme, theme.vars.colors.text.primary);
12360
- const [isLoading, setIsLoading] = useState23(false);
12361
- const [isFlowInitialized, setIsFlowInitialized] = useState23(false);
12362
- const [currentFlow, setCurrentFlow] = useState23(null);
12363
- const [apiError, setApiError] = useState23(null);
12364
- const [formValues, setFormValues] = useState23({});
12365
- const [formErrors, setFormErrors] = useState23({});
12366
- const [touchedFields, setTouchedFields] = useState23({});
12367
- const [isFormValid, setIsFormValid] = useState23(true);
12368
- const challengeTokenRef = useRef10(null);
12369
- const initializationAttemptedRef = useRef10(false);
12370
- useEffect21(() => {
12371
- if (!isSdkInitialized) return;
12372
- (async () => {
12373
- try {
12374
- const storageManager = await getStorageManager();
12375
- const tempData = await storageManager?.getTemporaryData();
12376
- if (tempData?.challengeToken) {
12377
- challengeTokenRef.current = tempData.challengeToken;
12378
- }
12379
- } catch {
12380
- }
12381
- })();
12382
- }, [isSdkInitialized]);
12383
- const setChallengeToken = async (challengeToken) => {
12384
- challengeTokenRef.current = challengeToken;
12385
- try {
12386
- const storageManager = await getStorageManager();
12387
- if (storageManager) {
12388
- if (challengeToken) {
12389
- await storageManager.setTemporaryDataParameter("challengeToken", challengeToken);
12390
- } else {
12391
- await storageManager.removeTemporaryDataParameter("challengeToken");
12392
- }
12393
- }
12394
- } catch {
12395
- logger10.warn("Failed to persist challenge token in storage.");
12396
- }
12397
- };
12448
+ const { theme, colorScheme } = useTheme_default();
12449
+ const { t } = useTranslation_default();
12450
+ const { subtitle: flowSubtitle, title: flowTitle, messages: flowMessages, addMessage, clearMessages } = useFlow_default();
12451
+ useAsgardeo_default();
12452
+ const styles = BaseSignUp_styles_default(theme, colorScheme);
12398
12453
  const handleError = useCallback16(
12399
12454
  (error) => {
12400
- const errorMessage = error?.failureReason || extractErrorMessage(error, t, "components.inviteUser.errors.generic");
12401
- setApiError(error instanceof Error ? error : new Error(errorMessage));
12402
- onError?.(error instanceof Error ? error : new Error(errorMessage));
12403
- },
12404
- [t, onError]
12405
- );
12406
- const normalizeFlowResponseLocal = useCallback16(
12407
- (response) => {
12408
- if (!response?.data?.meta?.components) {
12409
- return response;
12410
- }
12411
- try {
12412
- const { components: components2 } = normalizeFlowResponse(
12413
- response,
12414
- t,
12415
- {
12416
- defaultErrorKey: "components.inviteUser.errors.generic",
12417
- resolveTranslations: false
12418
- },
12419
- meta
12420
- );
12421
- return {
12422
- ...response,
12423
- data: {
12424
- ...response.data,
12425
- components: components2
12455
+ let errorMessage = t("errors.recovery.flow.failure");
12456
+ if (error && typeof error === "object") {
12457
+ if (error.code && (error.message || error.description)) {
12458
+ errorMessage = error.description || error.message;
12459
+ } else if (error instanceof Error && error.name === "AsgardeoAPIError") {
12460
+ try {
12461
+ const errorResponse = JSON.parse(error.message);
12462
+ errorMessage = errorResponse.description || errorResponse.message || error.message;
12463
+ } catch {
12464
+ errorMessage = error.message;
12426
12465
  }
12427
- };
12428
- } catch {
12429
- return response;
12466
+ } else if (error.message) {
12467
+ errorMessage = error.message;
12468
+ }
12469
+ } else if (typeof error === "string") {
12470
+ errorMessage = error;
12430
12471
  }
12472
+ clearMessages();
12473
+ addMessage({ message: errorMessage, type: "error" });
12431
12474
  },
12432
- [t, children]
12475
+ [t, addMessage, clearMessages]
12433
12476
  );
12434
- const handleInputChange = useCallback16((name, value) => {
12435
- setFormValues((prev) => ({ ...prev, [name]: value }));
12436
- setFormErrors((prev) => {
12437
- const newErrors = { ...prev };
12438
- delete newErrors[name];
12439
- return newErrors;
12440
- });
12441
- }, []);
12442
- const handleInputBlur = useCallback16((name) => {
12443
- setTouchedFields((prev) => ({ ...prev, [name]: true }));
12444
- }, []);
12445
- const validateForm = useCallback16(
12446
- (components2) => {
12447
- const errors = {};
12448
- const validateComponents = (comps) => {
12449
- comps.forEach((comp) => {
12450
- if ((comp.type === "TEXT_INPUT" || comp.type === "EMAIL_INPUT" || comp.type === "SELECT" || comp.type === "PHONE_INPUT" || comp.type === "OTP_INPUT") && comp.required && comp.ref) {
12451
- const value = formValues[comp.ref];
12452
- if (!value || value.trim() === "") {
12453
- errors[comp.ref] = `${comp.label || comp.ref} is required`;
12454
- }
12455
- if (comp.type === "EMAIL_INPUT" && value && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value)) {
12456
- errors[comp.ref] = "Please enter a valid email address";
12457
- }
12458
- }
12459
- if (comp.components && Array.isArray(comp.components)) {
12477
+ const [isLoading, setIsLoading] = useState23(false);
12478
+ const [isFlowInitialized, setIsFlowInitialized] = useState23(false);
12479
+ const [currentFlow, setCurrentFlow] = useState23(null);
12480
+ const initializationAttemptedRef = useRef10(false);
12481
+ const extractFormFields = useCallback16(
12482
+ (components) => {
12483
+ const fields = [];
12484
+ const processComponents = (comps) => {
12485
+ comps.forEach((component) => {
12486
+ if (component.type === EmbeddedFlowComponentType6.Input) {
12487
+ const config = component.config || {};
12488
+ fields.push({
12489
+ initialValue: config.defaultValue || "",
12490
+ name: config.name || component.id,
12491
+ required: config.required || false,
12492
+ validator: (value) => {
12493
+ if (config.required && (!value || value.trim() === "")) {
12494
+ return t("validations.required.field.error");
12495
+ }
12496
+ if (config.type === "email" && value && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value)) {
12497
+ return t("field.email.invalid");
12498
+ }
12499
+ if (config.type === "password" && value && value.length < 8) {
12500
+ return t("field.password.weak");
12501
+ }
12502
+ return null;
12503
+ }
12504
+ });
12505
+ }
12506
+ if (component.components && Array.isArray(component.components)) {
12507
+ processComponents(component.components);
12508
+ }
12509
+ });
12510
+ };
12511
+ processComponents(components);
12512
+ return fields;
12513
+ },
12514
+ [t]
12515
+ );
12516
+ const formFields = currentFlow?.data?.components ? extractFormFields(currentFlow.data.components) : [];
12517
+ const form = useForm({
12518
+ fields: formFields,
12519
+ initialValues: {},
12520
+ requiredMessage: t("validations.required.field.error"),
12521
+ validateOnBlur: true,
12522
+ validateOnChange: true
12523
+ });
12524
+ const {
12525
+ values: formValues,
12526
+ touched: touchedFields,
12527
+ errors: formErrors,
12528
+ isValid: isFormValid,
12529
+ setValue: setFormValue,
12530
+ setTouched: setFormTouched,
12531
+ validateForm,
12532
+ touchAllFields,
12533
+ reset: resetForm
12534
+ } = form;
12535
+ const setupFormFields = useCallback16(
12536
+ (flowResponse) => {
12537
+ const fields = extractFormFields(flowResponse.data?.components || []);
12538
+ const initialValues = {};
12539
+ fields.forEach((field) => {
12540
+ initialValues[field.name] = field.initialValue || "";
12541
+ });
12542
+ resetForm();
12543
+ Object.keys(initialValues).forEach((key) => setFormValue(key, initialValues[key]));
12544
+ },
12545
+ [extractFormFields, resetForm, setFormValue]
12546
+ );
12547
+ const handleInputChange = useCallback16(
12548
+ (name, value) => {
12549
+ setFormValue(name, value);
12550
+ setFormTouched(name, true);
12551
+ },
12552
+ [setFormValue, setFormTouched]
12553
+ );
12554
+ const handleSubmit = async (component, data, skipValidation) => {
12555
+ if (!currentFlow) return;
12556
+ if (!skipValidation) {
12557
+ touchAllFields();
12558
+ const validation = validateForm();
12559
+ if (!validation.isValid) return;
12560
+ }
12561
+ setIsLoading(true);
12562
+ clearMessages();
12563
+ try {
12564
+ const filteredInputs = {};
12565
+ if (data) {
12566
+ Object.entries(data).forEach(([key, value]) => {
12567
+ if (value !== null && value !== void 0 && value !== "") {
12568
+ filteredInputs[key] = value;
12569
+ }
12570
+ });
12571
+ }
12572
+ const payload = {
12573
+ ...currentFlow.flowId && { flowId: currentFlow.flowId },
12574
+ flowType: currentFlow.flowType || "RECOVERY",
12575
+ inputs: filteredInputs,
12576
+ ...component.id && { actionId: component.id }
12577
+ };
12578
+ const response = await onSubmit?.(payload);
12579
+ if (!response) return;
12580
+ onFlowChange?.(response);
12581
+ if (response.flowStatus === EmbeddedFlowStatus3.Complete) {
12582
+ onComplete?.(response);
12583
+ return;
12584
+ }
12585
+ if (response.flowStatus === EmbeddedFlowStatus3.Incomplete) {
12586
+ setCurrentFlow(response);
12587
+ setupFormFields(response);
12588
+ }
12589
+ } catch (err) {
12590
+ handleError(err);
12591
+ onError?.(err);
12592
+ } finally {
12593
+ setIsLoading(false);
12594
+ }
12595
+ };
12596
+ const containerClasses = cx26(
12597
+ [
12598
+ withVendorCSSClassPrefix25("recovery"),
12599
+ withVendorCSSClassPrefix25(`recovery--${size}`),
12600
+ withVendorCSSClassPrefix25(`recovery--${variant}`)
12601
+ ],
12602
+ className
12603
+ );
12604
+ const inputClasses = cx26(
12605
+ [
12606
+ withVendorCSSClassPrefix25("recovery__input"),
12607
+ size === "small" && withVendorCSSClassPrefix25("recovery__input--small"),
12608
+ size === "large" && withVendorCSSClassPrefix25("recovery__input--large")
12609
+ ],
12610
+ inputClassName
12611
+ );
12612
+ const buttonClasses = cx26(
12613
+ [
12614
+ withVendorCSSClassPrefix25("recovery__button"),
12615
+ size === "small" && withVendorCSSClassPrefix25("recovery__button--small"),
12616
+ size === "large" && withVendorCSSClassPrefix25("recovery__button--large")
12617
+ ],
12618
+ buttonClassName
12619
+ );
12620
+ const errorClasses = cx26([withVendorCSSClassPrefix25("recovery__error")], errorClassName);
12621
+ const messageClasses = cx26([withVendorCSSClassPrefix25("recovery__messages")], messageClassName);
12622
+ const renderComponents = useCallback16(
12623
+ (components) => renderRecoveryComponents2(
12624
+ components,
12625
+ formValues,
12626
+ touchedFields,
12627
+ formErrors,
12628
+ isLoading,
12629
+ isFormValid,
12630
+ handleInputChange,
12631
+ {
12632
+ buttonClassName: buttonClasses,
12633
+ inputClassName: inputClasses,
12634
+ onSubmit: handleSubmit,
12635
+ size,
12636
+ variant
12637
+ }
12638
+ ),
12639
+ [
12640
+ buttonClasses,
12641
+ formErrors,
12642
+ formValues,
12643
+ handleInputChange,
12644
+ handleSubmit,
12645
+ inputClasses,
12646
+ isFormValid,
12647
+ isLoading,
12648
+ size,
12649
+ touchedFields,
12650
+ variant
12651
+ ]
12652
+ );
12653
+ useEffect21(() => {
12654
+ if (isInitialized && !isFlowInitialized && !initializationAttemptedRef.current) {
12655
+ initializationAttemptedRef.current = true;
12656
+ (async () => {
12657
+ setIsLoading(true);
12658
+ clearMessages();
12659
+ try {
12660
+ const response = await onInitialize();
12661
+ setCurrentFlow(response);
12662
+ setIsFlowInitialized(true);
12663
+ onFlowChange?.(response);
12664
+ if (response.flowStatus === EmbeddedFlowStatus3.Complete) {
12665
+ onComplete?.(response);
12666
+ return;
12667
+ }
12668
+ if (response.flowStatus === EmbeddedFlowStatus3.Incomplete) {
12669
+ setupFormFields(response);
12670
+ }
12671
+ } catch (err) {
12672
+ handleError(err);
12673
+ onError?.(err);
12674
+ } finally {
12675
+ setIsLoading(false);
12676
+ }
12677
+ })();
12678
+ }
12679
+ }, [
12680
+ clearMessages,
12681
+ handleError,
12682
+ isFlowInitialized,
12683
+ isInitialized,
12684
+ onComplete,
12685
+ onError,
12686
+ onFlowChange,
12687
+ onInitialize,
12688
+ setupFormFields
12689
+ ]);
12690
+ if (children) {
12691
+ return /* @__PURE__ */ jsx88("div", { className: containerClasses, children });
12692
+ }
12693
+ if (!isFlowInitialized && isLoading) {
12694
+ return /* @__PURE__ */ jsx88(Card_default, { className: cx26(containerClasses, styles.card), variant, children: /* @__PURE__ */ jsx88(Card_default.Content, { children: /* @__PURE__ */ jsx88("div", { className: styles.loadingContainer, children: /* @__PURE__ */ jsx88(Spinner_default, { size: "medium" }) }) }) });
12695
+ }
12696
+ if (!currentFlow) {
12697
+ return /* @__PURE__ */ jsx88(Card_default, { className: cx26(containerClasses, styles.card), variant, children: /* @__PURE__ */ jsx88(Card_default.Content, { children: /* @__PURE__ */ jsxs37(Alert_default, { variant: "error", className: errorClasses, children: [
12698
+ /* @__PURE__ */ jsx88(Alert_default.Title, { children: t("errors.heading") }),
12699
+ /* @__PURE__ */ jsx88(Alert_default.Description, { children: t("errors.recovery.flow.initialization.failure") })
12700
+ ] }) }) });
12701
+ }
12702
+ return /* @__PURE__ */ jsxs37(Card_default, { className: cx26(containerClasses, styles.card), variant, children: [
12703
+ (showTitle || showSubtitle) && /* @__PURE__ */ jsxs37(Card_default.Header, { className: styles.header, children: [
12704
+ showTitle && /* @__PURE__ */ jsx88(Card_default.Title, { level: 2, className: styles.title, children: flowTitle || t("recovery.heading") }),
12705
+ showSubtitle && /* @__PURE__ */ jsx88(Typography_default, { variant: "body1", className: styles.subtitle, children: flowSubtitle || t("recovery.subheading") })
12706
+ ] }),
12707
+ /* @__PURE__ */ jsxs37(Card_default.Content, { children: [
12708
+ flowMessages && flowMessages.length > 0 && /* @__PURE__ */ jsx88("div", { className: styles.flowMessagesContainer, children: flowMessages.map((message, index) => /* @__PURE__ */ jsx88(
12709
+ Alert_default,
12710
+ {
12711
+ variant: message.type?.toLowerCase() === "error" ? "error" : "info",
12712
+ className: cx26(styles.flowMessageItem, messageClasses),
12713
+ children: /* @__PURE__ */ jsx88(Alert_default.Description, { children: message.message })
12714
+ },
12715
+ message.id || index
12716
+ )) }),
12717
+ /* @__PURE__ */ jsx88("div", { className: styles.contentContainer, children: currentFlow.data?.components && currentFlow.data.components.length > 0 ? renderComponents(currentFlow.data.components) : /* @__PURE__ */ jsx88(Alert_default, { variant: "warning", children: /* @__PURE__ */ jsx88(Typography_default, { variant: "body1", children: t("errors.recovery.components.not.available") }) }) })
12718
+ ] })
12719
+ ] });
12720
+ };
12721
+ var BaseRecovery = ({
12722
+ showLogo = true,
12723
+ ...rest
12724
+ }) => {
12725
+ const { theme, colorScheme } = useTheme_default();
12726
+ const styles = BaseSignUp_styles_default(theme, colorScheme);
12727
+ return /* @__PURE__ */ jsxs37("div", { children: [
12728
+ showLogo && /* @__PURE__ */ jsx88("div", { className: styles.logoContainer, children: /* @__PURE__ */ jsx88(Logo_default, { size: "large" }) }),
12729
+ /* @__PURE__ */ jsx88(FlowProvider_default, { children: /* @__PURE__ */ jsx88(BaseRecoveryContent, { showLogo, ...rest }) })
12730
+ ] });
12731
+ };
12732
+ var BaseRecovery_default = BaseRecovery;
12733
+
12734
+ // src/components/presentation/auth/Recovery/v2/BaseRecovery.tsx
12735
+ import {
12736
+ EmbeddedFlowStatus as EmbeddedFlowStatus4,
12737
+ EmbeddedFlowComponentTypeV2 as EmbeddedFlowComponentType7,
12738
+ withVendorCSSClassPrefix as withVendorCSSClassPrefix26
12739
+ } from "@asgardeo/browser";
12740
+ import { cx as cx27 } from "@emotion/css";
12741
+ import { useContext as useContext13, useEffect as useEffect22, useState as useState24, useCallback as useCallback17, useRef as useRef11 } from "react";
12742
+ import { jsx as jsx89, jsxs as jsxs38 } from "react/jsx-runtime";
12743
+ var BaseRecoveryContent2 = ({
12744
+ onInitialize,
12745
+ onSubmit,
12746
+ onError,
12747
+ onFlowChange,
12748
+ onComplete,
12749
+ error: externalError,
12750
+ className = "",
12751
+ inputClassName = "",
12752
+ buttonClassName = "",
12753
+ errorClassName = "",
12754
+ messageClassName = "",
12755
+ size = "medium",
12756
+ variant = "outlined",
12757
+ isInitialized,
12758
+ children,
12759
+ showTitle = true,
12760
+ showSubtitle = true
12761
+ }) => {
12762
+ const { theme, colorScheme } = useTheme_default();
12763
+ const customRenderers = useContext13(ComponentRendererContext_default);
12764
+ const { t } = useTranslation_default();
12765
+ const { subtitle: flowSubtitle, title: flowTitle, messages: flowMessages, addMessage, clearMessages } = useFlow_default();
12766
+ const { meta } = useAsgardeo_default();
12767
+ const styles = BaseSignUp_styles_default(theme, colorScheme);
12768
+ const [isLoading, setIsLoading] = useState24(false);
12769
+ const [isFlowInitialized, setIsFlowInitialized] = useState24(false);
12770
+ const [currentFlow, setCurrentFlow] = useState24(null);
12771
+ const [apiError, setApiError] = useState24(null);
12772
+ const initializationAttemptedRef = useRef11(false);
12773
+ const challengeTokenRef = useRef11(null);
12774
+ const handleError = useCallback17(
12775
+ (error) => {
12776
+ const errorMessage = error?.failureReason || extractErrorMessage(error, t);
12777
+ setApiError(error instanceof Error ? error : new Error(errorMessage));
12778
+ clearMessages();
12779
+ addMessage({ message: errorMessage, type: "error" });
12780
+ },
12781
+ [t, addMessage, clearMessages]
12782
+ );
12783
+ const normalizeFlowResponseLocal = useCallback17(
12784
+ (response) => {
12785
+ if (response?.data?.components && Array.isArray(response.data.components)) {
12786
+ return response;
12787
+ }
12788
+ if (response?.data) {
12789
+ const { components } = normalizeFlowResponse(
12790
+ response,
12791
+ t,
12792
+ { defaultErrorKey: "components.recovery.errors.generic", resolveTranslations: false },
12793
+ meta
12794
+ );
12795
+ return { ...response, data: { ...response.data, components } };
12796
+ }
12797
+ return response;
12798
+ },
12799
+ [t, meta]
12800
+ );
12801
+ const extractFormFields = useCallback17(
12802
+ (components) => {
12803
+ const fields = [];
12804
+ const processComponents = (comps) => {
12805
+ comps.forEach((component) => {
12806
+ if (component.type === EmbeddedFlowComponentType7.TextInput || component.type === EmbeddedFlowComponentType7.PasswordInput || component.type === EmbeddedFlowComponentType7.EmailInput || component.type === EmbeddedFlowComponentType7.Select) {
12807
+ const fieldName = component.ref || component.id;
12808
+ fields.push({
12809
+ initialValue: "",
12810
+ name: fieldName,
12811
+ required: component.required || false,
12812
+ validator: (value) => {
12813
+ if (component.required && (!value || value.trim() === "")) {
12814
+ return t("validations.required.field.error");
12815
+ }
12816
+ if ((component.type === EmbeddedFlowComponentType7.EmailInput || component.variant === "EMAIL") && value && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value)) {
12817
+ return t("field.email.invalid");
12818
+ }
12819
+ return null;
12820
+ }
12821
+ });
12822
+ }
12823
+ if (component.components && Array.isArray(component.components)) {
12824
+ processComponents(component.components);
12825
+ }
12826
+ });
12827
+ };
12828
+ processComponents(components);
12829
+ return fields;
12830
+ },
12831
+ [t]
12832
+ );
12833
+ const formFields = currentFlow?.data?.components ? extractFormFields(currentFlow.data.components) : [];
12834
+ const form = useForm({
12835
+ fields: formFields,
12836
+ initialValues: {},
12837
+ requiredMessage: t("validations.required.field.error"),
12838
+ validateOnBlur: true,
12839
+ validateOnChange: false
12840
+ });
12841
+ const {
12842
+ values: formValues,
12843
+ touched: touchedFields,
12844
+ errors: formErrors,
12845
+ isValid: isFormValid,
12846
+ setValue: setFormValue,
12847
+ setTouched: setFormTouched,
12848
+ validateForm,
12849
+ touchAllFields,
12850
+ reset: resetForm
12851
+ } = form;
12852
+ const setupFormFields = useCallback17(
12853
+ (flowResponse) => {
12854
+ const fields = extractFormFields(flowResponse.data?.components || []);
12855
+ const initialValues = {};
12856
+ fields.forEach((field) => {
12857
+ initialValues[field.name] = field.initialValue || "";
12858
+ });
12859
+ resetForm();
12860
+ Object.keys(initialValues).forEach((key) => setFormValue(key, initialValues[key]));
12861
+ },
12862
+ [extractFormFields, resetForm, setFormValue]
12863
+ );
12864
+ const handleInputChange = (name, value) => {
12865
+ setFormValue(name, value);
12866
+ };
12867
+ const handleInputBlur = (name) => {
12868
+ setFormTouched(name, true);
12869
+ };
12870
+ const handleSubmit = async (component, data, skipValidation) => {
12871
+ if (!currentFlow) return;
12872
+ if (!skipValidation) {
12873
+ touchAllFields();
12874
+ const validation = validateForm();
12875
+ if (!validation.isValid) return;
12876
+ }
12877
+ setIsLoading(true);
12878
+ setApiError(null);
12879
+ clearMessages();
12880
+ try {
12881
+ const filteredInputs = {};
12882
+ if (data) {
12883
+ Object.entries(data).forEach(([key, value]) => {
12884
+ if (value !== null && value !== void 0 && value !== "") {
12885
+ filteredInputs[key] = value;
12886
+ }
12887
+ });
12888
+ }
12889
+ const payload = {
12890
+ ...currentFlow.executionId && { executionId: currentFlow.executionId },
12891
+ flowType: currentFlow.flowType || "RECOVERY",
12892
+ ...component.id && { action: component.id },
12893
+ ...challengeTokenRef.current ? { challengeToken: challengeTokenRef.current } : {},
12894
+ inputs: filteredInputs
12895
+ };
12896
+ const rawResponse = await onSubmit?.(payload);
12897
+ if (!rawResponse) return;
12898
+ const response = normalizeFlowResponseLocal(rawResponse);
12899
+ onFlowChange?.(response);
12900
+ if (response.challengeToken !== void 0) {
12901
+ challengeTokenRef.current = response.challengeToken ?? null;
12902
+ }
12903
+ if (response.flowStatus === EmbeddedFlowStatus4.Complete) {
12904
+ onComplete?.(response);
12905
+ return;
12906
+ }
12907
+ if (response.flowStatus === EmbeddedFlowStatus4.Incomplete) {
12908
+ setCurrentFlow(response);
12909
+ setupFormFields(response);
12910
+ }
12911
+ } catch (err) {
12912
+ handleError(err);
12913
+ onError?.(err);
12914
+ } finally {
12915
+ setIsLoading(false);
12916
+ }
12917
+ };
12918
+ const containerClasses = cx27(
12919
+ [
12920
+ withVendorCSSClassPrefix26("recovery"),
12921
+ withVendorCSSClassPrefix26(`recovery--${size}`),
12922
+ withVendorCSSClassPrefix26(`recovery--${variant}`)
12923
+ ],
12924
+ className
12925
+ );
12926
+ const inputClasses = cx27(
12927
+ [
12928
+ withVendorCSSClassPrefix26("recovery__input"),
12929
+ size === "small" && withVendorCSSClassPrefix26("recovery__input--small"),
12930
+ size === "large" && withVendorCSSClassPrefix26("recovery__input--large")
12931
+ ],
12932
+ inputClassName
12933
+ );
12934
+ const buttonClasses = cx27(
12935
+ [
12936
+ withVendorCSSClassPrefix26("recovery__button"),
12937
+ size === "small" && withVendorCSSClassPrefix26("recovery__button--small"),
12938
+ size === "large" && withVendorCSSClassPrefix26("recovery__button--large")
12939
+ ],
12940
+ buttonClassName
12941
+ );
12942
+ const errorClasses = cx27([withVendorCSSClassPrefix26("recovery__error")], errorClassName);
12943
+ const messageClasses = cx27([withVendorCSSClassPrefix26("recovery__messages")], messageClassName);
12944
+ const renderComponents = useCallback17(
12945
+ (components) => renderRecoveryComponents(
12946
+ components,
12947
+ formValues,
12948
+ touchedFields,
12949
+ formErrors,
12950
+ isLoading,
12951
+ isFormValid,
12952
+ handleInputChange,
12953
+ {
12954
+ _customRenderers: customRenderers,
12955
+ _theme: theme,
12956
+ buttonClassName: buttonClasses,
12957
+ inputClassName: inputClasses,
12958
+ meta,
12959
+ onInputBlur: handleInputBlur,
12960
+ onSubmit: handleSubmit,
12961
+ size,
12962
+ variant
12963
+ }
12964
+ ),
12965
+ [
12966
+ customRenderers,
12967
+ buttonClasses,
12968
+ formErrors,
12969
+ formValues,
12970
+ handleInputBlur,
12971
+ handleSubmit,
12972
+ inputClasses,
12973
+ isFormValid,
12974
+ meta,
12975
+ isLoading,
12976
+ size,
12977
+ theme,
12978
+ touchedFields,
12979
+ variant
12980
+ ]
12981
+ );
12982
+ useEffect22(() => {
12983
+ if (isInitialized && !isFlowInitialized && !initializationAttemptedRef.current) {
12984
+ initializationAttemptedRef.current = true;
12985
+ (async () => {
12986
+ setIsLoading(true);
12987
+ setApiError(null);
12988
+ clearMessages();
12989
+ try {
12990
+ const rawResponse = await onInitialize?.();
12991
+ if (!rawResponse) return;
12992
+ const response = normalizeFlowResponseLocal(rawResponse);
12993
+ if (response.challengeToken !== void 0) {
12994
+ challengeTokenRef.current = response.challengeToken ?? null;
12995
+ }
12996
+ setCurrentFlow(response);
12997
+ setIsFlowInitialized(true);
12998
+ onFlowChange?.(response);
12999
+ if (response.flowStatus === EmbeddedFlowStatus4.Complete) {
13000
+ onComplete?.(response);
13001
+ return;
13002
+ }
13003
+ if (response.flowStatus === EmbeddedFlowStatus4.Incomplete) {
13004
+ setupFormFields(response);
13005
+ }
13006
+ } catch (err) {
13007
+ handleError(err);
13008
+ onError?.(err);
13009
+ } finally {
13010
+ setIsLoading(false);
13011
+ }
13012
+ })();
13013
+ }
13014
+ }, [
13015
+ isFlowInitialized,
13016
+ isInitialized,
13017
+ normalizeFlowResponseLocal,
13018
+ onComplete,
13019
+ onError,
13020
+ onFlowChange,
13021
+ onInitialize,
13022
+ setupFormFields,
13023
+ t
13024
+ ]);
13025
+ if (children) {
13026
+ if (typeof children === "function") {
13027
+ const renderProps = {
13028
+ components: currentFlow?.data?.components || [],
13029
+ error: apiError,
13030
+ fieldErrors: formErrors,
13031
+ handleInputChange,
13032
+ handleSubmit,
13033
+ isLoading,
13034
+ isValid: isFormValid,
13035
+ messages: flowMessages || [],
13036
+ meta,
13037
+ subtitle: flowSubtitle || t("recovery.subheading"),
13038
+ title: flowTitle || t("recovery.heading"),
13039
+ touched: touchedFields,
13040
+ validateForm: () => {
13041
+ const result = validateForm();
13042
+ return { fieldErrors: result.errors, isValid: result.isValid };
13043
+ },
13044
+ values: formValues
13045
+ };
13046
+ return /* @__PURE__ */ jsx89("div", { className: containerClasses, children: children(renderProps) });
13047
+ }
13048
+ return /* @__PURE__ */ jsx89("div", { className: containerClasses, children });
13049
+ }
13050
+ if (!isFlowInitialized && isLoading) {
13051
+ return /* @__PURE__ */ jsx89(Card_default, { className: cx27(containerClasses, styles.card), variant, children: /* @__PURE__ */ jsx89(Card_default.Content, { children: /* @__PURE__ */ jsx89("div", { className: styles.loadingContainer, children: /* @__PURE__ */ jsx89(Spinner_default, { size: "medium" }) }) }) });
13052
+ }
13053
+ if (!currentFlow) {
13054
+ return /* @__PURE__ */ jsx89(Card_default, { className: cx27(containerClasses, styles.card), variant, children: /* @__PURE__ */ jsx89(Card_default.Content, { children: /* @__PURE__ */ jsxs38(Alert_default, { variant: "error", className: errorClasses, children: [
13055
+ /* @__PURE__ */ jsx89(Alert_default.Title, { children: t("errors.heading") }),
13056
+ /* @__PURE__ */ jsx89(Alert_default.Description, { children: t("errors.recovery.flow.initialization.failure") })
13057
+ ] }) }) });
13058
+ }
13059
+ const componentsToRender = currentFlow.data?.components || [];
13060
+ const { title, subtitle, componentsWithoutHeadings } = getAuthComponentHeadings_default(
13061
+ componentsToRender,
13062
+ flowTitle,
13063
+ flowSubtitle,
13064
+ t("recovery.heading"),
13065
+ t("recovery.subheading")
13066
+ );
13067
+ return /* @__PURE__ */ jsxs38(Card_default, { className: cx27(containerClasses, styles.card), variant, children: [
13068
+ (showTitle || showSubtitle) && /* @__PURE__ */ jsxs38(Card_default.Header, { className: styles.header, children: [
13069
+ showTitle && /* @__PURE__ */ jsx89(Card_default.Title, { level: 2, className: styles.title, children: title }),
13070
+ showSubtitle && /* @__PURE__ */ jsx89(Typography_default, { variant: "body1", className: styles.subtitle, children: subtitle })
13071
+ ] }),
13072
+ /* @__PURE__ */ jsxs38(Card_default.Content, { children: [
13073
+ externalError && /* @__PURE__ */ jsx89("div", { className: styles.flowMessagesContainer, children: /* @__PURE__ */ jsx89(Alert_default, { variant: "error", className: cx27(styles.flowMessageItem, messageClasses), children: /* @__PURE__ */ jsx89(Alert_default.Description, { children: externalError.message }) }) }),
13074
+ flowMessages && flowMessages.length > 0 && /* @__PURE__ */ jsx89("div", { className: styles.flowMessagesContainer, children: flowMessages.map((message, index) => /* @__PURE__ */ jsx89(
13075
+ Alert_default,
13076
+ {
13077
+ variant: message.type?.toLowerCase() === "error" ? "error" : "info",
13078
+ className: cx27(styles.flowMessageItem, messageClasses),
13079
+ children: /* @__PURE__ */ jsx89(Alert_default.Description, { children: message.message })
13080
+ },
13081
+ message.id || index
13082
+ )) }),
13083
+ /* @__PURE__ */ jsx89("div", { className: styles.contentContainer, children: componentsWithoutHeadings && componentsWithoutHeadings.length > 0 ? renderComponents(componentsWithoutHeadings) : /* @__PURE__ */ jsx89(Alert_default, { variant: "warning", children: /* @__PURE__ */ jsx89(Typography_default, { variant: "body1", children: t("errors.recovery.components.not.available") }) }) })
13084
+ ] })
13085
+ ] });
13086
+ };
13087
+ var BaseRecovery2 = ({
13088
+ preferences,
13089
+ showLogo = true,
13090
+ ...rest
13091
+ }) => {
13092
+ const { theme, colorScheme } = useTheme_default();
13093
+ const styles = BaseSignUp_styles_default(theme, colorScheme);
13094
+ const content = /* @__PURE__ */ jsxs38("div", { children: [
13095
+ showLogo && /* @__PURE__ */ jsx89("div", { className: styles.logoContainer, children: /* @__PURE__ */ jsx89(Logo_default, { size: "large" }) }),
13096
+ /* @__PURE__ */ jsx89(FlowProvider_default, { children: /* @__PURE__ */ jsx89(BaseRecoveryContent2, { showLogo, ...rest }) })
13097
+ ] });
13098
+ if (!preferences) return content;
13099
+ return /* @__PURE__ */ jsx89(ComponentPreferencesContext_default.Provider, { value: preferences, children: content });
13100
+ };
13101
+ var BaseRecovery_default2 = BaseRecovery2;
13102
+
13103
+ // src/components/presentation/auth/Recovery/BaseRecovery.tsx
13104
+ import { jsx as jsx90 } from "react/jsx-runtime";
13105
+ var BaseRecovery3 = (props) => {
13106
+ const { platform } = useAsgardeo_default();
13107
+ if (platform === Platform9.AsgardeoV2) {
13108
+ return /* @__PURE__ */ jsx90(BaseRecovery_default2, { ...props });
13109
+ }
13110
+ return /* @__PURE__ */ jsx90(BaseRecovery_default, { ...props });
13111
+ };
13112
+ var BaseRecovery_default3 = BaseRecovery3;
13113
+
13114
+ // src/components/presentation/auth/Recovery/Recovery.tsx
13115
+ import { Platform as Platform10 } from "@asgardeo/browser";
13116
+
13117
+ // src/components/presentation/auth/Recovery/v1/Recovery.tsx
13118
+ import { EmbeddedFlowType as EmbeddedFlowType4 } from "@asgardeo/browser";
13119
+ import { jsx as jsx91 } from "react/jsx-runtime";
13120
+ var Recovery = ({
13121
+ className,
13122
+ size = "medium",
13123
+ afterRecoveryUrl,
13124
+ onError,
13125
+ onComplete,
13126
+ children,
13127
+ ...rest
13128
+ }) => {
13129
+ const { recover, isInitialized } = useAsgardeo_default();
13130
+ const handleInitialize = async (payload) => {
13131
+ const initialPayload = payload || { flowType: EmbeddedFlowType4.Recovery };
13132
+ return await recover(initialPayload);
13133
+ };
13134
+ const handleOnSubmit = async (payload) => await recover(payload);
13135
+ const handleComplete = (response) => {
13136
+ onComplete?.(response);
13137
+ if (afterRecoveryUrl) {
13138
+ window.location.href = afterRecoveryUrl;
13139
+ }
13140
+ };
13141
+ return /* @__PURE__ */ jsx91(
13142
+ BaseRecovery_default,
13143
+ {
13144
+ afterRecoveryUrl,
13145
+ onInitialize: handleInitialize,
13146
+ onSubmit: handleOnSubmit,
13147
+ onError,
13148
+ onComplete: handleComplete,
13149
+ className,
13150
+ size,
13151
+ isInitialized,
13152
+ showLogo: true,
13153
+ showTitle: false,
13154
+ showSubtitle: false,
13155
+ children,
13156
+ ...rest
13157
+ }
13158
+ );
13159
+ };
13160
+ var Recovery_default = Recovery;
13161
+
13162
+ // src/components/presentation/auth/Recovery/v2/Recovery.tsx
13163
+ import { EmbeddedFlowType as EmbeddedFlowType5 } from "@asgardeo/browser";
13164
+ import { useCallback as useCallback18 } from "react";
13165
+ import { jsx as jsx92 } from "react/jsx-runtime";
13166
+ var Recovery2 = ({
13167
+ className,
13168
+ size = "medium",
13169
+ afterRecoveryUrl,
13170
+ onError,
13171
+ onComplete,
13172
+ tokenUrlParam,
13173
+ children,
13174
+ ...rest
13175
+ }) => {
13176
+ const { recover, isInitialized, applicationId } = useAsgardeo_default();
13177
+ const handleInitialize = useCallback18(
13178
+ async (payload) => {
13179
+ const urlParams = new URL(window.location.href).searchParams;
13180
+ const applicationIdFromUrl = urlParams.get("applicationId");
13181
+ const effectiveApplicationId = applicationId ?? applicationIdFromUrl;
13182
+ if (tokenUrlParam) {
13183
+ const executionId = urlParams.get("executionId");
13184
+ const tokenValue = urlParams.get(tokenUrlParam);
13185
+ if (executionId && tokenValue) {
13186
+ const resumePayload = {
13187
+ executionId,
13188
+ inputs: { [tokenUrlParam]: tokenValue },
13189
+ verbose: true
13190
+ };
13191
+ return await recover(resumePayload);
13192
+ }
13193
+ }
13194
+ const initialPayload = payload || {
13195
+ flowType: EmbeddedFlowType5.Recovery,
13196
+ ...effectiveApplicationId && { applicationId: effectiveApplicationId }
13197
+ };
13198
+ return await recover(initialPayload);
13199
+ },
13200
+ [applicationId, tokenUrlParam, recover]
13201
+ );
13202
+ const handleOnSubmit = useCallback18(
13203
+ async (payload) => await recover(payload),
13204
+ [recover]
13205
+ );
13206
+ const handleComplete = useCallback18(
13207
+ (response) => {
13208
+ onComplete?.(response);
13209
+ if (afterRecoveryUrl) {
13210
+ window.location.href = afterRecoveryUrl;
13211
+ }
13212
+ },
13213
+ [onComplete, afterRecoveryUrl]
13214
+ );
13215
+ return /* @__PURE__ */ jsx92(
13216
+ BaseRecovery_default2,
13217
+ {
13218
+ afterRecoveryUrl,
13219
+ onInitialize: handleInitialize,
13220
+ onSubmit: handleOnSubmit,
13221
+ onError,
13222
+ onComplete: handleComplete,
13223
+ className,
13224
+ size,
13225
+ isInitialized,
13226
+ showTitle: true,
13227
+ showSubtitle: true,
13228
+ children,
13229
+ ...rest
13230
+ }
13231
+ );
13232
+ };
13233
+ var Recovery_default2 = Recovery2;
13234
+
13235
+ // src/components/presentation/auth/Recovery/Recovery.tsx
13236
+ import { jsx as jsx93 } from "react/jsx-runtime";
13237
+ var Recovery3 = (props) => {
13238
+ const { platform } = useAsgardeo_default();
13239
+ if (platform === Platform10.AsgardeoV2) {
13240
+ return /* @__PURE__ */ jsx93(Recovery_default2, { ...props });
13241
+ }
13242
+ return /* @__PURE__ */ jsx93(Recovery_default, { ...props });
13243
+ };
13244
+ var Recovery_default3 = Recovery3;
13245
+
13246
+ // src/components/presentation/auth/InviteUser/v2/InviteUser.tsx
13247
+ import { EmbeddedFlowType as EmbeddedFlowType7, getOrganizationUnitChildren } from "@asgardeo/browser";
13248
+ import { useCallback as useCallback20 } from "react";
13249
+
13250
+ // src/components/presentation/auth/InviteUser/v2/BaseInviteUser.tsx
13251
+ import {
13252
+ EmbeddedFlowType as EmbeddedFlowType6,
13253
+ logger as logger10
13254
+ } from "@asgardeo/browser";
13255
+ import { cx as cx28 } from "@emotion/css";
13256
+ import { useCallback as useCallback19, useContext as useContext14, useEffect as useEffect23, useRef as useRef12, useState as useState25 } from "react";
13257
+
13258
+ // src/components/presentation/auth/InviteUser/v2/BaseInviteUser.styles.ts
13259
+ import { css as css23 } from "@emotion/css";
13260
+ import { useMemo as useMemo30 } from "react";
13261
+ var useStyles22 = (theme, colorScheme) => useMemo30(() => {
13262
+ const card = css23`
13263
+ background: ${theme.vars.colors.background.surface};
13264
+ border-radius: ${theme.vars.borderRadius.large};
13265
+ gap: calc(${theme.vars.spacing.unit} * 2);
13266
+ min-width: 420px;
13267
+ font-family: ${theme.vars.typography.fontFamily};
13268
+ `;
13269
+ const header = css23`
13270
+ gap: 0;
13271
+ align-items: center;
13272
+ `;
13273
+ const title = css23`
13274
+ margin: 0 0 calc(${theme.vars.spacing.unit} * 1) 0;
13275
+ color: ${theme.vars.colors.text.primary};
13276
+ `;
13277
+ const subtitle = css23`
13278
+ margin-bottom: calc(${theme.vars.spacing.unit} * 1);
13279
+ color: ${theme.vars.colors.text.secondary};
13280
+ `;
13281
+ return {
13282
+ card,
13283
+ header,
13284
+ subtitle,
13285
+ title
13286
+ };
13287
+ }, [
13288
+ theme.vars.colors.background.surface,
13289
+ theme.vars.colors.text.primary,
13290
+ theme.vars.colors.text.secondary,
13291
+ theme.vars.borderRadius.large,
13292
+ theme.vars.spacing.unit,
13293
+ theme.vars.typography.fontFamily,
13294
+ colorScheme
13295
+ ]);
13296
+ var BaseInviteUser_styles_default = useStyles22;
13297
+
13298
+ // src/components/presentation/auth/InviteUser/v2/BaseInviteUser.tsx
13299
+ import { jsx as jsx94, jsxs as jsxs39 } from "react/jsx-runtime";
13300
+ var BaseInviteUser = ({
13301
+ onInitialize,
13302
+ onSubmit,
13303
+ onError,
13304
+ onFlowChange,
13305
+ className = "",
13306
+ children,
13307
+ fetchOrganizationUnitChildren,
13308
+ isInitialized = true,
13309
+ preferences,
13310
+ size = "medium",
13311
+ variant = "outlined",
13312
+ showTitle = true,
13313
+ showSubtitle = true
13314
+ }) => {
13315
+ const { meta, isInitialized: isSdkInitialized, getStorageManager } = useAsgardeo_default();
13316
+ const { t } = useTranslation_default(preferences?.i18n);
13317
+ const { theme } = useTheme_default();
13318
+ const customRenderers = useContext14(ComponentRendererContext_default);
13319
+ const styles = BaseInviteUser_styles_default(theme, theme.vars.colors.text.primary);
13320
+ const [isLoading, setIsLoading] = useState25(false);
13321
+ const [isFlowInitialized, setIsFlowInitialized] = useState25(false);
13322
+ const [currentFlow, setCurrentFlow] = useState25(null);
13323
+ const [apiError, setApiError] = useState25(null);
13324
+ const [formValues, setFormValues] = useState25({});
13325
+ const [formErrors, setFormErrors] = useState25({});
13326
+ const [touchedFields, setTouchedFields] = useState25({});
13327
+ const [isFormValid, setIsFormValid] = useState25(true);
13328
+ const challengeTokenRef = useRef12(null);
13329
+ const initializationAttemptedRef = useRef12(false);
13330
+ useEffect23(() => {
13331
+ if (!isSdkInitialized) return;
13332
+ (async () => {
13333
+ try {
13334
+ const storageManager = await getStorageManager();
13335
+ const tempData = await storageManager?.getTemporaryData();
13336
+ if (tempData?.challengeToken) {
13337
+ challengeTokenRef.current = tempData.challengeToken;
13338
+ }
13339
+ } catch {
13340
+ }
13341
+ })();
13342
+ }, [isSdkInitialized]);
13343
+ const setChallengeToken = async (challengeToken) => {
13344
+ challengeTokenRef.current = challengeToken;
13345
+ try {
13346
+ const storageManager = await getStorageManager();
13347
+ if (storageManager) {
13348
+ if (challengeToken) {
13349
+ await storageManager.setTemporaryDataParameter("challengeToken", challengeToken);
13350
+ } else {
13351
+ await storageManager.removeTemporaryDataParameter("challengeToken");
13352
+ }
13353
+ }
13354
+ } catch {
13355
+ logger10.warn("Failed to persist challenge token in storage.");
13356
+ }
13357
+ };
13358
+ const handleError = useCallback19(
13359
+ (error) => {
13360
+ const errorMessage = error?.failureReason || extractErrorMessage(error, t, "components.inviteUser.errors.generic");
13361
+ setApiError(error instanceof Error ? error : new Error(errorMessage));
13362
+ onError?.(error instanceof Error ? error : new Error(errorMessage));
13363
+ },
13364
+ [t, onError]
13365
+ );
13366
+ const normalizeFlowResponseLocal = useCallback19(
13367
+ (response) => {
13368
+ if (!response?.data?.meta?.components) {
13369
+ return response;
13370
+ }
13371
+ try {
13372
+ const { components: components2 } = normalizeFlowResponse(
13373
+ response,
13374
+ t,
13375
+ {
13376
+ defaultErrorKey: "components.inviteUser.errors.generic",
13377
+ resolveTranslations: false
13378
+ },
13379
+ meta
13380
+ );
13381
+ return {
13382
+ ...response,
13383
+ data: {
13384
+ ...response.data,
13385
+ components: components2
13386
+ }
13387
+ };
13388
+ } catch {
13389
+ return response;
13390
+ }
13391
+ },
13392
+ [t, children]
13393
+ );
13394
+ const handleInputChange = useCallback19((name, value) => {
13395
+ setFormValues((prev) => ({ ...prev, [name]: value }));
13396
+ setFormErrors((prev) => {
13397
+ const newErrors = { ...prev };
13398
+ delete newErrors[name];
13399
+ return newErrors;
13400
+ });
13401
+ }, []);
13402
+ const handleInputBlur = useCallback19((name) => {
13403
+ setTouchedFields((prev) => ({ ...prev, [name]: true }));
13404
+ }, []);
13405
+ const validateForm = useCallback19(
13406
+ (components2) => {
13407
+ const errors = {};
13408
+ const validateComponents = (comps) => {
13409
+ comps.forEach((comp) => {
13410
+ if ((comp.type === "TEXT_INPUT" || comp.type === "EMAIL_INPUT" || comp.type === "SELECT" || comp.type === "PHONE_INPUT" || comp.type === "OTP_INPUT") && comp.required && comp.ref) {
13411
+ const value = formValues[comp.ref];
13412
+ if (!value || value.trim() === "") {
13413
+ errors[comp.ref] = `${comp.label || comp.ref} is required`;
13414
+ }
13415
+ if (comp.type === "EMAIL_INPUT" && value && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value)) {
13416
+ errors[comp.ref] = "Please enter a valid email address";
13417
+ }
13418
+ }
13419
+ if (comp.components && Array.isArray(comp.components)) {
12460
13420
  validateComponents(comp.components);
12461
13421
  }
12462
13422
  });
@@ -12466,7 +13426,7 @@ var BaseInviteUser = ({
12466
13426
  },
12467
13427
  [formValues]
12468
13428
  );
12469
- const handleSubmit = useCallback16(
13429
+ const handleSubmit = useCallback19(
12470
13430
  async (component, data) => {
12471
13431
  if (!currentFlow) {
12472
13432
  return;
@@ -12517,7 +13477,7 @@ var BaseInviteUser = ({
12517
13477
  },
12518
13478
  [currentFlow, formValues, validateForm, onSubmit, onFlowChange, handleError, normalizeFlowResponseLocal]
12519
13479
  );
12520
- const resetFlow = useCallback16(() => {
13480
+ const resetFlow = useCallback19(() => {
12521
13481
  setIsFlowInitialized(false);
12522
13482
  setCurrentFlow(null);
12523
13483
  setApiError(null);
@@ -12526,7 +13486,7 @@ var BaseInviteUser = ({
12526
13486
  setTouchedFields({});
12527
13487
  initializationAttemptedRef.current = false;
12528
13488
  }, []);
12529
- useEffect21(() => {
13489
+ useEffect23(() => {
12530
13490
  if (isInitialized && !isFlowInitialized && !initializationAttemptedRef.current) {
12531
13491
  initializationAttemptedRef.current = true;
12532
13492
  (async () => {
@@ -12534,7 +13494,7 @@ var BaseInviteUser = ({
12534
13494
  setApiError(null);
12535
13495
  try {
12536
13496
  const payload = {
12537
- flowType: EmbeddedFlowType4.UserOnboarding,
13497
+ flowType: EmbeddedFlowType6.UserOnboarding,
12538
13498
  verbose: true
12539
13499
  };
12540
13500
  const rawResponse = await onInitialize(payload);
@@ -12554,7 +13514,7 @@ var BaseInviteUser = ({
12554
13514
  })();
12555
13515
  }
12556
13516
  }, [isInitialized, isFlowInitialized, onInitialize, onFlowChange, handleError, normalizeFlowResponseLocal]);
12557
- useEffect21(() => {
13517
+ useEffect23(() => {
12558
13518
  if (currentFlow && isFlowInitialized) {
12559
13519
  const components2 = currentFlow.data?.components || [];
12560
13520
  if (components2.length > 0) {
@@ -12563,7 +13523,7 @@ var BaseInviteUser = ({
12563
13523
  }
12564
13524
  }
12565
13525
  }, [formValues, currentFlow, isFlowInitialized, validateForm]);
12566
- const extractHeadings = useCallback16((components2) => {
13526
+ const extractHeadings = useCallback19((components2) => {
12567
13527
  let title2;
12568
13528
  let subtitle2;
12569
13529
  components2.forEach((comp) => {
@@ -12577,13 +13537,13 @@ var BaseInviteUser = ({
12577
13537
  });
12578
13538
  return { subtitle: subtitle2, title: title2 };
12579
13539
  }, []);
12580
- const filterHeadings = useCallback16(
13540
+ const filterHeadings = useCallback19(
12581
13541
  (components2) => components2.filter(
12582
13542
  (comp) => !(comp.type === "TEXT" && (comp.variant === "HEADING_1" || comp.variant === "HEADING_2"))
12583
13543
  ),
12584
13544
  []
12585
13545
  );
12586
- const renderComponents = useCallback16(
13546
+ const renderComponents = useCallback19(
12587
13547
  (components2) => renderInviteUserComponents(
12588
13548
  components2,
12589
13549
  formValues,
@@ -12642,30 +13602,30 @@ var BaseInviteUser = ({
12642
13602
  values: formValues
12643
13603
  };
12644
13604
  if (children) {
12645
- return /* @__PURE__ */ jsx87("div", { className, children: children(renderProps) });
13605
+ return /* @__PURE__ */ jsx94("div", { className, children: children(renderProps) });
12646
13606
  }
12647
13607
  if (!isInitialized) {
12648
- return /* @__PURE__ */ jsx87(Card_default, { className: cx26(className, styles.card), variant, children: /* @__PURE__ */ jsx87(Card_default.Content, { children: /* @__PURE__ */ jsx87("div", { style: { display: "flex", justifyContent: "center", padding: "2rem" }, children: /* @__PURE__ */ jsx87(Spinner_default, { size: "medium" }) }) }) });
13608
+ return /* @__PURE__ */ jsx94(Card_default, { className: cx28(className, styles.card), variant, children: /* @__PURE__ */ jsx94(Card_default.Content, { children: /* @__PURE__ */ jsx94("div", { style: { display: "flex", justifyContent: "center", padding: "2rem" }, children: /* @__PURE__ */ jsx94(Spinner_default, { size: "medium" }) }) }) });
12649
13609
  }
12650
13610
  if (!isFlowInitialized && isLoading) {
12651
- return /* @__PURE__ */ jsx87(Card_default, { className: cx26(className, styles.card), variant, children: /* @__PURE__ */ jsx87(Card_default.Content, { children: /* @__PURE__ */ jsx87("div", { style: { display: "flex", justifyContent: "center", padding: "2rem" }, children: /* @__PURE__ */ jsx87(Spinner_default, { size: "medium" }) }) }) });
13611
+ return /* @__PURE__ */ jsx94(Card_default, { className: cx28(className, styles.card), variant, children: /* @__PURE__ */ jsx94(Card_default.Content, { children: /* @__PURE__ */ jsx94("div", { style: { display: "flex", justifyContent: "center", padding: "2rem" }, children: /* @__PURE__ */ jsx94(Spinner_default, { size: "medium" }) }) }) });
12652
13612
  }
12653
13613
  if (!currentFlow && apiError) {
12654
- return /* @__PURE__ */ jsx87(Card_default, { className: cx26(className, styles.card), variant, children: /* @__PURE__ */ jsx87(Card_default.Content, { children: /* @__PURE__ */ jsxs37(Alert_default, { variant: "error", children: [
12655
- /* @__PURE__ */ jsx87(Alert_default.Title, { children: "Error" }),
12656
- /* @__PURE__ */ jsx87(Alert_default.Description, { children: apiError.message })
13614
+ return /* @__PURE__ */ jsx94(Card_default, { className: cx28(className, styles.card), variant, children: /* @__PURE__ */ jsx94(Card_default.Content, { children: /* @__PURE__ */ jsxs39(Alert_default, { variant: "error", children: [
13615
+ /* @__PURE__ */ jsx94(Alert_default.Title, { children: "Error" }),
13616
+ /* @__PURE__ */ jsx94(Alert_default.Description, { children: apiError.message })
12657
13617
  ] }) }) });
12658
13618
  }
12659
- return /* @__PURE__ */ jsxs37(Card_default, { className: cx26(className, styles.card), variant, children: [
12660
- (showTitle || showSubtitle) && (title || subtitle) && /* @__PURE__ */ jsxs37(Card_default.Header, { className: styles.header, children: [
12661
- showTitle && title && /* @__PURE__ */ jsx87(Card_default.Title, { level: 2, className: styles.title, children: title }),
12662
- showSubtitle && subtitle && /* @__PURE__ */ jsx87(Typography_default, { variant: "body1", className: styles.subtitle, children: subtitle })
13619
+ return /* @__PURE__ */ jsxs39(Card_default, { className: cx28(className, styles.card), variant, children: [
13620
+ (showTitle || showSubtitle) && (title || subtitle) && /* @__PURE__ */ jsxs39(Card_default.Header, { className: styles.header, children: [
13621
+ showTitle && title && /* @__PURE__ */ jsx94(Card_default.Title, { level: 2, className: styles.title, children: title }),
13622
+ showSubtitle && subtitle && /* @__PURE__ */ jsx94(Typography_default, { variant: "body1", className: styles.subtitle, children: subtitle })
12663
13623
  ] }),
12664
- /* @__PURE__ */ jsxs37(Card_default.Content, { children: [
12665
- apiError && /* @__PURE__ */ jsx87("div", { style: { marginBottom: "1rem" }, children: /* @__PURE__ */ jsx87(Alert_default, { variant: "error", children: /* @__PURE__ */ jsx87(Alert_default.Description, { children: apiError.message }) }) }),
12666
- /* @__PURE__ */ jsxs37("div", { children: [
12667
- componentsWithoutHeadings && componentsWithoutHeadings.length > 0 ? renderComponents(componentsWithoutHeadings) : !isLoading && /* @__PURE__ */ jsx87(Alert_default, { variant: "warning", children: /* @__PURE__ */ jsx87(Typography_default, { variant: "body1", children: "No form components available" }) }),
12668
- isLoading && /* @__PURE__ */ jsx87("div", { style: { display: "flex", justifyContent: "center", padding: "1rem" }, children: /* @__PURE__ */ jsx87(Spinner_default, { size: "small" }) })
13624
+ /* @__PURE__ */ jsxs39(Card_default.Content, { children: [
13625
+ apiError && /* @__PURE__ */ jsx94("div", { style: { marginBottom: "1rem" }, children: /* @__PURE__ */ jsx94(Alert_default, { variant: "error", children: /* @__PURE__ */ jsx94(Alert_default.Description, { children: apiError.message }) }) }),
13626
+ /* @__PURE__ */ jsxs39("div", { children: [
13627
+ componentsWithoutHeadings && componentsWithoutHeadings.length > 0 ? renderComponents(componentsWithoutHeadings) : !isLoading && /* @__PURE__ */ jsx94(Alert_default, { variant: "warning", children: /* @__PURE__ */ jsx94(Typography_default, { variant: "body1", children: "No form components available" }) }),
13628
+ isLoading && /* @__PURE__ */ jsx94("div", { style: { display: "flex", justifyContent: "center", padding: "1rem" }, children: /* @__PURE__ */ jsx94(Spinner_default, { size: "small" }) })
12669
13629
  ] })
12670
13630
  ] })
12671
13631
  ] });
@@ -12673,7 +13633,7 @@ var BaseInviteUser = ({
12673
13633
  var BaseInviteUser_default = BaseInviteUser;
12674
13634
 
12675
13635
  // src/components/presentation/auth/InviteUser/v2/InviteUser.tsx
12676
- import { jsx as jsx88 } from "react/jsx-runtime";
13636
+ import { jsx as jsx95 } from "react/jsx-runtime";
12677
13637
  var InviteUser = ({
12678
13638
  onError,
12679
13639
  onFlowChange,
@@ -12689,7 +13649,7 @@ var InviteUser = ({
12689
13649
  const response = await http2.request({
12690
13650
  data: {
12691
13651
  ...payload,
12692
- flowType: EmbeddedFlowType5.UserOnboarding,
13652
+ flowType: EmbeddedFlowType7.UserOnboarding,
12693
13653
  verbose: true
12694
13654
  },
12695
13655
  headers: {
@@ -12716,7 +13676,7 @@ var InviteUser = ({
12716
13676
  });
12717
13677
  return response.data;
12718
13678
  };
12719
- const fetchOrganizationUnitChildren = useCallback17(
13679
+ const fetchOrganizationUnitChildren = useCallback20(
12720
13680
  async (parentId, limit, offset4) => {
12721
13681
  const accessToken = await getAccessToken();
12722
13682
  return getOrganizationUnitChildren({
@@ -12729,7 +13689,7 @@ var InviteUser = ({
12729
13689
  },
12730
13690
  [baseUrl, getAccessToken]
12731
13691
  );
12732
- return /* @__PURE__ */ jsx88(
13692
+ return /* @__PURE__ */ jsx95(
12733
13693
  BaseInviteUser_default,
12734
13694
  {
12735
13695
  onInitialize: handleInitialize,
@@ -12753,8 +13713,8 @@ var InviteUser_default = InviteUser;
12753
13713
  import { useMemo as useMemo32 } from "react";
12754
13714
 
12755
13715
  // src/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.tsx
12756
- import { cx as cx27 } from "@emotion/css";
12757
- import { useCallback as useCallback18, useContext as useContext14, useEffect as useEffect22, useRef as useRef11, useState as useState24 } from "react";
13716
+ import { cx as cx29 } from "@emotion/css";
13717
+ import { useCallback as useCallback21, useContext as useContext15, useEffect as useEffect24, useRef as useRef13, useState as useState26 } from "react";
12758
13718
 
12759
13719
  // src/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.styles.ts
12760
13720
  import { css as css24 } from "@emotion/css";
@@ -12797,7 +13757,7 @@ var useStyles23 = (theme, colorScheme) => useMemo31(() => {
12797
13757
  var BaseAcceptInvite_styles_default = useStyles23;
12798
13758
 
12799
13759
  // src/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.tsx
12800
- import { jsx as jsx89, jsxs as jsxs38 } from "react/jsx-runtime";
13760
+ import { jsx as jsx96, jsxs as jsxs40 } from "react/jsx-runtime";
12801
13761
  var BaseAcceptInvite = ({
12802
13762
  executionId,
12803
13763
  inviteToken,
@@ -12817,22 +13777,22 @@ var BaseAcceptInvite = ({
12817
13777
  const { meta, isInitialized, getStorageManager } = useAsgardeo_default();
12818
13778
  const { t } = useTranslation_default(preferences?.i18n);
12819
13779
  const { theme } = useTheme_default();
12820
- const customRenderers = useContext14(ComponentRendererContext_default);
13780
+ const customRenderers = useContext15(ComponentRendererContext_default);
12821
13781
  const styles = BaseAcceptInvite_styles_default(theme, theme.vars.colors.text.primary);
12822
- const [isLoading, setIsLoading] = useState24(false);
12823
- const [isValidatingToken, setIsValidatingToken] = useState24(true);
12824
- const [isTokenInvalid, setIsTokenInvalid] = useState24(false);
12825
- const [isComplete, setIsComplete] = useState24(false);
12826
- const [currentFlow, setCurrentFlow] = useState24(null);
12827
- const [apiError, setApiError] = useState24(null);
12828
- const [formValues, setFormValues] = useState24({});
12829
- const [formErrors, setFormErrors] = useState24({});
12830
- const [touchedFields, setTouchedFields] = useState24({});
12831
- const [isFormValid, setIsFormValid] = useState24(true);
12832
- const [isStorageReady, setIsStorageReady] = useState24(false);
12833
- const challengeTokenRef = useRef11(null);
12834
- const tokenValidationAttemptedRef = useRef11(false);
12835
- useEffect22(() => {
13782
+ const [isLoading, setIsLoading] = useState26(false);
13783
+ const [isValidatingToken, setIsValidatingToken] = useState26(true);
13784
+ const [isTokenInvalid, setIsTokenInvalid] = useState26(false);
13785
+ const [isComplete, setIsComplete] = useState26(false);
13786
+ const [currentFlow, setCurrentFlow] = useState26(null);
13787
+ const [apiError, setApiError] = useState26(null);
13788
+ const [formValues, setFormValues] = useState26({});
13789
+ const [formErrors, setFormErrors] = useState26({});
13790
+ const [touchedFields, setTouchedFields] = useState26({});
13791
+ const [isFormValid, setIsFormValid] = useState26(true);
13792
+ const [isStorageReady, setIsStorageReady] = useState26(false);
13793
+ const challengeTokenRef = useRef13(null);
13794
+ const tokenValidationAttemptedRef = useRef13(false);
13795
+ useEffect24(() => {
12836
13796
  if (!isInitialized) return;
12837
13797
  (async () => {
12838
13798
  try {
@@ -12857,7 +13817,7 @@ var BaseAcceptInvite = ({
12857
13817
  }
12858
13818
  }
12859
13819
  };
12860
- const handleError = useCallback18(
13820
+ const handleError = useCallback21(
12861
13821
  (error) => {
12862
13822
  const errorMessage = error?.failureReason || extractErrorMessage(error, t, "components.acceptInvite.errors.generic");
12863
13823
  setApiError(error instanceof Error ? error : new Error(errorMessage));
@@ -12865,7 +13825,7 @@ var BaseAcceptInvite = ({
12865
13825
  },
12866
13826
  [t, onError]
12867
13827
  );
12868
- const normalizeFlowResponseLocal = useCallback18(
13828
+ const normalizeFlowResponseLocal = useCallback21(
12869
13829
  (response) => {
12870
13830
  if (!response?.data?.meta?.components) {
12871
13831
  return response;
@@ -12907,7 +13867,13 @@ var BaseAcceptInvite = ({
12907
13867
  },
12908
13868
  onFlowChange: (response) => {
12909
13869
  onFlowChange?.(response);
12910
- if (response.flowStatus !== "COMPLETE") {
13870
+ if (response.flowStatus === "COMPLETE") {
13871
+ setIsComplete(true);
13872
+ const completionComponents = response.data?.components || response.data?.meta?.components || [];
13873
+ if (completionComponents.length > 0) {
13874
+ setCurrentFlow(response);
13875
+ }
13876
+ } else {
12911
13877
  setCurrentFlow(response);
12912
13878
  setFormValues({});
12913
13879
  setFormErrors({});
@@ -12928,7 +13894,7 @@ var BaseAcceptInvite = ({
12928
13894
  },
12929
13895
  tokenValidationAttemptedRef
12930
13896
  });
12931
- const handleInputChange = useCallback18((name, value) => {
13897
+ const handleInputChange = useCallback21((name, value) => {
12932
13898
  setFormValues((prev) => ({ ...prev, [name]: value }));
12933
13899
  setFormErrors((prev) => {
12934
13900
  const newErrors = { ...prev };
@@ -12937,10 +13903,10 @@ var BaseAcceptInvite = ({
12937
13903
  });
12938
13904
  setIsFormValid(true);
12939
13905
  }, []);
12940
- const handleInputBlur = useCallback18((name) => {
13906
+ const handleInputBlur = useCallback21((name) => {
12941
13907
  setTouchedFields((prev) => ({ ...prev, [name]: true }));
12942
13908
  }, []);
12943
- const validateForm = useCallback18(
13909
+ const validateForm = useCallback21(
12944
13910
  (components2) => {
12945
13911
  const errors = {};
12946
13912
  const validateComponents = (comps) => {
@@ -12961,7 +13927,7 @@ var BaseAcceptInvite = ({
12961
13927
  },
12962
13928
  [formValues, t]
12963
13929
  );
12964
- const handleSubmit = useCallback18(
13930
+ const handleSubmit = useCallback21(
12965
13931
  async (component, data) => {
12966
13932
  if (!currentFlow) {
12967
13933
  return;
@@ -13036,10 +14002,14 @@ var BaseAcceptInvite = ({
13036
14002
  normalizeFlowResponseLocal
13037
14003
  ]
13038
14004
  );
13039
- useEffect22(() => {
14005
+ useEffect24(() => {
13040
14006
  if (tokenValidationAttemptedRef.current) {
13041
14007
  return;
13042
14008
  }
14009
+ const urlParams = new URLSearchParams(window.location.search);
14010
+ if (urlParams.get("code")) {
14011
+ return;
14012
+ }
13043
14013
  if (!executionId || !inviteToken) {
13044
14014
  setIsValidatingToken(false);
13045
14015
  setIsTokenInvalid(true);
@@ -13079,7 +14049,7 @@ var BaseAcceptInvite = ({
13079
14049
  }
13080
14050
  })();
13081
14051
  }, [executionId, inviteToken, onSubmit, onFlowChange, handleError, normalizeFlowResponseLocal]);
13082
- const extractHeadings = useCallback18((components2) => {
14052
+ const extractHeadings = useCallback21((components2) => {
13083
14053
  let title2;
13084
14054
  let subtitle2;
13085
14055
  components2.forEach((comp) => {
@@ -13093,7 +14063,7 @@ var BaseAcceptInvite = ({
13093
14063
  });
13094
14064
  return { subtitle: subtitle2, title: title2 };
13095
14065
  }, []);
13096
- const filterHeadings = useCallback18(
14066
+ const filterHeadings = useCallback21(
13097
14067
  (components2) => components2.filter(
13098
14068
  (comp) => !(comp.type === "TEXT" && (comp.variant === "HEADING_1" || comp.variant === "HEADING_2"))
13099
14069
  ),
@@ -13124,34 +14094,34 @@ var BaseAcceptInvite = ({
13124
14094
  values: formValues
13125
14095
  };
13126
14096
  if (children) {
13127
- return /* @__PURE__ */ jsx89("div", { className, children: children(renderProps) });
14097
+ return /* @__PURE__ */ jsx96("div", { className, children: children(renderProps) });
13128
14098
  }
13129
14099
  if (isValidatingToken) {
13130
- return /* @__PURE__ */ jsx89(Card_default, { className: cx27(className, styles.card), variant, children: /* @__PURE__ */ jsx89(Card_default.Content, { children: /* @__PURE__ */ jsxs38("div", { style: { alignItems: "center", display: "flex", flexDirection: "column", gap: "1rem", padding: "2rem" }, children: [
13131
- /* @__PURE__ */ jsx89(Spinner_default, { size: "medium" }),
13132
- /* @__PURE__ */ jsx89(Typography_default, { variant: "body1", children: "Validating your invite link..." })
14100
+ return /* @__PURE__ */ jsx96(Card_default, { className: cx29(className, styles.card), variant, children: /* @__PURE__ */ jsx96(Card_default.Content, { children: /* @__PURE__ */ jsxs40("div", { style: { alignItems: "center", display: "flex", flexDirection: "column", gap: "1rem", padding: "2rem" }, children: [
14101
+ /* @__PURE__ */ jsx96(Spinner_default, { size: "medium" }),
14102
+ /* @__PURE__ */ jsx96(Typography_default, { variant: "body1", children: "Validating your invite link..." })
13133
14103
  ] }) }) });
13134
14104
  }
13135
14105
  if (isTokenInvalid) {
13136
- return /* @__PURE__ */ jsxs38(Card_default, { className: cx27(className, styles.card), variant, children: [
13137
- /* @__PURE__ */ jsx89(Card_default.Header, { className: styles.header, children: /* @__PURE__ */ jsx89(Card_default.Title, { level: 2, className: styles.title, children: "Invalid Invite Link" }) }),
13138
- /* @__PURE__ */ jsxs38(Card_default.Content, { children: [
13139
- /* @__PURE__ */ jsxs38(Alert_default, { variant: "error", children: [
13140
- /* @__PURE__ */ jsx89(Alert_default.Title, { children: "Unable to verify invite" }),
13141
- /* @__PURE__ */ jsx89(Alert_default.Description, { children: apiError?.message || "This invite link is invalid or has expired. Please contact your administrator for a new invite." })
14106
+ return /* @__PURE__ */ jsxs40(Card_default, { className: cx29(className, styles.card), variant, children: [
14107
+ /* @__PURE__ */ jsx96(Card_default.Header, { className: styles.header, children: /* @__PURE__ */ jsx96(Card_default.Title, { level: 2, className: styles.title, children: "Invalid Invite Link" }) }),
14108
+ /* @__PURE__ */ jsxs40(Card_default.Content, { children: [
14109
+ /* @__PURE__ */ jsxs40(Alert_default, { variant: "error", children: [
14110
+ /* @__PURE__ */ jsx96(Alert_default.Title, { children: "Unable to verify invite" }),
14111
+ /* @__PURE__ */ jsx96(Alert_default.Description, { children: apiError?.message || "This invite link is invalid or has expired. Please contact your administrator for a new invite." })
13142
14112
  ] }),
13143
- onGoToSignIn && /* @__PURE__ */ jsx89("div", { style: { display: "flex", justifyContent: "center", marginTop: "1.5rem" }, children: /* @__PURE__ */ jsx89(Button_default, { variant: "outline", onClick: onGoToSignIn, children: "Go to Sign In" }) })
14113
+ onGoToSignIn && /* @__PURE__ */ jsx96("div", { style: { display: "flex", justifyContent: "center", marginTop: "1.5rem" }, children: /* @__PURE__ */ jsx96(Button_default, { variant: "outline", onClick: onGoToSignIn, children: "Go to Sign In" }) })
13144
14114
  ] })
13145
14115
  ] });
13146
14116
  }
13147
- return /* @__PURE__ */ jsxs38(Card_default, { className: cx27(className, styles.card), variant, children: [
13148
- (showTitle || showSubtitle) && (title || subtitle) && /* @__PURE__ */ jsxs38(Card_default.Header, { className: styles.header, children: [
13149
- showTitle && title && /* @__PURE__ */ jsx89(Card_default.Title, { level: 2, className: styles.title, children: title }),
13150
- showSubtitle && subtitle && /* @__PURE__ */ jsx89(Typography_default, { variant: "body1", className: styles.subtitle, children: subtitle })
14117
+ return /* @__PURE__ */ jsxs40(Card_default, { className: cx29(className, styles.card), variant, children: [
14118
+ (showTitle || showSubtitle) && (title || subtitle) && /* @__PURE__ */ jsxs40(Card_default.Header, { className: styles.header, children: [
14119
+ showTitle && title && /* @__PURE__ */ jsx96(Card_default.Title, { level: 2, className: styles.title, children: title }),
14120
+ showSubtitle && subtitle && /* @__PURE__ */ jsx96(Typography_default, { variant: "body1", className: styles.subtitle, children: subtitle })
13151
14121
  ] }),
13152
- /* @__PURE__ */ jsxs38(Card_default.Content, { children: [
13153
- apiError && /* @__PURE__ */ jsx89("div", { style: { marginBottom: "1rem" }, children: /* @__PURE__ */ jsx89(Alert_default, { variant: "error", children: /* @__PURE__ */ jsx89(Alert_default.Description, { children: apiError.message }) }) }),
13154
- /* @__PURE__ */ jsxs38("div", { children: [
14122
+ /* @__PURE__ */ jsxs40(Card_default.Content, { children: [
14123
+ apiError && /* @__PURE__ */ jsx96("div", { style: { marginBottom: "1rem" }, children: /* @__PURE__ */ jsx96(Alert_default, { variant: "error", children: /* @__PURE__ */ jsx96(Alert_default.Description, { children: apiError.message }) }) }),
14124
+ /* @__PURE__ */ jsxs40("div", { children: [
13155
14125
  componentsWithoutHeadings && componentsWithoutHeadings.length > 0 ? renderInviteUserComponents(
13156
14126
  componentsWithoutHeadings,
13157
14127
  formValues,
@@ -13168,13 +14138,13 @@ var BaseAcceptInvite = ({
13168
14138
  size,
13169
14139
  variant
13170
14140
  }
13171
- ) : !isLoading && /* @__PURE__ */ jsx89(Alert_default, { variant: "warning", children: /* @__PURE__ */ jsx89(Typography_default, { variant: "body1", children: "No form components available" }) }),
13172
- isLoading && /* @__PURE__ */ jsx89("div", { style: { display: "flex", justifyContent: "center", padding: "1rem" }, children: /* @__PURE__ */ jsx89(Spinner_default, { size: "small" }) })
14141
+ ) : !isLoading && /* @__PURE__ */ jsx96(Alert_default, { variant: "warning", children: /* @__PURE__ */ jsx96(Typography_default, { variant: "body1", children: "No form components available" }) }),
14142
+ isLoading && /* @__PURE__ */ jsx96("div", { style: { display: "flex", justifyContent: "center", padding: "1rem" }, children: /* @__PURE__ */ jsx96(Spinner_default, { size: "small" }) })
13173
14143
  ] }),
13174
- onGoToSignIn && /* @__PURE__ */ jsx89("div", { style: { marginTop: "1.5rem", textAlign: "center" }, children: /* @__PURE__ */ jsxs38(Typography_default, { variant: "body2", children: [
14144
+ onGoToSignIn && /* @__PURE__ */ jsx96("div", { style: { marginTop: "1.5rem", textAlign: "center" }, children: /* @__PURE__ */ jsxs40(Typography_default, { variant: "body2", children: [
13175
14145
  "Already have an account?",
13176
14146
  " ",
13177
- /* @__PURE__ */ jsx89(Button_default, { variant: "text", onClick: onGoToSignIn, style: { minWidth: "auto", padding: 0 }, children: "Sign In" })
14147
+ /* @__PURE__ */ jsx96(Button_default, { variant: "text", onClick: onGoToSignIn, style: { minWidth: "auto", padding: 0 }, children: "Sign In" })
13178
14148
  ] }) })
13179
14149
  ] })
13180
14150
  ] });
@@ -13182,7 +14152,7 @@ var BaseAcceptInvite = ({
13182
14152
  var BaseAcceptInvite_default = BaseAcceptInvite;
13183
14153
 
13184
14154
  // src/components/presentation/auth/AcceptInvite/v2/AcceptInvite.tsx
13185
- import { jsx as jsx90 } from "react/jsx-runtime";
14155
+ import { jsx as jsx97 } from "react/jsx-runtime";
13186
14156
  var getUrlParams = () => {
13187
14157
  if (typeof window === "undefined") {
13188
14158
  return {};
@@ -13238,7 +14208,7 @@ var AcceptInvite = ({
13238
14208
  }
13239
14209
  return response.json();
13240
14210
  };
13241
- return /* @__PURE__ */ jsx90(
14211
+ return /* @__PURE__ */ jsx97(
13242
14212
  BaseAcceptInvite_default,
13243
14213
  {
13244
14214
  executionId,
@@ -13261,9 +14231,9 @@ var AcceptInvite_default = AcceptInvite;
13261
14231
 
13262
14232
  // src/components/auth/Callback/Callback.tsx
13263
14233
  import { navigate as browserNavigate } from "@asgardeo/browser";
13264
- import { useEffect as useEffect23, useRef as useRef12 } from "react";
14234
+ import { useEffect as useEffect25, useRef as useRef14 } from "react";
13265
14235
  var Callback = ({ onNavigate, onError }) => {
13266
- const processingRef = useRef12(false);
14236
+ const processingRef = useRef14(false);
13267
14237
  const navigate6 = (path) => {
13268
14238
  if (onNavigate) {
13269
14239
  onNavigate(path);
@@ -13271,7 +14241,7 @@ var Callback = ({ onNavigate, onError }) => {
13271
14241
  browserNavigate(path);
13272
14242
  }
13273
14243
  };
13274
- useEffect23(() => {
14244
+ useEffect25(() => {
13275
14245
  const processOAuthCallback = () => {
13276
14246
  if (processingRef.current) {
13277
14247
  return;
@@ -13353,56 +14323,56 @@ var Callback = ({ onNavigate, onError }) => {
13353
14323
  };
13354
14324
 
13355
14325
  // src/components/presentation/User/BaseUser.tsx
13356
- import { Fragment as Fragment18, jsx as jsx91 } from "react/jsx-runtime";
14326
+ import { Fragment as Fragment18, jsx as jsx98 } from "react/jsx-runtime";
13357
14327
  var BaseUser = ({ user, children, fallback = null }) => {
13358
14328
  if (!user) {
13359
- return /* @__PURE__ */ jsx91(Fragment18, { children: fallback });
14329
+ return /* @__PURE__ */ jsx98(Fragment18, { children: fallback });
13360
14330
  }
13361
- return /* @__PURE__ */ jsx91(Fragment18, { children: children(user) });
14331
+ return /* @__PURE__ */ jsx98(Fragment18, { children: children(user) });
13362
14332
  };
13363
14333
  BaseUser.displayName = "BaseUser";
13364
14334
  var BaseUser_default = BaseUser;
13365
14335
 
13366
14336
  // src/components/presentation/User/User.tsx
13367
- import { jsx as jsx92 } from "react/jsx-runtime";
14337
+ import { jsx as jsx99 } from "react/jsx-runtime";
13368
14338
  var User5 = ({ children, fallback = null }) => {
13369
14339
  const { user } = useAsgardeo_default();
13370
- return /* @__PURE__ */ jsx92(BaseUser_default, { user, fallback, children });
14340
+ return /* @__PURE__ */ jsx99(BaseUser_default, { user, fallback, children });
13371
14341
  };
13372
14342
  User5.displayName = "User";
13373
14343
  var User_default = User5;
13374
14344
 
13375
14345
  // src/components/presentation/Organization/BaseOrganization.tsx
13376
- import { Fragment as Fragment19, jsx as jsx93 } from "react/jsx-runtime";
14346
+ import { Fragment as Fragment19, jsx as jsx100 } from "react/jsx-runtime";
13377
14347
  var BaseOrganization = ({
13378
14348
  children,
13379
14349
  fallback = null,
13380
14350
  organization
13381
14351
  }) => {
13382
14352
  if (!organization) {
13383
- return /* @__PURE__ */ jsx93(Fragment19, { children: fallback });
14353
+ return /* @__PURE__ */ jsx100(Fragment19, { children: fallback });
13384
14354
  }
13385
- return /* @__PURE__ */ jsx93(Fragment19, { children: children(organization) });
14355
+ return /* @__PURE__ */ jsx100(Fragment19, { children: children(organization) });
13386
14356
  };
13387
14357
  BaseOrganization.displayName = "BaseOrganization";
13388
14358
  var BaseOrganization_default = BaseOrganization;
13389
14359
 
13390
14360
  // src/components/presentation/Organization/Organization.tsx
13391
- import { jsx as jsx94 } from "react/jsx-runtime";
14361
+ import { jsx as jsx101 } from "react/jsx-runtime";
13392
14362
  var Organization5 = ({ children, fallback = null }) => {
13393
14363
  const { currentOrganization } = useOrganization_default();
13394
- return /* @__PURE__ */ jsx94(BaseOrganization_default, { organization: currentOrganization, fallback, children });
14364
+ return /* @__PURE__ */ jsx101(BaseOrganization_default, { organization: currentOrganization, fallback, children });
13395
14365
  };
13396
14366
  Organization5.displayName = "Organization";
13397
14367
  var Organization_default = Organization5;
13398
14368
 
13399
14369
  // src/components/presentation/UserProfile/BaseUserProfile.tsx
13400
- import { withVendorCSSClassPrefix as withVendorCSSClassPrefix29, WellKnownSchemaIds, bem as bem21 } from "@asgardeo/browser";
13401
- import { cx as cx31 } from "@emotion/css";
13402
- import { useState as useState27, useCallback as useCallback20 } from "react";
14370
+ import { withVendorCSSClassPrefix as withVendorCSSClassPrefix31, WellKnownSchemaIds, bem as bem21 } from "@asgardeo/browser";
14371
+ import { cx as cx33 } from "@emotion/css";
14372
+ import { useState as useState29, useCallback as useCallback23 } from "react";
13403
14373
 
13404
14374
  // src/components/presentation/UserProfile/BaseUserProfile.styles.ts
13405
- import { withVendorCSSClassPrefix as withVendorCSSClassPrefix25 } from "@asgardeo/browser";
14375
+ import { withVendorCSSClassPrefix as withVendorCSSClassPrefix27 } from "@asgardeo/browser";
13406
14376
  import { css as css25 } from "@emotion/css";
13407
14377
  import { useMemo as useMemo33 } from "react";
13408
14378
  var useStyles24 = (theme, colorScheme) => {
@@ -13541,7 +14511,7 @@ var useStyles24 = (theme, colorScheme) => {
13541
14511
  max-width: 350px;
13542
14512
  text-align: start;
13543
14513
 
13544
- .${withVendorCSSClassPrefix25("form-control")} {
14514
+ .${withVendorCSSClassPrefix27("form-control")} {
13545
14515
  margin-bottom: 0;
13546
14516
  }
13547
14517
 
@@ -13659,8 +14629,8 @@ var getDisplayName = (mergedMappings, user, displayAttributes) => {
13659
14629
  var getDisplayName_default = getDisplayName;
13660
14630
 
13661
14631
  // src/components/primitives/Avatar/Avatar.tsx
13662
- import { withVendorCSSClassPrefix as withVendorCSSClassPrefix26, bem as bem18 } from "@asgardeo/browser";
13663
- import { cx as cx28 } from "@emotion/css";
14632
+ import { withVendorCSSClassPrefix as withVendorCSSClassPrefix28, bem as bem18 } from "@asgardeo/browser";
14633
+ import { cx as cx30 } from "@emotion/css";
13664
14634
  import { useMemo as useMemo35 } from "react";
13665
14635
 
13666
14636
  // src/components/primitives/Avatar/Avatar.styles.ts
@@ -13730,7 +14700,7 @@ var useStyles25 = (theme, colorScheme, size, variant, backgroundColor) => useMem
13730
14700
  var Avatar_styles_default = useStyles25;
13731
14701
 
13732
14702
  // src/components/primitives/Avatar/Avatar.tsx
13733
- import { jsx as jsx95 } from "react/jsx-runtime";
14703
+ import { jsx as jsx102 } from "react/jsx-runtime";
13734
14704
  var Avatar = ({
13735
14705
  alt = "User avatar",
13736
14706
  background = "random",
@@ -13777,12 +14747,12 @@ var Avatar = ({
13777
14747
  const getInitials = (fullName) => fullName.split(" ").map((part) => part[0]).slice(0, 2).join("").toUpperCase();
13778
14748
  const renderContent = () => {
13779
14749
  if (imageUrl) {
13780
- return /* @__PURE__ */ jsx95(
14750
+ return /* @__PURE__ */ jsx102(
13781
14751
  "img",
13782
14752
  {
13783
14753
  src: imageUrl,
13784
14754
  alt,
13785
- className: cx28(withVendorCSSClassPrefix26(bem18("avatar", "image")), styles["image"])
14755
+ className: cx30(withVendorCSSClassPrefix28(bem18("avatar", "image")), styles["image"])
13786
14756
  }
13787
14757
  );
13788
14758
  }
@@ -13790,27 +14760,27 @@ var Avatar = ({
13790
14760
  return getInitials(name);
13791
14761
  }
13792
14762
  if (isLoading) {
13793
- return /* @__PURE__ */ jsx95("div", { className: cx28(withVendorCSSClassPrefix26(bem18("avatar", "skeleton")), styles["skeleton"]) });
14763
+ return /* @__PURE__ */ jsx102("div", { className: cx30(withVendorCSSClassPrefix28(bem18("avatar", "skeleton")), styles["skeleton"]) });
13794
14764
  }
13795
- return /* @__PURE__ */ jsx95(
14765
+ return /* @__PURE__ */ jsx102(
13796
14766
  "svg",
13797
14767
  {
13798
14768
  xmlns: "http://www.w3.org/2000/svg",
13799
14769
  viewBox: "0 0 640 640",
13800
- className: cx28(withVendorCSSClassPrefix26(bem18("avatar", "icon")), styles["icon"]),
13801
- children: /* @__PURE__ */ jsx95("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" })
14770
+ className: cx30(withVendorCSSClassPrefix28(bem18("avatar", "icon")), styles["icon"]),
14771
+ children: /* @__PURE__ */ jsx102("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" })
13802
14772
  }
13803
14773
  );
13804
14774
  };
13805
- return /* @__PURE__ */ jsx95(
14775
+ return /* @__PURE__ */ jsx102(
13806
14776
  "div",
13807
14777
  {
13808
- className: cx28(
13809
- withVendorCSSClassPrefix26(bem18("avatar")),
14778
+ className: cx30(
14779
+ withVendorCSSClassPrefix28(bem18("avatar")),
13810
14780
  styles["avatar"],
13811
14781
  styles["variant"],
13812
- withVendorCSSClassPrefix26(bem18("avatar", null, variant)),
13813
- isDefaultState && withVendorCSSClassPrefix26(bem18("avatar", "default")),
14782
+ withVendorCSSClassPrefix28(bem18("avatar", null, variant)),
14783
+ isDefaultState && withVendorCSSClassPrefix28(bem18("avatar", "default")),
13814
14784
  className
13815
14785
  ),
13816
14786
  children: renderContent()
@@ -13819,8 +14789,8 @@ var Avatar = ({
13819
14789
  };
13820
14790
 
13821
14791
  // src/components/primitives/Dialog/Dialog.tsx
13822
- import { withVendorCSSClassPrefix as withVendorCSSClassPrefix27, bem as bem19 } from "@asgardeo/browser";
13823
- import { cx as cx29 } from "@emotion/css";
14792
+ import { withVendorCSSClassPrefix as withVendorCSSClassPrefix29, bem as bem19 } from "@asgardeo/browser";
14793
+ import { cx as cx31 } from "@emotion/css";
13824
14794
  import {
13825
14795
  useFloating,
13826
14796
  useClick,
@@ -13838,10 +14808,10 @@ import {
13838
14808
  createContext as createContext12,
13839
14809
  forwardRef as forwardRef10,
13840
14810
  isValidElement,
13841
- useContext as useContext15,
14811
+ useContext as useContext16,
13842
14812
  useLayoutEffect,
13843
14813
  useMemo as useMemo37,
13844
- useState as useState25
14814
+ useState as useState27
13845
14815
  } from "react";
13846
14816
 
13847
14817
  // src/components/primitives/Dialog/Dialog.styles.ts
@@ -13909,8 +14879,8 @@ var useStyles26 = (theme, colorScheme) => useMemo36(() => {
13909
14879
  var Dialog_styles_default = useStyles26;
13910
14880
 
13911
14881
  // src/components/primitives/Icons/LogOut.tsx
13912
- import { jsx as jsx96, jsxs as jsxs39 } from "react/jsx-runtime";
13913
- var LogOut = (props) => /* @__PURE__ */ jsxs39(
14882
+ import { jsx as jsx103, jsxs as jsxs41 } from "react/jsx-runtime";
14883
+ var LogOut = (props) => /* @__PURE__ */ jsxs41(
13914
14884
  "svg",
13915
14885
  {
13916
14886
  xmlns: "http://www.w3.org/2000/svg",
@@ -13924,17 +14894,17 @@ var LogOut = (props) => /* @__PURE__ */ jsxs39(
13924
14894
  strokeLinejoin: "round",
13925
14895
  ...props,
13926
14896
  children: [
13927
- /* @__PURE__ */ jsx96("path", { d: "m16 17 5-5-5-5" }),
13928
- /* @__PURE__ */ jsx96("path", { d: "M21 12H9" }),
13929
- /* @__PURE__ */ jsx96("path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" })
14897
+ /* @__PURE__ */ jsx103("path", { d: "m16 17 5-5-5-5" }),
14898
+ /* @__PURE__ */ jsx103("path", { d: "M21 12H9" }),
14899
+ /* @__PURE__ */ jsx103("path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" })
13930
14900
  ]
13931
14901
  }
13932
14902
  );
13933
14903
  var LogOut_default = LogOut;
13934
14904
 
13935
14905
  // src/components/primitives/Icons/Plus.tsx
13936
- import { jsx as jsx97, jsxs as jsxs40 } from "react/jsx-runtime";
13937
- var Plus = (props) => /* @__PURE__ */ jsxs40(
14906
+ import { jsx as jsx104, jsxs as jsxs42 } from "react/jsx-runtime";
14907
+ var Plus = (props) => /* @__PURE__ */ jsxs42(
13938
14908
  "svg",
13939
14909
  {
13940
14910
  xmlns: "http://www.w3.org/2000/svg",
@@ -13948,16 +14918,16 @@ var Plus = (props) => /* @__PURE__ */ jsxs40(
13948
14918
  strokeLinejoin: "round",
13949
14919
  ...props,
13950
14920
  children: [
13951
- /* @__PURE__ */ jsx97("path", { d: "M5 12h14" }),
13952
- /* @__PURE__ */ jsx97("path", { d: "M12 5v14" })
14921
+ /* @__PURE__ */ jsx104("path", { d: "M5 12h14" }),
14922
+ /* @__PURE__ */ jsx104("path", { d: "M12 5v14" })
13953
14923
  ]
13954
14924
  }
13955
14925
  );
13956
14926
  var Plus_default = Plus;
13957
14927
 
13958
14928
  // src/components/primitives/Icons/User.tsx
13959
- import { jsx as jsx98, jsxs as jsxs41 } from "react/jsx-runtime";
13960
- var User7 = (props) => /* @__PURE__ */ jsxs41(
14929
+ import { jsx as jsx105, jsxs as jsxs43 } from "react/jsx-runtime";
14930
+ var User7 = (props) => /* @__PURE__ */ jsxs43(
13961
14931
  "svg",
13962
14932
  {
13963
14933
  xmlns: "http://www.w3.org/2000/svg",
@@ -13971,16 +14941,16 @@ var User7 = (props) => /* @__PURE__ */ jsxs41(
13971
14941
  strokeLinejoin: "round",
13972
14942
  ...props,
13973
14943
  children: [
13974
- /* @__PURE__ */ jsx98("path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" }),
13975
- /* @__PURE__ */ jsx98("circle", { cx: "12", cy: "7", r: "4" })
14944
+ /* @__PURE__ */ jsx105("path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" }),
14945
+ /* @__PURE__ */ jsx105("circle", { cx: "12", cy: "7", r: "4" })
13976
14946
  ]
13977
14947
  }
13978
14948
  );
13979
14949
  var User_default2 = User7;
13980
14950
 
13981
14951
  // src/components/primitives/Icons/X.tsx
13982
- import { jsx as jsx99, jsxs as jsxs42 } from "react/jsx-runtime";
13983
- var X = (props) => /* @__PURE__ */ jsxs42(
14952
+ import { jsx as jsx106, jsxs as jsxs44 } from "react/jsx-runtime";
14953
+ var X = (props) => /* @__PURE__ */ jsxs44(
13984
14954
  "svg",
13985
14955
  {
13986
14956
  xmlns: "http://www.w3.org/2000/svg",
@@ -13994,23 +14964,23 @@ var X = (props) => /* @__PURE__ */ jsxs42(
13994
14964
  strokeLinejoin: "round",
13995
14965
  ...props,
13996
14966
  children: [
13997
- /* @__PURE__ */ jsx99("path", { d: "M18 6 6 18" }),
13998
- /* @__PURE__ */ jsx99("path", { d: "m6 6 12 12" })
14967
+ /* @__PURE__ */ jsx106("path", { d: "M18 6 6 18" }),
14968
+ /* @__PURE__ */ jsx106("path", { d: "m6 6 12 12" })
13999
14969
  ]
14000
14970
  }
14001
14971
  );
14002
14972
  var X_default = X;
14003
14973
 
14004
14974
  // src/components/primitives/Dialog/Dialog.tsx
14005
- import { jsx as jsx100, jsxs as jsxs43 } from "react/jsx-runtime";
14975
+ import { jsx as jsx107, jsxs as jsxs45 } from "react/jsx-runtime";
14006
14976
  function useDialog({
14007
14977
  initialOpen = false,
14008
14978
  open: controlledOpen,
14009
14979
  onOpenChange: setControlledOpen
14010
14980
  } = {}) {
14011
- const [uncontrolledOpen, setUncontrolledOpen] = useState25(initialOpen);
14012
- const [labelId, setLabelId] = useState25();
14013
- const [descriptionId, setDescriptionId] = useState25();
14981
+ const [uncontrolledOpen, setUncontrolledOpen] = useState27(initialOpen);
14982
+ const [labelId, setLabelId] = useState27();
14983
+ const [descriptionId, setDescriptionId] = useState27();
14014
14984
  const open = controlledOpen ?? uncontrolledOpen;
14015
14985
  const setOpen = setControlledOpen ?? setUncontrolledOpen;
14016
14986
  const data = useFloating({
@@ -14040,7 +15010,7 @@ function useDialog({
14040
15010
  }
14041
15011
  var DialogContext = createContext12(null);
14042
15012
  var useDialogContext = () => {
14043
- const context = useContext15(DialogContext);
15013
+ const context = useContext16(DialogContext);
14044
15014
  if (context == null) {
14045
15015
  throw new Error("Dialog components must be wrapped in <Dialog />");
14046
15016
  }
@@ -14048,7 +15018,7 @@ var useDialogContext = () => {
14048
15018
  };
14049
15019
  function Dialog({ children, ...options }) {
14050
15020
  const dialog = useDialog(options);
14051
- return /* @__PURE__ */ jsx100(DialogContext.Provider, { value: dialog, children });
15021
+ return /* @__PURE__ */ jsx107(DialogContext.Provider, { value: dialog, children });
14052
15022
  }
14053
15023
  var DialogTrigger = forwardRef10(
14054
15024
  ({ children, asChild = false, ...props }, propRef) => {
@@ -14066,7 +15036,7 @@ var DialogTrigger = forwardRef10(
14066
15036
  })
14067
15037
  );
14068
15038
  }
14069
- return /* @__PURE__ */ jsx100("button", { ref, "data-state": context.open ? "open" : "closed", ...context.getReferenceProps(props), children });
15039
+ return /* @__PURE__ */ jsx107("button", { ref, "data-state": context.open ? "open" : "closed", ...context.getReferenceProps(props), children });
14070
15040
  }
14071
15041
  );
14072
15042
  var DialogContent = forwardRef10(
@@ -14076,16 +15046,16 @@ var DialogContent = forwardRef10(
14076
15046
  const styles = Dialog_styles_default(theme, colorScheme);
14077
15047
  const ref = useMergeRefs([context.refs.setFloating, propRef]);
14078
15048
  if (!floatingContext.open) return null;
14079
- return /* @__PURE__ */ jsx100(FloatingPortal, { children: /* @__PURE__ */ jsx100(
15049
+ return /* @__PURE__ */ jsx107(FloatingPortal, { children: /* @__PURE__ */ jsx107(
14080
15050
  FloatingOverlay,
14081
15051
  {
14082
- className: cx29(withVendorCSSClassPrefix27(bem19("dialog", "overlay")), styles["overlay"]),
15052
+ className: cx31(withVendorCSSClassPrefix29(bem19("dialog", "overlay")), styles["overlay"]),
14083
15053
  lockScroll: true,
14084
- children: /* @__PURE__ */ jsx100(FloatingFocusManager, { context: floatingContext, initialFocus: -1, children: /* @__PURE__ */ jsx100(
15054
+ children: /* @__PURE__ */ jsx107(FloatingFocusManager, { context: floatingContext, initialFocus: -1, children: /* @__PURE__ */ jsx107(
14085
15055
  "div",
14086
15056
  {
14087
15057
  ref,
14088
- className: cx29(withVendorCSSClassPrefix27(bem19("dialog", "content")), styles["content"], props.className),
15058
+ className: cx31(withVendorCSSClassPrefix29(bem19("dialog", "content")), styles["content"], props.className),
14089
15059
  "aria-labelledby": context.labelId,
14090
15060
  "aria-describedby": context.descriptionId,
14091
15061
  ...context.getFloatingProps(props),
@@ -14108,18 +15078,18 @@ var DialogHeading = forwardRef10(
14108
15078
  context.setLabelId(void 0);
14109
15079
  };
14110
15080
  }, [id, context.setLabelId]);
14111
- return /* @__PURE__ */ jsxs43("div", { className: cx29(withVendorCSSClassPrefix27(bem19("dialog", "header")), styles["header"]), children: [
14112
- /* @__PURE__ */ jsx100(
15081
+ return /* @__PURE__ */ jsxs45("div", { className: cx31(withVendorCSSClassPrefix29(bem19("dialog", "header")), styles["header"]), children: [
15082
+ /* @__PURE__ */ jsx107(
14113
15083
  "h2",
14114
15084
  {
14115
15085
  ...props,
14116
15086
  ref,
14117
15087
  id,
14118
- className: cx29(withVendorCSSClassPrefix27(bem19("dialog", "title")), styles["headerTitle"]),
15088
+ className: cx31(withVendorCSSClassPrefix29(bem19("dialog", "title")), styles["headerTitle"]),
14119
15089
  children
14120
15090
  }
14121
15091
  ),
14122
- /* @__PURE__ */ jsx100(
15092
+ /* @__PURE__ */ jsx107(
14123
15093
  Button_default,
14124
15094
  {
14125
15095
  color: "tertiary",
@@ -14130,7 +15100,7 @@ var DialogHeading = forwardRef10(
14130
15100
  context.setOpen(false);
14131
15101
  },
14132
15102
  "aria-label": "Close",
14133
- children: /* @__PURE__ */ jsx100(X_default, { width: 16, height: 16 })
15103
+ children: /* @__PURE__ */ jsx107(X_default, { width: 16, height: 16 })
14134
15104
  }
14135
15105
  )
14136
15106
  ] });
@@ -14148,13 +15118,13 @@ var DialogDescription = forwardRef10(
14148
15118
  context.setDescriptionId(void 0);
14149
15119
  };
14150
15120
  }, [id, context.setDescriptionId]);
14151
- return /* @__PURE__ */ jsx100(
15121
+ return /* @__PURE__ */ jsx107(
14152
15122
  "p",
14153
15123
  {
14154
15124
  ...props,
14155
15125
  ref,
14156
15126
  id,
14157
- className: cx29(withVendorCSSClassPrefix27(bem19("dialog", "description")), styles["description"], props.className),
15127
+ className: cx31(withVendorCSSClassPrefix29(bem19("dialog", "description")), styles["description"], props.className),
14158
15128
  children
14159
15129
  }
14160
15130
  );
@@ -14177,13 +15147,13 @@ var DialogClose = forwardRef10(
14177
15147
  onClick: handleClick
14178
15148
  });
14179
15149
  }
14180
- return /* @__PURE__ */ jsx100(
15150
+ return /* @__PURE__ */ jsx107(
14181
15151
  Button_default,
14182
15152
  {
14183
15153
  ...props,
14184
15154
  ref,
14185
15155
  onClick: handleClick,
14186
- className: cx29(withVendorCSSClassPrefix27(bem19("dialog", "close")), props.className),
15156
+ className: cx31(withVendorCSSClassPrefix29(bem19("dialog", "close")), props.className),
14187
15157
  variant: "text",
14188
15158
  children
14189
15159
  }
@@ -14203,9 +15173,9 @@ Dialog.Close = DialogClose;
14203
15173
  var Dialog_default = Dialog;
14204
15174
 
14205
15175
  // src/components/primitives/MultiInput/MultiInput.tsx
14206
- import { withVendorCSSClassPrefix as withVendorCSSClassPrefix28, bem as bem20 } from "@asgardeo/browser";
14207
- import { cx as cx30 } from "@emotion/css";
14208
- import { useCallback as useCallback19, useState as useState26 } from "react";
15176
+ import { withVendorCSSClassPrefix as withVendorCSSClassPrefix30, bem as bem20 } from "@asgardeo/browser";
15177
+ import { cx as cx32 } from "@emotion/css";
15178
+ import { useCallback as useCallback22, useState as useState28 } from "react";
14209
15179
 
14210
15180
  // src/components/primitives/MultiInput/MultiInput.styles.ts
14211
15181
  import { css as css28 } from "@emotion/css";
@@ -14300,7 +15270,7 @@ var useStyles27 = (theme, colorScheme, disabled, hasError, canAddMore, canRemove
14300
15270
  var MultiInput_styles_default = useStyles27;
14301
15271
 
14302
15272
  // src/components/primitives/MultiInput/MultiInput.tsx
14303
- import { jsx as jsx101, jsxs as jsxs44 } from "react/jsx-runtime";
15273
+ import { jsx as jsx108, jsxs as jsxs46 } from "react/jsx-runtime";
14304
15274
  var MultiInput = ({
14305
15275
  label,
14306
15276
  error,
@@ -14323,9 +15293,9 @@ var MultiInput = ({
14323
15293
  const canAddMore = !maxFields || values.length < maxFields;
14324
15294
  const canRemove = values.length > minFields;
14325
15295
  const styles = MultiInput_styles_default(theme, colorScheme, !!disabled, !!error, canAddMore, canRemove);
14326
- const PlusIcon = ({ iconClassName }) => /* @__PURE__ */ jsx101("svg", { width: "16", height: "16", viewBox: "0 0 24 24", className: cx30(styles["icon"], iconClassName), children: /* @__PURE__ */ jsx101("path", { d: "M12 5v14M5 12h14" }) });
14327
- const BinIcon = ({ iconClassName }) => /* @__PURE__ */ jsx101("svg", { width: "16", height: "16", viewBox: "0 0 24 24", className: cx30(styles["icon"], iconClassName), children: /* @__PURE__ */ jsx101("path", { d: "M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2m3 0v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6h14ZM10 11v6M14 11v6" }) });
14328
- const handleAddValue = useCallback19(
15296
+ const PlusIcon = ({ iconClassName }) => /* @__PURE__ */ jsx108("svg", { width: "16", height: "16", viewBox: "0 0 24 24", className: cx32(styles["icon"], iconClassName), children: /* @__PURE__ */ jsx108("path", { d: "M12 5v14M5 12h14" }) });
15297
+ const BinIcon = ({ iconClassName }) => /* @__PURE__ */ jsx108("svg", { width: "16", height: "16", viewBox: "0 0 24 24", className: cx32(styles["icon"], iconClassName), children: /* @__PURE__ */ jsx108("path", { d: "M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2m3 0v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6h14ZM10 11v6M14 11v6" }) });
15298
+ const handleAddValue = useCallback22(
14329
15299
  (newValue) => {
14330
15300
  if (newValue.trim() !== "" && (!maxFields || values.length < maxFields)) {
14331
15301
  onChange([...values, newValue.trim()]);
@@ -14333,7 +15303,7 @@ var MultiInput = ({
14333
15303
  },
14334
15304
  [values, onChange, maxFields]
14335
15305
  );
14336
- const handleRemoveValue = useCallback19(
15306
+ const handleRemoveValue = useCallback22(
14337
15307
  (index) => {
14338
15308
  if (values.length > minFields) {
14339
15309
  const updatedValues = values.filter((_, i) => i !== index);
@@ -14342,7 +15312,7 @@ var MultiInput = ({
14342
15312
  },
14343
15313
  [values, onChange, minFields]
14344
15314
  );
14345
- const renderInputField = useCallback19(
15315
+ const renderInputField = useCallback22(
14346
15316
  (value, onValueChange, attachedEndIcon, onEndIconClick) => {
14347
15317
  const handleInputChange = (e) => {
14348
15318
  const newValue = e.target ? e.target.value : e;
@@ -14368,9 +15338,9 @@ var MultiInput = ({
14368
15338
  };
14369
15339
  switch (fieldType) {
14370
15340
  case "DATE_TIME":
14371
- return /* @__PURE__ */ jsx101(DatePicker_default, { ...commonProps });
15341
+ return /* @__PURE__ */ jsx108(DatePicker_default, { ...commonProps });
14372
15342
  case "BOOLEAN":
14373
- return /* @__PURE__ */ jsx101(
15343
+ return /* @__PURE__ */ jsx108(
14374
15344
  Checkbox_default,
14375
15345
  {
14376
15346
  ...commonProps,
@@ -14379,58 +15349,58 @@ var MultiInput = ({
14379
15349
  }
14380
15350
  );
14381
15351
  default:
14382
- return /* @__PURE__ */ jsx101(TextField_default, { ...commonProps, type });
15352
+ return /* @__PURE__ */ jsx108(TextField_default, { ...commonProps, type });
14383
15353
  }
14384
15354
  },
14385
15355
  [placeholder, disabled, startIcon, endIcon, error, fieldType, type]
14386
15356
  );
14387
- const [currentInputValue, setCurrentInputValue] = useState26("");
14388
- const handleInputSubmit = useCallback19(() => {
15357
+ const [currentInputValue, setCurrentInputValue] = useState28("");
15358
+ const handleInputSubmit = useCallback22(() => {
14389
15359
  if (currentInputValue.trim() !== "") {
14390
15360
  handleAddValue(currentInputValue);
14391
15361
  setCurrentInputValue("");
14392
15362
  }
14393
15363
  }, [currentInputValue, handleAddValue]);
14394
- return /* @__PURE__ */ jsxs44(
15364
+ return /* @__PURE__ */ jsxs46(
14395
15365
  FormControl_default,
14396
15366
  {
14397
15367
  error,
14398
15368
  helperText,
14399
- className: cx30(withVendorCSSClassPrefix28(bem20("multi-input")), className),
15369
+ className: cx32(withVendorCSSClassPrefix30(bem20("multi-input")), className),
14400
15370
  style,
14401
15371
  children: [
14402
- label && /* @__PURE__ */ jsx101(InputLabel_default, { required, error: !!error, children: label }),
14403
- /* @__PURE__ */ jsxs44("div", { className: cx30(withVendorCSSClassPrefix28(bem20("multi-input", "container")), styles["container"]), children: [
14404
- /* @__PURE__ */ jsx101("div", { className: cx30(withVendorCSSClassPrefix28(bem20("multi-input", "input-row")), styles["inputRow"]), children: /* @__PURE__ */ jsx101("div", { className: cx30(withVendorCSSClassPrefix28(bem20("multi-input", "input-wrapper")), styles["inputWrapper"]), children: renderInputField(
15372
+ label && /* @__PURE__ */ jsx108(InputLabel_default, { required, error: !!error, children: label }),
15373
+ /* @__PURE__ */ jsxs46("div", { className: cx32(withVendorCSSClassPrefix30(bem20("multi-input", "container")), styles["container"]), children: [
15374
+ /* @__PURE__ */ jsx108("div", { className: cx32(withVendorCSSClassPrefix30(bem20("multi-input", "input-row")), styles["inputRow"]), children: /* @__PURE__ */ jsx108("div", { className: cx32(withVendorCSSClassPrefix30(bem20("multi-input", "input-wrapper")), styles["inputWrapper"]), children: renderInputField(
14405
15375
  currentInputValue,
14406
15376
  setCurrentInputValue,
14407
- canAddMore ? /* @__PURE__ */ jsx101(PlusIcon, { iconClassName: styles["plusIcon"] }) : void 0,
15377
+ canAddMore ? /* @__PURE__ */ jsx108(PlusIcon, { iconClassName: styles["plusIcon"] }) : void 0,
14408
15378
  canAddMore ? handleInputSubmit : void 0
14409
15379
  ) }) }),
14410
- values.length > 0 && /* @__PURE__ */ jsx101("div", { className: cx30(withVendorCSSClassPrefix28(bem20("multi-input", "list-container")), styles["listContainer"]), children: values.map((value, index) => /* @__PURE__ */ jsxs44(
15380
+ values.length > 0 && /* @__PURE__ */ jsx108("div", { className: cx32(withVendorCSSClassPrefix30(bem20("multi-input", "list-container")), styles["listContainer"]), children: values.map((value, index) => /* @__PURE__ */ jsxs46(
14411
15381
  "div",
14412
15382
  {
14413
- className: cx30(withVendorCSSClassPrefix28(bem20("multi-input", "list-item")), styles["listItem"]),
15383
+ className: cx32(withVendorCSSClassPrefix30(bem20("multi-input", "list-item")), styles["listItem"]),
14414
15384
  children: [
14415
- /* @__PURE__ */ jsx101(
15385
+ /* @__PURE__ */ jsx108(
14416
15386
  "span",
14417
15387
  {
14418
- className: cx30(withVendorCSSClassPrefix28(bem20("multi-input", "list-item-text")), styles["listItemText"]),
15388
+ className: cx32(withVendorCSSClassPrefix30(bem20("multi-input", "list-item-text")), styles["listItemText"]),
14419
15389
  children: value
14420
15390
  }
14421
15391
  ),
14422
- canRemove && /* @__PURE__ */ jsx101(
15392
+ canRemove && /* @__PURE__ */ jsx108(
14423
15393
  "button",
14424
15394
  {
14425
15395
  type: "button",
14426
15396
  onClick: () => handleRemoveValue(index),
14427
15397
  disabled,
14428
- className: cx30(
14429
- withVendorCSSClassPrefix28(bem20("multi-input", "remove-button")),
15398
+ className: cx32(
15399
+ withVendorCSSClassPrefix30(bem20("multi-input", "remove-button")),
14430
15400
  styles["removeButton"]
14431
15401
  ),
14432
15402
  title: "Remove value",
14433
- children: /* @__PURE__ */ jsx101(BinIcon, { iconClassName: styles["icon"] })
15403
+ children: /* @__PURE__ */ jsx108(BinIcon, { iconClassName: styles["icon"] })
14434
15404
  }
14435
15405
  )
14436
15406
  ]
@@ -14445,7 +15415,7 @@ var MultiInput = ({
14445
15415
  var MultiInput_default = MultiInput;
14446
15416
 
14447
15417
  // src/components/presentation/UserProfile/BaseUserProfile.tsx
14448
- import { Fragment as Fragment20, jsx as jsx102, jsxs as jsxs45 } from "react/jsx-runtime";
15418
+ import { Fragment as Fragment20, jsx as jsx109, jsxs as jsxs47 } from "react/jsx-runtime";
14449
15419
  var fieldsToSkip = [
14450
15420
  "roles.default",
14451
15421
  "active",
@@ -14489,10 +15459,10 @@ var BaseUserProfile = ({
14489
15459
  displayNameAttributes = []
14490
15460
  }) => {
14491
15461
  const { theme, colorScheme } = useTheme_default();
14492
- const [editedUser, setEditedUser] = useState27(flattenedProfile || profile);
14493
- const [editingFields, setEditingFields] = useState27({});
15462
+ const [editedUser, setEditedUser] = useState29(flattenedProfile || profile);
15463
+ const [editingFields, setEditingFields] = useState29({});
14494
15464
  const { t } = useTranslation_default(preferences?.i18n);
14495
- const shouldShowField = useCallback20(
15465
+ const shouldShowField = useCallback23(
14496
15466
  (fieldName) => {
14497
15467
  if (fieldsToSkip.includes(fieldName)) {
14498
15468
  return false;
@@ -14507,7 +15477,7 @@ var BaseUserProfile = ({
14507
15477
  },
14508
15478
  [showFields, hideFields]
14509
15479
  );
14510
- const PencilIcon = () => /* @__PURE__ */ jsx102(
15480
+ const PencilIcon = () => /* @__PURE__ */ jsx109(
14511
15481
  "svg",
14512
15482
  {
14513
15483
  width: "16",
@@ -14518,16 +15488,16 @@ var BaseUserProfile = ({
14518
15488
  strokeWidth: "2",
14519
15489
  strokeLinecap: "round",
14520
15490
  strokeLinejoin: "round",
14521
- children: /* @__PURE__ */ jsx102("path", { d: "M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z" })
15491
+ children: /* @__PURE__ */ jsx109("path", { d: "M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z" })
14522
15492
  }
14523
15493
  );
14524
- const toggleFieldEdit = useCallback20((fieldName) => {
15494
+ const toggleFieldEdit = useCallback23((fieldName) => {
14525
15495
  setEditingFields((prev) => ({
14526
15496
  ...prev,
14527
15497
  [fieldName]: !prev[fieldName]
14528
15498
  }));
14529
15499
  }, []);
14530
- const getFieldPlaceholder = useCallback20((schema) => {
15500
+ const getFieldPlaceholder = useCallback23((schema) => {
14531
15501
  const { type, displayName, description, name } = schema;
14532
15502
  const fieldLabel = displayName || description || name || "value";
14533
15503
  switch (type) {
@@ -14541,19 +15511,19 @@ var BaseUserProfile = ({
14541
15511
  return `Enter your ${fieldLabel.toLowerCase()}`;
14542
15512
  }
14543
15513
  }, []);
14544
- const formatLabel = useCallback20(
15514
+ const formatLabel = useCallback23(
14545
15515
  (key) => key.split(/(?=[A-Z])|_/).map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(" "),
14546
15516
  []
14547
15517
  );
14548
15518
  const styles = BaseUserProfile_styles_default(theme, colorScheme);
14549
15519
  const ObjectDisplay = ({ data }) => {
14550
15520
  if (!data || typeof data !== "object") return null;
14551
- return /* @__PURE__ */ jsx102("table", { className: styles.value, children: /* @__PURE__ */ jsx102("tbody", { children: Object.entries(data).map(([key, value]) => /* @__PURE__ */ jsxs45("tr", { children: [
14552
- /* @__PURE__ */ jsx102("td", { className: styles.objectKey, children: /* @__PURE__ */ jsxs45("strong", { children: [
15521
+ return /* @__PURE__ */ jsx109("table", { className: styles.value, children: /* @__PURE__ */ jsx109("tbody", { children: Object.entries(data).map(([key, value]) => /* @__PURE__ */ jsxs47("tr", { children: [
15522
+ /* @__PURE__ */ jsx109("td", { className: styles.objectKey, children: /* @__PURE__ */ jsxs47("strong", { children: [
14553
15523
  formatLabel(key),
14554
15524
  ":"
14555
15525
  ] }) }),
14556
- /* @__PURE__ */ jsx102("td", { className: styles.objectValue, children: typeof value === "object" ? /* @__PURE__ */ jsx102(ObjectDisplay, { data: value }) : String(value) })
15526
+ /* @__PURE__ */ jsx109("td", { className: styles.objectValue, children: typeof value === "object" ? /* @__PURE__ */ jsx109(ObjectDisplay, { data: value }) : String(value) })
14557
15527
  ] }, key)) }) });
14558
15528
  };
14559
15529
  function set(obj, path, value) {
@@ -14571,7 +15541,7 @@ var BaseUserProfile = ({
14571
15541
  }
14572
15542
  }
14573
15543
  }
14574
- const handleFieldSave = useCallback20(
15544
+ const handleFieldSave = useCallback23(
14575
15545
  (schema) => {
14576
15546
  if (!onUpdate || !schema.name) return;
14577
15547
  const fieldName = schema.name;
@@ -14601,7 +15571,7 @@ var BaseUserProfile = ({
14601
15571
  },
14602
15572
  [editedUser, flattenedProfile, onUpdate, toggleFieldEdit]
14603
15573
  );
14604
- const handleFieldCancel = useCallback20(
15574
+ const handleFieldCancel = useCallback23(
14605
15575
  (fieldName) => {
14606
15576
  const currentUser2 = flattenedProfile || profile;
14607
15577
  setEditedUser((prev) => ({
@@ -14628,7 +15598,7 @@ var BaseUserProfile = ({
14628
15598
  const { value, displayName, description, name, type, required, mutability, subAttributes, multiValued } = schema;
14629
15599
  const label = displayName || description || name || "";
14630
15600
  if (subAttributes && Array.isArray(subAttributes)) {
14631
- return /* @__PURE__ */ jsx102(Fragment20, { children: subAttributes.map((subAttr, index) => {
15601
+ return /* @__PURE__ */ jsx109(Fragment20, { children: subAttributes.map((subAttr, index) => {
14632
15602
  let displayValue2;
14633
15603
  if (Array.isArray(subAttr.value)) {
14634
15604
  displayValue2 = subAttr.value.map((item) => typeof item === "object" ? JSON.stringify(item) : String(item)).join(", ");
@@ -14637,9 +15607,9 @@ var BaseUserProfile = ({
14637
15607
  } else {
14638
15608
  displayValue2 = String(subAttr.value);
14639
15609
  }
14640
- return /* @__PURE__ */ jsxs45("div", { className: styles.field, children: [
14641
- /* @__PURE__ */ jsx102("span", { className: styles.label, children: subAttr.displayName || subAttr.description || "" }),
14642
- /* @__PURE__ */ jsx102("div", { className: styles.value, children: displayValue2 })
15610
+ return /* @__PURE__ */ jsxs47("div", { className: styles.field, children: [
15611
+ /* @__PURE__ */ jsx109("span", { className: styles.label, children: subAttr.displayName || subAttr.description || "" }),
15612
+ /* @__PURE__ */ jsx109("div", { className: styles.value, children: displayValue2 })
14643
15613
  ] }, index);
14644
15614
  }) });
14645
15615
  }
@@ -14663,9 +15633,9 @@ var BaseUserProfile = ({
14663
15633
  } else {
14664
15634
  fieldValues = [];
14665
15635
  }
14666
- return /* @__PURE__ */ jsxs45(Fragment20, { children: [
14667
- /* @__PURE__ */ jsx102("span", { className: styles.label, children: label }),
14668
- /* @__PURE__ */ jsx102("div", { className: styles.value, children: /* @__PURE__ */ jsx102(
15636
+ return /* @__PURE__ */ jsxs47(Fragment20, { children: [
15637
+ /* @__PURE__ */ jsx109("span", { className: styles.label, children: label }),
15638
+ /* @__PURE__ */ jsx109("div", { className: styles.value, children: /* @__PURE__ */ jsx109(
14669
15639
  MultiInput_default,
14670
15640
  {
14671
15641
  values: fieldValues,
@@ -14696,9 +15666,9 @@ var BaseUserProfile = ({
14696
15666
  } else {
14697
15667
  displayValue2 = "-";
14698
15668
  }
14699
- return /* @__PURE__ */ jsxs45(Fragment20, { children: [
14700
- /* @__PURE__ */ jsx102("span", { className: styles.label, children: label }),
14701
- /* @__PURE__ */ jsx102("div", { className: cx31(styles.value, !hasValues ? styles.valuePlaceholder : ""), children: !hasValues && isEditable2 && onStartEdit ? /* @__PURE__ */ jsx102(
15669
+ return /* @__PURE__ */ jsxs47(Fragment20, { children: [
15670
+ /* @__PURE__ */ jsx109("span", { className: styles.label, children: label }),
15671
+ /* @__PURE__ */ jsx109("div", { className: cx33(styles.value, !hasValues ? styles.valuePlaceholder : ""), children: !hasValues && isEditable2 && onStartEdit ? /* @__PURE__ */ jsx109(
14702
15672
  Button_default,
14703
15673
  {
14704
15674
  onClick: onStartEdit,
@@ -14713,7 +15683,7 @@ var BaseUserProfile = ({
14713
15683
  ] });
14714
15684
  }
14715
15685
  if (type === "COMPLEX" && typeof value === "object") {
14716
- return /* @__PURE__ */ jsx102(ObjectDisplay, { data: value });
15686
+ return /* @__PURE__ */ jsx109(ObjectDisplay, { data: value });
14717
15687
  }
14718
15688
  if (isEditing && onEditValue && mutability !== "READ_ONLY" && !readonlyFields.includes(name || "")) {
14719
15689
  let fieldValue;
@@ -14735,13 +15705,13 @@ var BaseUserProfile = ({
14735
15705
  let field;
14736
15706
  switch (type) {
14737
15707
  case "STRING":
14738
- field = /* @__PURE__ */ jsx102(TextField_default, { ...commonProps });
15708
+ field = /* @__PURE__ */ jsx109(TextField_default, { ...commonProps });
14739
15709
  break;
14740
15710
  case "DATE_TIME":
14741
- field = /* @__PURE__ */ jsx102(DatePicker_default, { ...commonProps });
15711
+ field = /* @__PURE__ */ jsx109(DatePicker_default, { ...commonProps });
14742
15712
  break;
14743
15713
  case "BOOLEAN":
14744
- field = /* @__PURE__ */ jsx102(
15714
+ field = /* @__PURE__ */ jsx109(
14745
15715
  Checkbox_default,
14746
15716
  {
14747
15717
  ...commonProps,
@@ -14753,7 +15723,7 @@ var BaseUserProfile = ({
14753
15723
  );
14754
15724
  break;
14755
15725
  case "COMPLEX":
14756
- field = /* @__PURE__ */ jsx102(
15726
+ field = /* @__PURE__ */ jsx109(
14757
15727
  "textarea",
14758
15728
  {
14759
15729
  value: fieldValue,
@@ -14765,11 +15735,11 @@ var BaseUserProfile = ({
14765
15735
  );
14766
15736
  break;
14767
15737
  default:
14768
- field = /* @__PURE__ */ jsx102(TextField_default, { ...commonProps });
15738
+ field = /* @__PURE__ */ jsx109(TextField_default, { ...commonProps });
14769
15739
  }
14770
- return /* @__PURE__ */ jsxs45(Fragment20, { children: [
14771
- /* @__PURE__ */ jsx102("span", { className: styles.label, children: label }),
14772
- /* @__PURE__ */ jsx102("div", { className: styles.value, children: field })
15740
+ return /* @__PURE__ */ jsxs47(Fragment20, { children: [
15741
+ /* @__PURE__ */ jsx109("span", { className: styles.label, children: label }),
15742
+ /* @__PURE__ */ jsx109("div", { className: styles.value, children: field })
14773
15743
  ] });
14774
15744
  }
14775
15745
  const hasValue = value !== void 0 && value !== null && value !== "";
@@ -14782,9 +15752,9 @@ var BaseUserProfile = ({
14782
15752
  } else {
14783
15753
  displayValue = "-";
14784
15754
  }
14785
- return /* @__PURE__ */ jsxs45(Fragment20, { children: [
14786
- /* @__PURE__ */ jsx102("span", { className: styles.label, children: label }),
14787
- /* @__PURE__ */ jsx102("div", { className: cx31(styles.value, !hasValue ? styles.valuePlaceholder : ""), children: !hasValue && isEditable && onStartEdit ? /* @__PURE__ */ jsx102(
15755
+ return /* @__PURE__ */ jsxs47(Fragment20, { children: [
15756
+ /* @__PURE__ */ jsx109("span", { className: styles.label, children: label }),
15757
+ /* @__PURE__ */ jsx109("div", { className: cx33(styles.value, !hasValue ? styles.valuePlaceholder : ""), children: !hasValue && isEditable && onStartEdit ? /* @__PURE__ */ jsx109(
14788
15758
  Button_default,
14789
15759
  {
14790
15760
  onClick: onStartEdit,
@@ -14807,8 +15777,8 @@ var BaseUserProfile = ({
14807
15777
  if (!shouldShow) {
14808
15778
  return null;
14809
15779
  }
14810
- return /* @__PURE__ */ jsxs45("div", { className: styles.field, children: [
14811
- /* @__PURE__ */ jsx102("div", { className: styles.fieldInner, children: renderSchemaField(
15780
+ return /* @__PURE__ */ jsxs47("div", { className: styles.field, children: [
15781
+ /* @__PURE__ */ jsx109("div", { className: styles.fieldInner, children: renderSchemaField(
14812
15782
  schema,
14813
15783
  isFieldEditing,
14814
15784
  (value) => {
@@ -14818,10 +15788,10 @@ var BaseUserProfile = ({
14818
15788
  },
14819
15789
  () => toggleFieldEdit(schema.name)
14820
15790
  ) }),
14821
- editable && schema.mutability !== "READ_ONLY" && !isReadonlyField && /* @__PURE__ */ jsxs45("div", { className: styles.fieldActions, children: [
14822
- isFieldEditing && /* @__PURE__ */ jsxs45(Fragment20, { children: [
14823
- /* @__PURE__ */ jsx102(Button_default, { size: "small", color: "primary", variant: "solid", onClick: () => handleFieldSave(schema), children: "Save" }),
14824
- /* @__PURE__ */ jsx102(
15791
+ editable && schema.mutability !== "READ_ONLY" && !isReadonlyField && /* @__PURE__ */ jsxs47("div", { className: styles.fieldActions, children: [
15792
+ isFieldEditing && /* @__PURE__ */ jsxs47(Fragment20, { children: [
15793
+ /* @__PURE__ */ jsx109(Button_default, { size: "small", color: "primary", variant: "solid", onClick: () => handleFieldSave(schema), children: "Save" }),
15794
+ /* @__PURE__ */ jsx109(
14825
15795
  Button_default,
14826
15796
  {
14827
15797
  size: "small",
@@ -14832,7 +15802,7 @@ var BaseUserProfile = ({
14832
15802
  }
14833
15803
  )
14834
15804
  ] }),
14835
- !isFieldEditing && hasValue && /* @__PURE__ */ jsx102(
15805
+ !isFieldEditing && hasValue && /* @__PURE__ */ jsx109(
14836
15806
  Button_default,
14837
15807
  {
14838
15808
  size: "small",
@@ -14841,7 +15811,7 @@ var BaseUserProfile = ({
14841
15811
  onClick: () => toggleFieldEdit(schema.name),
14842
15812
  title: "Edit",
14843
15813
  className: styles.editButton,
14844
- children: /* @__PURE__ */ jsx102(PencilIcon, {})
15814
+ children: /* @__PURE__ */ jsx109(PencilIcon, {})
14845
15815
  }
14846
15816
  )
14847
15817
  ] })
@@ -14850,10 +15820,10 @@ var BaseUserProfile = ({
14850
15820
  if (!profile && !flattenedProfile) {
14851
15821
  return fallback;
14852
15822
  }
14853
- const containerClasses = cx31(
15823
+ const containerClasses = cx33(
14854
15824
  styles.root,
14855
15825
  cardLayout ? styles.card : "",
14856
- withVendorCSSClassPrefix29("user-profile"),
15826
+ withVendorCSSClassPrefix31("user-profile"),
14857
15827
  className
14858
15828
  );
14859
15829
  const currentUser = flattenedProfile || profile;
@@ -14864,9 +15834,9 @@ var BaseUserProfile = ({
14864
15834
  if (!shouldShowField(key)) return false;
14865
15835
  return value !== void 0 && value !== "" && value !== null;
14866
15836
  }).sort(([a], [b]) => a.localeCompare(b));
14867
- return /* @__PURE__ */ jsxs45(Fragment20, { children: [
14868
- /* @__PURE__ */ jsxs45("div", { className: styles.profileSummary, children: [
14869
- /* @__PURE__ */ jsx102(
15837
+ return /* @__PURE__ */ jsxs47(Fragment20, { children: [
15838
+ /* @__PURE__ */ jsxs47("div", { className: styles.profileSummary, children: [
15839
+ /* @__PURE__ */ jsx109(
14870
15840
  Avatar,
14871
15841
  {
14872
15842
  imageUrl: getMappedUserProfileValue_default("picture", mergedMappings, currentUser),
@@ -14876,32 +15846,32 @@ var BaseUserProfile = ({
14876
15846
  isLoading
14877
15847
  }
14878
15848
  ),
14879
- /* @__PURE__ */ jsx102(Typography_default, { variant: "h3", fontWeight: "medium", children: displayName }),
14880
- getMappedUserProfileValue_default("email", mergedMappings, currentUser) && /* @__PURE__ */ jsx102(Typography_default, { variant: "body2", color: "textSecondary", children: getMappedUserProfileValue_default("email", mergedMappings, currentUser) })
15849
+ /* @__PURE__ */ jsx109(Typography_default, { variant: "h3", fontWeight: "medium", children: displayName }),
15850
+ getMappedUserProfileValue_default("email", mergedMappings, currentUser) && /* @__PURE__ */ jsx109(Typography_default, { variant: "body2", color: "textSecondary", children: getMappedUserProfileValue_default("email", mergedMappings, currentUser) })
14881
15851
  ] }),
14882
- /* @__PURE__ */ jsx102(Divider_default, {}),
14883
- profileEntries.map(([key, value], index) => /* @__PURE__ */ jsxs45("div", { children: [
14884
- /* @__PURE__ */ jsxs45("div", { className: styles.sectionRow, children: [
14885
- /* @__PURE__ */ jsx102("div", { className: styles.sectionLabel, children: formatLabel(key) }),
14886
- /* @__PURE__ */ jsx102("div", { className: styles.sectionValue, children: typeof value === "object" ? /* @__PURE__ */ jsx102(ObjectDisplay, { data: value }) : String(value) })
15852
+ /* @__PURE__ */ jsx109(Divider_default, {}),
15853
+ profileEntries.map(([key, value], index) => /* @__PURE__ */ jsxs47("div", { children: [
15854
+ /* @__PURE__ */ jsxs47("div", { className: styles.sectionRow, children: [
15855
+ /* @__PURE__ */ jsx109("div", { className: styles.sectionLabel, children: formatLabel(key) }),
15856
+ /* @__PURE__ */ jsx109("div", { className: styles.sectionValue, children: typeof value === "object" ? /* @__PURE__ */ jsx109(ObjectDisplay, { data: value }) : String(value) })
14887
15857
  ] }),
14888
- index < profileEntries.length - 1 && /* @__PURE__ */ jsx102(Divider_default, {})
15858
+ index < profileEntries.length - 1 && /* @__PURE__ */ jsx109(Divider_default, {})
14889
15859
  ] }, key))
14890
15860
  ] });
14891
15861
  };
14892
- const profileContent = /* @__PURE__ */ jsxs45(Card_default, { className: containerClasses, children: [
14893
- error && /* @__PURE__ */ jsxs45(
15862
+ const profileContent = /* @__PURE__ */ jsxs47(Card_default, { className: containerClasses, children: [
15863
+ error && /* @__PURE__ */ jsxs47(
14894
15864
  Alert_default,
14895
15865
  {
14896
15866
  variant: "error",
14897
- className: cx31(withVendorCSSClassPrefix29(bem21("user-profile", "alert")), styles.alert),
15867
+ className: cx33(withVendorCSSClassPrefix31(bem21("user-profile", "alert")), styles.alert),
14898
15868
  children: [
14899
- /* @__PURE__ */ jsx102(Alert_default.Title, { children: t("errors.heading") || "Error" }),
14900
- /* @__PURE__ */ jsx102(Alert_default.Description, { children: error })
15869
+ /* @__PURE__ */ jsx109(Alert_default.Title, { children: t("errors.heading") || "Error" }),
15870
+ /* @__PURE__ */ jsx109(Alert_default.Description, { children: error })
14901
15871
  ]
14902
15872
  }
14903
15873
  ),
14904
- schemas && schemas.length > 0 && /* @__PURE__ */ jsx102("div", { className: styles.header, children: /* @__PURE__ */ jsx102(
15874
+ schemas && schemas.length > 0 && /* @__PURE__ */ jsx109("div", { className: styles.header, children: /* @__PURE__ */ jsx109(
14905
15875
  Avatar,
14906
15876
  {
14907
15877
  imageUrl: getMappedUserProfileValue_default("picture", mergedMappings, currentUser),
@@ -14911,7 +15881,7 @@ var BaseUserProfile = ({
14911
15881
  isLoading
14912
15882
  }
14913
15883
  ) }),
14914
- /* @__PURE__ */ jsx102("div", { className: styles.infoContainer, children: schemas && schemas.length > 0 ? schemas.filter((schema) => {
15884
+ /* @__PURE__ */ jsx109("div", { className: styles.infoContainer, children: schemas && schemas.length > 0 ? schemas.filter((schema) => {
14915
15885
  if (!schema.name || !shouldShowField(schema.name)) return false;
14916
15886
  if (!editable) {
14917
15887
  const value = flattenedProfile && schema.name ? flattenedProfile[schema.name] : void 0;
@@ -14928,13 +15898,13 @@ var BaseUserProfile = ({
14928
15898
  ...schema,
14929
15899
  value
14930
15900
  };
14931
- return /* @__PURE__ */ jsx102("div", { className: styles.info, children: renderUserInfo(schemaWithValue) }, schema.name || index);
15901
+ return /* @__PURE__ */ jsx109("div", { className: styles.info, children: renderUserInfo(schemaWithValue) }, schema.name || index);
14932
15902
  }) : renderProfileWithoutSchemas() })
14933
15903
  ] });
14934
15904
  if (mode === "popup") {
14935
- return /* @__PURE__ */ jsx102(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs45(Dialog_default.Content, { children: [
14936
- /* @__PURE__ */ jsx102(Dialog_default.Heading, { children: title ?? t("user.profile.heading") }),
14937
- /* @__PURE__ */ jsx102("div", { className: styles.popup, children: profileContent })
15905
+ return /* @__PURE__ */ jsx109(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs47(Dialog_default.Content, { children: [
15906
+ /* @__PURE__ */ jsx109(Dialog_default.Heading, { children: title ?? t("user.profile.heading") }),
15907
+ /* @__PURE__ */ jsx109("div", { className: styles.popup, children: profileContent })
14938
15908
  ] }) });
14939
15909
  }
14940
15910
  return profileContent;
@@ -14943,7 +15913,7 @@ var BaseUserProfile_default = BaseUserProfile;
14943
15913
 
14944
15914
  // src/components/presentation/UserProfile/UserProfile.tsx
14945
15915
  import { AsgardeoError } from "@asgardeo/browser";
14946
- import { useState as useState28 } from "react";
15916
+ import { useState as useState30 } from "react";
14947
15917
 
14948
15918
  // src/api/updateMeProfile.ts
14949
15919
  import {
@@ -14976,12 +15946,12 @@ var updateMeProfile = async ({ fetcher, instanceId = 0, ...requestConfig }) => {
14976
15946
  var updateMeProfile_default = updateMeProfile;
14977
15947
 
14978
15948
  // src/components/presentation/UserProfile/UserProfile.tsx
14979
- import { jsx as jsx103 } from "react/jsx-runtime";
15949
+ import { jsx as jsx110 } from "react/jsx-runtime";
14980
15950
  var UserProfile3 = ({ preferences, ...rest }) => {
14981
15951
  const { baseUrl, instanceId } = useAsgardeo_default();
14982
15952
  const { profile, flattenedProfile, schemas, onUpdateProfile } = useUser_default();
14983
15953
  const { t } = useTranslation_default(preferences?.i18n);
14984
- const [error, setError] = useState28(null);
15954
+ const [error, setError] = useState30(null);
14985
15955
  const handleProfileUpdate = async (payload) => {
14986
15956
  setError(null);
14987
15957
  try {
@@ -14995,7 +15965,7 @@ var UserProfile3 = ({ preferences, ...rest }) => {
14995
15965
  setError(message);
14996
15966
  }
14997
15967
  };
14998
- return /* @__PURE__ */ jsx103(
15968
+ return /* @__PURE__ */ jsx110(
14999
15969
  BaseUserProfile_default,
15000
15970
  {
15001
15971
  profile,
@@ -15011,8 +15981,8 @@ var UserProfile3 = ({ preferences, ...rest }) => {
15011
15981
  var UserProfile_default = UserProfile3;
15012
15982
 
15013
15983
  // src/components/presentation/UserDropdown/BaseUserDropdown.tsx
15014
- import { withVendorCSSClassPrefix as withVendorCSSClassPrefix30 } from "@asgardeo/browser";
15015
- import { cx as cx32 } from "@emotion/css";
15984
+ import { withVendorCSSClassPrefix as withVendorCSSClassPrefix32 } from "@asgardeo/browser";
15985
+ import { cx as cx34 } from "@emotion/css";
15016
15986
  import {
15017
15987
  useFloating as useFloating2,
15018
15988
  autoUpdate,
@@ -15026,7 +15996,7 @@ import {
15026
15996
  FloatingFocusManager as FloatingFocusManager2,
15027
15997
  FloatingPortal as FloatingPortal2
15028
15998
  } from "@floating-ui/react";
15029
- import { useState as useState29 } from "react";
15999
+ import { useState as useState31 } from "react";
15030
16000
 
15031
16001
  // src/components/presentation/UserDropdown/BaseUserDropdown.styles.ts
15032
16002
  import { css as css29 } from "@emotion/css";
@@ -15218,7 +16188,7 @@ var useStyles28 = (theme, colorScheme) => useMemo39(() => {
15218
16188
  var BaseUserDropdown_styles_default = useStyles28;
15219
16189
 
15220
16190
  // src/components/presentation/UserDropdown/BaseUserDropdown.tsx
15221
- import { jsx as jsx104, jsxs as jsxs46 } from "react/jsx-runtime";
16191
+ import { jsx as jsx111, jsxs as jsxs48 } from "react/jsx-runtime";
15222
16192
  var BaseUserDropdown = ({
15223
16193
  fallback = null,
15224
16194
  className = "",
@@ -15234,8 +16204,8 @@ var BaseUserDropdown = ({
15234
16204
  }) => {
15235
16205
  const { theme, colorScheme } = useTheme_default();
15236
16206
  const styles = BaseUserDropdown_styles_default(theme, colorScheme);
15237
- const [isOpen, setIsOpen] = useState29(false);
15238
- const [hoveredItemIndex, setHoveredItemIndex] = useState29(null);
16207
+ const [isOpen, setIsOpen] = useState31(false);
16208
+ const [hoveredItemIndex, setHoveredItemIndex] = useState31(null);
15239
16209
  const { refs, floatingStyles, context } = useFloating2({
15240
16210
  middleware: [offset(5), flip({ fallbackAxisSideDirection: "end" }), shift({ padding: 5 })],
15241
16211
  onOpenChange: setIsOpen,
@@ -15270,14 +16240,14 @@ var BaseUserDropdown = ({
15270
16240
  const defaultMenuItems = [];
15271
16241
  if (onManageProfile) {
15272
16242
  defaultMenuItems.push({
15273
- icon: /* @__PURE__ */ jsx104(User_default2, { width: "16", height: "16" }),
16243
+ icon: /* @__PURE__ */ jsx111(User_default2, { width: "16", height: "16" }),
15274
16244
  label: "Manage Profile",
15275
16245
  onClick: onManageProfile
15276
16246
  });
15277
16247
  }
15278
16248
  if (onSignOut) {
15279
16249
  defaultMenuItems.push({
15280
- icon: /* @__PURE__ */ jsx104(LogOut_default, { width: "16", height: "16" }),
16250
+ icon: /* @__PURE__ */ jsx111(LogOut_default, { width: "16", height: "16" }),
15281
16251
  label: "Sign Out",
15282
16252
  onClick: onSignOut
15283
16253
  });
@@ -15289,19 +16259,19 @@ var BaseUserDropdown = ({
15289
16259
  }
15290
16260
  allMenuItems.push(...defaultMenuItems);
15291
16261
  }
15292
- return /* @__PURE__ */ jsxs46("div", { className: cx32(withVendorCSSClassPrefix30("user-dropdown"), className), children: [
15293
- /* @__PURE__ */ jsxs46(
16262
+ return /* @__PURE__ */ jsxs48("div", { className: cx34(withVendorCSSClassPrefix32("user-dropdown"), className), children: [
16263
+ /* @__PURE__ */ jsxs48(
15294
16264
  Button_default,
15295
16265
  {
15296
16266
  ref: refs.setReference,
15297
- className: cx32(withVendorCSSClassPrefix30("user-dropdown__trigger"), styles["trigger"]),
16267
+ className: cx34(withVendorCSSClassPrefix32("user-dropdown__trigger"), styles["trigger"]),
15298
16268
  color: "tertiary",
15299
16269
  variant: "text",
15300
16270
  size: "medium",
15301
16271
  "data-testid": "asgardeo-user-dropdown-trigger",
15302
16272
  ...getReferenceProps(),
15303
16273
  children: [
15304
- /* @__PURE__ */ jsx104(
16274
+ /* @__PURE__ */ jsx111(
15305
16275
  Avatar,
15306
16276
  {
15307
16277
  imageUrl: getMappedUserProfileValue_default("picture", mergedMappings, user),
@@ -15310,22 +16280,22 @@ var BaseUserDropdown = ({
15310
16280
  alt: `${getDisplayName_default(mergedMappings, user)}'s avatar`
15311
16281
  }
15312
16282
  ),
15313
- showTriggerLabel && /* @__PURE__ */ jsx104(
16283
+ showTriggerLabel && /* @__PURE__ */ jsx111(
15314
16284
  Typography_default,
15315
16285
  {
15316
16286
  variant: "body2",
15317
- className: cx32(withVendorCSSClassPrefix30("user-dropdown__trigger-label"), styles["userName"]),
16287
+ className: cx34(withVendorCSSClassPrefix32("user-dropdown__trigger-label"), styles["userName"]),
15318
16288
  children: getDisplayName_default(mergedMappings, user)
15319
16289
  }
15320
16290
  )
15321
16291
  ]
15322
16292
  }
15323
16293
  ),
15324
- isOpen && /* @__PURE__ */ jsx104(FloatingPortal2, { id: portalId, children: /* @__PURE__ */ jsx104(FloatingFocusManager2, { context, modal: false, initialFocus: -1, children: /* @__PURE__ */ jsxs46(
16294
+ isOpen && /* @__PURE__ */ jsx111(FloatingPortal2, { id: portalId, children: /* @__PURE__ */ jsx111(FloatingFocusManager2, { context, modal: false, initialFocus: -1, children: /* @__PURE__ */ jsxs48(
15325
16295
  "div",
15326
16296
  {
15327
16297
  ref: refs.setFloating,
15328
- className: cx32(withVendorCSSClassPrefix30("user-dropdown__content"), styles["dropdownContent"]),
16298
+ className: cx34(withVendorCSSClassPrefix32("user-dropdown__content"), styles["dropdownContent"]),
15329
16299
  style: {
15330
16300
  ...floatingStyles,
15331
16301
  // Floating UI doesn't set a z-index by default, so we set a high value to ensure the dropdown appears above other elements.
@@ -15334,8 +16304,8 @@ var BaseUserDropdown = ({
15334
16304
  },
15335
16305
  ...getFloatingProps(),
15336
16306
  children: [
15337
- /* @__PURE__ */ jsxs46("div", { className: cx32(withVendorCSSClassPrefix30("user-dropdown__header"), styles["dropdownHeader"]), children: [
15338
- /* @__PURE__ */ jsx104(
16307
+ /* @__PURE__ */ jsxs48("div", { className: cx34(withVendorCSSClassPrefix32("user-dropdown__header"), styles["dropdownHeader"]), children: [
16308
+ /* @__PURE__ */ jsx111(
15339
16309
  Avatar,
15340
16310
  {
15341
16311
  imageUrl: getMappedUserProfileValue_default("picture", mergedMappings, user),
@@ -15344,22 +16314,22 @@ var BaseUserDropdown = ({
15344
16314
  alt: `${getDisplayName_default(mergedMappings, user)}'s avatar`
15345
16315
  }
15346
16316
  ),
15347
- /* @__PURE__ */ jsxs46("div", { className: cx32(withVendorCSSClassPrefix30("user-dropdown__header-info"), styles["headerInfo"]), children: [
15348
- /* @__PURE__ */ jsx104(
16317
+ /* @__PURE__ */ jsxs48("div", { className: cx34(withVendorCSSClassPrefix32("user-dropdown__header-info"), styles["headerInfo"]), children: [
16318
+ /* @__PURE__ */ jsx111(
15349
16319
  Typography_default,
15350
16320
  {
15351
16321
  noWrap: true,
15352
- className: withVendorCSSClassPrefix30("user-dropdown__header-name"),
16322
+ className: withVendorCSSClassPrefix32("user-dropdown__header-name"),
15353
16323
  variant: "body1",
15354
16324
  fontWeight: "medium",
15355
16325
  children: getDisplayName_default(mergedMappings, user)
15356
16326
  }
15357
16327
  ),
15358
- /* @__PURE__ */ jsx104(
16328
+ /* @__PURE__ */ jsx111(
15359
16329
  Typography_default,
15360
16330
  {
15361
16331
  noWrap: true,
15362
- className: withVendorCSSClassPrefix30("user-dropdown__header-email"),
16332
+ className: withVendorCSSClassPrefix32("user-dropdown__header-email"),
15363
16333
  variant: "caption",
15364
16334
  color: "secondary",
15365
16335
  children: getMappedUserProfileValue_default("username", mergedMappings, user) || getMappedUserProfileValue_default("email", mergedMappings, user)
@@ -15367,25 +16337,25 @@ var BaseUserDropdown = ({
15367
16337
  )
15368
16338
  ] })
15369
16339
  ] }),
15370
- /* @__PURE__ */ jsx104("div", { className: cx32(withVendorCSSClassPrefix30("user-dropdown__menu"), styles["dropdownMenu"]), children: allMenuItems.map((item, index) => /* @__PURE__ */ jsx104("div", { children: (() => {
16340
+ /* @__PURE__ */ jsx111("div", { className: cx34(withVendorCSSClassPrefix32("user-dropdown__menu"), styles["dropdownMenu"]), children: allMenuItems.map((item, index) => /* @__PURE__ */ jsx111("div", { children: (() => {
15371
16341
  if (item.label === "") {
15372
- return /* @__PURE__ */ jsx104(
16342
+ return /* @__PURE__ */ jsx111(
15373
16343
  "div",
15374
16344
  {
15375
- className: cx32(withVendorCSSClassPrefix30("user-dropdown__menu-divider"), styles["divider"])
16345
+ className: cx34(withVendorCSSClassPrefix32("user-dropdown__menu-divider"), styles["divider"])
15376
16346
  }
15377
16347
  );
15378
16348
  }
15379
16349
  if (item.href) {
15380
- return /* @__PURE__ */ jsxs46(
16350
+ return /* @__PURE__ */ jsxs48(
15381
16351
  "a",
15382
16352
  {
15383
16353
  href: item.href,
15384
16354
  style: {
15385
16355
  backgroundColor: hoveredItemIndex === index ? theme.vars.colors.action?.hover : "transparent"
15386
16356
  },
15387
- className: cx32(
15388
- withVendorCSSClassPrefix30("user-dropdown__menu-item"),
16357
+ className: cx34(
16358
+ withVendorCSSClassPrefix32("user-dropdown__menu-item"),
15389
16359
  styles["menuItemAnchor"]
15390
16360
  ),
15391
16361
  onMouseEnter: () => setHoveredItemIndex(index),
@@ -15394,19 +16364,19 @@ var BaseUserDropdown = ({
15394
16364
  onBlur: () => setHoveredItemIndex(null),
15395
16365
  children: [
15396
16366
  item.icon,
15397
- /* @__PURE__ */ jsx104("span", { children: item.label })
16367
+ /* @__PURE__ */ jsx111("span", { children: item.label })
15398
16368
  ]
15399
16369
  }
15400
16370
  );
15401
16371
  }
15402
- return /* @__PURE__ */ jsx104(
16372
+ return /* @__PURE__ */ jsx111(
15403
16373
  Button_default,
15404
16374
  {
15405
16375
  onClick: () => handleMenuItemClick(item),
15406
16376
  style: {
15407
16377
  backgroundColor: hoveredItemIndex === index ? theme.vars.colors.action?.hover : "transparent"
15408
16378
  },
15409
- className: cx32(withVendorCSSClassPrefix30("user-dropdown__menu-item"), styles["menuItem"]),
16379
+ className: cx34(withVendorCSSClassPrefix32("user-dropdown__menu-item"), styles["menuItem"]),
15410
16380
  color: "tertiary",
15411
16381
  variant: "text",
15412
16382
  size: "small",
@@ -15425,8 +16395,8 @@ var BaseUserDropdown = ({
15425
16395
  var BaseUserDropdown_default = BaseUserDropdown;
15426
16396
 
15427
16397
  // src/components/presentation/UserDropdown/UserDropdown.tsx
15428
- import { useState as useState30 } from "react";
15429
- import { Fragment as Fragment21, jsx as jsx105, jsxs as jsxs47 } from "react/jsx-runtime";
16398
+ import { useState as useState32 } from "react";
16399
+ import { Fragment as Fragment21, jsx as jsx112, jsxs as jsxs49 } from "react/jsx-runtime";
15430
16400
  var UserDropdown = ({
15431
16401
  children,
15432
16402
  renderTrigger,
@@ -15435,7 +16405,7 @@ var UserDropdown = ({
15435
16405
  ...rest
15436
16406
  }) => {
15437
16407
  const { user, isLoading, signOut, meta } = useAsgardeo_default();
15438
- const [isProfileOpen, setIsProfileOpen] = useState30(false);
16408
+ const [isProfileOpen, setIsProfileOpen] = useState32(false);
15439
16409
  const handleManageProfile = () => {
15440
16410
  setIsProfileOpen(true);
15441
16411
  };
@@ -15458,14 +16428,14 @@ var UserDropdown = ({
15458
16428
  user
15459
16429
  };
15460
16430
  if (children) {
15461
- return /* @__PURE__ */ jsxs47(Fragment21, { children: [
16431
+ return /* @__PURE__ */ jsxs49(Fragment21, { children: [
15462
16432
  children(renderProps),
15463
- /* @__PURE__ */ jsx105(UserProfile_default, { mode: "popup", open: isProfileOpen, onOpenChange: setIsProfileOpen })
16433
+ /* @__PURE__ */ jsx112(UserProfile_default, { mode: "popup", open: isProfileOpen, onOpenChange: setIsProfileOpen })
15464
16434
  ] });
15465
16435
  }
15466
16436
  if (renderTrigger || renderDropdown) {
15467
- return /* @__PURE__ */ jsxs47(Fragment21, { children: [
15468
- renderTrigger ? renderTrigger(renderProps) : /* @__PURE__ */ jsx105(
16437
+ return /* @__PURE__ */ jsxs49(Fragment21, { children: [
16438
+ renderTrigger ? renderTrigger(renderProps) : /* @__PURE__ */ jsx112(
15469
16439
  BaseUserDropdown,
15470
16440
  {
15471
16441
  user,
@@ -15475,11 +16445,11 @@ var UserDropdown = ({
15475
16445
  ...rest
15476
16446
  }
15477
16447
  ),
15478
- /* @__PURE__ */ jsx105(UserProfile_default, { mode: "popup", open: isProfileOpen, onOpenChange: setIsProfileOpen })
16448
+ /* @__PURE__ */ jsx112(UserProfile_default, { mode: "popup", open: isProfileOpen, onOpenChange: setIsProfileOpen })
15479
16449
  ] });
15480
16450
  }
15481
- return /* @__PURE__ */ jsxs47(Fragment21, { children: [
15482
- /* @__PURE__ */ jsx105(
16451
+ return /* @__PURE__ */ jsxs49(Fragment21, { children: [
16452
+ /* @__PURE__ */ jsx112(
15483
16453
  BaseUserDropdown,
15484
16454
  {
15485
16455
  user,
@@ -15489,13 +16459,13 @@ var UserDropdown = ({
15489
16459
  ...rest
15490
16460
  }
15491
16461
  ),
15492
- isProfileOpen && /* @__PURE__ */ jsx105(UserProfile_default, { mode: "popup", open: isProfileOpen, onOpenChange: setIsProfileOpen })
16462
+ isProfileOpen && /* @__PURE__ */ jsx112(UserProfile_default, { mode: "popup", open: isProfileOpen, onOpenChange: setIsProfileOpen })
15493
16463
  ] });
15494
16464
  };
15495
16465
  var UserDropdown_default = UserDropdown;
15496
16466
 
15497
16467
  // src/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.tsx
15498
- import { cx as cx33 } from "@emotion/css";
16468
+ import { cx as cx35 } from "@emotion/css";
15499
16469
  import {
15500
16470
  useFloating as useFloating3,
15501
16471
  autoUpdate as autoUpdate2,
@@ -15509,7 +16479,7 @@ import {
15509
16479
  FloatingFocusManager as FloatingFocusManager3,
15510
16480
  FloatingPortal as FloatingPortal3
15511
16481
  } from "@floating-ui/react";
15512
- import { useState as useState31 } from "react";
16482
+ import { useState as useState33 } from "react";
15513
16483
 
15514
16484
  // src/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.styles.ts
15515
16485
  import { css as css30 } from "@emotion/css";
@@ -15737,9 +16707,9 @@ var useStyles29 = (theme, colorScheme) => useMemo40(() => {
15737
16707
  var BaseOrganizationSwitcher_styles_default = useStyles29;
15738
16708
 
15739
16709
  // src/components/primitives/Icons/Building.tsx
15740
- import { jsx as jsx106, jsxs as jsxs48 } from "react/jsx-runtime";
15741
- var Building = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ jsxs48("svg", { width, height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
15742
- /* @__PURE__ */ jsx106(
16710
+ import { jsx as jsx113, jsxs as jsxs50 } from "react/jsx-runtime";
16711
+ var Building = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ jsxs50("svg", { width, height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
16712
+ /* @__PURE__ */ jsx113(
15743
16713
  "path",
15744
16714
  {
15745
16715
  d: "M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",
@@ -15749,30 +16719,30 @@ var Building = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PU
15749
16719
  strokeLinejoin: "round"
15750
16720
  }
15751
16721
  ),
15752
- /* @__PURE__ */ jsx106("path", { d: "M6 12h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
15753
- /* @__PURE__ */ jsx106("path", { d: "M6 8h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
15754
- /* @__PURE__ */ jsx106("path", { d: "M14 8h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
15755
- /* @__PURE__ */ jsx106("path", { d: "M14 12h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
15756
- /* @__PURE__ */ jsx106("path", { d: "M6 18h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
15757
- /* @__PURE__ */ jsx106("path", { d: "M14 18h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
16722
+ /* @__PURE__ */ jsx113("path", { d: "M6 12h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
16723
+ /* @__PURE__ */ jsx113("path", { d: "M6 8h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
16724
+ /* @__PURE__ */ jsx113("path", { d: "M14 8h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
16725
+ /* @__PURE__ */ jsx113("path", { d: "M14 12h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
16726
+ /* @__PURE__ */ jsx113("path", { d: "M6 18h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
16727
+ /* @__PURE__ */ jsx113("path", { d: "M14 18h4", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
15758
16728
  ] });
15759
16729
  Building.displayName = "Building";
15760
16730
  var Building_default = Building;
15761
16731
 
15762
16732
  // src/components/primitives/Icons/Check.tsx
15763
- import { jsx as jsx107 } from "react/jsx-runtime";
15764
- var Check = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ jsx107("svg", { width, height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx107("path", { d: "M20 6 9 17l-5-5", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) });
16733
+ import { jsx as jsx114 } from "react/jsx-runtime";
16734
+ var Check = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ jsx114("svg", { width, height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx114("path", { d: "M20 6 9 17l-5-5", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) });
15765
16735
  Check.displayName = "Check";
15766
16736
  var Check_default = Check;
15767
16737
 
15768
16738
  // src/components/primitives/Icons/ChevronDown.tsx
15769
- import { jsx as jsx108 } from "react/jsx-runtime";
15770
- var ChevronDown = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ jsx108("svg", { width, height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx108("path", { d: "m6 9 6 6 6-6", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) });
16739
+ import { jsx as jsx115 } from "react/jsx-runtime";
16740
+ var ChevronDown = ({ color = "currentColor", height = 24, width = 24 }) => /* @__PURE__ */ jsx115("svg", { width, height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx115("path", { d: "m6 9 6 6 6-6", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) });
15771
16741
  ChevronDown.displayName = "ChevronDown";
15772
16742
  var ChevronDown_default = ChevronDown;
15773
16743
 
15774
16744
  // src/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.tsx
15775
- import { Fragment as Fragment22, jsx as jsx109, jsxs as jsxs49 } from "react/jsx-runtime";
16745
+ import { Fragment as Fragment22, jsx as jsx116, jsxs as jsxs51 } from "react/jsx-runtime";
15776
16746
  var BaseOrganizationSwitcher = ({
15777
16747
  organizations,
15778
16748
  currentOrganization,
@@ -15796,8 +16766,8 @@ var BaseOrganizationSwitcher = ({
15796
16766
  }) => {
15797
16767
  const { theme, colorScheme, direction } = useTheme_default();
15798
16768
  const styles = BaseOrganizationSwitcher_styles_default(theme, colorScheme);
15799
- const [isOpen, setIsOpen] = useState31(false);
15800
- const [hoveredItemIndex, setHoveredItemIndex] = useState31(null);
16769
+ const [isOpen, setIsOpen] = useState33(false);
16770
+ const [hoveredItemIndex, setHoveredItemIndex] = useState33(null);
15801
16771
  const { t } = useTranslation_default(preferences?.i18n);
15802
16772
  const isRTL = direction === "rtl";
15803
16773
  const { refs, floatingStyles, context } = useFloating3({
@@ -15827,8 +16797,8 @@ var BaseOrganizationSwitcher = ({
15827
16797
  const switchableOrganizations = organizations.filter(
15828
16798
  (org) => org.id !== currentOrganization?.id
15829
16799
  );
15830
- const defaultRenderOrganization2 = (organization, isSelected) => /* @__PURE__ */ jsxs49(Fragment22, { children: [
15831
- /* @__PURE__ */ jsx109(
16800
+ const defaultRenderOrganization2 = (organization, isSelected) => /* @__PURE__ */ jsxs51(Fragment22, { children: [
16801
+ /* @__PURE__ */ jsx116(
15832
16802
  Avatar,
15833
16803
  {
15834
16804
  variant: "square",
@@ -15838,35 +16808,35 @@ var BaseOrganizationSwitcher = ({
15838
16808
  alt: `${organization.name} avatar`
15839
16809
  }
15840
16810
  ),
15841
- /* @__PURE__ */ jsxs49("div", { className: cx33(styles["organizationInfo"]), children: [
15842
- /* @__PURE__ */ jsx109(Typography_default, { variant: "body2", fontWeight: "medium", className: cx33(styles["organizationName"]), children: organization.name }),
15843
- /* @__PURE__ */ jsxs49("div", { className: cx33(styles["organizationMeta"]), children: [
15844
- showMemberCount && organization.memberCount !== void 0 && /* @__PURE__ */ jsxs49("span", { children: [
16811
+ /* @__PURE__ */ jsxs51("div", { className: cx35(styles["organizationInfo"]), children: [
16812
+ /* @__PURE__ */ jsx116(Typography_default, { variant: "body2", fontWeight: "medium", className: cx35(styles["organizationName"]), children: organization.name }),
16813
+ /* @__PURE__ */ jsxs51("div", { className: cx35(styles["organizationMeta"]), children: [
16814
+ showMemberCount && organization.memberCount !== void 0 && /* @__PURE__ */ jsxs51("span", { children: [
15845
16815
  organization.memberCount,
15846
16816
  " ",
15847
16817
  organization.memberCount === 1 ? t("organization.switcher.member") : t("organization.switcher.members")
15848
16818
  ] }),
15849
- showRole && organization.role && showMemberCount && organization.memberCount !== void 0 && /* @__PURE__ */ jsx109("span", { children: " \u2022 " }),
15850
- showRole && organization.role && /* @__PURE__ */ jsx109("span", { className: cx33(styles["roleCapitalized"]), children: organization.role })
16819
+ showRole && organization.role && showMemberCount && organization.memberCount !== void 0 && /* @__PURE__ */ jsx116("span", { children: " \u2022 " }),
16820
+ showRole && organization.role && /* @__PURE__ */ jsx116("span", { className: cx35(styles["roleCapitalized"]), children: organization.role })
15851
16821
  ] })
15852
16822
  ] }),
15853
- isSelected && /* @__PURE__ */ jsx109(Check_default, { width: "16", height: "16", color: theme.vars.colors.text.primary })
16823
+ isSelected && /* @__PURE__ */ jsx116(Check_default, { width: "16", height: "16", color: theme.vars.colors.text.primary })
15854
16824
  ] });
15855
- const defaultRenderLoading2 = () => /* @__PURE__ */ jsx109("div", { className: cx33(styles["loadingContainer"]), children: /* @__PURE__ */ jsx109(Typography_default, { variant: "caption", className: cx33(styles["loadingText"]), children: t("organization.switcher.loading.placeholder.organizations") }) });
15856
- const defaultRenderError2 = (errorMessage) => /* @__PURE__ */ jsx109("div", { className: cx33(styles["errorContainer"]), children: /* @__PURE__ */ jsx109(Typography_default, { variant: "caption", className: cx33(styles["errorText"]), children: errorMessage }) });
15857
- return /* @__PURE__ */ jsxs49("div", { className: cx33(styles["root"], className), style, children: [
15858
- /* @__PURE__ */ jsxs49(
16825
+ const defaultRenderLoading2 = () => /* @__PURE__ */ jsx116("div", { className: cx35(styles["loadingContainer"]), children: /* @__PURE__ */ jsx116(Typography_default, { variant: "caption", className: cx35(styles["loadingText"]), children: t("organization.switcher.loading.placeholder.organizations") }) });
16826
+ const defaultRenderError2 = (errorMessage) => /* @__PURE__ */ jsx116("div", { className: cx35(styles["errorContainer"]), children: /* @__PURE__ */ jsx116(Typography_default, { variant: "caption", className: cx35(styles["errorText"]), children: errorMessage }) });
16827
+ return /* @__PURE__ */ jsxs51("div", { className: cx35(styles["root"], className), style, children: [
16828
+ /* @__PURE__ */ jsxs51(
15859
16829
  Button_default,
15860
16830
  {
15861
16831
  ref: refs.setReference,
15862
- className: cx33(styles["trigger"]),
16832
+ className: cx35(styles["trigger"]),
15863
16833
  color: "tertiary",
15864
16834
  variant: "outline",
15865
16835
  size: "medium",
15866
16836
  ...getReferenceProps(),
15867
16837
  children: [
15868
- currentOrganization ? /* @__PURE__ */ jsxs49(Fragment22, { children: [
15869
- /* @__PURE__ */ jsx109(
16838
+ currentOrganization ? /* @__PURE__ */ jsxs51(Fragment22, { children: [
16839
+ /* @__PURE__ */ jsx116(
15870
16840
  Avatar,
15871
16841
  {
15872
16842
  variant: "square",
@@ -15876,25 +16846,25 @@ var BaseOrganizationSwitcher = ({
15876
16846
  alt: `${currentOrganization.name} avatar`
15877
16847
  }
15878
16848
  ),
15879
- showTriggerLabel && /* @__PURE__ */ jsx109(Typography_default, { variant: "body2", className: cx33(styles["triggerLabel"]), children: currentOrganization.name })
15880
- ] }) : /* @__PURE__ */ jsxs49(Fragment22, { children: [
15881
- /* @__PURE__ */ jsx109(Building_default, { width: avatarSize, height: avatarSize }),
15882
- showTriggerLabel && /* @__PURE__ */ jsx109(Typography_default, { variant: "body2", className: cx33(styles["triggerLabel"]), children: t("elements.fields.organization.select.label") })
16849
+ showTriggerLabel && /* @__PURE__ */ jsx116(Typography_default, { variant: "body2", className: cx35(styles["triggerLabel"]), children: currentOrganization.name })
16850
+ ] }) : /* @__PURE__ */ jsxs51(Fragment22, { children: [
16851
+ /* @__PURE__ */ jsx116(Building_default, { width: avatarSize, height: avatarSize }),
16852
+ showTriggerLabel && /* @__PURE__ */ jsx116(Typography_default, { variant: "body2", className: cx35(styles["triggerLabel"]), children: t("elements.fields.organization.select.label") })
15883
16853
  ] }),
15884
- /* @__PURE__ */ jsx109("span", { style: { display: "inline-flex", transform: isRTL ? "scaleX(-1)" : "none" }, children: /* @__PURE__ */ jsx109(ChevronDown_default, { width: "16", height: "16" }) })
16854
+ /* @__PURE__ */ jsx116("span", { style: { display: "inline-flex", transform: isRTL ? "scaleX(-1)" : "none" }, children: /* @__PURE__ */ jsx116(ChevronDown_default, { width: "16", height: "16" }) })
15885
16855
  ]
15886
16856
  }
15887
16857
  ),
15888
- isOpen && /* @__PURE__ */ jsx109(FloatingPortal3, { id: portalId, children: /* @__PURE__ */ jsx109(FloatingFocusManager3, { context, modal: false, initialFocus: -1, children: /* @__PURE__ */ jsxs49(
16858
+ isOpen && /* @__PURE__ */ jsx116(FloatingPortal3, { id: portalId, children: /* @__PURE__ */ jsx116(FloatingFocusManager3, { context, modal: false, initialFocus: -1, children: /* @__PURE__ */ jsxs51(
15889
16859
  "div",
15890
16860
  {
15891
16861
  ref: refs.setFloating,
15892
- className: cx33(styles["content"]),
16862
+ className: cx35(styles["content"]),
15893
16863
  style: floatingStyles,
15894
16864
  ...getFloatingProps(),
15895
16865
  children: [
15896
- currentOrganization && /* @__PURE__ */ jsxs49("div", { className: cx33(styles["header"]), children: [
15897
- /* @__PURE__ */ jsx109(
16866
+ currentOrganization && /* @__PURE__ */ jsxs51("div", { className: cx35(styles["header"]), children: [
16867
+ /* @__PURE__ */ jsx116(
15898
16868
  Avatar,
15899
16869
  {
15900
16870
  variant: "square",
@@ -15904,10 +16874,10 @@ var BaseOrganizationSwitcher = ({
15904
16874
  alt: `${currentOrganization.name} avatar`
15905
16875
  }
15906
16876
  ),
15907
- /* @__PURE__ */ jsxs49("div", { className: cx33(styles["headerInfo"]), children: [
15908
- /* @__PURE__ */ jsx109(Typography_default, { noWrap: true, className: cx33(styles["headerName"]), variant: "body1", fontWeight: "medium", children: currentOrganization.name }),
15909
- /* @__PURE__ */ jsxs49("div", { className: cx33(styles["headerMeta"]), children: [
15910
- showMemberCount && currentOrganization.memberCount !== void 0 && /* @__PURE__ */ jsxs49(
16877
+ /* @__PURE__ */ jsxs51("div", { className: cx35(styles["headerInfo"]), children: [
16878
+ /* @__PURE__ */ jsx116(Typography_default, { noWrap: true, className: cx35(styles["headerName"]), variant: "body1", fontWeight: "medium", children: currentOrganization.name }),
16879
+ /* @__PURE__ */ jsxs51("div", { className: cx35(styles["headerMeta"]), children: [
16880
+ showMemberCount && currentOrganization.memberCount !== void 0 && /* @__PURE__ */ jsxs51(
15911
16881
  Typography_default,
15912
16882
  {
15913
16883
  noWrap: true,
@@ -15917,17 +16887,17 @@ var BaseOrganizationSwitcher = ({
15917
16887
  currentOrganization.memberCount,
15918
16888
  " ",
15919
16889
  currentOrganization.memberCount === 1 ? t("organization.switcher.member") : t("organization.switcher.members"),
15920
- showRole && currentOrganization.role && /* @__PURE__ */ jsxs49("span", { children: [
16890
+ showRole && currentOrganization.role && /* @__PURE__ */ jsxs51("span", { children: [
15921
16891
  " \u2022 ",
15922
16892
  currentOrganization.role
15923
16893
  ] })
15924
16894
  ]
15925
16895
  }
15926
16896
  ),
15927
- showRole && currentOrganization.role && (!showMemberCount || currentOrganization.memberCount === void 0) && /* @__PURE__ */ jsx109(Typography_default, { noWrap: true, className: cx33(styles["headerRole"]), variant: "caption", color: "secondary", children: currentOrganization.role })
16897
+ showRole && currentOrganization.role && (!showMemberCount || currentOrganization.memberCount === void 0) && /* @__PURE__ */ jsx116(Typography_default, { noWrap: true, className: cx35(styles["headerRole"]), variant: "caption", color: "secondary", children: currentOrganization.role })
15928
16898
  ] })
15929
16899
  ] }),
15930
- onManageProfile && /* @__PURE__ */ jsx109(
16900
+ onManageProfile && /* @__PURE__ */ jsx116(
15931
16901
  Button_default,
15932
16902
  {
15933
16903
  onClick: onManageProfile,
@@ -15935,8 +16905,8 @@ var BaseOrganizationSwitcher = ({
15935
16905
  variant: "outline",
15936
16906
  size: "small",
15937
16907
  "aria-label": "Manage Organization Profile",
15938
- className: cx33(styles["manageButton"]),
15939
- endIcon: /* @__PURE__ */ jsxs49(
16908
+ className: cx35(styles["manageButton"]),
16909
+ endIcon: /* @__PURE__ */ jsxs51(
15940
16910
  "svg",
15941
16911
  {
15942
16912
  width: "16",
@@ -15948,8 +16918,8 @@ var BaseOrganizationSwitcher = ({
15948
16918
  strokeLinecap: "round",
15949
16919
  strokeLinejoin: "round",
15950
16920
  children: [
15951
- /* @__PURE__ */ jsx109("circle", { cx: "12", cy: "12", r: "3" }),
15952
- /* @__PURE__ */ jsx109("path", { d: "M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1 1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z" })
16921
+ /* @__PURE__ */ jsx116("circle", { cx: "12", cy: "12", r: "3" }),
16922
+ /* @__PURE__ */ jsx116("path", { d: "M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1 1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z" })
15953
16923
  ]
15954
16924
  }
15955
16925
  ),
@@ -15957,31 +16927,31 @@ var BaseOrganizationSwitcher = ({
15957
16927
  }
15958
16928
  )
15959
16929
  ] }),
15960
- organizations.length > 1 && /* @__PURE__ */ jsx109(
16930
+ organizations.length > 1 && /* @__PURE__ */ jsx116(
15961
16931
  "div",
15962
16932
  {
15963
- className: cx33(styles["header"], styles["sectionHeaderContainer"]),
16933
+ className: cx35(styles["header"], styles["sectionHeaderContainer"]),
15964
16934
  style: {
15965
16935
  borderTop: currentOrganization ? `1px solid ${theme.vars.colors.border}` : "none"
15966
16936
  },
15967
- children: /* @__PURE__ */ jsx109(Typography_default, { variant: "caption", fontWeight: 600, className: cx33(styles["sectionHeader"]), children: t("organization.switcher.switch.organization") })
16937
+ children: /* @__PURE__ */ jsx116(Typography_default, { variant: "caption", fontWeight: 600, className: cx35(styles["sectionHeader"]), children: t("organization.switcher.switch.organization") })
15968
16938
  }
15969
16939
  ),
15970
- /* @__PURE__ */ jsx109("div", { className: cx33(styles["menu"]), children: (() => {
16940
+ /* @__PURE__ */ jsx116("div", { className: cx35(styles["menu"]), children: (() => {
15971
16941
  if (loading) {
15972
16942
  return renderLoading ? renderLoading() : defaultRenderLoading2();
15973
16943
  }
15974
16944
  if (error) {
15975
16945
  return renderError ? renderError(error) : defaultRenderError2(error);
15976
16946
  }
15977
- return /* @__PURE__ */ jsxs49(Fragment22, { children: [
16947
+ return /* @__PURE__ */ jsxs51(Fragment22, { children: [
15978
16948
  switchableOrganizations.map((organization) => {
15979
16949
  const isSelected = false;
15980
- return /* @__PURE__ */ jsx109(
16950
+ return /* @__PURE__ */ jsx116(
15981
16951
  Button_default,
15982
16952
  {
15983
16953
  onClick: () => handleOrganizationSwitch(organization),
15984
- className: cx33(styles["menuItem"]),
16954
+ className: cx35(styles["menuItem"]),
15985
16955
  color: "tertiary",
15986
16956
  variant: "text",
15987
16957
  size: "small",
@@ -15995,34 +16965,34 @@ var BaseOrganizationSwitcher = ({
15995
16965
  organization.id
15996
16966
  );
15997
16967
  }),
15998
- menuItems.length > 0 && /* @__PURE__ */ jsxs49(Fragment22, { children: [
15999
- /* @__PURE__ */ jsx109("div", { className: cx33(styles["menuDivider"]) }),
16968
+ menuItems.length > 0 && /* @__PURE__ */ jsxs51(Fragment22, { children: [
16969
+ /* @__PURE__ */ jsx116("div", { className: cx35(styles["menuDivider"]) }),
16000
16970
  menuItems.map(
16001
- (item, index) => /* @__PURE__ */ jsx109("div", { children: item.href ? /* @__PURE__ */ jsxs49(
16971
+ (item, index) => /* @__PURE__ */ jsx116("div", { children: item.href ? /* @__PURE__ */ jsxs51(
16002
16972
  "a",
16003
16973
  {
16004
16974
  href: item.href,
16005
16975
  style: {
16006
16976
  backgroundColor: hoveredItemIndex === switchableOrganizations.length + index ? theme.vars.colors.action?.hover : "transparent"
16007
16977
  },
16008
- className: cx33(styles["menuItem"]),
16978
+ className: cx35(styles["menuItem"]),
16009
16979
  onMouseEnter: () => setHoveredItemIndex(switchableOrganizations.length + index),
16010
16980
  onMouseLeave: () => setHoveredItemIndex(null),
16011
16981
  onFocus: () => setHoveredItemIndex(switchableOrganizations.length + index),
16012
16982
  onBlur: () => setHoveredItemIndex(null),
16013
16983
  children: [
16014
16984
  item.icon,
16015
- /* @__PURE__ */ jsx109("span", { children: item.label })
16985
+ /* @__PURE__ */ jsx116("span", { children: item.label })
16016
16986
  ]
16017
16987
  }
16018
- ) : /* @__PURE__ */ jsx109(
16988
+ ) : /* @__PURE__ */ jsx116(
16019
16989
  Button_default,
16020
16990
  {
16021
16991
  onClick: () => handleMenuItemClick(item),
16022
16992
  style: {
16023
16993
  backgroundColor: hoveredItemIndex === switchableOrganizations.length + index ? theme.vars.colors.action?.hover : "transparent"
16024
16994
  },
16025
- className: cx33(styles["menuItem"]),
16995
+ className: cx35(styles["menuItem"]),
16026
16996
  color: "tertiary",
16027
16997
  variant: "text",
16028
16998
  size: "small",
@@ -16044,11 +17014,11 @@ var BaseOrganizationSwitcher = ({
16044
17014
  var BaseOrganizationSwitcher_default = BaseOrganizationSwitcher;
16045
17015
 
16046
17016
  // src/components/presentation/OrganizationSwitcher/OrganizationSwitcher.tsx
16047
- import { useState as useState38 } from "react";
17017
+ import { useState as useState40 } from "react";
16048
17018
 
16049
17019
  // src/components/primitives/Icons/BuildingAlt.tsx
16050
- import { jsx as jsx110, jsxs as jsxs50 } from "react/jsx-runtime";
16051
- var BuildingAlt = ({ height = 24, width = 24 }) => /* @__PURE__ */ jsxs50(
17020
+ import { jsx as jsx117, jsxs as jsxs52 } from "react/jsx-runtime";
17021
+ var BuildingAlt = ({ height = 24, width = 24 }) => /* @__PURE__ */ jsxs52(
16052
17022
  "svg",
16053
17023
  {
16054
17024
  width,
@@ -16061,13 +17031,13 @@ var BuildingAlt = ({ height = 24, width = 24 }) => /* @__PURE__ */ jsxs50(
16061
17031
  strokeLinecap: "round",
16062
17032
  strokeLinejoin: "round",
16063
17033
  children: [
16064
- /* @__PURE__ */ jsx110("path", { d: "M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z" }),
16065
- /* @__PURE__ */ jsx110("path", { d: "M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2" }),
16066
- /* @__PURE__ */ jsx110("path", { d: "M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2" }),
16067
- /* @__PURE__ */ jsx110("path", { d: "M10 6h4" }),
16068
- /* @__PURE__ */ jsx110("path", { d: "M10 10h4" }),
16069
- /* @__PURE__ */ jsx110("path", { d: "M10 14h4" }),
16070
- /* @__PURE__ */ jsx110("path", { d: "M10 18h4" })
17034
+ /* @__PURE__ */ jsx117("path", { d: "M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z" }),
17035
+ /* @__PURE__ */ jsx117("path", { d: "M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2" }),
17036
+ /* @__PURE__ */ jsx117("path", { d: "M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2" }),
17037
+ /* @__PURE__ */ jsx117("path", { d: "M10 6h4" }),
17038
+ /* @__PURE__ */ jsx117("path", { d: "M10 10h4" }),
17039
+ /* @__PURE__ */ jsx117("path", { d: "M10 14h4" }),
17040
+ /* @__PURE__ */ jsx117("path", { d: "M10 18h4" })
16071
17041
  ]
16072
17042
  }
16073
17043
  );
@@ -16075,12 +17045,12 @@ BuildingAlt.displayName = "BuildingAlt";
16075
17045
  var BuildingAlt_default = BuildingAlt;
16076
17046
 
16077
17047
  // src/components/presentation/CreateOrganization/CreateOrganization.tsx
16078
- import { useState as useState33 } from "react";
17048
+ import { useState as useState35 } from "react";
16079
17049
 
16080
17050
  // src/components/presentation/CreateOrganization/BaseCreateOrganization.tsx
16081
17051
  import { createPackageComponentLogger as createPackageComponentLogger9 } from "@asgardeo/browser";
16082
- import { cx as cx34 } from "@emotion/css";
16083
- import { useState as useState32 } from "react";
17052
+ import { cx as cx36 } from "@emotion/css";
17053
+ import { useState as useState34 } from "react";
16084
17054
 
16085
17055
  // src/components/presentation/CreateOrganization/BaseCreateOrganization.styles.ts
16086
17056
  import { css as css31 } from "@emotion/css";
@@ -16221,7 +17191,7 @@ var useStyles30 = (theme, colorScheme) => useMemo41(() => {
16221
17191
  var BaseCreateOrganization_styles_default = useStyles30;
16222
17192
 
16223
17193
  // src/components/presentation/CreateOrganization/BaseCreateOrganization.tsx
16224
- import { jsx as jsx111, jsxs as jsxs51 } from "react/jsx-runtime";
17194
+ import { jsx as jsx118, jsxs as jsxs53 } from "react/jsx-runtime";
16225
17195
  var logger11 = createPackageComponentLogger9(
16226
17196
  "@asgardeo/react",
16227
17197
  "BaseCreateOrganization"
@@ -16248,13 +17218,13 @@ var BaseCreateOrganization = ({
16248
17218
  const { theme, colorScheme } = useTheme_default();
16249
17219
  const styles = BaseCreateOrganization_styles_default(theme, colorScheme);
16250
17220
  const { t } = useTranslation_default(preferences?.i18n);
16251
- const [formData, setFormData] = useState32({
17221
+ const [formData, setFormData] = useState34({
16252
17222
  description: "",
16253
17223
  handle: "",
16254
17224
  name: "",
16255
17225
  ...initialValues
16256
17226
  });
16257
- const [formErrors, setFormErrors] = useState32({});
17227
+ const [formErrors, setFormErrors] = useState34({});
16258
17228
  const validateForm = () => {
16259
17229
  const errors = {};
16260
17230
  if (!formData.name.trim()) {
@@ -16311,13 +17281,13 @@ var BaseCreateOrganization = ({
16311
17281
  logger11.error("Form submission error:");
16312
17282
  }
16313
17283
  };
16314
- const createOrganizationContent = /* @__PURE__ */ jsx111("div", { className: cx34(styles["root"], cardLayout && styles["card"], className), style, children: /* @__PURE__ */ jsxs51("div", { className: cx34(styles["content"]), children: [
16315
- /* @__PURE__ */ jsxs51("form", { id: "create-organization-form", className: cx34(styles["form"]), onSubmit: handleSubmit, children: [
16316
- error && /* @__PURE__ */ jsxs51(Alert_default, { variant: "error", className: styles["errorAlert"], children: [
16317
- /* @__PURE__ */ jsx111(Alert_default.Title, { children: "Error" }),
16318
- /* @__PURE__ */ jsx111(Alert_default.Description, { children: error })
17284
+ const createOrganizationContent = /* @__PURE__ */ jsx118("div", { className: cx36(styles["root"], cardLayout && styles["card"], className), style, children: /* @__PURE__ */ jsxs53("div", { className: cx36(styles["content"]), children: [
17285
+ /* @__PURE__ */ jsxs53("form", { id: "create-organization-form", className: cx36(styles["form"]), onSubmit: handleSubmit, children: [
17286
+ error && /* @__PURE__ */ jsxs53(Alert_default, { variant: "error", className: styles["errorAlert"], children: [
17287
+ /* @__PURE__ */ jsx118(Alert_default.Title, { children: "Error" }),
17288
+ /* @__PURE__ */ jsx118(Alert_default.Description, { children: error })
16319
17289
  ] }),
16320
- /* @__PURE__ */ jsx111("div", { className: cx34(styles["fieldGroup"]), children: /* @__PURE__ */ jsx111(
17290
+ /* @__PURE__ */ jsx118("div", { className: cx36(styles["fieldGroup"]), children: /* @__PURE__ */ jsx118(
16321
17291
  TextField_default,
16322
17292
  {
16323
17293
  label: `${t("elements.fields.organization.name.label")}`,
@@ -16327,10 +17297,10 @@ var BaseCreateOrganization = ({
16327
17297
  disabled: loading,
16328
17298
  required: true,
16329
17299
  error: formErrors.name,
16330
- className: cx34(styles["input"])
17300
+ className: cx36(styles["input"])
16331
17301
  }
16332
17302
  ) }),
16333
- /* @__PURE__ */ jsx111("div", { className: cx34(styles["fieldGroup"]), children: /* @__PURE__ */ jsx111(
17303
+ /* @__PURE__ */ jsx118("div", { className: cx36(styles["fieldGroup"]), children: /* @__PURE__ */ jsx118(
16334
17304
  TextField_default,
16335
17305
  {
16336
17306
  label: `${t("elements.fields.organization.handle.label") || "Organization Handle"}`,
@@ -16341,15 +17311,15 @@ var BaseCreateOrganization = ({
16341
17311
  required: true,
16342
17312
  error: formErrors.handle,
16343
17313
  helperText: "This will be your organization's unique identifier. Only lowercase letters, numbers, and hyphens are allowed.",
16344
- className: cx34(styles["input"])
17314
+ className: cx36(styles["input"])
16345
17315
  }
16346
17316
  ) }),
16347
- /* @__PURE__ */ jsx111("div", { className: cx34(styles["fieldGroup"]), children: /* @__PURE__ */ jsxs51(FormControl_default, { error: formErrors.description, children: [
16348
- /* @__PURE__ */ jsx111(InputLabel_default, { required: true, children: t("elements.fields.organization.description.label") }),
16349
- /* @__PURE__ */ jsx111(
17317
+ /* @__PURE__ */ jsx118("div", { className: cx36(styles["fieldGroup"]), children: /* @__PURE__ */ jsxs53(FormControl_default, { error: formErrors.description, children: [
17318
+ /* @__PURE__ */ jsx118(InputLabel_default, { required: true, children: t("elements.fields.organization.description.label") }),
17319
+ /* @__PURE__ */ jsx118(
16350
17320
  "textarea",
16351
17321
  {
16352
- className: cx34(styles["textarea"], formErrors.description && styles["textareaError"]),
17322
+ className: cx36(styles["textarea"], formErrors.description && styles["textareaError"]),
16353
17323
  placeholder: t("organization.create.description.placeholder"),
16354
17324
  value: formData.description,
16355
17325
  onChange: (e) => handleInputChange("description", e.target.value),
@@ -16360,15 +17330,15 @@ var BaseCreateOrganization = ({
16360
17330
  ] }) }),
16361
17331
  renderAdditionalFields && renderAdditionalFields()
16362
17332
  ] }),
16363
- /* @__PURE__ */ jsxs51("div", { className: cx34(styles["actions"]), children: [
16364
- onCancel && /* @__PURE__ */ jsx111(Button_default, { type: "button", variant: "outline", onClick: onCancel, disabled: loading, children: t("organization.create.buttons.cancel.text") }),
16365
- /* @__PURE__ */ jsx111(Button_default, { type: "submit", variant: "solid", color: "primary", disabled: loading, form: "create-organization-form", children: loading ? t("organization.create.buttons.create_organization.loading.text") : t("organization.create.buttons.create_organization.text") })
17333
+ /* @__PURE__ */ jsxs53("div", { className: cx36(styles["actions"]), children: [
17334
+ onCancel && /* @__PURE__ */ jsx118(Button_default, { type: "button", variant: "outline", onClick: onCancel, disabled: loading, children: t("organization.create.buttons.cancel.text") }),
17335
+ /* @__PURE__ */ jsx118(Button_default, { type: "submit", variant: "solid", color: "primary", disabled: loading, form: "create-organization-form", children: loading ? t("organization.create.buttons.create_organization.loading.text") : t("organization.create.buttons.create_organization.text") })
16366
17336
  ] })
16367
17337
  ] }) });
16368
17338
  if (mode === "popup") {
16369
- return /* @__PURE__ */ jsx111(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs51(Dialog_default.Content, { children: [
16370
- /* @__PURE__ */ jsx111(Dialog_default.Heading, { children: title }),
16371
- /* @__PURE__ */ jsx111("div", { className: styles["popup"], children: createOrganizationContent })
17339
+ return /* @__PURE__ */ jsx118(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs53(Dialog_default.Content, { children: [
17340
+ /* @__PURE__ */ jsx118(Dialog_default.Heading, { children: title }),
17341
+ /* @__PURE__ */ jsx118("div", { className: styles["popup"], children: createOrganizationContent })
16372
17342
  ] }) });
16373
17343
  }
16374
17344
  return createOrganizationContent;
@@ -16409,7 +17379,7 @@ var createOrganization = async ({
16409
17379
  var createOrganization_default = createOrganization;
16410
17380
 
16411
17381
  // src/components/presentation/CreateOrganization/CreateOrganization.tsx
16412
- import { Fragment as Fragment23, jsx as jsx112 } from "react/jsx-runtime";
17382
+ import { Fragment as Fragment23, jsx as jsx119 } from "react/jsx-runtime";
16413
17383
  var CreateOrganization = ({
16414
17384
  onCreateOrganization,
16415
17385
  fallback = null,
@@ -16419,13 +17389,13 @@ var CreateOrganization = ({
16419
17389
  }) => {
16420
17390
  const { isSignedIn, baseUrl, instanceId } = useAsgardeo_default();
16421
17391
  const { currentOrganization, revalidateMyOrganizations } = useOrganization_default();
16422
- const [loading, setLoading] = useState33(false);
16423
- const [error, setError] = useState33(null);
17392
+ const [loading, setLoading] = useState35(false);
17393
+ const [error, setError] = useState35(null);
16424
17394
  if (!isSignedIn && fallback) {
16425
17395
  return fallback;
16426
17396
  }
16427
17397
  if (!isSignedIn) {
16428
- return /* @__PURE__ */ jsx112(Fragment23, {});
17398
+ return /* @__PURE__ */ jsx119(Fragment23, {});
16429
17399
  }
16430
17400
  const parentId = defaultParentId || currentOrganization?.id || "";
16431
17401
  const handleSubmit = async (payload) => {
@@ -16460,7 +17430,7 @@ var CreateOrganization = ({
16460
17430
  setLoading(false);
16461
17431
  }
16462
17432
  };
16463
- return /* @__PURE__ */ jsx112(
17433
+ return /* @__PURE__ */ jsx119(
16464
17434
  BaseCreateOrganization,
16465
17435
  {
16466
17436
  onSubmit: handleSubmit,
@@ -16474,11 +17444,11 @@ var CreateOrganization = ({
16474
17444
  };
16475
17445
 
16476
17446
  // src/components/presentation/OrganizationList/OrganizationList.tsx
16477
- import { cx as cx36 } from "@emotion/css";
16478
- import { useEffect as useEffect24, useState as useState34 } from "react";
17447
+ import { cx as cx38 } from "@emotion/css";
17448
+ import { useEffect as useEffect26, useState as useState36 } from "react";
16479
17449
 
16480
17450
  // src/components/presentation/OrganizationList/BaseOrganizationList.tsx
16481
- import { cx as cx35 } from "@emotion/css";
17451
+ import { cx as cx37 } from "@emotion/css";
16482
17452
  import { useMemo as useMemo43 } from "react";
16483
17453
 
16484
17454
  // src/components/presentation/OrganizationList/BaseOrganizationList.styles.ts
@@ -16708,23 +17678,23 @@ var useStyles31 = (theme, colorScheme) => useMemo42(() => {
16708
17678
  var BaseOrganizationList_styles_default = useStyles31;
16709
17679
 
16710
17680
  // src/components/presentation/OrganizationList/BaseOrganizationList.tsx
16711
- import { jsx as jsx113, jsxs as jsxs52 } from "react/jsx-runtime";
16712
- var defaultRenderOrganization = (organization, styles, t, onOrganizationSelect, showStatus) => /* @__PURE__ */ jsxs52("div", { className: cx35(styles.organizationItem), children: [
16713
- /* @__PURE__ */ jsxs52("div", { className: cx35(styles.organizationContent), children: [
16714
- /* @__PURE__ */ jsx113(Avatar, { variant: "square", name: organization.name, size: 48, alt: `${organization.name} logo` }),
16715
- /* @__PURE__ */ jsxs52("div", { className: cx35(styles.organizationInfo), children: [
16716
- /* @__PURE__ */ jsx113(Typography_default, { variant: "h6", className: cx35(styles.organizationName), children: organization.name }),
16717
- /* @__PURE__ */ jsxs52(Typography_default, { variant: "body2", color: "textSecondary", className: cx35(styles.organizationHandle), children: [
17681
+ import { jsx as jsx120, jsxs as jsxs54 } from "react/jsx-runtime";
17682
+ var defaultRenderOrganization = (organization, styles, t, onOrganizationSelect, showStatus) => /* @__PURE__ */ jsxs54("div", { className: cx37(styles.organizationItem), children: [
17683
+ /* @__PURE__ */ jsxs54("div", { className: cx37(styles.organizationContent), children: [
17684
+ /* @__PURE__ */ jsx120(Avatar, { variant: "square", name: organization.name, size: 48, alt: `${organization.name} logo` }),
17685
+ /* @__PURE__ */ jsxs54("div", { className: cx37(styles.organizationInfo), children: [
17686
+ /* @__PURE__ */ jsx120(Typography_default, { variant: "h6", className: cx37(styles.organizationName), children: organization.name }),
17687
+ /* @__PURE__ */ jsxs54(Typography_default, { variant: "body2", color: "textSecondary", className: cx37(styles.organizationHandle), children: [
16718
17688
  "@",
16719
17689
  organization.orgHandle
16720
17690
  ] }),
16721
- showStatus && /* @__PURE__ */ jsxs52(Typography_default, { variant: "body2", color: "textSecondary", className: cx35(styles.organizationStatus), children: [
17691
+ showStatus && /* @__PURE__ */ jsxs54(Typography_default, { variant: "body2", color: "textSecondary", className: cx37(styles.organizationStatus), children: [
16722
17692
  t("organization.switcher.status.label"),
16723
17693
  " ",
16724
- /* @__PURE__ */ jsx113(
17694
+ /* @__PURE__ */ jsx120(
16725
17695
  "span",
16726
17696
  {
16727
- className: cx35(
17697
+ className: cx37(
16728
17698
  styles.statusText,
16729
17699
  organization.status === "ACTIVE" ? styles.statusTextActive : styles.statusTextInactive
16730
17700
  ),
@@ -16734,7 +17704,7 @@ var defaultRenderOrganization = (organization, styles, t, onOrganizationSelect,
16734
17704
  ] })
16735
17705
  ] })
16736
17706
  ] }),
16737
- organization.canSwitch && /* @__PURE__ */ jsx113("div", { className: cx35(styles.organizationActions), children: /* @__PURE__ */ jsx113(
17707
+ organization.canSwitch && /* @__PURE__ */ jsx120("div", { className: cx37(styles.organizationActions), children: /* @__PURE__ */ jsx120(
16738
17708
  Button_default,
16739
17709
  {
16740
17710
  onClick: (e) => {
@@ -16747,17 +17717,17 @@ var defaultRenderOrganization = (organization, styles, t, onOrganizationSelect,
16747
17717
  }
16748
17718
  ) })
16749
17719
  ] }, organization.id);
16750
- var defaultRenderLoading = (t, styles) => /* @__PURE__ */ jsxs52("div", { className: cx35(styles.loadingContainer), children: [
16751
- /* @__PURE__ */ jsx113(Spinner_default, { size: "medium" }),
16752
- /* @__PURE__ */ jsx113(Typography_default, { variant: "body1", color: "textSecondary", className: cx35(styles.loadingText), children: t("organization.switcher.loading.placeholder.organizations") })
17720
+ var defaultRenderLoading = (t, styles) => /* @__PURE__ */ jsxs54("div", { className: cx37(styles.loadingContainer), children: [
17721
+ /* @__PURE__ */ jsx120(Spinner_default, { size: "medium" }),
17722
+ /* @__PURE__ */ jsx120(Typography_default, { variant: "body1", color: "textSecondary", className: cx37(styles.loadingText), children: t("organization.switcher.loading.placeholder.organizations") })
16753
17723
  ] });
16754
- var defaultRenderError = (errorMessage, t, styles) => /* @__PURE__ */ jsx113("div", { className: cx35(styles.errorContainer), children: /* @__PURE__ */ jsxs52(Typography_default, { variant: "body1", color: "error", children: [
16755
- /* @__PURE__ */ jsx113("strong", { children: t("organization.switcher.error.prefix") }),
17724
+ var defaultRenderError = (errorMessage, t, styles) => /* @__PURE__ */ jsx120("div", { className: cx37(styles.errorContainer), children: /* @__PURE__ */ jsxs54(Typography_default, { variant: "body1", color: "error", children: [
17725
+ /* @__PURE__ */ jsx120("strong", { children: t("organization.switcher.error.prefix") }),
16756
17726
  " ",
16757
17727
  errorMessage
16758
17728
  ] }) });
16759
- var defaultRenderLoadMore = (onLoadMore, isLoadingMore, t, styles) => /* @__PURE__ */ jsx113(Button_default, { onClick: onLoadMore, disabled: isLoadingMore, className: cx35(styles.loadMoreButton), type: "button", fullWidth: true, children: isLoadingMore ? t("organization.switcher.loading.more") : t("organization.switcher.buttons.load_more.text") });
16760
- var defaultRenderEmpty = (t, styles) => /* @__PURE__ */ jsx113("div", { className: cx35(styles.emptyContainer), children: /* @__PURE__ */ jsx113(Typography_default, { variant: "body1", color: "textSecondary", className: cx35(styles.emptyText), children: t("organization.switcher.no.organizations") }) });
17729
+ var defaultRenderLoadMore = (onLoadMore, isLoadingMore, t, styles) => /* @__PURE__ */ jsx120(Button_default, { onClick: onLoadMore, disabled: isLoadingMore, className: cx37(styles.loadMoreButton), type: "button", fullWidth: true, children: isLoadingMore ? t("organization.switcher.loading.more") : t("organization.switcher.buttons.load_more.text") });
17730
+ var defaultRenderEmpty = (t, styles) => /* @__PURE__ */ jsx120("div", { className: cx37(styles.emptyContainer), children: /* @__PURE__ */ jsx120(Typography_default, { variant: "body1", color: "textSecondary", className: cx37(styles.emptyText), children: t("organization.switcher.no.organizations") }) });
16761
17731
  var BaseOrganizationList = ({
16762
17732
  className = "",
16763
17733
  allOrganizations,
@@ -16801,46 +17771,46 @@ var BaseOrganizationList = ({
16801
17771
  const renderLoadMoreWithStyles = renderLoadMore || ((onLoadMore, loadingMore) => defaultRenderLoadMore(onLoadMore, loadingMore, t, styles));
16802
17772
  const renderOrganizationWithStyles = renderOrganization || ((org) => defaultRenderOrganization(org, styles, t, onOrganizationSelect, showStatus));
16803
17773
  if (isLoading && organizationsWithSwitchAccess?.length === 0) {
16804
- const loadingContent = /* @__PURE__ */ jsx113("div", { className: cx35(styles["root"], className), style, children: renderLoadingWithStyles() });
17774
+ const loadingContent = /* @__PURE__ */ jsx120("div", { className: cx37(styles["root"], className), style, children: renderLoadingWithStyles() });
16805
17775
  if (mode === "popup") {
16806
- return /* @__PURE__ */ jsx113(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs52(Dialog_default.Content, { children: [
16807
- /* @__PURE__ */ jsx113(Dialog_default.Heading, { children: title }),
16808
- /* @__PURE__ */ jsx113("div", { className: cx35(styles["popupContent"]), children: loadingContent })
17776
+ return /* @__PURE__ */ jsx120(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs54(Dialog_default.Content, { children: [
17777
+ /* @__PURE__ */ jsx120(Dialog_default.Heading, { children: title }),
17778
+ /* @__PURE__ */ jsx120("div", { className: cx37(styles["popupContent"]), children: loadingContent })
16809
17779
  ] }) });
16810
17780
  }
16811
17781
  return loadingContent;
16812
17782
  }
16813
17783
  if (error && organizationsWithSwitchAccess?.length === 0) {
16814
- const errorContent = /* @__PURE__ */ jsx113("div", { className: cx35(styles["root"], className), style, children: renderErrorWithStyles(error) });
17784
+ const errorContent = /* @__PURE__ */ jsx120("div", { className: cx37(styles["root"], className), style, children: renderErrorWithStyles(error) });
16815
17785
  if (mode === "popup") {
16816
- return /* @__PURE__ */ jsx113(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs52(Dialog_default.Content, { children: [
16817
- /* @__PURE__ */ jsx113(Dialog_default.Heading, { children: title }),
16818
- /* @__PURE__ */ jsx113("div", { className: cx35(styles["popupContent"]), children: errorContent })
17786
+ return /* @__PURE__ */ jsx120(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs54(Dialog_default.Content, { children: [
17787
+ /* @__PURE__ */ jsx120(Dialog_default.Heading, { children: title }),
17788
+ /* @__PURE__ */ jsx120("div", { className: cx37(styles["popupContent"]), children: errorContent })
16819
17789
  ] }) });
16820
17790
  }
16821
17791
  return errorContent;
16822
17792
  }
16823
17793
  if (!isLoading && organizationsWithSwitchAccess?.length === 0) {
16824
- const emptyContent = /* @__PURE__ */ jsx113("div", { className: cx35(styles["root"], className), style, children: renderEmptyWithStyles() });
17794
+ const emptyContent = /* @__PURE__ */ jsx120("div", { className: cx37(styles["root"], className), style, children: renderEmptyWithStyles() });
16825
17795
  if (mode === "popup") {
16826
- return /* @__PURE__ */ jsx113(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs52(Dialog_default.Content, { children: [
16827
- /* @__PURE__ */ jsx113(Dialog_default.Heading, { children: title }),
16828
- /* @__PURE__ */ jsx113("div", { className: cx35(styles["popupContent"]), children: emptyContent })
17796
+ return /* @__PURE__ */ jsx120(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs54(Dialog_default.Content, { children: [
17797
+ /* @__PURE__ */ jsx120(Dialog_default.Heading, { children: title }),
17798
+ /* @__PURE__ */ jsx120("div", { className: cx37(styles["popupContent"]), children: emptyContent })
16829
17799
  ] }) });
16830
17800
  }
16831
17801
  return emptyContent;
16832
17802
  }
16833
- const organizationListContent = /* @__PURE__ */ jsxs52("div", { className: cx35(styles["root"], className), style, children: [
16834
- /* @__PURE__ */ jsxs52("div", { className: cx35(styles["header"]), children: [
16835
- /* @__PURE__ */ jsx113("div", { className: cx35(styles["headerInfo"]), children: /* @__PURE__ */ jsx113(Typography_default, { variant: "body2", color: "textSecondary", className: cx35(styles["subtitle"]), children: t("organization.switcher.showing.count", {
17803
+ const organizationListContent = /* @__PURE__ */ jsxs54("div", { className: cx37(styles["root"], className), style, children: [
17804
+ /* @__PURE__ */ jsxs54("div", { className: cx37(styles["header"]), children: [
17805
+ /* @__PURE__ */ jsx120("div", { className: cx37(styles["headerInfo"]), children: /* @__PURE__ */ jsx120(Typography_default, { variant: "body2", color: "textSecondary", className: cx37(styles["subtitle"]), children: t("organization.switcher.showing.count", {
16836
17806
  showing: organizationsWithSwitchAccess?.length,
16837
17807
  total: allOrganizations?.organizations?.length || 0
16838
17808
  }) }) }),
16839
- onRefresh && /* @__PURE__ */ jsx113(
17809
+ onRefresh && /* @__PURE__ */ jsx120(
16840
17810
  Button_default,
16841
17811
  {
16842
17812
  onClick: onRefresh,
16843
- className: cx35(styles["refreshButton"]),
17813
+ className: cx37(styles["refreshButton"]),
16844
17814
  type: "button",
16845
17815
  variant: "outline",
16846
17816
  size: "small",
@@ -16848,16 +17818,16 @@ var BaseOrganizationList = ({
16848
17818
  }
16849
17819
  )
16850
17820
  ] }),
16851
- /* @__PURE__ */ jsx113("div", { className: cx35(styles["listContainer"]), children: organizationsWithSwitchAccess?.map(
17821
+ /* @__PURE__ */ jsx120("div", { className: cx37(styles["listContainer"]), children: organizationsWithSwitchAccess?.map(
16852
17822
  (organization, index) => renderOrganizationWithStyles(organization, index)
16853
17823
  ) }),
16854
- error && organizationsWithSwitchAccess?.length > 0 && /* @__PURE__ */ jsx113("div", { className: cx35(styles["errorMargin"]), children: renderErrorWithStyles(error) }),
16855
- hasMore && fetchMore && /* @__PURE__ */ jsx113("div", { className: cx35(styles["loadMoreMargin"]), children: renderLoadMoreWithStyles(fetchMore, isLoadingMore) })
17824
+ error && organizationsWithSwitchAccess?.length > 0 && /* @__PURE__ */ jsx120("div", { className: cx37(styles["errorMargin"]), children: renderErrorWithStyles(error) }),
17825
+ hasMore && fetchMore && /* @__PURE__ */ jsx120("div", { className: cx37(styles["loadMoreMargin"]), children: renderLoadMoreWithStyles(fetchMore, isLoadingMore) })
16856
17826
  ] });
16857
17827
  if (mode === "popup") {
16858
- return /* @__PURE__ */ jsx113(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs52(Dialog_default.Content, { children: [
16859
- /* @__PURE__ */ jsx113(Dialog_default.Heading, { children: title }),
16860
- /* @__PURE__ */ jsx113("div", { className: cx35(styles["popupContent"]), children: organizationListContent })
17828
+ return /* @__PURE__ */ jsx120(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs54(Dialog_default.Content, { children: [
17829
+ /* @__PURE__ */ jsx120(Dialog_default.Heading, { children: title }),
17830
+ /* @__PURE__ */ jsx120("div", { className: cx37(styles["popupContent"]), children: organizationListContent })
16861
17831
  ] }) });
16862
17832
  }
16863
17833
  return organizationListContent;
@@ -16927,22 +17897,22 @@ var useStyles32 = (theme, colorScheme) => useMemo44(() => {
16927
17897
  var OrganizationList_styles_default = useStyles32;
16928
17898
 
16929
17899
  // src/components/presentation/OrganizationList/OrganizationList.tsx
16930
- import { jsx as jsx114 } from "react/jsx-runtime";
17900
+ import { jsx as jsx121 } from "react/jsx-runtime";
16931
17901
  var OrganizationList = (props) => {
16932
17902
  const { onOrganizationSelect, className = "", style, ...baseProps } = props;
16933
17903
  const { autoFetch, filter, limit, recursive, ...filteredBaseProps } = baseProps;
16934
17904
  const { theme, colorScheme } = useTheme_default();
16935
17905
  const styles = OrganizationList_styles_default(theme, colorScheme);
16936
17906
  const { getAllOrganizations: getAllOrganizations2, error, isLoading, myOrganizations } = useOrganization_default();
16937
- const [allOrganizations, setAllOrganizations] = useState34({
17907
+ const [allOrganizations, setAllOrganizations] = useState36({
16938
17908
  organizations: []
16939
17909
  });
16940
- useEffect24(() => {
17910
+ useEffect26(() => {
16941
17911
  (async () => {
16942
17912
  setAllOrganizations(await getAllOrganizations2());
16943
17913
  })();
16944
17914
  }, []);
16945
- return /* @__PURE__ */ jsx114("div", { className: cx36(styles["root"], className), style, children: /* @__PURE__ */ jsx114("div", { className: cx36(styles["container"]), children: /* @__PURE__ */ jsx114(
17915
+ return /* @__PURE__ */ jsx121("div", { className: cx38(styles["root"], className), style, children: /* @__PURE__ */ jsx121("div", { className: cx38(styles["container"]), children: /* @__PURE__ */ jsx121(
16946
17916
  BaseOrganizationList,
16947
17917
  {
16948
17918
  allOrganizations,
@@ -16958,12 +17928,12 @@ var OrganizationList_default = OrganizationList;
16958
17928
 
16959
17929
  // src/components/presentation/OrganizationProfile/OrganizationProfile.tsx
16960
17930
  import { createPackageComponentLogger as createPackageComponentLogger10 } from "@asgardeo/browser";
16961
- import { useEffect as useEffect25, useState as useState37 } from "react";
17931
+ import { useEffect as useEffect27, useState as useState39 } from "react";
16962
17932
 
16963
17933
  // src/components/presentation/OrganizationProfile/BaseOrganizationProfile.tsx
16964
17934
  import { formatDate } from "@asgardeo/browser";
16965
- import { cx as cx38 } from "@emotion/css";
16966
- import { useState as useState36, useCallback as useCallback22 } from "react";
17935
+ import { cx as cx40 } from "@emotion/css";
17936
+ import { useState as useState38, useCallback as useCallback25 } from "react";
16967
17937
 
16968
17938
  // src/components/presentation/OrganizationProfile/BaseOrganizationProfile.styles.ts
16969
17939
  import { css as css34 } from "@emotion/css";
@@ -17122,9 +18092,9 @@ var useStyles33 = (theme, colorScheme) => useMemo45(
17122
18092
  var BaseOrganizationProfile_styles_default = useStyles33;
17123
18093
 
17124
18094
  // src/components/primitives/KeyValueInput/KeyValueInput.tsx
17125
- import { withVendorCSSClassPrefix as withVendorCSSClassPrefix31, bem as bem22 } from "@asgardeo/browser";
17126
- import { cx as cx37 } from "@emotion/css";
17127
- import { useState as useState35, useCallback as useCallback21 } from "react";
18095
+ import { withVendorCSSClassPrefix as withVendorCSSClassPrefix33, bem as bem22 } from "@asgardeo/browser";
18096
+ import { cx as cx39 } from "@emotion/css";
18097
+ import { useState as useState37, useCallback as useCallback24 } from "react";
17128
18098
 
17129
18099
  // src/components/primitives/KeyValueInput/KeyValueInput.styles.ts
17130
18100
  import { css as css35 } from "@emotion/css";
@@ -17281,7 +18251,7 @@ var useStyles34 = (theme, colorScheme, disabled, readOnly, hasError) => useMemo4
17281
18251
  var KeyValueInput_styles_default = useStyles34;
17282
18252
 
17283
18253
  // src/components/primitives/KeyValueInput/KeyValueInput.tsx
17284
- import { jsx as jsx115, jsxs as jsxs53 } from "react/jsx-runtime";
18254
+ import { jsx as jsx122, jsxs as jsxs55 } from "react/jsx-runtime";
17285
18255
  var KeyValueInput = ({
17286
18256
  className = "",
17287
18257
  disabled = false,
@@ -17304,10 +18274,10 @@ var KeyValueInput = ({
17304
18274
  const { theme, colorScheme } = useTheme_default();
17305
18275
  const styles = KeyValueInput_styles_default(theme, colorScheme, disabled, readOnly, !!error);
17306
18276
  const initialPairs = Array.isArray(value) ? value : Object.entries(value).map(([key, val]) => ({ key, value: String(val) }));
17307
- const [pairs, setPairs] = useState35(initialPairs);
17308
- const [newKey, setNewKey] = useState35("");
17309
- const [newValue, setNewValue] = useState35("");
17310
- const handleAddPair = useCallback21(() => {
18277
+ const [pairs, setPairs] = useState37(initialPairs);
18278
+ const [newKey, setNewKey] = useState37("");
18279
+ const [newValue, setNewValue] = useState37("");
18280
+ const handleAddPair = useCallback24(() => {
17311
18281
  if (!newKey.trim() || !newValue.trim()) return;
17312
18282
  if (maxPairs && pairs.length >= maxPairs) return;
17313
18283
  const newPair = {
@@ -17325,7 +18295,7 @@ var KeyValueInput = ({
17325
18295
  onAdd(newPair);
17326
18296
  }
17327
18297
  }, [newKey, newValue, pairs, maxPairs, onChange, onAdd]);
17328
- const handleRemovePair = useCallback21(
18298
+ const handleRemovePair = useCallback24(
17329
18299
  (index) => {
17330
18300
  const pairToRemove = pairs[index];
17331
18301
  const updatedPairs = pairs.filter((_, i) => i !== index);
@@ -17339,7 +18309,7 @@ var KeyValueInput = ({
17339
18309
  },
17340
18310
  [pairs, onChange, onRemove]
17341
18311
  );
17342
- const handleUpdatePair = useCallback21(
18312
+ const handleUpdatePair = useCallback24(
17343
18313
  (index, field, newVal) => {
17344
18314
  const updatedPairs = pairs.map((pair, i) => {
17345
18315
  if (i === index) {
@@ -17358,21 +18328,21 @@ var KeyValueInput = ({
17358
18328
  const isAddDisabled = disabled || readOnly || !canAddMore || !newKey.trim() || !newValue.trim();
17359
18329
  const renderReadOnlyContent = () => {
17360
18330
  if (pairs.length === 0) {
17361
- return /* @__PURE__ */ jsx115("div", { className: cx37(withVendorCSSClassPrefix31(bem22("key-value-input", "empty-state")), styles["emptyState"]), children: "No attributes defined" });
18331
+ return /* @__PURE__ */ jsx122("div", { className: cx39(withVendorCSSClassPrefix33(bem22("key-value-input", "empty-state")), styles["emptyState"]), children: "No attributes defined" });
17362
18332
  }
17363
- return pairs.map((pair, index) => /* @__PURE__ */ jsxs53(
18333
+ return pairs.map((pair, index) => /* @__PURE__ */ jsxs55(
17364
18334
  "div",
17365
18335
  {
17366
- className: cx37(withVendorCSSClassPrefix31(bem22("key-value-input", "readonly-pair")), styles["readOnlyPair"]),
18336
+ className: cx39(withVendorCSSClassPrefix33(bem22("key-value-input", "readonly-pair")), styles["readOnlyPair"]),
17367
18337
  children: [
17368
- /* @__PURE__ */ jsxs53("span", { className: cx37(withVendorCSSClassPrefix31(bem22("key-value-input", "readonly-key")), styles["readOnlyKey"]), children: [
18338
+ /* @__PURE__ */ jsxs55("span", { className: cx39(withVendorCSSClassPrefix33(bem22("key-value-input", "readonly-key")), styles["readOnlyKey"]), children: [
17369
18339
  pair.key,
17370
18340
  ":"
17371
18341
  ] }),
17372
- /* @__PURE__ */ jsx115(
18342
+ /* @__PURE__ */ jsx122(
17373
18343
  "span",
17374
18344
  {
17375
- className: cx37(withVendorCSSClassPrefix31(bem22("key-value-input", "readonly-value")), styles["readOnlyValue"]),
18345
+ className: cx39(withVendorCSSClassPrefix33(bem22("key-value-input", "readonly-value")), styles["readOnlyValue"]),
17376
18346
  children: pair.value
17377
18347
  }
17378
18348
  )
@@ -17381,83 +18351,83 @@ var KeyValueInput = ({
17381
18351
  `${pair.key}-${index}`
17382
18352
  ));
17383
18353
  };
17384
- return /* @__PURE__ */ jsxs53("div", { className: cx37(withVendorCSSClassPrefix31(bem22("key-value-input")), styles["container"], className), children: [
17385
- label && /* @__PURE__ */ jsxs53("label", { className: cx37(withVendorCSSClassPrefix31(bem22("key-value-input", "label")), styles["label"]), children: [
18354
+ return /* @__PURE__ */ jsxs55("div", { className: cx39(withVendorCSSClassPrefix33(bem22("key-value-input")), styles["container"], className), children: [
18355
+ label && /* @__PURE__ */ jsxs55("label", { className: cx39(withVendorCSSClassPrefix33(bem22("key-value-input", "label")), styles["label"]), children: [
17386
18356
  label,
17387
- required && /* @__PURE__ */ jsx115(
18357
+ required && /* @__PURE__ */ jsx122(
17388
18358
  "span",
17389
18359
  {
17390
- className: cx37(withVendorCSSClassPrefix31(bem22("key-value-input", "required")), styles["requiredIndicator"]),
18360
+ className: cx39(withVendorCSSClassPrefix33(bem22("key-value-input", "required")), styles["requiredIndicator"]),
17391
18361
  children: " *"
17392
18362
  }
17393
18363
  )
17394
18364
  ] }),
17395
- /* @__PURE__ */ jsxs53("div", { className: cx37(withVendorCSSClassPrefix31(bem22("key-value-input", "pairs-list")), styles["pairsList"]), children: [
17396
- readOnly ? renderReadOnlyContent() : pairs.map((pair, index) => /* @__PURE__ */ jsxs53(
18365
+ /* @__PURE__ */ jsxs55("div", { className: cx39(withVendorCSSClassPrefix33(bem22("key-value-input", "pairs-list")), styles["pairsList"]), children: [
18366
+ readOnly ? renderReadOnlyContent() : pairs.map((pair, index) => /* @__PURE__ */ jsxs55(
17397
18367
  "div",
17398
18368
  {
17399
- className: cx37(withVendorCSSClassPrefix31(bem22("key-value-input", "pair-row")), styles["pairRow"]),
18369
+ className: cx39(withVendorCSSClassPrefix33(bem22("key-value-input", "pair-row")), styles["pairRow"]),
17400
18370
  children: [
17401
- /* @__PURE__ */ jsx115(
18371
+ /* @__PURE__ */ jsx122(
17402
18372
  TextField_default,
17403
18373
  {
17404
18374
  placeholder: keyPlaceholder,
17405
18375
  value: pair.key,
17406
18376
  onChange: (e) => handleUpdatePair(index, "key", e.target.value),
17407
18377
  disabled: disabled || readOnly,
17408
- className: cx37(withVendorCSSClassPrefix31(bem22("key-value-input", "pair-input")), styles["pairInput"]),
18378
+ className: cx39(withVendorCSSClassPrefix33(bem22("key-value-input", "pair-input")), styles["pairInput"]),
17409
18379
  "aria-label": `${keyLabel} ${index + 1}`
17410
18380
  }
17411
18381
  ),
17412
- /* @__PURE__ */ jsx115(
18382
+ /* @__PURE__ */ jsx122(
17413
18383
  TextField_default,
17414
18384
  {
17415
18385
  placeholder: valuePlaceholder,
17416
18386
  value: pair.value,
17417
18387
  onChange: (e) => handleUpdatePair(index, "value", e.target.value),
17418
18388
  disabled: disabled || readOnly,
17419
- className: cx37(withVendorCSSClassPrefix31(bem22("key-value-input", "pair-input")), styles["pairInput"]),
18389
+ className: cx39(withVendorCSSClassPrefix33(bem22("key-value-input", "pair-input")), styles["pairInput"]),
17420
18390
  "aria-label": `${valueLabel} ${index + 1}`
17421
18391
  }
17422
18392
  ),
17423
- !readOnly && /* @__PURE__ */ jsx115(
18393
+ !readOnly && /* @__PURE__ */ jsx122(
17424
18394
  "button",
17425
18395
  {
17426
18396
  type: "button",
17427
18397
  onClick: () => handleRemovePair(index),
17428
18398
  disabled,
17429
- className: cx37(
17430
- withVendorCSSClassPrefix31(bem22("key-value-input", "remove-button")),
18399
+ className: cx39(
18400
+ withVendorCSSClassPrefix33(bem22("key-value-input", "remove-button")),
17431
18401
  styles["removeButton"]
17432
18402
  ),
17433
18403
  "aria-label": `${removeButtonText} ${pair.key}`,
17434
- children: /* @__PURE__ */ jsx115(X_default, { width: 16, height: 16 })
18404
+ children: /* @__PURE__ */ jsx122(X_default, { width: 16, height: 16 })
17435
18405
  }
17436
18406
  )
17437
18407
  ]
17438
18408
  },
17439
18409
  `${pair.key}-${index}`
17440
18410
  )),
17441
- !readOnly && /* @__PURE__ */ jsxs53("div", { className: cx37(withVendorCSSClassPrefix31(bem22("key-value-input", "add-row")), styles["addRow"]), children: [
17442
- /* @__PURE__ */ jsx115(
18411
+ !readOnly && /* @__PURE__ */ jsxs55("div", { className: cx39(withVendorCSSClassPrefix33(bem22("key-value-input", "add-row")), styles["addRow"]), children: [
18412
+ /* @__PURE__ */ jsx122(
17443
18413
  TextField_default,
17444
18414
  {
17445
18415
  placeholder: keyPlaceholder,
17446
18416
  value: newKey,
17447
18417
  onChange: (e) => setNewKey(e.target.value),
17448
18418
  disabled,
17449
- className: cx37(withVendorCSSClassPrefix31(bem22("key-value-input", "pair-input")), styles["pairInput"]),
18419
+ className: cx39(withVendorCSSClassPrefix33(bem22("key-value-input", "pair-input")), styles["pairInput"]),
17450
18420
  "aria-label": "New key"
17451
18421
  }
17452
18422
  ),
17453
- /* @__PURE__ */ jsx115(
18423
+ /* @__PURE__ */ jsx122(
17454
18424
  TextField_default,
17455
18425
  {
17456
18426
  placeholder: valuePlaceholder,
17457
18427
  value: newValue,
17458
18428
  onChange: (e) => setNewValue(e.target.value),
17459
18429
  disabled,
17460
- className: cx37(withVendorCSSClassPrefix31(bem22("key-value-input", "pair-input")), styles["pairInput"]),
18430
+ className: cx39(withVendorCSSClassPrefix33(bem22("key-value-input", "pair-input")), styles["pairInput"]),
17461
18431
  "aria-label": "New value",
17462
18432
  onKeyPress: (e) => {
17463
18433
  if (e.key === "Enter" && !isAddDisabled) {
@@ -17466,21 +18436,21 @@ var KeyValueInput = ({
17466
18436
  }
17467
18437
  }
17468
18438
  ),
17469
- /* @__PURE__ */ jsx115(
18439
+ /* @__PURE__ */ jsx122(
17470
18440
  "button",
17471
18441
  {
17472
18442
  type: "button",
17473
18443
  onClick: handleAddPair,
17474
18444
  disabled: isAddDisabled,
17475
- className: cx37(withVendorCSSClassPrefix31(bem22("key-value-input", "add-button")), styles["addButton"]),
18445
+ className: cx39(withVendorCSSClassPrefix33(bem22("key-value-input", "add-button")), styles["addButton"]),
17476
18446
  "aria-label": "Add new key-value pair",
17477
- children: /* @__PURE__ */ jsx115(Plus_default, { width: 16, height: 16 })
18447
+ children: /* @__PURE__ */ jsx122(Plus_default, { width: 16, height: 16 })
17478
18448
  }
17479
18449
  )
17480
18450
  ] })
17481
18451
  ] }),
17482
- (helperText || error) && /* @__PURE__ */ jsx115("div", { className: cx37(withVendorCSSClassPrefix31(bem22("key-value-input", "helper-text")), styles["helperText"]), children: error || helperText }),
17483
- maxPairs && /* @__PURE__ */ jsxs53("div", { className: cx37(withVendorCSSClassPrefix31(bem22("key-value-input", "counter")), styles["counterText"]), children: [
18452
+ (helperText || error) && /* @__PURE__ */ jsx122("div", { className: cx39(withVendorCSSClassPrefix33(bem22("key-value-input", "helper-text")), styles["helperText"]), children: error || helperText }),
18453
+ maxPairs && /* @__PURE__ */ jsxs55("div", { className: cx39(withVendorCSSClassPrefix33(bem22("key-value-input", "counter")), styles["counterText"]), children: [
17484
18454
  pairs.length,
17485
18455
  " of ",
17486
18456
  maxPairs,
@@ -17491,7 +18461,7 @@ var KeyValueInput = ({
17491
18461
  var KeyValueInput_default = KeyValueInput;
17492
18462
 
17493
18463
  // src/components/presentation/OrganizationProfile/BaseOrganizationProfile.tsx
17494
- import { Fragment as Fragment24, jsx as jsx116, jsxs as jsxs54 } from "react/jsx-runtime";
18464
+ import { Fragment as Fragment24, jsx as jsx123, jsxs as jsxs56 } from "react/jsx-runtime";
17495
18465
  var BaseOrganizationProfile = ({
17496
18466
  fallback = null,
17497
18467
  className = "",
@@ -17538,9 +18508,9 @@ var BaseOrganizationProfile = ({
17538
18508
  }) => {
17539
18509
  const { theme, colorScheme } = useTheme_default();
17540
18510
  const styles = BaseOrganizationProfile_styles_default(theme, colorScheme);
17541
- const [editedOrganization, setEditedOrganization] = useState36(organization);
17542
- const [editingFields, setEditingFields] = useState36({});
17543
- const PencilIcon = () => /* @__PURE__ */ jsx116(
18511
+ const [editedOrganization, setEditedOrganization] = useState38(organization);
18512
+ const [editingFields, setEditingFields] = useState38({});
18513
+ const PencilIcon = () => /* @__PURE__ */ jsx123(
17544
18514
  "svg",
17545
18515
  {
17546
18516
  width: "16",
@@ -17551,16 +18521,16 @@ var BaseOrganizationProfile = ({
17551
18521
  strokeWidth: "2",
17552
18522
  strokeLinecap: "round",
17553
18523
  strokeLinejoin: "round",
17554
- children: /* @__PURE__ */ jsx116("path", { d: "M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z" })
18524
+ children: /* @__PURE__ */ jsx123("path", { d: "M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z" })
17555
18525
  }
17556
18526
  );
17557
- const toggleFieldEdit = useCallback22((fieldName) => {
18527
+ const toggleFieldEdit = useCallback25((fieldName) => {
17558
18528
  setEditingFields((prev) => ({
17559
18529
  ...prev,
17560
18530
  [fieldName]: !prev[fieldName]
17561
18531
  }));
17562
18532
  }, []);
17563
- const getFieldPlaceholder = useCallback22((fieldKey) => {
18533
+ const getFieldPlaceholder = useCallback25((fieldKey) => {
17564
18534
  const fieldLabels = {
17565
18535
  description: "organization description",
17566
18536
  name: "organization name",
@@ -17571,7 +18541,7 @@ var BaseOrganizationProfile = ({
17571
18541
  const fieldLabel = fieldLabels[fieldKey] || fieldKey.toLowerCase();
17572
18542
  return `Enter ${fieldLabel}`;
17573
18543
  }, []);
17574
- const handleFieldSave = useCallback22(
18544
+ const handleFieldSave = useCallback25(
17575
18545
  (fieldKey) => {
17576
18546
  if (!onUpdate || !fieldKey) return;
17577
18547
  let fieldValue;
@@ -17590,7 +18560,7 @@ var BaseOrganizationProfile = ({
17590
18560
  },
17591
18561
  [editedOrganization, organization, onUpdate, toggleFieldEdit]
17592
18562
  );
17593
- const handleFieldCancel = useCallback22(
18563
+ const handleFieldCancel = useCallback25(
17594
18564
  (fieldKey) => {
17595
18565
  setEditedOrganization((prev) => ({
17596
18566
  ...prev,
@@ -17612,7 +18582,7 @@ var BaseOrganizationProfile = ({
17612
18582
  if (isEditing && onEditValue && fieldEditable && editable) {
17613
18583
  const fieldValue = editedOrganization && key && editedOrganization[key] !== void 0 ? editedOrganization[key] : value || "";
17614
18584
  const commonProps = {
17615
- className: cx38(styles["fieldInput"]),
18585
+ className: cx40(styles["fieldInput"]),
17616
18586
  label: void 0,
17617
18587
  onChange: (e) => onEditValue(e.target ? e.target.value : e),
17618
18588
  placeholder: getFieldPlaceholder(key),
@@ -17621,7 +18591,7 @@ var BaseOrganizationProfile = ({
17621
18591
  let fieldInput;
17622
18592
  if (key === "attributes") {
17623
18593
  const attributesValue = typeof fieldValue === "object" && fieldValue !== null ? fieldValue : {};
17624
- fieldInput = /* @__PURE__ */ jsx116(
18594
+ fieldInput = /* @__PURE__ */ jsx123(
17625
18595
  KeyValueInput_default,
17626
18596
  {
17627
18597
  value: attributesValue,
@@ -17659,26 +18629,26 @@ var BaseOrganizationProfile = ({
17659
18629
  }
17660
18630
  );
17661
18631
  } else {
17662
- fieldInput = /* @__PURE__ */ jsx116(TextField_default, { ...commonProps });
18632
+ fieldInput = /* @__PURE__ */ jsx123(TextField_default, { ...commonProps });
17663
18633
  }
17664
- return /* @__PURE__ */ jsxs54(Fragment24, { children: [
17665
- /* @__PURE__ */ jsx116("span", { className: cx38(styles["label"]), children: label }),
17666
- /* @__PURE__ */ jsx116("div", { className: cx38(styles["value"]), children: fieldInput })
18634
+ return /* @__PURE__ */ jsxs56(Fragment24, { children: [
18635
+ /* @__PURE__ */ jsx123("span", { className: cx40(styles["label"]), children: label }),
18636
+ /* @__PURE__ */ jsx123("div", { className: cx40(styles["value"]), children: fieldInput })
17667
18637
  ] });
17668
18638
  }
17669
18639
  const hasValue = value !== void 0 && value !== null && value !== "";
17670
18640
  const isFieldEditable = editable && fieldEditable;
17671
18641
  let displayValue;
17672
18642
  if (hasValue) {
17673
- displayValue = key === "attributes" && typeof value === "object" && value !== null ? /* @__PURE__ */ jsx116(KeyValueInput_default, { value, readOnly: true, label: "" }) : String(renderedValue);
18643
+ displayValue = key === "attributes" && typeof value === "object" && value !== null ? /* @__PURE__ */ jsx123(KeyValueInput_default, { value, readOnly: true, label: "" }) : String(renderedValue);
17674
18644
  } else if (isFieldEditable) {
17675
18645
  displayValue = getFieldPlaceholder(key);
17676
18646
  } else {
17677
18647
  displayValue = "-";
17678
18648
  }
17679
- return /* @__PURE__ */ jsxs54(Fragment24, { children: [
17680
- /* @__PURE__ */ jsx116("span", { className: cx38(styles["label"]), children: label }),
17681
- /* @__PURE__ */ jsx116("div", { className: cx38(styles["value"], !hasValue && styles["valueEmpty"]), children: !hasValue && isFieldEditable && onStartEdit ? /* @__PURE__ */ jsx116(
18649
+ return /* @__PURE__ */ jsxs56(Fragment24, { children: [
18650
+ /* @__PURE__ */ jsx123("span", { className: cx40(styles["label"]), children: label }),
18651
+ /* @__PURE__ */ jsx123("div", { className: cx40(styles["value"], !hasValue && styles["valueEmpty"]), children: !hasValue && isFieldEditable && onStartEdit ? /* @__PURE__ */ jsx123(
17682
18652
  Button_default,
17683
18653
  {
17684
18654
  onClick: onStartEdit,
@@ -17686,7 +18656,7 @@ var BaseOrganizationProfile = ({
17686
18656
  color: "secondary",
17687
18657
  size: "small",
17688
18658
  title: "Click to edit",
17689
- className: cx38(styles["placeholderButton"]),
18659
+ className: cx40(styles["placeholderButton"]),
17690
18660
  children: displayValue
17691
18661
  }
17692
18662
  ) : displayValue })
@@ -17701,8 +18671,8 @@ var BaseOrganizationProfile = ({
17701
18671
  if (!shouldShow) {
17702
18672
  return null;
17703
18673
  }
17704
- return /* @__PURE__ */ jsxs54("div", { className: cx38(styles["field"]), children: [
17705
- /* @__PURE__ */ jsx116("div", { className: cx38(styles["fieldContent"]), children: renderField(
18674
+ return /* @__PURE__ */ jsxs56("div", { className: cx40(styles["field"]), children: [
18675
+ /* @__PURE__ */ jsx123("div", { className: cx40(styles["fieldContent"]), children: renderField(
17706
18676
  field,
17707
18677
  isFieldEditing,
17708
18678
  (value) => {
@@ -17712,8 +18682,8 @@ var BaseOrganizationProfile = ({
17712
18682
  },
17713
18683
  () => toggleFieldEdit(field.key)
17714
18684
  ) }),
17715
- isFieldEditable && /* @__PURE__ */ jsx116("div", { className: cx38(styles["fieldActions"]), children: isFieldEditing ? /* @__PURE__ */ jsxs54(Fragment24, { children: [
17716
- /* @__PURE__ */ jsx116(
18685
+ isFieldEditable && /* @__PURE__ */ jsx123("div", { className: cx40(styles["fieldActions"]), children: isFieldEditing ? /* @__PURE__ */ jsxs56(Fragment24, { children: [
18686
+ /* @__PURE__ */ jsx123(
17717
18687
  Button_default,
17718
18688
  {
17719
18689
  onClick: () => handleFieldSave(field.key),
@@ -17724,7 +18694,7 @@ var BaseOrganizationProfile = ({
17724
18694
  children: saveButtonText
17725
18695
  }
17726
18696
  ),
17727
- /* @__PURE__ */ jsx116(
18697
+ /* @__PURE__ */ jsx123(
17728
18698
  Button_default,
17729
18699
  {
17730
18700
  onClick: () => handleFieldCancel(field.key),
@@ -17735,7 +18705,7 @@ var BaseOrganizationProfile = ({
17735
18705
  children: cancelButtonText
17736
18706
  }
17737
18707
  )
17738
- ] }) : hasValue && /* @__PURE__ */ jsx116(
18708
+ ] }) : hasValue && /* @__PURE__ */ jsx123(
17739
18709
  Button_default,
17740
18710
  {
17741
18711
  onClick: () => toggleFieldEdit(field.key),
@@ -17743,8 +18713,8 @@ var BaseOrganizationProfile = ({
17743
18713
  color: "secondary",
17744
18714
  size: "small",
17745
18715
  title: "Edit field",
17746
- className: cx38(styles["editButton"]),
17747
- children: /* @__PURE__ */ jsx116(PencilIcon, {})
18716
+ className: cx40(styles["editButton"]),
18717
+ children: /* @__PURE__ */ jsx123(PencilIcon, {})
17748
18718
  }
17749
18719
  ) })
17750
18720
  ] }, field.key);
@@ -17752,23 +18722,23 @@ var BaseOrganizationProfile = ({
17752
18722
  if (!organization) {
17753
18723
  return fallback;
17754
18724
  }
17755
- const profileContent = /* @__PURE__ */ jsxs54(Card_default, { className: cx38(styles["root"], cardLayout && styles["card"], className), children: [
17756
- /* @__PURE__ */ jsxs54("div", { className: cx38(styles["header"]), children: [
17757
- /* @__PURE__ */ jsx116(Avatar, { name: getOrgInitials(organization.name), size: 80, alt: `${organization.name} logo` }),
17758
- /* @__PURE__ */ jsxs54("div", { className: cx38(styles["orgInfo"]), children: [
17759
- /* @__PURE__ */ jsx116("h2", { className: cx38(styles["name"]), children: organization.name }),
17760
- organization.orgHandle && /* @__PURE__ */ jsxs54("p", { className: cx38(styles["handle"]), children: [
18725
+ const profileContent = /* @__PURE__ */ jsxs56(Card_default, { className: cx40(styles["root"], cardLayout && styles["card"], className), children: [
18726
+ /* @__PURE__ */ jsxs56("div", { className: cx40(styles["header"]), children: [
18727
+ /* @__PURE__ */ jsx123(Avatar, { name: getOrgInitials(organization.name), size: 80, alt: `${organization.name} logo` }),
18728
+ /* @__PURE__ */ jsxs56("div", { className: cx40(styles["orgInfo"]), children: [
18729
+ /* @__PURE__ */ jsx123("h2", { className: cx40(styles["name"]), children: organization.name }),
18730
+ organization.orgHandle && /* @__PURE__ */ jsxs56("p", { className: cx40(styles["handle"]), children: [
17761
18731
  "@",
17762
18732
  organization.orgHandle
17763
18733
  ] })
17764
18734
  ] })
17765
18735
  ] }),
17766
- /* @__PURE__ */ jsx116("div", { className: cx38(styles["infoContainer"]), children: fields.map((field) => renderOrganizationField(field)) })
18736
+ /* @__PURE__ */ jsx123("div", { className: cx40(styles["infoContainer"]), children: fields.map((field) => renderOrganizationField(field)) })
17767
18737
  ] });
17768
18738
  if (mode === "popup") {
17769
- return /* @__PURE__ */ jsx116(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs54(Dialog_default.Content, { children: [
17770
- /* @__PURE__ */ jsx116(Dialog_default.Heading, { children: title }),
17771
- /* @__PURE__ */ jsx116("div", { className: cx38(styles["popup"]), children: profileContent })
18739
+ return /* @__PURE__ */ jsx123(Dialog_default, { open, onOpenChange, children: /* @__PURE__ */ jsxs56(Dialog_default.Content, { children: [
18740
+ /* @__PURE__ */ jsx123(Dialog_default.Heading, { children: title }),
18741
+ /* @__PURE__ */ jsx123("div", { className: cx40(styles["popup"]), children: profileContent })
17772
18742
  ] }) });
17773
18743
  }
17774
18744
  return profileContent;
@@ -17844,7 +18814,7 @@ var updateOrganization = async ({
17844
18814
  var updateOrganization_default = updateOrganization;
17845
18815
 
17846
18816
  // src/components/presentation/OrganizationProfile/OrganizationProfile.tsx
17847
- import { jsx as jsx117 } from "react/jsx-runtime";
18817
+ import { jsx as jsx124 } from "react/jsx-runtime";
17848
18818
  var logger12 = createPackageComponentLogger10(
17849
18819
  "@asgardeo/react",
17850
18820
  "OrganizationProfile"
@@ -17863,7 +18833,7 @@ var OrganizationProfile = ({
17863
18833
  }) => {
17864
18834
  const { baseUrl, instanceId } = useAsgardeo_default();
17865
18835
  const { t } = useTranslation_default(preferences?.i18n);
17866
- const [organization, setOrganization] = useState37(null);
18836
+ const [organization, setOrganization] = useState39(null);
17867
18837
  const fetchOrganization = async () => {
17868
18838
  if (!baseUrl || !organizationId) {
17869
18839
  return;
@@ -17880,7 +18850,7 @@ var OrganizationProfile = ({
17880
18850
  setOrganization(null);
17881
18851
  }
17882
18852
  };
17883
- useEffect25(() => {
18853
+ useEffect27(() => {
17884
18854
  fetchOrganization();
17885
18855
  }, [baseUrl, organizationId]);
17886
18856
  const handleOrganizationUpdate = async (payload) => {
@@ -17902,7 +18872,7 @@ var OrganizationProfile = ({
17902
18872
  throw err;
17903
18873
  }
17904
18874
  };
17905
- return /* @__PURE__ */ jsx117(
18875
+ return /* @__PURE__ */ jsx124(
17906
18876
  BaseOrganizationProfile_default,
17907
18877
  {
17908
18878
  organization,
@@ -17919,7 +18889,7 @@ var OrganizationProfile = ({
17919
18889
  var OrganizationProfile_default = OrganizationProfile;
17920
18890
 
17921
18891
  // src/components/presentation/OrganizationSwitcher/OrganizationSwitcher.tsx
17922
- import { Fragment as Fragment25, jsx as jsx118, jsxs as jsxs55 } from "react/jsx-runtime";
18892
+ import { Fragment as Fragment25, jsx as jsx125, jsxs as jsxs57 } from "react/jsx-runtime";
17923
18893
  var OrganizationSwitcher = ({
17924
18894
  currentOrganization: propCurrentOrganization,
17925
18895
  fallback = null,
@@ -17936,15 +18906,15 @@ var OrganizationSwitcher = ({
17936
18906
  isLoading,
17937
18907
  error
17938
18908
  } = useOrganization_default();
17939
- const [isCreateOrgOpen, setIsCreateOrgOpen] = useState38(false);
17940
- const [isProfileOpen, setIsProfileOpen] = useState38(false);
17941
- const [isOrganizationListOpen, setIsOrganizationListOpen] = useState38(false);
18909
+ const [isCreateOrgOpen, setIsCreateOrgOpen] = useState40(false);
18910
+ const [isProfileOpen, setIsProfileOpen] = useState40(false);
18911
+ const [isOrganizationListOpen, setIsOrganizationListOpen] = useState40(false);
17942
18912
  const { t } = useTranslation_default(preferences?.i18n);
17943
18913
  if (!isSignedIn && fallback) {
17944
18914
  return fallback;
17945
18915
  }
17946
18916
  if (!isSignedIn) {
17947
- return /* @__PURE__ */ jsx118(Fragment25, {});
18917
+ return /* @__PURE__ */ jsx125(Fragment25, {});
17948
18918
  }
17949
18919
  const organizations = propOrganizations || contextOrganizations || [];
17950
18920
  const currentOrganization = propCurrentOrganization || contextCurrentOrganization;
@@ -17958,19 +18928,19 @@ var OrganizationSwitcher = ({
17958
18928
  const defaultMenuItems = [];
17959
18929
  if (currentOrganization) {
17960
18930
  defaultMenuItems.push({
17961
- icon: /* @__PURE__ */ jsx118(BuildingAlt_default, {}),
18931
+ icon: /* @__PURE__ */ jsx125(BuildingAlt_default, {}),
17962
18932
  label: t("organization.switcher.manage.organizations"),
17963
18933
  onClick: handleManageOrganizations
17964
18934
  });
17965
18935
  }
17966
18936
  defaultMenuItems.push({
17967
- icon: /* @__PURE__ */ jsx118("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx118("path", { d: "M12 5v14m-7-7h14" }) }),
18937
+ icon: /* @__PURE__ */ jsx125("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx125("path", { d: "M12 5v14m-7-7h14" }) }),
17968
18938
  label: t("organization.switcher.create.organization"),
17969
18939
  onClick: () => setIsCreateOrgOpen(true)
17970
18940
  });
17971
18941
  const menuItems = props.menuItems ? [...defaultMenuItems, ...props.menuItems] : defaultMenuItems;
17972
- return /* @__PURE__ */ jsxs55(Fragment25, { children: [
17973
- /* @__PURE__ */ jsx118(
18942
+ return /* @__PURE__ */ jsxs57(Fragment25, { children: [
18943
+ /* @__PURE__ */ jsx125(
17974
18944
  BaseOrganizationSwitcher,
17975
18945
  {
17976
18946
  organizations,
@@ -17984,7 +18954,7 @@ var OrganizationSwitcher = ({
17984
18954
  ...props
17985
18955
  }
17986
18956
  ),
17987
- /* @__PURE__ */ jsx118(
18957
+ /* @__PURE__ */ jsx125(
17988
18958
  CreateOrganization,
17989
18959
  {
17990
18960
  mode: "popup",
@@ -17998,7 +18968,7 @@ var OrganizationSwitcher = ({
17998
18968
  }
17999
18969
  }
18000
18970
  ),
18001
- currentOrganization && /* @__PURE__ */ jsx118(
18971
+ currentOrganization && /* @__PURE__ */ jsx125(
18002
18972
  OrganizationProfile_default,
18003
18973
  {
18004
18974
  organizationId: currentOrganization.id,
@@ -18006,11 +18976,11 @@ var OrganizationSwitcher = ({
18006
18976
  open: isProfileOpen,
18007
18977
  onOpenChange: setIsProfileOpen,
18008
18978
  cardLayout: true,
18009
- loadingFallback: /* @__PURE__ */ jsx118("div", { children: t("organization.profile.loading") }),
18010
- errorFallback: /* @__PURE__ */ jsx118("div", { children: t("organization.profile.error") })
18979
+ loadingFallback: /* @__PURE__ */ jsx125("div", { children: t("organization.profile.loading") }),
18980
+ errorFallback: /* @__PURE__ */ jsx125("div", { children: t("organization.profile.error") })
18011
18981
  }
18012
18982
  ),
18013
- /* @__PURE__ */ jsx118(
18983
+ /* @__PURE__ */ jsx125(
18014
18984
  OrganizationList_default,
18015
18985
  {
18016
18986
  mode: "popup",
@@ -18030,7 +19000,7 @@ var OrganizationSwitcher = ({
18030
19000
  var OrganizationSwitcher_default = OrganizationSwitcher;
18031
19001
 
18032
19002
  // src/components/presentation/LanguageSwitcher/BaseLanguageSwitcher.tsx
18033
- import { cx as cx39 } from "@emotion/css";
19003
+ import { cx as cx41 } from "@emotion/css";
18034
19004
  import {
18035
19005
  autoUpdate as autoUpdate3,
18036
19006
  flip as flip3,
@@ -18044,7 +19014,7 @@ import {
18044
19014
  useInteractions as useInteractions4,
18045
19015
  useRole as useRole4
18046
19016
  } from "@floating-ui/react";
18047
- import { useEffect as useEffect26, useState as useState39 } from "react";
19017
+ import { useEffect as useEffect28, useState as useState41 } from "react";
18048
19018
 
18049
19019
  // src/components/presentation/LanguageSwitcher/BaseLanguageSwitcher.styles.ts
18050
19020
  import { css as css36 } from "@emotion/css";
@@ -18159,7 +19129,7 @@ var useStyles35 = (theme, colorScheme) => useMemo47(() => {
18159
19129
  var BaseLanguageSwitcher_styles_default = useStyles35;
18160
19130
 
18161
19131
  // src/components/presentation/LanguageSwitcher/BaseLanguageSwitcher.tsx
18162
- import { Fragment as Fragment26, jsx as jsx119, jsxs as jsxs56 } from "react/jsx-runtime";
19132
+ import { Fragment as Fragment26, jsx as jsx126, jsxs as jsxs58 } from "react/jsx-runtime";
18163
19133
  var BaseLanguageSwitcher = ({
18164
19134
  children,
18165
19135
  className,
@@ -18170,9 +19140,9 @@ var BaseLanguageSwitcher = ({
18170
19140
  }) => {
18171
19141
  const { theme, colorScheme } = useTheme_default();
18172
19142
  const styles = BaseLanguageSwitcher_styles_default(theme, colorScheme);
18173
- const [isOpen, setIsOpen] = useState39(false);
19143
+ const [isOpen, setIsOpen] = useState41(false);
18174
19144
  const hasMultipleLanguages = languages.length > 1;
18175
- useEffect26(() => {
19145
+ useEffect28(() => {
18176
19146
  if (!hasMultipleLanguages && isOpen) {
18177
19147
  setIsOpen(false);
18178
19148
  }
@@ -18189,15 +19159,15 @@ var BaseLanguageSwitcher = ({
18189
19159
  const { getReferenceProps, getFloatingProps } = useInteractions4([click, dismiss, role]);
18190
19160
  const currentOption = languages.find((l) => l.code === currentLanguage);
18191
19161
  if (children) {
18192
- return /* @__PURE__ */ jsx119(Fragment26, { children: children({
19162
+ return /* @__PURE__ */ jsx126(Fragment26, { children: children({
18193
19163
  currentLanguage,
18194
19164
  isLoading,
18195
19165
  languages,
18196
19166
  onLanguageChange
18197
19167
  }) });
18198
19168
  }
18199
- return /* @__PURE__ */ jsxs56("div", { className: cx39(styles["root"], className), children: [
18200
- /* @__PURE__ */ jsxs56(
19169
+ return /* @__PURE__ */ jsxs58("div", { className: cx41(styles["root"], className), children: [
19170
+ /* @__PURE__ */ jsxs58(
18201
19171
  "button",
18202
19172
  {
18203
19173
  ref: refs.setReference,
@@ -18207,13 +19177,13 @@ var BaseLanguageSwitcher = ({
18207
19177
  ...getReferenceProps(),
18208
19178
  className: styles["trigger"],
18209
19179
  children: [
18210
- currentOption && /* @__PURE__ */ jsx119("span", { className: styles["triggerEmoji"], children: currentOption.emoji }),
18211
- /* @__PURE__ */ jsx119("span", { className: styles["triggerLabel"], children: currentOption?.displayName ?? currentLanguage }),
18212
- hasMultipleLanguages && /* @__PURE__ */ jsx119(ChevronDown_default, {})
19180
+ currentOption && /* @__PURE__ */ jsx126("span", { className: styles["triggerEmoji"], children: currentOption.emoji }),
19181
+ /* @__PURE__ */ jsx126("span", { className: styles["triggerLabel"], children: currentOption?.displayName ?? currentLanguage }),
19182
+ hasMultipleLanguages && /* @__PURE__ */ jsx126(ChevronDown_default, {})
18213
19183
  ]
18214
19184
  }
18215
19185
  ),
18216
- isOpen && hasMultipleLanguages && /* @__PURE__ */ jsx119(FloatingPortal4, { children: /* @__PURE__ */ jsx119(FloatingFocusManager4, { context, modal: false, children: /* @__PURE__ */ jsx119(
19186
+ isOpen && hasMultipleLanguages && /* @__PURE__ */ jsx126(FloatingPortal4, { children: /* @__PURE__ */ jsx126(FloatingFocusManager4, { context, modal: false, children: /* @__PURE__ */ jsx126(
18217
19187
  "div",
18218
19188
  {
18219
19189
  ref: refs.setFloating,
@@ -18222,21 +19192,21 @@ var BaseLanguageSwitcher = ({
18222
19192
  className: styles["content"],
18223
19193
  role: "listbox",
18224
19194
  "aria-label": "Select language",
18225
- children: languages.map((lang) => /* @__PURE__ */ jsxs56(
19195
+ children: languages.map((lang) => /* @__PURE__ */ jsxs58(
18226
19196
  "button",
18227
19197
  {
18228
19198
  type: "button",
18229
19199
  role: "option",
18230
19200
  "aria-selected": lang.code === currentLanguage,
18231
- className: cx39(styles["option"], lang.code === currentLanguage && styles["optionActive"]),
19201
+ className: cx41(styles["option"], lang.code === currentLanguage && styles["optionActive"]),
18232
19202
  onClick: () => {
18233
19203
  onLanguageChange(lang.code);
18234
19204
  setIsOpen(false);
18235
19205
  },
18236
19206
  children: [
18237
- /* @__PURE__ */ jsx119("span", { className: styles["optionEmoji"], children: lang.emoji }),
18238
- /* @__PURE__ */ jsx119("span", { className: styles["optionLabel"], children: lang.displayName }),
18239
- lang.code === currentLanguage && /* @__PURE__ */ jsx119("span", { className: styles["checkIcon"], children: /* @__PURE__ */ jsx119(Check_default, {}) })
19207
+ /* @__PURE__ */ jsx126("span", { className: styles["optionEmoji"], children: lang.emoji }),
19208
+ /* @__PURE__ */ jsx126("span", { className: styles["optionLabel"], children: lang.displayName }),
19209
+ lang.code === currentLanguage && /* @__PURE__ */ jsx126("span", { className: styles["checkIcon"], children: /* @__PURE__ */ jsx126(Check_default, {}) })
18240
19210
  ]
18241
19211
  },
18242
19212
  lang.code
@@ -18249,12 +19219,12 @@ var BaseLanguageSwitcher_default = BaseLanguageSwitcher;
18249
19219
 
18250
19220
  // src/components/presentation/LanguageSwitcher/LanguageSwitcher.tsx
18251
19221
  import { resolveLocaleDisplayName, resolveLocaleEmoji } from "@asgardeo/browser";
18252
- import { useEffect as useEffect27, useMemo as useMemo48 } from "react";
19222
+ import { useEffect as useEffect29, useMemo as useMemo48 } from "react";
18253
19223
 
18254
19224
  // src/contexts/FlowMeta/useFlowMeta.ts
18255
- import { useContext as useContext16 } from "react";
19225
+ import { useContext as useContext17 } from "react";
18256
19226
  var useFlowMeta = () => {
18257
- const context = useContext16(FlowMetaContext_default);
19227
+ const context = useContext17(FlowMetaContext_default);
18258
19228
  if (!context) {
18259
19229
  throw new Error("useFlowMeta must be used within a FlowMetaProvider");
18260
19230
  }
@@ -18263,7 +19233,7 @@ var useFlowMeta = () => {
18263
19233
  var useFlowMeta_default = useFlowMeta;
18264
19234
 
18265
19235
  // src/components/presentation/LanguageSwitcher/LanguageSwitcher.tsx
18266
- import { jsx as jsx120 } from "react/jsx-runtime";
19236
+ import { jsx as jsx127 } from "react/jsx-runtime";
18267
19237
  var LanguageSwitcher = ({ children, className }) => {
18268
19238
  const { meta, switchLanguage, isLoading } = useFlowMeta_default();
18269
19239
  const { currentLanguage } = useTranslation_default();
@@ -18281,7 +19251,7 @@ var LanguageSwitcher = ({ children, className }) => {
18281
19251
  })),
18282
19252
  [effectiveLanguageCodes]
18283
19253
  );
18284
- useEffect27(() => {
19254
+ useEffect29(() => {
18285
19255
  if (availableLanguageCodes.length > 0 && !availableLanguageCodes.includes(currentLanguage)) {
18286
19256
  switchLanguage(availableLanguageCodes[0]);
18287
19257
  }
@@ -18291,7 +19261,7 @@ var LanguageSwitcher = ({ children, className }) => {
18291
19261
  switchLanguage(language);
18292
19262
  }
18293
19263
  };
18294
- return /* @__PURE__ */ jsx120(
19264
+ return /* @__PURE__ */ jsx127(
18295
19265
  BaseLanguageSwitcher_default,
18296
19266
  {
18297
19267
  currentLanguage,
@@ -18325,7 +19295,9 @@ import {
18325
19295
  EmbeddedFlowTextVariantV2,
18326
19296
  EmbeddedFlowEventTypeV2,
18327
19297
  EmbeddedSignInFlowStatusV2 as EmbeddedSignInFlowStatusV23,
18328
- EmbeddedSignInFlowTypeV2 as EmbeddedSignInFlowTypeV22
19298
+ EmbeddedSignInFlowTypeV2 as EmbeddedSignInFlowTypeV22,
19299
+ EmbeddedRecoveryFlowStatusV2,
19300
+ EmbeddedRecoveryFlowTypeV2
18329
19301
  } from "@asgardeo/browser";
18330
19302
  export {
18331
19303
  AcceptInvite_default as AcceptInvite,
@@ -18341,6 +19313,7 @@ export {
18341
19313
  BaseOrganizationList_default as BaseOrganizationList,
18342
19314
  BaseOrganizationProfile_default as BaseOrganizationProfile,
18343
19315
  BaseOrganizationSwitcher_default as BaseOrganizationSwitcher,
19316
+ BaseRecovery_default3 as BaseRecovery,
18344
19317
  BaseSignIn_default3 as BaseSignIn,
18345
19318
  BaseSignInButton_default as BaseSignInButton,
18346
19319
  BaseSignOutButton_default as BaseSignOutButton,
@@ -18369,6 +19342,8 @@ export {
18369
19342
  EmbeddedFlowComponentTypeV2 as EmbeddedFlowComponentType,
18370
19343
  EmbeddedFlowEventTypeV2 as EmbeddedFlowEventType,
18371
19344
  EmbeddedFlowTextVariantV2 as EmbeddedFlowTextVariant,
19345
+ EmbeddedRecoveryFlowStatusV2 as EmbeddedRecoveryFlowStatus,
19346
+ EmbeddedRecoveryFlowTypeV2 as EmbeddedRecoveryFlowType,
18372
19347
  EmbeddedSignInFlowStatusV23 as EmbeddedSignInFlowStatus,
18373
19348
  EmbeddedSignInFlowTypeV22 as EmbeddedSignInFlowType,
18374
19349
  Eye_default as Eye,
@@ -18405,6 +19380,7 @@ export {
18405
19380
  OrganizationUnitPicker_default as OrganizationUnitPicker,
18406
19381
  OtpField_default as OtpField,
18407
19382
  PasswordField_default as PasswordField,
19383
+ Recovery_default3 as Recovery,
18408
19384
  Select_default as Select,
18409
19385
  SignIn_default2 as SignIn,
18410
19386
  SignInButton_default as SignInButton,