@tern-secure/nextjs 3.1.31 → 3.1.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/dist/cjs/app-router/client/client-init.js +70 -0
  2. package/dist/cjs/app-router/client/client-init.js.map +7 -0
  3. package/dist/cjs/app-router/client/config.js +49 -0
  4. package/dist/cjs/app-router/client/config.js.map +7 -0
  5. package/dist/cjs/app-router/client/index.js +139 -0
  6. package/dist/cjs/app-router/client/index.js.map +7 -0
  7. package/dist/cjs/app-router/server/index.js +127 -0
  8. package/dist/cjs/app-router/server/index.js.map +7 -0
  9. package/dist/{esm/index.cjs → cjs/components/index.js} +92 -149
  10. package/dist/cjs/components/index.js.map +7 -0
  11. package/dist/cjs/index.js +124 -50
  12. package/dist/cjs/index.js.map +7 -1
  13. package/dist/esm/app-router/client/auth.d.ts +7 -0
  14. package/dist/esm/app-router/client/auth.d.ts.map +1 -0
  15. package/dist/esm/app-router/client/client-init.d.ts +4 -0
  16. package/dist/esm/app-router/client/client-init.d.ts.map +1 -0
  17. package/dist/esm/app-router/client/client-init.js +12 -0
  18. package/dist/esm/app-router/client/client-init.js.map +7 -0
  19. package/dist/esm/app-router/client/config.d.ts +4 -0
  20. package/dist/esm/app-router/client/config.d.ts.map +1 -0
  21. package/dist/esm/app-router/client/config.js +9 -0
  22. package/dist/esm/app-router/client/config.js.map +7 -0
  23. package/dist/esm/app-router/client/index.d.ts +7 -0
  24. package/dist/esm/app-router/client/index.d.ts.map +1 -0
  25. package/dist/esm/app-router/client/index.js +30 -0
  26. package/dist/esm/app-router/client/index.js.map +7 -0
  27. package/dist/esm/app-router/client/providers/ternSecureClientProvider.d.ts +5 -0
  28. package/dist/esm/app-router/client/providers/ternSecureClientProvider.d.ts.map +1 -0
  29. package/dist/esm/app-router/client/providers/ternSecureContext.d.ts +7 -0
  30. package/dist/esm/app-router/client/providers/ternSecureContext.d.ts.map +1 -0
  31. package/dist/esm/app-router/server/index.d.ts +2 -0
  32. package/dist/esm/app-router/server/index.d.ts.map +1 -0
  33. package/dist/esm/app-router/server/index.js +7 -0
  34. package/dist/esm/app-router/server/index.js.map +7 -0
  35. package/dist/esm/app-router/server/providers/TernSecureServerProvider.d.ts +7 -0
  36. package/dist/esm/app-router/server/providers/TernSecureServerProvider.d.ts.map +1 -0
  37. package/dist/esm/chunk-5DISHXED.js +24 -0
  38. package/dist/esm/chunk-5DISHXED.js.map +7 -0
  39. package/dist/esm/chunk-7RZ4XLTY.js +44 -0
  40. package/dist/esm/chunk-7RZ4XLTY.js.map +7 -0
  41. package/dist/esm/chunk-CGWE73OH.js +18 -0
  42. package/dist/esm/chunk-CGWE73OH.js.map +7 -0
  43. package/dist/esm/{chunk-KIR6XUJX.js → chunk-P4LC45HN.js} +13 -7
  44. package/dist/esm/chunk-P4LC45HN.js.map +7 -0
  45. package/dist/esm/chunk-RHUIR5LX.js +28 -0
  46. package/dist/esm/chunk-RHUIR5LX.js.map +7 -0
  47. package/dist/esm/chunk-XPP2LEPF.js +232 -0
  48. package/dist/esm/chunk-XPP2LEPF.js.map +7 -0
  49. package/dist/esm/components/index.d.ts +2 -0
  50. package/dist/esm/components/index.d.ts.map +1 -0
  51. package/dist/esm/components/index.js +11 -0
  52. package/dist/esm/components/index.js.map +7 -0
  53. package/dist/esm/components/sign-in.d.ts +22 -0
  54. package/dist/esm/components/sign-in.d.ts.map +1 -0
  55. package/dist/esm/errors/index.d.ts +9 -0
  56. package/dist/esm/errors/index.d.ts.map +1 -0
  57. package/dist/esm/hooks/index.d.ts +2 -0
  58. package/dist/esm/hooks/index.d.ts.map +1 -0
  59. package/dist/esm/hooks/useAuth.d.ts +2 -0
  60. package/dist/esm/hooks/useAuth.d.ts.map +1 -0
  61. package/dist/esm/index.d.ts +5 -81
  62. package/dist/esm/index.d.ts.map +1 -0
  63. package/dist/esm/index.js +40 -306
  64. package/dist/esm/index.js.map +7 -1
  65. package/dist/esm/ternSecureClientProvider-FZVUEXLU.js +8 -0
  66. package/dist/esm/ternSecureClientProvider-FZVUEXLU.js.map +7 -0
  67. package/dist/esm/types/index.d.ts +41 -0
  68. package/dist/esm/types/index.d.ts.map +1 -0
  69. package/dist/esm/utils/create-styles.d.ts +99 -0
  70. package/dist/esm/utils/create-styles.d.ts.map +1 -0
  71. package/package.json +15 -8
  72. package/dist/cjs/index.cjs +0 -434
  73. package/dist/cjs/index.cjs.map +0 -1
  74. package/dist/cjs/index.d.cts +0 -81
  75. package/dist/cjs/index.d.ts +0 -81
  76. package/dist/esm/chunk-IPJTMTN4.cjs +0 -44
  77. package/dist/esm/chunk-IPJTMTN4.cjs.map +0 -1
  78. package/dist/esm/chunk-KIR6XUJX.js.map +0 -1
  79. package/dist/esm/index.cjs.map +0 -1
  80. package/dist/esm/index.d.cts +0 -81
  81. package/dist/esm/ternSecureClientProvider-FOKWIA4L.cjs +0 -12
  82. package/dist/esm/ternSecureClientProvider-FOKWIA4L.cjs.map +0 -1
  83. package/dist/esm/ternSecureClientProvider-WBLGPYYR.js +0 -3
  84. package/dist/esm/ternSecureClientProvider-WBLGPYYR.js.map +0 -1
