lens-convex-auth 0.2.1 → 0.3.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/README.md CHANGED
@@ -261,7 +261,33 @@ if (session) await fetchMutation(api.users.ensureCurrentUser, {}, { token: await
261
261
 
262
262
  ### Your own dialog placement or UI
263
263
 
264
- Pass `accountDialog={false}` and render `<AccountDialog />` where you want it. `CreateAccountForm` is
264
+ Pass `accountDialog={false}` and render `<AccountDialog />` where you want it.
265
+
266
+ To match your app's own dialogs, render `<AccountPicker />` (the account list, or the form to create
267
+ one) inside them instead. `useAccountDialog()` has the dialog's state and its title:
268
+
269
+ ```tsx
270
+ import { AccountPicker, useAccountDialog, useLensAuth } from "lens-convex-auth/react"
271
+
272
+ function MyAccountDialog() {
273
+ const { signOut } = useLensAuth()
274
+ const { open, required, setOpen, title, description } = useAccountDialog()
275
+ return (
276
+ <MyDialog open={open} onOpenChange={setOpen} dismissible={!required} title={title} description={description}>
277
+ <AccountPicker
278
+ actions={
279
+ <MyButton onClick={signOut}>{required ? "Disconnect Wallet" : "Log Out"}</MyButton>
280
+ }
281
+ />
282
+ </MyDialog>
283
+ )
284
+ }
285
+ ```
286
+
287
+ `required` is true while a wallet is connected without a Lens account signed in: the dialog shouldn't
288
+ close then (`setOpen(false)` is ignored), so give it a way out, like the button above. Buttons passed
289
+ as `actions` go in the picker's button group, under "Create a new account" or the create form's
290
+ buttons. `AccountPicker` has no horizontal padding, so give it your dialog's. `CreateAccountForm` is
265
291
  exported too, and the lower-level building blocks (`auth.requestChallenge`, `auth.authenticate`,
266
292
  `createLensAccount`, `uploadAccountMetadata`, …) are in the main entry.
267
293
 
@@ -37,7 +37,19 @@ type LensAuthContextValue = {
37
37
  /** Opens the account dialog, e.g. to switch to another account */
38
38
  openAccountDialog: () => void;
39
39
  };
40
+ type AccountDialogHeader = {
41
+ /** "Select Account", or "Create Account" while the form to create one is shown */
42
+ title: string;
43
+ description: string;
44
+ };
45
+ type AccountDialogControls = AccountDialogHeader & {
46
+ open: boolean;
47
+ /** True while a wallet is connected without a Lens session: the dialog can't be dismissed */
48
+ required: boolean;
49
+ setOpen: (open: boolean) => void;
50
+ };
40
51
  declare function useLensAuth(): LensAuthContextValue;
52
+ declare function useAccountDialog(): AccountDialogControls;
41
53
  type LensAuthProviderProps = {
42
54
  /** From createLensAuth(), created once at module level */
43
55
  auth: LensAuth;
@@ -74,15 +86,20 @@ type SignInButtonProps = {
74
86
  declare function SignInButton({ label, signOutLabel, theme, className, connectButtonProps }: SignInButtonProps): React.JSX.Element;
75
87
 
76
88
  declare function AccountDialog(): React.JSX.Element;
89
+ declare function AccountPicker({ actions }: {
90
+ actions?: React.ReactNode;
91
+ }): React.JSX.Element | null;
77
92
 
78
93
  type CreatedAccount = {
79
94
  address: string;
80
95
  localName: string;
81
96
  };
82
- declare function CreateAccountForm({ ownerAddress, onCreated, onBack }: {
97
+ declare function CreateAccountForm({ ownerAddress, onCreated, onBack, actions }: {
83
98
  ownerAddress: string;
84
99
  onCreated: (account: CreatedAccount) => Promise<void>;
85
100
  onBack?: () => void;
101
+ /** More buttons, shown under the form's own */
102
+ actions?: React.ReactNode;
86
103
  }): React.JSX.Element;
87
104
 
88
- export { AccountDialog, CreateAccountForm, type CreatedAccount, type LensAuthContextValue, LensAuthProvider, type LensAuthProviderProps, type LensAuthStatus, SignInButton, type SignInButtonProps, type SignedInAccount, useLensAuth };
105
+ export { AccountDialog, type AccountDialogControls, type AccountDialogHeader, AccountPicker, CreateAccountForm, type CreatedAccount, type LensAuthContextValue, LensAuthProvider, type LensAuthProviderProps, type LensAuthStatus, SignInButton, type SignInButtonProps, type SignedInAccount, useAccountDialog, useLensAuth };
@@ -421,7 +421,7 @@ var STEP_LABELS = {
421
421
  };
422
422
  var USERNAME_DEBOUNCE_MS = 300;
423
423
  var MAX_PICTURE_BYTES = 10 * 1024 * 1024;
424
- function CreateAccountForm({ ownerAddress, onCreated, onBack }) {
424
+ function CreateAccountForm({ ownerAddress, onCreated, onBack, actions }) {
425
425
  const { auth } = useLensAuth();
426
426
  const activeAccount = useActiveAccount();
427
427
  const wallet = useActiveWallet();
@@ -665,7 +665,8 @@ function CreateAccountForm({ ownerAddress, onCreated, onBack }) {
665
665
  step ? STEP_LABELS[step.status] : "Create account"
666
666
  ] }),
667
667
  /* @__PURE__ */ jsx8(FieldDescription, { "aria-live": "polite", className: cn("min-h-5 leading-5", error && "text-destructive"), children: error ?? (step?.status === "sign" ? "Tap again to sign in your wallet." : "You\u2019ll sign a message in your wallet. It\u2019s free.") }),
668
- onBack && /* @__PURE__ */ jsx8(Button, { type: "button", variant: "ghost", className: "w-full", onClick: onBack, disabled: busy, children: "Back to your accounts" })
668
+ onBack && /* @__PURE__ */ jsx8(Button, { type: "button", variant: "ghost", className: "w-full", onClick: onBack, disabled: busy, children: "Back to your accounts" }),
669
+ actions
669
670
  ] })
670
671
  ] }) });
671
672
  }
@@ -906,21 +907,19 @@ function DrawerDescription({
906
907
  }
907
908
 
908
909
  // src/react/AccountDialog.tsx
909
- import { Fragment, jsx as jsx11, jsxs as jsxs5 } from "react/jsx-runtime";
910
+ import { jsx as jsx11, jsxs as jsxs5 } from "react/jsx-runtime";
910
911
  function AccountDialog() {
911
- const { wallet, signOut } = useLensAuth();
912
- const { open, required, setOpen } = useAccountDialogState();
912
+ const { signOut } = useLensAuth();
913
+ const { open, required, setOpen, title, description } = useAccountDialog();
913
914
  const isDesktop = useMediaQuery("(min-width: 768px)");
914
- const [creating, setCreating] = React3.useState(false);
915
- React3.useEffect(() => {
916
- if (!open) setCreating(false);
917
- }, [open]);
918
915
  const handleOpenChange = (next) => {
919
916
  if (!next && required) return;
920
917
  setOpen(next);
921
918
  };
922
- const body = wallet ? /* @__PURE__ */ jsx11(AccountDialogBody, { wallet, creating, setCreating }, wallet.address) : null;
923
- const disconnect = /* @__PURE__ */ jsx11(Button, { onClick: signOut, variant: "outline", className: "w-full", children: "Disconnect Wallet" });
919
+ const leave = (
920
+ // Without a Lens session there's only the wallet to disconnect; when switching accounts, it logs out too
921
+ /* @__PURE__ */ jsx11(Button, { onClick: signOut, variant: "ghost", className: "w-full", children: required ? "Disconnect Wallet" : "Log Out" })
922
+ );
924
923
  if (isDesktop) {
925
924
  return /* @__PURE__ */ jsx11(Dialog, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxs5(
926
925
  DialogContent,
@@ -930,21 +929,36 @@ function AccountDialog() {
930
929
  onEscapeKeyDown: (e) => required && e.preventDefault(),
931
930
  onPointerDownOutside: (e) => required && e.preventDefault(),
932
931
  children: [
933
- body,
934
- /* @__PURE__ */ jsx11("div", { className: "mt-4", children: disconnect })
932
+ /* @__PURE__ */ jsxs5(DialogHeader, { children: [
933
+ /* @__PURE__ */ jsx11(DialogTitle, { children: title }),
934
+ /* @__PURE__ */ jsx11(DialogDescription, { children: description })
935
+ ] }),
936
+ /* @__PURE__ */ jsx11(AccountPicker, { actions: leave })
935
937
  ]
936
938
  }
937
939
  ) });
938
940
  }
939
941
  return /* @__PURE__ */ jsx11(Drawer, { open, onOpenChange: handleOpenChange, dismissible: !required, children: /* @__PURE__ */ jsxs5(DrawerContent, { className: "max-h-[80vh] overflow-y-auto", children: [
940
- body,
941
- /* @__PURE__ */ jsx11("div", { className: "p-4", children: disconnect })
942
+ /* @__PURE__ */ jsxs5(DrawerHeader, { className: "text-left", children: [
943
+ /* @__PURE__ */ jsx11(DrawerTitle, { children: title }),
944
+ /* @__PURE__ */ jsx11(DrawerDescription, { children: description })
945
+ ] }),
946
+ /* @__PURE__ */ jsx11("div", { className: "px-4 pb-4", children: /* @__PURE__ */ jsx11(AccountPicker, { actions: leave }) })
942
947
  ] }) });
943
948
  }
944
- function AccountDialogBody({ wallet, creating, setCreating }) {
949
+ function AccountPicker({ actions }) {
950
+ const { wallet } = useLensAuth();
951
+ const { open } = useAccountDialogState();
952
+ const [creating, setCreating] = React3.useState(false);
953
+ React3.useEffect(() => {
954
+ if (!open) setCreating(false);
955
+ }, [open]);
956
+ if (!wallet) return null;
957
+ return /* @__PURE__ */ jsx11(AccountPickerBody, { wallet, creating, setCreating, actions }, wallet.address);
958
+ }
959
+ function AccountPickerBody({ wallet, creating, setCreating, actions }) {
945
960
  const { auth } = useLensAuth();
946
- const { completeSignIn } = useAccountDialogState();
947
- const isDesktop = useMediaQuery("(min-width: 768px)");
961
+ const { completeSignIn, setHeader } = useAccountDialogState();
948
962
  const { data, loading: loadingAccounts } = useAccountsAvailable({ managedBy: evmAddress(wallet.address), includeOwned: true });
949
963
  const accounts = data?.items;
950
964
  const usernames = useAccountUsernames(auth, accounts);
@@ -965,23 +979,18 @@ function AccountDialogBody({ wallet, creating, setCreating }) {
965
979
  };
966
980
  const title = showCreate ? "Create Account" : "Select Account";
967
981
  const description = showCreate ? hasAccounts ? "Pick a username for your new Lens account." : "You don\u2019t have a Lens account yet. Create one to continue." : "Select an account to continue.";
968
- const Header = isDesktop ? DialogHeader : DrawerHeader;
969
- const Title2 = isDesktop ? DialogTitle : DrawerTitle;
970
- const Description2 = isDesktop ? DialogDescription : DrawerDescription;
971
- return /* @__PURE__ */ jsxs5(Fragment, { children: [
972
- /* @__PURE__ */ jsxs5(Header, { className: isDesktop ? void 0 : "text-left", children: [
973
- /* @__PURE__ */ jsx11(Title2, { children: title }),
974
- /* @__PURE__ */ jsx11(Description2, { children: description })
975
- ] }),
976
- /* @__PURE__ */ jsx11("div", { className: isDesktop || !showCreate ? void 0 : "px-4", children: showCreate ? /* @__PURE__ */ jsx11(
977
- CreateAccountForm,
978
- {
979
- ownerAddress: wallet.address,
980
- onCreated: handleCreated,
981
- onBack: hasAccounts ? () => setCreating(false) : void 0
982
- }
983
- ) : /* @__PURE__ */ jsx11(AccountList, { auth, accounts, usernameOf, loading, ownerAddress: wallet.address, onSign: signIn, onCreate: () => setCreating(true) }) })
984
- ] });
982
+ React3.useLayoutEffect(() => {
983
+ setHeader({ title, description });
984
+ }, [setHeader, title, description]);
985
+ return showCreate ? /* @__PURE__ */ jsx11(
986
+ CreateAccountForm,
987
+ {
988
+ ownerAddress: wallet.address,
989
+ onCreated: handleCreated,
990
+ onBack: hasAccounts ? () => setCreating(false) : void 0,
991
+ actions
992
+ }
993
+ ) : /* @__PURE__ */ jsx11(AccountList, { auth, accounts, usernameOf, loading, ownerAddress: wallet.address, onSign: signIn, onCreate: () => setCreating(true), actions });
985
994
  }
986
995
  function useAccountUsernames(auth, accounts) {
987
996
  const key = accounts?.map((item) => item.account.address.toLowerCase()).join(",");
@@ -1008,7 +1017,7 @@ function fetchChallenge(auth, acc, ownerAddress) {
1008
1017
  signer: ownerAddress
1009
1018
  });
1010
1019
  }
1011
- function AccountList({ auth, accounts, usernameOf, loading, ownerAddress, onSign, onCreate }) {
1020
+ function AccountList({ auth, accounts, usernameOf, loading, ownerAddress, onSign, onCreate, actions }) {
1012
1021
  const [step, setStep] = React3.useState(null);
1013
1022
  const [errorId, setErrorId] = React3.useState(null);
1014
1023
  const [challenges, setChallenges] = React3.useState({});
@@ -1073,7 +1082,10 @@ function AccountList({ auth, accounts, usernameOf, loading, ownerAddress, onSign
1073
1082
  })().catch(fail);
1074
1083
  };
1075
1084
  if (loading) {
1076
- return /* @__PURE__ */ jsx11("div", { className: "p-4", children: /* @__PURE__ */ jsx11("p", { className: "text-sm text-muted-foreground", children: "Loading available profiles\u2026" }) });
1085
+ return /* @__PURE__ */ jsxs5("div", { className: "py-4 space-y-3", children: [
1086
+ /* @__PURE__ */ jsx11("p", { className: "text-sm text-muted-foreground", children: "Loading available profiles\u2026" }),
1087
+ actions && /* @__PURE__ */ jsx11("div", { className: "flex flex-col gap-2", children: actions })
1088
+ ] });
1077
1089
  }
1078
1090
  return /* @__PURE__ */ jsxs5("div", { className: "py-4 space-y-3", children: [
1079
1091
  /* @__PURE__ */ jsx11("ul", { className: "space-y-2 max-h-80 overflow-y-auto", children: selectable.map(({ acc, id }) => {
@@ -1108,12 +1120,16 @@ function AccountList({ auth, accounts, usernameOf, loading, ownerAddress, onSign
1108
1120
  errorId === id && /* @__PURE__ */ jsx11("p", { className: "px-1 pt-1 text-xs text-destructive", children: "Couldn\u2019t sign in. Please try again." })
1109
1121
  ] }, id);
1110
1122
  }) }),
1111
- /* @__PURE__ */ jsx11(Button, { variant: "ghost", className: "w-full", onClick: onCreate, disabled: step?.status === "loading", children: "Create a new account" })
1123
+ /* @__PURE__ */ jsxs5("div", { className: "flex flex-col gap-2", children: [
1124
+ /* @__PURE__ */ jsx11(Button, { className: "w-full", onClick: onCreate, disabled: step?.status === "loading", children: "Create a new account" }),
1125
+ actions
1126
+ ] })
1112
1127
  ] });
1113
1128
  }
1114
1129
 
1115
1130
  // src/react/provider.tsx
