@orangecheck/design 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,10 +1,10 @@
1
1
  import { clsx } from 'clsx';
2
2
  import { twMerge } from 'tailwind-merge';
3
3
  import * as React2 from 'react';
4
- import { createContext, useState, useRef, useEffect, useCallback, useMemo, useContext } from 'react';
4
+ import { createContext, useState, useRef, useEffect, useCallback, useMemo, useContext, Fragment as Fragment$1, useId } from 'react';
5
5
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
6
6
  import { useTheme } from 'next-themes';
7
- import { ChevronDown, Palette, Check, Sun, Moon, Monitor, CheckIcon, CircleIcon, X, XIcon, AlertTriangle, Pencil, ChevronLeft, ChevronRight, ChevronDownIcon, ChevronUpIcon, Maximize2, Copy } from 'lucide-react';
7
+ import { ChevronDown, Palette, Check, Sun, Moon, Monitor, CheckIcon, CircleIcon, X, XIcon, AlertTriangle, Pencil, ChevronLeft, ChevronRight, ChevronDownIcon, ChevronUpIcon, Maximize2, Copy, HelpCircle, Boxes, CornerDownLeft, Plus, Loader2 } from 'lucide-react';
8
8
  import { Slot } from '@radix-ui/react-slot';
9
9
  import { cva } from 'class-variance-authority';
10
10
  import * as LabelPrimitive from '@radix-ui/react-label';
@@ -17,131 +17,13 @@ import * as PopoverPrimitive from '@radix-ui/react-popover';
17
17
  import * as AccordionPrimitive from '@radix-ui/react-accordion';
18
18
  import * as SelectPrimitive from '@radix-ui/react-select';
19
19
  import { Toaster as Toaster$1 } from 'sonner';
20
+ import * as TabsPrimitive from '@radix-ui/react-tabs';
20
21
  import QRCode from 'qrcode';
21
- import * as ui_star from '@orangecheck/ui';
22
+ import Link6 from 'next/link';
23
+ import { useRouter } from 'next/router';
24
+ import { useOcSession, fetchOcLinkedIdentities } from '@orangecheck/auth-client';
22
25
 
23
- var __defProp = Object.defineProperty;
24
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
25
- var __getOwnPropNames = Object.getOwnPropertyNames;
26
- var __hasOwnProp = Object.prototype.hasOwnProperty;
27
- var __export = (target, all) => {
28
- for (var name in all)
29
- __defProp(target, name, { get: all[name], enumerable: true });
30
- };
31
- var __copyProps = (to, from, except, desc) => {
32
- if (from && typeof from === "object" || typeof from === "function") {
33
- for (let key of __getOwnPropNames(from))
34
- if (!__hasOwnProp.call(to, key) && key !== except)
35
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
36
- }
37
- return to;
38
- };
39
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget);
40
-
41
- // src/index.ts
42
- var src_exports = {};
43
- __export(src_exports, {
44
- Accordion: () => Accordion,
45
- AccordionContent: () => AccordionContent,
46
- AccordionItem: () => AccordionItem,
47
- AccordionTrigger: () => AccordionTrigger,
48
- Alert: () => Alert,
49
- AlertDescription: () => AlertDescription,
50
- AlertTitle: () => AlertTitle,
51
- AlertWithAction: () => AlertWithAction,
52
- AlertWithCountdown: () => AlertWithCountdown,
53
- Badge: () => Badge,
54
- Bar: () => Bar,
55
- BitcoinAddress: () => BitcoinAddress,
56
- Button: () => Button,
57
- Card: () => Card,
58
- Checkbox: () => Checkbox,
59
- ConfirmHost: () => ConfirmHost,
60
- CopyButton: () => CopyButton,
61
- DEFAULT_OC_THEME: () => DEFAULT_OC_THEME,
62
- Dialog: () => Dialog,
63
- DialogClose: () => DialogClose,
64
- DialogContent: () => DialogContent,
65
- DialogDescription: () => DialogDescription,
66
- DialogFooter: () => DialogFooter,
67
- DialogHeader: () => DialogHeader,
68
- DialogOverlay: () => DialogOverlay,
69
- DialogPortal: () => DialogPortal,
70
- DialogTitle: () => DialogTitle,
71
- DialogTrigger: () => DialogTrigger,
72
- ErrorBoundary: () => ErrorBoundary,
73
- Input: () => Input,
74
- Label: () => Label,
75
- Modal: () => Modal,
76
- OC_DEFAULT_ACCENT: () => OC_DEFAULT_ACCENT,
77
- OC_SKIN_COOKIE: () => OC_SKIN_COOKIE,
78
- OC_THEMES: () => OC_THEMES,
79
- OcAppearanceMenu: () => OcAppearanceMenu,
80
- OcThemeBridge: () => OcThemeBridge,
81
- OcThemePicker: () => OcThemePicker,
82
- OcThemeProvider: () => OcThemeProvider,
83
- Pagination: () => Pagination,
84
- Popover: () => Popover,
85
- PopoverAnchor: () => PopoverAnchor,
86
- PopoverContent: () => PopoverContent,
87
- PopoverTrigger: () => PopoverTrigger,
88
- PromptHost: () => PromptHost,
89
- QrCode: () => QrCode,
90
- REFERENCE_BTC_USD: () => REFERENCE_BTC_USD,
91
- RadioGroup: () => RadioGroup,
92
- RadioGroupItem: () => RadioGroupItem,
93
- SatsAmount: () => SatsAmount,
94
- Select: () => Select,
95
- SelectContent: () => SelectContent,
96
- SelectGroup: () => SelectGroup,
97
- SelectItem: () => SelectItem,
98
- SelectLabel: () => SelectLabel,
99
- SelectScrollDownButton: () => SelectScrollDownButton,
100
- SelectScrollUpButton: () => SelectScrollUpButton,
101
- SelectSeparator: () => SelectSeparator,
102
- SelectTrigger: () => SelectTrigger,
103
- SelectValue: () => SelectValue,
104
- Separator: () => Separator,
105
- Sheet: () => Sheet,
106
- SheetClose: () => SheetClose,
107
- SheetContent: () => SheetContent,
108
- SheetDescription: () => SheetDescription,
109
- SheetFooter: () => SheetFooter,
110
- SheetHeader: () => SheetHeader,
111
- SheetOverlay: () => SheetOverlay,
112
- SheetPortal: () => SheetPortal,
113
- SheetTitle: () => SheetTitle,
114
- SheetTrigger: () => SheetTrigger,
115
- Skeleton: () => Skeleton,
116
- Sparkline: () => Sparkline,
117
- StatBlock: () => StatBlock,
118
- StatusPill: () => StatusPill,
119
- Switch: () => Switch,
120
- Textarea: () => Textarea,
121
- ThemeToggle: () => ThemeToggle,
122
- ThemeToggleLink: () => ThemeToggleLink,
123
- Toaster: () => Toaster,
124
- Working: () => Working,
125
- WorkingPanel: () => WorkingPanel,
126
- accentFor: () => accentFor,
127
- badgeVariants: () => badgeVariants,
128
- buttonVariants: () => buttonVariants,
129
- cn: () => cn,
130
- confirm: () => confirm,
131
- explorerUrl: () => explorerUrl,
132
- formatSats: () => formatSats,
133
- formatSatsCompact: () => formatSatsCompact,
134
- getOcThemeInitScript: () => getOcThemeInitScript,
135
- isKnownTheme: () => isKnownTheme,
136
- priceBoth: () => priceBoth,
137
- prompt: () => prompt,
138
- relativeTime: () => relativeTime,
139
- resolveTheme: () => resolveTheme,
140
- satsToUsd: () => satsToUsd,
141
- shortenAddress: () => shortenAddress,
142
- usdToSats: () => usdToSats,
143
- useOcSkin: () => useOcSkin
144
- });
26
+ // src/tokens/cn.ts
145
27
  function cn(...inputs) {
146
28
  return twMerge(clsx(inputs));
147
29
  }
@@ -944,6 +826,7 @@ var ErrorBoundary = class extends React2.Component {
944
826
  }
945
827
  componentDidCatch(error, info) {
946
828
  console.error("[ErrorBoundary]", error, info);
829
+ this.props.onError?.(error, info);
947
830
  }