@@ -0,0 +1,7 @@
1
+ import React, { ReactNode } from 'react';
2
+ interface TernSecureProviderProps {
3
+ children: ReactNode;
4
+ }
5
+ export declare function TernSecureProvider({ children }: TernSecureProviderProps): import("react/jsx-runtime").JSX.Element | (string | number | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode>)[] | null | undefined;
6
+ export {};
7
+ //# sourceMappingURL=TernSecureServerProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TernSecureServerProvider.d.ts","sourceRoot":"","sources":["../../../../../src/app-router/server/providers/TernSecureServerProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGzC,UAAU,uBAAuB;IAC/B,QAAQ,EAAE,SAAS,CAAC;CACrB;AAWD,wBAAgB,kBAAkB,CAAC,EAAE,QAAQ,EAAE,EAAE,uBAAuB,qLA+BvE"}
@@ -0,0 +1,24 @@
1
+ // src/app-router/client/config.ts
2
+ var loadFireConfig = () => ({
3
+ apiKey: process.env.NEXT_PUBLIC_FIREBASE_API_KEY,
4
+ authDomain: process.env.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN,
5
+ projectId: process.env.NEXT_PUBLIC_FIREBASE_PROJECT_ID,
6
+ storageBucket: process.env.NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET,
7
+ messagingSenderId: process.env.NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID,
8
+ appId: process.env.NEXT_PUBLIC_FIREBASE_APP_ID,
9
+ measurementId: process.env.NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID
10
+ });
11
+ var validateConfig = (config) => {
12
+ Object.entries(config).forEach(([key, value]) => {
13
+ if (!value) {
14
+ throw new Error(`Missing environment variable: NEXT_PUBLIC_FIREBASE_${key.toUpperCase()}`);
15
+ }
16
+ });
17
+ return config;
18
+ };
19
+
20
+ export {
21
+ loadFireConfig,
22
+ validateConfig
23
+ };
24
+ //# sourceMappingURL=chunk-5DISHXED.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/app-router/client/config.ts"],
4
+ "sourcesContent": ["import { TernSecureConfig } from \"../../types\";\r\n\r\nexport const loadFireConfig = (): TernSecureConfig => ({\r\n apiKey: process.env.NEXT_PUBLIC_FIREBASE_API_KEY as string,\r\n authDomain: process.env.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN as string,\r\n projectId: process.env.NEXT_PUBLIC_FIREBASE_PROJECT_ID as string,\r\n storageBucket: process.env.NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET as string,\r\n messagingSenderId: process.env.NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID as string,\r\n appId: process.env.NEXT_PUBLIC_FIREBASE_APP_ID as string,\r\n measurementId: process.env.NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID as string,\r\n});\r\n\r\nexport const validateConfig = (config: TernSecureConfig): TernSecureConfig => {\r\n Object.entries(config).forEach(([key, value]) => {\r\n if (!value) {\r\n throw new Error(`Missing environment variable: NEXT_PUBLIC_FIREBASE_${key.toUpperCase()}`);\r\n }\r\n });\r\n return config;\r\n};"],
5
+ "mappings": ";AAEO,IAAM,iBAAiB,OAAyB;AAAA,EACrD,QAAQ,QAAQ,IAAI;AAAA,EACpB,YAAY,QAAQ,IAAI;AAAA,EACxB,WAAW,QAAQ,IAAI;AAAA,EACvB,eAAe,QAAQ,IAAI;AAAA,EAC3B,mBAAmB,QAAQ,IAAI;AAAA,EAC/B,OAAO,QAAQ,IAAI;AAAA,EACnB,eAAe,QAAQ,IAAI;AAC7B;AAEO,IAAM,iBAAiB,CAAC,WAA+C;AAC5E,SAAO,QAAQ,MAAM,EAAE,QAAQ,CAAC,CAAC,KAAK,KAAK,MAAM;AAC/C,QAAI,CAAC,OAAO;AACV,YAAM,IAAI,MAAM,sDAAsD,IAAI,YAAY,CAAC,EAAE;AAAA,IAC3F;AAAA,EACF,CAAC;AACD,SAAO;AACT;",
6
+ "names": []
7
+ }
@@ -0,0 +1,44 @@
1
+ // src/app-router/server/providers/TernSecureServerProvider.tsx
2
+ import React from "react";
3
+ import dynamic from "next/dynamic";
4
+ import { jsx } from "react/jsx-runtime";
5
+ var TernSecureClientProvider = dynamic(
6
+ () => import("./ternSecureClientProvider-FZVUEXLU.js").then((mod) => mod.TernSecureClientProvider),
7
+ {
8
+ ssr: false
9
+ //loading: () => null // Return null or a loading indicator
10
+ }
11
+ );
12
+ function TernSecureProvider({ children }) {
13
+ const isRootLayout = React.Children.toArray(children).some(
14
+ (child) => React.isValidElement(child) && child.type === "html"
15
+ );
16
+ if (isRootLayout) {
17
+ return React.Children.map(children, (child) => {
18
+ if (React.isValidElement(child) && child.type === "html") {
19
+ return React.cloneElement(
20
+ child,
21
+ {},
22
+ React.Children.map(child.props.children, (bodyChild) => {
23
+ if (React.isValidElement(bodyChild) && bodyChild.type === "body") {
24
+ const bodyProps = bodyChild.props;
25
+ return React.cloneElement(
26
+ bodyChild,
27
+ {},
28
+ /* @__PURE__ */ jsx(TernSecureClientProvider, { children: bodyProps.children })
29
+ );
30
+ }
31
+ return bodyChild;
32
+ })
33
+ );
34
+ }
35
+ return child;
36
+ });
37
+ }
38
+ return /* @__PURE__ */ jsx(TernSecureClientProvider, { children });
39
+ }
40
+
41
+ export {
42
+ TernSecureProvider
43
+ };
44
+ //# sourceMappingURL=chunk-7RZ4XLTY.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/app-router/server/providers/TernSecureServerProvider.tsx"],
4
+ "sourcesContent": ["import React, { ReactNode } from 'react';\r\nimport dynamic from 'next/dynamic'\r\n\r\ninterface TernSecureProviderProps {\r\n children: ReactNode;\r\n}\r\n\r\n// Dynamically import the client provider with no SSR\r\nconst TernSecureClientProvider = dynamic(\r\n () => import('../../client/providers/ternSecureClientProvider').then(mod => mod.TernSecureClientProvider),\r\n { \r\n ssr: false\r\n //loading: () => null // Return null or a loading indicator\r\n }\r\n)\r\n\r\nexport function TernSecureProvider({ children }: TernSecureProviderProps) {\r\n // Check if the children contain html/body tags\r\n const isRootLayout = React.Children.toArray(children).some(\r\n child => React.isValidElement(child) && child.type === 'html'\r\n );\r\n\r\n if (isRootLayout) {\r\n // If this is the root layout, inject our provider after the body tag\r\n return React.Children.map(children, child => {\r\n if (React.isValidElement(child) && child.type === 'html') {\r\n return React.cloneElement(child, {}, \r\n React.Children.map(child.props.children, bodyChild => {\r\n if (React.isValidElement(bodyChild) && bodyChild.type === 'body') {\r\n // Type assertion to access props safely\r\n const bodyProps = bodyChild.props as { children: ReactNode };\r\n return React.cloneElement(bodyChild, {}, \r\n <TernSecureClientProvider>\r\n {bodyProps.children}\r\n </TernSecureClientProvider>\r\n );\r\n }\r\n return bodyChild;\r\n })\r\n );\r\n }\r\n return child;\r\n });\r\n }\r\n\r\n // For non-root layouts, wrap normally\r\n return <TernSecureClientProvider>{children}</TernSecureClientProvider>;\r\n}"],
5
+ "mappings": ";AAAA,OAAO,WAA0B;AACjC,OAAO,aAAa;AA+BJ;AAxBhB,IAAM,2BAA2B;AAAA,EAC/B,MAAM,OAAO,wCAAiD,EAAE,KAAK,SAAO,IAAI,wBAAwB;AAAA,EACxG;AAAA,IACE,KAAK;AAAA;AAAA,EAEP;AACF;AAEO,SAAS,mBAAmB,EAAE,SAAS,GAA4B;AAExE,QAAM,eAAe,MAAM,SAAS,QAAQ,QAAQ,EAAE;AAAA,IACpD,WAAS,MAAM,eAAe,KAAK,KAAK,MAAM,SAAS;AAAA,EACzD;AAEA,MAAI,cAAc;AAEhB,WAAO,MAAM,SAAS,IAAI,UAAU,WAAS;AAC3C,UAAI,MAAM,eAAe,KAAK,KAAK,MAAM,SAAS,QAAQ;AACxD,eAAO,MAAM;AAAA,UAAa;AAAA,UAAO,CAAC;AAAA,UAChC,MAAM,SAAS,IAAI,MAAM,MAAM,UAAU,eAAa;AACpD,gBAAI,MAAM,eAAe,SAAS,KAAK,UAAU,SAAS,QAAQ;AAEhE,oBAAM,YAAY,UAAU;AAC5B,qBAAO,MAAM;AAAA,gBAAa;AAAA,gBAAW,CAAC;AAAA,gBACpC,oBAAC,4BACE,oBAAU,UACb;AAAA,cACF;AAAA,YACF;AACA,mBAAO;AAAA,UACT,CAAC;AAAA,QACH;AAAA,MACF;AACA,aAAO;AAAA,IACT,CAAC;AAAA,EACH;AAGA,SAAO,oBAAC,4BAA0B,UAAS;AAC7C;",
6
+ "names": []
7
+ }
@@ -0,0 +1,18 @@
1
+ import {
2
+ TernSecureAuth
3
+ } from "./chunk-RHUIR5LX.js";
4
+
5
+ // src/app-router/client/auth.ts
6
+ import { signInWithEmailAndPassword } from "firebase/auth";
7
+ async function signInWithEmail({
8
+ email,
9
+ password
10
+ }) {
11
+ const auth = TernSecureAuth();
12
+ return signInWithEmailAndPassword(auth, email, password);
13
+ }
14
+
15
+ export {
16
+ signInWithEmail
17
+ };
18
+ //# sourceMappingURL=chunk-CGWE73OH.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/app-router/client/auth.ts"],
4
+ "sourcesContent": ["import { TernSecureAuth } from './index'\r\nimport { signInWithEmailAndPassword, type UserCredential } from 'firebase/auth'\r\n\r\nexport interface SignInCredentials {\r\n email: string\r\n password: string\r\n}\r\n\r\nexport async function signInWithEmail({ \r\n email, \r\n password \r\n}: SignInCredentials): Promise<UserCredential> {\r\n const auth = TernSecureAuth()\r\n return signInWithEmailAndPassword(auth, email, password)\r\n} "],
5
+ "mappings": ";;;;;AACA,SAAS,kCAAuD;AAOhE,eAAsB,gBAAgB;AAAA,EACpC;AAAA,EACA;AACF,GAA+C;AAC7C,QAAM,OAAO,eAAe;AAC5B,SAAO,2BAA2B,MAAM,OAAO,QAAQ;AACzD;",
6
+ "names": []
7
+ }
@@ -1,8 +1,8 @@
1
- import React, { useState } from 'react';
2
- import { jsx } from 'react/jsx-runtime';
3
-
4
- /* eslint-disable */
1
+ // src/app-router/client/providers/ternSecureClientProvider.tsx
2
+ import { useState } from "react";
5
3
 
