@skylabs-digital/react-identity-access 2.19.0 → 2.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { jsx as s, Fragment as _, jsxs as d } from "react/jsx-runtime";
2
- import { createContext as fe, useMemo as J, useState as T, useCallback as se, useEffect as ee, useContext as ae, useRef as Qe } from "react";
3
- import { useLocation as Te, Navigate as be, useNavigate as ft, useSearchParams as gt } from "react-router-dom";
4
- class le {
2
+ import { createContext as fe, useMemo as Z, useState as T, useCallback as se, useEffect as ee, useContext as le, useRef as Ke } from "react";
3
+ import { useLocation as ke, Navigate as Se, useNavigate as gt, useSearchParams as mt } from "react-router-dom";
4
+ class ce {
5
5
  constructor(e, t = 1e4) {
6
6
  this.baseUrl = e.replace(/\/$/, ""), this.timeout = t;
7
7
  }
@@ -50,7 +50,7 @@ class le {
50
50
  return this.executeRequest("DELETE", e, void 0, t);
51
51
  }
52
52
  }
53
- class Oe {
53
+ class ze {
54
54
  constructor(e, t) {
55
55
  this.httpService = e, this.sessionManager = t;
56
56
  }
@@ -109,9 +109,9 @@ class Oe {
109
109
  })).data;
110
110
  }
111
111
  }