948
831
  render() {
949
832
  if (this.state.error) {
@@ -951,7 +834,7 @@ var ErrorBoundary = class extends React2.Component {
951
834
  return this.props.fallback(this.state.error, this.reset);
952
835
  }
953
836
  return /* @__PURE__ */ jsx("div", { className: "container py-16", children: /* @__PURE__ */ jsxs("div", { className: "terminal", children: [
954
- /* @__PURE__ */ jsx("div", { className: "terminal-title", children: /* @__PURE__ */ jsx("span", { className: "text-destructive flex items-center gap-1.5", children: "! fatal" }) }),
837
+ /* @__PURE__ */ jsx("div", { className: "terminal-title", children: /* @__PURE__ */ jsx("span", { className: "text-destructive flex items-center gap-1.5", children: this.props.title ?? "! fatal" }) }),
955
838
  /* @__PURE__ */ jsxs("div", { className: "space-y-3 p-5 font-mono text-xs leading-relaxed", children: [
956
839
  /* @__PURE__ */ jsxs("p", { children: [
957
840
  /* @__PURE__ */ jsxs("span", { className: "text-destructive", children: [
@@ -963,7 +846,7 @@ var ErrorBoundary = class extends React2.Component {
963
846
  ] }),
964
847
  /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground", children: [
965
848
  "> ",
966
- "this page crashed. reload to recover."
849
+ this.props.message ?? "this page crashed. reload to recover."
967
850
  ] }),
968
851
  /* @__PURE__ */ jsx(
969
852
  "button",
@@ -1265,7 +1148,7 @@ function ConfirmHost() {
1265
1148
  ) }),
1266
1149
  /* @__PURE__ */ jsxs("div", { className: "space-y-4 p-4 sm:p-5", children: [
1267
1150
  /* @__PURE__ */ jsx(SheetPrimitive.Title, { className: "sr-only", children: state.title }),
1268
- /* @__PURE__ */ jsx(SheetPrimitive.Description, { asChild: true, children: /* @__PURE__ */ jsx("div", { className: "text-muted-foreground font-mono text-xs leading-relaxed whitespace-pre-wrap", children: state.message }) }),
1151
+ /* @__PURE__ */ jsx(SheetPrimitive.Description, { asChild: true, children: /* @__PURE__ */ jsx("div", { className: "text-muted-foreground font-mono text-xs leading-relaxed whitespace-pre-wrap [overflow-wrap:anywhere]", children: state.message }) }),
1269
1152
  /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center justify-end gap-2", children: [
1270
1153
  /* @__PURE__ */ jsx(
1271
1154
  Button,
@@ -1916,6 +1799,57 @@ function StatusPill({ label, tone = "muted", icon, className }) {
1916
1799
  }
1917
1800
  );
1918
1801
  }
1802
+ function makeStatusPill(map) {
1803
+ function DomainStatusPill({ status, className }) {
1804
+ const spec = map[status];
1805
+ return /* @__PURE__ */ jsx(
1806
+ StatusPill,
1807
+ {
1808
+ tone: spec?.tone ?? "muted",
1809
+ label: spec?.label ?? status,
1810
+ icon: spec?.icon,
1811
+ className
1812
+ }
1813
+ );
1814
+ }
1815
+ return DomainStatusPill;
1816
+ }
1817
+ function Tabs({ ...props }) {
1818
+ return /* @__PURE__ */ jsx(TabsPrimitive.Root, { "data-slot": "tabs", ...props });
1819
+ }
1820
+ function TabsList({ className, ...props }) {
1821
+ return /* @__PURE__ */ jsx(
1822
+ TabsPrimitive.List,
1823
+ {
1824
+ "data-slot": "tabs-list",
1825
+ className: cn("border-border -mb-px flex items-center gap-6 border-b", className),
1826
+ ...props
1827
+ }
1828
+ );
1829
+ }
1830
+ function TabsTrigger({ className, ...props }) {
1831
+ return /* @__PURE__ */ jsx(
1832
+ TabsPrimitive.Trigger,
1833
+ {
1834
+ "data-slot": "tabs-trigger",
1835
+ className: cn(
1836
+ "text-muted-foreground hover:text-foreground data-[state=active]:text-primary data-[state=active]:border-primary -mb-px border-b-2 border-transparent py-2 font-mono text-[11px] tracking-widest uppercase transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
1837
+ className
1838
+ ),
1839
+ ...props
1840
+ }
1841
+ );
1842
+ }
1843
+ function TabsContent({ className, ...props }) {
1844
+ return /* @__PURE__ */ jsx(
1845
+ TabsPrimitive.Content,
1846
+ {
1847
+ "data-slot": "tabs-content",
1848
+ className: cn("mt-4 outline-none", className),
1849
+ ...props
1850
+ }
1851
+ );
1852
+ }
1919
1853
 
1920
1854
  // src/format/index.ts
1921
1855
  var REFERENCE_BTC_USD = 95e3;
@@ -2085,14 +2019,1800 @@ function QrCode({ value, size = 200, label, className }) {
2085
2019
  }
2086
2020
  );
2087
2021
  }
2022
+ function HelpHint({
2023
+ title,
2024
+ children,
2025
+ side = "bottom",
2026
+ label = "more information",
2027
+ className
2028
+ }) {
2029
+ return /* @__PURE__ */ jsxs(Popover, { children: [
2030
+ /* @__PURE__ */ jsx(
2031
+ PopoverTrigger,
2032
+ {
2033
+ "aria-label": label,
2034
+ className: cn(
2035
+ "text-muted-foreground/60 hover:text-foreground inline-flex size-3.5 items-center justify-center align-middle transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring",
2036
+ className
2037
+ ),
2038
+ children: /* @__PURE__ */ jsx(HelpCircle, { className: "size-3.5", "aria-hidden": true })
2039
+ }
2040
+ ),
2041
+ /* @__PURE__ */ jsxs(PopoverContent, { side, className: "w-72 space-y-1.5", children: [
2042
+ title && /* @__PURE__ */ jsx("p", { className: "label-mono text-foreground text-[10px]", children: title }),
2043
+ /* @__PURE__ */ jsx("div", { className: "text-muted-foreground text-xs leading-relaxed", children })
2044
+ ] })
2045
+ ] });
2046
+ }
2047
+ var TONE_CLASS = {
2048
+ primary: "text-primary",
2049
+ muted: "text-muted-foreground",
2050
+ warning: "text-warning",
2051
+ success: "text-success",
2052
+ destructive: "text-destructive"
2053
+ };
2054
+ function SectionHeader({
2055
+ label,
2056
+ meta,
2057
+ hint,
2058
+ tone = "primary",
2059
+ className = ""
2060
+ }) {
2061
+ return /* @__PURE__ */ jsxs("div", { className: `mb-3 flex items-baseline justify-between gap-2 ${className}`, children: [
2062
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
2063
+ /* @__PURE__ */ jsxs("div", { className: `label-mono ${TONE_CLASS[tone]}`, children: [
2064
+ "\xA7 ",
2065
+ label
2066
+ ] }),
2067
+ hint && /* @__PURE__ */ jsx(HelpHint, { title: hint.title, side: hint.side ?? "bottom", children: hint.body })
2068
+ ] }),
2069
+ meta && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground/70 font-mono text-[10px] tracking-widest uppercase", children: meta })
2070
+ ] });
2071
+ }
2072
+ var TONE_CLASS2 = {
2073
+ info: "border-primary/30 bg-primary/5",
2074
+ warning: "border-warning/40 bg-warning/5",
2075
+ muted: "border-border bg-muted/20"
2076
+ };
2077
+ var LABEL_TONE_CLASS = {
2078
+ info: "text-primary",
2079
+ warning: "text-warning",
2080
+ muted: "text-muted-foreground"
2081
+ };
2082
+ function EmptyState({
2083
+ label,
2084
+ children,
2085
+ cta,
2086
+ secondary,
2087
+ tone = "info",
2088
+ className = ""
2089
+ }) {
2090
+ return /* @__PURE__ */ jsxs("div", { className: `border p-5 md:p-6 ${TONE_CLASS2[tone]} ${className}`, children: [
2091
+ /* @__PURE__ */ jsxs("div", { className: `label-mono mb-2 ${LABEL_TONE_CLASS[tone]}`, children: [
2092
+ "\xA7 ",
2093
+ label
2094
+ ] }),
2095
+ /* @__PURE__ */ jsx("div", { className: "text-foreground/85 max-w-2xl text-sm leading-relaxed", children }),
2096
+ (cta || secondary) && /* @__PURE__ */ jsxs("div", { className: "mt-4 flex flex-wrap gap-3", children: [
2097
+ cta && /* @__PURE__ */ jsx(CtaLink, { ...cta, variant: "primary" }),
2098
+ secondary && /* @__PURE__ */ jsx(CtaLink, { ...secondary, variant: "secondary" })
2099
+ ] })
2100
+ ] });
2101
+ }
2102
+ function CtaLink({
2103
+ label,
2104
+ href,
2105
+ external,
2106
+ variant
2107
+ }) {
2108
+ const cls = variant === "primary" ? "bg-primary text-primary-foreground hover:bg-primary/90 inline-flex h-9 items-center justify-center rounded-md px-4 font-mono text-[11px] font-semibold tracking-widest uppercase" : "text-muted-foreground hover:text-foreground border-input hover:bg-accent inline-flex h-9 items-center justify-center rounded-md border px-4 font-mono text-[11px] tracking-widest uppercase";
2109
+ const text = external ? `${label} \u2197` : label;
2110
+ if (external) {
2111
+ return /* @__PURE__ */ jsx("a", { href, target: "_blank", rel: "noreferrer", className: cls, children: text });
2112
+ }
2113
+ return /* @__PURE__ */ jsx(Link6, { href, className: cls, children: text });
2114
+ }
2115
+ var TONE_CLASS3 = {
2116
+ default: "",
2117
+ primary: "text-primary",
2118
+ success: "text-success",
2119
+ warning: "text-warning",
2120
+ destructive: "text-destructive",
2121
+ muted: "text-muted-foreground"
2122
+ };
2123
+ var COL_CLASS = {
2124
+ 1: "",
2125
+ 2: "md:grid-cols-2",
2126
+ 3: "md:grid-cols-3",
2127
+ 4: "md:grid-cols-2 lg:grid-cols-4"
2128
+ };
2129
+ function StatGrid({ items, columns = 3, className = "" }) {
2130
+ return /* @__PURE__ */ jsx("div", { className: `bg-border grid gap-px border ${COL_CLASS[columns]} ${className}`, children: items.map((it, i) => /* @__PURE__ */ jsx(Tile, { item: it }, `${it.label}-${i}`)) });
2131
+ }
2132
+ function Tile({ item }) {
2133
+ const tone = item.tone ?? (item.accent ? "primary" : "default");
2134
+ return /* @__PURE__ */ jsxs("div", { className: "bg-background p-5", children: [
2135
+ /* @__PURE__ */ jsx("div", { className: "text-muted-foreground/80 font-mono text-[10px] tracking-widest uppercase", children: item.label }),
2136
+ /* @__PURE__ */ jsx(
2137
+ "div",
2138
+ {
2139
+ className: `font-display mt-1 text-2xl font-bold tabular-nums tracking-tight ${TONE_CLASS3[tone]}`,
2140
+ children: item.value
2141
+ }
2142
+ ),
2143
+ item.sub && /* @__PURE__ */ jsx("div", { className: "text-muted-foreground/70 mt-1 font-mono text-[10px] tracking-widest uppercase", children: item.sub })
2144
+ ] });
2145
+ }
2146
+ function StatTile({ children, ...item }) {
2147
+ return /* @__PURE__ */ jsxs("div", { children: [
2148
+ /* @__PURE__ */ jsx(Tile, { item }),
2149
+ children
2150
+ ] });
2151
+ }
2152
+ var FRAME = {
2153
+ info: "border-primary/30 bg-primary/5",
2154
+ warning: "border-warning/40 bg-warning/5",
2155
+ destructive: "border-destructive/40 bg-destructive/5",
2156
+ success: "border-success/40 bg-success/5",
2157
+ muted: "border-border bg-muted/20"
2158
+ };
2159
+ var LABEL = {
2160
+ info: "text-primary",
2161
+ warning: "text-warning",
2162
+ destructive: "text-destructive",
2163
+ success: "text-success",
2164
+ muted: "text-muted-foreground"
2165
+ };
2166
+ function Callout({ tone = "info", label, icon, children, action, className }) {
2167
+ return /* @__PURE__ */ jsxs("div", { className: cn("border p-4 md:p-5", FRAME[tone], className), children: [
2168
+ label && /* @__PURE__ */ jsxs("div", { className: cn("label-mono mb-2 flex items-center gap-1.5", LABEL[tone]), children: [
2169
+ icon,
2170
+ /* @__PURE__ */ jsxs("span", { children: [
2171
+ "\xA7 ",
2172
+ label
2173
+ ] })
2174
+ ] }),
2175
+ /* @__PURE__ */ jsxs("div", { className: "text-foreground/85 text-sm leading-relaxed", children: [
2176
+ !label && icon ? /* @__PURE__ */ jsx("span", { className: cn("mr-2 inline-flex align-middle", LABEL[tone]), children: icon }) : null,
2177
+ children
2178
+ ] }),
2179
+ action && /* @__PURE__ */ jsx("div", { className: "mt-3 flex flex-wrap gap-3", children: action })
2180
+ ] });
2181
+ }
2182
+ function DefinitionList({ items, className }) {
2183
+ return /* @__PURE__ */ jsx(
2184
+ "dl",
2185
+ {
2186
+ className: cn(
2187
+ "grid gap-x-5 gap-y-2 text-sm sm:grid-cols-[auto_1fr] sm:items-baseline",
2188
+ className
2189
+ ),
2190
+ children: items.map((item, i) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
2191
+ /* @__PURE__ */ jsx("dt", { className: "label-mono text-muted-foreground text-[10px]", children: item.label }),
2192
+ /* @__PURE__ */ jsx("dd", { className: "text-foreground font-mono text-xs break-all", children: item.value })
2193
+ ] }, i))
2194
+ }
2195
+ );
2196
+ }
2197
+ function DataRow({ children, meta, action, as, className }) {
2198
+ const Tag = as ?? "div";
2199
+ return /* @__PURE__ */ jsxs(
2200
+ Tag,
2201
+ {
2202
+ className: cn(
2203
+ "flex flex-col gap-1 py-3 sm:flex-row sm:items-baseline sm:justify-between sm:gap-4",
2204
+ className
2205
+ ),
2206
+ children: [
2207
+ /* @__PURE__ */ jsx("div", { className: "min-w-0 flex-1", children }),
2208
+ (meta || action) && /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-3 sm:justify-end", children: [
2209
+ meta && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground font-mono text-[11px] tracking-wide", children: meta }),
2210
+ action
2211
+ ] })
2212
+ ]
2213
+ }
2214
+ );
2215
+ }
2216
+ var ENTRIES = [
2217
+ {
2218
+ slug: "home",
2219
+ href: "https://ochk.io",
2220
+ label: "orangecheck",
2221
+ sub: "umbrella",
2222
+ docsHref: "https://docs.ochk.io"
2223
+ },
2224
+ {
2225
+ slug: "docs",
2226
+ href: "https://docs.ochk.io",
2227
+ label: "oc\xB7docs",
2228
+ sub: "unified docs",
2229
+ docsHref: "https://docs.ochk.io"
2230
+ },
2231
+ {
2232
+ slug: "fleet",
2233
+ href: "https://fleet.ochk.io",
2234
+ label: "oc\xB7fleet",
2235
+ sub: "managed \u2014 agent fleet",
2236
+ docsHref: "https://docs.ochk.io/fleet"
2237
+ },
2238
+ {
2239
+ slug: "me",
2240
+ href: "https://me.ochk.io",
2241
+ label: "oc\xB7me",
2242
+ sub: "earn \u2014 consumer identity",
2243
+ docsHref: "https://docs.ochk.io/me"
2244
+ },
2245
+ {
2246
+ slug: "vault",
2247
+ href: "https://vault.ochk.io",
2248
+ label: "oc\xB7vault",
2249
+ sub: "keep \u2014 encrypted secrets",
2250
+ docsHref: "https://docs.ochk.io/vault"
2251
+ },
2252
+ {
2253
+ slug: "attest",
2254
+ href: "https://attest.ochk.io",
2255
+ label: "oc\xB7attest",
2256
+ sub: "am \u2014 sybil resistance",
2257
+ docsHref: "https://docs.ochk.io/attest"
2258
+ },
2259
+ {
2260
+ slug: "lock",
2261
+ href: "https://lock.ochk.io",
2262
+ label: "oc\xB7lock",
2263
+ sub: "whisper \u2014 encryption",
2264
+ docsHref: "https://docs.ochk.io/lock"
2265
+ },
2266
+ {
2267
+ slug: "vote",
2268
+ href: "https://vote.ochk.io",
2269
+ label: "oc\xB7vote",
2270
+ sub: "decide \u2014 polls",
2271
+ docsHref: "https://docs.ochk.io/vote"
2272
+ },
2273
+ {
2274
+ slug: "stamp",
2275
+ href: "https://stamp.ochk.io",
2276
+ label: "oc\xB7stamp",
2277
+ sub: "declare \u2014 block-anchored",
2278
+ docsHref: "https://docs.ochk.io/stamp"
2279
+ },
2280
+ {
2281
+ slug: "agent",
2282
+ href: "https://agent.ochk.io",
2283
+ label: "oc\xB7agent",
2284
+ sub: "delegate \u2014 scoped auth",
2285
+ docsHref: "https://docs.ochk.io/agent"
2286
+ },
2287
+ {
2288
+ slug: "pledge",
2289
+ href: "https://pledge.ochk.io",
2290
+ label: "oc\xB7pledge",
2291
+ sub: "swear \u2014 bonded commitment",
2292
+ docsHref: "https://docs.ochk.io/pledge"
2293
+ }
2294
+ ];
2295
+ var OWNER_ENTRIES = [
2296
+ {
2297
+ slug: "analytics",
2298
+ href: "https://analytics.ochk.io",
2299
+ label: "oc\xB7analytics",
2300
+ sub: "owner cockpit",
2301
+ docsHref: "https://analytics.ochk.io"
2302
+ }
2303
+ ];
2304
+ function EcosystemSwitcher({
2305
+ current,
2306
+ className,
2307
+ showOwnerEntries = false
2308
+ }) {
2309
+ const [open, setOpen] = useState(false);
2310
+ const containerRef = useRef(null);
2311
+ useEffect(() => {
2312
+ if (!open) return;
2313
+ function onDoc(e) {
2314
+ if (!containerRef.current) return;
2315
+ if (!containerRef.current.contains(e.target)) setOpen(false);
2316
+ }
2317
+ function onKey(e) {
2318
+ if (e.key === "Escape") setOpen(false);
2319
+ }
2320
+ document.addEventListener("mousedown", onDoc);
2321
+ document.addEventListener("keydown", onKey);
2322
+ return () => {
2323
+ document.removeEventListener("mousedown", onDoc);
2324
+ document.removeEventListener("keydown", onKey);
2325
+ };
2326
+ }, [open]);
2327
+ return /* @__PURE__ */ jsxs("div", { ref: containerRef, className: "relative " + (className ?? ""), children: [
2328
+ /* @__PURE__ */ jsxs(
2329
+ "button",
2330
+ {
2331
+ type: "button",
2332
+ "aria-haspopup": "menu",
2333
+ "aria-expanded": open,
2334
+ "aria-label": "Switch OrangeCheck product",
2335
+ title: "Switch product",
2336
+ onClick: () => setOpen((v) => !v),
2337
+ className: "inline-flex items-center gap-1 px-2 py-1 transition-colors " + (open ? "text-foreground" : "text-muted-foreground hover:text-foreground"),
2338
+ children: [
2339
+ /* @__PURE__ */ jsx(Boxes, { className: "h-4 w-4" }),
2340
+ /* @__PURE__ */ jsx(
2341
+ ChevronDown,
2342
+ {
2343
+ className: "h-3.5 w-3.5 transition-transform " + (open ? "rotate-180" : "")
2344
+ }
2345
+ )
2346
+ ]
2347
+ }
2348
+ ),
2349
+ open && /* @__PURE__ */ jsxs(
2350
+ "div",
2351
+ {
2352
+ role: "menu",
2353
+ "aria-label": "Switch OrangeCheck product",
2354
+ className: "bg-background absolute right-0 top-full z-[60] mt-2 w-72 border shadow-lg",
2355
+ children: [
2356
+ /* @__PURE__ */ jsx("div", { className: "label-mono text-primary border-b px-4 py-2", children: "\xA7 the family" }),
2357
+ /* @__PURE__ */ jsx("ul", { className: "py-1", children: [...ENTRIES, ...showOwnerEntries ? OWNER_ENTRIES : []].map((e) => {
2358
+ const isActive2 = e.slug === current;
2359
+ return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
2360
+ Link6,
2361
+ {
2362
+ href: e.href,
2363
+ onClick: () => setOpen(false),
2364
+ "aria-current": isActive2 ? "page" : void 0,
2365
+ className: "group flex items-baseline gap-3 px-4 py-2 transition-colors " + (isActive2 ? "bg-primary/5" : "hover:bg-muted"),
2366
+ children: [
2367
+ /* @__PURE__ */ jsx(
2368
+ "span",
2369
+ {
2370
+ className: "font-display flex-1 text-[12px] font-semibold tracking-tight " + (isActive2 ? "text-primary" : "text-foreground group-hover:text-primary transition-colors"),
2371
+ children: e.label
2372
+ }
2373
+ ),
2374
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground font-mono text-[10px] tracking-wider uppercase", children: e.sub }),
2375
+ isActive2 && /* @__PURE__ */ jsx(Check, { className: "text-primary h-3 w-3" })
2376
+ ]
2377
+ }
2378
+ ) }, e.slug);
2379
+ }) }),
2380
+ /* @__PURE__ */ jsx("div", { className: "border-t px-4 py-2 font-mono text-[10px] tracking-widest uppercase", children: /* @__PURE__ */ jsx(
2381
+ Link6,
2382
+ {
2383
+ href: "https://docs.ochk.io",
2384
+ onClick: () => setOpen(false),
2385
+ className: "text-muted-foreground hover:text-foreground inline-block transition-colors",
2386
+ children: "docs.ochk.io \u2192"
2387
+ }
2388
+ ) })
2389
+ ]
2390
+ }
2391
+ )
2392
+ ] });
2393
+ }
2088
2394
 
