@viasoftbr/shared-ui 0.0.2 → 0.0.4

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/context.js CHANGED
@@ -35,411 +35,7 @@ function ThemeProvider({ children }) {
35
35
  }
36
36
 
37
37
  // src/context/AuthContext.tsx
38
- import { createContext as createContext4, useContext as useContext4, useEffect as useEffect4, useState as useState4 } from "react";
39
-
40
- // node_modules/.pnpm/react-router-dom@6.30.3_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-router-dom/dist/index.js
41
- import * as React3 from "react";
42
- import * as ReactDOM from "react-dom";
43
-
44
- // node_modules/.pnpm/react-router@6.30.3_react@19.2.4/node_modules/react-router/dist/index.js
45
- import * as React2 from "react";
46
-
47
- // node_modules/.pnpm/@remix-run+router@1.23.2/node_modules/@remix-run/router/dist/router.js
48
- function _extends() {
49
- _extends = Object.assign ? Object.assign.bind() : function(target) {
50
- for (var i = 1; i < arguments.length; i++) {
51
- var source = arguments[i];
52
- for (var key in source) {
53
- if (Object.prototype.hasOwnProperty.call(source, key)) {
54
- target[key] = source[key];
55
- }
56
- }
57
- }
58
- return target;
59
- };
60
- return _extends.apply(this, arguments);
61
- }
62
- var Action;
63
- (function(Action2) {
64
- Action2["Pop"] = "POP";
65
- Action2["Push"] = "PUSH";
66
- Action2["Replace"] = "REPLACE";
67
- })(Action || (Action = {}));
68
- function invariant(value, message) {
69
- if (value === false || value === null || typeof value === "undefined") {
70
- throw new Error(message);
71
- }
72
- }
73
- function warning(cond, message) {
74
- if (!cond) {
75
- if (typeof console !== "undefined")
76
- console.warn(message);
77
- try {
78
- throw new Error(message);
79
- } catch (e) {
80
- }
81
- }
82
- }
83
- function parsePath(path) {
84
- let parsedPath = {};
85
- if (path) {
86
- let hashIndex = path.indexOf("#");
87
- if (hashIndex >= 0) {
88
- parsedPath.hash = path.substr(hashIndex);
89
- path = path.substr(0, hashIndex);
90
- }
91
- let searchIndex = path.indexOf("?");
92
- if (searchIndex >= 0) {
93
- parsedPath.search = path.substr(searchIndex);
94
- path = path.substr(0, searchIndex);
95
- }
96
- if (path) {
97
- parsedPath.pathname = path;
98
- }
99
- }
100
- return parsedPath;
101
- }
102
- var ResultType;
103
- (function(ResultType2) {
104
- ResultType2["data"] = "data";
105
- ResultType2["deferred"] = "deferred";
106
- ResultType2["redirect"] = "redirect";
107
- ResultType2["error"] = "error";
108
- })(ResultType || (ResultType = {}));
109
- var ABSOLUTE_URL_REGEX$1 = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
110
- var isAbsoluteUrl = (url) => ABSOLUTE_URL_REGEX$1.test(url);
111
- function resolvePath(to, fromPathname) {
112
- if (fromPathname === void 0) {
113
- fromPathname = "/";
114
- }
115
- let {
116
- pathname: toPathname,
117
- search = "",
118
- hash = ""
119
- } = typeof to === "string" ? parsePath(to) : to;
120
- let pathname;
121
- if (toPathname) {
122
- if (isAbsoluteUrl(toPathname)) {
123
- pathname = toPathname;
124
- } else {
125
- if (toPathname.includes("//")) {
126
- let oldPathname = toPathname;
127
- toPathname = toPathname.replace(/\/\/+/g, "/");
128
- warning(false, "Pathnames cannot have embedded double slashes - normalizing " + (oldPathname + " -> " + toPathname));
129
- }
130
- if (toPathname.startsWith("/")) {
131
- pathname = resolvePathname(toPathname.substring(1), "/");
132
- } else {
133
- pathname = resolvePathname(toPathname, fromPathname);
134
- }
135
- }
136
- } else {
137
- pathname = fromPathname;
138
- }
139
- return {
140
- pathname,
141
- search: normalizeSearch(search),
142
- hash: normalizeHash(hash)
143
- };
144
- }
145
- function resolvePathname(relativePath, fromPathname) {
146
- let segments = fromPathname.replace(/\/+$/, "").split("/");
147
- let relativeSegments = relativePath.split("/");
148
- relativeSegments.forEach((segment) => {
149
- if (segment === "..") {
150
- if (segments.length > 1)
151
- segments.pop();
152
- } else if (segment !== ".") {
153
- segments.push(segment);
154
- }
155
- });
156
- return segments.length > 1 ? segments.join("/") : "/";
157
- }
158
- function getInvalidPathError(char, field, dest, path) {
159
- return "Cannot include a '" + char + "' character in a manually specified " + ("`to." + field + "` field [" + JSON.stringify(path) + "]. Please separate it out to the ") + ("`to." + dest + "` field. Alternatively you may provide the full path as ") + 'a string in <Link to="..."> and the router will parse it for you.';
160
- }
161
- function getPathContributingMatches(matches) {
162
- return matches.filter((match, index) => index === 0 || match.route.path && match.route.path.length > 0);
163
- }
164
- function getResolveToMatches(matches, v7_relativeSplatPath) {
165
- let pathMatches = getPathContributingMatches(matches);
166
- if (v7_relativeSplatPath) {
167
- return pathMatches.map((match, idx) => idx === pathMatches.length - 1 ? match.pathname : match.pathnameBase);
168
- }
169
- return pathMatches.map((match) => match.pathnameBase);
170
- }
171
- function resolveTo(toArg, routePathnames, locationPathname, isPathRelative) {
172
- if (isPathRelative === void 0) {
173
- isPathRelative = false;
174
- }
175
- let to;
176
- if (typeof toArg === "string") {
177
- to = parsePath(toArg);
178
- } else {
179
- to = _extends({}, toArg);
180
- invariant(!to.pathname || !to.pathname.includes("?"), getInvalidPathError("?", "pathname", "search", to));
181
- invariant(!to.pathname || !to.pathname.includes("#"), getInvalidPathError("#", "pathname", "hash", to));
182
- invariant(!to.search || !to.search.includes("#"), getInvalidPathError("#", "search", "hash", to));
183
- }
184
- let isEmptyPath = toArg === "" || to.pathname === "";
185
- let toPathname = isEmptyPath ? "/" : to.pathname;
186
- let from;
187
- if (toPathname == null) {
188
- from = locationPathname;
189
- } else {
190
- let routePathnameIndex = routePathnames.length - 1;
191
- if (!isPathRelative && toPathname.startsWith("..")) {
192
- let toSegments = toPathname.split("/");
193
- while (toSegments[0] === "..") {
194
- toSegments.shift();
195
- routePathnameIndex -= 1;
196
- }
197
- to.pathname = toSegments.join("/");
198
- }
199
- from = routePathnameIndex >= 0 ? routePathnames[routePathnameIndex] : "/";
200
- }
201
- let path = resolvePath(to, from);
202
- let hasExplicitTrailingSlash = toPathname && toPathname !== "/" && toPathname.endsWith("/");
203
- let hasCurrentTrailingSlash = (isEmptyPath || toPathname === ".") && locationPathname.endsWith("/");
204
- if (!path.pathname.endsWith("/") && (hasExplicitTrailingSlash || hasCurrentTrailingSlash)) {
205
- path.pathname += "/";
206
- }
207
- return path;
208
- }
209
- var joinPaths = (paths) => paths.join("/").replace(/\/\/+/g, "/");
210
- var normalizeSearch = (search) => !search || search === "?" ? "" : search.startsWith("?") ? search : "?" + search;
211
- var normalizeHash = (hash) => !hash || hash === "#" ? "" : hash.startsWith("#") ? hash : "#" + hash;
212
- var validMutationMethodsArr = ["post", "put", "patch", "delete"];
213
- var validMutationMethods = new Set(validMutationMethodsArr);
214
- var validRequestMethodsArr = ["get", ...validMutationMethodsArr];
215
- var validRequestMethods = new Set(validRequestMethodsArr);
216
- var UNSAFE_DEFERRED_SYMBOL = Symbol("deferred");
217
-
218
- // node_modules/.pnpm/react-router@6.30.3_react@19.2.4/node_modules/react-router/dist/index.js
219
- function _extends2() {
220
- _extends2 = Object.assign ? Object.assign.bind() : function(target) {
221
- for (var i = 1; i < arguments.length; i++) {
222
- var source = arguments[i];
223
- for (var key in source) {
224
- if (Object.prototype.hasOwnProperty.call(source, key)) {
225
- target[key] = source[key];
226
- }
227
- }
228
- }
229
- return target;
230
- };
231
- return _extends2.apply(this, arguments);
232
- }
233
- var DataRouterContext = /* @__PURE__ */ React2.createContext(null);
234
- if (false) {
235
- DataRouterContext.displayName = "DataRouter";
236
- }
237
- if (false) {
238
- DataRouterStateContext.displayName = "DataRouterState";
239
- }
240
- if (false) {
241
- AwaitContext.displayName = "Await";
242
- }
243
- var NavigationContext = /* @__PURE__ */ React2.createContext(null);
244
- if (false) {
245
- NavigationContext.displayName = "Navigation";
246
- }
247
- var LocationContext = /* @__PURE__ */ React2.createContext(null);
248
- if (false) {
249
- LocationContext.displayName = "Location";
250
- }
251
- var RouteContext = /* @__PURE__ */ React2.createContext({
252
- outlet: null,
253
- matches: [],
254
- isDataRoute: false
255
- });
256
- if (false) {
257
- RouteContext.displayName = "Route";
258
- }
259
- if (false) {
260
- RouteErrorContext.displayName = "RouteError";
261
- }
262
- function useInRouterContext() {
263
- return React2.useContext(LocationContext) != null;
264
- }
265
- function useLocation() {
266
- !useInRouterContext() ? false ? invariant(
267
- false,
268
- // TODO: This error is probably because they somehow have 2 versions of the
269
- // router loaded. We can help them understand how to avoid that.
270
- "useLocation() may be used only in the context of a <Router> component."
271
- ) : invariant(false) : void 0;
272
- return React2.useContext(LocationContext).location;
273
- }
274
- function useIsomorphicLayoutEffect(cb) {
275
- let isStatic = React2.useContext(NavigationContext).static;
276
- if (!isStatic) {
277
- React2.useLayoutEffect(cb);
278
- }
279
- }
280
- function useNavigate() {
281
- let {
282
- isDataRoute
283
- } = React2.useContext(RouteContext);
284
- return isDataRoute ? useNavigateStable() : useNavigateUnstable();
285
- }
286
- function useNavigateUnstable() {
287
- !useInRouterContext() ? false ? invariant(
288
- false,
289
- // TODO: This error is probably because they somehow have 2 versions of the
290
- // router loaded. We can help them understand how to avoid that.
291
- "useNavigate() may be used only in the context of a <Router> component."
292
- ) : invariant(false) : void 0;
293
- let dataRouterContext = React2.useContext(DataRouterContext);
294
- let {
295
- basename,
296
- future,
297
- navigator: navigator2
298
- } = React2.useContext(NavigationContext);
299
- let {
300
- matches
301
- } = React2.useContext(RouteContext);
302
- let {
303
- pathname: locationPathname
304
- } = useLocation();
305
- let routePathnamesJson = JSON.stringify(getResolveToMatches(matches, future.v7_relativeSplatPath));
306
- let activeRef = React2.useRef(false);
307
- useIsomorphicLayoutEffect(() => {
308
- activeRef.current = true;
309
- });
310
- let navigate = React2.useCallback(function(to, options) {
311
- if (options === void 0) {
312
- options = {};
313
- }
314
- false ? warning(activeRef.current, navigateEffectWarning) : void 0;
315
- if (!activeRef.current)
316
- return;
317
- if (typeof to === "number") {
318
- navigator2.go(to);
319
- return;
320
- }
321
- let path = resolveTo(to, JSON.parse(routePathnamesJson), locationPathname, options.relative === "path");
322
- if (dataRouterContext == null && basename !== "/") {
323
- path.pathname = path.pathname === "/" ? basename : joinPaths([basename, path.pathname]);
324
- }
325
- (!!options.replace ? navigator2.replace : navigator2.push)(path, options.state, options);
326
- }, [basename, navigator2, routePathnamesJson, locationPathname, dataRouterContext]);
327
- return navigate;
328
- }
329
- var DataRouterHook = /* @__PURE__ */ function(DataRouterHook3) {
330
- DataRouterHook3["UseBlocker"] = "useBlocker";
331
- DataRouterHook3["UseRevalidator"] = "useRevalidator";
332
- DataRouterHook3["UseNavigateStable"] = "useNavigate";
333
- return DataRouterHook3;
334
- }(DataRouterHook || {});
335
- var DataRouterStateHook = /* @__PURE__ */ function(DataRouterStateHook3) {
336
- DataRouterStateHook3["UseBlocker"] = "useBlocker";
337
- DataRouterStateHook3["UseLoaderData"] = "useLoaderData";
338
- DataRouterStateHook3["UseActionData"] = "useActionData";
339
- DataRouterStateHook3["UseRouteError"] = "useRouteError";
340
- DataRouterStateHook3["UseNavigation"] = "useNavigation";
341
- DataRouterStateHook3["UseRouteLoaderData"] = "useRouteLoaderData";
342
- DataRouterStateHook3["UseMatches"] = "useMatches";
343
- DataRouterStateHook3["UseRevalidator"] = "useRevalidator";
344
- DataRouterStateHook3["UseNavigateStable"] = "useNavigate";
345
- DataRouterStateHook3["UseRouteId"] = "useRouteId";
346
- return DataRouterStateHook3;
347
- }(DataRouterStateHook || {});
348
- function useDataRouterContext(hookName) {
349
- let ctx = React2.useContext(DataRouterContext);
350
- !ctx ? false ? invariant(false, getDataRouterConsoleError(hookName)) : invariant(false) : void 0;
351
- return ctx;
352
- }
353
- function useRouteContext(hookName) {
354
- let route = React2.useContext(RouteContext);
355
- !route ? false ? invariant(false, getDataRouterConsoleError(hookName)) : invariant(false) : void 0;
356
- return route;
357
- }
358
- function useCurrentRouteId(hookName) {
359
- let route = useRouteContext(hookName);
360
- let thisRoute = route.matches[route.matches.length - 1];
361
- !thisRoute.route.id ? false ? invariant(false, hookName + ' can only be used on routes that contain a unique "id"') : invariant(false) : void 0;
362
- return thisRoute.route.id;
363
- }
364
- function useNavigateStable() {
365
- let {
366
- router
367
- } = useDataRouterContext(DataRouterHook.UseNavigateStable);
368
- let id = useCurrentRouteId(DataRouterStateHook.UseNavigateStable);
369
- let activeRef = React2.useRef(false);
370
- useIsomorphicLayoutEffect(() => {
371
- activeRef.current = true;
372
- });
373
- let navigate = React2.useCallback(function(to, options) {
374
- if (options === void 0) {
375
- options = {};
376
- }
377
- false ? warning(activeRef.current, navigateEffectWarning) : void 0;
378
- if (!activeRef.current)
379
- return;
380
- if (typeof to === "number") {
381
- router.navigate(to);
382
- } else {
383
- router.navigate(to, _extends2({
384
- fromRouteId: id
385
- }, options));
386
- }
387
- }, [router, id]);
388
- return navigate;
389
- }
390
- var START_TRANSITION = "startTransition";
391
- var startTransitionImpl = React2[START_TRANSITION];
392
- var neverSettledPromise = new Promise(() => {
393
- });
394
-
395
- // node_modules/.pnpm/react-router-dom@6.30.3_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-router-dom/dist/index.js
396
- var REACT_ROUTER_VERSION = "6";
397
- try {
398
- window.__reactRouterVersion = REACT_ROUTER_VERSION;
399
- } catch (e) {
400
- }
401
- if (false) {
402
- ViewTransitionContext.displayName = "ViewTransition";
403
- }
404
- if (false) {
405
- FetchersContext.displayName = "Fetchers";
406
- }
407
- var START_TRANSITION2 = "startTransition";
408
- var startTransitionImpl2 = React3[START_TRANSITION2];
409
- var FLUSH_SYNC = "flushSync";
410
- var flushSyncImpl = ReactDOM[FLUSH_SYNC];
411
- var USE_ID = "useId";
412
- var useIdImpl = React3[USE_ID];
413
- if (false) {
414
- HistoryRouter.displayName = "unstable_HistoryRouter";
415
- }
416
- var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
417
- if (false) {
418
- Link.displayName = "Link";
419
- }
420
- if (false) {
421
- NavLink.displayName = "NavLink";
422
- }
423
- if (false) {
424
- Form.displayName = "Form";
425
- }
426
- if (false) {
427
- ScrollRestoration.displayName = "ScrollRestoration";
428
- }
429
- var DataRouterHook2;
430
- (function(DataRouterHook3) {
431
- DataRouterHook3["UseScrollRestoration"] = "useScrollRestoration";
432
- DataRouterHook3["UseSubmit"] = "useSubmit";
433
- DataRouterHook3["UseSubmitFetcher"] = "useSubmitFetcher";
434
- DataRouterHook3["UseFetcher"] = "useFetcher";
435
- DataRouterHook3["useViewTransitionState"] = "useViewTransitionState";
436
- })(DataRouterHook2 || (DataRouterHook2 = {}));
437
- var DataRouterStateHook2;
438
- (function(DataRouterStateHook3) {
439
- DataRouterStateHook3["UseFetcher"] = "useFetcher";
440
- DataRouterStateHook3["UseFetchers"] = "useFetchers";
441
- DataRouterStateHook3["UseScrollRestoration"] = "useScrollRestoration";
442
- })(DataRouterStateHook2 || (DataRouterStateHook2 = {}));
38
+ import { createContext as createContext2, useContext as useContext2, useEffect as useEffect2, useState as useState2 } from "react";
443
39
 