1116
1131
  import { jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
1132
+ var DEFAULT_HEADER = { title: "Select Account", description: "Select an account to continue." };
1117
1133
  var LensAuthContext = React4.createContext(null);
1118
1134
  var AccountDialogContext = React4.createContext(null);
1119
1135
  function useLensAuth() {
@@ -1126,6 +1142,10 @@ function useAccountDialogState() {
1126
1142
  if (!ctx) throw new Error("<AccountDialog> must be used within <LensAuthProvider>");
1127
1143
  return ctx;
1128
1144
  }
1145
+ function useAccountDialog() {
1146
+ const { open, required, setOpen, title, description } = useAccountDialogState();
1147
+ return { open, required, setOpen, title, description };
1148
+ }
1129
1149
  function subscribeToTokens(onChange) {
1130
1150
  window.addEventListener(TOKENS_CHANGED_EVENT, onChange);
1131
1151
  window.addEventListener("storage", onChange);
@@ -1185,6 +1205,7 @@ function LensAuthState({ auth, onSignIn, withConvex, wallets, children }) {
1185
1205
  const { disconnect } = useDisconnect();
1186
1206
  const sessionKey = useSessionKey(auth);
1187
1207
  const [manualOpen, setManualOpen] = React4.useState(false);
1208
+ const [header, setHeader] = React4.useState(DEFAULT_HEADER);
1188
1209
  const [pendingSignIn, setPendingSignIn] = React4.useState(null);
1189
1210
  const account = React4.useMemo(() => {
1190
1211
  if (!sessionKey) return null;
@@ -1200,11 +1221,8 @@ function LensAuthState({ auth, onSignIn, withConvex, wallets, children }) {
1200
1221
  const signOut = React4.useCallback(async () => {
1201
1222
  setManualOpen(false);
1202
1223
  writeSelectedAccount(auth, null);
1203
- try {
1204
- await auth.logout();
1205
- } finally {
1206
- if (activeWallet) disconnect(activeWallet);
1207
- }
1224
+ if (activeWallet) disconnect(activeWallet);
1225
+ await auth.logout();
1208
1226
  }, [auth, activeWallet, disconnect]);
1209
1227
  const value = React4.useMemo(() => ({
1210
1228
  auth,
@@ -1220,6 +1238,8 @@ function LensAuthState({ auth, onSignIn, withConvex, wallets, children }) {
1220
1238
  const dialog = React4.useMemo(() => ({
1221
1239
  open: required || manualOpen && !!wallet,
1222
1240
  required,
1241
+ ...header,
1242
+ setHeader,
1223
1243
  setOpen: (open) => {
1224
1244
  if (open) setManualOpen(true);
1225
1245
  else if (!required) setManualOpen(false);
@@ -1229,7 +1249,7 @@ function LensAuthState({ auth, onSignIn, withConvex, wallets, children }) {
1229
1249
  setManualOpen(false);
1230
1250
  if (onSignIn) setPendingSignIn(signedIn);
1231
1251
  }
1232
- }), [auth, required, manualOpen, wallet, onSignIn]);
1252
+ }), [auth, required, manualOpen, wallet, header, onSignIn]);
1233
1253
  return /* @__PURE__ */ jsx12(LensAuthContext.Provider, { value, children: /* @__PURE__ */ jsxs6(AccountDialogContext.Provider, { value: dialog, children: [
1234
1254
  children,
1235
1255
  sessionKey && !wallet && /* @__PURE__ */ jsx12(React4.Suspense, { fallback: null, children: /* @__PURE__ */ jsx12(AutoConnect, { client: auth.thirdwebClient, chain: auth.chain, wallets }) }),
@@ -1306,9 +1326,11 @@ function SignInButton({ label = "Sign in", signOutLabel = "Logout", theme, class
1306
1326
  }
1307
1327
  export {
1308
1328
  AccountDialog,
1329
+ AccountPicker,
1309
1330
  CreateAccountForm,
1310
1331
  LensAuthProvider,
1311
1332
  SignInButton,
1333
+ useAccountDialog,
1312
1334
  useLensAuth
1313
1335
  };
1314
1336
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/react/provider.tsx","../../src/react/AccountDialog.tsx","../../src/react/CreateAccountForm.tsx","../../src/react/utils.ts","../../src/react/ui/button.tsx","../../src/react/ui/input.tsx","../../src/react/ui/textarea.tsx","../../src/react/ui/avatar.tsx","../../src/react/ui/field.tsx","../../src/react/ui/label.tsx","../../src/react/ui/input-group.tsx","../../src/react/dom.ts","../../src/react/ui/dialog.tsx","../../src/react/ui/drawer.tsx","../../src/react/SignInButton.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { LensProvider } from \"@lens-protocol/react\"\nimport { ThirdwebProvider, useActiveAccount, useActiveWallet, useDisconnect } from \"thirdweb/react\"\nimport type { Account as ThirdwebAccount, Wallet } from \"thirdweb/wallets\"\nimport { ConvexProviderWithAuth, useConvexAuth, type ConvexReactClient } from \"convex/react\"\nimport type { LensAuth } from \"../core/auth\"\nimport { TOKENS_CHANGED_EVENT } from \"../core/tokens\"\nimport { AccountDialog } from \"./AccountDialog\"\n\nexport type SignedInAccount = {\n /** Lens account address, lowercased */\n address: string\n /** Lens username (local name), when known */\n username: string | null\n}\n\nexport type LensAuthStatus =\n /** Reading the stored session (first render, and during SSR) */\n | \"loading\"\n /** No wallet and no Lens session */\n | \"signed-out\"\n /** Wallet connected, no Lens account signed in yet: the account dialog is open */\n | \"choosing-account\"\n /** Signed in to a Lens account (Convex is authenticated as it too) */\n | \"signed-in\"\n\nexport type LensAuthContextValue = {\n auth: LensAuth\n status: LensAuthStatus\n isLoading: boolean\n isSignedIn: boolean\n /** The connected thirdweb wallet account */\n wallet: ThirdwebAccount | undefined\n /** The signed-in Lens account */\n account: SignedInAccount | null\n /** Ends the Lens session and disconnects the wallet */\n signOut: () => Promise<void>\n /** Opens the account dialog, e.g. to switch to another account */\n openAccountDialog: () => void\n}\n\ntype AccountDialogState = {\n open: boolean\n // True while a wallet is connected without a Lens session: the dialog can't be dismissed\n required: boolean\n setOpen: (open: boolean) => void\n completeSignIn: (account: SignedInAccount) => void\n}\n\nconst LensAuthContext = React.createContext<LensAuthContextValue | null>(null)\nconst AccountDialogContext = React.createContext<AccountDialogState | null>(null)\n\nexport function useLensAuth(): LensAuthContextValue {\n const ctx = React.useContext(LensAuthContext)\n if (!ctx) throw new Error(\"useLensAuth must be used within <LensAuthProvider>\")\n return ctx\n}\n\nexport function useAccountDialogState(): AccountDialogState {\n const ctx = React.useContext(AccountDialogContext)\n if (!ctx) throw new Error(\"<AccountDialog> must be used within <LensAuthProvider>\")\n return ctx\n}\n\nfunction subscribeToTokens(onChange: () => void) {\n window.addEventListener(TOKENS_CHANGED_EVENT, onChange)\n // Signing in or out in another tab\n window.addEventListener(\"storage\", onChange)\n return () => {\n window.removeEventListener(TOKENS_CHANGED_EVENT, onChange)\n window.removeEventListener(\"storage\", onChange)\n }\n}\n\n// Identifies the stored Lens session: its id plus the account it acts for. Token refreshes keep it the\n// same; signing in again, or as another account, changes it. Undefined until read on the client.\nfunction useSessionKey(auth: LensAuth): string | null | undefined {\n return React.useSyncExternalStore(\n subscribeToTokens,\n () => {\n const session = auth.getSession()\n return session ? `${session.sessionId}:${session.account}` : null\n },\n () => undefined,\n )\n}\n\n// Signs Convex in as the Lens account the user signed in with. A new session gets a new\n// fetchAccessToken, which makes Convex fetch its token again.\nfunction createUseConvexAuth(auth: LensAuth) {\n return function useLensConvexAuth() {\n const sessionKey = useSessionKey(auth)\n const fetchAccessToken = React.useCallback(\n async ({ forceRefreshToken }: { forceRefreshToken: boolean }) =>\n sessionKey ? auth.fetchConvexToken(forceRefreshToken) : null,\n [sessionKey],\n )\n return { isLoading: sessionKey === undefined, isAuthenticated: !!sessionKey, fetchAccessToken }\n }\n}\n\nexport type LensAuthProviderProps = {\n /** From createLensAuth(), created once at module level */\n auth: LensAuth\n /** Your ConvexReactClient. Omit to use the package without Convex. */\n convex?: ConvexReactClient\n /**\n * Called after the user signs in from the account dialog (picking an account or creating one), once\n * Convex accepts the session. A good place to create the user's row: `convex.mutation(api.users.ensure)`\n */\n onSignIn?: (account: SignedInAccount) => void | Promise<void>\n /** Render the account dialog. Set to false to render <AccountDialog /> yourself. Defaults to true. */\n accountDialog?: boolean\n /**\n * Wallets to reconnect after a reload while a Lens session is stored. Pass the same list as\n * SignInButton's `connectButtonProps.wallets`, if you customize it. Defaults to thirdweb's wallets.\n */\n wallets?: Wallet[]\n children: React.ReactNode\n}\n\n// thirdweb's AutoConnect (loaded on demand, like the ConnectButton) reconnects the last wallet\nconst AutoConnect = React.lazy(() => import(\"thirdweb/react\").then((m) => ({ default: m.AutoConnect })))\n\n// Wraps the app in thirdweb, Lens and (optionally) Convex providers wired to one session.\nexport function LensAuthProvider({ auth, convex, onSignIn, accountDialog = true, wallets, children }: LensAuthProviderProps) {\n const [useConvexAuthHook] = React.useState(() => createUseConvexAuth(auth))\n const content = (\n <LensAuthState auth={auth} onSignIn={onSignIn} withConvex={!!convex} wallets={wallets}>\n {children}\n {accountDialog && <AccountDialog />}\n </LensAuthState>\n )\n return (\n <ThirdwebProvider>\n <LensProvider client={auth.lensClient}>\n {convex ? (\n <ConvexProviderWithAuth client={convex} useAuth={useConvexAuthHook}>\n {content}\n </ConvexProviderWithAuth>\n ) : content}\n </LensProvider>\n </ThirdwebProvider>\n )\n}\n\nfunction readSelectedAccount(auth: LensAuth, address: string): string | null {\n try {\n const stored = JSON.parse(localStorage.getItem(`${auth.storagePrefix}account`) ?? \"null\")\n return stored?.address === address && typeof stored.username === \"string\" ? stored.username : null\n } catch {\n return null\n }\n}\n\nfunction writeSelectedAccount(auth: LensAuth, account: SignedInAccount | null) {\n try {\n const key = `${auth.storagePrefix}account`\n if (account) localStorage.setItem(key, JSON.stringify(account))\n else localStorage.removeItem(key)\n } catch {}\n}\n\nfunction LensAuthState({ auth, onSignIn, withConvex, wallets, children }: {\n auth: LensAuth\n onSignIn?: LensAuthProviderProps[\"onSignIn\"]\n withConvex: boolean\n wallets?: Wallet[]\n children: React.ReactNode\n}) {\n const wallet = useActiveAccount()\n const activeWallet = useActiveWallet()\n const { disconnect } = useDisconnect()\n const sessionKey = useSessionKey(auth)\n const [manualOpen, setManualOpen] = React.useState(false)\n const [pendingSignIn, setPendingSignIn] = React.useState<SignedInAccount | null>(null)\n\n const account = React.useMemo<SignedInAccount | null>(() => {\n if (!sessionKey) return null\n const address = sessionKey.slice(sessionKey.lastIndexOf(\":\") + 1)\n return { address, username: readSelectedAccount(auth, address) }\n }, [auth, sessionKey])\n\n const status: LensAuthStatus =\n sessionKey === undefined ? \"loading\"\n : sessionKey ? \"signed-in\"\n : wallet ? \"choosing-account\"\n : \"signed-out\"\n\n useBackgroundRefresh(auth)\n\n // A connected wallet checks the stored session is still valid (refreshing it or clearing it)\n React.useEffect(() => {\n if (wallet) void auth.resumeSession().catch(() => {})\n }, [auth, wallet?.address])\n\n const signOut = React.useCallback(async () => {\n setManualOpen(false)\n writeSelectedAccount(auth, null)\n try {\n await auth.logout()\n } finally {\n if (activeWallet) disconnect(activeWallet)\n }\n }, [auth, activeWallet, disconnect])\n\n const value = React.useMemo<LensAuthContextValue>(() => ({\n auth,\n status,\n isLoading: status === \"loading\",\n isSignedIn: status === \"signed-in\",\n wallet,\n account,\n signOut,\n openAccountDialog: () => setManualOpen(true),\n }), [auth, status, wallet, account, signOut])\n\n const required = status === \"choosing-account\"\n const dialog = React.useMemo<AccountDialogState>(() => ({\n open: required || (manualOpen && !!wallet),\n required,\n setOpen: (open) => {\n if (open) setManualOpen(true)\n else if (!required) setManualOpen(false)\n },\n completeSignIn: (signedIn) => {\n writeSelectedAccount(auth, signedIn)\n setManualOpen(false)\n if (onSignIn) setPendingSignIn(signedIn)\n },\n }), [auth, required, manualOpen, wallet, onSignIn])\n\n return (\n <LensAuthContext.Provider value={value}>\n <AccountDialogContext.Provider value={dialog}>\n {children}\n {/* After a reload the Lens session is restored from storage, but the wallet only comes back if\n something reconnects it: SignInButton's ConnectButton does, but it's only shown while no\n wallet is connected and apps often hide it once signed in. */}\n {sessionKey && !wallet && (\n <React.Suspense fallback={null}>\n <AutoConnect client={auth.thirdwebClient} chain={auth.chain} wallets={wallets} />\n </React.Suspense>\n )}\n {pendingSignIn && onSignIn && (\n withConvex\n ? <ConvexSignInCallback account={pendingSignIn} onSignIn={onSignIn} done={() => setPendingSignIn(null)} />\n : <SignInCallback account={pendingSignIn} onSignIn={onSignIn} done={() => setPendingSignIn(null)} />\n )}\n </AccountDialogContext.Provider>\n </LensAuthContext.Provider>\n )\n}\n\ntype SignInCallbackProps = {\n account: SignedInAccount\n onSignIn: NonNullable<LensAuthProviderProps[\"onSignIn\"]>\n done: () => void\n}\n\nfunction SignInCallback({ account, onSignIn, done }: SignInCallbackProps) {\n React.useEffect(() => {\n Promise.resolve(onSignIn(account)).catch((err) => console.error(\"lens-convex-auth: onSignIn failed\", err)).finally(done)\n }, [account])\n return null\n}\n\n// Waits until Convex accepts the new session, so onSignIn can call authenticated Convex functions\nfunction ConvexSignInCallback(props: SignInCallbackProps) {\n const { isAuthenticated, isLoading } = useConvexAuth()\n return isAuthenticated && !isLoading ? <SignInCallback {...props} /> : null\n}\n\n// Refreshes the tokens a minute before they expire, so Convex and API calls always have a fresh one\nfunction useBackgroundRefresh(auth: LensAuth) {\n React.useEffect(() => {\n let timeout: ReturnType<typeof setTimeout> | undefined\n let stopped = false\n\n // Runs again whenever tokens are stored or cleared (a sign-in, a refresh, another tab)\n const schedule = () => {\n if (timeout) clearTimeout(timeout)\n timeout = undefined\n const tokens = auth.tokens.getStoredTokens()\n if (stopped || !tokens?.expiresAt) return\n const delay = Math.max(1000, tokens.expiresAt - Date.now() - 60 * 1000)\n timeout = setTimeout(() => void auth.tokens.refreshTokens(), delay)\n }\n\n const unsubscribe = subscribeToTokens(schedule)\n ;(async () => {\n try {\n await auth.resumeSession()\n } catch {}\n schedule()\n })()\n\n return () => {\n stopped = true\n unsubscribe()\n if (timeout) clearTimeout(timeout)\n }\n }, [auth])\n}\n","import * as React from \"react\"\nimport { useAccountsAvailable } from \"@lens-protocol/react\"\nimport { evmAddress, type Account, type AccountAvailable } from \"@lens-protocol/client\"\nimport type { Account as ThirdwebAccount } from \"thirdweb/wallets\"\nimport { Loader2 } from \"lucide-react\"\nimport { CHALLENGE_MAX_AGE_MS, CHALLENGE_REFRESH_MS, opensWalletWithDeepLink, type LensAuth, type LensChallenge } from \"../core/auth\"\nimport { fetchAccountUsername } from \"../core/onboarding\"\nimport { useAccountDialogState, useLensAuth } from \"./provider\"\nimport { CreateAccountForm, type CreatedAccount } from \"./CreateAccountForm\"\nimport { useMediaQuery } from \"./dom\"\nimport { Button } from \"./ui/button\"\nimport { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from \"./ui/dialog\"\nimport { Drawer, DrawerContent, DrawerDescription, DrawerHeader, DrawerTitle } from \"./ui/drawer\"\n\n// Lists the wallet's Lens accounts to sign in with, or the form to create one. Opens by itself when a\n// wallet connects without a Lens session, and can't be dismissed until an account is signed in to (or\n// the wallet disconnects). A dialog on desktop, a drawer on mobile.\nexport function AccountDialog() {\n const { wallet, signOut } = useLensAuth()\n const { open, required, setOpen } = useAccountDialogState()\n const isDesktop = useMediaQuery(\"(min-width: 768px)\")\n const [creating, setCreating] = React.useState(false)\n\n // Show the account list again the next time the dialog opens\n React.useEffect(() => {\n if (!open) setCreating(false)\n }, [open])\n\n const handleOpenChange = (next: boolean) => {\n if (!next && required) return\n setOpen(next)\n }\n\n const body = wallet\n ? <AccountDialogBody key={wallet.address} wallet={wallet} creating={creating} setCreating={setCreating} />\n : null\n const disconnect = (\n <Button onClick={signOut} variant=\"outline\" className=\"w-full\">\n Disconnect Wallet\n </Button>\n )\n\n if (isDesktop) {\n return (\n <Dialog open={open} onOpenChange={handleOpenChange}>\n <DialogContent\n className=\"sm:max-w-[425px] max-h-[80vh] overflow-y-auto\"\n showCloseButton={!required}\n onEscapeKeyDown={(e) => required && e.preventDefault()}\n onPointerDownOutside={(e) => required && e.preventDefault()}\n >\n {body}\n <div className=\"mt-4\">{disconnect}</div>\n </DialogContent>\n </Dialog>\n )\n }\n\n return (\n <Drawer open={open} onOpenChange={handleOpenChange} dismissible={!required}>\n <DrawerContent className=\"max-h-[80vh] overflow-y-auto\">\n {body}\n <div className=\"p-4\">{disconnect}</div>\n </DrawerContent>\n </Drawer>\n )\n}\n\nfunction AccountDialogBody({ wallet, creating, setCreating }: {\n wallet: ThirdwebAccount\n creating: boolean\n setCreating: (creating: boolean) => void\n}) {\n const { auth } = useLensAuth()\n const { completeSignIn } = useAccountDialogState()\n const isDesktop = useMediaQuery(\"(min-width: 768px)\")\n const { data, loading: loadingAccounts } = useAccountsAvailable({ managedBy: evmAddress(wallet.address), includeOwned: true })\n const accounts = data?.items\n const usernames = useAccountUsernames(auth, accounts)\n const loading = loadingAccounts || (!!accounts && !usernames)\n const usernameOf = React.useCallback((acc: Account) => {\n const resolved = usernames?.[acc.address.toLowerCase()]\n return resolved === undefined ? acc.username?.localName ?? null : resolved\n }, [usernames])\n // Accounts without a username aren't listed, so they don't count\n const hasAccounts = !loading && !!accounts?.some((item) => usernameOf(item.account))\n // Wallets without an account go straight to creating one\n const showCreate = creating || (!loading && !hasAccounts)\n\n const signIn = async (account: SelectableAccount, challenge: LensChallenge) => {\n // The signature request goes out before the first await, so a click handler calling this keeps its\n // user gesture, which mobile wallets need to open (see signLensChallenge).\n const signature = await auth.signChallenge(challenge, wallet)\n await auth.authenticate(challenge, signature)\n completeSignIn({ address: account.address.toLowerCase(), username: usernameOf(account) })\n }\n\n const handleCreated = async (created: CreatedAccount) => {\n completeSignIn({ address: created.address.toLowerCase(), username: created.localName })\n }\n\n const title = showCreate ? \"Create Account\" : \"Select Account\"\n const description = showCreate\n ? hasAccounts ? \"Pick a username for your new Lens account.\" : \"You don’t have a Lens account yet. Create one to continue.\"\n : \"Select an account to continue.\"\n\n const Header = isDesktop ? DialogHeader : DrawerHeader\n const Title = isDesktop ? DialogTitle : DrawerTitle\n const Description = isDesktop ? DialogDescription : DrawerDescription\n\n return (\n <>\n <Header className={isDesktop ? undefined : \"text-left\"}>\n <Title>{title}</Title>\n <Description>{description}</Description>\n </Header>\n <div className={isDesktop || !showCreate ? undefined : \"px-4\"}>\n {showCreate ? (\n <CreateAccountForm\n ownerAddress={wallet.address}\n onCreated={handleCreated}\n onBack={hasAccounts ? () => setCreating(false) : undefined}\n />\n ) : (\n <AccountList auth={auth} accounts={accounts} usernameOf={usernameOf} loading={loading} ownerAddress={wallet.address} onSign={signIn} onCreate={() => setCreating(true)} />\n )}\n </div>\n </>\n )\n}\n\n// Each account's username by lowercased address (see fetchAccountUsername), or undefined while they load.\n// An account whose lookup failed is left out, so it falls back to its global Lens username.\nfunction useAccountUsernames(auth: LensAuth, accounts?: readonly AccountAvailable[]) {\n const key = accounts?.map((item) => item.account.address.toLowerCase()).join(\",\")\n const [usernames, setUsernames] = React.useState<{ key: string; byAddress: Record<string, string | null> } | null>(null)\n\n React.useEffect(() => {\n if (key === undefined) return\n let cancelled = false\n const addresses = key ? key.split(\",\") : []\n Promise.all(addresses.map((address) =>\n fetchAccountUsername(auth, address).then((username) => [[address, username] as const], () => []),\n )).then((entries) => {\n if (!cancelled) setUsernames({ key, byAddress: Object.fromEntries(entries.flat()) })\n })\n return () => {\n cancelled = true\n }\n }, [auth, key])\n\n return usernames && usernames.key === key ? usernames.byAddress : undefined\n}\n\ntype SelectableAccount = Account & { isOwner: boolean }\n\ntype SignInStep =\n | { id: string; status: \"loading\" }\n | { id: string; status: \"sign\"; challenge: LensChallenge }\n\ntype PrefetchedChallenge = { owner: string; challenge: LensChallenge; fetchedAt: number }\n\nfunction fetchChallenge(auth: LensAuth, acc: SelectableAccount, ownerAddress: string) {\n return auth.requestChallenge({\n role: acc.isOwner ? \"ACCOUNT_OWNER\" : \"ACCOUNT_MANAGER\",\n account: acc.address,\n signer: ownerAddress,\n })\n}\n\nfunction AccountList({ auth, accounts, usernameOf, loading, ownerAddress, onSign, onCreate }: {\n auth: LensAuth\n accounts?: readonly AccountAvailable[]\n usernameOf: (account: Account) => string | null\n loading: boolean\n ownerAddress: string\n onSign: (account: SelectableAccount, challenge: LensChallenge) => Promise<void>\n onCreate: () => void\n}) {\n const [step, setStep] = React.useState<SignInStep | null>(null)\n const [errorId, setErrorId] = React.useState<string | null>(null)\n const [challenges, setChallenges] = React.useState<Record<string, PrefetchedChallenge>>({})\n\n const selectable = React.useMemo(() => (accounts ?? []).map((item, index) => {\n const acc: SelectableAccount = { ...item.account, isOwner: item.__typename === \"AccountOwned\" }\n return { acc, id: `${acc.address}-${index}` }\n }), [accounts])\n\n const prefetch = React.useCallback((acc: SelectableAccount, id: string) => {\n fetchChallenge(auth, acc, ownerAddress)\n .then((challenge) => setChallenges((prev) => ({ ...prev, [id]: { owner: ownerAddress, challenge, fetchedAt: Date.now() } })))\n .catch(() => {})\n }, [auth, ownerAddress])\n\n // Accounts can share a username across namespaces: those get their shortened address too\n const sharedUsernames = React.useMemo(() => {\n const counts = new Map<string, number>()\n for (const { acc } of selectable) {\n const username = usernameOf(acc)\n if (username) counts.set(username, (counts.get(username) ?? 0) + 1)\n }\n return new Set([...counts].filter(([, count]) => count > 1).map(([username]) => username))\n }, [selectable, usernameOf])\n\n // Fetch each account's challenge ahead of time, so a tap can ask the wallet to sign right away:\n // on mobile that tap is what lets the wallet app open (see opensWalletWithDeepLink).\n React.useEffect(() => {\n const refresh = () => {\n if (document.visibilityState !== \"visible\") return\n for (const { acc, id } of selectable) {\n if (usernameOf(acc)) prefetch(acc, id)\n }\n }\n refresh()\n const interval = setInterval(refresh, CHALLENGE_REFRESH_MS)\n document.addEventListener(\"visibilitychange\", refresh)\n return () => {\n clearInterval(interval)\n document.removeEventListener(\"visibilitychange\", refresh)\n }\n }, [selectable, usernameOf, prefetch])\n\n const readyChallenge = (id: string) => {\n if (step?.id === id && step.status === \"sign\") return step.challenge\n const prefetched = challenges[id]\n if (!prefetched || prefetched.owner !== ownerAddress) return null\n return Date.now() - prefetched.fetchedAt < CHALLENGE_MAX_AGE_MS ? prefetched.challenge : null\n }\n\n const handleClick = (acc: SelectableAccount, id: string) => {\n setErrorId(null)\n const fail = () => {\n setStep(null)\n setErrorId(id)\n prefetch(acc, id)\n }\n const challenge = readyChallenge(id)\n if (challenge) {\n // Sign now, while the tap still counts as a user gesture. A challenge can only be used once.\n const signing = onSign(acc, challenge)\n setChallenges(({ [id]: _used, ...rest }) => rest)\n setStep({ id, status: \"loading\" })\n signing.then(() => setStep(null), fail)\n return\n }\n // The challenge isn't ready yet: fetch it now. Desktop wallets sign without a user gesture;\n // on mobile it takes one more tap to open the wallet.\n setStep({ id, status: \"loading\" })\n ;(async () => {\n const fetched = await fetchChallenge(auth, acc, ownerAddress)\n if (opensWalletWithDeepLink()) return setStep({ id, status: \"sign\", challenge: fetched })\n await onSign(acc, fetched)\n setStep(null)\n })().catch(fail)\n }\n\n if (loading) {\n return (\n <div className=\"p-4\">\n <p className=\"text-sm text-muted-foreground\">Loading available profiles…</p>\n </div>\n )\n }\n\n return (\n <div className=\"py-4 space-y-3\">\n <ul className=\"space-y-2 max-h-80 overflow-y-auto\">\n {selectable.map(({ acc, id }) => {\n const username = usernameOf(acc)\n if (!username) return null\n const isLoading = step?.id === id && step.status === \"loading\"\n const awaitingSignature = step?.id === id && step.status === \"sign\"\n return (\n <li key={id}>\n <button\n type=\"button\"\n className=\"w-full text-left px-3 py-2 rounded-md border hover:bg-accent/50 flex items-center justify-between cursor-pointer disabled:cursor-default\"\n onClick={() => handleClick(acc, id)}\n disabled={step?.status === \"loading\"}\n >\n <span className=\"truncate\">\n {username}\n {sharedUsernames.has(username) && (\n <span className=\"text-muted-foreground\"> · {acc.address.slice(0, 6)}…{acc.address.slice(-4)}</span>\n )}\n </span>\n {isLoading && <Loader2 className=\"size-4 animate-spin text-muted-foreground\" />}\n {awaitingSignature && <span className=\"text-sm font-medium text-primary\">Sign in</span>}\n </button>\n {awaitingSignature && (\n <p className=\"px-1 pt-1 text-xs text-muted-foreground\">Tap again to sign the message in your wallet.</p>\n )}\n {errorId === id && (\n <p className=\"px-1 pt-1 text-xs text-destructive\">Couldn’t sign in. Please try again.</p>\n )}\n </li>\n )\n })}\n </ul>\n <Button variant=\"ghost\" className=\"w-full\" onClick={onCreate} disabled={step?.status === \"loading\"}>\n Create a new account\n </Button>\n </div>\n )\n}\n","import * as React from \"react\"\nimport { useActiveAccount, useActiveWallet } from \"thirdweb/react\"\nimport type { SessionClient } from \"@lens-protocol/client\"\nimport { Check, Loader2 } from \"lucide-react\"\nimport { CHALLENGE_MAX_AGE_MS, CHALLENGE_REFRESH_MS, opensWalletWithDeepLink, signLensChallenge, type LensChallenge } from \"../core/auth\"\nimport {\n OnboardingError,\n authenticateOnboarding,\n checkUsername,\n createLensAccount,\n createOnboardingClient,\n isUsernameTaken,\n requestOnboardingChallenge,\n signInToCreatedAccount,\n uploadAccountMetadata,\n usernameFormatError,\n} from \"../core/onboarding\"\nimport { useLensAuth } from \"./provider\"\nimport { cn } from \"./utils\"\nimport { Button } from \"./ui/button\"\nimport { Input } from \"./ui/input\"\nimport { Textarea } from \"./ui/textarea\"\nimport { Avatar, AvatarFallback, AvatarImage } from \"./ui/avatar\"\nimport { Field, FieldContent, FieldDescription, FieldGroup, FieldLabel } from \"./ui/field\"\nimport { InputGroup, InputGroupAddon, InputGroupInput, InputGroupText } from \"./ui/input-group\"\n\nexport type CreatedAccount = { address: string; localName: string }\n\ntype Step =\n | { status: \"signing\" }\n // The challenge arrived after the tap: on mobile it takes one more tap to open the wallet\n | { status: \"sign\"; challenge: LensChallenge }\n | { status: \"checking\" | \"uploading\" | \"creating\" | \"signing-in\" }\n\nconst STEP_LABELS = {\n signing: \"Waiting for signature…\",\n sign: \"Sign in wallet\",\n checking: \"Checking username…\",\n uploading: \"Uploading profile…\",\n creating: \"Creating account…\",\n \"signing-in\": \"Signing in…\",\n} satisfies Record<Step[\"status\"], string>\n\ntype Availability = { localName: string; status: \"checking\" | \"available\" | \"taken\" | \"unknown\" }\n\n// Same delay as the search on the find page\nconst USERNAME_DEBOUNCE_MS = 300\nconst MAX_PICTURE_BYTES = 10 * 1024 * 1024\n\n// Render with `key={ownerAddress}`: the onboarding session belongs to the wallet that signed it.\nexport function CreateAccountForm({ ownerAddress, onCreated, onBack }: {\n ownerAddress: string\n onCreated: (account: CreatedAccount) => Promise<void>\n onBack?: () => void\n}) {\n const { auth } = useLensAuth()\n const activeAccount = useActiveAccount()\n const wallet = useActiveWallet()\n\n const [client] = React.useState(() => createOnboardingClient(auth))\n // Kept across attempts so a retry doesn't ask for another signature or create a second account\n const session = React.useRef<SessionClient | null>(null)\n const created = React.useRef<CreatedAccount | null>(null)\n const pictureInput = React.useRef<HTMLInputElement>(null)\n\n const [username, setUsername] = React.useState(\"\")\n const [debouncedUsername, setDebouncedUsername] = React.useState(\"\")\n const [name, setName] = React.useState(\"\")\n const [bio, setBio] = React.useState(\"\")\n const [picture, setPicture] = React.useState<File | null>(null)\n const [pictureUrl, setPictureUrl] = React.useState<string | null>(null)\n\n const [availability, setAvailability] = React.useState<Availability | null>(null)\n const [usernameError, setUsernameError] = React.useState<{ localName: string; message: string } | null>(null)\n const [step, setStep] = React.useState<Step | null>(null)\n const [error, setError] = React.useState<string | null>(null)\n const [prefetched, setPrefetched] = React.useState<{ challenge: LensChallenge; fetchedAt: number } | null>(null)\n\n const formatError = username ? usernameFormatError(username) : null\n const busy = step !== null && step.status !== \"sign\"\n\n // Fetch the challenge ahead of time, so the tap on \"Create account\" can ask the wallet to sign right\n // away: on mobile that tap is what lets the wallet app open (see opensWalletWithDeepLink).\n React.useEffect(() => {\n const refresh = () => {\n if (document.visibilityState !== \"visible\" || session.current) return\n requestOnboardingChallenge(auth, client, ownerAddress)\n .then((challenge) => setPrefetched({ challenge, fetchedAt: Date.now() }))\n .catch(() => {})\n }\n refresh()\n const interval = setInterval(refresh, CHALLENGE_REFRESH_MS)\n document.addEventListener(\"visibilitychange\", refresh)\n return () => {\n clearInterval(interval)\n document.removeEventListener(\"visibilitychange\", refresh)\n }\n }, [auth, client, ownerAddress])\n\n // End the onboarding session if the form is left before the account is signed in to\n React.useEffect(() => () => {\n if (!created.current) void session.current?.logout()\n }, [])\n\n React.useEffect(() => {\n if (!picture) return setPictureUrl(null)\n const url = URL.createObjectURL(picture)\n setPictureUrl(url)\n return () => URL.revokeObjectURL(url)\n }, [picture])\n\n // Only check the username once typing pauses, not on every keystroke\n React.useEffect(() => {\n const timeout = setTimeout(() => setDebouncedUsername(username), USERNAME_DEBOUNCE_MS)\n return () => clearTimeout(timeout)\n }, [username])\n\n React.useEffect(() => {\n if (!debouncedUsername || usernameFormatError(debouncedUsername)) return\n let cancelled = false\n setAvailability({ localName: debouncedUsername, status: \"checking\" })\n isUsernameTaken(auth, debouncedUsername)\n .then((taken) => !cancelled && setAvailability({ localName: debouncedUsername, status: taken ? \"taken\" : \"available\" }))\n .catch(() => !cancelled && setAvailability({ localName: debouncedUsername, status: \"unknown\" }))\n return () => {\n cancelled = true\n }\n }, [auth, debouncedUsername])\n\n const fail = (e: unknown) => {\n setStep(null)\n if ((e as Error)?.name === \"UnauthenticatedError\") session.current = null\n setError(e instanceof OnboardingError ? e.message : \"Couldn’t create your account. Please try again.\")\n }\n\n const create = async (onboarding: SessionClient) => {\n const localName = username\n if (!created.current) {\n setStep({ status: \"checking\" })\n const reason = await checkUsername(auth, onboarding, localName)\n if (reason) {\n setUsernameError({ localName, message: reason })\n setStep(null)\n return\n }\n setStep({ status: \"uploading\" })\n const metadataUri = await uploadAccountMetadata(auth, { name: name.trim(), bio: bio.trim(), picture })\n setStep({ status: \"creating\" })\n if (!wallet) throw new OnboardingError(\"Connect your wallet\")\n const account = await createLensAccount(auth, onboarding, wallet, { localName, metadataUri })\n // account.username is its global Lens username, which it has none of in the app's namespace\n created.current = { address: account.address, localName }\n }\n setStep({ status: \"signing-in\" })\n await signInToCreatedAccount(auth, onboarding, created.current.address)\n await onCreated(created.current)\n }\n\n const continueWith = (authenticating: Promise<SessionClient | null>) => {\n authenticating\n .then(async (onboarding) => {\n if (!onboarding) return\n session.current = onboarding\n await create(onboarding)\n })\n .catch(fail)\n }\n\n const readyChallenge = () => {\n if (step?.status === \"sign\") return step.challenge\n if (!prefetched || Date.now() - prefetched.fetchedAt >= CHALLENGE_MAX_AGE_MS) return null\n return prefetched.challenge\n }\n\n const handleSubmit = (e: React.FormEvent) => {\n e.preventDefault()\n if (busy || !activeAccount) return\n if (!username) return setUsernameError({ localName: username, message: \"Choose a username\" })\n if (formatError || availability?.status === \"taken\") return\n setError(null)\n setUsernameError(null)\n\n if (session.current) {\n setStep({ status: \"checking\" })\n create(session.current).catch(fail)\n return\n }\n\n const challenge = readyChallenge()\n if (challenge) {\n // Sign now, while the tap still counts as a user gesture. A challenge can only be used once.\n const signing = signLensChallenge(challenge, activeAccount)\n setPrefetched(null)\n setStep({ status: \"signing\" })\n continueWith(signing.then((signature) => authenticateOnboarding(client, challenge, signature)))\n return\n }\n\n // The challenge isn't ready yet: fetch it now. Desktop wallets sign without a user gesture;\n // on mobile it takes one more tap to open the wallet.\n setStep({ status: \"signing\" })\n continueWith((async () => {\n const fetched = await requestOnboardingChallenge(auth, client, ownerAddress)\n if (opensWalletWithDeepLink()) {\n setStep({ status: \"sign\", challenge: fetched })\n return null\n }\n const signature = await signLensChallenge(fetched, activeAccount)\n return authenticateOnboarding(client, fetched, signature)\n })())\n }\n\n const handlePictureChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const file = e.target.files?.[0] ?? null\n e.target.value = \"\"\n if (file && file.size > MAX_PICTURE_BYTES) return setError(\"Choose a picture under 10 MB\")\n setError(null)\n setPicture(file)\n }\n\n const usernameMessage = (() => {\n if (formatError) return { text: formatError, isError: true }\n if (usernameError?.localName === username) return { text: usernameError.message, isError: true }\n if (availability?.localName !== username) return null\n switch (availability.status) {\n case \"checking\": return { text: \"Checking availability…\", isError: false }\n case \"available\": return { text: \"Available\", isError: false }\n case \"taken\": return { text: \"This username is taken\", isError: true }\n default: return null\n }\n })()\n\n const fallbackInitial = (name.trim() || username || \"?\").charAt(0).toUpperCase()\n const usernameStatus = availability?.localName === username && !formatError ? availability.status : null\n\n return (\n <form className=\"py-4\" onSubmit={handleSubmit} noValidate>\n <FieldGroup className=\"gap-5\">\n <Field orientation=\"horizontal\">\n <Avatar className=\"size-16\">\n {pictureUrl && <AvatarImage src={pictureUrl} alt=\"\" className=\"object-cover\" />}\n <AvatarFallback className=\"text-lg font-semibold\">{fallbackInitial}</AvatarFallback>\n </Avatar>\n <FieldContent>\n <FieldLabel htmlFor=\"create-account-picture\">\n Profile picture <span className=\"font-normal text-muted-foreground\">(optional)</span>\n </FieldLabel>\n <div className=\"flex gap-2\">\n <Button type=\"button\" variant=\"outline\" size=\"sm\" onClick={() => pictureInput.current?.click()} disabled={busy}>\n {picture ? \"Change\" : \"Add photo\"}\n </Button>\n {picture && (\n <Button type=\"button\" variant=\"ghost\" size=\"sm\" onClick={() => setPicture(null)} disabled={busy}>\n Remove\n </Button>\n )}\n </div>\n </FieldContent>\n <input\n ref={pictureInput}\n id=\"create-account-picture\"\n type=\"file\"\n accept=\"image/*\"\n className=\"sr-only\"\n onChange={handlePictureChange}\n disabled={busy}\n />\n </Field>\n\n <Field data-invalid={usernameMessage?.isError || undefined}>\n <FieldLabel htmlFor=\"create-account-username\">Username</FieldLabel>\n <InputGroup>\n <InputGroupAddon>\n <InputGroupText>@</InputGroupText>\n </InputGroupAddon>\n <InputGroupInput\n id=\"create-account-username\"\n value={username}\n onChange={(e) => setUsername(e.target.value.trim().toLowerCase())}\n autoComplete=\"off\"\n autoCapitalize=\"none\"\n autoCorrect=\"off\"\n spellCheck={false}\n aria-invalid={usernameMessage?.isError || undefined}\n aria-describedby=\"create-account-username-status\"\n disabled={busy}\n />\n <InputGroupAddon align=\"inline-end\">\n {usernameStatus === \"checking\" && <Loader2 className=\"animate-spin\" />}\n {usernameStatus === \"available\" && <Check />}\n </InputGroupAddon>\n </InputGroup>\n {/* Always rendered with a fixed height, so the form doesn't shift as the feedback changes */}\n <FieldDescription\n id=\"create-account-username-status\"\n aria-live=\"polite\"\n className={cn(\"min-h-5 leading-5\", usernameMessage?.isError && \"text-destructive\")}\n >\n {usernameMessage?.text}\n </FieldDescription>\n </Field>\n\n <Field>\n <FieldLabel htmlFor=\"create-account-name\">\n Name <span className=\"font-normal text-muted-foreground\">(optional)</span>\n </FieldLabel>\n <Input id=\"create-account-name\" value={name} onChange={(e) => setName(e.target.value)} maxLength={100} disabled={busy} />\n </Field>\n\n <Field>\n <FieldLabel htmlFor=\"create-account-bio\">\n Bio <span className=\"font-normal text-muted-foreground\">(optional)</span>\n </FieldLabel>\n <Textarea\n id=\"create-account-bio\"\n value={bio}\n onChange={(e) => setBio(e.target.value)}\n maxLength={300}\n rows={3}\n className=\"resize-none\"\n disabled={busy}\n />\n </Field>\n\n <Field className=\"gap-2\">\n <Button type=\"submit\" className=\"w-full\" disabled={busy || !activeAccount}>\n {busy && <Loader2 className=\"animate-spin\" />}\n {step ? STEP_LABELS[step.status] : \"Create account\"}\n </Button>\n <FieldDescription aria-live=\"polite\" className={cn(\"min-h-5 leading-5\", error && \"text-destructive\")}>\n {error ?? (step?.status === \"sign\" ? \"Tap again to sign in your wallet.\" : \"You’ll sign a message in your wallet. It’s free.\")}\n </FieldDescription>\n {onBack && (\n <Button type=\"button\" variant=\"ghost\" className=\"w-full\" onClick={onBack} disabled={busy}>\n Back to your accounts\n </Button>\n )}\n </Field>\n </FieldGroup>\n </form>\n )\n}\n","import { clsx, type ClassValue } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","import * as React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"../utils\"\n\nconst buttonVariants = cva(\n \"cursor-pointer inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive\",\n {\n variants: {\n variant: {\n default:\n \"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90\",\n destructive:\n \"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60\",\n outline:\n \"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50\",\n secondary:\n \"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80\",\n ghost:\n \"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-9 px-4 py-2 has-[>svg]:px-3\",\n sm: \"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5\",\n lg: \"h-10 rounded-md px-6 has-[>svg]:px-4\",\n xl: \"h-[50px] rounded-md px-8 has-[>svg]:px-6\",\n icon: \"size-9\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nfunction Button({\n className,\n variant,\n size,\n asChild = false,\n ...props\n}: React.ComponentProps<\"button\"> &\n VariantProps<typeof buttonVariants> & {\n asChild?: boolean\n }) {\n const Comp = asChild ? Slot : \"button\"\n\n return (\n <Comp\n data-slot=\"button\"\n className={cn(buttonVariants({ variant, size, className }))}\n {...props}\n />\n )\n}\n\nexport { Button, buttonVariants }\n","import * as React from \"react\"\n\nimport { cn } from \"../utils\"\n\nfunction Input({ className, type, ...props }: React.ComponentProps<\"input\">) {\n return (\n <input\n type={type}\n data-slot=\"input\"\n className={cn(\n \"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n \"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]\",\n \"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Input }\n","import * as React from \"react\"\nimport { cn } from \"../utils\"\n\nfunction Textarea({ className, ...props }: React.ComponentProps<\"textarea\">) {\n return (\n <textarea\n data-slot=\"textarea\"\n className={cn(\n \"flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Textarea }\n","\"use client\"\n\nimport * as React from \"react\"\nimport * as AvatarPrimitive from \"@radix-ui/react-avatar\"\n\nimport { cn } from \"../utils\"\n\nfunction Avatar({\n className,\n ...props\n}: React.ComponentProps<typeof AvatarPrimitive.Root>) {\n return (\n <AvatarPrimitive.Root\n data-slot=\"avatar\"\n className={cn(\n \"relative flex size-8 shrink-0 overflow-hidden rounded-full\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AvatarImage({\n className,\n ...props\n}: React.ComponentProps<typeof AvatarPrimitive.Image>) {\n return (\n <AvatarPrimitive.Image\n data-slot=\"avatar-image\"\n className={cn(\"aspect-square size-full\", className)}\n {...props}\n />\n )\n}\n\nfunction AvatarFallback({\n className,\n ...props\n}: React.ComponentProps<typeof AvatarPrimitive.Fallback>) {\n return (\n <AvatarPrimitive.Fallback\n data-slot=\"avatar-fallback\"\n className={cn(\n \"bg-muted flex size-full items-center justify-center rounded-full\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Avatar, AvatarImage, AvatarFallback }\n","\"use client\"\n\nimport { useMemo } from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { cn } from \"../utils\"\n\nimport { Label } from \"./label\"\nimport { Separator } from \"./separator\"\n\nfunction FieldSet({ className, ...props }: React.ComponentProps<\"fieldset\">) {\n return (\n <fieldset\n data-slot=\"field-set\"\n className={cn(\n \"flex flex-col gap-6\",\n \"has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction FieldLegend({\n className,\n variant = \"legend\",\n ...props\n}: React.ComponentProps<\"legend\"> & { variant?: \"legend\" | \"label\" }) {\n return (\n <legend\n data-slot=\"field-legend\"\n data-variant={variant}\n className={cn(\n \"mb-3 font-medium\",\n \"data-[variant=legend]:text-base\",\n \"data-[variant=label]:text-sm\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction FieldGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"field-group\"\n className={cn(\n \"group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4\",\n className\n )}\n {...props}\n />\n )\n}\n\nconst fieldVariants = cva(\n \"group/field flex w-full gap-3 data-[invalid=true]:text-destructive\",\n {\n variants: {\n orientation: {\n vertical: [\"flex-col [&>*]:w-full [&>.sr-only]:w-auto\"],\n horizontal: [\n \"flex-row items-center\",\n \"[&>[data-slot=field-label]]:flex-auto\",\n \"has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px\",\n ],\n responsive: [\n \"flex-col @md/field-group:flex-row @md/field-group:items-center [&>*]:w-full @md/field-group:[&>*]:w-auto [&>.sr-only]:w-auto\",\n \"@md/field-group:[&>[data-slot=field-label]]:flex-auto\",\n \"@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px\",\n ],\n },\n },\n defaultVariants: {\n orientation: \"vertical\",\n },\n }\n)\n\nfunction Field({\n className,\n orientation = \"vertical\",\n ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof fieldVariants>) {\n return (\n <div\n role=\"group\"\n data-slot=\"field\"\n data-orientation={orientation}\n className={cn(fieldVariants({ orientation }), className)}\n {...props}\n />\n )\n}\n\nfunction FieldContent({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"field-content\"\n className={cn(\n \"group/field-content flex flex-1 flex-col gap-1.5 leading-snug\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction FieldLabel({\n className,\n ...props\n}: React.ComponentProps<typeof Label>) {\n return (\n <Label\n data-slot=\"field-label\"\n className={cn(\n \"group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50\",\n \"has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4\",\n \"has-data-[state=checked]:border-primary has-data-[state=checked]:bg-primary/5 dark:has-data-[state=checked]:bg-primary/10\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction FieldTitle({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"field-label\"\n className={cn(\n \"flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction FieldDescription({ className, ...props }: React.ComponentProps<\"p\">) {\n return (\n <p\n data-slot=\"field-description\"\n className={cn(\n \"text-sm leading-normal font-normal text-muted-foreground group-has-[[data-orientation=horizontal]]/field:text-balance\",\n \"last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5\",\n \"[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction FieldSeparator({\n children,\n className,\n ...props\n}: React.ComponentProps<\"div\"> & {\n children?: React.ReactNode\n}) {\n return (\n <div\n data-slot=\"field-separator\"\n data-content={!!children}\n className={cn(\n \"relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2\",\n className\n )}\n {...props}\n >\n <Separator className=\"absolute inset-0 top-1/2\" />\n {children && (\n <span\n className=\"relative mx-auto block w-fit bg-background px-2 text-muted-foreground\"\n data-slot=\"field-separator-content\"\n >\n {children}\n </span>\n )}\n </div>\n )\n}\n\nfunction FieldError({\n className,\n children,\n errors,\n ...props\n}: React.ComponentProps<\"div\"> & {\n errors?: Array<{ message?: string } | undefined>\n}) {\n const content = useMemo(() => {\n if (children) {\n return children\n }\n\n if (!errors?.length) {\n return null\n }\n\n const uniqueErrors = [\n ...new Map(errors.map((error) => [error?.message, error])).values(),\n ]\n\n if (uniqueErrors?.length == 1) {\n return uniqueErrors[0]?.message\n }\n\n return (\n <ul className=\"ml-4 flex list-disc flex-col gap-1\">\n {uniqueErrors.map(\n (error, index) =>\n error?.message && <li key={index}>{error.message}</li>\n )}\n </ul>\n )\n }, [children, errors])\n\n if (!content) {\n return null\n }\n\n return (\n <div\n role=\"alert\"\n data-slot=\"field-error\"\n className={cn(\"text-sm font-normal text-destructive\", className)}\n {...props}\n >\n {content}\n </div>\n )\n}\n\nexport {\n Field,\n FieldLabel,\n FieldDescription,\n FieldError,\n FieldGroup,\n FieldLegend,\n FieldSeparator,\n FieldSet,\n FieldContent,\n FieldTitle,\n}\n","\"use client\"\n\nimport * as React from \"react\"\nimport { cn } from \"../utils\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\n\nfunction Label({\n className,\n ...props\n}: React.ComponentProps<typeof LabelPrimitive.Root>) {\n return (\n <LabelPrimitive.Root\n data-slot=\"label\"\n className={cn(\n \"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Label }\n","\"use client\"\n\nimport * as React from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { cn } from \"../utils\"\n\nimport { Button } from \"./button\"\nimport { Input } from \"./input\"\nimport { Textarea } from \"./textarea\"\n\nfunction InputGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"input-group\"\n role=\"group\"\n className={cn(\n \"group/input-group relative flex w-full items-center rounded-md border border-input shadow-xs transition-[color,box-shadow] outline-none dark:bg-input/30\",\n \"h-9 min-w-0 has-[>textarea]:h-auto\",\n\n // Variants based on alignment.\n \"has-[>[data-align=inline-start]]:[&>input]:pl-2\",\n \"has-[>[data-align=inline-end]]:[&>input]:pr-2\",\n \"has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3\",\n \"has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3\",\n\n // Focus state.\n \"has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-[3px] has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50\",\n\n // Error state.\n \"has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40\",\n\n className\n )}\n {...props}\n />\n )\n}\n\nconst inputGroupAddonVariants = cva(\n \"flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4\",\n {\n variants: {\n align: {\n \"inline-start\":\n \"order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]\",\n \"inline-end\":\n \"order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]\",\n \"block-start\":\n \"order-first w-full justify-start px-3 pt-3 group-has-[>input]/input-group:pt-2.5 [.border-b]:pb-3\",\n \"block-end\":\n \"order-last w-full justify-start px-3 pb-3 group-has-[>input]/input-group:pb-2.5 [.border-t]:pt-3\",\n },\n },\n defaultVariants: {\n align: \"inline-start\",\n },\n }\n)\n\nfunction InputGroupAddon({\n className,\n align = \"inline-start\",\n ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof inputGroupAddonVariants>) {\n return (\n <div\n role=\"group\"\n data-slot=\"input-group-addon\"\n data-align={align}\n className={cn(inputGroupAddonVariants({ align }), className)}\n onClick={(e) => {\n if ((e.target as HTMLElement).closest(\"button\")) {\n return\n }\n e.currentTarget.parentElement?.querySelector(\"input\")?.focus()\n }}\n {...props}\n />\n )\n}\n\nconst inputGroupButtonVariants = cva(\n \"flex items-center gap-2 text-sm shadow-none\",\n {\n variants: {\n size: {\n xs: \"h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-2 has-[>svg]:px-2 [&>svg:not([class*='size-'])]:size-3.5\",\n sm: \"h-8 gap-1.5 rounded-md px-2.5 has-[>svg]:px-2.5\",\n \"icon-xs\":\n \"size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0\",\n \"icon-sm\": \"size-8 p-0 has-[>svg]:p-0\",\n },\n },\n defaultVariants: {\n size: \"xs\",\n },\n }\n)\n\nfunction InputGroupButton({\n className,\n type = \"button\",\n variant = \"ghost\",\n size = \"xs\",\n ...props\n}: Omit<React.ComponentProps<typeof Button>, \"size\"> &\n VariantProps<typeof inputGroupButtonVariants>) {\n return (\n <Button\n type={type}\n data-size={size}\n variant={variant}\n className={cn(inputGroupButtonVariants({ size }), className)}\n {...props}\n />\n )\n}\n\nfunction InputGroupText({ className, ...props }: React.ComponentProps<\"span\">) {\n return (\n <span\n className={cn(\n \"flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction InputGroupInput({\n className,\n ...props\n}: React.ComponentProps<\"input\">) {\n return (\n <Input\n data-slot=\"input-group-control\"\n className={cn(\n \"flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction InputGroupTextarea({\n className,\n ...props\n}: React.ComponentProps<\"textarea\">) {\n return (\n <Textarea\n data-slot=\"input-group-control\"\n className={cn(\n \"flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport {\n InputGroup,\n InputGroupAddon,\n InputGroupButton,\n InputGroupText,\n InputGroupInput,\n InputGroupTextarea,\n}\n","import * as React from \"react\"\n\nexport function useMediaQuery(query: string): boolean {\n return React.useSyncExternalStore(\n (onChange) => {\n const media = window.matchMedia(query)\n media.addEventListener(\"change\", onChange)\n return () => media.removeEventListener(\"change\", onChange)\n },\n () => window.matchMedia(query).matches,\n () => false,\n )\n}\n\n// The page's theme: a `dark` or `light` class on <html> (as next-themes and shadcn set it), otherwise\n// the system preference.\nfunction readTheme(): \"light\" | \"dark\" {\n const classes = document.documentElement.classList\n if (classes.contains(\"dark\")) return \"dark\"\n if (classes.contains(\"light\")) return \"light\"\n return window.matchMedia(\"(prefers-color-scheme: dark)\").matches ? \"dark\" : \"light\"\n}\n\nexport function useDocumentTheme(): \"light\" | \"dark\" {\n return React.useSyncExternalStore(\n (onChange) => {\n const observer = new MutationObserver(onChange)\n observer.observe(document.documentElement, { attributes: true, attributeFilter: [\"class\"] })\n const media = window.matchMedia(\"(prefers-color-scheme: dark)\")\n media.addEventListener(\"change\", onChange)\n return () => {\n observer.disconnect()\n media.removeEventListener(\"change\", onChange)\n }\n },\n readTheme,\n () => \"light\",\n )\n}\n","\"use client\"\n\nimport * as React from \"react\"\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\"\nimport { XIcon } from \"lucide-react\"\n\nimport { cn } from \"../utils\"\n\nfunction Dialog({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root data-slot=\"dialog\" {...props} />\n}\n\nfunction DialogTrigger({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />\n}\n\nfunction DialogPortal({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />\n}\n\nfunction DialogClose({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />\n}\n\nfunction DialogOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DialogContent({\n className,\n children,\n showCloseButton = true,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Content> & {\n showCloseButton?: boolean\n}) {\n return (\n <DialogPortal data-slot=\"dialog-portal\">\n <DialogOverlay />\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n \"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg\",\n className\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n className=\"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\"\n >\n <XIcon />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n )\n}\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn(\"flex flex-col gap-2 text-center sm:text-left\", className)}\n {...props}\n />\n )\n}\n\nfunction DialogFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\n \"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DialogTitle({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn(\"text-lg leading-none font-semibold\", className)}\n {...props}\n />\n )\n}\n\nfunction DialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n )\n}\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n}\n","\"use client\"\n\nimport * as React from \"react\"\nimport { Drawer as DrawerPrimitive } from \"vaul\"\n\nimport { cn } from \"../utils\"\n\nfunction Drawer({\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Root>) {\n return <DrawerPrimitive.Root data-slot=\"drawer\" {...props} />\n}\n\nfunction DrawerTrigger({\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Trigger>) {\n return <DrawerPrimitive.Trigger data-slot=\"drawer-trigger\" {...props} />\n}\n\nfunction DrawerPortal({\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Portal>) {\n return <DrawerPrimitive.Portal data-slot=\"drawer-portal\" {...props} />\n}\n\nfunction DrawerClose({\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Close>) {\n return <DrawerPrimitive.Close data-slot=\"drawer-close\" {...props} />\n}\n\nfunction DrawerOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Overlay>) {\n return (\n <DrawerPrimitive.Overlay\n data-slot=\"drawer-overlay\"\n className={cn(\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DrawerContent({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Content>) {\n return (\n <DrawerPortal data-slot=\"drawer-portal\">\n <DrawerOverlay />\n <DrawerPrimitive.Content\n data-slot=\"drawer-content\"\n className={cn(\n \"group/drawer-content bg-background fixed z-50 flex h-auto flex-col\",\n \"data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b\",\n \"data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t\",\n \"data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm\",\n \"data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm\",\n className\n )}\n {...props}\n >\n <div className=\"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPortal>\n )\n}\n\nfunction DrawerHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"drawer-header\"\n className={cn(\n \"flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DrawerFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"drawer-footer\"\n className={cn(\"mt-auto flex flex-col gap-2 p-4\", className)}\n {...props}\n />\n )\n}\n\nfunction DrawerTitle({\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Title>) {\n return (\n <DrawerPrimitive.Title\n data-slot=\"drawer-title\"\n className={cn(\"text-foreground font-semibold\", className)}\n {...props}\n />\n )\n}\n\nfunction DrawerDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Description>) {\n return (\n <DrawerPrimitive.Description\n data-slot=\"drawer-description\"\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n )\n}\n\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n}\n","import * as React from \"react\"\nimport type { ConnectButtonProps } from \"thirdweb/react\"\nimport { useLensAuth } from \"./provider\"\nimport { useDocumentTheme } from \"./dom\"\nimport { Button } from \"./ui/button\"\nimport { cn } from \"./utils\"\n\n// thirdweb's ConnectButton pulls in ~480KB (gzipped) of wallet SDKs (WalletConnect, Coinbase, ...).\n// Loading it on demand keeps that out of every page's initial bundle, so pages hydrate without\n// waiting for it.\nconst ConnectButton = React.lazy(() => import(\"thirdweb/react\").then((m) => ({ default: m.ConnectButton })))\n\nexport type SignInButtonProps = {\n /** Defaults to \"Sign in\" */\n label?: React.ReactNode\n /** Defaults to \"Logout\" */\n signOutLabel?: React.ReactNode\n /** thirdweb modal theme. Defaults to the page's theme (a `dark` class on <html>, or the system's). */\n theme?: \"light\" | \"dark\"\n /** Classes for the placeholder and sign-out buttons. Size the button's wrapper to size them all alike. */\n className?: string\n /** Extra props for thirdweb's ConnectButton (wallets, connectModal, ...) */\n connectButtonProps?: Partial<Omit<ConnectButtonProps, \"client\" | \"chain\" | \"theme\">>\n}\n\n// Connects a wallet (the account dialog then opens to pick or create a Lens account) and signs out.\nexport function SignInButton({ label = \"Sign in\", signOutLabel = \"Logout\", theme, className, connectButtonProps }: SignInButtonProps) {\n const { auth, wallet, status, signOut } = useLensAuth()\n const documentTheme = useDocumentTheme()\n const [mounted, setMounted] = React.useState(false)\n React.useEffect(() => setMounted(true), [])\n\n // Same size as the real button, so nothing shifts when it loads\n const placeholder = (\n <Button variant=\"outline\" size=\"xl\" className={cn(\"min-w-[165px] px-0\", className)} disabled>\n Loading...\n </Button>\n )\n\n // thirdweb's ConnectButton doesn't render the same on the server and the client\n if (!mounted) return placeholder\n\n if (!wallet) {\n return (\n <React.Suspense fallback={placeholder}>\n <ConnectButton\n client={auth.thirdwebClient}\n chain={auth.chain}\n theme={theme ?? documentTheme}\n {...connectButtonProps}\n connectButton={{\n label,\n ...connectButtonProps?.connectButton,\n style: { height: \"50px\", minWidth: \"165px\", ...connectButtonProps?.connectButton?.style },\n }}\n />\n </React.Suspense>\n )\n }\n\n if (status !== \"signed-in\") return placeholder\n\n return (\n <Button variant=\"ghost\" size=\"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A;AAAA,QACC,QAAQ,KAAK;AAAA,QACb,OAAO,KAAK;AAAA,QACZ,OAAO,SAAS;AAAA,QACf,GAAG;AAAA,QACJ,eAAe;AAAA,UACb;AAAA,UACA,GAAG,oBAAoB;AAAA,UACvB,OAAO,EAAE,QAAQ,QAAQ,UAAU,SAAS,GAAG,oBAAoB,eAAe,MAAM;AAAA,QAC1F;AAAA;AAAA,IACF,GACF;AAAA,EAEJ;AAEA,MAAI,WAAW,YAAa,QAAO;AAEnC,SACE,gBAAAA,MAAC,UAAO,SAAQ,SAAQ,MAAK,MAAK,WAAW,GAAG,sBAAsB,SAAS,GAAG,SAAS,SACxF,wBACH;AAEJ;","names":["React","useActiveAccount","useActiveWallet","React","Loader2","jsx","jsx","jsx","cva","jsx","jsx","jsx","cva","jsx","cva","jsx","cva","jsx","jsx","jsxs","React","jsx","jsxs","jsx","jsx","jsxs","jsx","jsx","jsxs","jsx","jsx","jsxs","jsx","jsx","jsxs","Title","Description","Loader2","jsx","jsxs","useActiveAccount","useActiveWallet","React","jsx"]}
1
+ {"version":3,"sources":["../../src/react/provider.tsx","../../src/react/AccountDialog.tsx","../../src/react/CreateAccountForm.tsx","../../src/react/utils.ts","../../src/react/ui/button.tsx","../../src/react/ui/input.tsx","../../src/react/ui/textarea.tsx","../../src/react/ui/avatar.tsx","../../src/react/ui/field.tsx","../../src/react/ui/label.tsx","../../src/react/ui/input-group.tsx","../../src/react/dom.ts","../../src/react/ui/dialog.tsx","../../src/react/ui/drawer.tsx","../../src/react/SignInButton.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { LensProvider } from \"@lens-protocol/react\"\nimport { ThirdwebProvider, useActiveAccount, useActiveWallet, useDisconnect } from \"thirdweb/react\"\nimport type { Account as ThirdwebAccount, Wallet } from \"thirdweb/wallets\"\nimport { ConvexProviderWithAuth, useConvexAuth, type ConvexReactClient } from \"convex/react\"\nimport type { LensAuth } from \"../core/auth\"\nimport { TOKENS_CHANGED_EVENT } from \"../core/tokens\"\nimport { AccountDialog } from \"./AccountDialog\"\n\nexport type SignedInAccount = {\n /** Lens account address, lowercased */\n address: string\n /** Lens username (local name), when known */\n username: string | null\n}\n\nexport type LensAuthStatus =\n /** Reading the stored session (first render, and during SSR) */\n | \"loading\"\n /** No wallet and no Lens session */\n | \"signed-out\"\n /** Wallet connected, no Lens account signed in yet: the account dialog is open */\n | \"choosing-account\"\n /** Signed in to a Lens account (Convex is authenticated as it too) */\n | \"signed-in\"\n\nexport type LensAuthContextValue = {\n auth: LensAuth\n status: LensAuthStatus\n isLoading: boolean\n isSignedIn: boolean\n /** The connected thirdweb wallet account */\n wallet: ThirdwebAccount | undefined\n /** The signed-in Lens account */\n account: SignedInAccount | null\n /** Ends the Lens session and disconnects the wallet */\n signOut: () => Promise<void>\n /** Opens the account dialog, e.g. to switch to another account */\n openAccountDialog: () => void\n}\n\nexport type AccountDialogHeader = {\n /** \"Select Account\", or \"Create Account\" while the form to create one is shown */\n title: string\n description: string\n}\n\nexport type AccountDialogControls = AccountDialogHeader & {\n open: boolean\n /** True while a wallet is connected without a Lens session: the dialog can't be dismissed */\n required: boolean\n setOpen: (open: boolean) => void\n}\n\ntype AccountDialogState = AccountDialogControls & {\n setHeader: (header: AccountDialogHeader) => void\n completeSignIn: (account: SignedInAccount) => void\n}\n\nconst DEFAULT_HEADER: AccountDialogHeader = { title: \"Select Account\", description: \"Select an account to continue.\" }\n\nconst LensAuthContext = React.createContext<LensAuthContextValue | null>(null)\nconst AccountDialogContext = React.createContext<AccountDialogState | null>(null)\n\nexport function useLensAuth(): LensAuthContextValue {\n const ctx = React.useContext(LensAuthContext)\n if (!ctx) throw new Error(\"useLensAuth must be used within <LensAuthProvider>\")\n return ctx\n}\n\nexport function useAccountDialogState(): AccountDialogState {\n const ctx = React.useContext(AccountDialogContext)\n if (!ctx) throw new Error(\"<AccountDialog> must be used within <LensAuthProvider>\")\n return ctx\n}\n\n// The account dialog's state, to render <AccountPicker /> in your own dialog (with accountDialog={false})\nexport function useAccountDialog(): AccountDialogControls {\n const { open, required, setOpen, title, description } = useAccountDialogState()\n return { open, required, setOpen, title, description }\n}\n\nfunction subscribeToTokens(onChange: () => void) {\n window.addEventListener(TOKENS_CHANGED_EVENT, onChange)\n // Signing in or out in another tab\n window.addEventListener(\"storage\", onChange)\n return () => {\n window.removeEventListener(TOKENS_CHANGED_EVENT, onChange)\n window.removeEventListener(\"storage\", onChange)\n }\n}\n\n// Identifies the stored Lens session: its id plus the account it acts for. Token refreshes keep it the\n// same; signing in again, or as another account, changes it. Undefined until read on the client.\nfunction useSessionKey(auth: LensAuth): string | null | undefined {\n return React.useSyncExternalStore(\n subscribeToTokens,\n () => {\n const session = auth.getSession()\n return session ? `${session.sessionId}:${session.account}` : null\n },\n () => undefined,\n )\n}\n\n// Signs Convex in as the Lens account the user signed in with. A new session gets a new\n// fetchAccessToken, which makes Convex fetch its token again.\nfunction createUseConvexAuth(auth: LensAuth) {\n return function useLensConvexAuth() {\n const sessionKey = useSessionKey(auth)\n const fetchAccessToken = React.useCallback(\n async ({ forceRefreshToken }: { forceRefreshToken: boolean }) =>\n sessionKey ? auth.fetchConvexToken(forceRefreshToken) : null,\n [sessionKey],\n )\n return { isLoading: sessionKey === undefined, isAuthenticated: !!sessionKey, fetchAccessToken }\n }\n}\n\nexport type LensAuthProviderProps = {\n /** From createLensAuth(), created once at module level */\n auth: LensAuth\n /** Your ConvexReactClient. Omit to use the package without Convex. */\n convex?: ConvexReactClient\n /**\n * Called after the user signs in from the account dialog (picking an account or creating one), once\n * Convex accepts the session. A good place to create the user's row: `convex.mutation(api.users.ensure)`\n */\n onSignIn?: (account: SignedInAccount) => void | Promise<void>\n /** Render the account dialog. Set to false to render <AccountDialog /> yourself. Defaults to true. */\n accountDialog?: boolean\n /**\n * Wallets to reconnect after a reload while a Lens session is stored. Pass the same list as\n * SignInButton's `connectButtonProps.wallets`, if you customize it. Defaults to thirdweb's wallets.\n */\n wallets?: Wallet[]\n children: React.ReactNode\n}\n\n// thirdweb's AutoConnect (loaded on demand, like the ConnectButton) reconnects the last wallet\nconst AutoConnect = React.lazy(() => import(\"thirdweb/react\").then((m) => ({ default: m.AutoConnect })))\n\n// Wraps the app in thirdweb, Lens and (optionally) Convex providers wired to one session.\nexport function LensAuthProvider({ auth, convex, onSignIn, accountDialog = true, wallets, children }: LensAuthProviderProps) {\n const [useConvexAuthHook] = React.useState(() => createUseConvexAuth(auth))\n const content = (\n <LensAuthState auth={auth} onSignIn={onSignIn} withConvex={!!convex} wallets={wallets}>\n {children}\n {accountDialog && <AccountDialog />}\n </LensAuthState>\n )\n return (\n <ThirdwebProvider>\n <LensProvider client={auth.lensClient}>\n {convex ? (\n <ConvexProviderWithAuth client={convex} useAuth={useConvexAuthHook}>\n {content}\n </ConvexProviderWithAuth>\n ) : content}\n </LensProvider>\n </ThirdwebProvider>\n )\n}\n\nfunction readSelectedAccount(auth: LensAuth, address: string): string | null {\n try {\n const stored = JSON.parse(localStorage.getItem(`${auth.storagePrefix}account`) ?? \"null\")\n return stored?.address === address && typeof stored.username === \"string\" ? stored.username : null\n } catch {\n return null\n }\n}\n\nfunction writeSelectedAccount(auth: LensAuth, account: SignedInAccount | null) {\n try {\n const key = `${auth.storagePrefix}account`\n if (account) localStorage.setItem(key, JSON.stringify(account))\n else localStorage.removeItem(key)\n } catch {}\n}\n\nfunction LensAuthState({ auth, onSignIn, withConvex, wallets, children }: {\n auth: LensAuth\n onSignIn?: LensAuthProviderProps[\"onSignIn\"]\n withConvex: boolean\n wallets?: Wallet[]\n children: React.ReactNode\n}) {\n const wallet = useActiveAccount()\n const activeWallet = useActiveWallet()\n const { disconnect } = useDisconnect()\n const sessionKey = useSessionKey(auth)\n const [manualOpen, setManualOpen] = React.useState(false)\n const [header, setHeader] = React.useState(DEFAULT_HEADER)\n const [pendingSignIn, setPendingSignIn] = React.useState<SignedInAccount | null>(null)\n\n const account = React.useMemo<SignedInAccount | null>(() => {\n if (!sessionKey) return null\n const address = sessionKey.slice(sessionKey.lastIndexOf(\":\") + 1)\n return { address, username: readSelectedAccount(auth, address) }\n }, [auth, sessionKey])\n\n const status: LensAuthStatus =\n sessionKey === undefined ? \"loading\"\n : sessionKey ? \"signed-in\"\n : wallet ? \"choosing-account\"\n : \"signed-out\"\n\n useBackgroundRefresh(auth)\n\n // A connected wallet checks the stored session is still valid (refreshing it or clearing it)\n React.useEffect(() => {\n if (wallet) void auth.resumeSession().catch(() => {})\n }, [auth, wallet?.address])\n\n const signOut = React.useCallback(async () => {\n setManualOpen(false)\n writeSelectedAccount(auth, null)\n // Both clear their state synchronously (logout before its first await), so the next render sees\n // neither. A wallet left without a session would open the account dialog while logout() waits on\n // the network, and a session left without a wallet would reconnect it (see AutoConnect below).\n if (activeWallet) disconnect(activeWallet)\n await auth.logout()\n }, [auth, activeWallet, disconnect])\n\n const value = React.useMemo<LensAuthContextValue>(() => ({\n auth,\n status,\n isLoading: status === \"loading\",\n isSignedIn: status === \"signed-in\",\n wallet,\n account,\n signOut,\n openAccountDialog: () => setManualOpen(true),\n }), [auth, status, wallet, account, signOut])\n\n const required = status === \"choosing-account\"\n const dialog = React.useMemo<AccountDialogState>(() => ({\n open: required || (manualOpen && !!wallet),\n required,\n ...header,\n setHeader,\n setOpen: (open) => {\n if (open) setManualOpen(true)\n else if (!required) setManualOpen(false)\n },\n completeSignIn: (signedIn) => {\n writeSelectedAccount(auth, signedIn)\n setManualOpen(false)\n if (onSignIn) setPendingSignIn(signedIn)\n },\n }), [auth, required, manualOpen, wallet, header, onSignIn])\n\n return (\n <LensAuthContext.Provider value={value}>\n <AccountDialogContext.Provider value={dialog}>\n {children}\n {/* After a reload the Lens session is restored from storage, but the wallet only comes back if\n something reconnects it: SignInButton's ConnectButton does, but it's only shown while no\n wallet is connected and apps often hide it once signed in. */}\n {sessionKey && !wallet && (\n <React.Suspense fallback={null}>\n <AutoConnect client={auth.thirdwebClient} chain={auth.chain} wallets={wallets} />\n </React.Suspense>\n )}\n {pendingSignIn && onSignIn && (\n withConvex\n ? <ConvexSignInCallback account={pendingSignIn} onSignIn={onSignIn} done={() => setPendingSignIn(null)} />\n : <SignInCallback account={pendingSignIn} onSignIn={onSignIn} done={() => setPendingSignIn(null)} />\n )}\n </AccountDialogContext.Provider>\n </LensAuthContext.Provider>\n )\n}\n\ntype SignInCallbackProps = {\n account: SignedInAccount\n onSignIn: NonNullable<LensAuthProviderProps[\"onSignIn\"]>\n done: () => void\n}\n\nfunction SignInCallback({ account, onSignIn, done }: SignInCallbackProps) {\n React.useEffect(() => {\n Promise.resolve(onSignIn(account)).catch((err) => console.error(\"lens-convex-auth: onSignIn failed\", err)).finally(done)\n }, [account])\n return null\n}\n\n// Waits until Convex accepts the new session, so onSignIn can call authenticated Convex functions\nfunction ConvexSignInCallback(props: SignInCallbackProps) {\n const { isAuthenticated, isLoading } = useConvexAuth()\n return isAuthenticated && !isLoading ? <SignInCallback {...props} /> : null\n}\n\n// Refreshes the tokens a minute before they expire, so Convex and API calls always have a fresh one\nfunction useBackgroundRefresh(auth: LensAuth) {\n React.useEffect(() => {\n let timeout: ReturnType<typeof setTimeout> | undefined\n let stopped = false\n\n // Runs again whenever tokens are stored or cleared (a sign-in, a refresh, another tab)\n const schedule = () => {\n if (timeout) clearTimeout(timeout)\n timeout = undefined\n const tokens = auth.tokens.getStoredTokens()\n if (stopped || !tokens?.expiresAt) return\n const delay = Math.max(1000, tokens.expiresAt - Date.now() - 60 * 1000)\n timeout = setTimeout(() => void auth.tokens.refreshTokens(), delay)\n }\n\n const unsubscribe = subscribeToTokens(schedule)\n ;(async () => {\n try {\n await auth.resumeSession()\n } catch {}\n schedule()\n })()\n\n return () => {\n stopped = true\n unsubscribe()\n if (timeout) clearTimeout(timeout)\n }\n }, [auth])\n}\n","import * as React from \"react\"\nimport { useAccountsAvailable } from \"@lens-protocol/react\"\nimport { evmAddress, type Account, type AccountAvailable } from \"@lens-protocol/client\"\nimport type { Account as ThirdwebAccount } from \"thirdweb/wallets\"\nimport { Loader2 } from \"lucide-react\"\nimport { CHALLENGE_MAX_AGE_MS, CHALLENGE_REFRESH_MS, opensWalletWithDeepLink, type LensAuth, type LensChallenge } from \"../core/auth\"\nimport { fetchAccountUsername } from \"../core/onboarding\"\nimport { useAccountDialog, useAccountDialogState, useLensAuth } from \"./provider\"\nimport { CreateAccountForm, type CreatedAccount } from \"./CreateAccountForm\"\nimport { useMediaQuery } from \"./dom\"\nimport { Button } from \"./ui/button\"\nimport { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from \"./ui/dialog\"\nimport { Drawer, DrawerContent, DrawerDescription, DrawerHeader, DrawerTitle } from \"./ui/drawer\"\n\n// Lists the wallet's Lens accounts to sign in with, or the form to create one. Opens by itself when a\n// wallet connects without a Lens session, and can't be dismissed until an account is signed in to (or\n// the wallet disconnects). A dialog on desktop, a drawer on mobile.\nexport function AccountDialog() {\n const { signOut } = useLensAuth()\n const { open, required, setOpen, title, description } = useAccountDialog()\n const isDesktop = useMediaQuery(\"(min-width: 768px)\")\n\n const handleOpenChange = (next: boolean) => {\n if (!next && required) return\n setOpen(next)\n }\n\n const leave = (\n // Without a Lens session there's only the wallet to disconnect; when switching accounts, it logs out too\n <Button onClick={signOut} variant=\"ghost\" className=\"w-full\">\n {required ? \"Disconnect Wallet\" : \"Log Out\"}\n </Button>\n )\n\n if (isDesktop) {\n return (\n <Dialog open={open} onOpenChange={handleOpenChange}>\n <DialogContent\n className=\"sm:max-w-[425px] max-h-[80vh] overflow-y-auto\"\n showCloseButton={!required}\n onEscapeKeyDown={(e) => required && e.preventDefault()}\n onPointerDownOutside={(e) => required && e.preventDefault()}\n >\n <DialogHeader>\n <DialogTitle>{title}</DialogTitle>\n <DialogDescription>{description}</DialogDescription>\n </DialogHeader>\n <AccountPicker actions={leave} />\n </DialogContent>\n </Dialog>\n )\n }\n\n return (\n <Drawer open={open} onOpenChange={handleOpenChange} dismissible={!required}>\n <DrawerContent className=\"max-h-[80vh] overflow-y-auto\">\n <DrawerHeader className=\"text-left\">\n <DrawerTitle>{title}</DrawerTitle>\n <DrawerDescription>{description}</DrawerDescription>\n </DrawerHeader>\n <div className=\"px-4 pb-4\">\n <AccountPicker actions={leave} />\n </div>\n </DrawerContent>\n </Drawer>\n )\n}\n\n// The account dialog's content without the dialog: the account list, or the form to create one. Render it\n// in your own dialog along with useAccountDialog(), which has its title. It has no horizontal padding.\n// `actions` (e.g. a button to sign out) go in its button group, under \"Create a new account\" or the form's.\nexport function AccountPicker({ actions }: { actions?: React.ReactNode }) {\n const { wallet } = useLensAuth()\n const { open } = useAccountDialogState()\n const [creating, setCreating] = React.useState(false)\n\n // Show the account list again the next time the dialog opens\n React.useEffect(() => {\n if (!open) setCreating(false)\n }, [open])\n\n if (!wallet) return null\n return <AccountPickerBody key={wallet.address} wallet={wallet} creating={creating} setCreating={setCreating} actions={actions} />\n}\n\nfunction AccountPickerBody({ wallet, creating, setCreating, actions }: {\n wallet: ThirdwebAccount\n creating: boolean\n setCreating: (creating: boolean) => void\n actions?: React.ReactNode\n}) {\n const { auth } = useLensAuth()\n const { completeSignIn, setHeader } = useAccountDialogState()\n const { data, loading: loadingAccounts } = useAccountsAvailable({ managedBy: evmAddress(wallet.address), includeOwned: true })\n const accounts = data?.items\n const usernames = useAccountUsernames(auth, accounts)\n const loading = loadingAccounts || (!!accounts && !usernames)\n const usernameOf = React.useCallback((acc: Account) => {\n const resolved = usernames?.[acc.address.toLowerCase()]\n return resolved === undefined ? acc.username?.localName ?? null : resolved\n }, [usernames])\n // Accounts without a username aren't listed, so they don't count\n const hasAccounts = !loading && !!accounts?.some((item) => usernameOf(item.account))\n // Wallets without an account go straight to creating one\n const showCreate = creating || (!loading && !hasAccounts)\n\n const signIn = async (account: SelectableAccount, challenge: LensChallenge) => {\n // The signature request goes out before the first await, so a click handler calling this keeps its\n // user gesture, which mobile wallets need to open (see signLensChallenge).\n const signature = await auth.signChallenge(challenge, wallet)\n await auth.authenticate(challenge, signature)\n completeSignIn({ address: account.address.toLowerCase(), username: usernameOf(account) })\n }\n\n const handleCreated = async (created: CreatedAccount) => {\n completeSignIn({ address: created.address.toLowerCase(), username: created.localName })\n }\n\n const title = showCreate ? \"Create Account\" : \"Select Account\"\n const description = showCreate\n ? hasAccounts ? \"Pick a username for your new Lens account.\" : \"You don’t have a Lens account yet. Create one to continue.\"\n : \"Select an account to continue.\"\n\n // The dialog around the picker shows these, so they're set before it paints\n React.useLayoutEffect(() => {\n setHeader({ title, description })\n }, [setHeader, title, description])\n\n return showCreate ? (\n <CreateAccountForm\n ownerAddress={wallet.address}\n onCreated={handleCreated}\n onBack={hasAccounts ? () => setCreating(false) : undefined}\n actions={actions}\n />\n ) : (\n <AccountList auth={auth} accounts={accounts} usernameOf={usernameOf} loading={loading} ownerAddress={wallet.address} onSign={signIn} onCreate={() => setCreating(true)} actions={actions} />\n )\n}\n\n// Each account's username by lowercased address (see fetchAccountUsername), or undefined while they load.\n// An account whose lookup failed is left out, so it falls back to its global Lens username.\nfunction useAccountUsernames(auth: LensAuth, accounts?: readonly AccountAvailable[]) {\n const key = accounts?.map((item) => item.account.address.toLowerCase()).join(\",\")\n const [usernames, setUsernames] = React.useState<{ key: string; byAddress: Record<string, string | null> } | null>(null)\n\n React.useEffect(() => {\n if (key === undefined) return\n let cancelled = false\n const addresses = key ? key.split(\",\") : []\n Promise.all(addresses.map((address) =>\n fetchAccountUsername(auth, address).then((username) => [[address, username] as const], () => []),\n )).then((entries) => {\n if (!cancelled) setUsernames({ key, byAddress: Object.fromEntries(entries.flat()) })\n })\n return () => {\n cancelled = true\n }\n }, [auth, key])\n\n return usernames && usernames.key === key ? usernames.byAddress : undefined\n}\n\ntype SelectableAccount = Account & { isOwner: boolean }\n\ntype SignInStep =\n | { id: string; status: \"loading\" }\n | { id: string; status: \"sign\"; challenge: LensChallenge }\n\ntype PrefetchedChallenge = { owner: string; challenge: LensChallenge; fetchedAt: number }\n\nfunction fetchChallenge(auth: LensAuth, acc: SelectableAccount, ownerAddress: string) {\n return auth.requestChallenge({\n role: acc.isOwner ? \"ACCOUNT_OWNER\" : \"ACCOUNT_MANAGER\",\n account: acc.address,\n signer: ownerAddress,\n })\n}\n\nfunction AccountList({ auth, accounts, usernameOf, loading, ownerAddress, onSign, onCreate, actions }: {\n auth: LensAuth\n accounts?: readonly AccountAvailable[]\n usernameOf: (account: Account) => string | null\n loading: boolean\n ownerAddress: string\n onSign: (account: SelectableAccount, challenge: LensChallenge) => Promise<void>\n onCreate: () => void\n actions?: React.ReactNode\n}) {\n const [step, setStep] = React.useState<SignInStep | null>(null)\n const [errorId, setErrorId] = React.useState<string | null>(null)\n const [challenges, setChallenges] = React.useState<Record<string, PrefetchedChallenge>>({})\n\n const selectable = React.useMemo(() => (accounts ?? []).map((item, index) => {\n const acc: SelectableAccount = { ...item.account, isOwner: item.__typename === \"AccountOwned\" }\n return { acc, id: `${acc.address}-${index}` }\n }), [accounts])\n\n const prefetch = React.useCallback((acc: SelectableAccount, id: string) => {\n fetchChallenge(auth, acc, ownerAddress)\n .then((challenge) => setChallenges((prev) => ({ ...prev, [id]: { owner: ownerAddress, challenge, fetchedAt: Date.now() } })))\n .catch(() => {})\n }, [auth, ownerAddress])\n\n // Accounts can share a username across namespaces: those get their shortened address too\n const sharedUsernames = React.useMemo(() => {\n const counts = new Map<string, number>()\n for (const { acc } of selectable) {\n const username = usernameOf(acc)\n if (username) counts.set(username, (counts.get(username) ?? 0) + 1)\n }\n return new Set([...counts].filter(([, count]) => count > 1).map(([username]) => username))\n }, [selectable, usernameOf])\n\n // Fetch each account's challenge ahead of time, so a tap can ask the wallet to sign right away:\n // on mobile that tap is what lets the wallet app open (see opensWalletWithDeepLink).\n React.useEffect(() => {\n const refresh = () => {\n if (document.visibilityState !== \"visible\") return\n for (const { acc, id } of selectable) {\n if (usernameOf(acc)) prefetch(acc, id)\n }\n }\n refresh()\n const interval = setInterval(refresh, CHALLENGE_REFRESH_MS)\n document.addEventListener(\"visibilitychange\", refresh)\n return () => {\n clearInterval(interval)\n document.removeEventListener(\"visibilitychange\", refresh)\n }\n }, [selectable, usernameOf, prefetch])\n\n const readyChallenge = (id: string) => {\n if (step?.id === id && step.status === \"sign\") return step.challenge\n const prefetched = challenges[id]\n if (!prefetched || prefetched.owner !== ownerAddress) return null\n return Date.now() - prefetched.fetchedAt < CHALLENGE_MAX_AGE_MS ? prefetched.challenge : null\n }\n\n const handleClick = (acc: SelectableAccount, id: string) => {\n setErrorId(null)\n const fail = () => {\n setStep(null)\n setErrorId(id)\n prefetch(acc, id)\n }\n const challenge = readyChallenge(id)\n if (challenge) {\n // Sign now, while the tap still counts as a user gesture. A challenge can only be used once.\n const signing = onSign(acc, challenge)\n setChallenges(({ [id]: _used, ...rest }) => rest)\n setStep({ id, status: \"loading\" })\n signing.then(() => setStep(null), fail)\n return\n }\n // The challenge isn't ready yet: fetch it now. Desktop wallets sign without a user gesture;\n // on mobile it takes one more tap to open the wallet.\n setStep({ id, status: \"loading\" })\n ;(async () => {\n const fetched = await fetchChallenge(auth, acc, ownerAddress)\n if (opensWalletWithDeepLink()) return setStep({ id, status: \"sign\", challenge: fetched })\n await onSign(acc, fetched)\n setStep(null)\n })().catch(fail)\n }\n\n if (loading) {\n return (\n <div className=\"py-4 space-y-3\">\n <p className=\"text-sm text-muted-foreground\">Loading available profiles…</p>\n {actions && <div className=\"flex flex-col gap-2\">{actions}</div>}\n </div>\n )\n }\n\n return (\n <div className=\"py-4 space-y-3\">\n <ul className=\"space-y-2 max-h-80 overflow-y-auto\">\n {selectable.map(({ acc, id }) => {\n const username = usernameOf(acc)\n if (!username) return null\n const isLoading = step?.id === id && step.status === \"loading\"\n const awaitingSignature = step?.id === id && step.status === \"sign\"\n return (\n <li key={id}>\n <button\n type=\"button\"\n className=\"w-full text-left px-3 py-2 rounded-md border hover:bg-accent/50 flex items-center justify-between cursor-pointer disabled:cursor-default\"\n onClick={() => handleClick(acc, id)}\n disabled={step?.status === \"loading\"}\n >\n <span className=\"truncate\">\n {username}\n {sharedUsernames.has(username) && (\n <span className=\"text-muted-foreground\"> · {acc.address.slice(0, 6)}…{acc.address.slice(-4)}</span>\n )}\n </span>\n {isLoading && <Loader2 className=\"size-4 animate-spin text-muted-foreground\" />}\n {awaitingSignature && <span className=\"text-sm font-medium text-primary\">Sign in</span>}\n </button>\n {awaitingSignature && (\n <p className=\"px-1 pt-1 text-xs text-muted-foreground\">Tap again to sign the message in your wallet.</p>\n )}\n {errorId === id && (\n <p className=\"px-1 pt-1 text-xs text-destructive\">Couldn’t sign in. Please try again.</p>\n )}\n </li>\n )\n })}\n </ul>\n <div className=\"flex flex-col gap-2\">\n <Button className=\"w-full\" onClick={onCreate} disabled={step?.status === \"loading\"}>\n Create a new account\n </Button>\n {actions}\n </div>\n </div>\n )\n}\n","import * as React from \"react\"\nimport { useActiveAccount, useActiveWallet } from \"thirdweb/react\"\nimport type { SessionClient } from \"@lens-protocol/client\"\nimport { Check, Loader2 } from \"lucide-react\"\nimport { CHALLENGE_MAX_AGE_MS, CHALLENGE_REFRESH_MS, opensWalletWithDeepLink, signLensChallenge, type LensChallenge } from \"../core/auth\"\nimport {\n OnboardingError,\n authenticateOnboarding,\n checkUsername,\n createLensAccount,\n createOnboardingClient,\n isUsernameTaken,\n requestOnboardingChallenge,\n signInToCreatedAccount,\n uploadAccountMetadata,\n usernameFormatError,\n} from \"../core/onboarding\"\nimport { useLensAuth } from \"./provider\"\nimport { cn } from \"./utils\"\nimport { Button } from \"./ui/button\"\nimport { Input } from \"./ui/input\"\nimport { Textarea } from \"./ui/textarea\"\nimport { Avatar, AvatarFallback, AvatarImage } from \"./ui/avatar\"\nimport { Field, FieldContent, FieldDescription, FieldGroup, FieldLabel } from \"./ui/field\"\nimport { InputGroup, InputGroupAddon, InputGroupInput, InputGroupText } from \"./ui/input-group\"\n\nexport type CreatedAccount = { address: string; localName: string }\n\ntype Step =\n | { status: \"signing\" }\n // The challenge arrived after the tap: on mobile it takes one more tap to open the wallet\n | { status: \"sign\"; challenge: LensChallenge }\n | { status: \"checking\" | \"uploading\" | \"creating\" | \"signing-in\" }\n\nconst STEP_LABELS = {\n signing: \"Waiting for signature…\",\n sign: \"Sign in wallet\",\n checking: \"Checking username…\",\n uploading: \"Uploading profile…\",\n creating: \"Creating account…\",\n \"signing-in\": \"Signing in…\",\n} satisfies Record<Step[\"status\"], string>\n\ntype Availability = { localName: string; status: \"checking\" | \"available\" | \"taken\" | \"unknown\" }\n\n// Same delay as the search on the find page\nconst USERNAME_DEBOUNCE_MS = 300\nconst MAX_PICTURE_BYTES = 10 * 1024 * 1024\n\n// Render with `key={ownerAddress}`: the onboarding session belongs to the wallet that signed it.\nexport function CreateAccountForm({ ownerAddress, onCreated, onBack, actions }: {\n ownerAddress: string\n onCreated: (account: CreatedAccount) => Promise<void>\n onBack?: () => void\n /** More buttons, shown under the form's own */\n actions?: React.ReactNode\n}) {\n const { auth } = useLensAuth()\n const activeAccount = useActiveAccount()\n const wallet = useActiveWallet()\n\n const [client] = React.useState(() => createOnboardingClient(auth))\n // Kept across attempts so a retry doesn't ask for another signature or create a second account\n const session = React.useRef<SessionClient | null>(null)\n const created = React.useRef<CreatedAccount | null>(null)\n const pictureInput = React.useRef<HTMLInputElement>(null)\n\n const [username, setUsername] = React.useState(\"\")\n const [debouncedUsername, setDebouncedUsername] = React.useState(\"\")\n const [name, setName] = React.useState(\"\")\n const [bio, setBio] = React.useState(\"\")\n const [picture, setPicture] = React.useState<File | null>(null)\n const [pictureUrl, setPictureUrl] = React.useState<string | null>(null)\n\n const [availability, setAvailability] = React.useState<Availability | null>(null)\n const [usernameError, setUsernameError] = React.useState<{ localName: string; message: string } | null>(null)\n const [step, setStep] = React.useState<Step | null>(null)\n const [error, setError] = React.useState<string | null>(null)\n const [prefetched, setPrefetched] = React.useState<{ challenge: LensChallenge; fetchedAt: number } | null>(null)\n\n const formatError = username ? usernameFormatError(username) : null\n const busy = step !== null && step.status !== \"sign\"\n\n // Fetch the challenge ahead of time, so the tap on \"Create account\" can ask the wallet to sign right\n // away: on mobile that tap is what lets the wallet app open (see opensWalletWithDeepLink).\n React.useEffect(() => {\n const refresh = () => {\n if (document.visibilityState !== \"visible\" || session.current) return\n requestOnboardingChallenge(auth, client, ownerAddress)\n .then((challenge) => setPrefetched({ challenge, fetchedAt: Date.now() }))\n .catch(() => {})\n }\n refresh()\n const interval = setInterval(refresh, CHALLENGE_REFRESH_MS)\n document.addEventListener(\"visibilitychange\", refresh)\n return () => {\n clearInterval(interval)\n document.removeEventListener(\"visibilitychange\", refresh)\n }\n }, [auth, client, ownerAddress])\n\n // End the onboarding session if the form is left before the account is signed in to\n React.useEffect(() => () => {\n if (!created.current) void session.current?.logout()\n }, [])\n\n React.useEffect(() => {\n if (!picture) return setPictureUrl(null)\n const url = URL.createObjectURL(picture)\n setPictureUrl(url)\n return () => URL.revokeObjectURL(url)\n }, [picture])\n\n // Only check the username once typing pauses, not on every keystroke\n React.useEffect(() => {\n const timeout = setTimeout(() => setDebouncedUsername(username), USERNAME_DEBOUNCE_MS)\n return () => clearTimeout(timeout)\n }, [username])\n\n React.useEffect(() => {\n if (!debouncedUsername || usernameFormatError(debouncedUsername)) return\n let cancelled = false\n setAvailability({ localName: debouncedUsername, status: \"checking\" })\n isUsernameTaken(auth, debouncedUsername)\n .then((taken) => !cancelled && setAvailability({ localName: debouncedUsername, status: taken ? \"taken\" : \"available\" }))\n .catch(() => !cancelled && setAvailability({ localName: debouncedUsername, status: \"unknown\" }))\n return () => {\n cancelled = true\n }\n }, [auth, debouncedUsername])\n\n const fail = (e: unknown) => {\n setStep(null)\n if ((e as Error)?.name === \"UnauthenticatedError\") session.current = null\n setError(e instanceof OnboardingError ? e.message : \"Couldn’t create your account. Please try again.\")\n }\n\n const create = async (onboarding: SessionClient) => {\n const localName = username\n if (!created.current) {\n setStep({ status: \"checking\" })\n const reason = await checkUsername(auth, onboarding, localName)\n if (reason) {\n setUsernameError({ localName, message: reason })\n setStep(null)\n return\n }\n setStep({ status: \"uploading\" })\n const metadataUri = await uploadAccountMetadata(auth, { name: name.trim(), bio: bio.trim(), picture })\n setStep({ status: \"creating\" })\n if (!wallet) throw new OnboardingError(\"Connect your wallet\")\n const account = await createLensAccount(auth, onboarding, wallet, { localName, metadataUri })\n // account.username is its global Lens username, which it has none of in the app's namespace\n created.current = { address: account.address, localName }\n }\n setStep({ status: \"signing-in\" })\n await signInToCreatedAccount(auth, onboarding, created.current.address)\n await onCreated(created.current)\n }\n\n const continueWith = (authenticating: Promise<SessionClient | null>) => {\n authenticating\n .then(async (onboarding) => {\n if (!onboarding) return\n session.current = onboarding\n await create(onboarding)\n })\n .catch(fail)\n }\n\n const readyChallenge = () => {\n if (step?.status === \"sign\") return step.challenge\n if (!prefetched || Date.now() - prefetched.fetchedAt >= CHALLENGE_MAX_AGE_MS) return null\n return prefetched.challenge\n }\n\n const handleSubmit = (e: React.FormEvent) => {\n e.preventDefault()\n if (busy || !activeAccount) return\n if (!username) return setUsernameError({ localName: username, message: \"Choose a username\" })\n if (formatError || availability?.status === \"taken\") return\n setError(null)\n setUsernameError(null)\n\n if (session.current) {\n setStep({ status: \"checking\" })\n create(session.current).catch(fail)\n return\n }\n\n const challenge = readyChallenge()\n if (challenge) {\n // Sign now, while the tap still counts as a user gesture. A challenge can only be used once.\n const signing = signLensChallenge(challenge, activeAccount)\n setPrefetched(null)\n setStep({ status: \"signing\" })\n continueWith(signing.then((signature) => authenticateOnboarding(client, challenge, signature)))\n return\n }\n\n // The challenge isn't ready yet: fetch it now. Desktop wallets sign without a user gesture;\n // on mobile it takes one more tap to open the wallet.\n setStep({ status: \"signing\" })\n continueWith((async () => {\n const fetched = await requestOnboardingChallenge(auth, client, ownerAddress)\n if (opensWalletWithDeepLink()) {\n setStep({ status: \"sign\", challenge: fetched })\n return null\n }\n const signature = await signLensChallenge(fetched, activeAccount)\n return authenticateOnboarding(client, fetched, signature)\n })())\n }\n\n const handlePictureChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const file = e.target.files?.[0] ?? null\n e.target.value = \"\"\n if (file && file.size > MAX_PICTURE_BYTES) return setError(\"Choose a picture under 10 MB\")\n setError(null)\n setPicture(file)\n }\n\n const usernameMessage = (() => {\n if (formatError) return { text: formatError, isError: true }\n if (usernameError?.localName === username) return { text: usernameError.message, isError: true }\n if (availability?.localName !== username) return null\n switch (availability.status) {\n case \"checking\": return { text: \"Checking availability…\", isError: false }\n case \"available\": return { text: \"Available\", isError: false }\n case \"taken\": return { text: \"This username is taken\", isError: true }\n default: return null\n }\n })()\n\n const fallbackInitial = (name.trim() || username || \"?\").charAt(0).toUpperCase()\n const usernameStatus = availability?.localName === username && !formatError ? availability.status : null\n\n return (\n <form className=\"py-4\" onSubmit={handleSubmit} noValidate>\n <FieldGroup className=\"gap-5\">\n <Field orientation=\"horizontal\">\n <Avatar className=\"size-16\">\n {pictureUrl && <AvatarImage src={pictureUrl} alt=\"\" className=\"object-cover\" />}\n <AvatarFallback className=\"text-lg font-semibold\">{fallbackInitial}</AvatarFallback>\n </Avatar>\n <FieldContent>\n <FieldLabel htmlFor=\"create-account-picture\">\n Profile picture <span className=\"font-normal text-muted-foreground\">(optional)</span>\n </FieldLabel>\n <div className=\"flex gap-2\">\n <Button type=\"button\" variant=\"outline\" size=\"sm\" onClick={() => pictureInput.current?.click()} disabled={busy}>\n {picture ? \"Change\" : \"Add photo\"}\n </Button>\n {picture && (\n <Button type=\"button\" variant=\"ghost\" size=\"sm\" onClick={() => setPicture(null)} disabled={busy}>\n Remove\n </Button>\n )}\n </div>\n </FieldContent>\n <input\n ref={pictureInput}\n id=\"create-account-picture\"\n type=\"file\"\n accept=\"image/*\"\n className=\"sr-only\"\n onChange={handlePictureChange}\n disabled={busy}\n />\n </Field>\n\n <Field data-invalid={usernameMessage?.isError || undefined}>\n <FieldLabel htmlFor=\"create-account-username\">Username</FieldLabel>\n <InputGroup>\n <InputGroupAddon>\n <InputGroupText>@</InputGroupText>\n </InputGroupAddon>\n <InputGroupInput\n id=\"create-account-username\"\n value={username}\n onChange={(e) => setUsername(e.target.value.trim().toLowerCase())}\n autoComplete=\"off\"\n autoCapitalize=\"none\"\n autoCorrect=\"off\"\n spellCheck={false}\n aria-invalid={usernameMessage?.isError || undefined}\n aria-describedby=\"create-account-username-status\"\n disabled={busy}\n />\n <InputGroupAddon align=\"inline-end\">\n {usernameStatus === \"checking\" && <Loader2 className=\"animate-spin\" />}\n {usernameStatus === \"available\" && <Check />}\n </InputGroupAddon>\n </InputGroup>\n {/* Always rendered with a fixed height, so the form doesn't shift as the feedback changes */}\n <FieldDescription\n id=\"create-account-username-status\"\n aria-live=\"polite\"\n className={cn(\"min-h-5 leading-5\", usernameMessage?.isError && \"text-destructive\")}\n >\n {usernameMessage?.text}\n </FieldDescription>\n </Field>\n\n <Field>\n <FieldLabel htmlFor=\"create-account-name\">\n Name <span className=\"font-normal text-muted-foreground\">(optional)</span>\n </FieldLabel>\n <Input id=\"create-account-name\" value={name} onChange={(e) => setName(e.target.value)} maxLength={100} disabled={busy} />\n </Field>\n\n <Field>\n <FieldLabel htmlFor=\"create-account-bio\">\n Bio <span className=\"font-normal text-muted-foreground\">(optional)</span>\n </FieldLabel>\n <Textarea\n id=\"create-account-bio\"\n value={bio}\n onChange={(e) => setBio(e.target.value)}\n maxLength={300}\n rows={3}\n className=\"resize-none\"\n disabled={busy}\n />\n </Field>\n\n <Field className=\"gap-2\">\n <Button type=\"submit\" className=\"w-full\" disabled={busy || !activeAccount}>\n {busy && <Loader2 className=\"animate-spin\" />}\n {step ? STEP_LABELS[step.status] : \"Create account\"}\n </Button>\n <FieldDescription aria-live=\"polite\" className={cn(\"min-h-5 leading-5\", error && \"text-destructive\")}>\n {error ?? (step?.status === \"sign\" ? \"Tap again to sign in your wallet.\" : \"You’ll sign a message in your wallet. It’s free.\")}\n </FieldDescription>\n {onBack && (\n <Button type=\"button\" variant=\"ghost\" className=\"w-full\" onClick={onBack} disabled={busy}>\n Back to your accounts\n </Button>\n )}\n {actions}\n </Field>\n </FieldGroup>\n </form>\n )\n}\n","import { clsx, type ClassValue } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","import * as React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"../utils\"\n\nconst buttonVariants = cva(\n \"cursor-pointer inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive\",\n {\n variants: {\n variant: {\n default:\n \"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90\",\n destructive:\n \"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60\",\n outline:\n \"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50\",\n secondary:\n \"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80\",\n ghost:\n \"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-9 px-4 py-2 has-[>svg]:px-3\",\n sm: \"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5\",\n lg: \"h-10 rounded-md px-6 has-[>svg]:px-4\",\n xl: \"h-[50px] rounded-md px-8 has-[>svg]:px-6\",\n icon: \"size-9\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nfunction Button({\n className,\n variant,\n size,\n asChild = false,\n ...props\n}: React.ComponentProps<\"button\"> &\n VariantProps<typeof buttonVariants> & {\n asChild?: boolean\n }) {\n const Comp = asChild ? Slot : \"button\"\n\n return (\n <Comp\n data-slot=\"button\"\n className={cn(buttonVariants({ variant, size, className }))}\n {...props}\n />\n )\n}\n\nexport { Button, buttonVariants }\n","import * as React from \"react\"\n\nimport { cn } from \"../utils\"\n\nfunction Input({ className, type, ...props }: React.ComponentProps<\"input\">) {\n return (\n <input\n type={type}\n data-slot=\"input\"\n className={cn(\n \"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n \"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]\",\n \"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Input }\n","import * as React from \"react\"\nimport { cn } from \"../utils\"\n\nfunction Textarea({ className, ...props }: React.ComponentProps<\"textarea\">) {\n return (\n <textarea\n data-slot=\"textarea\"\n className={cn(\n \"flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Textarea }\n","\"use client\"\n\nimport * as React from \"react\"\nimport * as AvatarPrimitive from \"@radix-ui/react-avatar\"\n\nimport { cn } from \"../utils\"\n\nfunction Avatar({\n className,\n ...props\n}: React.ComponentProps<typeof AvatarPrimitive.Root>) {\n return (\n <AvatarPrimitive.Root\n data-slot=\"avatar\"\n className={cn(\n \"relative flex size-8 shrink-0 overflow-hidden rounded-full\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AvatarImage({\n className,\n ...props\n}: React.ComponentProps<typeof AvatarPrimitive.Image>) {\n return (\n <AvatarPrimitive.Image\n data-slot=\"avatar-image\"\n className={cn(\"aspect-square size-full\", className)}\n {...props}\n />\n )\n}\n\nfunction AvatarFallback({\n className,\n ...props\n}: React.ComponentProps<typeof AvatarPrimitive.Fallback>) {\n return (\n <AvatarPrimitive.Fallback\n data-slot=\"avatar-fallback\"\n className={cn(\n \"bg-muted flex size-full items-center justify-center rounded-full\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Avatar, AvatarImage, AvatarFallback }\n","\"use client\"\n\nimport { useMemo } from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { cn } from \"../utils\"\n\nimport { Label } from \"./label\"\nimport { Separator } from \"./separator\"\n\nfunction FieldSet({ className, ...props }: React.ComponentProps<\"fieldset\">) {\n return (\n <fieldset\n data-slot=\"field-set\"\n className={cn(\n \"flex flex-col gap-6\",\n \"has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction FieldLegend({\n className,\n variant = \"legend\",\n ...props\n}: React.ComponentProps<\"legend\"> & { variant?: \"legend\" | \"label\" }) {\n return (\n <legend\n data-slot=\"field-legend\"\n data-variant={variant}\n className={cn(\n \"mb-3 font-medium\",\n \"data-[variant=legend]:text-base\",\n \"data-[variant=label]:text-sm\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction FieldGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"field-group\"\n className={cn(\n \"group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4\",\n className\n )}\n {...props}\n />\n )\n}\n\nconst fieldVariants = cva(\n \"group/field flex w-full gap-3 data-[invalid=true]:text-destructive\",\n {\n variants: {\n orientation: {\n vertical: [\"flex-col [&>*]:w-full [&>.sr-only]:w-auto\"],\n horizontal: [\n \"flex-row items-center\",\n \"[&>[data-slot=field-label]]:flex-auto\",\n \"has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px\",\n ],\n responsive: [\n \"flex-col @md/field-group:flex-row @md/field-group:items-center [&>*]:w-full @md/field-group:[&>*]:w-auto [&>.sr-only]:w-auto\",\n \"@md/field-group:[&>[data-slot=field-label]]:flex-auto\",\n \"@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px\",\n ],\n },\n },\n defaultVariants: {\n orientation: \"vertical\",\n },\n }\n)\n\nfunction Field({\n className,\n orientation = \"vertical\",\n ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof fieldVariants>) {\n return (\n <div\n role=\"group\"\n data-slot=\"field\"\n data-orientation={orientation}\n className={cn(fieldVariants({ orientation }), className)}\n {...props}\n />\n )\n}\n\nfunction FieldContent({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"field-content\"\n className={cn(\n \"group/field-content flex flex-1 flex-col gap-1.5 leading-snug\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction FieldLabel({\n className,\n ...props\n}: React.ComponentProps<typeof Label>) {\n return (\n <Label\n data-slot=\"field-label\"\n className={cn(\n \"group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50\",\n \"has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4\",\n \"has-data-[state=checked]:border-primary has-data-[state=checked]:bg-primary/5 dark:has-data-[state=checked]:bg-primary/10\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction FieldTitle({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"field-label\"\n className={cn(\n \"flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction FieldDescription({ className, ...props }: React.ComponentProps<\"p\">) {\n return (\n <p\n data-slot=\"field-description\"\n className={cn(\n \"text-sm leading-normal font-normal text-muted-foreground group-has-[[data-orientation=horizontal]]/field:text-balance\",\n \"last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5\",\n \"[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction FieldSeparator({\n children,\n className,\n ...props\n}: React.ComponentProps<\"div\"> & {\n children?: React.ReactNode\n}) {\n return (\n <div\n data-slot=\"field-separator\"\n data-content={!!children}\n className={cn(\n \"relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2\",\n className\n )}\n {...props}\n >\n <Separator className=\"absolute inset-0 top-1/2\" />\n {children && (\n <span\n className=\"relative mx-auto block w-fit bg-background px-2 text-muted-foreground\"\n data-slot=\"field-separator-content\"\n >\n {children}\n </span>\n )}\n </div>\n )\n}\n\nfunction FieldError({\n className,\n children,\n errors,\n ...props\n}: React.ComponentProps<\"div\"> & {\n errors?: Array<{ message?: string } | undefined>\n}) {\n const content = useMemo(() => {\n if (children) {\n return children\n }\n\n if (!errors?.length) {\n return null\n }\n\n const uniqueErrors = [\n ...new Map(errors.map((error) => [error?.message, error])).values(),\n ]\n\n if (uniqueErrors?.length == 1) {\n return uniqueErrors[0]?.message\n }\n\n return (\n <ul className=\"ml-4 flex list-disc flex-col gap-1\">\n {uniqueErrors.map(\n (error, index) =>\n error?.message && <li key={index}>{error.message}</li>\n )}\n </ul>\n )\n }, [children, errors])\n\n if (!content) {\n return null\n }\n\n return (\n <div\n role=\"alert\"\n data-slot=\"field-error\"\n className={cn(\"text-sm font-normal text-destructive\", className)}\n {...props}\n >\n {content}\n </div>\n )\n}\n\nexport {\n Field,\n FieldLabel,\n FieldDescription,\n FieldError,\n FieldGroup,\n FieldLegend,\n FieldSeparator,\n FieldSet,\n FieldContent,\n FieldTitle,\n}\n","\"use client\"\n\nimport * as React from \"react\"\nimport { cn } from \"../utils\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\n\nfunction Label({\n className,\n ...props\n}: React.ComponentProps<typeof LabelPrimitive.Root>) {\n return (\n <LabelPrimitive.Root\n data-slot=\"label\"\n className={cn(\n \"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Label }\n","\"use client\"\n\nimport * as React from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { cn } from \"../utils\"\n\nimport { Button } from \"./button\"\nimport { Input } from \"./input\"\nimport { Textarea } from \"./textarea\"\n\nfunction InputGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"input-group\"\n role=\"group\"\n className={cn(\n \"group/input-group relative flex w-full items-center rounded-md border border-input shadow-xs transition-[color,box-shadow] outline-none dark:bg-input/30\",\n \"h-9 min-w-0 has-[>textarea]:h-auto\",\n\n // Variants based on alignment.\n \"has-[>[data-align=inline-start]]:[&>input]:pl-2\",\n \"has-[>[data-align=inline-end]]:[&>input]:pr-2\",\n \"has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3\",\n \"has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3\",\n\n // Focus state.\n \"has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-[3px] has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50\",\n\n // Error state.\n \"has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40\",\n\n className\n )}\n {...props}\n />\n )\n}\n\nconst inputGroupAddonVariants = cva(\n \"flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4\",\n {\n variants: {\n align: {\n \"inline-start\":\n \"order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]\",\n \"inline-end\":\n \"order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]\",\n \"block-start\":\n \"order-first w-full justify-start px-3 pt-3 group-has-[>input]/input-group:pt-2.5 [.border-b]:pb-3\",\n \"block-end\":\n \"order-last w-full justify-start px-3 pb-3 group-has-[>input]/input-group:pb-2.5 [.border-t]:pt-3\",\n },\n },\n defaultVariants: {\n align: \"inline-start\",\n },\n }\n)\n\nfunction InputGroupAddon({\n className,\n align = \"inline-start\",\n ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof inputGroupAddonVariants>) {\n return (\n <div\n role=\"group\"\n data-slot=\"input-group-addon\"\n data-align={align}\n className={cn(inputGroupAddonVariants({ align }), className)}\n onClick={(e) => {\n if ((e.target as HTMLElement).closest(\"button\")) {\n return\n }\n e.currentTarget.parentElement?.querySelector(\"input\")?.focus()\n }}\n {...props}\n />\n )\n}\n\nconst inputGroupButtonVariants = cva(\n \"flex items-center gap-2 text-sm shadow-none\",\n {\n variants: {\n size: {\n xs: \"h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-2 has-[>svg]:px-2 [&>svg:not([class*='size-'])]:size-3.5\",\n sm: \"h-8 gap-1.5 rounded-md px-2.5 has-[>svg]:px-2.5\",\n \"icon-xs\":\n \"size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0\",\n \"icon-sm\": \"size-8 p-0 has-[>svg]:p-0\",\n },\n },\n defaultVariants: {\n size: \"xs\",\n },\n }\n)\n\nfunction InputGroupButton({\n className,\n type = \"button\",\n variant = \"ghost\",\n size = \"xs\",\n ...props\n}: Omit<React.ComponentProps<typeof Button>, \"size\"> &\n VariantProps<typeof inputGroupButtonVariants>) {\n return (\n <Button\n type={type}\n data-size={size}\n variant={variant}\n className={cn(inputGroupButtonVariants({ size }), className)}\n {...props}\n />\n )\n}\n\nfunction InputGroupText({ className, ...props }: React.ComponentProps<\"span\">) {\n return (\n <span\n className={cn(\n \"flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction InputGroupInput({\n className,\n ...props\n}: React.ComponentProps<\"input\">) {\n return (\n <Input\n data-slot=\"input-group-control\"\n className={cn(\n \"flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction InputGroupTextarea({\n className,\n ...props\n}: React.ComponentProps<\"textarea\">) {\n return (\n <Textarea\n data-slot=\"input-group-control\"\n className={cn(\n \"flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport {\n InputGroup,\n InputGroupAddon,\n InputGroupButton,\n InputGroupText,\n InputGroupInput,\n InputGroupTextarea,\n}\n","import * as React from \"react\"\n\nexport function useMediaQuery(query: string): boolean {\n return React.useSyncExternalStore(\n (onChange) => {\n const media = window.matchMedia(query)\n media.addEventListener(\"change\", onChange)\n return () => media.removeEventListener(\"change\", onChange)\n },\n () => window.matchMedia(query).matches,\n () => false,\n )\n}\n\n// The page's theme: a `dark` or `light` class on <html> (as next-themes and shadcn set it), otherwise\n// the system preference.\nfunction readTheme(): \"light\" | \"dark\" {\n const classes = document.documentElement.classList\n if (classes.contains(\"dark\")) return \"dark\"\n if (classes.contains(\"light\")) return \"light\"\n return window.matchMedia(\"(prefers-color-scheme: dark)\").matches ? \"dark\" : \"light\"\n}\n\nexport function useDocumentTheme(): \"light\" | \"dark\" {\n return React.useSyncExternalStore(\n (onChange) => {\n const observer = new MutationObserver(onChange)\n observer.observe(document.documentElement, { attributes: true, attributeFilter: [\"class\"] })\n const media = window.matchMedia(\"(prefers-color-scheme: dark)\")\n media.addEventListener(\"change\", onChange)\n return () => {\n observer.disconnect()\n media.removeEventListener(\"change\", onChange)\n }\n },\n readTheme,\n () => \"light\",\n )\n}\n","\"use client\"\n\nimport * as React from \"react\"\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\"\nimport { XIcon } from \"lucide-react\"\n\nimport { cn } from \"../utils\"\n\nfunction Dialog({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root data-slot=\"dialog\" {...props} />\n}\n\nfunction DialogTrigger({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />\n}\n\nfunction DialogPortal({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />\n}\n\nfunction DialogClose({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />\n}\n\nfunction DialogOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DialogContent({\n className,\n children,\n showCloseButton = true,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Content> & {\n showCloseButton?: boolean\n}) {\n return (\n <DialogPortal data-slot=\"dialog-portal\">\n <DialogOverlay />\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n \"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg\",\n className\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n className=\"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\"\n >\n <XIcon />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n )\n}\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn(\"flex flex-col gap-2 text-center sm:text-left\", className)}\n {...props}\n />\n )\n}\n\nfunction DialogFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\n \"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DialogTitle({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn(\"text-lg leading-none font-semibold\", className)}\n {...props}\n />\n )\n}\n\nfunction DialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n )\n}\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n}\n","\"use client\"\n\nimport * as React from \"react\"\nimport { Drawer as DrawerPrimitive } from \"vaul\"\n\nimport { cn } from \"../utils\"\n\nfunction Drawer({\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Root>) {\n return <DrawerPrimitive.Root data-slot=\"drawer\" {...props} />\n}\n\nfunction DrawerTrigger({\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Trigger>) {\n return <DrawerPrimitive.Trigger data-slot=\"drawer-trigger\" {...props} />\n}\n\nfunction DrawerPortal({\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Portal>) {\n return <DrawerPrimitive.Portal data-slot=\"drawer-portal\" {...props} />\n}\n\nfunction DrawerClose({\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Close>) {\n return <DrawerPrimitive.Close data-slot=\"drawer-close\" {...props} />\n}\n\nfunction DrawerOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Overlay>) {\n return (\n <DrawerPrimitive.Overlay\n data-slot=\"drawer-overlay\"\n className={cn(\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DrawerContent({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Content>) {\n return (\n <DrawerPortal data-slot=\"drawer-portal\">\n <DrawerOverlay />\n <DrawerPrimitive.Content\n data-slot=\"drawer-content\"\n className={cn(\n \"group/drawer-content bg-background fixed z-50 flex h-auto flex-col\",\n \"data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b\",\n \"data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t\",\n \"data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm\",\n \"data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm\",\n className\n )}\n {...props}\n >\n <div className=\"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPortal>\n )\n}\n\nfunction DrawerHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"drawer-header\"\n className={cn(\n \"flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DrawerFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"drawer-footer\"\n className={cn(\"mt-auto flex flex-col gap-2 p-4\", className)}\n {...props}\n />\n )\n}\n\nfunction DrawerTitle({\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Title>) {\n return (\n <DrawerPrimitive.Title\n data-slot=\"drawer-title\"\n className={cn(\"text-foreground font-semibold\", className)}\n {...props}\n />\n )\n}\n\nfunction DrawerDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Description>) {\n return (\n <DrawerPrimitive.Description\n data-slot=\"drawer-description\"\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n )\n}\n\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n}\n","import * as React from \"react\"\nimport type { ConnectButtonProps } from \"thirdweb/react\"\nimport { useLensAuth } from \"./provider\"\nimport { useDocumentTheme } from \"./dom\"\nimport { Button } from \"./ui/button\"\nimport { cn } from \"./utils\"\n\n// thirdweb's ConnectButton pulls in ~480KB (gzipped) of wallet SDKs (WalletConnect, Coinbase, ...).\n// Loading it on demand keeps that out of every page's initial bundle, so pages hydrate without\n// waiting for it.\nconst ConnectButton = React.lazy(() => import(\"thirdweb/react\").then((m) => ({ default: m.ConnectButton })))\n\nexport type SignInButtonProps = {\n /** Defaults to \"Sign in\" */\n label?: React.ReactNode\n /** Defaults to \"Logout\" */\n signOutLabel?: React.ReactNode\n /** thirdweb modal theme. Defaults to the page's theme (a `dark` class on <html>, or the system's). */\n theme?: \"light\" | \"dark\"\n /** Classes for the placeholder and sign-out buttons. Size the button's wrapper to size them all alike. */\n className?: string\n /** Extra props for thirdweb's ConnectButton (wallets, connectModal, ...) */\n connectButtonProps?: Partial<Omit<ConnectButtonProps, \"client\" | \"chain\" | \"theme\">>\n}\n\n// Connects a wallet (the account dialog then opens to pick or create a Lens account) and signs out.\nexport function SignInButton({ label = \"Sign in\", signOutLabel = \"Logout\", theme, className, connectButtonProps }: SignInButtonProps) {\n const { auth, wallet, status, signOut } = useLensAuth()\n const documentTheme = useDocumentTheme()\n const [mounted, setMounted] = React.useState(false)\n React.useEffect(() => setMounted(true), [])\n\n // Same size as the real button, so nothing shifts when it loads\n const placeholder = (\n <Button variant=\"outline\" size=\"xl\" className={cn(\"min-w-[165px] px-0\", className)} disabled>\n Loading...\n </Button>\n )\n\n // thirdweb's ConnectButton doesn't render the same on the server and the client\n if (!mounted) return placeholder\n\n if (!wallet) {\n return (\n <React.Suspense fallback={placeholder}>\n <ConnectButton\n client={auth.thirdwebClient}\n chain={auth.chain}\n theme={theme ?? documentTheme}\n {...connectButtonProps}\n connectButton={{\n label,\n ...connectButtonProps?.connectButton,\n style: { height: \"50px\", minWidth: \"165px\", ...connectButtonProps?.connectButton?.style },\n }}\n />\n </React.Suspense>\n )\n }\n\n if (status !== \"signed-in\") return placeholder\n\n return (\n <Button variant=\"ghost\" size=\"xl\" className={cn(\"min-w-[165px] px-0\", className)} onClick={signOut}>\n {signOutLabel}\n </Button>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,YAAYA,YAAW;AACvB,SAAS,oBAAoB;AAC7B,SAAS,kBAAkB,oBAAAC,mBAAkB,mBAAAC,kBAAiB,qBAAqB;AAEnF,SAAS,wBAAwB,qBAA6C;;;ACJ9E,YAAYC,YAAW;AACvB,SAAS,4BAA4B;AACrC,SAAS,kBAAuD;AAEhE,SAAS,WAAAC,gBAAe;;;ACJxB,YAAY,WAAW;AACvB,SAAS,kBAAkB,uBAAuB;AAElD,SAAS,OAAO,eAAe;;;ACH/B,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ACJA,SAAS,YAAY;AACrB,SAAS,WAA8B;AAiDnC;AA7CJ,IAAM,iBAAiB;AAAA,EACrB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SACE;AAAA,QACF,aACE;AAAA,QACF,SACE;AAAA,QACF,WACE;AAAA,QACF,OACE;AAAA,QACF,MAAM;AAAA,MACR;AAAA,MACA,MAAM;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,MAAM;AAAA,MACR;AAAA,IACF;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gBAAAA,MAAC,UAAO,SAAQ,SAAQ,MAAK,MAAK,WAAW,GAAG,sBAAsB,SAAS,GAAG,SAAS,SACxF,wBACH;AAEJ;","names":["React","useActiveAccount","useActiveWallet","React","Loader2","jsx","jsx","jsx","cva","jsx","jsx","jsx","cva","jsx","cva","jsx","cva","jsx","jsx","jsxs","React","jsx","jsxs","jsx","jsx","jsxs","jsx","jsx","jsxs","jsx","jsx","jsxs","jsx","jsx","jsxs","Loader2","jsx","jsxs","useActiveAccount","useActiveWallet","React","jsx"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lens-convex-auth",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "description": "Drop-in sign-in for Lens apps: thirdweb wallet, Lens account sign-in and creation, and Convex auth.",
5
5
  "license": "MIT",
6
6
  "author": "Jean Ayala <hola@jeanayala.xyz>",
@@ -49,13 +49,6 @@
49
49
  "bin": {
50
50
  "lens-convex-auth": "./dist/cli/index.js"
51
51
  },
52
- "scripts": {
53
- "build": "rm -rf dist && tsup",
54
- "dev": "tsup --watch",
55
- "typecheck": "tsc --noEmit",
56
- "test": "vitest run",
57
- "prepublishOnly": "pnpm typecheck && pnpm test && pnpm build"
58
- },
59
52
  "dependencies": {
60
53
  "@radix-ui/react-avatar": "^1.2.6",
61
54
  "@radix-ui/react-dialog": "^1.1.23",
@@ -101,5 +94,10 @@
101
94
  "engines": {
102
95
  "node": ">=20"
103
96
  },
104
- "packageManager": "pnpm@11.9.0"
105
- }
97
+ "scripts": {
98
+ "build": "rm -rf dist && tsup",
99
+ "dev": "tsup --watch",
100
+ "typecheck": "tsc --noEmit",
101
+ "test": "vitest run"
102
+ }
103
+ }