2089
- // src/components/index.ts
2090
- var components_exports = {};
2091
- __reExport(components_exports, ui_star);
2092
-
2093
- // src/index.ts
2094
- __reExport(src_exports, components_exports);
2395
+ // src/chrome/family-properties.ts
2396
+ var FAMILY_PROPERTIES = [
2397
+ {
2398
+ slug: "home",
2399
+ origin: "https://ochk.io",
2400
+ hostname: "ochk.io",
2401
+ label: "orangecheck",
2402
+ sub: "umbrella \xB7 sign-in",
2403
+ docsHref: "https://docs.ochk.io",
2404
+ category: "hub"
2405
+ },
2406
+ {
2407
+ slug: "docs",
2408
+ origin: "https://docs.ochk.io",
2409
+ hostname: "docs.ochk.io",
2410
+ label: "oc\xB7docs",
2411
+ sub: "unified reference",
2412
+ docsHref: "https://docs.ochk.io",
2413
+ category: "hub"
2414
+ },
2415
+ {
2416
+ slug: "me",
2417
+ origin: "https://me.ochk.io",
2418
+ hostname: "me.ochk.io",
2419
+ label: "oc\xB7me",
2420
+ sub: "earn \u2014 consumer identity",
2421
+ docsHref: "https://docs.ochk.io/me",
2422
+ category: "product"
2423
+ },
2424
+ {
2425
+ slug: "vault",
2426
+ origin: "https://vault.ochk.io",
2427
+ hostname: "vault.ochk.io",
2428
+ label: "oc\xB7vault",
2429
+ sub: "keep \u2014 encrypted secrets",
2430
+ docsHref: "https://docs.ochk.io/vault",
2431
+ category: "product"
2432
+ },
2433
+ {
2434
+ slug: "fleet",
2435
+ origin: "https://fleet.ochk.io",
2436
+ hostname: "fleet.ochk.io",
2437
+ label: "oc\xB7fleet",
2438
+ sub: "managed \u2014 agent fleet",
2439
+ docsHref: "https://docs.ochk.io/fleet",
2440
+ category: "product"
2441
+ },
2442
+ {
2443
+ slug: "attest",
2444
+ origin: "https://attest.ochk.io",
2445
+ hostname: "attest.ochk.io",
2446
+ label: "oc\xB7attest",
2447
+ sub: "am \u2014 sybil resistance",
2448
+ docsHref: "https://docs.ochk.io/attest",
2449
+ category: "protocol"
2450
+ },
2451
+ {
2452
+ slug: "lock",
2453
+ origin: "https://lock.ochk.io",
2454
+ hostname: "lock.ochk.io",
2455
+ label: "oc\xB7lock",
2456
+ sub: "whisper \u2014 encryption",
2457
+ docsHref: "https://docs.ochk.io/lock",
2458
+ category: "protocol"
2459
+ },
2460
+ {
2461
+ slug: "vote",
2462
+ origin: "https://vote.ochk.io",
2463
+ hostname: "vote.ochk.io",
2464
+ label: "oc\xB7vote",
2465
+ sub: "decide \u2014 polls",
2466
+ docsHref: "https://docs.ochk.io/vote",
2467
+ category: "protocol"
2468
+ },
2469
+ {
2470
+ slug: "stamp",
2471
+ origin: "https://stamp.ochk.io",
2472
+ hostname: "stamp.ochk.io",
2473
+ label: "oc\xB7stamp",
2474
+ sub: "declare \u2014 block-anchored",
2475
+ docsHref: "https://docs.ochk.io/stamp",
2476
+ category: "protocol"
2477
+ },
2478
+ {
2479
+ slug: "agent",
2480
+ origin: "https://agent.ochk.io",
2481
+ hostname: "agent.ochk.io",
2482
+ label: "oc\xB7agent",
2483
+ sub: "delegate \u2014 scoped auth",
2484
+ docsHref: "https://docs.ochk.io/agent",
2485
+ category: "protocol"
2486
+ },
2487
+ {
2488
+ slug: "pledge",
2489
+ origin: "https://pledge.ochk.io",
2490
+ hostname: "pledge.ochk.io",
2491
+ label: "oc\xB7pledge",
2492
+ sub: "swear \u2014 bonded commitment",
2493
+ docsHref: "https://docs.ochk.io/pledge",
2494
+ category: "protocol"
2495
+ },
2496
+ {
2497
+ slug: "analytics",
2498
+ origin: "https://analytics.ochk.io",
2499
+ hostname: "analytics.ochk.io",
2500
+ label: "oc\xB7analytics",
2501
+ sub: "owner cockpit",
2502
+ docsHref: "https://analytics.ochk.io",
2503
+ category: "owner"
2504
+ }
2505
+ ];
2506
+ var SITE_STATE_LABEL = {
2507
+ alpha: "alpha",
2508
+ beta: "beta"
2509
+ };
2510
+ function findFamilyProperty(slug) {
2511
+ return FAMILY_PROPERTIES.find((p) => p.slug === slug);
2512
+ }
2513
+ var SECTIONS = [
2514
+ { category: "hub", label: "hub" },
2515
+ { category: "product", label: "products" },
2516
+ { category: "protocol", label: "protocols" },
2517
+ { category: "owner", label: "owner" }
2518
+ ];
2519
+ function CategoryChip({ category }) {
2520
+ if (category === "hub") return null;
2521
+ const label = category === "product" ? "product" : category === "protocol" ? "protocol" : "owner";
2522
+ const tone = category === "product" ? "border-primary/25 bg-primary/10 text-primary" : category === "protocol" ? "border-muted-foreground/20 bg-muted/40 text-muted-foreground/85" : "border-warning/30 bg-warning/10 text-warning";
2523
+ return /* @__PURE__ */ jsx(
2524
+ "span",
2525
+ {
2526
+ "aria-label": category === "product" ? "commercial product" : category === "protocol" ? "protocol reference" : "owner-only surface",
2527
+ className: "ml-1 hidden rounded-sm border px-1.5 py-[1px] font-mono text-[9px] font-medium tracking-widest uppercase sm:inline-block " + tone,
2528
+ "data-oc-category": category,
2529
+ children: label
2530
+ }
2531
+ );
2532
+ }
2533
+ function SiteStateBadge({ state }) {
2534
+ if (state === "live") return null;
2535
+ return /* @__PURE__ */ jsx(
2536
+ "span",
2537
+ {
2538
+ "aria-label": `site lifecycle: ${state}`,
2539
+ className: "text-muted-foreground/70 ml-1 hidden font-mono text-[9px] font-medium tracking-widest uppercase sm:inline-block",
2540
+ "data-oc-site-state": state,
2541
+ children: SITE_STATE_LABEL[state]
2542
+ }
2543
+ );
2544
+ }
2545
+ function MenuCategoryChip({ category }) {
2546
+ if (category === "hub") return null;
2547
+ const label = category === "product" ? "pro" : category === "protocol" ? "spec" : "own";
2548
+ const tone = category === "product" ? "bg-primary/10 text-primary" : category === "protocol" ? "bg-muted/60 text-muted-foreground/80" : "bg-warning/15 text-warning";
2549
+ return /* @__PURE__ */ jsx(
2550
+ "span",
2551
+ {
2552
+ "aria-hidden": true,
2553
+ className: "inline-block shrink-0 rounded-sm px-1 py-[1px] font-mono text-[9px] font-medium tracking-widest uppercase " + tone,
2554
+ children: label
2555
+ }
2556
+ );
2557
+ }
2558
+ function OcLogoDropdown({
2559
+ current,
2560
+ homeHref = "/",
2561
+ siteState = "live",
2562
+ children,
2563
+ className,
2564
+ triggerClassName,
2565
+ popoverClassName,
2566
+ showOwnerEntries = false
2567
+ }) {
2568
+ const [open, setOpen] = useState(false);
2569
+ const containerRef = useRef(null);
2570
+ const menuId = useId();
2571
+ const router = useRouter();
2572
+ const currentCategory = findFamilyProperty(current)?.category ?? "hub";
2573
+ function handleTriggerClick(e) {
2574
+ if (e.detail >= 2) {
2575
+ e.preventDefault();
2576
+ setOpen(false);
2577
+ void router.push(homeHref);
2578
+ return;
2579
+ }
2580
+ setOpen((v) => !v);
2581
+ }
2582
+ useEffect(() => {
2583
+ if (!open) return;
2584
+ function onDoc(e) {
2585
+ if (!containerRef.current) return;
2586
+ if (!containerRef.current.contains(e.target)) setOpen(false);
2587
+ }
2588
+ function onKey(e) {
2589
+ if (e.key === "Escape") setOpen(false);
2590
+ }
2591
+ document.addEventListener("mousedown", onDoc);
2592
+ document.addEventListener("keydown", onKey);
2593
+ return () => {
2594
+ document.removeEventListener("mousedown", onDoc);
2595
+ document.removeEventListener("keydown", onKey);
2596
+ };
2597
+ }, [open]);
2598
+ return /* @__PURE__ */ jsxs(
2599
+ "div",
2600
+ {
2601
+ ref: containerRef,
2602
+ className: "relative inline-flex items-center " + (className ?? ""),
2603
+ "data-oc-logo-dropdown": "",
2604
+ "data-oc-current-category": currentCategory,
2605
+ "data-oc-site-state": siteState,
2606
+ children: [
2607
+ /* @__PURE__ */ jsxs(
2608
+ "button",
2609
+ {
2610
+ type: "button",
2611
+ "aria-haspopup": "menu",
2612
+ "aria-expanded": open,
2613
+ "aria-controls": menuId,
2614
+ "aria-label": "OrangeCheck family \xB7 click to open property menu, double-click to go home",
2615
+ title: "single-click \xB7 family menu \xB7 double-click \xB7 go home",
2616
+ onClick: handleTriggerClick,
2617
+ className: triggerClassName ?? "group hover:bg-accent/30 -mx-1.5 -my-1 flex min-h-[40px] items-center gap-2 rounded-sm px-1.5 py-1 transition-colors " + (open ? "bg-accent/20" : ""),
2618
+ "data-oc-logo-dropdown-trigger": "",
2619
+ "data-oc-logo-dropdown-open": open ? "true" : "false",
2620
+ children: [
2621
+ children,
2622
+ /* @__PURE__ */ jsx(CategoryChip, { category: currentCategory }),
2623
+ /* @__PURE__ */ jsx(SiteStateBadge, { state: siteState }),
2624
+ /* @__PURE__ */ jsx(
2625
+ ChevronDown,
2626
+ {
2627
+ "aria-hidden": true,
2628
+ className: "text-muted-foreground/70 group-hover:text-foreground/80 h-3.5 w-3.5 shrink-0 transition-transform duration-200 " + (open ? "rotate-180" : "")
2629
+ }
2630
+ )
2631
+ ]
2632
+ }
2633
+ ),
2634
+ /* @__PURE__ */ jsxs(
2635
+ Link6,
2636
+ {
2637
+ href: homeHref,
2638
+ "aria-label": "go to " + homeHref + " (this site's home)",
2639
+ onClick: () => setOpen(false),
2640
+ tabIndex: open ? 0 : -1,
2641
+ className: "hover:text-primary group/home -ml-1 hidden items-center gap-1 rounded-sm px-1.5 py-1 font-mono text-[9px] tracking-widest uppercase transition-all duration-200 sm:inline-flex " + (open ? "pointer-events-auto translate-x-0 text-muted-foreground/70 opacity-100 hover:bg-accent/30" : "pointer-events-none -translate-x-1 opacity-0"),
2642
+ "data-oc-logo-dropdown-home-hint": "",
2643
+ children: [
2644
+ /* @__PURE__ */ jsx(
2645
+ CornerDownLeft,
2646
+ {
2647
+ "aria-hidden": true,
2648
+ className: "h-3 w-3 group-hover/home:text-primary " + (open ? "motion-safe:animate-pulse" : "")
2649
+ }
2650
+ ),
2651
+ /* @__PURE__ */ jsx("span", { className: "text-primary/70 group-hover/home:text-primary", children: "home" })
2652
+ ]
2653
+ }
2654
+ ),
2655
+ open && /* @__PURE__ */ jsxs(
2656
+ "div",
2657
+ {
2658
+ id: menuId,
2659
+ role: "menu",
2660
+ "aria-label": "OrangeCheck family",
2661
+ className: popoverClassName ?? "bg-background absolute top-full left-0 z-[60] mt-2 w-[min(20rem,calc(100vw-1rem))] border shadow-lg",
2662
+ "data-oc-logo-dropdown-popover": "",
2663
+ children: [
2664
+ /* @__PURE__ */ jsx("div", { className: "label-mono text-primary border-b px-4 py-2", children: "\xA7 the orangecheck family" }),
2665
+ /* @__PURE__ */ jsx("div", { className: "max-h-[min(28rem,70vh)] overflow-y-auto py-1", role: "none", children: SECTIONS.map(({ category, label }) => {
2666
+ if (category === "owner" && !showOwnerEntries) return null;
2667
+ const sectionEntries = FAMILY_PROPERTIES.filter(
2668
+ (e) => e.category === category
2669
+ );
2670
+ if (sectionEntries.length === 0) return null;
2671
+ return /* @__PURE__ */ jsxs("div", { role: "none", "data-oc-section": category, children: [
2672
+ /* @__PURE__ */ jsx(
2673
+ "div",
2674
+ {
2675
+ role: "separator",
2676
+ "aria-hidden": true,
2677
+ className: "text-muted-foreground/60 px-4 pt-2.5 pb-1 font-mono text-[9px] font-medium tracking-widest uppercase " + (category === "hub" ? "" : "border-t mt-1"),
2678
+ children: label
2679
+ }
2680
+ ),
2681
+ /* @__PURE__ */ jsx("ul", { role: "none", className: "pb-1", children: sectionEntries.map((e) => {
2682
+ const isActive2 = e.slug === current;
2683
+ const href = isActive2 ? homeHref : e.origin;
2684
+ return /* @__PURE__ */ jsx("li", { role: "none", children: /* @__PURE__ */ jsxs(
2685
+ Link6,
2686
+ {
2687
+ href,
2688
+ role: "menuitem",
2689
+ onClick: () => setOpen(false),
2690
+ "aria-current": isActive2 ? "page" : void 0,
2691
+ className: "group flex items-center gap-2 px-4 py-2 transition-colors " + (isActive2 ? "bg-primary/8 border-primary -ml-px border-l-2" : "hover:bg-muted -ml-px border-l-2 border-transparent"),
2692
+ "data-oc-logo-dropdown-item": isActive2 ? "current" : "sibling",
2693
+ "data-oc-entry-category": e.category,
2694
+ children: [
2695
+ /* @__PURE__ */ jsxs("span", { className: "flex min-w-0 flex-1 flex-col leading-tight", children: [
2696
+ /* @__PURE__ */ jsx(
2697
+ "span",
2698
+ {
2699
+ className: "font-display text-[12px] font-semibold tracking-tight " + (isActive2 ? "text-primary" : "text-foreground group-hover:text-primary transition-colors"),
2700
+ children: e.label
2701
+ }
2702
+ ),
2703
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground mt-0.5 font-mono text-[10px] tracking-wide", children: e.sub })
2704
+ ] }),
2705
+ /* @__PURE__ */ jsx(MenuCategoryChip, { category: e.category }),
2706
+ isActive2 ? /* @__PURE__ */ jsxs("span", { className: "text-primary inline-flex shrink-0 items-center gap-1 font-mono text-[10px] tracking-widest uppercase", children: [
2707
+ "home",
2708
+ /* @__PURE__ */ jsx(Check, { className: "h-3 w-3" })
2709
+ ] }) : null
2710
+ ]
2711
+ }
2712
+ ) }, e.slug);
2713
+ }) })
2714
+ ] }, category);
2715
+ }) }),
2716
+ /* @__PURE__ */ jsx("div", { className: "border-t px-4 py-2 font-mono text-[10px] tracking-widest uppercase", children: /* @__PURE__ */ jsx(
2717
+ Link6,
2718
+ {
2719
+ href: "https://docs.ochk.io",
2720
+ onClick: () => setOpen(false),
2721
+ className: "text-muted-foreground hover:text-foreground inline-block transition-colors",
2722
+ children: "docs.ochk.io \u2192"
2723
+ }
2724
+ ) })
2725
+ ]
2726
+ }
2727
+ )
2728
+ ]
2729
+ }
2730
+ );
2731
+ }
2732
+ function obscureIdentity(value) {
2733
+ if (value.length <= 12) {
2734
+ return `${value.slice(0, 4)}\u2026${value.slice(-3)}`;
2735
+ }
2736
+ return `${value.slice(0, 6)}\u2026${value.slice(-4)}`;
2737
+ }
2738
+ var IDENTITY_KIND_LABEL = {
2739
+ did: "did:oc",
2740
+ btc: "bitcoin",
2741
+ email: "email",
2742
+ nostr: "nostr"
2743
+ };
2744
+ async function writeClipboard(text) {
2745
+ try {
2746
+ if (navigator.clipboard?.writeText) {
2747
+ await navigator.clipboard.writeText(text);
2748
+ return true;
2749
+ }
2750
+ } catch {
2751
+ }
2752
+ try {
2753
+ const ta = document.createElement("textarea");
2754
+ ta.value = text;
2755
+ ta.setAttribute("readonly", "");
2756
+ ta.style.position = "fixed";
2757
+ ta.style.top = "-1000px";
2758
+ ta.style.opacity = "0";
2759
+ document.body.appendChild(ta);
2760
+ ta.select();
2761
+ const ok = document.execCommand("copy");
2762
+ document.body.removeChild(ta);
2763
+ return ok;
2764
+ } catch {
2765
+ return false;
2766
+ }
2767
+ }
2768
+ function CopyableDid({ did }) {
2769
+ const [copied, setCopied] = useState(false);
2770
+ const timerRef = useRef(null);
2771
+ useEffect(
2772
+ () => () => {
2773
+ if (timerRef.current) clearTimeout(timerRef.current);
2774
+ },
2775
+ []
2776
+ );
2777
+ const onCopy = async () => {
2778
+ const ok = await writeClipboard(did);
2779
+ if (!ok) return;
2780
+ setCopied(true);
2781
+ if (timerRef.current) clearTimeout(timerRef.current);
2782
+ timerRef.current = setTimeout(() => setCopied(false), 1600);
2783
+ };
2784
+ return /* @__PURE__ */ jsxs(
2785
+ "button",
2786
+ {
2787
+ type: "button",
2788
+ onClick: onCopy,
2789
+ "aria-label": copied ? "OrangeCheck identity copied to clipboard" : `Copy OrangeCheck identity ${did} to clipboard`,
2790
+ title: "Copy identity",
2791
+ "data-oc-account-menu-copy-did": "",
2792
+ "data-copied": copied ? "" : void 0,
2793
+ className: "group/did hover:bg-accent focus-visible:ring-ring/60 -mx-1.5 mt-px flex w-[calc(100%+0.75rem)] items-start gap-1.5 rounded px-1.5 py-1 text-left transition-colors focus-visible:ring-2 focus-visible:outline-none",
2794
+ children: [
2795
+ /* @__PURE__ */ jsx("span", { className: "text-foreground/90 min-w-0 flex-1 font-mono text-[11px] leading-tight break-all", children: did }),
2796
+ /* @__PURE__ */ jsx(
2797
+ "span",
2798
+ {
2799
+ className: "mt-px shrink-0 transition-colors " + (copied ? "text-primary" : "text-muted-foreground/50 group-hover/did:text-foreground/80"),
2800
+ "aria-hidden": true,
2801
+ children: copied ? /* @__PURE__ */ jsx(Check, { className: "size-3.5" }) : /* @__PURE__ */ jsx(Copy, { className: "size-3.5" })
2802
+ }
2803
+ ),
2804
+ /* @__PURE__ */ jsx("span", { className: "sr-only", "aria-live": "polite", children: copied ? "Copied to clipboard" : "" })
2805
+ ]
2806
+ }
2807
+ );
2808
+ }
2809
+ function PromoteRow({
2810
+ kind,
2811
+ value,
2812
+ active,
2813
+ busy,
2814
+ disabled,
2815
+ onPromote
2816
+ }) {
2817
+ const [copied, setCopied] = useState(false);
2818
+ const timerRef = useRef(null);
2819
+ useEffect(
2820
+ () => () => {
2821
+ if (timerRef.current) clearTimeout(timerRef.current);
2822
+ },
2823
+ []
2824
+ );
2825
+ const onCopy = async () => {
2826
+ const ok = await writeClipboard(value);
2827
+ if (!ok) return;
2828
+ setCopied(true);
2829
+ if (timerRef.current) clearTimeout(timerRef.current);
2830
+ timerRef.current = setTimeout(() => setCopied(false), 1600);
2831
+ };
2832
+ const kindLabel = IDENTITY_KIND_LABEL[kind];
2833
+ return /* @__PURE__ */ jsxs(
2834
+ "div",
2835
+ {
2836
+ className: "hover:bg-accent flex items-center gap-1 pr-2 transition-colors",
2837
+ "data-oc-account-menu-promote-row": kind,
2838
+ "data-active": active ? "" : void 0,
2839
+ children: [
2840
+ /* @__PURE__ */ jsxs(
2841
+ "button",
2842
+ {
2843
+ type: "button",
2844
+ role: "menuitemradio",
2845
+ "aria-checked": active,
2846
+ "aria-label": active ? `Showing as ${kindLabel}` : `Show as ${kindLabel}`,
2847
+ disabled: disabled || active,
2848
+ onClick: onPromote,
2849
+ "data-oc-account-menu-promote": kind,
2850
+ className: "flex min-w-0 flex-1 items-center gap-2 py-2 pl-3 text-left font-mono text-[11px] tracking-wide disabled:cursor-default",
2851
+ children: [
2852
+ /* @__PURE__ */ jsx(
2853
+ "span",
2854
+ {
2855
+ className: "flex size-3.5 shrink-0 items-center justify-center rounded-full border " + (active ? "border-primary" : "border-muted-foreground/40"),
2856
+ "aria-hidden": true,
2857
+ children: active ? /* @__PURE__ */ jsx("span", { className: "bg-primary size-1.5 rounded-full" }) : null
2858
+ }
2859
+ ),
2860
+ /* @__PURE__ */ jsx("span", { className: "text-foreground/90 min-w-0 flex-1 truncate", children: obscureIdentity(value) })
2861
+ ]
2862
+ }
2863
+ ),
2864
+ /* @__PURE__ */ jsx(
2865
+ "button",
2866
+ {
2867
+ type: "button",
2868
+ onClick: () => void onCopy(),
2869
+ "aria-label": copied ? `${kindLabel} copied to clipboard` : `Copy ${kindLabel} to clipboard`,
2870
+ title: "Copy",
2871
+ "data-oc-account-menu-promote-copy": kind,
2872
+ "data-copied": copied ? "" : void 0,
2873
+ className: "hover:bg-background/70 focus-visible:ring-ring/60 flex size-6 shrink-0 items-center justify-center rounded transition-colors focus-visible:ring-2 focus-visible:outline-none",
2874
+ children: copied ? /* @__PURE__ */ jsx(Check, { className: "text-primary size-3.5" }) : /* @__PURE__ */ jsx(Copy, { className: "text-muted-foreground/50 size-3.5" })
2875
+ }
2876
+ ),
2877
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground/50 w-14 shrink-0 text-right text-[9px] tracking-widest uppercase", children: busy ? /* @__PURE__ */ jsx(Loader2, { className: "ml-auto size-3 animate-spin" }) : kindLabel }),
2878
+ /* @__PURE__ */ jsx("span", { className: "sr-only", "aria-live": "polite", children: copied ? "Copied to clipboard" : "" })
2879
+ ]
2880
+ }
2881
+ );
2882
+ }
2883
+ function IdentityPromoteSection({
2884
+ didOc,
2885
+ nostrNpub,
2886
+ current,
2887
+ open,
2888
+ setDisplayIdentity
2889
+ }) {
2890
+ const [identities, setIdentities] = useState(null);
2891
+ const [loadFailed, setLoadFailed] = useState(false);
2892
+ const [promoting, setPromoting] = useState(null);
2893
+ const [promoteErr, setPromoteErr] = useState(null);
2894
+ const lastFetchKeyRef = useRef(null);
2895
+ useEffect(() => {
2896
+ if (!open) return;
2897
+ if (lastFetchKeyRef.current === didOc) return;
2898
+ lastFetchKeyRef.current = didOc;
2899
+ let cancelled = false;
2900
+ setIdentities(null);
2901
+ setLoadFailed(false);
2902
+ void fetchOcLinkedIdentities().then((rows) => {
2903
+ if (!cancelled) setIdentities(rows);
2904
+ }).catch(() => {
2905
+ if (!cancelled) setLoadFailed(true);
2906
+ });
2907
+ return () => {
2908
+ cancelled = true;
2909
+ };
2910
+ }, [open, didOc]);
2911
+ if (identities === null && !loadFailed) return null;
2912
+ const btc = identities?.find((i) => i.kind === "btc" && i.is_primary && i.value) ?? identities?.find((i) => i.kind === "btc" && i.value);
2913
+ const email = identities?.find((i) => i.kind === "email" && i.is_primary && i.value) ?? identities?.find((i) => i.kind === "email" && i.value);
2914
+ const options = [
2915
+ { kind: "did", value: didOc }
2916
+ ];
2917
+ if (btc?.value) options.push({ kind: "btc", value: btc.value });
2918
+ if (email?.value) options.push({ kind: "email", value: email.value });
2919
+ if (nostrNpub) options.push({ kind: "nostr", value: nostrNpub });
2920
+ if (options.length < 2) return null;
2921
+ const promote = async (kind) => {
2922
+ if (promoting || kind === current.kind) return;
2923
+ setPromoting(kind);
2924
+ setPromoteErr(null);
2925
+ try {
2926
+ await setDisplayIdentity(kind);
2927
+ } catch (e) {
2928
+ setPromoteErr(e instanceof Error ? e.message : "promotion failed");
2929
+ } finally {
2930
+ setPromoting(null);
2931
+ }
2932
+ };
2933
+ return /* @__PURE__ */ jsxs("div", { className: "border-border border-b p-1", "data-oc-account-menu-section": "show-as", children: [
2934
+ /* @__PURE__ */ jsx("div", { className: "text-muted-foreground/60 px-3 pt-2 pb-1 font-mono text-[10px] tracking-widest uppercase", children: "\xA7 show as" }),
2935
+ options.map((opt) => /* @__PURE__ */ jsx(
2936
+ PromoteRow,
2937
+ {
2938
+ kind: opt.kind,
2939
+ value: opt.value,
2940
+ active: opt.kind === current.kind,
2941
+ busy: promoting === opt.kind,
2942
+ disabled: promoting !== null,
2943
+ onPromote: () => void promote(opt.kind)
2944
+ },
2945
+ opt.kind
2946
+ )),
2947
+ promoteErr ? /* @__PURE__ */ jsx("div", { className: "text-destructive/80 px-3 pt-1 pb-2 font-mono text-[10px]", children: promoteErr }) : null
2948
+ ] });
2949
+ }
2950
+ function OcAccountMenu(props) {
2951
+ const session = useOcSession();
2952
+ return /* @__PURE__ */ jsx(
2953
+ OcAccountMenuView,
2954
+ {
2955
+ ...props,
2956
+ session: {
2957
+ status: session.status,
2958
+ account: session.account ? {
2959
+ didOc: session.account.didOc,
2960
+ displayName: session.account.displayName ?? null,
2961
+ displayIdentity: session.account.displayIdentity,
2962
+ nostrNpub: session.account.nostrNpub ?? null
2963
+ } : null,
2964
+ signOut: session.signOut,
2965
+ refresh: session.refresh,
2966
+ setDisplayIdentity: session.setDisplayIdentity,
2967
+ // Multi-account · the connected variant always forwards
2968
+ // these from useOcSession(). The View variant accepts
2969
+ // them as optional so sites running their own auth
2970
+ // context (oc-www) can opt in incrementally.
2971
+ roster: session.roster,
2972
+ switchAccount: session.switchAccount,
2973
+ addAccountUrl: session.addAccountUrl
2974
+ }
2975
+ }
2976
+ );
2977
+ }
2978
+ function OcAccountMenuView({
2979
+ current,
2980
+ signInUrl = "/signin",
2981
+ signInLabel = "sign in",
2982
+ signOutRedirect = "/",
2983
+ menuItems,
2984
+ primaryNavLinks,
2985
+ secondaryNavLinks,
2986
+ showFamilyDashboard,
2987
+ build,
2988
+ siteState,
2989
+ className,
2990
+ triggerClassName,
2991
+ popoverClassName,
2992
+ session
2993
+ }) {
2994
+ const {
2995
+ status,
2996
+ account,
2997
+ signOut,
2998
+ refresh,
2999
+ setDisplayIdentity,
3000
+ roster,
3001
+ switchAccount,
3002
+ addAccountUrl
3003
+ } = session;
3004
+ const [hydrated, setHydrated] = useState(false);
3005
+ const [open, setOpen] = useState(false);
3006
+ const wrapRef = useRef(null);
3007
+ const property = findFamilyProperty(current);
3008
+ const hostname = property?.hostname ?? `${current}.ochk.io`;
3009
+ const isHome = current === "home";
3010
+ const familyDashboardEnabled = showFamilyDashboard ?? !isHome;
3011
+ useEffect(() => setHydrated(true), []);
3012
+ useEffect(() => {
3013
+ const onWake = () => {
3014
+ if (document.visibilityState === "visible") void refresh();
3015
+ };
3016
+ const onFocus = () => void refresh();
3017
+ document.addEventListener("visibilitychange", onWake);
3018
+ window.addEventListener("focus", onFocus);
3019
+ return () => {
3020
+ document.removeEventListener("visibilitychange", onWake);
3021
+ window.removeEventListener("focus", onFocus);
3022
+ };
3023
+ }, [refresh]);
3024
+ useEffect(() => {
3025
+ if (!open) return;
3026
+ const onClick = (e) => {
3027
+ if (wrapRef.current && !wrapRef.current.contains(e.target)) setOpen(false);
3028
+ };
3029
+ const onKey = (e) => {
3030
+ if (e.key === "Escape") setOpen(false);
3031
+ };
3032
+ document.addEventListener("mousedown", onClick);
3033
+ document.addEventListener("keydown", onKey);
3034
+ return () => {
3035
+ document.removeEventListener("mousedown", onClick);
3036
+ document.removeEventListener("keydown", onKey);
3037
+ };
3038
+ }, [open]);
3039
+ const signInTrigger = /* @__PURE__ */ jsx(
3040
+ "a",
3041
+ {
3042
+ href: signInUrl,
3043
+ "aria-label": signInLabel,
3044
+ "data-oc-account-menu-signin": "",
3045
+ className: triggerClassName ?? "border-input bg-background hover:bg-accent inline-flex h-8 items-center justify-center rounded-md border px-3 font-mono text-[11px] font-semibold tracking-widest uppercase transition-colors",
3046
+ children: signInLabel
3047
+ }
3048
+ );
3049
+ if (!hydrated || status === "loading") {
3050
+ return signInTrigger;
3051
+ }
3052
+ if (status !== "authenticated" || !account) {
3053
+ return signInTrigger;
3054
+ }
3055
+ const displayName = account.displayName ?? null;
3056
+ const label = displayName ?? obscureIdentity(account.displayIdentity.value);
3057
+ return /* @__PURE__ */ jsxs(
3058
+ "div",
3059
+ {
3060
+ ref: wrapRef,
3061
+ className: "relative inline-block " + (className ?? ""),
3062
+ "data-oc-account-menu": "",
3063
+ children: [
3064
+ /* @__PURE__ */ jsxs(
3065
+ "button",
3066
+ {
3067
+ type: "button",
3068
+ onClick: () => setOpen((v) => !v),
3069
+ "aria-haspopup": "menu",
3070
+ "aria-expanded": open,
3071
+ "aria-label": `Signed in as ${account.didOc}. Open account menu.`,
3072
+ className: triggerClassName ?? "border-primary/40 bg-card hover:bg-accent inline-flex h-8 items-center gap-1.5 rounded-md border px-3 font-mono text-[11px] tracking-wide transition-colors",
3073
+ "data-oc-account-menu-trigger": "",
3074
+ children: [
3075
+ /* @__PURE__ */ jsx("span", { className: "bg-primary inline-block size-1.5 rounded-full", "aria-hidden": true }),
3076
+ /* @__PURE__ */ jsx("span", { className: "text-foreground", children: label }),
3077
+ /* @__PURE__ */ jsx(
3078
+ "svg",
3079
+ {
3080
+ width: "9",
3081
+ height: "9",
3082
+ viewBox: "0 0 10 10",
3083
+ "aria-hidden": true,
3084
+ className: "opacity-60 transition-transform " + (open ? "rotate-180" : "rotate-0"),
3085
+ children: /* @__PURE__ */ jsx(
3086
+ "path",
3087
+ {
3088
+ d: "M2 4 L5 7 L8 4",
3089
+ stroke: "currentColor",
3090
+ strokeWidth: "1.5",
3091
+ fill: "none",
3092
+ strokeLinecap: "round"
3093
+ }
3094
+ )
3095
+ }
3096
+ )
3097
+ ]
3098
+ }
3099
+ ),
3100
+ open && /* @__PURE__ */ jsxs(
3101
+ "div",
3102
+ {
3103
+ role: "menu",
3104
+ "aria-label": "Account menu",
3105
+ className: popoverClassName ?? "border-border bg-popover text-popover-foreground absolute top-[calc(100%+6px)] right-0 z-50 w-[min(20rem,calc(100vw-1rem))] border shadow-xl",
3106
+ "data-oc-account-menu-popover": "",
3107
+ children: [
3108
+ /* @__PURE__ */ jsxs("div", { className: "border-border border-b p-3", children: [
3109
+ /* @__PURE__ */ jsxs("div", { className: "text-primary mb-1 font-mono text-[10px] tracking-widest uppercase", children: [
3110
+ "\xA7 signed in \xB7 ",
3111
+ hostname
3112
+ ] }),
3113
+ /* @__PURE__ */ jsx(CopyableDid, { did: account.didOc }),
3114
+ displayName ? /* @__PURE__ */ jsx("div", { className: "text-muted-foreground/80 mt-1 font-mono text-[10px] tracking-wide", children: displayName }) : null
3115
+ ] }),
3116
+ /* @__PURE__ */ jsx(
3117
+ IdentityPromoteSection,
3118
+ {
3119
+ didOc: account.didOc,
3120
+ nostrNpub: account.nostrNpub ?? null,
3121
+ current: account.displayIdentity,
3122
+ open,
3123
+ setDisplayIdentity
3124
+ }
3125
+ ),
3126
+ /* @__PURE__ */ jsx(
3127
+ AccountsSection,
3128
+ {
3129
+ roster: roster ?? [],
3130
+ switchAccount,
3131
+ addAccountUrl,
3132
+ signOut,
3133
+ onActionStart: () => setOpen(false)
3134
+ }
3135
+ ),
3136
+ primaryNavLinks && primaryNavLinks.length > 0 ? /* @__PURE__ */ jsx(
3137
+ PopoverSection,
3138
+ {
3139
+ label: "navigate",
3140
+ items: primaryNavLinks,
3141
+ onItemClick: () => setOpen(false)
3142
+ }
3143
+ ) : null,
3144
+ /* @__PURE__ */ jsxs("div", { className: "p-1", "data-oc-account-menu-section": "account", children: [
3145
+ primaryNavLinks && primaryNavLinks.length > 0 ? /* @__PURE__ */ jsx("div", { className: "text-muted-foreground/60 px-3 pb-1 pt-2 font-mono text-[10px] tracking-widest uppercase", children: "\xA7 account" }) : null,
3146
+ menuItems?.map((item) => {
3147
+ const onClick = () => setOpen(false);
3148
+ const cls = "hover:bg-accent flex items-center gap-2 px-3 py-2 font-mono text-[11px] tracking-wide transition-colors";
3149
+ const inner = /* @__PURE__ */ jsxs(Fragment, { children: [
3150
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", "aria-hidden": true, children: "\u2192" }),
3151
+ /* @__PURE__ */ jsx("span", { className: "flex-1", children: item.label }),
3152
+ item.external ? /* @__PURE__ */ jsx(
3153
+ "span",
3154
+ {
3155
+ className: "text-muted-foreground/70 text-[10px]",
3156
+ "aria-hidden": true,
3157
+ children: "\u2197"
3158
+ }
3159
+ ) : null
3160
+ ] });
3161
+ return item.external ? /* @__PURE__ */ jsx(
3162
+ "a",
3163
+ {
3164
+ href: item.href,
3165
+ target: "_blank",
3166
+ rel: "noreferrer",
3167
+ onClick,
3168
+ role: "menuitem",
3169
+ className: cls,
3170
+ "data-oc-account-menu-item": "",
3171
+ children: inner
3172
+ },
3173
+ item.href
3174
+ ) : /* @__PURE__ */ jsx(
3175
+ Link6,
3176
+ {
3177
+ href: item.href,
3178
+ onClick,
3179
+ role: "menuitem",
3180
+ className: cls,
3181
+ "data-oc-account-menu-item": "",
3182
+ children: inner
3183
+ },
3184
+ item.href
3185
+ );
3186
+ }),
3187
+ familyDashboardEnabled ? /* @__PURE__ */ jsxs(
3188
+ "a",
3189
+ {
3190
+ href: "https://ochk.io/dashboard",
3191
+ target: "_blank",
3192
+ rel: "noreferrer",
3193
+ onClick: () => setOpen(false),
3194
+ role: "menuitem",
3195
+ className: "hover:bg-accent flex items-center gap-2 px-3 py-2 font-mono text-[11px] tracking-wide transition-colors",
3196
+ "data-oc-account-menu-item": "",
3197
+ "data-oc-account-menu-family-dashboard": "",
3198
+ children: [
3199
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", "aria-hidden": true, children: "\u2192" }),
3200
+ /* @__PURE__ */ jsx("span", { className: "flex-1", children: "family dashboard" }),
3201
+ /* @__PURE__ */ jsx(
3202
+ "span",
3203
+ {
3204
+ className: "text-muted-foreground/70 text-[10px]",
3205
+ "aria-hidden": true,
3206
+ children: "\u2197"
3207
+ }
3208
+ )
3209
+ ]
3210
+ }
3211
+ ) : null,
3212
+ /* @__PURE__ */ jsxs(
3213
+ "button",
3214
+ {
3215
+ type: "button",
3216
+ role: "menuitem",
3217
+ onClick: () => {
3218
+ setOpen(false);
3219
+ void (async () => {
3220
+ await signOut();
3221
+ if (typeof window !== "undefined") {
3222
+ window.location.assign(signOutRedirect);
3223
+ }
3224
+ })();
3225
+ },
3226
+ className: "hover:bg-accent flex w-full items-center gap-2 px-3 py-2 text-left font-mono text-[11px] tracking-wide transition-colors",
3227
+ "data-oc-account-menu-item": "",
3228
+ "data-oc-account-menu-signout": "",
3229
+ children: [
3230
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", "aria-hidden": true, children: "\u2192" }),
3231
+ /* @__PURE__ */ jsx("span", { className: "flex-1", children: "sign out" })
3232
+ ]
3233
+ }
3234
+ )
3235
+ ] }),
3236
+ secondaryNavLinks && secondaryNavLinks.length > 0 ? /* @__PURE__ */ jsx(
3237
+ PopoverSection,
3238
+ {
3239
+ label: "more",
3240
+ items: secondaryNavLinks,
3241
+ onItemClick: () => setOpen(false),
3242
+ bordered: true
3243
+ }
3244
+ ) : null,
3245
+ build ? /* @__PURE__ */ jsx(BuildFooter, { hostname, build, state: siteState }) : null
3246
+ ]
3247
+ }
3248
+ )
3249
+ ]
3250
+ }
3251
+ );
3252
+ }
3253
+ function AccountsSection({
3254
+ roster,
3255
+ switchAccount,
3256
+ addAccountUrl,
3257
+ signOut,
3258
+ onActionStart
3259
+ }) {
3260
+ const [switching, setSwitching] = useState(null);
3261
+ const [err, setErr] = useState(null);
3262
+ if (!addAccountUrl) return null;
3263
+ const onSwitch = async (didOc) => {
3264
+ if (!switchAccount || switching) return;
3265
+ setSwitching(didOc);
3266
+ setErr(null);
3267
+ try {
3268
+ await switchAccount(didOc);
3269
+ } catch (e) {
3270
+ setErr(e instanceof Error ? e.message : "switch failed");
3271
+ } finally {
3272
+ setSwitching(null);
3273
+ }
3274
+ };
3275
+ return /* @__PURE__ */ jsxs("div", { className: "border-border border-b p-1", "data-oc-account-menu-section": "accounts", children: [
3276
+ /* @__PURE__ */ jsx("div", { className: "text-muted-foreground/60 px-3 pt-2 pb-1 font-mono text-[10px] tracking-widest uppercase", children: "\xA7 accounts" }),
3277
+ roster.map((peer) => /* @__PURE__ */ jsx(
3278
+ SwitchRow,
3279
+ {
3280
+ peer,
3281
+ busy: switching === peer.didOc,
3282
+ disabled: switching !== null,
3283
+ onSwitch: () => void onSwitch(peer.didOc)
3284
+ },
3285
+ peer.didOc
3286
+ )),
3287
+ /* @__PURE__ */ jsxs(
3288
+ "a",
3289
+ {
3290
+ href: addAccountUrl(),
3291
+ onClick: () => onActionStart(),
3292
+ role: "menuitem",
3293
+ "data-oc-account-menu-add-account": "",
3294
+ className: "hover:bg-accent flex items-center gap-2 px-3 py-2 font-mono text-[11px] tracking-wide transition-colors",
3295
+ children: [
3296
+ /* @__PURE__ */ jsx(Plus, { className: "text-muted-foreground size-3.5 shrink-0", "aria-hidden": true }),
3297
+ /* @__PURE__ */ jsx("span", { className: "flex-1", children: roster.length === 0 ? "add another account" : "add another" })
3298
+ ]
3299
+ }
3300
+ ),
3301
+ roster.length > 0 ? /* @__PURE__ */ jsxs(
3302
+ "button",
3303
+ {
3304
+ type: "button",
3305
+ role: "menuitem",
3306
+ onClick: () => {
3307
+ onActionStart();
3308
+ void (async () => {
3309
+ try {
3310
+ await signOut({ scope: "current" });
3311
+ } catch {
3312
+ }
3313
+ })();
3314
+ },
3315
+ "data-oc-account-menu-leave-current": "",
3316
+ className: "hover:bg-accent flex w-full items-center gap-2 px-3 py-2 text-left font-mono text-[11px] tracking-wide transition-colors",
3317
+ children: [
3318
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", "aria-hidden": true, children: "\u2192" }),
3319
+ /* @__PURE__ */ jsx("span", { className: "flex-1", children: "leave this account" })
3320
+ ]
3321
+ }
3322
+ ) : null,
3323
+ err ? /* @__PURE__ */ jsx("div", { className: "text-destructive/80 px-3 pt-1 pb-2 font-mono text-[10px]", children: err }) : null
3324
+ ] });
3325
+ }
3326
+ function SwitchRow({
3327
+ peer,
3328
+ busy,
3329
+ disabled,
3330
+ onSwitch
3331
+ }) {
3332
+ const label = peer.displayName ?? obscureIdentity(peer.displayIdentity.value);
3333
+ const kindLabel = IDENTITY_KIND_LABEL[peer.displayIdentity.kind];
3334
+ return /* @__PURE__ */ jsxs(
3335
+ "button",
3336
+ {
3337
+ type: "button",
3338
+ role: "menuitemradio",
3339
+ "aria-checked": false,
3340
+ "aria-label": `Switch to ${peer.didOc}`,
3341
+ disabled,
3342
+ onClick: onSwitch,
3343
+ "data-oc-account-menu-switch-row": "",
3344
+ className: "hover:bg-accent flex w-full items-center gap-2 px-3 py-2 text-left font-mono text-[11px] tracking-wide transition-colors disabled:cursor-default",
3345
+ children: [
3346
+ /* @__PURE__ */ jsx(
3347
+ "span",
3348
+ {
3349
+ className: "border-muted-foreground/40 flex size-3.5 shrink-0 items-center justify-center rounded-full border",
3350
+ "aria-hidden": true
3351
+ }
3352
+ ),
3353
+ /* @__PURE__ */ jsx("span", { className: "text-foreground/90 min-w-0 flex-1 truncate", children: label }),
3354
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground/50 w-14 shrink-0 text-right text-[9px] tracking-widest uppercase", children: busy ? /* @__PURE__ */ jsx(Loader2, { className: "ml-auto size-3 animate-spin" }) : kindLabel })
3355
+ ]
3356
+ }
3357
+ );
3358
+ }
3359
+ function PopoverSection({
3360
+ label,
3361
+ items,
3362
+ onItemClick,
3363
+ bordered
3364
+ }) {
3365
+ const cls = "hover:bg-accent flex items-center gap-2 px-3 py-2 font-mono text-[11px] tracking-wide transition-colors";
3366
+ return /* @__PURE__ */ jsxs(
3367
+ "div",
3368
+ {
3369
+ className: "p-1 " + (bordered ? "border-border border-t" : ""),
3370
+ "data-oc-account-menu-section": label,
3371
+ children: [
3372
+ /* @__PURE__ */ jsxs("div", { className: "text-muted-foreground/60 px-3 pt-2 pb-1 font-mono text-[10px] tracking-widest uppercase", children: [
3373
+ "\xA7 ",
3374
+ label
3375
+ ] }),
3376
+ items.map((item) => {
3377
+ const inner = /* @__PURE__ */ jsxs(Fragment, { children: [
3378
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", "aria-hidden": true, children: "\u2192" }),
3379
+ /* @__PURE__ */ jsx("span", { className: "flex-1", children: item.label }),
3380
+ item.external ? /* @__PURE__ */ jsx(
3381
+ "span",
3382
+ {
3383
+ className: "text-muted-foreground/70 text-[10px]",
3384
+ "aria-hidden": true,
3385
+ children: "\u2197"
3386
+ }
3387
+ ) : null
3388
+ ] });
3389
+ return item.external ? /* @__PURE__ */ jsx(
3390
+ "a",
3391
+ {
3392
+ href: item.href,
3393
+ target: "_blank",
3394
+ rel: "noreferrer",
3395
+ onClick: onItemClick,
3396
+ role: "menuitem",
3397
+ className: cls,
3398
+ "data-oc-account-menu-item": "",
3399
+ children: inner
3400
+ },
3401
+ item.href
3402
+ ) : /* @__PURE__ */ jsx(
3403
+ Link6,
3404
+ {
3405
+ href: item.href,
3406
+ onClick: onItemClick,
3407
+ role: "menuitem",
3408
+ className: cls,
3409
+ "data-oc-account-menu-item": "",
3410
+ children: inner
3411
+ },
3412
+ item.href
3413
+ );
3414
+ })
3415
+ ]
3416
+ }
3417
+ );
3418
+ }
3419
+ function BuildFooter({
3420
+ hostname,
3421
+ build,
3422
+ state
3423
+ }) {
3424
+ const sha = build.sha;
3425
+ const showSha = !!sha && sha !== "dev";
3426
+ const commitUrl = showSha && build.repo ? `https://github.com/${build.repo}/commit/${sha}` : null;
3427
+ return /* @__PURE__ */ jsxs(
3428
+ "div",
3429
+ {
3430
+ className: "text-muted-foreground/60 border-border border-t px-3 py-2 font-mono text-[9.5px] tracking-widest uppercase",
3431
+ "data-oc-account-menu-build": "",
3432
+ children: [
3433
+ hostname,
3434
+ state && state !== "live" ? /* @__PURE__ */ jsxs(Fragment, { children: [
3435
+ " \xB7 ",
3436
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground/80", children: state })
3437
+ ] }) : null,
3438
+ " ",
3439
+ /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground/80", children: [
3440
+ "v",
3441
+ build.version,
3442
+ showSha ? /* @__PURE__ */ jsxs(Fragment, { children: [
3443
+ " \xB7 ",
3444
+ commitUrl ? /* @__PURE__ */ jsx(
3445
+ "a",
3446
+ {
3447
+ href: commitUrl,
3448
+ target: "_blank",
3449
+ rel: "noreferrer",
3450
+ className: "hover:text-foreground/90 underline decoration-dotted underline-offset-2",
3451
+ children: sha
3452
+ }
3453
+ ) : sha
3454
+ ] }) : null
3455
+ ] })
3456
+ ]
3457
+ }
3458
+ );
3459
+ }
3460
+ function isActive(pathname, link) {
3461
+ if (link.external) return false;
3462
+ if (link.matchExact) return pathname === link.href;
3463
+ if (link.href === "/") return pathname === "/";
3464
+ return pathname === link.href || pathname.startsWith(link.href + "/");
3465
+ }
3466
+ function OcPrimaryNav({ activePath, links, className }) {
3467
+ return /* @__PURE__ */ jsx(
3468
+ "nav",
3469
+ {
3470
+ "aria-label": "primary",
3471
+ className: "flex min-w-0 items-center justify-start overflow-x-auto gap-0.5 sm:gap-1 whitespace-nowrap [scrollbar-width:none] [&::-webkit-scrollbar]:hidden " + (className ?? ""),
3472
+ "data-oc-primary-nav": "",
3473
+ children: links.map((link) => {
3474
+ const active = isActive(activePath, link);
3475
+ const className2 = "font-display relative shrink-0 px-2 py-1 sm:px-3 text-[11px] sm:text-[12px] font-semibold tracking-wider uppercase transition-colors " + (active ? 'text-primary after:bg-primary after:absolute after:inset-x-2 after:-bottom-[13px] after:h-px after:content-[""]' : "text-muted-foreground hover:text-foreground");
3476
+ const content = /* @__PURE__ */ jsxs(Fragment, { children: [
3477
+ link.label,
3478
+ link.external ? /* @__PURE__ */ jsx(
3479
+ "span",
3480
+ {
3481
+ "aria-hidden": true,
3482
+ className: "text-muted-foreground/60 ml-1 text-[9px]",
3483
+ children: "\u2197"
3484
+ }
3485
+ ) : null
3486
+ ] });
3487
+ return link.external ? /* @__PURE__ */ jsx(
3488
+ "a",
3489
+ {
3490
+ href: link.href,
3491
+ target: "_blank",
3492
+ rel: "noreferrer",
3493
+ className: className2,
3494
+ "data-oc-primary-nav-item": "",
3495
+ children: content
3496
+ },
3497
+ link.href
3498
+ ) : /* @__PURE__ */ jsx(
3499
+ Link6,
3500
+ {
3501
+ href: link.href,
3502
+ "aria-current": active ? "page" : void 0,
3503
+ className: className2,
3504
+ "data-oc-primary-nav-item": active ? "active" : "sibling",
3505
+ children: content
3506
+ },
3507
+ link.href
3508
+ );
3509
+ })
3510
+ }
3511
+ );
3512
+ }
3513
+ function OcDashboardShell({
3514
+ rootHref = "/dashboard",
3515
+ siteLabel,
3516
+ tools,
3517
+ active,
3518
+ eyebrow,
3519
+ title,
3520
+ description,
3521
+ children,
3522
+ className
3523
+ }) {
3524
+ const [drawerOpen, setDrawerOpen] = useState(false);
3525
+ useEffect(() => {
3526
+ if (!drawerOpen) return;
3527
+ function onKey(e) {
3528
+ if (e.key === "Escape") setDrawerOpen(false);
3529
+ }
3530
+ document.addEventListener("keydown", onKey);
3531
+ const prevOverflow = document.body.style.overflow;
3532
+ document.body.style.overflow = "hidden";
3533
+ return () => {
3534
+ document.removeEventListener("keydown", onKey);
3535
+ document.body.style.overflow = prevOverflow;
3536
+ };
3537
+ }, [drawerOpen]);
3538
+ const hasHeader = Boolean(title) || Boolean(eyebrow);
3539
+ return /* @__PURE__ */ jsxs(
3540
+ "div",
3541
+ {
3542
+ className: "container " + (className ?? ""),
3543
+ "data-oc-dashboard-shell": "",
3544
+ children: [
3545
+ /* @__PURE__ */ jsxs("div", { className: "flex min-h-[calc(100vh-3rem)] flex-col md:flex-row md:gap-8", children: [
3546
+ /* @__PURE__ */ jsx(
3547
+ Sidebar,
3548
+ {
3549
+ rootHref,
3550
+ siteLabel,
3551
+ tools,
3552
+ active,
3553
+ variant: "desktop"
3554
+ }
3555
+ ),
3556
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 flex-col", children: [
3557
+ /* @__PURE__ */ jsxs("div", { className: "border-border flex items-center justify-between border-b py-3 md:hidden", children: [
3558
+ /* @__PURE__ */ jsxs(
3559
+ "button",
3560
+ {
3561
+ type: "button",
3562
+ onClick: () => setDrawerOpen(true),
3563
+ className: "text-muted-foreground hover:text-foreground inline-flex h-9 items-center gap-2 px-1 font-mono text-[11px] tracking-widest uppercase transition-colors",
3564
+ "aria-label": "open dashboard tools",
3565
+ "aria-expanded": drawerOpen,
3566
+ "data-oc-dashboard-mobile-trigger": "",
3567
+ children: [
3568
+ /* @__PURE__ */ jsx("span", { className: "text-[14px] leading-none", children: "\u2261" }),
3569
+ /* @__PURE__ */ jsx("span", { children: "tools" })
3570
+ ]
3571
+ }
3572
+ ),
3573
+ /* @__PURE__ */ jsx(
3574
+ Link6,
3575
+ {
3576
+ href: rootHref,
3577
+ className: "text-primary font-mono text-[11px] tracking-widest uppercase",
3578
+ children: "\xA7 dashboard"
3579
+ }
3580
+ )
3581
+ ] }),
3582
+ /* @__PURE__ */ jsxs("div", { className: "pt-6 md:pt-3", children: [
3583
+ hasHeader && /* @__PURE__ */ jsxs("div", { className: "max-w-3xl", children: [
3584
+ eyebrow ? /* @__PURE__ */ jsx("div", { className: "label-mono text-primary mb-3 font-mono text-[10px] tracking-widest uppercase", children: eyebrow }) : null,
3585
+ title ? /* @__PURE__ */ jsx("h1", { className: "font-display text-2xl font-bold tracking-tight sm:text-3xl", children: title }) : null,
3586
+ description ? /* @__PURE__ */ jsx("p", { className: "text-muted-foreground mt-3 max-w-[64ch] text-sm leading-relaxed", children: description }) : null
3587
+ ] }),
3588
+ /* @__PURE__ */ jsx("div", { className: hasHeader ? "mt-8 pb-12" : "pb-12", children })
3589
+ ] })
3590
+ ] })
3591
+ ] }),
3592
+ drawerOpen ? /* @__PURE__ */ jsxs(
3593
+ "div",
3594
+ {
3595
+ className: "fixed inset-0 z-50 md:hidden",
3596
+ role: "dialog",
3597
+ "aria-modal": "true",
3598
+ "aria-label": "dashboard tools",
3599
+ "data-oc-dashboard-drawer": "",
3600
+ children: [
3601
+ /* @__PURE__ */ jsx(
3602
+ "div",
3603
+ {
3604
+ className: "absolute inset-0 bg-background/80 backdrop-blur-sm",
3605
+ onClick: () => setDrawerOpen(false),
3606
+ "aria-hidden": true
3607
+ }
3608
+ ),
3609
+ /* @__PURE__ */ jsx("div", { className: "bg-background absolute top-0 left-0 h-full w-[85vw] max-w-sm border-r shadow-xl", children: /* @__PURE__ */ jsx(
3610
+ Sidebar,
3611
+ {
3612
+ rootHref,
3613
+ siteLabel,
3614
+ tools,
3615
+ active,
3616
+ variant: "drawer",
3617
+ onClose: () => setDrawerOpen(false)
3618
+ }
3619
+ ) })
3620
+ ]
3621
+ }
3622
+ ) : null
3623
+ ]
3624
+ }
3625
+ );
3626
+ }
3627
+ function Sidebar({
3628
+ rootHref,
3629
+ siteLabel,
3630
+ tools,
3631
+ active,
3632
+ variant,
3633
+ onClose
3634
+ }) {
3635
+ const isDrawer = variant === "drawer";
3636
+ return /* @__PURE__ */ jsxs(
3637
+ "aside",
3638
+ {
3639
+ className: isDrawer ? "flex h-full w-full flex-col bg-card" : "hidden md:sticky md:top-4 md:flex md:h-[calc(100vh-2rem)] md:w-56 md:shrink-0 md:flex-col md:self-start md:overflow-y-auto md:rounded md:border md:bg-card/40 lg:w-60",
3640
+ "aria-label": "dashboard tools",
3641
+ "data-oc-dashboard-sidebar": variant,
3642
+ children: [
3643
+ /* @__PURE__ */ jsxs("div", { className: "border-b px-4 py-3", children: [
3644
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
3645
+ /* @__PURE__ */ jsx(
3646
+ Link6,
3647
+ {
3648
+ href: rootHref,
3649
+ onClick: onClose,
3650
+ className: "hover:text-foreground font-display text-sm font-bold tracking-tight",
3651
+ children: "\xA7 dashboard"
3652
+ }
3653
+ ),
3654
+ isDrawer ? /* @__PURE__ */ jsx(
3655
+ "button",
3656
+ {
3657
+ type: "button",
3658
+ onClick: onClose,
3659
+ className: "text-muted-foreground hover:text-foreground -mr-2 inline-flex h-8 w-8 items-center justify-center rounded font-mono text-lg",
3660
+ "aria-label": "close navigation",
3661
+ children: "\xD7"
3662
+ }
3663
+ ) : null
3664
+ ] }),
3665
+ siteLabel ? /* @__PURE__ */ jsx("div", { className: "text-muted-foreground/70 mt-1 font-mono text-[10px] tracking-widest uppercase", children: siteLabel }) : null
3666
+ ] }),
3667
+ /* @__PURE__ */ jsxs("nav", { className: "flex-1 overflow-y-auto px-2 py-3", children: [
3668
+ /* @__PURE__ */ jsx("div", { className: "text-muted-foreground/60 mb-1 px-3 font-mono text-[10px] tracking-widest uppercase", children: "\xA7 tools" }),
3669
+ /* @__PURE__ */ jsx("ul", { className: "space-y-0.5", children: tools.map((tool) => {
3670
+ const isActive2 = tool.id === active;
3671
+ const innerCls = "flex items-baseline gap-2 rounded px-3 py-1.5 text-[12.5px] transition-colors " + (isActive2 ? "bg-primary/10 text-primary font-semibold" : "text-muted-foreground hover:text-foreground hover:bg-muted/30");
3672
+ const content = /* @__PURE__ */ jsxs(Fragment, { children: [
3673
+ tool.icon ? /* @__PURE__ */ jsx(
3674
+ "span",
3675
+ {
3676
+ className: "shrink-0 font-mono text-[11px] " + (isActive2 ? "text-primary" : "text-muted-foreground/70"),
3677
+ "aria-hidden": true,
3678
+ children: tool.icon
3679
+ }
3680
+ ) : null,
3681
+ /* @__PURE__ */ jsxs("span", { className: "flex-1 leading-tight", children: [
3682
+ /* @__PURE__ */ jsx("span", { children: tool.label }),
3683
+ tool.tagline ? /* @__PURE__ */ jsx("span", { className: "text-muted-foreground/60 mt-0.5 block font-mono text-[10px] tracking-wide normal-case", children: tool.tagline }) : null
3684
+ ] }),
3685
+ tool.external ? /* @__PURE__ */ jsx(
3686
+ "span",
3687
+ {
3688
+ className: "text-muted-foreground/60 text-[10px]",
3689
+ "aria-hidden": true,
3690
+ children: "\u2197"
3691
+ }
3692
+ ) : null
3693
+ ] });
3694
+ return /* @__PURE__ */ jsx("li", { children: tool.external ? /* @__PURE__ */ jsx(
3695
+ "a",
3696
+ {
3697
+ href: tool.href,
3698
+ target: "_blank",
3699
+ rel: "noreferrer",
3700
+ onClick: onClose,
3701
+ className: innerCls,
3702
+ "data-oc-dashboard-tool": isActive2 ? "active" : "sibling",
3703
+ children: content
3704
+ }
3705
+ ) : /* @__PURE__ */ jsx(
3706
+ Link6,
3707
+ {
3708
+ href: tool.href,
3709
+ onClick: onClose,
3710
+ "aria-current": isActive2 ? "page" : void 0,
3711
+ className: innerCls,
3712
+ "data-oc-dashboard-tool": isActive2 ? "active" : "sibling",
3713
+ children: content
3714
+ }
3715
+ ) }, tool.id);
3716
+ }) })
3717
+ ] })
3718
+ ]
3719
+ }
3720
+ );
3721
+ }
3722
+ function OcDashboardHub({ tools, className }) {
3723
+ return /* @__PURE__ */ jsx(
3724
+ "ul",
3725
+ {
3726
+ className: "grid gap-px border-t border-l sm:grid-cols-2 " + (className ?? ""),
3727
+ "data-oc-dashboard-hub": "",
3728
+ children: tools.map((tool) => {
3729
+ const content = /* @__PURE__ */ jsxs("span", { className: "flex h-full flex-col gap-3 p-5 transition-colors", children: [
3730
+ /* @__PURE__ */ jsxs("span", { className: "flex items-baseline gap-3", children: [
3731
+ tool.icon ? /* @__PURE__ */ jsx(
3732
+ "span",
3733
+ {
3734
+ className: "text-primary font-mono text-[13px]",
3735
+ "aria-hidden": true,
3736
+ children: tool.icon
3737
+ }
3738
+ ) : null,
3739
+ /* @__PURE__ */ jsx("span", { className: "font-display text-foreground text-base font-bold tracking-tight", children: tool.label }),
3740
+ tool.external ? /* @__PURE__ */ jsx(
3741
+ "span",
3742
+ {
3743
+ className: "text-muted-foreground/60 ml-auto text-xs",
3744
+ "aria-hidden": true,
3745
+ children: "\u2197"
3746
+ }
3747
+ ) : /* @__PURE__ */ jsx(
3748
+ "span",
3749
+ {
3750
+ className: "text-muted-foreground/60 ml-auto text-xs",
3751
+ "aria-hidden": true,
3752
+ children: "\u2192"
3753
+ }
3754
+ )
3755
+ ] }),
3756
+ tool.tagline ? /* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-sm leading-relaxed", children: tool.tagline }) : null
3757
+ ] });
3758
+ const cls = "hover:bg-muted/30 group block border-r border-b transition-colors";
3759
+ return /* @__PURE__ */ jsx("li", { children: tool.external ? /* @__PURE__ */ jsx(
3760
+ "a",
3761
+ {
3762
+ href: tool.href,
3763
+ target: "_blank",
3764
+ rel: "noreferrer",
3765
+ className: cls,
3766
+ children: content
3767
+ }
3768
+ ) : /* @__PURE__ */ jsx(Link6, { href: tool.href, className: cls, children: content }) }, tool.id);
3769
+ })
3770
+ }
3771
+ );
3772
+ }
3773
+ function AppShell({
3774
+ eyebrow,
3775
+ title,
3776
+ description,
3777
+ headerActions,
3778
+ children,
3779
+ className
3780
+ }) {
3781
+ const hasHeader = Boolean(title);
3782
+ return /* @__PURE__ */ jsx("div", { className: "container " + (className ?? ""), children: /* @__PURE__ */ jsx("div", { className: "flex min-h-[calc(100vh-3rem)] flex-col", children: /* @__PURE__ */ jsx("div", { className: "flex min-w-0 flex-1 flex-col", children: /* @__PURE__ */ jsxs("div", { className: "pt-6 md:pt-8", children: [
3783
+ hasHeader && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between", children: [
3784
+ /* @__PURE__ */ jsxs("div", { className: "max-w-3xl", children: [
3785
+ eyebrow && /* @__PURE__ */ jsx("div", { className: "label-mono text-primary mb-3", children: eyebrow }),
3786
+ /* @__PURE__ */ jsx("h1", { className: "font-display text-2xl font-bold tracking-tight sm:text-3xl", children: title }),
3787
+ description && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground mt-3 max-w-[64ch] text-sm leading-relaxed", children: description })
3788
+ ] }),
3789
+ headerActions && /* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center gap-2", children: headerActions })
3790
+ ] }),
3791
+ /* @__PURE__ */ jsx("div", { className: hasHeader ? "mt-8 pb-12" : "pb-12", children })
3792
+ ] }) }) }) });
3793
+ }
3794
+ var HIDE = {
3795
+ sm: "hidden sm:inline",
3796
+ md: "hidden md:inline",
3797
+ lg: "hidden lg:inline"
3798
+ };
3799
+ function LayoutSubHeader({
3800
+ product,
3801
+ status = "live \xB7 mainnet",
3802
+ tags = [],
3803
+ noHeartbeat = false,
3804
+ className
3805
+ }) {
3806
+ return /* @__PURE__ */ jsx("div", { className: cn("border-b", className), children: /* @__PURE__ */ jsxs("div", { className: "container flex flex-wrap items-center justify-between gap-x-6 gap-y-1 py-2 font-mono text-[11px]", children: [
3807
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
3808
+ !noHeartbeat && /* @__PURE__ */ jsx("span", { className: "bg-primary inline-block h-1.5 w-1.5 animate-pulse rounded-full" }),
3809
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground tracking-widest uppercase", children: status }),
3810
+ /* @__PURE__ */ jsx("span", { className: "text-foreground", children: product })
3811
+ ] }),
3812
+ tags.length > 0 && /* @__PURE__ */ jsx("div", { className: "text-muted-foreground flex flex-wrap items-center gap-x-4 gap-y-1 tracking-widest uppercase", children: tags.map((tag, i) => /* @__PURE__ */ jsx("span", { className: tag.hideBelow ? HIDE[tag.hideBelow] : void 0, children: tag.label }, i)) })
3813
+ ] }) });
3814
+ }
2095
3815
 