444
40
  // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/helpers/bind.js
445
41
  function bind(fn, thisArg) {
@@ -2275,9 +1871,9 @@ var trackStream = (stream, chunkSize, onProgress, onFinish) => {
2275
1871
  // node_modules/.pnpm/axios@1.13.4/node_modules/axios/lib/adapters/fetch.js
2276
1872
  var DEFAULT_CHUNK_SIZE = 64 * 1024;
2277
1873
  var { isFunction: isFunction2 } = utils_default;
2278
- var globalFetchAPI = (({ Request: Request2, Response: Response2 }) => ({
2279
- Request: Request2,
2280
- Response: Response2
1874
+ var globalFetchAPI = (({ Request, Response }) => ({
1875
+ Request,
1876
+ Response
2281
1877
  }))(utils_default.global);
2282
1878
  var {
2283
1879
  ReadableStream: ReadableStream2,
@@ -2294,18 +1890,18 @@ var factory = (env) => {
2294
1890
  env = utils_default.merge.call({
2295
1891
  skipUndefined: true
2296
1892
  }, globalFetchAPI, env);
2297
- const { fetch: envFetch, Request: Request2, Response: Response2 } = env;
1893
+ const { fetch: envFetch, Request, Response } = env;
2298
1894
  const isFetchSupported = envFetch ? isFunction2(envFetch) : typeof fetch === "function";
2299
- const isRequestSupported = isFunction2(Request2);
2300
- const isResponseSupported = isFunction2(Response2);
1895
+ const isRequestSupported = isFunction2(Request);
1896
+ const isResponseSupported = isFunction2(Response);
2301
1897
  if (!isFetchSupported) {
2302
1898
  return false;
2303
1899
  }
2304
1900
  const isReadableStreamSupported = isFetchSupported && isFunction2(ReadableStream2);
2305
- const encodeText = isFetchSupported && (typeof TextEncoder === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : async (str) => new Uint8Array(await new Request2(str).arrayBuffer()));
1901
+ const encodeText = isFetchSupported && (typeof TextEncoder === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : async (str) => new Uint8Array(await new Request(str).arrayBuffer()));
2306
1902
  const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
2307
1903
  let duplexAccessed = false;
2308
- const hasContentType = new Request2(platform_default.origin, {
1904
+ const hasContentType = new Request(platform_default.origin, {
2309
1905
  body: new ReadableStream2(),
2310
1906
  method: "POST",
2311
1907
  get duplex() {
@@ -2315,7 +1911,7 @@ var factory = (env) => {
2315
1911
  }).headers.has("Content-Type");
2316
1912
  return duplexAccessed && !hasContentType;
2317
1913
  });
2318
- const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(() => utils_default.isReadableStream(new Response2("").body));
1914
+ const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(() => utils_default.isReadableStream(new Response("").body));
2319
1915
  const resolvers = {
2320
1916
  stream: supportsResponseStream && ((res) => res.body)
2321
1917
  };
@@ -2338,7 +1934,7 @@ var factory = (env) => {
2338
1934
  return body.size;
2339
1935
  }
2340
1936
  if (utils_default.isSpecCompliantForm(body)) {
2341
- const _request = new Request2(platform_default.origin, {
1937
+ const _request = new Request(platform_default.origin, {
2342
1938
  method: "POST",
2343
1939
  body
2344
1940
  });
@@ -2383,7 +1979,7 @@ var factory = (env) => {
2383
1979
  let requestContentLength;
2384
1980
  try {
2385
1981
  if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) {
2386
- let _request = new Request2(url, {
1982
+ let _request = new Request(url, {
2387
1983
  method: "POST",
2388
1984
  body: data,
2389
1985
  duplex: "half"
@@ -2403,7 +1999,7 @@ var factory = (env) => {
2403
1999
  if (!utils_default.isString(withCredentials)) {
2404
2000
  withCredentials = withCredentials ? "include" : "omit";
2405
2001
  }
2406
- const isCredentialsSupported = isRequestSupported && "credentials" in Request2.prototype;
2002
+ const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype;
2407
2003
  const resolvedOptions = {
2408
2004
  ...fetchOptions,
2409
2005
  signal: composedSignal,
@@ -2413,7 +2009,7 @@ var factory = (env) => {
2413
2009
  duplex: "half",
2414
2010
  credentials: isCredentialsSupported ? withCredentials : void 0
2415
2011
  };
2416
- request = isRequestSupported && new Request2(url, resolvedOptions);
2012
+ request = isRequestSupported && new Request(url, resolvedOptions);
2417
2013
  let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions));
2418
2014
  const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
2419
2015
  if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
@@ -2426,7 +2022,7 @@ var factory = (env) => {
2426
2022
  responseContentLength,
2427
2023
  progressEventReducer(asyncDecorator(onDownloadProgress), true)
2428
2024
  ) || [];
2429
- response = new Response2(
2025
+ response = new Response(
2430
2026
  trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
2431
2027
  flush && flush();
2432
2028
  unsubscribe && unsubscribe();
@@ -2464,10 +2060,10 @@ var factory = (env) => {
2464
2060
  var seedCache = /* @__PURE__ */ new Map();
2465
2061
  var getFetch = (config) => {
2466
2062
  let env = config && config.env || {};
2467
- const { fetch: fetch2, Request: Request2, Response: Response2 } = env;
2063
+ const { fetch: fetch2, Request, Response } = env;
2468
2064
  const seeds = [
2469
- Request2,
2470
- Response2,
2065
+ Request,
2066
+ Response,
2471
2067
  fetch2
2472
2068
  ];
2473
2069
  let len = seeds.length, i = len, seed, target, map = seedCache;
@@ -3225,8 +2821,8 @@ var authService = {
3225
2821
  };
3226
2822
 
3227
2823
  // src/services/loadRemoteModule.ts
3228
- import * as React4 from "react";
3229
- import * as ReactDOM2 from "react-dom";
2824
+ import * as React2 from "react";
2825
+ import * as ReactDOM from "react-dom";
3230
2826
 
3231
2827
  // src/services/metadataLoader.ts
3232
2828
  var MetadataLoader = class {
@@ -3370,12 +2966,12 @@ var hostConfigLoader = new HostConfigLoader();
3370
2966
 
3371
2967
  // src/context/AuthContext.tsx
3372
2968
  import { jsx as jsx2 } from "react/jsx-runtime";
3373
- var AuthContext = createContext4(void 0);
3374
- var AuthProvider = ({ children }) => {
3375
- const [user, setUser] = useState4(null);
3376
- const [accessToken, setToken] = useState4(null);
3377
- const [loading, setLoading] = useState4(true);
3378
- useEffect4(() => {
2969
+ var AuthContext = createContext2(void 0);
2970
+ var AuthProvider = ({ children, onNavigate }) => {
2971
+ const [user, setUser] = useState2(null);
2972
+ const [accessToken, setToken] = useState2(null);
2973
+ const [loading, setLoading] = useState2(true);
2974
+ useEffect2(() => {
3379
2975
  try {
3380
2976
  const storedUser = localStorage.getItem("user");
3381
2977
  if (storedUser)
@@ -3396,7 +2992,6 @@ var AuthProvider = ({ children }) => {
3396
2992
  }
3397
2993
  setLoading(false);
3398
2994
  }, []);
3399
- const navigate = useNavigate();
3400
2995
  const login = async (username, password, options) => {
3401
2996
  const resp = await authService.login(username, password);
3402
2997
  setToken(resp.accessToken);
@@ -3408,7 +3003,7 @@ var AuthProvider = ({ children }) => {
3408
3003
  } catch {
3409
3004
  }
3410
3005
  if (options?.redirect !== false)
3411
- navigate("/");
3006
+ onNavigate?.("/");
3412
3007
  };
3413
3008
  const logout = async () => {
3414
3009
  try {
@@ -3421,7 +3016,7 @@ var AuthProvider = ({ children }) => {
3421
3016
  localStorage.removeItem("user");
3422
3017
  } catch {
3423
3018
  }
3424
- navigate("/login");
3019
+ onNavigate?.("/login");
3425
3020
  }
3426
3021
  };
3427
3022
  const hasRole = (roles) => {
@@ -3433,51 +3028,23 @@ var AuthProvider = ({ children }) => {
3433
3028
  return /* @__PURE__ */ jsx2(AuthContext.Provider, { value: { user, accessToken, loading, login, logout, hasRole }, children });
3434
3029
  };
3435
3030
  function useAuth() {
3436
- const ctx = useContext4(AuthContext);
3031
+ const ctx = useContext2(AuthContext);
3437
3032
  if (!ctx)
3438
3033
  throw new Error("useAuth must be used within AuthProvider");
3439
3034
  return ctx;
3440
3035
  }
3036
+
3037
+ // src/context/SharedUiProvider.tsx
3038
+ import React4 from "react";
3039
+ import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
3040
+ import { jsx as jsx3 } from "react/jsx-runtime";
3041
+ function SharedUiProvider({ children, client }) {
3042
+ const internal = React4.useMemo(() => client ?? new QueryClient(), [client]);
3043
+ return /* @__PURE__ */ jsx3(QueryClientProvider, { client: internal, children });
3044
+ }
3441
3045
  export {
3442
3046
  AuthProvider,
3047
+ SharedUiProvider,
3443
3048
  ThemeProvider,
3444
3049
  useAuth
3445
3050
  };
3446
- /*! Bundled license information:
3447
-
3448
- @remix-run/router/dist/router.js:
3449
- (**
3450
- * @remix-run/router v1.23.2
3451
- *
3452
- * Copyright (c) Remix Software Inc.
3453
- *
3454
- * This source code is licensed under the MIT license found in the
3455
- * LICENSE.md file in the root directory of this source tree.
3456
- *
3457
- * @license MIT
3458
- *)
3459
-
3460
- react-router/dist/index.js:
3461
- (**
3462
- * React Router v6.30.3
3463
- *
3464
- * Copyright (c) Remix Software Inc.
3465
- *
3466
- * This source code is licensed under the MIT license found in the
3467
- * LICENSE.md file in the root directory of this source tree.
3468
- *
3469
- * @license MIT
3470
- *)
3471
-
3472
- react-router-dom/dist/index.js:
3473
- (**
3474
- * React Router DOM v6.30.3
3475
- *
3476
- * Copyright (c) Remix Software Inc.
3477
- *
3478
- * This source code is licensed under the MIT license found in the
3479
- * LICENSE.md file in the root directory of this source tree.
3480
- *
3481
- * @license MIT
3482
- *)
3483
- */