@photon-ai/pho-ui 4.26.0 → 4.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/chunks/{avatar-PgBOfszL.js → avatar-BJvgi8ON.js} +24 -30
- package/dist/chunks/avatar-BJvgi8ON.js.map +1 -0
- package/dist/chunks/{basic-page-aep8pM4s.js → basic-page-DSPzDKrZ.js} +79 -82
- package/dist/chunks/basic-page-DSPzDKrZ.js.map +1 -0
- package/dist/chunks/{box-search-CMl5bQ7Y.js → box-search-DD2EPtDy.js} +18 -19
- package/dist/chunks/box-search-DD2EPtDy.js.map +1 -0
- package/dist/chunks/{calendar-DDWITGo4.js → calendar-s-QRks1Z.js} +66 -69
- package/dist/chunks/calendar-s-QRks1Z.js.map +1 -0
- package/dist/chunks/{chat-D98GCjbe.js → chat-D6SGRahp.js} +226 -276
- package/dist/chunks/chat-D6SGRahp.js.map +1 -0
- package/dist/chunks/{checkbox-D8smFViR.js → checkbox-B3fVczYP.js} +2 -2
- package/dist/chunks/checkbox-B3fVczYP.js.map +1 -0
- package/dist/chunks/{close-button-Ck4rY1Fp.js → close-button-Bwv_OoCZ.js} +2 -2
- package/dist/chunks/close-button-Bwv_OoCZ.js.map +1 -0
- package/dist/chunks/{code-block-CthLWfxd.js → code-block-CiZWZBO2.js} +169 -238
- package/dist/chunks/code-block-CiZWZBO2.js.map +1 -0
- package/dist/chunks/copy-button-DNNZu6r4.js +69 -0
- package/dist/chunks/copy-button-DNNZu6r4.js.map +1 -0
- package/dist/chunks/{data-table-C1tLUdw0.js → data-table-CshUlqIu.js} +11 -12
- package/dist/chunks/data-table-CshUlqIu.js.map +1 -0
- package/dist/chunks/{date-picker-D-sWo3i8.js → date-picker-BaAkim2u.js} +126 -151
- package/dist/chunks/date-picker-BaAkim2u.js.map +1 -0
- package/dist/chunks/{description-list-DcTvBHzI.js → description-list-VTNz1MmJ.js} +2 -2
- package/dist/chunks/{description-list-DcTvBHzI.js.map → description-list-VTNz1MmJ.js.map} +1 -1
- package/dist/chunks/{dialog-H72fZGtf.js → dialog-C116Qr0w.js} +2 -2
- package/dist/chunks/{dialog-H72fZGtf.js.map → dialog-C116Qr0w.js.map} +1 -1
- package/dist/chunks/{filter-bar-D_sBAT5Y.js → filter-bar-DI5JO1Cd.js} +63 -72
- package/dist/chunks/filter-bar-DI5JO1Cd.js.map +1 -0
- package/dist/chunks/{ghost-search-CMUI2UH0.js → ghost-search-DhADxaWi.js} +11 -12
- package/dist/chunks/ghost-search-DhADxaWi.js.map +1 -0
- package/dist/chunks/icons-eq5FZ3Yc.js +1254 -0
- package/dist/chunks/icons-eq5FZ3Yc.js.map +1 -0
- package/dist/chunks/{input-DWnb33UF.js → input-hrrPhzXp.js} +37 -56
- package/dist/chunks/input-hrrPhzXp.js.map +1 -0
- package/dist/chunks/{select-Dux2SBVc.js → select-DlyDd7AB.js} +10 -10
- package/dist/chunks/select-DlyDd7AB.js.map +1 -0
- package/dist/chunks/{sidebar-ttBkgGRh.js → sidebar-DTRcoxrB.js} +95 -111
- package/dist/chunks/sidebar-DTRcoxrB.js.map +1 -0
- package/dist/chunks/{toast-Cbnn8lcA.js → toast-Btwu5Kjk.js} +7 -7
- package/dist/chunks/toast-Btwu5Kjk.js.map +1 -0
- package/dist/chunks/{trace-ClMpG82z.js → trace-CKYAff2U.js} +498 -607
- package/dist/chunks/trace-CKYAff2U.js.map +1 -0
- package/dist/components/avatar.js +1 -1
- package/dist/components/button.js +1 -1
- package/dist/components/calendar.js +1 -1
- package/dist/components/chat.js +1 -1
- package/dist/components/checkbox.js +1 -1
- package/dist/components/code-block.js +1 -1
- package/dist/components/command.js +36 -37
- package/dist/components/command.js.map +1 -1
- package/dist/components/copy-button.js +1 -1
- package/dist/components/data-table.js +2 -2
- package/dist/components/date-picker.js +1 -1
- package/dist/components/description-list.js +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/error.js +252 -11
- package/dist/components/error.js.map +1 -0
- package/dist/components/filter-bar.js +1 -1
- package/dist/components/input.js +1 -1
- package/dist/components/notification.js +27 -34
- package/dist/components/notification.js.map +1 -1
- package/dist/components/phone-input.js +3 -4
- package/dist/components/phone-input.js.map +1 -1
- package/dist/components/scope.js +52 -53
- package/dist/components/scope.js.map +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/theme-toggle.js +69 -95
- package/dist/components/theme-toggle.js.map +1 -1
- package/dist/components/toast.js +1 -1
- package/dist/components/trace.js +1 -1
- package/dist/icons.js +235 -78
- package/dist/icons.js.map +1 -1
- package/dist/index.js +158 -158
- package/dist/sections/basic-page.js +2 -2
- package/dist/sections/sidebar.js +1 -1
- package/dist/src/components/avatar/avatar.d.ts +1 -1
- package/dist/src/components/notification/notification.d.ts +2 -2
- package/dist/src/components/trace/decorations.d.ts +3 -3
- package/dist/src/icons/index.d.ts +1 -0
- package/dist/src/icons/photon/icons.d.ts +315 -0
- package/dist/src/icons/photon/index.d.ts +2 -0
- package/dist/src/icons/photon/photon-icon.d.ts +51 -0
- package/package.json +5 -3
- package/dist/chunks/IconArrowUpRight-OK8Fp0KQ.js +0 -14
- package/dist/chunks/IconArrowUpRight-OK8Fp0KQ.js.map +0 -1
- package/dist/chunks/IconCheck-DwSMn1wK.js +0 -11
- package/dist/chunks/IconCheck-DwSMn1wK.js.map +0 -1
- package/dist/chunks/IconChevronDown-Cd68NnX2.js +0 -11
- package/dist/chunks/IconChevronDown-Cd68NnX2.js.map +0 -1
- package/dist/chunks/IconChevronLeft-CptqhdxO.js +0 -11
- package/dist/chunks/IconChevronLeft-CptqhdxO.js.map +0 -1
- package/dist/chunks/IconChevronRight-BNkXCTk6.js +0 -11
- package/dist/chunks/IconChevronRight-BNkXCTk6.js.map +0 -1
- package/dist/chunks/IconChevronUp-Bxllwz8J.js +0 -11
- package/dist/chunks/IconChevronUp-Bxllwz8J.js.map +0 -1
- package/dist/chunks/IconInfoCircle-CTAynhe8.js +0 -21
- package/dist/chunks/IconInfoCircle-CTAynhe8.js.map +0 -1
- package/dist/chunks/IconSearch-DkcWWZ1H.js +0 -14
- package/dist/chunks/IconSearch-DkcWWZ1H.js.map +0 -1
- package/dist/chunks/IconX-DnPlFC68.js +0 -14
- package/dist/chunks/IconX-DnPlFC68.js.map +0 -1
- package/dist/chunks/avatar-PgBOfszL.js.map +0 -1
- package/dist/chunks/basic-page-aep8pM4s.js.map +0 -1
- package/dist/chunks/box-search-CMl5bQ7Y.js.map +0 -1
- package/dist/chunks/calendar-DDWITGo4.js.map +0 -1
- package/dist/chunks/chat-D98GCjbe.js.map +0 -1
- package/dist/chunks/checkbox-D8smFViR.js.map +0 -1
- package/dist/chunks/close-button-Ck4rY1Fp.js.map +0 -1
- package/dist/chunks/code-block-CthLWfxd.js.map +0 -1
- package/dist/chunks/copy-button-BLvirhXk.js +0 -76
- package/dist/chunks/copy-button-BLvirhXk.js.map +0 -1
- package/dist/chunks/data-table-C1tLUdw0.js.map +0 -1
- package/dist/chunks/date-picker-D-sWo3i8.js.map +0 -1
- package/dist/chunks/error-BT71wcUd.js +0 -270
- package/dist/chunks/error-BT71wcUd.js.map +0 -1
- package/dist/chunks/filter-bar-D_sBAT5Y.js.map +0 -1
- package/dist/chunks/ghost-search-CMUI2UH0.js.map +0 -1
- package/dist/chunks/input-DWnb33UF.js.map +0 -1
- package/dist/chunks/select-Dux2SBVc.js.map +0 -1
- package/dist/chunks/sidebar-ttBkgGRh.js.map +0 -1
- package/dist/chunks/toast-Cbnn8lcA.js.map +0 -1
- package/dist/chunks/trace-ClMpG82z.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"box-search-CMl5bQ7Y.js","names":["cn","IconSearch","IconX","useRef","jsx","jsxs","QUIET_SEARCH_FOCUS","BOX_SEARCH_INPUT","BoxSearch","className","onClear","trailing","value","onChange","disabled","ref","props","inputRef","filled","InputGroup","node","event"],"sources":["../../src/components/input-group/box-search.tsx"],"sourcesContent":["import { useRef, type ComponentProps, type ReactNode } from \"react\";\nimport { IconSearch, IconX } from \"@tabler/icons-react\";\nimport { cn } from \"../../utils/cn\";\nimport { InputGroup } from \"./input-group\";\n\n/**\n * The quiet focus of a search riding on a list or table. The field keeps\n * its resting hairline when it takes focus: the list it narrows is where\n * the eye goes, and a ring would box the field off from it. Focus shows\n * in the caret and in the magnifier, which takes the primary ink. Put it\n * on the field's surface after the surface's own classes (an `Input`'s\n * `wrapperClassName`, an `InputGroup.Root`'s `className`): tailwind-merge\n * keeps the ring at its rest width and ink.\n */\nexport const QUIET_SEARCH_FOCUS =\n \"has-[:focus-visible]:ring-1 has-[:focus-visible]:ring-pho-primary has-[input:focus-visible]:ring-1 has-[input:focus-visible]:ring-pho-primary\";\n\n/**\n * The text control: `InputGroup.Input`'s `sm` classes on a plain input.\n * Not a Base UI `Field.Control` — inside a host's `Field` that would make\n * the search the field's control, taking its name and its label. The\n * browser's own clear glyph gives way to the field's.\n */\nconst BOX_SEARCH_INPUT =\n \"my-0.5 w-full min-w-0 flex-1 bg-transparent py-1.5 text-pho-primary outline-none placeholder:text-pho-placeholder disabled:cursor-not-allowed [&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none\";\n\nexport interface BoxSearchProps extends Omit<\n ComponentProps<\"input\">,\n \"type\" | \"size\" | \"children\"\n> {\n /**\n * Empties the query from the field's own clear button, shown while the\n * field holds text; focus stays in the field. Without it, no button.\n */\n onClear?: () => void;\n /** Quiet words at the field's end, before the clear button — a count. */\n trailing?: ReactNode;\n /** Classes for the field's surface: its width, its place in a row. */\n className?: string;\n}\n\n/**\n * The boxed search over a list or table — an `sm` field with the\n * magnifier leading, a `trailing` slot, and a clear button. Its focus is\n * quiet (see `QUIET_SEARCH_FOCUS`). Shared by `BasicPage.Search`,\n * `FilterBar`, and `Scope`; the boxless face is `GhostSearch`.\n */\nexport function BoxSearch({\n className,\n onClear,\n trailing,\n value,\n onChange,\n disabled,\n ref,\n ...props\n}: BoxSearchProps) {\n const inputRef = useRef<HTMLInputElement | null>(null);\n const filled = value != null && String(value) !== \"\";\n return (\n <InputGroup.Root\n size=\"sm\"\n className={cn(\"group/search\", QUIET_SEARCH_FOCUS, className)}\n >\n <InputGroup.Addon>\n <IconSearch\n aria-hidden\n className=\"text-pho-description group-focus-within/search:text-pho-primary transition-colors duration-100 ease-linear\"\n />\n </InputGroup.Addon>\n <input\n ref={(node) => {\n inputRef.current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref != null) ref.current = node;\n }}\n type=\"search\"\n value={value}\n // The query is the list's, not a form's: an enclosing form that\n // saves on change or shows a save row once dirty never hears it.\n onChange={(event) => {\n event.stopPropagation();\n onChange?.(event);\n }}\n disabled={disabled}\n autoComplete=\"off\"\n spellCheck={false}\n className={BOX_SEARCH_INPUT}\n {...props}\n />\n {trailing != null ? (\n <InputGroup.Addon className=\"text-pho-description text-xs tabular-nums\">\n {trailing}\n </InputGroup.Addon>\n ) : null}\n {onClear != null && filled && !disabled ? (\n <InputGroup.Addon>\n <button\n type=\"button\"\n aria-label=\"Clear search\"\n // Reachable by click, skipped by Tab: `Escape` clears from the\n // keyboard, and Tab moves on to the list.\n tabIndex={-1}\n onClick={() => {\n onClear();\n inputRef.current?.focus();\n }}\n className=\"text-pho-secondary hover:text-pho-secondary-hover flex cursor-pointer items-center transition-colors duration-100 ease-linear\"\n >\n <IconX aria-hidden />\n </button>\n </InputGroup.Addon>\n ) : null}\n </InputGroup.Root>\n );\n}\n"],"mappings":";;;;;;;AAcA,IAAaM,IACX,iJAQIC,IACJ;AAuBF,SAAgBC,EAAU,EACxB,WAAAC,GACA,SAAAC,GACA,UAAAC,GACA,OAAAC,GACA,UAAAC,GACA,UAAAC,GACA,KAAAC,GACA,GAAGC,EAAA,GACc;AACjB,QAAMC,IAAWd,EAAgC,IAAI,GAC/Ce,IAASN,KAAS,QAAQ,OAAOA,CAAK,MAAM;AAClD,SACE,gBAAAP,EAACc,EAAW,MAAZ;AAAA,IACE,MAAK;AAAA,IACL,WAAWnB,EAAG,gBAAgBM,GAAoBG,CAAS;AAAA,IAF7D,UAAA;AAAA,MAIE,gBAAAL,EAACe,EAAW,OAAZ,EAAA,UACE,gBAAAf,EAACH,GAAD;AAAA,QACE,eAAA;AAAA,QACA,WAAU;AAAA,MACX,CAAA,EACe,CAAA;AAAA,MAClB,gBAAAG,EAAC,SAAD;AAAA,QACE,KAAA,CAAMgB,MAAS;AACb,UAAAH,EAAS,UAAUG,GACf,OAAOL,KAAQ,aAAYA,EAAIK,CAAI,IAC9BL,KAAO,SAAMA,EAAI,UAAUK;AAAA,QACtC;AAAA,QACA,MAAK;AAAA,QACE,OAAAR;AAAA,QAGP,UAAA,CAAWS,MAAU;AACnB,UAAAA,EAAM,gBAAgB,GACtBR,IAAWQ,CAAK;AAAA,QAClB;AAAA,QACU,UAAAP;AAAA,QACV,cAAa;AAAA,QACb,YAAY;AAAA,QACZ,WAAWP;AAAA,QACX,GAAIS;AAAA,MACL,CAAA;AAAA,MACAL,KAAY,OACX,gBAAAP,EAACe,EAAW,OAAZ;AAAA,QAAkB,WAAU;AAAA,QACzB,UAAAR;AAAA,MACe,CAAA,IAChB;AAAA,MACHD,KAAW,QAAQQ,KAAU,CAACJ,IAC7B,gBAAAV,EAACe,EAAW,OAAZ,EAAA,UACE,gBAAAf,EAAC,UAAD;AAAA,QACE,MAAK;AAAA,QACL,cAAW;AAAA,QAGX,UAAU;AAAA,QACV,SAAA,MAAe;AACb,UAAAM,EAAQ,GACRO,EAAS,SAAS,MAAM;AAAA,QAC1B;AAAA,QACA,WAAU;AAAA,QAEV,UAAA,gBAAAb,EAACF,GAAD,EAAO,eAAA,GAAa,CAAA;AAAA,MACd,CAAA,EACQ,CAAA,IAChB;AAAA,IACW;AAAA,E;AAErB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"calendar-DDWITGo4.js","names":["_Fragment","cn","createReactComponent","IconChevronDown","IconChevronLeft","IconChevronRight","IconChevronUp","createContext","useContext","useEffect","useMemo","useRef","useState","Fragment$1","jsx","jsxs","DayPicker","useDayPicker","__iconNode","IconPointFilled","DAY_SIZE","GRID_WIDTH","DROPDOWN_YEAR_REACH","NAV_BUTTON","CALENDAR_CLASS_NAMES","dayButtonClassName","modifiers","selectedEnd","CalendarDay","_day","className","props","inRange","CalendarDayButton","ref","CalendarChevron","orientation","startOfMonth","date","ViewContext","MonthContext","JUMP_BUTTON","JUMP_BUTTON_ON","useMonthYearWords","dayPickerProps","code","useNavYears","now","CalendarMonthCaption","calendarMonth","displayIndex","views","words","open","CAPTION_BUTTON","CAPTION_CHEVRON","MonthsView","index","goToMonth","first","last","year","today","span","reachable","month","lead","tail","_","when","outOfReach","YearsView","current","step","chosen","CalendarMonthWrapper","value","CalendarMonthGrid","showing","CalendarNav","onPreviousClick","onNextClick","previousMonth","nextMonth","navProps","classNames","components","labels","event","CALENDAR_COMPONENTS","JUMP_COMPONENTS","Calendar","showOutsideDays","captionLayout","startMonth","endMonth","todayLabel","jumps","view","setView","setIndex","next","at","bounded","thisYear","askedYear","navStart","navEnd","picker"],"sources":["../../../../node_modules/.pnpm/@tabler+icons-react@3.49.0_react@19.3.1/node_modules/@tabler/icons-react/dist/esm/icons/IconPointFilled.mjs","../../src/components/calendar/calendar.tsx"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.49.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M12 7a5 5 0 1 1 -4.995 5.217l-.005 -.217l.005 -.217a5 5 0 0 1 4.995 -4.783z\", \"key\": \"svg-0\" }]];\nconst IconPointFilled = createReactComponent(\"filled\", \"point-filled\", \"PointFilled\", __iconNode);\n\nexport { __iconNode, IconPointFilled as default };\n","import {\n createContext,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type TdHTMLAttributes,\n} from \"react\";\nimport {\n DayPicker,\n useDayPicker,\n type ChevronProps,\n type ClassNames,\n type CustomComponents,\n type DayButtonProps,\n type DayPickerProps,\n type DayProps,\n type Modifiers,\n type MonthCaptionProps,\n type MonthGridProps,\n type MonthProps,\n type NavProps,\n} from \"react-day-picker\";\nimport {\n IconChevronDown,\n IconChevronLeft,\n IconChevronRight,\n IconChevronUp,\n IconPointFilled,\n} from \"@tabler/icons-react\";\nimport { cn } from \"../../utils/cn\";\n\n/**\n * One square per day — the unit the whole grid is measured in. The header\n * cells share the width so the weekday initials sit over their column.\n */\nconst DAY_SIZE = \"size-9\";\n\n/**\n * Seven of those columns — the width the month grid comes to, and the width\n * the jump lists hold to, so the panel never changes shape under a tap.\n */\nconst GRID_WIDTH = \"w-63\";\n\n/**\n * How far the year dropdown reaches when the page has not bounded the\n * calendar: ten years back and ten on, which covers the dates a dashboard\n * asks for and still fits one glance. Set `startMonth` / `endMonth` for a\n * birthday, an archive, anything further out.\n */\nconst DROPDOWN_YEAR_REACH = 10;\n\n/** Ghost icon button — the month arrows, sized to the caption row. */\nconst NAV_BUTTON = cn(\n \"text-pho-secondary flex size-7 cursor-pointer items-center justify-center rounded-sm\",\n \"transition-[color,background-color] duration-150 ease-out\",\n \"hover:bg-pho-ghost-hover hover:text-pho-secondary-hover\",\n \"outline-pho-brand focus-visible:outline-2 focus-visible:outline-offset-1\",\n // Past the first or last navigable month the arrow stays put and dims.\n \"aria-disabled:pointer-events-none aria-disabled:opacity-30\",\n);\n\n/**\n * The structural classes. Every element DayPicker renders is named here — the\n * ones Pho dresses from the modifiers instead are named empty — so the\n * library's own stylesheet is never imported and no `rdp-*` class reaches the\n * DOM. A consumer's `classNames` merges over this map, element by element.\n */\nconst CALENDAR_CLASS_NAMES: Partial<ClassNames> = {\n root: \"text-pho-primary inline-block text-base\",\n // `relative` anchors the nav; months sit side by side once there is room.\n months: \"relative flex flex-col gap-6 sm:flex-row\",\n month: \"flex flex-col gap-2\",\n nav: \"absolute top-0 right-0 flex items-center gap-0.5\",\n button_previous: NAV_BUTTON,\n button_next: NAV_BUTTON,\n chevron: \"size-4\",\n // Matches the nav buttons' height so caption and arrows share a baseline.\n month_caption: \"flex h-7 items-center\",\n caption_label:\n \"text-pho-primary inline-flex items-center gap-0.5 font-medium\",\n dropdowns: \"flex items-center gap-1\",\n // The native select is a transparent overlay; the label under it is what shows.\n dropdown_root:\n \"relative -mx-1 inline-flex items-center rounded-sm px-1 hover:bg-pho-ghost-hover has-[select:focus-visible]:outline-pho-brand has-[select:focus-visible]:outline-2\",\n dropdown: \"absolute inset-0 cursor-pointer opacity-0\",\n months_dropdown: \"\",\n years_dropdown: \"\",\n // Separate borders so a range band's rounded ends actually round.\n month_grid: \"border-separate border-spacing-0\",\n weekdays: \"\",\n weekday: \"text-pho-description w-9 pb-1 text-xs font-normal\",\n weeks: \"\",\n week: \"\",\n week_number: \"text-pho-placeholder w-9 text-xs font-normal\",\n week_number_header: \"text-pho-description w-9 pb-1 text-xs font-normal\",\n footer: \"text-pho-description pt-3 text-base\",\n day: \"p-0 text-center align-middle\",\n // Day state is read off the modifiers in the two components below — as data\n // attributes on the cell and as classes on the button — so the library's own\n // state classes stay empty rather than doubling up.\n day_button: \"\",\n selected: \"\",\n range_start: \"\",\n range_middle: \"\",\n range_end: \"\",\n today: \"\",\n outside: \"\",\n focused: \"\",\n disabled: \"\",\n hidden: \"invisible\",\n};\n\n/** The day's own classes, resolved from the modifiers DayPicker hands down. */\nfunction dayButtonClassName(modifiers: Modifiers): string {\n const selectedEnd = Boolean(modifiers.selected && !modifiers.range_middle);\n\n return cn(\n \"relative flex cursor-pointer items-center justify-center rounded-sm tabular-nums select-none\",\n DAY_SIZE,\n \"text-pho-secondary\",\n \"transition-[color,background-color,box-shadow] duration-150 ease-out\",\n \"hover:bg-pho-ghost-hover hover:text-pho-primary\",\n \"outline-pho-brand focus-visible:outline-2 focus-visible:-outline-offset-1\",\n // A day from the neighbouring month is context, not a choice — it recedes\n // to the placeholder step but stays clickable.\n modifiers.outside && \"text-pho-placeholder\",\n // Today is marked with the field hairline, not a fill: the fill means\n // selected, and the two must never be confused.\n modifiers.today &&\n !modifiers.selected &&\n \"ring-pho-primary ring-1 ring-inset font-medium text-pho-primary\",\n // Inside a range the band behind carries the selection; the number just\n // reads as normal ink.\n modifiers.range_middle && \"text-pho-primary\",\n // The chosen day (and both ends of a range) takes the action fill.\n selectedEnd &&\n \"bg-pho-brand-solid text-pho-on-brand hover:bg-pho-brand-solid-hover hover:text-pho-on-brand font-medium ring-0\",\n \"disabled:pointer-events-none disabled:text-pho-disabled\",\n \"aria-disabled:pointer-events-none aria-disabled:text-pho-disabled\",\n );\n}\n\n/**\n * The grid cell. Carries the range band: a continuous wash behind the days\n * between both ends, rounded where the range starts and stops. The ends' own\n * buttons paint over their half of it, so the band reads as one shape.\n */\nfunction CalendarDay({\n // `day` is DayPicker's own object — kept out of the spread so it never\n // reaches the DOM as an attribute.\n day: _day,\n modifiers,\n className,\n ...props\n}: DayProps) {\n const inRange =\n modifiers.range_start || modifiers.range_middle || modifiers.range_end;\n\n return (\n <td\n {...(props as TdHTMLAttributes<HTMLTableCellElement>)}\n data-range-start={modifiers.range_start || undefined}\n data-range-middle={modifiers.range_middle || undefined}\n data-range-end={modifiers.range_end || undefined}\n className={cn(\n className,\n inRange && \"bg-pho-secondary\",\n modifiers.range_start && \"rounded-l-sm\",\n modifiers.range_end && \"rounded-r-sm\",\n )}\n />\n );\n}\n\n/**\n * The day button. Mirrors the library's own focus handover — roving tabindex\n * moves the `focused` modifier, and the newly focused day claims the caret —\n * then dresses itself from the modifiers.\n */\nfunction CalendarDayButton({\n day: _day,\n modifiers,\n className,\n ...props\n}: DayButtonProps) {\n const ref = useRef<HTMLButtonElement>(null);\n\n useEffect(() => {\n if (modifiers.focused) ref.current?.focus();\n }, [modifiers.focused]);\n\n return (\n <button\n ref={ref}\n {...props}\n className={cn(dayButtonClassName(modifiers), className)}\n />\n );\n}\n\n/** The system's stroke chevrons in place of the library's filled triangles. */\nfunction CalendarChevron({ orientation = \"left\", className }: ChevronProps) {\n const Icon =\n orientation === \"up\"\n ? IconChevronUp\n : orientation === \"down\"\n ? IconChevronDown\n : orientation === \"right\"\n ? IconChevronRight\n : IconChevronLeft;\n\n return <Icon className={className} aria-hidden />;\n}\n\n/* ------------------------------------------------- the caption's two views */\n\nconst startOfMonth = (date: Date) =>\n new Date(date.getFullYear(), date.getMonth(), 1);\n\n/** Which face the calendar is showing — the days, or a way to jump. */\ntype CalendarView = \"days\" | \"months\" | \"years\";\n\ninterface ViewState {\n view: CalendarView;\n /** Which displayed month opened it; only one view is up at a time. */\n index: number;\n show: (view: CalendarView, index: number) => void;\n /** The word on the button back to today, for the label and the tooltip. */\n todayLabel: string;\n}\n\n// Always provided, even where the caption only reads: the nav below needs the\n// today label whether or not the caption drills down.\nconst ViewContext = createContext<ViewState>({\n view: \"days\",\n index: 0,\n show: () => {},\n todayLabel: \"Today\",\n});\n\n/** The month a `Month` subtree belongs to — `MonthGrid` has no other way to know. */\nconst MonthContext = createContext<{ date: Date; index: number }>({\n date: new Date(0),\n index: 0,\n});\n\n/** A month or a year to jump to — the day button's manners at list size. */\nconst JUMP_BUTTON = cn(\n \"flex cursor-pointer items-center justify-center rounded-sm text-base tabular-nums select-none\",\n \"text-pho-secondary transition-[color,background-color] duration-150 ease-out\",\n \"hover:bg-pho-ghost-hover hover:text-pho-primary\",\n \"outline-pho-brand focus-visible:outline-2 focus-visible:-outline-offset-1\",\n \"disabled:pointer-events-none disabled:text-pho-disabled\",\n);\n\nconst JUMP_BUTTON_ON = cn(\n \"bg-pho-brand-solid text-pho-on-brand hover:bg-pho-brand-solid-hover\",\n \"hover:text-pho-on-brand font-medium\",\n);\n\n/** The words for a month and a year, in the calendar's own locale. */\nfunction useMonthYearWords() {\n const { dayPickerProps } = useDayPicker();\n const code = dayPickerProps.locale?.code;\n return useMemo(\n () => ({\n month: new Intl.DateTimeFormat(code, { month: \"short\" }),\n monthLong: new Intl.DateTimeFormat(code, { month: \"long\" }),\n }),\n [code],\n );\n}\n\n/** The first and last month the page allows, as plain years. */\nfunction useNavYears() {\n const { dayPickerProps } = useDayPicker();\n const now = dayPickerProps.today ?? new Date();\n const first =\n dayPickerProps.startMonth?.getFullYear() ??\n now.getFullYear() - DROPDOWN_YEAR_REACH;\n const last =\n dayPickerProps.endMonth?.getFullYear() ??\n now.getFullYear() + DROPDOWN_YEAR_REACH;\n return { first, last };\n}\n\n/**\n * The caption. Its month and its year are each a button into their own view,\n * so a date two years out is two taps: the year, then the month.\n */\nfunction CalendarMonthCaption({\n calendarMonth,\n displayIndex,\n className,\n ...props\n}: MonthCaptionProps) {\n const views = useContext(ViewContext);\n const words = useMonthYearWords();\n const open = views.index === displayIndex ? views.view : \"days\";\n\n return (\n // The buttons carry their own padding, so the row pulls back to keep the\n // month's first letter over the grid's left edge.\n <div className={cn(className, \"-ml-1.5 gap-0.5\")} {...props}>\n <button\n type=\"button\"\n aria-expanded={open === \"months\"}\n onClick={() =>\n views.show(open === \"months\" ? \"days\" : \"months\", displayIndex)\n }\n className={CAPTION_BUTTON}\n >\n {words.monthLong.format(calendarMonth.date)}\n <IconChevronDown\n aria-hidden\n className={cn(CAPTION_CHEVRON, open === \"months\" && \"rotate-180\")}\n />\n </button>\n <button\n type=\"button\"\n aria-expanded={open === \"years\"}\n onClick={() =>\n views.show(open === \"years\" ? \"days\" : \"years\", displayIndex)\n }\n className={CAPTION_BUTTON}\n >\n {calendarMonth.date.getFullYear()}\n <IconChevronDown\n aria-hidden\n className={cn(CAPTION_CHEVRON, open === \"years\" && \"rotate-180\")}\n />\n </button>\n </div>\n );\n}\n\n/** The twelve months of the year on screen. Picking one lands on the days. */\nfunction MonthsView() {\n const views = useContext(ViewContext);\n const { date, index } = useContext(MonthContext);\n const { goToMonth, dayPickerProps } = useDayPicker();\n const words = useMonthYearWords();\n const { first, last } = useNavYears();\n const year = date.getFullYear();\n const today = dayPickerProps.today ?? new Date();\n const span = dayPickerProps.numberOfMonths ?? 1;\n\n /**\n * The first month `goToMonth` would be given for a choice, and whether the\n * whole strip still fits between the navigable ends. Without the second\n * check DayPicker clamps the value and the pick lands under a different\n * caption than the one that was clicked.\n */\n const reachable = (month: number) => {\n const lead = new Date(year, month - index, 1);\n const tail = new Date(year, month - index + span - 1, 1);\n if (year < first || year > last) return false;\n if (\n dayPickerProps.startMonth &&\n lead < startOfMonth(dayPickerProps.startMonth)\n ) {\n return false;\n }\n if (\n dayPickerProps.endMonth &&\n tail > startOfMonth(dayPickerProps.endMonth)\n ) {\n return false;\n }\n return true;\n };\n\n return (\n <div\n // A labelled set of buttons, not a form section — `fieldset` would say\n // the wrong thing about what this is.\n // oxlint-disable-next-line jsx-a11y/prefer-tag-over-role\n role=\"group\"\n aria-label={String(year)}\n className={cn(\n GRID_WIDTH,\n \"grid h-[202px] grid-cols-3 content-start gap-1\",\n )}\n >\n {Array.from({ length: 12 }, (_, month) => {\n const when = new Date(year, month, 1);\n const outOfReach = !reachable(month);\n return (\n <button\n key={month}\n type=\"button\"\n disabled={outOfReach}\n onClick={() => {\n // `goToMonth` names the FIRST month on screen, so a caption\n // further along the strip steps back by its own offset and the\n // pick lands under the caption that was clicked.\n goToMonth(new Date(year, month - index, 1));\n views.show(\"days\", views.index);\n }}\n className={cn(\n JUMP_BUTTON,\n \"h-11\",\n month === date.getMonth() && JUMP_BUTTON_ON,\n month !== date.getMonth() &&\n year === today.getFullYear() &&\n month === today.getMonth() &&\n \"ring-pho-primary text-pho-primary font-medium ring-1 ring-inset\",\n )}\n >\n {words.month.format(when)}\n </button>\n );\n })}\n </div>\n );\n}\n\n/** Every year the page allows. Picking one asks for the month next. */\nfunction YearsView() {\n const views = useContext(ViewContext);\n const { date, index } = useContext(MonthContext);\n const { goToMonth, dayPickerProps } = useDayPicker();\n const { first, last } = useNavYears();\n const current = useRef<HTMLButtonElement>(null);\n const today = dayPickerProps.today ?? new Date();\n\n // Open on the year in play, however far down the list it sits.\n useEffect(() => {\n current.current?.scrollIntoView({ block: \"center\" });\n }, []);\n\n return (\n <div\n // oxlint-disable-next-line jsx-a11y/prefer-tag-over-role\n role=\"group\"\n aria-label=\"Year\"\n className={cn(\n GRID_WIDTH,\n \"grid h-[202px] grid-cols-4 content-start gap-1 overflow-y-auto\",\n )}\n >\n {Array.from({ length: last - first + 1 }, (_, step) => {\n const year = first + step;\n const chosen = year === date.getFullYear();\n return (\n <button\n key={year}\n type=\"button\"\n ref={chosen ? current : undefined}\n onClick={() => {\n goToMonth(new Date(year, date.getMonth() - index, 1));\n // The year alone does not name a day: ask for the month next.\n views.show(\"months\", views.index);\n }}\n className={cn(\n JUMP_BUTTON,\n \"h-9\",\n chosen && JUMP_BUTTON_ON,\n !chosen &&\n year === today.getFullYear() &&\n \"ring-pho-primary text-pho-primary font-medium ring-1 ring-inset\",\n )}\n >\n {year}\n </button>\n );\n })}\n </div>\n );\n}\n\n/** Puts the month a subtree belongs to in reach of the grid below it. */\nfunction CalendarMonthWrapper({\n calendarMonth,\n displayIndex,\n ...props\n}: MonthProps) {\n const value = useMemo(\n () => ({ date: calendarMonth.date, index: displayIndex }),\n [calendarMonth.date, displayIndex],\n );\n return (\n <MonthContext.Provider value={value}>\n <div {...props} />\n </MonthContext.Provider>\n );\n}\n\n/** The days, or whichever jump list the caption asked for in their place. */\nfunction CalendarMonthGrid(props: MonthGridProps) {\n const views = useContext(ViewContext);\n const { index } = useContext(MonthContext);\n const showing = views.index === index ? views.view : \"days\";\n\n if (showing === \"months\") return <MonthsView />;\n if (showing === \"years\") return <YearsView />;\n return <table {...props} />;\n}\n\n/** The month arrows step the days; a jump list is its own navigation. */\n/**\n * Back a month, back to today, on a month. The middle button moves the view\n * to today's month and leaves the selection alone — it is a way back, not a\n * way to choose. It stays lit while sitting on today's month, where the click\n * is a harmless no-op, because a control that reads as broken on first sight\n * is worse than one that sometimes does nothing; it dims only where it truly\n * cannot go, out past `startMonth` / `endMonth`, as the arrows do.\n */\nfunction CalendarNav({\n onPreviousClick,\n onNextClick,\n previousMonth,\n nextMonth,\n ...navProps\n}: NavProps) {\n const views = useContext(ViewContext);\n const { classNames, components, goToMonth, labels, dayPickerProps } =\n useDayPicker();\n\n // A jump list is its own navigation, so the arrows step aside. The nav is\n // absolutely positioned, so nothing below it moves.\n if (views.view !== \"days\") return <></>;\n\n const today = startOfMonth(dayPickerProps.today ?? new Date());\n const outOfReach =\n (dayPickerProps.startMonth != null &&\n today < startOfMonth(dayPickerProps.startMonth)) ||\n (dayPickerProps.endMonth != null &&\n today > startOfMonth(dayPickerProps.endMonth));\n\n return (\n <nav {...navProps}>\n <components.PreviousMonthButton\n type=\"button\"\n className={classNames.button_previous}\n tabIndex={previousMonth ? undefined : -1}\n aria-disabled={previousMonth ? undefined : true}\n aria-label={labels.labelPrevious(previousMonth)}\n onClick={(event) => {\n if (previousMonth) onPreviousClick?.(event);\n }}\n >\n <components.Chevron\n disabled={previousMonth ? undefined : true}\n className={classNames.chevron}\n orientation=\"left\"\n />\n </components.PreviousMonthButton>\n\n <button\n type=\"button\"\n className={NAV_BUTTON}\n tabIndex={outOfReach ? -1 : undefined}\n aria-disabled={outOfReach ? true : undefined}\n aria-label={views.todayLabel}\n title={views.todayLabel}\n onClick={() => {\n if (!outOfReach) goToMonth(today);\n }}\n >\n <IconPointFilled className={classNames.chevron} aria-hidden />\n </button>\n\n <components.NextMonthButton\n type=\"button\"\n className={classNames.button_next}\n tabIndex={nextMonth ? undefined : -1}\n aria-disabled={nextMonth ? undefined : true}\n aria-label={labels.labelNext(nextMonth)}\n onClick={(event) => {\n if (nextMonth) onNextClick?.(event);\n }}\n >\n <components.Chevron\n disabled={nextMonth ? undefined : true}\n className={classNames.chevron}\n orientation=\"right\"\n />\n </components.NextMonthButton>\n </nav>\n );\n}\n\nconst CAPTION_BUTTON = cn(\n \"text-pho-primary flex cursor-pointer items-center gap-0.5 rounded-sm px-1.5 py-0.5 font-medium\",\n \"transition-[color,background-color] duration-150 ease-out hover:bg-pho-ghost-hover\",\n \"outline-pho-brand focus-visible:outline-2 focus-visible:outline-offset-1\",\n);\n\nconst CAPTION_CHEVRON =\n \"text-pho-secondary size-3.5 transition-transform duration-150 ease-out\";\n\nconst CALENDAR_COMPONENTS: Partial<CustomComponents> = {\n Day: CalendarDay,\n DayButton: CalendarDayButton,\n Chevron: CalendarChevron,\n Nav: CalendarNav,\n};\n\n/** The extra parts the drill-down caption needs on top of the base set. */\nconst JUMP_COMPONENTS: Partial<CustomComponents> = {\n Month: CalendarMonthWrapper,\n MonthCaption: CalendarMonthCaption,\n MonthGrid: CalendarMonthGrid,\n};\n\nexport type CalendarProps = DayPickerProps & {\n /**\n * The word on the button back to today, used as its label and its tooltip.\n * @default \"Today\"\n */\n todayLabel?: string;\n};\n\n/**\n * Calendar built on React DayPicker — a month of days to read or to choose\n * from. Pass `mode` to make it selectable (`single`, `multiple`, `range`);\n * without one it is a static month. Every DayPicker prop passes through, so\n * `numberOfMonths`, `disabled`, `startMonth` / `endMonth`, `captionLayout`,\n * and the locale props all work as documented upstream.\n *\n * Pho supplies the whole class map, so the library's stylesheet is neither\n * imported nor needed. `classNames` and `components` merge over Pho's,\n * element by element.\n *\n * The caption is clickable: month and year each open a jump list, so a date\n * two years out is two taps rather than twenty-four. Pass\n * `captionLayout=\"label\"` for a caption that only reads, and `startMonth` /\n * `endMonth` to say how far the year list should reach. Between the month\n * arrows sits a way back to today's month.\n *\n * Selection follows DayPicker's own contract: hand it `onSelect` and the\n * calendar is controlled, so `selected` has to come with it. Leave both off\n * and it keeps the selection itself.\n *\n * For a calendar behind a field — a trigger that shows the chosen date and\n * opens this in a popover — use `DatePicker`.\n */\nexport function Calendar({\n className,\n classNames,\n components,\n showOutsideDays = true,\n captionLayout,\n startMonth,\n endMonth,\n todayLabel = \"Today\",\n ...props\n}: CalendarProps) {\n // No layout named means Pho's own: a caption that drills down. Name one and\n // DayPicker's handling of it stands, untouched.\n const jumps = captionLayout === undefined;\n const [view, setView] = useState<CalendarView>(\"days\");\n const [index, setIndex] = useState(0);\n const views = useMemo<ViewState>(\n () => ({\n view,\n index,\n show: (next, at) => {\n setView(next);\n setIndex(at);\n },\n todayLabel,\n }),\n [view, index, todayLabel],\n );\n\n // A jump list needs a first and last year to offer, even when none was set.\n // The window has to hold the month the page asked for as well as today:\n // DayPicker clamps a `month` / `defaultMonth` outside it, so a calendar\n // opened on 1979 would silently render this decade instead.\n const bounded = jumps || captionLayout !== \"label\";\n const thisYear = (props.today ?? new Date()).getFullYear();\n const askedYear = (\n props.month ??\n props.defaultMonth ??\n props.today ??\n new Date()\n ).getFullYear();\n const navStart =\n startMonth ??\n (bounded\n ? new Date(Math.min(thisYear, askedYear) - DROPDOWN_YEAR_REACH, 0, 1)\n : undefined);\n const navEnd =\n endMonth ??\n (bounded\n ? new Date(Math.max(thisYear, askedYear) + DROPDOWN_YEAR_REACH, 11, 1)\n : undefined);\n\n const picker = (\n <DayPicker\n showOutsideDays={showOutsideDays}\n // Pho's caption replaces the label wholesale, so DayPicker is told to\n // build the plain one and hand it over.\n captionLayout={jumps ? \"label\" : captionLayout}\n startMonth={navStart}\n endMonth={navEnd}\n classNames={{\n ...CALENDAR_CLASS_NAMES,\n ...classNames,\n // DayPicker concatenates `className` onto the root's classes; folding\n // it in here runs it through `cn` instead, so a caller's `text-md`\n // actually replaces the root's `text-base` rather than fighting it.\n root: cn(CALENDAR_CLASS_NAMES.root, classNames?.root, className),\n }}\n components={{\n ...CALENDAR_COMPONENTS,\n ...(jumps ? JUMP_COMPONENTS : null),\n ...components,\n }}\n {...props}\n />\n );\n\n // Provided either way: the nav's way back to today needs its word even\n // where the caption itself only reads.\n return <ViewContext.Provider value={views}>{picker}</ViewContext.Provider>;\n}\n\nCalendar.displayName = \"Calendar\";\n"],"ignoreList":[0],"mappings":";;;;;;;;;;AASA,IAAMkB,IAAa,CAAC,CAAC,QAAQ;AAAA,EAAE,GAAK;AAAA,EAA+E,KAAO;AAAQ,CAAC,CAAC,GAC9HC,KAAkBjB,EAAqB,UAAU,gBAAgB,eAAegB,CAAU,GC2B1FE,KAAW,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gBACNA,EAAM,SACN,oBAAI,KAAK,GACT,YAAY,GACR2E,IACJZ,MACCS,IACG,IAAI,KAAK,KAAK,IAAIC,GAAUC,CAAS,IAAInF,GAAqB,GAAG,CAAC,IAClE,SACAqF,IACJZ,MACCQ,IACG,IAAI,KAAK,KAAK,IAAIC,GAAUC,CAAS,IAAInF,GAAqB,IAAI,CAAC,IACnE,SAEAsF,IACJ,gBAAA9F,EAACE,GAAD;AAAA,IACmB,iBAAA4E;AAAA,IAGjB,eAAeK,IAAQ,UAAUJ;AAAA,IACjC,YAAYa;AAAA,IACZ,UAAUC;AAAA,IACV,YAAY;AAAA,MACV,GAAGnF;AAAA,MACH,GAAG6D;AAAA,MAIH,MAAMpF,EAAGuB,EAAqB,MAAM6D,GAAY,MAAMvD,CAAS;AAAA,IACjE;AAAA,IACA,YAAY;AAAA,MACV,GAAG2D;AAAA,MACH,GAAIQ,IAAQP,KAAkB;AAAA,MAC9B,GAAGJ;AAAA,IACL;AAAA,IACA,GAAIvD;AAAA,EACL,CAAA;AAKH,SAAO,gBAAAjB,EAACyB,EAAY,UAAb;AAAA,IAAsB,OAAOY;AAAA,IAAQ,UAAAyD;AAAA,EAA6B,CAAA;AAC3E;AAEAjB,GAAS,cAAc"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chat-D98GCjbe.js","names":["__iconNode","__iconNode","__iconNode","_Fragment","cn","useLinkComponent","FADE_SWAP","PRESS_SCALE_ROW","SPRING_PRESS","TRAVEL_LINEAR","Spinner","Button","createReactComponent","Input","Avatar","IconSearch","ScrollArea","StatusView","Skeleton","QUIET_SEARCH_FOCUS","createContext","useCallback","useContext","useEffect","useId","useLayoutEffect","useMemo","useRef","useState","Fragment$1","jsx","jsxs","AnimatePresence","motion","useReducedMotion","__iconNode$3","IconArrowLeft","__iconNode$2","IconArrowUp","__iconNode$1","IconUser","__iconNode","IconUsers","CHAT_SURFACE","AUTO_WIDE_PX","PANE_TRAVEL_PX","PANE_LEAVE_PX","TOP_BAR","LIST_WIDTH_PX","LIST_MIN_PX","THREAD_MIN_PX","SPLIT_STEP_PX","clampListWidth","width","rootWidth","next","ChatContext","useChat","part","ctx","useIsoLayoutEffect","paneDirectionFor","pane","isPaneSwap","layout","frameWidth","paneSwapMotion","direction","reduceMotion","paneSwapVariants","SwapPane","as","show","swapped","children","props","swap","motionProps","Root","paneProp","defaultPane","onPaneChange","className","style","ref","uncontrolledPane","setUncontrolledPane","listWidth","setListWidth","setFrameWidth","rootRef","controlled","setDirection","setSwapped","prevPaneRef","renderedDirection","renderedSwapped","setPane","resizeList","root","tighten","frame","current","observer","value","node","List","idProp","uid","listId","listClass","body","Splitter","rest","controlsId","drag","onPointerDown","event","onPointerMove","start","rtl","delta","onPointerUp","onKeyDown","shrink","grow","step","valueMax","Search","wrapperClassName","placeholder","Conversations","ConversationList","CONVERSATION_ROW","CONVERSATION_ROW_ACTIVE","CONVERSATION_ROW_INACTIVE","CONVERSATION_PRESS","Conversation","title","time","preview","avatar","group","active","href","onClick","Link","MotionLink","rowClass","open","Thread","threadClass","Header","actions","backLabel","Title","Description","PIN_SLACK_PX","EARLIER_AHEAD","offsetIn","viewport","row","placed","oldestMessage","content","Messages","hasEarlier","loadingEarlier","onLoadEarlier","earlierLabel","viewportRef","contentRef","sentinelRef","pinned","anchor","loading","stalled","askEarlier","settle","kept","onScroll","loadEarlier","sentinel","entries","entry","Divider","Footer","COMPOSER_MAX_HEIGHT_PX","Composer","onValueChange","onSend","sending","disabled","canSend","prefix","meta","sendLabel","textareaRef","innerRef","ready","element","submit","Empty","size","ConversationsLoading","rows","_","MessagesLoading","Chat"],"sources":["../../../../node_modules/.pnpm/@tabler+icons-react@3.49.0_react@19.3.1/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowLeft.mjs","../../../../node_modules/.pnpm/@tabler+icons-react@3.49.0_react@19.3.1/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowUp.mjs","../../../../node_modules/.pnpm/@tabler+icons-react@3.49.0_react@19.3.1/node_modules/@tabler/icons-react/dist/esm/icons/IconUser.mjs","../../../../node_modules/.pnpm/@tabler+icons-react@3.49.0_react@19.3.1/node_modules/@tabler/icons-react/dist/esm/icons/IconUsers.mjs","../../src/components/chat/chat.tsx"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.49.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M5 12l14 0\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M5 12l6 6\", \"key\": \"svg-1\" }], [\"path\", { \"d\": \"M5 12l6 -6\", \"key\": \"svg-2\" }]];\nconst IconArrowLeft = createReactComponent(\"outline\", \"arrow-left\", \"ArrowLeft\", __iconNode);\n\nexport { __iconNode, IconArrowLeft as default };\n","/**\n * @license @tabler/icons-react v3.49.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M12 5l0 14\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M18 11l-6 -6\", \"key\": \"svg-1\" }], [\"path\", { \"d\": \"M6 11l6 -6\", \"key\": \"svg-2\" }]];\nconst IconArrowUp = createReactComponent(\"outline\", \"arrow-up\", \"ArrowUp\", __iconNode);\n\nexport { __iconNode, IconArrowUp as default };\n","/**\n * @license @tabler/icons-react v3.49.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M6 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2\", \"key\": \"svg-1\" }]];\nconst IconUser = createReactComponent(\"outline\", \"user\", \"User\", __iconNode);\n\nexport { __iconNode, IconUser as default };\n","/**\n * @license @tabler/icons-react v3.49.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M5 7a4 4 0 1 0 8 0a4 4 0 1 0 -8 0\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M3 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2\", \"key\": \"svg-1\" }], [\"path\", { \"d\": \"M16 3.13a4 4 0 0 1 0 7.75\", \"key\": \"svg-2\" }], [\"path\", { \"d\": \"M21 21v-2a4 4 0 0 0 -3 -3.85\", \"key\": \"svg-3\" }]];\nconst IconUsers = createReactComponent(\"outline\", \"users\", \"Users\", __iconNode);\n\nexport { __iconNode, IconUsers as default };\n","import {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n type AnchorHTMLAttributes,\n type ButtonHTMLAttributes,\n type CSSProperties,\n type ComponentProps,\n type ComponentType,\n type FormEvent,\n type KeyboardEvent,\n type PointerEvent,\n type ReactNode,\n type Ref,\n type RefObject,\n} from \"react\";\nimport {\n IconArrowLeft,\n IconArrowUp,\n IconSearch,\n IconUser,\n IconUsers,\n} from \"@tabler/icons-react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\nimport {\n BLUR_PX,\n FADE_SWAP,\n PRESS_SCALE_ROW,\n SPRING_PRESS,\n TRAVEL_LINEAR,\n} from \"../../motion\";\nimport { Avatar } from \"../avatar\";\nimport { Button } from \"../button\";\nimport { Input, type InputProps } from \"../input\";\nimport { QUIET_SEARCH_FOCUS } from \"../input-group/box-search\";\nimport { ScrollArea } from \"../scroll-area\";\nimport { Skeleton } from \"../skeleton\";\nimport { Spinner } from \"../spinner\";\nimport { StatusView, type StatusViewProps } from \"../status-view\";\nimport { cn } from \"../../utils/cn\";\nimport { useLinkComponent } from \"../../utils/link-provider\";\n\n/**\n * Chat — an inbox in one card: the conversations down the left, the open\n * thread on the right with its messages scrolling up from the composer.\n * It composes the smaller parts (`Message` rows of `Bubble`s in a\n * `ScrollArea`, an `Input` for search, `Button`s to send and go back) the\n * way `Sidebar` composes a rail: rows that press, one active, links\n * through the host's `LinkProvider`.\n *\n * Two layouts. `default` seats both panes side by side — the divider\n * between them drags so either pane can grow, each down to a min width.\n * `compact` shows one at a time — the list, then the thread with a way\n * back — for a narrow column or a phone. Opening a conversation pushes\n * the thread in from the right; back pops the list in from the left, a\n * short drift on `TRAVEL_LINEAR` with a `FADE_SWAP` fade. `auto` is\n * compact only while the frame is narrower than 42rem (a container\n * query, so it follows the card, not the viewport). Which pane is up is\n * `pane`, controlled or not; opening a conversation moves to the thread,\n * the header's back button returns.\n *\n * Presentational, like every Pho part: the page fetches, formats times,\n * and decides who is who. The thread stays pinned to its newest message\n * while the reader is at the bottom, and keeps its place when earlier\n * pages arrive above.\n */\n\nexport type ChatLayout = \"default\" | \"compact\" | \"auto\";\nexport type ChatPane = \"list\" | \"thread\";\n/** Push is 1 (thread from the right); pop is −1 (list from the left). */\nexport type ChatPaneDirection = 1 | -1;\n\n/** Same chrome as `BasicPage.Card` and `LogList` — one card surface. */\nconst CHAT_SURFACE = \"rounded-base border border-pho-secondary bg-pho-primary\";\n\n// Below this frame width `auto` is compact: the `@2xl` container variant\n// (42rem) in the class strings below. Those variants are spelled out in\n// full on purpose — Tailwind finds utilities by scanning source text, so\n// a variant built from a variable (`${AUTO_WIDE}` before the colon) never\n// reached a consumer's CSS and `auto` stayed single-pane at every width.\n// chat.test.tsx keeps it that way.\n/** `42rem` in px at the 16px root — `frameWidth` is measured in px. */\nconst AUTO_WIDE_PX = 672;\n/**\n * Compact pane travel — a short drift, the same scale as `BAR_RISE_PX`,\n * not a full-width slide.\n */\nconst PANE_TRAVEL_PX = 24;\n/** Outgoing pane drift — same distance as BasicPage `BACK_LABEL_LEAVE_X`. */\nconst PANE_LEAVE_PX = 8;\n\n/** Search (`p-3` + sm Input) is the pane top-bar height; Header matches it. */\nconst TOP_BAR = \"min-h-[61px]\";\n\n/**\n * Wide layouts start the list at 273 — the measured inbox column, not\n * `w-80`. It will not go below `min-w-64` (256); the thread will not go\n * below `min-w-80` (320).\n */\nconst LIST_WIDTH_PX = 273;\nconst LIST_MIN_PX = 256;\nconst THREAD_MIN_PX = 320;\nconst SPLIT_STEP_PX = 16;\n\nfunction clampListWidth(width: number, rootWidth: number) {\n const next = Math.max(LIST_MIN_PX, width);\n if (rootWidth <= 0) return Number.isFinite(next) ? next : LIST_MIN_PX;\n return Math.min(next, Math.max(LIST_MIN_PX, rootWidth - THREAD_MIN_PX));\n}\n\ninterface ChatContextValue {\n layout: ChatLayout;\n pane: ChatPane;\n setPane: (pane: ChatPane) => void;\n /** Latest list ↔ thread step: 1 push, −1 pop. */\n direction: ChatPaneDirection;\n /** One pane at a time — compact, or `auto` once the frame measures narrow. */\n swap: boolean;\n /** True after the first list ↔ thread step — later remounts still push. */\n swapped: boolean;\n listWidth: number;\n frameWidth: number;\n resizeList: (width: number) => void;\n rootRef: RefObject<HTMLDivElement | null>;\n}\n\nconst ChatContext = createContext<ChatContextValue | null>(null);\n\nfunction useChat(part: string): ChatContextValue {\n const ctx = useContext(ChatContext);\n if (ctx == null) {\n throw new Error(`Chat.${part} must be used inside Chat.Root`);\n }\n return ctx;\n}\n\n// React 18 warns that useLayoutEffect does nothing on the server; fall\n// back to useEffect there so SSR'd docs stay quiet.\nconst useIsoLayoutEffect =\n typeof window === \"undefined\" ? useEffect : useLayoutEffect;\n\nfunction paneDirectionFor(pane: ChatPane): ChatPaneDirection {\n return pane === \"thread\" ? 1 : -1;\n}\n\n/**\n * Compact (and `auto` once the frame measures narrower than 42rem) mounts\n * one pane at a time so `AnimatePresence` can push/pop. `frameWidth` 0 is\n * the unmeasured / SSR frame — treat it as wide so both panes render and\n * nothing flashes.\n */\nfunction isPaneSwap(layout: ChatLayout, frameWidth: number) {\n return (\n layout === \"compact\" ||\n (layout === \"auto\" && frameWidth > 0 && frameWidth < AUTO_WIDE_PX)\n );\n}\n\n/**\n * The compact pane swap — incoming travels `PANE_TRAVEL_PX` on\n * `TRAVEL_LINEAR`, fades and breathes `BLUR_PX` on `FADE_SWAP`; outgoing\n * drifts `PANE_LEAVE_PX` the other way. Under reduced motion: opacity\n * only, and instant.\n */\nexport function paneSwapMotion(\n direction: ChatPaneDirection,\n reduceMotion?: boolean | null,\n) {\n if (reduceMotion) {\n return {\n initial: { opacity: 0 },\n animate: { opacity: 1 },\n exit: { opacity: 0 },\n transition: { duration: 0 },\n };\n }\n return {\n initial: {\n x: direction * PANE_TRAVEL_PX,\n opacity: 0,\n filter: `blur(${BLUR_PX}px)`,\n },\n animate: { x: 0, opacity: 1, filter: \"blur(0px)\" },\n exit: {\n x: -direction * PANE_LEAVE_PX,\n opacity: 0,\n filter: `blur(${BLUR_PX}px)`,\n },\n transition: { x: TRAVEL_LINEAR, opacity: FADE_SWAP, filter: FADE_SWAP },\n };\n}\n\nfunction paneSwapVariants(reduceMotion: boolean | null) {\n return {\n enter: (direction: ChatPaneDirection) =>\n paneSwapMotion(direction, reduceMotion).initial,\n rest: (direction: ChatPaneDirection) =>\n paneSwapMotion(direction, reduceMotion).animate,\n leave: (direction: ChatPaneDirection) =>\n paneSwapMotion(direction, reduceMotion).exit,\n };\n}\n\n/**\n * DOM handlers whose React signatures clash with Motion's gesture props.\n * Same omit list as `Button` — swap panes and conversation rows render\n * through `motion.*`.\n */\ntype MotionHandlerConflicts =\n | \"onAnimationStart\"\n | \"onAnimationEnd\"\n | \"onAnimationIteration\"\n | \"onDrag\"\n | \"onDragStart\"\n | \"onDragEnd\"\n | \"onDragEnter\"\n | \"onDragExit\"\n | \"onDragLeave\"\n | \"onDragOver\"\n | \"onDrop\";\n\ntype SwapPaneProps = {\n show: boolean;\n swapped: boolean;\n direction: ChatPaneDirection;\n reduceMotion: boolean | null;\n children?: ReactNode;\n} & (\n | ({ as: \"aside\" } & Omit<\n ComponentProps<\"aside\">,\n \"children\" | MotionHandlerConflicts\n >)\n | ({ as: \"section\" } & Omit<\n ComponentProps<\"section\">,\n \"children\" | MotionHandlerConflicts\n >)\n);\n\ntype SwapMotionProps = {\n custom: ChatPaneDirection;\n variants: ReturnType<typeof paneSwapVariants>;\n initial: \"enter\";\n animate: \"rest\";\n exit: \"leave\";\n transition: ReturnType<typeof paneSwapMotion>[\"transition\"];\n};\n\n/**\n * The compact face — Root's `AnimatePresence` keys list vs thread. `custom`\n * on that presence feeds this step's push/pop into the exiting face.\n */\nfunction SwapPane({\n as,\n show,\n swapped,\n direction,\n reduceMotion,\n children,\n ...props\n}: SwapPaneProps) {\n const swap = paneSwapMotion(direction, reduceMotion);\n const motionProps: SwapMotionProps = {\n custom: direction,\n variants: paneSwapVariants(reduceMotion),\n initial: \"enter\",\n animate: \"rest\",\n exit: \"leave\",\n transition: swap.transition,\n };\n // Skip the first paint only before any pane change — a Thread that\n // remounts (host `key`) on the way in still pushes.\n return (\n <AnimatePresence\n initial={!swapped && show ? false : undefined}\n mode=\"popLayout\"\n custom={direction}\n >\n {show ? (\n as === \"aside\" ? (\n <motion.aside key=\"list\" {...props} {...motionProps}>\n {children}\n </motion.aside>\n ) : (\n <motion.section key=\"thread\" {...props} {...motionProps}>\n {children}\n </motion.section>\n )\n ) : null}\n </AnimatePresence>\n );\n}\n\n/* --------------------------------- root --------------------------------- */\n\nexport interface ChatRootProps extends ComponentProps<\"div\"> {\n /**\n * `default` shows both panes; `compact` one at a time; `auto` is\n * compact while the frame is narrower than 42rem.\n * @default \"default\"\n */\n layout?: ChatLayout;\n /** The pane that is up in a compact layout. Pair with `onPaneChange`. */\n pane?: ChatPane;\n /** Initial pane when uncontrolled. @default \"list\" */\n defaultPane?: ChatPane;\n /** Called with the next pane — a row opened a thread, back was pressed. */\n onPaneChange?: (pane: ChatPane) => void;\n ref?: Ref<HTMLDivElement>;\n}\n\n/**\n * The card. Give it a height (`h-[32rem]`, or `min-h-0 flex-1` in a\n * column that fills the page); the panes scroll inside it.\n */\nfunction Root({\n layout = \"default\",\n pane: paneProp,\n defaultPane = \"list\",\n onPaneChange,\n className,\n style,\n ref,\n ...props\n}: ChatRootProps) {\n const [uncontrolledPane, setUncontrolledPane] = useState(defaultPane);\n const [listWidth, setListWidth] = useState(LIST_WIDTH_PX);\n const [frameWidth, setFrameWidth] = useState(0);\n const rootRef = useRef<HTMLDivElement | null>(null);\n const controlled = paneProp !== undefined;\n const pane = controlled ? paneProp : uncontrolledPane;\n const [direction, setDirection] = useState<ChatPaneDirection>(() =>\n paneDirectionFor(pane),\n );\n const [swapped, setSwapped] = useState(false);\n const prevPaneRef = useRef(pane);\n // Keep this render's direction aligned with `pane` so a controlled\n // update and a `setPane` call both push/pop on the same frame.\n let renderedDirection = direction;\n let renderedSwapped = swapped;\n if (prevPaneRef.current !== pane) {\n renderedDirection = paneDirectionFor(pane);\n renderedSwapped = true;\n prevPaneRef.current = pane;\n if (renderedDirection !== direction) setDirection(renderedDirection);\n if (!swapped) setSwapped(true);\n }\n const setPane = useCallback(\n (next: ChatPane) => {\n setDirection(paneDirectionFor(next));\n if (!controlled) setUncontrolledPane(next);\n onPaneChange?.(next);\n },\n [controlled, onPaneChange],\n );\n const resizeList = useCallback((width: number) => {\n setListWidth(clampListWidth(width, rootRef.current?.clientWidth ?? 0));\n }, []);\n const swap = isPaneSwap(layout, frameWidth);\n useIsoLayoutEffect(() => {\n const root = rootRef.current;\n if (!root || typeof ResizeObserver === \"undefined\") return;\n const tighten = () => {\n const frame = root.clientWidth;\n setFrameWidth(frame);\n setListWidth((current) => clampListWidth(current, frame));\n };\n tighten();\n const observer = new ResizeObserver(tighten);\n observer.observe(root);\n return () => observer.disconnect();\n }, []);\n const value = useMemo(\n () => ({\n layout,\n pane,\n setPane,\n direction: renderedDirection,\n swap,\n swapped: renderedSwapped,\n listWidth,\n frameWidth,\n resizeList,\n rootRef,\n }),\n [\n layout,\n pane,\n setPane,\n renderedDirection,\n swap,\n renderedSwapped,\n listWidth,\n frameWidth,\n resizeList,\n ],\n );\n return (\n <ChatContext.Provider value={value}>\n <div\n ref={(node) => {\n rootRef.current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref) {\n (ref as { current: HTMLDivElement | null }).current = node;\n }\n }}\n data-chat=\"\"\n data-basic-page-card=\"\"\n data-layout={layout}\n data-pane={pane}\n style={\n {\n ...style,\n \"--chat-list-width\": `${listWidth}px`,\n } as CSSProperties\n }\n className={cn(\n CHAT_SURFACE,\n \"@container relative flex min-h-0 min-w-0 overflow-hidden\",\n className,\n )}\n {...props}\n />\n </ChatContext.Provider>\n );\n}\n\n/* --------------------------------- list --------------------------------- */\n\n/** The left pane — search above, conversations below, on the page wash. */\nfunction List({\n className,\n children,\n id: idProp,\n ...props\n}: ComponentProps<\"aside\">) {\n const { layout, pane, direction, swap, swapped } = useChat(\"List\");\n const reduceMotion = useReducedMotion();\n const uid = useId();\n const listId = idProp ?? uid;\n const listClass = cn(\n \"border-pho-secondary bg-pho-page relative z-10 flex min-h-0 shrink-0 flex-col\",\n layout === \"default\" && \"min-w-64 w-[var(--chat-list-width)] border-r\",\n layout === \"compact\" && \"w-full\",\n layout === \"auto\" &&\n cn(\n \"w-full @2xl:min-w-64 @2xl:w-[var(--chat-list-width)] @2xl:border-r\",\n !swap && pane === \"thread\" && \"@max-2xl:hidden\",\n ),\n className,\n );\n const body = (\n <>\n {children}\n {layout !== \"compact\" && <Splitter controlsId={listId} />}\n </>\n );\n const rest = {\n id: listId,\n \"aria-label\": \"Conversations\",\n \"data-chat-list\": \"\",\n className: listClass,\n ...props,\n };\n if (!swap) {\n return <aside {...rest}>{body}</aside>;\n }\n return (\n <SwapPane\n as=\"aside\"\n show={pane === \"list\"}\n swapped={swapped}\n direction={direction}\n reduceMotion={reduceMotion}\n {...rest}\n >\n {body}\n </SwapPane>\n );\n}\n\n/**\n * The drag between the panes — a focusable separator. Hidden in\n * `compact`, and in `auto` while the frame is narrow.\n */\nfunction Splitter({ controlsId }: { controlsId: string }) {\n const { layout, listWidth, frameWidth, resizeList, rootRef } =\n useChat(\"Splitter\");\n const drag = useRef<{ x: number; width: number } | null>(null);\n\n const onPointerDown = (event: PointerEvent<HTMLDivElement>) => {\n if (event.button !== 0) return;\n event.currentTarget.setPointerCapture?.(event.pointerId);\n drag.current = { x: event.clientX, width: listWidth };\n };\n\n const onPointerMove = (event: PointerEvent<HTMLDivElement>) => {\n const start = drag.current;\n if (start == null) return;\n const root = rootRef.current;\n const rtl = root != null && getComputedStyle(root).direction === \"rtl\";\n const delta = (event.clientX - start.x) * (rtl ? -1 : 1);\n resizeList(start.width + delta);\n };\n\n const onPointerUp = () => {\n drag.current = null;\n };\n\n const onKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n const root = rootRef.current;\n const rtl = root != null && getComputedStyle(root).direction === \"rtl\";\n const shrink = rtl ? \"ArrowRight\" : \"ArrowLeft\";\n const grow = rtl ? \"ArrowLeft\" : \"ArrowRight\";\n const step = event.shiftKey ? SPLIT_STEP_PX * 2 : SPLIT_STEP_PX;\n if (event.key === shrink) {\n event.preventDefault();\n resizeList(listWidth - step);\n } else if (event.key === grow) {\n event.preventDefault();\n resizeList(listWidth + step);\n } else if (event.key === \"Home\") {\n event.preventDefault();\n resizeList(LIST_MIN_PX);\n } else if (event.key === \"End\") {\n event.preventDefault();\n const frame = root?.clientWidth ?? 0;\n if (frame > 0) resizeList(frame - THREAD_MIN_PX);\n }\n };\n\n const valueMax =\n frameWidth > 0\n ? Math.max(LIST_MIN_PX, frameWidth - THREAD_MIN_PX)\n : listWidth;\n\n return (\n <div\n // WAI-ARIA window splitter: a focusable separator with a value. An\n // `hr` can neither take focus nor carry the value attributes.\n // oxlint-disable-next-line jsx-a11y/prefer-tag-over-role\n role=\"separator\"\n aria-orientation=\"vertical\"\n aria-label=\"Resize conversation list\"\n aria-controls={controlsId}\n aria-valuenow={listWidth}\n aria-valuemin={LIST_MIN_PX}\n aria-valuemax={valueMax}\n aria-valuetext={`${listWidth} pixels`}\n tabIndex={0}\n data-chat-splitter=\"\"\n onPointerDown={onPointerDown}\n onPointerMove={onPointerMove}\n onPointerUp={onPointerUp}\n onPointerCancel={onPointerUp}\n onKeyDown={onKeyDown}\n className={cn(\n \"absolute inset-y-0 -right-3 z-10 w-6 cursor-col-resize touch-none select-none\",\n \"outline-pho-brand focus-visible:outline-2 focus-visible:-outline-offset-2\",\n \"after:absolute after:inset-y-0 after:left-1/2 after:w-px after:-translate-x-1/2 after:bg-transparent\",\n \"[@media(hover:hover)]:hover:after:bg-pho-brand focus-visible:after:bg-pho-brand\",\n layout === \"auto\" && \"@max-2xl:hidden\",\n )}\n />\n );\n}\n\nexport interface ChatSearchProps extends Omit<\n InputProps,\n \"size\" | \"icon\" | \"label\" | \"hint\" | \"labelTrailing\"\n> {}\n\n/**\n * The search row pinned over the conversations — an `sm` `Input` with a\n * search's quiet focus: no ring, the magnifier takes the ink.\n */\nfunction Search({\n className,\n wrapperClassName,\n placeholder = \"Search\",\n ...props\n}: ChatSearchProps) {\n return (\n <div data-chat-search=\"\" className={cn(\"p-3\", TOP_BAR, className)}>\n <Input\n size=\"sm\"\n icon={IconSearch}\n placeholder={placeholder}\n aria-label=\"Search conversations\"\n autoComplete=\"off\"\n spellCheck={false}\n wrapperClassName={cn(\n QUIET_SEARCH_FOCUS,\n \"[&:focus-within>svg]:text-pho-primary [&>svg]:transition-colors [&>svg]:duration-100\",\n wrapperClassName,\n )}\n {...props}\n />\n </div>\n );\n}\n\n/**\n * The scrolling part of the list. Put a `ConversationList` in it — or a\n * `ConversationsLoading`, an `Empty` — and anything that belongs after\n * the rows (a load-older button).\n */\nfunction Conversations({\n className,\n children,\n ...props\n}: ComponentProps<\"div\">) {\n return (\n <div\n data-chat-conversations=\"\"\n className={cn(\"flex min-h-0 flex-1 flex-col\", className)}\n {...props}\n >\n <ScrollArea.Root className=\"min-h-0 flex-1\">\n <ScrollArea.Viewport>\n <ScrollArea.Content\n // Base UI sets `minWidth: fit-content` on Content; a long\n // title must truncate, not widen the pane.\n style={{ minWidth: 0 }}\n // Same horizontal rail as Sidebar sm (`px-3`): the selected\n // chip sits in the page wash instead of kissing the aside.\n className=\"flex min-h-full flex-col px-3 py-1\"\n >\n {children}\n </ScrollArea.Content>\n </ScrollArea.Viewport>\n <ScrollArea.Scrollbar>\n <ScrollArea.Thumb />\n </ScrollArea.Scrollbar>\n </ScrollArea.Root>\n </div>\n );\n}\n\n/** The rows. */\nfunction ConversationList({ className, ...props }: ComponentProps<\"ul\">) {\n return (\n <ul\n data-chat-conversation-list=\"\"\n // list-none/m-0/p-0 shield the rows from host prose styles.\n className={cn(\"m-0 flex list-none flex-col gap-0.5 *:m-0\", className)}\n {...props}\n />\n );\n}\n\n/* ------------------------------ conversation ---------------------------- */\n\n/**\n * DOM handlers whose React signatures clash with Motion's gesture props.\n * Same omit list as `Button` — rows render through `motion.*`.\n */\ninterface ConversationBaseProps {\n /** Who — a number, a name, the members of a group. */\n title: ReactNode;\n /** When — the page's relative time (`2d ago`), trailing. */\n time?: ReactNode;\n /** The latest message, one truncated line. */\n preview?: ReactNode;\n /** Replace the default avatar (a person, or people for a `group`). */\n avatar?: ReactNode;\n /** A group conversation — the default avatar shows people. */\n group?: boolean;\n /** The open conversation. */\n active?: boolean;\n className?: string;\n}\n\nexport interface ChatConversationLinkProps\n extends\n ConversationBaseProps,\n Omit<\n AnchorHTMLAttributes<HTMLAnchorElement>,\n keyof ConversationBaseProps | MotionHandlerConflicts\n > {\n /** Destination — rendered through the host's `LinkProvider`. */\n href: string;\n}\n\nexport interface ChatConversationButtonProps\n extends\n ConversationBaseProps,\n Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n keyof ConversationBaseProps | MotionHandlerConflicts\n > {\n href?: undefined;\n}\n\nexport type ChatConversationProps =\n ChatConversationLinkProps | ChatConversationButtonProps;\n\n/** The row at rest, on hover, and while open — one pointer target. */\nconst CONVERSATION_ROW =\n \"outline-pho-brand rounded-base flex w-full cursor-pointer items-center gap-3 px-2 py-2.5 text-left transition-colors focus-visible:outline-2 focus-visible:-outline-offset-1\";\n/**\n * Open row — same chip as `Sidebar.Item` current (`aria-current=page`).\n * Weight lives on the title span, not here: time and preview stay Regular.\n */\nconst CONVERSATION_ROW_ACTIVE =\n \"bg-pho-primary text-pho-primary ring-pho-secondary ring-1 ring-inset *:data-icon:text-pho-primary\";\nconst CONVERSATION_ROW_INACTIVE = \"hover:bg-pho-ghost-hover\";\n\nconst CONVERSATION_PRESS = {\n initial: false as const,\n whileTap: { scale: PRESS_SCALE_ROW },\n transition: SPRING_PRESS,\n};\n\n/**\n * One conversation — a link when `href` is given (through the host's\n * `LinkProvider`), otherwise a button. Opening it in a compact layout\n * brings the thread up.\n */\nfunction Conversation({\n title,\n time,\n preview,\n avatar,\n group,\n active,\n className,\n href,\n onClick,\n ...rest\n}: ChatConversationProps) {\n const { layout, setPane } = useChat(\"Conversation\");\n const Link = useLinkComponent();\n // Same bridge as `Sidebar.Item` — host `LinkProvider` + Motion press.\n const MotionLink = useMemo(\n () =>\n motion.create(Link as unknown as ComponentType<Record<string, unknown>>),\n [Link],\n );\n const rowClass = cn(\n CONVERSATION_ROW,\n active ? CONVERSATION_ROW_ACTIVE : CONVERSATION_ROW_INACTIVE,\n className,\n );\n const open = () => {\n if (layout !== \"default\") setPane(\"thread\");\n };\n const body = (\n <>\n {avatar ?? (\n <Avatar.Root size=\"sm\">\n <Avatar.Fallback>\n {group ? (\n <IconUsers className=\"size-4\" aria-hidden />\n ) : (\n <IconUser className=\"size-4\" aria-hidden />\n )}\n </Avatar.Fallback>\n </Avatar.Root>\n )}\n <span className=\"min-w-0 flex-1\">\n <span className=\"flex items-baseline justify-between gap-2\">\n <span className=\"text-pho-primary font-heading min-w-0 truncate text-base font-medium\">\n {title}\n </span>\n {time != null && (\n <span className=\"text-pho-description shrink-0 text-xs font-normal whitespace-nowrap tabular-nums\">\n {time}\n </span>\n )}\n </span>\n {preview != null && (\n <span className=\"text-pho-description block min-w-0 truncate text-xs font-normal\">\n {preview}\n </span>\n )}\n </span>\n </>\n );\n\n if (href !== undefined) {\n return (\n <li>\n <MotionLink\n href={href}\n aria-current={active ? \"page\" : undefined}\n {...(rest as AnchorHTMLAttributes<HTMLAnchorElement>)}\n onClick={(event: React.MouseEvent<HTMLAnchorElement>) => {\n (onClick as AnchorHTMLAttributes<HTMLAnchorElement>[\"onClick\"])?.(\n event,\n );\n if (!event.defaultPrevented) open();\n }}\n className={rowClass}\n {...CONVERSATION_PRESS}\n >\n {body}\n </MotionLink>\n </li>\n );\n }\n\n return (\n <li>\n <motion.button\n type=\"button\"\n aria-current={active ? \"true\" : undefined}\n {...(rest as Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n MotionHandlerConflicts\n >)}\n onClick={(event) => {\n (onClick as ButtonHTMLAttributes<HTMLButtonElement>[\"onClick\"])?.(\n event,\n );\n if (!event.defaultPrevented) open();\n }}\n className={rowClass}\n {...CONVERSATION_PRESS}\n >\n {body}\n </motion.button>\n </li>\n );\n}\n\n/* -------------------------------- thread -------------------------------- */\n\n/** The right pane — header, messages, and the docked footer, on the card. */\nfunction Thread({ className, children, ...props }: ComponentProps<\"section\">) {\n const { layout, pane, direction, swap, swapped } = useChat(\"Thread\");\n const reduceMotion = useReducedMotion();\n const threadClass = cn(\n \"bg-pho-primary flex min-h-0 flex-1 flex-col\",\n layout === \"default\" && \"min-w-80\",\n layout === \"compact\" && \"min-w-0\",\n layout === \"auto\" && \"min-w-0 @2xl:min-w-80\",\n !swap && layout === \"auto\" && pane === \"list\" && \"@max-2xl:hidden\",\n className,\n );\n if (!swap) {\n return (\n <section\n aria-label=\"Conversation\"\n data-chat-thread=\"\"\n className={threadClass}\n {...props}\n >\n {children}\n </section>\n );\n }\n return (\n <SwapPane\n as=\"section\"\n show={pane === \"thread\"}\n swapped={swapped}\n direction={direction}\n reduceMotion={reduceMotion}\n aria-label=\"Conversation\"\n data-chat-thread=\"\"\n className={threadClass}\n {...props}\n >\n {children}\n </SwapPane>\n );\n}\n\nexport interface ChatHeaderProps extends ComponentProps<\"header\"> {\n /** The other side's avatar — an `Avatar.Root`. */\n avatar?: ReactNode;\n /** Controls at the trailing edge — a details button, a menu. */\n actions?: ReactNode;\n /** The back button's accessible name. @default \"Back to conversations\" */\n backLabel?: string;\n}\n\n/**\n * Who the thread is with. Children are a `Title` and a `Description`.\n * In a compact layout a back button leads the row; `auto` shows it only\n * while the frame is narrow.\n */\nfunction Header({\n avatar,\n actions,\n backLabel = \"Back to conversations\",\n className,\n children,\n ...props\n}: ChatHeaderProps) {\n const { layout, setPane } = useChat(\"Header\");\n return (\n <header\n data-chat-header=\"\"\n className={cn(\n \"flex shrink-0 items-center gap-3 px-4 py-1.5\",\n TOP_BAR,\n className,\n )}\n {...props}\n >\n {layout !== \"default\" && (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n shape=\"circle\"\n svgOnly\n aria-label={backLabel}\n data-chat-back=\"\"\n className={cn(\"-ml-1 shrink-0\", layout === \"auto\" && \"@2xl:hidden\")}\n onClick={() => setPane(\"list\")}\n >\n <IconArrowLeft />\n </Button>\n )}\n {avatar}\n <div className=\"flex min-w-0 flex-1 flex-col\">{children}</div>\n {actions != null && (\n <div className=\"flex shrink-0 items-center gap-1\">{actions}</div>\n )}\n </header>\n );\n}\n\n/** The other side's name. Inline extras (a copy button, a badge) sit after it. */\nfunction Title({ className, children, ...props }: ComponentProps<\"h2\">) {\n return (\n <h2\n data-chat-title=\"\"\n className={cn(\n \"text-pho-primary font-heading m-0 flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 overflow-visible text-base font-medium\",\n className,\n )}\n {...props}\n >\n {children}\n </h2>\n );\n}\n\n/** One line under the title — from whom, a status. */\nfunction Description({ className, ...props }: ComponentProps<\"p\">) {\n return (\n <p\n data-chat-description=\"\"\n className={cn(\n \"text-pho-description m-0 min-w-0 truncate text-xs\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/* ------------------------------- messages ------------------------------- */\n\n/** Within this many px of the bottom the pane counts as pinned. */\nconst PIN_SLACK_PX = 40;\n\n/** How far above the top the earlier page is asked for, ahead of the reader. */\nconst EARLIER_AHEAD = \"200px 0px 0px 0px\";\n\nexport interface ChatMessagesProps extends ComponentProps<\"div\"> {\n /** Earlier pages exist — the top of the pane asks for them. */\n hasEarlier?: boolean;\n /** The earlier page is on its way — a spinner shows and nothing is asked. */\n loadingEarlier?: boolean;\n /** Ask for the page before the first message shown. */\n onLoadEarlier?: () => void;\n /** The button's label. @default \"Load earlier messages\" */\n earlierLabel?: ReactNode;\n}\n\n/** A row's distance from the top of the pane, in px. */\nfunction offsetIn(viewport: HTMLElement, row: Element) {\n return row.getBoundingClientRect().top - viewport.getBoundingClientRect().top;\n}\n\n/** Still in the thread and laid out (a `display: contents` wrapper isn't). */\nfunction placed(row: Element | null): row is Element {\n return row != null && row.isConnected && row.getClientRects().length > 0;\n}\n\n/** The oldest message shown: an earlier page goes in above it. */\nfunction oldestMessage(content: Element | null) {\n const row = content?.querySelector(\"[data-message]\") ?? null;\n return placed(row) ? row : null;\n}\n\n/**\n * The messages, oldest to newest, on the thread surface. The pane starts at\n * the bottom and stays there as messages arrive unless the reader has\n * scrolled up. With `hasEarlier`, the earlier page is asked for as the top\n * comes into view (an `IntersectionObserver`, 200px ahead) — the same\n * request as the button there, which stays for keyboards and for a browser\n * without the observer. While `loadingEarlier` a spinner takes its place,\n * and when the page arrives above, what they were reading stays put.\n * Children are `Message` rows and `Divider`s. Its state belongs to one\n * conversation: key the `Thread` by it.\n */\nfunction Messages({\n hasEarlier = false,\n loadingEarlier = false,\n onLoadEarlier,\n earlierLabel = \"Load earlier messages\",\n className,\n children,\n ...props\n}: ChatMessagesProps) {\n const viewportRef = useRef<HTMLDivElement | null>(null);\n const contentRef = useRef<HTMLDivElement | null>(null);\n const sentinelRef = useRef<HTMLDivElement | null>(null);\n const pinned = useRef(true);\n // Where the reader was when the earlier page was asked for: a row and how\n // far it sat from the pane's top, kept current as they go on scrolling,\n // until the page is in. The height and scroll position stand in when\n // there is no row to hold on to.\n const anchor = useRef<{\n row: Element | null;\n offset: number;\n height: number;\n top: number;\n } | null>(null);\n const loading = useRef(loadingEarlier);\n // The last request brought no messages (it failed, or the page was\n // empty). The top would ask again at once and go on asking, so it waits\n // for the button, or for another thread.\n const stalled = useRef(false);\n const askEarlier = useRef(onLoadEarlier);\n useIsoLayoutEffect(() => {\n askEarlier.current = onLoadEarlier;\n });\n\n // Holds the reader's place while an earlier page is on its way and once\n // it lands; otherwise keeps a pinned pane at the bottom.\n const settle = useCallback(() => {\n const viewport = viewportRef.current;\n if (!viewport) return;\n const kept = anchor.current;\n if (kept) {\n if (placed(kept.row)) {\n viewport.scrollTop += offsetIn(viewport, kept.row) - kept.offset;\n } else {\n viewport.scrollTop = viewport.scrollHeight - kept.height + kept.top;\n }\n if (loading.current) return;\n anchor.current = null;\n pinned.current =\n viewport.scrollHeight - viewport.scrollTop - viewport.clientHeight <\n PIN_SLACK_PX;\n return;\n }\n if (pinned.current) viewport.scrollTop = viewport.scrollHeight;\n }, []);\n\n useIsoLayoutEffect(() => {\n const viewport = viewportRef.current;\n const content = contentRef.current;\n if (!viewport || !content) return;\n settle();\n if (typeof ResizeObserver === \"undefined\") return;\n const observer = new ResizeObserver(settle);\n observer.observe(content);\n observer.observe(viewport);\n return () => observer.disconnect();\n }, [settle]);\n\n // The page is in (or the request is over): let go of the reader's place\n // before paint, even when nothing changed size.\n useIsoLayoutEffect(() => {\n loading.current = loadingEarlier;\n if (loadingEarlier) return;\n const kept = anchor.current;\n if (kept) stalled.current = oldestMessage(contentRef.current) === kept.row;\n settle();\n }, [loadingEarlier, settle]);\n\n const onScroll = () => {\n const viewport = viewportRef.current;\n if (!viewport) return;\n const kept = anchor.current;\n if (kept) {\n kept.height = viewport.scrollHeight;\n kept.top = viewport.scrollTop;\n if (placed(kept.row)) kept.offset = offsetIn(viewport, kept.row);\n }\n pinned.current =\n viewport.scrollHeight - viewport.scrollTop - viewport.clientHeight <\n PIN_SLACK_PX;\n };\n\n const loadEarlier = useCallback(() => {\n const viewport = viewportRef.current;\n if (viewport) {\n // New messages go in below the oldest one and the page above it, and\n // unlike a day's divider it stays when the page arrives.\n const row = oldestMessage(contentRef.current);\n anchor.current = {\n row,\n offset: row ? offsetIn(viewport, row) : 0,\n height: viewport.scrollHeight,\n top: viewport.scrollTop,\n };\n }\n pinned.current = false;\n askEarlier.current?.();\n }, []);\n\n useEffect(() => {\n const viewport = viewportRef.current;\n const sentinel = sentinelRef.current;\n if (!hasEarlier) {\n stalled.current = false;\n return;\n }\n if (loadingEarlier || stalled.current || !viewport || !sentinel) return;\n if (typeof IntersectionObserver === \"undefined\") return;\n const observer = new IntersectionObserver(\n (entries) => {\n if (entries.some((entry) => entry.isIntersecting)) loadEarlier();\n },\n { root: viewport, rootMargin: EARLIER_AHEAD },\n );\n observer.observe(sentinel);\n return () => observer.disconnect();\n }, [hasEarlier, loadingEarlier, loadEarlier]);\n\n return (\n <div\n data-chat-messages=\"\"\n className={cn(\n // Bubbles' focus and selected rings offset against the thread.\n \"flex min-h-0 flex-1 flex-col [--pho-bubble-backdrop:var(--background-color-pho-primary)]\",\n className,\n )}\n {...props}\n >\n <ScrollArea.Root className=\"min-h-0 flex-1\">\n <ScrollArea.Viewport ref={viewportRef} onScroll={onScroll}>\n <ScrollArea.Content\n ref={contentRef}\n style={{ minWidth: 0 }}\n className=\"flex min-h-full flex-col gap-1 p-4\"\n >\n {hasEarlier && (\n <div\n ref={sentinelRef}\n data-chat-earlier=\"\"\n aria-busy={loadingEarlier || undefined}\n className=\"flex min-h-8 items-center justify-center\"\n >\n {loadingEarlier ? (\n <Spinner\n aria-label=\"Loading earlier messages\"\n className=\"text-pho-secondary\"\n />\n ) : (\n <Button\n variant=\"outlined\"\n size=\"sm\"\n onClick={(event) => {\n // The spinner takes the button's place: keyboard focus\n // stays in the pane.\n if (event.currentTarget === document.activeElement) {\n viewportRef.current?.focus({ preventScroll: true });\n }\n stalled.current = false;\n loadEarlier();\n }}\n >\n {earlierLabel}\n </Button>\n )}\n </div>\n )}\n {children}\n </ScrollArea.Content>\n </ScrollArea.Viewport>\n <ScrollArea.Scrollbar>\n <ScrollArea.Thumb />\n </ScrollArea.Scrollbar>\n </ScrollArea.Root>\n </div>\n );\n}\n\n/** A centered caption in the thread — the day, \"Unread\". */\nfunction Divider({ className, children, ...props }: ComponentProps<\"div\">) {\n return (\n <div\n data-chat-divider=\"\"\n className={cn(\"text-pho-description py-1 text-center text-xs\", className)}\n {...props}\n >\n {children}\n </div>\n );\n}\n\n/* -------------------------------- footer -------------------------------- */\n\n/** The docked bar under the messages — usually a `Composer`. */\nfunction Footer({ className, ...props }: ComponentProps<\"footer\">) {\n return (\n <footer\n data-chat-footer=\"\"\n className={cn(\"shrink-0 px-4 py-3\", className)}\n {...props}\n />\n );\n}\n\n/** The draft box grows with the text up to this, then scrolls. */\nconst COMPOSER_MAX_HEIGHT_PX = 200;\n\nexport interface ChatComposerProps extends Omit<\n ComponentProps<\"form\">,\n \"onSubmit\" | \"prefix\" | \"children\"\n> {\n /** The draft. */\n value: string;\n onValueChange: (value: string) => void;\n /** Enter, or the send button. Not called while `sending` or with nothing to send. */\n onSend: () => void;\n placeholder?: string;\n /** The send is in flight — the button spins, the box waits. */\n sending?: boolean;\n disabled?: boolean;\n /**\n * There is something to send besides text (an attachment). By default\n * the send button wakes when the draft has a non-blank character.\n */\n canSend?: boolean;\n /** Controls at the start of the bottom row — an add-attachment button. */\n prefix?: ReactNode;\n /** A quiet line between `prefix` and the send button — a count, a size. */\n meta?: ReactNode;\n /** The send button's accessible name. @default \"Send\" */\n sendLabel?: string;\n /** Above the text — attachment thumbnails. */\n children?: ReactNode;\n /** The `<textarea>`. */\n textareaRef?: Ref<HTMLTextAreaElement>;\n}\n\n/**\n * The message box: text that grows with the draft, Enter to send and\n * Shift+Enter for a new line, one round send button. Attachments are the\n * page's: put their thumbnails in `children`, the button that adds them\n * in `prefix`, and flip `canSend` when they alone should send.\n */\nfunction Composer({\n value,\n onValueChange,\n onSend,\n placeholder = \"Message\",\n sending = false,\n disabled = false,\n canSend,\n prefix,\n meta,\n sendLabel = \"Send\",\n children,\n textareaRef,\n className,\n ...props\n}: ChatComposerProps) {\n const innerRef = useRef<HTMLTextAreaElement | null>(null);\n const ready = !sending && !disabled && (canSend ?? value.trim().length > 0);\n\n useIsoLayoutEffect(() => {\n const element = innerRef.current;\n if (!element) return;\n element.style.height = \"0px\";\n element.style.height = `${Math.min(element.scrollHeight, COMPOSER_MAX_HEIGHT_PX)}px`;\n }, [value]);\n\n const submit = (event: FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n if (ready) onSend();\n };\n\n const onKeyDown = (event: KeyboardEvent<HTMLTextAreaElement>) => {\n if (\n event.key === \"Enter\" &&\n !event.shiftKey &&\n !event.nativeEvent.isComposing\n ) {\n event.preventDefault();\n if (ready) onSend();\n }\n };\n\n return (\n <form\n aria-label=\"Message composer\"\n data-chat-composer=\"\"\n onSubmit={submit}\n className={cn(\n // The field surface, as `Input`: hairline at rest, brand ring while\n // anything inside has focus.\n \"rounded-base bg-pho-primary ring-pho-primary focus-within:ring-pho-brand ring-1 transition-shadow duration-100 ease-linear ring-inset focus-within:ring-2\",\n disabled && \"opacity-50\",\n className,\n )}\n {...props}\n >\n {children}\n <textarea\n ref={(node) => {\n innerRef.current = node;\n if (typeof textareaRef === \"function\") textareaRef(node);\n else if (textareaRef) {\n (textareaRef as { current: HTMLTextAreaElement | null }).current =\n node;\n }\n }}\n value={value}\n onChange={(event) => onValueChange(event.target.value)}\n onKeyDown={onKeyDown}\n rows={1}\n placeholder={placeholder}\n aria-label=\"Message\"\n disabled={disabled}\n // In flight the box holds its text but stays focusable — `disabled`\n // would drop focus mid-send; `ready` already blocks a second send.\n readOnly={sending}\n className=\"text-pho-primary placeholder:text-pho-placeholder m-0 block w-full resize-none bg-transparent px-4 pt-3 pb-1 text-base outline-none disabled:cursor-not-allowed\"\n />\n <div className=\"flex items-center gap-2 px-2 pb-2\">\n {prefix}\n <p className=\"text-pho-description m-0 min-w-0 flex-1 truncate text-xs\">\n {meta}\n </p>\n <Button\n type=\"submit\"\n size=\"sm\"\n shape=\"circle\"\n svgOnly\n aria-label={sendLabel}\n disabled={!ready}\n loading={sending}\n >\n <IconArrowUp />\n </Button>\n </div>\n </form>\n );\n}\n\n/* --------------------------------- states ------------------------------- */\n\nexport interface ChatEmptyProps extends StatusViewProps {}\n\n/**\n * The standing-in view for either pane — no conversations, no thread\n * chosen, nothing said yet. `StatusView` at card size, centered in\n * whatever room the pane has.\n */\nfunction Empty({ className, size = \"sm\", ...props }: ChatEmptyProps) {\n return (\n <div\n data-chat-empty=\"\"\n className={cn(\n \"flex flex-1 flex-col items-center justify-center px-6 py-8\",\n className,\n )}\n >\n <StatusView size={size} {...props} />\n </div>\n );\n}\n\n/** Bones in the shape of conversation rows — avatar, who, when, preview. */\nfunction ConversationsLoading({ rows = 5 }: { rows?: number }) {\n return (\n <div\n aria-hidden\n data-chat-conversations-loading=\"\"\n className=\"flex flex-col gap-0.5\"\n >\n {Array.from({ length: rows }, (_, row) => (\n <div key={row} className=\"flex items-center gap-3 px-2 py-2.5\">\n <Skeleton className=\"size-8 shrink-0 rounded-full\" />\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex items-center justify-between gap-2\">\n <Skeleton className=\"h-3.5 w-32\" />\n <Skeleton className=\"h-2.5 w-8\" />\n </div>\n <Skeleton className=\"mt-1.5 h-2.5 w-44\" />\n </div>\n </div>\n ))}\n </div>\n );\n}\n\n/** Bones in a thread's shape — theirs left, ours right. */\nfunction MessagesLoading() {\n return (\n <div\n aria-hidden\n data-chat-messages-loading=\"\"\n className=\"flex flex-col gap-3\"\n >\n <Skeleton className=\"rounded-base h-10 w-1/2 self-start\" />\n <Skeleton className=\"rounded-base h-10 w-2/5 self-end\" />\n <Skeleton className=\"rounded-base h-16 w-3/5 self-start\" />\n </div>\n );\n}\n\n/**\n * The composed inbox. Assemble the two panes and fill them:\n *\n * ```tsx\n * <Chat.Root layout=\"auto\" className=\"h-[32rem]\">\n * <Chat.List>\n * <Chat.Search value={query} onChange={…} />\n * <Chat.Conversations>\n * <Chat.ConversationList>\n * <Chat.Conversation title=\"+1 (315) 997-8332\" time=\"2d ago\" preview=\"…\" active />\n * </Chat.ConversationList>\n * </Chat.Conversations>\n * </Chat.List>\n * <Chat.Thread>\n * <Chat.Header avatar={<Avatar.Root size=\"md\">…</Avatar.Root>}>\n * <Chat.Title>+1 (315) 997-8332</Chat.Title>\n * <Chat.Description>From …</Chat.Description>\n * </Chat.Header>\n * <Chat.Messages>\n * <Chat.Divider>September 12</Chat.Divider>\n * <Message.Root>…</Message.Root>\n * </Chat.Messages>\n * <Chat.Footer>\n * <Chat.Composer value={draft} onValueChange={setDraft} onSend={send} />\n * </Chat.Footer>\n * </Chat.Thread>\n * </Chat.Root>\n * ```\n */\nexport const Chat = {\n Root,\n List,\n Search,\n Conversations,\n ConversationList,\n Conversation,\n Thread,\n Header,\n Title,\n Description,\n Messages,\n Divider,\n Footer,\n Composer,\n Empty,\n ConversationsLoading,\n MessagesLoading,\n};\n"],"ignoreList":[0,1,2,3],"mappings":";;;;;;;;;;;;;;;;;AASA,IAAMA,KAAa;AAAA,EAAC,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAAc,KAAO;AAAA,EAAQ,CAAC;AAAA,EAAG,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAAa,KAAO;AAAA,EAAQ,CAAC;AAAA,EAAG,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAAc,KAAO;AAAA,EAAQ,CAAC;AAAC,GAC9JoC,KAAgBxB,EAAqB,WAAW,cAAc,aAAaZ,EAAU,GCDrFC,KAAa;AAAA,EAAC,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAAc,KAAO;AAAA,EAAQ,CAAC;AAAA,EAAG,CAAC,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AAA,EACE,CAAA;AAET;AAGA,SAAS8C,KAAkB;AACzB,SACE,gBAAAhL,EAAC,OAAD;AAAA,IACE,eAAA;AAAA,IACA,8BAA2B;AAAA,IAC3B,WAAU;AAAA,IAHZ,UAAA;AAAA,MAKE,gBAAAD,EAACZ,GAAD,EAAU,WAAU,qCAAsC,CAAA;AAAA,MAC1D,gBAAAY,EAACZ,GAAD,EAAU,WAAU,mCAAoC,CAAA;AAAA,MACxD,gBAAAY,EAACZ,GAAD,EAAU,WAAU,qCAAsC,CAAA;AAAA,IACvD;AAAA,E;AAET;AA+BA,IAAa8L,KAAO;AAAA,EAClB,MAAAlI;AAAA,EACA,MAAA4B;AAAA,EACA,QAAAsB;AAAA,EACA,eAAAG;AAAA,EACA,kBAAAC;AAAA,EACA,cAAAK;AAAA,EACA,QAAAa;AAAA,EACA,QAAAE;AAAA,EACA,OAAAG;AAAA,EACA,aAAAC;AAAA,EACA,UAAAS;AAAA,EACA,SAAAoB;AAAA,EACA,QAAAC;AAAA,EACA,UAAAE;AAAA,EACA,OAAAc;AAAA,EACA,sBAAAE;AAAA,EACA,iBAAAG;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox-D8smFViR.js","names":["Checkbox","BaseCheckbox","CheckboxGroup","BaseCheckboxGroup","BaseCheckbox","usePressPulse","CHOICE_CARD_PRESS_SCALE","CHOICE_CARD_PRESS_TRANSITION","CHOICE_CARD_BASE","jsx","jsxs","motion","Checkbox","CheckboxGroup","CHECK_PATH","MINUS_PATH","DRAW_TRANSITION","DrawnCheckGlyph","indeterminate","className","BOX","ICON","Checkbox$1","label","size","disabled","props","motionProps","onPointerDown","boxMotionProps","box","cn","CheckboxGroup$1","CardCopy","title","description","CheckboxCard","icon","hasIcon"],"sources":["../../src/components/checkbox/check-glyph.tsx","../../src/components/checkbox/checkbox.tsx","../../src/components/checkbox/checkbox-group.tsx","../../src/components/checkbox/checkbox-card.tsx"],"sourcesContent":["import { motion } from \"motion/react\";\n\n// Tabler's IconCheck / IconMinus paths, redrawn as a single animatable\n// `motion.path` — same 24×24 outline geometry, round caps/joins. Tabler\n// draws at stroke 2 for a 24px icon; the box shows this one at 12–14px,\n// where 2 thins to a hair, so it strokes at 3 and reads with the same\n// weight the icons around it have.\nconst CHECK_PATH = \"M5 12l5 5l10 -10\";\nconst MINUS_PATH = \"M5 12l14 0\";\n\nconst DRAW_TRANSITION = { duration: 0.22, ease: \"easeOut\" } as const;\n\n/**\n * The checkbox glyph, stroked on rather than popped in solid — same\n * considered-motion spirit as Button's press/wake effects. Re-keyed per\n * state (check vs. dash) so every appearance draws fresh from empty instead\n * of resuming a stroke left mid-way by whatever the glyph showed before.\n */\nexport function DrawnCheckGlyph({\n indeterminate,\n className,\n}: {\n indeterminate?: boolean;\n className?: string;\n}) {\n return (\n <svg\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={3}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={className}\n aria-hidden=\"true\"\n >\n <motion.path\n key={indeterminate ? \"minus\" : \"check\"}\n d={indeterminate ? MINUS_PATH : CHECK_PATH}\n initial={{ pathLength: 0 }}\n animate={{ pathLength: 1 }}\n transition={DRAW_TRANSITION}\n />\n </svg>\n );\n}\n","import { type ComponentProps, type ReactNode } from \"react\";\nimport { Checkbox as BaseCheckbox } from \"@base-ui/react/checkbox\";\nimport { motion } from \"motion/react\";\nimport { DrawnCheckGlyph } from \"./check-glyph\";\nimport { cn } from \"../../utils/cn\";\nimport { usePressPulse } from \"../../utils/use-press-pulse\";\n\nexport type CheckboxSize = \"sm\" | \"md\";\n\nconst BOX: Record<CheckboxSize, string> = { sm: \"size-4\", md: \"size-5\" };\nconst ICON: Record<CheckboxSize, string> = { sm: \"size-3\", md: \"size-3.5\" };\n\nexport interface CheckboxProps extends Omit<\n ComponentProps<typeof BaseCheckbox.Root>,\n \"className\"\n> {\n className?: string;\n /** Text rendered beside the box; the whole row toggles the checkbox. */\n label?: ReactNode;\n /** Size variant. @default \"md\" */\n size?: CheckboxSize;\n}\n\n/**\n * Checkbox built on Base UI `Checkbox`. Supports checked, unchecked, and\n * `indeterminate` states; pass `label` for a clickable text row, or omit it\n * and provide an `aria-label`. For a set of related options that submit\n * together, wrap them in `CheckboxGroup`.\n *\n * Animation is the Effect Button family scaled to a toggle, kept restrained:\n * a quick shallow press pulse on pointer-down (always plays out), the\n * fill/stroke easing between states, and the glyph popping in.\n */\nexport function Checkbox({\n className,\n label,\n size = \"md\",\n disabled,\n indeterminate,\n ...props\n}: CheckboxProps) {\n const { motionProps } = usePressPulse({\n scale: 0.94,\n disabled: Boolean(disabled),\n });\n // With a label, the whole row is the hit target — press-trigger from there\n // (pointerdown bubbles up from the label text too) so the box still\n // animates when the text, not the box itself, is what's clicked.\n const { onPointerDown, ...boxMotionProps } = motionProps;\n\n const box = (\n <BaseCheckbox.Root\n disabled={disabled}\n indeterminate={indeterminate}\n render={\n <motion.span\n {...boxMotionProps}\n onPointerDown={label ? undefined : onPointerDown}\n />\n }\n className={cn(\n // Flat field surface with the input-strength ring; the glyph only shows\n // on the brand-solid checked fill, so it must be on-brand (not white —\n // brand-solid is white in dark mode).\n \"group/cb outline-pho-brand bg-pho-primary ring-pho-primary text-pho-on-brand flex shrink-0 cursor-pointer items-center justify-center rounded-sm ring-1 ring-inset focus-visible:outline-2 focus-visible:outline-offset-2\",\n // Fill and stroke ease between states (stroke dissolves into the\n // fill on tick). Transform stays out — Motion owns the press pulse.\n \"transition-[background-color,box-shadow,color,outline-color] duration-150 ease-out\",\n // group-hover covers hovering the label text, not just the box itself.\n \"hover:bg-pho-primary-hover hover:ring-pho-ink group-hover:bg-pho-primary-hover group-hover:ring-pho-ink\",\n \"data-[checked]:bg-pho-brand-solid data-[checked]:ring-transparent\",\n \"data-[indeterminate]:bg-pho-brand-solid data-[indeterminate]:ring-transparent\",\n \"data-[checked]:hover:bg-pho-brand-solid-hover data-[checked]:group-hover:bg-pho-brand-solid-hover\",\n \"data-[indeterminate]:hover:bg-pho-brand-solid-hover data-[indeterminate]:group-hover:bg-pho-brand-solid-hover\",\n \"data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50\",\n BOX[size],\n className,\n )}\n {...props}\n >\n {/* The glyph draws itself on (see DrawnCheckGlyph) — no separate\n pop-in needed. A quick fade covers the exit, since an unmount\n can't play the stroke backwards. */}\n <BaseCheckbox.Indicator\n className={cn(\n \"flex items-center justify-center transition-opacity duration-100 ease-out\",\n \"data-[ending-style]:opacity-0\",\n )}\n >\n <DrawnCheckGlyph indeterminate={indeterminate} className={ICON[size]} />\n </BaseCheckbox.Indicator>\n </BaseCheckbox.Root>\n );\n\n if (!label) return box;\n return (\n <label\n className=\"group flex cursor-pointer items-center gap-2 select-none\"\n onPointerDown={onPointerDown}\n >\n {box}\n <span className=\"text-pho-secondary text-base\">{label}</span>\n </label>\n );\n}\n\nCheckbox.displayName = \"Checkbox\";\n","import { type ComponentProps } from \"react\";\nimport { CheckboxGroup as BaseCheckboxGroup } from \"@base-ui/react/checkbox-group\";\nimport { cn } from \"../../utils/cn\";\n\nexport interface CheckboxGroupProps extends Omit<\n ComponentProps<typeof BaseCheckboxGroup>,\n \"className\"\n> {\n className?: string;\n}\n\n/**\n * Groups related `Checkbox`es and tracks their values as one. Built on Base UI\n * `CheckboxGroup` — supports a parent \"select all\" checkbox via `allValues`.\n * Control with `value` / `onValueChange` or leave uncontrolled with\n * `defaultValue`.\n */\nexport function CheckboxGroup({ className, ...props }: CheckboxGroupProps) {\n return (\n <BaseCheckboxGroup\n className={cn(\"flex flex-col gap-3\", className)}\n {...props}\n />\n );\n}\n\nCheckboxGroup.displayName = \"CheckboxGroup\";\n","import { type ComponentProps, type ReactNode } from \"react\";\nimport { Checkbox as BaseCheckbox } from \"@base-ui/react/checkbox\";\nimport { motion } from \"motion/react\";\nimport { DrawnCheckGlyph } from \"./check-glyph\";\nimport { cn } from \"../../utils/cn\";\nimport { usePressPulse } from \"../../utils/use-press-pulse\";\nimport {\n CHOICE_CARD_BASE,\n CHOICE_CARD_WITH_ICON,\n CHOICE_CARD_PRESS_SCALE,\n CHOICE_CARD_PRESS_TRANSITION,\n} from \"../../utils/choice-card\";\n\nexport interface CheckboxCardProps extends Omit<\n ComponentProps<typeof BaseCheckbox.Root>,\n \"className\" | \"title\"\n> {\n className?: string;\n /** Tile heading. */\n title: ReactNode;\n /** Supporting copy shown below the title. */\n description?: ReactNode;\n /** Glyph stacked above the title. When set, it replaces the checkbox box. */\n icon?: ReactNode;\n}\n\nfunction CardCopy({\n title,\n description,\n}: {\n title: ReactNode;\n description?: ReactNode;\n}) {\n return (\n <span className=\"flex min-w-0 flex-1 flex-col\">\n <span className=\"text-pho-primary font-heading block font-medium\">\n {title}\n </span>\n {description ? (\n <span className=\"text-pho-description block\">{description}</span>\n ) : null}\n </span>\n );\n}\n\n/**\n * A `Checkbox` styled as a bordered, selectable tile — title, optional\n * description, and either a stacked icon above them or the checkbox box at\n * the end of the title row. The tile is a\n * `<label>` around the control so clicks (including on the icon/title) are a\n * trusted activation of the hidden input Base UI renders beside the root.\n */\nexport function CheckboxCard({\n className,\n title,\n description,\n icon,\n disabled,\n indeterminate,\n ...props\n}: CheckboxCardProps) {\n const { motionProps } = usePressPulse({\n scale: CHOICE_CARD_PRESS_SCALE,\n disabled: Boolean(disabled),\n transition: CHOICE_CARD_PRESS_TRANSITION,\n });\n const hasIcon = icon != null;\n\n return (\n <motion.label\n {...motionProps}\n className={cn(\n CHOICE_CARD_BASE,\n hasIcon && CHOICE_CARD_WITH_ICON,\n className,\n )}\n data-disabled={disabled ? \"\" : undefined}\n >\n {hasIcon ? (\n <span\n aria-hidden\n className=\"text-pho-secondary flex size-6 shrink-0 items-center justify-center [&>svg]:size-6\"\n >\n {icon}\n </span>\n ) : null}\n <CardCopy title={title} description={description} />\n {/* The box sits at the end of the title row, centered on the title's\n line and the same half step from the right edge, square in the\n corner; with an icon it is the hidden control the label\n activates. */}\n <BaseCheckbox.Root\n disabled={disabled}\n indeterminate={indeterminate}\n className={\n hasIcon\n ? \"sr-only\"\n : cn(\n \"bg-pho-primary ring-pho-primary text-pho-on-brand mt-0.5 mr-0.5 flex size-4 shrink-0 items-center justify-center rounded-sm ring-1 ring-inset\",\n \"group-hover:bg-pho-primary-hover group-hover:ring-pho-ink transition-[background-color,box-shadow,color] duration-150 ease-out\",\n \"data-[checked]:bg-pho-brand-solid data-[checked]:group-hover:bg-pho-brand-solid-hover data-[checked]:ring-transparent\",\n \"data-[indeterminate]:bg-pho-brand-solid data-[indeterminate]:group-hover:bg-pho-brand-solid-hover data-[indeterminate]:ring-transparent\",\n )\n }\n {...props}\n >\n {hasIcon ? null : (\n <BaseCheckbox.Indicator\n className={cn(\n \"flex items-center justify-center transition-opacity duration-100 ease-out\",\n \"data-[ending-style]:opacity-0\",\n )}\n >\n <DrawnCheckGlyph\n indeterminate={indeterminate}\n className=\"size-2.5\"\n />\n </BaseCheckbox.Indicator>\n )}\n </BaseCheckbox.Root>\n </motion.label>\n );\n}\n\nCheckboxCard.displayName = \"CheckboxCard\";\n"],"mappings":";;;;;;;;;AAOA,IAAMc,IAAa,oBACbC,IAAa,cAEbC,IAAkB;AAAA,EAAE,UAAU;AAAA,EAAM,MAAM;AAAU;AAQ1D,SAAgBC,EAAgB,EAC9B,eAAAC,GACA,WAAAC,EAAA,GAIC;AACD,SACE,gBAAAV,EAAC,OAAD;AAAA,IACE,SAAQ;AAAA,IACR,MAAK;AAAA,IACL,QAAO;AAAA,IACP,aAAa;AAAA,IACb,eAAc;AAAA,IACd,gBAAe;AAAA,IACJ,WAAAU;AAAA,IACX,eAAY;AAAA,IAEZ,UAAA,gBAAAV,EAACE,EAAO,MAAR;AAAA,MAEE,GAAGO,IAAgBH,IAAaD;AAAA,MAChC,SAAS,EAAE,YAAY,EAAE;AAAA,MACzB,SAAS,EAAE,YAAY,EAAE;AAAA,MACzB,YAAYE;AAAA,IACb,GALME,IAAgB,UAAU,OAKhC;AAAA,E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ACA,yHACA,yIACF;AAAA,QAEN,GAAIL;AAAA,QAEH,UAAAY,IAAU,OACT,gBAAA7B,EAACL,EAAa,WAAd;AAAA,UACE,WAAW2B,EACT,6EACA,+BACF;AAAA,UAEA,UAAA,gBAAAtB,EAACQ,GAAD;AAAA,YACiB,eAAAC;AAAA,YACf,WAAU;AAAA,UACX,CAAA;AAAA,QACqB,CAAA;AAAA,MAET,CAAA;AAAA,IACP;AAAA,E;AAElB;AAEAkB,EAAa,cAAc"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"close-button-Ck4rY1Fp.js","names":["cn","resolveVariant","IconX","jsx","CLOSE_SIZES","CloseButton","size","label","className","props"],"sources":["../../src/components/button/close-button.tsx"],"sourcesContent":["import { type ButtonHTMLAttributes } from \"react\";\nimport { IconX } from \"@tabler/icons-react\";\nimport { cn } from \"../../utils/cn\";\nimport { resolveVariant, type VariantMap } from \"../../utils/resolve-variant\";\n\n// `rounded-base` (12px) at every size; base classes already apply squircle.\nconst CLOSE_SIZES = {\n sm: { classes: \"size-9 rounded-base *:size-5\" },\n md: { classes: \"size-10 rounded-base *:size-5\" },\n lg: { classes: \"size-11 rounded-base *:size-6\" },\n} satisfies VariantMap;\n\nexport interface CloseButtonProps extends Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n \"color\"\n> {\n /** Size variant. @default \"sm\" */\n size?: keyof typeof CLOSE_SIZES;\n /** Accessible label. @default \"Close\" */\n label?: string;\n}\n\n/**\n * Icon-only dismiss control — a squircle chip that fills on hover. Adapts to\n * light/dark automatically via semantic tokens. Used by Dialog and dismissible\n * surfaces.\n */\nexport function CloseButton({\n size = \"sm\",\n label,\n className,\n ...props\n}: CloseButtonProps) {\n return (\n <button\n type=\"button\"\n aria-label={label || \"Close\"}\n {...props}\n className={cn(\n \"squircle text-pho-secondary outline-pho-brand hover:bg-pho-ghost-hover hover:text-pho-secondary-hover inline-flex cursor-pointer items-center justify-center p-2 transition duration-100 ease-linear focus-visible:outline-2 focus-visible:outline-offset-2\",\n resolveVariant(CLOSE_SIZES, size),\n className,\n )}\n >\n <IconX aria-hidden=\"true\" className=\"transition-inherit-all shrink-0\" />\n </button>\n );\n}\n\nCloseButton.displayName = \"CloseButton\";\n"],"mappings":";;;;;;AAMA,IAAMI,IAAc;AAAA,EAClB,IAAI,EAAE,SAAS,+BAA+B;AAAA,EAC9C,IAAI,EAAE,SAAS,gCAAgC;AAAA,EAC/C,IAAI,EAAE,SAAS,gCAAgC;AACjD;AAiBA,SAAgBC,EAAY,EAC1B,MAAAC,IAAO,MACP,OAAAC,GACA,WAAAC,GACA,GAAGC,EAAA,GACgB;AACnB,SACE,gBAAAN,EAAC,UAAD;AAAA,IACE,MAAK;AAAA,IACL,cAAYI,KAAS;AAAA,IACrB,GAAIE;AAAA,IACJ,WAAWT,EACT,+PACAC,EAAeG,GAAaE,CAAI,GAChCE,CACF;AAAA,IAEA,UAAA,gBAAAL,EAACD,GAAD;AAAA,MAAO,eAAY;AAAA,MAAO,WAAU;AAAA,IAAmC,CAAA;AAAA,EACjE,CAAA;AAEZ;AAEAG,EAAY,cAAc"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"code-block-CthLWfxd.js","names":["__iconNode","__iconNode","_Fragment","cn","Button","createReactComponent","IconChevronDown","IconChevronUp","CopyButton","ScrollArea","Toggle","Tooltip","useEffect","useMemo","useState","useSyncExternalStore","Fragment$1","jsx","jsxs","__iconNode$2","IconArrowsMaximize","__iconNode$1","IconArrowsMinimize","__iconNode","IconTextWrap","CODE_GRAMMARS","LANGUAGE_ALIASES","resolveGrammar","language","CODE_TOKEN_CLASS","tokenColor","type","tokenTypeOf","color","kind","CODE_TOKEN_CLASS","rule","scope","phoTheme","core","corePromise","loadedGrammars","loadingGrammars","getCore","createHighlighterCore","createJavaScriptRegexEngine","highlighter","preloadLanguage","language","grammar","resolveGrammar","loading","CODE_GRAMMARS","module","isLanguageReady","toLines","tokens","line","out","token","last","highlightSync","code","plainLines","text","highlight","CACHE_LIMIT","cache","listeners","remember","key","lines","known","oldest","subscribe","listener","notify","cacheKey","useHighlight","useSyncExternalStore","now","useEffect","result","TOKEN","tokenizeJson","match","string","colon","number","keyword","punctuation","CODE_BLOCK_SURFACE","LINE_H","PAD_Y","toText","syncLines","FLOATING_ROOM","HeaderToggle","label","pressed","onPressedChange","children","jsxs","Tooltip","jsx","Toggle","CodeLines","lineNumbers","digits","wrap","index","cn","at","CodeBlock","title","maxLines","overflow","wrapProp","defaultWrap","onWrapChange","expandToggle","wrapToggle","copy","empty","actions","className","props","useMemo","highlighted","sync","ownWrap","setOwnWrap","useState","setWrap","next","expanded","setExpanded","folds","scrolling","shown","isEmpty","showExpandToggle","showWrapToggle","showCopy","hasTitle","builtIns","hasControls","copyLabel","scrollLabel","expandLabel","lineNoDigits","controls","Fragment$1","IconArrowsMinimize","IconArrowsMaximize","IconTextWrap","CopyButton","body","ScrollArea","Button","IconChevronUp","IconChevronDown","prev"],"sources":["../../../../node_modules/.pnpm/@tabler+icons-react@3.49.0_react@19.3.1/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowsMaximize.mjs","../../../../node_modules/.pnpm/@tabler+icons-react@3.49.0_react@19.3.1/node_modules/@tabler/icons-react/dist/esm/icons/IconArrowsMinimize.mjs","../../../../node_modules/.pnpm/@tabler+icons-react@3.49.0_react@19.3.1/node_modules/@tabler/icons-react/dist/esm/icons/IconTextWrap.mjs","../../src/components/code-block/languages.ts","../../src/components/code-block/tokens.ts","../../src/components/code-block/pho-theme.ts","../../src/components/code-block/highlight.ts","../../src/components/code-block/tokenize-json.ts","../../src/components/code-block/code-block.tsx"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.49.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M16 4l4 0l0 4\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M14 10l6 -6\", \"key\": \"svg-1\" }], [\"path\", { \"d\": \"M8 20l-4 0l0 -4\", \"key\": \"svg-2\" }], [\"path\", { \"d\": \"M4 20l6 -6\", \"key\": \"svg-3\" }], [\"path\", { \"d\": \"M16 20l4 0l0 -4\", \"key\": \"svg-4\" }], [\"path\", { \"d\": \"M14 14l6 6\", \"key\": \"svg-5\" }], [\"path\", { \"d\": \"M8 4l-4 0l0 4\", \"key\": \"svg-6\" }], [\"path\", { \"d\": \"M4 4l6 6\", \"key\": \"svg-7\" }]];\nconst IconArrowsMaximize = createReactComponent(\"outline\", \"arrows-maximize\", \"ArrowsMaximize\", __iconNode);\n\nexport { __iconNode, IconArrowsMaximize as default };\n","/**\n * @license @tabler/icons-react v3.49.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M5 9l4 0l0 -4\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M3 3l6 6\", \"key\": \"svg-1\" }], [\"path\", { \"d\": \"M5 15l4 0l0 4\", \"key\": \"svg-2\" }], [\"path\", { \"d\": \"M3 21l6 -6\", \"key\": \"svg-3\" }], [\"path\", { \"d\": \"M19 9l-4 0l0 -4\", \"key\": \"svg-4\" }], [\"path\", { \"d\": \"M15 9l6 -6\", \"key\": \"svg-5\" }], [\"path\", { \"d\": \"M19 15l-4 0l0 4\", \"key\": \"svg-6\" }], [\"path\", { \"d\": \"M15 15l6 6\", \"key\": \"svg-7\" }]];\nconst IconArrowsMinimize = createReactComponent(\"outline\", \"arrows-minimize\", \"ArrowsMinimize\", __iconNode);\n\nexport { __iconNode, IconArrowsMinimize as default };\n","/**\n * @license @tabler/icons-react v3.49.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M4 6l16 0\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M4 18l5 0\", \"key\": \"svg-1\" }], [\"path\", { \"d\": \"M4 12h13a3 3 0 0 1 0 6h-4l2 -2m0 4l-2 -2\", \"key\": \"svg-2\" }]];\nconst IconTextWrap = createReactComponent(\"outline\", \"text-wrap\", \"TextWrap\", __iconNode);\n\nexport { __iconNode, IconTextWrap as default };\n","import type { LanguageRegistration } from \"shiki/core\";\n\n/**\n * The languages a code panel can color, each a grammar fetched on first\n * use — a page that shows JSON never downloads the TypeScript grammar.\n * Keyed by the name Shiki knows the grammar by; `LANGUAGE_ALIASES` lets a\n * panel say `ts` or `sh`.\n */\nexport const CODE_GRAMMARS = {\n json: () => import(\"@shikijs/langs/json\"),\n jsonc: () => import(\"@shikijs/langs/jsonc\"),\n javascript: () => import(\"@shikijs/langs/javascript\"),\n typescript: () => import(\"@shikijs/langs/typescript\"),\n jsx: () => import(\"@shikijs/langs/jsx\"),\n tsx: () => import(\"@shikijs/langs/tsx\"),\n shellscript: () => import(\"@shikijs/langs/shellscript\"),\n python: () => import(\"@shikijs/langs/python\"),\n swift: () => import(\"@shikijs/langs/swift\"),\n go: () => import(\"@shikijs/langs/go\"),\n ruby: () => import(\"@shikijs/langs/ruby\"),\n php: () => import(\"@shikijs/langs/php\"),\n java: () => import(\"@shikijs/langs/java\"),\n kotlin: () => import(\"@shikijs/langs/kotlin\"),\n csharp: () => import(\"@shikijs/langs/csharp\"),\n rust: () => import(\"@shikijs/langs/rust\"),\n html: () => import(\"@shikijs/langs/html\"),\n css: () => import(\"@shikijs/langs/css\"),\n xml: () => import(\"@shikijs/langs/xml\"),\n yaml: () => import(\"@shikijs/langs/yaml\"),\n toml: () => import(\"@shikijs/langs/toml\"),\n dotenv: () => import(\"@shikijs/langs/dotenv\"),\n sql: () => import(\"@shikijs/langs/sql\"),\n graphql: () => import(\"@shikijs/langs/graphql\"),\n http: () => import(\"@shikijs/langs/http\"),\n markdown: () => import(\"@shikijs/langs/markdown\"),\n diff: () => import(\"@shikijs/langs/diff\"),\n} satisfies Record<string, () => Promise<{ default: LanguageRegistration[] }>>;\n\nexport type CodeGrammar = keyof typeof CODE_GRAMMARS;\n\n/** Shorter names, and the ones people reach for first. */\nexport const LANGUAGE_ALIASES = {\n js: \"javascript\",\n ts: \"typescript\",\n bash: \"shellscript\",\n sh: \"shellscript\",\n shell: \"shellscript\",\n zsh: \"shellscript\",\n py: \"python\",\n rb: \"ruby\",\n kt: \"kotlin\",\n cs: \"csharp\",\n rs: \"rust\",\n yml: \"yaml\",\n md: \"markdown\",\n htm: \"html\",\n} as const satisfies Record<string, CodeGrammar>;\n\nexport type CodeLanguageAlias = keyof typeof LANGUAGE_ALIASES;\n\n/**\n * What `language` accepts: a grammar, an alias, or `text` for none. Plain\n * text is the default — a panel colors only what it is told the shape of.\n */\nexport type CodeBlockLanguage = \"text\" | CodeGrammar | CodeLanguageAlias;\n\n/**\n * The grammar behind a `language`, or `null` for plain text and names the\n * panel does not know (which read as text instead of throwing).\n */\nexport function resolveGrammar(language: string): CodeGrammar | null {\n // Own keys only: `in` would take \"toString\" for a grammar.\n if (Object.hasOwn(LANGUAGE_ALIASES, language)) {\n return LANGUAGE_ALIASES[language as CodeLanguageAlias];\n }\n return Object.hasOwn(CODE_GRAMMARS, language)\n ? (language as CodeGrammar)\n : null;\n}\n","/**\n * The token vocabulary a code panel colors with — one class per kind, on\n * the `--color-pho-code-*` tokens, which carry light and dark. The JSON\n * tokenizer speaks the first five; Shiki's grammars reach the rest.\n */\n\nexport type CodeTokenType =\n | \"key\"\n | \"string\"\n | \"number\"\n | \"keyword\"\n | \"punctuation\"\n | \"comment\"\n | \"function\"\n | \"type\"\n | \"plain\";\n\nexport interface CodeToken {\n type: CodeTokenType;\n text: string;\n}\n\n/** One line of a highlighted body. */\nexport type CodeLine = CodeToken[];\n\n/** The class a token kind wears; `plain` wears the panel's own ink. */\nexport const CODE_TOKEN_CLASS: Record<CodeTokenType, string | undefined> = {\n key: \"text-pho-code-key\",\n string: \"text-pho-code-string\",\n number: \"text-pho-code-number\",\n keyword: \"text-pho-code-keyword\",\n punctuation: \"text-pho-code-punctuation\",\n comment: \"text-pho-code-comment\",\n function: \"text-pho-code-function\",\n type: \"text-pho-code-type\",\n plain: undefined,\n};\n","import type { ThemeRegistrationRaw } from \"shiki/core\";\nimport { CODE_TOKEN_CLASS, type CodeTokenType } from \"./tokens\";\n\n/**\n * Pho's Shiki theme — not a palette but a routing table. Every TextMate\n * scope resolves to one of the panel's token kinds, and each kind's\n * \"color\" is the design token's own variable, so the theme has no light\n * and dark of its own: the `--color-pho-code-*` tokens carry both, and\n * the renderer turns each color back into the kind's class. Only the\n * kinds a body needs to read — keys, strings, numbers, keywords,\n * punctuation, comments, calls, types. Operators, variables, and\n * everything else stay in the panel's ink.\n */\n\nexport const PHO_THEME_NAME = \"pho\";\n\n/** The color a token kind \"has\" in the theme: its token's variable. */\nexport function tokenColor(type: Exclude<CodeTokenType, \"plain\">): string {\n return `var(--color-pho-code-${type})`;\n}\n\n/** The token kind behind a Shiki color, or `plain` for the panel's ink. */\nexport function tokenTypeOf(color: string | undefined): CodeTokenType {\n const match = color?.match(/^var\\(--color-pho-code-([a-z]+)\\)$/);\n const kind = match?.[1];\n return kind != null && kind in CODE_TOKEN_CLASS && kind !== \"plain\"\n ? (kind as CodeTokenType)\n : \"plain\";\n}\n\nconst rule = (\n type: Exclude<CodeTokenType, \"plain\"> | \"plain\",\n scope: string[],\n) => ({\n scope,\n settings: {\n foreground:\n type === \"plain\" ? \"var(--color-pho-code-fg)\" : tokenColor(type),\n },\n});\n\nexport const phoTheme: ThemeRegistrationRaw = {\n name: PHO_THEME_NAME,\n type: \"light\",\n fg: \"var(--color-pho-code-fg)\",\n bg: \"var(--color-pho-code-bg)\",\n settings: [\n rule(\"comment\", [\"comment\", \"punctuation.definition.comment\"]),\n rule(\"string\", [\n \"string\",\n \"markup.inserted\",\n \"meta.diff.header.to-file\",\n \"punctuation.definition.inserted\",\n ]),\n // A template's `${…}` and any embedded code read as code again.\n rule(\"plain\", [\"meta.template.expression\", \"meta.embedded\"]),\n rule(\"key\", [\n \"support.type.property-name\",\n \"meta.object-literal.key\",\n \"entity.other.attribute-name\",\n \"entity.name.tag.yaml\",\n \"keyword.key.toml\",\n \"variable.other.env\",\n ]),\n rule(\"number\", [\n \"constant.numeric\",\n \"markup.deleted\",\n \"meta.diff.header.from-file\",\n \"punctuation.definition.deleted\",\n ]),\n rule(\"keyword\", [\n \"keyword\",\n \"storage\",\n \"constant.language\",\n \"variable.language\",\n ]),\n // Symbolic operators sit in the ink: `=`, `+`, `=>`, `&&` are shape,\n // not vocabulary. The word-shaped ones above stay keywords.\n rule(\"plain\", [\"keyword.operator\"]),\n rule(\"keyword\", [\n \"keyword.operator.expression\",\n \"keyword.operator.new\",\n \"keyword.operator.logical.python\",\n \"keyword.operator.wordlike\",\n ]),\n rule(\"function\", [\n \"entity.name.function\",\n \"support.function\",\n \"entity.name.command\",\n \"meta.function-call.generic\",\n ]),\n rule(\"type\", [\n \"entity.name.type\",\n \"entity.name.class\",\n \"entity.name.tag\",\n \"entity.other.inherited-class\",\n \"support.type\",\n \"support.class\",\n \"storage.type.primitive\",\n ]),\n // A property name is a key even though it is a `support.type`.\n rule(\"key\", [\"support.type.property-name\"]),\n rule(\"punctuation\", [\n \"punctuation.separator\",\n \"punctuation.terminator\",\n \"punctuation.accessor\",\n \"punctuation.section\",\n \"punctuation.definition.array\",\n \"punctuation.definition.dictionary\",\n \"punctuation.definition.block\",\n \"punctuation.definition.parameters\",\n \"punctuation.definition.arguments\",\n \"punctuation.definition.tag\",\n \"punctuation.definition.typeparameters\",\n \"meta.brace\",\n ]),\n ],\n};\n","import { useEffect, useSyncExternalStore } from \"react\";\nimport type { HighlighterCore, ThemedToken } from \"shiki/core\";\nimport { CODE_GRAMMARS, resolveGrammar, type CodeGrammar } from \"./languages\";\nimport { phoTheme, PHO_THEME_NAME, tokenTypeOf } from \"./pho-theme\";\nimport type { CodeLine } from \"./tokens\";\n\n/**\n * Highlighting, on Shiki — one highlighter for the whole app, made on\n * the first panel that asks and kept; grammars fetched on demand and\n * kept too. Bodies are tokenized once per (grammar, text) and remembered,\n * so a wrap toggle or a fold never re-runs a grammar.\n *\n * The result is lines of `CodeToken`s in the panel's own vocabulary\n * (`tokens.ts`), never Shiki's HTML: the panel keeps rendering its own\n * lines (the fold, `data-line`) and its own classes (the design tokens).\n *\n * Nothing here runs on the server. `useHighlight` reports `null` until a\n * body is highlighted, and a panel shows its synchronous face meanwhile —\n * plain text, or the JSON tokenizer's colors — so a page prerendered and\n * a page hydrated agree, and the colors settle in a frame later.\n */\n\nlet core: HighlighterCore | null = null;\nlet corePromise: Promise<HighlighterCore> | null = null;\nconst loadedGrammars = new Set<CodeGrammar>();\nconst loadingGrammars = new Map<CodeGrammar, Promise<void>>();\n\n/**\n * Shiki itself arrives with the first body that needs it — a page of\n * cards and rows never loads the engine — and stays for the rest.\n */\nfunction getCore(): Promise<HighlighterCore> {\n corePromise ??= Promise.all([\n import(\"shiki/core\"),\n import(\"shiki/engine/javascript\"),\n ])\n .then(([{ createHighlighterCore }, { createJavaScriptRegexEngine }]) =>\n createHighlighterCore({\n themes: [phoTheme],\n langs: [],\n // Shiki's JavaScript engine: no WebAssembly to fetch or allow, and\n // `forgiving` degrades a grammar's exotic pattern instead of\n // failing the whole body.\n engine: createJavaScriptRegexEngine({ forgiving: true }),\n }),\n )\n .then((highlighter) => {\n core = highlighter;\n return highlighter;\n });\n return corePromise;\n}\n\n/** Fetch a language's grammar ahead of the first body that needs it. */\nexport function preloadLanguage(language: string): Promise<void> {\n const grammar = resolveGrammar(language);\n if (grammar == null || loadedGrammars.has(grammar)) return Promise.resolve();\n let loading = loadingGrammars.get(grammar);\n if (loading == null) {\n loading = Promise.all([getCore(), CODE_GRAMMARS[grammar]()])\n .then(([highlighter, module]) =>\n highlighter.loadLanguage(...module.default),\n )\n .then(() => {\n loadedGrammars.add(grammar);\n })\n .finally(() => {\n loadingGrammars.delete(grammar);\n });\n loadingGrammars.set(grammar, loading);\n }\n return loading;\n}\n\n/** Whether `language` can be tokenized right now, without waiting. */\nexport function isLanguageReady(language: string): boolean {\n const grammar = resolveGrammar(language);\n return grammar != null && core != null && loadedGrammars.has(grammar);\n}\n\nfunction toLines(tokens: ThemedToken[][]): CodeLine[] {\n return tokens.map((line) => {\n const out: CodeLine = [];\n for (const token of line) {\n const type = tokenTypeOf(token.color);\n const last = out[out.length - 1];\n // Neighbors of one kind collapse into one span.\n if (last != null && last.type === type) last.text += token.content;\n else out.push({ type, text: token.content });\n }\n return out;\n });\n}\n\n/**\n * Tokenize a body with a grammar that is already loaded. `null` when the\n * language is plain text or its grammar is not here yet — see\n * `preloadLanguage` / `highlight`.\n */\nexport function highlightSync(\n code: string,\n language: string,\n): CodeLine[] | null {\n const grammar = resolveGrammar(language);\n if (grammar == null || core == null || !loadedGrammars.has(grammar)) {\n return null;\n }\n return toLines(\n core.codeToTokensBase(code, { lang: grammar, theme: PHO_THEME_NAME }),\n );\n}\n\n/** Plain lines — what a body reads as with no grammar. */\nexport function plainLines(code: string): CodeLine[] {\n return code.split(\"\\n\").map((text) => [{ type: \"plain\", text }]);\n}\n\n/**\n * Tokenize a body, fetching the highlighter and the grammar first if\n * need be. A language the panel does not know resolves to plain lines.\n */\nexport async function highlight(\n code: string,\n language: string,\n): Promise<CodeLine[]> {\n if (resolveGrammar(language) == null) return plainLines(code);\n await preloadLanguage(language);\n return highlightSync(code, language) ?? plainLines(code);\n}\n\n/* --------------------------------- store --------------------------------- */\n\n/** How many highlighted bodies to keep. A page's worth, several times. */\nconst CACHE_LIMIT = 200;\nconst cache = new Map<string, CodeLine[]>();\nconst listeners = new Set<() => void>();\n\nfunction remember(key: string, lines: CodeLine[]): CodeLine[] {\n const known = cache.get(key);\n if (known != null) return known;\n if (cache.size >= CACHE_LIMIT) {\n const oldest = cache.keys().next().value;\n if (oldest != null) cache.delete(oldest);\n }\n cache.set(key, lines);\n return lines;\n}\n\nfunction subscribe(listener: () => void) {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n}\n\nfunction notify() {\n for (const listener of listeners) listener();\n}\n\nfunction cacheKey(grammar: CodeGrammar, code: string) {\n return `${grammar}\u0000${code}`;\n}\n\n/**\n * The highlighted lines of a body, or `null` while its grammar is on the\n * way (and always for plain text). A grammar already here highlights in\n * the same render, no flash.\n */\nexport function useHighlight(\n code: string,\n language: string,\n): CodeLine[] | null {\n const grammar = resolveGrammar(language);\n const key = grammar != null ? cacheKey(grammar, code) : null;\n const lines = useSyncExternalStore(\n subscribe,\n () => {\n if (key == null) return null;\n const known = cache.get(key);\n if (known != null) return known;\n const now = highlightSync(code, language);\n return now != null ? remember(key, now) : null;\n },\n // Prerendered markup is the synchronous face; hydration agrees with it\n // and the colors settle in the render after.\n () => null,\n );\n useEffect(() => {\n if (key == null || cache.has(key)) return;\n // Remembered even if this panel is gone by then: the next one with the\n // same body reads it in its first render.\n highlight(code, language).then(\n (result) => {\n remember(key, result);\n notify();\n },\n () => {\n // A grammar that would not load: the panel keeps its plain face.\n },\n );\n }, [key, code, language]);\n return lines;\n}\n","/**\n * A tokenizer for JSON, and nothing else: keys, strings, numbers, the\n * three keywords, and punctuation. Runs one line at a time (a JSON\n * string never spans lines) so a panel can show its first N lines and\n * stop. Text that isn't JSON comes back as it is, in plain tokens.\n */\n\nexport type JsonTokenType =\n \"key\" | \"string\" | \"number\" | \"keyword\" | \"punctuation\" | \"plain\";\n\nexport interface JsonToken {\n type: JsonTokenType;\n text: string;\n}\n\n// One pass, left to right: a string (a key when a colon follows), a\n// number, a keyword, a bracket or a comma. Anything between is plain.\nconst TOKEN =\n /(\"(?:[^\"\\\\]|\\\\.)*\")(\\s*:)?|(-?\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?)|\\b(true|false|null)\\b|([{}[\\]:,])/g;\n\nexport function tokenizeJson(line: string): JsonToken[] {\n const tokens: JsonToken[] = [];\n let last = 0;\n TOKEN.lastIndex = 0;\n for (let match = TOKEN.exec(line); match != null; match = TOKEN.exec(line)) {\n if (match.index > last) {\n tokens.push({ type: \"plain\", text: line.slice(last, match.index) });\n }\n const [, string, colon, number, keyword, punctuation] = match;\n if (string != null) {\n tokens.push({ type: colon != null ? \"key\" : \"string\", text: string });\n if (colon != null) tokens.push({ type: \"punctuation\", text: colon });\n } else if (number != null) {\n tokens.push({ type: \"number\", text: number });\n } else if (keyword != null) {\n tokens.push({ type: \"keyword\", text: keyword });\n } else if (punctuation != null) {\n tokens.push({ type: \"punctuation\", text: punctuation });\n }\n last = match.index + match[0].length;\n }\n if (last < line.length) {\n tokens.push({ type: \"plain\", text: line.slice(last) });\n }\n return tokens;\n}\n","import {\n useMemo,\n useState,\n type ComponentProps,\n type ReactNode,\n type Ref,\n} from \"react\";\nimport {\n IconArrowsMaximize,\n IconArrowsMinimize,\n IconChevronDown,\n IconChevronUp,\n IconTextWrap,\n} from \"@tabler/icons-react\";\nimport { Button } from \"../button\";\nimport { CopyButton } from \"../copy-button\";\nimport { ScrollArea } from \"../scroll-area\";\nimport { Toggle } from \"../toggle\";\nimport { Tooltip } from \"../tooltip\";\nimport { cn } from \"../../utils/cn\";\nimport { plainLines, useHighlight } from \"./highlight\";\nimport type { CodeBlockLanguage } from \"./languages\";\nimport { tokenizeJson } from \"./tokenize-json\";\nimport { CODE_TOKEN_CLASS, type CodeLine } from \"./tokens\";\n\n/**\n * Code Block — a read-only panel for a request body, a response, an\n * event's JSON, an install command. Mono text on the code surface, a title row with expand,\n * wrap, and copy controls. Past `maxLines` the body either scrolls\n * inside that height (`overflow=\"scroll\"`, the default) or folds with a\n * footer button (`overflow=\"expand\"`).\n *\n * Design notes:\n * - Wide lines scroll sideways inside the panel; the page never does.\n * Wrapping is a toggle (`wrap` / `defaultWrap`), off by default so a\n * body reads the way it was sent.\n * - `language` colors the text with Shiki's grammar for it, fetched on\n * first use, on the `--color-pho-code-*` tokens, which carry light and\n * dark. JSON has a synchronous face too — a built-in tokenizer paints\n * it in the first render, and the grammar agrees with it — so a body\n * never flashes plain. Other languages read plain for the frame their\n * grammar takes to arrive.\n * - Without a `title` there is no title row: the controls float over the\n * panel's top-right corner, the way a snippet on a page wears a copy\n * button.\n * - A body that isn't a string (an object) is pretty-printed as JSON.\n */\n\nexport type CodeBlockOverflow = \"scroll\" | \"expand\";\n\n/** The panel's chrome — the card hairline around the code surface. */\nconst CODE_BLOCK_SURFACE =\n \"rounded-base border border-pho-secondary bg-pho-code-bg text-pho-code-fg\";\n\n/** One code line is `leading-5` / `min-h-5`; the pre pads `py-3`. */\nconst LINE_H = \"1.25rem\";\nconst PAD_Y = \"0.75rem\";\n\nexport interface CodeBlockProps extends Omit<\n ComponentProps<\"div\">,\n \"title\" | \"children\"\n> {\n /** The text. An object is pretty-printed as JSON (two-space indent). */\n code?: string | object | null;\n /**\n * What the text is, so the panel can color it: `json`, `typescript`,\n * `bash`, `python`, … or `text` for none. @default \"text\"\n */\n language?: CodeBlockLanguage;\n /**\n * The title row's words — \"Request body\", \"Response\". Without one the\n * row goes and the controls float over the top-right corner.\n */\n title?: ReactNode;\n /** Past this many lines the panel folds or clips. @default 30 */\n maxLines?: number;\n /**\n * How a long body is shown past `maxLines`. `scroll` clips to that\n * height and scrolls inside, with an expand toggle in the title row.\n * `expand` folds and shows a footer button.\n * @default \"scroll\"\n */\n overflow?: CodeBlockOverflow;\n /** Wrap long lines (controlled). */\n wrap?: boolean;\n /** Wrap long lines at first (uncontrolled). @default false */\n defaultWrap?: boolean;\n onWrapChange?: (wrap: boolean) => void;\n /** The expand toggle when `overflow` is `scroll`. @default true */\n expandToggle?: boolean;\n /** The wrap toggle. @default true */\n wrapToggle?: boolean;\n /**\n * A gutter of line numbers. Off by default; turn on for a long\n * payload (about twenty lines or more).\n * @default false\n */\n lineNumbers?: boolean;\n /** The copy control. @default true */\n copy?: boolean;\n /** What the panel says with no code. @default \"Nothing to show.\" */\n empty?: ReactNode;\n /** More controls beside the built-in ones, before them. */\n actions?: ReactNode;\n ref?: Ref<HTMLDivElement>;\n}\n\nfunction toText(code: CodeBlockProps[\"code\"]): string {\n if (code == null) return \"\";\n if (typeof code === \"string\") return code;\n try {\n return JSON.stringify(code, null, 2) ?? \"\";\n } catch {\n return String(code);\n }\n}\n\n/** The face a body has before (or without) its grammar. */\nfunction syncLines(text: string, language: CodeBlockLanguage): CodeLine[] {\n if (language === \"json\" || language === \"jsonc\") {\n return text.split(\"\\n\").map((line) => tokenizeJson(line));\n }\n return plainLines(text);\n}\n\n/** Room on the first lines for the floating controls, by how many show. */\nconst FLOATING_ROOM = [undefined, \"pr-12\", \"pr-20\", \"pr-28\"] as const;\n\nfunction HeaderToggle({\n label,\n pressed,\n onPressedChange,\n children,\n}: {\n label: string;\n pressed: boolean;\n onPressedChange: (next: boolean) => void;\n children: ReactNode;\n}) {\n return (\n <Tooltip.Root>\n <Tooltip.Trigger\n render={\n <Toggle\n size=\"sm\"\n pressed={pressed}\n onPressedChange={onPressedChange}\n aria-label={label}\n className=\"rounded-sm\"\n >\n {children}\n </Toggle>\n }\n />\n <Tooltip.Portal>\n <Tooltip.Positioner>\n <Tooltip.Popup>{label}</Tooltip.Popup>\n </Tooltip.Positioner>\n </Tooltip.Portal>\n </Tooltip.Root>\n );\n}\n\nfunction CodeLines({\n lines,\n lineNumbers,\n digits,\n wrap,\n}: {\n lines: CodeLine[];\n lineNumbers: boolean;\n digits: number;\n wrap: boolean;\n}) {\n return (\n <code>\n {lines.map((line, index) => (\n <span\n key={index}\n data-line=\"\"\n className={cn(\n \"min-h-5\",\n lineNumbers ? \"flex items-start\" : \"block\",\n lineNumbers && !wrap && \"min-w-max\",\n )}\n >\n {lineNumbers ? (\n <span\n data-line-number=\"\"\n aria-hidden\n className=\"text-pho-placeholder bg-pho-code-bg sticky left-0 z-[1] box-content shrink-0 pr-3 pl-3 text-right font-mono text-xs leading-5 tabular-nums select-none\"\n style={{ width: `${digits}ch` }}\n >\n {index + 1}\n </span>\n ) : null}\n <span className={lineNumbers ? \"min-w-0 flex-1\" : undefined}>\n {line.map((token, at) =>\n token.type === \"plain\" ? (\n token.text\n ) : (\n <span key={at} className={CODE_TOKEN_CLASS[token.type]}>\n {token.text}\n </span>\n ),\n )}\n </span>\n </span>\n ))}\n </code>\n );\n}\n\nexport function CodeBlock({\n code,\n language = \"text\",\n title,\n maxLines = 30,\n overflow = \"scroll\",\n wrap: wrapProp,\n defaultWrap = false,\n onWrapChange,\n expandToggle = true,\n wrapToggle = true,\n lineNumbers = false,\n copy = true,\n empty = \"Nothing to show.\",\n actions,\n className,\n ...props\n}: CodeBlockProps) {\n const text = useMemo(() => toText(code), [code]);\n const highlighted = useHighlight(text, language);\n const lines = useMemo(() => {\n const sync = syncLines(text, language);\n // The grammar and the split must agree on where lines are; where\n // they don't, the synchronous face stands.\n return highlighted != null && highlighted.length === sync.length\n ? highlighted\n : sync;\n }, [text, language, highlighted]);\n const [ownWrap, setOwnWrap] = useState(defaultWrap);\n const wrap = wrapProp ?? ownWrap;\n const setWrap = (next: boolean) => {\n if (wrapProp == null) setOwnWrap(next);\n onWrapChange?.(next);\n };\n const [expanded, setExpanded] = useState(false);\n const folds = lines.length > maxLines;\n const scrolling = overflow === \"scroll\" && folds && !expanded;\n const shown =\n overflow === \"expand\" && folds && !expanded\n ? lines.slice(0, maxLines)\n : lines;\n const isEmpty = text === \"\";\n const showExpandToggle =\n overflow === \"scroll\" && expandToggle && folds && !isEmpty;\n const showWrapToggle = wrapToggle && !isEmpty;\n const showCopy = copy && !isEmpty;\n const hasTitle = title != null;\n const builtIns =\n Number(showExpandToggle) + Number(showWrapToggle) + Number(showCopy);\n const hasControls = actions != null || builtIns > 0;\n const copyLabel = typeof title === \"string\" ? title.toLowerCase() : \"code\";\n const scrollLabel = typeof title === \"string\" ? title : \"Code\";\n const expandLabel = expanded\n ? `Collapse to ${maxLines} lines`\n : `Show all ${lines.length} lines`;\n const lineNoDigits = String(Math.max(lines.length, 1)).length;\n const controls = (\n <>\n {actions}\n <Tooltip.Provider>\n {showExpandToggle ? (\n <HeaderToggle\n label={expandLabel}\n pressed={expanded}\n onPressedChange={setExpanded}\n >\n {expanded ? (\n <IconArrowsMinimize aria-hidden />\n ) : (\n <IconArrowsMaximize aria-hidden />\n )}\n </HeaderToggle>\n ) : null}\n {showWrapToggle ? (\n <HeaderToggle\n label=\"Wrap long lines\"\n pressed={wrap}\n onPressedChange={setWrap}\n >\n <IconTextWrap aria-hidden />\n </HeaderToggle>\n ) : null}\n </Tooltip.Provider>\n {showCopy ? (\n <CopyButton value={text} label={copyLabel} size=\"md\" />\n ) : null}\n </>\n );\n const body = (\n <pre\n className={cn(\n \"m-0 min-w-0 py-3 font-mono text-xs leading-5\",\n lineNumbers ? \"pr-3 pl-0\" : \"px-3\",\n // Room for the floating controls on the first lines.\n !hasTitle &&\n FLOATING_ROOM[Math.min(builtIns + (actions != null ? 1 : 0), 3)],\n wrap\n ? \"[overflow-wrap:anywhere] whitespace-pre-wrap\"\n : scrolling\n ? \"w-max min-w-full whitespace-pre\"\n : \"max-w-full overflow-x-auto whitespace-pre\",\n )}\n >\n <CodeLines\n lines={shown}\n lineNumbers={lineNumbers}\n digits={lineNoDigits}\n wrap={wrap}\n />\n </pre>\n );\n return (\n <div\n data-code-block=\"\"\n data-language={language}\n data-overflow={overflow}\n data-highlighted={\n highlighted != null && lines === highlighted ? \"\" : undefined\n }\n className={cn(\n CODE_BLOCK_SURFACE,\n \"relative flex w-full min-w-0 flex-col overflow-hidden\",\n className,\n )}\n {...props}\n >\n {hasTitle ? (\n <div className=\"border-pho-secondary flex min-h-10 items-center gap-2 border-b py-1 pr-1.5 pl-3\">\n <div className=\"text-pho-secondary min-w-0 flex-1 truncate text-xs font-medium\">\n {title}\n </div>\n {controls}\n </div>\n ) : hasControls ? (\n // No title row: the controls float over the corner, on the code\n // surface so scrolled text passes under them.\n <div className=\"bg-pho-code-bg absolute top-1 right-1.5 z-10 flex items-center gap-2 rounded-sm\">\n {controls}\n </div>\n ) : null}\n {isEmpty ? (\n <p className=\"text-pho-description m-0 px-3 py-3 text-base\">{empty}</p>\n ) : scrolling ? (\n <section className=\"min-w-0\">\n <ScrollArea.Root\n fade={false}\n data-code-scroll=\"\"\n className=\"min-w-0 rounded-b-[inherit]\"\n style={{ height: `calc(${maxLines} * ${LINE_H} + ${PAD_Y} * 2)` }}\n >\n <ScrollArea.Viewport tabIndex={0} aria-label={scrollLabel}>\n <ScrollArea.Content>{body}</ScrollArea.Content>\n </ScrollArea.Viewport>\n <ScrollArea.Scrollbar>\n <ScrollArea.Thumb />\n </ScrollArea.Scrollbar>\n {wrap ? null : (\n <ScrollArea.Scrollbar orientation=\"horizontal\">\n <ScrollArea.Thumb />\n </ScrollArea.Scrollbar>\n )}\n </ScrollArea.Root>\n </section>\n ) : (\n body\n )}\n {overflow === \"expand\" && folds ? (\n <div className=\"border-pho-secondary flex items-center border-t px-1.5 py-1\">\n <Button\n variant=\"ghost\"\n size=\"sm\"\n aria-expanded={expanded}\n prefix={expanded ? IconChevronUp : IconChevronDown}\n onClick={() => setExpanded((prev) => !prev)}\n >\n {expanded ? \"Show less\" : `Show all ${lines.length} lines`}\n </Button>\n </div>\n ) : null}\n </div>\n );\n}\n\nCodeBlock.displayName = \"CodeBlock\";\n"],"ignoreList":[0,1,2],"mappings":";;;;;;;;;;;;AASA,IAAMA,KAAa;AAAA,EAAC,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAAiB,KAAO;AAAA,EAAQ,CAAC;AAAA,EAAG,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAAe,KAAO;AAAA,EAAQ,CAAC;AAAA,EAAG,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAAmB,KAAO;AAAA,EAAQ,CAAC;AAAA,EAAG,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAAc,KAAO;AAAA,EAAQ,CAAC;AAAA,EAAG,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAAmB,KAAO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,EAAC,OAAD;AAAA,QAAK,WAAU;AAAA,QACb,UAAA,gBAAAA,EAACuD,IAAD;AAAA,UACE,SAAQ;AAAA,UACR,MAAK;AAAA,UACL,iBAAexB;AAAA,UACf,QAAQA,IAAWyB,KAAgBC;AAAA,UACnC,SAAA,MAAezB,EAAA,CAAa0B,MAAS,CAACA,CAAI;AAAA,UAEzC,UAAA3B,IAAW,cAAc,YAAYhE,EAAM,MAAA;AAAA,QACtC,CAAA;AAAA,MACL,CAAA,IACH;AAAA,IACD;AAAA,E;AAET;AAEA0C,GAAU,cAAc"}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { t as n } from "./cn-CPbhpG1q.js";
|
|
3
|
-
import { t as m } from "./resolve-variant-CcD8iG5l.js";
|
|
4
|
-
import { n as v } from "./use-copy-D6JwKUll.js";
|
|
5
|
-
import { t as y } from "./createReactComponent-yKZn9MIX.js";
|
|
6
|
-
import { t as f } from "./IconCheck-DwSMn1wK.js";
|
|
7
|
-
import "react";
|
|
8
|
-
import { jsx as r, jsxs as g } from "react/jsx-runtime";
|
|
9
|
-
var x = [["path", {
|
|
10
|
-
d: "M7 9.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667l0 -8.666",
|
|
11
|
-
key: "svg-0"
|
|
12
|
-
}], ["path", {
|
|
13
|
-
d: "M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1",
|
|
14
|
-
key: "svg-1"
|
|
15
|
-
}]], b = y("outline", "copy", "Copy", x), C = {
|
|
16
|
-
xs: {
|
|
17
|
-
classes: "size-6 -m-1.25 [&>svg]:size-3.5",
|
|
18
|
-
description: "Extra small — 14px icon; 24px hover wash overflows the title line"
|
|
19
|
-
},
|
|
20
|
-
sm: {
|
|
21
|
-
classes: "size-7 [&>svg]:size-4",
|
|
22
|
-
description: "Small — the default; row cells, panel headers"
|
|
23
|
-
},
|
|
24
|
-
md: {
|
|
25
|
-
classes: "size-8 [&>svg]:size-4",
|
|
26
|
-
description: "Medium — toolbars"
|
|
27
|
-
}
|
|
28
|
-
}, w = "min-w-0 truncate font-mono text-xs text-pho-primary", k = {
|
|
29
|
-
xs: "gap-2",
|
|
30
|
-
sm: "gap-1",
|
|
31
|
-
md: "gap-1"
|
|
32
|
-
}, N = "a, button, input, select, textarea, label";
|
|
33
|
-
function I(e) {
|
|
34
|
-
const o = e.currentTarget, s = e.target.closest(N);
|
|
35
|
-
if (s && o.contains(s)) return;
|
|
36
|
-
const t = window.getSelection();
|
|
37
|
-
t && !t.isCollapsed && o.contains(t.anchorNode) || (e.stopPropagation(), o.querySelector(":scope > [data-copy-button]")?.click());
|
|
38
|
-
}
|
|
39
|
-
function E({ value: e, children: o, label: s = "to clipboard", size: t = "sm", onCopied: p, className: l, onClick: d, ...u }) {
|
|
40
|
-
const { copied: a, copy: h } = v(), i = o != null && o !== !1 && o !== "";
|
|
41
|
-
return /* @__PURE__ */ g("span", {
|
|
42
|
-
onClick: i ? I : void 0,
|
|
43
|
-
className: n("inline-flex overflow-visible", i ? n("group/copy min-w-0 cursor-pointer items-center", k[t]) : "shrink-0"),
|
|
44
|
-
children: [
|
|
45
|
-
i ? /* @__PURE__ */ r("span", {
|
|
46
|
-
"data-copy-view": "",
|
|
47
|
-
className: w,
|
|
48
|
-
children: o
|
|
49
|
-
}) : null,
|
|
50
|
-
/* @__PURE__ */ r("button", {
|
|
51
|
-
type: "button",
|
|
52
|
-
"data-copy-button": "",
|
|
53
|
-
"aria-label": a ? `${s} copied` : `Copy ${s}`,
|
|
54
|
-
"data-copied": a || void 0,
|
|
55
|
-
onClick: async (c) => {
|
|
56
|
-
d?.(c), !c.defaultPrevented && await h(e) && p?.(e);
|
|
57
|
-
},
|
|
58
|
-
className: n("text-pho-secondary outline-pho-brand hover:bg-pho-ghost-hover hover:text-pho-secondary-hover inline-flex shrink-0 cursor-pointer items-center justify-center rounded-sm transition-[color,background-color] duration-100 ease-linear focus-visible:outline-2 focus-visible:outline-offset-2", "data-[copied]:text-pho-success data-[copied]:hover:text-pho-success", i && "text-pho-description group-hover/copy:bg-pho-ghost-hover group-hover/copy:text-pho-secondary-hover", m(C, t), l),
|
|
59
|
-
...u,
|
|
60
|
-
children: a ? /* @__PURE__ */ r(f, { "aria-hidden": !0 }) : /* @__PURE__ */ r(b, { "aria-hidden": !0 })
|
|
61
|
-
}),
|
|
62
|
-
/* @__PURE__ */ r("output", {
|
|
63
|
-
className: "sr-only",
|
|
64
|
-
"aria-live": "polite",
|
|
65
|
-
children: a ? "Copied" : ""
|
|
66
|
-
})
|
|
67
|
-
]
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
E.displayName = "CopyButton";
|
|
71
|
-
export {
|
|
72
|
-
E as n,
|
|
73
|
-
C as t
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
//# sourceMappingURL=copy-button-BLvirhXk.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"copy-button-BLvirhXk.js","names":["cn","resolveVariant","useCopy","createReactComponent","IconCheck","jsx","jsxs","__iconNode","IconCopy","COPY_BUTTON_SIZES","VIEW","VIEW_GAP","INTERACTIVE","pressFromValue","event","root","interactive","selection","CopyButton","value","children","label","size","onCopied","className","onClick","props","copied","copy","shown"],"sources":["../../../../node_modules/.pnpm/@tabler+icons-react@3.49.0_react@19.3.1/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.mjs","../../src/components/copy-button/copy-button.tsx"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.49.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M7 9.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667l0 -8.666\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1\", \"key\": \"svg-1\" }]];\nconst IconCopy = createReactComponent(\"outline\", \"copy\", \"Copy\", __iconNode);\n\nexport { __iconNode, IconCopy as default };\n","import {\n type ButtonHTMLAttributes,\n type MouseEvent,\n type ReactNode,\n type Ref,\n} from \"react\";\nimport { IconCheck, IconCopy } from \"@tabler/icons-react\";\nimport { cn } from \"../../utils/cn\";\nimport { resolveVariant, type VariantMap } from \"../../utils/resolve-variant\";\nimport { useCopy } from \"../../utils/use-copy\";\n\n/**\n * Size axis — a square ghost control that sits inside a row or a panel\n * header. `sm` is the default: a 28px target beside 13px mono text.\n */\nexport const COPY_BUTTON_SIZES = {\n xs: {\n classes: \"size-6 -m-1.25 [&>svg]:size-3.5\",\n description:\n \"Extra small — 14px icon; 24px hover wash overflows the title line\",\n },\n sm: {\n classes: \"size-7 [&>svg]:size-4\",\n description: \"Small — the default; row cells, panel headers\",\n },\n md: {\n classes: \"size-8 [&>svg]:size-4\",\n description: \"Medium — toolbars\",\n },\n} satisfies VariantMap;\n\nexport type CopyButtonSize = keyof typeof COPY_BUTTON_SIZES;\n\ninterface CopyButtonBaseProps {\n /** The text that goes to the clipboard. */\n value: string;\n /**\n * The view of the value, before the button: anything (the id as text,\n * a masked key, a number beside its flag). A click on it copies too,\n * the way a `<label>` presses its control; the button stays the one\n * tab stop and the accessible name. The view sets a default type (the\n * mono face, `xs`, primary ink, one truncating line); what you put in\n * sets its own and wins.\n */\n children?: ReactNode;\n /**\n * What is being copied, for the accessible name — \"request id\",\n * \"API key\". Read as `Copy {label}`, then `{label} copied`.\n * @default \"to clipboard\"\n */\n label?: string;\n /** Size variant. @default \"sm\" */\n size?: CopyButtonSize;\n /** Called after the clipboard write lands. */\n onCopied?: (value: string) => void;\n ref?: Ref<HTMLButtonElement>;\n}\n\nexport interface CopyButtonProps\n extends\n CopyButtonBaseProps,\n Omit<ButtonHTMLAttributes<HTMLButtonElement>, keyof CopyButtonBaseProps> {}\n\n/**\n * The view's default type: the value on one line in the mono face, the\n * loudest ink on its line. Inherited, so content with its own classes\n * overrides it.\n */\nconst VIEW = \"min-w-0 truncate font-mono text-xs text-pho-primary\";\n\n/**\n * View to button. The wash clears the view: `xs` lets its wash overflow\n * its box by 5px, so it sits two steps further out and the wash keeps\n * 3px off the text.\n */\nconst VIEW_GAP: Record<CopyButtonSize, string> = {\n xs: \"gap-2\",\n sm: \"gap-1\",\n md: \"gap-1\",\n};\n\n/** What keeps its own click inside the view. */\nconst INTERACTIVE = \"a, button, input, select, textarea, label\";\n\n/**\n * A click on the view presses the button, so both run the same path\n * (`onClick`, the write, `onCopied`). A link in the view keeps its\n * click, and a drag that selected text is a copy by hand in progress.\n */\nfunction pressFromValue(event: MouseEvent<HTMLSpanElement>) {\n const root = event.currentTarget;\n const interactive = (event.target as Element).closest(INTERACTIVE);\n if (interactive && root.contains(interactive)) return;\n const selection = window.getSelection();\n if (\n selection &&\n !selection.isCollapsed &&\n root.contains(selection.anchorNode)\n )\n return;\n event.stopPropagation();\n root.querySelector<HTMLButtonElement>(\":scope > [data-copy-button]\")?.click();\n}\n\n/**\n * Copy Button — the one copy affordance: a quiet icon button that writes\n * `value` to the clipboard, swaps its glyph to a check for a moment, and\n * says \"Copied\" to assistive tech through a polite live region. Ghost at\n * rest so a mono value stays the loudest thing on its line; the wash and\n * the ink lift on hover. Pass a view of the value as `children` and it\n * renders before the button, a click target too; the glyph then rests in\n * description ink, and the wash lifts over either.\n */\nexport function CopyButton({\n value,\n children,\n label = \"to clipboard\",\n size = \"sm\",\n onCopied,\n className,\n onClick,\n ...props\n}: CopyButtonProps) {\n const { copied, copy } = useCopy();\n const shown = children != null && children !== false && children !== \"\";\n return (\n // A pointer shortcut, like a <label>: keys and assistive tech reach\n // the button inside, which is the control.\n // oxlint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions\n <span\n onClick={shown ? pressFromValue : undefined}\n className={cn(\n \"inline-flex overflow-visible\",\n shown\n ? cn(\"group/copy min-w-0 cursor-pointer items-center\", VIEW_GAP[size])\n : \"shrink-0\",\n )}\n >\n {shown ? (\n <span data-copy-view=\"\" className={VIEW}>\n {children}\n </span>\n ) : null}\n <button\n type=\"button\"\n data-copy-button=\"\"\n aria-label={copied ? `${label} copied` : `Copy ${label}`}\n data-copied={copied || undefined}\n onClick={async (event) => {\n onClick?.(event);\n if (event.defaultPrevented) return;\n if (await copy(value)) onCopied?.(value);\n }}\n className={cn(\n \"text-pho-secondary outline-pho-brand hover:bg-pho-ghost-hover hover:text-pho-secondary-hover inline-flex shrink-0 cursor-pointer items-center justify-center rounded-sm transition-[color,background-color] duration-100 ease-linear focus-visible:outline-2 focus-visible:outline-offset-2\",\n \"data-[copied]:text-pho-success data-[copied]:hover:text-pho-success\",\n // With a view the glyph rests in the quietest ink, never louder\n // than the value it copies; the pointer on either lifts it.\n shown &&\n \"text-pho-description group-hover/copy:bg-pho-ghost-hover group-hover/copy:text-pho-secondary-hover\",\n resolveVariant(COPY_BUTTON_SIZES, size),\n className,\n )}\n {...props}\n >\n {copied ? <IconCheck aria-hidden /> : <IconCopy aria-hidden />}\n </button>\n <output className=\"sr-only\" aria-live=\"polite\">\n {copied ? \"Copied\" : \"\"}\n </output>\n </span>\n );\n}\n\nCopyButton.displayName = \"CopyButton\";\n"],"ignoreList":[0],"mappings":";;;;;;;;AASA,IAAMO,IAAa,CAAC,CAAC,QAAQ;AAAA,EAAE,GAAK;AAAA,EAAoK,KAAO;AAAQ,CAAC,GAAG,CAAC,QAAQ;AAAA,EAAE,GAAK;AAAA,EAAiG,KAAO;AAAQ,CAAC,CAAC,GACvVC,IAAWL,EAAqB,WAA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