zudoku 0.3.0-dev.62 → 0.3.0-dev.64

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.
@@ -14,13 +14,13 @@ export const SideNavigationCategory = ({ category, }) => {
14
14
  const navItem = useTopNavigationItem();
15
15
  const location = useLocation();
16
16
  const isCollapsible = category.collapsible ?? true;
17
- const [isOpen, setIsOpen] = useNavigationCollapsibleState({
17
+ const collapsibleProps = useNavigationCollapsibleState({
18
18
  item: category,
19
19
  path: navItem?.path ?? "",
20
20
  defaultOpen: () => !isCollapsible ||
21
21
  category.expanded ||
22
22
  checkHasActiveItem(category, location.pathname, navItem?.path ?? ""),
23
23
  });
24
- return (_jsxs(Collapsible.Root, { open: isOpen, onOpenChange: () => setIsOpen((prev) => !prev), children: [category.label.length > 0 ? (_jsx(Collapsible.Trigger, { asChild: isCollapsible, disabled: !isCollapsible, children: _jsxs("h5", { className: cn("flex group items-center justify-between cursor-pointer font-semibold text-foreground/90 px-[--padding-nav-item] py-1.5 rounded-lg transition-colors duration-300 -mx-[--padding-nav-item]", isCollapsible ? "hover:bg-accent" : "cursor-auto"), children: [category.label, isCollapsible && (_jsx(ChevronRightIcon, { className: "group-data-[state=open]:rotate-90 transition", size: 16 }))] }) })) : ("Endpoints"), _jsx(Collapsible.Content, { className: "CollapsibleContent -mx-[--padding-nav-item]", children: _jsx("ul", { className: "space-y-0.5 mt-1.5 mb-4 ms-3", children: category.children.map((item, i) => (_jsx(SideNavigationItem, { category: category, item: item, activeAnchor: activeAnchor, currentTopNavItem: navItem, basePath: joinPath(navItem?.path, category.path) }, i))) }) })] }, category.label));
24
+ return (_jsxs(Collapsible.Root, { ...collapsibleProps, children: [category.label.length > 0 ? (_jsx(Collapsible.Trigger, { asChild: isCollapsible, disabled: !isCollapsible, children: _jsxs("h5", { className: cn("flex group items-center justify-between cursor-pointer font-semibold text-foreground/90 px-[--padding-nav-item] py-1.5 rounded-lg transition-colors duration-300 -mx-[--padding-nav-item]", isCollapsible ? "hover:bg-accent" : "cursor-auto"), children: [category.label, isCollapsible && (_jsx(ChevronRightIcon, { className: "group-data-[state=open]:rotate-90 transition", size: 16 }))] }) })) : ("Endpoints"), _jsx(Collapsible.Content, { className: "CollapsibleContent -mx-[--padding-nav-item]", children: _jsx("ul", { className: "space-y-0.5 mt-1.5 mb-4 ms-3", children: category.children.map((item, i) => (_jsx(SideNavigationItem, { category: category, item: item, activeAnchor: activeAnchor, currentTopNavItem: navItem, basePath: joinPath(navItem?.path, category.path) }, i))) }) })] }, category.label));
25
25
  };
26
26
  //# sourceMappingURL=SideNavigationCategory.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SideNavigationCategory.js","sourceRoot":"","sources":["../../../../src/lib/components/navigation/SideNavigationCategory.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,WAAW,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE/C,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,EACrC,QAAQ,GAGT,EAAE,EAAE;IACH,MAAM,EAAE,YAAY,EAAE,GAAG,iBAAiB,EAAE,CAAC;IAC7C,MAAM,OAAO,GAAG,oBAAoB,EAAE,CAAC;IACvC,MAAM,QAAQ,GAAG,WAAW,EAA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ATTR = "data-anchor";
24
24
  export const SideNavigationItem = ({ category, item, activeAnchor, currentTopNavItem, basePath = "", }) => {
25
25
  const currentPath = isPathItem(item) ? joinPath(basePath, item.path) : "";
26
26
  const location = useLocation();
27
- const [isOpen, setIsOpen] = useNavigationCollapsibleState({
27
+ const collapsibleProps = useNavigationCollapsibleState({
28
28
  item,
29
29
  path: currentPath,
30
30
  defaultOpen: () => checkHasActiveItem(item, location.pathname, basePath),
@@ -36,7 +36,7 @@ export const SideNavigationItem = ({ category, item, activeAnchor, currentTopNav
36
36
  return item.href.startsWith("http") ? (_jsxs("a", { className: classes, href: item.href, target: "_blank", rel: "noopener noreferrer", children: [item.label, _jsx(ExternalLinkIcon, { size: 14 })] })) : (_jsx(NavLink, { className: classes, to: item.href, children: item.label }));
37
37
  }
38
38
  const linkContent = (_jsxs("div", { className: "flex justify-between w-full", children: [_jsxs("div", { className: "flex items-center gap-2 truncate w-full", children: [item.icon, typeof item.label !== "string" ? (item.label) : (_jsx("span", { className: "truncate", children: item.label }))] }), item.children && (_jsx(ChevronRightIcon, { size: 16, className: "transition shrink-0 group-data-[state=open]:rotate-90" }))] }));
39
- return (_jsx("li", { title: typeof item.label === "string" ? item.label : item.title, children: item.children ? (_jsxs(Collapsible.Root, { open: isOpen, onOpenChange: () => setIsOpen((prev) => !prev), className: "flex flex-col", children: [_jsx(Collapsible.Trigger, { className: cn("group text-start", navigationListItem({ isActive: false })), children: linkContent }), _jsx(Collapsible.Content, { className: "CollapsibleContent ms-[calc(var(--padding-nav-item)*1.125)]", children: _jsx("ul", { className: "mt-1 border-l ps-1.5", children: item.children.map((child) => (_jsx(SideNavigationItem, { category: category, item: child, activeAnchor: activeAnchor, currentTopNavItem: currentTopNavItem, basePath: currentPath }, isPathItem(child) ? child.path : child.href))) }) })] })) : item.path.startsWith("#") ? (_jsx(AnchorLink, { to: item.path, [DATA_ANCHOR_ATTR]: item.path, className: navigationListItem({
39
+ return (_jsx("li", { title: typeof item.label === "string" ? item.label : item.title, children: item.children ? (_jsxs(Collapsible.Root, { ...collapsibleProps, className: "flex flex-col", children: [_jsx(Collapsible.Trigger, { className: cn("group text-start", navigationListItem({ isActive: false })), children: linkContent }), _jsx(Collapsible.Content, { className: "CollapsibleContent ms-[calc(var(--padding-nav-item)*1.125)]", children: _jsx("ul", { className: "mt-1 border-l ps-1.5", children: item.children.map((child) => (_jsx(SideNavigationItem, { category: category, item: child, activeAnchor: activeAnchor, currentTopNavItem: currentTopNavItem, basePath: currentPath }, isPathItem(child) ? child.path : child.href))) }) })] })) : item.path.startsWith("#") ? (_jsx(AnchorLink, { to: item.path, [DATA_ANCHOR_ATTR]: item.path, className: navigationListItem({
40
40
  isActive: item.path.slice(1) === activeAnchor,
41
41
  isMuted: item.muted,
42
42
  }), children: linkContent })) : (_jsx(NavLink, { className: ({ isActive }) => navigationListItem({ isActive }), to: currentPath, children: linkContent })) }));
@@ -1 +1 @@
1
- {"version":3,"file":"SideNavigationItem.js","sourceRoot":"","sources":["../../../../src/lib/components/navigation/SideNavigationItem.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,WAAW,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAOxD,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvE,MAAM,kBAAkB,GAAG,GAAG,CAC5B,+FAA+F,EAC/F;IACE,Q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AAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAC5B,KAAC,kBAAkB,IAEjB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,KAAK,EACX,YAAY,EAAE,YAAY,EAC1B,iBAAiB,EAAE,iBAAiB,EACpC,QAAQ,EAAE,WAAW,IALhB,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAMhD,CACH,CAAC,GACC,GACe,IACL,CACpB,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAC9B,KAAC,UAAU,IACT,EAAE,EAAE,IAAI,CAAC,IAAI,EACP,CAAC,gBAAgB,CAAC,EAAE,IAAI,CAAC,IAAI,EACnC,SAAS,EAAE,kBAAkB,CAAC;gBAC5B,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,YAAY;gBAC7C,OAAO,EAAE,IAAI,CAAC,KAAK;aACpB,CAAC,YAED,WAAW,GACD,CACd,CAAC,CAAC,CAAC,CACF,KAAC,OAAO,IACN,SAAS,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,kBAAkB,CAAC,EAAE,QAAQ,EAAE,CAAC,EAC7D,EAAE,EAAE,WAAW,YAEd,WAAW,GACJ,CACX,GACE,CACN,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"file":"SideNavigationItem.js","sourceRoot":"","sources":["../../../../src/lib/components/navigation/SideNavigationItem.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,WAAW,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,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avigation.js";
2
3
  export declare const useNavigationCollapsibleState: ({ item, defaultOpen, path, }: {
3
4
  item: NavigationNode;
4
5
  defaultOpen: () => boolean;
5
6
  path: string;
6
- }) => readonly [boolean, import("react").Dispatch<import("react").SetStateAction<boolean>>];
7
+ }) => Partial<CollapsibleProps> & {
8
+ "data-animate": boolean;
9
+ };
@@ -2,15 +2,27 @@ import { useEffect, useRef, useState } from "react";
2
2
  import { useLocation } from "react-router-dom";
3
3
  import { checkHasActiveItem } from "./util.js";
4
4
  export const useNavigationCollapsibleState = ({ item, defaultOpen, path, }) => {
5
- const [isOpen, setIsOpen] = useState(defaultOpen);
5
+ const [open, setOpen] = useState(defaultOpen);
6
6
  const location = useLocation();
7
7
  const previousLocationPath = useRef(location.pathname);
8
+ const [shouldAnimate, setShouldAnimate] = useState(false);
8
9
  useEffect(() => {
9
- if (!isOpen && previousLocationPath.current !== location.pathname) {
10
- setIsOpen(checkHasActiveItem(item, location.pathname, path));
10
+ if (!open && previousLocationPath.current !== location.pathname) {
11
+ setOpen(checkHasActiveItem(item, location.pathname, path));
11
12
  }
12
13
  previousLocationPath.current = location.pathname;
13
- }, [isOpen, item, path, location.pathname]);
14
- return [isOpen, setIsOpen];
14
+ }, [open, item, path, location.pathname]);
15
+ const onOpenChange = () => {
16
+ setShouldAnimate(true);
17
+ setOpen((prev) => !prev);
18
+ };
19
+ useEffect(() => {
20
+ setShouldAnimate(false);
21
+ }, []);
22
+ return {
23
+ open,
24
+ onOpenChange,
25
+ "data-animate": shouldAnimate,
26
+ };
15
27
  };
16
28
  //# sourceMappingURL=useNavigationCollapsibleState.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useNavigationCollapsibleState.js","sourceRoot":"","sources":["../../../../src/lib/components/navigation/useNavigationCollapsibleState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,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QAAQ,CAAC,WAAW,CAAC,CAAC;IAC9C,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,MAAM,oBAAoB,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACvD,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE1D,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,IAAI,IAAI,oBAAoB,CAAC,OAAO,KAAK,QAAQ,CAAC,QAAQ,EAAE,CAAC;YAChE,OAAO,CAAC,kBAAkB,CAAC,IAAI,EAAE,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;QAC7D,CAAC;QACD,oBAAoB,CAAC,OAAO,GAAG,QAAQ,CAAC,QAAQ,CAAC;IACnD,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;IAE1C,MAAM,YAAY,GAAG,GAAG,EAAE;QACxB,gBAAgB,CAAC,IAAI,CAAC,CAAC;QACvB,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO;QACL,IAAI;QACJ,YAAY;QACZ,cAAc,EAAE,aAAa;KAC9B,CAAC;AACJ,CAAC,CAAC"}
@@ -15,26 +15,34 @@ const TocItem = ({ item, children, className, isActive, }) => {
15
15
  export const Toc = ({ entries }) => {
16
16
  const { activeAnchor } = useViewportAnchor();
17
17
  const listWrapperRef = useRef(null);
18
- const [indicatorStyle, setIndicatorStyles] = useState({});
18
+ const paintedOnce = useRef(false);
19
+ const [indicatorStyle, setIndicatorStyles] = useState({
20
+ top: 0,
21
+ opacity: 0,
22
+ });
19
23
  // synchronize active anchor indicator with the scroll position
20
24
  useEffect(() => {
21
25
  if (!listWrapperRef.current)
22
26
  return;
23
27
  const activeElement = listWrapperRef.current.querySelector(`[${DATA_ANCHOR_ATTR}='${activeAnchor}']`);
24
28
  if (!activeElement) {
25
- setIndicatorStyles({
26
- "--indicator-top": "0",
27
- "--indicator-opacity": 0,
28
- });
29
+ setIndicatorStyles({ top: 0, opacity: 0 });
29
30
  return;
30
31
  }
31
32
  const topParent = listWrapperRef.current.getBoundingClientRect().top;
32
33
  const topElement = activeElement.getBoundingClientRect().top;
33
34
  setIndicatorStyles({
34
- "--indicator-top": `${topElement - topParent}px`,
35
- "--indicator-opacity": 1,
35
+ opacity: 1,
36
+ top: `${topElement - topParent}px`,
37
+ });
38
+ if (paintedOnce.current)
39
+ return;
40
+ // after all is painted, the indicator should animate
41
+ requestIdleCallback(() => {
42
+ paintedOnce.current = true;
36
43
  });
37
44
  }, [activeAnchor]);
38
- return (_jsxs("aside", { className: "sticky top-[--header-height] h-[calc(100vh-var(--header-height))] pt-[--padding-content-top] pb-[--padding-content-bottom] overflow-y-auto ps-1 text-sm", children: [_jsxs("div", { className: "flex items-center gap-2 font-medium mb-2", children: [_jsx(ListTreeIcon, { size: 16 }), "On this page"] }), _jsx("ul", { ref: listWrapperRef, style: indicatorStyle, className: cn("relative ms-2 ps-4 font-medium list-none mt-0 space-y-2", "before:absolute before:inset-0 before:right-auto before:bg-border before:w-[2px]", "after:absolute after:-left-px after:-translate-y-1 after:top-[--indicator-top] after:opacity-[--indicator-opacity] after:h-6 after:bg-primary after:w-[4px] after:rounded after:ease-out after:[transition:top__150ms,opacity_325ms]"), children: entries.map((item) => (_jsx(TocItem, { isActive: item.id === activeAnchor, item: item, className: "pl-0", children: item.children && (_jsx("ul", { className: "list-none pl-4 pt-2 space-y-2", children: item.children.map((child) => (_jsx(TocItem, { item: child, isActive: child.id === activeAnchor }, child.id))) })) }, item.id))) })] }));
45
+ return (_jsxs("aside", { className: "sticky top-[--header-height] h-[calc(100vh-var(--header-height))] pt-[--padding-content-top] pb-[--padding-content-bottom] overflow-y-auto ps-1 text-sm", children: [_jsxs("div", { className: "flex items-center gap-2 font-medium mb-2", children: [_jsx(ListTreeIcon, { size: 16 }), "On this page"] }), _jsxs("div", { className: "relative ms-2 ps-4", children: [_jsx("div", { className: "absolute inset-0 right-auto bg-border w-[2px]" }), _jsx("div", { className: cn("absolute -left-px -translate-y-1 h-6 w-[4px] rounded bg-primary", paintedOnce.current &&
46
+ "ease-out [transition:top_150ms,opacity_325ms]"), style: indicatorStyle }), _jsx("ul", { ref: listWrapperRef, className: "relative font-medium list-none space-y-2", children: entries.map((item) => (_jsx(TocItem, { isActive: item.id === activeAnchor, item: item, className: "pl-0", children: item.children && (_jsx("ul", { className: "list-none pl-4 pt-2 space-y-2", children: item.children.map((child) => (_jsx(TocItem, { item: child, isActive: child.id === activeAnchor }, child.id))) })) }, item.id))) })] })] }));
39
47
  };
40
48
  //# sourceMappingURL=Toc.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Toc.js","sourceRoot":"","sources":["../../../../src/lib/plugins/markdown/Toc.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EACL,SAAS,EACT,MAAM,EACN,QAAQ,GAGT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mDAAmD,CAAC;AACtF,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAEtC,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAEvC,MAAM,OAAO,GAAG,CAAC,EACf,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,QAAQ,GAKR,EAAE,EAAE;IACJ,OAAO,CACL,cACE,SAAS,EAAE,EAAE,CACX,UAAU,EACV,QAAQ;YACN,CAAC,CAAC,cAAc;YAChB,CAAC,CAAC,4C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ACX,QAAQ,EAAE,KAAK,CAAC,EAAE,KAAK,YAAY,IAC9B,KAAK,CAAC,EAAE,CACb,CACH,CAAC,GACC,CACN,IAdI,IAAI,CAAC,EAAE,CAeJ,CACX,CAAC,GACC,IACD,IACA,CACT,CAAC;AACJ,CAAC,CAAC"}
@@ -1,9 +1,9 @@
1
- import { j as e, a as I } from "./jsx-runtime-BIr0WBt_.js";
2
- import { A as _, a as E, u as $ } from "./AnchorLink-Bj1hwDuD.js";
3
- import { useRef as q, useState as z, useEffect as B, useMemo as D } from "react";
4
- import { c as F, e as V, a as g, P as W, H as u, L as T } from "./Markdown-BjRJKl_E.js";
1
+ import { j as e, a as E } from "./jsx-runtime-BIr0WBt_.js";
2
+ import { A as _, a as $, u as q } from "./AnchorLink-Bj1hwDuD.js";
3
+ import { useRef as T, useState as z, useEffect as B, useMemo as D } from "react";
4
+ import { c as F, e as V, a as g, P as W, H as v, L as A } from "./Markdown-BjRJKl_E.js";
5
5
  import { C as X } from "./CategoryHeading-DMkTmmBh.js";
6
- import { v as G, z as A, l as M } from "./DevPortalProvider-BBhQ8kgI.js";
6
+ import { v as G, z as M, l as P } from "./DevPortalProvider-BBhQ8kgI.js";
7
7
  import { s as J } from "./slugify-CiPVjteN.js";
8
8
  /**
9
9
  * @license lucide-react v0.378.0 - ISC
@@ -17,119 +17,129 @@ const K = F("ListTree", [
17
17
  ["path", { d: "M21 18h-8", key: "1tm79t" }],
18
18
  ["path", { d: "M3 6v4c0 1.1.9 2 2 2h3", key: "1ywdgy" }],
19
19
  ["path", { d: "M3 10v6c0 1.1.9 2 2 2h3", key: "2wc746" }]
20
- ]), H = "data-active", P = ({
21
- item: s,
20
+ ]), H = "data-active", C = ({
21
+ item: r,
22
22
  children: t,
23
- className: r,
24
- isActive: o
23
+ className: s,
24
+ isActive: a
25
25
  }) => /* @__PURE__ */ e.jsxs(
26
26
  "li",
27
27
  {
28
28
  className: g(
29
29
  "truncate",
30
- o ? "text-primary" : "text-foreground/65 dark:text-foreground/75",
31
- r
30
+ a ? "text-primary" : "text-foreground/65 dark:text-foreground/75",
31
+ s
32
32
  ),
33
- title: s.value,
33
+ title: r.value,
34
34
  children: [
35
35
  /* @__PURE__ */ e.jsx(
36
36
  _,
37
37
  {
38
- to: `#${s.id}`,
39
- [H]: s.id,
38
+ to: `#${r.id}`,
39
+ [H]: r.id,
40
40
  className: g(
41
- o ? "text-primary" : "text-foreground/65 dark:text-foreground/75 hover:text-foreground"
41
+ a ? "text-primary" : "text-foreground/65 dark:text-foreground/75 hover:text-foreground"
42
42
  ),
43
- children: s.value
43
+ children: r.value
44
44
  }
45
45
  ),
46
46
  t
47
47
  ]
48
48
  }
49
- ), Q = ({ entries: s }) => {
50
- const { activeAnchor: t } = V(), r = q(null), [o, n] = z({});
49
+ ), Q = ({ entries: r }) => {
50
+ const { activeAnchor: t } = V(), s = T(null), a = T(!1), [c, d] = z({
51
+ top: 0,
52
+ opacity: 0
53
+ });
51
54
  return B(() => {
52
- if (!r.current) return;
53
- const a = r.current.querySelector(
55
+ if (!s.current) return;
56
+ const i = s.current.querySelector(
54
57
  `[${H}='${t}']`
55
58
  );
56
- if (!a) {
57
- n({
58
- "--indicator-top": "0",
59
- "--indicator-opacity": 0
60
- });
59
+ if (!i) {
60
+ d({ top: 0, opacity: 0 });
61
61
  return;
62
62
  }
63
- const l = r.current.getBoundingClientRect().top, d = a.getBoundingClientRect().top;
64
- n({
65
- "--indicator-top": `${d - l}px`,
66
- "--indicator-opacity": 1
63
+ const n = s.current.getBoundingClientRect().top, u = i.getBoundingClientRect().top;
64
+ d({
65
+ opacity: 1,
66
+ top: `${u - n}px`
67
+ }), !a.current && requestIdleCallback(() => {
68
+ a.current = !0;
67
69
  });
68
70
  }, [t]), /* @__PURE__ */ e.jsxs("aside", { className: "sticky top-[--header-height] h-[calc(100vh-var(--header-height))] pt-[--padding-content-top] pb-[--padding-content-bottom] overflow-y-auto ps-1 text-sm", children: [
69
71
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 font-medium mb-2", children: [
70
72
  /* @__PURE__ */ e.jsx(K, { size: 16 }),
71
73
  "On this page"
72
74
  ] }),
73
- /* @__PURE__ */ e.jsx(
74
- "ul",
75
- {
76
- ref: r,
77
- style: o,
78
- className: g(
79
- "relative ms-2 ps-4 font-medium list-none mt-0 space-y-2",
80
- "before:absolute before:inset-0 before:right-auto before:bg-border before:w-[2px]",
81
- "after:absolute after:-left-px after:-translate-y-1 after:top-[--indicator-top] after:opacity-[--indicator-opacity] after:h-6 after:bg-primary after:w-[4px] after:rounded after:ease-out after:[transition:top__150ms,opacity_325ms]"
82
- ),
83
- children: s.map((a) => /* @__PURE__ */ e.jsx(
84
- P,
85
- {
86
- isActive: a.id === t,
87
- item: a,
88
- className: "pl-0",
89
- children: a.children && /* @__PURE__ */ e.jsx("ul", { className: "list-none pl-4 pt-2 space-y-2", children: a.children.map((l) => /* @__PURE__ */ e.jsx(
90
- P,
91
- {
92
- item: l,
93
- isActive: l.id === t
94
- },
95
- l.id
96
- )) })
97
- },
98
- a.id
99
- ))
100
- }
101
- )
75
+ /* @__PURE__ */ e.jsxs("div", { className: "relative ms-2 ps-4", children: [
76
+ /* @__PURE__ */ e.jsx("div", { className: "absolute inset-0 right-auto bg-border w-[2px]" }),
77
+ /* @__PURE__ */ e.jsx(
78
+ "div",
79
+ {
80
+ className: g(
81
+ "absolute -left-px -translate-y-1 h-6 w-[4px] rounded bg-primary",
82
+ a.current && "ease-out [transition:top_150ms,opacity_325ms]"
83
+ ),
84
+ style: c
85
+ }
86
+ ),
87
+ /* @__PURE__ */ e.jsx(
88
+ "ul",
89
+ {
90
+ ref: s,
91
+ className: "relative font-medium list-none space-y-2",
92
+ children: r.map((i) => /* @__PURE__ */ e.jsx(
93
+ C,
94
+ {
95
+ isActive: i.id === t,
96
+ item: i,
97
+ className: "pl-0",
98
+ children: i.children && /* @__PURE__ */ e.jsx("ul", { className: "list-none pl-4 pt-2 space-y-2", children: i.children.map((n) => /* @__PURE__ */ e.jsx(
99
+ C,
100
+ {
101
+ item: n,
102
+ isActive: n.id === t
103
+ },
104
+ n.id
105
+ )) })
106
+ },
107
+ i.id
108
+ ))
109
+ }
110
+ )
111
+ ] })
102
112
  ] });
103
113
  }, U = {
104
- h2: ({ children: s, id: t }) => /* @__PURE__ */ e.jsx(u, { level: 2, id: t, registerSidebarAnchor: !0, children: s }),
105
- h3: ({ children: s, id: t }) => /* @__PURE__ */ e.jsxs(u, { level: 3, id: t, registerSidebarAnchor: !0, children: [
114
+ h2: ({ children: r, id: t }) => /* @__PURE__ */ e.jsx(v, { level: 2, id: t, registerSidebarAnchor: !0, children: r }),
115
+ h3: ({ children: r, id: t }) => /* @__PURE__ */ e.jsxs(v, { level: 3, id: t, registerSidebarAnchor: !0, children: [
106
116
  " ",
107
- s
117
+ r
108
118
  ] })
109
119
  }, ae = ({
110
- mdxComponent: s,
120
+ mdxComponent: r,
111
121
  frontmatter: t = {},
112
- defaultOptions: r,
113
- tableOfContents: o
122
+ defaultOptions: s,
123
+ tableOfContents: a
114
124
  }) => {
115
- var y, b;
116
- const n = G(), a = I(), l = n ? A(n, (i, x, m) => {
117
- var c;
118
- if (x === a.pathname)
119
- return (c = m.at(0)) == null ? void 0 : c.label;
120
- }) : void 0, d = t.title, f = t.category ?? l, L = t.toc === !1 || (r == null ? void 0 : r.toc) === !1, R = ((y = o.find((i) => i.depth === 1)) == null ? void 0 : y.value) ?? d, S = t.disablePager ?? (r == null ? void 0 : r.disablePager) ?? !1, v = ((b = o.find((i) => i.depth === 1)) == null ? void 0 : b.children) ?? // if `title` is provided by frontmatter it does not appear in the table of contents
121
- o.filter((i) => i.depth === 2), C = !L && v.length > 0, { prev: p, next: h } = D(() => {
122
- let i = { path: "", label: "" }, x = { path: "", label: "" }, m = !1;
123
- return n ? (A(n, (c, j) => {
125
+ var j, y;
126
+ const c = G(), d = E(), i = c ? M(c, (l, x, m) => {
127
+ var o;
128
+ if (x === d.pathname)
129
+ return (o = m.at(0)) == null ? void 0 : o.label;
130
+ }) : void 0, n = t.title, u = t.category ?? i, I = t.toc === !1 || (s == null ? void 0 : s.toc) === !1, L = ((j = a.find((l) => l.depth === 1)) == null ? void 0 : j.value) ?? n, R = t.disablePager ?? (s == null ? void 0 : s.disablePager) ?? !1, f = ((y = a.find((l) => l.depth === 1)) == null ? void 0 : y.children) ?? // if `title` is provided by frontmatter it does not appear in the table of contents
131
+ a.filter((l) => l.depth === 2), S = !I && f.length > 0, { prev: p, next: h } = D(() => {
132
+ let l = { path: "", label: "" }, x = { path: "", label: "" }, m = !1;
133
+ return c ? (M(c, (o, b) => {
124
134
  var w, k;
125
- const N = { path: j, label: c.label };
126
- if (m && M(c) && !((w = c.children) != null && w.length))
135
+ const N = { path: b, label: o.label };
136
+ if (m && P(o) && !((w = o.children) != null && w.length))
127
137
  return x = N, !0;
128
- j === a.pathname && (m = !0), !m && M(c) && !((k = c.children) != null && k.length) && (i = N);
129
- }), { prev: i, next: x }) : { prev: i, next: x };
130
- }, [n, a.pathname]);
138
+ b === d.pathname && (m = !0), !m && P(o) && !((k = o.children) != null && k.length) && (l = N);
139
+ }), { prev: l, next: x }) : { prev: l, next: x };
140
+ }, [c, d.pathname]);
131
141
  return /* @__PURE__ */ e.jsxs("div", { className: "xl:grid grid-cols-[--sidecar-grid-cols] gap-8 justify-between", children: [
132
- /* @__PURE__ */ e.jsx(E, { children: /* @__PURE__ */ e.jsx("title", { children: R }) }),
142
+ /* @__PURE__ */ e.jsx($, { children: /* @__PURE__ */ e.jsx("title", { children: L }) }),
133
143
  /* @__PURE__ */ e.jsxs(
134
144
  "div",
135
145
  {
@@ -139,21 +149,21 @@ const K = F("ListTree", [
139
149
  ),
140
150
  children: [
141
151
  /* @__PURE__ */ e.jsxs("header", { children: [
142
- f && /* @__PURE__ */ e.jsx(X, { children: f }),
143
- d && /* @__PURE__ */ e.jsx(u, { level: 1, id: J(d, { lower: !0 }), children: d }),
152
+ u && /* @__PURE__ */ e.jsx(X, { children: u }),
153
+ n && /* @__PURE__ */ e.jsx(v, { level: 1, id: J(n, { lower: !0 }), children: n }),
144
154
  t.description && /* @__PURE__ */ e.jsx("p", { className: "prose-lg", children: t.description })
145
155
  ] }),
146
156
  /* @__PURE__ */ e.jsx(
147
- s,
157
+ r,
148
158
  {
149
- components: { ...$(), ...U }
159
+ components: { ...q(), ...U }
150
160
  }
151
161
  ),
152
- !S && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
162
+ !R && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
153
163
  /* @__PURE__ */ e.jsx("hr", {}),
154
164
  /* @__PURE__ */ e.jsxs("div", { className: "not-prose flex items-center justify-between gap-8", children: [
155
165
  p.path ? /* @__PURE__ */ e.jsxs(
156
- T,
166
+ A,
157
167
  {
158
168
  to: p.path,
159
169
  className: "flex flex-col items-stretch gap-2 flex-1 truncate border rounded px-6 py-4 text-start hover:border-primary/85 transition shadow-sm hover:shadow-md",
@@ -165,7 +175,7 @@ const K = F("ListTree", [
165
175
  }
166
176
  ) : /* @__PURE__ */ e.jsx("div", { className: "flex-1" }),
167
177
  h.path ? /* @__PURE__ */ e.jsxs(
168
- T,
178
+ A,
169
179
  {
170
180
  to: h.path,
171
181
  className: "flex flex-col items-stretch gap-2 flex-1 truncate border rounded px-6 py-4 text-end hover:border-primary/85 transition shadow-sm hover:shadow-md",
@@ -181,10 +191,10 @@ const K = F("ListTree", [
181
191
  ]
182
192
  }
183
193
  ),
184
- /* @__PURE__ */ e.jsx("div", { className: "hidden xl:block", children: C && /* @__PURE__ */ e.jsx(Q, { entries: v }) })
194
+ /* @__PURE__ */ e.jsx("div", { className: "hidden xl:block", children: S && /* @__PURE__ */ e.jsx(Q, { entries: f }) })
185
195
  ] });
186
196
  };
187
197
  export {
188
198
  ae as MdxPage
189
199
  };
190
- //# sourceMappingURL=MdxPage-DJTFOCbZ.js.map
200
+ //# sourceMappingURL=MdxPage-BjOLKhCI.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MdxPage-BjOLKhCI.js","sources":["../../../node_modules/.pnpm/lucide-react@0.378.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/list-tree.js","../src/lib/plugins/markdown/Toc.tsx","../src/lib/plugins/markdown/MdxPage.tsx"],"sourcesContent":["/**\n * @license lucide-react v0.378.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst ListTree = createLucideIcon(\"ListTree\", [\n [\"path\", { d: \"M21 12h-8\", key: \"1bmf0i\" }],\n [\"path\", { d: \"M21 6H8\", key: \"1pqkrb\" }],\n [\"path\", { d: \"M21 18h-8\", key: \"1tm79t\" }],\n [\"path\", { d: \"M3 6v4c0 1.1.9 2 2 2h3\", key: \"1ywdgy\" }],\n [\"path\", { d: \"M3 10v6c0 1.1.9 2 2 2h3\", key: \"2wc746\" }]\n]);\n\nexport { ListTree as default };\n//# sourceMappingURL=list-tree.js.map\n","import type { TocEntry } from \"@stefanprobst/rehype-extract-toc\";\nimport { ListTreeIcon } from \"lucide-react\";\nimport {\n useEffect,\n useRef,\n useState,\n type CSSProperties,\n type PropsWithChildren,\n} from \"react\";\nimport { AnchorLink } from \"../../components/AnchorLink.js\";\nimport { useViewportAnchor } from \"../../components/context/ViewportAnchorContext.js\";\nimport { cn } from \"../../util/cn.js\";\n\nconst DATA_ANCHOR_ATTR = \"data-active\";\n\nconst TocItem = ({\n item,\n children,\n className,\n isActive,\n}: PropsWithChildren<{\n item: TocEntry;\n isActive: boolean;\n className?: string;\n}>) => {\n return (\n <li\n className={cn(\n \"truncate\",\n isActive\n ? \"text-primary\"\n : \"text-foreground/65 dark:text-foreground/75\",\n className,\n )}\n title={item.value}\n >\n <AnchorLink\n to={`#${item.id}`}\n {...{ [DATA_ANCHOR_ATTR]: item.id }}\n className={cn(\n isActive\n ? \"text-primary\"\n : \"text-foreground/65 dark:text-foreground/75 hover:text-foreground\",\n )}\n >\n {item.value}\n </AnchorLink>\n {children}\n </li>\n );\n};\n\nexport const Toc = ({ entries }: { entries: TocEntry[] }) => {\n const { activeAnchor } = useViewportAnchor();\n const listWrapperRef = useRef<HTMLUListElement>(null);\n const paintedOnce = useRef(false);\n const [indicatorStyle, setIndicatorStyles] = useState<CSSProperties>({\n top: 0,\n opacity: 0,\n });\n\n // synchronize active anchor indicator with the scroll position\n useEffect(() => {\n if (!listWrapperRef.current) return;\n\n const activeElement = listWrapperRef.current.querySelector(\n `[${DATA_ANCHOR_ATTR}='${activeAnchor}']`,\n );\n\n if (!activeElement) {\n setIndicatorStyles({ top: 0, opacity: 0 });\n return;\n }\n\n const topParent = listWrapperRef.current.getBoundingClientRect().top;\n const topElement = activeElement.getBoundingClientRect().top;\n\n setIndicatorStyles({\n opacity: 1,\n top: `${topElement - topParent}px`,\n });\n\n if (paintedOnce.current) return;\n\n // after all is painted, the indicator should animate\n requestIdleCallback(() => {\n paintedOnce.current = true;\n });\n }, [activeAnchor]);\n\n return (\n <aside className=\"sticky top-[--header-height] h-[calc(100vh-var(--header-height))] pt-[--padding-content-top] pb-[--padding-content-bottom] overflow-y-auto ps-1 text-sm\">\n <div className=\"flex items-center gap-2 font-medium mb-2\">\n <ListTreeIcon size={16} />\n On this page\n </div>\n <div className=\"relative ms-2 ps-4\">\n <div className=\"absolute inset-0 right-auto bg-border w-[2px]\" />\n <div\n className={cn(\n \"absolute -left-px -translate-y-1 h-6 w-[4px] rounded bg-primary\",\n paintedOnce.current &&\n \"ease-out [transition:top_150ms,opacity_325ms]\",\n )}\n style={indicatorStyle}\n />\n <ul\n ref={listWrapperRef}\n className=\"relative font-medium list-none space-y-2\"\n >\n {entries.map((item) => (\n <TocItem\n isActive={item.id === activeAnchor}\n key={item.id}\n item={item}\n className=\"pl-0\"\n >\n {item.children && (\n <ul className=\"list-none pl-4 pt-2 space-y-2\">\n {item.children.map((child) => (\n <TocItem\n item={child}\n isActive={child.id === activeAnchor}\n key={child.id}\n />\n ))}\n </ul>\n )}\n </TocItem>\n ))}\n </ul>\n </div>\n </aside>\n );\n};\n","import { useMDXComponents } from \"@mdx-js/react\";\nimport { Helmet } from \"@zudoku/react-helmet-async\";\nimport { useMemo, type PropsWithChildren, type ReactNode } from \"react\";\nimport { Link, useLocation } from \"react-router-dom\";\nimport { CategoryHeading } from \"../../components/CategoryHeading.js\";\nimport { Heading } from \"../../components/Heading.js\";\nimport { ProseClasses } from \"../../components/Markdown.js\";\nimport { useTopNavigationItem } from \"../../components/context/DevPortalProvider.js\";\nimport { isPathItem } from \"../../components/navigation/util.js\";\nimport type { MdxComponentsType } from \"../../util/MdxComponents.js\";\nimport { cn } from \"../../util/cn.js\";\nimport slugify from \"../../util/slugify.js\";\nimport { traverseNavigation } from \"../../util/traverseNavigation.js\";\nimport { Toc } from \"./Toc.js\";\nimport { MarkdownPluginDefaultOptions, MDXImport } from \"./index.js\";\n\nconst MarkdownHeadings = {\n h2: ({ children, id }) => (\n <Heading level={2} id={id} registerSidebarAnchor>\n {children}\n </Heading>\n ),\n h3: ({ children, id }) => (\n <Heading level={3} id={id} registerSidebarAnchor>\n {\" \"}\n {children}\n </Heading>\n ),\n} satisfies MdxComponentsType;\n\nexport const MdxPage = ({\n mdxComponent: MdxComponent,\n frontmatter = {},\n defaultOptions,\n tableOfContents,\n}: PropsWithChildren<\n Omit<MDXImport, \"default\"> & {\n mdxComponent: MDXImport[\"default\"];\n defaultOptions?: MarkdownPluginDefaultOptions;\n }\n>) => {\n const navItem = useTopNavigationItem();\n const location = useLocation();\n\n const categoryTitle = navItem\n ? traverseNavigation(navItem, (_node, fullPath, parentNodes) => {\n if (fullPath === location.pathname) {\n return parentNodes.at(0)?.label;\n }\n })\n : undefined;\n\n const title = frontmatter.title;\n const category = frontmatter.category ?? categoryTitle;\n const hideToc = frontmatter.toc === false || defaultOptions?.toc === false;\n const pageTitle =\n tableOfContents.find((item) => item.depth === 1)?.value ?? title;\n const hidePager =\n frontmatter.disablePager ?? defaultOptions?.disablePager ?? false;\n\n const tocEntries =\n tableOfContents.find((item) => item.depth === 1)?.children ??\n // if `title` is provided by frontmatter it does not appear in the table of contents\n tableOfContents.filter((item) => item.depth === 2);\n\n const showToc = !hideToc && tocEntries.length > 0;\n\n const { prev, next } = useMemo(() => {\n let prev = { path: \"\", label: \"\" as ReactNode };\n let next = { path: \"\", label: \"\" as ReactNode };\n let shouldStop = false;\n\n if (!navItem) return { prev, next };\n\n traverseNavigation(navItem, (node, fullPath) => {\n const item = { path: fullPath, label: node.label };\n\n if (shouldStop && isPathItem(node) && !node.children?.length) {\n next = item;\n return true;\n }\n if (fullPath === location.pathname) {\n shouldStop = true;\n }\n if (!shouldStop && isPathItem(node) && !node.children?.length) {\n prev = item;\n }\n });\n\n return { prev, next } as const;\n }, [navItem, location.pathname]);\n\n return (\n <div className=\"xl:grid grid-cols-[--sidecar-grid-cols] gap-8 justify-between\">\n <Helmet>\n <title>{pageTitle}</title>\n </Helmet>\n <div\n className={cn(\n ProseClasses,\n \"max-w-full xl:w-full xl:max-w-prose flex-1 flex-shrink pt-[--padding-content-top] pb-[--padding-content-bottom]\",\n )}\n >\n <header>\n {category && <CategoryHeading>{category}</CategoryHeading>}\n {title && (\n <Heading level={1} id={slugify(title, { lower: true })}>\n {title}\n </Heading>\n )}\n {frontmatter.description && (\n <p className=\"prose-lg\">{frontmatter.description}</p>\n )}\n </header>\n <MdxComponent\n components={{ ...useMDXComponents(), ...MarkdownHeadings }}\n />\n {!hidePager && (\n <>\n <hr />\n <div className=\"not-prose flex items-center justify-between gap-8\">\n {prev.path ? (\n <Link\n to={prev.path}\n className=\"flex flex-col items-stretch gap-2 flex-1 truncate border rounded px-6 py-4 text-start hover:border-primary/85 transition shadow-sm hover:shadow-md\"\n title={\n typeof prev.label === \"string\" ? prev.label : undefined\n }\n >\n <div className=\"text-sm text-muted-foreground\">\n ← Previous page\n </div>\n <div className=\"text-lg text-primary truncate\">\n {prev.label}\n </div>\n </Link>\n ) : (\n <div className=\"flex-1\" />\n )}\n {next.path ? (\n <Link\n to={next.path}\n className=\"flex flex-col items-stretch gap-2 flex-1 truncate border rounded px-6 py-4 text-end hover:border-primary/85 transition shadow-sm hover:shadow-md\"\n title={\n typeof next.label === \"string\" ? next.label : undefined\n }\n >\n <div className=\"text-sm text-muted-foreground\">\n Next page →\n </div>\n <div className=\"text-lg text-primary truncate\">\n {next.label}\n </div>\n </Link>\n ) : (\n <div className=\"flex-1\" />\n )}\n </div>\n </>\n )}\n </div>\n <div className=\"hidden xl:block\">\n {showToc && <Toc entries={tocEntries} />}\n </div>\n </div>\n );\n};\n"],"names":["ListTree","createLucideIcon","DATA_ANCHOR_ATTR","TocItem","item","children","className","isActive","jsxs","cn","jsx","AnchorLink","Toc","entries","activeAnchor","useViewportAnchor","listWrapperRef","useRef","paintedOnce","indicatorStyle","setIndicatorStyles","useState","useEffect","activeElement","topParent","topElement","ListTreeIcon","child","MarkdownHeadings","id","Heading","MdxPage","MdxComponent","frontmatter","defaultOptions","tableOfContents","navItem","useTopNavigationItem","location","useLocation","categoryTitle","traverseNavigation","_node","fullPath","parentNodes","_a","title","category","hideToc","pageTitle","hidePager","tocEntries","_b","showToc","prev","next","useMemo","shouldStop","node","isPathItem","Helmet","ProseClasses","CategoryHeading","slugify","useMDXComponents","Fragment","Link"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,IAAWC,EAAiB,YAAY;AAAA,EAC5C,CAAC,QAAQ,EAAE,GAAG,aAAa,KAAK,SAAQ,CAAE;AAAA,EAC1C,CAAC,QAAQ,EAAE,GAAG,WAAW,KAAK,SAAQ,CAAE;AAAA,EACxC,CAAC,QAAQ,EAAE,GAAG,aAAa,KAAK,SAAQ,CAAE;AAAA,EAC1C,CAAC,QAAQ,EAAE,GAAG,0BAA0B,KAAK,SAAQ,CAAE;AAAA,EACvD,CAAC,QAAQ,EAAE,GAAG,2BAA2B,KAAK,SAAQ,CAAE;AAC1D,CAAC,GCFKC,IAAmB,eAEnBC,IA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