2096
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertTitle, AlertWithAction, AlertWithCountdown, Badge, Bar, BitcoinAddress, Button, Card, Checkbox, ConfirmHost, CopyButton, DEFAULT_OC_THEME, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, ErrorBoundary, Input, Label, Modal, OC_DEFAULT_ACCENT, OC_SKIN_COOKIE, OC_THEMES, OcAppearanceMenu, OcThemeBridge, OcThemePicker, OcThemeProvider, Pagination, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PromptHost, QrCode, REFERENCE_BTC_USD, RadioGroup, RadioGroupItem, SatsAmount, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, Sparkline, StatBlock, StatusPill, Switch, Textarea, ThemeToggle, ThemeToggleLink, Toaster, Working, WorkingPanel, accentFor, badgeVariants, buttonVariants, cn, confirm, explorerUrl, formatSats, formatSatsCompact, getOcThemeInitScript, isKnownTheme, priceBoth, prompt, relativeTime, resolveTheme, satsToUsd, shortenAddress, usdToSats, useOcSkin };
3816
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertTitle, AlertWithAction, AlertWithCountdown, AppShell, Badge, Bar, BitcoinAddress, Button, Callout, Card, Checkbox, ConfirmHost, CopyButton, DEFAULT_OC_THEME, DataRow, DefinitionList, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, EcosystemSwitcher, EmptyState, ErrorBoundary, FAMILY_PROPERTIES, HelpHint, Input, Label, LayoutSubHeader, Modal, OC_DEFAULT_ACCENT, OC_SKIN_COOKIE, OC_THEMES, OcAccountMenu, OcAccountMenuView, OcAppearanceMenu, OcDashboardHub, OcDashboardShell, OcLogoDropdown, OcPrimaryNav, OcThemeBridge, OcThemePicker, OcThemeProvider, Pagination, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PromptHost, QrCode, REFERENCE_BTC_USD, RadioGroup, RadioGroupItem, SITE_STATE_LABEL, SatsAmount, SectionHeader, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, Sparkline, StatBlock, StatGrid, StatTile, StatusPill, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThemeToggle, ThemeToggleLink, Toaster, Working, WorkingPanel, accentFor, badgeVariants, buttonVariants, cn, confirm, explorerUrl, findFamilyProperty, formatSats, formatSatsCompact, getOcThemeInitScript, isKnownTheme, makeStatusPill, priceBoth, prompt, relativeTime, resolveTheme, satsToUsd, shortenAddress, usdToSats, useOcSkin };
2097
3817
  //# sourceMappingURL=index.mjs.map
2098
3818
  //# sourceMappingURL=index.mjs.map