112
- const Le = fe(null);
113
- function mr({ config: n, children: e }) {
114
- const t = J(
112
+ const Fe = fe(null);
113
+ function yr({ config: n, children: e }) {
114
+ const t = Z(
115
115
  () => {
116
116
  var p, x, R;
117
117
  return {
@@ -132,7 +132,7 @@ function mr({ config: n, children: e }) {
132
132
  } catch {
133
133
  return null;
134
134
  }
135
- }), [o, a] = T(!r), [f, g] = T(null), w = J(() => {
135
+ }), [o, a] = T(!r), [f, g] = T(null), w = Z(() => {
136
136
  const p = () => {
137
137
  c();
138
138
  };
@@ -150,7 +150,7 @@ function mr({ config: n, children: e }) {
150
150
  if (!(!p && t.enabled && r))
151
151
  try {
152
152
  a(!0), g(null);
153
- const x = new le(n.baseUrl), F = await new Oe(x, {}).getPublicAppInfo(n.appId);
153
+ const x = new ce(n.baseUrl), F = await new ze(x, {}).getPublicAppInfo(n.appId);
154
154
  if (i(F), t.enabled)
155
155
  try {
156
156
  const E = {
@@ -177,7 +177,7 @@ function mr({ config: n, children: e }) {
177
177
  if (!p) return;
178
178
  const x = JSON.parse(p);
179
179
  if (Date.now() - x.timestamp > t.ttl * 0.5) {
180
- const F = new le(n.baseUrl), A = await new Oe(F, {}).getPublicAppInfo(n.appId);
180
+ const F = new ce(n.baseUrl), A = await new ze(F, {}).getPublicAppInfo(n.appId);
181
181
  i(A);
182
182
  const u = {
183
183
  data: A,
@@ -192,18 +192,18 @@ function mr({ config: n, children: e }) {
192
192
  }, [n, t, r]);
193
193
  return ee(() => {
194
194
  r ? I() : c();
195
- }, []), /* @__PURE__ */ s(Le.Provider, { value: w, children: e });
195
+ }, []), /* @__PURE__ */ s(Fe.Provider, { value: w, children: e });
196
196
  }
197
- function Se() {
198
- const n = ae(Le);
197
+ function ve() {
198
+ const n = le(Fe);
199
199
  if (!n)
200
200
  throw new Error("useApp must be used within an AppProvider");
201
201
  return n;
202
202
  }
203
203
  function Ze() {
204
- return ae(Le);
204
+ return le(Fe);
205
205
  }
206
- const yr = Se;
206
+ const wr = ve;
207
207
  class ie extends Error {
208
208
  constructor(e, t) {
209
209
  const r = {
@@ -214,22 +214,47 @@ class ie extends Error {
214
214
  super(t || r[e]), this.name = "SessionExpiredError", this.reason = e;
215
215
  }
216
216
  }
217
- class mt extends Error {
217
+ class yt extends Error {
218
218
  constructor(e) {
219
219
  super(`Token refresh timed out after ${e}ms`), this.name = "TokenRefreshTimeoutError", this.timeoutMs = e;
220
220
  }
221
221
  }
222
- class yt extends Error {
222
+ class wt extends Error {
223
223
  constructor(e, t) {
224
224
  super(
225
225
  `Token refresh failed after ${e} attempts: ${(t == null ? void 0 : t.message) || "Unknown error"}`
226
226
  ), this.name = "TokenRefreshError", this.attempts = e, this.lastError = t;
227
227
  }
228
228
  }
229
- class pe {
229
+ const oe = class oe {
230
230
  constructor(e = {}) {
231
231
  this.refreshPromise = null, this.refreshQueue = [], this.proactiveTimerId = null, this.backgroundRetryTimerId = null, this.isDestroyed = !1, e.tenantSlug !== void 0 ? this.storageKey = e.tenantSlug ? `auth_tokens_${e.tenantSlug}` : "auth_tokens" : this.storageKey = e.storageKey || "auth_tokens", this.autoRefresh = e.autoRefresh ?? !0, this.refreshThreshold = e.refreshThreshold || 3e5, this.onRefreshFailed = e.onRefreshFailed, this.onSessionExpired = e.onSessionExpired, this.baseUrl = e.baseUrl || "", this.proactiveRefreshMargin = e.proactiveRefreshMargin ?? 6e4, this.refreshQueueTimeout = e.refreshQueueTimeout ?? 1e4, this.maxRefreshRetries = e.maxRefreshRetries ?? 3, this.retryBackoffBase = e.retryBackoffBase ?? 1e3, this.tokenStorage = e.tokenStorage || this.createTokenStorage(this.storageKey), this.scheduleProactiveRefresh();
232
232
  }
233
+ /**
234
+ * Get or create a SessionManager instance for the given config.
235
+ * Returns the same instance when called with the same storageKey/tenantSlug.
236
+ * Mutable config (callbacks, baseUrl) is updated on the existing instance.
237
+ */
238
+ static getInstance(e = {}) {
239
+ const t = oe.resolveStorageKey(e), r = oe.instances.get(t);
240
+ if (r)
241
+ return r.updateConfig(e), r;
242
+ const i = new oe(e);
243
+ return oe.instances.set(t, i), i;
244
+ }
245
+ /** Reset all singleton instances. For testing only. */
246
+ static resetAllInstances() {
247
+ for (const e of oe.instances.values())
248
+ e.destroy();
249
+ oe.instances.clear();
250
+ }
251
+ static resolveStorageKey(e) {
252
+ return e.storageKey ? e.storageKey : e.tenantSlug !== void 0 && e.tenantSlug ? `auth_tokens_${e.tenantSlug}` : "auth_tokens";
253
+ }
254
+ /** Update mutable config (callbacks, baseUrl) on an existing instance. */
255
+ updateConfig(e) {
256
+ e.onSessionExpired !== void 0 && (this.onSessionExpired = e.onSessionExpired), e.onRefreshFailed !== void 0 && (this.onRefreshFailed = e.onRefreshFailed), e.baseUrl && (this.baseUrl = e.baseUrl);
257
+ }
233
258
  // --- Storage helpers ---
234
259
  createTokenStorage(e) {
235
260
  return {
@@ -271,7 +296,7 @@ class pe {
271
296
  }
272
297
  }
273
298
  setTokens(e) {
274
- const t = e.expiresAt || (e.expiresIn ? Date.now() + e.expiresIn * 1e3 : void 0) || pe.extractJwtExpiry(e.accessToken), r = {
299
+ const t = e.expiresAt || (e.expiresIn ? Date.now() + e.expiresIn * 1e3 : void 0) || oe.extractJwtExpiry(e.accessToken), r = {
275
300
  ...e,
276
301
  expiresAt: t
277
302
  };
@@ -281,7 +306,7 @@ class pe {
281
306
  const { accessToken: e, refreshToken: t, expiresAt: r, expiresIn: i, tokenType: o } = this.tokenStorage.get() || {};
282
307
  if (!e)
283
308
  return null;
284
- const a = r || pe.extractJwtExpiry(e);
309
+ const a = r || oe.extractJwtExpiry(e);
285
310
  return {
286
311
  accessToken: e,
287
312
  refreshToken: t,
@@ -372,7 +397,7 @@ class pe {
372
397
  return new Promise((e, t) => {
373
398
  const r = setTimeout(() => {
374
399
  const i = this.refreshQueue.findIndex((o) => o.timeoutId === r);
375
- i !== -1 && this.refreshQueue.splice(i, 1), t(new mt(this.refreshQueueTimeout));
400
+ i !== -1 && this.refreshQueue.splice(i, 1), t(new yt(this.refreshQueueTimeout));
376
401
  }, this.refreshQueueTimeout);
377
402
  this.refreshQueue.push({ resolve: e, reject: t, timeoutId: r });
378
403
  });
@@ -418,7 +443,7 @@ class pe {
418
443
  await this.sleep(a);
419
444
  }
420
445
  }
421
- throw new yt(this.maxRefreshRetries + 1, t);
446
+ throw new wt(this.maxRefreshRetries + 1, t);
422
447
  }
423
448
  /**
424
449
  * Single refresh attempt with error classification.
@@ -484,7 +509,7 @@ class pe {
484
509
  * Cancels all timers and rejects pending queue entries.
485
510
  */
486
511
  destroy() {
487
- this.isDestroyed = !0, this.cancelProactiveTimer();
512
+ this.isDestroyed = !0, oe.instances.delete(this.storageKey), this.cancelProactiveTimer();
488
513
  const e = new ie("token_invalid", "SessionManager destroyed");
489
514
  this.rejectQueue(e);
490
515
  }
@@ -522,8 +547,10 @@ class pe {
522
547
  sleep(e) {
523
548
  return new Promise((t) => setTimeout(t, e));
524
549
  }
525
- }
526
- class wt {
550
+ };
551
+ oe.instances = /* @__PURE__ */ new Map();
552
+ let we = oe;
553
+ class bt {
527
554
  constructor(e) {
528
555
  this.httpService = e;
529
556
  }
@@ -579,7 +606,7 @@ class wt {
579
606
  });
580
607
  }
581
608
  }
582
- class ze {
609
+ class _e {
583
610
  constructor(e, t) {
584
611
  this.httpService = e, this.sessionManager = t;
585
612
  }
@@ -655,7 +682,7 @@ class ze {
655
682
  };
656
683
  }
657
684
  }
658
- class bt {
685
+ class St {
659
686
  constructor(e, t) {
660
687
  this.httpService = e, this.sessionManager = t;
661
688
  }
@@ -695,7 +722,7 @@ class bt {
695
722
  });
696
723
  }
697
724
  }
698
- class we {
725
+ class be {
699
726
  constructor(e, t, r) {
700
727
  this.httpService = e, this.appId = t, this.sessionManager = r;
701
728
  }
@@ -773,7 +800,7 @@ class we {
773
800
  )).data;
774
801
  }
775
802
  }
776
- function St(n, e) {
803
+ function vt(n, e) {
777
804
  if (n === "localhost" || n.startsWith("127.") || n.startsWith("192.168."))
778
805
  return null;
779
806
  if (e) {
@@ -789,26 +816,26 @@ function St(n, e) {
789
816
  const r = n.split(".");
790
817
  return r.length >= 3 && r[0] !== "www" ? r[0] : null;
791
818
  }
792
- function vt(n, e = "tenant", t) {
819
+ function Tt(n, e = "tenant", t) {
793
820
  const i = new URLSearchParams(n).get(e);
794
821
  return i ? (t && t.setItem("tenant", i), i) : t ? t.getItem("tenant") : null;
795
822
  }
796
- function Tt(n, e, t) {
823
+ function kt(n, e, t) {
797
824
  const { tenantMode: r, baseDomain: i, selectorParam: o, fixedTenantSlug: a } = n;
798
- return r === "fixed" ? a || null : r === "subdomain" ? St(e.hostname, i) : r === "selector" ? vt(e.search, o, t) : null;
825
+ return r === "fixed" ? a || null : r === "subdomain" ? vt(e.hostname, i) : r === "selector" ? Tt(e.search, o, t) : null;
799
826
  }
800
- function kt(n, e, t) {
827
+ function xt(n, e, t) {
801
828
  if (t)
802
829
  return `${n}.${t}`;
803
830
  const r = e.split(".");
804
831
  return r.length === 2 ? `${n}.${e}` : r.length >= 3 ? (r[0] = n, r.join(".")) : null;
805
832
  }
806
- const he = "_auth";
807
- function _e(n) {
833
+ const pe = "_auth";
834
+ function We(n) {
808
835
  const e = JSON.stringify(n);
809
836
  return btoa(e).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
810
837
  }
811
- function xt(n) {
838
+ function At(n) {
812
839
  try {
813
840
  let e = n.replace(/-/g, "+").replace(/_/g, "/");
814
841
  for (; e.length % 4; )
@@ -819,16 +846,16 @@ function xt(n) {
819
846
  return null;
820
847
  }
821
848
  }
822
- function At() {
849
+ function Pt() {
823
850
  if (typeof window > "u")
824
851
  return console.log("[CrossDomainAuth] SSR environment, skipping URL token extraction"), null;
825
- const e = new URLSearchParams(window.location.search).get(he);
852
+ const e = new URLSearchParams(window.location.search).get(pe);
826
853
  if (console.log("[CrossDomainAuth] extractAuthTokensFromUrl called", {
827
854
  hasAuthParam: !!e,
828
855
  searchParams: window.location.search,
829
856
  encodedLength: e == null ? void 0 : e.length
830
857
  }), !e) return null;
831
- const t = xt(e);
858
+ const t = At(e);
832
859
  return console.log("[CrossDomainAuth] Token decode result:", {
833
860
  success: !!t,
834
861
  hasAccessToken: !!(t != null && t.accessToken),
@@ -836,17 +863,17 @@ function At() {
836
863
  expiresIn: t == null ? void 0 : t.expiresIn
837
864
  }), t;
838
865
  }
839
- function Pt() {
866
+ function Rt() {
840
867
  if (typeof window > "u") return;
841
868
  const n = new URL(window.location.href);
842
- n.searchParams.delete(he), console.log("[CrossDomainAuth] Clearing auth tokens from URL", {
869
+ n.searchParams.delete(pe), console.log("[CrossDomainAuth] Clearing auth tokens from URL", {
843
870
  oldUrl: window.location.href,
844
871
  newUrl: n.toString()
845
872
  }), window.history.replaceState({}, "", n.toString());
846
873
  }
847
- const Fe = fe(null);
848
- function wr({ config: n, children: e }) {
849
- const { baseUrl: t, appInfo: r, appId: i } = Se(), o = se(() => typeof window > "u" ? null : Tt(
874
+ const De = fe(null);
875
+ function br({ config: n, children: e }) {
876
+ const { baseUrl: t, appInfo: r, appId: i } = ve(), o = se(() => typeof window > "u" ? null : kt(
850
877
  {
851
878
  tenantMode: n.tenantMode || "selector",
852
879
  baseDomain: n.baseDomain,
@@ -858,7 +885,7 @@ function wr({ config: n, children: e }) {
858
885
  search: window.location.search
859
886
  },
860
887
  window.localStorage
861
- ), [n.tenantMode, n.baseDomain, n.selectorParam, n.fixedTenantSlug]), [a, f] = T(() => o()), g = J(
888
+ ), [n.tenantMode, n.baseDomain, n.selectorParam, n.fixedTenantSlug]), [a, f] = T(() => o()), g = Z(
862
889
  () => {
863
890
  var h, C, S;
864
891
  return {
@@ -891,7 +918,7 @@ function wr({ config: n, children: e }) {
891
918
  if (!(!C && g.enabled && w && w.domain === h))
892
919
  try {
893
920
  p(!0), R(null);
894
- const S = new le(t), y = await new we(S, i).getPublicTenantInfo(h);
921
+ const S = new ce(t), y = await new be(S, i).getPublicTenantInfo(h);
895
922
  if (c(y), g.enabled)
896
923
  try {
897
924
  const v = {
@@ -918,7 +945,7 @@ function wr({ config: n, children: e }) {
918
945
  if (!h) return;
919
946
  const C = JSON.parse(h);
920
947
  if (Date.now() - C.timestamp > g.ttl * 0.5) {
921
- const b = new le(t), v = await new we(b, i).getPublicTenantInfo(a);
948
+ const b = new ce(t), v = await new be(b, i).getPublicTenantInfo(a);
922
949
  c(v);
923
950
  const j = {
924
951
  data: v,
@@ -934,7 +961,7 @@ function wr({ config: n, children: e }) {
934
961
  if (w != null && w.id)
935
962
  try {
936
963
  u(!0), m(null);
937
- const h = new le(t), S = await new we(h, w.appId).getTenantSettings(w.id);
964
+ const h = new ce(t), S = await new be(h, w.appId).getTenantSettings(w.id);
938
965
  E(S);
939
966
  } catch (h) {
940
967
  const C = h instanceof Error ? h : new Error("Failed to load tenant settings");
@@ -997,7 +1024,7 @@ function wr({ config: n, children: e }) {
997
1024
  return;
998
1025
  }
999
1026
  if (localStorage.setItem("tenant", h), v === "subdomain") {
1000
- const j = window.location.hostname, Q = kt(
1027
+ const j = window.location.hostname, Q = xt(
1001
1028
  h,
1002
1029
  j,
1003
1030
  n.baseDomain
@@ -1011,11 +1038,11 @@ function wr({ config: n, children: e }) {
1011
1038
  }
1012
1039
  const O = y || window.location.pathname, q = new URL(`${window.location.protocol}//${Q}${O}`);
1013
1040
  new URLSearchParams(window.location.search).forEach((B, X) => {
1014
- X !== he && q.searchParams.set(X, B);
1015
- }), b && q.searchParams.set(he, _e(b)), window.location.href = q.toString();
1041
+ X !== pe && q.searchParams.set(X, B);
1042
+ }), b && q.searchParams.set(pe, We(b)), window.location.href = q.toString();
1016
1043
  } else if (v === "selector") {
1017
1044
  const j = y || window.location.pathname, Q = new URLSearchParams(window.location.search);
1018
- if (Q.set(n.selectorParam || "tenant", h), Q.delete(he), b && Q.set(he, _e(b)), S === "reload") {
1045
+ if (Q.set(n.selectorParam || "tenant", h), Q.delete(pe), b && Q.set(pe, We(b)), S === "reload") {
1019
1046
  const O = `${j}?${Q.toString()}${window.location.hash}`;
1020
1047
  window.location.href = O;
1021
1048
  } else {
@@ -1025,7 +1052,7 @@ function wr({ config: n, children: e }) {
1025
1052
  }
1026
1053
  },
1027
1054
  [n.tenantMode, n.selectorParam, n.baseDomain, L]
1028
- ), $ = J(() => ({
1055
+ ), $ = Z(() => ({
1029
1056
  // Tenant info
1030
1057
  tenant: w,
1031
1058
  tenantSlug: a,
@@ -1057,19 +1084,19 @@ function wr({ config: n, children: e }) {
1057
1084
  N,
1058
1085
  l
1059
1086
  ]);
1060
- return /* @__PURE__ */ s(Fe.Provider, { value: $, children: e });
1087
+ return /* @__PURE__ */ s(De.Provider, { value: $, children: e });
1061
1088
  }
1062
1089
  function ge() {
1063
- const n = ae(Fe);
1090
+ const n = le(De);
1064
1091
  if (!n)
1065
1092
  throw new Error("useTenant must be used within a TenantProvider");
1066
1093
  return n;
1067
1094
  }
1068
- function ke() {
1069
- return ae(Fe);
1095
+ function xe() {
1096
+ return le(De);
1070
1097
  }
1071
- const br = ge;
1072
- function Sr() {
1098
+ const Sr = ge;
1099
+ function vr() {
1073
1100
  const { settings: n, settingsSchema: e, isSettingsLoading: t, settingsError: r, validateSettings: i } = ge();
1074
1101
  return {
1075
1102
  settings: n,
@@ -1089,35 +1116,35 @@ function me() {
1089
1116
  retry: i
1090
1117
  };
1091
1118
  }
1092
- const De = fe(null);
1093
- function vr({ config: n = {}, children: e }) {
1094
- const { appId: t, baseUrl: r } = Se(), { tenant: i, tenantSlug: o, switchTenant: a } = ge(), [f, g] = T(n.initialRoles || []), [w, c] = T(!n.initialRoles), [I, p] = T(null), [x, R] = T(!1), [F, E] = T(null), [A, u] = T(0), [k, m] = T(() => {
1119
+ const Ne = fe(null);
1120
+ function Tr({ config: n = {}, children: e }) {
1121
+ const { appId: t, baseUrl: r } = ve(), { tenant: i, tenantSlug: o, switchTenant: a } = ge(), [f, g] = T(n.initialRoles || []), [w, c] = T(!n.initialRoles), [I, p] = T(null), [x, R] = T(!1), [F, E] = T(null), [A, u] = T(0), [k, m] = T(() => {
1095
1122
  try {
1096
1123
  const G = localStorage.getItem("userTenants");
1097
1124
  return G ? JSON.parse(G) : [];
1098
1125
  } catch {
1099
1126
  return [];
1100
1127
  }
1101
- }), [M, L] = T(!1), D = Qe({ done: !1, urlTokens: null });
1102
- D.current.done || (D.current.done = !0, D.current.urlTokens = At(), D.current.urlTokens && console.log(
1128
+ }), [M, L] = T(!1), D = Ke({ done: !1, urlTokens: null });
1129
+ D.current.done || (D.current.done = !0, D.current.urlTokens = Pt(), D.current.urlTokens && console.log(
1103
1130
  "[AuthProvider] SYNC: URL tokens found, will block isAuthReady until user loaded"
1104
1131
  ));
1105
1132
  const [P, U] = T(() => {
1106
1133
  const G = D.current.urlTokens !== null;
1107
1134
  return console.log("[AuthProvider] SYNC: isLoadingAfterUrlTokens initial:", G), G;
1108
- }), l = J(() => {
1109
- const G = new pe({
1135
+ }), l = Z(() => {
1136
+ const G = we.getInstance({
1110
1137
  tenantSlug: o,
1111
1138
  baseUrl: r,
1112
1139
  refreshQueueTimeout: n.refreshQueueTimeout,
1113
1140
  proactiveRefreshMargin: n.proactiveRefreshMargin,
1114
- onSessionExpired: (ue) => {
1141
+ onSessionExpired: (he) => {
1115
1142
  p(null), E(null), m([]), L(!1);
1116
1143
  try {
1117
1144
  localStorage.removeItem("userTenants");
1118
1145
  } catch {
1119
1146
  }
1120
- n.onSessionExpired ? n.onSessionExpired(ue) : n.onRefreshFailed && n.onRefreshFailed();
1147
+ n.onSessionExpired ? n.onSessionExpired(he) : n.onRefreshFailed && n.onRefreshFailed();
1121
1148
  }
1122
1149
  });
1123
1150
  return D.current.urlTokens && (console.log("[AuthProvider] SYNC: Saving URL tokens to session manager"), G.setTokens({
@@ -1125,10 +1152,10 @@ function vr({ config: n = {}, children: e }) {
1125
1152
  refreshToken: D.current.urlTokens.refreshToken,
1126
1153
  expiresIn: D.current.urlTokens.expiresIn
1127
1154
  }), console.log("[AuthProvider] SYNC: Session valid:", G.hasValidSession())), G;
1128
- }, [o, r, n.refreshQueueTimeout, n.proactiveRefreshMargin]), [N, $] = T(() => D.current.urlTokens ? !1 : l.hasValidSession()), h = D.current.done && !P && !N, C = J(() => {
1129
- const G = new le(r);
1155
+ }, [o, r, n.refreshQueueTimeout, n.proactiveRefreshMargin]), [N, $] = T(() => D.current.urlTokens ? !1 : l.hasValidSession()), h = D.current.done && !P && !N, C = Z(() => {
1156
+ const G = new ce(r);
1130
1157
  return G.setSessionManager(l), G;
1131
- }, [r, l]), S = J(() => new wt(new le(r)), [r]), b = J(() => new bt(C, l), [C, l]), y = J(() => new ze(new le(r)), [r]), v = J(() => I || l.getUser(), [I, l]), j = J(() => v != null && v.roleId && f.find((G) => G.id === v.roleId) || null, [v, f]), Q = J(() => (j == null ? void 0 : j.permissions) || [], [j]), O = J(() => l.hasValidSession() && I !== null, [l, I]), q = 5 * 60 * 1e3, W = J(() => {
1158
+ }, [r, l]), S = Z(() => new bt(new ce(r)), [r]), b = Z(() => new St(C, l), [C, l]), y = Z(() => new _e(new ce(r)), [r]), v = Z(() => I || l.getUser(), [I, l]), j = Z(() => v != null && v.roleId && f.find((G) => G.id === v.roleId) || null, [v, f]), Q = Z(() => (j == null ? void 0 : j.permissions) || [], [j]), O = Z(() => l.hasValidSession() && I !== null, [l, I]), q = 5 * 60 * 1e3, W = Z(() => {
1132
1159
  const G = async (H = !1) => {
1133
1160
  try {
1134
1161
  if (!l.hasValidSession())
@@ -1142,112 +1169,112 @@ function vr({ config: n = {}, children: e }) {
1142
1169
  return;
1143
1170
  }
1144
1171
  R(!0), E(null);
1145
- const K = await b.getUserById(V);
1146
- p(K), l.setUser(K), u(Date.now());
1172
+ const J = await b.getUserById(V);
1173
+ p(J), l.setUser(J), u(Date.now());
1147
1174
  } catch (z) {
1148
1175
  const Y = z instanceof Error ? z : new Error("Failed to load user data");
1149
1176
  E(Y), console.error("[AuthProvider] Failed to load user data:", Y);
1150
1177
  } finally {
1151
1178
  R(!1);
1152
1179
  }
1153
- }, ue = async () => {
1180
+ }, he = async () => {
1154
1181
  await G();
1155
- }, xe = async (H) => {
1156
- var Be;
1157
- const { username: z, password: Y, tenantSlug: V, redirectPath: K } = H;
1182
+ }, Ae = async (H) => {
1183
+ var qe;
1184
+ const { username: z, password: Y, tenantSlug: V, redirectPath: J } = H;
1158
1185
  let te = i == null ? void 0 : i.id, re = o, ne = l;
1159
- V && (te = (await new we(C, t).getPublicTenantInfo(V)).id, re = V);
1160
- const Z = await S.login({
1186
+ V && (te = (await new be(C, t).getPublicTenantInfo(V)).id, re = V);
1187
+ const K = await S.login({
1161
1188
  username: z,
1162
1189
  password: Y,
1163
1190
  appId: t,
1164
1191
  tenantId: te
1165
1192
  }), ye = V && V !== o;
1166
- if (ye && (ne = new pe({
1193
+ if (ye && (ne = new we({
1167
1194
  tenantSlug: re,
1168
1195
  baseUrl: r
1169
1196
  })), ne.setTokens({
1170
- accessToken: Z.accessToken,
1171
- refreshToken: Z.refreshToken,
1172
- expiresIn: Z.expiresIn
1173
- }), Z.user) {
1174
- ne.setUser(Z.user), p(Z.user);
1197
+ accessToken: K.accessToken,
1198
+ refreshToken: K.refreshToken,
1199
+ expiresIn: K.expiresIn
1200
+ }), K.user) {
1201
+ ne.setUser(K.user), p(K.user);
1175
1202
  try {
1176
1203
  await G();
1177
- } catch (ve) {
1178
- console.warn("Failed to load complete user data after login:", ve);
1204
+ } catch (Te) {
1205
+ console.warn("Failed to load complete user data after login:", Te);
1179
1206
  }
1180
1207
  }
1181
- if (Z.tenants && Z.tenants.length > 0) {
1182
- m(Z.tenants);
1208
+ if (K.tenants && K.tenants.length > 0) {
1209
+ m(K.tenants);
1183
1210
  try {
1184
- localStorage.setItem("userTenants", JSON.stringify(Z.tenants));
1211
+ localStorage.setItem("userTenants", JSON.stringify(K.tenants));
1185
1212
  } catch {
1186
1213
  }
1187
1214
  }
1188
- const Re = ((Be = Z.user) == null ? void 0 : Be.tenantId) !== null;
1189
- L(Re);
1190
- const Ie = {
1191
- accessToken: Z.accessToken,
1192
- refreshToken: Z.refreshToken,
1193
- expiresIn: Z.expiresIn
1215
+ const Ie = ((qe = K.user) == null ? void 0 : qe.tenantId) !== null;
1216
+ L(Ie);
1217
+ const Ee = {
1218
+ accessToken: K.accessToken,
1219
+ refreshToken: K.refreshToken,
1220
+ expiresIn: K.expiresIn
1194
1221
  };
1195
1222
  if (ye && re)
1196
- return a(re, { tokens: Ie, redirectPath: K }), Z;
1197
- if (K && K !== window.location.pathname)
1198
- return a(re || o || "", { tokens: Ie, redirectPath: K }), Z;
1199
- if (!Re && Z.tenants && Z.tenants.length > 0) {
1200
- const ve = H.autoSwitch !== !1 && n.autoSwitchSingleTenant !== !1;
1201
- if (Z.tenants.length === 1 && ve) {
1202
- const qe = Z.tenants[0];
1203
- return a(qe.subdomain, { tokens: Ie, redirectPath: K }), Z;
1204
- } else Z.tenants.length > 1 && n.onTenantSelectionRequired && n.onTenantSelectionRequired(Z.tenants);
1223
+ return a(re, { tokens: Ee, redirectPath: J }), K;
1224
+ if (J && J !== window.location.pathname)
1225
+ return a(re || o || "", { tokens: Ee, redirectPath: J }), K;
1226
+ if (!Ie && K.tenants && K.tenants.length > 0) {
1227
+ const Te = H.autoSwitch !== !1 && n.autoSwitchSingleTenant !== !1;
1228
+ if (K.tenants.length === 1 && Te) {
1229
+ const Oe = K.tenants[0];
1230
+ return a(Oe.subdomain, { tokens: Ee, redirectPath: J }), K;
1231
+ } else K.tenants.length > 1 && n.onTenantSelectionRequired && n.onTenantSelectionRequired(K.tenants);
1205
1232
  }
1206
- return Z;
1207
- }, Ae = async (H) => {
1208
- const { email: z, phoneNumber: Y, name: V, password: K, lastName: te, tenantId: re } = H;
1233
+ return K;
1234
+ }, Pe = async (H) => {
1235
+ const { email: z, phoneNumber: Y, name: V, password: J, lastName: te, tenantId: re } = H;
1209
1236
  if (!z && !Y)
1210
1237
  throw new Error("Either email or phoneNumber is required");
1211
- if (!V || !K)
1238
+ if (!V || !J)
1212
1239
  throw new Error("Name and password are required");
1213
1240
  const ne = re ?? (i == null ? void 0 : i.id);
1214
1241
  return await S.signup({
1215
1242
  email: z,
1216
1243
  phoneNumber: Y,
1217
1244
  name: V,
1218
- password: K,
1245
+ password: J,
1219
1246
  tenantId: ne,
1220
1247
  lastName: te,
1221
1248
  appId: t
1222
1249
  });
1223
- }, tt = async (H) => {
1224
- const { email: z, phoneNumber: Y, name: V, password: K, tenantName: te, lastName: re } = H;
1250
+ }, rt = async (H) => {
1251
+ const { email: z, phoneNumber: Y, name: V, password: J, tenantName: te, lastName: re } = H;
1225
1252
  if (!z && !Y)
1226
1253
  throw new Error("Either email or phoneNumber is required");
1227
- if (!V || !K || !te)
1254
+ if (!V || !J || !te)
1228
1255
  throw new Error("Name, password, and tenantName are required");
1229
1256
  return await S.signupTenantAdmin({
1230
1257
  email: z,
1231
1258
  phoneNumber: Y,
1232
1259
  name: V,
1233
- password: K,
1260
+ password: J,
1234
1261
  tenantName: te,
1235
1262
  appId: t,
1236
1263
  lastName: re
1237
1264
  });
1238
- }, rt = async (H) => {
1265
+ }, nt = async (H) => {
1239
1266
  const { currentPassword: z, newPassword: Y } = H, V = await l.getAuthHeaders();
1240
1267
  await S.changePassword({ currentPassword: z, newPassword: Y }, V);
1241
- }, nt = async (H) => {
1268
+ }, st = async (H) => {
1242
1269
  const { email: z, tenantId: Y } = H, V = Y ?? (i == null ? void 0 : i.id);
1243
1270
  if (!V)
1244
1271
  throw new Error("tenantId is required for password reset");
1245
1272
  await S.requestPasswordReset({ email: z, tenantId: V });
1246
- }, st = async (H) => {
1273
+ }, it = async (H) => {
1247
1274
  const { token: z, newPassword: Y } = H;
1248
1275
  await S.confirmPasswordReset({ token: z, newPassword: Y });
1249
- }, it = async (H) => {
1250
- const { email: z, frontendUrl: Y, name: V, lastName: K, tenantId: te } = H, re = te ?? (i == null ? void 0 : i.id);
1276
+ }, ot = async (H) => {
1277
+ const { email: z, frontendUrl: Y, name: V, lastName: J, tenantId: te } = H, re = te ?? (i == null ? void 0 : i.id);
1251
1278
  if (!re)
1252
1279
  throw new Error("tenantId is required for magic link authentication");
1253
1280
  return await S.sendMagicLink({
@@ -1255,20 +1282,20 @@ function vr({ config: n = {}, children: e }) {
1255
1282
  tenantId: re,
1256
1283
  frontendUrl: Y,
1257
1284
  name: V,
1258
- lastName: K,
1285
+ lastName: J,
1259
1286
  appId: t
1260
1287
  });
1261
- }, ot = async (H) => {
1288
+ }, at = async (H) => {
1262
1289
  const { token: z, email: Y, tenantSlug: V } = H;
1263
- let K = i == null ? void 0 : i.id, te = o, re = l;
1264
- V && (K = (await new we(C, t).getPublicTenantInfo(V)).id, te = V);
1290
+ let J = i == null ? void 0 : i.id, te = o, re = l;
1291
+ V && (J = (await new be(C, t).getPublicTenantInfo(V)).id, te = V);
1265
1292
  const ne = await S.verifyMagicLink({
1266
1293
  token: z,
1267
1294
  email: Y,
1268
1295
  appId: t,
1269
- tenantId: K
1270
- }), Z = V && V !== o;
1271
- if (Z && (re = new pe({
1296
+ tenantId: J
1297
+ }), K = V && V !== o;
1298
+ if (K && (re = new we({
1272
1299
  tenantSlug: te,
1273
1300
  baseUrl: r
1274
1301
  })), re.setTokens({
@@ -1283,14 +1310,14 @@ function vr({ config: n = {}, children: e }) {
1283
1310
  console.warn("Failed to load complete user data after magic link login:", ye);
1284
1311
  }
1285
1312
  }
1286
- return Z && te && te !== o && a(te, {
1313
+ return K && te && te !== o && a(te, {
1287
1314
  tokens: {
1288
1315
  accessToken: ne.accessToken,
1289
1316
  refreshToken: ne.refreshToken,
1290
1317
  expiresIn: ne.expiresIn
1291
1318
  }
1292
1319
  }), ne;
1293
- }, at = async () => {
1320
+ }, lt = async () => {
1294
1321
  const H = l.getTokens();
1295
1322
  if (!(H != null && H.refreshToken))
1296
1323
  throw new Error("No refresh token available");
@@ -1302,17 +1329,17 @@ function vr({ config: n = {}, children: e }) {
1302
1329
  refreshToken: z.refreshToken || H.refreshToken,
1303
1330
  expiresIn: z.expiresIn
1304
1331
  });
1305
- }, lt = () => {
1332
+ }, ct = () => {
1306
1333
  l.clearSession(), p(null), E(null), m([]), L(!1);
1307
1334
  try {
1308
1335
  localStorage.removeItem("userTenants");
1309
1336
  } catch {
1310
1337
  }
1311
- }, ct = (H) => {
1338
+ }, dt = (H) => {
1312
1339
  l.setTokens(H);
1313
- }, dt = () => l.hasValidSession(), ut = () => {
1340
+ }, ut = () => l.hasValidSession(), ht = () => {
1314
1341
  l.clearSession(), p(null), E(null);
1315
- }, ht = async () => {
1342
+ }, pt = async () => {
1316
1343
  if (t)
1317
1344
  try {
1318
1345
  c(!0);
@@ -1323,9 +1350,9 @@ function vr({ config: n = {}, children: e }) {
1323
1350
  } finally {
1324
1351
  c(!1);
1325
1352
  }
1326
- }, pt = async () => {
1327
- await ht();
1328
- }, Pe = (H) => {
1353
+ }, ft = async () => {
1354
+ await pt();
1355
+ }, Re = (H) => {
1329
1356
  if (!Q || Q.length === 0)
1330
1357
  return !1;
1331
1358
  if (typeof H == "string")
@@ -1338,35 +1365,35 @@ function vr({ config: n = {}, children: e }) {
1338
1365
  isAuthenticated: O,
1339
1366
  sessionManager: l,
1340
1367
  authenticatedHttpService: C,
1341
- login: xe,
1342
- signup: Ae,
1343
- signupTenantAdmin: tt,
1344
- sendMagicLink: it,
1345
- verifyMagicLink: ot,
1346
- changePassword: rt,
1347
- requestPasswordReset: nt,
1348
- confirmPasswordReset: st,
1349
- refreshToken: at,
1350
- logout: lt,
1351
- setTokens: ct,
1352
- hasValidSession: dt,
1353
- clearSession: ut,
1368
+ login: Ae,
1369
+ signup: Pe,
1370
+ signupTenantAdmin: rt,
1371
+ sendMagicLink: ot,
1372
+ verifyMagicLink: at,
1373
+ changePassword: nt,
1374
+ requestPasswordReset: st,
1375
+ confirmPasswordReset: it,
1376
+ refreshToken: lt,
1377
+ logout: ct,
1378
+ setTokens: dt,
1379
+ hasValidSession: ut,
1380
+ clearSession: ht,
1354
1381
  currentUser: I,
1355
1382
  isUserLoading: x,
1356
1383
  userError: F,
1357
1384
  loadUserData: G,
1358
- refreshUser: ue,
1385
+ refreshUser: he,
1359
1386
  isAuthInitializing: !h,
1360
1387
  isAuthReady: h,
1361
1388
  userRole: j,
1362
1389
  userPermissions: Q,
1363
1390
  availableRoles: f,
1364
1391
  rolesLoading: w,
1365
- hasPermission: Pe,
1366
- hasAnyPermission: (H) => H.some((z) => Pe(z)),
1367
- hasAllPermissions: (H) => H.every((z) => Pe(z)),
1392
+ hasPermission: Re,
1393
+ hasAnyPermission: (H) => H.some((z) => Re(z)),
1394
+ hasAllPermissions: (H) => H.every((z) => Re(z)),
1368
1395
  getUserPermissionStrings: () => Q || [],
1369
- refreshRoles: pt,
1396
+ refreshRoles: ft,
1370
1397
  // RFC-004: Multi-tenant user membership
1371
1398
  userTenants: k,
1372
1399
  hasTenantContext: M,
@@ -1374,22 +1401,22 @@ function vr({ config: n = {}, children: e }) {
1374
1401
  const { redirectPath: Y } = z || {}, V = l.getTokens();
1375
1402
  if (!(V != null && V.refreshToken))
1376
1403
  throw new Error("No refresh token available for tenant switch");
1377
- const K = await S.switchTenant({
1404
+ const J = await S.switchTenant({
1378
1405
  refreshToken: V.refreshToken,
1379
1406
  tenantId: H
1380
1407
  });
1381
1408
  l.setTokens({
1382
- accessToken: K.accessToken,
1409
+ accessToken: J.accessToken,
1383
1410
  refreshToken: V.refreshToken,
1384
1411
  // Keep the same refresh token
1385
- expiresIn: K.expiresIn
1386
- }), p(K.user), l.setUser(K.user), L(!0);
1412
+ expiresIn: J.expiresIn
1413
+ }), p(J.user), l.setUser(J.user), L(!0);
1387
1414
  const te = k.find((re) => re.id === H);
1388
1415
  te && a(te.subdomain, {
1389
1416
  tokens: {
1390
- accessToken: K.accessToken,
1417
+ accessToken: J.accessToken,
1391
1418
  refreshToken: V.refreshToken,
1392
- expiresIn: K.expiresIn
1419
+ expiresIn: J.expiresIn
1393
1420
  },
1394
1421
  redirectPath: Y
1395
1422
  });
@@ -1431,10 +1458,10 @@ function vr({ config: n = {}, children: e }) {
1431
1458
  !n.initialRoles && t && (async () => {
1432
1459
  try {
1433
1460
  c(!0);
1434
- const ue = new le(r), xe = new ze(ue), { roles: Ae } = await xe.getRolesByApp(t);
1435
- g(Ae);
1436
- } catch (ue) {
1437
- console.error("Failed to fetch roles:", ue);
1461
+ const he = new ce(r), Ae = new _e(he), { roles: Pe } = await Ae.getRolesByApp(t);
1462
+ g(Pe);
1463
+ } catch (he) {
1464
+ console.error("Failed to fetch roles:", he);
1438
1465
  } finally {
1439
1466
  c(!1);
1440
1467
  }
@@ -1442,7 +1469,7 @@ function vr({ config: n = {}, children: e }) {
1442
1469
  }, [t, r, n.initialRoles]);
1443
1470
  const [B, X] = T(!1);
1444
1471
  return ee(() => {
1445
- B || (X(!0), D.current.urlTokens && (console.log("[AuthProvider] EFFECT: Cleaning up URL after sync token processing"), Pt(), U(!0), console.log("[AuthProvider] EFFECT: Loading user data (blocking isAuthReady)..."), W.loadUserData().catch((G) => {
1472
+ B || (X(!0), D.current.urlTokens && (console.log("[AuthProvider] EFFECT: Cleaning up URL after sync token processing"), Rt(), U(!0), console.log("[AuthProvider] EFFECT: Loading user data (blocking isAuthReady)..."), W.loadUserData().catch((G) => {
1446
1473
  console.error("[AuthProvider] Failed to load user data:", G);
1447
1474
  }).finally(() => {
1448
1475
  console.log("[AuthProvider] EFFECT: User data loaded, releasing isAuthReady"), U(!1);
@@ -1463,18 +1490,18 @@ function vr({ config: n = {}, children: e }) {
1463
1490
  });
1464
1491
  }, q);
1465
1492
  return () => clearInterval(G);
1466
- }, [l, I, W, q]), /* @__PURE__ */ s(De.Provider, { value: W, children: e });
1493
+ }, [l, I, W, q]), /* @__PURE__ */ s(Ne.Provider, { value: W, children: e });
1467
1494
  }
1468
- function de() {
1469
- const n = ae(De);
1495
+ function ue() {
1496
+ const n = le(Ne);
1470
1497
  if (!n)
1471
1498
  throw new Error("useAuth must be used within an AuthProvider");
1472
1499
  return n;
1473
1500
  }
1474
- function Ne() {
1475
- return ae(De);
1501
+ function Ce() {
1502
+ return le(Ne);
1476
1503
  }
1477
- class Rt {
1504
+ class It {
1478
1505
  constructor(e, t) {
1479
1506
  this.httpService = e, this.sessionManager = t;
1480
1507
  }
@@ -1554,11 +1581,11 @@ class Rt {
1554
1581
  })).data;
1555
1582
  }
1556
1583
  }
1557
- const Ce = fe(null);
1558
- function Tr({ config: n = {}, children: e }) {
1559
- const t = Ze(), r = ke(), i = (t == null ? void 0 : t.baseUrl) ?? "", o = (t == null ? void 0 : t.appId) ?? "", a = (r == null ? void 0 : r.tenant) ?? null, [f, g] = T([]), [w, c] = T(!1), [I, p] = T(null), [x, R] = T(!1), F = J(() => {
1560
- const u = new le(i);
1561
- return new Rt(u);
1584
+ const Ue = fe(null);
1585
+ function kr({ config: n = {}, children: e }) {
1586
+ const t = Ze(), r = xe(), i = (t == null ? void 0 : t.baseUrl) ?? "", o = (t == null ? void 0 : t.appId) ?? "", a = (r == null ? void 0 : r.tenant) ?? null, [f, g] = T([]), [w, c] = T(!1), [I, p] = T(null), [x, R] = T(!1), F = Z(() => {
1587
+ const u = new ce(i);
1588
+ return new It(u);
1562
1589
  }, [i]), E = async () => {
1563
1590
  if (!(a != null && a.id)) {
1564
1591
  g([]);
@@ -1581,7 +1608,7 @@ function Tr({ config: n = {}, children: e }) {
1581
1608
  const u = n.refreshInterval || 5 * 60 * 1e3, k = setInterval(E, u);
1582
1609
  return () => clearInterval(k);
1583
1610
  }, [a == null ? void 0 : a.id, i, o, n.refreshInterval]);
1584
- const A = J(() => {
1611
+ const A = Z(() => {
1585
1612
  const u = (D) => {
1586
1613
  const P = f.find((U) => U.key === D);
1587
1614
  return (P == null ? void 0 : P.value) === !0;
@@ -1602,18 +1629,18 @@ function Tr({ config: n = {}, children: e }) {
1602
1629
  refresh: M
1603
1630
  };
1604
1631
  }, [f, w, I, i, o, a == null ? void 0 : a.id, x]);
1605
- return /* @__PURE__ */ s(Ce.Provider, { value: A, children: e });
1632
+ return /* @__PURE__ */ s(Ue.Provider, { value: A, children: e });
1606
1633
  }
1607
- function It() {
1608
- const n = ae(Ce);
1634
+ function Et() {
1635
+ const n = le(Ue);
1609
1636
  if (!n)
1610
1637
  throw new Error("useFeatureFlags must be used within a FeatureFlagProvider");
1611
1638
  return n;
1612
1639
  }
1613
1640
  function Je() {
1614
- return ae(Ce);
1641
+ return le(Ue);
1615
1642
  }
1616
- class Et {
1643
+ class Mt {
1617
1644
  constructor(e, t) {
1618
1645
  this.httpService = e, this.sessionManager = t;
1619
1646
  }
@@ -1679,11 +1706,11 @@ class Et {
1679
1706
  )).data;
1680
1707
  }
1681
1708
  }
1682
- const Ue = fe(void 0);
1683
- function kr({ config: n = {}, children: e }) {
1684
- const t = Ze(), r = ke(), i = (t == null ? void 0 : t.baseUrl) ?? "", o = (r == null ? void 0 : r.tenant) ?? null, [a, f] = T(null), [g, w] = T(!1), [c, I] = T(null), [p, x] = T(!1), R = J(() => {
1685
- const A = new le(i);
1686
- return new Et(A);
1709
+ const $e = fe(void 0);
1710
+ function xr({ config: n = {}, children: e }) {
1711
+ const t = Ze(), r = xe(), i = (t == null ? void 0 : t.baseUrl) ?? "", o = (r == null ? void 0 : r.tenant) ?? null, [a, f] = T(null), [g, w] = T(!1), [c, I] = T(null), [p, x] = T(!1), R = Z(() => {
1712
+ const A = new ce(i);
1713
+ return new Mt(A);
1687
1714
  }, [i]), F = async () => {
1688
1715
  if (!(o != null && o.id)) {
1689
1716
  f(null);
@@ -1705,7 +1732,7 @@ function kr({ config: n = {}, children: e }) {
1705
1732
  const A = n.refreshInterval || 10 * 60 * 1e3, u = setInterval(F, A);
1706
1733
  return () => clearInterval(u);
1707
1734
  }, [o == null ? void 0 : o.id, i, n.refreshInterval]);
1708
- const E = J(() => {
1735
+ const E = Z(() => {
1709
1736
  const A = (a == null ? void 0 : a.features) || [], u = (P) => {
1710
1737
  const U = A.find((l) => l.key === P);
1711
1738
  return U ? U.type === "BOOLEAN" || U.type === "boolean" ? U.value === !0 : !!U.value : !1;
@@ -1728,19 +1755,19 @@ function kr({ config: n = {}, children: e }) {
1728
1755
  refresh: L
1729
1756
  };
1730
1757
  }, [a, g, c, i, o == null ? void 0 : o.id, p]);
1731
- return /* @__PURE__ */ s(Ue.Provider, { value: E, children: e });
1758
+ return /* @__PURE__ */ s($e.Provider, { value: E, children: e });
1732
1759
  }
1733
- function Mt() {
1734
- const n = ae(Ue);
1760
+ function Lt() {
1761
+ const n = le($e);
1735
1762
  if (n === void 0)
1736
1763
  throw new Error("useSubscription must be used within a SubscriptionProvider");
1737
1764
  return n;
1738
1765
  }
1739
- function Ke() {
1740
- return ae(Ue) ?? null;
1766
+ function Ye() {
1767
+ return le($e) ?? null;
1741
1768
  }
1742
- var oe = /* @__PURE__ */ ((n) => (n.SUPERUSER = "SUPERUSER", n.TENANT_ADMIN = "TENANT_ADMIN", n.USER = "USER", n))(oe || {});
1743
- const $e = {
1769
+ var ae = /* @__PURE__ */ ((n) => (n.SUPERUSER = "SUPERUSER", n.TENANT_ADMIN = "TENANT_ADMIN", n.USER = "USER", n))(ae || {});
1770
+ const He = {
1744
1771
  publicGuest: "/",
1745
1772
  publicUser: "/account",
1746
1773
  publicAdmin: "/admin",
@@ -1748,7 +1775,7 @@ const $e = {
1748
1775
  tenantUser: "/dashboard",
1749
1776
  tenantAdmin: "/admin/dashboard",
1750
1777
  default: "/"
1751
- }, Ye = {
1778
+ }, Xe = {
1752
1779
  // Public/Landing zones
1753
1780
  landing: { tenant: "forbidden", auth: "optional" },
1754
1781
  publicOnly: { tenant: "forbidden", auth: "forbidden" },
@@ -1761,18 +1788,18 @@ const $e = {
1761
1788
  tenantOpen: { tenant: "required", auth: "optional" },
1762
1789
  tenantAuth: { tenant: "required", auth: "required" },
1763
1790
  // User type zones
1764
- user: { tenant: "required", auth: "required", userType: oe.USER },
1765
- admin: { tenant: "required", auth: "required", userType: oe.TENANT_ADMIN },
1791
+ user: { tenant: "required", auth: "required", userType: ae.USER },
1792
+ admin: { tenant: "required", auth: "required", userType: ae.TENANT_ADMIN },
1766
1793
  // Fully open
1767
1794
  open: { tenant: "optional", auth: "optional" }
1768
- }, He = fe(null);
1769
- function xr({ config: n = {}, children: e }) {
1770
- const t = J(() => {
1795
+ }, Be = fe(null);
1796
+ function Ar({ config: n = {}, children: e }) {
1797
+ const t = Z(() => {
1771
1798
  const r = {
1772
- ...$e,
1799
+ ...He,
1773
1800
  ...n.zoneRoots
1774
1801
  }, i = {
1775
- ...Ye,
1802
+ ...Xe,
1776
1803
  ...n.presets
1777
1804
  };
1778
1805
  return {
@@ -1785,19 +1812,19 @@ function xr({ config: n = {}, children: e }) {
1785
1812
  returnToStorage: n.returnToStorage ?? "url"
1786
1813
  };
1787
1814
  }, [n]);
1788
- return /* @__PURE__ */ s(He.Provider, { value: t, children: e });
1815
+ return /* @__PURE__ */ s(Be.Provider, { value: t, children: e });
1789
1816
  }
1790
- function Ar() {
1791
- const n = ae(He);
1817
+ function Pr() {
1818
+ const n = le(Be);
1792
1819
  if (!n)
1793
1820
  throw new Error("useRouting must be used within a RoutingProvider");
1794
1821
  return n;
1795
1822
  }
1796
- function Lt() {
1797
- const n = ae(He);
1823
+ function Ft() {
1824
+ const n = le(Be);
1798
1825
  return n || {
1799
- zoneRoots: $e,
1800
- presets: Ye,
1826
+ zoneRoots: He,
1827
+ presets: Xe,
1801
1828
  loadingFallback: null,
1802
1829
  accessDeniedFallback: null,
1803
1830
  onAccessDenied: void 0,
@@ -1805,7 +1832,7 @@ function Lt() {
1805
1832
  returnToStorage: "url"
1806
1833
  };
1807
1834
  }
1808
- const We = () => /* @__PURE__ */ d(
1835
+ const Ve = () => /* @__PURE__ */ d(
1809
1836
  "div",
1810
1837
  {
1811
1838
  style: {
@@ -1842,7 +1869,7 @@ const We = () => /* @__PURE__ */ d(
1842
1869
  )
1843
1870
  ]
1844
1871
  }
1845
- ), Ve = ({
1872
+ ), je = ({
1846
1873
  userType: n,
1847
1874
  minUserType: e,
1848
1875
  missingPermissions: t
@@ -1883,36 +1910,36 @@ const We = () => /* @__PURE__ */ d(
1883
1910
  ] })
1884
1911
  ]
1885
1912
  }
1886
- ), Ft = (n, e) => {
1913
+ ), Dt = (n, e) => {
1887
1914
  const t = {
1888
- [oe.USER]: 1,
1889
- [oe.TENANT_ADMIN]: 2,
1890
- [oe.SUPERUSER]: 3
1915
+ [ae.USER]: 1,
1916
+ [ae.TENANT_ADMIN]: 2,
1917
+ [ae.SUPERUSER]: 3
1891
1918
  };
1892
1919
  return t[n] >= t[e];
1893
1920
  };
1894
- function Pr({
1921
+ function Rr({
1895
1922
  children: n,
1896
1923
  fallback: e,
1897
1924
  minUserType: t,
1898
1925
  requiredPermissions: r,
1899
1926
  requireAllPermissions: i = !1
1900
1927
  }) {
1901
- const { hasValidSession: o, sessionManager: a, hasPermission: f, hasAnyPermission: g, hasAllPermissions: w } = de();
1928
+ const { hasValidSession: o, sessionManager: a, hasPermission: f, hasAnyPermission: g, hasAllPermissions: w } = ue();
1902
1929
  if (!o())
1903
- return /* @__PURE__ */ s(_, { children: e || /* @__PURE__ */ s(We, {}) });
1930
+ return /* @__PURE__ */ s(_, { children: e || /* @__PURE__ */ s(Ve, {}) });
1904
1931
  const c = a.getUser();
1905
1932
  if (!c)
1906
- return /* @__PURE__ */ s(_, { children: e || /* @__PURE__ */ s(We, {}) });
1907
- if (t && !Ft(c.userType, t))
1908
- return /* @__PURE__ */ s(Ve, { userType: c.userType, minUserType: t });
1933
+ return /* @__PURE__ */ s(_, { children: e || /* @__PURE__ */ s(Ve, {}) });
1934
+ if (t && !Dt(c.userType, t))
1935
+ return /* @__PURE__ */ s(je, { userType: c.userType, minUserType: t });
1909
1936
  if (r && r.length > 0 && !(i ? w(r) : g(r))) {
1910
1937
  const p = r.filter((x) => !f(x)).map((x) => typeof x == "string" ? x : x.name);
1911
- return /* @__PURE__ */ s(Ve, { missingPermissions: p });
1938
+ return /* @__PURE__ */ s(je, { missingPermissions: p });
1912
1939
  }
1913
1940
  return /* @__PURE__ */ s(_, { children: n });
1914
1941
  }
1915
- const Dt = ({ redirectPath: n }) => /* @__PURE__ */ s(
1942
+ const Nt = ({ redirectPath: n }) => /* @__PURE__ */ s(
1916
1943
  "div",
1917
1944
  {
1918
1945
  style: {
@@ -1948,7 +1975,7 @@ const Dt = ({ redirectPath: n }) => /* @__PURE__ */ s(
1948
1975
  }
1949
1976
  )
1950
1977
  }
1951
- ), je = ({
1978
+ ), Ge = ({
1952
1979
  userType: n,
1953
1980
  requiredUserType: e,
1954
1981
  missingPermissions: t
@@ -1999,8 +2026,8 @@ const Dt = ({ redirectPath: n }) => /* @__PURE__ */ s(
1999
2026
  }
2000
2027
  )
2001
2028
  }
2002
- ), Nt = (n, e) => n === e;
2003
- function Rr({
2029
+ ), Ct = (n, e) => n === e;
2030
+ function Ir({
2004
2031
  children: n,
2005
2032
  redirectTo: e = "/login",
2006
2033
  requiredUserType: t,
@@ -2008,22 +2035,22 @@ function Rr({
2008
2035
  requireAllPermissions: i = !1,
2009
2036
  fallback: o
2010
2037
  }) {
2011
- const { hasValidSession: a, sessionManager: f, hasPermission: g, hasAnyPermission: w, hasAllPermissions: c } = de(), I = Te();
2038
+ const { hasValidSession: a, sessionManager: f, hasPermission: g, hasAnyPermission: w, hasAllPermissions: c } = ue(), I = ke();
2012
2039
  if (ee(() => {
2013
2040
  process.env.NODE_ENV === "development" && console.warn(
2014
2041
  "[react-identity-access] ProtectedRoute is deprecated. Use AuthenticatedZone or AdminZone from ZoneRoute instead."
2015
2042
  );
2016
2043
  }, []), !a())
2017
2044
  return o ? /* @__PURE__ */ s(_, { children: o }) : /* @__PURE__ */ d(_, { children: [
2018
- /* @__PURE__ */ s(Dt, { redirectPath: e }),
2019
- /* @__PURE__ */ s(be, { to: e, state: { from: I.pathname }, replace: !0 })
2045
+ /* @__PURE__ */ s(Nt, { redirectPath: e }),
2046
+ /* @__PURE__ */ s(Se, { to: e, state: { from: I.pathname }, replace: !0 })
2020
2047
  ] });
2021
2048
  const p = f.getUser();
2022
2049
  if (!p)
2023
- return /* @__PURE__ */ s(be, { to: e, state: { from: I.pathname }, replace: !0 });
2024
- if (t && !Nt(p.userType, t))
2050
+ return /* @__PURE__ */ s(Se, { to: e, state: { from: I.pathname }, replace: !0 });
2051
+ if (t && !Ct(p.userType, t))
2025
2052
  return /* @__PURE__ */ s(
2026
- je,
2053
+ Ge,
2027
2054
  {
2028
2055
  userType: p.userType,
2029
2056
  requiredUserType: t
@@ -2031,11 +2058,11 @@ function Rr({
2031
2058
  );
2032
2059
  if (r && r.length > 0 && !(i ? c(r) : w(r))) {
2033
2060
  const R = r.filter((F) => !g(F)).map((F) => typeof F == "string" ? F : F.name);
2034
- return /* @__PURE__ */ s(je, { missingPermissions: R });
2061
+ return /* @__PURE__ */ s(Ge, { missingPermissions: R });
2035
2062
  }
2036
2063
  return /* @__PURE__ */ s(_, { children: n });
2037
2064
  }
2038
- const Ct = ({ redirectPath: n }) => /* @__PURE__ */ s(
2065
+ const Ut = ({ redirectPath: n }) => /* @__PURE__ */ s(
2039
2066
  "div",
2040
2067
  {
2041
2068
  style: {
@@ -2072,18 +2099,18 @@ const Ct = ({ redirectPath: n }) => /* @__PURE__ */ s(
2072
2099
  )
2073
2100
  }
2074
2101
  );
2075
- function Ir({ children: n, redirectTo: e = "/", fallback: t }) {
2076
- const { tenant: r, isLoading: i, error: o } = me(), a = Te();
2102
+ function Er({ children: n, redirectTo: e = "/", fallback: t }) {
2103
+ const { tenant: r, isLoading: i, error: o } = me(), a = ke();
2077
2104
  return ee(() => {
2078
2105
  process.env.NODE_ENV === "development" && console.warn(
2079
2106
  "[react-identity-access] TenantRoute is deprecated. Use TenantZone from ZoneRoute instead."
2080
2107
  );
2081
2108
  }, []), i || o ? null : r ? /* @__PURE__ */ s(_, { children: n }) : t ? /* @__PURE__ */ s(_, { children: t }) : /* @__PURE__ */ d(_, { children: [
2082
- /* @__PURE__ */ s(Ct, { redirectPath: e }),
2083
- /* @__PURE__ */ s(be, { to: e, state: { from: a.pathname }, replace: !0 })
2109
+ /* @__PURE__ */ s(Ut, { redirectPath: e }),
2110
+ /* @__PURE__ */ s(Se, { to: e, state: { from: a.pathname }, replace: !0 })
2084
2111
  ] });
2085
2112
  }
2086
- const Ut = ({ redirectPath: n }) => /* @__PURE__ */ s(
2113
+ const $t = ({ redirectPath: n }) => /* @__PURE__ */ s(
2087
2114
  "div",
2088
2115
  {
2089
2116
  style: {
@@ -2120,41 +2147,41 @@ const Ut = ({ redirectPath: n }) => /* @__PURE__ */ s(
2120
2147
  )
2121
2148
  }
2122
2149
  );
2123
- function Er({ children: n, redirectTo: e = "/dashboard", fallback: t }) {
2124
- const { tenant: r, isLoading: i, error: o } = me(), a = Te();
2150
+ function Mr({ children: n, redirectTo: e = "/dashboard", fallback: t }) {
2151
+ const { tenant: r, isLoading: i, error: o } = me(), a = ke();
2125
2152
  return ee(() => {
2126
2153
  process.env.NODE_ENV === "development" && console.warn(
2127
2154
  "[react-identity-access] LandingRoute is deprecated. Use PublicZone from ZoneRoute instead."
2128
2155
  );
2129
2156
  }, []), i || o ? null : r ? t ? /* @__PURE__ */ s(_, { children: t }) : /* @__PURE__ */ d(_, { children: [
2130
- /* @__PURE__ */ s(Ut, { redirectPath: e }),
2131
- /* @__PURE__ */ s(be, { to: e, state: { from: a.pathname }, replace: !0 })
2157
+ /* @__PURE__ */ s($t, { redirectPath: e }),
2158
+ /* @__PURE__ */ s(Se, { to: e, state: { from: a.pathname }, replace: !0 })
2132
2159
  ] }) : /* @__PURE__ */ s(_, { children: n });
2133
2160
  }
2134
- function $t(n, e) {
2161
+ function Ht(n, e) {
2135
2162
  return e ? n ? Array.isArray(e) ? e.includes(n) : n === e : !1 : !0;
2136
2163
  }
2137
- function Ge(n, e) {
2164
+ function Qe(n, e) {
2138
2165
  return !n || n === "optional" ? "skip" : n === "required" ? e ? "pass" : "fail" : n === "forbidden" ? e ? "fail" : "pass" : "skip";
2139
2166
  }
2140
- function Ht(n, e) {
2141
- return Ge(n.tenant, e.hasTenant) === "fail" ? e.hasTenant ? "has_tenant" : "no_tenant" : Ge(n.auth, e.isAuthenticated) === "fail" ? e.isAuthenticated ? "already_authenticated" : "not_authenticated" : n.userType && e.isAuthenticated && !$t(e.userType, n.userType) ? "wrong_user_type" : n.permissions && n.permissions.length > 0 && !(n.requireAllPermissions !== !1 ? (o) => o.every((a) => e.permissions.includes(a)) : (o) => o.some((a) => e.permissions.includes(a)))(n.permissions) ? "missing_permissions" : null;
2142
- }
2143
2167
  function Bt(n, e) {
2144
- return n.hasTenant ? n.isAuthenticated ? n.userType === oe.TENANT_ADMIN ? e.tenantAdmin : e.tenantUser : e.tenantGuest : n.isAuthenticated ? n.userType === oe.TENANT_ADMIN ? e.publicAdmin : e.publicUser : e.publicGuest;
2168
+ return Qe(n.tenant, e.hasTenant) === "fail" ? e.hasTenant ? "has_tenant" : "no_tenant" : Qe(n.auth, e.isAuthenticated) === "fail" ? e.isAuthenticated ? "already_authenticated" : "not_authenticated" : n.userType && e.isAuthenticated && !Ht(e.userType, n.userType) ? "wrong_user_type" : n.permissions && n.permissions.length > 0 && !(n.requireAllPermissions !== !1 ? (o) => o.every((a) => e.permissions.includes(a)) : (o) => o.some((a) => e.permissions.includes(a)))(n.permissions) ? "missing_permissions" : null;
2169
+ }
2170
+ function qt(n, e) {
2171
+ return n.hasTenant ? n.isAuthenticated ? n.userType === ae.TENANT_ADMIN ? e.tenantAdmin : e.tenantUser : e.tenantGuest : n.isAuthenticated ? n.userType === ae.TENANT_ADMIN ? e.publicAdmin : e.publicUser : e.publicGuest;
2145
2172
  }
2146
- function qt(n, e, t, r, i) {
2173
+ function Ot(n, e, t, r, i) {
2147
2174
  if (!e || i !== "url")
2148
2175
  return n;
2149
2176
  const o = typeof e == "string" ? e : t, a = n.includes("?") ? "&" : "?";
2150
2177
  return `${n}${a}${r}=${encodeURIComponent(o)}`;
2151
2178
  }
2152
- function Ot(n, e, t) {
2179
+ function zt(n, e, t) {
2153
2180
  if (!n || t === "url") return;
2154
2181
  const r = typeof n == "string" ? n : e, i = "zone_return_to";
2155
2182
  t === "session" ? sessionStorage.setItem(i, r) : t === "local" && localStorage.setItem(i, r);
2156
2183
  }
2157
- const ce = ({
2184
+ const de = ({
2158
2185
  children: n,
2159
2186
  preset: e,
2160
2187
  tenant: t,
@@ -2168,10 +2195,10 @@ const ce = ({
2168
2195
  loadingFallback: c,
2169
2196
  accessDeniedFallback: I
2170
2197
  }) => {
2171
- const p = Te(), { isAuthenticated: x, isAuthInitializing: R, currentUser: F, userPermissions: E } = de(), { tenant: A, isTenantLoading: u } = ge(), k = Lt(), m = J(() => {
2198
+ const p = ke(), { isAuthenticated: x, isAuthInitializing: R, currentUser: F, userPermissions: E } = ue(), { tenant: A, isTenantLoading: u } = ge(), k = Ft(), m = Z(() => {
2172
2199
  if (e)
2173
2200
  return k.presets[e];
2174
- }, [e, k.presets]), M = J(
2201
+ }, [e, k.presets]), M = Z(
2175
2202
  () => ({
2176
2203
  tenant: t ?? (m == null ? void 0 : m.tenant),
2177
2204
  auth: r ?? (m == null ? void 0 : m.auth),
@@ -2180,7 +2207,7 @@ const ce = ({
2180
2207
  requireAllPermissions: a
2181
2208
  }),
2182
2209
  [t, r, i, o, m, a]
2183
- ), L = J(
2210
+ ), L = Z(
2184
2211
  () => ({
2185
2212
  hasTenant: !!A,
2186
2213
  isAuthenticated: x,
@@ -2196,7 +2223,7 @@ const ce = ({
2196
2223
  R,
2197
2224
  u
2198
2225
  ]
2199
- ), D = J(() => L.isLoading ? null : Ht(M, L), [M, L]), P = J(() => D ? w || Bt(L, k.zoneRoots) : null, [D, w, L, k.zoneRoots]), U = J(() => !D || !P ? null : {
2226
+ ), D = Z(() => L.isLoading ? null : Bt(M, L), [M, L]), P = Z(() => D ? w || qt(L, k.zoneRoots) : null, [D, w, L, k.zoneRoots]), U = Z(() => !D || !P ? null : {
2200
2227
  type: D,
2201
2228
  required: {
2202
2229
  tenant: M.tenant,
@@ -2215,7 +2242,7 @@ const ce = ({
2215
2242
  if (ee(() => {
2216
2243
  U && (g ? g(U) : k.onAccessDenied && k.onAccessDenied(U));
2217
2244
  }, [U, g, k]), ee(() => {
2218
- U && f && Ot(f, p.pathname + p.search, k.returnToStorage);
2245
+ U && f && zt(f, p.pathname + p.search, k.returnToStorage);
2219
2246
  }, [
2220
2247
  U,
2221
2248
  f,
@@ -2228,17 +2255,17 @@ const ce = ({
2228
2255
  const l = I ?? k.accessDeniedFallback;
2229
2256
  if (l)
2230
2257
  return /* @__PURE__ */ s(_, { children: l });
2231
- const N = qt(
2258
+ const N = Ot(
2232
2259
  P,
2233
2260
  f,
2234
2261
  p.pathname + p.search,
2235
2262
  k.returnToParam,
2236
2263
  k.returnToStorage
2237
2264
  );
2238
- return /* @__PURE__ */ s(be, { to: N, replace: !0 });
2265
+ return /* @__PURE__ */ s(Se, { to: N, replace: !0 });
2239
2266
  }
2240
2267
  return /* @__PURE__ */ s(_, { children: n });
2241
- }, Mr = (n) => /* @__PURE__ */ s(ce, { tenant: "required", ...n }), Lr = (n) => /* @__PURE__ */ s(ce, { tenant: "forbidden", ...n }), Fr = (n) => /* @__PURE__ */ s(ce, { auth: "required", ...n }), Dr = (n) => /* @__PURE__ */ s(ce, { auth: "forbidden", ...n }), Nr = (n) => /* @__PURE__ */ s(ce, { auth: "required", userType: oe.TENANT_ADMIN, ...n }), Cr = (n) => /* @__PURE__ */ s(ce, { auth: "required", userType: oe.USER, ...n }), Ur = (n) => /* @__PURE__ */ s(ce, { tenant: "optional", auth: "optional", ...n }), $r = (n) => /* @__PURE__ */ s(ce, { tenant: "required", auth: "required", ...n }), Hr = (n) => /* @__PURE__ */ s(ce, { tenant: "required", auth: "optional", ...n }), Br = (n) => /* @__PURE__ */ s(ce, { tenant: "required", auth: "forbidden", ...n }), zt = () => /* @__PURE__ */ d(
2268
+ }, Lr = (n) => /* @__PURE__ */ s(de, { tenant: "required", ...n }), Fr = (n) => /* @__PURE__ */ s(de, { tenant: "forbidden", ...n }), Dr = (n) => /* @__PURE__ */ s(de, { auth: "required", ...n }), Nr = (n) => /* @__PURE__ */ s(de, { auth: "forbidden", ...n }), Cr = (n) => /* @__PURE__ */ s(de, { auth: "required", userType: ae.TENANT_ADMIN, ...n }), Ur = (n) => /* @__PURE__ */ s(de, { auth: "required", userType: ae.USER, ...n }), $r = (n) => /* @__PURE__ */ s(de, { tenant: "optional", auth: "optional", ...n }), Hr = (n) => /* @__PURE__ */ s(de, { tenant: "required", auth: "required", ...n }), Br = (n) => /* @__PURE__ */ s(de, { tenant: "required", auth: "optional", ...n }), qr = (n) => /* @__PURE__ */ s(de, { tenant: "required", auth: "forbidden", ...n }), _t = () => /* @__PURE__ */ d(
2242
2269
  "div",
2243
2270
  {
2244
2271
  style: {
@@ -2255,13 +2282,13 @@ const ce = ({
2255
2282
  ]
2256
2283
  }
2257
2284
  );
2258
- function qr({
2285
+ function Or({
2259
2286
  children: n,
2260
- fallback: e = /* @__PURE__ */ s(zt, {}),
2287
+ fallback: e = /* @__PURE__ */ s(_t, {}),
2261
2288
  allowedPlans: t,
2262
2289
  requiredFeature: r
2263
2290
  }) {
2264
- const { subscription: i, hasAllowedPlan: o, isFeatureEnabled: a, loading: f } = Mt();
2291
+ const { subscription: i, hasAllowedPlan: o, isFeatureEnabled: a, loading: f } = Lt();
2265
2292
  return f ? /* @__PURE__ */ s(
2266
2293
  "div",
2267
2294
  {
@@ -2274,7 +2301,7 @@ function qr({
2274
2301
  }
2275
2302
  ) : i ? i.isActive ? t && t.length > 0 && !o(t) ? /* @__PURE__ */ s(_, { children: e }) : r && !a(r) ? /* @__PURE__ */ s(_, { children: e }) : /* @__PURE__ */ s(_, { children: n }) : /* @__PURE__ */ s(_, { children: e }) : /* @__PURE__ */ s(_, { children: e });
2276
2303
  }
2277
- const _t = ({ flagName: n }) => /* @__PURE__ */ d(
2304
+ const Wt = ({ flagName: n }) => /* @__PURE__ */ d(
2278
2305
  "div",
2279
2306
  {
2280
2307
  style: {
@@ -2301,8 +2328,8 @@ const _t = ({ flagName: n }) => /* @__PURE__ */ d(
2301
2328
  ]
2302
2329
  }
2303
2330
  );
2304
- function Or({ name: n, children: e, fallback: t }) {
2305
- const { isEnabled: r, loading: i } = It();
2331
+ function zr({ name: n, children: e, fallback: t }) {
2332
+ const { isEnabled: r, loading: i } = Et();
2306
2333
  return i ? /* @__PURE__ */ s(
2307
2334
  "div",
2308
2335
  {
@@ -2316,9 +2343,9 @@ function Or({ name: n, children: e, fallback: t }) {
2316
2343
  },
2317
2344
  children: "Loading feature flags..."
2318
2345
  }
2319
- ) : r(n) ? /* @__PURE__ */ s(_, { children: e }) : /* @__PURE__ */ s(_, { children: t || /* @__PURE__ */ s(_t, { flagName: n }) });
2346
+ ) : r(n) ? /* @__PURE__ */ s(_, { children: e }) : /* @__PURE__ */ s(_, { children: t || /* @__PURE__ */ s(Wt, { flagName: n }) });
2320
2347
  }
2321
- const Wt = () => /* @__PURE__ */ d(
2348
+ const Vt = () => /* @__PURE__ */ d(
2322
2349
  "svg",
2323
2350
  {
2324
2351
  width: "16",
@@ -2335,7 +2362,7 @@ const Wt = () => /* @__PURE__ */ d(
2335
2362
  /* @__PURE__ */ s("circle", { cx: "12", cy: "12", r: "3" })
2336
2363
  ]
2337
2364
  }
2338
- ), Vt = () => /* @__PURE__ */ d(
2365
+ ), jt = () => /* @__PURE__ */ d(
2339
2366
  "svg",
2340
2367
  {
2341
2368
  width: "16",
@@ -2352,10 +2379,10 @@ const Wt = () => /* @__PURE__ */ d(
2352
2379
  /* @__PURE__ */ s("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
2353
2380
  ]
2354
2381
  }
2355
- ), jt = {
2356
- showPassword: /* @__PURE__ */ s(Wt, {}),
2357
- hidePassword: /* @__PURE__ */ s(Vt, {})
2358
- }, Gt = {
2382
+ ), Gt = {
2383
+ showPassword: /* @__PURE__ */ s(Vt, {}),
2384
+ hidePassword: /* @__PURE__ */ s(jt, {})
2385
+ }, Qt = {
2359
2386
  title: "Sign In",
2360
2387
  usernameLabel: "Email or Phone",
2361
2388
  usernamePlaceholder: "Enter your email or phone number",
@@ -2369,7 +2396,7 @@ const Wt = () => /* @__PURE__ */ d(
2369
2396
  magicLinkLink: "Use Magic Link",
2370
2397
  errorMessage: "Invalid credentials",
2371
2398
  loadingText: "Signing in..."
2372
- }, Qt = {
2399
+ }, Kt = {
2373
2400
  container: {
2374
2401
  maxWidth: "400px",
2375
2402
  width: "100%",
@@ -2476,7 +2503,7 @@ const Wt = () => /* @__PURE__ */ d(
2476
2503
  fontSize: "0.875rem"
2477
2504
  }
2478
2505
  };
2479
- function zr({
2506
+ function _r({
2480
2507
  copy: n = {},
2481
2508
  styles: e = {},
2482
2509
  icons: t = {},
@@ -2490,7 +2517,7 @@ function zr({
2490
2517
  showMagicLinkOption: c = !0,
2491
2518
  className: I
2492
2519
  }) {
2493
- const [p, x] = T(""), [R, F] = T(""), [E, A] = T(!1), [u, k] = T(!1), [m, M] = T(""), [L, D] = T({}), { login: P } = de(), { tenant: U } = me(), l = { ...Gt, ...n }, N = { ...Qt, ...e }, $ = { ...jt, ...t }, h = () => {
2520
+ const [p, x] = T(""), [R, F] = T(""), [E, A] = T(!1), [u, k] = T(!1), [m, M] = T(""), [L, D] = T({}), { login: P } = ue(), { tenant: U } = me(), l = { ...Qt, ...n }, N = { ...Kt, ...e }, $ = { ...Gt, ...t }, h = () => {
2494
2521
  const y = {};
2495
2522
  return p.trim() || (y.username = !0), R.trim() || (y.password = !0), D(y), Object.keys(y).length === 0;
2496
2523
  }, C = async (y) => {
@@ -2727,7 +2754,7 @@ const Zt = {
2727
2754
  fontSize: "0.875rem"
2728
2755
  }
2729
2756
  };
2730
- function _r({
2757
+ function Wr({
2731
2758
  copy: n = {},
2732
2759
  styles: e = {},
2733
2760
  signupType: t = "user",
@@ -2739,7 +2766,7 @@ function _r({
2739
2766
  showMagicLinkOption: g = !0,
2740
2767
  className: w
2741
2768
  }) {
2742
- const [c, I] = T(""), [p, x] = T(""), [R, F] = T(""), [E, A] = T(""), [u, k] = T(""), [m, M] = T(""), [L, D] = T(""), [P, U] = T(!1), [l, N] = T(""), [$, h] = T({}), { signup: C, signupTenantAdmin: S } = de(), { tenant: b } = me(), y = { ...Zt, ...n }, v = { ...Jt, ...e }, j = () => {
2769
+ const [c, I] = T(""), [p, x] = T(""), [R, F] = T(""), [E, A] = T(""), [u, k] = T(""), [m, M] = T(""), [L, D] = T(""), [P, U] = T(!1), [l, N] = T(""), [$, h] = T({}), { signup: C, signupTenantAdmin: S } = ue(), { tenant: b } = me(), y = { ...Zt, ...n }, v = { ...Jt, ...e }, j = () => {
2743
2770
  const B = {};
2744
2771
  return c.trim() || (B.name = !0), !R.trim() && !E.trim() && (B.email = !0, B.phoneNumber = !0), u.trim() || (B.password = !0), m.trim() || (B.confirmPassword = !0), t === "tenant" && !L.trim() && (B.tenantName = !0), h(B), Object.keys(B).length === 0;
2745
2772
  }, Q = async (B) => {
@@ -2946,7 +2973,7 @@ function _r({
2946
2973
  ] })
2947
2974
  ] });
2948
2975
  }
2949
- const Kt = {
2976
+ const Yt = {
2950
2977
  title: "Sign In with Magic Link",
2951
2978
  emailLabel: "Email",
2952
2979
  emailPlaceholder: "Enter your email",
@@ -2964,7 +2991,7 @@ const Kt = {
2964
2991
  loadingText: "Sending magic link...",
2965
2992
  verifyingText: "Verifying magic link...",
2966
2993
  description: "Enter your email to receive a magic link. If you don't have an account, we'll create one for you."
2967
- }, Yt = {
2994
+ }, Xt = {
2968
2995
  container: {
2969
2996
  maxWidth: "400px",
2970
2997
  width: "100%",
@@ -3067,7 +3094,7 @@ const Kt = {
3067
3094
  fontSize: "0.875rem"
3068
3095
  }
3069
3096
  };
3070
- function Wr({
3097
+ function Vr({
3071
3098
  copy: n = {},
3072
3099
  styles: e = {},
3073
3100
  onSuccess: t,
@@ -3079,7 +3106,7 @@ function Wr({
3079
3106
  verifyToken: g,
3080
3107
  frontendUrl: w
3081
3108
  }) {
3082
- const [c, I] = T(""), [p, x] = T(""), [R, F] = T(""), [E, A] = T(!1), [u, k] = T(!1), [m, M] = T(""), [L, D] = T(""), [P, U] = T({}), [l, N] = T(!1), { sendMagicLink: $, verifyMagicLink: h } = de(), { tenant: C } = me(), S = { ...Kt, ...n }, b = { ...Yt, ...e };
3109
+ const [c, I] = T(""), [p, x] = T(""), [R, F] = T(""), [E, A] = T(!1), [u, k] = T(!1), [m, M] = T(""), [L, D] = T(""), [P, U] = T({}), [l, N] = T(!1), { sendMagicLink: $, verifyMagicLink: h } = ue(), { tenant: C } = me(), S = { ...Yt, ...n }, b = { ...Xt, ...e };
3083
3110
  ee(() => {
3084
3111
  g && y(g);
3085
3112
  }, [g]);
@@ -3254,7 +3281,7 @@ function Wr({
3254
3281
  ] })
3255
3282
  ] });
3256
3283
  }
3257
- const Xt = {
3284
+ const er = {
3258
3285
  title: "Verifying Magic Link",
3259
3286
  verifyingMessage: "Please wait while we verify your magic link...",
3260
3287
  successMessage: "Magic link verified successfully! You are now logged in.",
@@ -3262,7 +3289,7 @@ const Xt = {
3262
3289
  redirectingMessage: "Redirecting you to the dashboard...",
3263
3290
  retryButton: "Try Again",
3264
3291
  backToLoginButton: "Back to Login"
3265
- }, Xe = {
3292
+ }, et = {
3266
3293
  container: {
3267
3294
  maxWidth: "400px",
3268
3295
  width: "100%",
@@ -3349,7 +3376,7 @@ const Xt = {
3349
3376
  cursor: "pointer",
3350
3377
  transition: "all 0.15s ease-in-out"
3351
3378
  }
3352
- }, er = () => /* @__PURE__ */ s("div", { style: Xe.spinner }), tr = () => /* @__PURE__ */ d(
3379
+ }, tr = () => /* @__PURE__ */ s("div", { style: et.spinner }), rr = () => /* @__PURE__ */ d(
3353
3380
  "svg",
3354
3381
  {
3355
3382
  width: "48",
@@ -3366,7 +3393,7 @@ const Xt = {
3366
3393
  /* @__PURE__ */ s("polyline", { points: "22,4 12,14.01 9,11.01" })
3367
3394
  ]
3368
3395
  }
3369
- ), rr = () => /* @__PURE__ */ d(
3396
+ ), nr = () => /* @__PURE__ */ d(
3370
3397
  "svg",
3371
3398
  {
3372
3399
  width: "48",
@@ -3384,12 +3411,12 @@ const Xt = {
3384
3411
  /* @__PURE__ */ s("line", { x1: "9", y1: "9", x2: "15", y2: "15" })
3385
3412
  ]
3386
3413
  }
3387
- ), nr = {
3388
- loading: /* @__PURE__ */ s(er, {}),
3389
- success: /* @__PURE__ */ s(tr, {}),
3390
- error: /* @__PURE__ */ s(rr, {})
3414
+ ), sr = {
3415
+ loading: /* @__PURE__ */ s(tr, {}),
3416
+ success: /* @__PURE__ */ s(rr, {}),
3417
+ error: /* @__PURE__ */ s(nr, {})
3391
3418
  };
3392
- function Vr({
3419
+ function jr({
3393
3420
  copy: n = {},
3394
3421
  styles: e = {},
3395
3422
  icons: t = {},
@@ -3404,7 +3431,7 @@ function Vr({
3404
3431
  tenantSlug: I,
3405
3432
  autoRedirectDelay: p = 3e3
3406
3433
  }) {
3407
- const [x, R] = T("verifying"), [F, E] = T(""), { verifyMagicLink: A } = de(), u = { ...Xt, ...n }, k = { ...Xe, ...e }, m = { ...nr, ...t }, M = () => {
3434
+ const [x, R] = T("verifying"), [F, E] = T(""), { verifyMagicLink: A } = ue(), u = { ...er, ...n }, k = { ...et, ...e }, m = { ...sr, ...t }, M = () => {
3408
3435
  if (typeof window > "u") return {};
3409
3436
  const l = new URLSearchParams(window.location.search);
3410
3437
  return {
@@ -3506,7 +3533,7 @@ function Vr({
3506
3533
  U()
3507
3534
  ] });
3508
3535
  }
3509
- const sr = {
3536
+ const ir = {
3510
3537
  title: "Reset Password",
3511
3538
  subtitle: "Enter your email address and we'll send you a link to reset your password.",
3512
3539
  emailLabel: "Email",
@@ -3528,7 +3555,7 @@ const sr = {
3528
3555
  resetLoadingText: "Resetting...",
3529
3556
  resetSuccessMessage: "Password reset successfully!",
3530
3557
  passwordMismatchError: "Passwords do not match"
3531
- }, ir = {
3558
+ }, or = {
3532
3559
  container: {
3533
3560
  maxWidth: "400px",
3534
3561
  margin: "0 auto",
@@ -3620,7 +3647,7 @@ const sr = {
3620
3647
  cursor: "pointer"
3621
3648
  }
3622
3649
  };
3623
- function jr({
3650
+ function Gr({
3624
3651
  copy: n = {},
3625
3652
  styles: e = {},
3626
3653
  mode: t = "request",
@@ -3631,7 +3658,7 @@ function jr({
3631
3658
  onModeChange: f,
3632
3659
  className: g
3633
3660
  }) {
3634
- const [w, c] = T(""), [I, p] = T(r), [x, R] = T(""), [F, E] = T(""), [A, u] = T(!1), [k, m] = T(""), [M, L] = T(""), [D, P] = T({}), { requestPasswordReset: U, confirmPasswordReset: l } = de(), { tenant: N } = me(), $ = { ...sr, ...n }, h = { ...ir, ...e }, C = () => {
3661
+ const [w, c] = T(""), [I, p] = T(r), [x, R] = T(""), [F, E] = T(""), [A, u] = T(!1), [k, m] = T(""), [M, L] = T(""), [D, P] = T({}), { requestPasswordReset: U, confirmPasswordReset: l } = ue(), { tenant: N } = me(), $ = { ...ir, ...n }, h = { ...or, ...e }, C = () => {
3635
3662
  const O = {};
3636
3663
  return w.trim() || (O.email = !0), P(O), Object.keys(O).length === 0;
3637
3664
  }, S = () => {
@@ -3799,7 +3826,7 @@ function jr({
3799
3826
  ] })
3800
3827
  ] });
3801
3828
  }
3802
- const or = () => /* @__PURE__ */ s(
3829
+ const ar = () => /* @__PURE__ */ s(
3803
3830
  "div",
3804
3831
  {
3805
3832
  style: {
@@ -3811,7 +3838,7 @@ const or = () => /* @__PURE__ */ s(
3811
3838
  },
3812
3839
  children: /* @__PURE__ */ s("div", { children: "Loading..." })
3813
3840
  }
3814
- ), ar = ({ error: n, retry: e }) => /* @__PURE__ */ d(
3841
+ ), lr = ({ error: n, retry: e }) => /* @__PURE__ */ d(
3815
3842
  "div",
3816
3843
  {
3817
3844
  style: {
@@ -3845,26 +3872,26 @@ const or = () => /* @__PURE__ */ s(
3845
3872
  ]
3846
3873
  }
3847
3874
  );
3848
- function Gr({
3875
+ function Qr({
3849
3876
  children: n,
3850
3877
  loadingFallback: e,
3851
3878
  errorFallback: t,
3852
3879
  requireTenant: r = !0
3853
3880
  }) {
3854
- const { isAppLoading: i, appError: o, retryApp: a } = Se(), f = ke(), g = Ne(), w = Je(), c = Ke(), I = (f == null ? void 0 : f.isTenantLoading) ?? !1, p = (f == null ? void 0 : f.tenantError) ?? null, x = (f == null ? void 0 : f.tenantSlug) ?? null, R = (f == null ? void 0 : f.retryTenant) ?? (() => {
3881
+ const { isAppLoading: i, appError: o, retryApp: a } = ve(), f = xe(), g = Ce(), w = Je(), c = Ye(), I = (f == null ? void 0 : f.isTenantLoading) ?? !1, p = (f == null ? void 0 : f.tenantError) ?? null, x = (f == null ? void 0 : f.tenantSlug) ?? null, R = (f == null ? void 0 : f.retryTenant) ?? (() => {
3855
3882
  }), F = (g == null ? void 0 : g.isAuthReady) ?? !0, E = (w == null ? void 0 : w.isReady) ?? !0, A = (c == null ? void 0 : c.isReady) ?? !0, u = r && f && x, L = i || u && I || g && !F || w && !E || c && !A, D = o || (u ? p : null), P = () => {
3856
3883
  o && a(), p && f && R();
3857
3884
  };
3858
3885
  if (L)
3859
- return /* @__PURE__ */ s(_, { children: e || /* @__PURE__ */ s(or, {}) });
3886
+ return /* @__PURE__ */ s(_, { children: e || /* @__PURE__ */ s(ar, {}) });
3860
3887
  if (D) {
3861
- const U = typeof t == "function" ? t(D, P) : t || /* @__PURE__ */ s(ar, { error: D, retry: P });
3888
+ const U = typeof t == "function" ? t(D, P) : t || /* @__PURE__ */ s(lr, { error: D, retry: P });
3862
3889
  return /* @__PURE__ */ s(_, { children: U });
3863
3890
  }
3864
3891
  return /* @__PURE__ */ s(_, { children: n });
3865
3892
  }
3866
- function Qr(n = !0) {
3867
- const { isAppLoading: e, appError: t, retryApp: r, appInfo: i } = Se(), o = ke(), a = Ne(), f = Je(), g = Ke(), w = (o == null ? void 0 : o.isTenantLoading) ?? !1, c = (o == null ? void 0 : o.tenantError) ?? null, I = (o == null ? void 0 : o.tenant) ?? null, p = (o == null ? void 0 : o.tenantSlug) ?? null, x = (o == null ? void 0 : o.retryTenant) ?? (() => {
3893
+ function Kr(n = !0) {
3894
+ const { isAppLoading: e, appError: t, retryApp: r, appInfo: i } = ve(), o = xe(), a = Ce(), f = Je(), g = Ye(), w = (o == null ? void 0 : o.isTenantLoading) ?? !1, c = (o == null ? void 0 : o.tenantError) ?? null, I = (o == null ? void 0 : o.tenant) ?? null, p = (o == null ? void 0 : o.tenantSlug) ?? null, x = (o == null ? void 0 : o.retryTenant) ?? (() => {
3868
3895
  }), R = (a == null ? void 0 : a.isAuthReady) ?? !0, F = (f == null ? void 0 : f.isReady) ?? !0, E = (g == null ? void 0 : g.isReady) ?? !0, A = n && o && p, M = e || A && w || a && !R || f && !F || g && !E, L = t || (A ? c : null);
3869
3896
  return {
3870
3897
  isLoading: M,
@@ -3894,7 +3921,7 @@ function Zr({
3894
3921
  showCurrentTenant: w = !0
3895
3922
  }) {
3896
3923
  var k;
3897
- const c = Ne(), [I, p] = T(!1), x = Qe(null), R = n ?? (c == null ? void 0 : c.userTenants) ?? [], F = e ?? ((k = c == null ? void 0 : c.currentUser) == null ? void 0 : k.tenantId) ?? null, E = async (m) => {
3924
+ const c = Ce(), [I, p] = T(!1), x = Ke(null), R = n ?? (c == null ? void 0 : c.userTenants) ?? [], F = e ?? ((k = c == null ? void 0 : c.currentUser) == null ? void 0 : k.tenantId) ?? null, E = async (m) => {
3898
3925
  p(!1), t ? t(m) : c != null && c.switchToTenant && await c.switchToTenant(m);
3899
3926
  };
3900
3927
  ee(() => {
@@ -4045,7 +4072,7 @@ class Jr {
4045
4072
  };
4046
4073
  }
4047
4074
  }
4048
- class Kr {
4075
+ class Yr {
4049
4076
  constructor(e, t) {
4050
4077
  this.httpService = e, this.sessionManager = t;
4051
4078
  }
@@ -4096,7 +4123,7 @@ class Kr {
4096
4123
  });
4097
4124
  }
4098
4125
  }
4099
- class Yr {
4126
+ class Xr {
4100
4127
  constructor(e) {
4101
4128
  this.httpService = e;
4102
4129
  }
@@ -4105,7 +4132,7 @@ class Yr {
4105
4132
  return await this.httpService.get("/health");
4106
4133
  }
4107
4134
  }
4108
- class Xr {
4135
+ class en {
4109
4136
  // Date string to Date object
4110
4137
  static toDate(e) {
4111
4138
  return new Date(e);
@@ -4227,20 +4254,20 @@ class Xr {
4227
4254
  }), t;
4228
4255
  }
4229
4256
  }
4230
- const et = "returnTo", Ee = "zone_return_to", Me = "zone_return_to";
4231
- function en(n = {}) {
4257
+ const tt = "returnTo", Me = "zone_return_to", Le = "zone_return_to";
4258
+ function tn(n = {}) {
4232
4259
  const {
4233
4260
  zoneRoots: e = {},
4234
- returnToParam: t = et,
4261
+ returnToParam: t = tt,
4235
4262
  returnToStorage: r = "url"
4236
- } = n, i = ft(), [o, a] = gt(), { isAuthenticated: f, currentUser: g } = de(), { tenant: w } = ge(), c = J(() => ({ ...$e, ...e }), [e]), I = !!w, p = g == null ? void 0 : g.userType, x = J(() => {
4263
+ } = n, i = gt(), [o, a] = mt(), { isAuthenticated: f, currentUser: g } = ue(), { tenant: w } = ge(), c = Z(() => ({ ...He, ...e }), [e]), I = !!w, p = g == null ? void 0 : g.userType, x = Z(() => {
4237
4264
  switch (r) {
4238
4265
  case "url":
4239
4266
  return o.get(t);
4240
4267
  case "session":
4241
- return sessionStorage.getItem(Ee);
4268
+ return sessionStorage.getItem(Me);
4242
4269
  case "local":
4243
- return localStorage.getItem(Me);
4270
+ return localStorage.getItem(Le);
4244
4271
  default:
4245
4272
  return null;
4246
4273
  }
@@ -4252,10 +4279,10 @@ function en(n = {}) {
4252
4279
  break;
4253
4280
  }
4254
4281
  case "session":
4255
- sessionStorage.removeItem(Ee);
4282
+ sessionStorage.removeItem(Me);
4256
4283
  break;
4257
4284
  case "local":
4258
- localStorage.removeItem(Me);
4285
+ localStorage.removeItem(Le);
4259
4286
  break;
4260
4287
  }
4261
4288
  }, [r, o, t, a]), F = se(
@@ -4267,10 +4294,10 @@ function en(n = {}) {
4267
4294
  break;
4268
4295
  }
4269
4296
  case "session":
4270
- sessionStorage.setItem(Ee, u);
4297
+ sessionStorage.setItem(Me, u);
4271
4298
  break;
4272
4299
  case "local":
4273
- localStorage.setItem(Me, u);
4300
+ localStorage.setItem(Le, u);
4274
4301
  break;
4275
4302
  }
4276
4303
  },
@@ -4281,7 +4308,7 @@ function en(n = {}) {
4281
4308
  i(k);
4282
4309
  },
4283
4310
  [i, c]
4284
- ), A = se(() => I ? f ? p === oe.TENANT_ADMIN ? c.tenantAdmin : c.tenantUser : c.tenantGuest : f ? p === oe.TENANT_ADMIN ? c.publicAdmin : c.publicUser : c.publicGuest, [I, f, p, c]);
4311
+ ), A = se(() => I ? f ? p === ae.TENANT_ADMIN ? c.tenantAdmin : c.tenantUser : c.tenantGuest : f ? p === ae.TENANT_ADMIN ? c.publicAdmin : c.publicUser : c.publicGuest, [I, f, p, c]);
4285
4312
  return {
4286
4313
  returnToUrl: x,
4287
4314
  clearReturnTo: R,
@@ -4290,76 +4317,76 @@ function en(n = {}) {
4290
4317
  getSmartRedirect: A
4291
4318
  };
4292
4319
  }
4293
- function tn(n, e, t = et, r = "url") {
4320
+ function rn(n, e, t = tt, r = "url") {
4294
4321
  if (!e || r !== "url")
4295
4322
  return n;
4296
4323
  const i = new URL(n, window.location.origin);
4297
4324
  return i.searchParams.set(t, e), i.pathname + i.search;
4298
4325
  }
4299
4326
  export {
4300
- Nr as AdminZone,
4301
- Xr as ApiMappers,
4302
- Oe as AppApiService,
4303
- Gr as AppLoader,
4304
- mr as AppProvider,
4305
- wt as AuthApiService,
4306
- vr as AuthProvider,
4307
- Fr as AuthenticatedZone,
4308
- Ye as DEFAULT_ZONE_PRESETS,
4309
- $e as DEFAULT_ZONE_ROOTS,
4310
- Or as FeatureFlag,
4311
- Rt as FeatureFlagApiService,
4312
- Tr as FeatureFlagProvider,
4313
- Dr as GuestZone,
4314
- Yr as HealthApiService,
4315
- le as HttpService,
4316
- Er as LandingRoute,
4317
- zr as LoginForm,
4318
- Wr as MagicLinkForm,
4319
- Vr as MagicLinkVerify,
4320
- Ur as OpenZone,
4321
- jr as PasswordRecoveryForm,
4327
+ Cr as AdminZone,
4328
+ en as ApiMappers,
4329
+ ze as AppApiService,
4330
+ Qr as AppLoader,
4331
+ yr as AppProvider,
4332
+ bt as AuthApiService,
4333
+ Tr as AuthProvider,
4334
+ Dr as AuthenticatedZone,
4335
+ Xe as DEFAULT_ZONE_PRESETS,
4336
+ He as DEFAULT_ZONE_ROOTS,
4337
+ zr as FeatureFlag,
4338
+ It as FeatureFlagApiService,
4339
+ kr as FeatureFlagProvider,
4340
+ Nr as GuestZone,
4341
+ Xr as HealthApiService,
4342
+ ce as HttpService,
4343
+ Mr as LandingRoute,
4344
+ _r as LoginForm,
4345
+ Vr as MagicLinkForm,
4346
+ jr as MagicLinkVerify,
4347
+ $r as OpenZone,
4348
+ Gr as PasswordRecoveryForm,
4322
4349
  Jr as PermissionApiService,
4323
- Pr as Protected,
4324
- Rr as ProtectedRoute,
4325
- Lr as PublicZone,
4326
- ze as RoleApiService,
4327
- xr as RoutingProvider,
4350
+ Rr as Protected,
4351
+ Ir as ProtectedRoute,
4352
+ Fr as PublicZone,
4353
+ _e as RoleApiService,
4354
+ Ar as RoutingProvider,
4328
4355
  ie as SessionExpiredError,
4329
- pe as SessionManager,
4330
- _r as SignupForm,
4331
- Et as SubscriptionApiService,
4332
- qr as SubscriptionGuard,
4333
- Kr as SubscriptionPlanApiService,
4334
- kr as SubscriptionProvider,
4335
- we as TenantApiService,
4336
- $r as TenantAuthenticatedZone,
4337
- Br as TenantGuestZone,
4338
- Hr as TenantOpenZone,
4339
- wr as TenantProvider,
4340
- Ir as TenantRoute,
4356
+ we as SessionManager,
4357
+ Wr as SignupForm,
4358
+ Mt as SubscriptionApiService,
4359
+ Or as SubscriptionGuard,
4360
+ Yr as SubscriptionPlanApiService,
4361
+ xr as SubscriptionProvider,
4362
+ be as TenantApiService,
4363
+ Hr as TenantAuthenticatedZone,
4364
+ qr as TenantGuestZone,
4365
+ Br as TenantOpenZone,
4366
+ br as TenantProvider,
4367
+ Er as TenantRoute,
4341
4368
  Zr as TenantSelector,
4342
- Mr as TenantZone,
4343
- yt as TokenRefreshError,
4344
- mt as TokenRefreshTimeoutError,
4345
- bt as UserApiService,
4346
- oe as UserType,
4347
- Cr as UserZone,
4348
- ce as ZoneRoute,
4349
- tn as buildRedirectUrl,
4350
- yr as useApi,
4351
- Se as useApp,
4352
- Qr as useAppLoaderState,
4353
- de as useAuth,
4354
- It as useFeatureFlags,
4355
- Ar as useRouting,
4356
- Lt as useRoutingOptional,
4357
- Sr as useSettings,
4358
- Mt as useSubscription,
4369
+ Lr as TenantZone,
4370
+ wt as TokenRefreshError,
4371
+ yt as TokenRefreshTimeoutError,
4372
+ St as UserApiService,
4373
+ ae as UserType,
4374
+ Ur as UserZone,
4375
+ de as ZoneRoute,
4376
+ rn as buildRedirectUrl,
4377
+ wr as useApi,
4378
+ ve as useApp,
4379
+ Kr as useAppLoaderState,
4380
+ ue as useAuth,
4381
+ Et as useFeatureFlags,
4382
+ Pr as useRouting,
4383
+ Ft as useRoutingOptional,
4384
+ vr as useSettings,
4385
+ Lt as useSubscription,
4359
4386
  ge as useTenant,
4360
4387
  me as useTenantInfo,
4361
- ke as useTenantOptional,
4362
- br as useTenantSettings,
4363
- en as useZoneNavigation
4388
+ xe as useTenantOptional,
4389
+ Sr as useTenantSettings,
4390
+ tn as useZoneNavigation
4364
4391
  };
4365
4392
  //# sourceMappingURL=index.es.js.map