4
+ // src/app-router/client/providers/ternSecureContext.tsx
5
+ import React from "react";
6
6
  var initialState = {
7
7
  firebase: {
8
8
  initialized: false,
@@ -26,11 +26,17 @@ var useTernSecure = (hookname) => {
26
26
  }
27
27
  return context;
28
28
  };
29
+
30
+ // src/app-router/client/providers/ternSecureClientProvider.tsx
31
+ import { jsx } from "react/jsx-runtime";
29
32
  function TernSecureClientProvider({ children }) {
30
33
  const stateAndUpdater = useState(initialState);
31
34
  return /* @__PURE__ */ jsx(TernSecureContext.Provider, { value: stateAndUpdater, children });
32
35
  }
33
36
 
34
- export { TernSecureClientProvider, TernSecureContext, useTernSecure };
35
- //# sourceMappingURL=chunk-KIR6XUJX.js.map
36
- //# sourceMappingURL=chunk-KIR6XUJX.js.map
37
+ export {
38
+ TernSecureContext,
39
+ useTernSecure,
40
+ TernSecureClientProvider
41
+ };
42
+ //# sourceMappingURL=chunk-P4LC45HN.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/app-router/client/providers/ternSecureClientProvider.tsx", "../../src/app-router/client/providers/ternSecureContext.tsx"],
4
+ "sourcesContent": ["'use client'\r\n\r\nimport React, { useState } from 'react'\r\nimport { TernSecureContext, initialState } from './ternSecureContext'\r\n\r\nexport function TernSecureClientProvider({ children }: { children: React.ReactNode }) {\r\n const stateAndUpdater = useState(initialState)\r\n\r\n return (\r\n <TernSecureContext.Provider value={stateAndUpdater}>\r\n {children}\r\n </TernSecureContext.Provider>\r\n )\r\n}", "'use client'\r\n\r\nimport React from 'react'\r\nimport { TernSecureState } from '../../../types'\r\n\r\nconst initialState: TernSecureState = {\r\n firebase: {\r\n initialized: false,\r\n error: null\r\n },\r\n auth: {\r\n user: null,\r\n loading: true,\r\n error: null,\r\n isSignedIn: false\r\n }\r\n}\r\n\r\nconst TernSecureContext = React.createContext<[TernSecureState, React.Dispatch<React.SetStateAction<TernSecureState>>]>([initialState, () => {}])\r\n\r\nconst useTernSecure = (hookname?: string) => {\r\n const context = React.useContext(TernSecureContext)\r\n if (!context) {\r\n throw new Error(\r\n `${hookname} must be used within TernSecureProvider`)\r\n }\r\n return context\r\n}\r\n\r\nexport {\r\n TernSecureContext,\r\n useTernSecure,\r\n initialState\r\n}"],
5
+ "mappings": ";AAEA,SAAgB,gBAAgB;;;ACAhC,OAAO,WAAW;AAGlB,IAAM,eAAgC;AAAA,EACpC,UAAU;AAAA,IACR,aAAa;AAAA,IACb,OAAO;AAAA,EACT;AAAA,EACA,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,SAAS;AAAA,IACT,OAAO;AAAA,IACP,YAAY;AAAA,EACd;AACF;AAEA,IAAM,oBAAoB,MAAM,cAAwF,CAAC,cAAc,MAAM;AAAC,CAAC,CAAC;AAEhJ,IAAM,gBAAgB,CAAC,aAAsB;AAC3C,QAAM,UAAU,MAAM,WAAW,iBAAiB;AAClD,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI;AAAA,MACR,GAAG,QAAQ;AAAA,IAAyC;AAAA,EACxD;AACA,SAAO;AACT;;;ADlBI;AAJG,SAAS,yBAAyB,EAAE,SAAS,GAAkC;AACpF,QAAM,kBAAkB,SAAS,YAAY;AAE7C,SACE,oBAAC,kBAAkB,UAAlB,EAA2B,OAAO,iBAChC,UACH;AAEJ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,28 @@
1
+ import {
2
+ loadFireConfig,
3
+ validateConfig
4
+ } from "./chunk-5DISHXED.js";
5
+
6
+ // src/app-router/client/client-init.ts
7
+ import { getApps, initializeApp } from "firebase/app";
8
+ import { getAuth, setPersistence, browserSessionPersistence } from "firebase/auth";
9
+ import { getFirestore } from "firebase/firestore";
10
+ import { getStorage } from "firebase/storage";
11
+ var app = (() => {
12
+ const config = validateConfig(loadFireConfig());
13
+ return getApps().length ? getApps()[0] : initializeApp(config);
14
+ })();
15
+ var auth = getAuth(app);
16
+ setPersistence(auth, browserSessionPersistence);
17
+ var firestore = getFirestore(app);
18
+ var storage = getStorage(app);
19
+ var TernSecureAuth = () => auth;
20
+ var TernSecureFirestore = () => firestore;
21
+ var TernSecureStorage = () => storage;
22
+
23
+ export {
24
+ TernSecureAuth,
25
+ TernSecureFirestore,
26
+ TernSecureStorage
27
+ };
28
+ //# sourceMappingURL=chunk-RHUIR5LX.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/app-router/client/client-init.ts"],
4
+ "sourcesContent": ["import { getApps, initializeApp } from 'firebase/app';\r\nimport { getAuth, setPersistence, browserSessionPersistence } from 'firebase/auth';\r\nimport { getFirestore } from 'firebase/firestore';\r\nimport { getStorage } from 'firebase/storage';\r\nimport { loadFireConfig, validateConfig } from './config';\r\n\r\n// Initialize immediately\r\nconst app = (() => {\r\n const config = validateConfig(loadFireConfig());\r\n return getApps().length ? getApps()[0] : initializeApp(config);\r\n})();\r\n\r\nconst auth = getAuth(app);\r\nsetPersistence(auth, browserSessionPersistence); //to change later user should be able to choose persistance\r\nconst firestore = getFirestore(app);\r\nconst storage = getStorage(app);\r\n\r\nexport const TernSecureAuth = () => auth;\r\nexport const TernSecureFirestore = () => firestore;\r\nexport const TernSecureStorage = () => storage;"],
5
+ "mappings": ";;;;;;AAAA,SAAS,SAAS,qBAAqB;AACvC,SAAS,SAAS,gBAAgB,iCAAiC;AACnE,SAAS,oBAAoB;AAC7B,SAAS,kBAAkB;AAI3B,IAAM,OAAO,MAAM;AACjB,QAAM,SAAS,eAAe,eAAe,CAAC;AAC9C,SAAO,QAAQ,EAAE,SAAS,QAAQ,EAAE,CAAC,IAAI,cAAc,MAAM;AAC/D,GAAG;AAEH,IAAM,OAAO,QAAQ,GAAG;AACxB,eAAe,MAAM,yBAAyB;AAC9C,IAAM,YAAY,aAAa,GAAG;AAClC,IAAM,UAAU,WAAW,GAAG;AAEvB,IAAM,iBAAiB,MAAM;AAC7B,IAAM,sBAAsB,MAAM;AAClC,IAAM,oBAAoB,MAAM;",
6
+ "names": []
7
+ }
@@ -0,0 +1,232 @@
1
+ import {
2
+ signInWithEmail
3
+ } from "./chunk-CGWE73OH.js";
4
+
5
+ // src/components/sign-in.tsx
6
+ import { useState } from "react";
7
+
8
+ // src/utils/create-styles.ts
9
+ var PREFIX = "tern";
10
+ var styleInjection = {
11
+ isInjected: false,
12
+ styleElement: null
13
+ };
14
+ var defaultClassNames = {
15
+ container: `${PREFIX}-container`,
16
+ header: `${PREFIX}-header`,
17
+ title: `${PREFIX}-title`,
18
+ formWrapper: `${PREFIX}-formWrapper`,
19
+ formContainer: `${PREFIX}-formContainer`,
20
+ form: `${PREFIX}-form`,
21
+ label: `${PREFIX}-label`,
22
+ input: `${PREFIX}-input`,
23
+ button: `${PREFIX}-button`,
24
+ error: `${PREFIX}-error`
25
+ };
26
+ function createStyleSheet(styles2) {
27
+ if (typeof window === "undefined") return defaultClassNames;
28
+ if (styleInjection.isInjected) {
29
+ return defaultClassNames;
30
+ }
31
+ let styleElement = document.querySelector("[data-tern-secure]");
32
+ if (!styleElement) {
33
+ styleElement = document.createElement("style");
34
+ styleElement.setAttribute("data-tern-secure", "");
35
+ document.head.appendChild(styleElement);
36
+ styleInjection.styleElement = styleElement;
37
+ }
38
+ const cssRules = Object.entries(styles2).map(([key, rules]) => {
39
+ const className = defaultClassNames[key];
40
+ const cssProperties = Object.entries(rules).map(([prop, value]) => {
41
+ const cssProperty = prop.replace(/([A-Z])/g, "-$1").toLowerCase();
42
+ return `${cssProperty}: ${value};`;
43
+ }).join(" ");
44
+ return `.${className} { ${cssProperties} }`;
45
+ }).join("\n");
46
+ styleElement.textContent = cssRules;
47
+ styleInjection.isInjected = true;
48
+ return defaultClassNames;
49
+ }
50
+ var styleConfig = {
51
+ container: {
52
+ display: "flex",
53
+ minHeight: "100%",
54
+ flex: "1",
55
+ flexDirection: "column",
56
+ justifyContent: "center",
57
+ padding: "3rem 1.5rem"
58
+ },
59
+ header: {
60
+ margin: "0 auto",
61
+ width: "100%",
62
+ maxWidth: "28rem"
63
+ },
64
+ title: {
65
+ marginTop: "1.5rem",
66
+ textAlign: "center",
67
+ fontSize: "1.875rem",
68
+ fontWeight: "700",
69
+ lineHeight: "2.25rem",
70
+ letterSpacing: "-0.025em",
71
+ color: "var(--tern-text-primary, #111827)"
72
+ },
73
+ formWrapper: {
74
+ marginTop: "2.5rem",
75
+ margin: "0 auto",
76
+ width: "100%",
77
+ maxWidth: "30rem"
78
+ },
79
+ formContainer: {
80
+ padding: "3rem 1.5rem",
81
+ boxShadow: "0 1px 3px 0 rgb(0 0 0 / 0.1)",
82
+ borderRadius: "0.5rem",
83
+ backgroundColor: "var(--tern-background, white)"
84
+ },
85
+ form: {
86
+ display: "flex",
87
+ flexDirection: "column",
88
+ gap: "1rem"
89
+ },
90
+ label: {
91
+ display: "block",
92
+ fontSize: "0.875rem",
93
+ fontWeight: "500",
94
+ color: "var(--tern-text-secondary, #374151)"
95
+ },
96
+ input: {
97
+ marginTop: "0.25rem",
98
+ display: "block",
99
+ width: "100%",
100
+ padding: "0.5rem 0.75rem",
101
+ borderRadius: "0.375rem",
102
+ border: "1px solid var(--tern-border, #D1D5DB)",
103
+ backgroundColor: "var(--tern-input-background, white)",
104
+ color: "var(--tern-text-primary, #111827)"
105
+ },
106
+ button: {
107
+ display: "flex",
108
+ width: "100%",
109
+ justifyContent: "center",
110
+ padding: "0.5rem 1rem",
111
+ fontSize: "0.875rem",
112
+ fontWeight: "500",
113
+ color: "white",
114
+ backgroundColor: "var(--tern-primary, #2563EB)",
115
+ border: "none",
116
+ borderRadius: "0.375rem",
117
+ cursor: "pointer"
118
+ },
119
+ error: {
120
+ color: "var(--tern-error, #DC2626)",
121
+ fontSize: "0.875rem"
122
+ }
123
+ };
124
+ var styles = createStyleSheet(styleConfig);
125
+
126
+ // src/components/sign-in.tsx
127
+ import { jsx, jsxs } from "react/jsx-runtime";
128
+ function SignIn({
129
+ onSuccess,
130
+ onError,
131
+ redirectUrl,
132
+ className = "",
133
+ style,
134
+ customStyles = {}
135
+ }) {
136
+ const [email, setEmail] = useState("");
137
+ const [password, setPassword] = useState("");
138
+ const [loading, setLoading] = useState(false);
139
+ const [error, setError] = useState("");
140
+ const handleSubmit = async (e) => {
141
+ e.preventDefault();
142
+ setLoading(true);
143
+ setError("");
144
+ try {
145
+ await signInWithEmail({ email, password });
146
+ onSuccess?.();
147
+ if (redirectUrl) {
148
+ window.location.href = redirectUrl;
149
+ }
150
+ } catch (err) {
151
+ const errorMessage = err instanceof Error ? err.message : "Failed to sign in";
152
+ setError(errorMessage);
153
+ onError?.(err instanceof Error ? err : new Error("Failed to sign in"));
154
+ } finally {
155
+ setLoading(false);
156
+ }
157
+ };
158
+ return /* @__PURE__ */ jsxs("div", { className: `${styles.container} ${customStyles.container || ""}`, style, children: [
159
+ /* @__PURE__ */ jsx("div", { className: `${styles.header} ${customStyles.header || ""}`, children: /* @__PURE__ */ jsx("h2", { className: `${styles.title} ${customStyles.title || ""}`, children: "Sign in to your account" }) }),
160
+ /* @__PURE__ */ jsx("div", { className: `${styles.formWrapper} ${customStyles.formWrapper || ""}`, children: /* @__PURE__ */ jsx("div", { className: `${styles.formContainer} ${customStyles.formContainer || ""}`, children: /* @__PURE__ */ jsxs(
161
+ "form",
162
+ {
163
+ onSubmit: handleSubmit,
164
+ className: `${styles.form} ${customStyles.form || ""} ${className}`,
165
+ role: "form",
166
+ "aria-label": "Sign in form",
167
+ children: [
168
+ error && /* @__PURE__ */ jsx(
169
+ "div",
170
+ {
171
+ className: `${styles.error} ${customStyles.errorText || ""}`,
172
+ role: "alert",
173
+ "aria-live": "polite",
174
+ children: error
175
+ }
176
+ ),
177
+ /* @__PURE__ */ jsxs("div", { children: [
178
+ /* @__PURE__ */ jsx("label", { htmlFor: "email", className: `${styles.label} ${customStyles.label || ""}`, children: "Email" }),
179
+ /* @__PURE__ */ jsx(
180
+ "input",
181
+ {
182
+ id: "email",
183
+ type: "email",
184
+ value: email,
185
+ onChange: (e) => setEmail(e.target.value),
186
+ placeholder: "Enter your email",
187
+ required: true,
188
+ className: `${styles.input} ${customStyles.input || ""}`,
189
+ disabled: loading,
190
+ "aria-required": "true",
191
+ "aria-invalid": !!error
192
+ }
193
+ )
194
+ ] }),
195
+ /* @__PURE__ */ jsxs("div", { children: [
196
+ /* @__PURE__ */ jsx("label", { htmlFor: "password", className: `${styles.label} ${customStyles.label || ""}`, children: "Password" }),
197
+ /* @__PURE__ */ jsx(
198
+ "input",
199
+ {
200
+ id: "password",
201
+ type: "password",
202
+ value: password,
203
+ onChange: (e) => setPassword(e.target.value),
204
+ placeholder: "Enter your password",
205
+ required: true,
206
+ className: `${styles.input} ${customStyles.input || ""}`,
207
+ disabled: loading,
208
+ "aria-required": "true",
209
+ "aria-invalid": !!error
210
+ }
211
+ )
212
+ ] }),
213
+ /* @__PURE__ */ jsx(
214
+ "button",
215
+ {
216
+ type: "submit",
217
+ disabled: loading,
218
+ className: `${styles.button} ${customStyles.button || ""}`,
219
+ "data-testid": "sign-in-submit",
220
+ children: loading ? "Signing in..." : "Sign in"
221
+ }
222
+ )
223
+ ]
224
+ }
225
+ ) }) })
226
+ ] });
227
+ }
228
+
229
+ export {
230
+ SignIn
231
+ };
232
+ //# sourceMappingURL=chunk-XPP2LEPF.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/components/sign-in.tsx", "../../src/utils/create-styles.ts"],
4
+ "sourcesContent": ["import * as React from 'react'\r\nimport { useState } from 'react'\r\nimport { signInWithEmail } from '../app-router/client'\r\nimport { styles } from '../utils/create-styles'\r\n\r\nexport interface SignInProps {\r\n onSuccess?: () => void\r\n onError?: (error: Error) => void\r\n redirectUrl?: string\r\n className?: string\r\n style?: React.CSSProperties\r\n customStyles?: {\r\n container?: string\r\n header?: string\r\n title?: string\r\n formWrapper?: string\r\n formContainer?: string\r\n form?: string\r\n input?: string\r\n button?: string\r\n errorText?: string\r\n label?: string\r\n }\r\n}\r\n\r\nexport function SignIn({ \r\n onSuccess, \r\n onError, \r\n redirectUrl,\r\n className = '',\r\n style,\r\n customStyles = {}\r\n}: SignInProps) {\r\n const [email, setEmail] = useState('')\r\n const [password, setPassword] = useState('')\r\n const [loading, setLoading] = useState(false)\r\n const [error, setError] = useState('')\r\n\r\n const handleSubmit = async (e: React.FormEvent) => {\r\n e.preventDefault()\r\n setLoading(true)\r\n setError('')\r\n\r\n try {\r\n await signInWithEmail({ email, password })\r\n onSuccess?.()\r\n \r\n if (redirectUrl) {\r\n window.location.href = redirectUrl\r\n }\r\n } catch (err) {\r\n const errorMessage = err instanceof Error ? err.message : 'Failed to sign in'\r\n setError(errorMessage)\r\n onError?.(err instanceof Error ? err : new Error('Failed to sign in'))\r\n } finally {\r\n setLoading(false)\r\n }\r\n }\r\n\r\n return (\r\n <div className={`${styles.container} ${customStyles.container || ''}`} style={style}>\r\n <div className={`${styles.header} ${customStyles.header || ''}`}>\r\n <h2 className={`${styles.title} ${customStyles.title || ''}`}>\r\n Sign in to your account\r\n </h2>\r\n </div>\r\n \r\n <div className={`${styles.formWrapper} ${customStyles.formWrapper || ''}`}>\r\n <div className={`${styles.formContainer} ${customStyles.formContainer || ''}`}>\r\n <form \r\n onSubmit={handleSubmit} \r\n className={`${styles.form} ${customStyles.form || ''} ${className}`}\r\n role=\"form\"\r\n aria-label=\"Sign in form\"\r\n >\r\n {error && (\r\n <div \r\n className={`${styles.error} ${customStyles.errorText || ''}`}\r\n role=\"alert\"\r\n aria-live=\"polite\"\r\n >\r\n {error}\r\n </div>\r\n )}\r\n <div>\r\n <label htmlFor=\"email\" className={`${styles.label} ${customStyles.label || ''}`}>\r\n Email\r\n </label>\r\n <input\r\n id=\"email\"\r\n type=\"email\"\r\n value={email}\r\n onChange={(e) => setEmail(e.target.value)}\r\n placeholder=\"Enter your email\"\r\n required\r\n className={`${styles.input} ${customStyles.input || ''}`}\r\n disabled={loading}\r\n aria-required=\"true\"\r\n aria-invalid={!!error}\r\n />\r\n </div>\r\n <div>\r\n <label htmlFor=\"password\" className={`${styles.label} ${customStyles.label || ''}`}>\r\n Password\r\n </label>\r\n <input\r\n id=\"password\"\r\n type=\"password\"\r\n value={password}\r\n onChange={(e) => setPassword(e.target.value)}\r\n placeholder=\"Enter your password\"\r\n required\r\n className={`${styles.input} ${customStyles.input || ''}`}\r\n disabled={loading}\r\n aria-required=\"true\"\r\n aria-invalid={!!error}\r\n />\r\n </div>\r\n <button \r\n type=\"submit\" \r\n disabled={loading}\r\n className={`${styles.button} ${customStyles.button || ''}`}\r\n data-testid=\"sign-in-submit\"\r\n >\r\n {loading ? 'Signing in...' : 'Sign in'}\r\n </button>\r\n </form>\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\n", "'use client'\r\n\r\nconst PREFIX = 'tern'\r\n\r\n// Singleton to track style injection\r\nconst styleInjection = {\r\n isInjected: false,\r\n styleElement: null as HTMLStyleElement | null\r\n}\r\n\r\nexport const defaultClassNames = {\r\n container: `${PREFIX}-container`,\r\n header: `${PREFIX}-header`,\r\n title: `${PREFIX}-title`,\r\n formWrapper: `${PREFIX}-formWrapper`,\r\n formContainer: `${PREFIX}-formContainer`,\r\n form: `${PREFIX}-form`,\r\n label: `${PREFIX}-label`,\r\n input: `${PREFIX}-input`,\r\n button: `${PREFIX}-button`,\r\n error: `${PREFIX}-error`\r\n} as const\r\n\r\n// Create styles once and cache them\r\nfunction createStyleSheet(styles: Record<string, React.CSSProperties>) {\r\n if (typeof window === 'undefined') return defaultClassNames\r\n\r\n // Return early if styles are already injected\r\n if (styleInjection.isInjected) {\r\n return defaultClassNames\r\n }\r\n\r\n // Find existing style element or create new one\r\n let styleElement = document.querySelector<HTMLStyleElement>('[data-tern-secure]')\r\n \r\n if (!styleElement) {\r\n styleElement = document.createElement('style')\r\n styleElement.setAttribute('data-tern-secure', '')\r\n document.head.appendChild(styleElement)\r\n styleInjection.styleElement = styleElement\r\n }\r\n\r\n // Create CSS rules\r\n const cssRules = Object.entries(styles).map(([key, rules]) => {\r\n const className = defaultClassNames[key as keyof typeof defaultClassNames]\r\n const cssProperties = Object.entries(rules).map(([prop, value]) => {\r\n const cssProperty = prop.replace(/([A-Z])/g, '-$1').toLowerCase()\r\n return `${cssProperty}: ${value};`\r\n }).join(' ')\r\n\r\n return `.${className} { ${cssProperties} }`\r\n }).join('\\n')\r\n\r\n // Insert styles only once\r\n styleElement.textContent = cssRules\r\n styleInjection.isInjected = true\r\n\r\n return defaultClassNames\r\n}\r\n\r\n// Style configuration\r\nexport const styleConfig = {\r\n container: {\r\n display: 'flex',\r\n minHeight: '100%',\r\n flex: '1',\r\n flexDirection: 'column',\r\n justifyContent: 'center',\r\n padding: '3rem 1.5rem'\r\n },\r\n header: {\r\n margin: '0 auto',\r\n width: '100%',\r\n maxWidth: '28rem'\r\n },\r\n title: {\r\n marginTop: '1.5rem',\r\n textAlign: 'center',\r\n fontSize: '1.875rem',\r\n fontWeight: '700',\r\n lineHeight: '2.25rem',\r\n letterSpacing: '-0.025em',\r\n color: 'var(--tern-text-primary, #111827)'\r\n },\r\n formWrapper: {\r\n marginTop: '2.5rem',\r\n margin: '0 auto',\r\n width: '100%',\r\n maxWidth: '30rem'\r\n },\r\n formContainer: {\r\n padding: '3rem 1.5rem',\r\n boxShadow: '0 1px 3px 0 rgb(0 0 0 / 0.1)',\r\n borderRadius: '0.5rem',\r\n backgroundColor: 'var(--tern-background, white)'\r\n },\r\n form: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n gap: '1rem'\r\n },\r\n label: {\r\n display: 'block',\r\n fontSize: '0.875rem',\r\n fontWeight: '500',\r\n color: 'var(--tern-text-secondary, #374151)'\r\n },\r\n input: {\r\n marginTop: '0.25rem',\r\n display: 'block',\r\n width: '100%',\r\n padding: '0.5rem 0.75rem',\r\n borderRadius: '0.375rem',\r\n border: '1px solid var(--tern-border, #D1D5DB)',\r\n backgroundColor: 'var(--tern-input-background, white)',\r\n color: 'var(--tern-text-primary, #111827)'\r\n },\r\n button: {\r\n display: 'flex',\r\n width: '100%',\r\n justifyContent: 'center',\r\n padding: '0.5rem 1rem',\r\n fontSize: '0.875rem',\r\n fontWeight: '500',\r\n color: 'white',\r\n backgroundColor: 'var(--tern-primary, #2563EB)',\r\n border: 'none',\r\n borderRadius: '0.375rem',\r\n cursor: 'pointer'\r\n },\r\n error: {\r\n color: 'var(--tern-error, #DC2626)',\r\n fontSize: '0.875rem'\r\n }\r\n} as const\r\n\r\n// Export pre-created styles\r\nexport const styles = createStyleSheet(styleConfig)\r\n\r\n"],
5
+ "mappings": ";;;;;AACA,SAAS,gBAAgB;;;ACCzB,IAAM,SAAS;AAGf,IAAM,iBAAiB;AAAA,EACrB,YAAY;AAAA,EACZ,cAAc;AAChB;AAEO,IAAM,oBAAoB;AAAA,EAC/B,WAAW,GAAG,MAAM;AAAA,EACpB,QAAQ,GAAG,MAAM;AAAA,EACjB,OAAO,G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0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC"}
@@ -0,0 +1,11 @@
1
+ import {
2
+ SignIn
3
+ } from "../chunk-XPP2LEPF.js";
4
+ import "../chunk-CGWE73OH.js";
5
+ import "../chunk-RHUIR5LX.js";
6
+ import "../chunk-5DISHXED.js";
7
+ import "../chunk-P4LC45HN.js";
8
+ export {
9
+ SignIn
10
+ };
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,22 @@
1
+ import * as React from 'react';
2
+ export interface SignInProps {
3
+ onSuccess?: () => void;
4
+ onError?: (error: Error) => void;
5
+ redirectUrl?: string;
6
+ className?: string;
7
+ style?: React.CSSProperties;
8
+ customStyles?: {
9
+ container?: string;
10
+ header?: string;
11
+ title?: string;
12
+ formWrapper?: string;
13
+ formContainer?: string;
14
+ form?: string;
15
+ input?: string;
16
+ button?: string;
17
+ errorText?: string;
18
+ label?: string;
19
+ };
20
+ }
21
+ export declare function SignIn({ onSuccess, onError, redirectUrl, className, style, customStyles }: SignInProps): import("react/jsx-runtime").JSX.Element;
22
+ //# sourceMappingURL=sign-in.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sign-in.d.ts","sourceRoot":"","sources":["../../../src/components/sign-in.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAK9B,MAAM,WAAW,WAAW;IAC1B,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;IACtB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAA;IAChC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IAC3B,YAAY,CAAC,EAAE;QACb,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,aAAa,CAAC,EAAE,MAAM,CAAA;QACtB,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,KAAK,CAAC,EAAE,MAAM,CAAA;KACf,CAAA;CACF;AAED,wBAAgB,MAAM,CAAC,EACrB,SAAS,EACT,OAAO,EACP,WAAW,EACX,SAAc,EACd,KAAK,EACL,YAAiB,EAClB,EAAE,WAAW,2CAmGb"}
@@ -0,0 +1,9 @@
1
+ export declare const ERRORS: {
2
+ readonly SERVER_SIDE_INITIALIZATION: "TernSecure must be initialized on the client side";
3
+ readonly NOT_INITIALIZED: "TernSecure services are not initialized. Call initializeTernSecure() first";
4
+ readonly HOOK_CONTEXT: (hookName: string) => string;
5
+ };
6
+ export declare class TernSecureError extends Error {
7
+ constructor(message: string);
8
+ }
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/errors/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;sCAGU,MAAM;CACvB,CAAC;AAEX,qBAAa,eAAgB,SAAQ,KAAK;gBAC5B,OAAO,EAAE,MAAM;CAI5B"}
@@ -0,0 +1,2 @@
1
+ export { useAuth } from './useAuth';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare function useAuth(): import("../types").AuthState;
2
+ //# sourceMappingURL=useAuth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAuth.d.ts","sourceRoot":"","sources":["../../../src/hooks/useAuth.ts"],"names":[],"mappings":"AAMA,wBAAgB,OAAO,iCA0DtB"}