@aracreate/arm-ui 3.7.1 → 3.8.1
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 +17 -4
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/style.css +4 -1
- package/package.json +4 -4
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kishor/Work/01-araCreate/arm/library/arm-ui-library/dist/index.js","../src/components/Skeleton.tsx","../src/components/AccentHeader.tsx","../src/components/ConfirmDialog.tsx","../src/components/layout-tokens.ts","../src/components/CardFooter.tsx"],"names":["Skeleton","width","height","radius","circle","mb","className","style","jsx","AccentHeader","title","trailing","titleNode","Text","jsxs","Flex","AccentCard","children","bodyPadding","Box","layout","CardFooter","justify","noTopMargin","pad"],"mappings":"AAAA,ylCAAuD,+CC+BnD,SAVYA,EAAAA,CAAS,CACvB,KAAA,CAAAC,CAAAA,CAAQ,MAAA,CACR,MAAA,CAAAC,CAAAA,CAAS,gBAAA,CACT,MAAA,CAAAC,CAAAA,CAAS,iBAAA,CACT,MAAA,CAAAC,CAAAA,CAAS,CAAA,CAAA,CACT,EAAA,CAAAC,CAAAA,CACA,SAAA,CAAAC,CAAAA,CACA,KAAA,CAAAC,CACF,CAAA,CAAkB,CAChB,OACEC,6BAAAA,KAAC,CAAA,CACC,SAAA,CAAW,CAAC,UAAA,CAAYF,CAAS,CAAA,CAAE,MAAA,CAAO,OAAO,CAAA,CAAE,IAAA,CAAK,GAAG,CAAA,CAC3D,aAAA,CAAY,MAAA,CACZ,KAAA,CAAO,CACL,KAAA,CAAAL,CAAAA,CACA,MAAA,CAAAC,CAAAA,CACA,YAAA,CAAcE,CAAAA,CAAS,KAAA,CAAQD,CAAAA,CAC/B,YAAA,CAAcE,CAAAA,CACd,GAAGE,CACL,CAAA,CACF,CAEJ,CC1CA,0CAAgC,SAkBhBE,EAAAA,CAAa,CAAE,KAAA,CAAAC,CAAAA,CAAO,QAAA,CAAAC,CAAAA,CAAU,KAAA,CAAAJ,CAAM,CAAA,CAAsB,CAI1E,IAAMK,CAAAA,CACJ,OAAOF,CAAAA,EAAU,QAAA,EAAY,OAAOA,CAAAA,EAAU,QAAA,CAC5CF,6BAAAA,YAACK,CAAA,CAAK,IAAA,CAAK,GAAA,CAAI,MAAA,CAAO,QAAA,CAAS,KAAA,CAAO,CAAE,KAAA,CAAO,wBAAyB,CAAA,CACrE,QAAA,CAAAH,CAAAA,CACH,CAAA,CAEAA,CAAAA,CAEJ,OACEI,8BAAAA,YAACC,CAAA,CACC,KAAA,CAAM,QAAA,CACN,OAAA,CAAQ,SAAA,CACR,GAAA,CAAI,GAAA,CACJ,EAAA,CAAG,GAAA,CACH,KAAA,CAAO,CACL,UAAA,CAAY,iBAAA,CACZ,SAAA,CAAW,gBAAA,CACX,GAAGR,CACL,CAAA,CAEC,QAAA,CAAA,CAAAK,CAAAA,CACAD,CAAAA,CAAAA,CACH,CAEJ,CAaO,SAASK,EAAAA,CAAW,CACzB,KAAA,CAAAN,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,QAAA,CAAAM,CAAAA,CACA,WAAA,CAAAC,CAAAA,CAAc,GAAA,CACd,KAAA,CAAAX,CACF,CAAA,CAAoB,CAClB,OACEO,8BAAAA,WAACK,CAAA,CACC,KAAA,CAAO,CACL,UAAA,CAAY,0BAAA,CACZ,YAAA,CAAc,iBAAA,CACd,QAAA,CAAU,QAAA,CACV,SAAA,CAAW,oBAAA,CACX,GAAGZ,CACL,CAAA,CAEA,QAAA,CAAA,CAAAC,6BAAAA,EAACC,CAAA,CAAa,KAAA,CAAOC,CAAAA,CAAO,QAAA,CAAUC,CAAAA,CAAU,CAAA,CAChDH,6BAAAA,WAACW,CAAA,CAAI,CAAA,CAAGD,CAAAA,CAAc,QAAA,CAAAD,CAAAA,CAAS,CAAA,CAAA,CACjC,CAEJ,CChFA,ICKaG,CAAAA,CAAS,CACpB,UAAA,CAAY,4CAAA,CACZ,YAAA,CAAc,2CAAA,CACd,eAAA,CAAiB,2CAAA,CACjB,cAAA,CAAgB,2CAAA,CAChB,YAAA,CAAc,2BAAA,CACd,eAAA,CAAiB,2CAAA,CACjB,aAAA,CAAe,2CAAA,CACf,UAAA,CAAY,0BAAA,CACZ,WAAA,CAAa,2CAAA,CACb,QAAA,CAAU,2CAAA,CACV,UAAA,CAAY,2CAAA,CACZ,WAAA,CAAa,2CAAA,CACb,YAAA,CAAc,4DAAA,CACd,qBAAA,CAAuB,uCAAA,CACvB,QAAA,CAAU,2CAAA,CACV,QAAA,CAAU,2CAAA,CACV,aAAA,CAAe,2BAAA,CACf,iBAAA,CAAmB,0BAAA,CACnB,kBAAA,CAAoB,2CAAA,CAKpB,YAAA,CAAc,uCAAA,CACd,cAAA,CAAgB,wDAAA,CAChB,YAAA,CAAc,4DAAA,CACd,eAAA,CAAiB,2CAAA,CACjB,aAAA,CAAe,2CACjB,CAAA,CClCA,SAuBgBC,CAAAA,CAAW,CACzB,QAAA,CAAAJ,CAAAA,CACA,OAAA,CAAAK,CAAAA,CAAU,KAAA,CACV,WAAA,CAAAC,CAAAA,CACA,GAAA,CAAAC,CAAAA,CAAM,gBAAA,CACN,MAAA,CAAArB,CAAAA,CAAS,iBACX,CAAA,CAAoB,CAClB,OACEK,6BAAAA,YAACO,CAAA,CACC,OAAA,CAASO,CAAAA,CACT,KAAA,CAAO,CACL,MAAA,CAAQ,CAAA,EAAA","file":"/Users/kishor/Work/01-araCreate/arm/library/arm-ui-library/dist/index.js","sourcesContent":[null,"import type { CSSProperties } from \"react\";\n\n/**\n * Skeleton — loading placeholder. Generalizes the local `Skel` helper and the\n * inline `<div className=\"skeleton\" .../>` blocks used in the users, user-detail,\n * and home surfaces. Pulse animation + base color come from `.skeleton` in\n * globals.css.\n */\nexport interface SkeletonProps {\n width?: number | string;\n height?: number | string;\n /** Border radius. Ignored when `circle` is set. Defaults to var(--radius-2). */\n radius?: number | string;\n /** Render as a circle (avatars). */\n circle?: boolean;\n /** Bottom margin. */\n mb?: number | string;\n className?: string;\n style?: CSSProperties;\n}\n\nexport function Skeleton({\n width = \"100%\",\n height = \"var(--space-4)\" /* 16px == space-4 */,\n radius = \"var(--radius-2)\",\n circle = false,\n mb,\n className,\n style,\n}: SkeletonProps) {\n return (\n <div\n className={[\"skeleton\", className].filter(Boolean).join(\" \")}\n aria-hidden=\"true\"\n style={{\n width,\n height,\n borderRadius: circle ? \"50%\" : radius,\n marginBottom: mb,\n ...style,\n }}\n />\n );\n}\n\nexport default Skeleton;\n","import type { CSSProperties, ReactNode } from \"react\";\nimport { Box, Flex, Text } from \"@radix-ui/themes\";\n\n/**\n * AccentHeader — the amber two-tone title bar Figma uses on cards, dialogs,\n * and page banners (Target/Source Calendar, Preview, Upcoming Event, Confirm\n * Logout, Terms hero). Build-once pattern per the design ledger: a solid\n * `--accent-9` bar with a dark bold title, optionally with trailing controls\n * (e.g. the Month/Week/Day toggle lives inside the bar on the Preview card).\n *\n * Figma refs: ui-ux/figma/crops/month-card.png, confirm-dialog.png.\n */\nexport interface AccentHeaderProps {\n title: ReactNode;\n /** Right-aligned slot inside the bar (view toggles, actions). */\n trailing?: ReactNode;\n style?: CSSProperties;\n}\n\nexport function AccentHeader({ title, trailing, style }: AccentHeaderProps) {\n // Plain strings get the bar's standard Text treatment; element titles (e.g.\n // an AlertDialog.Title heading) render as-is so we never nest a heading\n // inside a span (invalid HTML).\n const titleNode =\n typeof title === \"string\" || typeof title === \"number\" ? (\n <Text size=\"3\" weight=\"medium\" style={{ color: \"var(--accent-contrast)\" }}>\n {title}\n </Text>\n ) : (\n title\n );\n return (\n <Flex\n align=\"center\"\n justify=\"between\"\n gap=\"3\"\n px=\"4\"\n style={{\n background: \"var(--accent-9)\",\n minHeight: \"var(--space-7)\",\n ...style,\n }}\n >\n {titleNode}\n {trailing}\n </Flex>\n );\n}\n\n/**\n * AccentCard — white panel with an AccentHeader bar and rounded corners\n * (measured r≈14 @1728 → var(--radius-5)) plus the soft card shadow seen on\n * every Figma card. The header is clipped by the card's radius.\n */\nexport interface AccentCardProps extends AccentHeaderProps {\n children: ReactNode;\n /** Radix padding scale for the body. Defaults to \"4\"; use \"0\" for flush content. */\n bodyPadding?: \"0\" | \"1\" | \"2\" | \"3\" | \"4\" | \"5\" | \"6\";\n}\n\nexport function AccentCard({\n title,\n trailing,\n children,\n bodyPadding = \"4\",\n style,\n}: AccentCardProps) {\n return (\n <Box\n style={{\n background: \"var(--color-panel-solid)\",\n borderRadius: \"var(--radius-5)\",\n overflow: \"hidden\",\n boxShadow: \"var(--shadow-card)\",\n ...style,\n }}\n >\n <AccentHeader title={title} trailing={trailing} />\n <Box p={bodyPadding}>{children}</Box>\n </Box>\n );\n}\n\nexport default AccentHeader;\n","import type { ReactNode } from \"react\";\nimport { AlertDialog, Button } from \"@radix-ui/themes\";\nimport { layout } from \"./layout-tokens\";\nimport { CardFooter } from \"./CardFooter\";\n\n/**\n * ConfirmDialog — the confirm/cancel prompt used for destructive or\n * state-changing actions (Confirm Logout, Remove account, etc). Built on\n * Radix `AlertDialog` with a plain title/description and bottom-right\n * actions, matching the app's other dialogs (e.g. ImportCalendarsDialog):\n * neutral outline Cancel, amber-primary Confirm.\n */\nexport interface ConfirmDialogProps {\n /** Dialog title, rendered inside the AccentHeader bar. */\n title: ReactNode;\n /** Question / body copy. */\n description: ReactNode;\n /** Confirm button label. Defaults to \"Yes\". */\n confirmLabel?: ReactNode;\n /** Cancel button label. Defaults to \"Cancel\". */\n cancelLabel?: ReactNode;\n /** Called when the confirm action is activated (dialog still closes via AlertDialog.Action). */\n onConfirm?: () => void;\n /** Element that opens the dialog, rendered inside AlertDialog.Trigger. Omit for a fully controlled dialog. */\n trigger?: ReactNode;\n /** Controlled open state — omit for uncontrolled, trigger-driven usage. */\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n}\n\nexport function ConfirmDialog({\n title,\n description,\n confirmLabel = \"Yes\",\n cancelLabel = \"Cancel\",\n onConfirm,\n trigger,\n open,\n onOpenChange,\n}: ConfirmDialogProps) {\n return (\n <AlertDialog.Root open={open} onOpenChange={onOpenChange}>\n {trigger ? <AlertDialog.Trigger>{trigger}</AlertDialog.Trigger> : null}\n <AlertDialog.Content maxWidth={layout.dialogSm}>\n <AlertDialog.Title\n size=\"5\"\n mb=\"1\"\n style={{ fontFamily: \"var(--heading-font-family)\", fontWeight: \"var(--font-weight-medium)\" }}\n >\n {title}\n </AlertDialog.Title>\n <AlertDialog.Description size=\"2\" color=\"gray\" mb=\"5\">\n {description}\n </AlertDialog.Description>\n <CardFooter justify=\"between\" noTopMargin>\n <AlertDialog.Cancel>\n <Button size=\"2\" variant=\"outline\" color=\"gray\">\n {cancelLabel}\n </Button>\n </AlertDialog.Cancel>\n <AlertDialog.Action>\n <Button size=\"2\" className=\"btn-amber-primary\" onClick={onConfirm}>\n {confirmLabel}\n </Button>\n </AlertDialog.Action>\n </CardFooter>\n </AlertDialog.Content>\n </AlertDialog.Root>\n );\n}\n\nexport default ConfirmDialog;\n","/** Radix space-scale layout widths. Originally a subset of the app's\n * src/lib/layout-tokens.ts covering only what this package's own components\n * reference; now also exported so consumers stop hand-rolling their own\n * copies (arm-admin had none at all, and core-fe carries a 5-constant\n * fork). Values must match the app's copy — see README.md's \"Files\n * duplicated from the app\". */\nexport const layout = {\n contentMax: \"calc(15 * var(--space-9) + var(--space-5))\",\n accountCardW: \"calc(3 * var(--space-9) + var(--space-8))\",\n accountCardMinH: \"calc(2 * var(--space-9) - var(--space-2))\",\n monthTitleMinW: \"calc(3 * var(--space-9) - var(--space-1))\",\n bigCalendarH: \"calc(10 * var(--space-9))\",\n sidebarColBasis: \"calc(4 * var(--space-9) - var(--space-2))\",\n sidebarColMin: \"calc(3 * var(--space-9) + var(--space-6))\",\n syncColMin: \"calc(5 * var(--space-9))\",\n syncColWide: \"calc(7 * var(--space-9) + var(--space-6))\",\n dialogSm: \"calc(6 * var(--space-9) - var(--space-2))\",\n dialogBody: \"calc(5 * var(--space-9) + var(--space-7))\",\n authFormMax: \"calc(6 * var(--space-9) + var(--space-8))\",\n brandLogoMax: \"calc(6 * var(--space-9) + var(--space-8) - var(--space-1))\",\n connectedAccountCardH: \"calc(var(--space-9) - var(--space-1))\",\n dialogMd: \"calc(6 * var(--space-9) + var(--space-6))\",\n dialogLg: \"calc(7 * var(--space-9) - var(--space-1))\",\n emptyStateMax: \"calc(10 * var(--space-9))\",\n emptyStateCopyMax: \"calc(6 * var(--space-9))\",\n providerChooserMax: \"calc(6 * var(--space-9) + var(--space-6))\",\n /* Admin portal. The two audit columns are fixed so the header grid and\n * every row grid resolve to the same track sizes; settingsGridMin is the\n * floor that keeps a 5–6 column table legible before it starts scrolling\n * horizontally instead of crushing its columns. */\n auditColTime: \"calc(var(--space-9) + var(--space-2))\",\n auditColAction: \"calc(var(--space-9) + var(--space-5) + var(--space-1))\",\n searchFieldW: \"calc(3 * var(--space-9) + var(--space-5) + var(--space-1))\",\n settingsGridMin: \"calc(5 * var(--space-9) + var(--space-5))\",\n placeholderMd: \"calc(6 * var(--space-9) + var(--space-4))\",\n} as const;\n","import type { ReactNode } from \"react\";\nimport { Flex } from \"@radix-ui/themes\";\n\nexport interface CardFooterProps {\n children: ReactNode;\n justify?: \"end\" | \"between\";\n /** Omit the top margin when the content above already ends with its own\n * bottom margin/gap (e.g. Flex `mb`) — avoids doubled spacing. */\n noTopMargin?: boolean;\n /** Match the enclosing container's own padding so the negative-margin\n * breakout lines up flush with its edges. Defaults to Card size=\"3\"'s\n * var(--space-5); pass the container's actual padding otherwise (e.g.\n * a default-size Card's var(--space-3), StepCard's var(--space-4)). */\n pad?: string;\n /** Match the enclosing container's own corner radius so the footer's\n * bottom corners line up. Defaults to Card size=\"3\"+'s var(--radius-5);\n * default-size Card (1-2) uses var(--radius-4). */\n radius?: string;\n}\n\n/** Full-bleed gray action bar for the bottom of a Card — breaks out of the\n * Card's own padding so it reads as a distinct footer strip, same shape as\n * ImportCalendarsDialog's button row. Use for any Card/Dialog that ends in\n * one or more buttons instead of a plain Separator + Flex. */\nexport function CardFooter({\n children,\n justify = \"end\",\n noTopMargin,\n pad = \"var(--space-5)\",\n radius = \"var(--radius-5)\",\n}: CardFooterProps) {\n return (\n <Flex\n justify={justify}\n style={{\n margin: `${noTopMargin ? \"0\" : \"var(--space-5)\"} calc(-1 * ${pad}) calc(-1 * ${pad})`,\n padding: `var(--space-4) ${pad}`,\n alignItems: \"center\",\n background: \"var(--gray-2)\",\n borderTop: \"1px solid var(--gray-5)\",\n borderRadius: `0 0 ${radius} ${radius}`,\n }}\n >\n {children}\n </Flex>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["/Users/kishor/Work/01-araCreate/arm/library/arm-ui-library/dist/index.js","../src/components/primitives.ts","../src/components/Skeleton.tsx","../src/components/AccentHeader.tsx","../src/components/ConfirmDialog.tsx","../src/components/layout-tokens.ts","../src/components/CardFooter.tsx"],"names":["Skeleton","width","height","radius","circle","mb","className","style","jsx","AccentHeader","title","trailing","titleNode","Text","jsxs","Flex","AccentCard","children","bodyPadding","Box","layout","CardFooter","justify","noTopMargin","pad"],"mappings":"AAAA,i3CAAuD,0CC8EhD,+CC/CH,SAVYA,EAAAA,CAAS,CACvB,KAAA,CAAAC,CAAAA,CAAQ,MAAA,CACR,MAAA,CAAAC,CAAAA,CAAS,gBAAA,CACT,MAAA,CAAAC,CAAAA,CAAS,iBAAA,CACT,MAAA,CAAAC,CAAAA,CAAS,CAAA,CAAA,CACT,EAAA,CAAAC,CAAAA,CACA,SAAA,CAAAC,CAAAA,CACA,KAAA,CAAAC,CACF,CAAA,CAAkB,CAChB,OACEC,6BAAAA,KAAC,CAAA,CACC,SAAA,CAAW,CAAC,UAAA,CAAYF,CAAS,CAAA,CAAE,MAAA,CAAO,OAAO,CAAA,CAAE,IAAA,CAAK,GAAG,CAAA,CAC3D,aAAA,CAAY,MAAA,CACZ,KAAA,CAAO,CACL,KAAA,CAAAL,CAAAA,CACA,MAAA,CAAAC,CAAAA,CACA,YAAA,CAAcE,CAAAA,CAAS,KAAA,CAAQD,CAAAA,CAC/B,YAAA,CAAcE,CAAAA,CACd,GAAGE,CACL,CAAA,CACF,CAEJ,CC1CA,SAkBgBE,EAAAA,CAAa,CAAE,KAAA,CAAAC,CAAAA,CAAO,QAAA,CAAAC,CAAAA,CAAU,KAAA,CAAAJ,CAAM,CAAA,CAAsB,CAI1E,IAAMK,CAAAA,CACJ,OAAOF,CAAAA,EAAU,QAAA,EAAY,OAAOA,CAAAA,EAAU,QAAA,CAC5CF,6BAAAA,YAACK,CAAA,CAAK,IAAA,CAAK,GAAA,CAAI,MAAA,CAAO,QAAA,CAAS,KAAA,CAAO,CAAE,KAAA,CAAO,wBAAyB,CAAA,CACrE,QAAA,CAAAH,CAAAA,CACH,CAAA,CAEAA,CAAAA,CAEJ,OACEI,8BAAAA,YAACC,CAAA,CACC,KAAA,CAAM,QAAA,CACN,OAAA,CAAQ,SAAA,CACR,GAAA,CAAI,GAAA,CACJ,EAAA,CAAG,GAAA,CACH,KAAA,CAAO,CACL,UAAA,CAAY,iBAAA,CACZ,SAAA,CAAW,gBAAA,CACX,GAAGR,CACL,CAAA,CAEC,QAAA,CAAA,CAAAK,CAAAA,CACAD,CAAAA,CAAAA,CACH,CAEJ,CAaO,SAASK,EAAAA,CAAW,CACzB,KAAA,CAAAN,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,QAAA,CAAAM,CAAAA,CACA,WAAA,CAAAC,CAAAA,CAAc,GAAA,CACd,KAAA,CAAAX,CACF,CAAA,CAAoB,CAClB,OACEO,8BAAAA,WAACK,CAAA,CACC,KAAA,CAAO,CACL,UAAA,CAAY,0BAAA,CACZ,YAAA,CAAc,iBAAA,CACd,QAAA,CAAU,QAAA,CACV,SAAA,CAAW,oBAAA,CACX,GAAGZ,CACL,CAAA,CAEA,QAAA,CAAA,CAAAC,6BAAAA,EAACC,CAAA,CAAa,KAAA,CAAOC,CAAAA,CAAO,QAAA,CAAUC,CAAAA,CAAU,CAAA,CAChDH,6BAAAA,WAACW,CAAA,CAAI,CAAA,CAAGD,CAAAA,CAAc,QAAA,CAAAD,CAAAA,CAAS,CAAA,CAAA,CACjC,CAEJ,CChFA,ICKaG,CAAAA,CAAS,CACpB,UAAA,CAAY,4CAAA,CACZ,YAAA,CAAc,2CAAA,CACd,eAAA,CAAiB,2CAAA,CACjB,cAAA,CAAgB,2CAAA,CAChB,YAAA,CAAc,2BAAA,CACd,eAAA,CAAiB,2CAAA,CACjB,aAAA,CAAe,2CAAA,CACf,UAAA,CAAY,0BAAA,CACZ,WAAA,CAAa,2CAAA,CACb,QAAA,CAAU,2CAAA,CACV,UAAA,CAAY,2CAAA,CACZ,WAAA,CAAa,2CAAA,CACb,YAAA,CAAc,4DAAA,CACd,qBAAA,CAAuB,uCAAA,CACvB,QAAA,CAAU,2CAAA,CACV,QAAA,CAAU,2CAAA,CACV,aAAA,CAAe,2BAAA,CACf,iBAAA,CAAmB,0BAAA,CACnB,kBAAA,CAAoB,2CAAA,CAKpB,YAAA,CAAc,uCAAA,CACd,cAAA,CAAgB,wDAAA,CAChB,YAAA,CAAc,4DAAA,CACd,eAAA,CAAiB,2CAAA,CACjB,aAAA,CAAe,2CACjB,CAAA,CClCA,SAuBgBC,CAAAA,CAAW,CACzB,QAAA,CAAAJ,CAAAA,CACA,OAAA,CAAAK,CAAAA,CAAU,KAAA,CACV,WAAA,CAAAC,CAAAA,CACA,GAAA,CAAAC,CAAAA,CAAM,gBAAA,CACN,MAAA,CAAArB,CAAAA,CAAS,iBACX,CAAA,CAAoB,CAClB,OACEK,6BAAAA,YAACO,CAAA,CACC,OAAA,CAASO,CAAAA,CACT,KAAA,CAAO,CACL,MAAA,CAAQ,CAAA,EAAA","file":"/Users/kishor/Work/01-araCreate/arm/library/arm-ui-library/dist/index.js","sourcesContent":[null,"// The basic components, re-exported from Radix Themes so a frontend imports every\n// component from this package and nothing from `@radix-ui/themes`.\n//\n// These are the identical objects, not wrappers — behaviour is Radix's. A component\n// becomes a real wrapper here only when ARM needs something Radix does not give, and\n// that edit then touches this library alone. Compound families (`Dialog.Root`,\n// `DropdownMenu.Item`, `Select.Item`, …) come through whole.\n//\n// Not exported, on purpose (primitives.test.ts holds this list and fails on any\n// Radix export that is neither re-exported nor named there):\n// Theme, useThemeContext, ThemeContext UIProvider owns the theme; frontends never mount it\n// ThemePanel, Reset dev tool / internal\n// Skeleton this library keeps its own (./Skeleton)\n// ChevronDownIcon, Thick*Icon Radix's own icon copies; the icon set (root index.ts) has ChevronDownIcon\n//\n// `Link` is exported as `TextLink`: react-router's `Link` shares files with it.\n\nexport {\n // Layout\n Box,\n Flex,\n Grid,\n Container,\n Section,\n Inset,\n AspectRatio,\n ScrollArea,\n Separator,\n // Typography\n Text,\n Heading,\n Blockquote,\n Code,\n Em,\n Kbd,\n Link as TextLink,\n Quote,\n Strong,\n // Actions and form controls\n Button,\n IconButton,\n TextField,\n TextArea,\n Checkbox,\n CheckboxGroup,\n CheckboxCards,\n Radio,\n RadioGroup,\n RadioCards,\n Select,\n Slider,\n Switch,\n SegmentedControl,\n // Overlays\n Dialog,\n AlertDialog,\n DropdownMenu,\n ContextMenu,\n Popover,\n HoverCard,\n Tooltip,\n Portal,\n // Feedback and data display\n Avatar,\n Badge,\n Callout,\n Card,\n DataList,\n Progress,\n Spinner,\n Table,\n Tabs,\n TabNav,\n // Utilities\n AccessibleIcon,\n Slot,\n Slottable,\n VisuallyHidden,\n} from \"@radix-ui/themes\";\n\nexport type {\n AccessibleIconProps,\n AspectRatioProps,\n AvatarProps,\n BadgeProps,\n BlockquoteProps,\n BoxProps,\n ButtonProps,\n CardProps,\n CheckboxProps,\n CodeProps,\n ContainerProps,\n EmProps,\n FlexProps,\n GridProps,\n HeadingProps,\n IconButtonProps,\n InsetProps,\n KbdProps,\n LinkProps as TextLinkProps,\n PortalProps,\n ProgressProps,\n QuoteProps,\n RadioProps,\n ScrollAreaProps,\n SectionProps,\n SeparatorProps,\n SliderProps,\n SpinnerProps,\n StrongProps,\n SwitchProps,\n TextAreaProps,\n TextProps,\n TooltipProps,\n VisuallyHiddenProps,\n} from \"@radix-ui/themes\";\n","import type { CSSProperties } from \"react\";\n\n/**\n * Skeleton — loading placeholder. Generalizes the local `Skel` helper and the\n * inline `<div className=\"skeleton\" .../>` blocks used in the users, user-detail,\n * and home surfaces. Pulse animation + base color come from `.skeleton` in\n * globals.css.\n */\nexport interface SkeletonProps {\n width?: number | string;\n height?: number | string;\n /** Border radius. Ignored when `circle` is set. Defaults to var(--radius-2). */\n radius?: number | string;\n /** Render as a circle (avatars). */\n circle?: boolean;\n /** Bottom margin. */\n mb?: number | string;\n className?: string;\n style?: CSSProperties;\n}\n\nexport function Skeleton({\n width = \"100%\",\n height = \"var(--space-4)\" /* 16px == space-4 */,\n radius = \"var(--radius-2)\",\n circle = false,\n mb,\n className,\n style,\n}: SkeletonProps) {\n return (\n <div\n className={[\"skeleton\", className].filter(Boolean).join(\" \")}\n aria-hidden=\"true\"\n style={{\n width,\n height,\n borderRadius: circle ? \"50%\" : radius,\n marginBottom: mb,\n ...style,\n }}\n />\n );\n}\n\nexport default Skeleton;\n","import type { CSSProperties, ReactNode } from \"react\";\nimport { Box, Flex, Text } from \"@radix-ui/themes\";\n\n/**\n * AccentHeader — the amber two-tone title bar Figma uses on cards, dialogs,\n * and page banners (Target/Source Calendar, Preview, Upcoming Event, Confirm\n * Logout, Terms hero). Build-once pattern per the design ledger: a solid\n * `--accent-9` bar with a dark bold title, optionally with trailing controls\n * (e.g. the Month/Week/Day toggle lives inside the bar on the Preview card).\n *\n * Figma refs: ui-ux/figma/crops/month-card.png, confirm-dialog.png.\n */\nexport interface AccentHeaderProps {\n title: ReactNode;\n /** Right-aligned slot inside the bar (view toggles, actions). */\n trailing?: ReactNode;\n style?: CSSProperties;\n}\n\nexport function AccentHeader({ title, trailing, style }: AccentHeaderProps) {\n // Plain strings get the bar's standard Text treatment; element titles (e.g.\n // an AlertDialog.Title heading) render as-is so we never nest a heading\n // inside a span (invalid HTML).\n const titleNode =\n typeof title === \"string\" || typeof title === \"number\" ? (\n <Text size=\"3\" weight=\"medium\" style={{ color: \"var(--accent-contrast)\" }}>\n {title}\n </Text>\n ) : (\n title\n );\n return (\n <Flex\n align=\"center\"\n justify=\"between\"\n gap=\"3\"\n px=\"4\"\n style={{\n background: \"var(--accent-9)\",\n minHeight: \"var(--space-7)\",\n ...style,\n }}\n >\n {titleNode}\n {trailing}\n </Flex>\n );\n}\n\n/**\n * AccentCard — white panel with an AccentHeader bar and rounded corners\n * (measured r≈14 @1728 → var(--radius-5)) plus the soft card shadow seen on\n * every Figma card. The header is clipped by the card's radius.\n */\nexport interface AccentCardProps extends AccentHeaderProps {\n children: ReactNode;\n /** Radix padding scale for the body. Defaults to \"4\"; use \"0\" for flush content. */\n bodyPadding?: \"0\" | \"1\" | \"2\" | \"3\" | \"4\" | \"5\" | \"6\";\n}\n\nexport function AccentCard({\n title,\n trailing,\n children,\n bodyPadding = \"4\",\n style,\n}: AccentCardProps) {\n return (\n <Box\n style={{\n background: \"var(--color-panel-solid)\",\n borderRadius: \"var(--radius-5)\",\n overflow: \"hidden\",\n boxShadow: \"var(--shadow-card)\",\n ...style,\n }}\n >\n <AccentHeader title={title} trailing={trailing} />\n <Box p={bodyPadding}>{children}</Box>\n </Box>\n );\n}\n\nexport default AccentHeader;\n","import type { ReactNode } from \"react\";\nimport { AlertDialog, Button } from \"@radix-ui/themes\";\nimport { layout } from \"./layout-tokens\";\nimport { CardFooter } from \"./CardFooter\";\n\n/**\n * ConfirmDialog — the confirm/cancel prompt used for destructive or\n * state-changing actions (Confirm Logout, Remove account, etc). Built on\n * Radix `AlertDialog` with a plain title/description and bottom-right\n * actions, matching the app's other dialogs (e.g. ImportCalendarsDialog):\n * neutral outline Cancel, amber-primary Confirm.\n */\nexport interface ConfirmDialogProps {\n /** Dialog title, rendered inside the AccentHeader bar. */\n title: ReactNode;\n /** Question / body copy. */\n description: ReactNode;\n /** Confirm button label. Defaults to \"Yes\". */\n confirmLabel?: ReactNode;\n /** Cancel button label. Defaults to \"Cancel\". */\n cancelLabel?: ReactNode;\n /** Called when the confirm action is activated (dialog still closes via AlertDialog.Action). */\n onConfirm?: () => void;\n /** Element that opens the dialog, rendered inside AlertDialog.Trigger. Omit for a fully controlled dialog. */\n trigger?: ReactNode;\n /** Controlled open state — omit for uncontrolled, trigger-driven usage. */\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n}\n\nexport function ConfirmDialog({\n title,\n description,\n confirmLabel = \"Yes\",\n cancelLabel = \"Cancel\",\n onConfirm,\n trigger,\n open,\n onOpenChange,\n}: ConfirmDialogProps) {\n return (\n <AlertDialog.Root open={open} onOpenChange={onOpenChange}>\n {trigger ? <AlertDialog.Trigger>{trigger}</AlertDialog.Trigger> : null}\n <AlertDialog.Content maxWidth={layout.dialogSm}>\n <AlertDialog.Title\n size=\"5\"\n mb=\"1\"\n style={{ fontFamily: \"var(--heading-font-family)\", fontWeight: \"var(--font-weight-medium)\" }}\n >\n {title}\n </AlertDialog.Title>\n <AlertDialog.Description size=\"2\" color=\"gray\" mb=\"5\">\n {description}\n </AlertDialog.Description>\n <CardFooter justify=\"between\" noTopMargin>\n <AlertDialog.Cancel>\n <Button size=\"2\" variant=\"outline\" color=\"gray\">\n {cancelLabel}\n </Button>\n </AlertDialog.Cancel>\n <AlertDialog.Action>\n <Button size=\"2\" className=\"btn-amber-primary\" onClick={onConfirm}>\n {confirmLabel}\n </Button>\n </AlertDialog.Action>\n </CardFooter>\n </AlertDialog.Content>\n </AlertDialog.Root>\n );\n}\n\nexport default ConfirmDialog;\n","/** Radix space-scale layout widths. Originally a subset of the app's\n * src/lib/layout-tokens.ts covering only what this package's own components\n * reference; now also exported so consumers stop hand-rolling their own\n * copies (arm-admin had none at all, and core-fe carries a 5-constant\n * fork). Values must match the app's copy — see README.md's \"Files\n * duplicated from the app\". */\nexport const layout = {\n contentMax: \"calc(15 * var(--space-9) + var(--space-5))\",\n accountCardW: \"calc(3 * var(--space-9) + var(--space-8))\",\n accountCardMinH: \"calc(2 * var(--space-9) - var(--space-2))\",\n monthTitleMinW: \"calc(3 * var(--space-9) - var(--space-1))\",\n bigCalendarH: \"calc(10 * var(--space-9))\",\n sidebarColBasis: \"calc(4 * var(--space-9) - var(--space-2))\",\n sidebarColMin: \"calc(3 * var(--space-9) + var(--space-6))\",\n syncColMin: \"calc(5 * var(--space-9))\",\n syncColWide: \"calc(7 * var(--space-9) + var(--space-6))\",\n dialogSm: \"calc(6 * var(--space-9) - var(--space-2))\",\n dialogBody: \"calc(5 * var(--space-9) + var(--space-7))\",\n authFormMax: \"calc(6 * var(--space-9) + var(--space-8))\",\n brandLogoMax: \"calc(6 * var(--space-9) + var(--space-8) - var(--space-1))\",\n connectedAccountCardH: \"calc(var(--space-9) - var(--space-1))\",\n dialogMd: \"calc(6 * var(--space-9) + var(--space-6))\",\n dialogLg: \"calc(7 * var(--space-9) - var(--space-1))\",\n emptyStateMax: \"calc(10 * var(--space-9))\",\n emptyStateCopyMax: \"calc(6 * var(--space-9))\",\n providerChooserMax: \"calc(6 * var(--space-9) + var(--space-6))\",\n /* Admin portal. The two audit columns are fixed so the header grid and\n * every row grid resolve to the same track sizes; settingsGridMin is the\n * floor that keeps a 5–6 column table legible before it starts scrolling\n * horizontally instead of crushing its columns. */\n auditColTime: \"calc(var(--space-9) + var(--space-2))\",\n auditColAction: \"calc(var(--space-9) + var(--space-5) + var(--space-1))\",\n searchFieldW: \"calc(3 * var(--space-9) + var(--space-5) + var(--space-1))\",\n settingsGridMin: \"calc(5 * var(--space-9) + var(--space-5))\",\n placeholderMd: \"calc(6 * var(--space-9) + var(--space-4))\",\n} as const;\n","import type { ReactNode } from \"react\";\nimport { Flex } from \"@radix-ui/themes\";\n\nexport interface CardFooterProps {\n children: ReactNode;\n justify?: \"end\" | \"between\";\n /** Omit the top margin when the content above already ends with its own\n * bottom margin/gap (e.g. Flex `mb`) — avoids doubled spacing. */\n noTopMargin?: boolean;\n /** Match the enclosing container's own padding so the negative-margin\n * breakout lines up flush with its edges. Defaults to Card size=\"3\"'s\n * var(--space-5); pass the container's actual padding otherwise (e.g.\n * a default-size Card's var(--space-3), StepCard's var(--space-4)). */\n pad?: string;\n /** Match the enclosing container's own corner radius so the footer's\n * bottom corners line up. Defaults to Card size=\"3\"+'s var(--radius-5);\n * default-size Card (1-2) uses var(--radius-4). */\n radius?: string;\n}\n\n/** Full-bleed gray action bar for the bottom of a Card — breaks out of the\n * Card's own padding so it reads as a distinct footer strip, same shape as\n * ImportCalendarsDialog's button row. Use for any Card/Dialog that ends in\n * one or more buttons instead of a plain Separator + Flex. */\nexport function CardFooter({\n children,\n justify = \"end\",\n noTopMargin,\n pad = \"var(--space-5)\",\n radius = \"var(--radius-5)\",\n}: CardFooterProps) {\n return (\n <Flex\n justify={justify}\n style={{\n margin: `${noTopMargin ? \"0\" : \"var(--space-5)\"} calc(-1 * ${pad}) calc(-1 * ${pad})`,\n padding: `var(--space-4) ${pad}`,\n alignItems: \"center\",\n background: \"var(--gray-2)\",\n borderTop: \"1px solid var(--gray-5)\",\n borderRadius: `0 0 ${radius} ${radius}`,\n }}\n >\n {children}\n </Flex>\n );\n}\n"]}
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as Ma,b as R,c as vt}from"./chunk-LGJWNA6J.mjs";import{jsx as Na}from"react/jsx-runtime";function Ba({width:e="100%",height:r="var(--space-4)",radius:t="var(--radius-2)",circle:a=!1,mb:n,className:o,style:i}){return Na("div",{className:["skeleton",o].filter(Boolean).join(" "),"aria-hidden":"true",style:{width:e,height:r,borderRadius:a?"50%":t,marginBottom:n,...i}})}import{Box as ht,Flex as Fa,Text as La}from"@radix-ui/themes";import{jsx as Sr,jsxs as xt}from"react/jsx-runtime";function bt({title:e,trailing:r,style:t}){let a=typeof e=="string"||typeof e=="number"?Sr(La,{size:"3",weight:"medium",style:{color:"var(--accent-contrast)"},children:e}):e;return xt(Fa,{align:"center",justify:"between",gap:"3",px:"4",style:{background:"var(--accent-9)",minHeight:"var(--space-7)",...t},children:[a,r]})}function Ha({title:e,trailing:r,children:t,bodyPadding:a="4",style:n}){return xt(ht,{style:{background:"var(--color-panel-solid)",borderRadius:"var(--radius-5)",overflow:"hidden",boxShadow:"var(--shadow-card)",...n},children:[Sr(bt,{title:e,trailing:r}),Sr(ht,{p:a,children:t})]})}import{AlertDialog as he,Button as Ct}from"@radix-ui/themes";var b={contentMax:"calc(15 * var(--space-9) + var(--space-5))",accountCardW:"calc(3 * var(--space-9) + var(--space-8))",accountCardMinH:"calc(2 * var(--space-9) - var(--space-2))",monthTitleMinW:"calc(3 * var(--space-9) - var(--space-1))",bigCalendarH:"calc(10 * var(--space-9))",sidebarColBasis:"calc(4 * var(--space-9) - var(--space-2))",sidebarColMin:"calc(3 * var(--space-9) + var(--space-6))",syncColMin:"calc(5 * var(--space-9))",syncColWide:"calc(7 * var(--space-9) + var(--space-6))",dialogSm:"calc(6 * var(--space-9) - var(--space-2))",dialogBody:"calc(5 * var(--space-9) + var(--space-7))",authFormMax:"calc(6 * var(--space-9) + var(--space-8))",brandLogoMax:"calc(6 * var(--space-9) + var(--space-8) - var(--space-1))",connectedAccountCardH:"calc(var(--space-9) - var(--space-1))",dialogMd:"calc(6 * var(--space-9) + var(--space-6))",dialogLg:"calc(7 * var(--space-9) - var(--space-1))",emptyStateMax:"calc(10 * var(--space-9))",emptyStateCopyMax:"calc(6 * var(--space-9))",providerChooserMax:"calc(6 * var(--space-9) + var(--space-6))",auditColTime:"calc(var(--space-9) + var(--space-2))",auditColAction:"calc(var(--space-9) + var(--space-5) + var(--space-1))",searchFieldW:"calc(3 * var(--space-9) + var(--space-5) + var(--space-1))",settingsGridMin:"calc(5 * var(--space-9) + var(--space-5))",placeholderMd:"calc(6 * var(--space-9) + var(--space-4))"};import{Flex as Oa}from"@radix-ui/themes";import{jsx as _a}from"react/jsx-runtime";function X({children:e,justify:r="end",noTopMargin:t,pad:a="var(--space-5)",radius:n="var(--radius-5)"}){return _a(Oa,{justify:r,style:{margin:`${t?"0":"var(--space-5)"} calc(-1 * ${a}) calc(-1 * ${a})`,padding:`var(--space-4) ${a}`,alignItems:"center",background:"var(--gray-2)",borderTop:"1px solid var(--gray-5)",borderRadius:`0 0 ${n} ${n}`},children:e})}import{jsx as be,jsxs as kr}from"react/jsx-runtime";function Rr({title:e,description:r,confirmLabel:t="Yes",cancelLabel:a="Cancel",onConfirm:n,trigger:o,open:i,onOpenChange:l}){return kr(he.Root,{open:i,onOpenChange:l,children:[o?be(he.Trigger,{children:o}):null,kr(he.Content,{maxWidth:b.dialogSm,children:[be(he.Title,{size:"5",mb:"1",style:{fontFamily:"var(--heading-font-family)",fontWeight:"var(--font-weight-medium)"},children:e}),be(he.Description,{size:"2",color:"gray",mb:"5",children:r}),kr(X,{justify:"between",noTopMargin:!0,children:[be(he.Cancel,{children:be(Ct,{size:"2",variant:"outline",color:"gray",children:a})}),be(he.Action,{children:be(Ct,{size:"2",className:"btn-amber-primary",onClick:n,children:t})})]})]})]})}import{PauseIcon as Wa}from"@radix-ui/react-icons";function h(e){return{width:`var(${e})`,height:`var(${e})`}}import{jsx as wt,jsxs as Va}from"react/jsx-runtime";function Ir({label:e="Paused",style:r}){return Va("span",{style:{display:"inline-flex",alignItems:"center",gap:"var(--space-1)",height:"calc(var(--space-4) + var(--space-1))",padding:"var(--space-1) var(--space-2)",border:"1px solid var(--color-paused)",borderRadius:999,background:"var(--color-panel-solid)",color:"var(--color-paused)",fontSize:"var(--font-size-1)",fontWeight:600,lineHeight:1,whiteSpace:"nowrap",...r},children:[wt("span",{"aria-hidden":"true",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"var(--space-3)",height:"var(--space-3)",flexShrink:0,borderRadius:"50%",border:"1px solid var(--color-paused)"},children:wt(Wa,{style:h("--space-2")})}),e]})}import{Avatar as $a,Box as Tt,DropdownMenu as Ie,Flex as St,IconButton as Ua,Text as kt}from"@radix-ui/themes";import{DotsVerticalIcon as Ga,PauseIcon as ja,PlayIcon as Ya,TrashIcon as Ka}from"@radix-ui/react-icons";import{jsx as $,jsxs as ne}from"react/jsx-runtime";function qa({name:e,email:r,avatarSrc:t,paused:a=!1,onPause:n,onResume:o,onDelete:i,onClick:l,badge:s,accentColor:c,style:p}){let d=$(kt,{as:l?"span":"p",size:"3",weight:"medium",truncate:!0,style:{color:"var(--gray-12)",minWidth:0},children:e});return ne(Tt,{onClick:l,style:{width:b.accountCardW,minHeight:b.accountCardMinH,padding:"var(--space-3)",background:"var(--color-panel-solid)",borderRadius:"var(--radius-4)",boxShadow:"var(--shadow-card)",cursor:l?"pointer":void 0,...p},children:[ne(St,{align:"center",justify:"between",gap:"2",mb:"3",children:[ne(St,{align:"center",gap:"2",style:{minWidth:0},children:[ne("div",{style:{position:"relative",flexShrink:0},children:[$($a,{size:"3",radius:"full",src:t,fallback:e.charAt(0).toUpperCase()||"?",style:c?{background:c,color:"white"}:void 0}),s&&$("span",{style:{position:"absolute",right:"calc(-1 * var(--space-1))",bottom:"calc(-1 * var(--space-1))",width:"var(--space-4)",height:"var(--space-4)",borderRadius:"50%",background:"var(--color-panel-solid)",border:"1px solid var(--gray-4)",display:"inline-flex",alignItems:"center",justifyContent:"center",transform:"scale(0.72)"},children:s})]}),a&&$(Ir,{})]}),ne(Ie.Root,{children:[$(Ie.Trigger,{children:$(Ua,{variant:"ghost",color:"gray","aria-label":"Account actions",style:{flexShrink:0},onClick:g=>g.stopPropagation(),children:$(Ga,{})})}),ne(Ie.Content,{align:"end",onClick:g=>g.stopPropagation(),children:[a?ne(Ie.Item,{onSelect:o,children:[$(Ya,{})," Resume"]}):ne(Ie.Item,{onSelect:n,children:[$(ja,{})," Pause"]}),ne(Ie.Item,{color:"red",onSelect:i,children:[$(Ka,{})," Delete"]})]})]})]}),ne(Tt,{style:{minWidth:0},children:[l?$("button",{type:"button",className:"card-title-button",onClick:g=>{g.stopPropagation(),l()},children:d}):d,$(kt,{as:"p",size:"1",color:"gray",truncate:!0,children:r})]})]})}import{Box as Rt,Flex as It,Heading as Xa,IconButton as At,Text as Dt}from"@radix-ui/themes";import{ChevronLeftIcon as Za,ChevronRightIcon as Ja}from"@radix-ui/react-icons";var L={h1:"6",h2:"5",h3:"4",h4:"3"};import{Fragment as io,jsx as F,jsxs as Dr}from"react/jsx-runtime";var Qa=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Ar="var(--space-9)",eo="var(--space-8)",Pt="var(--space-2)",ro=new Intl.DateTimeFormat("en-US",{month:"long",year:"numeric"}),to=new Intl.DateTimeFormat("en-US",{weekday:"long",month:"long",day:"numeric",year:"numeric"});function ao(e,r){return e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth()&&e.getDate()===r.getDate()}function Et(e){return(e+6)%7}function oo(e){let r=e.getMonth(),t=e.getFullYear(),a=new Date(t,r,1),n=new Date(t,r+1,0),o=Et(a.getDay()),i=6-Et(n.getDay()),l=new Date(t,r,1-o),s=o+n.getDate()+i;return Array.from({length:s},(c,p)=>{let d=new Date(l.getFullYear(),l.getMonth(),l.getDate()+p);return{date:d,inCurrentMonth:d.getMonth()===r}})}function zt(e,r){return new Date(e.getFullYear(),e.getMonth()+r,1)}function no({month:e,onMonthChange:r,events:t=[],dayDots:a,today:n,onSelectDay:o,style:i}){let l=n??new Date,s=oo(e),c=new Set(t.map(p=>p.toDateString()));return Dr(It,{direction:"column",align:"center",gap:"4",style:i,children:[Dr(It,{align:"center",gap:"2",children:[F(At,{type:"button",variant:"ghost",color:"gray","aria-label":"Previous month",onClick:()=>r?.(zt(e,-1)),children:F(Za,{style:h("--space-4")})}),F(Xa,{as:"h2",size:L.h2,weight:"medium",style:{minWidth:b.monthTitleMinW,textAlign:"center"},children:ro.format(e)}),F(At,{type:"button",variant:"ghost",color:"gray","aria-label":"Next month",onClick:()=>r?.(zt(e,1)),children:F(Ja,{style:h("--space-4")})})]}),F(Rt,{style:{display:"grid",gridTemplateColumns:`repeat(7, ${Ar})`,gap:Pt},children:Qa.map(p=>F(Dt,{size:"2",align:"center",style:{color:"var(--gray-11)"},children:p},p))}),F(Rt,{style:{display:"grid",gridTemplateColumns:`repeat(7, ${Ar})`,gap:Pt},children:s.map(({date:p,inCurrentMonth:d})=>{let g=ao(p,l),v=a?.get(p.toDateString()),f=c.has(p.toDateString()),x={position:"relative",width:Ar,height:eo,display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",background:d?g?"var(--color-panel-solid)":"transparent":"var(--gray-2)",border:g?"1.5px solid var(--accent-9)":"none",borderRadius:g?"var(--radius-3)":d?void 0:"var(--radius-2)",padding:0,font:"inherit",cursor:o?"pointer":void 0},w=Dr(io,{children:[v&&v.length>0?F("span",{"aria-hidden":"true",style:{position:"absolute",bottom:"var(--space-1)",left:0,right:0,display:"flex",justifyContent:"center",gap:"2px"},children:v.slice(0,3).map((ae,se)=>F("span",{style:{width:"var(--space-1)",height:"var(--space-1)",borderRadius:"50%",background:ae}},se))}):f&&F("span",{"aria-hidden":"true",style:{position:"absolute",top:"var(--space-1)",right:"var(--space-2)",width:"var(--space-2)",height:"var(--space-2)",borderRadius:"50%",background:"var(--accent-9)"}}),F(Dt,{size:"3",style:{color:d?"var(--gray-12)":"var(--gray-11)",fontWeight:g?600:400},children:p.getDate()})]}),z=p.toISOString();return o?F("button",{type:"button",onClick:()=>o(p),"aria-label":to.format(p),style:x,children:w},z):F("div",{style:x,children:w},z)})})]})}import{useEffect as so}from"react";import{Callout as Pr}from"@radix-ui/themes";import{CheckCircledIcon as lo,ExclamationTriangleIcon as co}from"@radix-ui/react-icons";import{jsx as Le,jsxs as po}from"react/jsx-runtime";function Er({msg:e,color:r="green",onDone:t,durationMs:a=3e3}){return so(()=>{let n=setTimeout(t,a);return()=>clearTimeout(n)},[t,a]),Le("div",{style:{position:"fixed",bottom:"var(--space-5)",right:"var(--space-5)",zIndex:1e4,maxWidth:b.dialogBody,pointerEvents:"none"},children:po(Pr.Root,{color:r,variant:"soft",size:"1",children:[Le(Pr.Icon,{children:r==="red"?Le(co,{}):Le(lo,{})}),Le(Pr.Text,{children:e})]})})}import{jsx as go}from"react/jsx-runtime";function P({children:e,size:r="var(--space-7)"}){return go("div",{style:{width:r,height:r,borderRadius:"var(--radius-4)",background:"var(--color-panel-solid)",border:"1px solid var(--gray-5)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e})}import{Box as uo,Flex as mo,Text as Mt}from"@radix-ui/themes";import{LockClosedIcon as fo}from"@radix-ui/react-icons";import{jsx as Bt,jsxs as zr}from"react/jsx-runtime";function yo({title:e,time:r,detail:t,color:a,locked:n}){return zr(mo,{align:"center",justify:"between",style:{background:a,borderRadius:"var(--radius-3)",padding:"var(--space-3)",color:"white"},children:[zr(uo,{style:{minWidth:0},children:[Bt(Mt,{as:"p",size:"2",weight:"medium",style:{color:"white"},truncate:!0,children:e}),zr(Mt,{as:"p",size:"1",style:{color:"rgba(255,255,255,0.85)"},truncate:!0,children:[r,t?` \xB7 ${t}`:""]})]}),n&&Bt(fo,{style:{flexShrink:0,color:"rgba(255,255,255,0.85)"}})]})}import{Box as vo}from"@radix-ui/themes";import{jsx as ho}from"react/jsx-runtime";function Mr({children:e,style:r,showBorder:t=!1,onActivate:a,selected:n=!1,className:o,"aria-label":i}){let l=!!a;function s(c){a&&(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),a())}return ho(vo,{role:l?"button":void 0,tabIndex:l?0:void 0,"aria-label":i,onClick:a,onKeyDown:l?s:void 0,className:["data-table-row",l&&"data-table-row--interactive",l&&n&&"data-table-row--selected",o].filter(Boolean).join(" "),style:{borderTop:t?"1px solid var(--gray-3)":void 0,...r},children:e})}import{useId as bo}from"react";import{Card as xo,Flex as Br,Text as Nr}from"@radix-ui/themes";import{jsx as ie,jsxs as Ae}from"react/jsx-runtime";function Co({label:e,value:r,delta:t,deltaDir:a,goodDirection:n,statusColor:o,sparkline:i}){return ie(xo,{className:"metric-card",children:Ae(Br,{direction:"column",p:"1",children:[Ae(Br,{align:"center",justify:"between",mb:"3",children:[ie(Nr,{as:"span",className:"ds-section-label",children:e}),ie("div",{style:{width:"var(--space-2)",height:"var(--space-2)",borderRadius:"50%",background:o,flexShrink:0}})]}),ie(Nr,{as:"p",className:"metric-card-value",children:r}),Ae(Br,{align:"end",justify:"between",children:[Ae(Nr,{size:"1",style:{color:a==="flat"?"var(--gray-11)":a===n?"var(--green-11)":"var(--red-11)",lineHeight:1.4},children:[a==="up"?"\u2191 ":a==="down"?"\u2193 ":"",t]}),ie(wo,{data:i,color:o})]})]})})}function wo({data:e,color:r}){let n=Math.min(...e),i=Math.max(...e)-n||1,l=e.map((g,v)=>({x:v/(e.length-1)*72,y:28-(g-n)/i*28*.75-28*.1})),s=l.map((g,v)=>`${v===0?"M":"L"} ${g.x.toFixed(1)} ${g.y.toFixed(1)}`).join(" "),c=["M 0 28",...l.map(g=>`L ${g.x.toFixed(1)} ${g.y.toFixed(1)}`),"L 72 28 Z"].join(" "),d=`spk${bo().replace(/[^a-zA-Z0-9_-]/g,"")}`;return Ae("svg",{width:72,height:28,viewBox:"0 0 72 28","aria-hidden":!0,style:{overflow:"visible",flexShrink:0},children:[ie("defs",{children:Ae("linearGradient",{id:d,x1:"0",y1:"0",x2:"0",y2:"1",children:[ie("stop",{offset:"0%",stopColor:r,stopOpacity:"0.18"}),ie("stop",{offset:"100%",stopColor:r,stopOpacity:"0"})]})}),ie("path",{d:c,fill:`url(#${d})`}),ie("path",{d:s,fill:"none",stroke:r,strokeWidth:"1.5",strokeLinejoin:"round",strokeLinecap:"round"})]})}import{Link as To}from"react-router-dom";import{Button as So,Card as ko,Flex as Nt,Text as Ft}from"@radix-ui/themes";import{ArrowRightIcon as Ro}from"@radix-ui/react-icons";import{jsx as De,jsxs as er}from"react/jsx-runtime";function Io({href:e,icon:r,name:t,description:a}){return er(ko,{style:{height:"100%",display:"flex",flexDirection:"column"},children:[er(Nt,{direction:"column",gap:"3",p:"1",flexGrow:"1",children:[er(Nt,{align:"center",gap:"3",minWidth:"0",children:[De(P,{children:r}),De(Ft,{size:"4",weight:"medium",style:{color:"var(--gray-12)",fontFamily:"var(--font-poppins)"},truncate:!0,children:t})]}),De(Ft,{size:"2",style:{color:"var(--gray-11)",fontFamily:"var(--font-poppins)",lineHeight:1.5},children:a})]}),De(X,{pad:"var(--space-3)",radius:"var(--radius-4)",children:De(So,{size:"2",className:"btn-amber-primary",asChild:!0,children:er(To,{to:e,children:["Open",De(Ro,{style:h("--space-3")})]})})})]})}import{Text as He}from"@radix-ui/themes";import{jsx as Fr,jsxs as Lr}from"react/jsx-runtime";function Ao({tag:e,tagColor:r,msg:t,actor:a,timeAgo:n,timestamp:o,showBorder:i}){return Lr(Mr,{showBorder:i,style:{display:"flex",alignItems:"center",gap:"var(--space-3)",paddingBlock:"var(--space-2)",paddingInline:"var(--space-4)"},children:[Fr(He,{as:"span",size:"1",weight:"medium",className:"data-mono",style:{color:r,minWidth:"var(--space-6)",letterSpacing:"0.06em",flexShrink:0},children:e}),Lr(He,{as:"span",size:"2",style:{flex:1,color:"var(--gray-11)",lineHeight:1.4,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[t,a&&Lr(He,{as:"span",size:"1",style:{color:"var(--gray-11)",marginLeft:"var(--space-2)"},children:["by ",a]})]}),n&&Fr(He,{as:"span",size:"1",color:"gray",style:{whiteSpace:"nowrap",flexShrink:0},children:n}),Fr(He,{as:"span",size:"1",className:"data-mono",style:{color:"var(--gray-11)",whiteSpace:"nowrap",flexShrink:0,minWidth:"var(--space-7)",textAlign:"right"},children:o})]})}import{Button as Do,Card as Po,Flex as Eo,Text as zo}from"@radix-ui/themes";import{ExclamationTriangleIcon as Mo}from"@radix-ui/react-icons";import{jsx as Oe,jsxs as No}from"react/jsx-runtime";function Bo({onRetry:e,message:r="Couldn't load your dashboard."}){return Oe(Po,{children:No(Eo,{direction:"column",align:"center",justify:"center",py:"9",gap:"3",children:[Oe(P,{children:Oe(Mo,{style:{...h("--space-5"),color:"var(--gray-7)"}})}),Oe(zo,{size:"2",color:"gray",children:r}),Oe(Do,{size:"2",color:"amber",variant:"solid",className:"btn-amber-primary",onClick:e,children:"Retry"})]})})}import{useMemo as Fo}from"react";import{Button as Lo,Flex as Ho,IconButton as rr,Text as Oo}from"@radix-ui/themes";import{ChevronLeftIcon as _o,ChevronRightIcon as Wo,DoubleArrowLeftIcon as Vo,DoubleArrowRightIcon as $o}from"@radix-ui/react-icons";import{jsx as Z,jsxs as jo}from"react/jsx-runtime";var Pe="\u2026";function Uo(e,r,t){let a=t*2+5;if(r<=a)return Array.from({length:r},(c,p)=>p+1);let n=Math.max(e-t,1),o=Math.min(e+t,r),i=n>2,l=o<r-1;if(!i&&l)return[...Array.from({length:3+t*2},(p,d)=>d+1),Pe,r];if(i&&!l){let c=3+t*2,p=Array.from({length:c},(d,g)=>r-c+g+1);return[1,Pe,...p]}let s=Array.from({length:o-n+1},(c,p)=>n+p);return[1,Pe,...s,Pe,r]}function Go({currentPage:e,totalPages:r,onPageChange:t,siblingCount:a=1,showFirstLast:n=!1,size:o="2"}){let i=Fo(()=>Uo(e,r,a),[e,r,a]),l=e<=1,s=e>=r;return Z(Ho,{asChild:!0,align:"center",gap:"1",children:jo("nav",{"aria-label":"Pagination",children:[n&&Z(rr,{size:o,variant:"soft",color:"gray","aria-label":"First page",disabled:l,onClick:()=>t(1),children:Z(Vo,{})}),Z(rr,{size:o,variant:"soft",color:"gray","aria-label":"Previous page",disabled:l,onClick:()=>t(e-1),children:Z(_o,{})}),i.map((c,p)=>c===Pe?Z(Oo,{size:o,color:"gray","aria-hidden":!0,style:{paddingInline:"var(--space-1)"},children:Pe},`ellipsis-${p}`):Z(Lo,{size:o,"aria-label":`Page ${c}`,"aria-current":c===e?"page":void 0,variant:c===e?"solid":"soft",color:c===e?void 0:"gray",className:c===e?"btn-amber-primary":void 0,onClick:()=>c!==e&&t(c),children:c},c)),Z(rr,{size:o,variant:"soft",color:"gray","aria-label":"Next page",disabled:s,onClick:()=>t(e+1),children:Z(Wo,{})}),n&&Z(rr,{size:o,variant:"soft",color:"gray","aria-label":"Last page",disabled:s,onClick:()=>t(r),children:Z($o,{})})]})})}var tr={admin:{label:"Admin",color:"amber"},operator:{label:"Operator",color:"blue"},user:{label:"Platform User",color:"gray"}},Yo={admin:tr.admin.label,operator:tr.operator.label,user:tr.user.label},Ko={active:{label:"Active",color:"var(--color-success)"},inactive:{label:"Inactive",color:"var(--gray-11)"},suspended:{label:"Suspended",color:"var(--color-danger)"}},qo={ok:"var(--green-9)",warn:"var(--orange-9)",error:"var(--red-9)"},Xo={auth:{tag:"AUTH",color:"var(--gray-11)"},sync:{tag:"SYNC",color:"var(--blue-11)"},role:{tag:"ROLE",color:"var(--violet-11)"},provision:{tag:"PROV",color:"var(--green-11)"},health:{tag:"HLTH",color:"var(--teal-11)"},error:{tag:"ERR!",color:"var(--red-11)"}},Lt={USER_UPDATED:{label:"User updated",tag:"UPD",badge:"amber",color:"var(--amber-11)"},USER_DISABLED:{label:"User disabled",tag:"DIS",badge:"red",color:"var(--red-11)"},USER_ENABLED:{label:"User enabled",tag:"ENA",badge:"green",color:"var(--teal-11)"},USER_APPROVED:{label:"User approved",tag:"APPR",badge:"green",color:"var(--green-11)"},USER_REJECTED:{label:"User rejected",tag:"REJ",badge:"red",color:"var(--red-11)"},SIGNUP_NOTIFICATIONS_ON:{label:"Signup notifications on",tag:"NOTF",badge:"gray",color:"var(--gray-11)"},SIGNUP_NOTIFICATIONS_OFF:{label:"Signup notifications off",tag:"NOTF",badge:"gray",color:"var(--gray-11)"},APPROVAL_EMAIL_RESENT:{label:"Approval email resent",tag:"MAIL",badge:"amber",color:"var(--amber-11)"},USER_DELETED:{label:"User deleted",tag:"DEL",badge:"yellow",color:"var(--red-11)"},ADMIN_GRANTED:{label:"Admin granted",tag:"ADMN",badge:"gray",color:"var(--violet-11)"},ADMIN_REVOKED:{label:"Admin revoked",tag:"ADMN",badge:"gray",color:"var(--orange-11)"},ADMIN_ROLE_CHANGED:{label:"Role changed",tag:"ROLE",badge:"amber",color:"var(--violet-11)"},SESSION_REVOKED:{label:"Session revoked",tag:"SESS",badge:"gray",color:"var(--gray-11)"},APP_GRANTED:{label:"App access granted",tag:"APP",badge:"green",color:"var(--green-11)"},APP_REVOKED:{label:"App access revoked",tag:"APP",badge:"red",color:"var(--orange-11)"}};function Zo(e){return Lt[e]??{label:e,tag:e.slice(0,4).toUpperCase(),badge:"gray",color:"var(--gray-11)"}}import{jsx as Ht}from"react/jsx-runtime";function Hr(){return Ht("div",{className:"auth-art-card",children:Ht("img",{src:"/arm-logo-inverted.svg",alt:"araMetrics",style:{width:"56%",maxWidth:b.brandLogoMax,display:"block",userSelect:"none"},draggable:!1})})}import{jsx as ar,jsxs as Qo}from"react/jsx-runtime";function Jo({children:e}){return Qo("div",{style:{minHeight:"100vh",display:"flex",background:"var(--surface-content)",padding:"var(--space-5)",gap:"var(--space-5)"},children:[ar("div",{className:"auth-card-left",style:{width:"47%",flexShrink:0,position:"sticky",top:"var(--space-5)",height:"calc(100vh - var(--space-8))"},children:ar(Hr,{})}),ar("div",{className:"auth-card-right",style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",justifyContent:"center",minHeight:"calc(100vh - var(--space-8))",padding:"var(--space-7) var(--space-5)"},children:ar("main",{style:{maxWidth:b.authFormMax,width:"100%",marginLeft:"auto",marginRight:"auto",background:"var(--color-panel-solid)",borderRadius:"var(--radius-5)",boxShadow:"var(--shadow-card)",padding:"var(--space-7) var(--space-5)"},children:e})})]})}import{jsx as or,jsxs as en}from"react/jsx-runtime";function Or(){return en("svg",{width:18,height:18,viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:[or("path",{d:"M15.68 8.18c0-.57-.05-1.11-.14-1.64H8v3.1h4.3a3.68 3.68 0 0 1-1.6 2.42v2h2.58c1.51-1.39 2.4-3.44 2.4-5.88Z",fill:"#4285F4"}),or("path",{d:"M8 16c2.16 0 3.97-.71 5.3-1.94l-2.59-2a4.88 4.88 0 0 1-7.27-2.56H0.9v2.07A8 8 0 0 0 8 16Z",fill:"#34A853"}),or("path",{d:"M3.44 9.5A4.8 4.8 0 0 1 3.19 8c0-.52.09-1.03.25-1.5V4.43H.9A8 8 0 0 0 0 8c0 1.29.31 2.51.9 3.57L3.44 9.5Z",fill:"#FBBC05"}),or("path",{d:"M8 3.18c1.22 0 2.31.42 3.17 1.24l2.37-2.37A7.94 7.94 0 0 0 8 0 8 8 0 0 0 .9 4.43L3.44 6.5A4.77 4.77 0 0 1 8 3.18Z",fill:"#EA4335"})]})}import{jsx as nr,jsxs as rn}from"react/jsx-runtime";function _r(){return rn("svg",{width:18,height:18,viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:[nr("rect",{x:"0",y:"0",width:"7.6",height:"7.6",fill:"#F25022"}),nr("rect",{x:"8.4",y:"0",width:"7.6",height:"7.6",fill:"#7FBA00"}),nr("rect",{x:"0",y:"8.4",width:"7.6",height:"7.6",fill:"#00A4EF"}),nr("rect",{x:"8.4",y:"8.4",width:"7.6",height:"7.6",fill:"#FFB900"})]})}import{useRef as tn}from"react";import{TextField as an}from"@radix-ui/themes";import{jsx as Ot}from"react/jsx-runtime";function Wr({value:e,onChange:r,disabled:t}){let a=tn([]);function n(s,c){let p=c.target.value.replace(/\D/g,"").slice(-1),d=Array.from({length:4},(g,v)=>e[v]??"");d[s]=p,r(d.join("")),p&&s<3&&a.current[s+1]?.focus()}function o(s,c){let p=Array.from({length:4},(d,g)=>e[g]??"");c.key==="Backspace"?!p[s]&&s>0&&(p[s-1]="",r(p.join("")),a.current[s-1]?.focus()):c.key==="ArrowLeft"&&s>0?a.current[s-1]?.focus():c.key==="ArrowRight"&&s<3&&a.current[s+1]?.focus()}function i(s){let c=s.clipboardData.getData("text").replace(/\D/g,"").slice(0,4);c&&(s.preventDefault(),r(c),a.current[Math.min(c.length,3)]?.focus())}let l=Array.from({length:4},(s,c)=>e[c]??"");return Ot("div",{style:{display:"flex",gap:"var(--space-3)",justifyContent:"center"},children:l.map((s,c)=>Ot(an.Root,{ref:p=>{a.current[c]=p},type:"text",inputMode:"numeric",maxLength:1,value:s,onChange:p=>n(c,p),onKeyDown:p=>o(c,p),onPaste:i,disabled:t,className:"otp-box","aria-label":`Digit ${c+1}`,autoComplete:c===0?"one-time-code":"off"},c))})}import{Button as Vr,Callout as _e,Heading as on,Text as $r}from"@radix-ui/themes";import{ExclamationTriangleIcon as nn}from"@radix-ui/react-icons";import{Fragment as _t,jsx as U,jsxs as le}from"react/jsx-runtime";function sn({email:e,title:r,subtitle:t,code:a,onCodeChange:n,otpDevHint:o,error:i,errorAction:l,busy:s,otpExpiresAt:c,otpSecondsLeft:p,resendCooldown:d,onResend:g,onUseDifferentEmail:v}){return le(_t,{children:[le("div",{style:{marginBottom:"var(--space-6)",textAlign:"center"},children:[U(on,{as:"h1",size:L.h1,style:{color:"var(--ink-strong)",marginBottom:"var(--space-3)"},children:r}),le($r,{as:"p",size:"2",style:{color:"var(--ink-mid)",lineHeight:1.55},children:[t," ",U("span",{style:{fontWeight:600,color:"var(--ink-strong)"},children:e}),"."]})]}),o&&U(_e.Root,{color:"gray",variant:"surface",size:"1",style:{marginBottom:"var(--space-5)"},children:le(_e.Text,{style:{fontFamily:"var(--font-poppins)"},children:["Dev hint \u2014 code is ",U("strong",{children:o})]})}),i&&le(_e.Root,{color:"red",variant:"surface",size:"2",style:{marginBottom:"var(--space-5)"},children:[U(_e.Icon,{children:U(nn,{})}),le(_e.Text,{style:{fontFamily:"var(--font-poppins)"},children:[i,l&&le(_t,{children:[" ",U(Vr,{type:"button",variant:"ghost",size:"1",onClick:l.onClick,style:{fontWeight:600,textDecoration:"underline",height:"auto",padding:0},children:l.label})]})]})]}),le("div",{children:[U(Wr,{value:a,onChange:n,disabled:s||p<=0}),s?U($r,{as:"p",size:"1",style:{color:"var(--ink-mid)",marginTop:"var(--space-3)",textAlign:"center"},children:"Checking code\u2026"}):c&&p<=0?U($r,{as:"p",size:"1",style:{color:"var(--red-11)",marginTop:"var(--space-3)",textAlign:"center"},children:"Code expired \u2014 resend to get a new one."}):null]}),le("div",{style:{marginTop:"var(--space-5)",display:"flex",flexDirection:"column",alignItems:"center",gap:"var(--space-3)"},children:[U(Vr,{type:"button",variant:"ghost",size:"2",disabled:d>0||s,onClick:g,style:{fontWeight:500,color:d>0?"rgba(85, 85, 85, 0.4)":"var(--ink-strong)",textDecoration:d>0?"none":"underline"},children:d>0?`Resend email (${d}s)`:"Resend email"}),U(Vr,{type:"button",variant:"ghost",size:"2",className:"auth-underline-link",disabled:s,onClick:v,style:{fontWeight:500,color:"var(--ink-strong)"},children:"Use a Different Email"})]})]})}import{jsx as Wt}from"react/jsx-runtime";function H({provider:e}){return e==="microsoft"?Wt(_r,{}):Wt(Or,{})}var ln={google:"Google",microsoft:"Microsoft"};import{useState as Vt}from"react";import{Link as Xt,useLocation as cn}from"react-router-dom";import{Avatar as $t,Badge as Zt,DropdownMenu as ce,IconButton as Ut,Text as sr,Tooltip as We}from"@radix-ui/themes";import{ChevronLeftIcon as dn,ChevronRightIcon as Gt,Cross1Icon as pn,DotFilledIcon as gn,DotsVerticalIcon as un,ExitIcon as mn,GearIcon as jt,QuestionMarkCircledIcon as fn}from"@radix-ui/react-icons";import{Fragment as Ur,jsx as m,jsxs as D}from"react/jsx-runtime";var cr="var(--space-9)",lr=e=>e.badge?`${e.label} \xB7 ${e.badge}`:e.label,yn="calc(4 * var(--space-9))",vn="calc(var(--space-9) + var(--space-6))",hn="calc(4 * var(--space-9) + var(--space-5))",bn="var(--space-8)",Yt="var(--space-5)",Kt="var(--space-5)",xn="calc(var(--space-5) + var(--space-3))",Cn="var(--space-3)",wn=e=>e?"opacity 130ms ease 80ms":"opacity 90ms ease",qt="opacity 200ms ease";function Tn({collapsed:e,onToggle:r,onClose:t,items:a,utilityHrefs:n,user:o,onSignOut:i,hasCalendarAccounts:l=!1,brandLogoExpandedSrc:s="/expand.svg",brandLogoCollapsedSrc:c="/shrink.svg",helpHref:p,devRoles:d,onDevRoleSelect:g,showDevRoles:v=!1}){let f=cn().pathname,[x,w]=Vt(!1),[z,ae]=Vt(null),se=z===f,C=u=>ae(u?f:null),M=!!t,T=!e||M,ge=M?hn:e?vn:yn,y=a.filter(u=>!u.roles||o&&u.roles.includes(o.role)),B=new Set(n),W=y.filter(u=>!B.has(u.href)),V=y.find(u=>u.href==="/settings"),K=y.filter(u=>B.has(u.href)&&u.href!=="/settings");function q(u){return u.root??u.href}function Re(u){let oe=q(u);return f===oe||f===u.href||f.startsWith(oe+"/")}let Ea=y.find(u=>u.children&&(q(u)!=="/calendar"||l)&&Re(u)),Fe=se?void 0:Ea;function Tr(u,oe){return u==="/home"||oe?f===u:f===u||f.startsWith(u+"/")}let za=f.startsWith("/admin")&&(o?.role==="admin"||o?.role==="operator"),ft=o?.name?.split(" ").map(u=>u[0]).join("").slice(0,2)||"?";return D("aside",{style:{position:"relative",width:ge,height:"100%",minHeight:"100vh",background:"var(--shell-surface)",borderRight:"1px solid var(--gray-6)",flexShrink:0,transition:M?"none":"width 200ms ease",zIndex:2},children:[D("div",{style:{width:"100%",height:"100%",minHeight:"100vh",display:"flex",flexDirection:"column",overflow:"hidden"},children:[D("div",{style:{height:cr,flexShrink:0,position:"relative",overflow:"hidden",borderBottom:"1px solid var(--border-hairline)"},children:[m("img",{src:s,alt:"",height:40,style:{display:"block",position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",transition:qt,opacity:T?1:0,pointerEvents:"none",userSelect:"none"}}),m("img",{src:c,alt:"",height:40,style:{display:"block",position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",transition:qt,opacity:T?0:1,pointerEvents:"none",userSelect:"none"}}),M&&m(Ut,{variant:"ghost",color:"gray",size:"1",onClick:t,"aria-label":"Close menu",style:{position:"absolute",right:"var(--space-2)",top:"50%",transform:"translateY(-50%)"},children:m(pn,{style:h("--space-3")})})]}),m("nav",{"aria-label":"Main navigation",style:{flex:1,overflowY:"auto",overflowX:"hidden",paddingTop:"var(--space-5)",display:"flex",flexDirection:"column"},children:Fe?D(Ur,{children:[(()=>{let u=m(ir,{item:{label:Fe.label,href:"#",Icon:dn},active:!1,expanded:T,asButton:!0,onClick:()=>C(!0)});return T?u:m(We,{content:Fe.label,side:"right",delayDuration:300,children:u})})(),Fe.children.map(u=>{let oe=Tr(u.href,u.end),ue=m(ir,{item:u,active:oe,expanded:T},u.href);return T?ue:m(We,{content:lr(u),side:"right",delayDuration:300,children:ue},u.href)})]}):W.map(u=>{let oe=Tr(q(u)),ue=!!u.children&&(q(u)!=="/calendar"||l),yt=m(ir,{item:u,active:oe,expanded:T,showChevron:ue,onClick:ue?()=>C(!1):void 0},u.href);return T?yt:m(We,{content:lr(u),side:"right",delayDuration:300,children:yt},u.href)})}),!Fe&&K.length>0&&m("nav",{"aria-label":"Utility navigation",style:{flexShrink:0,borderTop:"1px solid var(--gray-4)",paddingTop:"var(--space-2)",paddingBottom:"var(--space-2)",display:"flex",flexDirection:"column"},children:K.map(u=>{let oe=Tr(u.href),ue=m(ir,{item:u,active:oe,expanded:T,showChevron:!!u.children,onClick:u.children?()=>C(!1):void 0},u.href);return T?ue:m(We,{content:lr(u),side:"right",delayDuration:300,children:ue},u.href)})}),D("div",{style:{borderTop:K.length>0?"none":"1px solid var(--gray-4)",padding:T?"var(--space-2) var(--space-4)":"var(--space-2) 0",flexShrink:0,display:"flex",flexDirection:"column",gap:"var(--space-2)"},children:[T&&za&&D(Zt,{color:"gray",variant:"soft",highContrast:!0,size:"1",radius:"full",style:{alignSelf:"flex-start"},children:[m(gn,{style:h("--space-2")}),"Administering platform"]}),D("div",{style:{display:"flex",flexDirection:T?"row":"column",alignItems:"center",justifyContent:T?"space-between":"center",gap:"var(--space-2)"},children:[T?D("div",{className:"shell-profile-chip",style:{display:"flex",alignItems:"center",gap:"var(--space-2)",minWidth:0,flex:1,padding:"var(--space-1)",borderRadius:"var(--radius-3)"},children:[m($t,{size:"2",radius:"full",src:o?.avatarSrc,fallback:ft,color:"gray",variant:"soft",style:{flexShrink:0}}),m(sr,{as:"p",size:"2",weight:"medium",truncate:!0,style:{color:"var(--shell-ink-strong)"},children:o?.name})]}):m(We,{content:o?.name??"Account",side:"right",delayDuration:300,children:m($t,{size:"3",radius:"full",src:o?.avatarSrc,fallback:ft,color:"gray",variant:"soft"})}),D(ce.Root,{children:[m(ce.Trigger,{children:m(Ut,{variant:"ghost",color:"gray","aria-label":"Account menu",className:"sidebar-icon-btn",style:{flexShrink:0},children:m(un,{style:h("--space-4")})})}),D(ce.Content,{align:T?"end":"start",side:T?"top":"right",style:{minWidth:200},children:[V&&m(ce.Item,{asChild:!0,children:D(Xt,{to:V.href,onClick:()=>C(!1),children:[m(jt,{}),"Settings"]})}),p&&D(ce.Item,{onClick:()=>window.open(p,"_blank","noopener,noreferrer"),children:[m(fn,{}),"Help"]}),m(ce.Separator,{}),D(ce.Item,{color:"red",onClick:()=>w(!0),children:[m(mn,{}),"Log Out"]}),v&&d&&d.length>0&&D(Ur,{children:[m(ce.Separator,{}),m("div",{style:{padding:"var(--space-1) var(--space-3)"},children:m(sr,{size:"1",style:{fontFamily:"monospace",color:"var(--gray-11)",letterSpacing:"0.04em",textTransform:"uppercase"},children:"Dev \xB7 switch role"})}),d.map(u=>D(ce.Item,{onClick:()=>g?.(u.email),disabled:o?.role===u.role,children:[m(jt,{}),u.label,D(sr,{size:"1",color:"gray",style:{marginLeft:"auto"},children:[u.role,"@"]})]},u.role))]})]})]})]})]})]}),!M&&m("button",{onClick:r,"aria-label":e?"Expand sidebar":"Collapse sidebar",className:"sidebar-collapse-btn",style:{top:"calc(var(--space-9) / 2)",transform:"translateY(-50%)",right:"calc(-1 * var(--space-3))"},children:m(Sn,{flipped:e})}),m(Rr,{open:x,onOpenChange:w,title:"Confirm Logout",description:"Are you sure you want to log out?",onConfirm:i})]})}function ir({item:e,active:r,expanded:t,onClick:a,asButton:n,showChevron:o}){let i={position:"relative",textDecoration:"none",display:"flex",alignItems:"center",height:bn,flexShrink:0,paddingLeft:xn,paddingRight:t?`calc(${Kt} + var(--space-1))`:0,gap:t?Cn:0,color:r?"var(--shell-ink-strong)":"var(--shell-ink-mid)",cursor:"pointer"},l=D(Ur,{children:[r&&m("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:0,width:"var(--space-1)",height:"100%",background:"var(--accent-9)",borderRadius:"0 var(--radius-1) var(--radius-1) 0"}}),m("span",{"aria-hidden":"true",className:"nav-pill",style:{position:"absolute",top:0,bottom:0,left:Yt,right:t?Kt:Yt,borderRadius:"var(--radius-3)",background:r?"var(--accent-9)":"transparent",transition:"background 80ms ease"}}),m(e.Icon,{width:20,height:20,style:{position:"relative",flexShrink:0}}),D("span",{style:{position:"relative",display:"flex",alignItems:"center",gap:"var(--space-1)",minWidth:0,overflow:"hidden",maxWidth:t?void 0:0,opacity:t?1:0,transition:wn(t)},children:[m(sr,{as:"span",size:"3",weight:r?"medium":"regular",style:{lineHeight:1.3,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",minWidth:0},children:e.label}),e.badge&&m(Zt,{color:"gray",variant:r?"solid":"soft",highContrast:r,size:"1",radius:"full",style:{flexShrink:0,paddingInline:"var(--space-1)"},children:e.badge})]}),o&&t&&(r?m("span",{style:{position:"relative",marginLeft:"auto",marginRight:"var(--space-1)",flexShrink:0,display:"inline-flex",alignItems:"center",justifyContent:"center",width:"var(--space-5)",height:"var(--space-5)",background:"var(--color-panel-solid)",borderRadius:"var(--radius-2)",boxShadow:"0 1px 2px rgba(0,0,0,0.12)"},children:m(Gt,{style:{...h("--space-4"),color:"var(--gray-11)"}})}):m(Gt,{style:{...h("--space-4"),position:"relative",marginLeft:"auto",color:"var(--shell-ink-mid)",flexShrink:0}}))]});return n?m("button",{type:"button",onClick:a,className:"shell-nav-item",style:{...i,background:"none",border:"none",width:"100%",textAlign:"left",font:"inherit"},children:l}):m(Xt,{to:e.href,onClick:a,className:"shell-nav-item","data-active":r?"true":void 0,"aria-current":r?"page":void 0,title:t?lr(e):void 0,style:i,children:l})}function Sn({flipped:e}){return D("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",style:{transform:e?"scaleX(-1)":void 0},children:[m("rect",{x:"1.5",y:"2.5",width:"13",height:"11",rx:"1.5",stroke:"currentColor"}),m("path",{d:"M5.5 2.5v11",stroke:"currentColor"}),m("path",{d:"M11 5.5 8.5 8l2.5 2.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})]})}import{Link as kn,useLocation as Rn}from"react-router-dom";import{HamburgerMenuIcon as In,MagnifyingGlassIcon as An,BellIcon as Dn}from"@radix-ui/react-icons";import{Flex as Pn,Heading as En,IconButton as zn,Text as Jt,Tooltip as Mn}from"@radix-ui/themes";import{Fragment as Hn,jsx as O,jsxs as dr}from"react/jsx-runtime";var Bn=[["/home","Home","/home","Home"],["/calendar/syncs","Calendar","/calendar/syncs","Manage Syncs"],["/calendar/view","Calendar","/calendar/syncs","My Calendar"],["/calendar","Calendar","/calendar/syncs","Manage Syncs"],["/settings/account","Settings","/settings/account","Account"],["/settings/linked","Settings","/settings/account","Linked Account"],["/settings","Settings","/settings/account","Settings"]],Nn=[["/admin/overview","Overview"],["/admin/users","Users"],["/admin/monitoring","Monitoring"],["/admin/calendar-ops","Calendar Ops"],["/admin/logs","Logs"],["/admin/security","Security"],["/admin/audit","Audit Log"]];function Fn(e,r,t){if(e==="/admin"||e.startsWith("/admin/")){let l=t.find(([s])=>e===s||e.startsWith(s+"/"));return{section:"Admin Portal",sectionHref:"/admin/overview",page:l?l[1]:"Admin Portal"}}if(e==="/calendar/syncs/new")return{section:"Calendar",sectionHref:"/calendar/syncs",page:"New Sync"};if(/^\/calendar\/syncs\/[^/]+$/.test(e))return{section:"Calendar",sectionHref:"/calendar/syncs",page:"Edit Sync"};let a=r.find(([l,,,,s])=>s?e===l:e===l||e.startsWith(l+"/"));if(!a)return{section:"Home",sectionHref:"/home",page:"Home"};let[,n,o,i]=a;return{section:n,sectionHref:o,page:i}}function Ln({onSearchOpen:e,onMenuOpen:r,showMenu:t,titles:a=Bn,adminTitles:n=Nn}){let o=Rn().pathname;return dr("header",{style:{height:cr,background:"var(--accent-9)",borderBottom:"1px solid var(--border-hairline)",flexShrink:0,display:"flex",alignItems:"center",padding:"0 var(--space-6)",gap:"var(--space-4)"},children:[t&&O(zn,{variant:"ghost",size:"1",onClick:r,"aria-label":"Open navigation",style:{marginRight:"var(--space-1)",color:"var(--shell-ink-strong)"},children:O(In,{style:h("--space-4")})}),(()=>{let{section:i,sectionHref:l,page:s}=Fn(o,a,n);return dr(Pn,{align:"baseline",gap:"2",style:{minWidth:0,overflow:"hidden"},children:[i!==s&&dr(Hn,{children:[O(Jt,{asChild:!0,size:"3",weight:"regular",children:O(kn,{to:l,style:{color:"var(--shell-ink-mid)",whiteSpace:"nowrap",textDecoration:"none",overflow:"hidden",textOverflow:"ellipsis",flexShrink:0},className:"topbar-breadcrumb-link",children:i})}),O(Jt,{size:"3",weight:"regular",className:"topbar-breadcrumb-sep",style:{color:"var(--shell-ink-mid)",flexShrink:0},children:"/"})]}),O(En,{as:"h1",size:L.h1,weight:"medium",style:{color:"var(--shell-ink-strong)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",minWidth:0},children:s})]})})(),O("div",{style:{flex:1}}),dr("button",{className:"topbar-search",onClick:e,"aria-label":"Search (\u2318K)",children:[O(An,{width:16,height:16,style:{color:"var(--shell-ink-strong)",flexShrink:0}}),O("span",{className:"topbar-search-placeholder",children:"Search for something"})]}),O(Mn,{content:"Coming soon",children:O("span",{children:O("button",{className:"topbar-icon-circle","aria-label":"Notifications (coming soon)",disabled:!0,children:O(Dn,{style:h("--space-4")})})})})]})}import{useEffect as Qt,useRef as ea,useState as Gr}from"react";import{Dialog as jr,Flex as ra,Spinner as On,Text as J,TextField as _n,VisuallyHidden as Wn}from"@radix-ui/themes";import{CalendarIcon as Vn,MagnifyingGlassIcon as $n,PersonIcon as Un,ReaderIcon as Gn}from"@radix-ui/react-icons";import{Fragment as Zn,jsx as S,jsxs as G}from"react/jsx-runtime";var jn={app:Vn,people:Un,page:Gn},Yn={app:"Apps",people:"People",page:"Pages"};function Kn(e){let r=["app","people","page"],t=[],a=0;for(let n of r){let o=e.filter(i=>i.type===n);o.length>0&&(t.push({type:n,label:Yn[n],items:o,startIdx:a}),a+=o.length)}return t}function qn({open:e,onClose:r,results:t,onSelectResult:a,title:n="Search",placeholder:o="Search\u2026"}){return S(jr.Root,{open:e,onOpenChange:i=>!i&&r(),children:S(jr.Content,{"aria-describedby":void 0,style:{padding:0,maxWidth:"calc(9 * var(--space-9) + var(--space-2))",overflow:"hidden",boxShadow:"0 4px 8px rgba(0,0,0,0.06), 0 12px 32px rgba(0,0,0,0.10), 0 0 0 1px var(--gray-5)"},children:S(Xn,{onClose:r,resultPool:t,onSelectResult:a,title:n,placeholder:o})})})}function Xn({onClose:e,resultPool:r,onSelectResult:t,title:a,placeholder:n}){let[o,i]=Gr(""),[l,s]=Gr(null),[c,p]=Gr(-1),d=ea(null),g=ea(null),v=!!l&&l.q===o,f=v?l.items:[],x=o.trim()?v?f.length?"results":"no-match":"searching":"prompt";Qt(()=>{if(!o.trim())return;let C=setTimeout(()=>{let M=o.toLowerCase(),T=r.filter(ge=>ge.title.toLowerCase().includes(M)||ge.subtitle.toLowerCase().includes(M));s({q:o,items:T}),p(-1)},320);return()=>clearTimeout(C)},[o,r]),Qt(()=>{if(c<0||!g.current)return;g.current.querySelector(`[data-idx="${c}"]`)?.scrollIntoView({block:"nearest"})},[c]);function w(C){C.key==="Escape"?e():C.key==="ArrowDown"?(C.preventDefault(),p(M=>Math.min(M+1,f.length-1))):C.key==="ArrowUp"?(C.preventDefault(),p(M=>Math.max(M-1,0))):C.key==="Enter"&&(C.preventDefault(),c>=0&&f[c]&&(t(f[c]),e()))}function z(C){t(C),e()}let ae=Kn(f),se="calc(2 * var(--space-9) + var(--space-6))";return G(Zn,{children:[S(Wn,{children:S(jr.Title,{children:a})}),G("div",{style:{display:"flex",alignItems:"center",gap:"var(--space-3)",padding:"var(--space-3) var(--space-4)",borderBottom:"1px solid var(--gray-5)"},children:[x==="searching"?S(On,{size:"1",style:{flexShrink:0}}):S($n,{width:16,height:16,style:{color:"var(--gray-9)",flexShrink:0}}),S(_n.Root,{ref:d,autoFocus:!0,type:"text",placeholder:n,value:o,onChange:C=>i(C.target.value),onKeyDown:w,className:"search-overlay-input",style:{flex:1,border:"none",outline:"none",background:"transparent",boxShadow:"none","--text-field-selection-color":"unset"}}),S("kbd",{style:{color:"var(--gray-11)",background:"var(--gray-3)",border:"1px solid var(--gray-5)",borderRadius:"var(--radius-1)",padding:"var(--space-1) var(--space-2)",flexShrink:0},children:S(J,{size:"1",as:"span",children:"Esc"})})]}),G("div",{ref:g,style:{minHeight:se,maxHeight:"calc(6 * var(--space-9) + var(--space-7))",overflowY:"auto"},children:[x==="prompt"&&S(ra,{align:"center",justify:"center",style:{height:se},children:S(J,{size:"2",color:"gray",children:"Type to search\u2026"})}),x==="no-match"&&S(ra,{align:"center",justify:"center",style:{height:se},children:G("div",{style:{textAlign:"center"},children:[G(J,{size:"2",color:"gray",as:"p",children:["No results for \u201C",o,"\u201D"]}),S(J,{size:"1",color:"gray",as:"p",mt:"1",children:"Try searching with different keywords"})]})}),x==="results"&&S("div",{style:{padding:"var(--space-2)"},children:ae.map(C=>{let M=jn[C.type];return G("div",{style:{marginBottom:"var(--space-1)"},children:[S("div",{style:{padding:"var(--space-2) var(--space-3) var(--space-1)",display:"flex",alignItems:"center",gap:"var(--space-2)"},children:S(J,{size:"1",style:{color:"var(--gray-11)",fontWeight:500,letterSpacing:"0.04em",textTransform:"uppercase",fontFamily:"var(--font-poppins)"},children:C.label})}),C.items.map((T,ge)=>{let y=C.startIdx+ge,B=c===y;return G("button",{"data-idx":y,onClick:()=>z(T),onMouseEnter:()=>p(y),className:"search-result-item",style:{width:"100%",display:"flex",alignItems:"center",gap:"var(--space-3)",padding:"var(--space-2) var(--space-3)",borderRadius:"var(--radius-2)",border:"none",cursor:"pointer",textAlign:"left",background:B?"var(--gray-3)":"transparent"},children:[S("div",{style:{width:"var(--space-6)",height:"var(--space-6)",borderRadius:"var(--radius-1)",background:B?"var(--accent-a3)":"var(--gray-3)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:"background 100ms ease"},children:S(M,{width:12,height:12,style:{color:B?"var(--accent-11)":"var(--gray-9)"}})}),G("div",{style:{flex:1,minWidth:0},children:[S(J,{as:"p",size:"2",weight:"medium",style:{color:B?"var(--gray-12)":"var(--gray-11)",lineHeight:1.3,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:T.title}),S(J,{as:"p",size:"1",style:{color:"var(--gray-11)",lineHeight:1.3,marginTop:"1px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:T.subtitle})]}),B&&S("kbd",{style:{color:"var(--gray-9)",background:"var(--gray-4)",border:"1px solid var(--gray-5)",borderRadius:"var(--radius-1)",padding:"var(--space-1)",flexShrink:0},children:S(J,{size:"1",as:"span",className:"data-mono",children:"\u21B5"})})]},T.id)})]},C.type)})})]}),x!=="prompt"&&G("div",{style:{borderTop:"1px solid var(--gray-4)",padding:"var(--space-2) var(--space-4)",display:"flex",gap:"var(--space-4)"},children:[G(J,{as:"span",size:"1",color:"gray",children:[S("kbd",{className:"data-mono",children:"\u2191\u2193"})," navigate"]}),G(J,{as:"span",size:"1",color:"gray",children:[S("kbd",{className:"data-mono",children:"\u21B5"})," open"]}),G(J,{as:"span",size:"1",color:"gray",children:[S("kbd",{className:"data-mono",children:"Esc"})," close"]})]})]})}function j(e,r){for(let t of e){let a=t.calendars.find(n=>n.id===r);if(a)return{account:t,calendar:a}}}import Yr from"dayjs";import{Flex as ta,Text as aa}from"@radix-ui/themes";import{jsx as Kr,jsxs as Jn}from"react/jsx-runtime";function qr({date:e,today:r=new Date}){let t=Yr(e).isSame(r,"day");return Jn(ta,{direction:"column",align:"center",gap:"1",py:"1",children:[Kr(aa,{size:"1",weight:"medium",color:"gray",style:{letterSpacing:"0.04em"},children:Yr(e).format("ddd").toUpperCase()}),Kr(ta,{align:"center",justify:"center",style:{width:"var(--space-6)",height:"var(--space-6)",borderRadius:"50%",background:t?"var(--accent-9)":"transparent",lineHeight:1},children:Kr(aa,{size:"3",weight:t?"medium":"regular",style:{color:t?"var(--accent-contrast)":"var(--gray-12)",lineHeight:1},children:Yr(e).format("D")})})]})}import{Box as Ve,Checkbox as Qn,Flex as ei,RadioGroup as oa,Text as $e}from"@radix-ui/themes";import{jsx as E,jsxs as ia}from"react/jsx-runtime";function ri(e){return e.flatMap(r=>r.calendars.map(t=>({calendarId:t.id,calendarName:t.name,email:r.email,provider:r.provider})))}function ti({provider:e}){return E("span",{"aria-hidden":!0,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"var(--space-5)",height:"var(--space-5)",flexShrink:0},children:E(H,{provider:e})})}function na({row:e,control:r,selected:t,disabled:a,disabledLabel:n}){return ia($e,{as:"label",size:"2",style:{display:"flex",alignItems:"center",gap:"var(--space-3)",width:"100%",paddingBlock:"var(--space-3)",paddingInline:"var(--space-4)",cursor:a?"not-allowed":"pointer",opacity:a?.45:1,background:t?"var(--accent-2)":"transparent",color:"var(--gray-12)"},children:[E(ti,{provider:e.provider}),ia(ei,{direction:"column",gap:"0",style:{minWidth:0,flex:1},children:[E($e,{size:"2",weight:"medium",truncate:!0,style:{color:"var(--gray-12)"},children:e.calendarName}),E($e,{size:"1",color:"gray",truncate:!0,children:e.email})]}),n?E($e,{size:"1",color:"gray",style:{flexShrink:0},children:n}):null,E(Ve,{style:{flexShrink:0,display:"flex",alignItems:"center"},children:r})]})}function ai({accounts:e,mode:r,sourceCalendarIds:t,targetCalendarId:a,takenSourceIds:n,onToggleSource:o,onSelectTarget:i,fill:l=!1}){let s=ri(e),p=r==="sources"&&s.length>0&&s.every(d=>d.calendarId===a||n.has(d.calendarId))?E(Ve,{style:{border:"1px solid var(--gray-5)",borderRadius:"var(--radius-3)",background:"var(--color-panel-solid)",padding:"var(--space-4)",...l?{flex:1,minHeight:0}:{}},children:E($e,{as:"p",size:"2",color:"gray",align:"center",children:"All your calendars are already used as sources in other syncs, or set as this sync's target. Remove a calendar from another sync to make it available here."})}):E(Ve,{style:{border:"1px solid var(--gray-5)",borderRadius:"var(--radius-3)",background:"var(--color-panel-solid)",...l?{flex:1,minHeight:0,overflowY:"auto"}:{overflow:"hidden"}},children:s.map((d,g)=>{if(r==="sources"){let x=d.calendarId===a,w=n.has(d.calendarId),z=x||w,ae=t.includes(d.calendarId);return E(Ve,{style:{borderTop:g>0?"1px solid var(--gray-4)":void 0},children:E(na,{row:d,selected:ae,disabled:z,disabledLabel:x?"Target":w?"In use":void 0,control:E(Qn,{checked:ae,disabled:z,onCheckedChange:()=>{z||o(d.calendarId)}})})},d.calendarId)}let v=t.includes(d.calendarId),f=d.calendarId===a;return E(Ve,{style:{borderTop:g>0?"1px solid var(--gray-4)":void 0},children:E(na,{row:d,selected:f,disabled:v,disabledLabel:v?"Source":void 0,control:E(oa.Item,{value:d.calendarId,disabled:v})})},d.calendarId)})});return r==="target"?E(oa.Root,{value:a??"",onValueChange:d=>{d&&i(d)},style:l?{flex:1,minHeight:0,display:"flex",flexDirection:"column"}:void 0,children:p}):p}import{Button as sa,Flex as Xr,Heading as oi,IconButton as la}from"@radix-ui/themes";import{ChevronLeftIcon as ni,ChevronRightIcon as ii}from"@radix-ui/react-icons";import{Navigate as Zr}from"react-big-calendar";import{jsx as me,jsxs as ca}from"react/jsx-runtime";function Jr({label:e,view:r,onNavigate:t,onView:a}){return ca(Xr,{align:"center",justify:"between",gap:"3",wrap:"wrap",className:"calendar-toolbar",children:[ca(Xr,{align:"center",gap:"2",children:[me(la,{size:"2",variant:"soft",color:"gray",radius:"full","aria-label":"Previous",onClick:()=>t(Zr.PREVIOUS),children:me(ni,{})}),me(sa,{size:"2",variant:"soft",color:"gray",onClick:()=>t(Zr.TODAY),children:"Today"}),me(la,{size:"2",variant:"soft",color:"gray",radius:"full","aria-label":"Next",onClick:()=>t(Zr.NEXT),children:me(ii,{})})]}),me(oi,{as:"h2",size:L.h2,weight:"medium",style:{color:"var(--gray-12)"},children:e}),me(Xr,{gap:"1",style:{border:"1px solid var(--gray-5)",borderRadius:"var(--radius-3)",padding:"var(--space-1)",background:"var(--gray-2)"},children:["week","month"].map(n=>me(sa,{size:"2",variant:r===n?"solid":"soft",className:r===n?"btn-amber-primary":void 0,color:r===n?void 0:"gray",onClick:()=>a(n),style:r===n?void 0:{background:"transparent"},children:n==="week"?"Week":"Month"},n))})]})}import{Button as si,Flex as pr,Spinner as li,Text as Qr}from"@radix-ui/themes";import{ChevronRightIcon as ci,ExclamationTriangleIcon as di}from"@radix-ui/react-icons";import{jsx as Q,jsxs as Ue}from"react/jsx-runtime";var Ee={google:{label:"Google Calendar",description:"Connect a Google account calendar"},microsoft:{label:"Outlook Calendar",description:"Connect an Outlook account calendar"}},pi=["google","microsoft"];function et({connectingProvider:e,failedProvider:r,exhausted:t=!1,onConnect:a}){return Q(pr,{direction:"column",gap:"3",style:{width:"100%",textAlign:"left"},children:pi.map(n=>{let o=Ee[n],i=e===n;return Ue("div",{children:[Ue("button",{type:"button",className:"provider-choice",onClick:()=>a(n),disabled:e!==null,"data-connecting":i?"true":void 0,"aria-busy":i||void 0,"aria-label":`Connect ${o.label}`,children:[Q(P,{children:Q(H,{provider:n})}),Ue(pr,{direction:"column",className:"provider-choice__copy",gap:"1",children:[Q(Qr,{size:"3",weight:"medium",truncate:!0,style:{color:"var(--gray-12)"},children:o.label}),Q(Qr,{size:"2",color:"gray",truncate:!0,children:o.description})]}),Q("span",{className:"provider-choice__chevron","aria-hidden":!0,children:i?Q(li,{size:"2"}):Q(ci,{style:h("--space-5")})})]}),r===n&&Ue(pr,{align:"center",justify:"between",gap:"3",mt:"2",px:"1",children:[Ue(pr,{align:"center",gap:"2",children:[Q(di,{style:{...h("--space-4"),color:"var(--red-9)",flexShrink:0}}),Q(Qr,{size:"2",style:{color:"var(--red-11)"},children:t?`No more ${o.label} accounts available to connect.`:`Couldn't connect ${o.label}. Please try again.`})]}),!t&&Q(si,{variant:"ghost",size:"1",onClick:()=>a(n),children:"Retry"})]})]},n)})})}import{Badge as da,Box as gi,DropdownMenu as Ge,Flex as pa,IconButton as ui,Text as ga}from"@radix-ui/themes";import{DotsVerticalIcon as mi,ReloadIcon as fi,TrashIcon as yi}from"@radix-ui/react-icons";import{jsx as Y,jsxs as xe}from"react/jsx-runtime";function vi({account:e,onRemove:r,onReconnect:t,onClick:a}){let n=e.authStatus==="reauth",o=e.authStatus==="failed",i=Y(ga,{size:"2",weight:"medium",truncate:!0,style:{color:"var(--gray-12)"},children:e.displayName});return xe(gi,{onClick:a,style:{width:"100%",minWidth:0,height:b.connectedAccountCardH,boxSizing:"border-box",padding:"var(--space-3)",background:"var(--color-panel-solid)",border:"1px solid var(--gray-5)",borderRadius:"var(--radius-3)",display:"flex",alignItems:"center",gap:"var(--space-3)",cursor:a?"pointer":void 0},children:[Y(P,{size:"var(--space-6)",children:Y(H,{provider:e.provider})}),xe(pa,{direction:"column",style:{flex:1,minWidth:0},children:[xe(pa,{align:"center",gap:"2",style:{minWidth:0},children:[a?Y("button",{type:"button",className:"card-title-button",onClick:l=>{l.stopPropagation(),a()},children:i}):i,n&&Y(da,{color:"amber",variant:"soft",size:"1",radius:"full",style:{flexShrink:0},children:"Needs reconnect"}),o&&Y(da,{color:"red",variant:"soft",size:"1",radius:"full",style:{flexShrink:0},children:"Connection failed"})]}),Y(ga,{size:"1",color:"gray",truncate:!0,children:e.email})]}),xe(Ge.Root,{children:[Y(Ge.Trigger,{children:Y(ui,{variant:"ghost",color:"gray",size:"1","aria-label":`${e.displayName} actions`,onClick:l=>l.stopPropagation(),children:Y(mi,{})})}),xe(Ge.Content,{align:"end",onClick:l=>l.stopPropagation(),children:[(n||o)&&t&&xe(Ge.Item,{onSelect:t,children:[Y(fi,{})," Reconnect"]}),xe(Ge.Item,{color:"red",onSelect:r,children:[Y(yi,{})," Remove account"]})]})]})]})}import{Flex as hi,Text as bi,Heading as xi}from"@radix-ui/themes";import{jsx as rt,jsxs as wi}from"react/jsx-runtime";function Ci({icon:e,title:r,description:t,action:a,headingAs:n="h2"}){return wi(hi,{direction:"column",align:"center",gap:"3",style:{width:"100%",paddingTop:"var(--space-9)",textAlign:"center"},children:[rt(P,{size:"var(--space-8)",children:e}),rt(xi,{as:n,size:L[n],weight:"medium",align:"center",children:r}),t&&rt(bi,{size:"2",color:"gray",align:"center",style:{maxWidth:b.emptyStateCopyMax},children:t}),a]})}import{useState as Ti}from"react";import{Dialog as je,Flex as Si,Text as gr,Checkbox as ki,Button as ua}from"@radix-ui/themes";import{Fragment as Ii,jsx as _,jsxs as tt}from"react/jsx-runtime";function Ce({account:e,onOpenChange:r,onImport:t,initiallySelectedIds:a,disabledIds:n,disabledReason:o,title:i="Calendars",description:l="Choose which calendars you want to import.",confirmLabel:s="Import Calendars"}){let c=e?`${e.id}:${(a??e.calendars.map(p=>p.id)).join(",")}`:"closed";return _(je.Root,{open:!!e,onOpenChange:r,children:_(je.Content,{maxWidth:b.dialogMd,onInteractOutside:p=>p.preventDefault(),children:e&&_(Ri,{account:e,initiallySelectedIds:a,disabledIds:n,disabledReason:o,title:i,description:l,confirmLabel:s,onImport:t},c)})})}function Ri({account:e,initiallySelectedIds:r,disabledIds:t,disabledReason:a,title:n,description:o,confirmLabel:i,onImport:l}){let[s,c]=Ti(()=>new Set(r??e.calendars.map(g=>g.id))),p=new Set(t??[]);function d(g){p.has(g)||c(v=>{let f=new Set(v);return f.has(g)?f.delete(g):f.add(g),f})}return tt(Ii,{children:[_(je.Title,{size:"5",weight:"medium",mb:"1",children:n}),_(je.Description,{size:"2",color:"gray",mb:"2",children:o}),_(gr,{as:"p",size:"2",weight:"medium",mb:"5",style:{color:"var(--gray-12)"},children:e.email}),_(Si,{direction:"column",gap:"3",mb:"5",children:e.calendars.map(g=>{let v=s.has(g.id),f=p.has(g.id);return tt(gr,{as:"label",size:"3",className:"calendar-picker-row","data-selected":v||void 0,"data-disabled":f?"true":void 0,style:{display:"flex",alignItems:"center",gap:"var(--space-3)",padding:"var(--space-4)",cursor:f?"default":"pointer"},children:[_(ki,{checked:v,disabled:f,onCheckedChange:()=>d(g.id)}),_(gr,{weight:"medium",truncate:!0,style:{flex:1,minWidth:0,color:"var(--gray-12)"},children:g.name}),f&&a&&_(gr,{size:"1",color:"gray",style:{flexShrink:0},children:a})]},g.id)})}),tt(X,{justify:"between",noTopMargin:!0,pad:"var(--space-5)",radius:"var(--radius-4)",children:[_(je.Close,{children:_(ua,{size:"2",variant:"outline",color:"gray",children:"Cancel"})}),_(ua,{size:"2",className:"btn-amber-primary",disabled:s.size===0,onClick:()=>l(Array.from(s)),children:i})]})]})}import{Box as Ye,Flex as Ai,Text as ee}from"@radix-ui/themes";import{jsx as N,jsxs as ur}from"react/jsx-runtime";function Di(e){let r=/^#?([0-9a-f]{6})$/i.exec(e.trim());if(!r)return"white";let t=parseInt(r[1],16),a=o=>{let i=o/255;return i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4)};return .2126*a(t>>16&255)+.7152*a(t>>8&255)+.0722*a(t&255)>.45?"black":"white"}function ma({tone:e,title:r,meta:t,accentColor:a}){let n=e==="synced"?a||"var(--accent-9)":"var(--blue-11)",o=e==="synced"?a?Di(a):"var(--accent-contrast)":"white";return ur(Ye,{style:{background:n,borderRadius:"var(--radius-2)",padding:"var(--space-2) var(--space-3)"},children:[N(ee,{as:"p",size:"2",weight:"medium",style:{color:o},children:r}),t?N(ee,{as:"p",size:"1",style:{color:o},children:t}):null]})}var Pi="Busy",Ei={title:"Gym",time:"10:00 AM",location:"Flex Gym on 16th Ave",description:"Workout notes"};function zi({hasSources:e,hasTarget:r,sourceLabel:t,targetLabel:a,showTitle:n,showDescription:o,showLocation:i,tagLabel:l,accentColor:s,sampleEvent:c=Ei}){let p=c.title,d=[c.time,c.location].filter(Boolean).join(" \xB7 "),g=l?.trim()||Pi,v=n?`${c.title} - (${g})`:g,f=[c.time].filter(Boolean);i&&c.location&&f.push(c.location),o&&c.description&&f.push(c.description);let x=f.join(" \xB7 ");return ur(Ai,{direction:"column",gap:"4",style:{padding:"var(--space-4)"},children:[N(ee,{as:"p",className:"ds-section-label",style:{textAlign:"center"},children:"Sync Preview"}),N(ee,{as:"p",size:"1",color:"gray",style:{textAlign:"center",marginTop:"calc(-1 * var(--space-2))"},children:"Example event \u2014 not from your calendars."}),ur(Ye,{children:[N(ee,{as:"p",size:"1",color:"gray",mb:"1",children:"Sources"}),N(ee,{as:"p",size:"1",weight:"medium",mb:"2",truncate:!0,style:{color:"var(--gray-12)"},children:e?t||"Selected sources":"\u2014"}),N(Ye,{style:{border:"1px solid var(--gray-5)",borderRadius:"var(--radius-2)",padding:"var(--space-2)",background:"var(--gray-2)"},children:N(ma,{tone:"source",title:p,meta:d})})]}),ur(Ye,{children:[N(ee,{as:"p",size:"1",color:"gray",mb:"1",children:"Target"}),N(ee,{as:"p",size:"1",weight:"medium",mb:"2",truncate:!0,style:{color:"var(--gray-12)"},children:r?a||"Selected target":"\u2014"}),N(Ye,{style:{border:"1px solid var(--gray-5)",borderRadius:"var(--radius-2)",padding:"var(--space-2)",background:"var(--gray-2)"},children:r?N(ma,{tone:"synced",title:v,meta:x,...s?{accentColor:s}:{}}):N(ee,{as:"p",size:"2",color:"gray",children:"Pick one target calendar"})})]}),!e||!r?N(ee,{as:"p",size:"1",color:"gray",style:{textAlign:"center"},children:"Select one or more sources, then one target"}):N(ee,{as:"p",size:"1",color:"gray",style:{textAlign:"center"},children:"Only the highlighted block is posted to the target"})]})}import{Flex as at,Text as ot}from"@radix-ui/themes";import{CheckIcon as Mi}from"@radix-ui/react-icons";import{jsx as ze,jsxs as fa}from"react/jsx-runtime";function nt({steps:e,current:r}){return ze("div",{role:"list","aria-label":"Wizard progress",style:{display:"flex",flexWrap:"wrap",width:"100%",flexShrink:0,marginBottom:0,border:"1px solid var(--gray-5)",borderRadius:"var(--radius-4)",background:"var(--color-panel-solid)",overflow:"hidden"},children:e.map((t,a)=>{let n=a+1,o=n===r,i=n<r;return fa(at,{align:"start",gap:"3",role:"listitem","aria-current":o?"step":void 0,style:{flex:"1 1 calc(3 * var(--space-9) + var(--space-6))",minWidth:"calc(3 * var(--space-9) + var(--space-6))",paddingTop:"var(--space-4)",paddingBottom:"var(--space-4)",paddingLeft:"var(--space-4)",paddingRight:"var(--space-4)",marginBottom:"-1px",borderBottom:o?"2px solid var(--accent-9)":"2px solid transparent"},children:[ze(at,{align:"center",justify:"center",style:{width:"var(--space-6)",height:"var(--space-6)",borderRadius:"50%",flexShrink:0,marginTop:"var(--space-1)",background:i?"var(--green-9)":o?"var(--accent-9)":"var(--gray-3)",color:i?"white":o?"var(--accent-contrast)":"var(--gray-11)"},children:i?ze(Mi,{style:h("--space-3")}):ze(ot,{size:"1",weight:"medium",children:t.n})}),fa(at,{direction:"column",gap:"1",style:{minWidth:0,flex:1,paddingTop:"var(--space-1)"},children:[ze(ot,{size:"2",weight:"medium",style:{color:o||i?"var(--gray-12)":"var(--gray-10)",lineHeight:"var(--line-height-2)"},children:t.title}),ze(ot,{size:"1",color:"gray",style:{lineHeight:"var(--line-height-1)"},children:t.description})]})]},t.n)})})}import{jsx as va}from"react/jsx-runtime";var Bi=[{n:"01",title:"Connect",description:"Connect your calendar account"},{n:"02",title:"Calendars",description:"Import at least 2 calendars"},{n:"03",title:"Sync",description:"Set up your first sync"}];function ya({current:e}){return va(nt,{steps:Bi,current:e})}function Ni({current:e,total:r=3}){return va(ya,{current:e})}import it from"dayjs";import{Flex as ha,Grid as ba,IconButton as xa,Text as Ca}from"@radix-ui/themes";import{ChevronLeftIcon as Fi,ChevronRightIcon as Li}from"@radix-ui/react-icons";import{jsx as de,jsxs as st}from"react/jsx-runtime";var Hi=["S","M","T","W","T","F","S"];function lt({cursor:e,onSelect:r,today:t=new Date}){let a=it(e).startOf("month"),n=a.startOf("week"),o=Array.from({length:42},(i,l)=>n.add(l,"day"));return st("div",{children:[st(ha,{align:"center",justify:"between",mb:"2",children:[de(Ca,{size:"2",weight:"medium",style:{color:"var(--gray-12)"},children:a.format("MMMM YYYY")}),st(ha,{gap:"1",children:[de(xa,{size:"1",variant:"ghost",color:"gray","aria-label":"Previous month",onClick:()=>r(it(e).subtract(1,"month").toDate()),children:de(Fi,{})}),de(xa,{size:"1",variant:"ghost",color:"gray","aria-label":"Next month",onClick:()=>r(it(e).add(1,"month").toDate()),children:de(Li,{})})]})]}),de(ba,{columns:"7",gap:"1",mb:"1",children:Hi.map((i,l)=>de(Ca,{size:"1",color:"gray",align:"center",children:i},l))}),de(ba,{columns:"7",gap:"1",justify:"center",align:"center",style:{justifyItems:"center"},children:o.map(i=>{let l=i.isSame(t,"day"),s=i.isSame(e,"day"),c=!i.isSame(a,"month");return de("button",{type:"button",onClick:()=>r(i.toDate()),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"var(--space-5)",height:"var(--space-5)",boxSizing:"border-box",flexShrink:0,padding:0,borderRadius:"50%",border:l&&!s?"1.5px solid var(--accent-9)":"none",cursor:"pointer",background:s?"var(--accent-9)":"transparent",color:s?"var(--accent-contrast)":c?"var(--gray-11)":l?"var(--accent-11)":"var(--gray-12)",fontWeight:l||s?500:400,fontSize:"var(--font-size-1)",fontFamily:"var(--font-poppins)"},children:i.format("D")},i.format("YYYY-MM-DD"))})})]})}import{useState as Oi}from"react";import{Dialog as Ke,Flex as qe,Text as mr,Button as ct,IconButton as _i,Badge as wa,Separator as Wi,Box as Ta}from"@radix-ui/themes";import{Cross2Icon as Vi,PlusIcon as $i,ReloadIcon as Ui}from"@radix-ui/react-icons";import{Fragment as Sa,jsx as I,jsxs as re}from"react/jsx-runtime";function Gi({account:e,catalog:r,onOpenChange:t,onRemoveCalendar:a,onSaveCalendars:n,onReconnect:o}){let[i,l]=Oi(!1),s=e?.authStatus==="reauth",c=e?.authStatus==="failed";function p(d){if(!e||!r)return;let g=new Set(d);n(e,r.calendars.filter(v=>g.has(v.id))),l(!1)}return re(Sa,{children:[I(Ke.Root,{open:!!e&&!i,onOpenChange:d=>{d||t(!1)},children:I(Ke.Content,{maxWidth:b.dialogMd,children:e&&re(Sa,{children:[re(qe,{align:"center",gap:"3",mb:"1",children:[I(P,{size:"var(--space-6)",children:I(H,{provider:e.provider})}),re(Ta,{style:{minWidth:0,flex:1},children:[re(qe,{align:"center",gap:"2",mb:"1",style:{minWidth:0},children:[I(Ke.Title,{size:"4",weight:"medium",mb:"0",truncate:!0,style:{minWidth:0},children:e.displayName}),s&&I(wa,{color:"amber",variant:"soft",size:"1",radius:"full",style:{flexShrink:0},children:"Needs reconnect"}),c&&I(wa,{color:"red",variant:"soft",size:"1",radius:"full",style:{flexShrink:0},children:"Connection failed"})]}),I(Ke.Description,{size:"2",color:"gray",mb:"0",children:e.email})]})]}),(s||c)&&o&&re(ct,{size:"2",variant:"soft",color:c?"red":"amber",mt:"3",onClick:()=>o(e.id),children:[I(Ui,{}),"Reconnect"]}),I(Wi,{size:"4",my:"4"}),re(qe,{align:"center",justify:"between",gap:"3",mb:"3",children:[I(mr,{as:"p",className:"ds-section-label",mb:"0",children:"Calendars"}),r&&r.calendars.length>0&&re(ct,{size:"1",variant:"soft",color:"gray",onClick:()=>l(!0),children:[I($i,{style:h("--space-3")}),"Change calendars"]})]}),I(qe,{direction:"column",style:{border:"1px solid var(--gray-5)",borderRadius:"var(--radius-3)",overflow:"hidden",background:"var(--color-panel-solid)"},children:e.calendars.length===0?I(mr,{size:"2",color:"gray",style:{padding:"var(--space-4)"},children:"No calendars imported."}):e.calendars.map((d,g)=>re(qe,{align:"center",gap:"3",className:"data-table-row",style:{padding:"var(--space-3) var(--space-4)",minHeight:"var(--space-7)",borderTop:g>0?"1px solid var(--gray-4)":void 0},children:[I(Ta,{"aria-hidden":!0,style:{width:"var(--space-2)",height:"var(--space-2)",borderRadius:"50%",background:d.colorToken,flexShrink:0}}),re(mr,{size:"2",truncate:!0,style:{flex:1,minWidth:0,color:"var(--gray-12)"},children:[d.name,d.isPrimary&&re(mr,{size:"1",color:"gray",children:[" ","\xB7 Primary"]})]}),I(_i,{variant:"ghost",color:"gray",size:"1","aria-label":`Remove ${d.name}`,onClick:()=>a(e,d),children:I(Vi,{})})]},d.id))}),I(X,{justify:"end",children:I(Ke.Close,{children:I(ct,{size:"2",variant:"soft",color:"gray",children:"Close"})})})]})})}),I(Ce,{account:i&&r?r:null,initiallySelectedIds:e?.calendars.map(d=>d.id),title:"Change calendars",description:"Choose which calendars to keep on this account.",confirmLabel:"Save calendars",onOpenChange:d=>{d||l(!1)},onImport:p})]})}import{useMemo as ji}from"react";import vr from"dayjs";import{Calendar as Yi,dayjsLocalizer as Ki,Views as Xe}from"react-big-calendar";import"react-big-calendar/lib/css/react-big-calendar.css";import{Text as fr}from"@radix-ui/themes";import{jsx as Me,jsxs as yr}from"react/jsx-runtime";var qi=Ki(vr),Xi=new Date(1970,0,1,8,0,0);function dt({blocks:e,view:r,onViewChange:t,date:a,onNavigate:n,accounts:o,today:i=new Date}){let l=ji(()=>e.map(s=>{let c=new Date(s.date);c.setHours(s.startHour,s.startMinute,0,0);let p=new Date(s.date);return p.setHours(s.endHour,s.endMinute,0,0),{id:s.id,title:s.title,start:c,end:p,resource:s}}),[e]);return Me("div",{className:"rbc-radix-scope",style:{height:"100%",containerType:"inline-size"},children:Me(Yi,{localizer:qi,events:l,view:r==="week"?Xe.WEEK:Xe.MONTH,onView:s=>t(s===Xe.MONTH?"month":"week"),date:a,onNavigate:n,views:[Xe.WEEK,Xe.MONTH],toolbar:!0,popup:!0,scrollToTime:Xi,enableAutoScroll:!0,getNow:()=>i,tooltipAccessor:null,eventPropGetter:s=>{let p=j(o,s.resource.calendarId)?.calendar.colorToken??"var(--gray-8)";return r==="month"?{style:{background:"transparent",border:"none",boxShadow:"none"}}:{style:{backgroundColor:p,border:"none"}}},components:{toolbar:Jr,week:{header:s=>Me(qr,{...s,today:i}),event:({event:s})=>{let c=(s.end.getTime()-s.start.getTime())/6e4,p=c>=60,d=c>=30;return yr("div",{children:[Me(fr,{size:"1",weight:"medium",style:{color:"white",display:"block"},truncate:!0,children:s.title}),d&&yr(fr,{size:"1",style:{color:"rgba(255,255,255,0.85)",display:"block"},truncate:!0,children:[vr(s.start).format("h:mm A")," \u2013 ",vr(s.end).format("h:mm A")]}),p&&s.resource.location&&Me(fr,{size:"1",style:{color:"rgba(255,255,255,0.85)",display:"block"},truncate:!0,children:s.resource.location})]})}},month:{event:({event:s})=>{let p=j(o,s.resource.calendarId)?.calendar.colorToken??"var(--gray-8)";return yr(fr,{size:"1",style:{display:"flex",alignItems:"center",gap:"var(--space-1)",color:"var(--gray-12)",background:`color-mix(in srgb, ${p} 28%, transparent)`,borderRadius:"var(--radius-2)",padding:"var(--space-1) var(--space-2)"},truncate:!0,children:[Me("span",{"aria-hidden":!0,style:{width:"var(--space-2)",height:"var(--space-2)",borderRadius:"50%",background:p,flexShrink:0}}),yr("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[vr(s.start).format("H:mm")," ",s.title]})]})}}}})})}import{Dialog as Ze,Flex as we,Text as Te,Button as ka,Separator as Zi,Badge as Ji}from"@radix-ui/themes";import{Fragment as es,jsx as k,jsxs as ye}from"react/jsx-runtime";var Ra={synced:{label:"Synced",color:"green"},syncing:{label:"Syncing\u2026",color:"amber"},error:{label:"Error",color:"red"}};function Qi({sync:e,accounts:r,onOpenChange:t,onEdit:a}){let n=e?(()=>{let o=e.sourceCalendarIds.map(l=>j(r,l)?.calendar.name).filter(l=>!!l),i=j(r,e.targetCalendarId)?.calendar.name??"\u2014";return`${o.join(", ")||"\u2014"} \u2192 ${i}`})():"";return k(Ze.Root,{open:!!e,onOpenChange:t,children:k(Ze.Content,{maxWidth:b.dialogMd,children:e&&ye(es,{children:[ye(we,{align:"center",justify:"between",mb:"1",children:[k(Ze.Title,{size:"4",mb:"0",children:e.name}),k(Ji,{color:Ra[e.status].color,variant:"soft",size:"1",radius:"full",children:Ra[e.status].label})]}),k(Ze.Description,{size:"2",color:"gray",mb:"4",children:"Sync configuration"}),ye(we,{direction:"column",gap:"3",children:[k(fe,{label:"Calendars",children:n}),k(fe,{label:"Sources",children:k(we,{direction:"column",gap:"1",align:"end",children:e.sourceCalendarIds.map(o=>{let i=j(r,o);return i?ye(we,{direction:"column",align:"end",children:[k(Te,{size:"2",weight:"medium",style:{color:"var(--gray-12)"},children:i.calendar.name}),k(Te,{size:"1",color:"gray",children:i.account.email})]},o):null})||"\u2014"})}),k(fe,{label:"Target",children:(()=>{let o=j(r,e.targetCalendarId);return o?ye(we,{direction:"column",align:"end",children:[k(Te,{size:"2",weight:"medium",style:{color:"var(--gray-12)"},children:o.calendar.name}),k(Te,{size:"1",color:"gray",children:o.account.email})]}):"\u2014"})()}),k(fe,{label:"Last synced",children:e.lastSyncedLabel??"\u2014"})]}),k(Zi,{size:"4",my:"4"}),k(Te,{as:"p",size:"1",weight:"medium",color:"gray",mb:"3",style:{letterSpacing:"0.04em"},children:"WHAT TO SHOW"}),ye(we,{direction:"column",gap:"3",children:[k(fe,{label:"Tag",children:e.tagLabel?.trim()||"Busy"}),k(fe,{label:"Event titles",children:e.showTitle?"Shown":"Hidden"}),k(fe,{label:"Event description",children:e.showDescription?"Shown":"Hidden"}),k(fe,{label:"Event location",children:e.showLocation?"Shown":"Hidden"})]}),ye(X,{justify:"between",children:[k(Ze.Close,{children:k(ka,{size:"2",variant:"soft",color:"gray",children:"Close"})}),k(ka,{size:"2",className:"btn-amber-primary",onClick:()=>a(e.id),children:"Edit sync"})]})]})})})}function fe({label:e,children:r}){return ye(we,{align:"baseline",justify:"between",gap:"4",children:[k(Te,{size:"2",color:"gray",style:{flexShrink:0},children:e}),k(Te,{size:"2",weight:"medium",align:"right",style:{color:"var(--gray-12)"},children:r})]})}import{useState as hr}from"react";function Je({accounts:e,connectProvider:r,onAccountAdded:t,onImported:a}){let[n,o]=hr(null),[i,l]=hr(null),[s,c]=hr(null),[p,d]=hr(!1);function g(f){if(n)return;c(null),d(!1),o(f);let x=e.map(w=>w.id);r(f,x).then(w=>{o(null),w?l(w):(c(f),d(!0))}).catch(()=>{o(null),c(f),d(!1)})}function v(f){if(!i)return;let x=new Set(f);t({...i,calendars:i.calendars.filter(w=>x.has(w.id))}),l(null),a?.()}return{connectingProvider:n,pendingAccount:i,failedProvider:s,exhausted:p,connect:g,confirmImport:v,cancelImport:()=>l(null),dismissError:()=>c(null)}}import{Box as rs,DropdownMenu as br,Button as ts,Flex as as,Text as Ia}from"@radix-ui/themes";import{PlusIcon as Aa}from"@radix-ui/react-icons";import{Fragment as ns,jsx as te,jsxs as Be}from"react/jsx-runtime";function os({variant:e="button",trigger:r,accounts:t,connectProvider:a,onAccountAdded:n,onImported:o}){let{pendingAccount:i,failedProvider:l,exhausted:s,connect:c,confirmImport:p,cancelImport:d,dismissError:g}=Je({accounts:t,connectProvider:a,onAccountAdded:n,onImported:o}),v=["google","microsoft"],f=e==="tile"?Be("button",{type:"button",className:"connect-account-tile","aria-label":"Connect Account",children:[te(Aa,{style:h("--space-4")}),"Connect Account"]}):Be(ts,{size:"2",className:"btn-amber-primary",children:[te(Aa,{style:h("--space-4")}),"Connect Account"]}),x=Be(br.Root,{children:[te(br.Trigger,{children:r??f}),te(br.Content,{align:"start",style:{width:"max-content",minWidth:"max-content"},children:v.map(w=>{let z=Ee[w];return Be(br.Item,{onSelect:()=>c(w),style:{height:"auto",alignItems:"center",gap:"var(--space-3)",padding:"var(--space-2) var(--space-3)"},children:[te(P,{size:"var(--space-6)",children:te(H,{provider:w})}),Be(as,{direction:"column",gap:"1",style:{flexShrink:0},children:[te(Ia,{size:"2",weight:"medium",style:{color:"var(--gray-12)"},children:z.label}),te(Ia,{size:"1",color:"gray",children:z.description})]})]},w)})})]});return Be(ns,{children:[e==="tile"&&!r?te(rs,{style:{width:"100%",minWidth:0},children:x}):x,te(Ce,{account:i,onOpenChange:w=>!w&&d(),onImport:p}),l&&te(Er,{msg:s?`No more ${Ee[l].label} accounts available to connect.`:`Couldn't connect ${Ee[l].label}. Please try again.`,color:"red",onDone:g})]})}import{Card as is,Flex as pt,Text as ss,Heading as ls}from"@radix-ui/themes";import{CalendarIcon as cs}from"@radix-ui/react-icons";import{jsx as ve,jsxs as Da}from"react/jsx-runtime";function ds({accounts:e,connectProvider:r,onAccountAdded:t,onImported:a}){let{connectingProvider:n,pendingAccount:o,failedProvider:i,exhausted:l,connect:s,confirmImport:c,cancelImport:p}=Je({accounts:e,connectProvider:r,onAccountAdded:t,onImported:a});return Da(pt,{direction:"column",align:"center",justify:"center",style:{width:"100%",flex:1,minHeight:0},children:[ve(is,{style:{width:"100%",maxWidth:b.providerChooserMax},children:Da(pt,{direction:"column",align:"center",justify:"center",gap:"3",py:"6",px:"3",style:{width:"100%",textAlign:"center"},children:[ve(P,{children:ve(cs,{style:{...h("--space-5"),color:"var(--gray-7)"}})}),ve(ls,{as:"h2",size:L.h2,weight:"medium",children:e.length>0?"Connect another account":"Connect your first account"}),ve(ss,{as:"p",size:"2",color:"gray",children:e.length>0?"Add another Google or Microsoft account, then choose which calendars to import.":"Connect a Google or Microsoft account to import calendars for sync."}),ve(pt,{direction:"column",style:{width:"100%"},mt:"3",children:ve(et,{connectingProvider:n,failedProvider:i,exhausted:l,onConnect:s})})]})}),ve(Ce,{account:o,onOpenChange:d=>!d&&p(),onImport:c})]})}import{useEffect as ps,useMemo as gt,useState as xr}from"react";import{Link as gs}from"react-router-dom";import{Box as ut,Checkbox as Pa,Flex as Qe,Separator as mt,Text as Se}from"@radix-ui/themes";import{ChevronDownIcon as us,GearIcon as ms,HamburgerMenuIcon as fs}from"@radix-ui/react-icons";import{jsx as A,jsxs as pe}from"react/jsx-runtime";function ys({accounts:e,view:r,setView:t,hideClones:a,setHideClones:n,mergedCalendarIds:o,visibleCalendarIds:i,toggleCalendarVisible:l,getVisibleBlocksInRange:s,manageAccountsHref:c,today:p=new Date}){let[d,g]=xr(p),[v,f]=xr(new Set),[x,w]=xr(()=>typeof window<"u"&&window.innerWidth<900),[z,ae]=xr(!1);ps(()=>{function y(){w(window.innerWidth<900)}return window.addEventListener("resize",y),()=>window.removeEventListener("resize",y)},[]);let se=gt(()=>{let y=new Date(d);return y.setDate(y.getDate()-42),y},[d]),C=gt(()=>{let y=new Date(d);return y.setDate(y.getDate()+42),y},[d]),M=s(se,C),T=gt(()=>{let y=[],B=new Map;for(let W of o){let V=j(e,W);if(!V)continue;let K=B.get(V.account.id);K===void 0&&(K=y.length,B.set(V.account.id,K),y.push({accountId:V.account.id,calendarIds:[]})),y[K].calendarIds.push(W)}return y},[o,e]);function ge(y){f(B=>{let W=new Set(B);return W.has(y)?W.delete(y):W.add(y),W})}return pe(Qe,{gap:"5",align:"start",direction:x?"column":"row",flexGrow:"1",minHeight:"0",height:"100%",children:[(!x||z)&&pe(ut,{minWidth:x?void 0:b.sidebarColMin,p:"4",maxHeight:"100%",style:{flex:x?"1 1 100%":`0 0 ${b.sidebarColBasis}`,border:"1px solid var(--gray-5)",borderRadius:"var(--radius-4)",background:"var(--color-panel-solid)",boxShadow:"var(--shadow-card)",overflow:"auto"},children:[A(lt,{cursor:d,onSelect:g,today:p}),A(mt,{size:"4",my:"3"}),A(Se,{as:"p",size:"1",weight:"medium",color:"gray",mb:"3",style:{letterSpacing:"0.04em"},children:"CALENDARS"}),A(Qe,{direction:"column",gap:"1",mb:"4",children:T.map(({accountId:y,calendarIds:B},W)=>{let V=e.find(q=>q.id===y);if(!V)return null;let K=v.has(y);return pe("div",{style:{paddingTop:W>0?"var(--space-2)":void 0,borderTop:W>0?"1px solid var(--gray-3)":void 0},children:[pe(Qe,{align:"center",gap:"2",mb:"2",py:"1",className:"calendar-legend-account-row",style:{cursor:"pointer",borderRadius:"var(--radius-2)"},onClick:()=>ge(y),children:[A(us,{style:{...h("--space-3"),color:"var(--gray-9)",transform:K?"rotate(-90deg)":void 0,transition:"transform 120ms ease",flexShrink:0}}),A(H,{provider:V.provider}),A(Se,{size:"2",weight:"medium",truncate:!0,title:V.email,style:{color:"var(--gray-12)",minWidth:0},children:V.email})]}),!K&&A(Qe,{direction:"column",gap:"1",pl:"5",children:B.map(q=>{let Re=j(e,q);return Re?pe(Se,{as:"label",size:"2",className:"calendar-legend-row",style:{display:"flex",alignItems:"center",gap:"var(--space-2)",cursor:"pointer",borderRadius:"var(--radius-2)",padding:"var(--space-1) var(--space-2)",marginLeft:"calc(var(--space-2) * -1)"},children:[pe(Qe,{align:"center",gap:"1",children:[A(Pa,{checked:i.has(q),onCheckedChange:()=>l(q)}),A("span",{"aria-hidden":!0,style:{width:"var(--space-3)",height:"var(--space-3)",borderRadius:"50%",background:Re.calendar.colorToken,flexShrink:0}})]}),A(Se,{size:"2",truncate:!0,style:{color:"var(--gray-12)"},title:Re.calendar.name,children:Re.calendar.name})]},q):null})})]},y)})}),A(mt,{size:"4",mb:"3"}),pe(Se,{as:"label",size:"2",style:{display:"flex",alignItems:"center",gap:"var(--space-2)",cursor:"pointer"},mb:"3",children:[A(Pa,{checked:a,onCheckedChange:y=>n(!!y)}),"Hide synced events"]}),A(mt,{size:"4",mb:"3"}),pe(gs,{to:c,style:{display:"flex",alignItems:"center",gap:"var(--space-2)",color:"var(--gray-11)",textDecoration:"none"},children:[A(ms,{style:h("--space-3")}),A(Se,{size:"2",children:"Manage accounts"})]}),A(Se,{as:"p",size:"1",color:"gray",mt:"4",children:"On your target calendars, others see only what each sync is set to share. Full detail stays in araMetrics."})]}),pe(ut,{width:x?"100%":void 0,minHeight:b.bigCalendarH,height:"100%",style:{flex:x?"1 1 100%":`1 1 ${b.syncColWide}`,minWidth:x?0:b.syncColMin,display:"flex",flexDirection:"column",alignSelf:"stretch"},children:[x&&A("button",{type:"button",className:"sidebar-icon-btn","aria-label":z?"Hide calendars":"Show calendars",style:{alignSelf:"flex-start",marginBottom:"var(--space-3)"},onClick:()=>ae(y=>!y),children:A(fs,{style:h("--space-4")})}),A(ut,{flexGrow:"1",minHeight:"0",height:"100%",children:A(dt,{blocks:M,view:r,onViewChange:t,date:d,onNavigate:g,accounts:e,today:p})})]})]})}import{clsx as vs}from"clsx";import{twMerge as hs}from"tailwind-merge";function ke(...e){return hs(vs(e))}function bs(e,r="solid"){return R.variants[e]?.[r]||R.variants.primary[r]}function xs(e){let r=R.sizes[e]||R.sizes.md;return`${r.text} ${r.padding} ${r.height}`}function Cs(){return ke(R.base.transition,R.base.focus,R.base.disabled,R.accessibility.reducedMotion)}function ws(){return ke(R.base.interactive,R.accessibility.focusTrap,R.accessibility.touchTarget)}function Ts(e={}){return ke(e.focusVisible&&R.accessibility.focusTrap,e.highContrast&&R.accessibility.highContrast,e.reducedMotion&&R.accessibility.reducedMotion)}function Ss(e,r=""){return typeof e=="string"?`${r}${e}`:typeof e=="object"&&e!==null?Object.entries(e).map(([t,a])=>a===void 0?"":`${t==="xs"?"":`${t}:`}${r}${a}`).filter(Boolean).join(" "):""}function ks(e,r="gap"){let t=R.spacing[e]||R.spacing.md;switch(r){case"margin":return t.replace("gap-","m-");case"padding":return t.replace("gap-","p-");default:return t}}function Rs(e){return R.radius[e]||R.radius.md}function Is(e){return R.typography[e]||R.typography.base}function As(e,r=500){return`bg-${e}-${r}`}function Ds(e,r=500){return`text-${e}-${r}`}function Ps(e,r=500){return`border-${e}-${r}`}function Es(e,r=500){return`hover:bg-${e}-${r}`}function zs(e,r=500){return`hover:text-${e}-${r}`}function Ms(e,r=500){return`focus:ring-${e}-${r}`}function Bs(e){let r=R.animations[e];return typeof r=="string"?r:""}function Ns(e,r,t){return a=>{let n=e;return Object.entries(r).forEach(([o,i])=>{let l=a[o];l&&i[l]&&(n+=` ${i[l]}`)}),t?.forEach(({conditions:o,className:i})=>{Object.entries(o).every(([s,c])=>a[s]===c)&&(n+=` ${i}`)}),ke(n)}}function Fs(e){return function(t){let{className:a,...n}=t,o={...e.defaultVariants,...n},i=e.base||"";return e.variants&&Object.entries(e.variants).forEach(([l,s])=>{let c=o[l];c&&s[c]&&(i+=` ${s[c]}`)}),e.compoundVariants?.forEach(({conditions:l,className:s})=>{Object.entries(l).every(([p,d])=>o[p]===d)&&(i+=` ${s}`)}),ke(i,a)}}function Ls(e,r){let t={...e};return Object.keys(r).forEach(a=>{let n=r[a],o=e[a];a==="className"?t[a]=ke(o,n):typeof n=="object"&&typeof o=="object"&&n!==null&&o!==null&&!Array.isArray(n)&&!Array.isArray(o)?t[a]={...o,...n}:t[a]=n}),t}function Hs(e,r,t){return e?r:t&&e===!1?t:""}function Os(e){let r=["button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","a[href]",'[tabindex]:not([tabindex="-1"])','[contenteditable="true"]'].join(", ");return Array.from(e.querySelectorAll(r))}function _s(e,r,t,a={}){let{loop:n=!0,orientation:o="both"}=a,i=t;switch(e.key){case"ArrowDown":(o==="vertical"||o==="both")&&(i=t+1,i>=r.length&&(i=n?0:r.length-1));break;case"ArrowUp":(o==="vertical"||o==="both")&&(i=t-1,i<0&&(i=n?r.length-1:0));break;case"ArrowRight":(o==="horizontal"||o==="both")&&(i=t+1,i>=r.length&&(i=n?0:r.length-1));break;case"ArrowLeft":(o==="horizontal"||o==="both")&&(i=t-1,i<0&&(i=n?r.length-1:0));break;case"Home":i=0;break;case"End":i=r.length-1;break}return i!==t&&(e.preventDefault(),r[i]?.focus()),i}import{Theme as Ws}from"@radix-ui/themes";import"@radix-ui/themes/styles.css";import{jsx as $s}from"react/jsx-runtime";function Vs({children:e,appearance:r="light",radius:t="none",scaling:a="100%",accentColor:n="amber",grayColor:o="gray",panelBackground:i="solid",className:l=""}){return $s(Ws,{accentColor:n,grayColor:o,radius:t,scaling:a,panelBackground:i,appearance:r,className:l,children:e})}import*as Cr from"react";function ku({value:e,defaultValue:r,onChange:t}){let[a,n]=Cr.useState(r),o=e!==void 0,i=o?e:a,l=Cr.useCallback(s=>{let c=typeof s=="function"?s(i):s;o||n(c),t?.(c)},[o,i,t]);return[i,l]}import*as Ne from"react";function Iu(e=!1){let[r,t]=Ne.useState(e),a=Ne.useCallback(()=>t(!0),[]),n=Ne.useCallback(()=>t(!1),[]),o=Ne.useCallback(()=>t(i=>!i),[]);return{isOpen:r,open:a,close:n,toggle:o,onOpen:a,onClose:n,onToggle:o}}import*as wr from"react";function Du(e,r=!0){let t=wr.useRef(null);return wr.useEffect(()=>{if(!r)return;let a=n=>{t.current&&!t.current.contains(n.target)&&e()};return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[e,r]),t}export{Xo as ACTIVITY_META,Lt as AUDIT_ACTION_META,Ha as AccentCard,bt as AccentHeader,Gi as AccountCalendarsDialog,qa as AccountCard,Ao as ActivityRow,os as AddAccountMenu,Io as AppCard,Jo as AuthCard,dt as BigCalendarView,Hr as BrandPanel,qr as CalendarDayHeader,ys as CalendarMergedView,ai as CalendarPickList,Jr as CalendarToolbar,X as CardFooter,Rr as ConfirmDialog,et as ConnectProviderList,ds as ConnectProviderRows,vi as ConnectedAccountCard,Bo as DashboardErrorCard,Mr as DataTableRow,Ci as EmptyCard,yo as EventBlock,Or as GoogleIcon,P as IconTile,Ce as ImportCalendarsDialog,qo as METRIC_STATUS_COLOR,Co as MetricCard,_r as MicrosoftIcon,lt as MiniMonthPicker,no as MonthGrid,Ni as OnboardingStepDots,ya as OnboardingStepper,Wr as OtpInput,sn as OtpVerifyStep,ln as PROVIDER_LABEL,Ee as PROVIDER_META,Go as Pagination,Ir as PausedBadge,H as ProviderIcon,Yo as ROLE_LABELS,tr as ROLE_META,cr as SHELL_HEADER_H,Ko as STATUS_META,qn as SearchOverlay,Tn as Sidebar,Ba as Skeleton,Qi as SyncDetailsDialog,zi as SyncPreviewRail,Er as Toast,Ln as Topbar,Vs as UIProvider,nt as WizardStepper,Zo as auditActionMeta,ke as cn,Ma as colors,Hs as conditionalClass,Ns as createCompoundVariants,Fs as createVariantGenerator,j as findCalendar,Ts as getAccessibilityStyles,Bs as getAnimationClass,Cs as getBaseStyles,As as getBgClass,Ps as getBorderClass,vt as getColor,Ms as getFocusRingClass,Os as getFocusableElements,Es as getHoverBgClass,zs as getHoverTextClass,ws as getInteractiveStyles,Rs as getRadiusClass,Ss as getResponsiveClasses,xs as getSizeStyles,ks as getSpacingClass,Ds as getTextClass,Is as getTypographyClass,bs as getVariantStyles,_s as handleArrowNavigation,L as headingSize,b as layout,Ls as mergeProps,R as theme,Du as useClickOutside,Je as useConnectAccount,ku as useControllableState,Iu as useDisclosure};
|
|
1
|
+
import{a as zo,b as R,c as vt}from"./chunk-LGJWNA6J.mjs";import{Box as js,Flex as Ks,Grid as Ys,Container as qs,Section as Xs,Inset as Zs,AspectRatio as Qs,ScrollArea as Js,Separator as el,Text as rl,Heading as tl,Blockquote as ol,Code as al,Em as nl,Kbd as il,Link as sl,Quote as ll,Strong as cl,Button as dl,IconButton as pl,TextField as gl,TextArea as ul,Checkbox as ml,CheckboxGroup as fl,CheckboxCards as yl,Radio as vl,RadioGroup as hl,RadioCards as bl,Select as xl,Slider as Cl,Switch as wl,SegmentedControl as Tl,Dialog as Sl,AlertDialog as kl,DropdownMenu as Rl,ContextMenu as Il,Popover as Al,HoverCard as Dl,Tooltip as Pl,Portal as El,Avatar as Bl,Badge as Ml,Callout as zl,Card as Nl,DataList as Fl,Progress as Ll,Spinner as Hl,Table as Ol,Tabs as _l,TabNav as Vl,AccessibleIcon as Wl,Slot as $l,Slottable as Ul,VisuallyHidden as Gl}from"@radix-ui/themes";import{jsx as Fo}from"react/jsx-runtime";function No({width:e="100%",height:r="var(--space-4)",radius:t="var(--radius-2)",circle:o=!1,mb:n,className:a,style:i}){return Fo("div",{className:["skeleton",a].filter(Boolean).join(" "),"aria-hidden":"true",style:{width:e,height:r,borderRadius:o?"50%":t,marginBottom:n,...i}})}import{Box as ht,Flex as Lo,Text as Ho}from"@radix-ui/themes";import{jsx as Sr,jsxs as xt}from"react/jsx-runtime";function bt({title:e,trailing:r,style:t}){let o=typeof e=="string"||typeof e=="number"?Sr(Ho,{size:"3",weight:"medium",style:{color:"var(--accent-contrast)"},children:e}):e;return xt(Lo,{align:"center",justify:"between",gap:"3",px:"4",style:{background:"var(--accent-9)",minHeight:"var(--space-7)",...t},children:[o,r]})}function Oo({title:e,trailing:r,children:t,bodyPadding:o="4",style:n}){return xt(ht,{style:{background:"var(--color-panel-solid)",borderRadius:"var(--radius-5)",overflow:"hidden",boxShadow:"var(--shadow-card)",...n},children:[Sr(bt,{title:e,trailing:r}),Sr(ht,{p:o,children:t})]})}import{AlertDialog as he,Button as Ct}from"@radix-ui/themes";var b={contentMax:"calc(15 * var(--space-9) + var(--space-5))",accountCardW:"calc(3 * var(--space-9) + var(--space-8))",accountCardMinH:"calc(2 * var(--space-9) - var(--space-2))",monthTitleMinW:"calc(3 * var(--space-9) - var(--space-1))",bigCalendarH:"calc(10 * var(--space-9))",sidebarColBasis:"calc(4 * var(--space-9) - var(--space-2))",sidebarColMin:"calc(3 * var(--space-9) + var(--space-6))",syncColMin:"calc(5 * var(--space-9))",syncColWide:"calc(7 * var(--space-9) + var(--space-6))",dialogSm:"calc(6 * var(--space-9) - var(--space-2))",dialogBody:"calc(5 * var(--space-9) + var(--space-7))",authFormMax:"calc(6 * var(--space-9) + var(--space-8))",brandLogoMax:"calc(6 * var(--space-9) + var(--space-8) - var(--space-1))",connectedAccountCardH:"calc(var(--space-9) - var(--space-1))",dialogMd:"calc(6 * var(--space-9) + var(--space-6))",dialogLg:"calc(7 * var(--space-9) - var(--space-1))",emptyStateMax:"calc(10 * var(--space-9))",emptyStateCopyMax:"calc(6 * var(--space-9))",providerChooserMax:"calc(6 * var(--space-9) + var(--space-6))",auditColTime:"calc(var(--space-9) + var(--space-2))",auditColAction:"calc(var(--space-9) + var(--space-5) + var(--space-1))",searchFieldW:"calc(3 * var(--space-9) + var(--space-5) + var(--space-1))",settingsGridMin:"calc(5 * var(--space-9) + var(--space-5))",placeholderMd:"calc(6 * var(--space-9) + var(--space-4))"};import{Flex as _o}from"@radix-ui/themes";import{jsx as Vo}from"react/jsx-runtime";function X({children:e,justify:r="end",noTopMargin:t,pad:o="var(--space-5)",radius:n="var(--radius-5)"}){return Vo(_o,{justify:r,style:{margin:`${t?"0":"var(--space-5)"} calc(-1 * ${o}) calc(-1 * ${o})`,padding:`var(--space-4) ${o}`,alignItems:"center",background:"var(--gray-2)",borderTop:"1px solid var(--gray-5)",borderRadius:`0 0 ${n} ${n}`},children:e})}import{jsx as be,jsxs as kr}from"react/jsx-runtime";function Rr({title:e,description:r,confirmLabel:t="Yes",cancelLabel:o="Cancel",onConfirm:n,trigger:a,open:i,onOpenChange:l}){return kr(he.Root,{open:i,onOpenChange:l,children:[a?be(he.Trigger,{children:a}):null,kr(he.Content,{maxWidth:b.dialogSm,children:[be(he.Title,{size:"5",mb:"1",style:{fontFamily:"var(--heading-font-family)",fontWeight:"var(--font-weight-medium)"},children:e}),be(he.Description,{size:"2",color:"gray",mb:"5",children:r}),kr(X,{justify:"between",noTopMargin:!0,children:[be(he.Cancel,{children:be(Ct,{size:"2",variant:"outline",color:"gray",children:o})}),be(he.Action,{children:be(Ct,{size:"2",className:"btn-amber-primary",onClick:n,children:t})})]})]})]})}import{PauseIcon as Wo}from"@radix-ui/react-icons";function h(e){return{width:`var(${e})`,height:`var(${e})`}}import{jsx as wt,jsxs as $o}from"react/jsx-runtime";function Ir({label:e="Paused",style:r}){return $o("span",{style:{display:"inline-flex",alignItems:"center",gap:"var(--space-1)",height:"calc(var(--space-4) + var(--space-1))",padding:"var(--space-1) var(--space-2)",border:"1px solid var(--color-paused)",borderRadius:999,background:"var(--color-panel-solid)",color:"var(--color-paused)",fontSize:"var(--font-size-1)",fontWeight:600,lineHeight:1,whiteSpace:"nowrap",...r},children:[wt("span",{"aria-hidden":"true",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"var(--space-3)",height:"var(--space-3)",flexShrink:0,borderRadius:"50%",border:"1px solid var(--color-paused)"},children:wt(Wo,{style:h("--space-2")})}),e]})}import{Avatar as Uo,Box as Tt,DropdownMenu as Ie,Flex as St,IconButton as Go,Text as kt}from"@radix-ui/themes";import{DotsVerticalIcon as jo,PauseIcon as Ko,PlayIcon as Yo,TrashIcon as qo}from"@radix-ui/react-icons";import{jsx as $,jsxs as ne}from"react/jsx-runtime";function Xo({name:e,email:r,avatarSrc:t,paused:o=!1,onPause:n,onResume:a,onDelete:i,onClick:l,badge:s,accentColor:c,style:p}){let d=$(kt,{as:l?"span":"p",size:"3",weight:"medium",truncate:!0,style:{color:"var(--gray-12)",minWidth:0},children:e});return ne(Tt,{onClick:l,style:{width:b.accountCardW,minHeight:b.accountCardMinH,padding:"var(--space-3)",background:"var(--color-panel-solid)",borderRadius:"var(--radius-4)",boxShadow:"var(--shadow-card)",cursor:l?"pointer":void 0,...p},children:[ne(St,{align:"center",justify:"between",gap:"2",mb:"3",children:[ne(St,{align:"center",gap:"2",style:{minWidth:0},children:[ne("div",{style:{position:"relative",flexShrink:0},children:[$(Uo,{size:"3",radius:"full",src:t,fallback:e.charAt(0).toUpperCase()||"?",style:c?{background:c,color:"white"}:void 0}),s&&$("span",{style:{position:"absolute",right:"calc(-1 * var(--space-1))",bottom:"calc(-1 * var(--space-1))",width:"var(--space-4)",height:"var(--space-4)",borderRadius:"50%",background:"var(--color-panel-solid)",border:"1px solid var(--gray-4)",display:"inline-flex",alignItems:"center",justifyContent:"center",transform:"scale(0.72)"},children:s})]}),o&&$(Ir,{})]}),ne(Ie.Root,{children:[$(Ie.Trigger,{children:$(Go,{variant:"ghost",color:"gray","aria-label":"Account actions",style:{flexShrink:0},onClick:g=>g.stopPropagation(),children:$(jo,{})})}),ne(Ie.Content,{align:"end",onClick:g=>g.stopPropagation(),children:[o?ne(Ie.Item,{onSelect:a,children:[$(Yo,{})," Resume"]}):ne(Ie.Item,{onSelect:n,children:[$(Ko,{})," Pause"]}),ne(Ie.Item,{color:"red",onSelect:i,children:[$(qo,{})," Delete"]})]})]})]}),ne(Tt,{style:{minWidth:0},children:[l?$("button",{type:"button",className:"card-title-button",onClick:g=>{g.stopPropagation(),l()},children:d}):d,$(kt,{as:"p",size:"1",color:"gray",truncate:!0,children:r})]})]})}import{Box as Rt,Flex as It,Heading as Zo,IconButton as At,Text as Dt}from"@radix-ui/themes";import{ChevronLeftIcon as Qo,ChevronRightIcon as Jo}from"@radix-ui/react-icons";var L={h1:"6",h2:"5",h3:"4",h4:"3"};import{Fragment as sa,jsx as F,jsxs as Dr}from"react/jsx-runtime";var ea=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Ar="var(--space-9)",ra="var(--space-8)",Pt="var(--space-2)",ta=new Intl.DateTimeFormat("en-US",{month:"long",year:"numeric"}),oa=new Intl.DateTimeFormat("en-US",{weekday:"long",month:"long",day:"numeric",year:"numeric"});function aa(e,r){return e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth()&&e.getDate()===r.getDate()}function Et(e){return(e+6)%7}function na(e){let r=e.getMonth(),t=e.getFullYear(),o=new Date(t,r,1),n=new Date(t,r+1,0),a=Et(o.getDay()),i=6-Et(n.getDay()),l=new Date(t,r,1-a),s=a+n.getDate()+i;return Array.from({length:s},(c,p)=>{let d=new Date(l.getFullYear(),l.getMonth(),l.getDate()+p);return{date:d,inCurrentMonth:d.getMonth()===r}})}function Bt(e,r){return new Date(e.getFullYear(),e.getMonth()+r,1)}function ia({month:e,onMonthChange:r,events:t=[],dayDots:o,today:n,onSelectDay:a,style:i}){let l=n??new Date,s=na(e),c=new Set(t.map(p=>p.toDateString()));return Dr(It,{direction:"column",align:"center",gap:"4",style:i,children:[Dr(It,{align:"center",gap:"2",children:[F(At,{type:"button",variant:"ghost",color:"gray","aria-label":"Previous month",onClick:()=>r?.(Bt(e,-1)),children:F(Qo,{style:h("--space-4")})}),F(Zo,{as:"h2",size:L.h2,weight:"medium",style:{minWidth:b.monthTitleMinW,textAlign:"center"},children:ta.format(e)}),F(At,{type:"button",variant:"ghost",color:"gray","aria-label":"Next month",onClick:()=>r?.(Bt(e,1)),children:F(Jo,{style:h("--space-4")})})]}),F(Rt,{style:{display:"grid",gridTemplateColumns:`repeat(7, ${Ar})`,gap:Pt},children:ea.map(p=>F(Dt,{size:"2",align:"center",style:{color:"var(--gray-11)"},children:p},p))}),F(Rt,{style:{display:"grid",gridTemplateColumns:`repeat(7, ${Ar})`,gap:Pt},children:s.map(({date:p,inCurrentMonth:d})=>{let g=aa(p,l),v=o?.get(p.toDateString()),f=c.has(p.toDateString()),x={position:"relative",width:Ar,height:ra,display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",background:d?g?"var(--color-panel-solid)":"transparent":"var(--gray-2)",border:g?"1.5px solid var(--accent-9)":"none",borderRadius:g?"var(--radius-3)":d?void 0:"var(--radius-2)",padding:0,font:"inherit",cursor:a?"pointer":void 0},w=Dr(sa,{children:[v&&v.length>0?F("span",{"aria-hidden":"true",style:{position:"absolute",bottom:"var(--space-1)",left:0,right:0,display:"flex",justifyContent:"center",gap:"2px"},children:v.slice(0,3).map((oe,se)=>F("span",{style:{width:"var(--space-1)",height:"var(--space-1)",borderRadius:"50%",background:oe}},se))}):f&&F("span",{"aria-hidden":"true",style:{position:"absolute",top:"var(--space-1)",right:"var(--space-2)",width:"var(--space-2)",height:"var(--space-2)",borderRadius:"50%",background:"var(--accent-9)"}}),F(Dt,{size:"3",style:{color:d?"var(--gray-12)":"var(--gray-11)",fontWeight:g?600:400},children:p.getDate()})]}),B=p.toISOString();return a?F("button",{type:"button",onClick:()=>a(p),"aria-label":oa.format(p),style:x,children:w},B):F("div",{style:x,children:w},B)})})]})}import{useEffect as la}from"react";import{Callout as Pr}from"@radix-ui/themes";import{CheckCircledIcon as ca,ExclamationTriangleIcon as da}from"@radix-ui/react-icons";import{jsx as Le,jsxs as pa}from"react/jsx-runtime";function Er({msg:e,color:r="green",onDone:t,durationMs:o=3e3}){return la(()=>{let n=setTimeout(t,o);return()=>clearTimeout(n)},[t,o]),Le("div",{style:{position:"fixed",bottom:"var(--space-5)",right:"var(--space-5)",zIndex:1e4,maxWidth:b.dialogBody,pointerEvents:"none"},children:pa(Pr.Root,{color:r,variant:"soft",size:"1",children:[Le(Pr.Icon,{children:r==="red"?Le(da,{}):Le(ca,{})}),Le(Pr.Text,{children:e})]})})}import{jsx as ga}from"react/jsx-runtime";function P({children:e,size:r="var(--space-7)"}){return ga("div",{style:{width:r,height:r,borderRadius:"var(--radius-4)",background:"var(--color-panel-solid)",border:"1px solid var(--gray-5)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e})}import{Box as ua,Flex as ma,Text as Mt}from"@radix-ui/themes";import{LockClosedIcon as fa}from"@radix-ui/react-icons";import{jsx as zt,jsxs as Br}from"react/jsx-runtime";function ya({title:e,time:r,detail:t,color:o,locked:n}){return Br(ma,{align:"center",justify:"between",style:{background:o,borderRadius:"var(--radius-3)",padding:"var(--space-3)",color:"white"},children:[Br(ua,{style:{minWidth:0},children:[zt(Mt,{as:"p",size:"2",weight:"medium",style:{color:"white"},truncate:!0,children:e}),Br(Mt,{as:"p",size:"1",style:{color:"rgba(255,255,255,0.85)"},truncate:!0,children:[r,t?` \xB7 ${t}`:""]})]}),n&&zt(fa,{style:{flexShrink:0,color:"rgba(255,255,255,0.85)"}})]})}import{Box as va}from"@radix-ui/themes";import{jsx as ha}from"react/jsx-runtime";function Mr({children:e,style:r,showBorder:t=!1,onActivate:o,selected:n=!1,className:a,"aria-label":i}){let l=!!o;function s(c){o&&(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),o())}return ha(va,{role:l?"button":void 0,tabIndex:l?0:void 0,"aria-label":i,onClick:o,onKeyDown:l?s:void 0,className:["data-table-row",l&&"data-table-row--interactive",l&&n&&"data-table-row--selected",a].filter(Boolean).join(" "),style:{borderTop:t?"1px solid var(--gray-3)":void 0,...r},children:e})}import{useId as ba}from"react";import{Card as xa,Flex as zr,Text as Nr}from"@radix-ui/themes";import{jsx as ie,jsxs as Ae}from"react/jsx-runtime";function Ca({label:e,value:r,delta:t,deltaDir:o,goodDirection:n,statusColor:a,sparkline:i}){return ie(xa,{className:"metric-card",children:Ae(zr,{direction:"column",p:"1",children:[Ae(zr,{align:"center",justify:"between",mb:"3",children:[ie(Nr,{as:"span",className:"ds-section-label",children:e}),ie("div",{style:{width:"var(--space-2)",height:"var(--space-2)",borderRadius:"50%",background:a,flexShrink:0}})]}),ie(Nr,{as:"p",className:"metric-card-value",children:r}),Ae(zr,{align:"end",justify:"between",children:[Ae(Nr,{size:"1",style:{color:o==="flat"?"var(--gray-11)":o===n?"var(--green-11)":"var(--red-11)",lineHeight:1.4},children:[o==="up"?"\u2191 ":o==="down"?"\u2193 ":"",t]}),ie(wa,{data:i,color:a})]})]})})}function wa({data:e,color:r}){let n=Math.min(...e),i=Math.max(...e)-n||1,l=e.map((g,v)=>({x:v/(e.length-1)*72,y:28-(g-n)/i*28*.75-28*.1})),s=l.map((g,v)=>`${v===0?"M":"L"} ${g.x.toFixed(1)} ${g.y.toFixed(1)}`).join(" "),c=["M 0 28",...l.map(g=>`L ${g.x.toFixed(1)} ${g.y.toFixed(1)}`),"L 72 28 Z"].join(" "),d=`spk${ba().replace(/[^a-zA-Z0-9_-]/g,"")}`;return Ae("svg",{width:72,height:28,viewBox:"0 0 72 28","aria-hidden":!0,style:{overflow:"visible",flexShrink:0},children:[ie("defs",{children:Ae("linearGradient",{id:d,x1:"0",y1:"0",x2:"0",y2:"1",children:[ie("stop",{offset:"0%",stopColor:r,stopOpacity:"0.18"}),ie("stop",{offset:"100%",stopColor:r,stopOpacity:"0"})]})}),ie("path",{d:c,fill:`url(#${d})`}),ie("path",{d:s,fill:"none",stroke:r,strokeWidth:"1.5",strokeLinejoin:"round",strokeLinecap:"round"})]})}import{Link as Ta}from"react-router-dom";import{Button as Sa,Card as ka,Flex as Nt,Text as Ft}from"@radix-ui/themes";import{ArrowRightIcon as Ra}from"@radix-ui/react-icons";import{jsx as De,jsxs as er}from"react/jsx-runtime";function Ia({href:e,icon:r,name:t,description:o}){return er(ka,{style:{height:"100%",display:"flex",flexDirection:"column"},children:[er(Nt,{direction:"column",gap:"3",p:"1",flexGrow:"1",children:[er(Nt,{align:"center",gap:"3",minWidth:"0",children:[De(P,{children:r}),De(Ft,{size:"4",weight:"medium",style:{color:"var(--gray-12)",fontFamily:"var(--font-poppins)"},truncate:!0,children:t})]}),De(Ft,{size:"2",style:{color:"var(--gray-11)",fontFamily:"var(--font-poppins)",lineHeight:1.5},children:o})]}),De(X,{pad:"var(--space-3)",radius:"var(--radius-4)",children:De(Sa,{size:"2",className:"btn-amber-primary",asChild:!0,children:er(Ta,{to:e,children:["Open",De(Ra,{style:h("--space-3")})]})})})]})}import{Text as He}from"@radix-ui/themes";import{jsx as Fr,jsxs as Lr}from"react/jsx-runtime";function Aa({tag:e,tagColor:r,msg:t,actor:o,timeAgo:n,timestamp:a,showBorder:i}){return Lr(Mr,{showBorder:i,style:{display:"flex",alignItems:"center",gap:"var(--space-3)",paddingBlock:"var(--space-2)",paddingInline:"var(--space-4)"},children:[Fr(He,{as:"span",size:"1",weight:"medium",className:"data-mono",style:{color:r,minWidth:"var(--space-6)",letterSpacing:"0.06em",flexShrink:0},children:e}),Lr(He,{as:"span",size:"2",style:{flex:1,color:"var(--gray-11)",lineHeight:1.4,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[t,o&&Lr(He,{as:"span",size:"1",style:{color:"var(--gray-11)",marginLeft:"var(--space-2)"},children:["by ",o]})]}),n&&Fr(He,{as:"span",size:"1",color:"gray",style:{whiteSpace:"nowrap",flexShrink:0},children:n}),Fr(He,{as:"span",size:"1",className:"data-mono",style:{color:"var(--gray-11)",whiteSpace:"nowrap",flexShrink:0,minWidth:"var(--space-7)",textAlign:"right"},children:a})]})}import{Button as Da,Card as Pa,Flex as Ea,Text as Ba}from"@radix-ui/themes";import{ExclamationTriangleIcon as Ma}from"@radix-ui/react-icons";import{jsx as Oe,jsxs as Na}from"react/jsx-runtime";function za({onRetry:e,message:r="Couldn't load your dashboard."}){return Oe(Pa,{children:Na(Ea,{direction:"column",align:"center",justify:"center",py:"9",gap:"3",children:[Oe(P,{children:Oe(Ma,{style:{...h("--space-5"),color:"var(--gray-7)"}})}),Oe(Ba,{size:"2",color:"gray",children:r}),Oe(Da,{size:"2",color:"amber",variant:"solid",className:"btn-amber-primary",onClick:e,children:"Retry"})]})})}import{useMemo as Fa}from"react";import{Button as La,Flex as Ha,IconButton as rr,Text as Oa}from"@radix-ui/themes";import{ChevronLeftIcon as _a,ChevronRightIcon as Va,DoubleArrowLeftIcon as Wa,DoubleArrowRightIcon as $a}from"@radix-ui/react-icons";import{jsx as Z,jsxs as ja}from"react/jsx-runtime";var Pe="\u2026";function Ua(e,r,t){let o=t*2+5;if(r<=o)return Array.from({length:r},(c,p)=>p+1);let n=Math.max(e-t,1),a=Math.min(e+t,r),i=n>2,l=a<r-1;if(!i&&l)return[...Array.from({length:3+t*2},(p,d)=>d+1),Pe,r];if(i&&!l){let c=3+t*2,p=Array.from({length:c},(d,g)=>r-c+g+1);return[1,Pe,...p]}let s=Array.from({length:a-n+1},(c,p)=>n+p);return[1,Pe,...s,Pe,r]}function Ga({currentPage:e,totalPages:r,onPageChange:t,siblingCount:o=1,showFirstLast:n=!1,size:a="2"}){let i=Fa(()=>Ua(e,r,o),[e,r,o]),l=e<=1,s=e>=r;return Z(Ha,{asChild:!0,align:"center",gap:"1",children:ja("nav",{"aria-label":"Pagination",children:[n&&Z(rr,{size:a,variant:"soft",color:"gray","aria-label":"First page",disabled:l,onClick:()=>t(1),children:Z(Wa,{})}),Z(rr,{size:a,variant:"soft",color:"gray","aria-label":"Previous page",disabled:l,onClick:()=>t(e-1),children:Z(_a,{})}),i.map((c,p)=>c===Pe?Z(Oa,{size:a,color:"gray","aria-hidden":!0,style:{paddingInline:"var(--space-1)"},children:Pe},`ellipsis-${p}`):Z(La,{size:a,"aria-label":`Page ${c}`,"aria-current":c===e?"page":void 0,variant:c===e?"solid":"soft",color:c===e?void 0:"gray",className:c===e?"btn-amber-primary":void 0,onClick:()=>c!==e&&t(c),children:c},c)),Z(rr,{size:a,variant:"soft",color:"gray","aria-label":"Next page",disabled:s,onClick:()=>t(e+1),children:Z(Va,{})}),n&&Z(rr,{size:a,variant:"soft",color:"gray","aria-label":"Last page",disabled:s,onClick:()=>t(r),children:Z($a,{})})]})})}var tr={admin:{label:"Admin",color:"amber"},operator:{label:"Operator",color:"blue"},user:{label:"Platform User",color:"gray"}},Ka={admin:tr.admin.label,operator:tr.operator.label,user:tr.user.label},Ya={active:{label:"Active",color:"var(--color-success)"},inactive:{label:"Inactive",color:"var(--gray-11)"},suspended:{label:"Suspended",color:"var(--color-danger)"}},qa={ok:"var(--green-9)",warn:"var(--orange-9)",error:"var(--red-9)"},Xa={auth:{tag:"AUTH",color:"var(--gray-11)"},sync:{tag:"SYNC",color:"var(--blue-11)"},role:{tag:"ROLE",color:"var(--violet-11)"},provision:{tag:"PROV",color:"var(--green-11)"},health:{tag:"HLTH",color:"var(--teal-11)"},error:{tag:"ERR!",color:"var(--red-11)"}},Lt={USER_UPDATED:{label:"User updated",tag:"UPD",badge:"amber",color:"var(--amber-11)"},USER_DISABLED:{label:"User disabled",tag:"DIS",badge:"red",color:"var(--red-11)"},USER_ENABLED:{label:"User enabled",tag:"ENA",badge:"green",color:"var(--teal-11)"},USER_APPROVED:{label:"User approved",tag:"APPR",badge:"green",color:"var(--green-11)"},USER_REJECTED:{label:"User rejected",tag:"REJ",badge:"red",color:"var(--red-11)"},SIGNUP_NOTIFICATIONS_ON:{label:"Signup notifications on",tag:"NOTF",badge:"gray",color:"var(--gray-11)"},SIGNUP_NOTIFICATIONS_OFF:{label:"Signup notifications off",tag:"NOTF",badge:"gray",color:"var(--gray-11)"},APPROVAL_EMAIL_RESENT:{label:"Approval email resent",tag:"MAIL",badge:"amber",color:"var(--amber-11)"},USER_DELETED:{label:"User deleted",tag:"DEL",badge:"yellow",color:"var(--red-11)"},ADMIN_GRANTED:{label:"Admin granted",tag:"ADMN",badge:"gray",color:"var(--violet-11)"},ADMIN_REVOKED:{label:"Admin revoked",tag:"ADMN",badge:"gray",color:"var(--orange-11)"},ADMIN_ROLE_CHANGED:{label:"Role changed",tag:"ROLE",badge:"amber",color:"var(--violet-11)"},SESSION_REVOKED:{label:"Session revoked",tag:"SESS",badge:"gray",color:"var(--gray-11)"},APP_GRANTED:{label:"App access granted",tag:"APP",badge:"green",color:"var(--green-11)"},APP_REVOKED:{label:"App access revoked",tag:"APP",badge:"red",color:"var(--orange-11)"}};function Za(e){return Lt[e]??{label:e,tag:e.slice(0,4).toUpperCase(),badge:"gray",color:"var(--gray-11)"}}import{jsx as Ht}from"react/jsx-runtime";function Hr(){return Ht("div",{className:"auth-art-card",children:Ht("img",{src:"/arm-logo-inverted.svg",alt:"araMetrics",style:{width:"56%",maxWidth:b.brandLogoMax,display:"block",userSelect:"none"},draggable:!1})})}import{jsx as or,jsxs as Ja}from"react/jsx-runtime";function Qa({children:e}){return Ja("div",{style:{minHeight:"100vh",display:"flex",background:"var(--surface-content)",padding:"var(--space-5)",gap:"var(--space-5)"},children:[or("div",{className:"auth-card-left",style:{width:"47%",flexShrink:0,position:"sticky",top:"var(--space-5)",height:"calc(100vh - var(--space-8))"},children:or(Hr,{})}),or("div",{className:"auth-card-right",style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",justifyContent:"center",minHeight:"calc(100vh - var(--space-8))",padding:"var(--space-7) var(--space-5)"},children:or("main",{style:{maxWidth:b.authFormMax,width:"100%",marginLeft:"auto",marginRight:"auto",background:"var(--color-panel-solid)",borderRadius:"var(--radius-5)",boxShadow:"var(--shadow-card)",padding:"var(--space-7) var(--space-5)"},children:e})})]})}import{jsx as ar,jsxs as en}from"react/jsx-runtime";function Or(){return en("svg",{width:18,height:18,viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:[ar("path",{d:"M15.68 8.18c0-.57-.05-1.11-.14-1.64H8v3.1h4.3a3.68 3.68 0 0 1-1.6 2.42v2h2.58c1.51-1.39 2.4-3.44 2.4-5.88Z",fill:"#4285F4"}),ar("path",{d:"M8 16c2.16 0 3.97-.71 5.3-1.94l-2.59-2a4.88 4.88 0 0 1-7.27-2.56H0.9v2.07A8 8 0 0 0 8 16Z",fill:"#34A853"}),ar("path",{d:"M3.44 9.5A4.8 4.8 0 0 1 3.19 8c0-.52.09-1.03.25-1.5V4.43H.9A8 8 0 0 0 0 8c0 1.29.31 2.51.9 3.57L3.44 9.5Z",fill:"#FBBC05"}),ar("path",{d:"M8 3.18c1.22 0 2.31.42 3.17 1.24l2.37-2.37A7.94 7.94 0 0 0 8 0 8 8 0 0 0 .9 4.43L3.44 6.5A4.77 4.77 0 0 1 8 3.18Z",fill:"#EA4335"})]})}import{jsx as nr,jsxs as rn}from"react/jsx-runtime";function _r(){return rn("svg",{width:18,height:18,viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:[nr("rect",{x:"0",y:"0",width:"7.6",height:"7.6",fill:"#F25022"}),nr("rect",{x:"8.4",y:"0",width:"7.6",height:"7.6",fill:"#7FBA00"}),nr("rect",{x:"0",y:"8.4",width:"7.6",height:"7.6",fill:"#00A4EF"}),nr("rect",{x:"8.4",y:"8.4",width:"7.6",height:"7.6",fill:"#FFB900"})]})}import{useRef as tn}from"react";import{TextField as on}from"@radix-ui/themes";import{jsx as Ot}from"react/jsx-runtime";function Vr({value:e,onChange:r,disabled:t}){let o=tn([]);function n(s,c){let p=c.target.value.replace(/\D/g,"").slice(-1),d=Array.from({length:4},(g,v)=>e[v]??"");d[s]=p,r(d.join("")),p&&s<3&&o.current[s+1]?.focus()}function a(s,c){let p=Array.from({length:4},(d,g)=>e[g]??"");c.key==="Backspace"?!p[s]&&s>0&&(p[s-1]="",r(p.join("")),o.current[s-1]?.focus()):c.key==="ArrowLeft"&&s>0?o.current[s-1]?.focus():c.key==="ArrowRight"&&s<3&&o.current[s+1]?.focus()}function i(s){let c=s.clipboardData.getData("text").replace(/\D/g,"").slice(0,4);c&&(s.preventDefault(),r(c),o.current[Math.min(c.length,3)]?.focus())}let l=Array.from({length:4},(s,c)=>e[c]??"");return Ot("div",{style:{display:"flex",gap:"var(--space-3)",justifyContent:"center"},children:l.map((s,c)=>Ot(on.Root,{ref:p=>{o.current[c]=p},type:"text",inputMode:"numeric",maxLength:1,value:s,onChange:p=>n(c,p),onKeyDown:p=>a(c,p),onPaste:i,disabled:t,className:"otp-box","aria-label":`Digit ${c+1}`,autoComplete:c===0?"one-time-code":"off"},c))})}import{Button as Wr,Callout as _e,Heading as an,Text as $r}from"@radix-ui/themes";import{ExclamationTriangleIcon as nn}from"@radix-ui/react-icons";import{Fragment as _t,jsx as U,jsxs as le}from"react/jsx-runtime";function sn({email:e,title:r,subtitle:t,code:o,onCodeChange:n,otpDevHint:a,error:i,errorAction:l,busy:s,otpExpiresAt:c,otpSecondsLeft:p,resendCooldown:d,onResend:g,onUseDifferentEmail:v}){return le(_t,{children:[le("div",{style:{marginBottom:"var(--space-6)",textAlign:"center"},children:[U(an,{as:"h1",size:L.h1,style:{color:"var(--ink-strong)",marginBottom:"var(--space-3)"},children:r}),le($r,{as:"p",size:"2",style:{color:"var(--ink-mid)",lineHeight:1.55},children:[t," ",U("span",{style:{fontWeight:600,color:"var(--ink-strong)"},children:e}),"."]})]}),a&&U(_e.Root,{color:"gray",variant:"surface",size:"1",style:{marginBottom:"var(--space-5)"},children:le(_e.Text,{style:{fontFamily:"var(--font-poppins)"},children:["Dev hint \u2014 code is ",U("strong",{children:a})]})}),i&&le(_e.Root,{color:"red",variant:"surface",size:"2",style:{marginBottom:"var(--space-5)"},children:[U(_e.Icon,{children:U(nn,{})}),le(_e.Text,{style:{fontFamily:"var(--font-poppins)"},children:[i,l&&le(_t,{children:[" ",U(Wr,{type:"button",variant:"ghost",size:"1",onClick:l.onClick,style:{fontWeight:600,textDecoration:"underline",height:"auto",padding:0},children:l.label})]})]})]}),le("div",{children:[U(Vr,{value:o,onChange:n,disabled:s||p<=0}),s?U($r,{as:"p",size:"1",style:{color:"var(--ink-mid)",marginTop:"var(--space-3)",textAlign:"center"},children:"Checking code\u2026"}):c&&p<=0?U($r,{as:"p",size:"1",style:{color:"var(--red-11)",marginTop:"var(--space-3)",textAlign:"center"},children:"Code expired \u2014 resend to get a new one."}):null]}),le("div",{style:{marginTop:"var(--space-5)",display:"flex",flexDirection:"column",alignItems:"center",gap:"var(--space-3)"},children:[U(Wr,{type:"button",variant:"ghost",size:"2",disabled:d>0||s,onClick:g,style:{fontWeight:500,color:d>0?"rgba(85, 85, 85, 0.4)":"var(--ink-strong)",textDecoration:d>0?"none":"underline"},children:d>0?`Resend email (${d}s)`:"Resend email"}),U(Wr,{type:"button",variant:"ghost",size:"2",className:"auth-underline-link",disabled:s,onClick:v,style:{fontWeight:500,color:"var(--ink-strong)"},children:"Use a Different Email"})]})]})}import{jsx as Vt}from"react/jsx-runtime";function H({provider:e}){return e==="microsoft"?Vt(_r,{}):Vt(Or,{})}var ln={google:"Google",microsoft:"Microsoft"};import{useState as Wt}from"react";import{Link as Xt,useLocation as cn}from"react-router-dom";import{Avatar as $t,Badge as Zt,DropdownMenu as ce,IconButton as Ut,Text as sr,Tooltip as Ve}from"@radix-ui/themes";import{ChevronLeftIcon as dn,ChevronRightIcon as Gt,Cross1Icon as pn,DotFilledIcon as gn,DotsVerticalIcon as un,ExitIcon as mn,GearIcon as jt,QuestionMarkCircledIcon as fn}from"@radix-ui/react-icons";import{Fragment as Ur,jsx as m,jsxs as D}from"react/jsx-runtime";var cr="var(--space-9)",lr=e=>e.badge?`${e.label} \xB7 ${e.badge}`:e.label,yn="calc(4 * var(--space-9))",vn="calc(var(--space-9) + var(--space-6))",hn="calc(4 * var(--space-9) + var(--space-5))",bn="var(--space-8)",Kt="var(--space-5)",Yt="var(--space-5)",xn="calc(var(--space-5) + var(--space-3))",Cn="var(--space-3)",wn=e=>e?"opacity 130ms ease 80ms":"opacity 90ms ease",qt="opacity 200ms ease";function Tn({collapsed:e,onToggle:r,onClose:t,items:o,utilityHrefs:n,user:a,onSignOut:i,hasCalendarAccounts:l=!1,brandLogoExpandedSrc:s="/expand.svg",brandLogoCollapsedSrc:c="/shrink.svg",helpHref:p,devRoles:d,onDevRoleSelect:g,showDevRoles:v=!1}){let f=cn().pathname,[x,w]=Wt(!1),[B,oe]=Wt(null),se=B===f,C=u=>oe(u?f:null),M=!!t,T=!e||M,ge=M?hn:e?vn:yn,y=o.filter(u=>!u.roles||a&&u.roles.includes(a.role)),z=new Set(n),V=y.filter(u=>!z.has(u.href)),W=y.find(u=>u.href==="/settings"),Y=y.filter(u=>z.has(u.href)&&u.href!=="/settings");function q(u){return u.root??u.href}function Re(u){let ae=q(u);return f===ae||f===u.href||f.startsWith(ae+"/")}let Bo=y.find(u=>u.children&&(q(u)!=="/calendar"||l)&&Re(u)),Fe=se?void 0:Bo;function Tr(u,ae){return u==="/home"||ae?f===u:f===u||f.startsWith(u+"/")}let Mo=f.startsWith("/admin")&&(a?.role==="admin"||a?.role==="operator"),ft=a?.name?.split(" ").map(u=>u[0]).join("").slice(0,2)||"?";return D("aside",{style:{position:"relative",width:ge,height:"100%",minHeight:"100vh",background:"var(--shell-surface)",borderRight:"1px solid var(--gray-6)",flexShrink:0,transition:M?"none":"width 200ms ease",zIndex:2},children:[D("div",{style:{width:"100%",height:"100%",minHeight:"100vh",display:"flex",flexDirection:"column",overflow:"hidden"},children:[D("div",{style:{height:cr,flexShrink:0,position:"relative",overflow:"hidden",borderBottom:"1px solid var(--border-hairline)"},children:[m("img",{src:s,alt:"",height:40,style:{display:"block",position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",transition:qt,opacity:T?1:0,pointerEvents:"none",userSelect:"none"}}),m("img",{src:c,alt:"",height:40,style:{display:"block",position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",transition:qt,opacity:T?0:1,pointerEvents:"none",userSelect:"none"}}),M&&m(Ut,{variant:"ghost",color:"gray",size:"1",onClick:t,"aria-label":"Close menu",style:{position:"absolute",right:"var(--space-2)",top:"50%",transform:"translateY(-50%)"},children:m(pn,{style:h("--space-3")})})]}),m("nav",{"aria-label":"Main navigation",style:{flex:1,overflowY:"auto",overflowX:"hidden",paddingTop:"var(--space-5)",display:"flex",flexDirection:"column"},children:Fe?D(Ur,{children:[(()=>{let u=m(ir,{item:{label:Fe.label,href:"#",Icon:dn},active:!1,expanded:T,asButton:!0,onClick:()=>C(!0)});return T?u:m(Ve,{content:Fe.label,side:"right",delayDuration:300,children:u})})(),Fe.children.map(u=>{let ae=Tr(u.href,u.end),ue=m(ir,{item:u,active:ae,expanded:T},u.href);return T?ue:m(Ve,{content:lr(u),side:"right",delayDuration:300,children:ue},u.href)})]}):V.map(u=>{let ae=Tr(q(u)),ue=!!u.children&&(q(u)!=="/calendar"||l),yt=m(ir,{item:u,active:ae,expanded:T,showChevron:ue,onClick:ue?()=>C(!1):void 0},u.href);return T?yt:m(Ve,{content:lr(u),side:"right",delayDuration:300,children:yt},u.href)})}),!Fe&&Y.length>0&&m("nav",{"aria-label":"Utility navigation",style:{flexShrink:0,borderTop:"1px solid var(--gray-4)",paddingTop:"var(--space-2)",paddingBottom:"var(--space-2)",display:"flex",flexDirection:"column"},children:Y.map(u=>{let ae=Tr(u.href),ue=m(ir,{item:u,active:ae,expanded:T,showChevron:!!u.children,onClick:u.children?()=>C(!1):void 0},u.href);return T?ue:m(Ve,{content:lr(u),side:"right",delayDuration:300,children:ue},u.href)})}),D("div",{style:{borderTop:Y.length>0?"none":"1px solid var(--gray-4)",padding:T?"var(--space-2) var(--space-4)":"var(--space-2) 0",flexShrink:0,display:"flex",flexDirection:"column",gap:"var(--space-2)"},children:[T&&Mo&&D(Zt,{color:"gray",variant:"soft",highContrast:!0,size:"1",radius:"full",style:{alignSelf:"flex-start"},children:[m(gn,{style:h("--space-2")}),"Administering platform"]}),D("div",{style:{display:"flex",flexDirection:T?"row":"column",alignItems:"center",justifyContent:T?"space-between":"center",gap:"var(--space-2)"},children:[T?D("div",{className:"shell-profile-chip",style:{display:"flex",alignItems:"center",gap:"var(--space-2)",minWidth:0,flex:1,padding:"var(--space-1)",borderRadius:"var(--radius-3)"},children:[m($t,{size:"2",radius:"full",src:a?.avatarSrc,fallback:ft,color:"gray",variant:"soft",style:{flexShrink:0}}),m(sr,{as:"p",size:"2",weight:"medium",truncate:!0,style:{color:"var(--shell-ink-strong)"},children:a?.name})]}):m(Ve,{content:a?.name??"Account",side:"right",delayDuration:300,children:m($t,{size:"3",radius:"full",src:a?.avatarSrc,fallback:ft,color:"gray",variant:"soft"})}),D(ce.Root,{children:[m(ce.Trigger,{children:m(Ut,{variant:"ghost",color:"gray","aria-label":"Account menu",className:"sidebar-icon-btn",style:{flexShrink:0},children:m(un,{style:h("--space-4")})})}),D(ce.Content,{align:T?"end":"start",side:T?"top":"right",style:{minWidth:200},children:[W&&m(ce.Item,{asChild:!0,children:D(Xt,{to:W.href,onClick:()=>C(!1),children:[m(jt,{}),"Settings"]})}),p&&D(ce.Item,{onClick:()=>window.open(p,"_blank","noopener,noreferrer"),children:[m(fn,{}),"Help"]}),m(ce.Separator,{}),D(ce.Item,{color:"red",onClick:()=>w(!0),children:[m(mn,{}),"Log Out"]}),v&&d&&d.length>0&&D(Ur,{children:[m(ce.Separator,{}),m("div",{style:{padding:"var(--space-1) var(--space-3)"},children:m(sr,{size:"1",style:{fontFamily:"monospace",color:"var(--gray-11)",letterSpacing:"0.04em",textTransform:"uppercase"},children:"Dev \xB7 switch role"})}),d.map(u=>D(ce.Item,{onClick:()=>g?.(u.email),disabled:a?.role===u.role,children:[m(jt,{}),u.label,D(sr,{size:"1",color:"gray",style:{marginLeft:"auto"},children:[u.role,"@"]})]},u.role))]})]})]})]})]})]}),!M&&m("button",{onClick:r,"aria-label":e?"Expand sidebar":"Collapse sidebar",className:"sidebar-collapse-btn",style:{top:"calc(var(--space-9) / 2)",transform:"translateY(-50%)",right:"calc(-1 * var(--space-3))"},children:m(Sn,{flipped:e})}),m(Rr,{open:x,onOpenChange:w,title:"Confirm Logout",description:"Are you sure you want to log out?",onConfirm:i})]})}function ir({item:e,active:r,expanded:t,onClick:o,asButton:n,showChevron:a}){let i={position:"relative",textDecoration:"none",display:"flex",alignItems:"center",height:bn,flexShrink:0,paddingLeft:xn,paddingRight:t?`calc(${Yt} + var(--space-1))`:0,gap:t?Cn:0,color:r?"var(--shell-ink-strong)":"var(--shell-ink-mid)",cursor:"pointer"},l=D(Ur,{children:[r&&m("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:0,width:"var(--space-1)",height:"100%",background:"var(--accent-9)",borderRadius:"0 var(--radius-1) var(--radius-1) 0"}}),m("span",{"aria-hidden":"true",className:"nav-pill",style:{position:"absolute",top:0,bottom:0,left:Kt,right:t?Yt:Kt,borderRadius:"var(--radius-3)",background:r?"var(--accent-9)":"transparent",transition:"background 80ms ease"}}),m(e.Icon,{width:20,height:20,style:{position:"relative",flexShrink:0}}),D("span",{style:{position:"relative",display:"flex",alignItems:"center",gap:"var(--space-1)",minWidth:0,overflow:"hidden",maxWidth:t?void 0:0,opacity:t?1:0,transition:wn(t)},children:[m(sr,{as:"span",size:"3",weight:r?"medium":"regular",style:{lineHeight:1.3,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",minWidth:0},children:e.label}),e.badge&&m(Zt,{color:"gray",variant:r?"solid":"soft",highContrast:r,size:"1",radius:"full",style:{flexShrink:0,paddingInline:"var(--space-1)"},children:e.badge})]}),a&&t&&(r?m("span",{style:{position:"relative",marginLeft:"auto",marginRight:"var(--space-1)",flexShrink:0,display:"inline-flex",alignItems:"center",justifyContent:"center",width:"var(--space-5)",height:"var(--space-5)",background:"var(--color-panel-solid)",borderRadius:"var(--radius-2)",boxShadow:"0 1px 2px rgba(0,0,0,0.12)"},children:m(Gt,{style:{...h("--space-4"),color:"var(--gray-11)"}})}):m(Gt,{style:{...h("--space-4"),position:"relative",marginLeft:"auto",color:"var(--shell-ink-mid)",flexShrink:0}}))]});return n?m("button",{type:"button",onClick:o,className:"shell-nav-item",style:{...i,background:"none",border:"none",width:"100%",textAlign:"left",font:"inherit"},children:l}):m(Xt,{to:e.href,onClick:o,className:"shell-nav-item","data-active":r?"true":void 0,"aria-current":r?"page":void 0,title:t?lr(e):void 0,style:i,children:l})}function Sn({flipped:e}){return D("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",style:{transform:e?"scaleX(-1)":void 0},children:[m("rect",{x:"1.5",y:"2.5",width:"13",height:"11",rx:"1.5",stroke:"currentColor"}),m("path",{d:"M5.5 2.5v11",stroke:"currentColor"}),m("path",{d:"M11 5.5 8.5 8l2.5 2.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})]})}import{Link as kn,useLocation as Rn}from"react-router-dom";import{HamburgerMenuIcon as In,MagnifyingGlassIcon as An,BellIcon as Dn}from"@radix-ui/react-icons";import{Flex as Pn,Heading as En,IconButton as Bn,Text as Qt,Tooltip as Mn}from"@radix-ui/themes";import{Fragment as Hn,jsx as O,jsxs as dr}from"react/jsx-runtime";var zn=[["/home","Home","/home","Home"],["/calendar/syncs","Calendar","/calendar/syncs","Manage Syncs"],["/calendar/view","Calendar","/calendar/syncs","My Calendar"],["/calendar","Calendar","/calendar/syncs","Manage Syncs"],["/settings/account","Settings","/settings/account","Account"],["/settings/linked","Settings","/settings/account","Linked Account"],["/settings","Settings","/settings/account","Settings"]],Nn=[["/admin/overview","Overview"],["/admin/users","Users"],["/admin/monitoring","Monitoring"],["/admin/calendar-ops","Calendar Ops"],["/admin/logs","Logs"],["/admin/security","Security"],["/admin/audit","Audit Log"]];function Fn(e,r,t){if(e==="/admin"||e.startsWith("/admin/")){let l=t.find(([s])=>e===s||e.startsWith(s+"/"));return{section:"Admin Portal",sectionHref:"/admin/overview",page:l?l[1]:"Admin Portal"}}if(e==="/calendar/syncs/new")return{section:"Calendar",sectionHref:"/calendar/syncs",page:"New Sync"};if(/^\/calendar\/syncs\/[^/]+$/.test(e))return{section:"Calendar",sectionHref:"/calendar/syncs",page:"Edit Sync"};let o=r.find(([l,,,,s])=>s?e===l:e===l||e.startsWith(l+"/"));if(!o)return{section:"Home",sectionHref:"/home",page:"Home"};let[,n,a,i]=o;return{section:n,sectionHref:a,page:i}}function Ln({onSearchOpen:e,onMenuOpen:r,showMenu:t,titles:o=zn,adminTitles:n=Nn}){let a=Rn().pathname;return dr("header",{style:{height:cr,background:"var(--accent-9)",borderBottom:"1px solid var(--border-hairline)",flexShrink:0,display:"flex",alignItems:"center",padding:"0 var(--space-6)",gap:"var(--space-4)"},children:[t&&O(Bn,{variant:"ghost",size:"1",onClick:r,"aria-label":"Open navigation",style:{marginRight:"var(--space-1)",color:"var(--shell-ink-strong)"},children:O(In,{style:h("--space-4")})}),(()=>{let{section:i,sectionHref:l,page:s}=Fn(a,o,n);return dr(Pn,{align:"baseline",gap:"2",style:{minWidth:0,overflow:"hidden"},children:[i!==s&&dr(Hn,{children:[O(Qt,{asChild:!0,size:"3",weight:"regular",children:O(kn,{to:l,style:{color:"var(--shell-ink-mid)",whiteSpace:"nowrap",textDecoration:"none",overflow:"hidden",textOverflow:"ellipsis",flexShrink:0},className:"topbar-breadcrumb-link",children:i})}),O(Qt,{size:"3",weight:"regular",className:"topbar-breadcrumb-sep",style:{color:"var(--shell-ink-mid)",flexShrink:0},children:"/"})]}),O(En,{as:"h1",size:L.h1,weight:"medium",style:{color:"var(--shell-ink-strong)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",minWidth:0},children:s})]})})(),O("div",{style:{flex:1}}),dr("button",{className:"topbar-search",onClick:e,"aria-label":"Search (\u2318K)",children:[O(An,{width:16,height:16,style:{color:"var(--shell-ink-strong)",flexShrink:0}}),O("span",{className:"topbar-search-placeholder",children:"Search for something"})]}),O(Mn,{content:"Coming soon",children:O("span",{children:O("button",{className:"topbar-icon-circle","aria-label":"Notifications (coming soon)",disabled:!0,children:O(Dn,{style:h("--space-4")})})})})]})}import{useEffect as Jt,useRef as eo,useState as Gr}from"react";import{Dialog as jr,Flex as ro,Spinner as On,Text as Q,TextField as _n,VisuallyHidden as Vn}from"@radix-ui/themes";import{CalendarIcon as Wn,MagnifyingGlassIcon as $n,PersonIcon as Un,ReaderIcon as Gn}from"@radix-ui/react-icons";import{Fragment as Zn,jsx as S,jsxs as G}from"react/jsx-runtime";var jn={app:Wn,people:Un,page:Gn},Kn={app:"Apps",people:"People",page:"Pages"};function Yn(e){let r=["app","people","page"],t=[],o=0;for(let n of r){let a=e.filter(i=>i.type===n);a.length>0&&(t.push({type:n,label:Kn[n],items:a,startIdx:o}),o+=a.length)}return t}function qn({open:e,onClose:r,results:t,onSelectResult:o,title:n="Search",placeholder:a="Search\u2026"}){return S(jr.Root,{open:e,onOpenChange:i=>!i&&r(),children:S(jr.Content,{"aria-describedby":void 0,style:{padding:0,maxWidth:"calc(9 * var(--space-9) + var(--space-2))",overflow:"hidden",boxShadow:"0 4px 8px rgba(0,0,0,0.06), 0 12px 32px rgba(0,0,0,0.10), 0 0 0 1px var(--gray-5)"},children:S(Xn,{onClose:r,resultPool:t,onSelectResult:o,title:n,placeholder:a})})})}function Xn({onClose:e,resultPool:r,onSelectResult:t,title:o,placeholder:n}){let[a,i]=Gr(""),[l,s]=Gr(null),[c,p]=Gr(-1),d=eo(null),g=eo(null),v=!!l&&l.q===a,f=v?l.items:[],x=a.trim()?v?f.length?"results":"no-match":"searching":"prompt";Jt(()=>{if(!a.trim())return;let C=setTimeout(()=>{let M=a.toLowerCase(),T=r.filter(ge=>ge.title.toLowerCase().includes(M)||ge.subtitle.toLowerCase().includes(M));s({q:a,items:T}),p(-1)},320);return()=>clearTimeout(C)},[a,r]),Jt(()=>{if(c<0||!g.current)return;g.current.querySelector(`[data-idx="${c}"]`)?.scrollIntoView({block:"nearest"})},[c]);function w(C){C.key==="Escape"?e():C.key==="ArrowDown"?(C.preventDefault(),p(M=>Math.min(M+1,f.length-1))):C.key==="ArrowUp"?(C.preventDefault(),p(M=>Math.max(M-1,0))):C.key==="Enter"&&(C.preventDefault(),c>=0&&f[c]&&(t(f[c]),e()))}function B(C){t(C),e()}let oe=Yn(f),se="calc(2 * var(--space-9) + var(--space-6))";return G(Zn,{children:[S(Vn,{children:S(jr.Title,{children:o})}),G("div",{style:{display:"flex",alignItems:"center",gap:"var(--space-3)",padding:"var(--space-3) var(--space-4)",borderBottom:"1px solid var(--gray-5)"},children:[x==="searching"?S(On,{size:"1",style:{flexShrink:0}}):S($n,{width:16,height:16,style:{color:"var(--gray-9)",flexShrink:0}}),S(_n.Root,{ref:d,autoFocus:!0,type:"text",placeholder:n,value:a,onChange:C=>i(C.target.value),onKeyDown:w,className:"search-overlay-input",style:{flex:1,border:"none",outline:"none",background:"transparent",boxShadow:"none","--text-field-selection-color":"unset"}}),S("kbd",{style:{color:"var(--gray-11)",background:"var(--gray-3)",border:"1px solid var(--gray-5)",borderRadius:"var(--radius-1)",padding:"var(--space-1) var(--space-2)",flexShrink:0},children:S(Q,{size:"1",as:"span",children:"Esc"})})]}),G("div",{ref:g,style:{minHeight:se,maxHeight:"calc(6 * var(--space-9) + var(--space-7))",overflowY:"auto"},children:[x==="prompt"&&S(ro,{align:"center",justify:"center",style:{height:se},children:S(Q,{size:"2",color:"gray",children:"Type to search\u2026"})}),x==="no-match"&&S(ro,{align:"center",justify:"center",style:{height:se},children:G("div",{style:{textAlign:"center"},children:[G(Q,{size:"2",color:"gray",as:"p",children:["No results for \u201C",a,"\u201D"]}),S(Q,{size:"1",color:"gray",as:"p",mt:"1",children:"Try searching with different keywords"})]})}),x==="results"&&S("div",{style:{padding:"var(--space-2)"},children:oe.map(C=>{let M=jn[C.type];return G("div",{style:{marginBottom:"var(--space-1)"},children:[S("div",{style:{padding:"var(--space-2) var(--space-3) var(--space-1)",display:"flex",alignItems:"center",gap:"var(--space-2)"},children:S(Q,{size:"1",style:{color:"var(--gray-11)",fontWeight:500,letterSpacing:"0.04em",textTransform:"uppercase",fontFamily:"var(--font-poppins)"},children:C.label})}),C.items.map((T,ge)=>{let y=C.startIdx+ge,z=c===y;return G("button",{"data-idx":y,onClick:()=>B(T),onMouseEnter:()=>p(y),className:"search-result-item",style:{width:"100%",display:"flex",alignItems:"center",gap:"var(--space-3)",padding:"var(--space-2) var(--space-3)",borderRadius:"var(--radius-2)",border:"none",cursor:"pointer",textAlign:"left",background:z?"var(--gray-3)":"transparent"},children:[S("div",{style:{width:"var(--space-6)",height:"var(--space-6)",borderRadius:"var(--radius-1)",background:z?"var(--accent-a3)":"var(--gray-3)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:"background 100ms ease"},children:S(M,{width:12,height:12,style:{color:z?"var(--accent-11)":"var(--gray-9)"}})}),G("div",{style:{flex:1,minWidth:0},children:[S(Q,{as:"p",size:"2",weight:"medium",style:{color:z?"var(--gray-12)":"var(--gray-11)",lineHeight:1.3,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:T.title}),S(Q,{as:"p",size:"1",style:{color:"var(--gray-11)",lineHeight:1.3,marginTop:"1px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:T.subtitle})]}),z&&S("kbd",{style:{color:"var(--gray-9)",background:"var(--gray-4)",border:"1px solid var(--gray-5)",borderRadius:"var(--radius-1)",padding:"var(--space-1)",flexShrink:0},children:S(Q,{size:"1",as:"span",className:"data-mono",children:"\u21B5"})})]},T.id)})]},C.type)})})]}),x!=="prompt"&&G("div",{style:{borderTop:"1px solid var(--gray-4)",padding:"var(--space-2) var(--space-4)",display:"flex",gap:"var(--space-4)"},children:[G(Q,{as:"span",size:"1",color:"gray",children:[S("kbd",{className:"data-mono",children:"\u2191\u2193"})," navigate"]}),G(Q,{as:"span",size:"1",color:"gray",children:[S("kbd",{className:"data-mono",children:"\u21B5"})," open"]}),G(Q,{as:"span",size:"1",color:"gray",children:[S("kbd",{className:"data-mono",children:"Esc"})," close"]})]})]})}function j(e,r){for(let t of e){let o=t.calendars.find(n=>n.id===r);if(o)return{account:t,calendar:o}}}import Kr from"dayjs";import{Flex as to,Text as oo}from"@radix-ui/themes";import{jsx as Yr,jsxs as Qn}from"react/jsx-runtime";function qr({date:e,today:r=new Date}){let t=Kr(e).isSame(r,"day");return Qn(to,{direction:"column",align:"center",gap:"1",py:"1",children:[Yr(oo,{size:"1",weight:"medium",color:"gray",style:{letterSpacing:"0.04em"},children:Kr(e).format("ddd").toUpperCase()}),Yr(to,{align:"center",justify:"center",style:{width:"var(--space-6)",height:"var(--space-6)",borderRadius:"50%",background:t?"var(--accent-9)":"transparent",lineHeight:1},children:Yr(oo,{size:"3",weight:t?"medium":"regular",style:{color:t?"var(--accent-contrast)":"var(--gray-12)",lineHeight:1},children:Kr(e).format("D")})})]})}import{Box as We,Checkbox as Jn,Flex as ei,RadioGroup as ao,Text as $e}from"@radix-ui/themes";import{jsx as E,jsxs as io}from"react/jsx-runtime";function ri(e){return e.flatMap(r=>r.calendars.map(t=>({calendarId:t.id,calendarName:t.name,email:r.email,provider:r.provider})))}function ti({provider:e}){return E("span",{"aria-hidden":!0,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"var(--space-5)",height:"var(--space-5)",flexShrink:0},children:E(H,{provider:e})})}function no({row:e,control:r,selected:t,disabled:o,disabledLabel:n}){return io($e,{as:"label",size:"2",style:{display:"flex",alignItems:"center",gap:"var(--space-3)",width:"100%",paddingBlock:"var(--space-3)",paddingInline:"var(--space-4)",cursor:o?"not-allowed":"pointer",opacity:o?.45:1,background:t?"var(--accent-2)":"transparent",color:"var(--gray-12)"},children:[E(ti,{provider:e.provider}),io(ei,{direction:"column",gap:"0",style:{minWidth:0,flex:1},children:[E($e,{size:"2",weight:"medium",truncate:!0,style:{color:"var(--gray-12)"},children:e.calendarName}),E($e,{size:"1",color:"gray",truncate:!0,children:e.email})]}),n?E($e,{size:"1",color:"gray",style:{flexShrink:0},children:n}):null,E(We,{style:{flexShrink:0,display:"flex",alignItems:"center"},children:r})]})}function oi({accounts:e,mode:r,sourceCalendarIds:t,targetCalendarId:o,takenSourceIds:n,onToggleSource:a,onSelectTarget:i,fill:l=!1}){let s=ri(e),p=r==="sources"&&s.length>0&&s.every(d=>d.calendarId===o||n.has(d.calendarId))?E(We,{style:{border:"1px solid var(--gray-5)",borderRadius:"var(--radius-3)",background:"var(--color-panel-solid)",padding:"var(--space-4)",...l?{flex:1,minHeight:0}:{}},children:E($e,{as:"p",size:"2",color:"gray",align:"center",children:"All your calendars are already used as sources in other syncs, or set as this sync's target. Remove a calendar from another sync to make it available here."})}):E(We,{style:{border:"1px solid var(--gray-5)",borderRadius:"var(--radius-3)",background:"var(--color-panel-solid)",...l?{flex:1,minHeight:0,overflowY:"auto"}:{overflow:"hidden"}},children:s.map((d,g)=>{if(r==="sources"){let x=d.calendarId===o,w=n.has(d.calendarId),B=x||w,oe=t.includes(d.calendarId);return E(We,{style:{borderTop:g>0?"1px solid var(--gray-4)":void 0},children:E(no,{row:d,selected:oe,disabled:B,disabledLabel:x?"Target":w?"In use":void 0,control:E(Jn,{checked:oe,disabled:B,onCheckedChange:()=>{B||a(d.calendarId)}})})},d.calendarId)}let v=t.includes(d.calendarId),f=d.calendarId===o;return E(We,{style:{borderTop:g>0?"1px solid var(--gray-4)":void 0},children:E(no,{row:d,selected:f,disabled:v,disabledLabel:v?"Source":void 0,control:E(ao.Item,{value:d.calendarId,disabled:v})})},d.calendarId)})});return r==="target"?E(ao.Root,{value:o??"",onValueChange:d=>{d&&i(d)},style:l?{flex:1,minHeight:0,display:"flex",flexDirection:"column"}:void 0,children:p}):p}import{Button as so,Flex as Xr,Heading as ai,IconButton as lo}from"@radix-ui/themes";import{ChevronLeftIcon as ni,ChevronRightIcon as ii}from"@radix-ui/react-icons";import{Navigate as Zr}from"react-big-calendar";import{jsx as me,jsxs as co}from"react/jsx-runtime";function Qr({label:e,view:r,onNavigate:t,onView:o}){return co(Xr,{align:"center",justify:"between",gap:"3",wrap:"wrap",className:"calendar-toolbar",children:[co(Xr,{align:"center",gap:"2",children:[me(lo,{size:"2",variant:"soft",color:"gray",radius:"full","aria-label":"Previous",onClick:()=>t(Zr.PREVIOUS),children:me(ni,{})}),me(so,{size:"2",variant:"soft",color:"gray",onClick:()=>t(Zr.TODAY),children:"Today"}),me(lo,{size:"2",variant:"soft",color:"gray",radius:"full","aria-label":"Next",onClick:()=>t(Zr.NEXT),children:me(ii,{})})]}),me(ai,{as:"h2",size:L.h2,weight:"medium",style:{color:"var(--gray-12)"},children:e}),me(Xr,{gap:"1",style:{border:"1px solid var(--gray-5)",borderRadius:"var(--radius-3)",padding:"var(--space-1)",background:"var(--gray-2)"},children:["week","month"].map(n=>me(so,{size:"2",variant:r===n?"solid":"soft",className:r===n?"btn-amber-primary":void 0,color:r===n?void 0:"gray",onClick:()=>o(n),style:r===n?void 0:{background:"transparent"},children:n==="week"?"Week":"Month"},n))})]})}import{Button as si,Flex as pr,Spinner as li,Text as Jr}from"@radix-ui/themes";import{ChevronRightIcon as ci,ExclamationTriangleIcon as di}from"@radix-ui/react-icons";import{jsx as J,jsxs as Ue}from"react/jsx-runtime";var Ee={google:{label:"Google Calendar",description:"Connect a Google account calendar"},microsoft:{label:"Outlook Calendar",description:"Connect an Outlook account calendar"}},pi=["google","microsoft"];function et({connectingProvider:e,failedProvider:r,exhausted:t=!1,onConnect:o}){return J(pr,{direction:"column",gap:"3",style:{width:"100%",textAlign:"left"},children:pi.map(n=>{let a=Ee[n],i=e===n;return Ue("div",{children:[Ue("button",{type:"button",className:"provider-choice",onClick:()=>o(n),disabled:e!==null,"data-connecting":i?"true":void 0,"aria-busy":i||void 0,"aria-label":`Connect ${a.label}`,children:[J(P,{children:J(H,{provider:n})}),Ue(pr,{direction:"column",className:"provider-choice__copy",gap:"1",children:[J(Jr,{size:"3",weight:"medium",truncate:!0,style:{color:"var(--gray-12)"},children:a.label}),J(Jr,{size:"2",color:"gray",truncate:!0,children:a.description})]}),J("span",{className:"provider-choice__chevron","aria-hidden":!0,children:i?J(li,{size:"2"}):J(ci,{style:h("--space-5")})})]}),r===n&&Ue(pr,{align:"center",justify:"between",gap:"3",mt:"2",px:"1",children:[Ue(pr,{align:"center",gap:"2",children:[J(di,{style:{...h("--space-4"),color:"var(--red-9)",flexShrink:0}}),J(Jr,{size:"2",style:{color:"var(--red-11)"},children:t?`No more ${a.label} accounts available to connect.`:`Couldn't connect ${a.label}. Please try again.`})]}),!t&&J(si,{variant:"ghost",size:"1",onClick:()=>o(n),children:"Retry"})]})]},n)})})}import{Badge as po,Box as gi,DropdownMenu as Ge,Flex as go,IconButton as ui,Text as uo}from"@radix-ui/themes";import{DotsVerticalIcon as mi,ReloadIcon as fi,TrashIcon as yi}from"@radix-ui/react-icons";import{jsx as K,jsxs as xe}from"react/jsx-runtime";function vi({account:e,onRemove:r,onReconnect:t,onClick:o}){let n=e.authStatus==="reauth",a=e.authStatus==="failed",i=K(uo,{size:"2",weight:"medium",truncate:!0,style:{color:"var(--gray-12)"},children:e.displayName});return xe(gi,{onClick:o,style:{width:"100%",minWidth:0,height:b.connectedAccountCardH,boxSizing:"border-box",padding:"var(--space-3)",background:"var(--color-panel-solid)",border:"1px solid var(--gray-5)",borderRadius:"var(--radius-3)",display:"flex",alignItems:"center",gap:"var(--space-3)",cursor:o?"pointer":void 0},children:[K(P,{size:"var(--space-6)",children:K(H,{provider:e.provider})}),xe(go,{direction:"column",style:{flex:1,minWidth:0},children:[xe(go,{align:"center",gap:"2",style:{minWidth:0},children:[o?K("button",{type:"button",className:"card-title-button",onClick:l=>{l.stopPropagation(),o()},children:i}):i,n&&K(po,{color:"amber",variant:"soft",size:"1",radius:"full",style:{flexShrink:0},children:"Needs reconnect"}),a&&K(po,{color:"red",variant:"soft",size:"1",radius:"full",style:{flexShrink:0},children:"Connection failed"})]}),K(uo,{size:"1",color:"gray",truncate:!0,children:e.email})]}),xe(Ge.Root,{children:[K(Ge.Trigger,{children:K(ui,{variant:"ghost",color:"gray",size:"1","aria-label":`${e.displayName} actions`,onClick:l=>l.stopPropagation(),children:K(mi,{})})}),xe(Ge.Content,{align:"end",onClick:l=>l.stopPropagation(),children:[(n||a)&&t&&xe(Ge.Item,{onSelect:t,children:[K(fi,{})," Reconnect"]}),xe(Ge.Item,{color:"red",onSelect:r,children:[K(yi,{})," Remove account"]})]})]})]})}import{Flex as hi,Text as bi,Heading as xi}from"@radix-ui/themes";import{jsx as rt,jsxs as wi}from"react/jsx-runtime";function Ci({icon:e,title:r,description:t,action:o,headingAs:n="h2"}){return wi(hi,{direction:"column",align:"center",gap:"3",style:{width:"100%",paddingTop:"var(--space-9)",textAlign:"center"},children:[rt(P,{size:"var(--space-8)",children:e}),rt(xi,{as:n,size:L[n],weight:"medium",align:"center",children:r}),t&&rt(bi,{size:"2",color:"gray",align:"center",style:{maxWidth:b.emptyStateCopyMax},children:t}),o]})}import{useState as Ti}from"react";import{Dialog as je,Flex as Si,Text as gr,Checkbox as ki,Button as mo}from"@radix-ui/themes";import{Fragment as Ii,jsx as _,jsxs as tt}from"react/jsx-runtime";function Ce({account:e,onOpenChange:r,onImport:t,initiallySelectedIds:o,disabledIds:n,disabledReason:a,title:i="Calendars",description:l="Choose which calendars you want to import.",confirmLabel:s="Import Calendars"}){let c=e?`${e.id}:${(o??e.calendars.map(p=>p.id)).join(",")}`:"closed";return _(je.Root,{open:!!e,onOpenChange:r,children:_(je.Content,{maxWidth:b.dialogMd,onInteractOutside:p=>p.preventDefault(),children:e&&_(Ri,{account:e,initiallySelectedIds:o,disabledIds:n,disabledReason:a,title:i,description:l,confirmLabel:s,onImport:t},c)})})}function Ri({account:e,initiallySelectedIds:r,disabledIds:t,disabledReason:o,title:n,description:a,confirmLabel:i,onImport:l}){let[s,c]=Ti(()=>new Set(r??e.calendars.map(g=>g.id))),p=new Set(t??[]);function d(g){p.has(g)||c(v=>{let f=new Set(v);return f.has(g)?f.delete(g):f.add(g),f})}return tt(Ii,{children:[_(je.Title,{size:"5",weight:"medium",mb:"1",children:n}),_(je.Description,{size:"2",color:"gray",mb:"2",children:a}),_(gr,{as:"p",size:"2",weight:"medium",mb:"5",style:{color:"var(--gray-12)"},children:e.email}),_(Si,{direction:"column",gap:"3",mb:"5",children:e.calendars.map(g=>{let v=s.has(g.id),f=p.has(g.id);return tt(gr,{as:"label",size:"3",className:"calendar-picker-row","data-selected":v||void 0,"data-disabled":f?"true":void 0,style:{display:"flex",alignItems:"center",gap:"var(--space-3)",padding:"var(--space-4)",cursor:f?"default":"pointer"},children:[_(ki,{checked:v,disabled:f,onCheckedChange:()=>d(g.id)}),_(gr,{weight:"medium",truncate:!0,style:{flex:1,minWidth:0,color:"var(--gray-12)"},children:g.name}),f&&o&&_(gr,{size:"1",color:"gray",style:{flexShrink:0},children:o})]},g.id)})}),tt(X,{justify:"between",noTopMargin:!0,pad:"var(--space-5)",radius:"var(--radius-4)",children:[_(je.Close,{children:_(mo,{size:"2",variant:"outline",color:"gray",children:"Cancel"})}),_(mo,{size:"2",className:"btn-amber-primary",disabled:s.size===0,onClick:()=>l(Array.from(s)),children:i})]})]})}import{Box as Ke,Flex as Ai,Text as ee}from"@radix-ui/themes";import{jsx as N,jsxs as ur}from"react/jsx-runtime";function Di(e){let r=/^#?([0-9a-f]{6})$/i.exec(e.trim());if(!r)return"white";let t=parseInt(r[1],16),o=a=>{let i=a/255;return i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4)};return .2126*o(t>>16&255)+.7152*o(t>>8&255)+.0722*o(t&255)>.45?"black":"white"}function fo({tone:e,title:r,meta:t,accentColor:o}){let n=e==="synced"?o||"var(--accent-9)":"var(--blue-11)",a=e==="synced"?o?Di(o):"var(--accent-contrast)":"white";return ur(Ke,{style:{background:n,borderRadius:"var(--radius-2)",padding:"var(--space-2) var(--space-3)"},children:[N(ee,{as:"p",size:"2",weight:"medium",style:{color:a},children:r}),t?N(ee,{as:"p",size:"1",style:{color:a},children:t}):null]})}var Pi="Busy",Ei={title:"Gym",time:"10:00 AM",location:"Flex Gym on 16th Ave",description:"Workout notes"};function Bi({hasSources:e,hasTarget:r,sourceLabel:t,targetLabel:o,showTitle:n,showDescription:a,showLocation:i,tagLabel:l,accentColor:s,sampleEvent:c=Ei}){let p=c.title,d=[c.time,c.location].filter(Boolean).join(" \xB7 "),g=l?.trim()||Pi,v=n?`${c.title} - (${g})`:g,f=[c.time].filter(Boolean);i&&c.location&&f.push(c.location),a&&c.description&&f.push(c.description);let x=f.join(" \xB7 ");return ur(Ai,{direction:"column",gap:"4",style:{padding:"var(--space-4)"},children:[N(ee,{as:"p",className:"ds-section-label",style:{textAlign:"center"},children:"Sync Preview"}),N(ee,{as:"p",size:"1",color:"gray",style:{textAlign:"center",marginTop:"calc(-1 * var(--space-2))"},children:"Example event \u2014 not from your calendars."}),ur(Ke,{children:[N(ee,{as:"p",size:"1",color:"gray",mb:"1",children:"Sources"}),N(ee,{as:"p",size:"1",weight:"medium",mb:"2",truncate:!0,style:{color:"var(--gray-12)"},children:e?t||"Selected sources":"\u2014"}),N(Ke,{style:{border:"1px solid var(--gray-5)",borderRadius:"var(--radius-2)",padding:"var(--space-2)",background:"var(--gray-2)"},children:N(fo,{tone:"source",title:p,meta:d})})]}),ur(Ke,{children:[N(ee,{as:"p",size:"1",color:"gray",mb:"1",children:"Target"}),N(ee,{as:"p",size:"1",weight:"medium",mb:"2",truncate:!0,style:{color:"var(--gray-12)"},children:r?o||"Selected target":"\u2014"}),N(Ke,{style:{border:"1px solid var(--gray-5)",borderRadius:"var(--radius-2)",padding:"var(--space-2)",background:"var(--gray-2)"},children:r?N(fo,{tone:"synced",title:v,meta:x,...s?{accentColor:s}:{}}):N(ee,{as:"p",size:"2",color:"gray",children:"Pick one target calendar"})})]}),!e||!r?N(ee,{as:"p",size:"1",color:"gray",style:{textAlign:"center"},children:"Select one or more sources, then one target"}):N(ee,{as:"p",size:"1",color:"gray",style:{textAlign:"center"},children:"Only the highlighted block is posted to the target"})]})}import{Flex as ot,Text as at}from"@radix-ui/themes";import{CheckIcon as Mi}from"@radix-ui/react-icons";import{jsx as Be,jsxs as yo}from"react/jsx-runtime";function nt({steps:e,current:r}){return Be("div",{role:"list","aria-label":"Wizard progress",style:{display:"flex",flexWrap:"wrap",width:"100%",flexShrink:0,marginBottom:0,border:"1px solid var(--gray-5)",borderRadius:"var(--radius-4)",background:"var(--color-panel-solid)",overflow:"hidden"},children:e.map((t,o)=>{let n=o+1,a=n===r,i=n<r;return yo(ot,{align:"start",gap:"3",role:"listitem","aria-current":a?"step":void 0,style:{flex:"1 1 calc(3 * var(--space-9) + var(--space-6))",minWidth:"calc(3 * var(--space-9) + var(--space-6))",paddingTop:"var(--space-4)",paddingBottom:"var(--space-4)",paddingLeft:"var(--space-4)",paddingRight:"var(--space-4)",marginBottom:"-1px",borderBottom:a?"2px solid var(--accent-9)":"2px solid transparent"},children:[Be(ot,{align:"center",justify:"center",style:{width:"var(--space-6)",height:"var(--space-6)",borderRadius:"50%",flexShrink:0,marginTop:"var(--space-1)",background:i?"var(--green-9)":a?"var(--accent-9)":"var(--gray-3)",color:i?"white":a?"var(--accent-contrast)":"var(--gray-11)"},children:i?Be(Mi,{style:h("--space-3")}):Be(at,{size:"1",weight:"medium",children:t.n})}),yo(ot,{direction:"column",gap:"1",style:{minWidth:0,flex:1,paddingTop:"var(--space-1)"},children:[Be(at,{size:"2",weight:"medium",style:{color:a||i?"var(--gray-12)":"var(--gray-10)",lineHeight:"var(--line-height-2)"},children:t.title}),Be(at,{size:"1",color:"gray",style:{lineHeight:"var(--line-height-1)"},children:t.description})]})]},t.n)})})}import{jsx as ho}from"react/jsx-runtime";var zi=[{n:"01",title:"Connect",description:"Connect your calendar account"},{n:"02",title:"Calendars",description:"Import at least 2 calendars"},{n:"03",title:"Sync",description:"Set up your first sync"}];function vo({current:e}){return ho(nt,{steps:zi,current:e})}function Ni({current:e,total:r=3}){return ho(vo,{current:e})}import it from"dayjs";import{Flex as bo,Grid as xo,IconButton as Co,Text as wo}from"@radix-ui/themes";import{ChevronLeftIcon as Fi,ChevronRightIcon as Li}from"@radix-ui/react-icons";import{jsx as de,jsxs as st}from"react/jsx-runtime";var Hi=["S","M","T","W","T","F","S"];function lt({cursor:e,onSelect:r,today:t=new Date}){let o=it(e).startOf("month"),n=o.startOf("week"),a=Array.from({length:42},(i,l)=>n.add(l,"day"));return st("div",{children:[st(bo,{align:"center",justify:"between",mb:"2",children:[de(wo,{size:"2",weight:"medium",style:{color:"var(--gray-12)"},children:o.format("MMMM YYYY")}),st(bo,{gap:"1",children:[de(Co,{size:"1",variant:"ghost",color:"gray","aria-label":"Previous month",onClick:()=>r(it(e).subtract(1,"month").toDate()),children:de(Fi,{})}),de(Co,{size:"1",variant:"ghost",color:"gray","aria-label":"Next month",onClick:()=>r(it(e).add(1,"month").toDate()),children:de(Li,{})})]})]}),de(xo,{columns:"7",gap:"1",mb:"1",children:Hi.map((i,l)=>de(wo,{size:"1",color:"gray",align:"center",children:i},l))}),de(xo,{columns:"7",gap:"1",justify:"center",align:"center",style:{justifyItems:"center"},children:a.map(i=>{let l=i.isSame(t,"day"),s=i.isSame(e,"day"),c=!i.isSame(o,"month");return de("button",{type:"button",onClick:()=>r(i.toDate()),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"var(--space-5)",height:"var(--space-5)",boxSizing:"border-box",flexShrink:0,padding:0,borderRadius:"50%",border:l&&!s?"1.5px solid var(--accent-9)":"none",cursor:"pointer",background:s?"var(--accent-9)":"transparent",color:s?"var(--accent-contrast)":c?"var(--gray-11)":l?"var(--accent-11)":"var(--gray-12)",fontWeight:l||s?500:400,fontSize:"var(--font-size-1)",fontFamily:"var(--font-poppins)"},children:i.format("D")},i.format("YYYY-MM-DD"))})})]})}import{useState as Oi}from"react";import{Dialog as Ye,Flex as qe,Text as mr,Button as ct,IconButton as _i,Badge as To,Separator as Vi,Box as So}from"@radix-ui/themes";import{Cross2Icon as Wi,PlusIcon as $i,ReloadIcon as Ui}from"@radix-ui/react-icons";import{Fragment as ko,jsx as I,jsxs as re}from"react/jsx-runtime";function Gi({account:e,catalog:r,onOpenChange:t,onRemoveCalendar:o,onSaveCalendars:n,onReconnect:a}){let[i,l]=Oi(!1),s=e?.authStatus==="reauth",c=e?.authStatus==="failed";function p(d){if(!e||!r)return;let g=new Set(d);n(e,r.calendars.filter(v=>g.has(v.id))),l(!1)}return re(ko,{children:[I(Ye.Root,{open:!!e&&!i,onOpenChange:d=>{d||t(!1)},children:I(Ye.Content,{maxWidth:b.dialogMd,children:e&&re(ko,{children:[re(qe,{align:"center",gap:"3",mb:"1",children:[I(P,{size:"var(--space-6)",children:I(H,{provider:e.provider})}),re(So,{style:{minWidth:0,flex:1},children:[re(qe,{align:"center",gap:"2",mb:"1",style:{minWidth:0},children:[I(Ye.Title,{size:"4",weight:"medium",mb:"0",truncate:!0,style:{minWidth:0},children:e.displayName}),s&&I(To,{color:"amber",variant:"soft",size:"1",radius:"full",style:{flexShrink:0},children:"Needs reconnect"}),c&&I(To,{color:"red",variant:"soft",size:"1",radius:"full",style:{flexShrink:0},children:"Connection failed"})]}),I(Ye.Description,{size:"2",color:"gray",mb:"0",children:e.email})]})]}),(s||c)&&a&&re(ct,{size:"2",variant:"soft",color:c?"red":"amber",mt:"3",onClick:()=>a(e.id),children:[I(Ui,{}),"Reconnect"]}),I(Vi,{size:"4",my:"4"}),re(qe,{align:"center",justify:"between",gap:"3",mb:"3",children:[I(mr,{as:"p",className:"ds-section-label",mb:"0",children:"Calendars"}),r&&r.calendars.length>0&&re(ct,{size:"1",variant:"soft",color:"gray",onClick:()=>l(!0),children:[I($i,{style:h("--space-3")}),"Change calendars"]})]}),I(qe,{direction:"column",style:{border:"1px solid var(--gray-5)",borderRadius:"var(--radius-3)",overflow:"hidden",background:"var(--color-panel-solid)"},children:e.calendars.length===0?I(mr,{size:"2",color:"gray",style:{padding:"var(--space-4)"},children:"No calendars imported."}):e.calendars.map((d,g)=>re(qe,{align:"center",gap:"3",className:"data-table-row",style:{padding:"var(--space-3) var(--space-4)",minHeight:"var(--space-7)",borderTop:g>0?"1px solid var(--gray-4)":void 0},children:[I(So,{"aria-hidden":!0,style:{width:"var(--space-2)",height:"var(--space-2)",borderRadius:"50%",background:d.colorToken,flexShrink:0}}),re(mr,{size:"2",truncate:!0,style:{flex:1,minWidth:0,color:"var(--gray-12)"},children:[d.name,d.isPrimary&&re(mr,{size:"1",color:"gray",children:[" ","\xB7 Primary"]})]}),I(_i,{variant:"ghost",color:"gray",size:"1","aria-label":`Remove ${d.name}`,onClick:()=>o(e,d),children:I(Wi,{})})]},d.id))}),I(X,{justify:"end",children:I(Ye.Close,{children:I(ct,{size:"2",variant:"soft",color:"gray",children:"Close"})})})]})})}),I(Ce,{account:i&&r?r:null,initiallySelectedIds:e?.calendars.map(d=>d.id),title:"Change calendars",description:"Choose which calendars to keep on this account.",confirmLabel:"Save calendars",onOpenChange:d=>{d||l(!1)},onImport:p})]})}import{useMemo as ji}from"react";import vr from"dayjs";import{Calendar as Ki,dayjsLocalizer as Yi,Views as Xe}from"react-big-calendar";import"react-big-calendar/lib/css/react-big-calendar.css";import{Text as fr}from"@radix-ui/themes";import{jsx as Me,jsxs as yr}from"react/jsx-runtime";var qi=Yi(vr),Xi=new Date(1970,0,1,8,0,0);function dt({blocks:e,view:r,onViewChange:t,date:o,onNavigate:n,accounts:a,today:i=new Date}){let l=ji(()=>e.map(s=>{let c=new Date(s.date);c.setHours(s.startHour,s.startMinute,0,0);let p=new Date(s.date);return p.setHours(s.endHour,s.endMinute,0,0),{id:s.id,title:s.title,start:c,end:p,resource:s}}),[e]);return Me("div",{className:"rbc-radix-scope",style:{height:"100%",containerType:"inline-size"},children:Me(Ki,{localizer:qi,events:l,view:r==="week"?Xe.WEEK:Xe.MONTH,onView:s=>t(s===Xe.MONTH?"month":"week"),date:o,onNavigate:n,views:[Xe.WEEK,Xe.MONTH],toolbar:!0,popup:!0,scrollToTime:Xi,enableAutoScroll:!0,getNow:()=>i,tooltipAccessor:null,eventPropGetter:s=>{let p=j(a,s.resource.calendarId)?.calendar.colorToken??"var(--gray-8)";return r==="month"?{style:{background:"transparent",border:"none",boxShadow:"none"}}:{style:{backgroundColor:p,border:"none"}}},components:{toolbar:Qr,week:{header:s=>Me(qr,{...s,today:i}),event:({event:s})=>{let c=(s.end.getTime()-s.start.getTime())/6e4,p=c>=60,d=c>=30;return yr("div",{children:[Me(fr,{size:"1",weight:"medium",style:{color:"white",display:"block"},truncate:!0,children:s.title}),d&&yr(fr,{size:"1",style:{color:"rgba(255,255,255,0.85)",display:"block"},truncate:!0,children:[vr(s.start).format("h:mm A")," \u2013 ",vr(s.end).format("h:mm A")]}),p&&s.resource.location&&Me(fr,{size:"1",style:{color:"rgba(255,255,255,0.85)",display:"block"},truncate:!0,children:s.resource.location})]})}},month:{event:({event:s})=>{let p=j(a,s.resource.calendarId)?.calendar.colorToken??"var(--gray-8)";return yr(fr,{size:"1",style:{display:"flex",alignItems:"center",gap:"var(--space-1)",color:"var(--gray-12)",background:`color-mix(in srgb, ${p} 28%, transparent)`,borderRadius:"var(--radius-2)",padding:"var(--space-1) var(--space-2)"},truncate:!0,children:[Me("span",{"aria-hidden":!0,style:{width:"var(--space-2)",height:"var(--space-2)",borderRadius:"50%",background:p,flexShrink:0}}),yr("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[vr(s.start).format("H:mm")," ",s.title]})]})}}}})})}import{Dialog as Ze,Flex as we,Text as Te,Button as Ro,Separator as Zi,Badge as Qi}from"@radix-ui/themes";import{Fragment as es,jsx as k,jsxs as ye}from"react/jsx-runtime";var Io={synced:{label:"Synced",color:"green"},syncing:{label:"Syncing\u2026",color:"amber"},error:{label:"Error",color:"red"}};function Ji({sync:e,accounts:r,onOpenChange:t,onEdit:o}){let n=e?(()=>{let a=e.sourceCalendarIds.map(l=>j(r,l)?.calendar.name).filter(l=>!!l),i=j(r,e.targetCalendarId)?.calendar.name??"\u2014";return`${a.join(", ")||"\u2014"} \u2192 ${i}`})():"";return k(Ze.Root,{open:!!e,onOpenChange:t,children:k(Ze.Content,{maxWidth:b.dialogMd,children:e&&ye(es,{children:[ye(we,{align:"center",justify:"between",mb:"1",children:[k(Ze.Title,{size:"4",mb:"0",children:e.name}),k(Qi,{color:Io[e.status].color,variant:"soft",size:"1",radius:"full",children:Io[e.status].label})]}),k(Ze.Description,{size:"2",color:"gray",mb:"4",children:"Sync configuration"}),ye(we,{direction:"column",gap:"3",children:[k(fe,{label:"Calendars",children:n}),k(fe,{label:"Sources",children:k(we,{direction:"column",gap:"1",align:"end",children:e.sourceCalendarIds.map(a=>{let i=j(r,a);return i?ye(we,{direction:"column",align:"end",children:[k(Te,{size:"2",weight:"medium",style:{color:"var(--gray-12)"},children:i.calendar.name}),k(Te,{size:"1",color:"gray",children:i.account.email})]},a):null})||"\u2014"})}),k(fe,{label:"Target",children:(()=>{let a=j(r,e.targetCalendarId);return a?ye(we,{direction:"column",align:"end",children:[k(Te,{size:"2",weight:"medium",style:{color:"var(--gray-12)"},children:a.calendar.name}),k(Te,{size:"1",color:"gray",children:a.account.email})]}):"\u2014"})()}),k(fe,{label:"Last synced",children:e.lastSyncedLabel??"\u2014"})]}),k(Zi,{size:"4",my:"4"}),k(Te,{as:"p",size:"1",weight:"medium",color:"gray",mb:"3",style:{letterSpacing:"0.04em"},children:"WHAT TO SHOW"}),ye(we,{direction:"column",gap:"3",children:[k(fe,{label:"Tag",children:e.tagLabel?.trim()||"Busy"}),k(fe,{label:"Event titles",children:e.showTitle?"Shown":"Hidden"}),k(fe,{label:"Event description",children:e.showDescription?"Shown":"Hidden"}),k(fe,{label:"Event location",children:e.showLocation?"Shown":"Hidden"})]}),ye(X,{justify:"between",children:[k(Ze.Close,{children:k(Ro,{size:"2",variant:"soft",color:"gray",children:"Close"})}),k(Ro,{size:"2",className:"btn-amber-primary",onClick:()=>o(e.id),children:"Edit sync"})]})]})})})}function fe({label:e,children:r}){return ye(we,{align:"baseline",justify:"between",gap:"4",children:[k(Te,{size:"2",color:"gray",style:{flexShrink:0},children:e}),k(Te,{size:"2",weight:"medium",align:"right",style:{color:"var(--gray-12)"},children:r})]})}import{useState as hr}from"react";function Qe({accounts:e,connectProvider:r,onAccountAdded:t,onImported:o}){let[n,a]=hr(null),[i,l]=hr(null),[s,c]=hr(null),[p,d]=hr(!1);function g(f){if(n)return;c(null),d(!1),a(f);let x=e.map(w=>w.id);r(f,x).then(w=>{a(null),w?l(w):(c(f),d(!0))}).catch(()=>{a(null),c(f),d(!1)})}function v(f){if(!i)return;let x=new Set(f);t({...i,calendars:i.calendars.filter(w=>x.has(w.id))}),l(null),o?.()}return{connectingProvider:n,pendingAccount:i,failedProvider:s,exhausted:p,connect:g,confirmImport:v,cancelImport:()=>l(null),dismissError:()=>c(null)}}import{Box as rs,DropdownMenu as br,Button as ts,Flex as os,Text as Ao}from"@radix-ui/themes";import{PlusIcon as Do}from"@radix-ui/react-icons";import{Fragment as ns,jsx as te,jsxs as ze}from"react/jsx-runtime";function as({variant:e="button",trigger:r,accounts:t,connectProvider:o,onAccountAdded:n,onImported:a}){let{pendingAccount:i,failedProvider:l,exhausted:s,connect:c,confirmImport:p,cancelImport:d,dismissError:g}=Qe({accounts:t,connectProvider:o,onAccountAdded:n,onImported:a}),v=["google","microsoft"],f=e==="tile"?ze("button",{type:"button",className:"connect-account-tile","aria-label":"Connect Account",children:[te(Do,{style:h("--space-4")}),"Connect Account"]}):ze(ts,{size:"2",className:"btn-amber-primary",children:[te(Do,{style:h("--space-4")}),"Connect Account"]}),x=ze(br.Root,{children:[te(br.Trigger,{children:r??f}),te(br.Content,{align:"start",style:{width:"max-content",minWidth:"max-content"},children:v.map(w=>{let B=Ee[w];return ze(br.Item,{onSelect:()=>c(w),style:{height:"auto",alignItems:"center",gap:"var(--space-3)",padding:"var(--space-2) var(--space-3)"},children:[te(P,{size:"var(--space-6)",children:te(H,{provider:w})}),ze(os,{direction:"column",gap:"1",style:{flexShrink:0},children:[te(Ao,{size:"2",weight:"medium",style:{color:"var(--gray-12)"},children:B.label}),te(Ao,{size:"1",color:"gray",children:B.description})]})]},w)})})]});return ze(ns,{children:[e==="tile"&&!r?te(rs,{style:{width:"100%",minWidth:0},children:x}):x,te(Ce,{account:i,onOpenChange:w=>!w&&d(),onImport:p}),l&&te(Er,{msg:s?`No more ${Ee[l].label} accounts available to connect.`:`Couldn't connect ${Ee[l].label}. Please try again.`,color:"red",onDone:g})]})}import{Card as is,Flex as pt,Text as ss,Heading as ls}from"@radix-ui/themes";import{CalendarIcon as cs}from"@radix-ui/react-icons";import{jsx as ve,jsxs as Po}from"react/jsx-runtime";function ds({accounts:e,connectProvider:r,onAccountAdded:t,onImported:o}){let{connectingProvider:n,pendingAccount:a,failedProvider:i,exhausted:l,connect:s,confirmImport:c,cancelImport:p}=Qe({accounts:e,connectProvider:r,onAccountAdded:t,onImported:o});return Po(pt,{direction:"column",align:"center",justify:"center",style:{width:"100%",flex:1,minHeight:0},children:[ve(is,{style:{width:"100%",maxWidth:b.providerChooserMax},children:Po(pt,{direction:"column",align:"center",justify:"center",gap:"3",py:"6",px:"3",style:{width:"100%",textAlign:"center"},children:[ve(P,{children:ve(cs,{style:{...h("--space-5"),color:"var(--gray-7)"}})}),ve(ls,{as:"h2",size:L.h2,weight:"medium",children:e.length>0?"Connect another account":"Connect your first account"}),ve(ss,{as:"p",size:"2",color:"gray",children:e.length>0?"Add another Google or Microsoft account, then choose which calendars to import.":"Connect a Google or Microsoft account to import calendars for sync."}),ve(pt,{direction:"column",style:{width:"100%"},mt:"3",children:ve(et,{connectingProvider:n,failedProvider:i,exhausted:l,onConnect:s})})]})}),ve(Ce,{account:a,onOpenChange:d=>!d&&p(),onImport:c})]})}import{useEffect as ps,useMemo as gt,useState as xr}from"react";import{Link as gs}from"react-router-dom";import{Box as ut,Checkbox as Eo,Flex as Je,Separator as mt,Text as Se}from"@radix-ui/themes";import{ChevronDownIcon as us,GearIcon as ms,HamburgerMenuIcon as fs}from"@radix-ui/react-icons";import{jsx as A,jsxs as pe}from"react/jsx-runtime";function ys({accounts:e,view:r,setView:t,hideClones:o,setHideClones:n,mergedCalendarIds:a,visibleCalendarIds:i,toggleCalendarVisible:l,getVisibleBlocksInRange:s,manageAccountsHref:c,today:p=new Date}){let[d,g]=xr(p),[v,f]=xr(new Set),[x,w]=xr(()=>typeof window<"u"&&window.innerWidth<900),[B,oe]=xr(!1);ps(()=>{function y(){w(window.innerWidth<900)}return window.addEventListener("resize",y),()=>window.removeEventListener("resize",y)},[]);let se=gt(()=>{let y=new Date(d);return y.setDate(y.getDate()-42),y},[d]),C=gt(()=>{let y=new Date(d);return y.setDate(y.getDate()+42),y},[d]),M=s(se,C),T=gt(()=>{let y=[],z=new Map;for(let V of a){let W=j(e,V);if(!W)continue;let Y=z.get(W.account.id);Y===void 0&&(Y=y.length,z.set(W.account.id,Y),y.push({accountId:W.account.id,calendarIds:[]})),y[Y].calendarIds.push(V)}return y},[a,e]);function ge(y){f(z=>{let V=new Set(z);return V.has(y)?V.delete(y):V.add(y),V})}return pe(Je,{gap:"5",align:"start",direction:x?"column":"row",flexGrow:"1",minHeight:"0",height:"100%",children:[(!x||B)&&pe(ut,{minWidth:x?void 0:b.sidebarColMin,p:"4",maxHeight:"100%",style:{flex:x?"1 1 100%":`0 0 ${b.sidebarColBasis}`,border:"1px solid var(--gray-5)",borderRadius:"var(--radius-4)",background:"var(--color-panel-solid)",boxShadow:"var(--shadow-card)",overflow:"auto"},children:[A(lt,{cursor:d,onSelect:g,today:p}),A(mt,{size:"4",my:"3"}),A(Se,{as:"p",size:"1",weight:"medium",color:"gray",mb:"3",style:{letterSpacing:"0.04em"},children:"CALENDARS"}),A(Je,{direction:"column",gap:"1",mb:"4",children:T.map(({accountId:y,calendarIds:z},V)=>{let W=e.find(q=>q.id===y);if(!W)return null;let Y=v.has(y);return pe("div",{style:{paddingTop:V>0?"var(--space-2)":void 0,borderTop:V>0?"1px solid var(--gray-3)":void 0},children:[pe(Je,{align:"center",gap:"2",mb:"2",py:"1",className:"calendar-legend-account-row",style:{cursor:"pointer",borderRadius:"var(--radius-2)"},onClick:()=>ge(y),children:[A(us,{style:{...h("--space-3"),color:"var(--gray-9)",transform:Y?"rotate(-90deg)":void 0,transition:"transform 120ms ease",flexShrink:0}}),A(H,{provider:W.provider}),A(Se,{size:"2",weight:"medium",truncate:!0,title:W.email,style:{color:"var(--gray-12)",minWidth:0},children:W.email})]}),!Y&&A(Je,{direction:"column",gap:"1",pl:"5",children:z.map(q=>{let Re=j(e,q);return Re?pe(Se,{as:"label",size:"2",className:"calendar-legend-row",style:{display:"flex",alignItems:"center",gap:"var(--space-2)",cursor:"pointer",borderRadius:"var(--radius-2)",padding:"var(--space-1) var(--space-2)",marginLeft:"calc(var(--space-2) * -1)"},children:[pe(Je,{align:"center",gap:"1",children:[A(Eo,{checked:i.has(q),onCheckedChange:()=>l(q)}),A("span",{"aria-hidden":!0,style:{width:"var(--space-3)",height:"var(--space-3)",borderRadius:"50%",background:Re.calendar.colorToken,flexShrink:0}})]}),A(Se,{size:"2",truncate:!0,style:{color:"var(--gray-12)"},title:Re.calendar.name,children:Re.calendar.name})]},q):null})})]},y)})}),A(mt,{size:"4",mb:"3"}),pe(Se,{as:"label",size:"2",style:{display:"flex",alignItems:"center",gap:"var(--space-2)",cursor:"pointer"},mb:"3",children:[A(Eo,{checked:o,onCheckedChange:y=>n(!!y)}),"Hide synced events"]}),A(mt,{size:"4",mb:"3"}),pe(gs,{to:c,style:{display:"flex",alignItems:"center",gap:"var(--space-2)",color:"var(--gray-11)",textDecoration:"none"},children:[A(ms,{style:h("--space-3")}),A(Se,{size:"2",children:"Manage accounts"})]}),A(Se,{as:"p",size:"1",color:"gray",mt:"4",children:"On your target calendars, others see only what each sync is set to share. Full detail stays in araMetrics."})]}),pe(ut,{width:x?"100%":void 0,minHeight:b.bigCalendarH,height:"100%",style:{flex:x?"1 1 100%":`1 1 ${b.syncColWide}`,minWidth:x?0:b.syncColMin,display:"flex",flexDirection:"column",alignSelf:"stretch"},children:[x&&A("button",{type:"button",className:"sidebar-icon-btn","aria-label":B?"Hide calendars":"Show calendars",style:{alignSelf:"flex-start",marginBottom:"var(--space-3)"},onClick:()=>oe(y=>!y),children:A(fs,{style:h("--space-4")})}),A(ut,{flexGrow:"1",minHeight:"0",height:"100%",children:A(dt,{blocks:M,view:r,onViewChange:t,date:d,onNavigate:g,accounts:e,today:p})})]})]})}import{clsx as vs}from"clsx";import{twMerge as hs}from"tailwind-merge";function ke(...e){return hs(vs(e))}function bs(e,r="solid"){return R.variants[e]?.[r]||R.variants.primary[r]}function xs(e){let r=R.sizes[e]||R.sizes.md;return`${r.text} ${r.padding} ${r.height}`}function Cs(){return ke(R.base.transition,R.base.focus,R.base.disabled,R.accessibility.reducedMotion)}function ws(){return ke(R.base.interactive,R.accessibility.focusTrap,R.accessibility.touchTarget)}function Ts(e={}){return ke(e.focusVisible&&R.accessibility.focusTrap,e.highContrast&&R.accessibility.highContrast,e.reducedMotion&&R.accessibility.reducedMotion)}function Ss(e,r=""){return typeof e=="string"?`${r}${e}`:typeof e=="object"&&e!==null?Object.entries(e).map(([t,o])=>o===void 0?"":`${t==="xs"?"":`${t}:`}${r}${o}`).filter(Boolean).join(" "):""}function ks(e,r="gap"){let t=R.spacing[e]||R.spacing.md;switch(r){case"margin":return t.replace("gap-","m-");case"padding":return t.replace("gap-","p-");default:return t}}function Rs(e){return R.radius[e]||R.radius.md}function Is(e){return R.typography[e]||R.typography.base}function As(e,r=500){return`bg-${e}-${r}`}function Ds(e,r=500){return`text-${e}-${r}`}function Ps(e,r=500){return`border-${e}-${r}`}function Es(e,r=500){return`hover:bg-${e}-${r}`}function Bs(e,r=500){return`hover:text-${e}-${r}`}function Ms(e,r=500){return`focus:ring-${e}-${r}`}function zs(e){let r=R.animations[e];return typeof r=="string"?r:""}function Ns(e,r,t){return o=>{let n=e;return Object.entries(r).forEach(([a,i])=>{let l=o[a];l&&i[l]&&(n+=` ${i[l]}`)}),t?.forEach(({conditions:a,className:i})=>{Object.entries(a).every(([s,c])=>o[s]===c)&&(n+=` ${i}`)}),ke(n)}}function Fs(e){return function(t){let{className:o,...n}=t,a={...e.defaultVariants,...n},i=e.base||"";return e.variants&&Object.entries(e.variants).forEach(([l,s])=>{let c=a[l];c&&s[c]&&(i+=` ${s[c]}`)}),e.compoundVariants?.forEach(({conditions:l,className:s})=>{Object.entries(l).every(([p,d])=>a[p]===d)&&(i+=` ${s}`)}),ke(i,o)}}function Ls(e,r){let t={...e};return Object.keys(r).forEach(o=>{let n=r[o],a=e[o];o==="className"?t[o]=ke(a,n):typeof n=="object"&&typeof a=="object"&&n!==null&&a!==null&&!Array.isArray(n)&&!Array.isArray(a)?t[o]={...a,...n}:t[o]=n}),t}function Hs(e,r,t){return e?r:t&&e===!1?t:""}function Os(e){let r=["button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","a[href]",'[tabindex]:not([tabindex="-1"])','[contenteditable="true"]'].join(", ");return Array.from(e.querySelectorAll(r))}function _s(e,r,t,o={}){let{loop:n=!0,orientation:a="both"}=o,i=t;switch(e.key){case"ArrowDown":(a==="vertical"||a==="both")&&(i=t+1,i>=r.length&&(i=n?0:r.length-1));break;case"ArrowUp":(a==="vertical"||a==="both")&&(i=t-1,i<0&&(i=n?r.length-1:0));break;case"ArrowRight":(a==="horizontal"||a==="both")&&(i=t+1,i>=r.length&&(i=n?0:r.length-1));break;case"ArrowLeft":(a==="horizontal"||a==="both")&&(i=t-1,i<0&&(i=n?r.length-1:0));break;case"Home":i=0;break;case"End":i=r.length-1;break}return i!==t&&(e.preventDefault(),r[i]?.focus()),i}import{Theme as Vs}from"@radix-ui/themes";import"@radix-ui/themes/styles.css";import{jsx as $s}from"react/jsx-runtime";function Ws({children:e,appearance:r="light",radius:t="none",scaling:o="100%",accentColor:n="amber",grayColor:a="gray",panelBackground:i="solid",className:l=""}){return $s(Vs,{accentColor:n,grayColor:a,radius:t,scaling:o,panelBackground:i,appearance:r,className:l,children:e})}import*as Cr from"react";function Am({value:e,defaultValue:r,onChange:t}){let[o,n]=Cr.useState(r),a=e!==void 0,i=a?e:o,l=Cr.useCallback(s=>{let c=typeof s=="function"?s(i):s;a||n(c),t?.(c)},[a,i,t]);return[i,l]}import*as Ne from"react";function Pm(e=!1){let[r,t]=Ne.useState(e),o=Ne.useCallback(()=>t(!0),[]),n=Ne.useCallback(()=>t(!1),[]),a=Ne.useCallback(()=>t(i=>!i),[]);return{isOpen:r,open:o,close:n,toggle:a,onOpen:o,onClose:n,onToggle:a}}import*as wr from"react";function Bm(e,r=!0){let t=wr.useRef(null);return wr.useEffect(()=>{if(!r)return;let o=n=>{t.current&&!t.current.contains(n.target)&&e()};return document.addEventListener("mousedown",o),()=>document.removeEventListener("mousedown",o)},[e,r]),t}export*from"@radix-ui/react-icons";export{Xa as ACTIVITY_META,Lt as AUDIT_ACTION_META,Oo as AccentCard,bt as AccentHeader,Wl as AccessibleIcon,Gi as AccountCalendarsDialog,Xo as AccountCard,Aa as ActivityRow,as as AddAccountMenu,kl as AlertDialog,Ia as AppCard,Qs as AspectRatio,Qa as AuthCard,Bl as Avatar,Ml as Badge,dt as BigCalendarView,ol as Blockquote,js as Box,Hr as BrandPanel,dl as Button,qr as CalendarDayHeader,ys as CalendarMergedView,oi as CalendarPickList,Qr as CalendarToolbar,zl as Callout,Nl as Card,X as CardFooter,ml as Checkbox,yl as CheckboxCards,fl as CheckboxGroup,al as Code,Rr as ConfirmDialog,et as ConnectProviderList,ds as ConnectProviderRows,vi as ConnectedAccountCard,qs as Container,Il as ContextMenu,za as DashboardErrorCard,Fl as DataList,Mr as DataTableRow,Sl as Dialog,Rl as DropdownMenu,nl as Em,Ci as EmptyCard,ya as EventBlock,Ks as Flex,Or as GoogleIcon,Ys as Grid,tl as Heading,Dl as HoverCard,pl as IconButton,P as IconTile,Ce as ImportCalendarsDialog,Zs as Inset,il as Kbd,qa as METRIC_STATUS_COLOR,Ca as MetricCard,_r as MicrosoftIcon,lt as MiniMonthPicker,ia as MonthGrid,Ni as OnboardingStepDots,vo as OnboardingStepper,Vr as OtpInput,sn as OtpVerifyStep,ln as PROVIDER_LABEL,Ee as PROVIDER_META,Ga as Pagination,Ir as PausedBadge,Al as Popover,El as Portal,Ll as Progress,H as ProviderIcon,ll as Quote,Ka as ROLE_LABELS,tr as ROLE_META,vl as Radio,bl as RadioCards,hl as RadioGroup,cr as SHELL_HEADER_H,Ya as STATUS_META,Js as ScrollArea,qn as SearchOverlay,Xs as Section,Tl as SegmentedControl,xl as Select,el as Separator,Tn as Sidebar,No as Skeleton,Cl as Slider,$l as Slot,Ul as Slottable,Hl as Spinner,cl as Strong,wl as Switch,Ji as SyncDetailsDialog,Bi as SyncPreviewRail,Vl as TabNav,Ol as Table,_l as Tabs,rl as Text,ul as TextArea,gl as TextField,sl as TextLink,Er as Toast,Pl as Tooltip,Ln as Topbar,Ws as UIProvider,Gl as VisuallyHidden,nt as WizardStepper,Za as auditActionMeta,ke as cn,zo as colors,Hs as conditionalClass,Ns as createCompoundVariants,Fs as createVariantGenerator,j as findCalendar,Ts as getAccessibilityStyles,zs as getAnimationClass,Cs as getBaseStyles,As as getBgClass,Ps as getBorderClass,vt as getColor,Ms as getFocusRingClass,Os as getFocusableElements,Es as getHoverBgClass,Bs as getHoverTextClass,ws as getInteractiveStyles,Rs as getRadiusClass,Ss as getResponsiveClasses,xs as getSizeStyles,ks as getSpacingClass,Ds as getTextClass,Is as getTypographyClass,bs as getVariantStyles,_s as handleArrowNavigation,L as headingSize,b as layout,Ls as mergeProps,R as theme,Bm as useClickOutside,Qe as useConnectAccount,Am as useControllableState,Pm as useDisclosure};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|